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


Java NodeService.createAssociation方法代码示例

本文整理汇总了Java中org.alfresco.service.cmr.repository.NodeService.createAssociation方法的典型用法代码示例。如果您正苦于以下问题:Java NodeService.createAssociation方法的具体用法?Java NodeService.createAssociation怎么用?Java NodeService.createAssociation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.alfresco.service.cmr.repository.NodeService的用法示例。


在下文中一共展示了NodeService.createAssociation方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addAttachment

import org.alfresco.service.cmr.repository.NodeService; //导入方法依赖的package包/类
/**
 * Adds new node into Alfresco repository and mark its as an attachment.
 * 
 * @param nodeService Alfresco Node Service.
 * @param folder Space/Folder to add.
 * @param mainContentNode Main content node. Any mail is added into Alfresco as one main content node and several its attachments. Each attachment related with its main node.
 * @param fileName File name for the attachment.
 * @return Reference to created node.
 */
protected NodeRef addAttachment(NodeService nodeService, NodeRef folder, NodeRef mainContentNode, String fileName)
{
    
    if (log.isDebugEnabled())
    {
        log.debug("Adding attachment node (name=" + fileName + ").");
    }
    
    NodeRef attachmentNode = addContentNode(nodeService, folder, fileName, false);
    
    // Add attached aspect
    nodeService.addAspect(mainContentNode, ContentModel.ASPECT_ATTACHABLE, null);
    // Add the association
    nodeService.createAssociation(mainContentNode, attachmentNode, ContentModel.ASSOC_ATTACHMENTS);
    
    if (log.isDebugEnabled())
    {
        log.debug("Attachment has been added.");
    }
    return attachmentNode;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:31,代码来源:AbstractEmailMessageHandler.java

示例2: updateAssociations

import org.alfresco.service.cmr.repository.NodeService; //导入方法依赖的package包/类
@Override
protected void updateAssociations(NodeService nodeService)
{
    List<AssociationRef> existingAssocs = nodeService.getTargetAssocs(sourceNodeRef, assocQName);
    for (AssociationRef assoc : existingAssocs)
    {
        if (assoc.getTargetRef().equals(targetNodeRef))
        {
            if (logger.isWarnEnabled())
            {
                logger.warn("Attempt to add existing association prevented. " + assoc);
            }
            return;
        }
    }
    nodeService.createAssociation(sourceNodeRef, targetNodeRef, assocQName);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:18,代码来源:ContentModelFormProcessor.java

示例3: makeAvatar

import org.alfresco.service.cmr.repository.NodeService; //导入方法依赖的package包/类
public static String makeAvatar(final NodeService nodeService, final NodeRef person)
{
    nodeService.addAspect(person, ContentModel.ASPECT_PREFERENCES, null);
    ChildAssociationRef assoc = nodeService.createNode(person, ContentModel.ASSOC_PREFERENCE_IMAGE, avatarQName,
                ContentModel.TYPE_CONTENT);
    NodeRef avatar = assoc.getChildRef();
    nodeService.createAssociation(person, avatar, ContentModel.ASSOC_AVATAR);
    return "api/node/" + avatar + "/content/thumbnails/avatar";
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:10,代码来源:InvitationWebScriptTest.java


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