Results 1 to 6 of 6
  1. #1

    Question Gettting itemName when subscibing to itemGroup

    Hi,

    I can't seem to find in the docs a way to extract item name of an update, when client subscribed to an itemGroup only (MERGE mode).

    The set of item names in the group is returned from custom MetadataAdapter (using ARI protocol) to the LS server, using getItems() method, so how is this set available in the client?

    BR,
    Dejan Milosevic

  2. #2
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    539
    Hi Dejan,

    I confirm you that if a Subscription was initialized using an "Item Group" then it is not possible to extract the Item names from the update received by the client.

    If the map "Item Group" -> "Item list" is static you can directly use the list at the time of subscription.
    But, if it is dynamic, and therefore the intervention of the Metadata Adapter is required, a possible option to get the list of Item names, is to add a new Item (or a new field to an existing Item) which contains itself the list of names extracted from getItems().

    Regards,
    Giuseppe

  3. #3
    Hi,

    That's really strange, I see no point in having the option to subscribe to item group, since updates received on it will be useless without item list (and if client does have the exact item list, he can subscribe using that).

    Anyway, tnx for the reply, we'll have to use another item or field as you suggested.

    BR,
    Dejan

  4. #4
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    539
    Hi Dejan,

    Please consider that the Item Group (and similar the Schema for the field list) was originally introduced with the aim to save band, in the request sent from client to server, and time, to the client developers, in the cases where very long lists, even of several hundreds, of Items (or fields) were involved.
    In those cases we assumed that the client was aware of the composition of the list, which was static, and could map internally the position returned in the updates with the actual Item.

    However, in cases of dynamic lists, we are aware that the lack of meta-information on the actual composition of the lists is very annoying.
    And that is why we are considering whether to add the feature in the future.

    Regards,
    Giuseppe

  5. #5
    Administrator
    Join Date
    Feb 2012
    Location
    Milano
    Posts
    539
    Hi Dejan,

    Please let me add a further consideration.

    If the list of items is determined on the server side, another option that you might consider is to change the subscription mode from MERGE to COMMAND.
    In particular with the "two-level push", please refer to this demo, the list of Items can also dynamically change while the subscription is active, and the key field of the COMMAND mode will automatically provide you with the name of each Item.

    Regards,
    Giuseppe

  6. #6
    Hi,

    Tnx for the suggestion. We've considered using COMMAND mode before, but it seems a bit easier to just send the item name in a separate field, while keeping the MERGE mode (which is similar to what key field would do in COMMAND mode). Our item list will be constant for the duration of subscription so there's no need for add/delete commands, only update.

    BR,
    Dejan

 

 

Similar Threads

  1. Replies: 1
    Last Post: April 18th, 2014, 08:59 AM
  2. Uniqueness of Itemname
    By LS_Developer in forum Adapter APIs
    Replies: 1
    Last Post: June 10th, 2011, 05:21 PM

Tags for this Thread

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 06:43 AM.