portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shins...@apache.org
Subject svn commit: r499006 [1/2] - in /portals/jetspeed-2/trunk: ./ applications/j2-admin/ applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/ applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/ applications/j2-admin/src/ja...
Date Tue, 23 Jan 2007 12:41:39 GMT
Author: shinsuke
Date: Tue Jan 23 04:41:36 2007
New Revision: 499006

URL: http://svn.apache.org/viewvc?view=rev&rev=499006
Log:
Remote Portlet Application Deployer (https://issues.apache.org/jira/browse/JS2-644)

Added:
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/PortletApplication.java   (with props)
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/RPADConstants.java   (with props)
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/RPADException.java   (with props)
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/Repository.java   (with props)
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/RepositoryConfigHandler.java   (with props)
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/RepositoryManager.java   (with props)
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/RPADPortletFilter.java   (with props)
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/deployer/
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/deployer/PortletDeployer.java   (with props)
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/deployer/impl/
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/deployer/impl/JetspeedPortletDeployer.java   (with props)
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/util/
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/util/FacesMessageUtil.java   (with props)
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/web/
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/web/deployer/
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/web/deployer/DisplayPortletsPage.java   (with props)
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/web/deployer/DisplayRepositoriesPage.java   (with props)
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/web/deployer/EditRepositoryPage.java   (with props)
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/simple/
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/simple/SimpleConfigHandler.java   (with props)
    portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/simple/SimpleRepository.java   (with props)
    portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/rpad-config.xml   (with props)
    portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/view/deployer/
    portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/view/deployer/displayPortlets.jsp   (with props)
    portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/view/deployer/displayRepositories.jsp   (with props)
    portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/view/deployer/editRepository.jsp   (with props)
    portals/jetspeed-2/trunk/design-docs/src/rpad/
    portals/jetspeed-2/trunk/design-docs/src/rpad/RPAD.txt   (with props)
    portals/jetspeed-2/trunk/src/webapp/WEB-INF/pages/Administrative/rpad.psml
Modified:
    portals/jetspeed-2/trunk/.classpath
    portals/jetspeed-2/trunk/applications/j2-admin/pom.xml
    portals/jetspeed-2/trunk/applications/j2-admin/project.xml
    portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/faces-config.xml
    portals/jetspeed-2/trunk/applications/j2-admin/src/webapp/WEB-INF/portlet.xml
    portals/jetspeed-2/trunk/pom.xml
    portals/jetspeed-2/trunk/project.properties
    portals/jetspeed-2/trunk/src/webapp/WEB-INF/pages/Administrative/folder.metadata

Modified: portals/jetspeed-2/trunk/.classpath
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/.classpath?view=diff&rev=499006&r1=499005&r2=499006
==============================================================================
--- portals/jetspeed-2/trunk/.classpath (original)
+++ portals/jetspeed-2/trunk/.classpath Tue Jan 23 04:41:36 2007
@@ -109,6 +109,7 @@
 	<classpathentry kind="var" path="MAVEN_REPO/org.apache.portals.bridges/jars/portals-bridges-frameworks-1.0.1-dev.jar"/>
 	<classpathentry kind="var" path="MAVEN_REPO/org.apache.portals.bridges/jars/portals-bridges-jsf-1.0.jar"/>
 	<classpathentry kind="var" path="MAVEN_REPO/org.apache.portals.bridges/jars/portals-bridges-velocity-1.0.1-dev.jar"/>
+	<classpathentry kind="var" path="MAVEN_REPO/org.apache.portals.bridges/jars/portals-bridges-portletfilter-1.0.1-dev.jar"/>
 	<classpathentry kind="var" path="MAVEN_REPO/activation/jars/activation-1.0.2.jar"/>
 	<classpathentry kind="var" path="MAVEN_REPO/javamail/jars/javamail-1.3.3.jar"/>
 	<classpathentry kind="var" path="MAVEN_REPO/taglibs/jars/random-1.0.2.jar"/>

Modified: portals/jetspeed-2/trunk/applications/j2-admin/pom.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/j2-admin/pom.xml?view=diff&rev=499006&r1=499005&r2=499006
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/pom.xml (original)
+++ portals/jetspeed-2/trunk/applications/j2-admin/pom.xml Tue Jan 23 04:41:36 2007
@@ -70,6 +70,10 @@
             <artifactId>portals-bridges-jsf</artifactId>
         </dependency>
         <dependency>
+            <groupId>org.apache.portals.bridges</groupId>
+            <artifactId>portals-bridges-portletfilter</artifactId>
+        </dependency>
+        <dependency>
             <groupId>${pom.groupId}</groupId>
             <artifactId>jetspeed2-taglib-treecontrol</artifactId>
         </dependency>

Modified: portals/jetspeed-2/trunk/applications/j2-admin/project.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/j2-admin/project.xml?view=diff&rev=499006&r1=499005&r2=499006
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/project.xml (original)
+++ portals/jetspeed-2/trunk/applications/j2-admin/project.xml Tue Jan 23 04:41:36 2007
@@ -138,6 +138,13 @@
             <war.bundle>true</war.bundle>
         </properties>
     </dependency>
+    <dependency>
+        <id>org.apache.portals.bridges:portals-bridges-portletfilter</id>
+        <version>${portals.bridges.portletfilter.version}</version>
+        <properties>
+            <war.bundle>true</war.bundle>
+        </properties>
+    </dependency>
     
     <!-- Servlets, JSTL -->      
     <dependency>

Added: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/PortletApplication.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/PortletApplication.java?view=auto&rev=499006
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/PortletApplication.java (added)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/PortletApplication.java Tue Jan 23 04:41:36 2007
@@ -0,0 +1,366 @@
+/*
+ * Copyright 2007 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.jetspeed.portlets.rpad;
+
+import java.sql.Date;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+
+public class PortletApplication
+{
+    private Date created = null;
+
+    private Date lastModified = null;
+
+    private String portletSpecVersion = null;
+
+    private String groupId = null;
+
+    private String artifactId = null;
+
+    private String packaging = null;
+
+    private String version = null;
+
+    private String name = null;
+
+    private String description = null;
+
+    private List categories = new ArrayList();
+
+    private String publisherName = null;
+
+    private String publisherUrl = null;
+
+    private String binaryUrl = null;
+
+    private String sourceUrl = null;
+
+    private String thumbnailUrl = null;
+
+    //TODO
+    //    private Map dependencies;
+
+    //TODO
+    //   private List licenses = new ArrayList();
+
+    private String javaBuildVersion = null;
+
+    private String javaRuntimeVersion = null;
+
+    private Locale defaultLocale = Locale.ENGLISH;
+
+    private List supportedLocales = new ArrayList();
+
+    public PortletApplication()
+    {
+
+    }
+
+    public void addCategory(String category)
+    {
+        categories.add(category);
+    }
+
+    public List getCategories()
+    {
+        return categories;
+    }
+
+    public void addSupportedLocale(Locale locale)
+    {
+        supportedLocales.add(locale);
+    }
+
+    public List getSupportedLocales()
+    {
+        return supportedLocales;
+    }
+
+    /**
+     * @return the artifactId
+     */
+    public String getArtifactId()
+    {
+        return artifactId;
+    }
+
+    /**
+     * @param artifactId the artifactId to set
+     */
+    public void setArtifactId(String artifactId)
+    {
+        this.artifactId = artifactId;
+    }
+
+    /**
+     * @return the binaryUrl
+     */
+    public String getBinaryUrl()
+    {
+        return binaryUrl;
+    }
+
+    /**
+     * @param binaryUrl the binaryUrl to set
+     */
+    public void setBinaryUrl(String binaryUrl)
+    {
+        this.binaryUrl = binaryUrl;
+    }
+
+    /**
+     * @return the created
+     */
+    public Date getCreated()
+    {
+        return created;
+    }
+
+    /**
+     * @param created the created to set
+     */
+    public void setCreated(Date created)
+    {
+        this.created = created;
+    }
+
+    /**
+     * @return the defaultLocale
+     */
+    public Locale getDefaultLocale()
+    {
+        return defaultLocale;
+    }
+
+    /**
+     * @param defaultLocale the defaultLocale to set
+     */
+    public void setDefaultLocale(Locale defaultLocale)
+    {
+        this.defaultLocale = defaultLocale;
+    }
+
+    /**
+     * @return the description
+     */
+    public String getDescription()
+    {
+        return description;
+    }
+
+    /**
+     * @param description the description to set
+     */
+    public void setDescription(String description)
+    {
+        this.description = description;
+    }
+
+    /**
+     * @return the groupId
+     */
+    public String getGroupId()
+    {
+        return groupId;
+    }
+
+    /**
+     * @param groupId the groupId to set
+     */
+    public void setGroupId(String groupId)
+    {
+        this.groupId = groupId;
+    }
+
+    /**
+     * @return the javaBuildVersion
+     */
+    public String getJavaBuildVersion()
+    {
+        return javaBuildVersion;
+    }
+
+    /**
+     * @param javaBuildVersion the javaBuildVersion to set
+     */
+    public void setJavaBuildVersion(String javaBuildVersion)
+    {
+        this.javaBuildVersion = javaBuildVersion;
+    }
+
+    /**
+     * @return the javaRuntimeVersion
+     */
+    public String getJavaRuntimeVersion()
+    {
+        return javaRuntimeVersion;
+    }
+
+    /**
+     * @param javaRuntimeVersion the javaRuntimeVersion to set
+     */
+    public void setJavaRuntimeVersion(String javaRuntimeVersion)
+    {
+        this.javaRuntimeVersion = javaRuntimeVersion;
+    }
+
+    /**
+     * @return the lastModified
+     */
+    public Date getLastModified()
+    {
+        return lastModified;
+    }
+
+    /**
+     * @param lastModified the lastModified to set
+     */
+    public void setLastModified(Date lastModified)
+    {
+        this.lastModified = lastModified;
+    }
+
+    /**
+     * @return the namme
+     */
+    public String getName()
+    {
+        return name;
+    }
+
+    /**
+     * @param namme the namme to set
+     */
+    public void setName(String namme)
+    {
+        this.name = namme;
+    }
+
+    /**
+     * @return the packaging
+     */
+    public String getPackaging()
+    {
+        return packaging;
+    }
+
+    /**
+     * @param packaging the packaging to set
+     */
+    public void setPackaging(String packaging)
+    {
+        this.packaging = packaging;
+    }
+
+    /**
+     * @return the portletSpecVersion
+     */
+    public String getPortletSpecVersion()
+    {
+        return portletSpecVersion;
+    }
+
+    /**
+     * @param portletSpecVersion the portletSpecVersion to set
+     */
+    public void setPortletSpecVersion(String portletSpecVersion)
+    {
+        this.portletSpecVersion = portletSpecVersion;
+    }
+
+    /**
+     * @return the publisherName
+     */
+    public String getPublisherName()
+    {
+        return publisherName;
+    }
+
+    /**
+     * @param publisherName the publisherName to set
+     */
+    public void setPublisherName(String publisherName)
+    {
+        this.publisherName = publisherName;
+    }
+
+    /**
+     * @return the publisherUrl
+     */
+    public String getPublisherUrl()
+    {
+        return publisherUrl;
+    }
+
+    /**
+     * @param publisherUrl the publisherUrl to set
+     */
+    public void setPublisherUrl(String publisherUrl)
+    {
+        this.publisherUrl = publisherUrl;
+    }
+
+    /**
+     * @return the sourceUrl
+     */
+    public String getSourceUrl()
+    {
+        return sourceUrl;
+    }
+
+    /**
+     * @param sourceUrl the sourceUrl to set
+     */
+    public void setSourceUrl(String sourceUrl)
+    {
+        this.sourceUrl = sourceUrl;
+    }
+
+    /**
+     * @return the thumbnailUrl
+     */
+    public String getThumbnailUrl()
+    {
+        return thumbnailUrl;
+    }
+
+    /**
+     * @param thumbnailUrl the thumbnailUrl to set
+     */
+    public void setThumbnailUrl(String thumbnailUrl)
+    {
+        this.thumbnailUrl = thumbnailUrl;
+    }
+
+    /**
+     * @return the version
+     */
+    public String getVersion()
+    {
+        return version;
+    }
+
+    /**
+     * @param version the version to set
+     */
+    public void setVersion(String version)
+    {
+        this.version = version;
+    }
+
+}

