Workflow Name: amset9copynode#
Constituent Services: AuthenticationService, RepositoryService, InitCreateContentWS, DateTimeWS#
Technical Notes#
Platform: GlassFishESB V2.1, NetBeans IDE 6.5 (including BPEL Designer, implementing WS-BPEL 2.0)
Java: 1.6.0_10; 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.
Workflow Description#
This is a copy of amset4 with appropriate changes in input XML (namespaces haven't been altered). This copies a node, either a folder or resource, from one folder to another.
If the children element is set to true, then all child nodes are also copied.
Input/Output#
The <ns:to></ns:to> defines the destination and <ns:where></ns:where> the source.
Code snippet 9.1. InitCreateContentWS 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/amset5createcontent1/InitCreateContentWS" xmlns:ns="http://www.alfresco.org/ws/cml/1.0" xmlns:ns1="http://www.alfresco.org/ws/model/content/1.0">
<soapenv:Body>
<init:InitCreateContentWSOperation>
<username>admin</username>
<password>adminPassword</password>
<updateRequest>
<!--Zero or more repetitions:-->
<ns:copy>
<!--You have a CHOICE of the next 2 items at this level-->
<!--Optional:-->
<ns:to>
<!--Optional:-->
<ns1:store>
<!--Optional:-->
<ns1:scheme>workspace</ns1:scheme>
<!--Optional:-->
<ns1:address>SpacesStore</ns1:address>
</ns1:store>
<!--Optional:-->
<ns1:uuid>d8016a51-7df8-4fdb-aee7-64977dbfc6a3</ns1:uuid>
<!--Optional:-->
<ns1:path></ns1:path>
<!--Optional:-->
<ns1:associationType>{http://www.alfresco.org/model/content/1.0}contains</ns1:associationType>
<!--Optional:-->
<ns1:childName>{http://www.alfresco.org/model/content/1.0}contains</ns1:childName>
</ns:to>
<!--You have a CHOICE of the next 2 items at this level-->
<!--Optional:-->
<ns:where>
<!--You have a CHOICE of the next 2 items at this level-->
<!--Zero or more repetitions:-->
<ns1:nodes>
<!--Optional:-->
<ns1:store>
<!--Optional:-->
<ns1:scheme>workspace</ns1:scheme>
<!--Optional:-->
<ns1:address>SpacesStore</ns1:address>
</ns1:store>
<!--Optional:-->
<ns1:uuid>471d4bc3-5285-4f9e-9bab-f923943a76e0</ns1:uuid>
<!--Optional:-->
<ns1:path></ns1:path>
</ns1:nodes>
<!--Optional:-->
<ns1:store>
<!--Optional:-->
<ns1:scheme></ns1:scheme>
<!--Optional:-->
<ns1:address></ns1:address>
</ns1:store>
<!--Optional:-->
<ns1:query>
<ns1:language></ns1:language>
<ns1:statement></ns1:statement>
</ns1:query>
</ns:where>
<!--Optional:-->
<ns:where_id></ns:where_id>
<!--Optional:-->
<ns:children></ns:children>
</ns:copy>
</updateRequest>
</init:InitCreateContentWSOperation>
</soapenv:Body>
</soapenv:Envelope>
Code snippet 9.2. RepositoryService.update() 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-08-28T14:26:35.42+00:00</wsu:Created>
<wsu:Expires>2009-08-28T14:30:35.00+00:00</wsu:Expires>
</wsu:Timestamp>
<UsernameToken>
<Username>admin</Username>
<Password Id="" Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">TICKET_7d2bce622d4175e622bb4d181d6d6e05e77ace69</Password>
</UsernameToken>
</Security>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<update
xmlns="http://www.alfresco.org/ws/service/repository/1.0" xmlns:msgns="http://www.alfresco.org/ws/service/repository/1.0">
<ns0:statements
xmlns:init="http://j2ee.netbeans.org/wsdl/amset5createcontent1/InitCreateContentWS"
xmlns:msgns="http://j2ee.netbeans.org/wsdl/amset5createcontent1/InitCreateContentWS"
xmlns:ns="http://www.alfresco.org/ws/cml/1.0"
xmlns:ns0="http://www.alfresco.org/ws/service/repository/1.0" xmlns:ns1="http://www.alfresco.org/ws/model/content/1.0">
<ns:copy>
<ns:to>
<ns1:store>
<ns1:scheme>workspace</ns1:scheme>
<ns1:address>SpacesStore</ns1:address>
</ns1:store>
<ns1:uuid>d8016a51-7df8-4fdb-aee7-64977dbfc6a3</ns1:uuid>
<ns1:path/>
<ns1:associationType>{http://www.alfresco.org/model/content/1.0}contains</ns1:associationType>
<ns1:childName>{http://www.alfresco.org/model/content/1.0}contains</ns1:childName>
</ns:to>
<ns:where>
<ns1:nodes>
<ns1:store>
<ns1:scheme>workspace</ns1:scheme>
<ns1:address>SpacesStore</ns1:address>
</ns1:store>
<ns1:uuid>471d4bc3-5285-4f9e-9bab-f923943a76e0</ns1:uuid>
<ns1:path/>
</ns1:nodes>
<ns1:store>
<ns1:scheme/>
<ns1:address/>
</ns1:store>
<ns1:query>
<ns1:language/>
<ns1:statement/>
</ns1:query>
</ns:where>
<ns:where_id/>
<ns:children/>
</ns:copy>
</ns0:statements>
</update>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Code snippet 9.3. RepositoryService.update() 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>
<updateResponse xmlns="http://www.alfresco.org/ws/service/repository/1.0">
<updateReturn>
<statement>copy</statement>
<updateCount xsi:nil="true"/>
<sourceId xsi:nil="true"/>
<source>
<ns1:store xmlns:ns1="http://www.alfresco.org/ws/model/content/1.0">
<ns1:scheme>workspace</ns1:scheme>
<ns1:address>SpacesStore</ns1:address>
</ns1:store>
<ns2:uuid xmlns:ns2="http://www.alfresco.org/ws/model/content/1.0">471d4bc3-5285-4f9e-9bab-f923943a76e0</ns2:uuid>
<ns3:path xmlns:ns3="http://www.alfresco.org/ws/model/content/1.0">/app:company_home/cm:Waffle_x0020_Bus_x0020_Workflows/cm:What_x0020_is_x0020_the_x0020_Protein_x0020_Folding_x0020_Problem/cm:contains</ns3:path>
</source>
<destination>
<ns4:store xmlns:ns4="http://www.alfresco.org/ws/model/content/1.0">
<ns4:scheme>workspace</ns4:scheme>
<ns4:address>SpacesStore</ns4:address>
</ns4:store>
<ns5:uuid xmlns:ns5="http://www.alfresco.org/ws/model/content/1.0">3212f8a8-6d10-4049-a6cc-d89dd2df1191</ns5:uuid>
<ns6:path xmlns:ns6="http://www.alfresco.org/ws/model/content/1.0">/app:company_home/cm:Waffle_x0020_Bus_x0020_Workflows/cm:What_x0020_is_x0020_the_x0020_Protein_x0020_Folding_x0020_Problem/cm:contains/cm:contains</ns6:path>
</destination>
</updateReturn>
</updateResponse>
</soapenv:Body>
</soapenv:Envelope>