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


Java ApplicationModel类代码示例

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


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


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