[jboss-svn-commits] JBL Code SVN: r6034 - in labs/shotoku/trunk: . lib/portal shotoku-base shotoku-base/src/etc shotoku-base/src/java/org/jboss/shotoku shotoku-example shotoku-example/src shotoku-example/src/etc shotoku-example/src/java/org/jboss/shotoku/example shotoku-file-access/src/java/org/jboss/shotoku/fileaccess/monitors shotoku-portal/src/java/org/jboss/shotoku/portal shotoku-svn shotoku-svn/src/java/org/jboss/shotoku/svn/service shotoku-tags/src/java/org/jboss/shotoku/tags/service shotoku-user shotoku-user/src/java/org/jboss/shotoku/user shotoku-user/src/java/org/jboss/shotoku/user/service

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Aug 30 18:23:38 EDT 2006


Author: adamw
Date: 2006-08-30 18:22:57 -0400 (Wed, 30 Aug 2006)
New Revision: 6034

Added:
   labs/shotoku/trunk/lib/portal/portal-identity-lib.jar
   labs/shotoku/trunk/shotoku-example/src/etc/
   labs/shotoku/trunk/shotoku-example/src/etc/log4j.properties
   labs/shotoku/trunk/shotoku-portal/src/java/org/jboss/shotoku/portal/CompositeCommand.java
Modified:
   labs/shotoku/trunk/lib/portal/portal-cms-lib.jar
   labs/shotoku/trunk/lib/portal/portal-common-lib.jar
   labs/shotoku/trunk/lib/portal/portal-core-lib.jar
   labs/shotoku/trunk/lib/portal/portal-portlet-lib.jar
   labs/shotoku/trunk/project.properties
   labs/shotoku/trunk/shotoku-base/shotoku-base.iml
   labs/shotoku/trunk/shotoku-base/src/etc/shotoku.properties.sample
   labs/shotoku/trunk/shotoku-base/src/java/org/jboss/shotoku/ContentManager.java
   labs/shotoku/trunk/shotoku-example/shotoku-example.iml
   labs/shotoku/trunk/shotoku-example/src/java/org/jboss/shotoku/example/ExampleEmbedded.java
   labs/shotoku/trunk/shotoku-file-access/src/java/org/jboss/shotoku/fileaccess/monitors/ListingMonitor.java
   labs/shotoku/trunk/shotoku-portal/src/java/org/jboss/shotoku/portal/ContentCreateCommand.java
   labs/shotoku/trunk/shotoku-portal/src/java/org/jboss/shotoku/portal/ShotokuCMS.java
   labs/shotoku/trunk/shotoku-portal/src/java/org/jboss/shotoku/portal/ShotokuCommand.java
   labs/shotoku/trunk/shotoku-portal/src/java/org/jboss/shotoku/portal/ShotokuCommandFactory.java
   labs/shotoku/trunk/shotoku-svn/maven.xml
   labs/shotoku/trunk/shotoku-svn/project.properties
   labs/shotoku/trunk/shotoku-svn/src/java/org/jboss/shotoku/svn/service/SvnRepository.java
   labs/shotoku/trunk/shotoku-svn/src/java/org/jboss/shotoku/svn/service/SvnServiceImpl.java
   labs/shotoku/trunk/shotoku-tags/src/java/org/jboss/shotoku/tags/service/TagServiceImpl.java
   labs/shotoku/trunk/shotoku-user/project.xml
   labs/shotoku/trunk/shotoku-user/src/java/org/jboss/shotoku/user/JBossPortalGroup.java
   labs/shotoku/trunk/shotoku-user/src/java/org/jboss/shotoku/user/JBossPortalUser.java
   labs/shotoku/trunk/shotoku-user/src/java/org/jboss/shotoku/user/service/UserServiceImpl.java
Log:
http://jira.jboss.com/jira/browse/JBLAB-752

Modified: labs/shotoku/trunk/lib/portal/portal-cms-lib.jar
===================================================================
(Binary files differ)

Modified: labs/shotoku/trunk/lib/portal/portal-common-lib.jar
===================================================================
(Binary files differ)

Modified: labs/shotoku/trunk/lib/portal/portal-core-lib.jar
===================================================================
(Binary files differ)

Added: labs/shotoku/trunk/lib/portal/portal-identity-lib.jar
===================================================================
(Binary files differ)


Property changes on: labs/shotoku/trunk/lib/portal/portal-identity-lib.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: labs/shotoku/trunk/lib/portal/portal-portlet-lib.jar
===================================================================
(Binary files differ)

Modified: labs/shotoku/trunk/project.properties
===================================================================
--- labs/shotoku/trunk/project.properties	2006-08-30 19:24:20 UTC (rev 6033)
+++ labs/shotoku/trunk/project.properties	2006-08-30 22:22:57 UTC (rev 6034)
@@ -5,7 +5,7 @@
 
 shotoku.sar.dir=shotoku.sar
 shotoku.subprojects.cms=base,files,jcr,svn
-shotoku.subprojects=${shotoku.subprojects.cms},aop,test,user,web,admin,tags,feeds,file-access,portal
+shotoku.subprojects=${shotoku.subprojects.cms},aop,test,user,web,admin,tags,feeds,file-access
 
 maven.final.name=${pom.artifactId}
 
@@ -29,6 +29,7 @@
 maven.jar.portal-cms=${shotoku.root.dir}/lib/portal/portal-cms-lib.jar
 maven.jar.portal-core=${shotoku.root.dir}/lib/portal/portal-core-lib.jar
 maven.jar.portal-common=${shotoku.root.dir}/lib/portal/portal-common-lib.jar
