Class CmsUgcSessionFactory

java.lang.Object
org.opencms.ugc.CmsUgcSessionFactory

public class CmsUgcSessionFactory extends Object
Factory to create the form editing sessions.

  • Method Details

    • 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 context
      request - the request
      config - 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 context
      request - the request
      sitePath - 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 use
      request - the current request
      configPath - the path of the form configuration
      fileName - 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 request
      sessionId - the form session id
      Returns:
      the session