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


Java DictionaryService.isSubClass方法代码示例

本文整理汇总了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;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:30,代码来源:Workflow.java

示例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.");
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:57,代码来源:DocumentEmailMessageHandler.java


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