+maven.jar.portal-identity=${shotoku.root.dir}/lib/portal/portal-identity-lib.jar
 
 maven.jar.shotoku-base=${shotoku.root.dir}/shotoku-base/target/shotoku-base.jar
 maven.jar.shotoku-svn=${shotoku.root.dir}/shotoku-svn/target/shotoku-svn.jar

Modified: labs/shotoku/trunk/shotoku-base/shotoku-base.iml
===================================================================
--- labs/shotoku/trunk/shotoku-base/shotoku-base.iml	2006-08-30 19:24:20 UTC (rev 6033)
+++ labs/shotoku/trunk/shotoku-base/shotoku-base.iml	2006-08-30 22:22:57 UTC (rev 6034)
@@ -5,6 +5,7 @@
     <output url="file://$MODULE_DIR$/target" />
     <exclude-output />
     <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src/etc" isTestSource="false" />
       <sourceFolder url="file://$MODULE_DIR$/src/java" isTestSource="false" />
     </content>
     <orderEntry type="inheritedJdk" />

Modified: labs/shotoku/trunk/shotoku-base/src/etc/shotoku.properties.sample
===================================================================
--- labs/shotoku/trunk/shotoku-base/src/etc/shotoku.properties.sample	2006-08-30 19:24:20 UTC (rev 6033)
+++ labs/shotoku/trunk/shotoku-base/src/etc/shotoku.properties.sample	2006-08-30 22:22:57 UTC (rev 6034)
@@ -1,9 +1,15 @@
-# Content manager configuration
+#
+# Content managers configuration
+# ------------------------------
+#
 
+# Default content manager id
 shotoku.id.default = default
 
+# All ids that will be available for use
 shotoku.ids = default
 
+# Definitions of content managers
 shotoku.default.implementation = org.jboss.shotoku.svn.SvnContentManager
 shotoku.default.url = 
 shotoku.default.username = 
@@ -23,33 +29,65 @@
 # shotoku.jcr.password =
 # shotoku.jcr.localpath =
 
+#
+# General configuration
+# ---------------------
+#
+
 # Embedded/ application server mode
-
 shotoku.embedded = false
 
+# Size of a byte array that is allocated when transferring files to/from
+# the client
+shotoku.transfer.buffer.size = 1024
+
+# Interval between service (and cache) updates, in milliseconds
+shotoku.service.interval = 10000
+
+#
 # Feeds configuration
+# -------------------
+#
+
 # Content manager and directory in which feeds.properties is placed in shotoku
 shotoku.internal.feeds.configcmid =
 shotoku.internal.feeds.configdir =
+
+# Interval between feed updates, in milliseconds
 shotoku.internal.feeds.service.interval = 10000
 
+#
 # Tags configuration
+# ------------------
+#
+
+# Should synchronization of tags be done
+shotoku.internal.tags.synchronization = 1
+
 # Content manager and base directory with which synchronization of Shotoku tags
 # will be done
-shotoku.internal.tags.synchronization = 1
 shotoku.internal.tags.cmid =
 shotoku.internal.tags.cmdir =
+
+# Interval between tag synchronization updates, in milliseconds
 shotoku.internal.tags.service.interval = 10000
 
-# Internal properties (best leave intact)
+#
+# Tests configuration
+# -------------------
+#
 
-shotoku.transfer.buffer.size = 1024
-shotoku.service.interval = 10000
-
-shotoku.internal.svn.service.interval = 5000
+# Content manager and base directory in which tests will be done
 shotoku.internal.tests.id = default
 shotoku.internal.tests.dir = shotoku-test
 
+#
+# SVN content manager service configuration
+# -----------------------------------------
+
+# Interval between working copy updates, in milliseconds
+shotoku.internal.svn.service.interval = 5000
+
 # A debugging property which, when set to 0, will cause repositories not to be
 # updated for the first time when being registered.
 shotoku.internal.svn.service.firstupdate = 1
\ No newline at end of file

Modified: labs/shotoku/trunk/shotoku-base/src/java/org/jboss/shotoku/ContentManager.java
===================================================================
--- labs/shotoku/trunk/shotoku-base/src/java/org/jboss/shotoku/ContentManager.java	2006-08-30 19:24:20 UTC (rev 6033)
+++ labs/shotoku/trunk/shotoku-base/src/java/org/jboss/shotoku/ContentManager.java	2006-08-30 22:22:57 UTC (rev 6034)
@@ -504,11 +504,6 @@
                     "Error while loading content manager configuration: ", e);
         }
 
-        // Setuping the logger.
-        if (isEmbedded()) {
-            BasicConfigurator.configure();
-        }
-
         log = Logger.getLogger(ContentManager.class);
     }
 
@@ -528,15 +523,16 @@
      */
     public static void setup() {
         synchronized (ContentManager.class) {
-            if (setupDone)
+            if (setupDone) {
                 return;
+            }
 
             // Preventing setup to be executed twice.
             setupDone = true;
         }
 
-        engines = Collections
-                .synchronizedMap(new HashMap<String, VelocityEngine>());
+        engines = Collections.synchronizedMap(
+                new HashMap<String, VelocityEngine>());
 
         contentManagers = new HashMap<String, Constructor>();
         initializedContentManagers = new HashSet<String>();
@@ -712,10 +708,10 @@
             return null;
         }
 
-        Constructor constr = contentManagers.get(cmData.getFirst());
-
         initializeId(id);
 
