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 2006/09/20 19:37:21 UTC
svn commit: r448311 [3/25] - in /incubator/graffito/trunk: ./ api/
api/src/java/org/apache/portals/graffito/context/
api/src/java/org/apache/portals/graffito/exception/
api/src/java/org/apache/portals/graffito/services/core/
api/src/java/org/apache/por...
Modified: incubator/graffito/trunk/applications/browser/project.xml
URL: http://svn.apache.org/viewvc/incubator/graffito/trunk/applications/browser/project.xml?view=diff&rev=448311&r1=448310&r2=448311
==============================================================================
--- incubator/graffito/trunk/applications/browser/project.xml (original)
+++ incubator/graffito/trunk/applications/browser/project.xml Wed Sep 20 12:37:05 2006
@@ -1,242 +1,242 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Copyright 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.
-
- $Id: project.xml 189937 2005-06-10 10:51:53Z ate $
--->
-<project>
- <extend>${basedir}/./../../project.xml</extend>
- <pomVersion>3</pomVersion>
- <artifactId>graffito-browser</artifactId>
- <name>Graffito Browser Portlet</name>
- <groupId>org.apache.portals.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>${portlet.api.version}</version>
- <type>jar</type>
- <properties>
- <war.bundle>false</war.bundle>
- </properties>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>${log4j.version}</version>
- <type>jar</type>
- <properties>
- <war.bundle>true</war.bundle>
- </properties>
- </dependency>
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>${commons.logging.version}</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>${commons.beanutils.version}</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>${commons.codec.version}</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>${commons.collections.version}</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>${commons.digester.version}</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>${commons.fileupload.version}</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>${commons.jexl.version}</version>
- <type>jar</type>
- <properties>
- <war.bundle>true</war.bundle>
- </properties>
- </dependency>
- <dependency>
- <groupId>org.apache.portals.graffito</groupId>
- <artifactId>graffito-commons</artifactId>
- <version>${graffito.version}</version>
- <type>jar</type>
- </dependency>
- <dependency>
- <groupId>org.apache.portals.graffito</groupId>
- <artifactId>graffito-api</artifactId>
- <version>${graffito.version}</version>
- <type>jar</type>
- </dependency>
- <dependency>
- <groupId>org.apache.portals.graffito</groupId>
- <artifactId>graffito-framework-portlets</artifactId>
- <version>${graffito.version}</version>
- <type>jar</type>
- <properties>
- <war.bundle>true</war.bundle>
- </properties>
- </dependency>
- <dependency>
- <groupId>servletapi</groupId>
- <artifactId>servletapi</artifactId>
- <version>${servlet.api.version}</version>
- <type>jar</type>
- <properties>
- <war.bundle>false</war.bundle>
- </properties>
- </dependency>
- <dependency>
- <groupId>org.apache.portals.jetspeed-2</groupId>
- <artifactId>jetspeed-api</artifactId>
- <version>${jetspeed.version}</version>
- <type>jar</type>
- <properties>
- <war.bundle>false</war.bundle>
- </properties>
- </dependency>
- <dependency>
- <groupId>org.apache.portals.jetspeed-2</groupId>
- <artifactId>jetspeed-commons</artifactId>
- <version>${jetspeed.version}</version>
- <type>jar</type>
- <properties>
- <war.bundle>false</war.bundle>
- </properties>
- </dependency>
- <dependency>
- <groupId>org.apache.portals.jetspeed-2</groupId>
- <artifactId>jetspeed-components</artifactId>
- <version>${jetspeed.version}</version>
- <type>jar</type>
- <properties>
- <war.bundle>true</war.bundle>
- </properties>
- </dependency>
- <dependency>
- <groupId>org.apache.portals.bridges</groupId>
- <artifactId>portals-bridges-common</artifactId>
- <version>${portals.bridges.common.version}</version>
- <type>jar</type>
- <properties>
- <war.bundle>true</war.bundle>
- </properties>
- </dependency>
- <dependency>
- <groupId>org.apache.portals.bridges</groupId>
- <artifactId>portals-bridges-velocity</artifactId>
- <version>${portals.bridges.velocity.version}</version>
- <type>jar</type>
- <properties>
- <war.bundle>true</war.bundle>
- </properties>
- </dependency>
- <dependency>
- <groupId>velocity</groupId>
- <artifactId>velocity</artifactId>
- <version>${velocity.version}</version>
- <type>jar</type>
- <properties>
- <war.bundle>true</war.bundle>
- </properties>
- </dependency>
- <dependency>
- <groupId>velocity-tools</groupId>
- <artifactId>velocity-tools</artifactId>
- <version>${velocity.tools.version}</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>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright 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.
+
+ $Id: project.xml 189937 2005-06-10 10:51:53Z ate $
+-->
+<project>
+ <extend>${basedir}/./../../project.xml</extend>
+ <pomVersion>3</pomVersion>
+ <artifactId>graffito-browser</artifactId>
+ <name>Graffito Browser Portlet</name>
+ <groupId>org.apache.portals.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>${portlet.api.version}</version>
+ <type>jar</type>
+ <properties>
+ <war.bundle>false</war.bundle>
+ </properties>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>${log4j.version}</version>
+ <type>jar</type>
+ <properties>
+ <war.bundle>true</war.bundle>
+ </properties>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>${commons.logging.version}</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>${commons.beanutils.version}</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>${commons.codec.version}</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>${commons.collections.version}</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>${commons.digester.version}</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>${commons.fileupload.version}</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>${commons.jexl.version}</version>
+ <type>jar</type>
+ <properties>
+ <war.bundle>true</war.bundle>
+ </properties>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.portals.graffito</groupId>
+ <artifactId>graffito-commons</artifactId>
+ <version>${graffito.version}</version>
+ <type>jar</type>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.portals.graffito</groupId>
+ <artifactId>graffito-api</artifactId>
+ <version>${graffito.version}</version>
+ <type>jar</type>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.portals.graffito</groupId>
+ <artifactId>graffito-framework-portlets</artifactId>
+ <version>${graffito.version}</version>
+ <type>jar</type>
+ <properties>
+ <war.bundle>true</war.bundle>
+ </properties>
+ </dependency>
+ <dependency>
+ <groupId>servletapi</groupId>
+ <artifactId>servletapi</artifactId>
+ <version>${servlet.api.version}</version>
+ <type>jar</type>
+ <properties>
+ <war.bundle>false</war.bundle>
+ </properties>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.portals.jetspeed-2</groupId>
+ <artifactId>jetspeed-api</artifactId>
+ <version>${jetspeed.version}</version>
+ <type>jar</type>
+ <properties>
+ <war.bundle>false</war.bundle>
+ </properties>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.portals.jetspeed-2</groupId>
+ <artifactId>jetspeed-commons</artifactId>
+ <version>${jetspeed.version}</version>
+ <type>jar</type>
+ <properties>
+ <war.bundle>false</war.bundle>
+ </properties>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.portals.jetspeed-2</groupId>
+ <artifactId>jetspeed-components</artifactId>
+ <version>${jetspeed.version}</version>
+ <type>jar</type>
+ <properties>
+ <war.bundle>true</war.bundle>
+ </properties>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.portals.bridges</groupId>
+ <artifactId>portals-bridges-common</artifactId>
+ <version>${portals.bridges.common.version}</version>
+ <type>jar</type>
+ <properties>
+ <war.bundle>true</war.bundle>
+ </properties>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.portals.bridges</groupId>
+ <artifactId>portals-bridges-velocity</artifactId>
+ <version>${portals.bridges.velocity.version}</version>
+ <type>jar</type>
+ <properties>
+ <war.bundle>true</war.bundle>
+ </properties>
+ </dependency>
+ <dependency>
+ <groupId>velocity</groupId>
+ <artifactId>velocity</artifactId>
+ <version>${velocity.version}</version>
+ <type>jar</type>
+ <properties>
+ <war.bundle>true</war.bundle>
+ </properties>
+ </dependency>
+ <dependency>
+ <groupId>velocity-tools</groupId>
+ <artifactId>velocity-tools</artifactId>
+ <version>${velocity.tools.version}</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>
+
Propchange: incubator/graffito/trunk/applications/browser/project.xml
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/BrowserPortlet.java
URL: http://svn.apache.org/viewvc/incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/BrowserPortlet.java?view=diff&rev=448311&r1=448310&r2=448311
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/BrowserPortlet.java (original)
+++ incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/BrowserPortlet.java Wed Sep 20 12:37:05 2006
@@ -1,119 +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());
- }
- }
-
-
+/*
+ * 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());
+ }
+ }
+
+
}
Propchange: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/BrowserPortlet.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/BrowserAction.java
URL: http://svn.apache.org/viewvc/incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/BrowserAction.java?view=diff&rev=448311&r1=448310&r2=448311
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/BrowserAction.java (original)
+++ incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/BrowserAction.java Wed Sep 20 12:37:05 2006
@@ -1,56 +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);
- }
-
-
-}
+/*
+ * 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);
+ }
+
+
+}
Propchange: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/BrowserAction.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/BrowserActionConstants.java
URL: http://svn.apache.org/viewvc/incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/BrowserActionConstants.java?view=diff&rev=448311&r1=448310&r2=448311
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/BrowserActionConstants.java (original)
+++ incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/BrowserActionConstants.java Wed Sep 20 12:37:05 2006
@@ -1,58 +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";
-
-
-
-}
+/*
+ * 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";
+
+
+
+}
Propchange: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/BrowserActionConstants.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/CmsObjectAction.java
URL: http://svn.apache.org/viewvc/incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/CmsObjectAction.java?view=diff&rev=448311&r1=448310&r2=448311
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/CmsObjectAction.java (original)
+++ incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/CmsObjectAction.java Wed Sep 20 12:37:05 2006
@@ -1,66 +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.exception.ContentManagementException;
-import org.apache.portals.graffito.portlets.page.action.PortletActionInfo;
-import org.apache.portals.graffito.portlets.util.ServiceUtil;
-import org.apache.portals.graffito.services.core.ContentModelService;
-
-/**
- * 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);
- }
-
- }
-
-}
+/*
+ * 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.exception.ContentManagementException;
+import org.apache.portals.graffito.portlets.page.action.PortletActionInfo;
+import org.apache.portals.graffito.portlets.util.ServiceUtil;
+import org.apache.portals.graffito.services.core.ContentModelService;
+
+/**
+ * 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);
+ }
+
+ }
+
+}
Propchange: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/CmsObjectAction.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/DocumentAction.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/FolderAction.java
URL: http://svn.apache.org/viewvc/incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/FolderAction.java?view=diff&rev=448311&r1=448310&r2=448311
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/FolderAction.java (original)
+++ incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/FolderAction.java Wed Sep 20 12:37:05 2006
@@ -1,225 +1,225 @@
-/*
- * 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.exception.ContentManagementException;
-import org.apache.portals.graffito.model.core.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.services.core.ContentModelService;
-import org.apache.portals.graffito.services.core.ContentServerService;
-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.setContents(modelService.getContents(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.setContents(modelService.getContents(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.setProperty("title", request.getParameter("title"));
- folder.setProperty("description", request.getParameter("description"));
- 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.setProperty("title", request.getParameter("title"));
- folder.setProperty("description", request.getParameter("description"));
-
- 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);
- }
- }
-
-
-
-}
+/*
+ * 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.exception.ContentManagementException;
+import org.apache.portals.graffito.model.core.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.services.core.ContentModelService;
+import org.apache.portals.graffito.services.core.ContentServerService;
+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.setContents(modelService.getContents(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.setContents(modelService.getContents(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.setProperty("title", request.getParameter("title"));
+ folder.setProperty("description", request.getParameter("description"));
+ 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.setProperty("title", request.getParameter("title"));
+ folder.setProperty("description", request.getParameter("description"));
+
+ 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);
+ }
+ }
+
+
+
+}
Propchange: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/FolderAction.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/ForwardAction.java
URL: http://svn.apache.org/viewvc/incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/ForwardAction.java?view=diff&rev=448311&r1=448310&r2=448311
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/ForwardAction.java (original)
+++ incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/ForwardAction.java Wed Sep 20 12:37:05 2006
@@ -1,76 +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);
- }
-
- }
-
-
-}
+/*
+ * 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);
+ }
+
+ }
+
+
+}
Propchange: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/browser/actions/ForwardAction.java
------------------------------------------------------------------------------
svn:eol-style = native