Propchange: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/PortletApplication.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/RPADConstants.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/RPADConstants.java?view=auto&rev=499006
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/RPADConstants.java (added)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/RPADConstants.java Tue Jan 23 04:41:36 2007
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2007 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.jetspeed.portlets.rpad;
+
+public class RPADConstants
+{
+
+    public final static String REPOSITORY_MANAGER = "org.apache.jetspeed.portlets.rpad.RepositoryManager";
+
+    public final static String REPOSITORY = "org.apache.jetspeed.portlets.rpad.Repository";
+
+}

Propchange: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/RPADConstants.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/RPADException.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/RPADException.java?view=auto&rev=499006
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/RPADException.java (added)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/RPADException.java Tue Jan 23 04:41:36 2007
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2007 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.jetspeed.portlets.rpad;
+
+public class RPADException extends Exception
+{
+
+    public RPADException()
+    {
+        super();
+    }
+
+    public RPADException(String message)
+    {
+        super(message);
+    }
+
+    public RPADException(String message, Throwable cause)
+    {
+        super(message, cause);
+    }
+
+    public RPADException(Throwable cause)
+    {
+        super(cause);
+    }
+}

Propchange: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/RPADException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/Repository.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/Repository.java?view=auto&rev=499006
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/Repository.java (added)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/Repository.java Tue Jan 23 04:41:36 2007
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2007 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.jetspeed.portlets.rpad;
+
+import java.util.List;
+
+public interface Repository
+{
+    public void init();
+
+    public String getName();
+
+    public void setAvailable(boolean b);
+
+    public boolean isAvailable();
+
+    public PortletApplication getPortletApplication(String groupId,
+            String artifactId, String version, String packaging);
+
+    public List getPortletApplications();
+
+    public String toXMLString();
+}

