You are viewing a plain text version of this content. The canonical link for it is here.
Posted to graffito-commits@incubator.apache.org by cl...@apache.org on 2005/05/23 21:04:02 UTC

svn commit: r178023 [1/2] - in /incubator/graffito/trunk/applications/browser: ./ src/java/org/apache/portals/graffito/portlets/ src/java/org/apache/portals/graffito/portlets/browser/ src/java/org/apache/portals/graffito/portlets/browser/actions/ src/java/org/apache/portals/graffito/portlets/browser/dto/ src/java/org/apache/portals/graffito/portlets/browser/resources/ src/java/org/apache/portals/graffito/portlets/browser/session/ src/webapp/WEB-INF/ src/webapp/kupu/

Author: clombart
Date: Mon May 23 14:04:00 2005
New Revision: 178023

URL: http://svn.apache.org/viewcvs?rev=178023&view=rev
Log:
Use the Graffito portlet frameworks

Added:
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/BrowserPortlet.java
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/BrowserAction.java
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/BrowserActionConstants.java
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/CmsObjectAction.java
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/DocumentAction.java
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/FolderAction.java
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/ForwardAction.java
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/PermissionAction.java
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/dto/
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/dto/DocumentDTO.java
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/dto/FolderDTO.java
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/dto/PathDTO.java
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/dto/PermissionDTO.java
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/dto/PermissionsDTO.java
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/resources/
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/resources/messages.properties
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/resources/messages_en.properties
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/resources/messages_fr.properties
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/resources/messages_ja.properties
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/session/
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/session/BrowserSession.java
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/session/SessionUtil.java
    incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/pages.xml
Removed:
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/AbstractGraffitoPortlet.java
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/BrowserPortlet.java
    incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/jetspeed-portlet.xml
    incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/portlet.xml
    incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/web.xml
Modified:
    incubator/graffito/trunk/applications/browser/   (props changed)
    incubator/graffito/trunk/applications/browser/.classpath
    incubator/graffito/trunk/applications/browser/project.xml
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupu.vm
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuinit_form.js

Propchange: incubator/graffito/trunk/applications/browser/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon May 23 14:04:00 2005
@@ -0,0 +1,2 @@
+
+target

Modified: incubator/graffito/trunk/applications/browser/.classpath
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/.classpath?rev=178023&r1=178022&r2=178023&view=diff
==============================================================================
--- incubator/graffito/trunk/applications/browser/.classpath (original)
+++ incubator/graffito/trunk/applications/browser/.classpath Mon May 23 14:04:00 2005
@@ -5,13 +5,31 @@
   </classpathentry>
   <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
   </classpathentry>
+  <classpathentry kind="var" path="MAVEN_REPO/portlet-api/jars/portlet-api-1.0.jar">
+  </classpathentry>
+  <classpathentry kind="var" path="MAVEN_REPO/log4j/jars/log4j-1.2.8.jar">
+  </classpathentry>
+  <classpathentry kind="var" path="MAVEN_REPO/commons-logging/jars/commons-logging-1.0.3.jar">
+  </classpathentry>
+  <classpathentry kind="var" path="MAVEN_REPO/commons-beanutils/jars/commons-beanutils-1.6.1.jar">
+  </classpathentry>
+  <classpathentry kind="var" path="MAVEN_REPO/commons-codec/jars/commons-codec-1.2.jar">
+  </classpathentry>
+  <classpathentry kind="var" path="MAVEN_REPO/commons-collections/jars/commons-collections-2.1.jar">
+  </classpathentry>
+  <classpathentry kind="var" path="MAVEN_REPO/commons-digester/jars/commons-digester-1.5.jar">
+  </classpathentry>
+  <classpathentry kind="var" path="MAVEN_REPO/commons-fileupload/jars/commons-fileupload-1.0.jar">
+  </classpathentry>
+  <classpathentry kind="var" path="MAVEN_REPO/commons-jexl/jars/commons-jexl-1.0.jar">
+  </classpathentry>
   <classpathentry kind="var" path="MAVEN_REPO/graffito/jars/graffito-commons-1.0-a1-dev.jar">
   </classpathentry>
   <classpathentry kind="var" path="MAVEN_REPO/graffito/jars/graffito-api-1.0-a1-dev.jar">
   </classpathentry>
-  <classpathentry kind="var" path="MAVEN_REPO/servletapi/jars/servletapi-2.3.jar">
+  <classpathentry kind="var" path="MAVEN_REPO/graffito/jars/graffito-framework-portlets-1.0-a1-dev.jar">
   </classpathentry>
-  <classpathentry kind="var" path="MAVEN_REPO/portlet-api/jars/portlet-api-1.0.jar">
+  <classpathentry kind="var" path="MAVEN_REPO/servletapi/jars/servletapi-2.3.jar">
   </classpathentry>
   <classpathentry kind="var" path="MAVEN_REPO/jetspeed2/jars/jetspeed-api-2.0-M3-dev.jar">
   </classpathentry>
@@ -26,22 +44,6 @@
   <classpathentry kind="var" path="MAVEN_REPO/velocity/jars/velocity-1.4.jar">
   </classpathentry>
   <classpathentry kind="var" path="MAVEN_REPO/velocity-tools/jars/velocity-tools-1.1.jar">
-  </classpathentry>
-  <classpathentry kind="var" path="MAVEN_REPO/log4j/jars/log4j-1.2.8.jar">
-  </classpathentry>
-  <classpathentry kind="var" path="MAVEN_REPO/commons-logging/jars/commons-logging-1.0.3.jar">
-  </classpathentry>
-  <classpathentry kind="var" path="MAVEN_REPO/commons-beanutils/jars/commons-beanutils-1.6.1.jar">
-  </classpathentry>
-  <classpathentry kind="var" path="MAVEN_REPO/commons-codec/jars/commons-codec-1.2.jar">
-  </classpathentry>
-  <classpathentry kind="var" path="MAVEN_REPO/commons-collections/jars/commons-collections-2.1.jar">
-  </classpathentry>
-  <classpathentry kind="var" path="MAVEN_REPO/commons-digester/jars/commons-digester-1.5.jar">
-  </classpathentry>
-  <classpathentry kind="var" path="MAVEN_REPO/commons-el/jars/commons-el-1.0.jar">
-  </classpathentry>
-  <classpathentry kind="var" path="MAVEN_REPO/commons-fileupload/jars/commons-fileupload-1.0.jar">
   </classpathentry>
   <classpathentry kind="output" path="target/classes">
   </classpathentry>

Modified: incubator/graffito/trunk/applications/browser/project.xml
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/project.xml?rev=178023&r1=178022&r2=178023&view=diff
==============================================================================
--- incubator/graffito/trunk/applications/browser/project.xml (original)
+++ incubator/graffito/trunk/applications/browser/project.xml Mon May 23 14:04:00 2005
@@ -1,203 +1,225 @@
+<?xml version="1.0" encoding="UTF-8"?>
 <project>
-	<extend>${basedir}/./../../project.xml</extend>
-	<pomVersion>3</pomVersion>
-	<artifactId>graffito-browser</artifactId>
-	<name>Graffito Browser Portlet</name>
-	<groupId>graffito</groupId>
-	<description>Graffito Browser Portlet</description>
-	<shortDescription>Graffito Browser Portlet</shortDescription>
-	<repository>
-		<connection>scm:subversion:https://svn.apache.org/repos/asf/incubator/graffito/trunk/applications/browser</connection>
-		<developerConnection>
-			scm:subversion:https://svn.apache.org/repos/asf/incubator/graffito/trunk/applications/browser</developerConnection>
-		<url>http://svn.apache.org/viewcvs</url>
-	</repository>
-	<dependencies>
-		<dependency>
-			<id>graffito-commons</id>
-			<groupId>graffito</groupId>
-			<version>1.0-a1-dev</version>
-		</dependency>		
-		<dependency>
-			<id>graffito-api</id>
-			<groupId>graffito</groupId>
-			<version>1.0-a1-dev</version>
-		</dependency>
-		<dependency>
-			<id>servletapi</id>
-			<version>2.3</version>
-			<properties>
-				<war.bundle>false</war.bundle>
-			</properties>
-		</dependency>
-		<dependency>
-			<groupId>portlet-api</groupId>
-			<artifactId>portlet-api</artifactId>
-			<version>1.0</version>
-			<type>jar</type>
-			<properties>
-				<war.bundle>false</war.bundle>
-			</properties>
-		</dependency>
-		<dependency>
-			<groupId>jetspeed2</groupId>
-			<artifactId>jetspeed-api</artifactId>
-			<version>2.0-M3-dev</version>
-			<type>jar</type>
-			<properties>
-				<war.bundle>false</war.bundle>
-			</properties>
-		</dependency>
-		
-		<dependency>
-			<groupId>jetspeed2</groupId>
-			<artifactId>jetspeed-commons</artifactId>
-			<version>2.0-M3-dev</version>
-			<type>jar</type>
-			<properties>
-				<war.bundle>false</war.bundle>
-			</properties>
-		</dependency>
-		<dependency>
-			<groupId>jetspeed2</groupId>
-			<artifactId>jetspeed-components</artifactId>
-			<version>2.0-M3-dev</version>
-			<type>jar</type>
-			<properties>
-				<war.bundle>true</war.bundle>
-			</properties>
-		</dependency>
-		<dependency>
-			<groupId>portals-bridges</groupId>
-			<artifactId>portals-bridges-common</artifactId>
-			<version>0.1</version>
-			<type>jar</type>
-			<properties>
-				<war.bundle>true</war.bundle>
-			</properties>
-		</dependency>
-		<dependency>
-			<groupId>portals-bridges</groupId>
-			<artifactId>portals-bridges-velocity</artifactId>
-			<version>0.1</version>
-			<type>jar</type>
-			<properties>
-				<war.bundle>true</war.bundle>
-			</properties>
-		</dependency>
-		<dependency>
-			<id>velocity</id>
-			<version>1.4</version>
-			<properties>
-				<war.bundle>true</war.bundle>
-			</properties>
-		</dependency>
-		<dependency>
-			<id>velocity-tools</id>
-			<version>1.1</version>
-			<url>http://jakarta.apache.org/velocity</url>
-			<properties>
-				<war.bundle>true</war.bundle>
-			</properties>
-		</dependency>
-		<dependency>
-			<groupId>log4j</groupId>
-			<artifactId>log4j</artifactId>
-			<version>1.2.8</version>
-			<type>jar</type>
-			<properties>
-				<war.bundle>true</war.bundle>
-			</properties>
-		</dependency>
-		<dependency>
-			<groupId>commons-logging</groupId>
-			<artifactId>commons-logging</artifactId>
-			<version>1.0.3</version>
-			<type>jar</type>
-			<url>http://jakarta.apache.org/commons/logging.html</url>
-			<properties>
-				<war.bundle>true</war.bundle>
-			</properties>
-		</dependency>
-		<dependency>
-			<groupId>commons-beanutils</groupId>
-			<artifactId>commons-beanutils</artifactId>
-			<version>1.6.1</version>
-			<url>http://jakarta.apache.org/commons/beanutils.html</url>
-			<properties>
-				<war.bundle>true</war.bundle>
-			</properties>
-		</dependency>
-		<dependency>
-			<groupId>commons-codec</groupId>
-			<artifactId>commons-codec</artifactId>
-			<version>1.2</version>
-			<url>http://jakarta.apache.org/commons/codec/</url>
-			<properties>
-				<war.bundle>true</war.bundle>
-			</properties>
-		</dependency>
-		<dependency>
-			<groupId>commons-collections</groupId>
-			<artifactId>commons-collections</artifactId>
-			<version>2.1</version>
-			<url>http://jakarta.apache.org/commons/collections.html</url>
-			<properties>
-				<war.bundle>true</war.bundle>
-			</properties>
-		</dependency>
-		<dependency>
-			<groupId>commons-digester</groupId>
-			<artifactId>commons-digester</artifactId>
-			<version>1.5</version>
-			<url>http://jakarta.apache.org/commons/digester.html</url>
-			<properties>
-				<war.bundle>true</war.bundle>
-			</properties>
-		</dependency>
-		<dependency>
-			<groupId>commons-el</groupId>
-			<artifactId>commons-el</artifactId>
-			<version>1.0</version>
-			<url>http://jakarta.apache.org/commons/el/</url>
-			<properties>
-				<war.bundle>true</war.bundle>
-			</properties>
-		</dependency>
-		<dependency>
-			<groupId>commons-fileupload</groupId>
-			<artifactId>commons-fileupload</artifactId>
-			<version>1.0</version>
-			<url>http://jakarta.apache.org/commons/fileupload/</url>
-			<properties>
-				<war.bundle>true</war.bundle>
-			</properties>
-		</dependency>
-	</dependencies>
-	<build>
-		<sourceDirectory>src/java</sourceDirectory>
-		<resources>
-			<resource>
-				<directory>${basedir}/src/java/</directory>
-				<includes>
-					<include>**/*.properties</include>
-				</includes>
-				<filtering>false</filtering>
-			</resource>
-		</resources>
-	</build>
-	<reports>
-		<report>maven-jdepend-plugin</report>
-		<report>maven-checkstyle-plugin</report>
-		<report>maven-pmd-plugin</report>
-		<report>maven-changelog-plugin</report>
-		<report>maven-file-activity-plugin</report>
-		<report>maven-developer-activity-plugin</report>
-		<report>maven-license-plugin</report>
-		<report>maven-javadoc-plugin</report>
-		<report>maven-jxr-plugin</report>
-		<report>maven-junit-report-plugin</report>
-		<report>maven-tasklist-plugin</report>
-	</reports>
-	<properties/>
-</project>
\ No newline at end of file
+  <extend>${basedir}/./../../project.xml</extend>
+  <pomVersion>3</pomVersion>
+  <artifactId>graffito-browser</artifactId>
+  <name>Graffito Browser Portlet</name>
+  <groupId>graffito</groupId>
+  <description>Graffito Browser Portlet</description>
+  <shortDescription>Graffito Browser Portlet</shortDescription>
+  <repository>
+    <connection>scm:subversion:https://svn.apache.org/repos/asf/incubator/graffito/trunk/applications/browser</connection>
+    <developerConnection>scm:subversion:https://svn.apache.org/repos/asf/incubator/graffito/trunk/applications/browser</developerConnection>
+    <url>http://svn.apache.org/viewcvs</url>
+  </repository>
+  <dependencies>
+    <dependency>
+      <groupId>portlet-api</groupId>
+      <artifactId>portlet-api</artifactId>
+      <version>1.0</version>
+      <type>jar</type>
+      <properties>
+        <war.bundle>false</war.bundle>
+      </properties>
+    </dependency>
+    <dependency>
+      <groupId>log4j</groupId>
+      <artifactId>log4j</artifactId>
+      <version>1.2.8</version>
+      <type>jar</type>
+      <properties>
+        <war.bundle>true</war.bundle>
+      </properties>
+    </dependency>
+    <dependency>
+      <groupId>commons-logging</groupId>
+      <artifactId>commons-logging</artifactId>
+      <version>1.0.3</version>
+      <type>jar</type>
+      <url>http://jakarta.apache.org/commons/logging.html</url>
+      <properties>
+        <war.bundle>true</war.bundle>
+      </properties>
+    </dependency>
+    <dependency>
+      <groupId>commons-beanutils</groupId>
+      <artifactId>commons-beanutils</artifactId>
+      <version>1.6.1</version>
+      <type>jar</type>
+      <url>http://jakarta.apache.org/commons/beanutils.html</url>
+      <properties>
+        <war.bundle>true</war.bundle>
+      </properties>
+    </dependency>
+    <dependency>
+      <groupId>commons-codec</groupId>
+      <artifactId>commons-codec</artifactId>
+      <version>1.2</version>
+      <type>jar</type>
+      <url>http://jakarta.apache.org/commons/codec/</url>
+      <properties>
+        <war.bundle>true</war.bundle>
+      </properties>
+    </dependency>
+    <dependency>
+      <groupId>commons-collections</groupId>
+      <artifactId>commons-collections</artifactId>
+      <version>2.1</version>
+      <type>jar</type>
+      <url>http://jakarta.apache.org/commons/collections.html</url>
+      <properties>
+        <war.bundle>true</war.bundle>
+      </properties>
+    </dependency>
+    <dependency>
+      <groupId>commons-digester</groupId>
+      <artifactId>commons-digester</artifactId>
+      <version>1.5</version>
+      <type>jar</type>
+      <url>http://jakarta.apache.org/commons/digester.html</url>
+      <properties>
+        <war.bundle>true</war.bundle>
+      </properties>
+    </dependency>
+    <dependency>
+      <groupId>commons-fileupload</groupId>
+      <artifactId>commons-fileupload</artifactId>
+      <version>1.0</version>
+      <type>jar</type>
+      <url>http://jakarta.apache.org/commons/fileupload/</url>
+      <properties>
+        <war.bundle>true</war.bundle>
+      </properties>
+    </dependency>
+    <dependency>
+      <groupId>commons-jexl</groupId>
+      <artifactId>commons-jexl</artifactId>
+      <version>1.0</version>
+      <type>jar</type>    
+      <properties>
+        <war.bundle>true</war.bundle>
+      </properties>
+    </dependency>    
+    <dependency>
+      <groupId>graffito</groupId>
+      <artifactId>graffito-commons</artifactId>
+      <version>1.0-a1-dev</version>
+      <type>jar</type>
+    </dependency>
+    <dependency>
+      <groupId>graffito</groupId>
+      <artifactId>graffito-api</artifactId>
+      <version>1.0-a1-dev</version>
+      <type>jar</type>
+    </dependency>
+    <dependency>
+      <groupId>graffito</groupId>
+      <artifactId>graffito-framework-portlets</artifactId>
+      <version>1.0-a1-dev</version>
+      <type>jar</type>
+      <properties>
+        <war.bundle>true</war.bundle>
+      </properties>
+    </dependency>
+    <dependency>
+      <groupId>servletapi</groupId>
+      <artifactId>servletapi</artifactId>
+      <version>2.3</version>
+      <type>jar</type>
+      <properties>
+        <war.bundle>false</war.bundle>
+      </properties>
+    </dependency>
+    <dependency>
+      <groupId>jetspeed2</groupId>
+      <artifactId>jetspeed-api</artifactId>
+      <version>2.0-M3-dev</version>
+      <type>jar</type>
+      <properties>
+        <war.bundle>false</war.bundle>
+      </properties>
+    </dependency>
+    <dependency>
+      <groupId>jetspeed2</groupId>
+      <artifactId>jetspeed-commons</artifactId>
+      <version>2.0-M3-dev</version>
+      <type>jar</type>
+      <properties>
+        <war.bundle>false</war.bundle>
+      </properties>
+    </dependency>
+    <dependency>
+      <groupId>jetspeed2</groupId>
+      <artifactId>jetspeed-components</artifactId>
+      <version>2.0-M3-dev</version>
+      <type>jar</type>
+      <properties>
+        <war.bundle>true</war.bundle>
+      </properties>
+    </dependency>
+    <dependency>
+      <groupId>portals-bridges</groupId>
+      <artifactId>portals-bridges-common</artifactId>
+      <version>0.1</version>
+      <type>jar</type>
+      <properties>
+        <war.bundle>true</war.bundle>
+      </properties>
+    </dependency>
+    <dependency>
+      <groupId>portals-bridges</groupId>
+      <artifactId>portals-bridges-velocity</artifactId>
+      <version>0.1</version>
+      <type>jar</type>
+      <properties>
+        <war.bundle>true</war.bundle>
+      </properties>
+    </dependency>
+    <dependency>
+      <groupId>velocity</groupId>
+      <artifactId>velocity</artifactId>
+      <version>1.4</version>
+      <type>jar</type>
+      <properties>
+        <war.bundle>true</war.bundle>
+      </properties>
+    </dependency>
+    <dependency>
+      <groupId>velocity-tools</groupId>
+      <artifactId>velocity-tools</artifactId>
+      <version>1.1</version>
+      <type>jar</type>
+      <url>http://jakarta.apache.org/velocity</url>
+      <properties>
+        <war.bundle>true</war.bundle>
+      </properties>
+    </dependency>
+  </dependencies>
+  <build>
+    <sourceDirectory>src/java</sourceDirectory>
+    <resources>
+      <resource>
+        <directory>${basedir}/src/java/</directory>
+        <includes>
+          <include>**/*.properties</include>
+        </includes>
+        <filtering>false</filtering>
+      </resource>
+    </resources>
+  </build>
+  <reports>
+    <report>maven-jdepend-plugin</report>
+    <report>maven-checkstyle-plugin</report>
+    <report>maven-pmd-plugin</report>
+    <report>maven-changelog-plugin</report>
+    <report>maven-file-activity-plugin</report>
+    <report>maven-developer-activity-plugin</report>
+    <report>maven-license-plugin</report>
+    <report>maven-javadoc-plugin</report>
+    <report>maven-jxr-plugin</report>
+    <report>maven-junit-report-plugin</report>
+    <report>maven-tasklist-plugin</report>
+  </reports>
+  <properties />
+</project>
+

