Package org.activiti.workflow.simple.definition.form

Examples of org.activiti.workflow.simple.definition.form.TextPropertyDefinition


    return TextPropertyDefinition.class;
  }

  @Override
  public void convertProperty(M2Type contentType, String formSet, Form form, FormPropertyDefinition propertyDefinition, WorkflowDefinitionConversion conversion) {
    TextPropertyDefinition textDefinition = (TextPropertyDefinition) propertyDefinition;
    String propertyName = getPropertyName(textDefinition, conversion);
   
    // Add to content model
    M2Property property = new M2Property();
    property.setMandatory(new M2Mandatory(textDefinition.isMandatory()));
    property.setName(propertyName);
    property.setPropertyType(AlfrescoConversionConstants.PROPERTY_TYPE_TEXT);
   
    M2Model model = AlfrescoConversionUtil.getContentModel(conversion);
    M2Aspect aspect = model.getAspect(propertyName);
    if(aspect != null) {
      // In case the "shared" aspect doesn't have the actual property set yet, we
      // do this here
      if(aspect.getProperties().isEmpty()) {
        aspect.getProperties().add(property);
      }
      contentType.getMandatoryAspects().add(propertyName);
    } else {
      contentType.getProperties().add(property);
    }
   
    // Add form configuration
    form.getFormFieldVisibility().addShowFieldElement(propertyName);
    FormField formField = form.getFormAppearance().addFormField(propertyName, propertyDefinition.getName(), formSet);

    if(!textDefinition.isWritable()) {
      // Read-only properties should always be rendered using an info-template
      FormFieldControl control = new FormFieldControl();
      control.setTemplate(AlfrescoConversionConstants.FORM_READONLY_TEMPLATE);
      formField.setControl(control);
    } else if(textDefinition.isMultiline()) {
      // In case the property is multi-lined, use an alternative control template
      FormFieldControl control = new FormFieldControl();
      control.setTemplate(AlfrescoConversionConstants.FORM_MULTILINE_TEXT_TEMPLATE);
      formField.setControl(control);
    } else {
View Full Code Here


    workflowDefinition.getSteps().add(stepWithForm);
    FormDefinition formDefinition = new FormDefinition();
    stepWithForm.setForm(formDefinition);
    formDefinition.setFormKey("123");
   
    TextPropertyDefinition textProp = new TextPropertyDefinition();
    textProp.setMandatory(true);
    textProp.setName("textProp");
    textProp.setWritable(false);
    formDefinition.addFormProperty(textProp);
    textProp.getParameters().put("custom-parameter", "This is a test");
   
    NumberPropertyDefinition numberProp = new NumberPropertyDefinition();
    numberProp.setMandatory(true);
    numberProp.setName("numberProp");
    numberProp.setWritable(false);
View Full Code Here

        approveEnum.setType("enum");
        approveEnum.addEntry(new ListPropertyEntry("true", "Approve"));
        approveEnum.addEntry(new ListPropertyEntry("false", "Reject"));
        formDefinition.addFormProperty(approveEnum);

        TextPropertyDefinition reason = new TextPropertyDefinition();
        reason.setName("Reason");
        reason.setType("string");
        formDefinition.addFormProperty(reason);

        List<FormProperty> properties = converter.convertProperties(formDefinition);
        assertTrue(properties.size() == 2);
View Full Code Here

    if(type.equals("number")) {
      result = new NumberPropertyDefinition();
    } else if(type.equals("date")) {
      result = new DatePropertyDefinition();
    } else {
      result = new TextPropertyDefinition();
    }
   
    // Set generic properties
    result.setName((String) item.getItemProperty(PropertyTable.ID_PROPERTY_NAME).getValue());
    result.setMandatory((Boolean) ((CheckBox) item.getItemProperty(PropertyTable.ID_PROPERTY_REQUIRED).getValue()).getValue());
View Full Code Here

    humanStep.setId("step1");
    FormDefinition form = new FormDefinition();
   
    humanStep.setForm(form);
   
    TextPropertyDefinition text = new TextPropertyDefinition();
    text.setName("my text");
   
    text.getParameters().put(AlfrescoConversionConstants.PARAMETER_ADD_PROPERTY_TO_OUTPUT, true);
    FormPropertyGroup group = new FormPropertyGroup();
    group.setId("group");
    form.getFormGroups().add(group);
    group.getFormPropertyDefinitions().add(text);
   
View Full Code Here

    group.setId("group");
    group.setTitle("My group");
    humanStep.getForm().addFormPropertyGroup(group);
   
    // Add simple text
    TextPropertyDefinition textProperty = new TextPropertyDefinition();
    textProperty.setName("text");
    textProperty.setMandatory(true);
    group.addFormProperty(textProperty);
   
   
    definition.addStep(humanStep);
   
View Full Code Here

TOP

Related Classes of org.activiti.workflow.simple.definition.form.TextPropertyDefinition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.