Propchange: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/Repository.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/RepositoryConfigHandler.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/RepositoryConfigHandler.java?view=auto&rev=499006
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/RepositoryConfigHandler.java (added)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/RepositoryConfigHandler.java Tue Jan 23 04:41:36 2007
@@ -0,0 +1,206 @@
+/*
+ * Copyright 2007 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.jetspeed.portlets.rpad;
+
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Locale;
+import java.util.Map;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+public class RepositoryConfigHandler extends DefaultHandler
+{
+    /**
+     * Logger for this class
+     */
+    private static final Log log = LogFactory
+            .getLog(RepositoryConfigHandler.class);
+
+    private String className;
+
+    private String propertyName;
+
+    private String repositoryName;
+
+    private Map properties;
+
+    //TODO
+    //    private String typeName;
+    //    private Map types;
+
+    private String currentQName;
+
+    private Map repositories;
+
+    public RepositoryConfigHandler()
+    {
+        className = null;
+        propertyName = null;
+        properties = new HashMap();
+        currentQName = null;
+        repositories = new HashMap();
+    }
+
+    protected Repository loadRepository(String className, Map properties)
+    {
+        try
+        {
+            Class cls = Class.forName(className);
+            Object obj = cls.newInstance();
+            if (obj instanceof Repository)
+            {
+                Repository repo = (Repository) obj;
+                for (Iterator i = properties.entrySet().iterator(); i.hasNext();)
+                {
+                    try
+                    {
+                        Map.Entry entry = (Map.Entry) i.next();
+                        String propertyName = (String) entry.getKey();
+                        Class[] clsArgs = new Class[1];
+                        //TODO set type
+                        clsArgs[0] = String.class;
+                        Method method = cls.getMethod("set"
+                                + propertyName.substring(0, 1).toUpperCase(
+                                        Locale.ENGLISH)
+                                + propertyName.substring(1), clsArgs);
+                        Object[] args = new Object[1];
+                        args[0] = entry.getValue();
+                        method.invoke(repo, args);
+                    }
+                    catch (Exception e)
+                    {
+                        log.error("Could invoke a method for property: "
+                                + propertyName, e);
+                    }
+                }
+
+                try
+                {
+                    // call init()
+                    Method initMethod = cls.getMethod("init", null);
+                    initMethod.invoke(repo, null);
+                }
+                catch (Exception e)
+                {
+                    log.error("Could not initialize an instance: " + className,
+                            e);
+                    repo.setAvailable(false);
+                }
+
+                return repo;
+            }
+        }
+        catch (Exception e)
+        {
+            log.error("Could not create an instance: " + className, e);
+        }
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.xml.sax.helpers.DefaultHandler#endElement(java.lang.String, java.lang.String, java.lang.String)
+     */
+    public void endElement(String uri, String localName, String qName)
+            throws SAXException
+    {
+        if ("repository".equals(qName))
+        {
+            if (className != null && repositoryName != null
+                    && !repositories.equals(""))
+            {
+                Repository repo = loadRepository(className, properties);
+                if (repo != null)
+                {
+                    repositories.put(repositoryName, repo);
+                }
+                else
+                {
+                    log.warn("Could not load " + className);
+                }
+            }
+            else
+            {
+                log.warn("The class name or repository name are null.");
+            }
+        }
+
+        if (currentQName != null && currentQName.equals(qName))
+        {
+            currentQName = null;
+        }
+    }
+
+    /* (non-Javadoc)
+     * @see org.xml.sax.helpers.DefaultHandler#startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
+     */
+    public void startElement(String uri, String localName, String qName,
+            Attributes attributes) throws SAXException
+    {
+        currentQName = qName;
+
+        if ("repository".equals(qName))
+        {
+            className = null;
+            propertyName = null;
+            properties = new HashMap();
+        }
+        else if ("class".equals(qName))
+        {
+            className = attributes.getValue("name");
+        }
+        else if ("property".equals(qName))
+        {
+            propertyName = attributes.getValue("name");
+        }
+    }
+
+    /* (non-Javadoc)
+     * @see org.xml.sax.helpers.DefaultHandler#characters(char[], int, int)
+     */
+    public void characters(char[] ch, int start, int length)
+            throws SAXException
+    {
+
+        if ("property".equals(currentQName))
+        {
+            if (propertyName != null)
+            {
+                properties.put(propertyName, new String(ch, start, length));
+            }
+            propertyName = null;
+        }
+        else if ("name".equals(currentQName))
+        {
+            repositoryName = new String(ch, start, length);
+            properties.put("name", repositoryName);
+        }
+    }
+
+    /**
+     * @return the repositories
+     */
+    public Map getRepositories()
+    {
+        return repositories;
+    }
+
+}

Propchange: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/RepositoryConfigHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/RepositoryManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/RepositoryManager.java?view=auto&rev=499006
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/RepositoryManager.java (added)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/RepositoryManager.java Tue Jan 23 04:41:36 2007
@@ -0,0 +1,237 @@
+/*
+ * Copyright 2007 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.jetspeed.portlets.rpad;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.xml.sax.SAXException;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.io.UnsupportedEncodingException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+public class RepositoryManager
+{
+    /**
+     * Logger for this class
+     */
+    private static final Log log = LogFactory.getLog(RepositoryManager.class);
+
+    private String configFileName;
+
+    private Map repositories;
+
+    private static RepositoryManager repositoryManager;
+
+    public static void init(String configFileName) throws RPADException
+    {
+        repositoryManager = new RepositoryManager(configFileName);
+    }
+
+    public static RepositoryManager getInstance()
+    {
+        if (repositoryManager == null)
+        {
+            throw new IllegalStateException(
+                    "init() needs to be called before getInstance().");
+        }
+        return repositoryManager;
+    }
+
+    public RepositoryManager(String configFileName) throws RPADException
+    {
+        this.configFileName = configFileName;
+        load();
+    }
+
+    protected void load() throws RPADException
+    {
+        try
+        {
+            SAXParserFactory spfactory = SAXParserFactory.newInstance();
+            SAXParser parser = spfactory.newSAXParser();
+            RepositoryConfigHandler repoConfigHandler = new RepositoryConfigHandler();
+            parser.parse(new File(configFileName), repoConfigHandler);
+            repositories = repoConfigHandler.getRepositories();
+        }
+        catch (ParserConfigurationException e)
+        {
+            throw new RPADException("Could not configure a parser.", e);
+        }
+        catch (SAXException e)
+        {
+            throw new RPADException("An exception occurrs on SAX parser.", e);
+        }
+        catch (IOException e)
+        {
+            throw new RPADException(
+                    "An exception occurrs when accessing a configuration file: "
+                            + configFileName, e);
+        }
+    }
+
+    public void reload() throws RPADException
+    {
+        synchronized (repositories)
+        {
+            load();
+        }
+    }
+
+    public void addRepository(String name, Repository repository)
+            throws RPADException
+    {
+        synchronized (repositories)
+        {
+            if (repositories.containsKey(name))
+            {
+                throw new RPADException(name + "exists.");
+            }
+            repositories.put(name, repository);
+            store();
+        }
+    }
+
+    public Repository getRepository(String name)
+    {
+        return (Repository) repositories.get(name);
+    }
+
+    public void removeRepository(String name) throws RPADException
+    {
+        synchronized (repositories)
+        {
+            if (!repositories.containsKey(name))
+            {
+                throw new RPADException(name + "does not exist.");
+            }
+            repositories.remove(name);
+            store();
+        }
+    }
+
+    public List getRepositories()
+    {
+        return new ArrayList(repositories.values());
+    }
+
+    public void store() throws RPADException
+    {
+        synchronized (repositories)
+        {
+            BufferedWriter writer = null;
+            try
+            {
+                try
+                {
+                    writer = new BufferedWriter(new OutputStreamWriter(
+                            new FileOutputStream(configFileName), "UTF-8"));
+                }
+                catch (UnsupportedEncodingException e)
+                {
+                    writer = new BufferedWriter(new OutputStreamWriter(
+                            new FileOutputStream(configFileName)));
+                }
+                writer.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
+                writer.write("<repositories>\n");
+                for (Iterator i = repositories.entrySet().iterator(); i
+                        .hasNext();)
+                {
+                    Map.Entry entry = (Map.Entry) i.next();
+                    if (log.isDebugEnabled())
+                    {
+                        log.debug("Storing a repository: " + entry.getKey());
+                    }
+
+                    Repository repo = (Repository) entry.getValue();
+                    writer.write(repo.toXMLString());
+                }
+                writer.write("</repositories>\n");
+                writer.flush();
+            }
+            catch (FileNotFoundException e)
+            {
+                throw new RPADException("Could not find " + configFileName, e);
+            }
+            catch (IOException e)
+            {
+                throw new RPADException("Could not write " + configFileName, e);
+            }
+            finally
+            {
+                if (writer != null)
+                {
+                    try
+                    {
+                        writer.close();
+                    }
+                    catch (IOException e)
+                    {
+                    }
+                }
+            }
+        }
+    }
+
+    public List getPortletApplications()
+    {
+        ArrayList list = new ArrayList();
+        for (Iterator i = repositories.entrySet().iterator(); i.hasNext();)
+        {
+            Map.Entry entry = (Map.Entry) i.next();
+            Repository repo = (Repository) entry.getValue();
+            if (repo.isAvailable())
+            {
+                List portlets = repo.getPortletApplications();
+                if (portlets != null)
+                {
+                    list.addAll(portlets);
+                }
+            }
+        }
+        return list;
+    }
+
+    public List getPortletApplications(String name)
+    {
+        ArrayList list = new ArrayList();
+
+        Repository repo = getRepository(name);
+        if (repo != null && repo.isAvailable())
+        {
+            List portlets = repo.getPortletApplications();
+            if (portlets != null)
+            {
+                list.addAll(portlets);
+            }
+        }
+        return list;
+    }
+
+    //TODO search
+}

