mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Cleaned up some unused methods in Form Processors.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@21751 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -36,6 +36,7 @@ import org.apache.commons.logging.LogFactory;
|
||||
* the filter mechanism.
|
||||
*
|
||||
* @author Gavin Cornwell
|
||||
* @author Nick Smith
|
||||
*/
|
||||
public abstract class FilteredFormProcessor<ItemType, PersistType> extends AbstractFormProcessor
|
||||
{
|
||||
@@ -68,10 +69,8 @@ public abstract class FilteredFormProcessor<ItemType, PersistType> extends Abstr
|
||||
this.ignoredFields = ignoredFields;
|
||||
}
|
||||
|
||||
/*
|
||||
* @see
|
||||
* org.alfresco.repo.forms.processor.FormProcessor#generate(org.alfresco
|
||||
* .repo.forms.Item, java.util.List, java.util.List, java.util.Map)
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public Form generate(Item item, List<String> fields, List<String> forcedFields, Map<String, Object> context)
|
||||
{
|
||||
@@ -101,7 +100,6 @@ public abstract class FilteredFormProcessor<ItemType, PersistType> extends Abstr
|
||||
filter.afterGenerate(typedItem, fields, forcedFields, form, context);
|
||||
}
|
||||
}
|
||||
|
||||
return form;
|
||||
}
|
||||
|
||||
@@ -171,6 +169,12 @@ public abstract class FilteredFormProcessor<ItemType, PersistType> extends Abstr
|
||||
log.debug("Generated form: " + form);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method generates all the fields to be added and adds them to the Form, together with the associated field data.
|
||||
* @param form The {@link Form} to which the fields are added.
|
||||
* @param fields The names of all the fields to be added.
|
||||
* @param data {@link FormCreationData} used to generate all the fields.
|
||||
*/
|
||||
protected void populateForm(Form form, List<String> fields, FormCreationData data)
|
||||
{
|
||||
List<Field> fieldsToAdd;
|
||||
@@ -225,6 +229,18 @@ public abstract class FilteredFormProcessor<ItemType, PersistType> extends Abstr
|
||||
return fieldData;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets the field processor registry.
|
||||
*
|
||||
* @param fieldProcessorRegistry
|
||||
* The {@link FieldProcessorRegistry} to use.
|
||||
*/
|
||||
public void setFieldProcessorRegistry(FieldProcessorRegistry fieldProcessorRegistry)
|
||||
{
|
||||
this.fieldProcessorRegistry = fieldProcessorRegistry;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a data object used by the {@link FormProcessor} and {@link FieldProcessor FieldProcessors} to create {@link Field Fields}
|
||||
* @return
|
||||
@@ -263,17 +279,6 @@ public abstract class FilteredFormProcessor<ItemType, PersistType> extends Abstr
|
||||
* @return
|
||||
*/
|
||||
protected abstract String getItemURI(ItemType item);
|
||||
|
||||
/**
|
||||
* Sets the field processor registry.
|
||||
*
|
||||
* @param fieldProcessorRegistry
|
||||
* The {@link FieldProcessorRegistry} to use.
|
||||
*/
|
||||
public void setFieldProcessorRegistry(FieldProcessorRegistry fieldProcessorRegistry)
|
||||
{
|
||||
this.fieldProcessorRegistry = fieldProcessorRegistry;
|
||||
}
|
||||
|
||||
/**
|
||||
* Persists the form data.
|
||||
@@ -284,5 +289,13 @@ public abstract class FilteredFormProcessor<ItemType, PersistType> extends Abstr
|
||||
*/
|
||||
protected abstract PersistType internalPersist(ItemType item, FormData data);
|
||||
|
||||
/**
|
||||
* When a {@link Form} is generated with no field names specifically set then a default {@link Form} is created.
|
||||
* The default {@link Form} contains all the properties and associations related to the {@link Item}, excluding a
|
||||
* blacklist of ignored fields which defaults to the return value of this method.
|
||||
* The default ignored values can be overridden by setting the property <code>ignoredFields</code>.
|
||||
*
|
||||
* @return the names of all the fields to be excluded from the default {@link Form} if no <code>defaultFields</code> property is explicitly set.
|
||||
*/
|
||||
protected abstract List<String> getDefaultIgnoredFields();
|
||||
}
|
||||
|
@@ -60,14 +60,14 @@ public class AssociationFieldProcessor extends QNameFieldProcessor<AssociationDe
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the associated value from the {@link ItemData}.
|
||||
* Gets the associated value from the {@link ContentModelItemData}.
|
||||
* If the value is <code>null</code> the method returns an empty {@link List}.
|
||||
* If the value is a single Object (assumed to be a NodeRef) it returns a {@link List} containing a {@link String} representation of that object.
|
||||
* If the value is a {@link Collection} of Objects, returns a {@link List} containing {@link String} representations of all the objects.
|
||||
* @return An {@link ArrayList} of Strings or <code>null</code>.
|
||||
*/
|
||||
@Override
|
||||
protected Object getValue(QName name, ItemData<?> data)
|
||||
protected Object getValue(QName name, ContentModelItemData<?> data)
|
||||
{
|
||||
Serializable values = data.getAssociationValue(name);
|
||||
if (values == null)
|
||||
@@ -116,7 +116,7 @@ public class AssociationFieldProcessor extends QNameFieldProcessor<AssociationDe
|
||||
* @see org.alfresco.repo.forms.processor.node.QNameFieldProcessor#getTypeDefinition(org.alfresco.service.namespace.QName, org.alfresco.repo.forms.processor.node.ItemData, boolean)
|
||||
*/
|
||||
@Override
|
||||
protected AssociationDefinition getTypeDefinition(QName fullName, ItemData<?> itemData, boolean isForcedField)
|
||||
protected AssociationDefinition getTypeDefinition(QName fullName, ContentModelItemData<?> itemData, boolean isForcedField)
|
||||
{
|
||||
AssociationDefinition assocDefinition = itemData.getAssociationDefinition(fullName);
|
||||
if (assocDefinition == null)
|
||||
|
@@ -27,7 +27,6 @@ import static org.alfresco.repo.forms.processor.node.FormFieldConstants.PROP_DAT
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -44,7 +43,6 @@ import org.alfresco.repo.forms.FormException;
|
||||
import org.alfresco.repo.forms.FormData.FieldData;
|
||||
import org.alfresco.repo.forms.processor.FilteredFormProcessor;
|
||||
import org.alfresco.repo.forms.processor.FormCreationData;
|
||||
import org.alfresco.service.cmr.dictionary.AspectDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.AssociationDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.ChildAssociationDefinition;
|
||||
import org.alfresco.service.cmr.dictionary.ConstraintDefinition;
|
||||
@@ -64,7 +62,6 @@ import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.service.namespace.RegexQNamePattern;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.json.JSONArray;
|
||||
@@ -164,7 +161,7 @@ public abstract class ContentModelFormProcessor<ItemType, PersistType> extends
|
||||
this.contentService = contentService;
|
||||
}
|
||||
|
||||
protected void addPropertyDataIfRequired(QName propName, Form form, ItemData<?> itemData)
|
||||
protected void addPropertyDataIfRequired(QName propName, Form form, ContentModelItemData<?> itemData)
|
||||
{
|
||||
String dataKey = makePropDataKey(propName);
|
||||
if(form.dataExists(dataKey)== false)
|
||||
@@ -190,22 +187,8 @@ public abstract class ContentModelFormProcessor<ItemType, PersistType> extends
|
||||
return defaultFieldBuilder.buildDefaultFields();
|
||||
}
|
||||
|
||||
protected Map<QName, AssociationDefinition> populateAssociations(TypeDefinition typeDef)
|
||||
{
|
||||
// we only get the associations of the actual type so
|
||||
// we also need to manually get associations from any
|
||||
// mandatory aspects
|
||||
HashMap<QName, AssociationDefinition> allAssocs = new HashMap<QName, AssociationDefinition>();
|
||||
allAssocs.putAll(typeDef.getAssociations());
|
||||
List<AspectDefinition> aspects = typeDef.getDefaultAspects(true);
|
||||
for (AspectDefinition aspect : aspects) {
|
||||
allAssocs.putAll(aspect.getAssociations());
|
||||
}
|
||||
return Collections.unmodifiableMap(allAssocs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ItemData<ItemType> makeItemData(ItemType item)
|
||||
protected ContentModelItemData<ItemType> makeItemData(ItemType item)
|
||||
{
|
||||
TypeDefinition baseType = getBaseType(item);
|
||||
Set<QName> aspects = getAspectNames(item);
|
||||
@@ -215,7 +198,7 @@ public abstract class ContentModelFormProcessor<ItemType, PersistType> extends
|
||||
Map<QName, Serializable> propValues = getPropertyValues(item);
|
||||
Map<QName, Serializable> assocValues = getAssociationValues(item);
|
||||
Map<String, Object> transientValues = getTransientValues(item);
|
||||
return new ItemData<ItemType>(item, propDefs, assocDefs, propValues, assocValues, transientValues);
|
||||
return new ContentModelItemData<ItemType>(item, propDefs, assocDefs, propValues, assocValues, transientValues);
|
||||
}
|
||||
|
||||
protected Set<QName> getAspectNames(ItemType item)
|
||||
@@ -231,33 +214,6 @@ public abstract class ContentModelFormProcessor<ItemType, PersistType> extends
|
||||
|
||||
protected abstract TypeDefinition getBaseType(ItemType item);
|
||||
|
||||
/**
|
||||
* Retrieves the values of the given association definition on the given
|
||||
* node.
|
||||
*
|
||||
* @param nodeRef The node to get the association values for
|
||||
* @param assocDef The association definition to look for values for
|
||||
* @return List of values for association or null of the association does
|
||||
* not exist for the given node.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
protected List retrieveAssociationValues(NodeRef nodeRef, AssociationDefinition assocDef)
|
||||
{
|
||||
List assocValues = null;
|
||||
|
||||
// get the list of values (if any) for the association
|
||||
if (assocDef instanceof ChildAssociationDefinition)
|
||||
{
|
||||
assocValues = this.nodeService.getChildAssocs(nodeRef, assocDef.getName(), RegexQNamePattern.MATCH_ALL);
|
||||
}
|
||||
else
|
||||
{
|
||||
assocValues = this.nodeService.getTargetAssocs(nodeRef, assocDef.getName());
|
||||
}
|
||||
|
||||
return assocValues;
|
||||
}
|
||||
|
||||
/**
|
||||
* Persists the given FormData on the given NodeRef
|
||||
*
|
||||
|
@@ -41,7 +41,7 @@ import org.alfresco.service.namespace.QName;
|
||||
* @since 3.4
|
||||
* @author Nick Smith
|
||||
*/
|
||||
public class ItemData<ItemType> implements TransientValueGetter
|
||||
public class ContentModelItemData<ItemType> implements TransientValueGetter
|
||||
{
|
||||
private final ItemType item;
|
||||
private final Map<QName, PropertyDefinition> propDefs;
|
||||
@@ -50,7 +50,7 @@ public class ItemData<ItemType> implements TransientValueGetter
|
||||
private final Map<QName, Serializable> assocValues;
|
||||
private final Map<String, Object> transientValues;
|
||||
|
||||
public ItemData(ItemType item,
|
||||
public ContentModelItemData(ItemType item,
|
||||
Map<QName, PropertyDefinition> propDefs,
|
||||
Map<QName, AssociationDefinition> assocDefs,
|
||||
Map<QName, Serializable> propValues,
|
@@ -47,7 +47,7 @@ public class DefaultFieldBuilder
|
||||
private static final Log MY_LOGGER = LogFactory.getLog(DefaultFieldBuilder.class);
|
||||
|
||||
private final FormCreationData formData;
|
||||
private final ItemData<?> ItemData;
|
||||
private final ContentModelItemData<?> ItemData;
|
||||
private final FieldProcessorRegistry registry;
|
||||
private final NamespaceService namespaceService;
|
||||
private final List<String> ignoredFields;
|
||||
@@ -73,7 +73,7 @@ public class DefaultFieldBuilder
|
||||
this.registry = registry;
|
||||
this.namespaceService = namespaceService;
|
||||
this.ignoredFields = getNonNullList(ignoredFields );
|
||||
this.ItemData = (ItemData<?>) formData.getItemData();
|
||||
this.ItemData = (ContentModelItemData<?>) formData.getItemData();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -61,7 +61,7 @@ public class DefaultFieldProcessor extends QNameFieldProcessor<ClassAttributeDef
|
||||
}
|
||||
|
||||
@Override
|
||||
public Field generateField(QName fullName, ItemData<?> itemData, boolean isForcedField)
|
||||
public Field generateField(QName fullName, ContentModelItemData<?> itemData, boolean isForcedField)
|
||||
{
|
||||
Field fieldInfo = propProcessor.generateField(fullName, itemData, isForcedField);
|
||||
if (fieldInfo == null)
|
||||
@@ -100,7 +100,7 @@ public class DefaultFieldProcessor extends QNameFieldProcessor<ClassAttributeDef
|
||||
* @see org.alfresco.repo.forms.processor.node.QNameFieldProcessor#getTypeDefinition(org.alfresco.service.namespace.QName, org.alfresco.repo.forms.processor.node.ItemData, boolean)
|
||||
*/
|
||||
@Override
|
||||
protected ClassAttributeDefinition getTypeDefinition(QName fullName, ItemData<?> itemData, boolean isForcedField)
|
||||
protected ClassAttributeDefinition getTypeDefinition(QName fullName, ContentModelItemData<?> itemData, boolean isForcedField)
|
||||
{
|
||||
throw new UnsupportedOperationException("This method should never be called!");
|
||||
}
|
||||
@@ -109,7 +109,7 @@ public class DefaultFieldProcessor extends QNameFieldProcessor<ClassAttributeDef
|
||||
* @see org.alfresco.repo.forms.processor.node.QNameFieldProcessor#getValue(org.alfresco.service.namespace.QName, org.alfresco.repo.forms.processor.node.ItemData)
|
||||
*/
|
||||
@Override
|
||||
protected Object getValue(QName fullName, ItemData<?> itemData)
|
||||
protected Object getValue(QName fullName, ContentModelItemData<?> itemData)
|
||||
{
|
||||
throw new UnsupportedOperationException("This method should never be called!");
|
||||
}
|
||||
|
@@ -136,7 +136,7 @@ public class FieldProcessorTest extends TestCase
|
||||
data = new FormCreationDataImpl(makeItemData(), null, null);
|
||||
}
|
||||
|
||||
private ItemData<Void> makeItemData()
|
||||
private ContentModelItemData<Void> makeItemData()
|
||||
{
|
||||
Map<QName, PropertyDefinition> propDefs = makePropertyDefs();
|
||||
Map<QName, AssociationDefinition> assocDefs = makeAssociationDefs();
|
||||
@@ -144,7 +144,7 @@ public class FieldProcessorTest extends TestCase
|
||||
Map<QName, Serializable> propValues = new HashMap<QName, Serializable>();
|
||||
Map<QName, Serializable> assocValues = new HashMap<QName, Serializable>();
|
||||
Map<String, Object> transientValues = new HashMap<String, Object>();
|
||||
return new ItemData<Void>(null, propDefs, assocDefs, propValues, assocValues, transientValues);
|
||||
return new ContentModelItemData<Void>(null, propDefs, assocDefs, propValues, assocValues, transientValues);
|
||||
}
|
||||
|
||||
private Map<QName, AssociationDefinition> makeAssociationDefs()
|
||||
|
@@ -72,7 +72,7 @@ public class PropertyFieldProcessor extends QNameFieldProcessor<PropertyDefiniti
|
||||
}
|
||||
|
||||
@Override
|
||||
protected PropertyDefinition getTypeDefinition(QName fullName, ItemData<?> itemData, boolean isForcedField)
|
||||
protected PropertyDefinition getTypeDefinition(QName fullName, ContentModelItemData<?> itemData, boolean isForcedField)
|
||||
{
|
||||
PropertyDefinition propDef = itemData.getPropertyDefinition(fullName);
|
||||
if (propDef == null)
|
||||
@@ -100,7 +100,7 @@ public class PropertyFieldProcessor extends QNameFieldProcessor<PropertyDefiniti
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getValue(QName name, ItemData<?> data)
|
||||
public Object getValue(QName name, ContentModelItemData<?> data)
|
||||
{
|
||||
Serializable value = data.getPropertyValue(name);
|
||||
if (value == null)
|
||||
@@ -127,7 +127,7 @@ public class PropertyFieldProcessor extends QNameFieldProcessor<PropertyDefiniti
|
||||
return value;
|
||||
}
|
||||
|
||||
private Object getDefaultValue(QName name, ItemData<?> data)
|
||||
private Object getDefaultValue(QName name, ContentModelItemData<?> data)
|
||||
{
|
||||
PropertyDefinition propDef = data.getPropertyDefinition(name);
|
||||
if(propDef !=null)
|
||||
|
@@ -37,7 +37,7 @@ import org.alfresco.service.namespace.QName;
|
||||
*
|
||||
* @param <Type>
|
||||
*/
|
||||
public abstract class QNameFieldProcessor<Type extends ClassAttributeDefinition> extends AbstractFieldProcessor<ItemData<?>>
|
||||
public abstract class QNameFieldProcessor<Type extends ClassAttributeDefinition> extends AbstractFieldProcessor<ContentModelItemData<?>>
|
||||
{
|
||||
protected NamespaceService namespaceService;
|
||||
protected DictionaryService dictionaryService;
|
||||
@@ -57,7 +57,7 @@ public abstract class QNameFieldProcessor<Type extends ClassAttributeDefinition>
|
||||
* @see org.alfresco.repo.forms.field.processor.AbstractFieldProcessor#generateTypedField(java.lang.String, java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
protected Field generateTypedField(String fieldName, FormCreationData formData, ItemData<?> typedData)
|
||||
protected Field generateTypedField(String fieldName, FormCreationData formData, ContentModelItemData<?> typedData)
|
||||
{
|
||||
QName fullName = getFullName(fieldName);
|
||||
boolean isForcedField = formData.isForcedField(fieldName);
|
||||
@@ -78,7 +78,7 @@ public abstract class QNameFieldProcessor<Type extends ClassAttributeDefinition>
|
||||
return attribDef.getName().toPrefixString(namespaceService);
|
||||
}
|
||||
|
||||
public Field generateField(QName fullName, ItemData<?> itemData, boolean isForcedField)
|
||||
public Field generateField(QName fullName, ContentModelItemData<?> itemData, boolean isForcedField)
|
||||
{
|
||||
Type propDef = getTypeDefinition(fullName, itemData, isForcedField);
|
||||
Field field = null;
|
||||
@@ -137,11 +137,11 @@ public abstract class QNameFieldProcessor<Type extends ClassAttributeDefinition>
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
protected Class<ItemData<?>> getExpectedDataType()
|
||||
protected Class<ContentModelItemData<?>> getExpectedDataType()
|
||||
{
|
||||
// This is nasty but unavoidable because of generics.
|
||||
Object clazz = ItemData.class;
|
||||
return (Class<ItemData<?>>)clazz;
|
||||
Object clazz = ContentModelItemData.class;
|
||||
return (Class<ContentModelItemData<?>>)clazz;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -164,7 +164,7 @@ public abstract class QNameFieldProcessor<Type extends ClassAttributeDefinition>
|
||||
|
||||
protected abstract FieldGroup getGroup(Type typeDef);
|
||||
|
||||
protected abstract Object getValue(QName fullName, ItemData<?> itemData);
|
||||
protected abstract Object getValue(QName fullName, ContentModelItemData<?> itemData);
|
||||
|
||||
protected abstract Type getTypeDefinition(QName fullName, ItemData<?> itemData, boolean isForcedField);
|
||||
protected abstract Type getTypeDefinition(QName fullName, ContentModelItemData<?> itemData, boolean isForcedField);
|
||||
}
|
@@ -47,6 +47,7 @@ import static org.alfresco.repo.forms.processor.node.FormFieldConstants.*;
|
||||
* types in the Alfresco content model.
|
||||
*
|
||||
* @author Gavin Cornwell
|
||||
* @author Nick Smith
|
||||
* @author 3.4
|
||||
*/
|
||||
public class TypeFormProcessor extends ContentModelFormProcessor<TypeDefinition, NodeRef>
|
||||
|
@@ -30,7 +30,7 @@ import org.alfresco.repo.forms.Item;
|
||||
import org.alfresco.repo.forms.FormData.FieldData;
|
||||
import org.alfresco.repo.forms.processor.FormCreationData;
|
||||
import org.alfresco.repo.forms.processor.node.ContentModelFormProcessor;
|
||||
import org.alfresco.repo.forms.processor.node.ItemData;
|
||||
import org.alfresco.repo.forms.processor.node.ContentModelItemData;
|
||||
import org.alfresco.repo.workflow.WorkflowModel;
|
||||
import org.alfresco.service.cmr.workflow.WorkflowService;
|
||||
import org.alfresco.util.ParameterCheck;
|
||||
@@ -54,7 +54,7 @@ public abstract class AbstractWorkflowFormProcessor<ItemType, PersistType> exten
|
||||
super.populateForm(form, fields, data);
|
||||
|
||||
// Add package actions to FormData.
|
||||
ItemData<?> itemData = (ItemData<?>) data.getItemData();
|
||||
ContentModelItemData<?> itemData = (ContentModelItemData<?>) data.getItemData();
|
||||
addPropertyDataIfRequired(WorkflowModel.PROP_PACKAGE_ACTION_GROUP, form, itemData);
|
||||
addPropertyDataIfRequired(WorkflowModel.PROP_PACKAGE_ITEM_ACTION_GROUP, form, itemData);
|
||||
}
|
||||
|
@@ -23,7 +23,7 @@ import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.repo.forms.FormData.FieldData;
|
||||
import org.alfresco.repo.forms.processor.node.ItemData;
|
||||
import org.alfresco.repo.forms.processor.node.ContentModelItemData;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
import org.alfresco.service.cmr.dictionary.PropertyDefinition;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
@@ -51,9 +51,9 @@ public abstract class ContentModelFormPersister<T> implements FormPersister<T>
|
||||
protected final DataKeyMatcher keyMatcher;
|
||||
protected final DictionaryService dictionaryService;
|
||||
protected final Log logger;
|
||||
protected final ItemData<?> itemData;
|
||||
protected final ContentModelItemData<?> itemData;
|
||||
|
||||
public ContentModelFormPersister(ItemData<?> itemData, NamespaceService namespaceService, DictionaryService dictionaryService, Log logger)
|
||||
public ContentModelFormPersister(ContentModelItemData<?> itemData, NamespaceService namespaceService, DictionaryService dictionaryService, Log logger)
|
||||
{
|
||||
this.dictionaryService= dictionaryService;
|
||||
this.logger = logger==null ? LOGGER : logger;
|
||||
|
@@ -23,7 +23,7 @@ import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.repo.forms.FormData.FieldData;
|
||||
import org.alfresco.repo.forms.processor.node.ItemData;
|
||||
import org.alfresco.repo.forms.processor.node.ContentModelItemData;
|
||||
import org.alfresco.repo.workflow.TaskUpdater;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
@@ -45,7 +45,7 @@ public class TaskFormPersister extends ContentModelFormPersister<WorkflowTask>
|
||||
private final TaskUpdater updater;
|
||||
private String transitionId = null;
|
||||
|
||||
public TaskFormPersister(ItemData<WorkflowTask> itemData,
|
||||
public TaskFormPersister(ContentModelItemData<WorkflowTask> itemData,
|
||||
NamespaceService namespaceService,
|
||||
DictionaryService dictionaryService,
|
||||
WorkflowService workflowService,
|
||||
|
@@ -34,7 +34,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.repo.forms.processor.FieldProcessorRegistry;
|
||||
import org.alfresco.repo.forms.processor.node.ItemData;
|
||||
import org.alfresco.repo.forms.processor.node.ContentModelItemData;
|
||||
import org.alfresco.repo.workflow.WorkflowModel;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
import org.alfresco.service.cmr.dictionary.TypeDefinition;
|
||||
@@ -198,9 +198,9 @@ public class TaskFormProcessor extends AbstractWorkflowFormProcessor<WorkflowTas
|
||||
if (hiddenValues != null)
|
||||
{
|
||||
if (hiddenValues instanceof List<?>)
|
||||
{
|
||||
return (List<String>) hiddenValues;
|
||||
}
|
||||
{
|
||||
return (List<String>) hiddenValues;
|
||||
}
|
||||
else if (hiddenValues instanceof String && ((String)hiddenValues).length() > 0)
|
||||
{
|
||||
return Arrays.asList(((String)hiddenValues).split(","));
|
||||
@@ -215,7 +215,7 @@ public class TaskFormProcessor extends AbstractWorkflowFormProcessor<WorkflowTas
|
||||
@Override
|
||||
protected ContentModelFormPersister<WorkflowTask> makeFormPersister(WorkflowTask item)
|
||||
{
|
||||
ItemData<WorkflowTask> itemData = makeItemData(item);
|
||||
ContentModelItemData<WorkflowTask> itemData = makeItemData(item);
|
||||
return new TaskFormPersister(itemData, namespaceService, dictionaryService, workflowService, nodeService, LOGGER);
|
||||
}
|
||||
}
|
||||
|
@@ -22,7 +22,7 @@ package org.alfresco.repo.forms.processor.workflow;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.repo.forms.processor.node.ItemData;
|
||||
import org.alfresco.repo.forms.processor.node.ContentModelItemData;
|
||||
import org.alfresco.repo.workflow.WorkflowBuilder;
|
||||
import org.alfresco.service.cmr.dictionary.DictionaryService;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
@@ -44,7 +44,7 @@ public class WorkflowFormPersister extends ContentModelFormPersister<WorkflowIns
|
||||
{
|
||||
private final WorkflowBuilder builder;
|
||||
|
||||
public WorkflowFormPersister(ItemData<?> itemData,
|
||||
public WorkflowFormPersister(ContentModelItemData<?> itemData,
|
||||
NamespaceService namespaceService,
|
||||
DictionaryService dictionaryService,
|
||||
WorkflowService workflowService,
|
||||
|
@@ -22,7 +22,7 @@ import java.io.Serializable;
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.repo.forms.processor.node.ItemData;
|
||||
import org.alfresco.repo.forms.processor.node.ContentModelItemData;
|
||||
import org.alfresco.service.cmr.dictionary.TypeDefinition;
|
||||
import org.alfresco.service.cmr.workflow.WorkflowDefinition;
|
||||
import org.alfresco.service.cmr.workflow.WorkflowInstance;
|
||||
@@ -150,7 +150,7 @@ public class WorkflowFormProcessor extends AbstractWorkflowFormProcessor<Workflo
|
||||
@Override
|
||||
protected ContentModelFormPersister<WorkflowInstance> makeFormPersister(WorkflowDefinition item)
|
||||
{
|
||||
ItemData<WorkflowDefinition> itemData = makeItemData(item);
|
||||
ContentModelItemData<WorkflowDefinition> itemData = makeItemData(item);
|
||||
return new WorkflowFormPersister(itemData, namespaceService, dictionaryService, workflowService, nodeService, logger);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user