本文整理匯總了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;
}
示例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);
}
示例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());
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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();
}
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}