本文整理汇总了Java中org.alfresco.service.cmr.dictionary.AssociationDefinition类的典型用法代码示例。如果您正苦于以下问题:Java AssociationDefinition类的具体用法?Java AssociationDefinition怎么用?Java AssociationDefinition使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AssociationDefinition类属于org.alfresco.service.cmr.dictionary包,在下文中一共展示了AssociationDefinition类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: createRelationshipDefinition
import org.alfresco.service.cmr.dictionary.AssociationDefinition; //导入依赖的package包/类
/**
* Creates the relationship definition from the association definition
*
* @param associationDefinition The association definition
* @return The relationship definition if <code>associationDefinition</code> exists, <code>null</code> otherwise
*/
private RelationshipDefinition createRelationshipDefinition(AssociationDefinition associationDefinition)
{
RelationshipDefinition relationshipDefinition = null;
if (associationDefinition != null)
{
String uniqueName = associationDefinition.getName().getLocalName();
RelationshipType type = getRelationshipType(associationDefinition);
String title = associationDefinition.getTitle(getDictionaryService());
RelationshipDisplayName displayName = getRelationshipDisplayName(type, title);
relationshipDefinition = new RelationshipDefinitionImpl(uniqueName, type, displayName);
}
return relationshipDefinition;
}
开发者ID:Alfresco,项目名称:records-management-old,代码行数:25,代码来源:RelationshipServiceImpl.java
示例17: generateControl
import org.alfresco.service.cmr.dictionary.AssociationDefinition; //导入依赖的package包/类
/**
* Generates an appropriate control for the given property
*
* @param context JSF context
* @param propSheet The property sheet this property belongs to
* @param assocDef The definition of the association to create the control for
*/
private void generateControl(FacesContext context, UIPropertySheet propSheet,
AssociationDefinition assocDef)
{
// get the custom component generator (if one)
String componentGeneratorName = this.getComponentGenerator();
// use the default component generator if there wasn't an overridden one
if (componentGeneratorName == null)
{
componentGeneratorName = RepoConstants.GENERATOR_CHILD_ASSOCIATION;
}
UIChildAssociationEditor control = (UIChildAssociationEditor)FacesHelper.getComponentGenerator(
context, componentGeneratorName).generateAndAdd(context, propSheet, this);
if (logger.isDebugEnabled())
logger.debug("Created control " + control + "(" +
control.getClientId(context) +
") for '" + assocDef.getName().toString() +
"' and added it to component " + this);
}
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:29,代码来源:UIChildAssociation.java
示例18: generateControl
import org.alfresco.service.cmr.dictionary.AssociationDefinition; //导入依赖的package包/类
/**
* Generates an appropriate control for the given property
*
* @param context JSF context
* @param propSheet The property sheet this property belongs to
* @param assocDef The definition of the association to create the control for
*/
private void generateControl(FacesContext context, UIPropertySheet propSheet,
AssociationDefinition assocDef)
{
// get the custom component generator (if one)
String componentGeneratorName = this.getComponentGenerator();
// use the default component generator if there wasn't an overridden one
if (componentGeneratorName == null)
{
componentGeneratorName = RepoConstants.GENERATOR_ASSOCIATION;
}
UIAssociationEditor control = (UIAssociationEditor)FacesHelper.getComponentGenerator(
context, componentGeneratorName).generateAndAdd(context, propSheet, this);
if (logger.isDebugEnabled())
logger.debug("Created control " + control + "(" +
control.getClientId(context) +
") for '" + assocDef.getName().toString() +
"' and added it to component " + this);
}
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:29,代码来源:UIAssociation.java
示例19: setupAssociation
import org.alfresco.service.cmr.dictionary.AssociationDefinition; //导入依赖的package包/类
/**
* Sets up the association component i.e. setting the value binding
*
* @param context FacesContext
* @param propertySheet The property sheet
* @param item The parent component
* @param associationDef The association definition
* @param component The component representing the association
*/
@SuppressWarnings("unchecked")
protected void setupAssociation(FacesContext context, UIPropertySheet propertySheet,
PropertySheetItem item, AssociationDefinition associationDef, UIComponent component)
{
// create and set the value binding
ValueBinding vb = context.getApplication().createValueBinding(
"#{" + propertySheet.getVar() + "}");
component.setValueBinding("value", vb);
// set the association name and set to disabled if appropriate
((BaseAssociationEditor)component).setAssociationName(
associationDef.getName().toString());
// disable the component if it is read only or protected
// or if the property sheet is in view mode
if (propertySheet.inEditMode() == false || item.isReadOnly() ||
(associationDef != null && associationDef.isProtected()))
{
component.getAttributes().put("disabled", Boolean.TRUE);
}
}
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:31,代码来源:BaseComponentGenerator.java
示例20: getRelationshipDefinitions
import org.alfresco.service.cmr.dictionary.AssociationDefinition; //导入依赖的package包/类
/**
* @see org.alfresco.module.org_alfresco_module_rm.relationship.RelationshipService#getRelationshipDefinitions()
*/
@Override
public Set<RelationshipDefinition> getRelationshipDefinitions()
{
Set<RelationshipDefinition> relationshipDefinitions = new HashSet<RelationshipDefinition>();
Set<Entry<QName, AssociationDefinition>> associationsEntrySet = getCustomAssociations().entrySet();
for (Map.Entry<QName, AssociationDefinition> associationEntry : associationsEntrySet)
{
AssociationDefinition associationDefinition = associationEntry.getValue();
RelationshipDefinition relationshipDefinition = createRelationshipDefinition(associationDefinition);
if (relationshipDefinition != null)
{
relationshipDefinitions.add(relationshipDefinition);
}
}
return relationshipDefinitions;
}
开发者ID:Alfresco,项目名称:records-management-old,代码行数:22,代码来源:RelationshipServiceImpl.java
注:本文中的org.alfresco.service.cmr.dictionary.AssociationDefinition类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论