CatNiP docutest
Sähköinen nuottikirja, HY-TKTKL-OHTUPROJ KESÄ11
|
Encapsulates a MediaWiki API category query. More...
#import <MediaWikiCategoryQuery.h>
Public Member Functions | |
(NSString *) | - _buildGetParams |
A private worker method that does the actual GET parameter building work. | |
(NSString *) | - buildQueryURL [implementation] |
Overrides the default MediaWikiQuery buildQueryURL method to append the GET parameters into the URL. | |
(void) | - didReceiveMediaWikiData: [implementation] |
MediaWikiQueryDelegate method implementation. | |
(id) | - init [implementation] |
Base init method for MediaWikiCategoryQuery objects. | |
(void) | - parseCategoryXML: |
Launch method for parsing the XML data from a NSData object. | |
(void) | - parser:didStartElement:namespaceURI:qualifiedName:attributes: |
NSXMLParserDelegate method implementation. | |
(void) | - parser:parseErrorOccurred: |
NSXMLParserDelegate method implementation. | |
(void) | - parser:validationErrorOccurred: |
NSXMLParserDelegate method implementation. | |
(void) | - parserDidEndDocument: |
NSXMLParserDelegate method implementation. | |
(void) | - parserDidStartDocument: |
NSXMLParserDelegate method implementation. | |
(void) | - setCategoryName: [implementation] |
(void) | - setChunkSize: [implementation] |
(void) | - setReturnFormat: [implementation] |
(void) | - setWikiAction: [implementation] |
Static Public Member Functions | |
(MediaWikiCategoryQuery *) | + newCategoryQuery:delegate: |
Builds a MediaWikiCategoryQuery and returns it. | |
Properties | |
id < MediaWikiCategoryQueryDelegate > | categoryDelegate |
The delegate to pass read categories and any error messages to. | |
NSString * | categoryName |
Defines the category name for a category contents query. | |
NSString * | chunkSize |
Defines the chunk size to be read from the MediaWiki when doing a category contents query, ie. | |
NSString * | continueFrom |
A property specifying the beginning point for the next category contents query. | |
NSMutableDictionary * | parameters |
A dictionary object that holds the parameter data. | |
NSString * | returnFormat |
Defines the return format for this MediaWiki API query. | |
NSString * | wikiAction |
Defines the action parameter for this MediaWiki API query. | |
NSString * | wikiQuery |
Defines the query subtype. | |
NSArray * | wikiQueryPageIds |
MediaWiki API parameter that accepts a comma-delimeted list of wiki page ids as the set to query for eg. | |
NSArray * | wikiQueryTitles |
MediaWiki API parameter that accepts a comma-delimeted list of wiki page titles as the set to query for eg. | |
NSString * | wikiQueryType |
Defines the wiki query type. |
Encapsulates a MediaWiki API category query.
Currently only supports the xml format, and will try to parse the received data even if you manually set the format property to whatever.
Used by the IMSLPQueryHelper to handle category queries to the IMSLP site.
Created by Antti V J Niemela, tkol on 5/24/11. Copyright 2011 University of Helsinki. All rights reserved.
- (NSString *) _buildGetParams |
A private worker method that does the actual GET parameter building work.
Returns the GET parameters as a NSString object.
- (NSString *) buildQueryURL | [implementation] |
Overrides the default MediaWikiQuery buildQueryURL method to append the GET parameters into the URL.
Reimplemented from MediaWikiQuery.
- (void) didReceiveMediaWikiData: | (NSData *) | data | [implementation] |
MediaWikiQueryDelegate method implementation.
Launches the XML parse process.
Reimplemented from <MediaWikiQueryDelegate>.
- (id) init | [implementation] |
Base init method for MediaWikiCategoryQuery objects.
Reimplemented from MediaWikiQuery.
+ (MediaWikiCategoryQuery *) newCategoryQuery: | (NSString*) | URL | |
delegate: | (id <MediaWikiCategoryQueryDelegate>) | qDelegate | |
Builds a MediaWikiCategoryQuery and returns it.
This static "factory" method builds a MediaWikiCategoryQuery object that will access the given URL and report the category data read to the delegate passed. You will need to set the actual category manually by using the MediaWikiQuery* categoryName property before starting the actual query process.
- (void) parseCategoryXML: | (NSData*) | XMLData |
Launch method for parsing the XML data from a NSData object.
Instantiates a NSXMLParser object and sets it to work, using self as a delegate.
- (void) parser: | (NSXMLParser *) | parser | |
didStartElement: | (NSString *) | elementName | |
namespaceURI: | (NSString *) | namespaceURI | |
qualifiedName: | (NSString *) | qName | |
attributes: | (NSDictionary *) | attributeDict | |
NSXMLParserDelegate method implementation.
Event received when an element has been found.
- (void) parser: | (NSXMLParser *) | parser | |
parseErrorOccurred: | (NSError *) | parseError | |
NSXMLParserDelegate method implementation.
Event received when a parse error is generated by the parser. Passed to the delegate using the MediaWikiCategoryQueryDelegate method categoryParseFailed:NSError*
- (void) parser: | (NSXMLParser *) | parser | |
validationErrorOccurred: | (NSError *) | validationError | |
NSXMLParserDelegate method implementation.
Event received when a validation error is generated by the parser.Passed to the delegate using the MediaWikiCategoryQueryDelegate method categoryParseFailed:NSError*
- (void) parserDidEndDocument: | (NSXMLParser *) | parser |
NSXMLParserDelegate method implementation.
Event received when the XML data has been parsed.
- (void) parserDidStartDocument: | (NSXMLParser *) | parser |
NSXMLParserDelegate method implementation.
Event received when the XML parsing begins.
- (void) setCategoryName: | (NSString *) | categoryName | [implementation] |
- (void) setChunkSize: | (NSString *) | chunkSize | [implementation] |
- (void) setReturnFormat: | (NSString *) | returnFormat | [implementation] |
- (void) setWikiAction: | (NSString *) | wikiAction | [implementation] |
- (id<MediaWikiCategoryQueryDelegate>) categoryDelegate [read, write, retain] |
The delegate to pass read categories and any error messages to.
A single MediaWikiCategoryQuery can have only one delegate.
- (NSString *) categoryName [read, write, copy] |
Defines the category name for a category contents query.
- (NSString *) chunkSize [read, write, copy] |
Defines the chunk size to be read from the MediaWiki when doing a category contents query, ie.
how many category members to receive in a single query. Remember to stringify the number, because we're lazy here and don't do it for you.
- (NSString*) continueFrom [read, write, copy] |
A property specifying the beginning point for the next category contents query.
- (NSMutableDictionary *) parameters [read, write, retain] |
A dictionary object that holds the parameter data.
FIXME: Why is it a public property?
- (NSString *) returnFormat [read, write, copy] |
Defines the return format for this MediaWiki API query.
Only xml is currently supported.
- (NSString *) wikiAction [read, write, copy] |
Defines the action parameter for this MediaWiki API query.
- (NSString*) wikiQuery [read, write, copy] |
Defines the query subtype.
The correct one for a category query is "categorymembers". Set automatically by the factory method.
- (NSArray*) wikiQueryPageIds [read, write, copy] |
MediaWiki API parameter that accepts a comma-delimeted list of wiki page ids as the set to query for eg.
metadata or properties.
- (NSArray*) wikiQueryTitles [read, write, copy] |
MediaWiki API parameter that accepts a comma-delimeted list of wiki page titles as the set to query for eg.
metadata or properties.
- (NSString*) wikiQueryType [read, write, copy] |
Defines the wiki query type.
The correct one for a category query is "list". Set automatically by the factory method.