You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by rw...@apache.org on 2006/03/30 06:34:17 UTC

svn commit: r389988 - in /portals/jetspeed-2/trunk: ./ maven-archetypes/application/src/archetype/META-INF/ maven-archetypes/application/src/archetype/archetype-resources/ maven-archetypes/application/src/archetype/archetype-resources/src/java/ maven-a...

Author: rwatler
Date: Wed Mar 29 20:34:15 2006
New Revision: 389988

URL: http://svn.apache.org/viewcvs?rev=389988&view=rev
Log:
Maven2: checkpoint commit adding application portlet tempalte and component/application test templates

Added:
    portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/src/java/
    portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/src/java/ApplicationPortlet.java   (with props)
    portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/src/test/
    portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/src/test/TestApplicationPortlet.java   (with props)
    portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/src/test/log4j.properties   (with props)
    portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/src/webapp/WEB-INF/view/
    portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/src/webapp/WEB-INF/view/application-portlet-edit.vm   (with props)
    portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/src/webapp/WEB-INF/view/application-portlet-help.vm   (with props)
    portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/src/webapp/WEB-INF/view/application-portlet-view.vm   (with props)
Modified:
    portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/META-INF/archetype.xml
    portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/pom.xml
    portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/src/webapp/WEB-INF/portlet.xml
    portals/jetspeed-2/trunk/maven-archetypes/component/src/archetype/META-INF/archetype.xml
    portals/jetspeed-2/trunk/maven-archetypes/component/src/archetype/archetype-resources/src/test/TestComponent.java
    portals/jetspeed-2/trunk/maven-archetypes/portal/src/archetype/META-INF/archetype.xml
    portals/jetspeed-2/trunk/settings.xml.sample

Modified: portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/META-INF/archetype.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/META-INF/archetype.xml?rev=389988&r1=389987&r2=389988&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/META-INF/archetype.xml (original)
+++ portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/META-INF/archetype.xml Wed Mar 29 20:34:15 2006
@@ -17,6 +17,7 @@
 -->
         
 <archetype>
+
     <id>portal-archetype</id>
     <allowPartial>true</allowPartial>
 
@@ -33,6 +34,18 @@
         <resource>src/webapp/WEB-INF/velocity/toolbox.xml</resource>
         <resource>src/webapp/WEB-INF/velocity/velocity-macros.vm</resource>
         <resource>src/webapp/WEB-INF/velocity/velocity.properties</resource>
+        <resource>src/webapp/WEB-INF/view/application-portlet-edit.vm</resource>
+        <resource>src/webapp/WEB-INF/view/application-portlet-help.vm</resource>
+        <resource>src/webapp/WEB-INF/view/application-portlet-view.vm</resource>
     </resources>
+    <sources>
+        <source>src/java/ApplicationPortlet.java</source>
+    </sources>
+    <testSources>
+        <source>src/test/TestApplicationPortlet.java</source>
+    </testSources>
+    <testResources>
+        <resource>src/test/log4j.properties</resource>
+    </testResources>
 
 </archetype>

Modified: portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/pom.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/pom.xml?rev=389988&r1=389987&r2=389988&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/pom.xml (original)
+++ portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/pom.xml Wed Mar 29 20:34:15 2006
@@ -42,6 +42,10 @@
 
         <!-- Build Dependencies -->
         <dependency>
+            <groupId>org.apache.portals.bridges</groupId>
+            <artifactId>portals-bridges-velocity</artifactId>
+        </dependency>
+        <dependency>
             <groupId>velocity</groupId>
             <artifactId>velocity</artifactId>
         </dependency>
@@ -69,11 +73,6 @@
         <dependency>
             <groupId>taglibs</groupId>
             <artifactId>request</artifactId>
-            <scope>runtime</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.portals.bridges</groupId>
-            <artifactId>portals-bridges-velocity</artifactId>
             <scope>runtime</scope>
         </dependency>
         <dependency>

