cancel
Showing results for 
Search instead for 
Did you mean: 

Managing groups with Web Services

fmberqui
Champ in-the-making
Champ in-the-making
Hello,

I´m new developing Alfresco that I´m integrating with Liferay, and I have some problems that I need to solve, so I hope that someone can help me Smiley Happy.

We have sites on Liferay that need their own site/folder on Alfresco, and we want to make it from Liferay when an admin create a site and add users to it.

So I need to create a folder in Alfresco (I am able to do it with web services), and my problem now, is that i can create  a group for that folder, but I dont know how to make the folder private and set the group to the folder.

Is it possibly to do it with web services?

I´m not using webscript because we have the alfresco server on other host and Js doesnt allow me to execute it.

Thank you.
5 REPLIES 5

mitpatoliya
Star Collaborator
Star Collaborator
well you can do that.
But are you creating your own webservices or using the OOTB provided services?
Also I did not get why you are not able to use the webscript?
Whatever may be the case you should be able to use the webscripts.

You can play around with AuthorityService to achieve your requirement.

fmberqui
Champ in-the-making
Champ in-the-making
I havent created my WS, I´m using the Alfresco provided services.

I can´t use webscript because I need to do it from Java, because it will be invoked as a part of a servlet that make other stuff in Liferay, and I think that I can´t use WebScript from Java, but I haven´t used WebScript and maybe I´m wrong.

At this moment, I´m focusing on ACL and ACE class to get the permissions but the documentation that I´m finding about it its poor, any help?

Thank you.

Salutes.

mrogers
Star Contributor
Star Contributor
Yes of course you can use a WebScript from Java.

mitpatoliya
Star Collaborator
Star Collaborator
Here is the link for javabacked webscript
http://wiki.alfresco.com/wiki/Java-backed_Web_Scripts_Samples

fmberqui
Champ in-the-making
Champ in-the-making
Hello,

Thanks for the help, but finally I got it with WS provided by Alfresco.

My code is this:

reference = new Reference(spacesStore,null,"/app:company_home/st:sites/cm:"+FOLDERNAME);
             Predicate predicate = new Predicate(new Reference[] {reference}, null, null);
   
                ACL[] acl;
               try {
                  ACE[] ace = new ACE[]{new ACE(FOLDERNAME, Constants.CONTRIBUTOR, AccessStatus.acepted)};
                   acl = accessControlService.addACEs(predicate,ace);
                  
               } catch (Exception e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
               }

FOLDERNAME is the name of the folder and the usergroup that I asign to the folder. Don´t forget that FOLDERNAME must have included "GROUP_" at the beggining of the name.

Now I have other question… do you know how to do a folder as private?

Thank you again.

Salute.