Propchange: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/RepositoryManager.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/RPADPortletFilter.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/RPADPortletFilter.java?view=auto&rev=499006
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/RPADPortletFilter.java (added)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/RPADPortletFilter.java Tue Jan 23 04:41:36 2007
@@ -0,0 +1,107 @@
+/*
+ * Copyright 2007 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.jetspeed.portlets.rpad.portlet;
+
+import java.io.IOException;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletContext;
+import javax.portlet.PortletException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jetspeed.portlets.rpad.RPADException;
+import org.apache.jetspeed.portlets.rpad.RepositoryManager;
+import org.apache.portals.bridges.portletfilter.PortletFilter;
+import org.apache.portals.bridges.portletfilter.PortletFilterChain;
+import org.apache.portals.bridges.portletfilter.PortletFilterConfig;
+
+public class RPADPortletFilter implements PortletFilter
+{
+    /**
+     * Logger for this class
+     */
+    private static final Log log = LogFactory.getLog(RPADPortletFilter.class);
+
+    protected final static String CONFIG_FILE = "config-file";
+
+    protected final static String DEFAULT_CONFIG_FILE = "/WEB-INF/rpad-config.xml";
+
+    protected final static String WEBAPP_ROOT_PREFIX = "${webapp}";
+
+    public void destroy()
+    {
+        try
+        {
+            RepositoryManager.getInstance().store();
+        }
+        catch (RPADException e)
+        {
+            log.error("Could not store the configuration.", e);
+        }
+    }
+
+    public void init(PortletFilterConfig filterConfig) throws PortletException
+    {
+        PortletConfig portletConfig = filterConfig.getPortletConfig();
+        PortletContext portletContext = portletConfig.getPortletContext();
+        String configFile = portletConfig.getInitParameter(CONFIG_FILE);
+        if (configFile == null)
+        {
+            configFile = portletContext.getRealPath(DEFAULT_CONFIG_FILE);
+        }
+        else if (configFile.startsWith(WEBAPP_ROOT_PREFIX))
+        {
+            configFile = portletContext.getRealPath(configFile
+                    .substring(WEBAPP_ROOT_PREFIX.length()));
+        }
+
+        if (log.isDebugEnabled())
+        {
+            log.debug("init(PortletConfig) - configFile=" + configFile);
+        }
+
+        // Create RepositoryManager
+        try
+        {
+            RepositoryManager.init(configFile);
+        }
+        catch (Exception e)
+        {
+            throw new PortletException(
+                    "Could not create RepositoryManager. The config file is "
+                            + configFile, e);
+        }
+    }
+
+    public void processActionFilter(ActionRequest request,
+            ActionResponse response, PortletFilterChain chain)
+            throws PortletException, IOException
+    {
+        chain.processActionFilter(request, response);
+    }
+
+    public void renderFilter(RenderRequest request, RenderResponse response,
+            PortletFilterChain chain) throws PortletException, IOException
+    {
+        chain.renderFilter(request, response);
+    }
+
+}

Propchange: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/RPADPortletFilter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/deployer/PortletDeployer.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/deployer/PortletDeployer.java?view=auto&rev=499006
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/deployer/PortletDeployer.java (added)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/deployer/PortletDeployer.java Tue Jan 23 04:41:36 2007
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2007 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.jetspeed.portlets.rpad.portlet.deployer;
+
+import org.apache.jetspeed.portlets.rpad.PortletApplication;
+
+public interface PortletDeployer
+{
+    public static final int READY = 0;
+
+    public static final int DEPLOYING = 1;
+
+    public int getStatus();
+
+    public void deploy(PortletApplication portlet);
+}

