What is the WikiAPI?
The main goal is to offer a set of services which allow you to manage a wiki without necessarily having to be in the site, to excecute actions on a wiki from other applications and any platform.
The following services are available:
-
add a page
-
add a category
-
add a page and associate it to a category
-
get the recent pages
-
get the recent pages associated to a category
-
get the recent pages associated to a user
-
get a category associated pages
-
get a list of linked pages associated to a page
-
to execute actions on a page like: modify the Edit Status or the View Status
Services
//Get relevant information of a given wiki (name, creation date, number of pages, etc.)
WikiInfoGet():WikiInfo
//Check user authentication, true if user and password are Ok, otherwise false.
WikiCheckAuthentication(in:user, in:pass):boolean
//Add a page using an SDT, if a page with same name already exists it will add a new version
//return the page number when succedded, the errorcode otherwise.
WikiPageInsert(in:user, in:pass, pagestruct):status,pageid
//Given a page by id, change it's status to ToDelete
WikiPageDelete(in:user, in:pass, in:pageid):status
//Given a full name page, change it's status to ToDelete
WikiPageDeleteByFullName(in:user, in:pass, in:pagefullname):status
//Given a page type and name, change it's status to ToDelete
WikiPageDeleteByTypeAndName(in:user, in:pass, in:pagetype, in:pagename):status
//Get relevant data associated to a page given its id
//if ContentType=0 the internal page content is returned
//if ContentType=1 the editable page content is returned
//if ContentType=2 the html page content is returned
WikiPageGetById(in:user, in:pass, in:pageid, in:contenttype):pagestruct,status
//Get relevant data associated to a page given its full name
//if ContentType=0 the internal page content is given back
//if ContentType=1 the editable page content is given back
//if ContentType=2 the html page content is given back
WikiPageGetByFullName(in:user, in:pass, in:pagefullname, in:contenttype):pagestruct,status
//Get the page id given a its full name
WikiPageGetIdByName(in:user, in:pass, in:pagefullname):pageid,status
//Get the page id given its type and name
WikiPageGetIdByTypeAndName(in:user, in:pass, in:pagetype, in:pagename):pageid,status
//It returns a list of page names that begin with certain string and are of a certain type.
//You can set the starting position and the maximum number of results you want to retrieve (useful for paging purposes).
//The result will be a collection of page names that fulfill the conditions and a parameter that indicates if there are more results
WikiPageGetNamesBeginsWith(in:user, in:pass, in:pagetype, in:begins, in:from, in:max):names,hasmore,status
//Given a page id, return the last version of it, as well as the date, hour and the user.
WikiPageGetCurrentVersionId(in:user, in:pass, in:pageid):pagelastversionid,pageversiontime,pageversionuser,status
//Adds an image or file
//return the page number when succedded, the errorcode otherwise.
WikiFileInsert(in:user, in:pass, pagestruct):status,pageid
WikiStruct
This structure is used to send page information:
<WikiStruct>
<PageId></PageId>
<PageVersionId></PageVersionId>
<PageName></PageName>
<PageType></Pageype>
<PageFullName></PageFullName>
<PageContent></PageContent>
<isPrivate></isPrivate>
<override></override>
<PageLink></PageLink>
<FileName></FileName>
<CreateCategories></CreateCategories>
<Categories>
<Item></Item>
</Categories>
</WikiStruct>
WikiStatus
<WikiStatus> <WikiStatusItem> <ErrCode></ErrCode> <ErrDesc></ErrDesc> </WikiStatusItem> </WikiStatus>
WikiInfo
<WikiInfo>
<WikiName></WikiName>
<WikiAccessPolicy></WikiAccessPolicy>
<WikiShortDescription></WikiShortDescription>
<WikiCreationTime></WikiCreationTime>
<NumberOfDeletedPages></NumberOfDeletedPages>
<NumberOfPages></NumberOfPages>
<NumberOfUsers></NumberOfUsers>
<NumberOfVersions></NumberOfVersions>
<AverageVersionPerPage></AverageVersionPerPage>
<TotalNumberOfPages></TotalNumberOfPages>
</WikiInfo>
Implementation The implementation can be cradle in:
If you are using gxwiki 1.0 download the following file Download; otherwise the WikiAPI is already in the Knowledge base (WikiAPI folder).