cancel
Showing results for 
Search instead for 
Did you mean: 

How query for group

joksy
Champ in-the-making
Champ in-the-making
Hi Alfy Users,

I look for a method for quesy the group in ALfresco, I just watch the pickerCallBack. For users and run ok,

The point now is to search for group and document. Someone of you know how??

Thanks in advance

Best Regards.
4 REPLIES 4

mrogers
Star Contributor
Star Contributor
I've just (yesterday) added REST api's for groups to HEAD.

If you want to do this with older versions of Alfresco you will need to use the Java AuthorityService.

joksy
Champ in-the-making
Champ in-the-making
I've just (yesterday) added REST api's for groups to HEAD.

If you want to do this with older versions of Alfresco you will need to use the Java AuthorityService.


Smiley Very Happy Thanks a lot

I m going to use the AuthorityService object for my businnes, let me ask you another question that was not so related to that post.
I unterstand that using the createcontentwizard is hard to fetch  some customproperty. That means that the customModel.xml are loaded after the creation of the document.

I m try to is more clear


private ArrayList<AssociationDefinition> getAssociations(){
      DictionaryService dictionaryService = Repository.getServiceRegistry(FacesContext.getCurrentInstance()).getDictionaryService();
      ArrayList<QName> qnames = new ArrayList<QName>(
            dictionaryService.getAssociations(QName.createQName("{http://www.xxx.com/model/content/1.0}adocument")));
      ArrayList<AssociationDefinition> associations = new ArrayList<AssociationDefinition>();
      for (QName qname : qnames) {
         associations.add(
               dictionaryService.getAssociation(qname));
      }
      return associations;
   /}

This is a simple method that want to return a list of AssociationDefintion but at runtime an error occur, and tell me that the model doesn not exist. But if i print all the collection form this.getDictionaryService().getAllTypes() is in there.

So i m quite lost, You know how that is possible???

Because my idea is to set, during the content creation, some property of the document. If you have some hits,could be very useful.

If my idea is not possible for some reason a try to build an wizard for doing this job after document creation.

Thanks again for the reply.

joksy
Champ in-the-making
Champ in-the-making
Hi Alfy Users,

I look for a method for quesy the group in ALfresco, I just watch the pickerCallBack. For users and run ok,

The point now is to search for group and document. Someone of you know how??

Thanks in advance

Best Regards.


Hey guys i post my method for achieve this task. Thanks mrogers Smiley Wink


   public SelectItem[] pickerGroups(int filterIndex, final String contains){
      SelectItem[] gropusItems = new SelectItem[authorityService.getAllAuthorities(AuthorityType.GROUP).size()];
      Iterator<String> iterator = authorityService.getAllAuthorities(AuthorityType.GROUP).iterator();
   
      for (int i = 0;iterator.hasNext();i++) {
         String value = iterator.next();
         gropusItems[i] = new SelectItem(value,value);
      }
      return gropusItems;
   }

cheffilet
Champ in-the-making
Champ in-the-making
Try this, it could help:


StoreRef storeRef = new StoreRef("alfrescoUserStore","user");
searcher.query(storeRef, "lucene", "TYPE: \\\"{http://www.alfresco.org/model/user/1.0}authorityContainer\\\"", null, null)