CatNiP prefinal
Sähköinen nuottikirja, HY-TKTKL-OHTUPROJ KESÄ11
MediaWikiCategoryQuery Class Reference

Encapsulates a MediaWiki API category query. More...

#import <MediaWikiCategoryQuery.h>

Inheritance diagram for MediaWikiCategoryQuery:
Collaboration diagram for MediaWikiCategoryQuery:

List of all members.

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.

Detailed Description

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.

Definition at line 15 of file MediaWikiCategoryQuery.h.


Member Function Documentation

- (NSString *) _buildGetParams

A private worker method that does the actual GET parameter building work.

Returns the GET parameters as a NSString object.

Definition at line 154 of file MediaWikiCategoryQuery.m.

References continueFrom.

Here is the caller graph for this function:

- (NSString *) buildQueryURL [implementation]

Overrides the default MediaWikiQuery buildQueryURL method to append the GET parameters into the URL.

Reimplemented from MediaWikiQuery.

Definition at line 87 of file MediaWikiCategoryQuery.m.

References _buildGetParams.

Here is the call graph for this function:

- (void) didReceiveMediaWikiData: (NSData *)  data [implementation]

MediaWikiQueryDelegate method implementation.

Launches the XML parse process.

Reimplemented from <MediaWikiQueryDelegate>.

Definition at line 93 of file MediaWikiCategoryQuery.m.

References parseCategoryXML:.

Here is the call graph for this function:

- (id) init [implementation]

Base init method for MediaWikiCategoryQuery objects.

Reimplemented from MediaWikiQuery.

Definition at line 78 of file MediaWikiCategoryQuery.m.

+ (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.

Definition at line 63 of file MediaWikiCategoryQuery.m.

References categoryDelegate, MediaWikiQuery::initWithDelegate:mediaWikiURL:, returnFormat, wikiAction, wikiQuery, and wikiQueryType.

Here is the call graph for this function:

Here is the caller graph for this function:

- (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.

Definition at line 97 of file MediaWikiCategoryQuery.m.

References categoryParser.

Here is the caller graph for this function:

- (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.

Definition at line 108 of file MediaWikiCategoryQuery.m.

References categories.

- (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*

Definition at line 144 of file MediaWikiCategoryQuery.m.

- (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*

Definition at line 139 of file MediaWikiCategoryQuery.m.

- (void) parserDidEndDocument: (NSXMLParser *)  parser

NSXMLParserDelegate method implementation.

Event received when the XML data has been parsed.

Definition at line 124 of file MediaWikiCategoryQuery.m.

References categories.

- (void) parserDidStartDocument: (NSXMLParser *)  parser

NSXMLParserDelegate method implementation.

Event received when the XML parsing begins.

Definition at line 130 of file MediaWikiCategoryQuery.m.

References categories.

- (void) setCategoryName: (NSString *)  categoryName [implementation]

Definition at line 42 of file MediaWikiCategoryQuery.m.

- (void) setChunkSize: (NSString *)  chunkSize [implementation]

Definition at line 50 of file MediaWikiCategoryQuery.m.

- (void) setReturnFormat: (NSString *)  returnFormat [implementation]

Definition at line 35 of file MediaWikiCategoryQuery.m.

- (void) setWikiAction: (NSString *)  wikiAction [implementation]

Definition at line 28 of file MediaWikiCategoryQuery.m.


Property Documentation

- (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.

Definition at line 38 of file MediaWikiCategoryQuery.h.

- (NSString *) categoryName [read, write, copy]

Defines the category name for a category contents query.

Definition at line 46 of file MediaWikiCategoryQuery.h.

- (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.

Definition at line 48 of file MediaWikiCategoryQuery.h.

- (NSString*) continueFrom [read, write, copy]

A property specifying the beginning point for the next category contents query.

Definition at line 40 of file MediaWikiCategoryQuery.h.

- (NSMutableDictionary *) parameters [read, write, retain]

A dictionary object that holds the parameter data.

FIXME: Why is it a public property?

Definition at line 16 of file MediaWikiCategoryQuery.h.

- (NSString *) returnFormat [read, write, copy]

Defines the return format for this MediaWiki API query.

Only xml is currently supported.

Definition at line 44 of file MediaWikiCategoryQuery.h.

- (NSString *) wikiAction [read, write, copy]

Defines the action parameter for this MediaWiki API query.

Definition at line 28 of file MediaWikiCategoryQuery.h.

- (NSString*) wikiQuery [read, write, copy]

Defines the query subtype.

The correct one for a category query is "categorymembers". Set automatically by the factory method.

Definition at line 32 of file MediaWikiCategoryQuery.h.

- (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.

Definition at line 36 of file MediaWikiCategoryQuery.h.

- (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.

Definition at line 34 of file MediaWikiCategoryQuery.h.

- (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.

Definition at line 30 of file MediaWikiCategoryQuery.h.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Enumerations Enumerator Properties Defines