- Inherits From:
- NSObject
- Declared In:
- MultiParser.h
The MultiParser communicates with the tool that uses it by notification rather than directly invoking methods like a LoadBroker does, since it's not tied as tightly.
A concurrent search is invoked with startNewSearchWithInputs.
To support loading of the next set of results, each parsing dictionary should scan out a string with the key "next_results" to be placed at the top level sequence. The method loadMoreResults uses these values to load all the "next" pages for circumstances where there are subsequent results pages, as is often found on web searches.
Synopsis:
NSString *MultiParserNewResultsNotification;
NSString *MultiParserDoneLoading;
NSString *MultiParserStillLoading;
NSString *MultiParserMoreResults;
NSString *MultiParserResultCount;
NSString *MultiParserPreferencesKey;
NSString *MultiParserPreferencesChanged;
NSArray *mIdentifier;
NSDictionary *mParsingDicts;
NSMutableArray *mResultArray;
NSMutableDictionary *mNextPageURLs;
NSString *mPreferencesKey;
NSString *mFolder;
NSInvocation *mFilterInvocation;
ParseManager *mParseManager;
NSProgressIndicator *mProgress;
mIdentifier No description. mParsingDicts No description. mResultArray No description. mNextPageURLs No description. mPreferencesKey No description. mFolder No description. mFilterInvocation No description. mParseManager No description. mProgress No description.
- - initWithFolder:progress:fromBundle:
- - initWithFolder:progress:fromBundle:prefKey:
- - addHomePagesToDictionary:
- - loadMoreResults
- - stopLoading
- - resultArray
- - setFilterSelector:target:
- - startNewSearchWithInputs:
- - startNewSearchWithInputs:parsingDicts:
- - folder
- - dictionaryOfIdentifiersForPages
- - preferencesKey
- - parsingDicts
- - translateUserInputs:withParsingDict:
- (void)addHomePagesToDictionary:(NSMutableDictionary *)inDict
No method description.
- (NSDictionary *)dictionaryOfIdentifiersForPages
Return a dictionary with the names as the keys and the identifiers (the plist names) as the values
- (NSString *)folder
Return the folder name associated with this; it should be a human-readable name.
- (id)initWithFolder:(NSString *)inFolder progress:(NSProgressIndicator *)inProgress fromBundle:(NSBundle *)inBundle
Initialize, given the subdirectory inFolder to search for parsing dictionaries, the progress indicator to use, and the bundle that corresponds to this; use the default key for indicating how preferences are stored.
- (id)initWithFolder:(NSString *)inFolder progress:(NSProgressIndicator *)inProgress fromBundle:(NSBundle *)inBundle prefKey:(NSString *)inPrefKey
Initialize, given the subdirectory inFolder to search for parsing dictionaries, the progress indicator to use, the bundle that corresponds to this, and the given key for storing preferences. The bundle identifier will be used to indicate the subdirectory that any externally loaded parsing dictionaries will be found.
- (void)loadMoreResults
Load the next pages of results, as specified in the "next_results" values.
- (NSDictionary *)parsingDicts
Return the dictionary of parsing dictionaries; allows tools not actually doing the multiparsing to still use MultiParser to load and organize the dictionaries.
- (NSString *)preferencesKey
Return the string that is used in NSUserDefaults for storing settings related to this MultiParser.
- (NSMutableArray *)resultArray
Return the resulting array of dictionaries after a load.
- (void)setFilterSelector:(SEL)inSelector target:(id)inTarget
Set the method to be invoked to determine if a new record should be added to the result list. This is useful for weeding out duplicates, since multiple sites will be invoked. The selector is for a method like - (BOOL) canAddRecord:(NSDictionary *)inRecord. If not specified, no filtering will occur.
- (void)startNewSearchWithInputs:(NSDictionary *)inInputs
Begin a new search. The dictionary of inputs are in a canonical form; the corresponding inputs to each request is stored at the top level of each parse dictionary. Only the sites checked in the user interface, out of all possible sites, are invoked.
- (void)startNewSearchWithInputs:(NSDictionary *)inInputs parsingDicts:(NSDictionary *)inParsingDicts
Begin a new search as above, using only the supplied dictionary of parsing dicts (and further filtered by user settings). This is useful if the client wants to choose which parsing dicts to use first, based on other factors.
- (void)stopLoading
Stop loading of all pages.
- (NSDictionary *)translateUserInputs:(NSDictionary *)inUserInputs withParsingDict:(NSDictionary *)inParsingDict
Convert the "meta" input names found in the parsing dictionary to the real inputs needed by the search engine.