org.alfresco.service.cmr.dictionary.DataTypeDefinition Java Examples

The following examples show how to use org.alfresco.service.cmr.dictionary.DataTypeDefinition. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ObjectIdLuceneBuilder.java    From alfresco-data-model with GNU Lesser General Public License v3.0 6 votes vote down vote up
private <Q, S, E extends Throwable> String getValueAsString(LuceneQueryParserAdaptor<Q, S, E> lqpa, Serializable value)
{
	String nodeRefStr = null;
    if(!NodeRef.isNodeRef((String)value))
    {
        // assume the object id is the node guid
        StoreRef storeRef = getStore(lqpa);
    	nodeRefStr = storeRef.toString() + "/" + (String)value;
    }
    else
    {
    	nodeRefStr = (String)value;
    }

    Object converted = DefaultTypeConverter.INSTANCE.convert(dictionaryService.getDataType(DataTypeDefinition.NODE_REF), nodeRefStr);
    String asString = DefaultTypeConverter.INSTANCE.convert(String.class, converted);
    return asString;
}
 
Example #2
Source File: BaseTemplateRenderingEngine.java    From alfresco-repository with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
protected Collection<ParameterDefinition> getParameterDefinitions()
{
    Collection<ParameterDefinition> paramList = super.getParameterDefinitions();
    ParameterDefinitionImpl modelParamDef = new ParameterDefinitionImpl(PARAM_MODEL, DataTypeDefinition.ANY, false,
            getParamDisplayLabel(PARAM_MODEL));
    ParameterDefinitionImpl templateParamDef = new ParameterDefinitionImpl(//
            PARAM_TEMPLATE, DataTypeDefinition.TEXT, false, getParamDisplayLabel(PARAM_TEMPLATE));
    ParameterDefinitionImpl templateNodeParamDef = new ParameterDefinitionImpl(PARAM_TEMPLATE_NODE,
            DataTypeDefinition.NODE_REF, false, getParamDisplayLabel(PARAM_TEMPLATE_NODE));
    ParameterDefinitionImpl templatePathParamDef = new ParameterDefinitionImpl(PARAM_TEMPLATE_PATH,
            DataTypeDefinition.TEXT, false, getParamDisplayLabel(PARAM_TEMPLATE_PATH));
    paramList.add(new ParameterDefinitionImpl(PARAM_MIME_TYPE, DataTypeDefinition.TEXT, false,
            getParamDisplayLabel(PARAM_MIME_TYPE)));
    paramList.add(modelParamDef);
    paramList.add(templateParamDef);
    paramList.add(templateNodeParamDef);
    paramList.add(templatePathParamDef);
    return paramList;
}
 
Example #3
Source File: ActionFormProcessor.java    From alfresco-repository with GNU Lesser General Public License v3.0 6 votes vote down vote up
protected List<Field> generateDefaultFields(FormCreationData data, List<String> fieldsToIgnore)
{
    List<Field> fields = new ArrayList<Field>();
    
    ActionItemData itemData = (ActionItemData)data.getItemData();
    
    // generate a field for each action parameter
    for (ParameterDefinition paramDef : itemData.getActionDefinition().getParameterDefinitions())
    {
        if (!fieldsToIgnore.contains(paramDef.getName()))
        {
            ActionParameterField actionParameterField = new ActionParameterField(paramDef, actionService);
            fields.add(actionParameterField);
        }
    }
    
    // And also generate the special case of "execute asynchronously", which is not defined
    // as an ActionParameter within the ActionExecuter, but is instead available for all actions.
    fields.add(new ActionNonParameterField(EXECUTE_ASYNCHRONOUSLY, DataTypeDefinition.BOOLEAN));
    
    return fields;
}
 
Example #4
Source File: MetadataEncryptor.java    From alfresco-repository with GNU Lesser General Public License v3.0 6 votes vote down vote up
/**
 * Decrypt a property if the data definition (model-specific) requires it.
 * 
 * @param propertyQName             the property qualified name
 * @param inbound                   the property to decrypt
 * @return                          the decrypted property or the original if it wasn't encrypted
 */