Propchange: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/deployer/PortletDeployer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/deployer/impl/JetspeedPortletDeployer.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/deployer/impl/JetspeedPortletDeployer.java?view=auto&rev=499006
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/deployer/impl/JetspeedPortletDeployer.java (added)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/deployer/impl/JetspeedPortletDeployer.java Tue Jan 23 04:41:36 2007
@@ -0,0 +1,297 @@
+/*
+ * Copyright 2007 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.jetspeed.portlets.rpad.portlet.deployer.impl;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Calendar;
+
+import javax.faces.context.FacesContext;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jetspeed.CommonPortletServices;
+import org.apache.jetspeed.deployment.DeploymentException;
+import org.apache.jetspeed.deployment.DeploymentManager;
+import org.apache.jetspeed.deployment.DeploymentStatus;
+import org.apache.jetspeed.portlets.rpad.PortletApplication;
+import org.apache.jetspeed.portlets.rpad.portlet.deployer.PortletDeployer;
+import org.apache.jetspeed.portlets.rpad.portlet.util.FacesMessageUtil;
+
+public class JetspeedPortletDeployer implements PortletDeployer
+{
+    /**
+     * Logger for this class
+     */
+    private static final Log log = LogFactory
+            .getLog(JetspeedPortletDeployer.class);
+
+    private int status;
+
+    private long startTime = 0;
+
+    public JetspeedPortletDeployer()
+    {
+        status = READY;
+    }
+
+    public int getStatus()
+    {
+        return status;
+    }
+
+    synchronized public void deploy(PortletApplication portlet)
+    {
+        if (status != READY)
+        {
+            //TODO check timeout
+
+            //TODO i18n
+            FacesMessageUtil
+                    .addWarnMessage("Other deployment process is running.");
+            return;
+        }
+        DeployerThread deployer = new DeployerThread();
+        deployer.setDeploymentManager((DeploymentManager) FacesContext
+                .getCurrentInstance().getExternalContext().getApplicationMap()
+                .get(CommonPortletServices.CPS_DEPLOYMENT_MANAGER_COMPONENT));
+        deployer.setPortletApplication(portlet);
+        try
+        {
+            deployer.start();
+            //TODO i18n
+            FacesMessageUtil.addInfoMessage("Started a deployment process.");
+        }
+        catch (Exception e)
+        {
+            //TODO i18n
+            FacesMessageUtil
+                    .addErrorMessage("Could not start deployment process.");
+            log.error("Could not start deployment process.", e);
+        }
+    }
+
+    public class DeployerThread extends Thread
+    {
+        private DeploymentManager deploymentManager;
+
+        private PortletApplication portletApplication;
+
+        /* (non-Javadoc)
+         * @see java.lang.Thread#run()
+         */
+        public void run()
+        {
+            status = DEPLOYING;
+            try
+            {
+                startTime = Calendar.getInstance().getTimeInMillis();
+                if (getDeploymentManager() != null)
+                {
+                    String binaryUrl = portletApplication.getBinaryUrl();
+                    if (binaryUrl != null && !binaryUrl.equals(""))
+                    {
+                        File targetFile = null;
+                        try
+                        {
+                            File tempFile = File.createTempFile("rpad_", "."
+                                    + portletApplication.getPackaging());
+                            FileOutputStream out = new FileOutputStream(
+                                    tempFile);
+                            drain(getInputStream(portletApplication
+                                    .getBinaryUrl()), out);
+                            try
+                            {
+                                targetFile = new File(tempFile.getParentFile(),
+                                        portletApplication.getArtifactId()
+                                                + "."
+                                                + portletApplication
+                                                        .getPackaging());
+                                tempFile.renameTo(targetFile);
+                            }
+                            catch (Exception e)
+                            {
+                                targetFile = tempFile;
+                            }
+                            if (getDeploymentManager().deploy(targetFile)
+                                    .getStatus() == DeploymentStatus.STATUS_OKAY)
+                            {
+                                log.info(portletApplication.getName()
+                                        + " was deployed.");
+                            }
+                            else
+                            {
+                                log.error("Could not deploy "
+                                        + portletApplication.getName());
+                            }
+                        }
+                        catch (FileNotFoundException e)
+                        {
+                            log.error(e);
+                        }
+                        catch (IOException e)
+                        {
+                            log.error(e);
+                        }
+                        catch (DeploymentException e)
+                        {
+                            log.error(e);
+                        }
+                        if (targetFile != null && targetFile.exists())
+                        {
+                            targetFile.delete();
+                        }
+                    }
+                    else
+                    {
+                        log.error("The target url is invalid. The path is "
+                                + binaryUrl);
+                    }
+                }
+                else
+                {
+                    log.error("Could not find the deployment manager.");
+                }
+            }
+            catch (Exception e)
+            {
+                log.error("Unexpected exception.", e);
+            }
+            finally
+            {
+                status = READY;
+            }
+        }
+
+        /**
+         * @return the portletApplication
+         */
+        public PortletApplication getPortletApplication()
+        {
+            return portletApplication;
+        }
+
+        /**
+         * @param portletApplication the portletApplication to set
+         */
+        public void setPortletApplication(PortletApplication portletApplication)
+        {
+            this.portletApplication = portletApplication;
+        }
+
+        /**
+         * @return the startTime
+         */
+        public long getStartTime()
+        {
+            return startTime;
+        }
+
+        /**
+         * @return the deploymentManager
+         */
+        public DeploymentManager getDeploymentManager()
+        {
+            return deploymentManager;
+        }
+
+        /**
+         * @param deploymentManager the deploymentManager to set
+         */
+        public void setDeploymentManager(DeploymentManager deploymentManager)
+        {
+            this.deploymentManager = deploymentManager;
+        }
+
+    }
+
+    protected void drain(InputStream in, OutputStream out) throws IOException
+    {
+        try
+        {
+            byte[] buf = new byte[8192];
+            int len = in.read(buf);
+
+            while (len != -1)
+            {
+                out.write(buf, 0, len);
+                len = in.read(buf);
+            }
+            out.flush();
+        }
+        catch (IOException e)
+        {
+            throw e;
+        }
+        finally
+        {
+            try
+            {
+                out.close();
+            }
+            catch (IOException e)
+            {
+            }
+            try
+            {
+                in.close();
+            }
+            catch (IOException e)
+            {
+            }
+        }
+    }
+
+    protected InputStream getInputStream(String path)
+    {
+        if (path.startsWith("http:") || path.startsWith("https:"))
+        {
+            try
+            {
+                URL url = new URL(path);
+                return url.openStream();
+            }
+            catch (MalformedURLException e)
+            {
+                log.error("Wrong url: " + path, e);
+            }
+            catch (IOException e)
+            {
+                log.error("Could not load " + path, e);
+            }
+        }
+        else if (path.startsWith("file:"))
+        {
+            try
+            {
+                return new FileInputStream(new File(path.substring(5)));
+            }
+            catch (FileNotFoundException e)
+            {
+                log.error("Could not load " + path, e);
+            }
+        }
+        return null;
+    }
+
+}

Propchange: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/deployer/impl/JetspeedPortletDeployer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/util/FacesMessageUtil.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/util/FacesMessageUtil.java?view=auto&rev=499006
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/util/FacesMessageUtil.java (added)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/util/FacesMessageUtil.java Tue Jan 23 04:41:36 2007
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2007 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.jetspeed.portlets.rpad.portlet.util;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+
+public class FacesMessageUtil
+{
+    public static void addMessage(FacesMessage.Severity severity,
+            java.lang.String summary, java.lang.String detail)
+    {
+        FacesMessage facesMessage = new FacesMessage(severity, summary, detail);
+        FacesContext.getCurrentInstance().addMessage(null, facesMessage);
+    }
+
+    public static void addErrorMessage(java.lang.String summary, Throwable t)
+    {
+        addMessage(FacesMessage.SEVERITY_ERROR, summary, t.getMessage());
+    }
+
+    public static void addErrorMessage(java.lang.String summary,
+            java.lang.String detail)
+    {
+        addMessage(FacesMessage.SEVERITY_ERROR, summary, detail);
+    }
+
+    public static void addErrorMessage(java.lang.String summary)
+    {
+        addMessage(FacesMessage.SEVERITY_ERROR, summary, null);
+    }
+
+    public static void addFatalMessage(java.lang.String summary, Throwable t)
+    {
+        addMessage(FacesMessage.SEVERITY_FATAL, summary, t.getMessage());
+    }
+
+    public static void addFatalMessage(java.lang.String summary,
+            java.lang.String detail)
+    {
+        addMessage(FacesMessage.SEVERITY_FATAL, summary, detail);
+    }
+
+    public static void addFatalMessage(java.lang.String summary)
+    {
+        addMessage(FacesMessage.SEVERITY_FATAL, summary, null);
+    }
+
+    public static void addInfoMessage(java.lang.String summary, Throwable t)
+    {
+        addMessage(FacesMessage.SEVERITY_INFO, summary, t.getMessage());
+    }
+
+    public static void addInfoMessage(java.lang.String summary,
+            java.lang.String detail)
+    {
+        addMessage(FacesMessage.SEVERITY_INFO, summary, detail);
+    }
+
+    public static void addInfoMessage(java.lang.String summary)
+    {
+        addMessage(FacesMessage.SEVERITY_INFO, summary, null);
+    }
+
+    public static void addWarnMessage(java.lang.String summary, Throwable t)
+    {
+        addMessage(FacesMessage.SEVERITY_WARN, summary, t.getMessage());
+    }
+
+    public static void addWarnMessage(java.lang.String summary,
+            java.lang.String detail)
+    {
+        addMessage(FacesMessage.SEVERITY_WARN, summary, detail);
+    }
+
+    public static void addWarnMessage(java.lang.String summary)
+    {
+        addMessage(FacesMessage.SEVERITY_WARN, summary, null);
+    }
+}

