ate 2005/03/25 18:17:10
Modified: . project.properties .classpath
applications/pam project.xml
portal maven.xml
applications/pam/src/webapp/WEB-INF portlet.xml
jetspeed-portlet.xml
Added: applications/palm/src/java/org/apache/jetspeed/portlets/palm
PortletApplicationLifecycleManager.java
PortletApplicationResources.java
PortletApplicationStatusBean.java
applications/palm .cvsignore maven.xml project.properties
locator.ent project.xml
portal/src/webapp/WEB-INF/pages/Administrative palm.psml
applications/palm/xdocs navigation.xml
applications/palm/src/webapp/WEB-INF jetspeed-portlet.xml
web.xml portlet.xml
applications/palm/src/webapp/WEB-INF/view palm.jsp
Removed: portal/src/webapp/WEB-INF/pages/Administrative pam2.psml
applications/pam/src/java/org/apache/jetspeed/portlets/pam
PortletApplicationStatusBean.java
PortletApplicationManager.java
applications/pam/src/webapp/WEB-INF/view pam.jsp
Log:
Moved the recently added PortletApplicationManager Portlet to its own new
PALM application (Portlet Application Lifecycle Management).
Now this portlet can be used in Fusion as well, replacing the Fusion JSR-168
Registry Management Portlets.
And its a fine beer too ;-)
Revision Changes Path
1.1
jakarta-jetspeed-2/applications/palm/src/java/org/apache/jetspeed/portlets/palm/PortletApplicationLifecycleManager.java
Index: PortletApplicationLifecycleManager.java
===================================================================
/* Copyright 2004 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.palm;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
import javax.portlet.PortletConfig;
import javax.portlet.PortletContext;
import javax.portlet.PortletException;
import javax.portlet.PortletMode;
import javax.portlet.PortletRequest;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import org.apache.jetspeed.components.portletregistry.PortletRegistry;
import org.apache.jetspeed.components.portletregistry.RegistryException;
import org.apache.jetspeed.deployment.DeploymentManager;
import org.apache.jetspeed.factory.PortletFactory;
import org.apache.jetspeed.om.common.portlet.MutablePortletApplication;
import
org.apache.jetspeed.tools.pamanager.servletcontainer.ApplicationServerManager;
import
org.apache.jetspeed.tools.pamanager.servletcontainer.ApplicationServerManagerResult;
import org.apache.portals.bridges.common.GenericServletPortlet;
import org.apache.portals.gems.util.StatusMessage;
import org.apache.portals.messaging.PortletMessaging;
/**
* PALM Portlet
*
* @author <a href="mailto:[EMAIL PROTECTED]">Ate Douma</a>
* @version $Id: PortletApplicationLifecycleManager.java,v 1.1 2005/03/26
02:17:09 ate Exp $
*/
public class PortletApplicationLifecycleManager extends GenericServletPortlet
{
private ApplicationServerManager asm;
private PortletRegistry registry;
private PortletFactory portletFactory;
private DeploymentManager dm;
private boolean serverManagerAvailable;
public void init(PortletConfig config)
throws PortletException
{
super.init(config);
PortletContext context = getPortletContext();
registry =
(PortletRegistry)context.getAttribute(PortletApplicationResources.CPS_REGISTRY_COMPONENT);
portletFactory =
(PortletFactory)context.getAttribute(PortletApplicationResources.CPS_PORTLET_FACTORY_COMPONENT);
dm =
(DeploymentManager)context.getAttribute(PortletApplicationResources.CPS_DEPLOYMENT_MANAGER_COMPONENT);
asm =
(ApplicationServerManager)context.getAttribute(PortletApplicationResources.CPS_APPLICATION_SERVER_MANAGER_COMPONENT);
if (null == registry)
{
throw new PortletException("Failed to find the Portlet Registry
on portlet initialization");
}
if (null == portletFactory)
{
throw new PortletException("Failed to find the Portlet Factory on
portlet initialization");
}
serverManagerAvailable = (asm != null && asm.isConnected());
}
public void doView(RenderRequest request, RenderResponse response)
throws PortletException, IOException
{
request.setAttribute("serverManagerAvailable",serverManagerAvailable?Boolean.TRUE:Boolean.FALSE);
StatusMessage msg = (StatusMessage)PortletMessaging.consume(request,
"PALM", "status");
if (msg != null)
{
request.setAttribute("statusMsg", msg);
}
if ( request.getPortletSession().getAttribute("list") == null )
{
List list = new ArrayList();
Iterator apps = registry.getPortletApplications().iterator();
while (apps.hasNext())
{
MutablePortletApplication pa =
(MutablePortletApplication)apps.next();
PortletApplicationStatusBean bean = new
PortletApplicationStatusBean(pa,
portletFactory.isPortletApplicationRegistered(pa));
list.add(bean);
}
request.getPortletSession().setAttribute("list",list);
}
super.doView(request, response);
}
public void processAction(ActionRequest request, ActionResponse response)
throws PortletException, IOException
{
if (request.getPortletMode() == PortletMode.VIEW)
{
String action = request.getParameter("action");
String value = request.getParameter("value");
if ( !isEmpty(action))
{
// enforce list is rebuild next doView
request.getPortletSession().removeAttribute("list");
if (!action.equals("refresh") && !isEmpty(value))
{
MutablePortletApplication pa =
registry.getPortletApplication(value);
if ( pa == null )
{
publishStatusMessage(request, "PALM", "status", null,
"Portlet Application "+pa.getName()+" no longer exists");
}
else if ( pa.getApplicationType() ==
MutablePortletApplication.LOCAL )
{
// TODO
}
else // ( pa.getApplicationType() ==
MutablePortletApplication.WEBAPP )
{
if (action.equals("start"))
{
startPA(request,pa);
}
else if (action.equals("stop"))
{
stopPA(request,pa);
}
else if (action.equals("undeploy"))
{
undeployPA(request,pa);
}
else if (action.equals("delete"))
{
deletePA(request,pa);
}
}
}
}
}
}
protected void publishStatusMessage(PortletRequest request, String
portlet, String topic, Throwable e, String message)
{
if ( e != null )
{
message = message + ": " + e.toString();
Throwable cause = e.getCause();
if (cause != null)
{
message = message + ", " + cause.getMessage();
}
}
StatusMessage sm = new StatusMessage(message, StatusMessage.ERROR);
try
{
// TODO: fixme, bug in Pluto on portlet session
PortletMessaging.publish(request, portlet, topic, sm);
}
catch (Exception ee)
{
System.err.println("Failed to publish message: " + message);
}
}
protected void startPA(ActionRequest request, MutablePortletApplication
pa)
{
if ( portletFactory.isPortletApplicationRegistered(pa))
{
publishStatusMessage(request, "PALM", "status", null, "Portlet
Application "+pa.getName()+" already running");
}
else if ( !serverManagerAvailable || !asm.isConnected() )
{
publishStatusMessage(request, "PALM", "status", null,
"Application Server Manager not available");
}
else
{
try
{
ApplicationServerManagerResult result =
asm.start(pa.getWebApplicationDefinition().getContextRoot());
if ( !result.isOk() )
{
publishStatusMessage(request, "PALM", "status", null,
result.getMessage());
}
}
catch (Exception e)
{
e.printStackTrace();
publishStatusMessage(request, "PAM", "status", e, "Could not
start Portlet Application "+pa.getName());
}
}
}
protected void stopPA(ActionRequest request, MutablePortletApplication pa)
{
if ( !portletFactory.isPortletApplicationRegistered(pa))
{
publishStatusMessage(request, "PALM", "status", null, "Portlet
Application "+pa.getName()+" no longer running");
}
else if ( !serverManagerAvailable || !asm.isConnected() )
{
publishStatusMessage(request, "PALM", "status", null,
"Application Server Manager not available");
}
else
{
try
{
ApplicationServerManagerResult result =
asm.stop(pa.getWebApplicationDefinition().getContextRoot());
if ( !result.isOk() )
{
publishStatusMessage(request, "PALM", "status", null,
result.getMessage());
}
}
catch (Exception e)
{
e.printStackTrace();
publishStatusMessage(request, "PALM", "status", e, "Could not
stop Portlet Application "+pa.getName());
}
}
}
protected void undeployPA(ActionRequest request,
MutablePortletApplication pa)
{
if ( !serverManagerAvailable || !asm.isConnected() )
{
publishStatusMessage(request, "PALM", "status", null,
"Application Server Manager not available");
}
else
{
try
{
ApplicationServerManagerResult result =
asm.undeploy(pa.getWebApplicationDefinition().getContextRoot());
if ( !result.isOk() )
{
publishStatusMessage(request, "PALM", "status", null,
result.getMessage());
}
}
catch (Exception e)
{
e.printStackTrace();
publishStatusMessage(request, "PALM", "status", e, "Could not
undeploy Portlet Application "+pa.getName());
}
}
}
protected void deletePA(ActionRequest request, MutablePortletApplication
pa)
{
if ( portletFactory.isPortletApplicationRegistered(pa))
{
publishStatusMessage(request, "PALM", "status", null, "Portlet
Application "+pa.getName()+" is still running");
}
else
{
try
{
registry.removeApplication(pa);
}
catch (RegistryException e)
{
e.printStackTrace();
publishStatusMessage(request, "PALM", "status", e, "Could not
delete Portlet Application "+pa.getName());
}
}
}
private boolean isEmpty(String s)
{
if (s == null) return true;
if (s.trim().equals("")) return true;
return false;
}
}
1.1
jakarta-jetspeed-2/applications/palm/src/java/org/apache/jetspeed/portlets/palm/PortletApplicationResources.java
Index: PortletApplicationResources.java
===================================================================
/*
* 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.jetspeed.portlets.palm;
/**
* Common resources used by Application Lifecycle Management Portlets
*
* @author <a href="mailto:[EMAIL PROTECTED]">Ate Douma</a>
* @version $Id: PortletApplicationResources.java,v 1.1 2005/03/26 02:17:09
ate Exp $
*/
public interface PortletApplicationResources
{
public final static String CPS_REGISTRY_COMPONENT =
"cps:PortletRegistryComponent";
public final static String CPS_APPLICATION_SERVER_MANAGER_COMPONENT =
"cps:ApplicationServerManager";
public final static String CPS_PORTLET_FACTORY_COMPONENT =
"cps:PortletFactory";
public final static String CPS_DEPLOYMENT_MANAGER_COMPONENT =
"cps:DeploymentManager";
}
1.1
jakarta-jetspeed-2/applications/palm/src/java/org/apache/jetspeed/portlets/palm/PortletApplicationStatusBean.java
Index: PortletApplicationStatusBean.java
===================================================================
/*
* 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.jetspeed.portlets.palm;
import java.io.Serializable;
import org.apache.jetspeed.om.common.portlet.MutablePortletApplication;
/**
* PortletApplicationStatusBean
*
* @author <a href="mailto:[EMAIL PROTECTED]">Ate Douma</a>
* @version $Id: PortletApplicationStatusBean.java,v 1.1 2005/03/26 02:17:09
ate Exp $
*/
public class PortletApplicationStatusBean implements Serializable
{
private String name;
private String path;
private String version;
private boolean local;
private boolean running;
public PortletApplicationStatusBean(MutablePortletApplication pa, boolean
running)
{
this.name = pa.getName();
this.version = pa.getVersion();
this.local = pa.getApplicationType() ==
MutablePortletApplication.LOCAL;
if (local)
{
this.path = "<local>";
}
else
{
this.path = pa.getWebApplicationDefinition().getContextRoot();
}
this.running = running;
}
public String getPath()
{
return path;
}
public boolean isLocal()
{
return local;
}
public String getName()
{
return name;
}
public boolean isRunning()
{
return running;
}
public String getVersion()
{
return version;
}
}
1.1 jakarta-jetspeed-2/applications/palm/.cvsignore
Index: .cvsignore
===================================================================
target
jcoverage.ser
1.1 jakarta-jetspeed-2/applications/palm/maven.xml
Index: maven.xml
===================================================================
<project default="java:jar"
xmlns:j="jelly:core"
xmlns:define="jelly:define">
<!-- ================================================================ -->
<!-- Hot Deploy for mundane everyday development under Catalina -->
<!-- ================================================================ -->
<goal name="hotdeploy">
<echo message="Hot Deploying ${org.apache.jetspeed.portlet.app.name} to
${org.apache.jetspeed.deploy.war.dir}"/>
<copy
todir="${org.apache.jetspeed.deploy.war.dir}/${org.apache.jetspeed.portlet.app.name}/WEB-INF/classes">
<fileset dir="${maven.build.dir}/classes">
</fileset>
</copy>
<copy
todir="${org.apache.jetspeed.deploy.war.dir}/${org.apache.jetspeed.portlet.app.name}/">
<fileset dir="./src/webapp"/>
</copy>
</goal>
<preGoal name="hotdeploy">
<attainGoal name= "java:compile"/>
</preGoal>
</project>
1.1 jakarta-jetspeed-2/applications/palm/project.properties
Index: project.properties
===================================================================
# 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.properties,v 1.1 2005/03/26 02:17:09 ate Exp $
#
maven.multiproject.type=war
org.apache.jetspeed.portlet.app.name=palm
1.1 jakarta-jetspeed-2/applications/palm/locator.ent
Index: locator.ent
===================================================================
<!-- Project dependencies -->
<!-- Project reports -->
<!ENTITY j2-reports SYSTEM "file:../../etc/project-reports/j2-reports.xml">
1.1 jakarta-jetspeed-2/applications/palm/project.xml
Index: project.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE project [
<!ENTITY % locator-entities SYSTEM "file:locator.ent"> %locator-entities;
]>
<!--
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.
-->
<project>
<extend>${basedir}/./../project.xml</extend>
<pomVersion>3</pomVersion>
<artifactId>palm</artifactId>
<name>Jetspeed-2 Portlet Application Lifecyle Management</name>
<groupId>pam</groupId>
<description>Jetspeed-2 Portlet Application Lifecyle
Management</description>
<shortDescription>Portlet Application Lifecycle
Management</shortDescription>
<repository>
<connection>scm:cvs:pserver:[EMAIL
PROTECTED]:/home/cvspublic:jakarta-jetspeed-2/applications/palm</connection>
<url>http://cvs.apache.org/viewcvs/jakarta-jetspeed-2/applications/palm/</url>
</repository>
<dependencies>
<dependency>
<groupId>portlet-api</groupId>
<artifactId>portlet-api</artifactId>
<version>1.0</version>
<type>jar</type>
<properties>
<war.bundle>false</war.bundle>
</properties>
</dependency>
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.0.6</version>
<type>jar</type>
<properties>
<war.bundle>true</war.bundle>
</properties>
</dependency>
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.0.6</version>
<type>jar</type>
<properties>
<war.bundle>true</war.bundle>
</properties>
</dependency>
<dependency>
<groupId>servletapi</groupId>
<artifactId>servletapi</artifactId>
<version>2.3</version>
<type>jar</type>
<properties>
<war.bundle>false</war.bundle>
</properties>
</dependency>
<dependency>
<groupId>jetspeed2</groupId>
<artifactId>jetspeed-api</artifactId>
<version>2.0-M2-dev</version>
<type>jar</type>
<properties>
<war.bundle>false</war.bundle>
</properties>
</dependency>
<dependency>
<groupId>jetspeed2</groupId>
<artifactId>jetspeed-commons</artifactId>
<version>2.0-M2-dev</version>
<type>jar</type>
<properties>
<war.bundle>false</war.bundle>
</properties>
</dependency>
<dependency>
<groupId>portals-gems</groupId>
<artifactId>portals-gems</artifactId>
<version>2.0-M2-dev</version>
<type>jar</type>
<properties>
<war.bundle>true</war.bundle>
</properties>
</dependency>
<dependency>
<groupId>portals-bridges</groupId>
<artifactId>portals-bridges-common</artifactId>
<version>0.1</version>
<properties>
<war.bundle>true</war.bundle>
</properties>
</dependency>
<dependency>
<groupId>pluto</groupId>
<artifactId>pluto</artifactId>
<version>1.0.1-rc1</version>
<type>jar</type>
<properties>
<war.bundle>false</war.bundle>
</properties>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.8</version>
<type>jar</type>
<properties>
<war.bundle>true</war.bundle>
</properties>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.0.3</version>
<type>jar</type>
<url>http://jakarta.apache.org/commons/logging.html</url>
<properties>
<war.bundle>true</war.bundle>
</properties>
</dependency>
</dependencies>
<build>
<sourceDirectory>src/java</sourceDirectory>
<resources>
<resource>
<directory>${basedir}/src/java/</directory>
<includes>
<include>**/*.properties</include>
</includes>
</resource>
</resources>
</build>
<reports>
&j2-reports;
</reports>
<properties/>
</project>
1.1
jakarta-jetspeed-2/portal/src/webapp/WEB-INF/pages/Administrative/palm.psml
Index: palm.psml
===================================================================
<!--
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.
-->
<page id="palm">
<defaults
skin="orange"
layout-decorator="tigris"
portlet-decorator="tigris"
/>
<title>PALM</title>
<fragment id="palm-layout" type="layout"
name="jetspeed-layouts::VelocityOneColumn">
<fragment id="palm-app" type="portlet"
name="palm::PortletApplicationLifecycleManager">
<property name="row" value="0" layout="OneColumn"/>
<property name="column" value="0" layout="OneColumn"/>
</fragment>
</fragment>
</page>
1.1 jakarta-jetspeed-2/applications/palm/xdocs/navigation.xml
Index: navigation.xml
===================================================================
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
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.
-->
<project>
<body>
<links>
<item name="Jetspeed 2" href="../../index.html"/>
</links>
</body>
</project>
1.1
jakarta-jetspeed-2/applications/palm/src/webapp/WEB-INF/jetspeed-portlet.xml
Index: jetspeed-portlet.xml
===================================================================
<?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.
-->
<portlet-app id="palm" version="1.0"
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
xmlns:js="http://portals.apache.org/jetspeed"
xmlns:dc="http://www.purl.org/dc">
<dc:title>Portlet Application Lifecycle Management Portlets</dc:title>
<dc:title xml:lang="en">Portlet Application Lifecycle Management
Portlets</dc:title>
<dc:creator>J2 Team</dc:creator>
<js:services>
<js:service name='PortletRegistryComponent'/>
<js:service name='ApplicationServerManager'/>
<js:service name='PortletFactory'/>
<js:service name='DeploymentManager'/>
</js:services>
</portlet-app>
1.1
jakarta-jetspeed-2/applications/palm/src/webapp/WEB-INF/web.xml
Index: web.xml
===================================================================
<?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.
-->
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application
2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>Portlet Application Lifecycle Management
Portlets</display-name>
<description>Portlet Application Lifecycle Management Portlets</description>
</web-app>
1.1
jakarta-jetspeed-2/applications/palm/src/webapp/WEB-INF/portlet.xml
Index: portlet.xml
===================================================================
<?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.
-->
<portlet-app id="palm" version="1.0">
<portlet id="PortletApplicationLifecyleManager">
<init-param>
<description>This parameter sets the template used in view
mode.</description>
<name>ViewPage</name>
<value>/WEB-INF/view/palm.jsp</value>
</init-param>
<portlet-name>PortletApplicationLifecycleManager</portlet-name>
<display-name>Portlet Application Lifecycle Manager</display-name>
<description>The PALM (Portlet Application Lifecycle Manager) manages the
lifecyle of portlet applications. From here you can start, stop, undeploy and
delete portlet applications</description>
<portlet-class>org.apache.jetspeed.portlets.palm.PortletApplicationLifecycleManager</portlet-class>
<expiration-cache>-1</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>VIEW</portlet-mode>
</supports>
<supported-locale>en</supported-locale>
<portlet-info>
<title>Portlet Application Lifecycle Manager</title>
<short-title>PALM</short-title>
<keywords>applications,apps,PALM</keywords>
</portlet-info>
</portlet>
</portlet-app>
1.1
jakarta-jetspeed-2/applications/palm/src/webapp/WEB-INF/view/palm.jsp
Index: palm.jsp
===================================================================
<%--
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.
--%>
<%--
@author <a href="mailto:[EMAIL PROTECTED]">Ate Douma</a>
@version $Id: palm.jsp,v 1.1 2005/03/26 02:17:09 ate Exp $
--%>
<[EMAIL PROTECTED] uri="http://java.sun.com/portlet" prefix="portlet"%>
<[EMAIL PROTECTED] uri="http://java.sun.com/jstl/core" prefix="c" %>
<[EMAIL PROTECTED] uri="http://java.sun.com/jstl/core_rt" prefix="c_rt"%>
<portlet:defineObjects/>
<script type="text/javascript">
function doSubmit(a,pa) {
for (ix = 0; ix < document.forms.length; ix++) {
var f = document.forms[ix];
if (f.name == "palmForm") {
for (iy = 0; iy < f.elements.length; iy++) {
var el = f.elements[iy];
if (el.name == "action") el.value = a;
if (el.name == "value") el.value = pa;
}
f.submit();
}
}
}
function checkSubmit(a,pa,d) { if (confirm("Are you Sure to "+a+"
"+pa+"?")) doSubmit(a,pa); return false; }
</script>
<form name="palmForm" action="<portlet:actionURL/>" method="post">
<input name="action" type="hidden" value="">
<input name="value" type="hidden" value="">
</form>
<c:if test="${not empty requestScope.statusMsg}">
<br/>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<div class="<c:out value="${requestScope.statusMsg.type}"/>"><c:out
value="${requestScope.statusMsg.text}"/></div>
</tr>
</table>
</c:if>
<table cellpadding=0 cellspacing=1 border=0 width="100%">
<tr>
<th colspan="5" class="portlet-section-header">Portlet Applications</th>
</tr>
<tr>
<th class="portlet-section-subheader">Name</th>
<th class="portlet-section-subheader">Version</th>
<th class="portlet-section-subheader">Path</th>
<th class="portlet-section-subheader">Running</th>
<th class="portlet-section-subheader">Commands</th>
</tr>
<c_rt:set var="list"
value="<%=renderRequest.getPortletSession().getAttribute("list")%>"/>
<c:forEach var="pa" items="${list}" varStatus="status">
<c:choose>
<c:when test="${status.count % 2 != 0}">
<c:set var="rowClass" value="portlet-section-body"/>
</c:when>
<c:otherwise>
<c:set var="rowClass" value="portlet-section-alternate"/>
</c:otherwise>
</c:choose>
<tr>
<td class='<c:out value="${rowClass}"/>'> <c:out
value="${pa.name}"/></td>
<td class='<c:out value="${rowClass}"/>'> <c:out
value="${pa.version}"/></td>
<td class='<c:out value="${rowClass}"/>'> <c:out
value="${pa.path}"/></td>
<td style='text-align:center' class='<c:out value="${rowClass}"/>'><c:out
value="${pa.running}"/></td>
<td class='<c:out value="${rowClass}"/>'>
<c:if test="${requestScope.serverManagerAvailable}">
<c:choose>
<c:when test="${pa.local}">
<%-- management of local pa not yet supported --%>
start stop undeploy
</c:when>
<c:otherwise>
<c:choose>
<c:when test="${pa.running}">
start <a href="#" onClick='return
checkSubmit("stop","<c:out value="${pa.name}"/>")'>stop</a>
</c:when>
<c:otherwise>
<a href="#" onClick='return checkSubmit("start","<c:out
value="${pa.name}"/>")'>start</a> stop
</c:otherwise>
</c:choose>
<a href="#" onclick='return checkSubmit("undeploy","<c:out
value="${pa.name}"/>")'>undeploy</a>
</c:otherwise>
</c:choose>
</c:if>
<c:choose>
<c:when test="${pa.running}">
delete
</c:when>
<c:otherwise>
<a href="#" onClick='return checkSubmit("delete","<c:out
value="${pa.name}"/>")'>delete</a>
</c:otherwise>
</c:choose>
</td>
</tr>
</c:forEach>
<tr>
<td class='portlet-section-footer' colspan='5'><input type="button"
class="portlet-dlg-icon-label" value="refresh"
onClick='doSubmit("refresh",null)'></td>
</tr>
</table>
1.34 +1 -1 jakarta-jetspeed-2/project.properties
Index: project.properties
===================================================================
RCS file: /home/cvs/jakarta-jetspeed-2/project.properties,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- project.properties 23 Mar 2005 23:10:46 -0000 1.33
+++ project.properties 26 Mar 2005 02:17:09 -0000 1.34
@@ -54,7 +54,7 @@
maven.multiproject.excludes=project.xml,applications/project.xml,cornerstone*/project.xml,portlet-api/project.xml,design-docs/project.xml,site/project.xml,taglibs/project.xml,maven-plugin/project.xml
jar.includes=applications/gems/project.xml,portlet-api/project.xml,commons/project.xml,cps/project.xml,content-server/project.xml,jetspeed-api/project.xml,portals-bridges/**/project.xml,portal/project.xml,components/**/project.xml,taglibs/treecontrol/project.xml
-jar.excludes=/project.xml,maven-plugin/**,layout-portlets/**,applications/project.xml,applications/demo/**,applications/jsf-demo/**,applications/localeselector/**,applications/pam/**,applications/perl/**,applications/php/**,applications/rss/**,applications/security/**,applications/struts-demo/**,,applications/jpetstore/**site/project.xml,design-docs/project.xml
+jar.excludes=/project.xml,maven-plugin/**,layout-portlets/**,applications/project.xml,applications/demo/**,applications/jsf-demo/**,applications/localeselector/**,applications/palm/**,applications/pam/**,applications/perl/**,applications/php/**,applications/rss/**,applications/security/**,applications/struts-demo/**,,applications/jpetstore/**site/project.xml,design-docs/project.xml
maven.multiproject.site.goals=site,dashboard:report-single
1.97 +1 -0 jakarta-jetspeed-2/.classpath
Index: .classpath
===================================================================
RCS file: /home/cvs/jakarta-jetspeed-2/.classpath,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -r1.96 -r1.97
--- .classpath 23 Mar 2005 23:10:19 -0000 1.96
+++ .classpath 26 Mar 2005 02:17:09 -0000 1.97
@@ -55,6 +55,7 @@
<classpathentry excluding="**/CVS/*" kind="src"
path="applications/gems/src/java"/>
<classpathentry excluding="**/CVS*|log4j.properties" kind="src"
path="applications/jpetstore/src/java"/>
<classpathentry excluding="**/CVS/*" kind="src"
path="applications/jsf-demo/src/java"/>
+ <classpathentry excluding="**/CVS*" kind="src"
path="applications/palm/src/java"/>
<classpathentry excluding="**/CVS*" kind="src"
path="applications/pam/src/java"/>
<classpathentry kind="src" path="applications/rss/src/java"/>
<classpathentry excluding="**/CVS/*" kind="src"
path="applications/security/src/java"/>
1.31 +0 -10 jakarta-jetspeed-2/applications/pam/project.xml
Index: project.xml
===================================================================
RCS file: /home/cvs/jakarta-jetspeed-2/applications/pam/project.xml,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- project.xml 23 Mar 2005 22:43:35 -0000 1.30
+++ project.xml 26 Mar 2005 02:17:10 -0000 1.31
@@ -193,16 +193,6 @@
<war.bundle>true</war.bundle>
</properties>
</dependency>
-
- <dependency>
- <groupId>portals-gems</groupId>
- <artifactId>portals-gems</artifactId>
- <version>2.0-M2-dev</version>
- <type>jar</type>
- <properties>
- <war.bundle>true</war.bundle>
- </properties>
- </dependency>
<dependency>
<groupId>portals-bridges</groupId>
<artifactId>portals-bridges-frameworks</artifactId>
1.122 +22 -0 jakarta-jetspeed-2/portal/maven.xml
Index: maven.xml
===================================================================
RCS file: /home/cvs/jakarta-jetspeed-2/portal/maven.xml,v
retrieving revision 1.121
retrieving revision 1.122
diff -u -r1.121 -r1.122
--- maven.xml 23 Mar 2005 23:07:19 -0000 1.121
+++ maven.xml 26 Mar 2005 02:17:10 -0000 1.122
@@ -257,6 +257,18 @@
<attainGoal name="jetspeed2:deploy" />
</goal>
+ <goal name="pam.palmdeploy">
+ <!--
+ <j:set var="pam.app.name" value="palm"/>
+ <j:set var="pam.app.war" value="../applications/palm/target/palm.war"/>
+ <attainGoal name="pam.template.deploy"/>
+ -->
+
+ <j:set var="maven.build.dir" value="../applications/palm/target" />
+ <j:set var="maven.war.final.name" value="palm.war" />
+ <attainGoal name="jetspeed2:deploy" />
+ </goal>
+
<goal name="pam.pamdeploy">
<!--
<j:set var="pam.app.name" value="pam"/>
@@ -361,6 +373,12 @@
<attainGoal name="pam.template.undeploy"/>
</goal>
+ <goal name="pam.palmundeploy">
+ <j:set var="pam.app.name" value="palm"/>
+ <j:set var="pam.app.type" value="webapp"/>
+ <attainGoal name="pam.template.undeploy"/>
+ </goal>
+
<goal name="pam.pamundeploy">
<j:set var="pam.app.name" value="pam"/>
<j:set var="pam.app.type" value="webapp"/>
@@ -474,6 +492,7 @@
<attainGoal name="deploy" />
<attainGoal name="pam.register" />
<attainGoal name="pam.deploy" />
+ <attainGoal name="pam.palmdeploy" />
<attainGoal name="pam.pamdeploy" />
<attainGoal name="pam.strutsdeploy" />
<attainGoal name="pam.jsfdeploy" />
@@ -491,6 +510,7 @@
<attainGoal name="deploy" />
<attainGoal name="pam.register" />
<attainGoal name="pam.deploy" />
+ <attainGoal name="pam.palmdeploy" />
<attainGoal name="pam.pamdeploy" />
<attainGoal name="pam.strutsdeploy" />
<attainGoal name="pam.jsfdeploy" />
@@ -676,6 +696,8 @@
<delete
file="${org.apache.jetspeed.deploy.war.dir}/${org.apache.jetspeed.portal.name}.war"/>
<delete dir="${org.apache.jetspeed.deploy.war.dir}/demo"/>
<delete file="${org.apache.jetspeed.deploy.war.dir}/demo.war"/>
+ <delete dir="${org.apache.jetspeed.deploy.war.dir}/palm"/>
+ <delete file="${org.apache.jetspeed.deploy.war.dir}/palm.war"/>
<delete dir="${org.apache.jetspeed.deploy.war.dir}/pam"/>
<delete file="${org.apache.jetspeed.deploy.war.dir}/pam.war"/>
<delete dir="${org.apache.jetspeed.deploy.war.dir}/security"/>
1.20 +0 -23
jakarta-jetspeed-2/applications/pam/src/webapp/WEB-INF/portlet.xml
Index: portlet.xml
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed-2/applications/pam/src/webapp/WEB-INF/portlet.xml,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- portlet.xml 23 Mar 2005 22:43:35 -0000 1.19
+++ portlet.xml 26 Mar 2005 02:17:10 -0000 1.20
@@ -16,29 +16,6 @@
-->
<portlet-app id="pam" version="1.0">
-<portlet id="PortletApplicationBrowser">
- <init-param>
- <description>This parameter sets the template used in view
mode.</description>
- <name>ViewPage</name>
- <value>/WEB-INF/view/pam.jsp</value>
- </init-param>
- <portlet-name>PortletApplicationManager</portlet-name>
- <display-name>Portlet Application Manager</display-name>
- <description>The PAM (Portlet Application Manager)</description>
-
<portlet-class>org.apache.jetspeed.portlets.pam.PortletApplicationManager</portlet-class>
- <expiration-cache>-1</expiration-cache>
- <supports>
- <mime-type>text/html</mime-type>
- <portlet-mode>VIEW</portlet-mode>
- </supports>
- <supported-locale>en</supported-locale>
- <portlet-info>
- <title>Portlet Application Manager</title>
- <short-title>PAM</short-title>
- <keywords>applications,apps,PAM</keywords>
- </portlet-info>
- </portlet>
-
<portlet id="LocaleSelector">
<portlet-name>LocaleSelector</portlet-name>
<display-name>Locale Selector</display-name>
1.10 +0 -3
jakarta-jetspeed-2/applications/pam/src/webapp/WEB-INF/jetspeed-portlet.xml
Index: jetspeed-portlet.xml
===================================================================
RCS file:
/home/cvs/jakarta-jetspeed-2/applications/pam/src/webapp/WEB-INF/jetspeed-portlet.xml,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- jetspeed-portlet.xml 23 Mar 2005 22:43:35 -0000 1.9
+++ jetspeed-portlet.xml 26 Mar 2005 02:17:10 -0000 1.10
@@ -43,9 +43,6 @@
<js:service name='RoleManager'/>
<js:service name='GroupManager'/>
<js:service name='Profiler'/>
- <js:service name='ApplicationServerManager'/>
- <js:service name='PortletFactory'/>
- <js:service name='DeploymentManager'/>
</js:services>
</portlet-app>
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]