Added: portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/src/java/ApplicationPortlet.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/src/java/ApplicationPortlet.java?rev=389988&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/src/java/ApplicationPortlet.java (added)
+++ portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/src/java/ApplicationPortlet.java Wed Mar 29 20:34:15 2006
@@ -0,0 +1,579 @@
+/*
+ * 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.
+ */
+package ${groupId};
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.security.Principal;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.GenericPortlet;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletException;
+import javax.portlet.PortletMode;
+import javax.portlet.PortletPreferences;
+import javax.portlet.PortletRequest;
+import javax.portlet.PortletSession;
+import javax.portlet.PortletURL;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+import javax.portlet.WindowState;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.portals.bridges.velocity.GenericVelocityPortlet;
+import org.apache.velocity.context.Context;
+
+/**
+ * ApplicationPortlet
+ *
+ * @author <a href="mailto:"></a>
+ * @version $Id:$
+ */
+public class ApplicationPortlet extends GenericVelocityPortlet
+{
+    /**
+     * Class specific log instance.
+     */
+    private final static Log log = LogFactory.getLog(ApplicationPortlet.class);
+
+    /**
+     * ApplicationPortlet constructor.
+     */
+    public ApplicationPortlet()
+    {
+        super();
+    }
+    
+    /**
+     * Called by the portlet container to indicate to a portlet that the 
+     * portlet is being placed into service.
+     *
+     * The portlet container calls the init
+     * method exactly once after instantiating the portlet.
+     * The init method must complete successfully
+     * before the portlet can receive any requests.
+     *
+     * The portlet container cannot place the portlet into service
+     * if the init method
+     * 
+     * - Throws a PortletException
+     * - Does not return within a time period defined by the portlet container.
+     *
+     * @param config a PortletConfig object 
+     *               containing the portlet's
+     *               configuration and initialization parameters
+     * @exception PortletException if an exception has occurred that
+     *                             interferes with the portlet's normal
+     *                             operation.
+     * @exception UnavailableException if the portlet cannot perform
+     *                                 the initialization at this time.
+     *
+     */
+    public void init(PortletConfig config)
+        throws PortletException
+    {
+        // save config and invoke init()
+        super.init(config);
+    }
+
+    /**
+     *
+     * A convenience method which can be overridden so that there's no need
+     * to call super.init(config).
+     *
+     * Instead of overriding init(PortletConfig), simply override
+     * this method and it will be called by
+     * GenericPortlet.init(PortletConfig config).
+     * The PortletConfig object can still be retrieved via getPortletConfig. 
+     *
+     * @exception PortletException if an exception has occurred that
+     *                             interferes with the portlet normal
+     *                             operation.
+     * @exception UnavailableException if the portlet is unavailable to perform init
+     */    
+    public void init()
+        throws PortletException
+    {
+        getPortletContext().log("ApplicationPortlet.init() invoked...");
+        log.debug("ApplicationPortlet.init() invoked...");
+
+        super.init();
+    }
+    
+    /**
+     * Called by the portlet container to allow the portlet to process
+     * an action request. This method is called if the client request was
+     * originated by a URL created (by the portlet) with the 
+     * RenderResponse.createActionURL() method.
+     * 
+     * Typically, in response to an action request, a portlet updates state 
+     * based on the information sent in the action request parameters.
+     * In an action the portlet may:
+     * 
+     * - issue a redirect
+     * - change its window state
+     * - change its portlet mode
+     * - modify its persistent state
+     * - set render parameters
+     * 
+     * 
+     * A client request triggered by an action URL translates into one 
+     * action request and many render requests, one per portlet in the portal page.
+     * The action processing must be finished before the render requests
+     * can be issued.
+     *
+     * @param request the action request
+     * @param response the action response
+     * @exception PortletException if the portlet has problems fulfilling the
+     *                              request
+     * @exception UnavailableException if the portlet is unavailable to process
+     *                                  the action at this time
+     * @exception PortletSecurityException if the portlet cannot fullfill this
+     *                                      request because of security reasons
+     * @exception IOException if the streaming causes an I/O problem
+     */
+    public void processAction(ActionRequest request, ActionResponse response)
+        throws PortletException, IOException
+    {
+        getPortletContext().log("ApplicationPortlet.processAction() invoked...");
+        log.debug("ApplicationPortlet.processAction() invoked...");
+
+        // precess action from request parameters
+        Enumeration requestParametersEnum = request.getParameterNames();
+        while (requestParametersEnum.hasMoreElements())
+        {
+            String name = (String) requestParametersEnum.nextElement();
+            String [] values = request.getParameterValues(name);
+
+            // log.debug, redirect, or side effect various parameters, attributes,
+            // and preferences
+            if (name.equals("test-action") && (values.length == 1) && (values[0] != null))
+            {
+                getPortletContext().log("ApplicationPortlet.processAction() received action: "+name+" value="+values[0]);
+                log.debug("ApplicationPortlet.processAction() received action: "+name+" value="+values[0]);
+            }
+            else if (name.equals("redirect-action") && (values.length == 1) && (values[0] != null))
+            {
+                getPortletContext().log("ApplicationPortlet.processAction() received action: "+name+" url="+values[0]);
+                log.debug("ApplicationPortlet.processAction() received action: "+name+" url="+values[0]);
+                if (values[0].startsWith("http://") || values[0].startsWith("https://"))
+                {
+                    response.sendRedirect(values[0]);
+                    return ;
+                }
+            }
+            else if (name.equals("edit-context-attributes-name-action") && (values.length == 1) && (values[0] != null))
+            {
+                String [] attributeValues = request.getParameterValues("edit-context-attributes-value-action");
+                if ((attributeValues != null) && (attributeValues.length == 1) && (attributeValues[0] != null))
+                {
+                    getPortletContext().log("ApplicationPortlet.processAction() received action: "+name+", name="+values[0]+", value="+attributeValues[0]);
+                    log.debug("ApplicationPortlet.processAction() received action: "+name+", name="+values[0]+", value="+attributeValues[0]);
+                    getPortletContext().setAttribute(values[0], attributeValues[0]);
+                }
+                else
+                {
+                    getPortletContext().log("ApplicationPortlet.processAction() received action: "+name+", name="+values[0]);
+                    log.debug("ApplicationPortlet.processAction() received action: "+name+", name="+values[0]);
+                    getPortletContext().removeAttribute(values[0]);
+                }
+            }
+            else if (name.equals("edit-preferences-name-action") && (values.length == 1) && (values[0] != null))
+            {
+                PortletPreferences prefs = request.getPreferences();
+                String [] preferenceValues = request.getParameterValues("edit-preferences-value-action");
+                if ((preferenceValues != null) && (preferenceValues.length == 1))
+                {
+                    preferenceValues = splitArrayValues(preferenceValues[0]);
+                }
+                if ((preferenceValues != null) && (preferenceValues.length > 0))
+                {
+                    getPortletContext().log("ApplicationPortlet.processAction() received action: "+name+", name="+values[0]+", value="+concatArrayValues(preferenceValues));
+                    log.debug("ApplicationPortlet.processAction() received action: "+name+", name="+values[0]+", value="+concatArrayValues(preferenceValues));
+                    if (! prefs.isReadOnly(values[0]))
+                    {
+                        prefs.setValues(values[0], preferenceValues);
+                        try
+                        {
+                            prefs.store();
+                        }
+                        catch (Exception e)
+                        {
+                            getPortletContext().log("ApplicationPortlet.processAction() preferences store exception caught", e);
+                            log.debug("ApplicationPortlet.processAction() preferences store exception caught", e);
+                        }
+                    }
+                    else
+                    {
+                        getPortletContext().log("ApplicationPortlet.processAction() read only preference: "+values[0]);
+                        log.debug("ApplicationPortlet.processAction() read only preference: "+values[0]);
+                    }
+                }
+                else
+                {
+                    getPortletContext().log("ApplicationPortlet.processAction() received action: "+name+", name="+values[0]);
+                    if (! prefs.isReadOnly(values[0]))
+                    {
+                        prefs.reset(values[0]);
+                        try
+                        {
+                            prefs.store();
+                        }
+                        catch (Exception e)
+                        {
+                            getPortletContext().log("ApplicationPortlet.processAction() preferences store exception caught", e);
+                            log.debug("ApplicationPortlet.processAction() preferences store exception caught", e);
+                        }
+                    }
+                    else
+                    {
+                        getPortletContext().log("ApplicationPortlet.processAction() read only preference: "+values[0]);
+                        log.debug("ApplicationPortlet.processAction() read only preference: "+values[0]);
+                    }
+                }
+            }
+            else if (name.equals("edit-session-application-attributes-name-action") && (values.length == 1) && (values[0] != null))
+            {
+                PortletSession session = request.getPortletSession(false);
+                String [] attributeValues = request.getParameterValues("edit-session-application-attributes-value-action");
+                if ((attributeValues != null) && (attributeValues.length == 1) && (attributeValues[0] != null))
+                {
+                    getPortletContext().log("ApplicationPortlet.processAction() received action: "+name+", name="+values[0]+", value="+attributeValues[0]);
+                    log.debug("ApplicationPortlet.processAction() received action: "+name+", name="+values[0]+", value="+attributeValues[0]);
+                    session.setAttribute(values[0], attributeValues[0], PortletSession.APPLICATION_SCOPE);
+                }
+                else
+                {
+                    getPortletContext().log("ApplicationPortlet.processAction() received action: "+name+", name="+values[0]);
+                    log.debug("ApplicationPortlet.processAction() received action: "+name+", name="+values[0]);
+                    session.removeAttribute(values[0], PortletSession.APPLICATION_SCOPE);
+                }
+            }
+            else if (name.equals("edit-session-portlet-attributes-name-action") && (values.length == 1) && (values[0] != null))
+            {
+                PortletSession session = request.getPortletSession(false);
+                String [] attributeValues = request.getParameterValues("edit-session-portlet-attributes-value-action");
+                if ((attributeValues != null) && (attributeValues.length == 1) && (attributeValues[0] != null))
+                {
+                    getPortletContext().log("ApplicationPortlet.processAction() received action: "+name+", name="+values[0]+", value="+attributeValues[0]);
+                    log.debug("ApplicationPortlet.processAction() received action: "+name+", name="+values[0]+", value="+attributeValues[0]);
+                    session.setAttribute(values[0], attributeValues[0], PortletSession.PORTLET_SCOPE);
+                }
+                else
+                {
+                    getPortletContext().log("ApplicationPortlet.processAction() received action: "+name+", name="+values[0]);
+                    log.debug("ApplicationPortlet.processAction() received action: "+name+", name="+values[0]);
+                    session.removeAttribute(values[0], PortletSession.PORTLET_SCOPE);
+                }
+            }
+            else if (name.equals("edit-request-attributes-name-action") && (values.length == 1) && (values[0] != null))
+            {
+                String [] attributeValues = request.getParameterValues("edit-request-attributes-value-action");
+                if ((attributeValues != null) && (attributeValues.length == 1) && (attributeValues[0] != null))
+                {
+                    getPortletContext().log("ApplicationPortlet.processAction() received action: "+name+", name="+values[0]+", value="+attributeValues[0]);
+                    log.debug("ApplicationPortlet.processAction() received action: "+name+", name="+values[0]+", value="+attributeValues[0]);
+                    request.setAttribute(values[0], attributeValues[0]);
+                }
+                else
+                {
+                    getPortletContext().log("ApplicationPortlet.processAction() received action: "+name+", name="+values[0]);
+                    log.debug("ApplicationPortlet.processAction() received action: "+name+", name="+values[0]);
+                    request.removeAttribute(values[0]);
+                }
+            }
+            else if (name.equals("set-render-parameters-name-action") && (values.length == 1) && (values[0] != null))
+            {
+                String [] parameterValues = request.getParameterValues("set-render-parameters-value-action");
+                if ((parameterValues != null) && (parameterValues.length == 1))
+                {
+                    parameterValues = splitArrayValues(parameterValues[0]);
+                }
+                if ((parameterValues != null) && (parameterValues.length > 0))
+                {
+                    getPortletContext().log("ApplicationPortlet.processAction() received action: "+name+", name="+values[0]+", value="+concatArrayValues(parameterValues));
+                    log.debug("ApplicationPortlet.processAction() received action: "+name+", name="+values[0]+", value="+concatArrayValues(parameterValues));
+                    response.setRenderParameter(values[0], parameterValues);
+                }
+            }
+
+            // propagate action request parameters as render parameters
+            response.setRenderParameter((name.startsWith("ACTION-PARAMETER-") ? name : "ACTION-PARAMETER-"+name), values);
+        }
+    }
+    
+    /**
+     * Called by the portlet container to allow the portlet to generate
+     * the content of the response based on its current state.
+     *
+     * @param request the render request
+     * @param response the render response
+     * @exception PortletException if the portlet has problems fulfilling the
+     *                             rendering request
+     * @exception UnavailableException if the portlet is unavailable to
+     *                                 perform render at this time
+     * @exception PortletSecurityException if the portlet cannot fullfill this
+     *                                     request because of security reasons
+     * @exception java.io.IOException if the streaming causes an I/O problem
+     */
+    public void render(RenderRequest request, RenderResponse response)
+        throws PortletException, IOException
+    {
+        // invoke getTitle() and doDispatch()
+        super.render(request, response);
+    }
+    
+    /**
+     * Used by the render method to get the title.
+     * 
+     * The default implementation gets the title from the ResourceBundle
+     * of the PortletConfig of the portlet. The title is retrieved
+     * using the 'javax.portlet.title' resource name.
+     * 
+     * Portlets can overwrite this method to provide dynamic
+     * titles (e.g. based on locale, client, and session information).
+     * Examples are:
+     * 
+     * - language-dependant titles for multi-lingual portals
+     * - shorter titles for WAP phones
+     * - the number of messages in a mailbox portlet
+     * 
+     * @return the portlet title for this window
+     */
+    protected String getTitle(RenderRequest request)
+    {
+        // return "javax.portlet.title" resource using request locale
+        return super.getTitle(request);
+    }
+    
+    /**
+     * The default implementation of this method routes the render request
+     * to a set of helper methods depending on the current portlet mode the
+     * portlet is currently in.
+     * These methods are:
+     * 
+     * - doView for handling view requests
+     * - doEdit for handling edit requests
+     * - doHelp for handling help requests
+     * 
+     * If the window state of this portlet is minimized, this
+     * method does not invoke any of the portlet mode rendering methods.
+     * 
+     * For handling custom portlet modes the portlet should override this
+     * method.
+     *
+     * @param request the render request
+     * @param response the render response
+     * @exception PortletException if the portlet cannot fulfilling the request
+     * @exception UnavailableException if the portlet is unavailable to perform
+     *                                 render at this time
+     * @exception PortletSecurityException if the portlet cannot fullfill this
+     *                                     request because of security reasons
+     * @exception java.io.IOException if the streaming causes an I/O problem
+     *
+     * @see #doView(RenderRequest, RenderResponse)
+     * @see #doEdit(RenderRequest, RenderResponse)
+     * @see #doHelp(RenderRequest, RenderResponse)
+     */
+    protected void doDispatch(RenderRequest request, RenderResponse response)
+        throws PortletException, IOException
+    {
+        // invoke doView(), doEdit(), or doHelp() based on window state and portlet mode
+        super.doDispatch(request, response);
+    }
+
+    /**
+     * Helper method to serve up the mandatory view mode.
+     * 
+     * The default implementation throws an exception.
+     *
+     * @param request the portlet request
+     * @param response the render response
+     * @exception PortletException if the portlet cannot fulfilling the request
+     * @exception UnavailableException if the portlet is unavailable to perform
+     *                                 render at this time
+     * @exception PortletSecurityException if the portlet cannot fullfill this
+     *                                     request because of security reasons
+     * @exception java.io.IOException if the streaming causes an I/O problem
+     */
+    public void doView(RenderRequest request, RenderResponse response)
+        throws PortletException, IOException
+    {
+        getPortletContext().log("ApplicationPortlet.doView() invoked...");
+        log.debug("ApplicationPortlet.doView() invoked...");
+
+        // configure velocity context and invoke appropriate template
+        Context context = getContext(request);
+        context.put("portlet", this);
+        super.doView(request,response);
+    }
+
+    /**
+     * Helper method to serve up the edit mode.
+     * 
+     * The default implementation throws an exception.
+     *
+     * @param request the portlet request
+     * @param response the render response
+     * @exception PortletException if the portlet cannot fulfilling the request
+     * @exception UnavailableException if the portlet is unavailable to perform
+     *                                 render at this time
+     * @exception PortletSecurityException if the portlet cannot fullfill this
+     *                                     request because of security reasons
+     * @exception java.io.IOException if the streaming causes an I/O problem
+     */
+    public void doEdit(RenderRequest request, RenderResponse response)
+        throws PortletException, IOException
+    {
+        getPortletContext().log("ApplicationPortlet.doEdit() invoked...");
+        log.debug("ApplicationPortlet.doEdit() invoked...");
+
+        // dynamically set title
+        response.setTitle("EDIT - Application Portlet Title");
+
+        // configure velocity context and invoke appropriate template
+        Context context = getContext(request);
+        context.put("portlet", this);
+        super.doEdit(request,response);
+    }
+
+    /**
+     * Helper method to serve up the help mode.
+     * 
+     * The default implementation throws an exception.
+     *
+     * @param request the portlet request
+     * @param response the render response
+     * @exception PortletException if the portlet cannot fulfilling the request
+     * @exception UnavailableException if the portlet is unavailable to perform
+     *                                 render at this time
+     * @exception PortletSecurityException if the portlet cannot fullfill this
+     *                                     request because of security reasons
+     * @exception java.io.IOException if the streaming causes an I/O problem
+     */
+    public void doHelp(RenderRequest request, RenderResponse response)
+        throws PortletException, IOException
+    {
+        getPortletContext().log("ApplicationPortlet.doHelp() invoked...");
+        log.debug("ApplicationPortlet.doHelp() invoked...");
+
+        // dynamically set title
+        response.setTitle("HELP - Application Portlet Title");
+
+        // configure velocity context and invoke appropriate template
+        Context context = getContext(request);
+        context.put("portlet", this);
+        super.doHelp(request,response);
+    }
+
+    /**
+     * Called by the portlet container to indicate to a portlet that the
+     * portlet is being taken out of service.  
+     * 
+     * Before the portlet container calls the destroy method, it should 
+     * allow any threads that are currently processing requests within 
+     * the portlet object to complete execution. To avoid
+     * waiting forever, the portlet container can optionally wait for 
+     * a predefined time before destroying the portlet object.
+     *
+     * This method enables the portlet to do the following:
+     * 
+     * - clean up any resources that it holds (for example, memory,
+     * file handles, threads) 
+     * - make sure that any persistent state is
+     * synchronized with the portlet current state in memory.
+     * 
+     */
+    public void destroy()
+    {
+        getPortletContext().log("ApplicationPortlet.destroy() invoked...");
+        log.debug("ApplicationPortlet.destroy() invoked...");
+
+        super.destroy();
+    }
+
+    // utilities
+
+    /**
+     * Convert String to String array.
+     *
+     * @param values string to split
+     * @return split array of strings
+     */
+    public String [] splitArrayValues(String values)
+    {
+        if (values != null)
+        {
+            return values.split(",");
+        }
+        return null;
+    }
+
+    /**
+     * Concatinate String array to String.
+     *
+     * @param values array of string to concatinate
+     * @return concatinated string
+     */
+    public String concatArrayValues(String [] values)
+    {
+        if (values != null)
+        {
+            StringBuffer concat = new StringBuffer();
+            if (values.length > 0)
+            {
+                concat.append(values[0]);
+            }
+            for (int i = 1; (i < values.length); i++)
+            {
+                concat.append(',');
+                concat.append(values[i]);
+            }
+            return concat.toString();
+        }
+        return null;
+    }
+
+    /**
+     * Concatinate String Enumeration to String.
+     *
+     * @param values enumeration of strings to concatinate
+     * @return concatinated string
+     */
+    public String concatArrayValues(Enumeration values)
+    {
+        if (values != null)
+        {
+            StringBuffer concat = new StringBuffer();
+            if (values.hasMoreElements())
+            {
+                concat.append(values.nextElement());
+            }
+            while (values.hasMoreElements())
+            {
+                concat.append(',');
+                concat.append(values.nextElement());
+            }
+            return concat.toString();
+        }
+        return null;
+    }
+}

