The Server Side API          
  
   
 


transaction

Generic transaction methods.

  • getParameter( parameterName )
    • parameterName - The name of the request parameter to find.//For example for a request /MyPage?food=Cheese getParameter( "food" ) would return the string "Cheese"
  • getResult()
    • returns the current result string (see setResult below)
  • getSocket()
    • returns the transactions socket connection
  • getUser()
    • returns the logged in users name
  • goToPage(pageName)
    • pageName - the name for the page for the browser to display (converts titles to page names)
  • redirect(pageName)
    • pageName - the name for the page for the browser to display (like goToPage but no conversion)
  • sendFile(data, fileName)
    • data - data to return to the browser as a file
    • fileName - the name of the file to return
  • sendPage( pageData )
    • pageData - the data to return as an html page
  • sendPage(data, type)
    • data - the data to return as a page
    • type - the mime type of the page to return
  • sendResponseHeader()
    • send a response header to the browser
  • sendString(data)
    • send the data to the browser
  • setResult(resultStatus)
    • resultStatus - the result status string
      OK, ERROR, KEEP ALIVE or SHOW PAGE
  • userCanPerformAction(pageName, action, throwException)
    • pageName - the name of the page to check access rights for
    • action - the action to check rights for
      read,update or delete
    • throwException - a boolean value
      true = throw an exception if the user cannot perform the action

Get

The get transaction has only the generic transaction methods.

Post

The post transaction has the following methods as well as all of the generic transaction methods.

  • buildDataSearchResultPage( listPage )
    • listPage - The Wiki page that contains a list of pages to search
    • Searches a list of pages with meta data attached as data.xml and returns a page view of the result
  • buildDataSearchResultTable( listPage )
    • listPage - The Wiki page that contains a list of pages to search
    • Searches a list of pages with meta data attached as data.xml and returns a csv file of the results
  • getPostData()
    • makes the post parameters available
  • getPostFileData()
    • retrieves a posted file and makes the post parameters available
  • getPostParameter( parameterName )
    • parameterName - the parameter name
    • returns the posted parameter from a form
  • savePage( pageName , data , tags )
    • pageName - The name of the page to save
    • data - the pages wiki markup data
    • tags - the pages tags
  • savePageWithTemplate( pageName , template )
    • pageName - the name of the page to save
    • template - the template to apply to the post data
    • saves a page by applying the template to the posted data

wiki

  • addJournalEntry( entryText )
  • buildDifferencesPage(String, String, String)
  • buildEditPage(String)
  • buildHistoryPage(String)
  • buildPage( String pageName )
    • Rebuild the named page from it's Wiki source
  • buildPage( String pageName, boolean rebuildReferences )
    • Rebuild the named page from it's Wiki source
    • rebuildReferences - true if referring pages should also be rebuilt
  • buildPage(String pageName, String source)
    • Build a named page from the supplied HTML source using standard header and footer for the given page name
    • The page is not stored, just returned to the browser
  • buildPage(String pageName, String source, boolean isWikiSource)
    • Build a named page from the supplied source using standard header and footer for the given page name
    • isWikiSource - if true the source is converted from Wiki source to HTML
    • The page is not stored, just returned to the browser
  • buildSearchPage(String)
  • cleanUpQueues()
  • copyPage(String, String, String)
  • deleteAttachment(String, String)
  • deletePage(String)
  • getDateTimeStamp()
  • getDateTimeStamp(String)
  • getMessagesSince(String, String)
  • getPageAsList( pageName )
Returns a string array of list items
  • getPageAsTable(String)
  • getPages()
  • getPageUpdateTemplate(String)
  • getTimeStamp()
  • pageExists(String)
  • postMessageToQueue(String, String)
  • rebuild()
  • refreshPage(String)
  • revert(String, String)
  • saveAsAttachment(String, String, String, String)

js

  • get2DArrayAsJavascript(String, String[][])
  • get2DStringArrayAsHashtable(String[][])
  • getApi(String)
  • getArrayAsJavascript( arrayName,arrayData )
    • Converts arrayData into client side javascript array code
  • getAttachmentsJS(String, Hashtable)
  • getPageAttachmentAsString(String, String)
  • getPageAttachmentAsXml(String)
  • getPageAttachmentAsXml(String, String)
  • getPageTags(String)
  • getStringArrayHelper()
  • getStringGenerator()
  • getStringAsXml(data)
  • getXmlAsJavascript(String, XmlElement)
  • getXmlAsJS(XmlElement, XmlElement)
  • getXmlNodeForm(XmlElement, XmlElement, String)
  • pageExists(String)
  • parseXml(String)

file

  • attachmentExists( pageName , fileName )
  • getAttachment( pageName , fileName)
  • getAttachmentsForPage( pageName )
  • incrementAttachment( pageNam e, fileName )
  • installAttachment( pageName , fileName )
  • saveAttachment( pageName , fileName , fileData )
  • unInstallAttachment( pageName , fileName )
  • unZipAttachment( pageName , fileName )
  • zipPage( pageName )

external

  • copyFile(url, pageName, fileName)
    • copys the result of an HTTP request to a file on a particular page
  • getData(url)
    • returns the result of an HTTP request to a url
  • postData(url, keyValuePairs)
    • posts a hashtable of key - value pairs to a url via HTTP

Xml Element

  • addAttribute(String, String)
  • addChild(String)
  • addChild(XmlElement)
  • addValue(String)
  • getAttributeCount()
  • getAttributeNameByIndex(int)
  • getAttributeValueByIndex(int)
  • getAttributeValueByName(String)
  • getElementByIndex(int)
  • getElementByName(String)
  • getElementCount()
  • getElementsByName(String)
  • getValue()
  • hasChild(String)
  • insertChild(XmlElement, int)
  • removeAttribute(String)
  • removeChild(XmlElement)
  • setAttributeValue(String, String)
  • setName(String)
  • setValue(String)
  • toXml()
by Admin on 21/04/2008 at 10:08 PM