public Serializable decrypt(QName propertyQName, Serializable inbound)
{
    PropertyDefinition propertyDef = dictionaryService.getProperty(propertyQName);
    if (inbound == null || propertyDef == null || !(propertyDef.getDataType().getName().equals(DataTypeDefinition.ENCRYPTED)))
    {
        return inbound;
    }
    if (!(inbound instanceof SealedObject))
    {
        return inbound;
    }
    try
    {
     Serializable outbound = encryptor.unsealObject(KeyProvider.ALIAS_METADATA, inbound);
     // Done
     return outbound;
    }
    catch(KeyException e)
    {
    	throw new AlfrescoRuntimeException("Invalid metadata decryption key", e);
    }
}
 
Example #5
Source File: DirectLuceneBuilder.java    From alfresco-data-model with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public <Q, S, E extends Throwable> String getLuceneSortField(LuceneQueryParserAdaptor<Q, S, E> lqpa) throws E
{
    String field = getLuceneFieldName();
    // need to find the real field to use
    PropertyDefinition propertyDef = dictionaryService.getProperty(QName.createQName(field.substring(1)));

    if (propertyDef.getDataType().getName().equals(DataTypeDefinition.CONTENT))
    {
        throw new CmisInvalidArgumentException("Order on content properties is not curently supported");
    }
    else if ((propertyDef.getDataType().getName().equals(DataTypeDefinition.MLTEXT)) || (propertyDef.getDataType().getName().equals(DataTypeDefinition.TEXT)))
    {
        field = lqpa.getSortField(field);
    }
    else if (propertyDef.getDataType().getName().equals(DataTypeDefinition.DATETIME))
    {
        field = lqpa.getDatetimeSortField(field, propertyDef);
    }        

    return field;
}
 
Example #6
Source File: ExecuteAllRulesActionExecuter.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * @see org.alfresco.repo.action.ParameterizedItemAbstractBase#addParameterDefinitions(java.util.List)
 */
@Override
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
{
    paramList.add(new ParameterDefinitionImpl(PARAM_EXECUTE_INHERITED_RULES, DataTypeDefinition.BOOLEAN, false, getParamDisplayLabel(PARAM_EXECUTE_INHERITED_RULES)));
    paramList.add(new ParameterDefinitionImpl(PARAM_RUN_ALL_RULES_ON_CHILDREN, DataTypeDefinition.BOOLEAN, false, getParamDisplayLabel(PARAM_RUN_ALL_RULES_ON_CHILDREN)));
}
 
Example #7
Source File: CustomModelsImpl.java    From alfresco-remote-api with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void validateUsage(QName propDataType)
{
    if (propDataType != null && !(DataTypeDefinition.TEXT.equals(propDataType)
                || DataTypeDefinition.MLTEXT.equals(propDataType)
                || DataTypeDefinition.CONTENT.equals(propDataType)))
    {
        throw new InvalidArgumentException("cmm.rest_api.length_constraint_invalid_use");
    }
}
 
Example #8
Source File: ContentPropertyRestrictionInterceptor.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
private boolean isContentProperty(QName propertyQName, Serializable propValue)
{
    if (propValue instanceof ContentData)
    {
        return true;
    }

    PropertyDefinition contentPropDef = dictionaryService.getProperty(propertyQName);
    return contentPropDef != null && contentPropDef.getDataType().getName().equals(DataTypeDefinition.CONTENT);
}
 
Example #9
Source File: DelegateModelQuery.java    From alfresco-data-model with GNU Lesser General Public License v3.0 5 votes vote down vote up
public DataTypeDefinition getDataType(QName name)
{
    DataTypeDefinition def = query.getDataType(name);
    if (def == null)
    {
        def = delegate.getDataType(name);
    }
    return def;
}
 
