Interface FormManager


  • public interface FormManager
    The FormManager is the interface that is to be implemented by the FormManagerService. If you want to work with the Form API, retrieve the service with this interface from the Framework or define a ServiceDependency on it.
    • Method Detail

      • getAllForms

        List<Form> getAllForms​(Website website)
        Returns a list of all forms from a specific website.
        Parameters:
        website - The website for which the forms should be returned.
        Returns:
        A list of all forms from a specific website.
      • getAllForms

        List<Form> getAllForms()
        Returns a list of all forms within an installation. To get the forms for a specific website use getAllForms(Website website).
        Returns:
        A list of all forms within an installation.
      • getAllFormSections

        List<FormSection> getAllFormSections​(Website website)
        Returns a list of all formsections from a specific website.
        Parameters:
        website - The website for which the formsections should be returned.
        Returns:
        A list of all formsections from a specific website.
      • getAllFormSections

        List<FormSection> getAllFormSections()
        Returns a list of all formsections within an installation. To get the formsections for a specific website use getAllForms(Website website).
        Returns:
        A list of all formsections within an installation.
      • getAllCategories

        List<FormCategory> getAllCategories​(Website website)
        Returns a list of all form categories for a specific website.
        Parameters:
        website - The website to get the categories for.
        Returns:
        A list of all form categories for a specific website.
      • getAllFormHandlerDefinitions

        List<FormHandlerDefinition> getAllFormHandlerDefinitions()
        Returns a list of all form handler definitions within an installation.
        Returns:
        A list of all FormHandlerDefinitions within an installation.
      • getAllFormRouterDefinitions

        List<FormRouterDefinition> getAllFormRouterDefinitions()
        Returns a list of all form router definitions within an installation.
        Returns:
        A list of all FormRouterDefinitions within an installation.
      • getAllFragmentValidatorDefinitions

        List<FragmentValidatorDefinition> getAllFragmentValidatorDefinitions()
        Returns a list of all fragment validator definitions within an installation.
        Returns:
        A list of all FragmentValidatorDefinitions within an installation.
      • getAllFormValidatorDefinitions

        List<FormValidatorDefinition> getAllFormValidatorDefinitions()
        Returns a list of all form validator definitions within an installation.
        Returns:
        A list of all FormValidatorDefinitions within an installation.
      • getAllFormLogicComponentDefinitions

        List<FormLogicComponentDefinition> getAllFormLogicComponentDefinitions()
        Returns a list of all form logic component definitions within an installation.
        Returns:
        a list of all form logic component definitions within an installation
      • getAllFormHandlerVariantDefinitions

        List<FormHandlerVariantDefinition> getAllFormHandlerVariantDefinitions()
        Returns a list of all form handler variant definitions within an installation.
        Returns:
        A list of all FormHandlerVariantDefinitions within an installation.
      • getAllFormRouterVariantDefinitions

        List<FormRouterVariantDefinition> getAllFormRouterVariantDefinitions()
        Returns a list of all form router variant definitions within an installation.
        Returns:
        A list of all FormRouterVariantDefinitions within an installation.
      • getAllFormValidatorVariantDefinitions

        List<FormValidatorVariantDefinition> getAllFormValidatorVariantDefinitions()
        Returns a list of all form validator variant definitions within an installation.
        Returns:
        A list of all FormValidatorVariantDefinitions within an installation.
      • getAllFragmentValidatorVariantDefinitions

        List<FragmentValidatorVariantDefinition> getAllFragmentValidatorVariantDefinitions()
        Returns a list of all fragment validator variant definitions within an installation.
        Returns:
        A list of all FragmantValidatorVariantDefinitions within an installation.
      • getFormById

        Form getFormById​(WmId wmId)
        Returns the form identified by the wmId.
        Parameters:
        wmId - Internal identifier for the form.
        Returns:
        The form that is identified by the wmId.
      • getFormByOriginIdentifier

        Form getFormByOriginIdentifier​(String originIdentifier,
                                       Website website)
        Returns the form identified by the origin identifier.
        Parameters:
        originIdentifier - original identifier for the form.
        Returns:
        The form that is identified by the original identifier.
      • getFormSectionByOriginIdentifier

        FormSection getFormSectionByOriginIdentifier​(String originIdentifier,
                                                     Website website)
        Returns the form section identified by the origin identifier.
        Parameters:
        originIdentifier - original identifier for the form section.
        Returns:
        The form section that is identified by the original identifier.
      • getFormSectionById

        FormSection getFormSectionById​(WmId wmId)
        Returns the formsection identified by the wmId.
        Parameters:
        wmId - Internal identifier for the formsection.
        Returns:
        The formsection that is identified by the wmId.
      • getFormCategoryById

        FormCategory getFormCategoryById​(WmId wmId)
        Returns the form category identified by the wmId.
        Parameters:
        wmId - Internal identifier for the form category.
        Returns:
        The form category identified by the wmId.
      • getFormVersionById

        FormVersion getFormVersionById​(WmId wmId)
        Returns the form version identified by the wmId.
        Parameters:
        wmId - Internal identifier for the form version.
        Returns:
        The form version identified by the wmId.
      • getFormFragmentContainerById

        FormFragmentContainer getFormFragmentContainerById​(WmId wmId)
        Returns the formfragment container identified by the wmId.
        Parameters:
        wmId - Internal identifier for the formfragment container.
        Returns:
        The formfragment container identified by the wmId.
      • getFormSectionVersionById

        FormSectionVersion getFormSectionVersionById​(WmId wmId)
        Returns the formsection version identified by the wmId.
        Parameters:
        wmId - Internal identifier for the formsection version.
        Returns:
        The formsection version identified by the wmId.
      • getFormStepById

        FormStep getFormStepById​(WmId wmId)
        Returns the form step identified by the wmId.
        Parameters:
        wmId - Internal identifier for the form step.
        Returns:
        The form step identified by the wmId.
      • getFormFragmentById

        FormFragment getFormFragmentById​(WmId wmId)
        Returns the form fragment identified by the wmId.
        Parameters:
        wmId - Internal identifier for the form fragment.
        Returns:
        The form fragment identified by the wmId.
      • getFormLogicComponentById

        FormLogicComponent getFormLogicComponentById​(WmId wmId)
        Returns the form logic component identified by the wmId.
        Parameters:
        wmId - Internal identifier for the form logic component.
        Returns:
        The form logic component identified by the wmId.
      • getParameterById

        Parameter getParameterById​(WmId wmId)
        Returns the parameter (of a validator or handler) identified by the wmId.
        Parameters:
        wmId - Internal identifier for the parameter.
        Returns:
        The parameter identified by the wmId.
      • getConditionalComponentById

        ConditionalComponent getConditionalComponentById​(WmId wmId)
        Returns the conditional component identified by the wmId.
        Parameters:
        wmId - Internal identifier for the conditional component.
        Returns:
        The conditional component identified by the wmId.
      • getFragmentValidatorById

        FragmentValidator getFragmentValidatorById​(WmId wmId)
        Returns the fragment validator identified by the wmId.
        Parameters:
        wmId - Internal identifier for the fragment validator.
        Returns:
        The fragment validator identified by the wmId.
      • getFragmentValidatorDefinitionById

        FragmentValidatorDefinition getFragmentValidatorDefinitionById​(WmId wmId)
        Returns the fragment validator defintion identified by the wmId.
        Parameters:
        wmId - Internal identifier for the fragment validator definition.
        Returns:
        The fragment validator definition identified by the wmId.
      • getFormLogicComponentDefinitionById

        FormLogicComponentDefinition getFormLogicComponentDefinitionById​(WmId wmId)
        Returns the form logic component definition identified by the wmId.
        Parameters:
        wmId - Internal identifier for the form logic component definition.
        Returns:
        The form logic component definition identified by the wmId.
      • getFormValidatorDefinitionByIdentifier

        FormValidatorDefinition getFormValidatorDefinitionByIdentifier​(String identifier)
        Returns the form validator definition.
        Parameters:
        identifier - The identifier for the form validator definition.
        Returns:
        The form validator definition identified by the identifier.
      • getFormHandlerDefinitionByIdentifier

        FormHandlerDefinition getFormHandlerDefinitionByIdentifier​(String identifier)
        Returns the form handler definition.
        Parameters:
        identifier - The identifier for the form handler definition.
        Returns:
        The form handler definition identified by the identifier.
      • getFormRouterDefinitionByIdentifier

        FormRouterDefinition getFormRouterDefinitionByIdentifier​(String identifier)
        Returns the form router definition.
        Parameters:
        identifier - The identifier for the form router definition.
        Returns:
        The form router definition identified by the identifier.
      • getFragmentValidatorDefinitionByIdentifier

        FragmentValidatorDefinition getFragmentValidatorDefinitionByIdentifier​(String identifier)
        Returns the fragment validator definition.
        Parameters:
        identifier - The identifier for the fragment validator definition.
        Returns:
        The fragment validator definition identified by the identifier.
      • getFormLogicComponentDefinitionByIdentifier

        FormLogicComponentDefinition getFormLogicComponentDefinitionByIdentifier​(String identifier)
        Returns the form logic provider definition.
        Parameters:
        identifier - The identifier for the form logic component definition
        Returns:
        the form logic provider definition with the specified identifier
      • getFormLogicComponentDefinitionByComponentId

        FormLogicComponentDefinition getFormLogicComponentDefinitionByComponentId​(String componentId)
        Returns the form logic provider definition.
        Parameters:
        componentId - The identifier for the form logic component definition
        Returns:
        the form logic provider definition with the specified identifier
      • createForm

        Form createForm()
        Creates a new form. Note that also a version and a step will be created.
        Returns:
        The newly created form.
      • createForm

        Form createForm​(boolean createVersion)
        Creates a new form. Note that also a version and a step will be created.
        Parameters:
        createVersion - If true then a FormVersion will be created and added to the new Form.
        Returns:
        The newly created form.
      • createFormSection

        FormSection createFormSection()
        Creates a new formsection.
        Returns:
        The newly created formsection.
      • createFormSection

        FormSection createFormSection​(boolean createVersion)
        Creates a new FormSection.
        Parameters:
        createVersion - indicates whether to also create an initial version
        Returns:
        the newly created FormSection
      • createFormCategory

        FormCategory createFormCategory()
        Creates a new form category.
        Returns:
        The newly created category.
      • createFormValidatorDefinition

        FormValidatorDefinition createFormValidatorDefinition()
        Creates a form validator definition.
        Returns:
        The created form validator definition.
      • createFormHandlerDefinition

        FormHandlerDefinition createFormHandlerDefinition()
        Creates a form handler definition.
        Returns:
        The created form validator definition.
      • createFormRouterDefinition

        FormRouterDefinition createFormRouterDefinition()
        Creates a form router definition.
        Returns:
        The created form router definition.
      • createFragmentValidatorDefinition

        FragmentValidatorDefinition createFragmentValidatorDefinition()
        Creates a form fragement validator definition.
        Returns:
        The created form fragment validator definition.
      • deleteFormLogicComponentDefinition

        void deleteFormLogicComponentDefinition​(FormLogicComponentDefinition formLogicComponentDefinition)
                                         throws FormManagerException
        Deletes a form logic component definition. To be used when purging a FormLogicComponentProvider WCB.
        Parameters:
        formLogicComponentDefinition - the form logic component definition to delete
        Throws:
        FormManagerException - when something went wrong, e.g. the component is still being referenced
      • createFormValidatorVariantDefinition

        FormValidatorVariantDefinition createFormValidatorVariantDefinition()
        Creates a form validator variant definition.
        Returns:
        The created form validator variant definition.
      • createFormHandlerVariantDefinition

        FormHandlerVariantDefinition createFormHandlerVariantDefinition()
        Creates a form handler variant definition.
        Returns:
        The created form validator variant definition.
      • createFormRouterVariantDefinition

        FormRouterVariantDefinition createFormRouterVariantDefinition()
        Creates a form router variant definition.
        Returns:
        The created form router variant definition.
      • createFragmentValidatorVariantDefinition

        FragmentValidatorVariantDefinition createFragmentValidatorVariantDefinition()
        Creates a form fragement validator variant definition.
        Returns:
        The created form fragment validator variant definition.
      • getOrCreateLanguageLabelContainer

        LanguageLabelContainer getOrCreateLanguageLabelContainer​(int webId,
                                                                 String locale)
                                                          throws FormManagerException
        Returns an existing or newly created language container for the given website and locale.
        Parameters:
        webId - the id of the website for which to create a new language label container
        locale - the locale of the container
        Returns:
        the language label container
        Throws:
        FormManagerException - when an error occured during the creation of a new container
      • updateIdentifierReferences

        void updateIdentifierReferences​(BasicFormFragment updatedFragment,
                                        String oldId,
                                        String newId)
                                 throws FormManagerException
        Updates the references to the updated fragment. Recursively updates all javascript references of the updatedFragment's old identifier, to the specified new identifier. Updated are: string parameters, fragment preconditions, fragment prefilling, step/form prehandling, step/form logic component parameters, form logic conditions, and javascript form handlers. Every update is done with respect to the fragment's scope. All code changing a fragment identifier should call this method, to prevent identifier inconsistencies from occurring and thereby prevent forms from breaking.
        Parameters:
        updatedFragment - The fragment that is (to be) updated
        oldId - The old identifier of the fragment
        newId - The new identifier of the fragment
        Throws:
        FormManagerException - If saving a fragment container failed
      • updateIdentifierReferences

        void updateIdentifierReferences​(BasicFormFragmentContainer updatedContainer,
                                        String oldId,
                                        String newId)
                                 throws FormManagerException
        Updates the references to the updated container. Recursively updates all javascript references of the updatedContainer's old identifier, to the specified new identifier. Updated are: string parameters, fragment preconditions, fragment prefilling, step/form prehandling, step/form logic component parameters, form logic conditions, and javascript form handlers. Every update is done with respect to the container's scope. All code changing a fragment identifier should call this method, to prevent identifier inconsistencies from occurring and thereby prevent forms from breaking.
        Parameters:
        updatedFragment - The fragment that is (to be) updated
        oldId - The old identifier of the fragment
        newId - The new identifier of the fragment
        Throws:
        FormManagerException - If saving a fragment container failed
      • getSettings

        Settings getSettings​(Website website)
        Returns (or creates) the Settings object for the specified website.
        Parameters:
        website - the website to return the Settings-object for
        Returns:
        the Settings object for the specified website
        See Also:
        Settings
      • deleteFormLogicComponentVariantDefinition

        void deleteFormLogicComponentVariantDefinition​(FormLogicComponentVariantDefinition formLogicComponentVariantDefinition)
                                                throws FormManagerException
        Deletes a form logic component variant definition.
        Parameters:
        formLogicComponentVariantDefinition - the form logic component variant definition to delete
        Throws:
        FormManagerException - when something went wrong, e.g. the component is still being referenced
      • getParameterDefinitionById

        ParameterDefinition getParameterDefinitionById​(WmId wmId)
        Returns a ParameterDefinition for a given id.
        Parameters:
        website - the website to return the Settings-object for
        Returns:
        the Settings object for the specified website
        See Also:
        Settings
      • deleteParameterDefinition

        void deleteParameterDefinition​(ParameterDefinition parameterVariantDefinition)
                                throws FormManagerException
        Deletes a parameter definition.
        Parameters:
        parameterDefinition - the parameterDefinition to delete
        Throws:
        FormManagerException - when something went wrong, e.g. the component is still being referenced
      • getFormHandlerVariantDefinitionsByOriginIdentifier

        List<FormHandlerVariantDefinition> getFormHandlerVariantDefinitionsByOriginIdentifier​(String originIdentifier)
        Returns the FormLogicComponentVariantDefinitions with the specified originIdentifier.
        Parameters:
        originIdentifier - the origin identifier for which to look up FormLogicComponentVariantDefinition
        Returns:
        A list of all FormLogicComponentVariantDefinitions with the specified originIdentifier or null if it does not exist
      • getFragmentValidatorVariantDefinitionsByOriginIdentifier

        List<FragmentValidatorVariantDefinition> getFragmentValidatorVariantDefinitionsByOriginIdentifier​(String originIdentifier)
        Returns the FragmentValidatorVariantDefinitions with the specified originIdentifier.
        Parameters:
        originIdentifier - the origin identifier for which to look up FragmentValidatorVariantDefinition
        Returns:
        A list of all FragmentValidatorVariantDefinitions with the specified originIdentifier or null if it does not exist
      • getFormValidatorVariantDefinitionsByOriginIdentifier

        List<FormValidatorVariantDefinition> getFormValidatorVariantDefinitionsByOriginIdentifier​(String originIdentifier)
        Returns the FormValidatorVariantDefinitions with the specified originIdentifier.
        Parameters:
        originIdentifier - the origin identifier for which to look up FormValidatorVariantDefinition
        Returns:
        A list of all FormValidatorVariantDefinitions with the specified originIdentifier or null if it does not exist
      • getFormRouterVariantDefinitionsByOriginIdentifier

        List<FormRouterVariantDefinition> getFormRouterVariantDefinitionsByOriginIdentifier​(String originIdentifier)
        Returns the FormRouterVariantDefinitions with the specified originIdentifier.
        Parameters:
        originIdentifier - the origin identifier for which to look up FormRouterVariantDefinition
        Returns:
        A list of all FormRouterVariantDefinitions with the specified originIdentifier or null if it does not exist
      • getFormLogicComponentVariantDefinitionsByOriginIdentifier

        List<FormLogicComponentVariantDefinition> getFormLogicComponentVariantDefinitionsByOriginIdentifier​(String originIdentifier)
        Returns the FormLogicComponentVariantDefinitions with the specified originIdentifier.
        Parameters:
        originIdentifier - the origin identifier for which to look up FormLogicComponentVariantDefinition
        Returns:
        A list of all FormLogicComponentVariantDefinitions with the specified originIdentifier or null if it does not exist
      • getFormSectionByFragmentContainerId

        BasicFormSection getFormSectionByFragmentContainerId​(WmId containerId)
        Returns the FormSection belonging to sectionversion having the passed WmId. Null if the id does not belong to a formsection (i.e. belongs to a formstep insetad)
        Parameters:
        containerId - the identifier for which to look up the formsection
        Returns:
        The formsection
      • getFormsContainingFormSection

        List<Form> getFormsContainingFormSection​(FormSection formSection)
        Returns all forms that (in)directly contain the specified FormSection.
        Parameters:
        formSection - the formsection to search
        Returns:
        A list of all forms (in)directly containing the given form section
      • getCurrentLocale

        String getCurrentLocale()
        Returns the current editing locale, or the Dutch locale if no locale was set yet. This method always returns a locale.
        Returns:
        the current editing locale
        Since:
        10.33.0
      • getLanguage

        Language getLanguage​(String locale)
        Returns the language associated with the specified locale. Tis is the language for which Language.getMetaTagValue() returns the same String as the specified locale
        Parameters:
        locale - Locale of the language to return
        Returns:
        the language associated with the specified locale
        Since:
        10.33.0