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 2007/07/03 20:07:11 UTC

svn commit: r552934 - in /portals/pluto/trunk: pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/config/impl/ pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/ pluto-portal-driver/src/main/java/org/apac...

Author: cdoremus
Date: Tue Jul  3 11:07:10 2007
New Revision: 552934

URL: http://svn.apache.org/viewvc?view=rev&rev=552934
Log:
Changes to incorporate Add/Remove Page functionality to Page Administrator Portlet to fix PLUTO-387.

Modified:
    portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/config/impl/DriverConfigurationImpl.java
    portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/RenderConfigServiceImpl.java
    portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/PortalDriverServlet.java
    portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/config/DriverConfiguration.java
    portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/portlets/PageAdminPortlet.java
    portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/RenderConfig.java
    portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/RenderConfigService.java
    portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/admin/RenderConfigAdminService.java
    portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/fragments/admin/page/help.jsp
    portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/fragments/admin/page/view.jsp

Modified: portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/config/impl/DriverConfigurationImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/config/impl/DriverConfigurationImpl.java?view=diff&rev=552934&r1=552933&r2=552934
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/config/impl/DriverConfigurationImpl.java (original)
+++ portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/config/impl/DriverConfigurationImpl.java Tue Jul  3 11:07:10 2007
@@ -194,5 +194,9 @@
     {
         return supportedWindowStateService.isWindowStateSupportedByPortlet(portletId, windowState);
     }
+    
+    public RenderConfigService getRenderConfigService(){
+    	return renderService;
+    }
 }
 

Modified: portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/RenderConfigServiceImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/RenderConfigServiceImpl.java?view=diff&rev=552934&r1=552933&r2=552934
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/RenderConfigServiceImpl.java (original)
+++ portals/pluto/trunk/pluto-portal-driver-impl/src/main/java/org/apache/pluto/driver/services/impl/resource/RenderConfigServiceImpl.java Tue Jul  3 11:07:10 2007
@@ -1,9 +1,9 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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
@@ -99,5 +99,9 @@
 
     public void addPage(PageConfig pageConfig) {
         config.getRenderConfig().addPage(pageConfig);
+    }
+    
+    public void removePage(PageConfig pageConfig){
+        config.getRenderConfig().removePage(pageConfig);
     }
 }

Modified: portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/PortalDriverServlet.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/PortalDriverServlet.java?view=diff&rev=552934&r1=552933&r2=552934
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/PortalDriverServlet.java (original)
+++ portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/PortalDriverServlet.java Tue Jul  3 11:07:10 2007
@@ -52,7 +52,7 @@
     /** The Portal Driver sServlet Context */
     private ServletContext servletContext;
 
-    protected static final String DEFAULT_PAGE_URI =
+    public static final String DEFAULT_PAGE_URI =
     		"/WEB-INF/themes/pluto-default-theme.jsp";
 
     /** The portlet container to which we will forward all portlet requests. */

Modified: portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/config/DriverConfiguration.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/config/DriverConfiguration.java?view=diff&rev=552934&r1=552933&r2=552934
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/config/DriverConfiguration.java (original)
+++ portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/config/DriverConfiguration.java Tue Jul  3 11:07:10 2007
@@ -21,6 +21,7 @@
 import javax.servlet.ServletContext;
 
 import org.apache.pluto.driver.services.portal.PageConfig;
+import org.apache.pluto.driver.services.portal.RenderConfigService;
 import org.apache.pluto.driver.url.PortalURLParser;
 import org.apache.pluto.spi.PortalCallbackService;
 import org.apache.pluto.spi.optional.PortletPreferencesService;
@@ -111,4 +112,6 @@
     PortletPreferencesService getPortletPreferencesService();
 
     PortalURLParser getPortalUrlParser();
+    
+    public RenderConfigService getRenderConfigService();
 }

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=552934&r1=552933&r2=552934
==============================================================================
--- 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 Jul  3 11:07:10 2007
@@ -20,9 +20,11 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.pluto.driver.AttributeKeys;
+import org.apache.pluto.driver.PortalDriverServlet;
 import org.apache.pluto.driver.config.DriverConfiguration;
 import org.apache.pluto.driver.services.portal.PageConfig;
 import org.apache.pluto.driver.services.portal.PortletWindowConfig;
