use of org.alfresco.repo.forms.Form in project alfresco-repository by Alfresco.
the class WorkflowFormProcessorTest method testGenerateSingleProperty.
public void testGenerateSingleProperty() {
// Check Status field is added to Form.
String fieldName = PRIORITY_NAME.toPrefixString(namespaceService);
List<String> fields = Arrays.asList(fieldName);
Form form = processForm(fields);
checkSingleProperty(form, fieldName, 2);
// Check Status field is added to Form, when explicitly typed as a
// property.
String fullPropertyName = "prop:" + fieldName;
fields = Arrays.asList(fullPropertyName);
form = processForm(fields);
checkSingleProperty(form, fieldName, 2);
checkPackageActionGroups(form.getFormData());
}
use of org.alfresco.repo.forms.Form in project alfresco-repository by Alfresco.
the class WorkflowFormProcessorTest method testGenerateSingleAssociation.
public void testGenerateSingleAssociation() {
Serializable values = (Serializable) Collections.emptyList();
// Check Assignee field is added to Form.
String fieldName = ASSIGNEE_NAME.toPrefixString(namespaceService);
List<String> fields = Arrays.asList(fieldName);
Form form = processForm(fields);
checkSingleAssociation(form, fieldName, values);
// Check Assignee field is added to Form, when explicitly typed as an
// association.
String fullAssociationName = "assoc:" + fieldName;
fields = Arrays.asList(fullAssociationName);
form = processForm(fields);
checkSingleAssociation(form, fieldName, values);
checkPackageActionGroups(form.getFormData());
}
use of org.alfresco.repo.forms.Form in project alfresco-repository by Alfresco.
the class WorkflowFormProcessorTest method testGeneratePackageItems.
public void testGeneratePackageItems() throws Exception {
// Check empty package
String fieldName = PackageItemsFieldProcessor.KEY;
Form form = processForm(fieldName);
Serializable packageItems = (Serializable) Collections.emptyList();
checkSingleAssociation(form, fieldName, packageItems);
}
use of org.alfresco.repo.forms.Form in project alfresco-repository by Alfresco.
the class TaskFormProcessorTest method testEscapeMultiValuedProperty.
public void testEscapeMultiValuedProperty() throws Exception {
try {
ExtendedPropertyFieldProcessor extendedProcessor = new ExtendedPropertyFieldProcessor();
extendedProcessor.addEscapedPropertyName(STATUS_NAME);
processor.setExtendedPropertyFieldProcessor(extendedProcessor);
// Check Status field is added to Form.
String fieldName = STATUS_NAME.toPrefixString(namespaceService);
List<String> fields = Arrays.asList(fieldName);
Form form = processForm(fields);
checkSingleProperty(form, fieldName, WorkflowTaskState.IN_PROGRESS);
// Check Status field is added to Form, when explicitly typed as a
// property.
String fullPropertyName = "prop:" + fieldName;
fields = Arrays.asList(fullPropertyName);
form = processForm(fields);
checkSingleProperty(form, fieldName, WorkflowTaskState.IN_PROGRESS);
checkPackageActionGroups(form.getFormData());
} finally {
processor.setExtendedPropertyFieldProcessor(null);
}
}
use of org.alfresco.repo.forms.Form in project alfresco-repository by Alfresco.
the class TaskFormProcessorTest method testGenerateSingleAssociation.
public void testGenerateSingleAssociation() {
// Check Assignee field is added to Form.
String fieldName = ASSIGNEE_NAME.toPrefixString(namespaceService);
List<String> fields = Arrays.asList(fieldName);
Form form = processForm(fields);
Serializable fieldData = (Serializable) Arrays.asList(FAKE_NODE.toString());
checkSingleAssociation(form, fieldName, fieldData);
// Check Assignee field is added to Form, when explicitly typed as an
// association.
String fullAssociationName = "assoc:" + fieldName;
fields = Arrays.asList(fullAssociationName);
form = processForm(fields);
checkSingleAssociation(form, fieldName, fieldData);
checkPackageActionGroups(form.getFormData());
}
Aggregations