• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ApplicationModel类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.alfresco.model.ApplicationModel的典型用法代码示例。如果您正苦于以下问题:Java ApplicationModel类的具体用法?Java ApplicationModel怎么用?Java ApplicationModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ApplicationModel类属于org.alfresco.model包,在下文中一共展示了ApplicationModel类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: addForumNode

import org.alfresco.model.ApplicationModel; //导入依赖的package包/类
/**
     * Adds forum node
     * 
     * @param nodeRef Paren node
     * @return Reference to created node
     */
    private NodeRef addForumNode(NodeRef nodeRef)
    {
        NodeService nodeService = getNodeService();
        
//        //Add discussable aspect to content node
//        if (!nodeService.hasAspect(nodeRef, ForumModel.ASPECT_DISCUSSABLE))
//        {
//            nodeService.addAspect(nodeRef, ForumModel.ASPECT_DISCUSSABLE, null);
//        }

        //Create forum node and associate it with content node
        Map<QName, Serializable> properties = new HashMap<QName, Serializable>(1);
        properties.put(ContentModel.PROP_NAME, forumNodeName);
        ChildAssociationRef childAssoc = nodeService.createNode(nodeRef, ForumModel.ASSOC_DISCUSSION, ForumModel.ASSOC_DISCUSSION, ForumModel.TYPE_FORUM, properties);
        NodeRef forumNode = childAssoc.getChildRef();        

        //Add necessary aspects to forum node
        properties.clear();
        properties.put(ApplicationModel.PROP_ICON, "forum");
        nodeService.addAspect(forumNode, ApplicationModel.ASPECT_UIFACETS, properties);
        
        return forumNode;
    }
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:30,代码来源:DocumentEmailMessageHandler.java


示例2: getLinkDestination