Added: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/BrowserPortlet.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/BrowserPortlet.java?rev=178023&view=auto
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/BrowserPortlet.java (added)
+++ incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/BrowserPortlet.java Mon May 23 14:04:00 2005
@@ -0,0 +1,119 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS"
+ * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
+ */
+package org.apache.portals.graffito.portlets.browser;
+
+import java.util.ArrayList;
+
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletException;
+import org.apache.portals.graffito.portlets.GraffitoPortlet;
+import org.apache.portals.graffito.portlets.util.ServiceUtil;
+
+
+/**
+ * Graffito Content Browser.
+ * 
+ * In the view mode, this browser gives the possibility to navigate across the complete content tree. 
+ * In the edit mode, this browser can manage folders & documents (edit, add, delete, manage security, versionning, ...).
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart </a>
+ * @version $Id: BrowserPortlet.java,v 1.1 2004/12/28 14:29:11 christophe Exp $
+ */
+public class BrowserPortlet extends GraffitoPortlet
+{
+    
+    private static final String SEPARATOR = ",";
+      
+    private static final String DOCUMENT_LANGUAGES_PARAM = "DocumentLanguages";
+    private static final String DOCUMENT_TYPES_PARAM = "DocumentTypes";
+    
+    /** Portlet init param containing all available document types */
+    private ArrayList documentTypes = new ArrayList();
+
+    /** Portlet init param containing all available document languages */
+    private ArrayList documentLanguages = new ArrayList();
+    
+
+    /**
+     * @see javax.portlet.Portlet#init(javax.portlet.PortletConfig)
+     */
+    public void init(PortletConfig config) throws PortletException
+    {
+        super.init(config);
+
+        String param = config.getInitParameter(DOCUMENT_TYPES_PARAM);
+        if (null == param)
+        {
+            throw new PortletException("Failed to read the init paramater : DocumentTypes");
+        }
+        initDocumentTypes(param);
+
+        param = config.getInitParameter(DOCUMENT_LANGUAGES_PARAM);
+        if (null == param)
+        {
+            throw new PortletException("Failed to read the init paramater : DocumentLanguages");
+        }
+        initDocumentLanguages(param);
+        
+        param = config.getInitParameter("UploadTempFolder");
+        if (null == param)
+        {
+            throw new PortletException("Failed to read the init paramater : UploadTempFolder");
+        }
+        ServiceUtil.setUploadFolder(param);
+    }
+
+    
+    public ArrayList getDocumentTypes()
+    {
+        return documentTypes;
+        
+    }
+    
+    public ArrayList getDocumentLanguages()
+    {
+        return documentLanguages;
+    }
+    
+    /**
+     * Initialise the list of the available document types
+     * 
+     * @param documentTypes  comma separated document types
+     */
+    private void initDocumentTypes(String documentTypes)
+    {
+        String[] types = documentTypes.split(SEPARATOR);
+
+        for (int i = 0; i < types.length; i++)
+        {
+            this.documentTypes.add(types[i].trim());
+        }
+    }
+
+    /**
+     * Initialise the list of the available document types
+     * 
+     * @param documentLanguages comma separated language types
+     */
+    private void initDocumentLanguages(String documentLanguages)
+    {
+        String[] types = documentLanguages.split(SEPARATOR);
+
+        for (int i = 0; i < types.length; i++)
+        {
+            this.documentLanguages.add(types[i].trim());
+        }
+    }
+    
+
+}
\ No newline at end of file

Added: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/BrowserAction.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/BrowserAction.java?rev=178023&view=auto
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/BrowserAction.java (added)
+++ incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/BrowserAction.java Mon May 23 14:04:00 2005
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.portals.graffito.portlets.browser.actions;
+
+import javax.portlet.PortletRequest;
+
+import org.apache.portals.graffito.portlets.browser.session.SessionUtil;
+
+
+/**
+ * Ancestor class for all Graffito Browser Portlet Action
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe </a>
+ * @version $Id: Exp $
+ */
+public class BrowserAction
+{
+    
+    protected String getUri(PortletRequest request)
+    {
+        String uri = request.getParameter(BrowserActionConstants.URI);                
+        if (uri == null)
+        {
+            uri = SessionUtil.getUri(request);
+            
+            if (uri == null)
+            {
+               uri = this.getDefaultContentScope(request);
+            }            
+        }    
+        SessionUtil.setUri(request, uri);
+        return uri;
+        
+    }
+    
+    protected String getDefaultContentScope(PortletRequest request)
+    {
+
+        return request.getPreferences().getValue(BrowserActionConstants.CONTENT_SCOPE, BrowserActionConstants.DEFAULT_CONTENT_SCOPE);
+    }    
+    
+
+}

Added: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/BrowserActionConstants.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/BrowserActionConstants.java?rev=178023&view=auto
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/BrowserActionConstants.java (added)
+++ incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/BrowserActionConstants.java Mon May 23 14:04:00 2005
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.portals.graffito.portlets.browser.actions;
+
+/**
+ *
+ * Constants used in the different actions
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe </a>
+ * @version $Id: Exp $
+ */
+public class BrowserActionConstants
+{
+    /** HTML content type */
+    public static final String HTML_CONTENT_TYPE = "text/html";    
+
+    /** Plain text content type */
+    public static final String TEXT_CONTENT_TYPE = "text/plain";
+
+    /** DTO used to display the cms object path */
+    public static final String VELOCITY_PATH_DTO = "pathDTO";
+    
+    /** DTO used to display a folder */
+    public static final String VELOCITY_FOLDER_DTO = "folderDTO";
+    
+    /** DTO used to display a document */
+    public static final String VELOCITY_DOCUMENT_DTO = "documentDTO";
+       
+    /** DTO used to display cms object permissions */
+    public static final String VELOCITY_PERMISSIONS_DTO = "permissionsDTO";
+
+    /** DTO used to display one permission */
+    public static final String VELOCITY_PERMISSION_DTO = "permissionDTO";
+    
+    /** Default uri used to display the content browser */
+    public static final String DEFAULT_CONTENT_SCOPE = "/graffito";
+
+    /** Portlet preference attritube containing the root uri used to display the content browser */
+    public static final String CONTENT_SCOPE = "gaffito.content.scope";
+        
+    /** cms object uri */
+    public static final String URI = "uri";
+    
+
+
+}

Added: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/CmsObjectAction.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/CmsObjectAction.java?rev=178023&view=auto
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/CmsObjectAction.java (added)
+++ incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/CmsObjectAction.java Mon May 23 14:04:00 2005
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.portals.graffito.portlets.browser.actions;
+
+
+import javax.portlet.ActionRequest;
+import javax.portlet.PortletException;
+
+import org.apache.portals.graffito.ContentModelService;
+import org.apache.portals.graffito.exception.ContentManagementException;
+import org.apache.portals.graffito.portlets.page.action.PortletActionInfo;
+import org.apache.portals.graffito.portlets.util.ServiceUtil;
+
+/**
+ * Portlet Action used to manage all common action on Cms object like delete, ...
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe </a>
+ * @version $Id: Exp $
+ */
+public class CmsObjectAction extends BrowserAction
+{
+
+    /**
+     * Delete a cms object (document, folder,...)
+     * 
+     * @param portletActionInfo Param used by the action  
+     *  
+     * @throws PortletException when it is not possible to delete the cms objects
+     */
+    public void delete(PortletActionInfo portletActionInfo) throws PortletException
+    {
+       
+        ActionRequest actionRequest = (ActionRequest) portletActionInfo.getRequest();
+        try
+        {
+            String[] uriToDelete = actionRequest.getParameterValues("uri");
+            if (uriToDelete == null)
+            {
+                // No cms object has been selected
+                return;
+            }
+            
+            ContentModelService modelService = ServiceUtil.getModelService();
+            modelService.removeAll(uriToDelete);                        
+
+        }
+        catch (ContentManagementException e)
+        {
+            throw new PortletException("Impossible to delete all cms objects ", e);
+        }
+        
+    }   
+        
+}

