當前位置: 首頁>>代碼示例>>Java>>正文


Java CategoryService類代碼示例

本文整理匯總了Java中org.alfresco.service.cmr.search.CategoryService的典型用法代碼示例。如果您正苦於以下問題:Java CategoryService類的具體用法?Java CategoryService怎麽用?Java CategoryService使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


CategoryService類屬於org.alfresco.service.cmr.search包,在下文中一共展示了CategoryService類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getLoadedCategoryRoot

import org.alfresco.service.cmr.search.CategoryService; //導入依賴的package包/類
private NodeRef getLoadedCategoryRoot()
{
    StoreRef storeRef = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore");
    
    CategoryService categoryService = serviceRegistry.getCategoryService();
    // Check if the categories exist
    Collection<ChildAssociationRef> assocRefs = categoryService.getRootCategories(
            storeRef,
            ContentModel.ASPECT_GEN_CLASSIFIABLE);
    // Find it
    for (ChildAssociationRef assocRef : assocRefs)
    {
        NodeRef nodeRef = assocRef.getChildRef();
        if (nodeRef.getId().equals("test:xyz-root"))
        {
            // Found it
            return nodeRef;
        }
    }
    return null;
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:22,代碼來源:ComponentsTest.java

示例2: testImporterModuleComponent

import org.alfresco.service.cmr.search.CategoryService; //導入依賴的package包/類
public void testImporterModuleComponent() throws Exception
{
    // Delete any pre-existing data
    NodeRef nodeRef = getLoadedCategoryRoot();
    if (nodeRef != null)
    {
        CategoryService categoryService = serviceRegistry.getCategoryService();
        categoryService.deleteCategory(nodeRef);
    }
    // Double check to make sure it is gone
    nodeRef = getLoadedCategoryRoot();
    assertNull("Category not deleted", nodeRef);
    
    ImporterModuleComponent component = (ImporterModuleComponent) ctx.getBean("module.test.importerComponent");
    // Execute it
    component.execute();
    
    // Now make sure the data exists
    nodeRef = getLoadedCategoryRoot();
    assertNotNull("Loaded category root not found", nodeRef);
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:22,代碼來源:ComponentsTest.java

示例3: onSetUpInTransaction

import org.alfresco.service.cmr.search.CategoryService; //導入依賴的package包/類
@Override
protected void onSetUpInTransaction() throws Exception
{
    nodeService = (NodeService)applicationContext.getBean(ServiceRegistry.NODE_SERVICE.getLocalName());
    exporterService = (ExporterService)applicationContext.getBean("exporterComponent");
    importerService = (ImporterService)applicationContext.getBean("importerComponent");
    fileFolderService = (FileFolderService) applicationContext.getBean("fileFolderService");
    categoryService = (CategoryService) applicationContext.getBean("categoryService");     
    transactionService = (TransactionService) applicationContext.getBean("transactionService");
    permissionService = (PermissionServiceSPI) applicationContext.getBean("permissionService");

    this.authenticationService = (MutableAuthenticationService) applicationContext.getBean("AuthenticationService");
    this.authenticationComponent = (AuthenticationComponent) applicationContext.getBean("authenticationComponent");
    this.authenticationComponent.setSystemUserAsCurrentUser();
    this.storeRef = nodeService.createStore(StoreRef.PROTOCOL_WORKSPACE, "Test_" + System.currentTimeMillis());
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:17,代碼來源:ExporterComponentTest.java

示例4: getCategoryMembers

import org.alfresco.service.cmr.search.CategoryService; //導入依賴的package包/類
/**
 * @return all the member of a category
 */
public List<TemplateNode> getCategoryMembers()
{
    if (getIsCategory())
    {
        return buildTemplateNodeList(services.getCategoryService().getChildren(getNodeRef(),
                CategoryService.Mode.MEMBERS, CategoryService.Depth.ANY));
    }
    else
    {
        return Collections.<TemplateNode>emptyList();
    }
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:16,代碼來源:CategoryTemplateNode.java

示例5: getSubCategories

import org.alfresco.service.cmr.search.CategoryService; //導入依賴的package包/類
/**
 * @return all the subcategories of a category
 */
public List<CategoryTemplateNode> getSubCategories()
{
    if (getIsCategory())
    {
        return buildCategoryNodeList(services.getCategoryService().getChildren(getNodeRef(),
                CategoryService.Mode.SUB_CATEGORIES, CategoryService.Depth.ANY));
    }
    else
    {
        return Collections.<CategoryTemplateNode>emptyList();
    }
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:16,代碼來源:CategoryTemplateNode.java

示例6: getMembersAndSubCategories

import org.alfresco.service.cmr.search.CategoryService; //導入依賴的package包/類
/**
 * @return members and subcategories of a category
 */
public List<TemplateNode> getMembersAndSubCategories()
{
    if (getIsCategory())
    {

        return buildMixedNodeList(services.getCategoryService().getChildren(getNodeRef(), CategoryService.Mode.ALL,
                CategoryService.Depth.ANY));
    }
    else
    {
        return Collections.<TemplateNode>emptyList();
    }
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:17,代碼來源:CategoryTemplateNode.java

示例7: getImmediateCategoryMembers

import org.alfresco.service.cmr.search.CategoryService; //導入依賴的package包/類
/**
 * @return all the immediate member of a category
 */
public List<TemplateNode> getImmediateCategoryMembers()
{
    if (getIsCategory())
    {
        return buildTemplateNodeList(services.getCategoryService().getChildren(getNodeRef(),
                CategoryService.Mode.MEMBERS, CategoryService.Depth.IMMEDIATE));
    }
    else
    {
        return Collections.<TemplateNode>emptyList();
    }
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:16,代碼來源:CategoryTemplateNode.java

示例8: getImmediateSubCategories

import org.alfresco.service.cmr.search.CategoryService; //導入依賴的package包/類
/**
 * @return all the immediate subcategories of a category
 */
public List<CategoryTemplateNode> getImmediateSubCategories()
{
    if (getIsCategory())
    {
        return buildCategoryNodeList(services.getCategoryService().getChildren(getNodeRef(),
                CategoryService.Mode.SUB_CATEGORIES, CategoryService.Depth.IMMEDIATE));
    }
    else
    {
        return Collections.<CategoryTemplateNode>emptyList();
    }
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:16,代碼來源:CategoryTemplateNode.java

示例9: getImmediateMembersAndSubCategories

import org.alfresco.service.cmr.search.CategoryService; //導入依賴的package包/類
/**
 * @return immediate members and subcategories of a category
 */
public List<TemplateNode> getImmediateMembersAndSubCategories()
{
    if (getIsCategory())
    {
        return buildMixedNodeList(services.getCategoryService().getChildren(getNodeRef(),
                CategoryService.Mode.ALL, CategoryService.Depth.IMMEDIATE));
    }
    else
    {
        return Collections.<TemplateNode>emptyList();
    }
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:16,代碼來源:CategoryTemplateNode.java

示例10: getAllCategoryNodes

import org.alfresco.service.cmr.search.CategoryService; //導入依賴的package包/類
/**
 * Find all the category nodes in a given classification.
 * 
 * @param aspect String
 * @return Scriptable
 */
public Scriptable getAllCategoryNodes(String aspect)
{
    Object[] cats = buildCategoryNodes(services.getCategoryService().getCategories(
                        storeRef, createQName(aspect), CategoryService.Depth.ANY));
    return Context.getCurrentContext().newArray(getScope(), cats);
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:13,代碼來源:Classification.java

示例11: onSetUp

import org.alfresco.service.cmr.search.CategoryService; //導入依賴的package包/類
/**
 * Called during the transaction setup
 */
protected void onSetUp() throws Exception
{
   
    super.onSetUp();
    
    // Get the required services
    this.transferService = (TransferService)this.applicationContext.getBean("TransferService");
    this.contentService = (ContentService)this.applicationContext.getBean("ContentService");
    this.transferServiceImpl = (TransferServiceImpl2)this.applicationContext.getBean("transferService2");
    this.searchService = (SearchService)this.applicationContext.getBean("SearchService");
    this.transactionService = (TransactionService)this.applicationContext.getBean("TransactionService");
    this.nodeService = (NodeService) this.applicationContext.getBean("nodeService");
    this.contentService = (ContentService) this.applicationContext.getBean("contentService");
    this.authenticationService = (MutableAuthenticationService) this.applicationContext.getBean("authenticationService");
    this.actionService = (ActionService)this.applicationContext.getBean("actionService");
    this.permissionService = (PermissionService)this.applicationContext.getBean("permissionService");
    this.receiver = (TransferReceiver)this.applicationContext.getBean("transferReceiver");
    this.transferManifestNodeFactory = (TransferManifestNodeFactory)this.applicationContext.getBean("transferManifestNodeFactory");
    this.authenticationComponent = (AuthenticationComponent) this.applicationContext.getBean("authenticationComponent");
    this.lockService = (LockService) this.applicationContext.getBean("lockService");
    this.personService = (PersonService)this.applicationContext.getBean("PersonService");
    this.descriptorService = (DescriptorService)this.applicationContext.getBean("DescriptorService");
    this.copyService = (CopyService)this.applicationContext.getBean("CopyService");
    this.taggingService = ((TaggingService)this.applicationContext.getBean("TaggingService"));
    this.categoryService = (CategoryService)this.applicationContext.getBean("CategoryService");
    this.repositoryHelper = (Repository) this.applicationContext.getBean("repositoryHelper");
    
    this.serverDescriptor = descriptorService.getServerDescriptor();
    
    REPO_ID_B = descriptorService.getCurrentRepositoryDescriptor().getId();
    
    authenticationComponent.setSystemUserAsCurrentUser();
    assertNotNull("receiver is null", this.receiver);     
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:38,代碼來源:TransferServiceImplTest.java

示例12: onSetUp

import org.alfresco.service.cmr.search.CategoryService; //導入依賴的package包/類
/**
 * Called during the transaction setup
 */
protected void onSetUp() throws Exception
{
   
    super.onSetUp();
    
    // Get the required services
    this.transferService = (TransferService)this.applicationContext.getBean("TransferService");
    this.contentService = (ContentService)this.applicationContext.getBean("ContentService");
    this.transferServiceImpl = (TransferServiceImpl2)this.applicationContext.getBean("transferService2");
    this.searchService = (SearchService)this.applicationContext.getBean("SearchService");
    this.transactionService = (TransactionService)this.applicationContext.getBean("TransactionService");
    this.nodeService = (NodeService) this.applicationContext.getBean("nodeService");
    this.contentService = (ContentService) this.applicationContext.getBean("contentService");
    this.authenticationService = (MutableAuthenticationService) this.applicationContext.getBean("authenticationService");
    this.actionService = (ActionService)this.applicationContext.getBean("actionService");
    this.permissionService = (PermissionService)this.applicationContext.getBean("permissionService");
    this.receiver = (TransferReceiver)this.applicationContext.getBean("transferReceiver");
    this.transferManifestNodeFactory = (TransferManifestNodeFactory)this.applicationContext.getBean("transferManifestNodeFactory");
    this.authenticationComponent = (AuthenticationComponent) this.applicationContext.getBean("authenticationComponent");
    this.lockService = (LockService) this.applicationContext.getBean("lockService");
    this.personService = (PersonService)this.applicationContext.getBean("PersonService");
    this.descriptorService = (DescriptorService)this.applicationContext.getBean("DescriptorService");
    this.copyService = (CopyService)this.applicationContext.getBean("CopyService");
    this.taggingService = ((TaggingService)this.applicationContext.getBean("TaggingService"));
    this.categoryService = (CategoryService)this.applicationContext.getBean("CategoryService");
    
    this.serverDescriptor = descriptorService.getServerDescriptor();
    
    REPO_ID_B = descriptorService.getCurrentRepositoryDescriptor().getId();
    
    authenticationComponent.setSystemUserAsCurrentUser();
    assertNotNull("receiver is null", this.receiver);     
}
 
開發者ID:Alfresco,項目名稱:community-edition-old,代碼行數:37,代碼來源:TransferServiceImplTest.java

示例13: getCategoryService

import org.alfresco.service.cmr.search.CategoryService; //導入依賴的package包/類
private static CategoryService getCategoryService(FacesContext context)
{
    CategoryService service = Repository.getServiceRegistry(context).getCategoryService();
    if (service == null)
    {
        throw new IllegalStateException("Unable to obtain CategoryService bean reference.");
    }

    return service;
}
 
開發者ID:Alfresco,項目名稱:community-edition-old,代碼行數:11,代碼來源:UITagSelector.java

示例14: getCategoryService

import org.alfresco.service.cmr.search.CategoryService; //導入依賴的package包/類
/**
 * Use Spring JSF integration to return the category service bean instance
 * 
 * @param context    FacesContext
 * 
 * @return category service bean instance or throws runtime exception if not found
 */
private static CategoryService getCategoryService(FacesContext context)
{
   CategoryService service = Repository.getServiceRegistry(context).getCategoryService();
   if (service == null)
   {
      throw new IllegalStateException("Unable to obtain CategoryService bean reference.");
   }
   
   return service;
}
 
開發者ID:Alfresco,項目名稱:community-edition-old,代碼行數:18,代碼來源:UICategorySelector.java

示例15: getChildrenForNode

import org.alfresco.service.cmr.search.CategoryService; //導入依賴的package包/類
public Collection<NodeRef> getChildrenForNode(FacesContext context)
{
   NodeRef nodeRef = new NodeRef(Repository.getStoreRef(), this.navigationId);
   
   Collection<ChildAssociationRef> childRefs = getCategoryService(context).getChildren(nodeRef, 
         CategoryService.Mode.SUB_CATEGORIES, CategoryService.Depth.IMMEDIATE);
   Collection<NodeRef> refs = new ArrayList<NodeRef>(childRefs.size());
   for (ChildAssociationRef childRef : childRefs)
   {
      refs.add(childRef.getChildRef());
   }
   
   return refs;
}
 
開發者ID:Alfresco,項目名稱:community-edition-old,代碼行數:15,代碼來源:UICategorySelector.java


注:本文中的org.alfresco.service.cmr.search.CategoryService類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。