CatNiP -test sprint-4-interim
catnip
MediaWikiCategoryQuery Class Reference

#import <MediaWikiCategoryQuery.h>

Inheritance diagram for MediaWikiCategoryQuery:
MediaWikiQuery <MediaWikiQueryDelegate>

List of all members.

Public Member Functions

(void) - parseCategoryXML:
(void) - parser:didStartElement:namespaceURI:qualifiedName:attributes:
(void) - parser:parseErrorOccurred:
(void) - parser:validationErrorOccurred:
(void) - parserDidEndDocument:
(void) - parserDidStartDocument:
(NSString *) - _buildGetParams

Static Public Member Functions

(MediaWikiCategoryQuery *) + newCategoryQuery:delegate:

Properties

NSString * wikiAction
NSString * wikiQueryType
NSString * wikiQuery
NSArray * wikiQueryTitles
NSArray * wikiQueryPageIds
id
< MediaWikiCategoryQueryDelegate
categoryDelegate
NSString * continueFrom
NSMutableDictionary * parameters
NSString * returnFormat
NSString * categoryName
NSString * chunkSize

Detailed Description

MediaWikiCategoryQuery.m 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.


Member Function Documentation

- (NSString*) _buildGetParams
+ (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.


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.

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


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