Results 1 to 10 of 12

Hybrid View

  1. #1
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,091
    As your XML file has a simple tabular structure, you can easily fit your data into the items/fields concepts used in Lightstreamer.
    What you can associate to the concept of "item" depends on what your front-end page is aimed at representing.
    Does your page explicitly mention each single match, so that you only need to decorate the match data with the current result?
    Or does the page contain a table which just lists the current matches, so that new matches could even enter the table dynamically as they start?
    The behavior of the page and the identification of what is a data "item" is a precondition for designing the Data Adapter.

  2. #2
    Member
    Join Date
    Apr 2010
    Location
    Everett
    Posts
    6
    Here is what I have for my front-end.

    <html>
    <head>
    <title></title>
    <link rel="stylesheet" type="text/css" href="style.css" />
    <script language="JavaScript" src="LS/lscommons.js"></script>
    <script language="JavaScript" src="LS/lspushpage.js"></script>

    </head>

    <body>
    <div source="lightstreamer" table="hellotable" item="greetings" field="away">loading...</div>
    <div source="lightstreamer" table="hellotable" item="greetings" field="home">loading...</div>
    <div source="lightstreamer" table="hellotable" item="greetings" field="score">loading...</div>
    <div source="lightstreamer" table="hellotable" item="greetings" field="inning">loading...</div>
    <div source="lightstreamer" table="hellotable" item="greetings" field="timestamp">loading...</div>

    <script type="text/javascript">
    var page = new PushPage();
    page.onEngineCreation = function(engine) {
    engine.connection.setAdapterName("HELLOWORLD");
    engine.changeStatus("STREAMING");
    }
    page.bind();
    page.createEngine("HelloWorldApp", "LS", "SHARE_SESSION");

    var pushtable = new OverwriteTable(null, null, "MERGE");
    page.addTable(pushtable, "hellotable");
    </script>
    </body>
    </html>
    I'm just learning Java and Lightstreamer and that is why I'm having this basic problem.

  3. #3
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,091
    You have a page that only has the place for displaying one match result.
    However, your source XML file is supposed to contain a list of match results.

    What, in your intentions, should the page show?
    One of the results included in the XML file?
    All the results included in the XML file in round, so that each result is displayed for a few seconds?

    Or is your real intention that of showing a table which reports all the results (so that you would need to extend your page)?

  4. #4
    Member
    Join Date
    Apr 2010
    Location
    Everett
    Posts
    6
    I want my page to show all of my matches. I was looking at another example and they used an array. I figure that is what I should use. I'm just not sure on how to code it?

  5. #5
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,091
    You have usually two options for displaying a set of matches
    and again it all depends on your data.
    1) you are managing a fixed set of matches, say 10 matches, and your page already includes static contents regarding those 10 matches.
    2) you want to list whatever matches are currently available and your page, in its static part, has no knowledge of the available matches.

  6. #6
    Member
    Join Date
    Apr 2010
    Location
    Everett
    Posts
    6
    Yes I want to list whatever matches are currently available, in its static part, has no knowledge of the available matches.

  7. #7
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    hi,

    so what you need is to implement something similar to our PortfolioDemo.

    Such demo is based on the MultiMetapush logic. There is a main item that in our case gives a list of stocks but in yours will give a list of matches and then each match will be related to its own item that supplies the updates related to such match.

    We used two different data adapters to differentiate the kind of data sent. The main item is supplied by the PortfolioAdapter while the sub-items are supplied by the StockListDemo adapter.
    Note that our main item is governed by client requests while yours will read its data from your XML. To receive orders from clients we needed to implement a custom metadata adapter, you'll probably can use the same metadata adapter of the hello world demo (LiteralBasedProvider)

    You can find the sources and explanation of both data adapters in our distribution under DOCS-SDKs/sdk_adapter_java/examples/Portfolio_Adapters and DOCS-SDKs/sdk_adapter_java/examples/StockListDemo_DataAdapter

    HTH

 

 

Similar Threads

  1. Replies: 4
    Last Post: February 3rd, 2011, 10:33 AM
  2. How to debug .NET DataAdapter
    By msgiribabu in forum Adapter SDKs
    Replies: 1
    Last Post: January 21st, 2011, 01:38 PM
  3. DataAdapter Service
    By brucehoch in forum Adapter SDKs
    Replies: 3
    Last Post: October 14th, 2010, 11:22 PM
  4. DataAdapter using XML
    By amarin in forum Adapter SDKs
    Replies: 4
    Last Post: August 21st, 2008, 09:23 AM
  5. Pre-Processor Snapshot vs DataAdapter Snapshot
    By sukhdev in forum Adapter SDKs
    Replies: 3
    Last Post: August 1st, 2007, 08:44 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 10:33 AM.