Workflow Name: amset24createauthorities#
Constituent Services: AuthenticationService, AccessControlService, InitGetAuthoritiesWS, DateTimeWS#
Technical Notes#
Platform: GlassFishESB V2.1, NetBeans IDE 6.5.1 (including BPEL Designer, implementing WS-BPEL 2.0)
Java: 1.6.0_12; Java HotSpot(TM) Client VM 11.0-b15
System: Windows XP version 5.1 running on x86; Cp1252; en_GB (nb).
Alfresco Labs 3.1 Final running on remote server, 64-bit Java 1.6.0_13, Tomcat 6 on Red Hat Enterprise Linux 5.
At project number 24 the first substantial issue seems to have arisen. It is not possible to use the AccessControlService.createAuthorities()operation to create a user group unless it is a subgroup of an existing group. This seems to accord with a bug registerd in the Alfresco JIRA, https://issues.alfresco.com/jira/browse/RM-77.
The obvious workaround is to create a root group from the Web application console and work under this. It might also be possible to use a CML script and the RepositoryService.update() operation.
Workflow Description#
Creates new authorities, USER, GROUP or ROLE. The snippets below show the creation of a new group, MyTutorialGroup, under the existing GROUP_users group.
Input/Output#
Code snippet 24.1. InitCreateAuthoritiesWS SOAP request.
<soapenv:Envelope xsi:schemaLocation="http://schemas.xmlsoap.org/soap/envelope/ http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:init="http://j2ee.netbeans.org/wsdl/amset24createauthorities/InitCreateAuthoritiesWS" xmlns:acc="http://xml.netbeans.org/schema/accesscontrol"> <soapenv:Body> <init:InitCreateAuthoritiesWSOperation> <alfrescoAdminUsername>admin</alfrescoAdminUsername> <alfrescoAdminPassword>adminPassword</alfrescoAdminPassword> <part1> <acc:createAuthorities> <acc:parentAuthority>GROUP_users</acc:parentAuthority> <acc:newAuthorites> <acc:authorityType>GROUP</acc:authorityType> <acc:name>MyTutorialGroup</acc:name> </acc:newAuthorites> </acc:createAuthorities> </part1> </init:InitCreateAuthoritiesWSOperation> </soapenv:Body> </soapenv:Envelope>
Code snippet 24.2. AccessControlService.createAuthorities() SOAP request.
<?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header> <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> <wsu:Timestamp xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> <wsu:Created>2009-09-01T14:44:52.76+00:00</wsu:Created> <wsu:Expires>2009-09-01T14:48:52.00+00:00</wsu:Expires> </wsu:Timestamp> <UsernameToken> <Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">TICKET_c7e220b6b9b0102831be10bf3e2894d801edac75</Password> <Username>admin</Username> </UsernameToken> </Security> </SOAP-ENV:Header> <SOAP-ENV:Body> <createAuthorities xmlns="http://www.alfresco.org/ws/service/accesscontrol/1.0" xmlns:acc="http://xml.netbeans.org/schema/accesscontrol" xmlns:init="http://j2ee.netbeans.org/wsdl/amset24createauthorities/InitCreateAuthoritiesWS" xmlns:msgns="http://j2ee.netbeans.org/wsdl/amset24createauthorities/InitCreateAuthoritiesWS" xmlns:ns0="http://www.alfresco.org/ws/service/accesscontrol/1.0"> <acc:parentAuthority>GROUP_users</acc:parentAuthority> <acc:newAuthorites> <acc:authorityType>GROUP</acc:authorityType> <acc:name>MyTutorialGroup</acc:name> </acc:newAuthorites> </createAuthorities> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Code snippet 24.3. AccessControlService.createAuthorities() SOAP response.
<?xml version="1.0" encoding="UTF-8"?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body> <createAuthoritiesResponse xmlns="http://www.alfresco.org/ws/service/accesscontrol/1.0"> <results>GROUP_MyTutorialGroup</results> </createAuthoritiesResponse> </soapenv:Body> </soapenv:Envelope>