Class CoreComponentFormGenerator


  • public class CoreComponentFormGenerator
    extends java.lang.Object
    This class generates Core Component forms. Note: Layout layer specific properties (columnCount, columnClassNames, gridClassNames) are not supported. Note: All Server side propeties like submit action , prefill service etc which is not part of JSON would not be present when form is created
    • Constructor Detail

      • CoreComponentFormGenerator

        public CoreComponentFormGenerator​(@Nullable
                                          ResourceResolver resourceResolver,
                                          @Nonnull
                                          java.lang.String crisprJsonString,
                                          @Nullable
                                          java.util.Map<java.lang.String,​java.lang.String> resourceMappings,
                                          boolean createResources,
                                          FormDataSchema.SchemaType dataSchemaType)
      • CoreComponentFormGenerator

        public CoreComponentFormGenerator​(@Nullable
                                          ResourceResolver resourceResolver,
                                          @Nonnull
                                          java.lang.String crisprJsonString)
      • CoreComponentFormGenerator

        public CoreComponentFormGenerator​(@Nullable
                                          ResourceResolver resourceResolver,
                                          @Nonnull
                                          java.lang.String crisprJsonString,
                                          @Nullable
                                          java.util.Map<java.lang.String,​java.lang.String> resourceMappings,
                                          FormDataSchema.SchemaType schemaType)
    • Method Detail

      • generateForm

        public java.lang.String generateForm()
                                      throws java.lang.Exception
        Returns a form as a JSON string which can be used in the content tree inside form editor
        Returns:
        the generated form as a JSON string.
        Throws:
        java.lang.Exception - if an error occurs during form generation.
      • generateForm

        public java.lang.String generateForm​(@Nullable
                                             java.lang.String formContainerPath)
                                      throws java.lang.Exception
        Returns a form as a JSON string which can be used in the content tree inside form editor Optionally specifying form container path, would additionally create form resources inside the specified form container path
        Parameters:
        formContainerPath - the path to the form container, or null to use the default.
        Returns:
        the generated form as a JSON string.
        Throws:
        java.lang.Exception - if an error occurs during form generation.