Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Member
    Join Date
    Nov 2007
    Location
    Shanghai
    Posts
    5

    Question Can I receive the original data?

    Hi,

    In my assumption, I want to directly receive the data from server without throught the Table. That is to say, I just want to handle the original data from sever and undefine the schema and group. Is this a logical assumption? If yes, how can I capture the server map data without the schema and group?

    I puerilely wrote the following test code:

    /////////////////////////////////////////////////////////////////////
    var myTable = new NonVisualTable("","","MERGE");//Empty the group and schema
    myTable.setSnapshotRequired(true);
    myTable.onItemUpdate = function(item, itemUpdate) {
    ......
    }
    lsPage.addTable(myTable,"test");
    /////////////////////////////////////////////////////////////////////

    The test result is failed as my forecast.

    Is there any other ways for this assumption?

    Thanks for any ideas!

    Best Regards,
    Johnny Yau

  2. #2
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    The items and fields related to a table are decided server side by the MetadataProvider.
    When you subscribe a table you're not sending to the server item and field names, but a group name and a schema name.
    Usually group and schema names are composed by space-separated item and field names. This special case is handled by the LiteralBasedProvider that is a MetadataProvider implementation distributed with the server.
    If you implement your own MetadataProvider class (maybe extending an existing one)
    you can completely change this logic implementing two methods: getItems and getSchema.

    Look the following example. I will use "ALL" as group name and I will be returned with the 30 items of the StockListDemo.

    First I change the adapters.xml file of the classic StockListDemo as follows (note that the only difference is the metadata_provider class name:


    This is the AllMetaExampleimplementation:


    and finally a simple client:


    Note that once you give to the Table constructor a String instead of an Array (as in this case) you can't no more acces items by name but you must handle item indexes.
    Some useful links:
    http://www.lightstreamer.com/docs/client_web_jsdoc/Table.html#Table()
    http://www.lightstreamer.com/docs/cl...eItemInfo.html
    http://www.lightstreamer.com/vb/show...lBasedProvider

    Please check the FileBasedProvider before starting implement your own MetadataProvider. Maybe it already fit your needs.

    Hope that helps.

  3. #3
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    PS: the null passed as group and/or schema name does not mean to give to you everything, but means "get the item and field names from the html template that will contain the updates". Obviously this is not possible with a NonVisualTable and is suitable only for LiteralBasedProvider-like MetadataAdapters.

  4. #4
    Member
    Join Date
    Nov 2007
    Location
    Shanghai
    Posts
    5
    Hi Mone,

    Thanks for your help.

    I have took a look for here http://www.lightstreamer.com/vb/show...lBasedProvider.

    In my project, I want use NonVisualTable like that but pass null as group and/or schema name. It sounds like wishful thinking

  5. #5
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    sorry, but I don't understand why you want to use null as schema and group name.
    Isn't my example suitable for your needs?

  6. #6
    Member
    Join Date
    Nov 2007
    Location
    Shanghai
    Posts
    5
    My project tearm have choosen the push technology - pushlet before I join. Now the performance is not suitable for the customer requirements. So we focus on the lightstreamer. But the pushlet web client development have been completed. I want to establish an adapter between pushlet and lightstreamer. I have completed the server-side codes, but broken by the group and schema. If can pass null as group and schema name on NonVisualTable, I will finish the switch workload and suggest to purchase the commercial edition lightstreamer. Of course, I also can suggest for project term to rewrite the client codes. I think it is not a very difficult matter

    Thanks for your useful help. I have got a short cut for the lightstreamer.

    cheers

  7. #7
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    Ok, I understand,
    but just customizing the MetadataProvider and use a custom string instead of the null value should not be a big change unless you already have a custom MetadataProvider incompatible with such approach.

    Let me know if you need further info.

  8. #8
    Member
    Join Date
    Nov 2007
    Location
    Shanghai
    Posts
    5
    I fixed it by passing a constant string as group and schema name!

    Can the lightstreamer server push data to the appointed client that known by the DataProvider? And is there a clientid to identify the client connection?

    Thanks!

  9. #9
    Power Member
    Join Date
    Jul 2006
    Location
    Cesano Maderno, Italy
    Posts
    784
    Hello,

    Please take a look to these threads:
    http://www.lightstreamer.com/vb/showthread.php?t=61
    http://www.lightstreamer.com/vb/showthread.php?t=51

    Maybe even this thread can be useful: http://www.lightstreamer.com/vb/showthread.php?t=65

    Hope that helps.

    PS: Please try to place your questions in the right section (e.g.: Lightstreamer Adapter Development ). Avoid to continue a thread with a different topic. Thank you.

  10. #10
    Senior Member
    Join Date
    Jul 2009
    Location
    not
    Posts
    41
    Hi everybody.
    Please, in the case where i have this in AllMetaExample
    Code:
    public class AllMetaExample extends LiteralBasedProvider {
    
        private static String[] completeList;
        
        static {
                completeList[] = geFromDB();
        }
    
        private String[] geFromDB(){
                 .........
        }
    }
    So, how can i know the number of elements that i will be subscribed to from the client ?
    What will i put in this HTML line:

    Code:
                for (var i = 1; i <= ???; i++) {
    Or should i use a DynaScrollTable ? Or can i still use OverwriteTable ?

 

 

Similar Threads

  1. Client receive old data after some time.
    By mnenchev in forum General
    Replies: 3
    Last Post: November 25th, 2009, 03:27 PM

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 12:33 PM.