cancel
Showing results for 
Search instead for 
Did you mean: 

Find all groups

lbm
Champ in-the-making
Champ in-the-making
Hi,

I'd like to know how to get all existing groups in Alfresco. I've tried :

var query = "TYPE:\"{http://www.alfresco.org/model/user/1.0}authorityContainer\"";

but it doesn't get any results.  Is there anything wrong? Is there another way to get all existing groups? It's driving me crazy and I really need it!!

Thank you.
3 REPLIES 3

lbm
Champ in-the-making
Champ in-the-making
Well, I've realised what the problem is , but I don't know hot to solve it.
The problem is that my search is not in "workspace://SpacesStore" but in "user://alfrescoUserStore". So how can I change the storeref if my code is in javascript? Because I've looked through the API and with "search.luceneSearch(query)" I can't specify what store I want to use, it always uses "workspace://SpacesStore"…

If someone has any idea of how I can solve it, I would be really, really grateful. Thank you!

lotharm
Champ on-the-rise
Champ on-the-rise
More a hack instead of a real solution, there is a search.setStoreUrl(…) method on the org.alfresco.repo.jscript.Search class which might help:

  
     /**
     * Set the default store reference
     *
     * @param   storeRef the default store reference
     */
    public void setStoreUrl(String storeRef)
    {
        this.storeRef = new StoreRef(storeRef);
    }

lbm
Champ in-the-making
Champ in-the-making
Yes, it worked!
Thank you very much