com.xpn.xwiki.api
Class Context

java.lang.Object
  extended by com.xpn.xwiki.api.Api
      extended by com.xpn.xwiki.api.Context

public class Context
extends Api


Field Summary
 
Fields inherited from class com.xpn.xwiki.api.Api
context
 
Constructor Summary
Context(XWikiContext context)
           
 
Method Summary
 java.lang.Object get(java.lang.String key)
           
 java.lang.String getAction()
           
 int getCacheDuration()
           
 XWikiContext getContext()
           
 java.lang.String getDatabase()
           
 XWikiDocument getDoc()
           
 java.lang.String getLanguage()
           
 java.lang.String getLocalUser()
           
 int getMode()
           
 java.lang.String getOriginalDatabase()
           
protected  XWikiContext getProtectedContext()
           
 XWikiRequest getRequest()
           
 XWikiResponse getResponse()
           
 XWikiURLFactory getURLFactory()
           
 java.lang.String getUser()
           
 XWiki getXWiki()
           
 boolean isVirtual()
           
 void put(java.lang.String key, Object value)
           
 void setCacheDuration(int duration)
           
 void setDatabase(java.lang.String database)
          set the database if you have the programming right
 void setDoc(XWikiDocument doc)
          set the document if you have the programming right
 void setFinished(boolean finished)
           
 
Methods inherited from class com.xpn.xwiki.api.Api
checkProgrammingRights, hasAccessLevel, hasAdminRights, hasProgrammingRights
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Context

public Context(XWikiContext context)
Method Detail

getRequest

public XWikiRequest getRequest()
Returns:
an object which contains the Request context

getResponse

public XWikiResponse getResponse()
Returns:
an object which contains the response object

getMode

public int getMode()

getDatabase

public java.lang.String getDatabase()
Returns:
the current database name

getOriginalDatabase

public java.lang.String getOriginalDatabase()
Returns:
the original database

setDatabase

public void setDatabase(java.lang.String database)
set the database if you have the programming right

Parameters:
database - the data name

getURLFactory

public XWikiURLFactory getURLFactory()
Returns:
the url Factory

isVirtual

public boolean isVirtual()
Returns:
true if the server is in virtual mode (ie host more than one wiki)

getAction

public java.lang.String getAction()
Returns:
the requested action

getLanguage

public java.lang.String getLanguage()
Returns:
the language of the current user

getXWiki

public XWiki getXWiki()
Returns:
the XWiki object if you have the programming right

getDoc

public XWikiDocument getDoc()
Returns:
the current requested document

getUser

public java.lang.String getUser()
Returns:
the current user which made the request

getLocalUser

public java.lang.String getLocalUser()
Returns:
the local username of the current user which made the request

setDoc

public void setDoc(XWikiDocument doc)
set the document if you have the programming right

Parameters:
doc -

getContext

public XWikiContext getContext()
Returns:
the unwrapped version of the context if you have the programming right

getProtectedContext

protected XWikiContext getProtectedContext()

get

public java.lang.Object get(java.lang.String key)

put

public void put(java.lang.String key,
                Object value)

setFinished

public void setFinished(boolean finished)

getCacheDuration

public int getCacheDuration()
Returns:
the cache duration

setCacheDuration

public void setCacheDuration(int duration)
Parameters:
duration - in second


Copyright 2003 Ludovic Dubost