+        Constructor constr = contentManagers.get(cmData.getFirst());
+
         try {
             return (ContentManager) constr.newInstance(id, prefix,
                     cmData.getSecond());

Modified: labs/shotoku/trunk/shotoku-example/shotoku-example.iml
===================================================================
--- labs/shotoku/trunk/shotoku-example/shotoku-example.iml	2006-08-30 19:24:20 UTC (rev 6033)
+++ labs/shotoku/trunk/shotoku-example/shotoku-example.iml	2006-08-30 22:22:57 UTC (rev 6034)
@@ -11,25 +11,9 @@
     <orderEntry type="sourceFolder" forTests="false" />
     <orderEntry type="module" module-name="shotoku-base" />
     <orderEntry type="library" name="jboss" level="application" />
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar://$MODULE_DIR$/../shotoku-base/target/shotoku-base.jar!/" />
-        </CLASSES>
-        <JAVADOC />
-        <SOURCES />
-      </library>
-    </orderEntry>
     <orderEntry type="module" module-name="shotoku-svn" />
-    <orderEntry type="module-library">
-      <library>
-        <CLASSES>
-          <root url="jar://$MODULE_DIR$/../shotoku-svn/target/shotoku-svn.jar!/" />
-        </CLASSES>
-        <JAVADOC />
-        <SOURCES />
-      </library>
-    </orderEntry>
+    <orderEntry type="library" name="etc" level="project" />
+    <orderEntry type="library" name="example-etc" level="project" />
     <orderEntryProperties />
   </component>
 </module>

Added: labs/shotoku/trunk/shotoku-example/src/etc/log4j.properties
===================================================================
--- labs/shotoku/trunk/shotoku-example/src/etc/log4j.properties	2006-08-30 19:24:20 UTC (rev 6033)
+++ labs/shotoku/trunk/shotoku-example/src/etc/log4j.properties	2006-08-30 22:22:57 UTC (rev 6034)
@@ -0,0 +1,9 @@
+# Set root logger level to DEBUG and its only appender to A1.
+log4j.rootLogger=INFO, A1
+
+# A1 is set to be a ConsoleAppender.
+log4j.appender.A1=org.apache.log4j.ConsoleAppender
+
+# A1 uses PatternLayout.
+log4j.appender.A1.layout=org.apache.log4j.PatternLayout
+log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
\ No newline at end of file

Modified: labs/shotoku/trunk/shotoku-example/src/java/org/jboss/shotoku/example/ExampleEmbedded.java
===================================================================
--- labs/shotoku/trunk/shotoku-example/src/java/org/jboss/shotoku/example/ExampleEmbedded.java	2006-08-30 19:24:20 UTC (rev 6033)
+++ labs/shotoku/trunk/shotoku-example/src/java/org/jboss/shotoku/example/ExampleEmbedded.java	2006-08-30 22:22:57 UTC (rev 6034)
@@ -49,9 +49,6 @@
             System.out.println("Content manager changed to (" + id +
                     ", " + prefix + ").");
         }
