|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opencms.db.CmsDbContext
Wraps context information to access the OpenCms database.
Field Summary | |
protected CmsFlexRequestContextInfo |
m_flexRequestContextInfo
The current Flex request context info (if available). |
protected CmsUUID |
m_projectId
The id of the project for the context. |
protected CmsRequestContext |
m_requestContext
The wrapped user request context. |
Constructor Summary | |
CmsDbContext()
Creates a new, empty database context. |
|
CmsDbContext(CmsRequestContext context)
Creates a new database context initialized with the given user request context. |
Method Summary | |
void |
clear()
Clears this database context. |
CmsProject |
currentProject()
Returns the current users project. |
CmsUser |
currentUser()
Returns the current user. |
CmsFlexRequestContextInfo |
getFlexRequestContextInfo()
Returns the current Flex request context info. |
CmsUUID |
getProjectId()
Returns the project id of the context. |
CmsRequestContext |
getRequestContext()
Returns the request context. |
boolean |
isDefaultDbContext()
Returns true if the database context uses the default implementation. |
void |
pop()
Processes the current database context. |
java.lang.String |
removeSiteRoot(java.lang.String resourcename)
Removes the current site root prefix from the absolute path in the resource name, that is adjusts the resource name for the current site root. |
void |
report(I_CmsReport report,
CmsMessageContainer message,
java.lang.Throwable throwable)
Reports an error to the given report (if available) and to the OpenCms log file. |
void |
setProjectId(CmsUUID projectId)
Sets the project id of the context. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected CmsFlexRequestContextInfo m_flexRequestContextInfo
protected CmsUUID m_projectId
protected CmsRequestContext m_requestContext
Constructor Detail |
public CmsDbContext()
public CmsDbContext(CmsRequestContext context)
context
- the current users request contextMethod Detail |
public void clear()
public CmsProject currentProject()
public CmsUser currentUser()
public CmsFlexRequestContextInfo getFlexRequestContextInfo()
public CmsUUID getProjectId()
public CmsRequestContext getRequestContext()
public boolean isDefaultDbContext()
public void pop() throws CmsException
CmsException
- if something goes wrongpublic java.lang.String removeSiteRoot(java.lang.String resourcename)
If no user request context is available, the given resource name is returned unchanged.
resourcename
- the resource name
public void report(I_CmsReport report, CmsMessageContainer message, java.lang.Throwable throwable) throws CmsVfsException, CmsException
report
- the report to write the error tomessage
- the message to write to the report / logthrowable
- the exception to write to the report / log
CmsException
- if the throwable parameter is not null and a CmsException
CmsVfsException
- if the throwable parameter is not null and no CmsExceptionpublic void setProjectId(CmsUUID projectId)
projectId
- the id of the project to set
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |