From: <pka...@us...> - 2009-07-07 10:18:41
|
Revision: 313 http://cse-ip.svn.sourceforge.net/cse-ip/?rev=313&view=rev Author: pkasprzak Date: 2009-07-07 09:59:17 +0000 (Tue, 07 Jul 2009) Log Message: ----------- * Added more (all?) attributes required for addUser() * Made it robust when some account attributes are missing Modified Paths: -------------- trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/AddAccount.bpel Modified: trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/AddAccount.bpel =================================================================== --- trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/AddAccount.bpel 2009-07-03 14:33:22 UTC (rev 312) +++ trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/AddAccount.bpel 2009-07-07 09:59:17 UTC (rev 313) @@ -29,6 +29,12 @@ <variable name="AddUserOut" xmlns:tns="urn:ilUserAdministration" messageType="tns:addUserResponse"/> <variable name="AddUserIn" xmlns:tns="urn:ilUserAdministration" messageType="tns:addUserRequest"/> <variable name="AddAccountIn" xmlns:tns="http://cse.campussource.de/wsdl/ILIASClientAdapter/AddAccount" messageType="tns:AddAccountRequest"/> + + <!-- Constructed later on --> + <variable name="Login" type="xsd:string"/> + <variable name="Password" type="xsd:string"/> + <variable name="EMail" type="xsd:string"/> + </variables> <scope name="AddAccountScope"> @@ -48,7 +54,122 @@ </copy> </assign> - <assign name="setAccountData"> + <!-- Construct login --> + <if> + <condition>$AddAccountIn.account/dt:attribute[dt:name = 'login']/dt:value/text()</condition> + <!-- Login is set in attributes --> + <assign> + <copy> + <from>$AddAccountIn.account/dt:attribute[dt:name = 'login']/dt:value</from> + <to>$Login</to> + </copy> + </assign> + <elseif> + <condition>$AddAccountIn.account/dt:attribute[dt:name = 'firstName']/dt:value/text() and $AddAccountIn.account/dt:attribute[dt:name = 'surname']/dt:value/text()</condition> + <!-- Construct login from firstname + surname --> + <assign> + <copy> + <from>concat($AddAccountIn.account/dt:attribute[dt:name = 'firstName']/dt:value/text(), '.', $AddAccountIn.account/dt:attribute[dt:name = 'surname']/dt:value/text())</from> + <to>$Login</to> + </copy> + </assign> + </elseif> + <else> + <!-- Use attribute of last resort: lsfId --> + <assign> + <copy> + <from>concat('user_', $AddAccountIn.account/dt:attribute[dt:name = 'lsfId']/dt:value)</from> + <to>$Login</to> + </copy> + </assign> + </else> + </if> + + <!-- Construct Password --> + <if> + <condition>$AddAccountIn.account/dt:attribute[dt:name = 'password']/dt:value/text()</condition> + <!-- Password is set in attributes --> + <assign> + <copy> + <from>$AddAccountIn.account/dt:attribute[dt:name = 'password']/dt:value</from> + <to>$Password</to> + </copy> + </assign> + <else> + <!-- Set default password --> + <assign> + <copy> + <from>'test'</from> + <to>$Password</to> + </copy> + </assign> + </else> + </if> + + <!-- Construct EMail --> + <if> + <condition>$AddAccountIn.account/dt:attribute[dt:name = 'emailAddress']/dt:value/text()</condition> + <!-- EMail is set in attributes --> + <assign> + <copy> + <from>$AddAccountIn.account/dt:attribute[dt:name = 'emailAddress']/dt:value/text()</from> + <to>$EMail</to> + </copy> + </assign> + <elseif> + <condition>$AddAccountIn.account/dt:attribute[dt:name = 'firstName']/dt:value/text() and $AddAccountIn.account/dt:attribute[dt:name = 'surname']/dt:value/text()</condition> + <!-- Construct EMail from firstname + surname + dummy-address --> + <assign> + <copy> + <from>concat($AddAccountIn.account/dt:attribute[dt:name = 'firstName']/dt:value/text(), '.', $AddAccountIn.account/dt:attribute[dt:name = 'surname']/dt:value/text(), '@dummy.com')</from> + <to>$EMail</to> + </copy> + </assign> + </elseif> + <else> + <!-- Use attribute of last resort: lsfId --> + <assign> + <copy> + <from>concat('user_', $AddAccountIn.account/dt:attribute[dt:name = 'lsfId']/dt:value, '@dummy.com')</from> + <to>$EMail</to> + </copy> + </assign> + </else> + </if> + + <assign name="setRequiredAccountData"> + <copy> + <from>$Login</from> + <to>$AddUserIn.user_data/login</to> + </copy> + <copy> + <from>$Password</from> + <to>$AddUserIn.user_data/passwd</to> + </copy> + <copy> + <from>$EMail</from> + <to>$AddUserIn.user_data/email</to> + </copy> + <!-- Set timelimit + technical stuff --> + <copy> + <from>7</from> + <to>$AddUserIn.user_data/time_limit_owner</to> + </copy> + <copy> + <from>1</from> + <to>$AddUserIn.user_data/time_limit_unlimited</to> + </copy> + <copy> + <from>1</from> + <to>$AddUserIn.user_data/active</to> + </copy> + <copy> + <from>'en'</from> + <to>$AddUserIn.user_data/user_language</to> + </copy> + </assign> + + <assign name="setOptionalAccountData"> <copy ignoreMissingFromData="yes"> <from>$AddAccountIn.account/dt:attribute[dt:name = 'firstName']/dt:value</from> <to>$AddUserIn.user_data/firstname</to> @@ -71,11 +192,12 @@ <!-- Set SID --> <copy> <from>$AddAccountIn.SID</from> - <to variable="AddUserIn" part="sid"/> + <to>$AddUserIn.sid</to> </copy> + <!-- Set global role --> <copy> - <from>'test'</from> - <to>$AddUserIn.user_data/login</to> + <from>4</from> + <to>$AddUserIn.global_role_id</to> </copy> </assign> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pka...@us...> - 2009-07-07 14:48:34
|
Revision: 319 http://cse-ip.svn.sourceforge.net/cse-ip/?rev=319&view=rev Author: pkasprzak Date: 2009-07-07 14:15:22 +0000 (Tue, 07 Jul 2009) Log Message: ----------- * Fix password length + node conversion error Modified Paths: -------------- trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/AddAccount.bpel Modified: trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/AddAccount.bpel =================================================================== --- trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/AddAccount.bpel 2009-07-07 14:12:30 UTC (rev 318) +++ trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/AddAccount.bpel 2009-07-07 14:15:22 UTC (rev 319) @@ -7,8 +7,10 @@ xmlns:sxed="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/Editor" xmlns:sxat="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/Attachment" xmlns:sxeh="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/ErrorHandling" + xmlns:sxxf="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/XPathFunctions" xmlns:tns="http://cse.campussource.de/bpel/ILIASClientAdapter/AddAccount" xmlns:ns0="http://cse.campussource.de/wsdl/ILIASClientAdapter/AddAccount" + xmlns:ex="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:dt="http://cse.campussource.de/schema/DataTypes" xmlns:sxed2="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/Editor2"> @@ -99,7 +101,8 @@ <!-- Set default password --> <assign> <copy> - <from>'test'</from> + <!-- Needs to be longer than 4 characters --> + <from>'test12'</from> <to>$Password</to> </copy> </assign> @@ -139,15 +142,15 @@ <assign name="setRequiredAccountData"> <copy> - <from>$Login</from> + <from>string($Login)</from> <to>$AddUserIn.user_data/login</to> </copy> <copy> - <from>$Password</from> + <from>string($Password)</from> <to>$AddUserIn.user_data/passwd</to> </copy> <copy> - <from>$EMail</from> + <from>string($EMail)</from> <to>$AddUserIn.user_data/email</to> </copy> <!-- Set timelimit + technical stuff --> @@ -189,6 +192,12 @@ </assign> <assign name="prepareAddAccount"> + <sxt:trace> + <sxt:log level="info" location="onComplete"> + <ex:from>concat('*** addUser-xml: ', sxxf:doMarshal($AddUserIn.user_data))</ex:from> + </sxt:log> + </sxt:trace> + <!-- Set SID --> <copy> <from>$AddAccountIn.SID</from> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pka...@us...> - 2009-07-08 10:41:30
|
Revision: 323 http://cse-ip.svn.sourceforge.net/cse-ip/?rev=323&view=rev Author: pkasprzak Date: 2009-07-08 10:41:29 +0000 (Wed, 08 Jul 2009) Log Message: ----------- * Fix "password too short" problem when adding users Modified Paths: -------------- trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/AddAccount.bpel Modified: trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/AddAccount.bpel =================================================================== --- trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/AddAccount.bpel 2009-07-07 14:25:10 UTC (rev 322) +++ trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/AddAccount.bpel 2009-07-08 10:41:29 UTC (rev 323) @@ -67,7 +67,8 @@ </copy> </assign> <elseif> - <condition>$AddAccountIn.account/dt:attribute[dt:name = 'firstName']/dt:value/text() and $AddAccountIn.account/dt:attribute[dt:name = 'surname']/dt:value/text()</condition> + <condition> $AddAccountIn.account/dt:attribute[dt:name = 'firstName']/dt:value/text() + and $AddAccountIn.account/dt:attribute[dt:name = 'surname']/dt:value/text()</condition> <!-- Construct login from firstname + surname --> <assign> <copy> @@ -89,8 +90,9 @@ <!-- Construct Password --> <if> - <condition>$AddAccountIn.account/dt:attribute[dt:name = 'password']/dt:value/text()</condition> - <!-- Password is set in attributes --> + <condition> $AddAccountIn.account/dt:attribute[dt:name = 'password']/dt:value/text() + and string-length($AddAccountIn.account/dt:attribute[dt:name = 'password']/dt:value/text()) > 5</condition> + <!-- Password is set in attributes AND long enough --> <assign> <copy> <from>$AddAccountIn.account/dt:attribute[dt:name = 'password']/dt:value</from> @@ -101,7 +103,7 @@ <!-- Set default password --> <assign> <copy> - <!-- Needs to be longer than 4 characters --> + <!-- Password needs to be 6 characters or longer --> <from>'test12'</from> <to>$Password</to> </copy> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pka...@us...> - 2009-07-08 10:44:34
|
Revision: 324 http://cse-ip.svn.sourceforge.net/cse-ip/?rev=324&view=rev Author: pkasprzak Date: 2009-07-08 10:44:27 +0000 (Wed, 08 Jul 2009) Log Message: ----------- * Prettying... Modified Paths: -------------- trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/AddAccount.bpel Modified: trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/AddAccount.bpel =================================================================== --- trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/AddAccount.bpel 2009-07-08 10:41:29 UTC (rev 323) +++ trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/AddAccount.bpel 2009-07-08 10:44:27 UTC (rev 324) @@ -57,7 +57,7 @@ </assign> <!-- Construct login --> - <if> + <if name="ConstructLogin"> <condition>$AddAccountIn.account/dt:attribute[dt:name = 'login']/dt:value/text()</condition> <!-- Login is set in attributes --> <assign> @@ -89,7 +89,7 @@ </if> <!-- Construct Password --> - <if> + <if name="ConstructPassword"> <condition> $AddAccountIn.account/dt:attribute[dt:name = 'password']/dt:value/text() and string-length($AddAccountIn.account/dt:attribute[dt:name = 'password']/dt:value/text()) > 5</condition> <!-- Password is set in attributes AND long enough --> @@ -112,7 +112,7 @@ </if> <!-- Construct EMail --> - <if> + <if name="ConstrucEMmail"> <condition>$AddAccountIn.account/dt:attribute[dt:name = 'emailAddress']/dt:value/text()</condition> <!-- EMail is set in attributes --> <assign> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |