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

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


    return NumberPropertyDefinition.class;
  }

  @Override
  public void convertProperty(M2Type contentType, String formSet, Form form, FormPropertyDefinition propertyDefinition, WorkflowDefinitionConversion conversion) {
    NumberPropertyDefinition numberPropertyDefinition = (NumberPropertyDefinition) propertyDefinition;
    String propertyName = getPropertyName(propertyDefinition, conversion);
   
    // Add to content model
    M2Property property = new M2Property();
    property.setMandatory(new M2Mandatory(numberPropertyDefinition.isMandatory()));
    property.setName(propertyName);
    property.setPropertyType(AlfrescoConversionConstants.PROPERTY_TYPE_DOUBLE);
   
    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(numberPropertyDefinition.isWritable()) {
      // Use custom date-control
      FormFieldControl control = new FormFieldControl();
      control.setTemplate(AlfrescoConversionConstants.FORM_NUMBER_TEMPLATE);
      formField.setControl(control);
    } else {
View Full Code Here


    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);
    formDefinition.addFormProperty(numberProp);
   
    ReferencePropertyDefinition reference = new ReferencePropertyDefinition();
    reference.setMandatory(true);
    reference.setName("referenceProp");
View Full Code Here

  protected FormPropertyDefinition getFormPropertyDefinition(Item item) {
    String type = (String) ((ComboBox) item.getItemProperty(PropertyTable.ID_PROPERTY_TYPE).getValue()).getValue();
   
    FormPropertyDefinition result = null;
    if(type.equals("number")) {
      result = new NumberPropertyDefinition();
    } else if(type.equals("date")) {
      result = new DatePropertyDefinition();
    } else {
      result = new TextPropertyDefinition();
    }
View Full Code Here

TOP

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

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.