+import org.apache.pluto.driver.services.portal.RenderConfigService;
 
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
@@ -31,7 +33,6 @@
 import javax.portlet.RenderResponse;
 
 import java.io.File;
-import java.io.FileReader;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -52,21 +53,23 @@
 
     public void processAction(ActionRequest request, ActionResponse response) {
         String command = request.getParameter("command");
-        if("Add Portlet".equalsIgnoreCase(command)) {
-            doAddPortlet(request);
-        }
-        else if ("Remove Portlet".equalsIgnoreCase(command)) {
-            doRemovePortlet(request);
-        }
         try {
+	        if("Add Portlet".equalsIgnoreCase(command)) {
+	            doAddPortlet(request);
+	        } else if ("Remove Portlet".equalsIgnoreCase(command)) {
+	            doRemovePortlet(request);
+	        } else if ("Add Page".equalsIgnoreCase(command)) {
+	        	doAddPage(request);
+	        } else if ("Remove Page".equalsIgnoreCase(command)) {
+	        	doRemovePage(request);
+	        }
 			persistPages();
 		} catch (IOException e) {
-			String msg = "Problem persisting configuration changes";
+			String msg = "Problem persisting configuration changes. Changes will not be persisted.";
 			LOG.error(msg, e);
-			IllegalStateException ese = new IllegalStateException(msg);
-			ese.initCause(e);
-			throw ese;
+			//TODO: send message back to UI
 		}
+		//TODO: send 'success' message back to UI
     }
 
     public void doAddPortlet(ActionRequest request) {
@@ -81,7 +84,68 @@
 
     }
 
+    /**
+     * Adds a page to the portal via the <code>RenderConfigService</code>.
+     * 
+     *  This does not add portlets to the new page. Do that when the page is created
+     *  using the Add Portlet button.
+     *   
+     * @param request The action request.
+     */
+    public void doAddPage(ActionRequest request) {
+        String page = request.getParameter("newPage");//newPage text input element
+        //Check if page is null or empty
+        if (page == null || page.equals("")) {
+			LOG.warn("Page parameter is null or empty. Page addition will be ignored.");
+			//TODO: send message back to UI
+        	return;
+        }
+        //TODO: add page URI input to form
+        String uri = request.getParameter("pageURI");
+        if (uri == null) {
+        	uri = PortalDriverServlet.DEFAULT_PAGE_URI;
+        }
+        DriverConfiguration driverConfig = (DriverConfiguration) getPortletContext()
+    		.getAttribute(AttributeKeys.DRIVER_CONFIG);
+        PageConfig pageConfig = new PageConfig();
+        pageConfig.setName(page);
+        pageConfig.setUri(uri);
+
+        RenderConfigService renderConfig = driverConfig.getRenderConfigService();
+        renderConfig.addPage(pageConfig);
+    }
+
+    /**
+     * Removes a page from the portal ignoring any requests to remove the default page
+     * or the Pluto Admin page. 
+     * 
+     * The page's portlets are still available, but no longer associated with the deleted page.
+     * 
+     * @param request The action request.
+     * @throws IOException If a problem occurs accessing the config file.
+     */
+    public void doRemovePage(ActionRequest request) throws IOException {
+        String page = request.getParameter("page");
+        DriverConfiguration driverConfig = (DriverConfiguration) getPortletContext()
+    	.getAttribute(AttributeKeys.DRIVER_CONFIG);
+        //make sure we are not deleting the default page
+		String defaultPage = getDefaultPage();
+	    if (page.equalsIgnoreCase(defaultPage)) {
+			LOG.warn("Trying to delete the default page. Page deletion will be ignored.");
+			//TODO: send message back to UI
+	    	return;
+	    }
+        //make sure we are not deleting the Pluto Admin page
+		if (page.equalsIgnoreCase("Pluto Admin")) {
+			LOG.warn("Trying to delete the Pluto Admin page. Page deletion will be ignored.");
+			return;
+		}
 
+		PageConfig pageConfig = getPageConfig(page);
+        RenderConfigService renderConfig = driverConfig.getRenderConfigService();
+        renderConfig.removePage(pageConfig);
+    }
+    
     public void doRemovePortlet(ActionRequest request) {
         String page = request.getParameter("page");
         String portletId = request.getParameter("placedPortlets");
@@ -143,20 +207,23 @@
         return list;
     }
 