-
-        System.out.println("---");
-        System.out.println();
     }
 
     /**
@@ -65,10 +62,8 @@
         NodeList nl = cm.getDirectory(path).getNodes();
         System.out.println("Nodes in directory: " + path);
         for (Node n : nl) {
-            System.out.println("- " + n.getName());
+            System.out.println("  " + n.getName());
         }
-        System.out.println("---");
-        System.out.println();
     }
 
     /**
@@ -82,10 +77,8 @@
         List<Directory> dirs = cm.getDirectory(path).getDirectories();
         System.out.println("Directories in directory: " + path);
         for (Directory d : dirs) {
-            System.out.println("- " + d.getName());
+            System.out.println("  " + d.getName());
         }
-        System.out.println("---");
-        System.out.println();
     }
 
     public void listProperties(String path) throws ResourceDoesNotExist {
@@ -99,10 +92,8 @@
         System.out.println("Properties on path: " + path);
         Map<String, String> props = res.getProperties();
         for (String propName : props.keySet()) {
-            System.out.println("-  " + propName + " = " + props.get(propName));
+            System.out.println("   " + propName + " = " + props.get(propName));
         }
-        System.out.println("---");
-        System.out.println();
     }
 
     public void setNodeContent(String path, String content)
@@ -118,8 +109,8 @@
         openNodes.add(n);
 
         System.out.println("Content of node " + path + " changed.");
-        System.out.println("---");
-        System.out.println();
+        System.out.println("No modifications will be done on the repository" +
+                " until the modified resources are saved.");
     }
 
     public void setNodeProprety(String path, String name, String value)
@@ -138,8 +129,6 @@
                 " changed.");
         System.out.println("No modifications will be done on the repository" +
                 " until the modified resources are saved.");
-        System.out.println("---");
-        System.out.println();
     }
 
     public void newDirectory(String path)
@@ -149,8 +138,6 @@
         System.out.println("Directory " + path + " created.");
         System.out.println("No modifications will be done on the repository" +
                 " until the modified resources are saved.");
-        System.out.println("---");
-        System.out.println();
     }
 
     public void saveAll(String logMessage) throws SaveException {
@@ -163,32 +150,25 @@
         openNodes.clear();
 
         System.out.println("All modified resource saved.");
-        System.out.println("---");
-        System.out.println();
     }
 
     public void discardAll() {
         openDirectories.clear();
         openNodes.clear();
         System.out.println("All changes to resources discarded.");
-        System.out.println("---");
-        System.out.println();
     }
 
     public void listModifiedResources() {
         System.out.println("Modified nodes:");
         for (Node n : openNodes) {
-            System.out.println("- " + n.getName());
+            System.out.println("  " + n.getName());
         }
         System.out.println();
 
         System.out.println("Modified directories:");
         for (Directory d : openDirectories) {
-            System.out.println("- " + d.getName());
+            System.out.println("  " + d.getName());
         }
-
-        System.out.println("---");
-        System.out.println();
     }
 
     /*
@@ -214,8 +194,8 @@
             System.out.println("2. List nodes in a directory");
             System.out.println("3. List directories in a directory");
             System.out.println("4. List resource properties");
-            System.out.println("5. Change node content");
-            System.out.println("6. Change node property");
+            System.out.println("5. Change node content (possible create a new node)");
+            System.out.println("6. Change node property (possible create a new node)");
             System.out.println("7. Create new directory");
             System.out.println("8. Save all modified resources");
             System.out.println("9. List all modified resources");
@@ -279,6 +259,11 @@
                         System.out.println("Bye!");
                         System.exit(0);
                 }
+
+                System.out.println("---");
+                System.out.println("Press enter to continue.");
+                br.readLine();
+
             } catch (Exception e) {
                 System.out.println("Exception " + e.getClass().getName() +
                     " caught, message: " + e.getMessage() + ".");

Modified: labs/shotoku/trunk/shotoku-file-access/src/java/org/jboss/shotoku/fileaccess/monitors/ListingMonitor.java
===================================================================
--- labs/shotoku/trunk/shotoku-file-access/src/java/org/jboss/shotoku/fileaccess/monitors/ListingMonitor.java	2006-08-30 19:24:20 UTC (rev 6033)
+++ labs/shotoku/trunk/shotoku-file-access/src/java/org/jboss/shotoku/fileaccess/monitors/ListingMonitor.java	2006-08-30 22:22:57 UTC (rev 6034)
@@ -60,7 +60,6 @@
             Node indexNode = getIndexNode(d);
             if (indexNode == null) {
                 try {
-
                     request.setAttribute("directory", d);
                     response.setContentType("text/html");
                     request.getRequestDispatcher("/repo-access/listing.jsp")

Added: labs/shotoku/trunk/shotoku-portal/src/java/org/jboss/shotoku/portal/CompositeCommand.java
===================================================================
--- labs/shotoku/trunk/shotoku-portal/src/java/org/jboss/shotoku/portal/CompositeCommand.java	2006-08-30 19:24:20 UTC (rev 6033)
+++ labs/shotoku/trunk/shotoku-portal/src/java/org/jboss/shotoku/portal/CompositeCommand.java	2006-08-30 22:22:57 UTC (rev 6034)
@@ -0,0 +1,27 @@
+package org.jboss.shotoku.portal;
+
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * @author Adam Warski (adamw at aster.pl)
+ */
+public class CompositeCommand extends ShotokuCommand {
+    private List<ShotokuCommand> commands;
+
+    public CompositeCommand(ShotokuCommand... cmds) {
+        commands = new ArrayList<ShotokuCommand>();
+        for (ShotokuCommand cmd : cmds) {
+            commands.add(cmd);
+        }
+    }
+
+    public Object execute(ShotokuCommandContext context) {
+        Object ret = null;
+        for (ShotokuCommand cmd : commands) {
+            ret = cmd.execute(context);
+        }
+
+        return ret;
+    }
+}

Modified: labs/shotoku/trunk/shotoku-portal/src/java/org/jboss/shotoku/portal/ContentCreateCommand.java
===================================================================
--- labs/shotoku/trunk/shotoku-portal/src/java/org/jboss/shotoku/portal/ContentCreateCommand.java	2006-08-30 19:24:20 UTC (rev 6033)
+++ labs/shotoku/trunk/shotoku-portal/src/java/org/jboss/shotoku/portal/ContentCreateCommand.java	2006-08-30 22:22:57 UTC (rev 6034)
@@ -22,6 +22,7 @@
 package org.jboss.shotoku.portal;
 
 import org.jboss.portal.cms.model.File;
+import org.jboss.portal.common.invocation.InvocationException;
 import org.jboss.shotoku.Node;
 
 /**
@@ -57,4 +58,8 @@
 
         return null;
     }
+
+    protected void dispatch() throws Exception, InvocationException {
+
+    }
 }

Modified: labs/shotoku/trunk/shotoku-portal/src/java/org/jboss/shotoku/portal/ShotokuCMS.java
===================================================================
--- labs/shotoku/trunk/shotoku-portal/src/java/org/jboss/shotoku/portal/ShotokuCMS.java	2006-08-30 19:24:20 UTC (rev 6033)
+++ labs/shotoku/trunk/shotoku-portal/src/java/org/jboss/shotoku/portal/ShotokuCMS.java	2006-08-30 22:22:57 UTC (rev 6034)
@@ -96,10 +96,10 @@
     }
 
     public Object execute(Command cmd) {
-        ShotokuCommand jcrCmd = (ShotokuCommand) cmd;
+        ShotokuCommand shtCmd = (ShotokuCommand) cmd;
         ShotokuCommandContext ctx = new ShotokuCommandContext(cm,
                 commandFactory, defaultLocale);
-        return ctx.execute(jcrCmd);
+        return ctx.execute(shtCmd);
     }
 
     /*

Modified: labs/shotoku/trunk/shotoku-portal/src/java/org/jboss/shotoku/portal/ShotokuCommand.java
===================================================================
--- labs/shotoku/trunk/shotoku-portal/src/java/org/jboss/shotoku/portal/ShotokuCommand.java	2006-08-30 19:24:20 UTC (rev 6033)
+++ labs/shotoku/trunk/shotoku-portal/src/java/org/jboss/shotoku/portal/ShotokuCommand.java	2006-08-30 22:22:57 UTC (rev 6034)
@@ -22,6 +22,7 @@
 package org.jboss.shotoku.portal;
 
 import org.jboss.portal.cms.Command;
+import org.jboss.portal.common.invocation.InvocationException;
 
 import java.io.Serializable;
 
@@ -31,6 +32,10 @@
  * @author <a href="mailto:roy at jboss.org">Roy Russo</a>
  * @author Adam Warski (adamw at aster.pl)
  */
