Class FormDesignerModelFactory


  • public final class FormDesignerModelFactory
    extends Object
    Utility methods for creating the various models used by the form designer.
    Since:
    7.0.0
    Author:
    XIMA MEDIA GmbH
    • Method Detail

      • createFormDesignerModel

        public static FormDesignerModel createFormDesignerModel​(javax.faces.context.FacesContext facesContext,
                                                                IEntityContext ec,
                                                                Mandant client,
                                                                ProjectPageBean projectHolder,
                                                                Locale locale,
                                                                Benutzer user,
                                                                WebFormPersistFile initialPersist,
                                                                String conversationId)
                                                         throws AccessDeniedException,
                                                                javassist.NotFoundException,
                                                                Exception
        Creates a new form designer model from the data of the given faces request.
        Parameters:
        facesContext - Faces context of the currently active faces request.
        ec - Entity context to use for database transactions.
        client - Current client.
        projectHolder - Current project.
        locale - Requested locale.
        user - User who requested the designer.
        initialPersist - Initial persist to be loaded on startup.
        conversationId - Current ID of the designer session.s
        Returns:
        A new form designer model
        Throws:
        AccessDeniedException - When the user does not have access to the requested designer instance.
        javassist.NotFoundException - When the requested project, workflow version or form version could not be found.
        Exception - When the model could not be created for any other reason, such as database failures etc.
      • createFormRenderConfig

        public static IXFormRenderConfig createFormRenderConfig​(javax.faces.context.FacesContext facesContext,
                                                                Locale locale,
                                                                ProjectPageBean projectHolder)
                                                         throws IOException,
                                                                ContextBuilderException
        Creates a new dummy form render config for th form and designer.
        Parameters:
        facesContext - Current faces context.
        locale - Current locale.
        projectHolder - Info about the selected project and form version.
        Returns:
        A new form render config.
        Throws:
        IOException - When the form config could not be built.
        ContextBuilderException - When the render config could not be built.
      • findAvailableFormVersionBackups

        public static List<FormBackupVersion> findAvailableFormVersionBackups​(IEntityContext ec,
                                                                              Locale locale,
                                                                              ProjectPageBean projectHolder)
                                                                       throws Exception
        Reads the available backup versions from the database and returns them.
        Parameters:
        ec - Entity context to use for database transactions.
        locale - Current locale.
        projectHolder - Current project.
        Returns:
        A list of all currently available backup version.
        Throws:
        Exception - When the list could not be created, such as when the database could not be accessed.