The EMConnectionManager
is a shared interface for requesting and receiving data from an Endeca Assembler. It uses the interface of the EMAssemblerConnection
in the iOS-rest-client project to submit actions to the assembler. The EMAssemblerConnection
returns a response object which has been parsed into NSObjects
of type NSDictionary
, and NSArray
. The EMConnectionManager
passes the NSObjects
through to its delegate in the connection:didReceiveResponseObject
: method. Typically, this delegate is the EMAssemblerViewController
, which is discussed in the following section.
Connecting EMConnectionManager to your Running Assembler Instance
The EMConnectionManager
uses the settings in the MobileCommerce-Info.plist
for ATG_REST_SERVER_HOST
, ATG_REST_SERVER_PORT
and ENDECA_CONTEXT_PATH
. You will need to edit these values to match those in your environment.
Interface
//Submit an action to the assembler and designate a call back - (void)submitAction:(EMAction *)pAction withDelegate:(id<EMConnectionManagerDelegate>)pDelegate //Constructor override extension point - (id)initWithHost:(NSString*)pHost port:(NSInteger)pPort contextPath:(NSString*)pContextPath urlBuilder:(EMAssemblerConnectionURLBuilder*) pURLBuilder; //sharedManager will return the default config as defined in the applications //plist //use constructor override if you wish to do something else + (EMConnectionManager *)sharedManager;
Delegate
- (void)connection:(EMAssemblerConnection *)pConnection willSubmitAction:(EMAction *)pAction; - (void)connection:(EMAssemblerConnection *)pConnection didSubmitAction:(EMAction *)pAction; - (void)connection:(EMAssemblerConnection *)pConnection didReceiveResponseObject:(id)pResponseObject; - (void)connection:(EMAssemblerConnection *)pConnection didFailWithError:(NSError *)pError;