-public abstract class ShotokuCommand implements Command, Serializable {
-   public abstract Object execute(ShotokuCommandContext context);
+public abstract class ShotokuCommand extends Command implements Serializable {
+    public abstract Object execute(ShotokuCommandContext context);
+
+    protected void dispatch() throws Exception, InvocationException {
+    }
+    
 }

Modified: labs/shotoku/trunk/shotoku-portal/src/java/org/jboss/shotoku/portal/ShotokuCommandFactory.java
===================================================================
--- labs/shotoku/trunk/shotoku-portal/src/java/org/jboss/shotoku/portal/ShotokuCommandFactory.java	2006-08-30 19:24:20 UTC (rev 6033)
+++ labs/shotoku/trunk/shotoku-portal/src/java/org/jboss/shotoku/portal/ShotokuCommandFactory.java	2006-08-30 22:22:57 UTC (rev 6034)
@@ -36,107 +36,122 @@
  * @author Adam Warski (adamw at aster.pl)
  */
 public class ShotokuCommandFactory implements CommandFactory {
-   public ShotokuCommandFactory()
-   {
-   }
+    public ShotokuCommandFactory()
+    {
+    }
 
-   public Command createCopyCommand(String sFromPath, String sToPath)
-   {
-      return new CopyCommand(sFromPath, sToPath);
-   }
+    public Command createCopyCommand(String sFromPath, String sToPath)
+    {
+        return new CopyCommand(sFromPath, sToPath);
+    }
 
-   public Command createMoveCommand(String sFromPath, String sToPath)
-   {
-      return new MoveCommand(sFromPath, sToPath);
-   }
+    public Command createMoveCommand(String sFromPath, String sToPath)
+    {
+        return new MoveCommand(sFromPath, sToPath);
+    }
 
-   public Command createRenameCommand(String sPath, String sNewName)
-   {
-      return new RenameCommand(sPath, sNewName);
-   }
+    public Command createRenameCommand(String sPath, String sNewName)
+    {
+        return new RenameCommand(sPath, sNewName);
+    }
 
-   public Command createDeleteCommand(String sPath)
-   {
-      return new DeleteCommand(sPath);
-   }
+    public Command createDeleteCommand(String sPath)
+    {
+        return new DeleteCommand(sPath);
+    }
 
-   public Command createFileSaveCommand(File file)
-   {
-      return new FileCreateCommand(file);
-   }
+    public Command createFileSaveCommand(File file)
+    {
+        return new FileCreateCommand(file);
+    }
 
-   public Command createFileGetCommand(String sFilePath, String sVersionNumber, Locale locale)
-   {
-      return new FileGetCommand(sFilePath, sVersionNumber, locale);
-   }
+    public Command createFileGetCommand(String sFilePath, String sVersionNumber, Locale locale)
+    {
+        return new FileGetCommand(sFilePath, sVersionNumber, locale);
+    }
 
-   public Command createFileGetCommand(String sFilePath, Locale locale)
-   {
-      return new FileGetCommand(sFilePath, locale);
-   }
+    public Command createFileGetCommand(String sFilePath, Locale locale)
+    {
+        return new FileGetCommand(sFilePath, locale);
+    }
 
-   public Command createFileUpdateCommand(File file)
-   {
-      return new FileUpdateCommand(file);
-   }
+    public Command createFileUpdateCommand(File file)
+    {
+        return new FileUpdateCommand(file);
+    }
 
-   public Command createFolderSaveCommand(Folder folder)
-   {
-      return new FolderCreateCommand(folder);
-   }
+    public Command createFolderSaveCommand(Folder folder)
+    {
+        return new FolderCreateCommand(folder);
+    }
 
-   public Command createFolderGetCommand(String sFolderPath)
-   {
-      return new FolderGetCommand(sFolderPath);
-   }
+    public Command createFolderGetCommand(String sFolderPath)
+    {
+        return new FolderGetCommand(sFolderPath);
+    }
 
-   public Command createFolderUpdateCommand(Folder folder)
-   {
-      return new FolderUpdateCommand(folder);
-   }
+    public Command createFolderUpdateCommand(Folder folder)
+    {
+        return new FolderUpdateCommand(folder);
+    }
 
-   public Command createContentGetVersionsCommand(String sFilePath)
-   {
-      return new ContentGetVersionsCommand(sFilePath);
-   }
+    public Command createContentGetVersionsCommand(String sFilePath)
+    {
+        return new ContentGetVersionsCommand(sFilePath);
+    }
 
-   public Command createFolderGetListCommand(String sFolderPath)
-   {
-      return new FolderGetListCommand(sFolderPath);
-   }
+    public Command createFolderGetListCommand(String sFolderPath)
+    {
+        return new FolderGetListCommand(sFolderPath);
+    }
 
-   public Command createContentCreateNewVersionCommand(Content content, boolean bMakeLive)
-   {
-      return new ContentCreateNewVersionCommand(content, bMakeLive);
-   }
+    public Command createContentCreateNewVersionCommand(Content content, boolean bMakeLive)
+    {
+        return new ContentCreateNewVersionCommand(content, bMakeLive);
+    }
 
-   public Command createContentCreateNewVersionCommand(List contents, boolean bMakeLive)
-   {
-      return new ContentCreateNewVersionCommand(contents, bMakeLive);
-   }
+    public Command createContentCreateNewVersionCommand(List contents, boolean bMakeLive)
+    {
+        return new ContentCreateNewVersionCommand(contents, bMakeLive);
+    }
 
-   public Command createStoreArchiveCommand(String sRootPath, InputStream is, String sLanguage)
-   {
-      return new StoreArchiveCommand(sRootPath, is, sLanguage);
-   }
+    public Command createStoreArchiveCommand(String sRootPath, InputStream is, String sLanguage)
+    {
+        return new StoreArchiveCommand(sRootPath, is, sLanguage);
+    }
 
-   public Command createItemExistsCommand(String sPath)
-   {
-      return new ItemExistsCommand(sPath);
-   }
+    public Command createItemExistsCommand(String sPath)
+    {
+        return new ItemExistsCommand(sPath);
+    }
 
-   public Command createContentSaveCommand(File file)
-   {
-      return new ContentCreateCommand(file);
-   }
+    public Command createContentSaveCommand(File file)
+    {
+        return new ContentCreateCommand(file);
+    }
 
-   public Command createContentGetCommand(String sPath, String sVersionNumber, Locale locale)
-   {
-      return new ContentGetCommand(sPath, sVersionNumber, locale);
-   }
+    public Command createContentGetCommand(String sPath, String sVersionNumber, Locale locale)
+    {
+        return new ContentGetCommand(sPath, sVersionNumber, locale);
+    }
 
-   public Command createFileGetListCommand(String sFilePath)
-   {
-      return new FileGetListCommand(sFilePath);
-   }
+    public Command createFileGetListCommand(String sFilePath)
+    {
+        return new FileGetListCommand(sFilePath);
+    }
+
+    public Command createGetArchiveCommand(String string, String string1) {
+        // TODO
+        return null;
+    }
+
+    public Command createNewFileCommand(File file, Content content) {
+        // TODO
+        return null;
+    }
+
+    public Command createUpdateFileCommand(File file, Content content, boolean b) {
+        // TODO
+        return null;
+    }
 }

Modified: labs/shotoku/trunk/shotoku-svn/maven.xml
===================================================================
--- labs/shotoku/trunk/shotoku-svn/maven.xml	2006-08-30 19:24:20 UTC (rev 6033)
+++ labs/shotoku/trunk/shotoku-svn/maven.xml	2006-08-30 22:22:57 UTC (rev 6034)
@@ -18,4 +18,10 @@
                 tofile="${local.deploy.dir}/shotoku-svn.ejb3"
                 overwrite="true" />
     </goal>
+
+    <goal name="all">
+        <attainGoal name="clean" />
+        <attainGoal name="build" />
+        <attainGoal name="deploy" />
+    </goal>				    
 </project>

Modified: labs/shotoku/trunk/shotoku-svn/project.properties
===================================================================
--- labs/shotoku/trunk/shotoku-svn/project.properties	2006-08-30 19:24:20 UTC (rev 6033)
+++ labs/shotoku/trunk/shotoku-svn/project.properties	2006-08-30 22:22:57 UTC (rev 6034)
@@ -1,7 +1,4 @@
 maven.repo.remote=http://repository.atlassian.com,http://www.ibiblio.org/maven,http://dist.codehaus.org/
-
 maven.final.name=${pom.artifactId}
-
 maven.jar.override=on
-
-maven.jar.javasvn=shotoku-svn/lib/javasvn.jar
\ No newline at end of file
+maven.jar.javasvn=${shotoku.root.dir}/shotoku-svn/lib/javasvn.jar

Modified: labs/shotoku/trunk/shotoku-svn/src/java/org/jboss/shotoku/svn/service/SvnRepository.java
===================================================================
--- labs/shotoku/trunk/shotoku-svn/src/java/org/jboss/shotoku/svn/service/SvnRepository.java	2006-08-30 19:24:20 UTC (rev 6033)
+++ labs/shotoku/trunk/shotoku-svn/src/java/org/jboss/shotoku/svn/service/SvnRepository.java	2006-08-30 22:22:57 UTC (rev 6034)
@@ -160,6 +160,7 @@
         try {
             ourClientManager.getWCClient().doCleanup(wc);
         } catch (Exception e) {
+            debug("Exception while cleaning up: " + e.getMessage() + ".");
             // Nothing we can do.
         }
     }
