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 {