Example #10
Source File: SizeFieldProcessor.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
protected FieldDefinition makeTransientFieldDefinition() 
{
    String dataKeyName = PROP_DATA_PREFIX + KEY;
    PropertyFieldDefinition sizeField = new PropertyFieldDefinition(KEY, 
                DataTypeDefinition.LONG.getLocalName());
    sizeField.setLabel(I18NUtil.getMessage(MSG_SIZE_LABEL));
    sizeField.setDescription(I18NUtil.getMessage(MSG_SIZE_DESC));
    sizeField.setDataKeyName(dataKeyName);
    sizeField.setProtectedField(true);
    return sizeField;
}
 
Example #11
Source File: TikaPoweredContainerExtractor.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
protected void addParameterDefinitions(List<ParameterDefinition> paramList) {
   paramList.add(new ParameterDefinitionImpl(
         PARAM_MIME_TYPES,
         DataTypeDefinition.TEXT,
         false,
         getParamDisplayLabel(PARAM_MIME_TYPES)
   ));
}
 
Example #12
Source File: ComparePropertyValueEvaluator.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Add parameter definitions
 */
@Override
protected void addParameterDefinitions(List<ParameterDefinition> paramList) 
{
    paramList.add(new ParameterDefinitionImpl(PARAM_PROPERTY, DataTypeDefinition.QNAME, false, getParamDisplayLabel(PARAM_PROPERTY)));
    paramList.add(new ParameterDefinitionImpl(PARAM_CONTENT_PROPERTY, DataTypeDefinition.TEXT, false, getParamDisplayLabel(PARAM_CONTENT_PROPERTY), false, "ac-content-properties"));
    paramList.add(new ParameterDefinitionImpl(PARAM_VALUE, DataTypeDefinition.ANY, true, getParamDisplayLabel(PARAM_VALUE)));
    paramList.add(new ParameterDefinitionImpl(PARAM_OPERATION, DataTypeDefinition.TEXT, false, getParamDisplayLabel(PARAM_OPERATION), false, "ac-compare-operations"));
}
 
Example #13
Source File: CheckOutActionExecuter.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Add the parameter defintions
 */
@Override
protected void addParameterDefinitions(List<ParameterDefinition> paramList) 
{
    paramList.add(new ParameterDefinitionImpl(PARAM_DESTINATION_FOLDER, DataTypeDefinition.NODE_REF, false, getParamDisplayLabel(PARAM_DESTINATION_FOLDER)));
    paramList.add(new ParameterDefinitionImpl(PARAM_ASSOC_TYPE_QNAME, DataTypeDefinition.QNAME, false, getParamDisplayLabel(PARAM_ASSOC_TYPE_QNAME)));
    paramList.add(new ParameterDefinitionImpl(PARAM_ASSOC_QNAME, DataTypeDefinition.QNAME, false, getParamDisplayLabel(PARAM_ASSOC_QNAME)));
}
 
Example #14
Source File: CreateThumbnailActionExecuter.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * @see org.alfresco.repo.action.ParameterizedItemAbstractBase#addParameterDefinitions(java.util.List)
 */
@Override
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
{
    paramList.add(new ParameterDefinitionImpl(PARAM_THUMBANIL_NAME, DataTypeDefinition.TEXT, true, getParamDisplayLabel(PARAM_THUMBANIL_NAME)));      
    paramList.add(new ParameterDefinitionImpl(PARAM_CONTENT_PROPERTY, DataTypeDefinition.QNAME, false, getParamDisplayLabel(PARAM_CONTENT_PROPERTY)));        
}
 