Propchange: portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/src/java/ApplicationPortlet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/src/test/TestApplicationPortlet.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/src/test/TestApplicationPortlet.java?rev=389988&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/src/test/TestApplicationPortlet.java (added)
+++ portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/src/test/TestApplicationPortlet.java Wed Mar 29 20:34:15 2006
@@ -0,0 +1,83 @@
+/*
+ * 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.
+ */
+package ${groupId};
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import ${groupId}.ApplicationPortlet;
+
+/**
+ * TestApplicationPortlet
+ *
+ * @author <a href="mailto:"></a>
+ * @version $Id:$
+ */
+public class TestApplicationPortlet extends TestCase
+{
+    /**
+     * Class specific log instance.
+     */
+    private final static Log log = LogFactory.getLog(TestApplicationPortlet.class);
+
+    /**
+     * Main test runner entry point.
+     */
+    public static void main(String args[])
+    {
+        junit.awtui.TestRunner.main(new String[]{TestApplicationPortlet.class.getName()});
+    }
+    
+    /**
+     * Test suite configuration for test*() methods in this class.
+     */
+    public static Test suite()
+    {
+        return new TestSuite(TestApplicationPortlet.class);
+    }
+    
+    /**
+     * Setup protocol method.
+     */
+    protected void setUp() throws Exception
+    {
+        super.setUp();        
+    }
+
+    /**
+     * Cleanup protocol method.
+     */
+    protected void tearDown() throws Exception
+    {
+        super.tearDown();        
+    }
+
+    /**
+     * Unit test method.
+     */
+    public void testApplicationPortlet() throws Exception
+    {
+        log.info("TestApplicationPortlet start...");
+
+        log.info("TestApplicationPortlet testing: " + ApplicationPortlet.class.getName());
+
+        log.info("TestApplicationPortlet done.");
+    }
+}

