Guided Search classes are handled differently than Oracle Commerce classes. If you make a Guided Search 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. Oracle Commerce responses are not attributed so they are not used for Oracle Commerce-related parsing. Since the default impl is not Guided Search-specific there is a ‘typed’ version called EMJSONParse which knows how to handle the Guided Search-style attribution (@class @type). In cases that you would want to override the EMJSONParser to change the default Guided Search parsing behavior, you can extend it using a subclass such as ATGJSONParser. The following section shows a typical Guided Search page flow.

AssemblerViewController - Fetch Page

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

Note: Action as used in the previous sentence has a specific meaning within Guided Search. One example of an action in this context is a Refinement. For example, in the Refinement menu ContentItem, there is an action for applying a refinement for a given dimension, for example, 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/ATGJSONParser class hierarchy.

The 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 Oracle Commerce, the class construction leverages the same NSObject category for setting property values. Note that NSObject+ATGRestAdditions uses the method objectFromDictionary.

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


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