AnsweredAssumed Answered

How to get storeref for alfresco content categories

Question asked by dynamolalit on Mar 24, 2010
Latest reply on Apr 5, 2010 by dynamolalit
Hi,

I am using Alfresco 3.2r with Tomcat 6 with JDK 1.6.

I want to know how can i get storeref for alfresco categories. Here is my code:


StoreRef storeRef = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, "SpacesStore");

LuceneCategoryServiceImpl categoryServiceImpl = new LuceneCategoryServiceImpl();
       Collection<ChildAssociationRef> listOfCategories = categoryServiceImpl.getCategories(storeRef , QName.createQName("{http://www.alfresco.org/model/application/1.0}company_home/{http://www.alfresco.org/model/content/1.0}category_root"), CategoryService.Depth.ANY);

Here i am getting error as:

java.lang.NullPointerException
   at org.alfresco.repo.search.impl.lucene.LuceneCategoryServiceImpl.getClassificationNodes(LuceneCategoryServiceImpl.java:284)
   at org.alfresco.repo.search.impl.lucene.LuceneCategoryServiceImpl.getCategories(LuceneCategoryServiceImpl.java:274)
   at com.jindal.alfresco.km.constraints.CommunitySearchConstraint.getAllowedValues(CommunitySearchConstraint.java:162)

org.alfresco.repo.search.impl.lucene.LuceneCategoryServiceImpl.getClassificationNodes(LuceneCategoryServiceImpl.java:284) states this:

private Set<NodeRef> getClassificationNodes(StoreRef storeRef, QName qname)
    {
        storeRef = tenantService.getName(storeRef); <– Line no 284

        ResultSet resultSet = null;
….


I think that i am putting right parameters but its not the case.

I also tried this:

StoreRef storeRef =new StoreRef("workspace://SpacesStore/{http://www.alfresco.org/model/content/1.0}categoryRoot");
StoreRef storeRef =new StoreRef("workspace://SpacesStore/");{http://www.alfresco.org/model/content/1.0}category_root");

But no luck!!


Any help?

Outcomes