Propchange: portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/src/test/TestApplicationPortlet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/src/test/log4j.properties
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/src/test/log4j.properties?rev=389988&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/src/test/log4j.properties (added)
+++ portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/src/test/log4j.properties Wed Mar 29 20:34:15 2006
@@ -0,0 +1,41 @@
+# 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.
+
+# ------------------------------------------------------------------------
+#
+# Logging Configuration
+#
+# $Id:$
+#
+# ------------------------------------------------------------------------
+
+#
+# Default root logger 
+#
+log4j.rootLogger = INFO, console
+
+#
+# Component logger
+#
+log4j.category.${groupId} = DEBUG, console
+log4j.additivity.${groupId} = false
+
+#
+# Console
+#
+log4j.appender.console=org.apache.log4j.ConsoleAppender
+log4j.appender.console.layout=org.apache.log4j.PatternLayout
+
+# Pattern to output the caller's file name and line number.
+log4j.appender.console.layout.ConversionPattern=%5p: %c - %m%n

Propchange: portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/src/test/log4j.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/src/webapp/WEB-INF/portlet.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/src/webapp/WEB-INF/portlet.xml?rev=389988&r1=389987&r2=389988&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/src/webapp/WEB-INF/portlet.xml (original)
+++ portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/src/webapp/WEB-INF/portlet.xml Wed Mar 29 20:34:15 2006
@@ -16,51 +16,67 @@
 -->
 <portlet-app id="${artifactId}" version="1.0">
 
