Endeca classes are handled differently than ATG classes. If you make an Endeca request, CRS-IUA makes very few assumptions about the return type, just that it returns valid JSON which has been attributed to support reflection, for example:

(@item:price)

The JSONParser iterates over the JSON object and searches for attributed properties. If it finds an attribute it asks its delegate what type of class it should construct for the current object. This class is generic in its handling of attributed properties so that it may eventually be used for ATG. ATG responses are not attributed so they are not used for ATG-related parsing. Since the default impl is not Endeca-specific there is a 'typed' version called EMJSONParse which knows how to handle the Endeca-style attribution (@class @type). In cases that you would want to override the EMJSONParser to change the default Endeca parsing behavior, you can extend using a subclass such as CommerceJSONParser. The following section shows a typical Endeca page flow.

AssemblerViewController - Fetch Page

AssemblerViewController requests an Endeca page for an action, and then Endeca returns a JSON object to the AssemblerViewController.

Note: “Action” as used in the previous sentence has a specific meaning within Endeca. One example of an action in this context would be a Refinement. For example, in the Refinement menu ContentItem, there is an action for applying a refinement for a given dimension, say color: blue.

The AssemblerViewController creates an EMContentItem from the JSON object. The transformation of the JSON object into an EMContentItem exists within the JSONParser/EMJSONParser/CommerceJSONParser class hierarchy.

In normal situations, JSONParser finds @class and @type, it delegates to EMJSONParser which performs a lookup based on value for attribute and suggests a class to construct. Similar to the same function in ATG, the class construction leverages the same NSObject category for setting property values. Note that NSObject+ATGRestAdditions uses the method

objectFromDictionary

The EMContentItem is then paired with an adaptor to construct the view.


Copyright © 1997, 2013 Oracle and/or its affiliates. All rights reserved. Legal Notices