Example #15
Source File: AlfrescoSolrDataModel.java    From SearchServices with GNU Lesser General Public License v3.0 5 votes vote down vote up
private void addFacetSearchFields(PropertyDefinition propertyDefinition, IndexedField indexedField)
{
    if(propertyDefinition.getDataType().getName().equals(DataTypeDefinition.TEXT))
    {
        if (!isIdentifierTextProperty(propertyDefinition.getName()))
        {
            if(propertyDefinition.getFacetable() == Facetable.TRUE)
            {
                indexedField.addField(getFieldForText(false, false, false, propertyDefinition), false, false);
            }
        }
    }


    if ((propertyDefinition.getIndexTokenisationMode() == IndexTokenisationMode.FALSE)
            || (propertyDefinition.getIndexTokenisationMode() == IndexTokenisationMode.BOTH)
            || isIdentifierTextProperty(propertyDefinition.getName()))
    {

        indexedField.addField(getFieldForText(false, false, false, propertyDefinition), false, false);
    }
    else
    {
        if(crossLocaleSearchDataTypes.contains(propertyDefinition.getDataType().getName()) || crossLocaleSearchProperties.contains(propertyDefinition.getName()))
        {
            indexedField.addField(getFieldForText(false, true, false, propertyDefinition), false, false);
        }
        else
        {
            indexedField.addField(getFieldForText(true, true, false, propertyDefinition), false, false);
        }
    }
}
 
Example #16
Source File: ComparePropertyValueEvaluatorTest.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
private void createTestModel()
{
    M2Model model = M2Model.createModel("test:comparepropertyvalueevaluatortest");
    model.createNamespace(TEST_TYPE_NAMESPACE, "test");
    model.createImport(NamespaceService.DICTIONARY_MODEL_1_0_URI, NamespaceService.DICTIONARY_MODEL_PREFIX);
    model.createImport(NamespaceService.SYSTEM_MODEL_1_0_URI, NamespaceService.SYSTEM_MODEL_PREFIX);
    model.createImport(NamespaceService.CONTENT_MODEL_1_0_URI, NamespaceService.CONTENT_MODEL_PREFIX);

    M2Type testType = model.createType("test:" + TEST_TYPE_QNAME.getLocalName());
    testType.setParentName("cm:" + ContentModel.TYPE_CONTENT.getLocalName());
    
    M2Property prop1 = testType.createProperty("test:" + PROP_TEXT.getLocalName());
    prop1.setMandatory(false);
    prop1.setType("d:" + DataTypeDefinition.TEXT.getLocalName());
    prop1.setMultiValued(false);
    
    M2Property prop2 = testType.createProperty("test:" + PROP_INT.getLocalName());
    prop2.setMandatory(false);
    prop2.setType("d:" + DataTypeDefinition.INT.getLocalName());
    prop2.setMultiValued(false);
    
    M2Property prop3 = testType.createProperty("test:" + PROP_DATETIME.getLocalName());
    prop3.setMandatory(false);
    prop3.setType("d:" + DataTypeDefinition.DATETIME.getLocalName());
    prop3.setMultiValued(false);
    
    M2Property prop4 = testType.createProperty("test:" + PROP_NODEREF.getLocalName());
    prop4.setMandatory(false);
    prop4.setType("d:" + DataTypeDefinition.NODE_REF.getLocalName());
    prop4.setMultiValued(false);

    M2Property prop5 = testType.createProperty("test:" + PROP_MULTI_VALUE.getLocalName());
    prop5.setMandatory(false);
    prop5.setType("d:" + DataTypeDefinition.TEXT.getLocalName());
    prop5.setMultiValued(true);

    dictionaryDAO.putModel(model);
}
 
Example #17
Source File: AncestorNodeLocator.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
* {@inheritDoc}
*/
@Override
public List<ParameterDefinition> getParameterDefinitions()
{
    List<ParameterDefinition> paramDefs = new ArrayList<ParameterDefinition>(2);
    paramDefs.add(new ParameterDefinitionImpl(TYPE_KEY, DataTypeDefinition.QNAME, false, "Type"));
    paramDefs.add(new ParameterDefinitionImpl(ASPECT_KEY, DataTypeDefinition.QNAME, false, "Aspect"));
    return paramDefs;
}
 
Example #18
Source File: SolrInformationServerTest.java    From SearchServices with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Test
public void destructuringCanBeAppliedToDateTimeFields()
{
    PropertyDefinition propertyThatCanBeDestructured = mock(PropertyDefinition.class);
    when(propertyThatCanBeDestructured.isMultiValued()).thenReturn(false);

    DataTypeDefinition datetime = mock(DataTypeDefinition.class);
    when(datetime.getName()).thenReturn(DataTypeDefinition.DATETIME);
    when(propertyThatCanBeDestructured.getDataType()).thenReturn(datetime);

    assertTrue(
            "Destructuring must be supported in Datetime fields!",
            infoServer.canBeDestructured(propertyThatCanBeDestructured, "datetime@sd@{http://www.alfresco.org/model/content/1.0}created"));
}
 
