portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r350079 - in /portals/jetspeed-2/trunk: components/page-manager/src/java/org/apache/jetspeed/page/ components/portal/src/java/org/apache/jetspeed/administration/ src/webapp/WEB-INF/assembly/
Date Wed, 30 Nov 2005 23:37:13 GMT
Author: taylor
Date: Wed Nov 30 15:37:08 2005
New Revision: 350079

URL: http://svn.apache.org/viewcvs?rev=350079&view=rev
Log:
- fix bug in deep folder copy
- add transactions to register user
- fix bugs and cleanup in register user

Modified:
    portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/AbstractPageManager.java
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/administration/PortalAdministrationImpl.java
    portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/administration.xml

Modified: portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/AbstractPageManager.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/AbstractPageManager.java?rev=350079&r1=350078&r2=350079&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/AbstractPageManager.java
(original)
+++ portals/jetspeed-2/trunk/components/page-manager/src/java/org/apache/jetspeed/page/AbstractPageManager.java
Wed Nov 30 15:37:08 2005
@@ -851,7 +851,8 @@
         while (pages.hasNext())
         {
             Page srcPage = (Page)pages.next();
-            Page dstPage = this.copyPage(srcPage, srcPage.getPath());
+            String path = this.concatenatePaths(destinationPath, srcPage.getName());
+            Page dstPage = this.copyPage(srcPage, path);
             this.updatePage(dstPage);
         }
      

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/administration/PortalAdministrationImpl.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/administration/PortalAdministrationImpl.java?rev=350079&r1=350078&r2=350079&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/administration/PortalAdministrationImpl.java
(original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/administration/PortalAdministrationImpl.java
Wed Nov 30 15:37:08 2005
@@ -113,6 +113,7 @@
         this.groupManager = groupManager;
         this.pageManager = pageManager;
         this.preferences = preferences;
+        this.profiler = profiler;
         this.mailSender = mailSender;
         this.velocityEngine = velocityEngine;
         this.adminUtil = new AdminUtil();
@@ -143,9 +144,6 @@
             config.getString(PortalConfigurationConstants.PSML_TEMPLATE_FOLDER);
         this.adminUser = config.getString(PortalConfigurationConstants.USERS_DEFAULT_ADMIN);
         
-        System.out.println("admin user = " + adminUser);
-        System.out.println("roles = " + defaultRoles);
-        System.out.println("folder template = " + folderTemplate);
     }
     
     public void registerUser(String userName, String password)
@@ -174,7 +172,7 @@
             User user = userManager.getUser(userName);
                         
             // assign roles to user
-            if (roles == null)
+            if (roles == null || roles.isEmpty())
             {
                 roles = this.defaultRoles;
             }
@@ -184,16 +182,13 @@
                 while (roleList.hasNext())
                 {
                     String role = (String)roleList.next();
-                    if (!role.startsWith(Folder.ROLE_FOLDER))
-                    {
-                        role = Folder.ROLE_FOLDER + role;
-                    }
-                    roleManager.addRoleToUser(userName, role);
+                    if (role.trim().length() > 0)
+                        roleManager.addRoleToUser(userName, role);
                 }
             }
             
             // assign groups to user
-            if (groups == null)
+            if (groups == null || groups.isEmpty())
             {
                 groups = this.defaultGroups;
             }
@@ -203,11 +198,10 @@
                 while (groupsList.hasNext())
                 {
                     String group = (String)groupsList.next();
-                    if (!group.startsWith(Folder.GROUP_FOLDER))
+                    if (group.trim().length() > 0)
                     {
-                        group = Folder.GROUP_FOLDER + group;
-                    }                    
-                    groupManager.addUserToGroup(userName, group);
+                        groupManager.addUserToGroup(userName, group);
+                    }
                 }
             }
             
@@ -223,7 +217,7 @@
             }
             
             // assign profiling rules to user
-            if (rules == null)
+            if (rules == null || rules.isEmpty())
             {
                 rules = this.defaultRules;
             }
@@ -232,7 +226,7 @@
                 Iterator ruleEntries = rules.entrySet().iterator();
                 while (ruleEntries.hasNext())
                 {           
-                    Map.Entry entry = (Map.Entry)ruleEntries.next();
+                    Map.Entry entry = (Map.Entry)ruleEntries.next();                    
                     ProfilingRule rule = profiler.getRule((String)entry.getKey());
                     if (rule != null)
                     {
@@ -288,7 +282,10 @@
                 // rollback user creation and cascade roles, groups, etc
                 try
                 {
-                    userManager.removeUser(userName);
+                    if (userManager.getUser(userName) != null)
+                    {
+                        userManager.removeUser(userName);
+                    }
                 }
                 catch (Exception e)
                 {

Modified: portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/administration.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/administration.xml?rev=350079&r1=350078&r2=350079&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/administration.xml (original)
+++ portals/jetspeed-2/trunk/src/webapp/WEB-INF/assembly/administration.xml Wed Nov 30 15:37:08
2005
@@ -26,7 +26,7 @@
     <property name="resourceLoaderPath"><value>/WEB-INF/templates/</value></property>
 </bean>
   
-<bean id='PortalAdministration' init-method="start"
+<bean id='PortalAdministrationImpl' init-method="start"
       class='org.apache.jetspeed.administration.PortalAdministrationImpl'>
     	<constructor-arg index='0'>
     		<ref bean="org.apache.jetspeed.security.UserManager"/>
@@ -52,6 +52,21 @@
         <constructor-arg index='7'>
     		<ref bean="adminVelocityEngine"/>
     	</constructor-arg>                                                           

+</bean>
+    
+<bean id="PortalAdministration" name="PortalAdministration" parent="baseTransactionProxy">
+        <property name="proxyInterfaces">
+            <value>org.apache.jetspeed.administration.PortalAdministration</value>
+        </property>
+
+        <property name="target">
+            <ref bean="PortalAdministrationImpl" />
+        </property>
+        <property name="transactionAttributes">
+            <props>
+                <prop key="register*">PROPAGATION_REQUIRED,-org.apache.jetspeed.administration.RegistrationException</prop>
+            </props>
+        </property>
 </bean>
     
 </beans>



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message