Added: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/DocumentAction.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/DocumentAction.java?rev=178023&view=auto
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/DocumentAction.java (added)
+++ incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/DocumentAction.java Mon May 23 14:04:00 2005
@@ -0,0 +1,328 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.portals.graffito.portlets.browser.actions;
+
+
+import java.io.UnsupportedEncodingException;
+import java.sql.Timestamp;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletException;
+import javax.portlet.PortletMode;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+import org.apache.commons.fileupload.FileItem;
+import org.apache.portals.graffito.ContentModelService;
+import org.apache.portals.graffito.ContentServerService;
+import org.apache.portals.graffito.exception.ContentManagementException;
+import org.apache.portals.graffito.model.Document;
+import org.apache.portals.graffito.portlets.bean.BeanUtil;
+import org.apache.portals.graffito.portlets.browser.BrowserPortlet;
+import org.apache.portals.graffito.portlets.browser.dto.DocumentDTO;
+import org.apache.portals.graffito.portlets.browser.dto.PathDTO;
+import org.apache.portals.graffito.portlets.browser.session.BrowserSession;
+import org.apache.portals.graffito.portlets.browser.session.SessionUtil;
+import org.apache.portals.graffito.portlets.page.action.PortletActionInfo;
+import org.apache.portals.graffito.portlets.page.manager.PortletPageManager;
+import org.apache.portals.graffito.portlets.upload.PortletDiskFileUpload;
+import org.apache.portals.graffito.portlets.util.ServiceUtil;
+import org.apache.portals.graffito.util.UriUtil;
+
+/**
+ * Portlet Action used to manage the Graffito Folders
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe </a>
+ * @version $Id: Exp $
+ */
+public class DocumentAction extends BrowserAction
+{
+    
+    public void retrieve(PortletActionInfo actionInfo) throws PortletException
+    {
+        try
+        {
+            
+            RenderRequest request = (RenderRequest) actionInfo.getRequest();
+            RenderResponse response = (RenderResponse) actionInfo.getResponse();
+            PortletPageManager portletPageManager = actionInfo.getPortletPageManager();
+
+            ContentModelService modelService = ServiceUtil.getModelService();
+            ContentServerService serverService = ServiceUtil.getServerService();
+            response.setContentType(BrowserActionConstants.HTML_CONTENT_TYPE);
+            
+            PathDTO pathDTO = new PathDTO();
+            DocumentDTO documentDTO = new DocumentDTO();
+            
+            // Retrieve the document 
+            String uri = this.getUri(request);
+            Document document = modelService.getDocument(uri);
+            
+            // Init the path DTO
+            String scopeServer = UriUtil.getServerScope(uri);
+            pathDTO.setServer(serverService.getServer(scopeServer));
+            pathDTO.setCmsObject(document);
+            
+            // Init the document DTO 
+            documentDTO.setDocument(document);            
+            documentDTO.setDocumentLanguages(((BrowserPortlet)portletPageManager.getPortlet()).getDocumentLanguages());
+            documentDTO.setDocumentTypes(((BrowserPortlet)portletPageManager.getPortlet()).getDocumentTypes());
+            
+            // Init the Session Browser info
+            if (request.getPortletMode().equals(PortletMode.EDIT))
+            {
+                SessionUtil.setOperation(request, BrowserSession.UPDATE);               
+            }
+
+            portletPageManager.addContextObject(request, BrowserActionConstants.VELOCITY_DOCUMENT_DTO, documentDTO);
+            portletPageManager.addContextObject(request, BrowserActionConstants.VELOCITY_PATH_DTO, pathDTO);
+            
+            
+        }
+        catch (Exception e)
+        {
+            throw new PortletException("Impossible to retrieve a document ", e);
+        }
+        
+    }
+
+    public void createWizard(PortletActionInfo actionInfo) throws PortletException
+    {
+        
+        try
+        {
+            
+            RenderRequest request = (RenderRequest) actionInfo.getRequest();
+            RenderResponse response = (RenderResponse) actionInfo.getResponse();
+            PortletPageManager portletPageManager = actionInfo.getPortletPageManager();
+
+            ContentModelService modelService = ServiceUtil.getModelService();
+            ContentServerService serverService = ServiceUtil.getServerService();
+            
+            response.setContentType(BrowserActionConstants.HTML_CONTENT_TYPE);
+
+            Document document = (Document) SessionUtil.getWizardInfo(request);
+            
+            String parentUri = this.getUri(request);
+            // First step in the wizard : init the document
+            if (document == null)
+            {
+                org.apache.portals.graffito.model.Folder parentFolder = modelService.getFolder(parentUri);
+                document = modelService.createDocument();
+                document.setParentFolder(parentFolder);
+            }
+            
+            
+            
+            // Init the path DTO 
+            PathDTO pathDTO =  new PathDTO();
+            String scopeServer = UriUtil.getServerScope(parentUri);
+            pathDTO.setServer(serverService.getServer(scopeServer));
+            pathDTO.setCmsObject(document);
+            
+            // Init the Document DTO
+            DocumentDTO documentDTO = new DocumentDTO();
+            documentDTO.setDocument(document);
+            
+            documentDTO.setDocumentLanguages(((BrowserPortlet)portletPageManager.getPortlet()).getDocumentLanguages());
+            documentDTO.setDocumentTypes(((BrowserPortlet)portletPageManager.getPortlet()).getDocumentTypes());
+            SessionUtil.setOperation(request, BrowserSession.INSERT);
+            SessionUtil.setWizardInfo(request, document);
+            
+            portletPageManager.addContextObject(request, BrowserActionConstants.VELOCITY_DOCUMENT_DTO, documentDTO);
+            portletPageManager.addContextObject(request, BrowserActionConstants.VELOCITY_PATH_DTO, pathDTO);
+            
+        }
+        catch (Exception e)
+        {
+            throw new PortletException("Impossible to create a folder ", e);
+        }
+        
+    }   
+ 
+    public void updateProperties(PortletActionInfo actionInfo) throws PortletException
+    {        
+        ActionRequest request = (ActionRequest) actionInfo.getRequest();
+        ActionResponse response = (ActionResponse) actionInfo.getResponse();
+        PortletPageManager portletPageManager = actionInfo.getPortletPageManager();
+
+        ContentModelService modelService = ServiceUtil.getModelService();
+        BrowserSession browserSession = SessionUtil.getBrowserSession(request);
+
+        Document document = (Document) SessionUtil.getWizardInfo(request);
+        BeanUtil.populate(request, document);
+        document.setCreationDate(new Timestamp(System.currentTimeMillis()));
+        document.setLastModified(new Timestamp(System.currentTimeMillis()));
+        document.setUri(browserSession.getUri() + "/" + document.getName());
+        document.setVersionNumber("1.0");
+
+        String type = request.getParameter("documentType");
+        if (type.equals("document.type.text"))
+        {
+            document.setContentType("text/plain");
+            portletPageManager.setSelectedEditPageId(request, "textEdit");
+        }
+
+        if (type.equals("document.type.html"))
+        {
+            document.setContentType("text/html");
+            portletPageManager.setSelectedEditPageId(request, "htmlEdit");
+
+        }
+
+        if (type.equals("document.type.upload"))
+        {
+            portletPageManager.setSelectedEditPageId(request, "uploadEdit");
+        }
+
+        browserSession.setWizardInfo(document);
+        SessionUtil.setBrowserSession(request, browserSession);            
+    }
+    
+    
+    public void insert(PortletActionInfo actionInfo) throws PortletException
+    {
+        try
+        {
+            ActionRequest request = (ActionRequest) actionInfo.getRequest();
+            ActionResponse response = (ActionResponse) actionInfo.getResponse();
+            PortletPageManager portletPageManager = actionInfo.getPortletPageManager();      
+
+            BrowserSession browserSession = SessionUtil.getBrowserSession(request);
+            Document document = (Document) browserSession.getWizardInfo();
+            
+            BeanUtil.populate(request, document);
+            String documentContent = request.getParameter("documentContent");
+            if (documentContent != null)
+            {
+                try
+                {
+                    document.getContent().setContent(documentContent.getBytes(request.getCharacterEncoding()));
+                    document.getContent().setEncoding(request.getCharacterEncoding());
+                }
+                catch (UnsupportedEncodingException e)
+                {
+                    document.getContent().setContent(documentContent.getBytes());
+                }
+                document.setSize(documentContent.length());
+            }
+            ContentModelService modelService = ServiceUtil.getModelService();
+            modelService.addDocument(document);
+            portletPageManager.setSelectedEditPageId(request, "folderEdit");
+            SessionUtil.setOperation(request, null);
+                        
+        }
+        catch (ContentManagementException e)
+        {
+            throw new PortletException("Impossible to create a document ", e);
+        }
+        
+    }
+
+    
+    public void save(PortletActionInfo actionInfo) throws PortletException
+    {
+        try
+        {
+            ActionRequest request = (ActionRequest) actionInfo.getRequest();
+            ActionResponse response = (ActionResponse) actionInfo.getResponse();
+            PortletPageManager portletPageManager = actionInfo.getPortletPageManager();      
+
+            BrowserSession browserSession = SessionUtil.getBrowserSession(request);
+            ContentModelService modelService = ServiceUtil.getModelService();
+            String uri = this.getUri(request);
+            Document document = modelService.getDocument(uri);
+            
+            BeanUtil.populate(request, document);
+            String documentContent = request.getParameter("documentContent");
+            if (documentContent != null)
+            {
+                try
+                {
+                    document.getContent().setContent(documentContent.getBytes(request.getCharacterEncoding()));
+                    document.getContent().setEncoding(request.getCharacterEncoding());
+                }
+                catch (UnsupportedEncodingException e)
+                {
+                    document.getContent().setContent(documentContent.getBytes());
+                }
+                document.setSize(documentContent.length());
+            }
+            
+            modelService.updateDocument(document);
+
+                        
+        }
+        catch (ContentManagementException e)
+        {
+            throw new PortletException("Impossible to create a document ", e);
+        }
+        
+    }
+    
+    
+    public void upload(PortletActionInfo actionInfo) throws PortletException
+    {
+        try
+        {
+            ActionRequest request = (ActionRequest) actionInfo.getRequest();
+            ActionResponse response = (ActionResponse) actionInfo.getResponse();
+            PortletPageManager portletPageManager = actionInfo.getPortletPageManager();           
+            BrowserSession browserSession = SessionUtil.getBrowserSession(request);
+            ContentModelService modelService = ServiceUtil.getModelService();  
+            
+            Document document = null;
+            if (browserSession.isInsert())
+            {
+                 document = (Document) browserSession.getWizardInfo();
+            }
+            else
+            {
+                document = modelService.getDocument(browserSession.getUri());               
+            }
+            
+            PortletDiskFileUpload diskFileUpload = actionInfo.getDiskFileUpload();
+            diskFileUpload.setRepositoryPath(ServiceUtil.getUploadFolder());
+            FileItem fileItem = diskFileUpload.getFileItem(request, "file");
+            document.setContentType(fileItem.getContentType());
+            document.getContent().setContent(fileItem.get());
+            document.getContent().setEncoding(request.getCharacterEncoding());
+
+            document.setSize(fileItem.getSize());
+                      
+            if (browserSession.isInsert())
+            {
+                modelService.addDocument(document);
+                portletPageManager.setSelectedEditPageId(request, "folderEdit");
+                SessionUtil.setOperation(request, null);
+            }
+            else
+            {
+                modelService.updateDocument(document);
+            }
+                        
+            
+            
+        }
+        catch (Exception e)
+        {
+            throw new PortletException("Impossible to upload a document ", e);
+        }
+    }
+    
+   
+}