Example #19
Source File: WorkflowFormProcessorTest.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
private Map<QName, PropertyDefinition> makeTaskPropertyDefs()
{
    Map<QName, PropertyDefinition> properties = new HashMap<QName, PropertyDefinition>();
    QName intType = DataTypeDefinition.INT;
    MockClassAttributeDefinition priorityDef = MockClassAttributeDefinition.mockPropertyDefinition(PRIORITY_NAME, intType, "2");
    properties.put(PRIORITY_NAME, priorityDef);
    
    QName textType = DataTypeDefinition.TEXT;

    // Add a Description property
    PropertyDefinition descValue = MockClassAttributeDefinition.mockPropertyDefinition(DESC_NAME, textType);
    properties.put(DESC_NAME, descValue);

    // Add a Status property
    PropertyDefinition titleValue = MockClassAttributeDefinition.mockPropertyDefinition(STATUS_NAME, textType);
    properties.put(STATUS_NAME, titleValue);

    // Add a Status property
    PropertyDefinition with_ = MockClassAttributeDefinition.mockPropertyDefinition(PROP_WITH_, textType);
    properties.put(PROP_WITH_, with_);

    // Add a Package Action property
    QName pckgActionGroup = PROP_PACKAGE_ACTION_GROUP;
    PropertyDefinition pckgAction = MockClassAttributeDefinition.mockPropertyDefinition(pckgActionGroup, textType,
                "add_package_item_actions");
    properties.put(pckgActionGroup, pckgAction);

    // Add a Package Action property
    QName pckgItemActionGroup = PROP_PACKAGE_ITEM_ACTION_GROUP;
    PropertyDefinition pckgItemAction = MockClassAttributeDefinition.mockPropertyDefinition(pckgItemActionGroup,
                textType, "start_package_item_actions");
    properties.put(pckgItemActionGroup, pckgItemAction);

    return properties;
}
 
Example #20
Source File: SolrFacetServiceImpl.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
private boolean isNumeric(DataTypeDefinition datatype)
{
    boolean result;
    try
    {
        Class<?> clazz = Class.forName(datatype.getJavaClassName());
        result = Number.class.isAssignableFrom(clazz);
    } catch (ClassNotFoundException e)
    {
        result = false;
    }
    return result;
}
 
Example #21
Source File: TaskFormProcessorTest.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
private Map<QName, PropertyDefinition> makeTaskPropertyDefs()
{
    Map<QName, PropertyDefinition> properties = new HashMap<QName, PropertyDefinition>();
    QName textType = DataTypeDefinition.TEXT;

    // Add a Description property
    PropertyDefinition descValue = MockClassAttributeDefinition.mockPropertyDefinition(DESC_NAME, textType);
    properties.put(DESC_NAME, descValue);

    // Add a Status property
    PropertyDefinition titleValue = MockClassAttributeDefinition.mockPropertyDefinition(STATUS_NAME, textType);
    properties.put(STATUS_NAME, titleValue);

    // Add a Status property
    PropertyDefinition with_ = MockClassAttributeDefinition.mockPropertyDefinition(PROP_WITH_, textType);
    properties.put(PROP_WITH_, with_);

    // Add a Package Action property
    QName pckgActionGroup = PROP_PACKAGE_ACTION_GROUP;
    PropertyDefinition pckgAction = MockClassAttributeDefinition.mockPropertyDefinition(pckgActionGroup, textType,
                "");
    properties.put(pckgActionGroup, pckgAction);

    // Add a Package Action property
    QName pckgItemActionGroup = PROP_PACKAGE_ITEM_ACTION_GROUP;
    PropertyDefinition pckgItemAction = MockClassAttributeDefinition.mockPropertyDefinition(pckgItemActionGroup,
                textType, "read_package_item_actions");
    properties.put(pckgItemActionGroup, pckgItemAction);
    
    
    // Add a priority property
    QName priorityName = PROP_PRIORITY;
    PropertyDefinition priorityDef = 
        MockClassAttributeDefinition.mockPropertyDefinition(priorityName, DataTypeDefinition.INT, Integer.class, "0");
    properties.put(priorityName, priorityDef);

    return properties;
}
 