-  <!--
-  <portlet id="HelloPortlet">
-    <portlet-name>HelloPortlet</portlet-name>
-    <display-name>HelloWorld Portlet Wrapper</display-name>
-    <description>This is the hello world of portlets, it doesn't do much</description>
-    <portlet-class>${groupId}.${artifactId}..HelloWorld</portlet-class>
-    <expiration-cache>-1</expiration-cache>
-    <init-param>
-      <description>test init param</description>
-      <name>hello</name>
-      <value>Hello Portlet</value>
-     </init-param>
-    <supports>
-      <mime-type>text/html</mime-type>
-      <portlet-mode>EDIT</portlet-mode>
-      <portlet-mode>VIEW</portlet-mode>
-      <portlet-mode>HELP</portlet-mode>
-    </supports>
-    <supported-locale>en</supported-locale>
-    <supported-locale>ja</supported-locale>
-    <resource-bundle>${groupId}.${artifactId}.HelloWorldResources</resource-bundle>
-    <portlet-preferences>
-      <preference>                            
-        <name>hello</name>                    
-        <value></value>    
-      </preference>                               		
-    </portlet-preferences>        
-    <security-role-ref>
-      <role-name>Administrator</role-name>
-      <role-link>admin</role-link>
-    </security-role-ref>
-    <security-role-ref>
-      <role-name>Manager</role-name>
-      <role-link>manager</role-link>
-    </security-role-ref>
-    <security-role-ref>
-      <role-name>User</role-name>
-      <role-link>user</role-link>
-    </security-role-ref>
-    <portlet-info>
-      <title>HelloWorldTitle</title>
-      <short-title>This is the short title</short-title>
-      <keywords>Test</keywords>
-    </portlet-info>
-  </portlet>
-  -->
-  
+    <portlet id="application">
+
+        <description xml:lang="en">Application Velocity portlet example.</description>
+        <portlet-name>Application</portlet-name>
+        <display-name xml:lang="en">Application Portlet</display-name>
+
+        <portlet-class>${groupId}.ApplicationPortlet</portlet-class>
+
+        <init-param>
+            <name>ViewPage</name>
+            <value>/WEB-INF/view/application-view.vm</value>
+        </init-param>
+        <init-param>
+            <name>EditPage</name>
+            <value>/WEB-INF/view/application-edit.vm</value>
+        </init-param>
+        <init-param>
+            <name>HelpPage</name>
+            <value>/WEB-INF/view/application-help.vm</value>
+        </init-param>
+
+        <init-param>
+            <name>application-init-param</name>
+            <value>application-init-param-value</value>
+        </init-param>
+
+        <expiration-cache>-1</expiration-cache>
+
+        <supports>
+            <mime-type>text/html</mime-type>
+            <portlet-mode>view</portlet-mode>
+            <portlet-mode>edit</portlet-mode>
+            <portlet-mode>help</portlet-mode>
+        </supports>
+
+        <supported-locale>en</supported-locale>    
+
+        <portlet-info>
+            <title>Application Velocity Portlet</title>
+            <short-title>Application</short-title>
+            <keywords>Velocity</keywords>
+        </portlet-info>
+
+        <portlet-preferences>
+            <preference>
+                <name>application-preference</name>
+                <value>application-preference-value</value>
+                <read-only>true</read-only>
+            </preference>
+            <preference>
+                <name>application-writable-preference</name>
+                <value>application-writable-preference-value-0</value>
+                <value>application-writable-preference-value-1</value>
+            </preference>
+        </portlet-preferences>
+
+    </portlet>
+
+    <user-attribute>
+        <description>Given User Name USER_INFO Attribute</description>
+        <name>user.name.given</name>
+    </user-attribute>
+
 </portlet-app>