+    /**
+     * Persist page configuration changes to render-config section of pluto-portal-driver-config.xml.
+     * 
+     * TODO: Use JAXB for config file parsing and persistence.
+     * 
+     * @throws IOException
+     */
     private void persistPages() throws IOException {
-    	//TODO: Null checks. Substitute empty string or throw an Exception
+    	//TODO: Null checks??? Substitute empty string or throw an Exception
     	final String NL = System.getProperty("line.separator");
         DriverConfiguration driverConfig = (DriverConfiguration) getPortletContext()
         	.getAttribute(AttributeKeys.DRIVER_CONFIG);
-    	String path = getPortletContext().getRealPath(CONFIG_FILE_PATH);
-    	File configFile = new File(path);
-    	String configFileContents = FileUtils.readFileToString(configFile);
     	StringBuffer renderConfig = new StringBuffer();
     	//start with render-config element
     	renderConfig.append(" ");//indent
     	renderConfig.append(RENDER_CONFIG_SEARCH_TOKEN);
-    	String defaultPage = parseDefaultPage(configFileContents);
-    	renderConfig.append(defaultPage);
+    	renderConfig.append(getDefaultPage());
     	renderConfig.append("\">");
     	renderConfig.append(NL);
     	Collection pages = getAvailablePages();
@@ -196,13 +263,39 @@
     	renderConfig.append(NL);
     	//create new config file content
     	StringBuffer newFileContents = new StringBuffer();
-    	newFileContents.append(getContentBeforeRenderConfig(configFileContents));
+    	newFileContents.append(getContentBeforeRenderConfig(getConfigFileContents()));
     	newFileContents.append(renderConfig);
-    	//persist to new config file content to file
-    	FileUtils.writeStringToFile(configFile, newFileContents.toString());
+    	//persist content to new config file
+    	FileUtils.writeStringToFile(getConfigFile(), newFileContents.toString());
+    }
+    
+    private String getConfigFileContents() throws IOException {
+    	return FileUtils.readFileToString(getConfigFile());
+    }
+
+    private File getConfigFile() {
+    	String path = getPortletContext().getRealPath(CONFIG_FILE_PATH);
+    	return new File(path);
     }
     
+    /**
+     * Get the page name of the default page from pluto-portal-driver-config.xml.
+     * 
+     * @return
+     * @throws IOException
+     */
+    private String getDefaultPage() throws IOException {
+    	String configFileContents = getConfigFileContents();
+    	return parseDefaultPage(configFileContents);
+    }
     
+    /**
+     * Gets the content of the config page before the render-config element
+     * (also including the default attribute of render-config - see RENDER_CONFIG_SEARCH_TOKEN above).
+     * 
+     * @param contents pluto-portal-driver-config.xml file contents.
+     * @return
+     */
     protected static String getContentBeforeRenderConfig(String contents) {
     	return contents.substring(0, contents.indexOf(RENDER_CONFIG_SEARCH_TOKEN));
     }

Modified: portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/RenderConfig.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/RenderConfig.java?view=diff&rev=552934&r1=552933&r2=552934
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/RenderConfig.java (original)
+++ portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/RenderConfig.java Tue Jul  3 11:07:10 2007
@@ -1,9 +1,9 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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
@@ -121,6 +121,10 @@
     public void addPage(PageConfig config) {
         config.setOrderNumber(orderNumberCounter++);
         pages.put(config.getName(), config);
+    }
+    
+    public void removePage(PageConfig config){
+        pages.remove(config.getName());
     }
 
 }

Modified: portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/RenderConfigService.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/RenderConfigService.java?view=diff&rev=552934&r1=552933&r2=552934
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/RenderConfigService.java (original)
+++ portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/RenderConfigService.java Tue Jul  3 11:07:10 2007
@@ -48,4 +48,8 @@
      */
     PageConfig getPage(String id);
 
+    //added for page admin portlet
+    public void addPage(PageConfig pageConfig);
+    public void removePage(PageConfig pageConfig);
+        
 }

Modified: portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/admin/RenderConfigAdminService.java
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/admin/RenderConfigAdminService.java?view=diff&rev=552934&r1=552933&r2=552934
==============================================================================
--- portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/admin/RenderConfigAdminService.java (original)
+++ portals/pluto/trunk/pluto-portal-driver/src/main/java/org/apache/pluto/driver/services/portal/admin/RenderConfigAdminService.java Tue Jul  3 11:07:10 2007
@@ -1,9 +1,9 @@
 /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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
