本文整理汇总了Java中org.alfresco.service.cmr.dictionary.DictionaryService.isSubClass方法的典型用法代码示例。如果您正苦于以下问题:Java DictionaryService.isSubClass方法的具体用法?Java DictionaryService.isSubClass怎么用?Java DictionaryService.isSubClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.alfresco.service.cmr.dictionary.DictionaryService
的用法示例。
在下文中一共展示了DictionaryService.isSubClass方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPackageResources
import org.alfresco.service.cmr.dictionary.DictionaryService; //导入方法依赖的package包/类
/**
* @return the resources from the package attached to this workflow task
*/
public List<TemplateContent> getPackageResources()
{
List<TemplateContent> resources = new ArrayList<TemplateContent>();
List<NodeRef> contents = this.services.getWorkflowService().getPackageContents(this.task.id);
NodeService nodeService = this.services.getNodeService();
DictionaryService ddService = this.services.getDictionaryService();
for(NodeRef nodeRef : contents)
{
QName type = nodeService.getType(nodeRef);
// make sure the type is defined in the data dictionary
if (ddService.getType(type) != null)
{
// look for content nodes or links to content
// NOTE: folders within workflow packages are ignored for now
if (ddService.isSubClass(type, ContentModel.TYPE_CONTENT) ||
ApplicationModel.TYPE_FILELINK.equals(type))
{
resources.add(new TemplateNode(nodeRef, this.services, this.resolver));
}
}
}
return resources;
}
示例2: processMessage
import org.alfresco.service.cmr.dictionary.DictionaryService; //导入方法依赖的package包/类
public void processMessage(NodeRef contentNodeRef, EmailMessage message)
{
String messageSubject = message.getSubject();
if (messageSubject != null && messageSubject.length() > 0)
{
messageSubject = message.getSubject();
}
else
{
messageSubject = "EMPTY_SUBJECT_" + System.currentTimeMillis();
}
if(logger.isDebugEnabled())
{
logger.debug("process message:" + messageSubject);
}
QName nodeTypeQName = getNodeService().getType(contentNodeRef);
DictionaryService dictionaryService = getDictionaryService();
if (dictionaryService.isSubClass(nodeTypeQName, ContentModel.TYPE_CONTENT))
{
// Find where the content resides
NodeRef spaceNodeRef = getNodeService().getPrimaryParent(contentNodeRef).getParentRef();
NodeRef forumNode = getForumNode(contentNodeRef);
if (forumNode == null)
{
logger.debug("adding new forum node");
forumNode = addForumNode(contentNodeRef);
}
// Try to find existed node
NodeRef topicNodeRef = getTopicNode(forumNode, messageSubject);
if (topicNodeRef == null)
{
logger.debug("adding new topic node");
topicNodeRef = addTopicNode(forumNode, messageSubject);
}
// Create the post
logger.debug("add a post to the topic");
NodeRef postNodeRef = addPostNode(topicNodeRef, message);
// Add attachments
addAttachments(spaceNodeRef, postNodeRef, message);
}
else
{
throw new AlfrescoRuntimeException("\n" +
"Message handler " + this.getClass().getName() + " cannot handle type " + nodeTypeQName + ".\n" +
"Check the message handler mappings.");
}
}