Autocomplete plug-ins receive incomplete item’s data from Hunter Suite and should search over the net to complete it
To begin the development of your own plug-in you can download the sample project.
An autocomplete plug-in need to be an application (.bundle).
The bundle must contain the code of your plug-in compiled as a command line application.
The info dictionary (Info.plist) of your bundle must have the following keys used by Hunter Suite
- HSPluginName the name of your plug-in. Used to present the plug-in to the user.
- HSPluginType the type of hunter suite plug-in. The value for autocomplete plug-ins is: Autocomplete
- Creator (optional) your name or nick name. This value will be displayed in the plug-ins manager as Creator of plug-in.
- CFBundleVersion version of your plug-in. This values is used by plug-in manager to display plug-in update. Current version of plug-in manger check the version code as a String comparison. And this choice could create some problem with version code (for example 1.10 is an older version than 1.9).
- HSExecutableName: The name of the application contained in the bundle
- HSAdditionalPlugInArguments: (optional) An array of string. You plug-in will be invoked with the content of this array as parameters.
HSAutocomplete
For the development of autocomplete plug-ins the SDK provide the class HSAutocomplete.
Method of this class:
- (id)init;This method will initialize the class and read task parameters passed by the hunter suite. The parameters read will identify what is the calling application of your plug-in.
-(NSXMLElement *)itemToComplete; This method returns the NSXMLElement of the item you need to complete.
- (void)addResult:(NSXMLElement*)aResult; This method will add an XMLElement to the results array, that will be sent to Hunter Suite
- (void)writeResultsAndEraseTempFiles; You need to call this function before quitting the plug-ins, the function will write all the results in the xml file read by the Hunter Suite
- (NSUInteger)numberOfResultItems; This methos returns the number of items currently present in the result array.
- (NSString*)mainEntityName;This method return the name of the main element for the calling application.
(Film for Dvd Hunter, Game for Game Hunter, Book for Book Hunter)
- (NSString*)voteRatingFor:(unsigned int)value;This method will create the string for the VoteRating field of an item.
The value should be less or equal than 5. Greater values will create a sting with 5 stars.
-(HunterApplication) callingApplication;return the code of application who launched the plug-in
- (NSArray *)additionalPlugInArguments; return the array containing all the arguments of plug-in task
