Package org.opencms.ugc
Class CmsUgcSessionFactory
- java.lang.Object
-
- org.opencms.ugc.CmsUgcSessionFactory
-
public class CmsUgcSessionFactory extends java.lang.Object
Factory to create the form editing sessions.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CmsUgcSession
createSession(CmsObject cms, javax.servlet.http.HttpServletRequest request, java.lang.String sitePath)
Creates a new editing session.CmsUgcSession
createSession(CmsObject cms, javax.servlet.http.HttpServletRequest request, CmsUgcConfiguration config)
Creates a new editing session.CmsUgcSession
createSessionForFile(CmsObject cms, javax.servlet.http.HttpServletRequest request, java.lang.String configPath, java.lang.String fileName)
Creates a new session for a given file.static CmsUgcSessionFactory
getInstance()
Returns the factory instance.CmsUgcSession
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 Detail
-
getInstance
public static CmsUgcSessionFactory getInstance()
Returns the factory instance.- Returns:
- the factory instance
-
setAdminCms
public static void setAdminCms(CmsObject adminCms)
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, java.lang.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, java.lang.String configPath, java.lang.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
public CmsUgcSession getSession(javax.servlet.http.HttpServletRequest request, CmsUUID sessionId)
Returns the session, if already initialized.- Parameters:
request
- the requestsessionId
- the form session id- Returns:
- the session
-
-