Search in sources :

Example 1 with FormFieldControlParameter

use of org.activiti.workflow.simple.alfresco.model.config.FormFieldControlParameter in project Activiti by Activiti.

the class InitializeAlfrescoModelsConversionListener method populateDefaultDetailFormConfig.

protected void populateDefaultDetailFormConfig(Configuration configuration) {
    Form form = configuration.createForm();
    // Add visibility of fields
    form.getFormFieldVisibility().addShowFieldElement(PROPERTY_WORKFLOW_DESCRIPTION);
    form.getFormFieldVisibility().addShowFieldElement(PROPERTY_WORKFLOW_DUE_DATE);
    form.getFormFieldVisibility().addShowFieldElement(PROPERTY_WORKFLOW_PRIORITY);
    form.getFormFieldVisibility().addShowFieldElement(PROPERTY_PACKAGEITEMS);
    form.getFormFieldVisibility().addShowFieldElement(PROPERTY_SEND_EMAIL_NOTIFICATIONS);
    // Add all sets to the appearance
    form.getFormAppearance().addFormSet(FORM_SET_GENERAL, FORM_SET_APPEARANCE_TITLE, FORM_SET_GENERAL_LABEL, null);
    form.getFormAppearance().addFormSet(FORM_SET_INFO, null, null, FORM_SET_TEMPLATE_2_COLUMN);
    form.getFormAppearance().addFormSet(FORM_SET_ASSIGNEE, FORM_SET_APPEARANCE_TITLE, FORM_SET_ASSIGNEE_LABEL, null);
    form.getFormAppearance().addFormSet(FORM_SET_ITEMS, FORM_SET_APPEARANCE_TITLE, FORM_SET_ITEMS_LABEL, null);
    form.getFormAppearance().addFormSet(FORM_SET_OTHER, FORM_SET_APPEARANCE_TITLE, FORM_SET_OTHER_LABEL, null);
    // Finally, add the individual fields
    FormField descriptionField = new FormField();
    descriptionField.setId(PROPERTY_WORKFLOW_DESCRIPTION);
    descriptionField.setControl(new FormFieldControl(FORM_MULTILINE_TEXT_TEMPLATE));
    descriptionField.setLabelId(FORM_WORKFLOW_DESCRIPTION_LABEL);
    form.getFormAppearance().addFormAppearanceElement(descriptionField);
    FormField dueDateField = new FormField();
    dueDateField.setId(PROPERTY_WORKFLOW_DUE_DATE);
    dueDateField.setSet(FORM_SET_INFO);
    dueDateField.setLabelId(FORM_WORKFLOW_DUE_DATE_LABEL);
    dueDateField.setControl(new FormFieldControl(FORM_DATE_TEMPLATE));
    dueDateField.getControl().getControlParameters().add(new FormFieldControlParameter(FORM_DATE_PARAM_SHOW_TIME, Boolean.FALSE.toString()));
    dueDateField.getControl().getControlParameters().add(new FormFieldControlParameter(FORM_DATE_PARAM_SUBMIT_TIME, Boolean.FALSE.toString()));
    form.getFormAppearance().addFormAppearanceElement(dueDateField);
    FormField priorityField = new FormField();
    priorityField.setSet(FORM_SET_INFO);
    priorityField.setLabelId(FORM_WORKFLOW_PRIORITY_LABEL);
    priorityField.setId(PROPERTY_WORKFLOW_PRIORITY);
    priorityField.setControl(new FormFieldControl(FORM_PRIORITY_TEMPLATE));
    form.getFormAppearance().addFormAppearanceElement(priorityField);
    form.getFormAppearance().addFormField(PROPERTY_PACKAGEITEMS, null, FORM_SET_ITEMS);
    FormField emailNotificationsField = new FormField();
    emailNotificationsField.setSet(FORM_SET_OTHER);
    emailNotificationsField.setId(PROPERTY_SEND_EMAIL_NOTIFICATIONS);
    emailNotificationsField.setControl(new FormFieldControl(FORM_EMAIL_NOTIFICATION_TEMPLATE));
    form.getFormAppearance().addFormAppearanceElement(emailNotificationsField);
}
Also used : Form(org.activiti.workflow.simple.alfresco.model.config.Form) FormFieldControl(org.activiti.workflow.simple.alfresco.model.config.FormFieldControl) FormFieldControlParameter(org.activiti.workflow.simple.alfresco.model.config.FormFieldControlParameter) FormField(org.activiti.workflow.simple.alfresco.model.config.FormField)

Example 2 with FormFieldControlParameter

use of org.activiti.workflow.simple.alfresco.model.config.FormFieldControlParameter in project Activiti by Activiti.

the class AlfrescoReferencePropertyConverter method addDueDateReference.

protected void addDueDateReference(Form form, String formSet, boolean writable) {
    String fieldName = null;
    if (form.isStartForm()) {
        fieldName = AlfrescoConversionConstants.PROPERTY_WORKFLOW_DUE_DATE;
    } else {
        fieldName = AlfrescoConversionConstants.PROPERTY_DUE_DATE;
    }
    form.getFormFieldVisibility().addShowFieldElement(fieldName);
    FormField formField = form.getFormAppearance().addFormField(fieldName, AlfrescoConversionConstants.FORM_WORKFLOW_DUE_DATE_LABEL, formSet);
    if (form.isStartForm() || writable) {
        formField.setControl(new FormFieldControl(AlfrescoConversionConstants.FORM_DATE_TEMPLATE));
        formField.getControl().getControlParameters().add(new FormFieldControlParameter(AlfrescoConversionConstants.FORM_DATE_PARAM_SHOW_TIME, Boolean.FALSE.toString()));
        formField.getControl().getControlParameters().add(new FormFieldControlParameter(AlfrescoConversionConstants.FORM_DATE_PARAM_SUBMIT_TIME, Boolean.FALSE.toString()));
    } else {
        formField.setControl(new FormFieldControl(AlfrescoConversionConstants.FORM_READONLY_TEMPLATE));
    }
    form.getFormAppearance().addFormAppearanceElement(formField);
}
Also used : FormFieldControl(org.activiti.workflow.simple.alfresco.model.config.FormFieldControl) FormFieldControlParameter(org.activiti.workflow.simple.alfresco.model.config.FormFieldControlParameter) FormField(org.activiti.workflow.simple.alfresco.model.config.FormField)

Aggregations

FormField (org.activiti.workflow.simple.alfresco.model.config.FormField)2 FormFieldControl (org.activiti.workflow.simple.alfresco.model.config.FormFieldControl)2 FormFieldControlParameter (org.activiti.workflow.simple.alfresco.model.config.FormFieldControlParameter)2 Form (org.activiti.workflow.simple.alfresco.model.config.Form)1