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

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


    return DatePropertyDefinition.class;
  }

  @Override
  public void convertProperty(M2Type contentType, String formSet, Form form, FormPropertyDefinition propertyDefinition, WorkflowDefinitionConversion conversion) {
    DatePropertyDefinition dateDefinition = (DatePropertyDefinition) propertyDefinition;
    String propertyName = getPropertyName(propertyDefinition, conversion);
   
    // Add to content model
    M2Property property = new M2Property();
    property.setMandatory(new M2Mandatory(dateDefinition.isMandatory()));
    property.setName(propertyName);
   
    if(dateDefinition.isShowTime()) {
      property.setPropertyType(AlfrescoConversionConstants.PROPERTY_TYPE_DATETIME);
    } else {
      property.setPropertyType(AlfrescoConversionConstants.PROPERTY_TYPE_DATE);
    }
   
    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, dateDefinition.getName(), formSet);

    if(dateDefinition.isWritable()) {
      // Use custom date-control
      FormFieldControl control = new FormFieldControl();
      control.setTemplate(AlfrescoConversionConstants.FORM_DATE_TEMPLATE);
      control.addControlParameter(AlfrescoConversionConstants.FORM_DATE_PARAM_SHOW_TIME,
          Boolean.toString(dateDefinition.isShowTime()));
      control.addControlParameter(AlfrescoConversionConstants.FORM_DATE_PARAM_SUBMIT_TIME,
          Boolean.toString(dateDefinition.isShowTime()));
      formField.setControl(control);
    } else {
      // Read-only properties should always be rendered using an info-template
      FormFieldControl control = new FormFieldControl();
      control.setTemplate(AlfrescoConversionConstants.FORM_READONLY_TEMPLATE);
View Full Code Here


   
    FormPropertyDefinition result = null;
    if(type.equals("number")) {
      result = new NumberPropertyDefinition();
    } else if(type.equals("date")) {
      result = new DatePropertyDefinition();
    } else {
      result = new TextPropertyDefinition();
    }
   
    // Set generic properties
View Full Code Here

TOP

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

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.