info.bliki.api.query
Class Query

java.lang.Object
  extended by info.bliki.api.query.RequestBuilder
      extended by info.bliki.api.query.Query

public class Query
extends RequestBuilder

action=query
Query API module allows applications to get needed pieces of data from the MediaWiki databases, and is loosely based on the Query API interface currently available on all MediaWiki servers. All data modifications will first have to use query to acquire a token to prevent abuse from malicious sites.

 Parameters:
   titles         - A list of titles to work on
   pageids        - A list of page IDs to work on
   revids         - A list of revision IDs to work on
   prop           - Which properties to get for the titles/revisions/pageids
                    Values (separate with '|'): info, revisions, links, langlinks, images, imageinfo, templates, categories, extlinks, categoryinfo, duplicatefiles
   list           - Which lists to get
                    Values (separate with '|'): allimages, allpages, alllinks, allcategories, allusers, backlinks, blocks, categorymembers, deletedrevs, embeddedin, imageusage, logevents, recentchanges, search, usercontribs, watchlist, exturlusage, users, random
   meta           - Which meta data to get about the site
                    Values (separate with '|'): siteinfo, userinfo, allmessages
   generator      - Use the output of a list as the input for other prop/list/meta items
                    One value: links, images, templates, categories, duplicatefiles, allimages, allpages, alllinks, allcategories, backlinks, categorymembers, embeddedin, imageusage, search, watchlist, exturlusage, random
   redirects      - Automatically resolve redirects
   indexpageids   - Include an additional pageids section listing all returned page IDs.
 
Example: api.php?action=query&prop=revisions&meta=siteinfo&titles=Main%20 Page&rvprop=user|comment


Constructor Summary
Query()
           
 
Method Summary
 Query apfrom(java.lang.String title)
          The page title to start enumerating from.
 Query aplimit(int limit)
          How many total pages to return.
static Query create()
           
 Query generator(java.lang.String generator)
          Use the output of a list as the input for other prop/list/meta items.
 Query indexpageids()
          Include an additional pageids section listing all returned page IDs.
 Query inprop(java.lang.String... prop)
          Which additional properties to get: "protection" - List the protection level of each page "talkid" - The page ID of the talk page for each non-talk page "subjectid" - The page ID of the parent page for each talk page Values (separate with '|'): protection, talkid, subjectid, url, readable
 Query inprop(java.lang.String prop)
          Which additional property to get:
"protection" - List the protection level of each page "talkid" - The page ID of the talk page for each non-talk page "subjectid" - The page ID of the parent page for each talk page Values (separate with '|'): protection, talkid, subjectid, url, readable
 Query intoken(java.lang.String intoken)
           
 Query list(java.lang.String... lists)
          Which lists to get.
 Query meta(java.lang.String... metadata)
          Which meta data to get about the site.
 Query pageids(int... pageids)
          A list of page IDs to work on
 Query prop(java.lang.String... prop)
          Which properties to get for the titles/revisions/pageids.
 Query prop(java.lang.String prop)
          Which property to get for the titles/revisions/pageids.
 Query redirects()
          Automatically resolve redirects.
 Query revids(int... revids)
          A list of revision IDs to work on
 Query titles(java.lang.String... titles)
          A list of titles to work on
 Query titles(java.lang.String title)
          One title to work on
 
Methods inherited from class info.bliki.api.query.RequestBuilder
action, clear, containsKey, containsValue, entrySet, equals, format, get, getParameters, hashCode, isEmpty, keySet, maxage, maxlag, put, putAll, putPipedString, putPipedString, remove, requestid, size, smaxage, toPipedString, toPipedString, toString, values, version
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Query

public Query()
Method Detail

create

public static Query create()

titles

public Query titles(java.lang.String title)
One title to work on

Parameters:
titles -
Returns:

titles

public Query titles(java.lang.String... titles)
A list of titles to work on

Parameters:
titles -
Returns:

pageids

public Query pageids(int... pageids)
A list of page IDs to work on

Parameters:
pageids -
Returns:

revids

public Query revids(int... revids)
A list of revision IDs to work on

Parameters:
revids -
Returns:

prop

public Query prop(java.lang.String prop)
Which property to get for the titles/revisions/pageids.
Values info, revisions, links, langlinks, images, imageinfo, templates, categories, extlinks, categoryinfo, duplicatefiles

Parameters:
prop -
Returns:

prop

public Query prop(java.lang.String... prop)
Which properties to get for the titles/revisions/pageids.
Values (internally separated with '|'): info, revisions, links, langlinks, images, imageinfo, templates, categories, extlinks, categoryinfo, duplicatefiles

Parameters:
prop -
Returns:

list

public Query list(java.lang.String... lists)
Which lists to get.
Values (separate with '|'): allimages, allpages, alllinks, allcategories, allusers, backlinks, blocks, categorymembers, deletedrevs, embeddedin, imageusage, logevents, recentchanges, search, usercontribs, watchlist, exturlusage, users, random

Parameters:
lists -
Returns:

meta

public Query meta(java.lang.String... metadata)
Which meta data to get about the site.
Values (separate with '|'): siteinfo, userinfo, allmessages

Parameters:
metadata -
Returns:

generator

public Query generator(java.lang.String generator)
Use the output of a list as the input for other prop/list/meta items.
One value: links, images, templates, categories, duplicatefiles, allimages, allpages, alllinks, allcategories, backlinks, categorymembers, embeddedin, imageusage, search, watchlist, exturlusage, random

Parameters:
generator -
Returns:

redirects

public Query redirects()
Automatically resolve redirects.

Returns:

indexpageids

public Query indexpageids()
Include an additional pageids section listing all returned page IDs.

Returns:

inprop

public Query inprop(java.lang.String prop)
Which additional property to get:
"protection" - List the protection level of each page "talkid" - The page ID of the talk page for each non-talk page "subjectid" - The page ID of the parent page for each talk page Values (separate with '|'): protection, talkid, subjectid, url, readable

Parameters:
prop -
Returns:

inprop

public Query inprop(java.lang.String... prop)
Which additional properties to get: "protection" - List the protection level of each page "talkid" - The page ID of the talk page for each non-talk page "subjectid" - The page ID of the parent page for each talk page Values (separate with '|'): protection, talkid, subjectid, url, readable

Parameters:
prop -
Returns:

apfrom

public Query apfrom(java.lang.String title)
The page title to start enumerating from.

Parameters:
title -
Returns:

aplimit

public Query aplimit(int limit)
How many total pages to return. No more than 500 (5000 for bots) allowed. Default: 10

Parameters:
limit -
Returns:

intoken

public Query intoken(java.lang.String intoken)


Copyright © 2012 Java Wikipedia API (Bliki engine). All Rights Reserved.