Added: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/FolderAction.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/FolderAction.java?rev=178023&view=auto
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/FolderAction.java (added)
+++ incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/FolderAction.java Mon May 23 14:04:00 2005
@@ -0,0 +1,220 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.portals.graffito.portlets.browser.actions;
+
+import java.sql.Timestamp;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.PortletException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+import org.apache.portals.graffito.ContentModelService;
+import org.apache.portals.graffito.ContentServerService;
+import org.apache.portals.graffito.exception.ContentManagementException;
+import org.apache.portals.graffito.model.Folder;
+import org.apache.portals.graffito.portlets.bean.BeanUtil;
+import org.apache.portals.graffito.portlets.browser.dto.FolderDTO;
+import org.apache.portals.graffito.portlets.browser.dto.PathDTO;
+import org.apache.portals.graffito.portlets.browser.session.BrowserSession;
+import org.apache.portals.graffito.portlets.browser.session.SessionUtil;
+import org.apache.portals.graffito.portlets.page.action.PortletActionInfo;
+import org.apache.portals.graffito.portlets.page.manager.PortletPageManager;
+import org.apache.portals.graffito.portlets.util.ServiceUtil;
+import org.apache.portals.graffito.util.UriUtil;
+
+/**
+ *  Portlet Action used to manage the Graffito Folders
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe </a>
+ * @version $Id: Exp $
+ */
+public class FolderAction extends BrowserAction
+{
+    
+    /**
+     * Retrieve a folder information from the view mode or from the edit mode
+     * 
+     * @param actionInfo
+     * @throws PortletException
+     */
+    public void retrieve(PortletActionInfo actionInfo) throws PortletException
+    {
+        try
+        {
+            RenderRequest request = (RenderRequest) actionInfo.getRequest();
+            RenderResponse response = (RenderResponse) actionInfo.getResponse();
+            PortletPageManager portletPageManager = actionInfo.getPortletPageManager();           
+            response.setContentType(BrowserActionConstants.HTML_CONTENT_TYPE);
+                           
+
+            ContentModelService modelService =  ServiceUtil.getModelService();
+            ContentServerService serverService =  ServiceUtil.getServerService();            
+            
+            String uri = this.getUri(request);
+            Folder folder = modelService.getFolder(uri);
+            
+            // Init the path DTO
+            PathDTO pathDTO = new PathDTO();
+            String scopeServer = UriUtil.getServerScope(uri);
+            pathDTO.setServer(serverService.getServer(scopeServer));
+            pathDTO.setCmsObject(folder);
+            
+            // Init the folder DTO
+            FolderDTO folderDTO = new FolderDTO();            
+            folderDTO.setFolder(folder);            
+            folderDTO.setDocuments(modelService.getDocuments(uri));
+            folderDTO.setFolders(modelService.getFolders(uri));
+            SessionUtil.setWizardInfo(request, null);
+            portletPageManager.addContextObject(request, BrowserActionConstants.VELOCITY_FOLDER_DTO, folderDTO);
+            portletPageManager.addContextObject(request, BrowserActionConstants.VELOCITY_PATH_DTO, pathDTO);
+                    
+            
+        }
+        catch (Exception e)
+        {
+            throw new PortletException("Impossible to retrieve a folder ", e);
+        }
+        
+    }
+        
+    /**
+     * Retrieve the folder children 
+     * 
+     * @param actionInfo
+     * @throws PortletException
+     */
+    public void retrieveChildren(PortletActionInfo actionInfo) throws PortletException
+    {
+        try
+        {
+            RenderRequest request = (RenderRequest) actionInfo.getRequest();
+            RenderResponse response = (RenderResponse) actionInfo.getResponse();
+            PortletPageManager portletPageManager = actionInfo.getPortletPageManager();           
+            response.setContentType(BrowserActionConstants.HTML_CONTENT_TYPE);
+                           
+            ContentModelService modelService =  ServiceUtil.getModelService();
+                        
+            
+            String uri = this.getUri(request);
+            
+            // Init the folder DTO
+            FolderDTO folderDTO = (FolderDTO) portletPageManager.getContextObject(request, BrowserActionConstants.VELOCITY_FOLDER_DTO);
+            if (folderDTO == null )
+            {
+               throw new PortletException("FolderDTO is not initialised");
+            }
+                                    
+            folderDTO.setDocuments(modelService.getDocuments(uri));
+            folderDTO.setFolders(modelService.getFolders(uri));            
+            portletPageManager.addContextObject(request, BrowserActionConstants.VELOCITY_FOLDER_DTO, folderDTO);
+            
+        }
+        catch (Exception e)
+        {
+            throw new PortletException("Impossible to retrieve a folder ", e);
+        }
+        
+    }    
+    /**
+     * Instantiate a new folder
+     * 
+     * @param actionInfo
+     * @throws PortletException
+     */
+    public void create(PortletActionInfo actionInfo) throws PortletException
+    {
+        try
+        {
+            RenderRequest request = (RenderRequest) actionInfo.getRequest();
+            RenderResponse response = (RenderResponse) actionInfo.getResponse();
+            PortletPageManager portletPageManager = actionInfo.getPortletPageManager();        
+            response.setContentType(BrowserActionConstants.HTML_CONTENT_TYPE);                      
+
+            ContentModelService modelService =  ServiceUtil.getModelService();
+            ContentServerService serverService =  ServiceUtil.getServerService();            
+            
+            String parentUri = this.getUri(request);
+            Folder parentFolder = modelService.getFolder(parentUri);
+            String scopeServer = UriUtil.getServerScope(parentUri);
+            Folder folder  = modelService.createFolder();
+            folder.setParentFolder(parentFolder);
+
+            // Init the path DTO
+            PathDTO pathDTO =  new PathDTO();
+            pathDTO.setServer(serverService.getServer(scopeServer));
+            pathDTO.setCmsObject(folder);
+            
+            // Init the folder DTO
+            FolderDTO folderDTO = new FolderDTO();
+            folderDTO.setFolder(folder);
+            folderDTO.setParentUri(parentUri);
+            
+            SessionUtil.setOperation(request, BrowserSession.INSERT);
+            portletPageManager.addContextObject(request, BrowserActionConstants.VELOCITY_PATH_DTO, pathDTO);
+            portletPageManager.addContextObject(request, BrowserActionConstants.VELOCITY_FOLDER_DTO, folderDTO);
+            
+        }
+        catch (Exception e)
+        {
+            throw new PortletException("Impossible to create a folder ", e);
+        }
+    }   
+
+    
+    public void save(PortletActionInfo actionInfo) throws PortletException
+    {
+        try
+        {
+            ActionRequest request = (ActionRequest) actionInfo.getRequest();
+            PortletPageManager portletPageManager = actionInfo.getPortletPageManager();
+            
+            ContentModelService modelService =  ServiceUtil.getModelService();
+            BrowserSession browserSession = SessionUtil.getBrowserSession(request);
+            if (browserSession.isInsert())
+            {
+
+                Folder folder = modelService.createFolder();
+                BeanUtil.populate(request, folder);
+                folder.setCreationDate(new Timestamp(System.currentTimeMillis()));
+                folder.setLastModified(new Timestamp(System.currentTimeMillis()));
+                
+                String parentFolderUri = this.getUri(request);
+                folder.setUri(parentFolderUri + "/" + folder.getName());
+                
+                modelService.addFolder(folder);
+
+            }
+            else
+            {
+                Folder folder = modelService.getFolder(this.getUri(request));
+                BeanUtil.populate(request, folder);
+                folder.setLastModified(new Timestamp(System.currentTimeMillis()));
+                modelService.updateFolder(folder);
+            }
+
+            portletPageManager.setSelectedEditPageId(request, "folderEdit");
+            SessionUtil.setOperation(request, null);
+            
+        }
+        catch (ContentManagementException e)
+        {
+            throw new PortletException("Impossible to save a folder ", e);
+        }
+    }
+        
+  
+        
+}

Added: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/ForwardAction.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/ForwardAction.java?rev=178023&view=auto
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/ForwardAction.java (added)
+++ incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/ForwardAction.java Mon May 23 14:04:00 2005
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.portals.graffito.portlets.browser.actions;
+
+
+import javax.portlet.ActionRequest;
+import javax.portlet.PortletException;
+import javax.portlet.PortletMode;
+
+import org.apache.portals.graffito.portlets.browser.session.SessionUtil;
+import org.apache.portals.graffito.portlets.page.action.PortletActionInfo;
+import org.apache.portals.graffito.portlets.page.manager.PortletPageManager;
+
+
+/**
+ *  Portlet Action used to manage the Graffito Folders
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe </a>
+ * @version $Id: Exp $
+ */
+public class ForwardAction extends BrowserAction
+{
+    
+    /**
+     * Forward to another page
+     * 
+     * @param actionInfo
+     * @throws PortletException
+     */
+    public void forward(PortletActionInfo actionInfo) throws PortletException
+    {
+        try
+        {
+            ActionRequest request = (ActionRequest) actionInfo.getRequest();                        
+            PortletPageManager portletPageManager = actionInfo.getPortletPageManager();
+            
+            String forwardToPage = (String) request.getAttribute(PortletPageManager.FORWARD_TO_PAGE);            
+            if (request.getPortletMode().equals(PortletMode.VIEW))
+            {
+                portletPageManager.setSelectedViewPageId(request, forwardToPage);                
+            }
+            
+            if (request.getPortletMode().equals(PortletMode.EDIT))
+            {
+                portletPageManager.setSelectedEditPageId(request, forwardToPage);                
+            }
+            
+            String uri = request.getParameter(BrowserActionConstants.URI);
+            if (uri != null)
+            {
+                SessionUtil.setUri(request, uri);
+            }
+            
+                        
+        }
+        catch (Exception e)
+        {
+            throw new PortletException("Impossible to forward to another page ", e);
+        }
+        
+    }
+        
+    
+}