@@ -28,6 +28,9 @@
 public interface RenderConfigAdminService {
 
     public void addPage(PageConfig config)
+        throws DriverConfigurationException;
+    
+    public void removePage(PageConfig config)
         throws DriverConfigurationException;
 
 }

Modified: portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/fragments/admin/page/help.jsp
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/fragments/admin/page/help.jsp?view=diff&rev=552934&r1=552933&r2=552934
==============================================================================
--- portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/fragments/admin/page/help.jsp (original)
+++ portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/fragments/admin/page/help.jsp Tue Jul  3 11:07:10 2007
@@ -23,12 +23,11 @@
 <div class="portlet-section-header">Page Adminstrator Portlet Help</div>
 
 <p class="portlet-font">
-The Page Administrator Portlet is used to add and remove portlets from portal pages. The current
-version of this application does not deploy the portlet application war or persist page
-configurations that are held in pluto-portal-driver-config.xml.
+The Page Administrator Portlet is used to add and remove pages and portlets from portal pages. The portlet
+also persist these changes to pluto-portal-driver-config.xml in pluto's WEB-INF directory.
 </p>
 
-<div class="portlet-section-subheader">Configuring a Portlet Application</div>
+<div class="portlet-section-subheader"><a name="ConfiguringPortletApp">Configuring a Portlet Application</a></div>
 <p class="portlet-font">
 The portlet application needs to be bundled in a war file as per the Java Portlet Specification. 
 The war also needs to include proper PortletServlet servlet and servlet-mapping records in WEB-INF/web.xml.
@@ -45,7 +44,8 @@
 in the META-INF directory of the war file. Here's an example of one for a portlet bundled for a 
 HelloWorldPortlet context (file name is HelloWorldPortlet.xml): 
 <pre>
-&lt;Context path="/HelloWorldPortlet" docBase="HelloWorldPortlet" crossContext="true"/&gt; 
+&lt;Context path="/HelloWorldPortlet" 
+	docBase="HelloWorldPortlet" crossContext="true"/&gt; 
 </pre>  
 The crossContext attribute allows Pluto, which is deployed in its own Tomcat context, to work with this custom portlet. 
 </p>
@@ -56,35 +56,68 @@
 	Pluto is deployed in Tomcat. In this case, you can use the Tomcat manager app to deploy the portlet
 	war. There is a 'Upload and deploy portlet war' link at the bottom of the Page Administrator portlet that points to 
 	the manager app	in the bundled distribution (this link can be changed for other app servers -- see the 
-	adjacent Help link). In the bundled distribution of Pluto, you can also simply drop the portlet application war into Tomcat's 
-    webapp directory.
+	adjacent Help link). Use of the manager application requires you to be logged into Pluto in a manager role (pluto or
+	tomcat user). 
+</p>
+	
+<p class="portlet-font">
+	In the bundled distribution of Pluto, you can also deploy a properly configured portlet application by simply dropping
+	the war file into the webapp directory (see <a href="#ConfiguringPortletApp">Configuring a Portlet Application</a> above).
+	You will need to restart Pluto in order for the Page Administrator Portlet to see the newly deployed portlet so it
+	can be added to a portal page.
 </p>
 
-<div class="portlet-section-subheader">Adding Portlets to a Portal Pages</div>
+<div class="portlet-section-subheader">Adding Portal Pages</div>
 <p class="portlet-font">
-Adding portlets to a portal page using the Pluto Page Administrator portlet involves first selecting a portal 
-page using the Portal Pages drop-down and then selecting a portlet application using the Portlet Applications 
-drop-down and finally a portlet in the adjacent drop down. When this is done, click the Add Portlet button.
+Adding a new portal page using the Pluto Page Administrator portlet involves inputing the page name into the text box adjacent 
+to the Add Page button and clicking on the button. The new page is created with the default 'theme', which lays out the 
+portlets in two columns (see /WEB-INF/themes/pluto-default-theme.jsp in the pluto webapp for details). Once a page
+has been added, portlets will need to be added to the page (see <a href="#AddingPortlets">Adding Portlets to a Portal Page</a>).
+</p>
+
+<p class="portlet-font">
+Please note that adding a new Page with the name of an existing page will replace the existing page with the
+new page. This is equivalent to removing the page and adding it again with the same name.
 </p>
 
 <div class="portlet-section-subheader">Removing Portal Pages</div>
 <p class="portlet-font">