import org.alfresco.model.ApplicationModel; //导入依赖的package包/类
@Override
public NodeRef getLinkDestination(NodeRef linkNodeRef)
{
    /* Validate input */
    PropertyCheck.mandatory(this, "linkNodeRef", linkNodeRef);

    /* Check if the node exists */
    if (!nodeService.exists(linkNodeRef))
    {
        throw new IllegalArgumentException("The provided node does not exist");
    }

    if (!nodeService.getType(linkNodeRef).equals(ApplicationModel.TYPE_FILELINK)
            && !nodeService.getType(linkNodeRef).equals(ApplicationModel.TYPE_FOLDERLINK))
    {
        throw new IllegalArgumentException("The provided node is not a document link");
    }

    return (NodeRef) nodeService.getProperty(linkNodeRef, ContentModel.PROP_LINK_DESTINATION);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:21,代码来源:DocumentLinkServiceImpl.java


示例3: getConfigurationFolder

import org.alfresco.model.ApplicationModel; //导入依赖的package包/类
public NodeRef getConfigurationFolder(NodeRef nodeRef)
{
	NodeRef result = null;
	if (isConfigurable(nodeRef) == true)
	{
		List<ChildAssociationRef> assocs = this.nodeService.getChildAssocs(
                   nodeRef,
                   RegexQNamePattern.MATCH_ALL,
                   ApplicationModel.ASSOC_CONFIGURATIONS);
		if (assocs.size() != 0)
		{
			ChildAssociationRef assoc = assocs.get(0);
			result = assoc.getChildRef();
		}
	}		
	return result;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:18,代码来源:ConfigurableServiceImpl.java


示例4: testHasAspect

import org.alfresco.model.ApplicationModel; //导入依赖的package包/类
/**
 * Test hasAspect
 */
public void testHasAspect()
{
    // Create a new versionable node
    NodeRef versionableNode = createNewVersionableNode();
    
    // Create a new version
    Version version = createVersion(versionableNode, this.versionProperties);
    
    boolean test1 = this.versionStoreNodeService.hasAspect(
            version.getFrozenStateNodeRef(), 
            ApplicationModel.ASPECT_UIFACETS);
    assertFalse(test1);
    
    boolean test2 = this.versionStoreNodeService.hasAspect(
            version.getFrozenStateNodeRef(),
            ContentModel.ASPECT_VERSIONABLE);
    assertTrue(test2);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:22,代码来源:NodeServiceImplTest.java


示例5: testCreateFileLink

import org.alfresco.model.ApplicationModel; //导入依赖的package包/类
/**
 * Tests the creation of a file link
 * 
 * @throws Exception
 */
public void testCreateFileLink() throws Exception
{
    // create a link of file site1File1_1 in folder site1Folder2
    NodeRef linkNodeRef = documentLinkService.createDocumentLink(site1File1, site1Folder2);
    assertNotNull(linkNodeRef);

    // test if the link node is listed as a child of site1Folder2
    String site1File1LinkName =  I18NUtil.getMessage("doclink_service.link_to_label", (site1File1Name + ".url"));
    NodeRef linkNodeRef2 = fileFolderService.searchSimple(site1Folder2, site1File1LinkName);
    assertNotNull(linkNodeRef2);
    assertEquals(linkNodeRef, linkNodeRef2);

    // check the type of the link
    assertEquals(nodeService.getType(linkNodeRef), ApplicationModel.TYPE_FILELINK);

    // check if the link destination is site1File1_1
    NodeRef linkDestination = documentLinkService.getLinkDestination(linkNodeRef);
    assertNotNull(linkDestination);
    assertEquals(linkDestination, site1File1);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:26,代码来源:DocumentLinkServiceImplTest.java


示例6: testCreateFolderLink

import org.alfresco.model.ApplicationModel; //导入依赖的package包/类
/**
 * Tests the creation of a folder link
 * 
 * @throws Exception
 */
public void testCreateFolderLink() throws Exception
{
    // create a link of file site1File1_1 in folder site1Folder2
    NodeRef linkNodeRef = documentLinkService.createDocumentLink(site1Folder1, site1Folder2);
    assertNotNull(linkNodeRef);

    // test if the link node is listed as a child of site1Folder2
    String site1Folder1LinkName =  I18NUtil.getMessage("doclink_service.link_to_label", (site1Folder1Name + ".url"));
    NodeRef linkNodeRef2 = fileFolderService.searchSimple(site1Folder2, site1Folder1LinkName);
    assertNotNull(linkNodeRef2);
    assertEquals(linkNodeRef, linkNodeRef2);

    // check the type of the link
    assertEquals(nodeService.getType(linkNodeRef), ApplicationModel.TYPE_FOLDERLINK);

    // check if the link destination is site1File1_1
    NodeRef linkDestination = documentLinkService.getLinkDestination(linkNodeRef);
    assertNotNull(linkDestination);
    assertEquals(linkDestination, site1Folder1);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:26,代码来源:DocumentLinkServiceImplTest.java


示例7: testDeleteLinks

import org.alfresco.model.ApplicationModel; //导入依赖的package包/类
/**
 * Tests the deletion of a document's links, with and without write
 * permissions
 * 
 * @throws Exception
 */
public void testDeleteLinks() throws Exception
{
    DeleteLinksStatusReport report = AuthenticationUtil.runAs(new RunAsWork<DeleteLinksStatusReport>()
    {
        @Override
        public DeleteLinksStatusReport doWork() throws Exception
        {
            return documentLinkService.deleteLinksToDocument(site1File2);
        }
    }, TEST_USER);

    // check if the service found 2 links of the document
    assertEquals(2, report.getTotalLinksFoundCount());

    // check if the service successfully deleted one
    assertEquals(1, report.getDeletedLinksCount());

    assertEquals(true, nodeService.hasAspect(site1File2, ApplicationModel.ASPECT_LINKED));

    // check if the second one failed with access denied
    Throwable ex = report.getErrorDetails().get(linkOfFile1Site2);
    assertNotNull(ex);
    assertEquals(ex.getClass(), AccessDeniedException.class);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:31,代码来源:DocumentLinkServiceImplTest.java


示例8: testExecutionReject

import org.alfresco.model.ApplicationModel; //导入依赖的package包/类
public void testExecutionReject()
{
    addWorkflowAspect(node, destinationFolder, Boolean.TRUE, Boolean.FALSE);
    
    assertTrue(nodeService.hasAspect(node, ApplicationModel.ASPECT_SIMPLE_WORKFLOW));
    NodeRef pParent = nodeService.getPrimaryParent(node).getParentRef();
    assertEquals(sourceFolder, pParent);
    assertEquals(0, nodeService.getChildAssocs(destinationFolder).size());
    
    ActionImpl action = new ActionImpl(null, ID, "reject-simpleworkflow", null);
    rejectExecuter.execute(action, node);
    
    assertFalse(nodeService.hasAspect(node, ApplicationModel.ASPECT_SIMPLE_WORKFLOW));
    pParent = nodeService.getPrimaryParent(node).getParentRef();
    assertEquals(sourceFolder, pParent);        
    assertEquals(1, nodeService.getChildAssocs(destinationFolder).size());
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:18,代码来源:TransitionSimpleWorkflowActionExecuterTest.java


示例9: testExecutionApproveWhenDestinationSameAsSource

import org.alfresco.model.ApplicationModel; //导入依赖的package包/类
/** Test for MNT-14730*/
public void testExecutionApproveWhenDestinationSameAsSource()
{
    addWorkflowAspect(node, sourceFolder, Boolean.FALSE, Boolean.FALSE);
    
    assertTrue(nodeService.hasAspect(node, ApplicationModel.ASPECT_SIMPLE_WORKFLOW));
    NodeRef pParent = nodeService.getPrimaryParent(node).getParentRef();
    assertEquals(sourceFolder, pParent);
    
    ActionImpl action = new ActionImpl(null, ID, "accept-simpleworkflow", null);
    acceptExecuter.execute(action, node);
    
    String copyName = QName.createValidLocalName("Copy of my node.txt");
    NodeRef nodeRef = nodeService.getChildByName(sourceFolder, ContentModel.ASSOC_CONTAINS, copyName);
    assertNotNull(nodeRef);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:17,代码来源:TransitionSimpleWorkflowActionExecuterTest.java


示例10: testExecutionRejectWhenDestinationSameAsSource

import org.alfresco.model.ApplicationModel; //导入依赖的package包/类
/** Test for MNT-14730*/
public void testExecutionRejectWhenDestinationSameAsSource()
{
    addWorkflowAspect(node, sourceFolder, Boolean.FALSE, Boolean.FALSE);
    
    assertTrue(nodeService.hasAspect(node, ApplicationModel.ASPECT_SIMPLE_WORKFLOW));
    NodeRef pParent = nodeService.getPrimaryParent(node).getParentRef();
    assertEquals(sourceFolder, pParent);
    assertEquals(0, nodeService.getChildAssocs(destinationFolder).size());
    
    ActionImpl action = new ActionImpl(null, ID, "reject-simpleworkflow", null);
    rejectExecuter.execute(action, node);
    
    assertFalse(nodeService.hasAspect(node, ApplicationModel.ASPECT_SIMPLE_WORKFLOW));
    pParent = nodeService.getPrimaryParent(node).getParentRef();
    assertEquals(sourceFolder, pParent);        
    assertEquals(0, nodeService.getChildAssocs(destinationFolder).size());
    
    String copyName = QName.createValidLocalName("Copy of my node.txt");
    NodeRef nodeRef = nodeService.getChildByName(sourceFolder, ContentModel.ASSOC_CONTAINS, copyName);
    assertNotNull(nodeRef);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:23,代码来源:TransitionSimpleWorkflowActionExecuterTest.java


示例11: testCreateFileLink

import org.alfresco.model.ApplicationModel; //导入依赖的package包/类
/**
 * Tests the creation of a file link
 * 
 * @throws Exception
 */
public void testCreateFileLink() throws Exception
{
    // create a link of file site1File1_1 in folder site1Folder2
    NodeRef linkNodeRef = documentLinkService.createDocumentLink(site1File1, site1Folder2);
    assertNotNull(linkNodeRef);

    // test if the link node is listed as a child of site1Folder2
    NodeRef linkNodeRef2 = fileFolderService.searchSimple(site1Folder2, site1File1Name);
    assertNotNull(linkNodeRef2);
    assertEquals(linkNodeRef, linkNodeRef2);

    // check the type of the link
    assertEquals(nodeService.getType(linkNodeRef), ApplicationModel.TYPE_FILELINK);

    // check if the link destination is site1File1_1
    NodeRef linkDestination = documentLinkService.getLinkDestination(linkNodeRef);
    assertNotNull(linkDestination);
    assertEquals(linkDestination, site1File1);
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:25,代码来源:DocumentLinkServiceImplTest.java


示例12: testCreateFolderLink

import org.alfresco.model.ApplicationModel; //导入依赖的package包/类
/**
 * Tests the creation of a folder link
 * 
 * @throws Exception
 */
public void testCreateFolderLink() throws Exception
{
    // create a link of file site1File1_1 in folder site1Folder2
    NodeRef linkNodeRef = documentLinkService.createDocumentLink(site1Folder1, site1Folder2);
    assertNotNull(linkNodeRef);

    // test if the link node is listed as a child of site1Folder2
    NodeRef linkNodeRef2 = fileFolderService.searchSimple(site1Folder2, site1Folder1Name);
    assertNotNull(linkNodeRef2);
    assertEquals(linkNodeRef, linkNodeRef2);

    // check the type of the link
    assertEquals(nodeService.getType(linkNodeRef), ApplicationModel.TYPE_FOLDERLINK);

    // check if the link destination is site1File1_1
    NodeRef linkDestination = documentLinkService.getLinkDestination(linkNodeRef);
    assertNotNull(linkDestination);
    assertEquals(linkDestination, site1Folder1);
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:25,代码来源:DocumentLinkServiceImplTest.java


示例13: removeRSSTemplate

import org.alfresco.model.ApplicationModel; //导入依赖的package包/类
/**
 * Action handler to remove a RSS template from the current Space
 */
public void removeRSSTemplate(ActionEvent event)
{
   try
   {
      // clear template property
      getNodeService().setProperty(getNode().getNodeRef(), ApplicationModel.PROP_FEEDTEMPLATE, null);
      getNodeService().removeAspect(getNode().getNodeRef(), ApplicationModel.ASPECT_FEEDSOURCE);
      
      // reset node details for next refresh of details page
      getNode().reset();
   }
   catch (Exception e)
   {
      Utils.addErrorMessage(MessageFormat.format(Application.getMessage(
            FacesContext.getCurrentInstance(), Repository.ERROR_GENERIC), e.getMessage()), e);
   }
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:21,代码来源:SpaceDetailsDialog.java


示例14: setupCommonBindingProperties

import org.alfresco.model.ApplicationModel; //导入依赖的package包/类
/**
 * Setup the common properties required at data-binding time.
 * <p>
 * These are properties used by components on the page when iterating over the nodes.
 * The properties are available as the Node is a Map so they can be accessed directly
 * by name. Information such as download URL, size and filetype are provided etc.
 * <p>
 * We use a set of anonymous inner classes to provide the implemention for the property
 * getters. The interfaces are only called when the properties are first requested.
 *
 * @param node       Node to add the properties too
 */
public void setupCommonBindingProperties(Node node)
{
   // special properties to be used by the value binding components on the page
   node.addPropertyResolver("url", this.resolverUrl);

   if (ApplicationModel.TYPE_FILELINK.equals(node.getType()))
   {
      node.addPropertyResolver("downloadUrl", this.resolverLinkDownload);
   }
   else
   {
      node.addPropertyResolver("downloadUrl", this.resolverDownload);
   }

   node.addPropertyResolver("webdavUrl", this.resolverWebdavUrl);
   node.addPropertyResolver("cifsPath", this.resolverCifsPath);
   node.addPropertyResolver("fileType16", this.resolverFileType16);
   node.addPropertyResolver("fileType32", this.resolverFileType32);
   node.addPropertyResolver("size", this.resolverSize);
   node.addPropertyResolver("lang", this.resolverLang);
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:34,代码来源:BrowseBean.java


示例15: evaluate

import org.alfresco.model.ApplicationModel; //导入依赖的package包/类
/**
 * @see org.alfresco.web.action.ActionEvaluator#evaluate(org.alfresco.web.bean.repository.Node)
 */
public boolean evaluate(Node node)
{
   FacesContext fc = FacesContext.getCurrentInstance();
   DictionaryService dd = Repository.getServiceRegistry(fc).getDictionaryService();
   
   boolean result = false;
   
   // if the node is inline editable, the default http behaviour should always be used
   if (dd.isSubClass(node.getType(), ContentModel.TYPE_CONTENT))
   {
      if (node.hasAspect(ApplicationModel.ASPECT_INLINEEDITABLE) == false &&
          "cifs".equals(Application.getClientConfig(fc).getEditLinkType()))
      {
         if ((node.isWorkingCopyOwner() == true && node.getProperties().get(ContentModel.PROP_WORKING_COPY_MODE) != null && 
              node.getProperties().get(ContentModel.PROP_WORKING_COPY_MODE).equals(EditOnlineDialog.ONLINE_EDITING))||
            (node.hasAspect(ContentModel.ASPECT_WORKING_COPY) && node.hasPermission(PermissionService.WRITE)) ||
            (node.isLocked() == false && node.hasAspect(ContentModel.ASPECT_WORKING_COPY) == false))
         {
            result = true;
         }
      }
   }
   
   return result;
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:29,代码来源:EditDocCIFSEvaluator.java


示例16: evaluate

import org.alfresco.model.ApplicationModel; //导入依赖的package包/类
/**
 * @see org.alfresco.web.action.ActionEvaluator#evaluate(org.alfresco.web.bean.repository.Node)
 */
public boolean evaluate(Node node)
{
   FacesContext fc = FacesContext.getCurrentInstance();
   DictionaryService dd = Repository.getServiceRegistry(fc).getDictionaryService();
   
   boolean result = false;
   
   // if the node is inline editable, the default http behaviour should always be used
   if (dd.isSubClass(node.getType(), ContentModel.TYPE_CONTENT))
   {
      if (node.hasAspect(ApplicationModel.ASPECT_INLINEEDITABLE) == false &&
          "webdav".equals(Application.getClientConfig(fc).getEditLinkType()))
      {
         if ((node.isWorkingCopyOwner() == true && node.getProperties().get(ContentModel.PROP_WORKING_COPY_MODE).equals(EditOnlineDialog.ONLINE_EDITING)) ||
            (node.hasAspect(ContentModel.ASPECT_WORKING_COPY) && node.hasPermission(PermissionService.WRITE)) ||
            (node.isLocked() == false && node.hasAspect(ContentModel.ASPECT_WORKING_COPY) == false))
         {
            result = true;
         }
      }
   }
   
   return result;
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:28,代码来源:EditDocWebDavEvaluator.java


示例17: deleteLinks

import org.alfresco.model.ApplicationModel; //导入依赖的package包/类
@Test
public void deleteLinks() throws Exception {
	// create the link
	transactionHelper.doInTransaction(new RetryingTransactionHelper.RetryingTransactionCallback<Void>(){
		@Override
		public Void execute() throws Throwable {
			ScriptNode newDocumentLink = scriptLinkService.createLink(new ScriptNode(documentId, getServiceRegistry()),
					new ScriptNode(tempFolder, getServiceRegistry()));
			Assert.assertNotNull(newDocumentLink);
			Assert.assertTrue(getServiceRegistry().getNodeService().getType(newDocumentLink.getNodeRef()).
					equals(ApplicationModel.TYPE_FILELINK));

			return null;
		}
	},false,true);

	// delete the new created link
	transactionHelper.doInTransaction(new RetryingTransactionHelper.RetryingTransactionCallback<Void>() {
		@Override
		public Void execute() throws Throwable {
			scriptLinkService.deleteLinks(new ScriptNode(documentId, getServiceRegistry()));
			return null;
		}
	});
}
 
开发者ID:jgoldhammer,项目名称:alfresco-jscript-extensions,代码行数:26,代码来源:ScriptLinkServiceTest.java


示例18: addTopicNode

import org.alfresco.model.ApplicationModel; //导入依赖的package包/类
/**
 * Adds topic node into Alfresco repository
 * 
 * @param parentNode        Parent node
 * @param name              Topic name
 * @return                  Reference to created node
 */
protected NodeRef addTopicNode(NodeRef parentNode, String name)
{
    String workingName = encodeSubject(name);
    
    NodeService nodeService = getNodeService();
    Map<QName, Serializable> properties = new HashMap<QName, Serializable>(1);
    properties.put(ContentModel.PROP_NAME, workingName);

    NodeRef topicNode = nodeService.getChildByName(parentNode, ContentModel.ASSOC_CONTAINS, workingName);
    if (topicNode == null)
    {
        ChildAssociationRef association = nodeService.createNode(
                parentNode,
                ContentModel.ASSOC_CONTAINS,
                QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, workingName),
                ForumModel.TYPE_TOPIC,
                properties);
        topicNode = association.getChildRef();
    }

    // Add necessary aspects
    properties.clear();
    properties.put(ApplicationModel.PROP_ICON, "topic");
    getNodeService().addAspect(topicNode, ApplicationModel.ASPECT_UIFACETS, properties);

    return topicNode;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:35,代码来源:AbstractForumEmailMessageHandler.java


示例19: init

import org.alfresco.model.ApplicationModel; //导入依赖的package包/类
/**
 * The initialise method. Register our policies.
 */
public void init()
{
    PropertyCheck.mandatory(this, "nodeService", nodeService);
    PropertyCheck.mandatory(this, "dictionaryService", dictionaryService);
    PropertyCheck.mandatory(this, "searchService", searchService);
    PropertyCheck.mandatory(this, "namespaceService", namespaceService);
    PropertyCheck.mandatory(this, "checkOutCheckInService", checkOutCheckInService);
    PropertyCheck.mandatory(this, "policyComponent", policyComponent);
    PropertyCheck.mandatory(this, "behaviourFilter", behaviourFilter);
    PropertyCheck.mandatory(this, "permissionService", permissionService);
    PropertyCheck.mandatory(this, "cannedQueryDAO", cannedQueryDAO);
    PropertyCheck.mandatory(this, "qnameDAO", qnameDAO);

    // Register interest in the beforeDeleteNode policy

    // for nodes that have app:linked aspect
    policyComponent.bindClassBehaviour(
            BeforeDeleteNodePolicy.QNAME,
            ApplicationModel.ASPECT_LINKED,
            new JavaBehaviour(this, "beforeDeleteNode"));

   //for app:filelink node types 
   policyComponent.bindClassBehaviour(
            BeforeDeleteNodePolicy.QNAME,
            ApplicationModel.TYPE_FILELINK,
            new JavaBehaviour(this, "beforeDeleteLinkNode"));

    //for app:folderlink node types 
    policyComponent.bindClassBehaviour(
            BeforeDeleteNodePolicy.QNAME,
            ApplicationModel.TYPE_FOLDERLINK,
            new JavaBehaviour(this, "beforeDeleteLinkNode"));
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:37,代码来源:DocumentLinkServiceImpl.java


示例20: beforeDeleteLinkNode

import org.alfresco.model.ApplicationModel; //导入依赖的package包/类
public void beforeDeleteLinkNode(NodeRef linkNodeRef)
{
    final NodeRef nodeRef = getLinkDestination(linkNodeRef);

    List<Long> nodeRefLinks = getNodeLinksIds(nodeRef);

    long linkNodeId = (Long) nodeService.getProperty(linkNodeRef, ContentModel.PROP_NODE_DBID);

    if (nodeRefLinks.size() == 1 && nodeRefLinks.contains(linkNodeId))
    {
        AuthenticationUtil.runAs(new AuthenticationUtil.RunAsWork<Object>()
        {
            public Void doWork() throws Exception
            {
                behaviourFilter.disableBehaviour(nodeRef, ContentModel.ASPECT_AUDITABLE);
                behaviourFilter.disableBehaviour(nodeRef, ContentModel.ASPECT_LOCKABLE);
                try
                {
                    nodeService.removeAspect(nodeRef, ApplicationModel.ASPECT_LINKED);
                }
                finally
                {
                    behaviourFilter.enableBehaviour(nodeRef, ContentModel.ASPECT_AUDITABLE);
                    behaviourFilter.enableBehaviour(nodeRef, ContentModel.ASPECT_LOCKABLE);
                }

                return null;
            }
        }, AuthenticationUtil.getSystemUserName());
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:32,代码来源:DocumentLinkServiceImpl.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Feature类代码示例发布时间:2022-05-22
下一篇:
Java BinaryCommandFactory类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap