当前位置: 首页>>代码示例>>Java>>正文


Java AssociationDefinition类代码示例

本文整理汇总了Java中org.alfresco.service.cmr.dictionary.AssociationDefinition的典型用法代码示例。如果您正苦于以下问题:Java AssociationDefinition类的具体用法?Java AssociationDefinition怎么用?Java AssociationDefinition使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


AssociationDefinition类属于org.alfresco.service.cmr.dictionary包,在下文中一共展示了AssociationDefinition类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: makeAssociationFields

import org.alfresco.service.cmr.dictionary.AssociationDefinition; //导入依赖的package包/类
/**
 * Generates a list of association fields with values.
 * 
 * @param assocDefs List of association definitions to generate
 * @param values Map containing the values to use for each property
 * @param group The group the field belongs to
 * @param namespaceService NamespaceService instance
 * @return List of generated Field objects
 */
public static List<Field> makeAssociationFields(
            Collection<AssociationDefinition> assocDefs,
            Map<AssociationDefinition, Object> values,
            FieldGroup group,
            NamespaceService namespaceService,
            DictionaryService dictionaryService)
{
    AssociationFieldProcessor processor = new AssociationFieldProcessor(namespaceService, dictionaryService);
    ArrayList<Field> fields = new ArrayList<Field>(assocDefs.size());
    for (AssociationDefinition propDef : assocDefs)
    {
        Object value = values == null ? null : values.get(propDef);
        Field field = processor.makeField(propDef, value, group);
        fields.add(field);
    }
    return fields;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:27,代码来源:FieldUtils.java

示例2: isExcludedAspectAssociation

import org.alfresco.service.cmr.dictionary.AssociationDefinition; //导入依赖的package包/类
/**
 * Is the association unexportable?
 */
private boolean isExcludedAspectAssociation(QName[] excludeAspects, QName associationQName)
{
    AssociationDefinition assocDef = dictionaryService.getAssociation(associationQName);
    if (assocDef == null)
    {
        return false;
    }
    
    ClassDefinition classDef = assocDef.getSourceClass();
    if (classDef == null || !classDef.isAspect())
    {
        return false;
    }
    
    return isExcludedAspect(excludeAspects, classDef.getName());
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:20,代码来源:ExporterComponent.java

示例3: init

import org.alfresco.service.cmr.dictionary.AssociationDefinition; //导入依赖的package包/类
public void init()
{
    super.init();
    // Quickly scan the supplied association types and remove any that either
    // do not exist or are not child association types.
    DictionaryService dictionaryService = serviceRegistry.getDictionaryService();
    childAssociationTypes.clear();
    for (QName associationType : suppliedAssociationTypes)
    {
        AssociationDefinition assocDef = dictionaryService.getAssociation(associationType);
        if (assocDef != null && assocDef.isChild())
        {
            childAssociationTypes.add(associationType);
        }
    }
    initialised = true;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:18,代码来源:ChildAssociatedNodeFinder.java

示例4: bindAssociationBehaviour

import org.alfresco.service.cmr.dictionary.AssociationDefinition; //导入依赖的package包/类
public BehaviourDefinition<ClassFeatureBehaviourBinding> bindAssociationBehaviour(QName policy, QName className, QName assocName, Behaviour behaviour)
{
    // Validate arguments
    ParameterCheck.mandatory("Policy", policy);
    ParameterCheck.mandatory("Class Reference", className);
    ParameterCheck.mandatory("Association Reference", assocName);
    ParameterCheck.mandatory("Behaviour", behaviour);

    // Validate Binding
    AssociationDefinition assocDefinition = dictionary.getAssociation(assocName);
    if (assocDefinition == null)
    {
        throw new IllegalArgumentException("Association " + assocName + " of class " + className + " has not been defined in the data dictionary");
    }
    
    // Create behaviour definition and bind to policy
    ClassFeatureBehaviourBinding binding = new ClassFeatureBehaviourBinding(dictionary, className, assocName);
    BehaviourDefinition<ClassFeatureBehaviourBinding> definition = createBehaviourDefinition(PolicyType.Association, policy, binding, behaviour);
    getAssociationBehaviourIndex(policy).putClassBehaviour(definition);
    
    if (logger.isInfoEnabled())
        logger.info("Bound " + behaviour + " to policy " + policy + " for association " + assocName + " of class " + className);

    return definition;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:26,代码来源:PolicyComponentImpl.java

示例5: mapArbitraryProperties

import org.alfresco.service.cmr.dictionary.AssociationDefinition; //导入依赖的package包/类
private Map<QName, Serializable> mapArbitraryProperties(Map<String, Object> variables,
        final Map<String, Object> localVariables,
            final Map<QName, PropertyDefinition> taskProperties,
            final Map<QName, AssociationDefinition> taskAssociations) 
{
    EntryTransformer<String, Object, QName, Serializable> transformer = new EntryTransformer<String, Object, QName, Serializable>()
    {
        @Override
        public Pair<QName, Serializable> apply(Entry<String, Object> entry)
        {
            String key = entry.getKey();
            QName qname = factory.mapNameToQName(key);
            // Add variable, only if part of task definition or locally defined
            // on task
            if (taskProperties.containsKey(qname) 
                    || taskAssociations.containsKey(qname) 
                    || localVariables.containsKey(key))
            {
                Serializable value = convertPropertyValue(entry.getValue());
                return new Pair<QName, Serializable>(qname, value);
            }
            return null;
        }
    };
    return CollectionUtils.transform(variables, transformer);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:27,代码来源:ActivitiPropertyConverter.java

示例6: handleDefaultProperty

import org.alfresco.service.cmr.dictionary.AssociationDefinition; //导入依赖的package包/类
protected Object handleDefaultProperty(Object task, TypeDefinition type, QName key, Serializable value)
{
    PropertyDefinition propDef = type.getProperties().get(key);
    if (propDef != null)
    {
        return handleProperty(value, propDef);
    }
    else
    {
        AssociationDefinition assocDef = type.getAssociations().get(key);
        if (assocDef != null)
        {
            return handleAssociation(value, assocDef);
        }
        else if (value instanceof NodeRef)
        {
            return nodeConverter.convertNode((NodeRef)value, false);
        }
    }
    return value;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:22,代码来源:AbstractWorkflowPropertyHandler.java

示例7: testLabels

import org.alfresco.service.cmr.dictionary.AssociationDefinition; //导入依赖的package包/类
public void testLabels()
{
    QName model = QName.createQName(TEST_URL, "dictionarydaotest");
    ModelDefinition modelDef = service.getModel(model);
    assertEquals("Model Description", modelDef.getDescription(service));
    QName type = QName.createQName(TEST_URL, "base");
    TypeDefinition typeDef = service.getType(type);
    assertEquals("Base Title", typeDef.getTitle(service));
    assertEquals("Base Description", typeDef.getDescription(service));
    QName prop = QName.createQName(TEST_URL, "prop1");
    PropertyDefinition propDef = service.getProperty(prop);
    assertEquals("Prop1 Title", propDef.getTitle(service));
    assertEquals("Prop1 Description", propDef.getDescription(service));
    QName assoc = QName.createQName(TEST_URL, "assoc1");
    AssociationDefinition assocDef = service.getAssociation(assoc);
    assertEquals("Assoc1 Title", assocDef.getTitle(service));
    assertEquals("Assoc1 Description", assocDef.getDescription(service));
    QName datatype = QName.createQName(TEST_URL, "datatype");
    DataTypeDefinition datatypeDef = service.getDataType(datatype);
    assertEquals("alfresco/model/dataTypeAnalyzers", datatypeDef.getAnalyserResourceBundleName());
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:22,代码来源:RepoDictionaryDAOTest.java

示例8: makeTaskAssociationDefs

import org.alfresco.service.cmr.dictionary.AssociationDefinition; //导入依赖的package包/类
protected Map<QName, AssociationDefinition> makeTaskAssociationDefs()
{
    Map<QName, AssociationDefinition> associations = new HashMap<QName, AssociationDefinition>();
    QName actorName = QName.createQName(NamespaceService.BPM_MODEL_1_0_URI, "Actor");

    // Add Assigneee association
    MockClassAttributeDefinition assigneeDef = MockClassAttributeDefinition.mockAssociationDefinition(ASSIGNEE_NAME, actorName);
    associations.put(ASSIGNEE_NAME, assigneeDef);

    // Add Assigneee association
    MockClassAttributeDefinition actorsDef = MockClassAttributeDefinition.mockAssociationDefinition(ACTORS_NAME, actorName);
    associations.put(ACTORS_NAME, actorsDef);

    // Add association with _
    MockClassAttributeDefinition with_ = MockClassAttributeDefinition.mockAssociationDefinition(ASSOC_WITH_, actorName);
    associations.put(ASSOC_WITH_, with_);

    return associations;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:20,代码来源:FormProcessorTest.java

示例9: makeAssociationDefs

import org.alfresco.service.cmr.dictionary.AssociationDefinition; //导入依赖的package包/类
private Map<QName, AssociationDefinition> makeAssociationDefs()
{
    QName targetClass = QName.createQName(URI, "Target");
    AssociationDefinition assocDef1 = MockClassAttributeDefinition.mockAssociationDefinition(
            qName1, targetClass,
            null,// Defalt title, so sets label to be same as name.
            DESCRIPTION1, false, false, false);
    MockClassAttributeDefinition assocDef2 = MockClassAttributeDefinition.mockAssociationDefinition(
            qName2, targetClass,
            TITLE, DESCRIPTION2,
            true, true, true);
    Map<QName, AssociationDefinition> assocDefs = new HashMap<QName, AssociationDefinition>();
    assocDefs.put(qName1, assocDef1);
    assocDefs.put(qName2, assocDef2);
    return assocDefs;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:17,代码来源:FieldProcessorTest.java

示例10: getAssociationImpl

import org.alfresco.service.cmr.dictionary.AssociationDefinition; //导入依赖的package包/类
protected AssociationDefinition getAssociationImpl(QName assocName)
{
	AssociationDefinition assocDef = null;

    List<CompiledModel> models = getModelsForUri(assocName.getNamespaceURI());
    if(models != null && models.size() > 0)
    {
     for (CompiledModel model : models)
     {
     	assocDef = model.getAssociation(assocName);
     	if(assocDef != null)
     	{
     		break;
     	}
     }
    }

    return assocDef;
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:20,代码来源:AbstractDictionaryRegistry.java

示例11: updateDefinition

import org.alfresco.service.cmr.dictionary.AssociationDefinition; //导入依赖的package包/类
@Override
public void updateDefinition(DictionaryService dictionaryService)
{
    AssociationDefinition assocDef = dictionaryService.getAssociation(alfrescoName);

    if (assocDef != null)
    {
        setTypeDefDisplayName(assocDef.getTitle(dictionaryService));
        setTypeDefDescription(assocDef.getDescription(dictionaryService));
    }
    else
    {
        super.updateDefinition(dictionaryService);
    }
    
    updateTypeDefInclProperties();
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:18,代码来源:RelationshipTypeDefintionWrapper.java

示例12: executeImpl

import org.alfresco.service.cmr.dictionary.AssociationDefinition; //导入依赖的package包/类
/**
 * Override method from DeclarativeWebScript
 */
protected Map<String, Object> executeImpl(WebScriptRequest req, Status status)
{
    Map<String, Object> model = new HashMap<String, Object>(3);
    Map<QName, ClassDefinition> classdef = new HashMap<QName, ClassDefinition>();
    Map<QName, Collection<PropertyDefinition>> propdef = new HashMap<QName, Collection<PropertyDefinition>>();
    Map<QName, Collection<AssociationDefinition>> assocdef = new HashMap<QName, Collection<AssociationDefinition>>();

    QName classQname = getClassQname(req);
    classdef.put(classQname, this.dictionaryservice.getClass(classQname));
    propdef.put(classQname, this.dictionaryservice.getClass(classQname).getProperties().values());
    assocdef.put(classQname, this.dictionaryservice.getClass(classQname).getAssociations().values());

    model.put(MODEL_PROP_KEY_CLASS_DETAILS, classdef.values());
    model.put(MODEL_PROP_KEY_PROPERTY_DETAILS, propdef.values());
    model.put(MODEL_PROP_KEY_ASSOCIATION_DETAILS, assocdef.values());
    model.put(MODEL_PROP_KEY_MESSAGE_LOOKUP, this.dictionaryservice);

    return model;
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:23,代码来源:AbstractClassGet.java

示例13: getAssociationDefinition

import org.alfresco.service.cmr.dictionary.AssociationDefinition; //导入依赖的package包/类
/**
 * Gets the association definition for the given unique name
 *
 * @param uniqueName The unique name
 * @return The association definition for the given unique name if exists, <code>null</code> otherwise
 */
private AssociationDefinition getAssociationDefinition(String uniqueName)
{
    AssociationDefinition associationDefinition = null;

    Set<Entry<QName, AssociationDefinition>> associationsEntrySet = getCustomAssociations().entrySet();
    for (Map.Entry<QName, AssociationDefinition> associationEntry : associationsEntrySet)
    {
        String localName = associationEntry.getKey().getLocalName();
        if (uniqueName.equals(localName))
        {
            associationDefinition = associationEntry.getValue();
            break;
        }
    }

    return associationDefinition;
}
 
开发者ID:Alfresco,项目名称:records-management-old,代码行数:24,代码来源:RelationshipServiceImpl.java

示例14: getRelationshipType

import org.alfresco.service.cmr.dictionary.AssociationDefinition; //导入依赖的package包/类
/**
 * Gets the relationship type from the association definition
 *
 * @param associationDefinition The association definition
 * @return The type of the relationship definition
 */
private RelationshipType getRelationshipType(AssociationDefinition associationDefinition)
{
    RelationshipType type;

    if (associationDefinition instanceof ChildAssociationDefinition)
    {
        type = RelationshipType.PARENTCHILD;
    }
    else
    {
        type = RelationshipType.BIDIRECTIONAL;
    }

    return type;
}
 
开发者ID:Alfresco,项目名称:records-management-old,代码行数:22,代码来源:RelationshipServiceImpl.java

示例15: getAssociationDefinitionName

import org.alfresco.service.cmr.dictionary.AssociationDefinition; //导入依赖的package包/类
/**
 * Gets the qualified name of the association definition for the given unique name
 *
 * @param uniqueName The unique name
 * @return The qualified name of the association definition for the given unique name
 */
private QName getAssociationDefinitionName(String uniqueName)
{
    AssociationDefinition associationDefinition = getAssociationDefinition(uniqueName);

    if (associationDefinition == null)
    {
        StringBuilder sb = new StringBuilder();
        sb.append("The qualified name for '")
            .append(uniqueName)
            .append("' was not found.");
        throw new AlfrescoRuntimeException(sb.toString());
    }

    return associationDefinition.getName();
}
 
开发者ID:Alfresco,项目名称:records-management-old,代码行数:22,代码来源:RelationshipServiceImpl.java


注:本文中的org.alfresco.service.cmr.dictionary.AssociationDefinition类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。