Added: portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/src/webapp/WEB-INF/view/application-portlet-edit.vm
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/src/webapp/WEB-INF/view/application-portlet-edit.vm?rev=389988&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/src/webapp/WEB-INF/view/application-portlet-edit.vm (added)
+++ portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/src/webapp/WEB-INF/view/application-portlet-edit.vm Wed Mar 29 20:34:15 2006
@@ -0,0 +1,89 @@
+## application portlet
+<b>EDIT: Application Portlet</b>
+<p>portlet name: $portlet.getPortletName()
+<p>portlet mode: $renderRequest.getPortletMode()
+<p>window state: $renderRequest.getWindowState()
+
+## render links to change window state/portlet modes
+<p>
+#if ($renderRequest.isWindowStateAllowed($STATE_NORMAL))
+    #set ($normalRenderURL = $renderResponse.createRenderURL())
+    $normalRenderURL.setWindowState($STATE_NORMAL)
+    <p>NORMAL render link: <a href="$normalRenderURL">$normalRenderURL</a>
+#end
+#if ($renderRequest.isWindowStateAllowed($STATE_MAX))
+    #set ($maximizedRenderURL = $renderResponse.createRenderURL())
+    $maximizedRenderURL.setWindowState($STATE_MAX)
+    <p>MAXIMIZED render link: <a href="$maximizedRenderURL">$maximizedRenderURL</a>
+#end
+#if ($renderRequest.isWindowStateAllowed($STATE_MIN))
+    #set ($minimizedRenderURL = $renderResponse.createRenderURL())
+    $minimizedRenderURL.setWindowState($STATE_MIN)
+    <p>MINIMIZED render link: <a href="$minimizedRenderURL">$minimizedRenderURL</a>
+#end
+#if ($renderRequest.isPortletModeAllowed($MODE_VIEW))
+    #set ($viewRenderURL = $renderResponse.createRenderURL())
+    $viewRenderURL.setPortletMode($MODE_VIEW)
+    <p>VIEW render link: <a href="$viewRenderURL">$viewRenderURL</a>
+#end
+#if ($renderRequest.isPortletModeAllowed($MODE_EDIT))
+    #set ($editRenderURL = $renderResponse.createRenderURL())
+    $editRenderURL.setPortletMode($MODE_EDIT)
+    <p>EDIT render link: <a href="$editRenderURL">$editRenderURL</a>
+#end
+#if ($renderRequest.isPortletModeAllowed($MODE_HELP))
+    #set ($helpRenderURL = $renderResponse.createRenderURL())
+    $helpRenderURL.setPortletMode($MODE_HELP)
+    <p>HELP render link: <a href="$helpRenderURL">$helpRenderURL</a>
+#end
+<p>
+
+## edit links/forms to change portlet state
+#set ($testActionURL = $renderResponse.createActionURL())
+$testActionURL.setParameter("test-action", "test-me-to-tears")
+#if ($renderRequest.isPortletModeAllowed($MODE_VIEW))
+    $testActionURL.setPortletMode($MODE_VIEW)
+#end
+<p>test action link: <a href="$testActionURL">$testActionURL</a>
+
+#set ($redirectActionURL = $renderResponse.createActionURL())
+#if ($renderRequest.isPortletModeAllowed($MODE_VIEW))
+    $redirectActionURL.setPortletMode($MODE_VIEW)
+#end
+<p><form method="POST" action="$redirectActionURL">redirect url: <input name="redirect-action" type="TEXT" size="64"></form>
+
+#set ($editContextAttributesActionURL = $renderResponse.createActionURL())
+#if ($renderRequest.isPortletModeAllowed($MODE_VIEW))
+    $editContextAttributesActionURL.setPortletMode($MODE_VIEW)
+#end
+<p><form method="POST" action="$editContextAttributesActionURL">edit context attributes: <input name="edit-context-attributes-name-action" type="TEXT" size="32" value="context-attr"><input name="edit-context-attributes-value-action" type="TEXT" size="32"><input type="submit"></form>
+
+#set ($editPreferencesActionURL = $renderResponse.createActionURL())
+#if ($renderRequest.isPortletModeAllowed($MODE_VIEW))
+    $editPreferencesActionURL.setPortletMode($MODE_VIEW)
+#end
+<p><form method="POST" action="$editPreferencesActionURL">edit preferences: <input name="edit-preferences-name-action" type="TEXT" size="32" value="preference"><input name="edit-preferences-value-action" type="TEXT" size="32"><input type="submit"></form>
+
+#set ($editSessionApplicationAttributesActionURL = $renderResponse.createActionURL())
+#if ($renderRequest.isPortletModeAllowed($MODE_VIEW))
+    $editSessionApplicationAttributesActionURL.setPortletMode($MODE_VIEW)
+#end
+<p><form method="POST" action="$editSessionApplicationAttributesActionURL">edit session application attributes: <input name="edit-session-application-attributes-name-action" type="TEXT" size="32" value="app-attr"><input name="edit-session-application-attributes-value-action" type="TEXT" size="32"><input type="submit"></form>
+
+#set ($editSessionPortletAttributesActionURL = $renderResponse.createActionURL())
+#if ($renderRequest.isPortletModeAllowed($MODE_VIEW))
+    $editSessionPortletAttributesActionURL.setPortletMode($MODE_VIEW)
+#end
+<p><form method="POST" action="$editSessionPortletAttributesActionURL">edit session portlet attributes: <input name="edit-session-portlet-attributes-name-action" type="TEXT" size="32" value="portlet-attr"><input name="edit-session-portlet-attributes-value-action" type="TEXT" size="32"><input type="submit"></form>
+
+#set ($editRequestAttributesActionURL = $renderResponse.createActionURL())
+#if ($renderRequest.isPortletModeAllowed($MODE_VIEW))
+    $editRequestAttributesActionURL.setPortletMode($MODE_VIEW)
+#end
+<p><form method="POST" action="$editRequestAttributesActionURL">edit request attributes: <input name="edit-request-attributes-name-action" type="TEXT" size="32" value="request-attr"><input name="edit-request-attributes-value-action" type="TEXT" size="32"><input type="submit"></form>
+
+#set ($setRenderParametersActionURL = $renderResponse.createActionURL())
+#if ($renderRequest.isPortletModeAllowed($MODE_VIEW))
+    $setRenderParametersActionURL.setPortletMode($MODE_VIEW)
+#end
+<p><form method="POST" action="$setRenderParametersActionURL">set render parameters: <input name="set-render-parameters-name-action" type="TEXT" size="32" value="render-param"><input name="set-render-parameters-value-action" type="TEXT" size="32"><input type="submit"></form>

Propchange: portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/src/webapp/WEB-INF/view/application-portlet-edit.vm
------------------------------------------------------------------------------
    svn:eol-style = native

