Author: chathura
Date: Thu Jan 31 21:30:27 2008
New Revision: 13208

Log:


Fixed minor bugs.
Redirected to root after sign in and sign out.
Added support for capturing resource restore action in activity logs.



Modified:
   
trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/ControllerServlet.java
   
trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/actions/RecentActivityAction.java
   
trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/utils/UserUtil.java
   trunk/registry/modules/webapps/src/main/webapp/admin/js/common.js

Modified: 
trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/ControllerServlet.java
==============================================================================
--- 
trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/ControllerServlet.java
   (original)
+++ 
trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/ControllerServlet.java
   Thu Jan 31 21:30:27 2008
@@ -122,7 +122,9 @@
                     e.printStackTrace();
                 }
 
-                response.sendRedirect("/wso2registry/web" + path);
+                request.getSession().setAttribute(
+                        UIConstants.PATH_ATTR, RegistryConstants.ROOT_PATH);
+                response.sendRedirect("/wso2registry/web");
                 //forwardToResources(request, response, path);
 
             } else if (command.equals("/addUser")) {
@@ -358,7 +360,7 @@
             setErrorMessage(request, e.getMessage());
         }
 
-        response.sendRedirect("/wso2registry/web" + path);
+        response.sendRedirect("/wso2registry/web" + getParentPath(path));
     }
 
     protected void doGet(HttpServletRequest request,
@@ -502,7 +504,7 @@
                     e.printStackTrace();
                 }
 
-                response.sendRedirect("/wso2registry/web" + path);
+                response.sendRedirect("/wso2registry/web");
                 //forwardToResources(request, response, path);
 
             } else if (command.equals("/activity")) {

Modified: 
trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/actions/RecentActivityAction.java
==============================================================================
--- 
trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/actions/RecentActivityAction.java
        (original)
+++ 
trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/actions/RecentActivityAction.java
        Thu Jan 31 21:30:27 2008
@@ -73,6 +73,8 @@
         } else if (filter.equals("ratings")) {
             filterValue = LogEntry.RATING;
 
+        } else if (filter.equals("restore")) {
+            filterValue = LogEntry.RESTORE;
         }
 
         SecureRegistry secureRegistry = (SecureRegistry) getRegistry();
@@ -102,6 +104,9 @@
                 String entry = "<a href='/wso2registry/system/people/" + 
logEntry.getUserName() + "'>" + logEntry.getUserName() + "</a>" + " has rated 
the resource '" + "<a href='/wso2registry/web" + logEntry.getResourcePath() + 
"'>" + logEntry.getResourcePath() + "</a> with rating " + 
logEntry.getActionData() + " on " + CommonUtil.formatDate(logEntry.getDate()) + 
".";
                 activity.add(entry);
 
+            } else if (logEntry.getAction() == LogEntry.RESTORE) {
+                String entry = "<a href='/wso2registry/system/people/" + 
logEntry.getUserName() + "'>" + logEntry.getUserName() + "</a>" + " has 
restored the resource '" + "<a href='/wso2registry/web" + 
logEntry.getResourcePath() + "'>" + logEntry.getResourcePath() + "</a> to the 
version " + logEntry.getActionData() + " on " + 
CommonUtil.formatDate(logEntry.getDate()) + ".";
+                activity.add(entry);
             }
         }
 

Modified: 
trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/utils/UserUtil.java
==============================================================================
--- 
trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/utils/UserUtil.java
      (original)
+++ 
trunk/registry/modules/webapps/src/main/java/org/wso2/registry/web/utils/UserUtil.java
      Thu Jan 31 21:30:27 2008
@@ -67,6 +67,9 @@
                         new SecureRegistry(userName, password, jdbcRegistry, 
realm);
                 
request.getSession().setAttribute(ConsoleConstants.USER_REGISTRY, 
secureRegistry);
 
+                request.getSession().
+                        setAttribute(UIConstants.PATH_ATTR, 
RegistryConstants.ROOT_PATH);
+
                 writer.write("SUCCESS: User authenticated.");
                 writer.flush();
                 return;

Modified: trunk/registry/modules/webapps/src/main/webapp/admin/js/common.js
==============================================================================
--- trunk/registry/modules/webapps/src/main/webapp/admin/js/common.js   
(original)
+++ trunk/registry/modules/webapps/src/main/webapp/admin/js/common.js   Thu Jan 
31 21:30:27 2008
@@ -302,7 +302,7 @@
             } else {
                 prepareLoginBox();
                 loginProgress();
-                window.location.reload(false);
+                window.location = "/wso2registry/web";
             }
         },
         onFailure: function(){}

_______________________________________________
Registry-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/registry-dev

Reply via email to