本文整理汇总了Java中org.alfresco.service.cmr.dictionary.TypeDefinition.getParentName方法的典型用法代码示例。如果您正苦于以下问题:Java TypeDefinition.getParentName方法的具体用法?Java TypeDefinition.getParentName怎么用?Java TypeDefinition.getParentName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.alfresco.service.cmr.dictionary.TypeDefinition
的用法示例。
在下文中一共展示了TypeDefinition.getParentName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addTypePermissions
import org.alfresco.service.cmr.dictionary.TypeDefinition; //导入方法依赖的package包/类
/**
* Support to add permissions for types
*
* @param type QName
* @param permissions Set<PermissionReference>
* @param exposedOnly boolean
*/
private void addTypePermissions(QName type, Set<PermissionReference> permissions, boolean exposedOnly)
{
TypeDefinition typeDef = dictionaryService.getType(type);
if (typeDef == null)
{
// the type definition is no longer in the dictionary - ignore
return;
}
if (typeDef.getParentName() != null)
{
PermissionSet permissionSet = permissionSets.get(type);
if (!exposedOnly || (permissionSet == null) || permissionSet.exposeAll())
{
addTypePermissions(typeDef.getParentName(), permissions, exposedOnly);
}
}
for (AspectDefinition ad : typeDef.getDefaultAspects())
{
addAspectPermissions(ad.getName(), permissions, exposedOnly);
}
mergePermissions(permissions, type, exposedOnly, true);
}
示例2: isCategory
import org.alfresco.service.cmr.dictionary.TypeDefinition; //导入方法依赖的package包/类
private boolean isCategory(TypeDefinition typeDef)
{
if (typeDef == null)
{
return false;
}
TypeDefinition current = typeDef;
while (current != null)
{
if (current.getName().equals(ContentModel.TYPE_CATEGORY))
{
return true;
}
else
{
QName parentName = current.getParentName();
if (parentName == null)
{
break;
}
current = getDictionaryService().getType(parentName);
}
}
return false;
}
示例3: getMessageHandler
import org.alfresco.service.cmr.dictionary.TypeDefinition; //导入方法依赖的package包/类
/**
* @param nodeRef Target node
* @return Handler that can process message addressed to specific node (target node).
* @throws EmailMessageException is thrown if a suitable message handler isn't found.
*/
private EmailMessageHandler getMessageHandler(NodeRef nodeRef)
{
ParameterCheck.mandatory("nodeRef", nodeRef);
QName nodeTypeQName = nodeService.getType(nodeRef);
String prefixedNodeTypeStr = nodeTypeQName.toPrefixString(namespaceService);
EmailMessageHandler handler = emailMessageHandlerMap.get(prefixedNodeTypeStr);
if( handler == null)
{
if(logger.isDebugEnabled())
{
logger.debug("did not find a handler for type:" + prefixedNodeTypeStr);
}
// not a direct match on type
// need to check the super-types (if any) of the target node
TypeDefinition typeDef = dictionaryService.getType(nodeTypeQName);
while(typeDef != null)
{
QName parentName = typeDef.getParentName();
if(parentName != null)
{
String prefixedSubTypeStr = parentName.toPrefixString(namespaceService);
handler = emailMessageHandlerMap.get(prefixedSubTypeStr);
if(handler != null)
{
if(logger.isDebugEnabled())
{
logger.debug("found a handler for a subtype:" + prefixedSubTypeStr);
}
return handler;
}
}
typeDef = dictionaryService.getType(parentName);
}
}
if (handler == null)
{
throw new EmailMessageException(ERR_HANDLER_NOT_FOUND, prefixedNodeTypeStr);
}
return handler;
}