You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-scm@portals.apache.org by cd...@apache.org on 2006/12/26 16:37:22 UTC
svn commit: r490310 - in /portals/pluto/trunk:
pluto-portal-driver/src/main/java/org/apache/pluto/driver/portlets/
pluto-portal/src/main/webapp/WEB-INF/
pluto-portal/src/main/webapp/WEB-INF/classes/
pluto-portal/src/main/webapp/WEB-INF/fragments/admin/...
Author: cdoremus
Date: Tue Dec 26 07:37:21 2006
New Revision: 490310
URL: http://svn.apache.org/viewvc?view=rev&rev=490310
Log:
Changes to support an 'Upload and deploy portlet war' link on the Page Admin Portlet.
Added:
portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/classes/AdminPortlet.properties
portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/fragments/admin/page/TomcatDeploymentHelp.jsp
portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/tld/portlet-el.tld
Modified:
portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/portlets/AdminPortlet.java
portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/portlets/GenericPlutoPortlet.java
portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/portlets/PageAdminPortlet.java
portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/fragments/admin/page/view.jsp
portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/web.xml
Modified: portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/portlets/AdminPortlet.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/portlets/AdminPortlet.java?view=diff&rev=490310&r1=490309&r2=490310
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/portlets/AdminPortlet.java (original)
+++ portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/portlets/AdminPortlet.java Tue Dec 26 07:37:21 2006
@@ -41,7 +41,7 @@
return EDIT_PAGE;
}
- public String getHelpPage() {
+ public String getHelpPage(RenderRequest request) {
return HELP_PAGE;
}
}
Modified: portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/portlets/GenericPlutoPortlet.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/portlets/GenericPlutoPortlet.java?view=diff&rev=490310&r1=490309&r2=490310
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/portlets/GenericPlutoPortlet.java (original)
+++ portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/portlets/GenericPlutoPortlet.java Tue Dec 26 07:37:21 2006
@@ -28,7 +28,7 @@
public abstract String getViewPage();
public abstract String getEditPage();
- public abstract String getHelpPage();
+ public abstract String getHelpPage(RenderRequest request);
public void doView(RenderRequest request, RenderResponse response)
throws PortletException, IOException {
@@ -50,7 +50,7 @@
throws PortletException, IOException {
PortletContext context = getPortletContext();
PortletRequestDispatcher requestDispatcher =
- context.getRequestDispatcher(getHelpPage());
+ context.getRequestDispatcher(getHelpPage(request));
requestDispatcher.include(request, response);
}
}
Modified: portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/portlets/PageAdminPortlet.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/portlets/PageAdminPortlet.java?view=diff&rev=490310&r1=490309&r2=490310
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/portlets/PageAdminPortlet.java (original)
+++ portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/portlets/PageAdminPortlet.java Tue Dec 26 07:37:21 2006
@@ -36,10 +36,10 @@
public class PageAdminPortlet extends GenericPlutoPortlet {
private static final Log LOG = LogFactory.getLog(PageAdminPortlet.class);
-
- private static final String VIEW_PAGE = "/WEB-INF/fragments/admin/page/view.jsp";
- private static final String EDIT_PAGE = "/WEB-INF/fragments/admin/page/edit.jsp";
- private static final String HELP_PAGE = "/WEB-INF/fragments/admin/page/help.jsp";
+ private static final String JSP_DIR = "/WEB-INF/fragments/admin/page/";
+ private static final String VIEW_PAGE = JSP_DIR + "view.jsp";
+ private static final String EDIT_PAGE = JSP_DIR + "edit.jsp";
+ private static final String HELP_PAGE = JSP_DIR + "help.jsp";
public void processAction(ActionRequest request, ActionResponse response) {
@@ -96,8 +96,13 @@
return EDIT_PAGE;
}
- public String getHelpPage() {
- return HELP_PAGE;
+ public String getHelpPage(RenderRequest request) {
+ String incPage = HELP_PAGE;
+ String page = request.getParameter("helpPage");
+ if (page != null) {
+ incPage = JSP_DIR + page;
+ }
+ return incPage;
}
public Collection getAvailablePages() {
Added: portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/classes/AdminPortlet.properties
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/classes/AdminPortlet.properties?view=auto&rev=490310
==============================================================================
--- portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/classes/AdminPortlet.properties (added)
+++ portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/classes/AdminPortlet.properties Tue Dec 26 07:37:21 2006
@@ -0,0 +1,11 @@
+#AdminPortlet.properties
+
+#URL to the war deployer for this app server.
+#Tomcat's manager app is located at /manager/html
+#and requires that the logged in user is in the manager role.
+appserver.deployer.url=/manager/html/
+#Page in /WEB-INF/fragments/admin/page/ containing
+# help on using the app server's deployer, which is
+# displayed in the help mode. Help file for
+# Tomcat is TomcatDeploymentHelp.jsp
+appserver.deployer.help.page=TomcatDeploymentHelp.jsp
\ No newline at end of file
Added: portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/fragments/admin/page/TomcatDeploymentHelp.jsp
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/fragments/admin/page/TomcatDeploymentHelp.jsp?view=auto&rev=490310
==============================================================================
--- portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/fragments/admin/page/TomcatDeploymentHelp.jsp (added)
+++ portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/fragments/admin/page/TomcatDeploymentHelp.jsp Tue Dec 26 07:37:21 2006
@@ -0,0 +1,62 @@
+<%--
+Copyright 2006 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.
+--%>
+
+<div class="portlet-section-header">Page Adminstrator Portlet Help</div>
+
+<div class="portlet-section-subheader">Adding New Portlets to a Portal Page</div>
+
+<p class="portlet-font">
+The Page Administrator Portlet works with deployed portlet applications. This deployment can be done via the Pluto
+Maven plugin or Ant task. Alternately, you can deploy the war using the 'Upload and deploy portlet war'
+link on the bottom of the Page Administrator Portlet that points to the app server's war deployer application.
+Clicking on that link opens up a new browser window, so you should disable any popup blockers for this page.
+</p>
+
+<div class="portlet-section-subheader">Uploading and deploying using Tomcat's Manager Application</div>
+<p class="portlet-font">
+The binary distribution of Pluto is built on Tomcat. Tomcat's deployer application is the manager application.
+Use that application to upload and deploy the war. A properly deployed portlet on Tomcat requires that the war
+have a context.xml file in META-INF containing a Context element and the crossContext attribute set to true
+like this:<br/>
+<Context path="HelloWorldPortlet" docBase="HelloWorldPortlet" crossContext="true">
+</p>
+
+<p class="portlet-font">
+The logged in user also needs to have a manager role also,
+which is configured in conf/tomcat-users.xml. In the binary distribution, the tomcat and pluto users have the manager
+role set.In addition, the portlet application needs to be registered in pluto-portal-driver-config.xml with a
+proper portlet-app record like this:
+<pre>
+<portlet-app>
+ <context-path>/HelloWorldPortlet</context-path>
+ <portlets>
+ <portlet name="HelloWorldPortlet"/>
+ </portlets>
+ </portlet-app>
+</pre>
+When these steps have been done, restart Pluto and use the Page Administrator Portlet to add the new portlet to a page. If you want to put the portlet on a new page, you must do so by manually adding a page element as a child of the render-config element in pluto-portal-driver-config.xml before you restart Pluto.
+</p>
+
+<div class="portlet-section-subheader">Deployment in Another Application Server</div>
+<p class="portlet-font">
+ The 'Upload and deploy portlet war' link can be changed to an appropriate administrative page when Pluto
+ is deployed inside another (non-Tomcat) app server. This is done by changing the appserver.deployer.url property
+ inside AdminPortlet.properties located in the WEB-INF/classes directory to point to the URL of an appropriate administrative
+ page. The 'Help' link can also be changed to another help page using the appserver.deployer.help.page property.
+ That help file needs to reside in this directory (WEB-INF/fragments/admin/page).
+</p>
+
Modified: portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/fragments/admin/page/view.jsp
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/fragments/admin/page/view.jsp?view=diff&rev=490310&r1=490309&r2=490310
==============================================================================
--- portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/fragments/admin/page/view.jsp (original)
+++ portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/fragments/admin/page/view.jsp Tue Dec 26 07:37:21 2006
@@ -15,7 +15,9 @@
limitations under the License.
--%>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
+<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/portlet" prefix="portlet" %>
+<%@ taglib uri="http://portals.apache.org/pluto/portlet-el" prefix="portlet-el" %>
<portlet:actionURL var="formActionUrl"/>
<form name="adminForm" action="<c:out value="${formActionUrl}"/>" method="POST">
@@ -135,3 +137,18 @@
</p>
</div>
</form>
+<%-- Properties for link to app server deployer and help mode file --%>
+<fmt:bundle basename="AdminPortlet">
+ <fmt:message key="appserver.deployer.url" var="deployerURL"/>
+ <fmt:message key="appserver.deployer.help.page" var="deployerHelp"/>
+</fmt:bundle>
+
+<portlet:renderURL portletMode="help" var="deployerhelpURL">
+ <%-- needed el taglib to be able to use fmt:message value above --%>
+ <portlet-el:param name="helpPage" value="${deployerHelp}"/>
+</portlet:renderURL>
+
+<div>
+<a href='<c:out value="${deployerURL}"/>' target="_blank">Upload and deploy a new portlet war</a>
+<a href='<c:out value="${deployerhelpURL}"/>'>Help</a>
+</div>
Added: portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/tld/portlet-el.tld
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/tld/portlet-el.tld?view=auto&rev=490310
==============================================================================
--- portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/tld/portlet-el.tld (added)
+++ portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/tld/portlet-el.tld Tue Dec 26 07:37:21 2006
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE taglib PUBLIC
+ "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
+ "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
+<!--
+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.
+-->
+<taglib>
+ <tlibversion>1.0</tlibversion>
+ <jspversion>1.2</jspversion>
+ <shortname>portlet</shortname>
+ <uri>http://portals.apache.org/pluto/portlet-el</uri>
+ <tag>
+ <name>defineObjects</name>
+ <tagclass>org.apache.pluto.tags.DefineObjectsTag</tagclass>
+ <teiclass>org.apache.pluto.tags.DefineObjectsTag$TEI</teiclass>
+ <bodycontent>empty</bodycontent>
+ </tag>
+ <tag>
+ <name>param</name>
+ <tagclass>org.apache.pluto.tags.el.ParamTag</tagclass>
+ <bodycontent>empty</bodycontent>
+ <attribute>
+ <name>name</name>
+ <required>true</required>
+ <rtexprvalue>false</rtexprvalue>
+ </attribute>
+ <attribute>
+ <name>value</name>
+ <required>true</required>
+ <rtexprvalue>false</rtexprvalue>
+ </attribute>
+ </tag>
+ <tag>
+ <name>actionURL</name>
+ <tagclass>org.apache.pluto.tags.ActionURLTag</tagclass>
+ <teiclass>org.apache.pluto.tags.BasicURLTag$TEI</teiclass>
+ <bodycontent>JSP</bodycontent>
+ <attribute>
+ <name>windowState</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ <attribute>
+ <name>portletMode</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ <attribute>
+ <name>secure</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ <attribute>
+ <name>var</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ </tag>
+ <tag>
+ <name>renderURL</name>
+ <tagclass>org.apache.pluto.tags.RenderURLTag</tagclass>
+ <teiclass>org.apache.pluto.tags.BasicURLTag$TEI</teiclass>
+ <bodycontent>JSP</bodycontent>
+ <attribute>
+ <name>windowState</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ <attribute>
+ <name>portletMode</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ <attribute>
+ <name>secure</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ <attribute>
+ <name>var</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ </attribute>
+ </tag>
+ <tag>
+ <name>namespace</name>
+ <tagclass>org.apache.pluto.tags.NamespaceTag</tagclass>
+ <bodycontent>empty</bodycontent>
+ </tag>
+</taglib>
\ No newline at end of file
Modified: portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/web.xml?view=diff&rev=490310&r1=490309&r2=490310
==============================================================================
--- portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/web.xml (original)
+++ portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/web.xml Tue Dec 26 07:37:21 2006
@@ -135,6 +135,11 @@
</taglib>
<taglib>
+ <taglib-uri>http://portals.apache.org/pluto/portlet-el</taglib-uri>
+ <taglib-location>/WEB-INF/tld/portlet-el.tld</taglib-location>
+ </taglib>
+
+ <taglib>
<taglib-uri>http://portals.apache.org/pluto</taglib-uri>
<taglib-location>/WEB-INF/tld/pluto.tld</taglib-location>
</taglib>