|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Dictionary<K,V>
java.util.Hashtable<Object,Object>
com.xpn.xwiki.XWikiContext
public class XWikiContext
Field Summary | |
---|---|
static String |
EXECUTIONCONTEXT_KEY
|
protected static org.slf4j.Logger |
LOGGER
Logging helper object. |
static int |
MODE_ATOM
|
static int |
MODE_GWT
|
static int |
MODE_GWT_DEBUG
|
static int |
MODE_PDF
|
static int |
MODE_PORTLET
|
static int |
MODE_SERVLET
|
static int |
MODE_XMLRPC
|
static ParameterizedType |
TYPE_PROVIDER
Type instance for Provider |
Constructor Summary | |
---|---|
XWikiContext()
|
Methods inherited from class java.util.Hashtable |
---|
clear, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, putAll, rehash, size, toString, values |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static ParameterizedType TYPE_PROVIDER
public static final int MODE_SERVLET
public static final int MODE_PORTLET
public static final int MODE_XMLRPC
public static final int MODE_ATOM
public static final int MODE_PDF
public static final int MODE_GWT
public static final int MODE_GWT_DEBUG
public static final String EXECUTIONCONTEXT_KEY
protected static final org.slf4j.Logger LOGGER
Constructor Detail |
---|
public XWikiContext()
Method Detail |
---|
public XWiki getWiki()
public Util getUtil()
public void setWiki(XWiki wiki)
public XWikiEngineContext getEngineContext()
public void setEngineContext(XWikiEngineContext engine_context)
public XWikiRequest getRequest()
public void setRequest(XWikiRequest request)
public String getAction()
public void setAction(String action)
public XWikiResponse getResponse()
public void setResponse(XWikiResponse response)
public String getDatabase()
public void setDatabase(String database)
public Object put(Object key, Object value)
Make sure to keep database
fields and map synchronized.
put
in interface Map<Object,Object>
put
in class Hashtable<Object,Object>
Hashtable.put(java.lang.Object, java.lang.Object)
public Object remove(Object key)
Make sure to keep database
field and map synchronized.
remove
in interface Map<Object,Object>
remove
in class Hashtable<Object,Object>
Hashtable.remove(java.lang.Object)
public String getOriginalDatabase()
public void setOriginalDatabase(String database)
public boolean isMainWiki()
public boolean isMainWiki(String wikiName)
wikiName
- the name of the wiki.
public XWikiDocument getDoc()
public void setDoc(XWikiDocument doc)
public DocumentReference getUserReference()
public void setUserReference(DocumentReference userReference)
@Deprecated public void setUser(String user)
setUserReference(DocumentReference)
instead
@Deprecated public String getUser()
getUserReference()
instead
@Deprecated public String getLocalUser()
getUserReference()
instead
@Deprecated public XWikiUser getXWikiUser()
getUserReference()
instead
@Deprecated public String getLanguage()
getLocale()
instead
@Deprecated public void setLanguage(String language)
setLocale(Locale)
instead
public Locale getLocale()
public void setLocale(Locale locale)
locale
- the current localepublic String getInterfaceLanguage()
public void setInterfaceLanguage(String interfaceLanguage)
public int getMode()
public void setMode(int mode)
public URL getURL()
public void setURL(URL url)
public XWikiURLFactory getURLFactory()
public void setURLFactory(XWikiURLFactory URLFactory)
public XWikiForm getForm()
public void setForm(XWikiForm form)
public boolean isFinished()
public void setFinished(boolean finished)
public org.apache.xmlrpc.server.XmlRpcServer getXMLRPCServer()
public void setXMLRPCServer(org.apache.xmlrpc.server.XmlRpcServer xmlRpcServer)
@Deprecated public void setWikiOwner(String wikiOwner)
@Deprecated public String getWikiOwner()
XWiki.getWikiOwner(String, XWikiContext)
instead
@Deprecated public void setWikiServer(XWikiDocument doc)
public XWikiDocument getWikiServer()
public int getCacheDuration()
public void setCacheDuration(int cacheDuration)
public String getMainXWiki()
public void setMainXWiki(String str)
public void addBaseClass(BaseClass bclass)
public BaseClass getBaseClass(DocumentReference documentReference)
public void flushClassCache()
public void setLinksAction(String action)
public void unsetLinksAction()
public String getLinksAction()
public void setLinksQueryString(String value)
public void unsetLinksQueryString()
public String getLinksQueryString()
public XWikiMessageTool getMessageTool()
public XWikiValidationStatus getValidationStatus()
public void setValidationStatus(XWikiValidationStatus status)
public void addDisplayedField(String fieldname)
public List<String> getDisplayedFields()
public String getEditorWysiwyg()
public void dropPermissions()
After this is called:
Api.hasProgrammingRights()
will always return false.XWiki.getDocumentAsAuthor(org.xwiki.model.reference.DocumentReference)
,
XWiki.getDocumentAsAuthor(String)
, Document.saveAsAuthor()
,
Document.saveAsAuthor(String)
,
Document.saveAsAuthor(String, boolean)
, and
Document.deleteAsAuthor()
will perform all of their actions as if the document's
content author was the guest user (XWiki.XWikiGuest).
In effect, no code requiring "programming right" will run, and if the document content author (see:
Document.getContentAuthor()
) is a user who has "programming right", there will be no
way for code following this call to save another document as this user, blessing it too with programming right.
Once dropped, permissions cannot be regained for the duration of the request.
If you are interested in a more flexable sandboxing method which sandboxed code only for the remainder of the
rendering cycle, consider using Document.dropPermissions()
.
public boolean hasDroppedPermissions()
dropPermissions()
has been called on this context, or if the
XWikiConstant.DROPPED_PERMISSIONS
key has been set in the
ExecutionContext
for this thread. This is done by calling
{Document#dropPermissions()}public XWikiContext clone()
clone
in class Hashtable<Object,Object>
public void declareInExecutionContext(org.xwiki.context.ExecutionContext executionContext)
executionContext
- The execution context.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |