svn commit: r741855 - in /ofbiz/trunk: build.xml framework/resources/templates/AdminUserLoginData.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r741855 - in /ofbiz/trunk: build.xml framework/resources/templates/AdminUserLoginData.xml

jacopoc
Author: jacopoc
Date: Sat Feb  7 08:43:39 2009
New Revision: 741855

URL: http://svn.apache.org/viewvc?rev=741855&view=rev
Log:
Improved create-admin-user-login target.

Added:
    ofbiz/trunk/framework/resources/templates/AdminUserLoginData.xml   (with props)
Modified:
    ofbiz/trunk/build.xml

Modified: ofbiz/trunk/build.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/build.xml?rev=741855&r1=741854&r2=741855&view=diff
==============================================================================
--- ofbiz/trunk/build.xml (original)
+++ ofbiz/trunk/build.xml Sat Feb  7 08:43:39 2009
@@ -135,7 +135,7 @@
         <echo message="" file="runtime/svninfo.ftl"/>
         <echo message="Done!"/>
     </target>
-
+    
     <!-- ================================================================== -->
     <!-- Build Components                                                   -->
     <!-- ================================================================== -->
@@ -343,26 +343,27 @@
             <arg value="file=${data-file}"/>
         </java>
     </target>
-    <target name="create-admin-user-login"
-        description="Prompts for a user name, then creates a user login with admin privileges and a temporary password equal to 'ofbiz'; after a succesful login the user will be prompted for a new password.">
-        <condition property="userLoginId.notSet">
-            <not><isset property="userLoginId"/></not>
-        </condition>
-        <antcall target="prompt-user-login-name"/>
-        <echoxml file="runtime/tmp/tmpUserLogin.xml">
-            <entity-engine-xml>
-                <UserLogin userLoginId="${userLoginId}" currentPassword="{SHA}47ca69ebb4bdc9ae0adec130880165d2cc05db1a" requirePasswordChange="Y"/>
-                <UserLoginSecurityGroup groupId="FULLADMIN" userLoginId="${userLoginId}" fromDate="2001-01-01 12:00:00.0"/>
-            </entity-engine-xml>
-        </echoxml>
+    <target name="load-admin-user-login"
+        description="Creates a user login with admin privileges and a temporary password equal to 'ofbiz'; after a succesful login the user will be prompted for a new password.">
+        <fail message="userLoginId parameter is required to create a new admin user.">
+            <condition>
+                <not><isset property="userLoginId"/></not>
+            </condition>
+        </fail>
+        <copy file="${basedir}/framework/resources/templates/AdminUserLoginData.xml" tofile="runtime/tmp/tmpUserLogin.xml">
+            <filterset>
+                <filter token="userLoginId" value="${userLoginId}"/>
+            </filterset>
+        </copy>
         <antcall target="run-install-file">
             <param name="data-file" value="runtime/tmp/tmpUserLogin.xml"/>
         </antcall>
         <delete file="runtime/tmp/tmpUserLogin.xml"/>
     </target>
-    <target name="prompt-user-login-name" if="userLoginId.notSet"
-        description="Prompts for a user name.">
+    <target name="create-admin-user-login"
+        description="Prompts for a user name, then creates a user login with admin privileges and a temporary password equal to 'ofbiz'; after a succesful login the user will be prompted for a new password.">
         <input addproperty="userLoginId" message="Enter user name (log in with the temporary password 'ofbiz'):"/>
+        <antcall target="load-admin-user-login"/>
     </target>
 
     <target name="run-debug" depends="build">

Added: ofbiz/trunk/framework/resources/templates/AdminUserLoginData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/resources/templates/AdminUserLoginData.xml?rev=741855&view=auto
==============================================================================
--- ofbiz/trunk/framework/resources/templates/AdminUserLoginData.xml (added)
+++ ofbiz/trunk/framework/resources/templates/AdminUserLoginData.xml Sat Feb  7 08:43:39 2009
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<entity-engine-xml>
+    <UserLogin userLoginId="@userLoginId@" currentPassword="{SHA}47ca69ebb4bdc9ae0adec130880165d2cc05db1a" requirePasswordChange="Y"/>
+    <UserLoginSecurityGroup groupId="FULLADMIN" userLoginId="@userLoginId@" fromDate="2001-01-01 12:00:00.0"/>
+</entity-engine-xml>

Propchange: ofbiz/trunk/framework/resources/templates/AdminUserLoginData.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/resources/templates/AdminUserLoginData.xml
------------------------------------------------------------------------------
    svn:keywords = Date Rev Author URL Id

Propchange: ofbiz/trunk/framework/resources/templates/AdminUserLoginData.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml