Package org.opencms.ugc
Class CmsUgcSessionFactory
java.lang.Object
org.opencms.ugc.CmsUgcSessionFactory
Factory to create the form editing sessions.
-
Method Summary
Modifier and TypeMethodDescriptioncreateSession
(CmsObject cms, javax.servlet.http.HttpServletRequest request, String sitePath) Creates a new editing session.createSession
(CmsObject cms, javax.servlet.http.HttpServletRequest request, CmsUgcConfiguration config) Creates a new editing session.createSessionForFile
(CmsObject cms, javax.servlet.http.HttpServletRequest request, String configPath, String fileName) Creates a new session for a given file.static CmsUgcSessionFactory
Returns the factory instance.getSession
(javax.servlet.http.HttpServletRequest request, CmsUUID sessionId) Returns the session, if already initialized.static void
setAdminCms
(CmsObject adminCms) Sets the admin CmsObject instance.
-
Method Details
-
getInstance
Returns the factory instance.- Returns:
- the factory instance
-
setAdminCms
Sets the admin CmsObject instance.- Parameters:
adminCms
- the admin CmsObject
-
createSession
public CmsUgcSession createSession(CmsObject cms, javax.servlet.http.HttpServletRequest request, CmsUgcConfiguration config) throws CmsUgcException Creates a new editing session.- Parameters:
cms
- the cms contextrequest
- the requestconfig
- the configuration- Returns:
- the form session
- Throws:
CmsUgcException
- if creating the session fails
-
createSession
public CmsUgcSession createSession(CmsObject cms, javax.servlet.http.HttpServletRequest request, String sitePath) throws CmsUgcException Creates a new editing session.- Parameters:
cms
- the cms contextrequest
- the requestsitePath
- the configuration site path- Returns:
- the form session
- Throws:
CmsUgcException
- if creating the session fails
-
createSessionForFile
public CmsUgcSession createSessionForFile(CmsObject cms, javax.servlet.http.HttpServletRequest request, String configPath, String fileName) throws CmsUgcException Creates a new session for a given file.- Parameters:
cms
- the CMS context to userequest
- the current requestconfigPath
- the path of the form configurationfileName
- the file name (*not* path) of the XML content for which the session should be initialized- Returns:
- the newly created session
- Throws:
CmsUgcException
- if something goes wrong
-
getSession
Returns the session, if already initialized.- Parameters:
request
- the requestsessionId
- the form session id- Returns:
- the session
-