Added: portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/src/webapp/WEB-INF/view/application-portlet-help.vm
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/src/webapp/WEB-INF/view/application-portlet-help.vm?rev=389988&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/src/webapp/WEB-INF/view/application-portlet-help.vm (added)
+++ portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/src/webapp/WEB-INF/view/application-portlet-help.vm Wed Mar 29 20:34:15 2006
@@ -0,0 +1,46 @@
+## application portlet
+<b>HELP: Application Portlet</b>
+<p>portlet name: $portlet.getPortletName()
+<p>portlet mode: $renderRequest.getPortletMode()
+<p>window state: $renderRequest.getWindowState()
+
+## dump window state/portlet modes; render links to change
+## window state/portlet modes
+<p>
+<p>NORMAL window state allowed: $renderRequest.isWindowStateAllowed($STATE_NORMAL)
+<p>MAXIMIZED window state allowed: $renderRequest.isWindowStateAllowed($STATE_MAX)
+<p>MINIMIZED window state allowed: $renderRequest.isWindowStateAllowed($STATE_MIN)
+<p>VIEW portlet mode allowed: $renderRequest.isPortletModeAllowed($MODE_VIEW)
+<p>EDIT portlet mode allowed: $renderRequest.isPortletModeAllowed($MODE_EDIT)
+<p>HELP portlet mode allowed: $renderRequest.isPortletModeAllowed($MODE_HELP)
+#if ($renderRequest.isWindowStateAllowed($STATE_NORMAL))
+    #set ($normalRenderURL = $renderResponse.createRenderURL())
+    $normalRenderURL.setWindowState($STATE_NORMAL)
+    <p>NORMAL render link: <a href="$normalRenderURL">$normalRenderURL</a>
+#end
+#if ($renderRequest.isWindowStateAllowed($STATE_MAX))
+    #set ($maximizedRenderURL = $renderResponse.createRenderURL())
+    $maximizedRenderURL.setWindowState($STATE_MAX)
+    <p>MAXIMIZED render link: <a href="$maximizedRenderURL">$maximizedRenderURL</a>
+#end
+#if ($renderRequest.isWindowStateAllowed($STATE_MIN))
+    #set ($minimizedRenderURL = $renderResponse.createRenderURL())
+    $minimizedRenderURL.setWindowState($STATE_MIN)
+    <p>MINIMIZED render link: <a href="$minimizedRenderURL">$minimizedRenderURL</a>
+#end
+#if ($renderRequest.isPortletModeAllowed($MODE_VIEW))
+    #set ($viewRenderURL = $renderResponse.createRenderURL())
+    $viewRenderURL.setPortletMode($MODE_VIEW)
+    <p>VIEW render link: <a href="$viewRenderURL">$viewRenderURL</a>
+#end
+#if ($renderRequest.isPortletModeAllowed($MODE_EDIT))
+    #set ($editRenderURL = $renderResponse.createRenderURL())
+    $editRenderURL.setPortletMode($MODE_EDIT)
+    <p>EDIT render link: <a href="$editRenderURL">$editRenderURL</a>
+#end
+#if ($renderRequest.isPortletModeAllowed($MODE_HELP))
+    #set ($helpRenderURL = $renderResponse.createRenderURL())
+    $helpRenderURL.setPortletMode($MODE_HELP)
+    <p>HELP render link: <a href="$helpRenderURL">$helpRenderURL</a>
+#end
+<p>

Propchange: portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/src/webapp/WEB-INF/view/application-portlet-help.vm
------------------------------------------------------------------------------
    svn:eol-style = native

Added: portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/src/webapp/WEB-INF/view/application-portlet-view.vm
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/src/webapp/WEB-INF/view/application-portlet-view.vm?rev=389988&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/src/webapp/WEB-INF/view/application-portlet-view.vm (added)
+++ portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/src/webapp/WEB-INF/view/application-portlet-view.vm Wed Mar 29 20:34:15 2006
@@ -0,0 +1,176 @@
+## application portlet
+<b>VIEW: Application Portlet</b>
+<p>portlet name: $portlet.getPortletName()
+<p>portlet mode: $renderRequest.getPortletMode()
+<p>window state: $renderRequest.getWindowState()
+
+## render links to change window state/portlet modes
+<p>
+#if ($renderRequest.isWindowStateAllowed($STATE_NORMAL))
+    #set ($normalRenderURL = $renderResponse.createRenderURL())
+    $normalRenderURL.setWindowState($STATE_NORMAL)
+    <p>NORMAL render link: <a href="$normalRenderURL">$normalRenderURL</a>
+#end
+#if ($renderRequest.isWindowStateAllowed($STATE_MAX))
+    #set ($maximizedRenderURL = $renderResponse.createRenderURL())
+    $maximizedRenderURL.setWindowState($STATE_MAX)
+    <p>MAXIMIZED render link: <a href="$maximizedRenderURL">$maximizedRenderURL</a>
+#end
+#if ($renderRequest.isWindowStateAllowed($STATE_MIN))
+    #set ($minimizedRenderURL = $renderResponse.createRenderURL())
+    $minimizedRenderURL.setWindowState($STATE_MIN)
+    <p>MINIMIZED render link: <a href="$minimizedRenderURL">$minimizedRenderURL</a>
+#end
+#if ($renderRequest.isPortletModeAllowed($MODE_VIEW))
+    #set ($viewRenderURL = $renderResponse.createRenderURL())
+    $viewRenderURL.setPortletMode($MODE_VIEW)
+    <p>VIEW render link: <a href="$viewRenderURL">$viewRenderURL</a>
+#end
+#if ($renderRequest.isPortletModeAllowed($MODE_EDIT))
+    #set ($editRenderURL = $renderResponse.createRenderURL())
+    $editRenderURL.setPortletMode($MODE_EDIT)
+    <p>EDIT render link: <a href="$editRenderURL">$editRenderURL</a>
+#end
+#if ($renderRequest.isPortletModeAllowed($MODE_HELP))
+    #set ($helpRenderURL = $renderResponse.createRenderURL())
+    $helpRenderURL.setPortletMode($MODE_HELP)
+    <p>HELP render link: <a href="$helpRenderURL">$helpRenderURL</a>
+#end
+<p>
+
+## dump all portlet state information
+<p>response is committed: $renderResponse.isCommitted()
+<p>locale: $renderRequest.getLocale()
+<p>has locale resource bundle:
+#if ($portlet.getResourceBundle($renderRequest.getLocale()))
+    true
+#else
+    false
+#end
+<p>init parameters:
+<ul>
+#foreach ($name in $portlet.getInitParameterNames())
+    <li>$name: $portlet.getInitParameter($name)</li>
+#end
+</ul>
+<p>portlet context name: getPortletContext().getPortletContextName()
+<p>context server info: getPortletContext().getServerInfo()
+<p>context major version: getPortletContext().getMajorVersion()
+<p>context minor version: getPortletContext().getMinorVersion()
+<p>context real path for "/": getPortletContext().getRealPath("/")
+
+<p>context resource paths for "/":
+<ul>
+#foreach ($path in $portlet.getPortletContext().getResourcePaths("/"))
+    <li>$path</li>
+#end
+</ul>
+<p>context resource url for "/":$portlet.getPortletContext().getResource("/")
+<p>context attributes:
+<ul>
+#foreach ($name in $portlet.getPortletContext().getAttributeNames())
+    <li>$name: $portlet.getPortletContext().getAttribute($name)</li>
+#end
+</ul>
+<p>context init parameters:
+<ul>
+#foreach ($name in $portlet.getPortletContext().getInitParameterNames())
+    <li>$name: $portlet.getPortletContext().getInitParameter($name)</li>
+#end
+</ul>
+#set ($prefs = $renderRequest.getPreferences())
+#if ($prefs)
+    <p>preferences:
+    <ul>
+    #foreach ($name in $prefs.getNames())
+        #set ($values = $prefs.getValues($name, null))
+        #if ($prefs.isReadOnly($name))
+            <li>$name: $portlet.concatArrayValues($values), (read only)</li>
+        #else
+            <li>$name: $portlet.concatArrayValues($values)</li>
+        #end
+    #end
+    </ul>
+#end
+<p>requested session id: $renderRequest.getRequestedSessionId()
+<p>requested session id is valid: $renderRequest.isRequestedSessionIdValid()
+#set ($session = $renderRequest.getPortletSession(false))
+#if ($session)
+    <p>session is new: $session.isNew()
+    <p>session id: $session.getId()
+    <p>session creation time: $session.getCreationTime()
+    <p>session last accessed time: $session.getLastAccessedTime()
+    <p>session max inactive: $session.getMaxInactiveInterval()
+    <p>session application attributes:
+    <ul>
+    #foreach ($name in $session.getAttributeNames($session.APPLICATION_SCOPE))
+        <li>$name: $session.getAttribute($name, $session.APPLICATION_SCOPE)</li>
+    #end
+    </ul>
+    <p>session portlet attributes:
+    <ul>
+    #foreach ($name in $session.getAttributeNames($session.PORTLET_SCOPE))
+        <li>$name: $session.getAttribute($name, $session.PORTLET_SCOPE)</li>
+    #end
+    </ul>
+#end
+<p>request properties:
+<ul>
+#foreach ($name in $renderRequest.getPropertyNames())
+    #set ($values = $renderRequest.getProperties($name))
+    <li>$name: $portlet.concatArrayValues($values)</li>
+#end
+</ul>
+<p>authentication type: $renderRequest.getAuthType()
+<p>context path: $renderRequest.getContextPath()
+<p>remote user: $renderRequest.getRemoteUser()
+#set ($principal = $renderRequest.getUserPrincipal())
+#if ($principal)
+    <p>principal: $principal.getName()
+    <p>principal is in user role: $renderRequest.isUserInRole("user")
+    <p>principal is in manager role: $renderRequest.isUserInRole("manager")
+    <p>principal is in admin role: $renderRequest.isUserInRole("admin")
+#end
+<p>request attributes:
+<ul>
+#foreach ($name in $renderRequest.getAttributeNames())
+    <li>$name: $renderRequest.getAttribute($name)</li>
+#end
+</ul>
+<p>request parameters:
+<ul>
+#foreach ($name in $renderRequest.getParameterNames())
+    #set ($values = $renderRequest.getParameterValues($name))
+    <li>$name: $portlet.concatArrayValues($values)</li>
+#end
+</ul>
+<p>is secure: $renderRequest.isSecure()
+
+<p>preferred content type: $renderRequest.getResponseContentType()
+<p>accepted content types:
+<ol>
+#foreach ($type in $renderRequest.getResponseContentTypes())
+    <li>$type</li>
+#end
+</ol>
+<p>preferred locale: $renderRequest.getLocale()
+<p>accepted locales:
+<ol>
+#foreach ($locale in $renderRequest.getLocales())
+    <li>$locale</li>
+#end
+</ol>
+<p>scheme: $renderRequest.getScheme()
+<p>server name: $renderRequest.getServerName()
+<p>server port: $renderRequest.getServerPort()
+<p>namespace: $renderResponse.getNamespace()
+<p>response is committed: $renderResponse.isCommitted()
+#set ($userInfo = $renderRequest.getAttribute($USER_INFO))
+#if ($userInfo)
+    <p>user info request attribute values:
+    <ul>
+    #foreach ($userInfoEntry in $userInfo.entrySet())
+        <li>$userInfoEntry.getKey(): $userInfoEntry.getValue()</li>
+    #end
+    </ul>
+#end