Propchange: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/util/FacesMessageUtil.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/web/deployer/DisplayPortletsPage.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/web/deployer/DisplayPortletsPage.java?view=auto&rev=499006
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/web/deployer/DisplayPortletsPage.java (added)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/web/deployer/DisplayPortletsPage.java Tue Jan 23 04:41:36 2007
@@ -0,0 +1,225 @@
+/*
+ * Copyright 2007 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.jetspeed.portlets.rpad.portlet.web.deployer;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+import javax.faces.model.SelectItem;
+
+import org.apache.jetspeed.portlets.rpad.PortletApplication;
+import org.apache.jetspeed.portlets.rpad.Repository;
+import org.apache.jetspeed.portlets.rpad.RepositoryManager;
+import org.apache.jetspeed.portlets.rpad.portlet.deployer.PortletDeployer;
+import org.apache.jetspeed.portlets.rpad.portlet.util.FacesMessageUtil;
+
+public class DisplayPortletsPage
+{
+
+    protected static final String SEARCH = "org.apache.jetspeed.portlets.rpad.portlet.web.deployer.Search";
+
+    protected static final String REPOSITORY_NAME = "org.apache.jetspeed.portlets.rpad.portlet.web.deployer.RepositoryNamee";
+
+    private String repositoryName = null;
+
+    private String search = null;
+
+    private RepositoryManager repositoryManager = null;
+
+    private PortletDeployer portletDeployer;
+
+    public DisplayPortletsPage()
+    {
+        Map sessionMap = FacesContext.getCurrentInstance().getExternalContext()
+                .getSessionMap();
+
+        String repositoryName = (String) sessionMap.get(REPOSITORY_NAME);
+        if (repositoryName != null)
+        {
+            this.repositoryName = repositoryName;
+        }
+
+        String search = (String) sessionMap.get(SEARCH);
+        if (search != null)
+        {
+            this.search = search;
+        }
+    }
+
+    public RepositoryManager getRepositoryManager()
+    {
+        if (repositoryManager == null)
+        {
+            repositoryManager = RepositoryManager.getInstance();
+        }
+        return repositoryManager;
+    }
+
+    public String doSearch()
+    {
+        Map sessionMap = FacesContext.getCurrentInstance().getExternalContext()
+                .getSessionMap();
+
+        if (getRepositoryName() != null && !getRepositoryName().equals(""))
+        {
+            sessionMap.put(REPOSITORY_NAME, getRepositoryName());
+        }
+        else
+        {
+            sessionMap.remove(REPOSITORY_NAME);
+        }
+
+        if (getSearch() != null && !getSearch().equals(""))
+        {
+            sessionMap.put(SEARCH, getSearch());
+        }
+        else
+        {
+            sessionMap.remove(SEARCH);
+        }
+
+        return null;
+    }
+
+    public String jumpUpdateRepository()
+    {
+        return "deployer_displayRepositories";
+    }
+
+    public String doRefresh()
+    {
+        return null;
+    }
+
+    public String doDeploy()
+    {
+        PortletApplication portlet = (PortletApplication) FacesContext
+                .getCurrentInstance().getExternalContext().getRequestMap().get(
+                        "portlet");
+        if (portlet != null)
+        {
+            if (getPortletDeployer() != null)
+            {
+                getPortletDeployer().deploy(portlet);
+            }
+            else
+            {
+                //TODO i18n
+                FacesMessageUtil.addMessage(FacesMessage.SEVERITY_ERROR,
+                        "Could not find the portlet deployer.", null);
+            }
+        }
+        else
+        {
+            //TODO i18n
+            FacesMessageUtil.addMessage(FacesMessage.SEVERITY_ERROR,
+                    "Could not find the target portlet.", null);
+        }
+
+        return null;
+    }
+
+    public SelectItem[] getRepositoryNames()
+    {
+        List repos = getRepositoryManager().getRepositories();
+        SelectItem[] items = new SelectItem[repos.size() + 1];
+        items[0] = new SelectItem("");
+        int c = 1;
+        for (Iterator i = repos.iterator(); i.hasNext(); c++)
+        {
+            Repository repo = (Repository) i.next();
+            items[c] = new SelectItem(repo.getName());
+        }
+        return items;
+    }
+
+    public List getPortlets()
+    {
+        //TODO search
+        if (repositoryName != null)
+        {
+            return getRepositoryManager()
+                    .getPortletApplications(repositoryName);
+        }
+        else
+        {
+            return getRepositoryManager().getPortletApplications();
+        }
+    }
+
+    public int getPageSize()
+    {
+        //TODO move to portlet.xml or somewhere..
+        return 10;
+    }
+
+    /**
+     * @return the repositoryName
+     */
+    public String getRepositoryName()
+    {
+        return repositoryName;
+    }
+
+    /**
+     * @param repositoryName the repositoryName to set
+     */
+    public void setRepositoryName(String repositoryName)
+    {
+        this.repositoryName = repositoryName;
+    }
+
+    /**
+     * @return the search
+     */
+    public String getSearch()
+    {
+        return search;
+    }
+
+    /**
+     * @param search the search to set
+     */
+    public void setSearch(String search)
+    {
+        this.search = search;
+    }
+
+    /**
+     * @return the portletDeployer
+     */
+    public PortletDeployer getPortletDeployer()
+    {
+        return portletDeployer;
+    }
+
+    /**
+     * @param portletDeployer the portletDeployer to set
+     */
+    public void setPortletDeployer(PortletDeployer portletDeployer)
+    {
+        this.portletDeployer = portletDeployer;
+    }
+
+    public boolean isDeployable()
+    {
+        return portletDeployer.getStatus() == PortletDeployer.READY;
+    }
+
+}

