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

The following are Jave code examples for showing how to use TEXT of the org.alfresco.service.cmr.dictionary.DataTypeDefinition class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: alfresco-repository   File: BaseTemplateRenderingEngine.java   Source Code and License Vote up 6 votes
@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 2
Project: alfresco-repository   File: WorkflowFormProcessorTest.java   Source Code and License Vote up 5 votes
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 3
Project: alfresco-repository   File: TaskFormProcessorTest.java   Source Code and License Vote up 5 votes
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 4
Project: alfresco-repository   File: ParameterDefinitionImplTest.java   Source Code and License Vote up 5 votes
private ParameterDefinitionImpl create()
{
    ParameterDefinitionImpl paramDef = new ParameterDefinitionImpl(
            NAME,
            DataTypeDefinition.TEXT,
            true,
            DISPLAY_LABEL);
    assertNotNull(paramDef);
    return paramDef;
}
 
Example 5
Project: alfresco-repository   File: Cron.java   Source Code and License Vote up 4 votes
public QName getExpressionDataType()
{
    return DataTypeDefinition.TEXT;
}
 
Example 6
Project: alfresco-repository   File: XMLDuration.java   Source Code and License Vote up 4 votes
public QName getExpressionDataType()
{
    return DataTypeDefinition.TEXT;
}
 
Example 7
Project: alfresco-data-model   File: Lower.java   Source Code and License Vote up 4 votes
public Lower()
{
    super(NAME, DataTypeDefinition.TEXT, args);
}
 
Example 8
Project: alfresco-data-model   File: Upper.java   Source Code and License Vote up 4 votes
public Upper()
{
    super(NAME, DataTypeDefinition.TEXT, args);
}
 
Example 9
Project: alfresco-remote-api   File: RestVariableHelper.java   Source Code and License Vote up 4 votes
public QName extractTypeFromValue(Object value) {
    QName type = null;
    if(value instanceof Collection<?>)
    {
        Collection<?> collection = (Collection<?>) value;
        if(collection.size() > 0)
        {
            type = extractTypeFromValue(collection.iterator().next());
        }
    }
    else
    {
        if(value instanceof String) 
        {
            type = DataTypeDefinition.TEXT;
        }
        else if(value instanceof Integer)
        {
            type = DataTypeDefinition.INT;
        }
        else if(value instanceof Long)
        {
            type = DataTypeDefinition.LONG;
        }
        else if(value instanceof Double)
        {
            type = DataTypeDefinition.DOUBLE;
        }
        else if(value instanceof Float)
        {
            type = DataTypeDefinition.FLOAT;
        }
        else if(value instanceof Date)
        {
            type = DataTypeDefinition.DATETIME;
        }
        else if(value instanceof Boolean)
        {
            type = DataTypeDefinition.BOOLEAN;
        }
        else if(value instanceof QName)
        {
            type = DataTypeDefinition.QNAME;
        }
        else if(value instanceof NodeRef || value instanceof ScriptNode)
        {
            type = DataTypeDefinition.NODE_REF;
        }
    }
   
    if(type == null)
    {
        // Type cannot be determined, revert to default for unknown types
        type = DataTypeDefinition.ANY;
    }
    return type;
}