Search in sources :

Example 1 with TypeInfoImpl

use of org.kie.workbench.common.forms.model.impl.TypeInfoImpl in project kie-wb-common by kiegroup.

the class MultipleSubformBackendFormRenderingContextManagerTest method getNestedForms.

@Override
protected FormDefinition[] getNestedForms() {
    JavaFormModel model = new PortableJavaModel(Person.class.getName());
    FormDefinition creationForm = new FormDefinition(model);
    creationForm.setId("person-creation");
    FieldDefinition field = fieldManager.getDefinitionByDataType(new TypeInfoImpl(Long.class.getName()));
    field.setName("id");
    field.setBinding("id");
    creationForm.getFields().add(field);
    field = fieldManager.getDefinitionByDataType(new TypeInfoImpl(String.class.getName()));
    field.setName("name");
    field.setBinding("name");
    creationForm.getFields().add(field);
    field = fieldManager.getDefinitionByDataType(new TypeInfoImpl(String.class.getName()));
    field.setName("lastName");
    field.setBinding("lastName");
    creationForm.getFields().add(field);
    field = fieldManager.getDefinitionByDataType(new TypeInfoImpl(Date.class.getName()));
    field.setName("birthday");
    field.setBinding("birthday");
    creationForm.getFields().add(field);
    FormDefinition editionForm = new FormDefinition(model);
    editionForm.setId("person-edition");
    field = fieldManager.getDefinitionByDataType(new TypeInfoImpl(Long.class.getName()));
    field.setName("id");
    field.setBinding("id");
    editionForm.getFields().add(field);
    field = fieldManager.getDefinitionByDataType(new TypeInfoImpl(String.class.getName()));
    field.setName("name");
    field.setBinding("name");
    editionForm.getFields().add(field);
    field = fieldManager.getDefinitionByDataType(new TypeInfoImpl(String.class.getName()));
    field.setName("lastName");
    field.setBinding("lastName");
    editionForm.getFields().add(field);
    field = fieldManager.getDefinitionByDataType(new TypeInfoImpl(Date.class.getName()));
    field.setName("birthday");
    field.setBinding("birthday");
    editionForm.getFields().add(field);
    return new FormDefinition[] { creationForm, editionForm };
}
Also used : FieldDefinition(org.kie.workbench.common.forms.model.FieldDefinition) MultipleSubFormFieldDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.relations.multipleSubform.definition.MultipleSubFormFieldDefinition) PortableJavaModel(org.kie.workbench.common.forms.model.impl.PortableJavaModel) FormDefinition(org.kie.workbench.common.forms.model.FormDefinition) TypeInfoImpl(org.kie.workbench.common.forms.model.impl.TypeInfoImpl) JavaFormModel(org.kie.workbench.common.forms.model.JavaFormModel) Person(org.kie.workbench.common.forms.dynamic.backend.server.context.generation.dynamic.impl.model.Person) Date(java.util.Date)

Example 2 with TypeInfoImpl

use of org.kie.workbench.common.forms.model.impl.TypeInfoImpl in project kie-wb-common by kiegroup.

the class ProcessableModelBackendFormRenderingContextManagerTest method getRootForm.

@Override
protected FormDefinition getRootForm() {
    FormDefinition form = new FormDefinition();
    FieldDefinition field = fieldManager.getDefinitionByDataType(new TypeInfoImpl(TypeKind.OBJECT, ProcessableModel.class.getName(), false));
    field.setName(MODEL);
    field.setBinding(MODEL);
    SubFormFieldDefinition subForm = (SubFormFieldDefinition) field;
    subForm.setNestedForm(ROOT_FORM_ID);
    form.getFields().add(field);
    return form;
}
Also used : SubFormFieldDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.relations.subForm.definition.SubFormFieldDefinition) MultipleSubFormFieldDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.relations.multipleSubform.definition.MultipleSubFormFieldDefinition) FieldDefinition(org.kie.workbench.common.forms.model.FieldDefinition) SubFormFieldDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.relations.subForm.definition.SubFormFieldDefinition) MultipleSubFormFieldDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.relations.multipleSubform.definition.MultipleSubFormFieldDefinition) FormDefinition(org.kie.workbench.common.forms.model.FormDefinition) TypeInfoImpl(org.kie.workbench.common.forms.model.impl.TypeInfoImpl)

Example 3 with TypeInfoImpl

use of org.kie.workbench.common.forms.model.impl.TypeInfoImpl in project kie-wb-common by kiegroup.

the class EmptyMultipleSubformBackendFormRenderingContextManagerTest method getRootForm.

@Override
protected FormDefinition getRootForm() {
    FormDefinition form = new FormDefinition(new PortableJavaModel(Person.class.getName()));
    form.setId("form");
    FieldDefinition field = fieldManager.getDefinitionByDataType(new TypeInfoImpl(TypeKind.OBJECT, Person.class.getName(), true));
    field.setName("persons");
    field.setBinding("persons");
    MultipleSubFormFieldDefinition multpleSubForm = (MultipleSubFormFieldDefinition) field;
    multpleSubForm.setCreationForm("person-creation");
    multpleSubForm.setEditionForm("person-edition");
    form.getFields().add(field);
    return form;
}
Also used : FieldDefinition(org.kie.workbench.common.forms.model.FieldDefinition) MultipleSubFormFieldDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.relations.multipleSubform.definition.MultipleSubFormFieldDefinition) PortableJavaModel(org.kie.workbench.common.forms.model.impl.PortableJavaModel) FormDefinition(org.kie.workbench.common.forms.model.FormDefinition) TypeInfoImpl(org.kie.workbench.common.forms.model.impl.TypeInfoImpl) MultipleSubFormFieldDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.relations.multipleSubform.definition.MultipleSubFormFieldDefinition)