-Removing portlets from a portal page involves selecting a portal page using the Portal Pages drop-down, selecting
-the portlet in the adjacent list and then clicking on the Remove Page button.
+Removing a portal page using the Pluto Page Administrator portlet involves selecting a page in the drop down above 
+the Remove Page button and clicking on the button. You are not allowed to remove the default page 
+(default attribute of the render-config element in pluto-portal-driver-config.xml) and the Pluto Admin page.
+</p>
+
+<div class="portlet-section-subheader"><a name="AddingPortlets">Adding Portlets to a Portal Page</a></div>
+<p class="portlet-font">
+Adding portlets to a portal page using the Pluto Page Administrator portlet involves first selecting a portal 
+page in the Portal Pages drop-down (above the Remove Page button) and then selecting a portlet application 
+using the Portlet Applications drop-down and finally a portlet in the adjacent drop down. When this is done, 
+click the Add Portlet button.
+</p>
+
+<div class="portlet-section-subheader">Removing Portlets from a Portal Page</div>
+<p class="portlet-font">
+Removing portlets from a portal page involves selecting a portal page on the Portal Pages drop-down 
+(above the Remove Page button), selecting the portlet in the adjacent list and then clicking on the 
+Remove Portlet button.
 </p>
 
 
 <div class="portlet-section-subheader">Manually Updating the Configuration File</div>
 <p class="portlet-font">
-The Page Administrator Portlet does not allow the addition of pages. This must be done manually in the 
-pluto-portal-driver-config.xml file.
+The pluto-portal-driver-config.xml file holds changes made by the Page Administrator Portlet. You can manually 
+update this file to add pages or portlets. If this is done, please be careful of the structure of the 
+render-config child elements. 
 </p>
 
 <p class="portlet-font">
-New portal pages can be created in the config file by adding a page element under render-config. 
-The uri attribute of the page element points to a JSP page that will contain a portlet (or portlets) defined in 
-its child (or children) portlet element(s). The default 'theme' lays out the portlets in two columns 
-(see WEB-INF\themes\pluto-default-theme.jsp in the pluto webapp for details). 
+You can also change the theme of portlets and the default page -- the portal's 
+home page after login -- in this config file. The theme will require a proper URI to a file containing
+the new theme. Use the default theme (/WEB-INF/themes/pluto-default-theme.jsp in the pluto webapp) for 
+an example theme elements.
+
+Again, be careful to not modify the XML structure of the 
+config file if you choose to change the theme or default 
 </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=552934&r1=552933&r2=552934
==============================================================================
--- 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 Jul  3 11:07:10 2007
@@ -51,7 +51,10 @@
               }
 
               var disabled = select.value == 'Select. . .'
-              document.forms['adminForm'].elements['command'][0].disabled = disabled;
+        	  //disable 'Remove Page' button
+              document.forms['adminForm'].elements['command'][1].disabled = disabled;
+        	  //disable 'Remove Portlet' button
+              document.forms['adminForm'].elements['command'][2].disabled = disabled;
 
               if(disabled) {
                   return;
@@ -64,9 +67,10 @@
           }
       </script>
 
-
-
-
+	<p>
+ 		<input type="text" name="newPage"></input>
+    	<input id="addPageButton" type="submit" name="command" value="Add Page"></input>
+	</p>
 
     <select name="page" onChange="<portlet:namespace/>doSwitchPage(this)">
       <option value="Select. . .">Select. . .</option>
@@ -79,6 +83,7 @@
 
     </select>
     <p>
+      <input id="removePageButton" type="submit" name="command" disabled="true" value="Remove Page"></input>
       <input id="removeButton" type="submit" name="command" disabled="true" value="Remove Portlet"></input>
     </p>
   </p>
@@ -116,7 +121,8 @@
         }
 
         function <portlet:namespace/>doSwitchButton(select) {
-            document.forms['adminForm'].elements['command'][1].disabled = (select.value == 'Select. . .' || select.disabled);
+        	//disable 'Add Portlet' button
+            document.forms['adminForm'].elements['command'][3].disabled = (select.value == 'Select. . .' || select.disabled);
         }
     </script>