Added: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/PermissionAction.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/PermissionAction.java?rev=178023&view=auto
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/PermissionAction.java (added)
+++ incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/PermissionAction.java Mon May 23 14:04:00 2005
@@ -0,0 +1,229 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.portals.graffito.portlets.browser.actions;
+
+import java.security.Permission;
+import java.security.Permissions;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.PortletException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+import org.apache.portals.bridges.velocity.GenericVelocityPortlet;
+import org.apache.portals.graffito.ContentModelService;
+import org.apache.portals.graffito.ContentPermissionService;
+import org.apache.portals.graffito.ContentServerService;
+import org.apache.portals.graffito.exception.ContentManagementException;
+import org.apache.portals.graffito.model.CmsObject;
+import org.apache.portals.graffito.model.CmsPermission;
+import org.apache.portals.graffito.portlets.browser.BrowserPortlet;
+import org.apache.portals.graffito.portlets.browser.dto.PathDTO;
+import org.apache.portals.graffito.portlets.browser.dto.PermissionDTO;
+import org.apache.portals.graffito.portlets.browser.dto.PermissionsDTO;
+import org.apache.portals.graffito.portlets.browser.session.BrowserSession;
+import org.apache.portals.graffito.portlets.browser.session.SessionUtil;
+import org.apache.portals.graffito.portlets.page.action.PortletActionInfo;
+import org.apache.portals.graffito.portlets.page.manager.PortletPageManager;
+import org.apache.portals.graffito.portlets.util.ServiceUtil;
+import org.apache.portals.graffito.util.UriUtil;
+import org.apache.velocity.context.Context;
+
+
+
+
+/**
+ *  Portlet Action used to manage the Graffito Folders & documents
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe </a>
+ * @version $Id: Exp $
+ */
+public class PermissionAction extends BrowserAction
+{
+
+    /**
+     * Retrieve all permission assigned to a cms object
+     * @param actionInfo
+     * @throws PortletException
+     */
+    public void retrieve(PortletActionInfo actionInfo) throws PortletException
+    {
+        try
+        {
+            RenderRequest request = (RenderRequest) actionInfo.getRequest();
+            RenderResponse response = (RenderResponse) actionInfo.getResponse();
+            PortletPageManager portletPageManager = actionInfo.getPortletPageManager();
+           
+            response.setContentType(BrowserActionConstants.HTML_CONTENT_TYPE);                     
+            ContentModelService modelService =  ServiceUtil.getModelService();
+            ContentServerService serverService =  ServiceUtil.getServerService();            
+            ContentPermissionService permissionService = ServiceUtil.getPermissionService();
+            
+            String uri = this.getUri(request);
+            String scopeServer = UriUtil.getServerScope(uri);                            
+            CmsObject cmsObject = modelService.getCmsObject(uri);
+            
+            // Init the path DTO
+            PathDTO pathDTO = new PathDTO();
+            pathDTO.setServer(serverService.getServer(scopeServer));
+            pathDTO.setCmsObject(cmsObject);
+                        
+            // Init the permissions DTP
+            Permissions permissions = permissionService.getPermissions(uri);            
+            PermissionsDTO permissionsDTO = new PermissionsDTO();
+            permissionsDTO.setPermissions(permissions);
+            
+            portletPageManager.addContextObject(request, BrowserActionConstants.VELOCITY_PATH_DTO, pathDTO);                       
+            portletPageManager.addContextObject(request, BrowserActionConstants.VELOCITY_PERMISSIONS_DTO, permissionsDTO);
+                    
+            
+        }
+        catch (Exception e)
+        {
+            throw new PortletException("Impossible to retrieve a folder ", e);
+        }
+        
+    }
+    
+    /**
+     * Create/instantiate a new empty permission
+     *  
+     * @param actionInfo The action info 
+     * @throws PortletException when it is not possible to create a new permission
+     */
+    public void create(PortletActionInfo actionInfo) throws PortletException
+    {
+        try
+        {
+
+            RenderRequest request = (RenderRequest) actionInfo.getRequest();
+            RenderResponse response = (RenderResponse) actionInfo.getResponse();
+            PortletPageManager portletPageManager = actionInfo.getPortletPageManager();          
+            response.setContentType(BrowserActionConstants.HTML_CONTENT_TYPE);           
+
+            ContentModelService modelService =  ServiceUtil.getModelService();
+            ContentServerService serverService =  ServiceUtil.getServerService();            
+            ContentPermissionService permissionService = ServiceUtil.getPermissionService();
+            
+            String uri = this.getUri(request);
+            CmsObject cmsObject = modelService.getCmsObject(uri);
+            String scopeServer = UriUtil.getServerScope(uri);
+            
+            // Init the path DTO
+            PathDTO pathDTO = new PathDTO();
+            pathDTO.setServer(serverService.getServer(scopeServer));
+            pathDTO.setCmsObject(cmsObject);
+            
+            // Init the permission DTO
+            CmsPermission cmsPermission = permissionService.createPermission(uri, CmsPermission.ALL);
+            PermissionDTO permissionDTO =  new PermissionDTO();
+            permissionDTO.setPermission((Permission) cmsPermission);
+            SessionUtil.setOperation(request, BrowserSession.INSERT);
+            
+            portletPageManager.addContextObject(request, BrowserActionConstants.VELOCITY_PATH_DTO, pathDTO);            
+            portletPageManager.addContextObject(request, BrowserActionConstants.VELOCITY_PERMISSION_DTO, permissionDTO);
+            
+        }
+        catch (ContentManagementException e)
+        {
+            throw new PortletException("Impossible to create a folder ", e);
+        }
+    }   
+        
+    
+    /**
+     * Save (insert or update a new permission) 
+     * @param actionInfo The action info 
+     * @throws PortletException when it is not possible to save the permission
+     */
+    public void save(PortletActionInfo actionInfo) throws PortletException
+    {
+        try
+        {
+            ActionRequest request = (ActionRequest) actionInfo.getRequest();           
+            PortletPageManager portletPageManager = actionInfo.getPortletPageManager();
+            
+            String permissionName =  request.getParameter("permissionName");            
+            String[] actionValues = request.getParameterValues("actions");
+            String actions = "";
+            for (int i=0; i<actionValues.length; i++)
+            {
+                if (i>0)
+                {
+                    actions += ",";
+                }
+                actions = actions + actionValues[i];
+            }
+            
+            String attributes = request.getParameter("attributes");
+            String principal = request.getParameter("principal");
+            
+            ContentPermissionService permissionService = ServiceUtil.getPermissionService();
+            BrowserSession browserSession = SessionUtil.getBrowserSession(request);
+            if (browserSession.isInsert())
+            {
+                if (attributes != null && ! attributes.equals(""))
+                {
+                    permissionName = permissionName + "/" + attributes;
+                }
+                CmsPermission permission =  permissionService.createPermission(permissionName, actions );
+                permissionService.addPermission((Permission) permission);
+                
+                permissionService.grantPermission(principal, permission);                
+            }
+            portletPageManager.setSelectedEditPageId(request, "folderEdit");
+            SessionUtil.setOperation(request, null);
+
+            
+        }
+        catch (Exception e)
+        {
+            throw new PortletException("Impossible to insert a permission ", e);
+        }
+    }
+
+    /**
+     * Delete a permission
+     *  
+     * @param actionInfo The action info 
+     * @throws PortletException when it is not possible to create a new permission
+     */
+    public void delete(PortletActionInfo actionInfo) throws PortletException
+    {
+        try
+        {
+            ActionRequest request = (ActionRequest) actionInfo.getRequest();
+            PortletPageManager portletPageManager = actionInfo.getPortletPageManager();
+            // The http request contains an array of permissions to delete
+            // each string in this array is structured as 'permissionName_permissionAction'
+            String[] permissionToDelete = request.getParameterValues("selectedPermissions");
+            ContentPermissionService permissionService = ServiceUtil.getPermissionService();
+                        
+            for (int i = 0; i<permissionToDelete.length; i++)
+            {                 
+                String[] permissionDescription = permissionToDelete[i].split("_"); 
+                CmsPermission cmsPermission = permissionService.createPermission(permissionDescription[0], permissionDescription[1]);               
+                permissionService.removePermission((Permission) cmsPermission);                
+            }
+            
+            portletPageManager.setSelectedEditPageId(request, "folderEdit");
+        }
+        catch (Exception e)
+        {
+            throw new PortletException("Impossible to delete a permission", e);
+        }
+    }
+
+}