Propchange: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/web/deployer/DisplayPortletsPage.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/web/deployer/DisplayRepositoriesPage.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/web/deployer/DisplayRepositoriesPage.java?view=auto&rev=499006
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/web/deployer/DisplayRepositoriesPage.java (added)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/web/deployer/DisplayRepositoriesPage.java Tue Jan 23 04:41:36 2007
@@ -0,0 +1,136 @@
+/*
+ * Copyright 2007 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.jetspeed.portlets.rpad.portlet.web.deployer;
+
+import java.util.List;
+
+import javax.faces.context.FacesContext;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jetspeed.portlets.rpad.RPADConstants;
+import org.apache.jetspeed.portlets.rpad.RPADException;
+import org.apache.jetspeed.portlets.rpad.Repository;
+import org.apache.jetspeed.portlets.rpad.RepositoryManager;
+import org.apache.jetspeed.portlets.rpad.portlet.util.FacesMessageUtil;
+
+public class DisplayRepositoriesPage
+{
+    /**
+     * Logger for this class
+     */
+    private static final Log log = LogFactory
+            .getLog(DisplayRepositoriesPage.class);
+
+    private RepositoryManager repositoryManager = null;
+
+    public RepositoryManager getRepositoryManager()
+    {
+        if (repositoryManager == null)
+        {
+            repositoryManager = RepositoryManager.getInstance();
+        }
+        return repositoryManager;
+    }
+
+    public String jumpDisplayPortlets()
+    {
+        return "deployer_displayPortlets";
+    }
+
+    public String doReloadRepositories()
+    {
+        try
+        {
+            getRepositoryManager().reload();
+            FacesMessageUtil.addInfoMessage("Reload repositories.");
+        }
+        catch (Exception e)
+        {
+            //TODO i18n
+            FacesMessageUtil.addErrorMessage("Could not reload repositories.");
+            log.error("Could not reload repositories.", e);
+        }
+        return null;
+    }
+
+    public String doAddRepository()
+    {
+        FacesContext.getCurrentInstance().getExternalContext().getSessionMap()
+                .remove(RPADConstants.REPOSITORY);
+        return "deployer_editRepository";
+    }
+
+    public String doEditRepository()
+    {
+        Repository repo = (Repository) FacesContext.getCurrentInstance()
+                .getExternalContext().getRequestMap().get("repository");
+        if (repo != null)
+        {
+            FacesContext.getCurrentInstance().getExternalContext()
+                    .getSessionMap().put(RPADConstants.REPOSITORY, repo);
+            return "deployer_editRepository";
+        }
+        else
+        {
+            //TODO i18n
+            FacesMessageUtil
+                    .addWarnMessage("Could not find the target repository.");
+        }
+        return null;
+    }
+
+    public String doDeleteRepository()
+    {
+        Repository repo = (Repository) FacesContext.getCurrentInstance()
+                .getExternalContext().getRequestMap().get("repository");
+        if (repo != null)
+        {
+            try
+            {
+                getRepositoryManager().removeRepository(repo.getName());
+                //TODO i18n
+                FacesMessageUtil
+                        .addInfoMessage("Removed the target repository.");
+            }
+            catch (RPADException e)
+            {
+                //TODO i18n
+                FacesMessageUtil
+                        .addErrorMessage("Could not remove the target repository.");
+            }
+        }
+        else
+        {
+            //TODO i18n
+            FacesMessageUtil
+                    .addWarnMessage("Could not find the target repository.");
+        }
+        return null;
+    }
+
+    public List getRepositories()
+    {
+        return getRepositoryManager().getRepositories();
+    }
+
+    public int getPageSize()
+    {
+        //TODO move to portlet.xml or somewhere..
+        return 10;
+    }
+
+}

Propchange: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/web/deployer/DisplayRepositoriesPage.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/web/deployer/EditRepositoryPage.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/web/deployer/EditRepositoryPage.java?view=auto&rev=499006
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/web/deployer/EditRepositoryPage.java (added)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/web/deployer/EditRepositoryPage.java Tue Jan 23 04:41:36 2007
@@ -0,0 +1,210 @@
+/*
+ * Copyright 2007 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.jetspeed.portlets.rpad.portlet.web.deployer;
+
+import java.util.Map;
+
+import javax.faces.context.FacesContext;
+
+import org.apache.jetspeed.portlets.rpad.RPADConstants;
+import org.apache.jetspeed.portlets.rpad.RPADException;
+import org.apache.jetspeed.portlets.rpad.Repository;
+import org.apache.jetspeed.portlets.rpad.RepositoryManager;
+import org.apache.jetspeed.portlets.rpad.portlet.util.FacesMessageUtil;
+import org.apache.jetspeed.portlets.rpad.simple.SimpleRepository;
+
+public class EditRepositoryPage
+{
+
+    private RepositoryManager repositoryManager = null;
+
+    private boolean newRepository;
+
+    private String name;
+
+    private String path;
+
+    public EditRepositoryPage()
+    {
+        Map sessionMap = FacesContext.getCurrentInstance().getExternalContext()
+                .getSessionMap();
+        Repository repo = (Repository) sessionMap.get(RPADConstants.REPOSITORY);
+        if (repo != null)
+        {
+            //TODO support repositories other than SimpleRepository
+            if (repo instanceof SimpleRepository)
+            {
+                SimpleRepository simpleRepo = (SimpleRepository) repo;
+                newRepository = false;
+                setName(simpleRepo.getName());
+                setPath(simpleRepo.getConfigPath());
+            }
+            else
+            {
+                newRepository = true;
+                sessionMap.remove(RPADConstants.REPOSITORY);
+            }
+        }
+        else
+        {
+            newRepository = true;
+        }
+    }
+
+    public RepositoryManager getRepositoryManager()
+    {
+        if (repositoryManager == null)
+        {
+            repositoryManager = RepositoryManager.getInstance();
+        }
+        return repositoryManager;
+    }
+
+    public String jumpDisplayRepositories()
+    {
+        return "deployer_displayRepositories";
+    }
+
+    public String doCreateRepository()
+    {
+        if (getRepositoryManager().getRepository(getName()) == null)
+        {
+            //TODO support repositories other than SimpleRepository
+            SimpleRepository repo = new SimpleRepository();
+            repo.setName(getName());
+            repo.setConfigPath(getPath());
+            repo.init();
+
+            try
+            {
+                getRepositoryManager().addRepository(getName(), repo);
+                getRepositoryManager().reload();
+                //  TODO i18n
+                FacesMessageUtil.addInfoMessage(getName() + " exits.");
+                return "deployer_displayRepositories";
+            }
+            catch (RPADException e)
+            {
+                //TODO i18n
+                FacesMessageUtil.addErrorMessage("Could not add a repository: "
+                        + getName());
+            }
+        }
+        else
+        {
+            //TODO i18n
+            FacesMessageUtil.addWarnMessage(getName() + " exits.");
+        }
+
+        return null;
+    }
+
+    public String doUpdateRepository()
+    {
+        Map sessionMap = FacesContext.getCurrentInstance().getExternalContext()
+                .getSessionMap();
+        Repository repo = (Repository) sessionMap.get(RPADConstants.REPOSITORY);
+        if (repo != null)
+        {
+            Repository r = (Repository) getRepositoryManager().getRepository(
+                    repo.getName());
+
+            //TODO support repositories other than SimpleRepository
+            if (r instanceof SimpleRepository)
+            {
+                SimpleRepository simpleRepo = (SimpleRepository) r;
+                simpleRepo.setName(getName());
+                simpleRepo.setConfigPath(getPath());
+            }
+            else
+            {
+                //TODO i18n
+                FacesMessageUtil
+                        .addWarnMessage("Could not get the proper repository.");
+            }
+            try
+            {
+                getRepositoryManager().store();
+                getRepositoryManager().reload();
+                //TODO i18n
+                FacesMessageUtil
+                        .addWarnMessage("Could not get the proper repository.");
+                return null;
+            }
+            catch (RPADException e)
+            {
+                //TODO i18n
+                FacesMessageUtil
+                        .addErrorMessage("Could not update the target repository.");
+            }
+
+        }
+        else
+        {
+            //TODO i18n
+            FacesMessageUtil.addWarnMessage("Your session might be expired.");
+        }
+        return "deployer_displayRepositories";
+    }
+
+    /**
+     * @return the name
+     */
+    public String getName()
+    {
+        return name;
+    }
+
+    /**
+     * @param name the name to set
+     */
+    public void setName(String name)
+    {
+        this.name = name;
+    }
+
+    /**
+     * @return the newRepository
+     */
+    public boolean isNewRepository()
+    {
+        return newRepository;
+    }
+
+    /**
+     * @param newRepository the newRepository to set
+     */
+    public void setNewRepository(boolean newRepository)
+    {
+        this.newRepository = newRepository;
+    }
+
+    /**
+     * @return the path
+     */
+    public String getPath()
+    {
+        return path;
+    }
+
+    /**
+     * @param path the path to set
+     */
+    public void setPath(String path)
+    {
+        this.path = path;
+    }
+}