Propchange: portals/jetspeed-2/trunk/maven-archetypes/application/src/archetype/archetype-resources/src/webapp/WEB-INF/view/application-portlet-view.vm
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: portals/jetspeed-2/trunk/maven-archetypes/component/src/archetype/META-INF/archetype.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/maven-archetypes/component/src/archetype/META-INF/archetype.xml?rev=389988&r1=389987&r2=389988&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/maven-archetypes/component/src/archetype/META-INF/archetype.xml (original)
+++ portals/jetspeed-2/trunk/maven-archetypes/component/src/archetype/META-INF/archetype.xml Wed Mar 29 20:34:15 2006
@@ -17,6 +17,7 @@
 -->
         
 <archetype>
+
     <id>portal-archetype</id>
     <allowPartial>true</allowPartial>
 
@@ -33,4 +34,5 @@
     <testResources>
         <resource>src/test/log4j.properties</resource>
     </testResources>
+
 </archetype>

Modified: portals/jetspeed-2/trunk/maven-archetypes/component/src/archetype/archetype-resources/src/test/TestComponent.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/maven-archetypes/component/src/archetype/archetype-resources/src/test/TestComponent.java?rev=389988&r1=389987&r2=389988&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/maven-archetypes/component/src/archetype/archetype-resources/src/test/TestComponent.java (original)
+++ portals/jetspeed-2/trunk/maven-archetypes/component/src/archetype/archetype-resources/src/test/TestComponent.java Wed Mar 29 20:34:15 2006
@@ -22,7 +22,6 @@
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
-import ${groupId}.Component;
 import ${groupId}.ComponentImpl;
 
 /**

Modified: portals/jetspeed-2/trunk/maven-archetypes/portal/src/archetype/META-INF/archetype.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/maven-archetypes/portal/src/archetype/META-INF/archetype.xml?rev=389988&r1=389987&r2=389988&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/maven-archetypes/portal/src/archetype/META-INF/archetype.xml (original)
+++ portals/jetspeed-2/trunk/maven-archetypes/portal/src/archetype/META-INF/archetype.xml Wed Mar 29 20:34:15 2006
@@ -17,6 +17,7 @@
 -->
         
 <archetype>
+
     <id>portal-archetype</id>
     <allowPartial>true</allowPartial>
 

Modified: portals/jetspeed-2/trunk/settings.xml.sample
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/settings.xml.sample?rev=389988&r1=389987&r2=389988&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/settings.xml.sample (original)
+++ portals/jetspeed-2/trunk/settings.xml.sample Wed Mar 29 20:34:15 2006
@@ -26,6 +26,14 @@
 -->
 <settings xmlns="http://maven.apache.org/POM/4.0.0">
 
+    <!-- Local Repository Location -->
+
+    <!--
+    <localRepository>c:/maven2/repository</localRepository>
+    -->
+
+    <!-- Jetspeed-2 Profile Configuration -->
+
     <profiles>
 
         <!-- Default Profile -->



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