Added: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/dto/DocumentDTO.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/dto/DocumentDTO.java?rev=178023&view=auto
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/dto/DocumentDTO.java (added)
+++ incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/dto/DocumentDTO.java Mon May 23 14:04:00 2005
@@ -0,0 +1,87 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS"
+ * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
+ */
+package org.apache.portals.graffito.portlets.browser.dto;
+
+import java.util.ArrayList;
+
+import org.apache.portals.graffito.model.Document;
+
+/**
+ * Main information on the current folder object displayed in the Graffito Browser Portlet.
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe </a>
+ * @version $Id: Exp $
+ */
+public class DocumentDTO
+{   
+    private String parentUri;
+    
+    /** Current folder display in the Browser portlet, can be null if it is a server root folder */    
+    private Document document;
+        
+    private ArrayList documentTypes;
+    
+    private ArrayList documentLanguages;
+      
+    
+    /**
+     * Get the uri associated to the cms object display in the Browser
+     * @return The uri
+     */
+    public String getParentUri()
+    {
+        return parentUri;
+    }
+            
+    
+    public Document getDocument()
+    {
+        return document;
+    }
+    public void setDocument(Document document)
+    {
+        this.document = document;
+    }
+    
+    public ArrayList getDocumentLanguages()
+    {
+        return documentLanguages;
+    }
+    public void setDocumentLanguages(ArrayList documentLanguages)
+    {
+        this.documentLanguages = documentLanguages;
+    }
+    public ArrayList getDocumentTypes()
+    {
+        return documentTypes;
+    }
+    public void setDocumentTypes(ArrayList documentTypes)
+    {
+        this.documentTypes = documentTypes;
+    }
+    
+    public boolean isHTML()
+    {
+        return (document.getContentType().equals("text/html"));
+    }
+
+    public boolean isText()
+    {
+        return (document.getContentType().equals("text/plain"));
+    }
+                    
+    public boolean isBinary()
+    {
+        return ((! this.isHTML()) && (! this.isText()) );
+    }    
+}
\ No newline at end of file

Added: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/dto/FolderDTO.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/dto/FolderDTO.java?rev=178023&view=auto
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/dto/FolderDTO.java (added)
+++ incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/dto/FolderDTO.java Mon May 23 14:04:00 2005
@@ -0,0 +1,125 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS"
+ * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
+ */
+package org.apache.portals.graffito.portlets.browser.dto;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+
+import org.apache.portals.graffito.model.Folder;
+import org.apache.portals.graffito.model.Server;
+
+/**
+ * Main information on the current folder object displayed in the Graffito Browser Portlet.
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe </a>
+ * @version $Id: Exp $
+ */
+public class FolderDTO
+{   
+    /** The uri assigned to the parent folder */
+    private String parentUri;
+    
+    /** Current folder display in the Browser portlet, can be null if it is a server root folder */    
+    private Folder folder;
+    
+    /** Document children found in the current folder */ 
+    private Collection documents;
+
+    /** Folder children found in the current folder */
+    private Collection folders;
+    
+   
+    
+    /**
+     * Get the uri associated to the parent folder
+     * @return The uri
+     */
+    public String getParentUri()
+    {
+        return parentUri;
+    }
+    
+    
+    public void setParentUri(String parentUri)
+    {
+        this.parentUri = parentUri;
+    }
+    
+    
+    /**
+     * @return Returns the document children.
+     */
+    public Collection getDocuments()
+    {
+        return documents;
+    }
+
+    /**
+     * @param documents The document children to set.
+     */
+    public void setDocuments(Collection documents)
+    {
+        this.documents = documents;
+    }
+
+    /**
+     * @return Returns the folders children.
+     */
+    public Collection getFolders()
+    {
+        return folders;
+    }
+
+    /**
+     * @param folders The folders to set.
+     */
+    public void setFolders(Collection folders)
+    {
+        this.folders = folders;
+    }
+
+    /**
+     * @return the current folder
+     */
+    public Folder getFolder()
+    {
+        return folder;
+    }
+    
+    /**
+     * @param folder The current folder to set
+     */
+    public void setFolder(Folder folder)
+    {
+        this.folder = folder;
+    }
+    
+        
+    /**
+     * @return true if the Browser is empty, else false
+     */
+    public boolean isEmpty()
+    {
+        if ((((documents == null) || (documents.size() == 0))) &&
+            (((folders == null) || (folders.size() == 0)))) 
+        {
+            return true;
+        }
+        else 
+        {
+            return false;
+        }
+    }
+        
+}
\ No newline at end of file

Added: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/dto/PathDTO.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/dto/PathDTO.java?rev=178023&view=auto
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/dto/PathDTO.java (added)
+++ incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/dto/PathDTO.java Mon May 23 14:04:00 2005
@@ -0,0 +1,104 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS"
+ * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
+ */
+package org.apache.portals.graffito.portlets.browser.dto;
+
+import java.util.ArrayList;
+
+
+import org.apache.portals.graffito.model.CmsObject;
+import org.apache.portals.graffito.model.Folder;
+import org.apache.portals.graffito.model.Server;
+
+/**
+ * This DTO is used to displat the path from the root folder to a selected cms object.
+ * 
+ * @author <a href="mailto:christophe.lombart@gmail.com">Lombart Christophe </a>
+ * @version $Id: Exp $
+ */
+public class PathDTO
+{   
+        
+    /** Current cms object*/    
+    private CmsObject cmsObject ;
+    
+    /** Server object associated to the current folder */
+    private Server server;
+    
+    
+    /**
+     * Get the selected cms object
+     * @return the cms object
+     */
+    public CmsObject getCmsObject()
+    {
+        return cmsObject;
+    }
+    
+    /**
+     * Set the selected cms object
+     * @param cmsObject to set
+     */
+    public void setCmsObject(CmsObject cmsObject)
+    {
+        this.cmsObject = cmsObject;
+    }
+    /**
+     * @return the current server
+     */
+    public Server getServer()
+    {
+        return server;
+    }
+        
+    /**
+     * 
+     * @param server The current server to set
+     */
+    public void setServer(Server server)
+    {
+        this.server = server;
+    }
+    
+    
+    /**
+     * return an array list containing all folders between the root and the selected cms object
+     * 
+     * @return an array of cms object
+     */
+    public ArrayList getPath()
+    {
+        ArrayList cmsPath = new ArrayList();
+        
+        Folder folder = cmsObject.getParentFolder();
+        if (folder != null)
+        {
+            cmsPath.add(folder);
+            Folder parentFolder = folder.getParentFolder();
+            while (parentFolder != null)
+            {
+                cmsPath.add(0, parentFolder);
+                parentFolder = parentFolder.getParentFolder();
+            }
+        }
+        
+        // cmsObject.getName() can be null when creating a new cms object
+        if (cmsObject instanceof Folder && cmsObject.getName() != null)
+        {
+            cmsPath.add(cmsObject);
+        }
+                
+        return cmsPath;
+        
+    }
+                
+}
\ No newline at end of file

Added: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/dto/PermissionDTO.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/dto/PermissionDTO.java?rev=178023&view=auto
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/dto/PermissionDTO.java (added)
+++ incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/dto/PermissionDTO.java Mon May 23 14:04:00 2005
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS"
+ * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
+ */
+package org.apache.portals.graffito.portlets.browser.dto;
+
+import java.security.Permission;
+
+
+/**
+ * Information on one permission.
+ * This is the DTO used between the velocity template and the portlet methods
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe </a>
+ * @version $Id: Exp $
+ */
+public class PermissionDTO
+{   
+    /** Permission assigned to the cms object */
+    private Permission permission;
+    
+    
+    
+    public Permission getPermission()
+    {
+        return permission;
+    }
+    
+    public void setPermission(Permission permission)
+    {
+        this.permission = permission;
+    }
+                
+}
\ No newline at end of file