Propchange: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/portlet/web/deployer/EditRepositoryPage.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/simple/SimpleConfigHandler.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/simple/SimpleConfigHandler.java?view=auto&rev=499006
==============================================================================
--- portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/simple/SimpleConfigHandler.java (added)
+++ portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/simple/SimpleConfigHandler.java Tue Jan 23 04:41:36 2007
@@ -0,0 +1,238 @@
+/*
+ * Copyright 2007 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.jetspeed.portlets.rpad.simple;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+import java.util.StringTokenizer;
+
+import org.apache.jetspeed.portlets.rpad.PortletApplication;
+import org.xml.sax.Attributes;
+import org.xml.sax.helpers.DefaultHandler;
+
+public class SimpleConfigHandler extends DefaultHandler
+{
+
+    private List portletApplications;
+
+    private PortletApplication portletApplication;
+
+    private List qNameList;
+
+    public SimpleConfigHandler()
+    {
+        portletApplications = new ArrayList();
+        qNameList = new ArrayList();
+    }
+
+    public void startElement(String uri, String localName, String qName,
+            Attributes attributes)
+    {
+        if ("portlet".equals(qName))
+        {
+            portletApplication = new PortletApplication();
+            String created = attributes.getValue("created");
+            if (created != null)
+            {
+                //TODO
+            }
+            String lastModified = attributes.getValue("last-modified");
+            if (lastModified != null)
+            {
+                //TODO
+            }
+        }
+        synchronized (qNameList)
+        {
+            qNameList.add(qName);
+        }
+    }
+
+    public void characters(char[] ch, int start, int length)
+    {
+        if (qNameList.size() < 1)
+        {
+            return;
+        }
+
+        String value = new String(ch, start, length);
+        String qName = (String) qNameList.get(qNameList.size() - 1);
+        String parentQName;
+        if (qNameList.size() - 2 >= 0)
+        {
+            parentQName = (String) qNameList.get(qNameList.size() - 2);
+        }
+        else
+        {
+            parentQName = "";
+        }
+        if ("portlet-spec-version".equals(qName))
+        {
+            portletApplication.setPortletSpecVersion(value);
+        }
+        else if ("group-id".equals(qName))
+        {
+            portletApplication.setGroupId(value);
+        }
+        else if ("artifact-id".equals(qName))
+        {
+            portletApplication.setArtifactId(value);
+        }
+        else if ("packaging".equals(qName))
+        {
+            portletApplication.setPackaging(value);
+        }
+        else if ("version".equals(qName))
+        {
+            portletApplication.setVersion(value);
+        }
+        else if ("name".equals(qName))
+        {
+            if ("publisher".equals(parentQName))
+            {
+                portletApplication.setPublisherName(value);
+            }
+            else if ("license".equals(parentQName))
+            {
+                portletApplication.setPublisherName(value);
+            }
+            else
+            {
+                portletApplication.setName(value);
+            }
+        }
+        else if ("description".equals(qName))
+        {
+            portletApplication.setDescription(value);
+        }
+        else if ("cateogry".equals(qName))
+        {
+            portletApplication.addCategory(value);
+        }
+        else if ("url".equals(qName))
+        {
+            if ("publisher".equals(parentQName))
+            {
+                portletApplication.setPublisherUrl(value);
+            }
+        }
+        else if ("binary".equals(qName))
+        {
+            portletApplication.setBinaryUrl(value);
+        }
+        else if ("source".equals(qName))
+        {
+            portletApplication.setSourceUrl(value);
+        }
+        else if ("thumbnail".equals(qName))
+        {
+            portletApplication.setThumbnailUrl(value);
+        }
+        //TODO dependencies
+        //TODO license
+        else if ("build".equals(qName))
+        {
+            portletApplication.setJavaBuildVersion(value);
+        }
+        else if ("runtime".equals(qName))
+        {
+            portletApplication.setJavaRuntimeVersion(value);
+        }
+        else if ("default-locale".equals(qName))
+        {
+            Locale l = getLocaleFromString(value);
+            if (l != null)
+            {
+                portletApplication.setDefaultLocale(l);
+            }
+        }
+        else if ("supported-locale".equals(qName))
+        {
+            Locale l = getLocaleFromString(value);
+            if (l != null)
+            {
+                portletApplication.addSupportedLocale(l);
+            }
+        }
+
+    }
+
+    private Locale getLocaleFromString(String localeString)
+    {
+        StringTokenizer st = new StringTokenizer(localeString, "_-");
+        String[] buf = new String[3];
+        int count = 0;
+        while (st.hasMoreTokens())
+        {
+            buf[count] = st.nextToken();
+            count++;
+        }
+        if (count > 2)
+        {
+            return new Locale(buf[0], buf[1], buf[2]);
+        }
+        else if (count > 1)
+        {
+            return new Locale(buf[0], buf[1]);
+        }
+        else if (count > 0)
+        {
+            return new Locale(buf[0]);
+        }
+        return null;
+    }
+
+    public void endElement(String uri, String localName, String qName)
+    {
+        if ("portlet".equals(qName))
+        {
+            portletApplications.add(portletApplication);
+            portletApplication = null;
+        }
+
+        synchronized (qNameList)
+        {
+            if (qNameList.size() < 1)
+            {
+                throw new IllegalStateException("The stacked QName is 0.");
+            }
+            String stackedQName = (String) qNameList
+                    .remove(qNameList.size() - 1);
+            if (!qName.equals(stackedQName))
+            {
+                throw new IllegalStateException("The expected QName is "
+                        + stackedQName + ". But the current value is " + qName);
+            }
+        }
+    }
+
+    /**
+     * @return the portletApplications
+     */
+    public List getPortletApplications()
+    {
+        return portletApplications;
+    }
+
+    /**
+     * @param portletApplications the portletApplications to set
+     */
+    public void setPortletApplications(List portletApplications)
+    {
+        this.portletApplications = portletApplications;
+    }
+}

Propchange: portals/jetspeed-2/trunk/applications/j2-admin/src/java/org/apache/jetspeed/portlets/rpad/simple/SimpleConfigHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message