Example #22
Source File: CompiledModel.java    From alfresco-data-model with GNU Lesser General Public License v3.0 5 votes vote down vote up
public DataTypeDefinition getDataType(Class javaClass)
{
    for (DataTypeDefinition dataTypeDef : dataTypes.values())
    {
        if (dataTypeDef.getJavaClassName().equals(javaClass.getName()))
        {
            return dataTypeDef;
        }
    }
    return null;
}
 
Example #23
Source File: SelectorPropertyContentStore.java    From alfresco-simple-content-stores with Apache License 2.0 5 votes vote down vote up
private void afterPropertiesSet_setupChangePolicies()
{
    if (this.moveStoresOnChangeOptionPropertyName != null)
    {
        this.moveStoresOnChangeOptionPropertyQName = QName.resolveToQName(this.namespaceService,
                this.moveStoresOnChangeOptionPropertyName);
        PropertyCheck.mandatory(this, "moveStoresOnChangeOptionPropertyQName", this.moveStoresOnChangeOptionPropertyQName);

        final PropertyDefinition moveStoresOnChangeOptionPropertyDefinition = this.dictionaryService
                .getProperty(this.moveStoresOnChangeOptionPropertyQName);
        if (moveStoresOnChangeOptionPropertyDefinition == null
                || !DataTypeDefinition.BOOLEAN.equals(moveStoresOnChangeOptionPropertyDefinition.getDataType().getName())
                || moveStoresOnChangeOptionPropertyDefinition.isMultiValued())
        {
            throw new IllegalStateException(this.moveStoresOnChangeOptionPropertyName
                    + " is not a valid content model property of type single-valued d:boolean");
        }
    }

    if (this.moveStoresOnChange || this.moveStoresOnChangeOptionPropertyQName != null)
    {
        this.policyComponent.bindClassBehaviour(OnUpdatePropertiesPolicy.QNAME, this.selectorClassQName,
                new JavaBehaviour(this, "onUpdateProperties", NotificationFrequency.EVERY_EVENT));

        final ClassDefinition classDefinition = this.dictionaryService.getClass(this.selectorClassQName);
        if (classDefinition.isAspect())
        {
            this.policyComponent.bindClassBehaviour(BeforeRemoveAspectPolicy.QNAME, this.selectorClassQName,
                    new JavaBehaviour(this, "beforeRemoveAspect", NotificationFrequency.EVERY_EVENT));
            this.policyComponent.bindClassBehaviour(OnAddAspectPolicy.QNAME, this.selectorClassQName,
                    new JavaBehaviour(this, "onAddAspect", NotificationFrequency.EVERY_EVENT));
        }
    }
}
 
Example #24
Source File: ActionFormProcessorTest.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override protected void addParameterDefinitions(List<ParameterDefinition> paramList)
{
    paramList.add(new ParameterDefinitionImpl("check", DataTypeDefinition.BOOLEAN, false, "Check"));
    paramList.add(new ParameterDefinitionImpl("date", DataTypeDefinition.DATE, false, "Date"));
    paramList.add(new ParameterDefinitionImpl("qname", DataTypeDefinition.QNAME, false, "QName", true));
    paramList.add(new ParameterDefinitionImpl("nodeRefs", DataTypeDefinition.NODE_REF, false, "NodeRefs", true));
}
 
