The application launches and makes a request for the home page:

http://localhost:8080/crs/mobile/browse/?format=json

and the following JSON response is returned to the EMConnectionManager:

{

    "auditContents": "[{\"@type\":\"MobilePage\",\"endeca.internal.created.by\":\"admin\",\"rule.msg\":\"User trigger not satisfied\",\"endeca.internal.last.modified.by\":\"admin\",\"rule.msgcode\":\"14\",\"rule.state\":\"considered\",\"endeca.internal.resource.path\":\"\\/sites-live\\/CRS\\/content\\/Mobile\\/Web Browse Pages\\/Category Page\",\"endeca.internal.workflow.state\":\"ACTIVE\",\"type\":\"DGraph.MerchDebug\",\"Title\":\"Category Page\",\"rule.id\":\"6\",\"endeca.internal.last.modified\":\"2013-02-18T10:44\",\"endeca.internal.date.created\":\"2013-02-18T10:44\",\"Zone\":\"\\/content\\/Mobile\\/Web Browse Pages\"}\n,{\"@type\":\"MobilePage\",\"endeca.internal.created.by\":\"admin\",\"rule.msg\":\"Fired\",\"endeca.internal.last.modified.by\":\"admin\",\"rule.msgcode\":\"13\",\"rule.state\":\"fired\",\"endeca.internal.resource.path\":\"\\/sites-live\\/CRS\\/content\\/Mobile\\/Web Browse Pages\\/Default Browse Page\",\"endeca.internal.workflow.state\":\"ACTIVE\",\"type\":\"DGraph.MerchDebug\",\"Title\":\"Default Browse Page\",\"rule.id\":\"7\",\"endeca.internal.last.modified\":\"2013-02-18T10:44\",\"endeca.internal.date.created\":\"2013-02-18T10:44\",\"Zone\":\"\\/content\\/Mobile\\/Web Browse Pages\"}\n]\n",
    "previewModuleUrl": "http://localhost:8080/preview",
    "contents": [
        {

            "SecondaryContent": [
                {
                    "removeAllAction": { … },
                    "refinementCrumbs": [ ],
                    "displayNamePropertyAlias": "displayName",
                    "geoFilterCrumb": null,
                    "@type": "Breadcrumbs",
                    "name": "Breadcrumbs",
                    "searchCrumbs": [ ],
                    "rangeFilterCrumbs": [ … ],
                    "displayNameProperty": "displayName_en"
                },
                { … }
            ],
            "@type": "MobilePage",
            "name": "MobilePage",
            "MainContent": [
                {
                    "@type": "SearchAdjustments",
                    "name": "Search Adjustments"
                },
                { … }
            ]
        }
    ],
    "@type": "PageSlot",
    "name": "Mobile Browse Page Slot",
    "endeca:contentPath": "/mobile/browse",
    "atg:currentSiteProductionURL": "/crs/storeus",
    "ruleLimit": "1",
    "endeca:siteRootPath": "/pages",
    "contentCollection": "/content/Mobile/Web Browse Pages"

}
JSON Response

The JSON response is received by the EMConnectionManager and passed through to its delegate, an EMAssemblerViewController. The EMAssemblerViewController parses the object into an EMContentItem:

//The default Assembler View Controller uses an EMJSONParser for this parsing
//which utilizes introspection to determine how to construct Objective-C classes.
//If you want to override the default parsing behavior subclass the EMJSONParser //and
//override the dataObjectClassForClass: and contentItemClassForType: methods

- (EMContentItem *)parseResponseObject:(id)pResponseObject;

The EMContentItem constructs a series of EMContentItemAdaptors which are stored and managed by the EMAdaptorManager.

//This is a recursive function. It utilizes a factory to construct a content item //adaptor for each content item it finds. If there is no specific implementation //for an adaptor it
//constructs the default EMContentItemAdaptor. The resulting EMContentItemAdaptors //are stored on the EMAdaptorManager. If you wish to override the factory //construction you should subclass the EMAdaptorManager and implement your own //logic in the adaptorForContentItem:controller: method
- (void)constructAdaptorForContentItem:(EMContentItem *)pContentItem withController:(EMAssemblerViewController *)pController;

The EMAdaptorManager uses the list of EMContentItemAdaptors to inform an EMAssemblerViewControllers view's layout. In response, the following EMContentItems for which an adaptor are constructed:

Each content item is individually managed via a specific EMContentItemAdaptor. The EMAssemblerViewController uses view(UICollectionView) to query the EMAdaptorManager for the following information:

typedef void (^block)(void);

The EMAssemblerViewController automatically runs/removes blocks in the queue, and viewWillAppearBlockQueue in the standard UIViewController uses the viewWillAppear method, and dataReadyBlockQueue in the Assembler view controller's dataReady method which is called when the collection view is ready to be displayed in view.


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