@@ -213,6 +214,10 @@
         }
     }
 
+    private void debug(String message) {
+        log.debug(message);
+    }
+
     /**
      * Updates the repository. If it fails, and <code>tryCheckout</code> is
      * set to true, a checkout is attempted; if it set to false, and
@@ -226,15 +231,20 @@
      *            True iff this is the first attempt to do an update.
      */
     private synchronized void update(boolean tryCheckout, boolean firstTime) {
+        debug("Starting SVN update...");
         /*
          * Checking if there is any need for updating the working copy.
          */
         try {
             if (lastRevision == repository.getLatestRevision()) {
+                debug("No update necessary, performing delayed operations...");
                 performDelayedOperations();
+                debug("Ending SVN update.");
                 return;
             }
-        } catch (SVNException e1) {
+        } catch (SVNException e) {
+            debug("Exception when checking if working copy update is needed: " +
+                    e.getMessage());
             // Trying to continue ...
         }
 
@@ -262,26 +272,40 @@
             SVNUpdateClient updateClient = ourClientManager.getUpdateClient();
             updateClient.setIgnoreExternals(ignoreExternals);
             try {
+                debug("Updating repository: " + getId() +
+                        "; revision number before update: " +
+                        getLastRevision() + ".");
                 /*
-                     * Trying to do an update - if it does not succeed, then most
-                     * probably the wc hasn't been checked out yet. That's why
-                     * we try to do a check out in case of an error.
-                     */
+                 * Trying to do an update - if it does not succeed, then most
+                 * probably the wc hasn't been checked out yet. That's why
+                 * we try to do a check out in case of an error.
+                 */
                 lastRevision = updateClient.doUpdate(wc, SVNRevision.HEAD,
                         true);
+                debug("Finished updating repository: " + getId() +
+                        "; revision number after update: " +
+                        getLastRevision() + ".");
             } catch (SVNException e) {
                 SVNURL repositoryURL = SVNURL.parseURIEncoded(url);
 
                 if (tryCheckout) {
-                    updateClient.doCheckout(repositoryURL, wc,
+                    debug("Exception when updating: " + e.getErrorMessage() + ", trying " +
+                        "to perform a checkout.");
+                    lastRevision = updateClient.doCheckout(repositoryURL, wc,
                             SVNRevision.HEAD, SVNRevision.HEAD, true);
+                    debug("Checked out revision " + lastRevision + ".");
                 } else {
+                    debug("Exception when updating: " + e.getErrorMessage() + ", not " +
+                            "trying to perform a checkout.");
                     throw e;
                 }
             }
         } catch (SVNException e) {
             if (firstTime) {
+                debug("First-time update threw an exception: " + e.getMessage() +
+                        ", calling cleanup ...");
                 tryCleanup();
+                debug("First-time update threw an exception, calling update again...");
                 update(tryCheckout, false);
             } else {
                 log.error("Error while updating the repository.", e);
@@ -297,8 +321,11 @@
         // Finally, executing any delayed operations (no point in doing this
         // in a first-time update).
         if (!firstTime) {
+            debug("Performing delayed operations...");
             performDelayedOperations();
         }
+
+        debug("Ending SVN update.");
     }
 
     public void addPathsToUpdate(String id, long revision, Set<String> paths) {

Modified: labs/shotoku/trunk/shotoku-svn/src/java/org/jboss/shotoku/svn/service/SvnServiceImpl.java
===================================================================
--- labs/shotoku/trunk/shotoku-svn/src/java/org/jboss/shotoku/svn/service/SvnServiceImpl.java	2006-08-30 19:24:20 UTC (rev 6033)
+++ labs/shotoku/trunk/shotoku-svn/src/java/org/jboss/shotoku/svn/service/SvnServiceImpl.java	2006-08-30 22:22:57 UTC (rev 6034)
@@ -52,7 +52,7 @@
 @Management(SvnService.class)
 @Depends(Constants.SHOTOKU_SERVICE_NAME)
 public class SvnServiceImpl extends AdministratedServiceImpl
-           implements SvnService, SvnServiceLocal {
+        implements SvnService, SvnServiceLocal {
     private static final Logger log = Logger.getLogger(AdministratedService.class);
 
     private ConcurrentMap<String, SvnRepository> repositories;
@@ -107,22 +107,14 @@
     }
 
     public void update() {
-        log.debug("Starting SVN update.");
         for (SvnRepository repo : repositories.values()) {
             try {
-                log.debug("Updating repository: " + repo.getId() +
-                        "; revision number before update: " +
-                        repo.getLastRevision() + ".");
                 repo.update();
-                log.debug("Finished updating repository: " + repo.getId() +
-                        "; revision number after update: " +
-                        repo.getLastRevision() + ".");
             } catch (Exception e) {
                 log.error("Exception while updating repository: " +
                         repo.getId() + ".", e);
             }
         }
-        log.debug("Ending SVN update.");
     }
 
     public String getServiceId() {
@@ -139,7 +131,7 @@
             sb.append(id).append(" (").
                     append(repositories.get(id).getLastRevision()).append("); ");
         }
-        
+
         return sb.append(".").toString();
     }
 

Modified: labs/shotoku/trunk/shotoku-tags/src/java/org/jboss/shotoku/tags/service/TagServiceImpl.java
===================================================================
--- labs/shotoku/trunk/shotoku-tags/src/java/org/jboss/shotoku/tags/service/TagServiceImpl.java	2006-08-30 19:24:20 UTC (rev 6033)
+++ labs/shotoku/trunk/shotoku-tags/src/java/org/jboss/shotoku/tags/service/TagServiceImpl.java	2006-08-30 22:22:57 UTC (rev 6034)
@@ -79,8 +79,7 @@
     public void create() throws Exception {
         super.create();
 
-        setTimerInterval(ContentManager
-                .getProperty(
+        setTimerInterval(ContentManager.getProperty(
                 org.jboss.shotoku.tags.tools.Constants.PROPERTY_INTERVAL,
                 10000));
 

Modified: labs/shotoku/trunk/shotoku-user/project.xml
===================================================================
--- labs/shotoku/trunk/shotoku-user/project.xml	2006-08-30 19:24:20 UTC (rev 6033)
+++ labs/shotoku/trunk/shotoku-user/project.xml	2006-08-30 22:22:57 UTC (rev 6034)
@@ -21,6 +21,11 @@
             <artifactId>portal-core</artifactId>
             <jar>portal-core-lib.jar</jar>
         </dependency>
+        <dependency>
+            <groupId>jboss</groupId>
+            <artifactId>portal-identity</artifactId>
+            <jar>portal-identity-lib.jar</jar>
+        </dependency>
     </dependencies>
 
     <build>

Modified: labs/shotoku/trunk/shotoku-user/src/java/org/jboss/shotoku/user/JBossPortalGroup.java
===================================================================
--- labs/shotoku/trunk/shotoku-user/src/java/org/jboss/shotoku/user/JBossPortalGroup.java	2006-08-30 19:24:20 UTC (rev 6033)
+++ labs/shotoku/trunk/shotoku-user/src/java/org/jboss/shotoku/user/JBossPortalGroup.java	2006-08-30 22:22:57 UTC (rev 6034)
@@ -1,12 +1,12 @@
 package org.jboss.shotoku.user;
 
-import org.jboss.portal.core.model.Role;
+import org.jboss.portal.identity.Role;
 
 /**
  * @author Adam Warski (adamw at aster.pl)
  */
 public class JBossPortalGroup extends Group {
-    private org.jboss.portal.core.model.Role r;
+    private Role r;
 
     public JBossPortalGroup(Role r) {
         this.r = r;

Modified: labs/shotoku/trunk/shotoku-user/src/java/org/jboss/shotoku/user/JBossPortalUser.java
===================================================================
--- labs/shotoku/trunk/shotoku-user/src/java/org/jboss/shotoku/user/JBossPortalUser.java	2006-08-30 19:24:20 UTC (rev 6033)
+++ labs/shotoku/trunk/shotoku-user/src/java/org/jboss/shotoku/user/JBossPortalUser.java	2006-08-30 22:22:57 UTC (rev 6034)
@@ -4,9 +4,9 @@
  * @author Adam Warski (adamw at aster.pl)
  */
 public class JBossPortalUser extends User {
-    org.jboss.portal.core.model.User u;
+    org.jboss.portal.identity.User u;
 
-    public JBossPortalUser(org.jboss.portal.core.model.User u) {
+    public JBossPortalUser(org.jboss.portal.identity.User u) {
         this.u = u;
     }
 

Modified: labs/shotoku/trunk/shotoku-user/src/java/org/jboss/shotoku/user/service/UserServiceImpl.java
===================================================================
--- labs/shotoku/trunk/shotoku-user/src/java/org/jboss/shotoku/user/service/UserServiceImpl.java	2006-08-30 19:24:20 UTC (rev 6033)
+++ labs/shotoku/trunk/shotoku-user/src/java/org/jboss/shotoku/user/service/UserServiceImpl.java	2006-08-30 22:22:57 UTC (rev 6034)
@@ -26,9 +26,9 @@
 import org.jboss.annotation.ejb.Depends;
 import org.jboss.shotoku.user.tools.UserConstants;
 import org.jboss.shotoku.user.*;
-import org.jboss.portal.core.modules.UserModule;
-import org.jboss.portal.core.modules.ModuleException;
-import org.jboss.portal.core.modules.RoleModule;
+import org.jboss.portal.identity.UserModule;
+import org.jboss.portal.identity.RoleModule;
+import org.jboss.portal.identity.IdentityException;
 import org.apache.log4j.Logger;
 
 import javax.ejb.Local;
@@ -65,7 +65,7 @@
             }
 
             return new JBossPortalUser(um.findUserByUserName(userName));
-        } catch (ModuleException e) {
+        } catch (IdentityException e) {
             throw new UserNotFoundException(e);
         }
     }
@@ -77,39 +77,39 @@
             }
 
             return new JBossPortalGroup(rm.findRoleByName(groupName));
-        } catch (ModuleException e) {
+        } catch (IdentityException e) {
             throw new GroupNotFoundException(e);
         }
     }
 
     public List<User> getUsersInGroup(String groupName) throws GroupNotFoundException {
         try {
-            org.jboss.portal.core.model.Role r = rm.findRoleByName(groupName);
+            org.jboss.portal.identity.Role r = rm.findRoleByName(groupName);
 
             List<User> users = new ArrayList<User>();
             for (Object u : r.getUsers()) {
                 users.add(new JBossPortalUser(
-                        (org.jboss.portal.core.model.User) u));
+                        (org.jboss.portal.identity.User) u));
             }
 
             return users;
-        } catch (ModuleException e) {
+        } catch (IdentityException e) {
             throw new GroupNotFoundException(e);
         }
     }
 
     public List<Group> getGroupsOfUser(String userName) throws UserNotFoundException {
         try {
-            org.jboss.portal.core.model.User u = um.findUserByUserName(userName);
+            org.jboss.portal.identity.User u = um.findUserByUserName(userName);
 
             List<Group> groups = new ArrayList<Group>();
-            for (Object r : u.getRoles()) {
+            for (Object r :  rm.getRoles(u)) {
                 groups.add(new JBossPortalGroup(
-                        (org.jboss.portal.core.model.Role) r));
+                        (org.jboss.portal.identity.Role) r));
             }
 
             return groups;
-        } catch (ModuleException e) {
+        } catch (IdentityException e) {
             throw new UserNotFoundException(e);
         }
     }




More information about the jboss-svn-commits mailing list