Example 4 with TypeInfoImpl

use of org.kie.workbench.common.forms.model.impl.TypeInfoImpl in project kie-wb-common by kiegroup.

the class NestedFormBackendFormRenderingContextManagerTest method getNestedForms.

@Override
protected FormDefinition[] getNestedForms() {
    FormDefinition form = new FormDefinition(new PortableJavaModel(Person.class.getName()));
    form.setId(Person.class.getName());
    FieldDefinition field = fieldManager.getDefinitionByDataType(new TypeInfoImpl(Integer.class.getName()));
    field.setName("id");
    field.setBinding("id");
    form.getFields().add(field);
    field = fieldManager.getDefinitionByDataType(new TypeInfoImpl(String.class.getName()));
    field.setName("name");
    field.setBinding("name");
    form.getFields().add(field);
    field = fieldManager.getDefinitionByDataType(new TypeInfoImpl(String.class.getName()));
    field.setName("lastName");
    field.setBinding("lastName");
    form.getFields().add(field);
    field = fieldManager.getDefinitionByDataType(new TypeInfoImpl(Date.class.getName()));
    field.setName("birthday");
    field.setBinding("birthday");
    form.getFields().add(field);
    return new FormDefinition[] { form };
}
Also used : FieldDefinition(org.kie.workbench.common.forms.model.FieldDefinition) SubFormFieldDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.relations.subForm.definition.SubFormFieldDefinition) PortableJavaModel(org.kie.workbench.common.forms.model.impl.PortableJavaModel) FormDefinition(org.kie.workbench.common.forms.model.FormDefinition) TypeInfoImpl(org.kie.workbench.common.forms.model.impl.TypeInfoImpl) Person(org.kie.workbench.common.forms.dynamic.backend.server.context.generation.dynamic.impl.model.Person) Date(java.util.Date)

Example 5 with TypeInfoImpl

use of org.kie.workbench.common.forms.model.impl.TypeInfoImpl in project kie-wb-common by kiegroup.

the class NestedFormBackendFormRenderingContextManagerTest method getRootForm.

@Override
protected FormDefinition getRootForm() {
    FormDefinition form = new FormDefinition(new PortableJavaModel(Person.class.getName()));
    FieldDefinition field = fieldManager.getDefinitionByDataType(new TypeInfoImpl(TypeKind.OBJECT, Person.class.getName(), false));
    field.setName("person");
    field.setBinding("person");
    SubFormFieldDefinition subForm = (SubFormFieldDefinition) field;
    subForm.setNestedForm(Person.class.getName());
    form.getFields().add(field);
    return form;
}
Also used : SubFormFieldDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.relations.subForm.definition.SubFormFieldDefinition) FieldDefinition(org.kie.workbench.common.forms.model.FieldDefinition) SubFormFieldDefinition(org.kie.workbench.common.forms.fields.shared.fieldTypes.relations.subForm.definition.SubFormFieldDefinition) PortableJavaModel(org.kie.workbench.common.forms.model.impl.PortableJavaModel) FormDefinition(org.kie.workbench.common.forms.model.FormDefinition) TypeInfoImpl(org.kie.workbench.common.forms.model.impl.TypeInfoImpl) Person(org.kie.workbench.common.forms.dynamic.backend.server.context.generation.dynamic.impl.model.Person)

Aggregations

TypeInfoImpl (org.kie.workbench.common.forms.model.impl.TypeInfoImpl)32 ModelPropertyImpl (org.kie.workbench.common.forms.model.impl.ModelPropertyImpl)19 FieldDefinition (org.kie.workbench.common.forms.model.FieldDefinition)17 FormDefinition (org.kie.workbench.common.forms.model.FormDefinition)17 ModelProperty (org.kie.workbench.common.forms.model.ModelProperty)15 ArrayList (java.util.ArrayList)13 Test (org.junit.Test)10 MultipleSubFormFieldDefinition (org.kie.workbench.common.forms.fields.shared.fieldTypes.relations.multipleSubform.definition.MultipleSubFormFieldDefinition)8 FormGenerationResult (org.kie.workbench.common.forms.jbpm.server.service.formGeneration.FormGenerationResult)8 PortableJavaModel (org.kie.workbench.common.forms.model.impl.PortableJavaModel)8 TextBoxFieldDefinition (org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.textBox.definition.TextBoxFieldDefinition)7 Date (java.util.Date)6 SubFormFieldDefinition (org.kie.workbench.common.forms.fields.shared.fieldTypes.relations.subForm.definition.SubFormFieldDefinition)6 TaskFormModel (org.kie.workbench.common.forms.jbpm.model.authoring.task.TaskFormModel)6 TypeInfo (org.kie.workbench.common.forms.model.TypeInfo)6 Person (org.kie.workbench.common.forms.dynamic.backend.server.context.generation.dynamic.impl.model.Person)4 CheckBoxFieldDefinition (org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.checkBox.definition.CheckBoxFieldDefinition)4 IntegerBoxFieldDefinition (org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.integerBox.definition.IntegerBoxFieldDefinition)4 BusinessProcessFormModel (org.kie.workbench.common.forms.jbpm.model.authoring.process.BusinessProcessFormModel)4 BasicTypeFieldProvider (org.kie.workbench.common.forms.fields.shared.fieldTypes.basic.BasicTypeFieldProvider)3