Results 1 to 3 of 3
  1. #1

    Command mode second level item key uniqueness

    Are there any links between the primary and secondary levels of a subscription in Command mode?

    Lets say the requirement is subscribing to all the cities population by state level.

    So there is a Command subscription for the state.
    connected to that subscription is a second level subscription for city key and a population field.

    In the event that a multiple states can have cities with the same name, is there a link between the secondary and primary subscriptions ie the secondary connection knows we are only talking about one state... Or does the secondary subscription need a complex key of the state.city?

  2. #2
    Senior Member
    Join Date
    Feb 2013
    Posts
    54
    Hi,

    In the "two-level push", the Data Adapter of the second level is actually independent from the Data Adapter of the first level.
    The second level adapter is in fact a Data Adapter on its own, and does not need to be related to the first level Data Adapter.
    It is only the first level Data Adapter which needs to know the ItemNames of the second level Data Adapter, in order to manage the list of "keys" referring to the second level ItemNames.
    For example, you may have a Data Adapter which publishes the data of the population for each city. Each city is identified by an ItemName and this IteemName must be unique.
    So, if you have two distinct cities with the same name, you cannot use the name of the city as ItemName, but you have to relay on a unique city identifier. A unique city id may be something like state.city, stated there cannot be two cities with the same name in the same state, or can be any other type of id.
    The first level Data Adapter publishes for each list, also identified by a unique ItemName which in our example can be the state name, the commands that indicate how to progressively modify a list of cities.
    Each published ItemEvent of the first level Data Adapter has two field: the “key” field containing the key that unequivocally identifies the Item of the second level Data Adapter, i.e. the city id, and the “command” field containing the command value “ADD”, “UPDATE” or “DELETE”.
    You can find more info in "General Concepts", and look at the Portfolio Demo as an example of "two-level push", and the source code of the Portfolio Demo HTML Client on GitHub.

    hth,
    Marco

  3. #3
    Thank you Marco for the clarification.

 

 

Similar Threads

  1. Hundreds of Ajax request per second on our website
    By Daniel Mihalko in forum Client APIs
    Replies: 1
    Last Post: July 29th, 2013, 10:22 AM
  2. Uniqueness of Itemname
    By LS_Developer in forum Adapter APIs
    Replies: 1
    Last Post: June 10th, 2011, 05:21 PM
  3. Replies: 1
    Last Post: March 11th, 2010, 03:53 PM
  4. Replies: 1
    Last Post: August 20th, 2009, 08:47 AM
  5. "item already contains key" message
    By ddhanis in forum Adapter APIs
    Replies: 1
    Last Post: December 6th, 2007, 08:50 AM

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 04:26 PM.