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

The following examples show how to use org.alfresco.service.cmr.dictionary.DataTypeDefinition. These examples are extracted from open source projects. 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 want to check out the right sidebar which shows the related API usage.
Example 1
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 2
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 3
@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 4
/**
 * 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
@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
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 7
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 8
/**
 * @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 9
/**
 * @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 10
@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
@Override
protected FieldDefinition makeTransientFieldDefinition() 
{
    String dataKeyName = PROP_DATA_PREFIX + KEY;
    PropertyFieldDefinition mimetypeField = new PropertyFieldDefinition(KEY, DataTypeDefinition.TEXT
                .getLocalName());
    mimetypeField.setLabel(I18NUtil.getMessage(MSG_MIMETYPE_LABEL));
    mimetypeField.setDescription(I18NUtil.getMessage(MSG_MIMETYPE_DESC));
    mimetypeField.setDataKeyName(dataKeyName);
    return mimetypeField;
}
 
Example 12
@Override
protected String getValueAsString(Serializable value)
{
    Object converted = DefaultTypeConverter.INSTANCE.convert(dictionaryService.getDataType(DataTypeDefinition.LONG), value);
    String asString = DefaultTypeConverter.INSTANCE.convert(String.class, converted);
    return asString;
}
 
Example 13
protected void checkAndProcessContentPropertiesMove(final NodeRef affectedNode, final Map<QName, Serializable> properties,
        final CD customData)
{
    final Collection<QName> contentProperties = this.dictionaryService.getAllProperties(DataTypeDefinition.CONTENT);

    final Collection<QName> setProperties = new HashSet<>(properties.keySet());
    setProperties.retainAll(contentProperties);

    LOGGER.debug("Found {} set content properties on {}", setProperties.size(), affectedNode);

    if (!setProperties.isEmpty())
    {
        final Map<QName, Serializable> contentPropertiesMap = new HashMap<>();
        for (final QName contentProperty : setProperties)
        {
            final Serializable value = properties.get(contentProperty);
            if (value != null)
            {
                contentPropertiesMap.put(contentProperty, value);
            }
        }

        if (!contentPropertiesMap.isEmpty())
        {
            LOGGER.debug("Processing {} set content properties with non-null values on {}", contentPropertiesMap.size(), affectedNode);

            ContentStoreContext.executeInNewContext(() -> {
                MoveCapableCommonRoutingContentStore.this.processContentPropertiesMove(affectedNode, contentPropertiesMap, customData);
                return null;
            });
        }
    }
}
 
Example 14
/**
 * Add the parameter definitions
 */
@Override
protected void addParameterDefinitions(List<ParameterDefinition> paramList) 
{
    paramList.add(new ParameterDefinitionImpl(PARAM_FAILING_PERSON_NODEREF, DataTypeDefinition.NODE_REF, true, "Failing Person NodeRef"));
    paramList.add(new ParameterDefinitionImpl(PARAM_PERSON_NODEREF, DataTypeDefinition.NODE_REF, true, "Person NodeRef"));
    paramList.add(new ParameterDefinitionImpl(PARAM_USERNAME, DataTypeDefinition.TEXT, true, "Username"));
}
 
Example 15
/**
* {@inheritDoc}
*/
@Override
public List<ParameterDefinition> getParameterDefinitions()
{
    List<ParameterDefinition> paramDefs = new ArrayList<ParameterDefinition>(2);
    paramDefs.add(new ParameterDefinitionImpl(QUERY_KEY, DataTypeDefinition.TEXT, true, "Query"));
    paramDefs.add(new ParameterDefinitionImpl(STORE_TYPE_KEY, DataTypeDefinition.TEXT, false, "Store Type"));
    paramDefs.add(new ParameterDefinitionImpl(STORE_ID_KEY, DataTypeDefinition.TEXT, false, "Store Id"));
    return paramDefs;
}
 
Example 16
/**
* {@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 17
@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, "[email protected]@{http://www.alfresco.org/model/content/1.0}created"));
}
 
Example 18
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 19
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 20
@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 21
@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 22
@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 23
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 24
@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 25
@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 26
/**
 * 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;
}
 
Example 27
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 28
public DataTypeDefinition getDataType(Class javaClass)
{
    for (DataTypeDefinition dataTypeDef : dataTypes.values())
    {
        if (dataTypeDef.getJavaClassName().equals(javaClass.getName()))
        {
            return dataTypeDef;
        }
    }
    return null;
}
 
Example 29
@Override
protected void addParameterDefinitions(List<ParameterDefinition> paramList) {
   paramList.add(new ParameterDefinitionImpl(
         PARAM_MIME_TYPES,
         DataTypeDefinition.TEXT,
         false,
         getParamDisplayLabel(PARAM_MIME_TYPES)
   ));
}
 
Example 30
/**
 * 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)));
}