Author: deepal
Date: Thu Feb  7 01:42:53 2008
New Revision: 13393

Log:

supporting "/tags" and "/comments"
fixing REGISTRY-115


Modified:
   
trunk/registry/modules/core/src/main/java/org/wso2/registry/app/AtomRegistry.java
   
trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/dao/VersionedResourceDAO.java

Modified: 
trunk/registry/modules/core/src/main/java/org/wso2/registry/app/AtomRegistry.java
==============================================================================
--- 
trunk/registry/modules/core/src/main/java/org/wso2/registry/app/AtomRegistry.java
   (original)
+++ 
trunk/registry/modules/core/src/main/java/org/wso2/registry/app/AtomRegistry.java
   Thu Feb  7 01:42:53 2008
@@ -53,6 +53,7 @@
 public class AtomRegistry extends AbstractProvider implements Provider, 
APPConstants {
 
     private Log log = LogFactory.getLog(AtomRegistry.class);
+    public static final String SECURE_REGISTRY = "secureRegistry";
 
     private Registry jdbcregistry;
     private RegistryRealm realm;
@@ -315,6 +316,11 @@
         Abdera abdera = request.getAbdera();
         String baseURI = request.getBaseUri().toString();
         String entry_id = getRealPath(request);
+        if ("/tags".equals(entry_id)) {
+            entry_id = "/;tags";
+        } else if ("/comments".equals(entry_id)){
+            entry_id = "/;comments";
+        }
         int idx = entry_id.indexOf(RegistryConstants.URL_SEPARATOR);
         String resourcePath = entry_id.substring(0, (idx == -1) ? 
entry_id.length() : idx);
 

Modified: 
trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/dao/VersionedResourceDAO.java
==============================================================================
--- 
trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/dao/VersionedResourceDAO.java
      (original)
+++ 
trunk/registry/modules/core/src/main/java/org/wso2/registry/jdbc/dao/VersionedResourceDAO.java
      Thu Feb  7 01:42:53 2008
@@ -735,7 +735,11 @@
         byte[] bytes = convertToBytes(content);
         statement.setBytes(3, bytes);
 
-        statement.setString(4, resource.getLastUpdaterUserName());
+        String userName = resource.getLastUpdaterUserName();
+        if(userName == null){
+            userName = User.getCurrentUser();
+        }
+        statement.setString(4, userName);
         statement.setTimestamp(5, new Timestamp(System.currentTimeMillis()));
         statement.executeUpdate();
 
@@ -1012,6 +1016,9 @@
 
         Resource resource = new Resource();
         resource.setId(resourceID);
+        if(lastUpdaterUserName == null){
+             lastUpdaterUserName = User.getCurrentUser();
+        }
         resource.setLastUpdaterUserName(lastUpdaterUserName);
         resource.setLastModified(new Date(lastModifiedTime));
         insertToVersionTable(resource, connection);

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

Reply via email to