Example #25
Source File: SimpleWorkflowActionExecuter.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
protected void addParameterDefinitions(List<ParameterDefinition> paramList) 
{
    paramList.add(new ParameterDefinitionImpl(PARAM_APPROVE_STEP, DataTypeDefinition.TEXT, true, getParamDisplayLabel(PARAM_APPROVE_STEP)));
    paramList.add(new ParameterDefinitionImpl(PARAM_APPROVE_FOLDER, DataTypeDefinition.NODE_REF, true, getParamDisplayLabel(PARAM_APPROVE_FOLDER)));
    paramList.add(new ParameterDefinitionImpl(PARAM_APPROVE_MOVE, DataTypeDefinition.BOOLEAN, true, getParamDisplayLabel(PARAM_APPROVE_MOVE)));
    paramList.add(new ParameterDefinitionImpl(PARAM_REJECT_STEP, DataTypeDefinition.TEXT, false, getParamDisplayLabel(PARAM_REJECT_STEP)));
    paramList.add(new ParameterDefinitionImpl(PARAM_REJECT_FOLDER, DataTypeDefinition.NODE_REF, false, getParamDisplayLabel(PARAM_REJECT_FOLDER)));
    paramList.add(new ParameterDefinitionImpl(PARAM_REJECT_MOVE, DataTypeDefinition.BOOLEAN, false, getParamDisplayLabel(PARAM_REJECT_MOVE)));        
}
 
Example #26
Source File: PerformRenditionActionExecuter.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
protected void addParameterDefinitions(List<ParameterDefinition> paramList)
{
    paramList.add(new ParameterDefinitionImpl(PARAM_RENDITION_DEFINITION, DataTypeDefinition.ANY, true,
                getParamDisplayLabel(PARAM_RENDITION_DEFINITION)));

    paramList.add(new ParameterDefinitionImpl(PARAM_RESULT, DataTypeDefinition.CHILD_ASSOC_REF, false,
                getParamDisplayLabel(PARAM_RESULT)));
}
 
Example #27
Source File: SiteRoutingFileContentStore.java    From alfresco-simple-content-stores with Apache License 2.0 5 votes vote down vote up
protected void afterPropertiesSet_setupChangePolicies()
{
    if (this.moveStoresOnNodeMoveOrCopyOverridePropertyName != null)
    {
        this.moveStoresOnNodeMoveOrCopyOverridePropertyQName = QName.resolveToQName(this.namespaceService,
                this.moveStoresOnNodeMoveOrCopyOverridePropertyName);
        PropertyCheck.mandatory(this, "moveStoresOnNodeMoveOrCopyOverridePropertyQName",
                this.moveStoresOnNodeMoveOrCopyOverridePropertyQName);

        final PropertyDefinition moveStoresOnChangeOptionPropertyDefinition = this.dictionaryService
                .getProperty(this.moveStoresOnNodeMoveOrCopyOverridePropertyQName);
        if (moveStoresOnChangeOptionPropertyDefinition == null
                || !DataTypeDefinition.BOOLEAN.equals(moveStoresOnChangeOptionPropertyDefinition.getDataType().getName())
                || moveStoresOnChangeOptionPropertyDefinition.isMultiValued())
        {
            throw new IllegalStateException(this.moveStoresOnNodeMoveOrCopyOverridePropertyName
                    + " is not a valid content model property of type single-valued d:boolean");
        }
    }

    if (this.moveStoresOnNodeMoveOrCopy || this.moveStoresOnNodeMoveOrCopyOverridePropertyQName != null)
    {
        this.policyComponent.bindClassBehaviour(OnCopyCompletePolicy.QNAME, ContentModel.TYPE_BASE,
                new JavaBehaviour(this, "onCopyComplete", NotificationFrequency.EVERY_EVENT));
        this.policyComponent.bindClassBehaviour(OnMoveNodePolicy.QNAME, ContentModel.TYPE_BASE,
                new JavaBehaviour(this, "onMoveNode", NotificationFrequency.EVERY_EVENT));
    }
}
 
Example #28
Source File: ReformatRenderingEngine.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
protected Collection<ParameterDefinition> getParameterDefinitions()
{
    Collection<ParameterDefinition> paramList = super.getParameterDefinitions();
    paramList.add(new ParameterDefinitionImpl(PARAM_MIME_TYPE, DataTypeDefinition.TEXT, true,
                getParamDisplayLabel(PARAM_MIME_TYPE)));
    paramList.add(new ParameterDefinitionImpl(PARAM_FLASH_VERSION, DataTypeDefinition.TEXT, false,
                getParamDisplayLabel(PARAM_FLASH_VERSION)));
    return paramList;
}
 
Example #29
Source File: FreemarkerRenderingEngine.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
protected Collection<ParameterDefinition> getParameterDefinitions()
{
    Collection<ParameterDefinition> paramList = super.getParameterDefinitions();
    paramList.add(new ParameterDefinitionImpl(
            PARAM_IMAGE_RESOLVER,
            DataTypeDefinition.ANY,
            false,
            getParamDisplayLabel(PARAM_IMAGE_RESOLVER)));
    return paramList;
}
 
Example #30
Source File: AbstractRenderingEngine.java    From alfresco-repository with GNU Lesser General Public License v3.0 5 votes vote down vote up
/**
 * Supplies the list of parameters required by this rendering engine.
 * 
 */
protected Collection<ParameterDefinition> getParameterDefinitions()
{
    List<ParameterDefinition> paramList = new ArrayList<ParameterDefinition>();
    
    paramList.add(new ParameterDefinitionImpl(RenditionDefinitionImpl.RENDITION_DEFINITION_NAME, DataTypeDefinition.QNAME, true,
            getParamDisplayLabel(RenditionDefinitionImpl.RENDITION_DEFINITION_NAME)));

    paramList.add(new ParameterDefinitionImpl(PARAM_RUN_AS, DataTypeDefinition.TEXT, false,
            getParamDisplayLabel(PARAM_RUN_AS)));

    paramList.add(new ParameterDefinitionImpl(PARAM_UPDATE_RENDITIONS_ON_ANY_PROPERTY_CHANGE, DataTypeDefinition.BOOLEAN, false,
            getParamDisplayLabel(PARAM_UPDATE_RENDITIONS_ON_ANY_PROPERTY_CHANGE)));

    paramList.add(new ParameterDefinitionImpl(PARAM_RENDITION_NODETYPE, DataTypeDefinition.QNAME, false,
                getParamDisplayLabel(PARAM_RENDITION_NODETYPE)));

    paramList.add(new ParameterDefinitionImpl(PARAM_PLACEHOLDER_RESOURCE_PATH, DataTypeDefinition.TEXT, false,
                getParamDisplayLabel(PARAM_PLACEHOLDER_RESOURCE_PATH)));

    paramList.add(new ParameterDefinitionImpl(PARAM_SOURCE_CONTENT_PROPERTY, DataTypeDefinition.QNAME, false,
                getParamDisplayLabel(PARAM_SOURCE_CONTENT_PROPERTY)));

    paramList.add(new ParameterDefinitionImpl(PARAM_TARGET_CONTENT_PROPERTY, DataTypeDefinition.QNAME, false,
                getParamDisplayLabel(PARAM_TARGET_CONTENT_PROPERTY)));

    paramList.add(new ParameterDefinitionImpl(PARAM_DESTINATION_PATH_TEMPLATE, DataTypeDefinition.TEXT, false,
                getParamDisplayLabel(PARAM_DESTINATION_PATH_TEMPLATE)));

    paramList.add(new ParameterDefinitionImpl(PARAM_ORPHAN_EXISTING_RENDITION, DataTypeDefinition.BOOLEAN, false,
            getParamDisplayLabel(PARAM_ORPHAN_EXISTING_RENDITION)));

    paramList.add(new ParameterDefinitionImpl(PARAM_RESULT, DataTypeDefinition.CHILD_ASSOC_REF, false,
            getParamDisplayLabel(PARAM_RESULT)));

    paramList.add(new ParameterDefinitionImpl(PARAM_IS_COMPONENT_RENDITION, DataTypeDefinition.BOOLEAN, false,
            getParamDisplayLabel(PARAM_IS_COMPONENT_RENDITION)));
    return paramList;
}