incubator-graffito-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clomb...@apache.org
Subject svn commit: r124694 - in incubator/graffito/trunk: . components engine portlets portlets/src/java/org/apache/portals/graffito/portlets portlets/src/webapp/WEB-INF portlets/src/webapp/WEB-INF/view
Date Sun, 09 Jan 2005 00:54:48 GMT
Author: clombart
Date: Sat Jan  8 16:54:46 2005
New Revision: 124694

URL: http://svn.apache.org/viewcvs?view=rev&rev=124694
Log:
Continue to work on the Browser Portlet :
* Use Velocity instead of JSP/JSTL/JSF
* Starting the edit mode in order to add folders & documents
* Modify the project.xml : add *.properties in the build
Removed:
   incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/GraffitoBrowserPortlet.java
   incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/edit-prefs.vm
   incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/edit.jsp
   incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/help.html
   incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/view.jsp
   incubator/graffito/trunk/portlets/src/webapp/WEB-INF/web-velocity.xml
Modified:
   incubator/graffito/trunk/   (props changed)
   incubator/graffito/trunk/components/   (props changed)
   incubator/graffito/trunk/engine/   (props changed)
   incubator/graffito/trunk/portlets/project.xml
   incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/BrowserPortlet.java
   incubator/graffito/trunk/portlets/src/webapp/WEB-INF/portlet.xml
   incubator/graffito/trunk/portlets/src/webapp/WEB-INF/web.xml

Modified: incubator/graffito/trunk/portlets/project.xml
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/portlets/project.xml?view=diff&rev=124694&p1=incubator/graffito/trunk/portlets/project.xml&r1=124693&p2=incubator/graffito/trunk/portlets/project.xml&r2=124694
==============================================================================
--- incubator/graffito/trunk/portlets/project.xml	(original)
+++ incubator/graffito/trunk/portlets/project.xml	Sat Jan  8 16:54:46 2005
@@ -176,9 +176,18 @@
 			</properties>
 		</dependency>
 	</dependencies>
-	<build>
-		<sourceDirectory>src/java</sourceDirectory>
-	</build>
+        <build>
+          <sourceDirectory>src/java</sourceDirectory>
+          <resources>
+            <resource>
+                <directory>${basedir}/src/java/</directory>
+                <includes>
+                    <include>**/*.properties</include>
+                </includes>
+                <filtering>false</filtering>
+            </resource>
+          </resources>
+        </build>
 	<reports>
 		<report>maven-jdepend-plugin</report>
 		<!--

Modified: incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/BrowserPortlet.java
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/BrowserPortlet.java?view=diff&rev=124694&p1=incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/BrowserPortlet.java&r1=124693&p2=incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/BrowserPortlet.java&r2=124694
==============================================================================
--- incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/BrowserPortlet.java
(original)
+++ incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/BrowserPortlet.java
Sat Jan  8 16:54:46 2005
@@ -1,218 +1,224 @@
-/*
- * Copyright 2000-2004 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.portals.graffito.portlets;
-
-import java.io.IOException;
-import java.util.Map;
-
-import javax.faces.context.FacesContext;
-import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.PortletConfig;
-import javax.portlet.PortletContext;
-import javax.portlet.PortletException;
-import javax.portlet.PortletMode;
-import javax.portlet.PortletRequest;
-import javax.portlet.PortletRequestDispatcher;
-import javax.portlet.PortletResponse;
-import javax.portlet.PortletSession;
-import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.apache.portals.bridges.myfaces.FacesPortlet;
-import org.apache.portals.graffito.ContentModelService;
-import org.apache.portals.graffito.exception.ContentManagementException;
-import org.apache.velocity.context.Context;
-
-/**
- * Graffito Content Browser
- * 
- * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
- * @version $Id: Exp $
- */
-public class BrowserPortlet extends FacesPortlet
-{
-    /** JSF Bean to set the browser info object in the JSF Session */
-    private static final String BROWSER_INFO = "browser";
-    
-
-    /** Default uri used to display the content browser */
-    private static final String DEFAULT_CONTENT_SCOPE = "/graffito";
-
-    /** Portlet preference attritube containing the root uri used to display the content
browser */
-    private static final String CONTENT_SCOPE = "gaffito.content.scope";
-
-    
-    protected Log log = LogFactory.getLog(BrowserPortlet.class);
-   
-    private ContentModelService modelService;
-
-    
-    /**
-     * @see javax.portlet.Portlet#init(javax.portlet.PortletConfig)
-     */
-    public void init(PortletConfig config) throws PortletException
-    {
-        super.init(config);
-        PortletContext context = getPortletContext();
-
-        modelService = (ContentModelService) context.getAttribute("cps:ContentModel");
-        if (null == modelService)
-        {
-            throw new PortletException("Failed to find the content model service on portlet
initialization");
-        }
-
-    }
-    
-    /**
-     * @see org.apache.portals.bridges.myfaces.FacesPortlet#preProcessFaces(javax.faces.context.FacesContext)
-     */
-    protected void preProcessFaces(FacesContext context)
-    {
-        if (null == context.getExternalContext().getSessionMap().get(BROWSER_INFO))
-        {
-            context.getExternalContext().getSessionMap().put(BROWSER_INFO, new BrowserInfo());
-        }
-    }    
-    
-    
-    /**
-     * @see javax.portlet.GenericPortlet#doView(javax.portlet.RenderRequest, javax.portlet.RenderResponse)
-     */
-    public void doView(RenderRequest request, RenderResponse response) throws PortletException,
IOException
-    {
-        response.setContentType("text/html");
-        
-        try
-        {
-            BrowserInfo browserInfo = this.getBrowserInfo(request, response);
-            String parentUri = this.getDefaultContentScope(request);                
-            browserInfo.setDocuments(modelService.getDocuments(parentUri));
-            browserInfo.setFolders(modelService.getFolders(parentUri));
-            browserInfo.setUri(parentUri);
-        }
-        catch (ContentManagementException e)
-        {
-            throw new PortletException("Failed to view the portlet - impossible to access
to Graffito content store : " + e.getMessage());
-        }
-        
-        super.doView(request, response);
-    }    
-    
-    /**
-     * @see javax.portlet.GenericPortlet#doEdit(javax.portlet.RenderRequest, javax.portlet.RenderResponse)
-     */
-    public void doEdit(RenderRequest request, RenderResponse response) throws PortletException,
IOException
-    {
-        response.setContentType("text/html");
-
-        //velocityContext.put(VELOCITY_BROWSER_INFO, browserInfo); 
-//        String page = this.getEditPage(request);
-//        
-//        if (page != null)
-//        {
-//            this.clearEditPage(request);
-//            PortletContext context = getPortletContext();
-//            PortletRequestDispatcher rd = context.getRequestDispatcher(page);         
  
-//            rd.include(request, response); 
-//            
-//            
-//        }
-//        else
-//        {
-            super.doEdit(request, response);
-//        }
-        
-                   
-    }
-
-    /**
-     * @see javax.portlet.Portlet#processAction(javax.portlet.ActionRequest, javax.portlet.ActionResponse)
-     */
-    public void processAction(ActionRequest request, ActionResponse response) throws PortletException,
IOException
-    {
-                
-        if (request.getPortletMode() == PortletMode.EDIT)
-        {            
-            String action = request.getParameter("addfolder");
-            if (action!=null)
-            {
-                //this.setEditPage(request, "/WEB-INF/view/addfolder.vm");
-                return;
-            }
-            
-            action = request.getParameter("adddocument");
-            if (action!=null)
-            {
-                //this.setEditPage(request, "/WEB-INF/view/adddocument.vm");
-                return;
-            }              
-                
-        }
-        else
-        {
-//            String browserAction = request.getParameter("db.browser.action");
-//            if (browserAction != null)
-//            {
-//                if (browserAction.equals("refresh"))
-//                {
-//                   // clearDatabaseBrowserIterator(request);
-//                }
-//                String start = request.getParameter("start");
-//                if (start != null)
-//                {
-//                    response.setRenderParameter("start", start);
-//                }
-//            }
-        }
-
-    }
-
-    protected BrowserInfo getBrowserInfo(PortletRequest request, PortletResponse response)
throws PortletException
-    {
-        FacesContext context = getFacesContextFactory().getFacesContext(this.getPortletConfig(),
request, response, getLifecycle());
-        preProcessFaces(context);             
-        Map session = context.getExternalContext().getSessionMap();
-        BrowserInfo browserInfo =  (BrowserInfo) session.get(BROWSER_INFO);
-        return browserInfo;
-        
-    }
-
-    protected String getDefaultContentScope(PortletRequest request)
-    {
-        return request.getPreferences().getValue(CONTENT_SCOPE, DEFAULT_CONTENT_SCOPE);
-    }
-    
-//    protected void setEditPage(PortletRequest request, String page)
-//    {
-//        request.getPortletSession().setAttribute("test", page);
-//    }
-//    
-//    protected String getEditPage(PortletRequest request)
-//    {
-//        return (String) request.getPortletSession().getAttribute("test",  PortletSession.PORTLET_SCOPE);
-//    }  
-//    
-//    protected void clearEditPage(PortletRequest request)
-//    {
-//        request.getPortletSession().removeAttribute("test");
-//    }    
-      
-    
-}
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.portals.graffito.portlets;
+
+import java.io.IOException;
+
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletContext;
+import javax.portlet.PortletException;
+import javax.portlet.PortletMode;
+import javax.portlet.PortletRequest;
+import javax.portlet.PortletRequestDispatcher;
+import javax.portlet.PortletSession;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.portals.bridges.velocity.GenericVelocityPortlet;
+import org.apache.portals.graffito.ContentModelService;
+import org.apache.portals.graffito.exception.ContentManagementException;
+import org.apache.velocity.context.Context;
+
+/**
+ * Graffito Content Browser
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
+ * @version $Id: BrowserPortlet.java,v 1.1 2004/12/28 14:29:11 christophe Exp $
+ */
+public class BrowserPortlet extends GenericVelocityPortlet
+{
+
+    /** Velocity variable to set the browser info object in the Velocity context */
+    private static final String VELOCITY_BROWSER_INFO = "browserInfo";
+    
+    /** Portlet session attribute name used to set the Browser info*/
+    private static final String SESSION_BROWSER_INFO = "graffito.browser.info";
+
+    /** Default uri used to display the content browser */
+    private static final String DEFAULT_CONTENT_SCOPE = "/graffito";
+
+    /** Portlet preference attritube containing the root uri used to display the content
browser */
+    private static final String CONTENT_SCOPE = "gaffito.content.scope";
+
+    
+    protected Log log = LogFactory.getLog(BrowserPortlet.class);
+
+   
+    private ContentModelService modelService;
+    
+
+    /**
+     * @see javax.portlet.Portlet#init(javax.portlet.PortletConfig)
+     */
+    public void init(PortletConfig config) throws PortletException
+    {
+        super.init(config);
+        PortletContext context = getPortletContext();
+
+        modelService = (ContentModelService) context.getAttribute("cps:ContentModel");
+        if (null == modelService)
+        {
+            throw new PortletException("Failed to find the content model service on portlet
initialization");
+        }
+
+    }
+
+    /**
+     * @see javax.portlet.GenericPortlet#doView(javax.portlet.RenderRequest, javax.portlet.RenderResponse)
+     */
+    public void doView(RenderRequest request, RenderResponse response) throws PortletException,
IOException
+    {
+        
+        response.setContentType("text/html");
+        Context velocityContext = this.getContext(request);
+        
+        try
+        {
+            BrowserInfo browserInfo = this.getSessionBrowserInfo(request);
+            if (null == browserInfo)
+            {
+                String parentUri = this.getDefaultContentScope(request);
+                browserInfo = new BrowserInfo();
+                browserInfo.setDocuments(modelService.getDocuments(parentUri));
+                browserInfo.setFolders(modelService.getFolders(parentUri));
+                browserInfo.setUri(parentUri);
+                
+                this.setSessionContentBrowser(request, browserInfo);
+            }            
+            velocityContext.put(VELOCITY_BROWSER_INFO, browserInfo);
+        }
+        catch (ContentManagementException e)
+        {
+            throw new PortletException("Failed to view the portlet - impossible to access
to Graffito content store : " + e.getMessage());
+        }
+        
+        
+        super.doView(request, response);
+
+        
+    }
+
+    /**
+     * @see javax.portlet.GenericPortlet#doEdit(javax.portlet.RenderRequest, javax.portlet.RenderResponse)
+     */
+    public void doEdit(RenderRequest request, RenderResponse response) throws PortletException,
IOException
+    {
+        response.setContentType("text/html");
+        Context velocityContext = this.getContext(request);
+        BrowserInfo browserInfo = this.getSessionBrowserInfo(request);
+        velocityContext.put(VELOCITY_BROWSER_INFO, browserInfo); 
+        String page = this.getEditPage(request);
+        
+        if (page != null)
+        {
+            this.clearEditPage(request);
+            PortletContext context = getPortletContext();
+            PortletRequestDispatcher rd = context.getRequestDispatcher(page);           

+            rd.include(request, response); 
+            
+            
+        }
+        else
+        {
+            super.doEdit(request, response);
+        }
+        
+                   
+    }
+
+    /**
+     * @see javax.portlet.Portlet#processAction(javax.portlet.ActionRequest, javax.portlet.ActionResponse)
+     */
+    public void processAction(ActionRequest request, ActionResponse response) throws PortletException,
IOException
+    {
+                
+        if (request.getPortletMode() == PortletMode.EDIT)
+        {            
+            String action = request.getParameter("addfolder");
+            if (action!=null)
+            {
+                this.setEditPage(request, "/WEB-INF/view/addfolder.vm");
+                return;
+            }
+            
+            action = request.getParameter("adddocument");
+            if (action!=null)
+            {
+                this.setEditPage(request, "/WEB-INF/view/adddocument.vm");
+                return;
+            }              
+                
+        }
+        else
+        {
+//            String browserAction = request.getParameter("db.browser.action");
+//            if (browserAction != null)
+//            {
+//                if (browserAction.equals("refresh"))
+//                {
+//                   // clearDatabaseBrowserIterator(request);
+//                }
+//                String start = request.getParameter("start");
+//                if (start != null)
+//                {
+//                    response.setRenderParameter("start", start);
+//                }
+//            }
+        }
+
+    }
+
+    protected BrowserInfo getSessionBrowserInfo(PortletRequest request)
+    {
+        return (BrowserInfo) request.getPortletSession().getAttribute(SESSION_BROWSER_INFO,
PortletSession.PORTLET_SCOPE);
+    }
+
+    protected void setSessionContentBrowser(RenderRequest request, BrowserInfo browserInfo)
+    {
+        request.getPortletSession().setAttribute(SESSION_BROWSER_INFO, browserInfo);
+    }
+
+    protected void clearSessionContentBrowser(PortletRequest request)
+    {
+        request.getPortletSession().removeAttribute(SESSION_BROWSER_INFO);
+    }
+
+    protected String getDefaultContentScope(PortletRequest request)
+    {
+        return request.getPreferences().getValue(CONTENT_SCOPE, DEFAULT_CONTENT_SCOPE);
+    }
+    
+    protected void setEditPage(PortletRequest request, String page)
+    {
+        request.getPortletSession().setAttribute("test", page);
+    }
+    
+    protected String getEditPage(PortletRequest request)
+    {
+        return (String) request.getPortletSession().getAttribute("test",  PortletSession.PORTLET_SCOPE);
+    }  
+    
+    protected void clearEditPage(PortletRequest request)
+    {
+        request.getPortletSession().removeAttribute("test");
+    }    
+      
+}
\ No newline at end of file

Deleted: /incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/GraffitoBrowserPortlet.java
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/GraffitoBrowserPortlet.java?view=auto&rev=124693
==============================================================================

Modified: incubator/graffito/trunk/portlets/src/webapp/WEB-INF/portlet.xml
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/portlets/src/webapp/WEB-INF/portlet.xml?view=diff&rev=124694&p1=incubator/graffito/trunk/portlets/src/webapp/WEB-INF/portlet.xml&r1=124693&p2=incubator/graffito/trunk/portlets/src/webapp/WEB-INF/portlet.xml&r2=124694
==============================================================================
--- incubator/graffito/trunk/portlets/src/webapp/WEB-INF/portlet.xml	(original)
+++ incubator/graffito/trunk/portlets/src/webapp/WEB-INF/portlet.xml	Sat Jan  8 16:54:46 2005
@@ -16,11 +16,11 @@
 
 -->
 <portlet-app id="graffito" version="1.0">
-	<!--portlet>
+	<portlet>
 		<description>Graffito Content Browser Portlet</description>
 		<portlet-name>graffitoBrowser</portlet-name>
 		<display-name>Graffito Browser</display-name>
-		<portlet-class>org.apache.portals.graffito.portlets.GraffitoBrowserPortlet</portlet-class>
	
+		<portlet-class>org.apache.portals.graffito.portlets.BrowserPortlet</portlet-class>
	
 		<init-param>
 			<name>AllowPreferences</name>
 			<value>true</value>
@@ -52,46 +52,13 @@
 			<preference>
 				<name>graffito.content.scope</name>
 				<value>/graffito</value>
-			</preference>
-		</portlet-preferences>
-	</portlet -->
-	<portlet>
-		<description>Graffito Content Browser Portlet</description>
-		<portlet-name>graffitoBrowser</portlet-name>
-		<display-name>Graffito Browser</display-name>
-		<portlet-class>org.apache.portals.graffito.portlets.BrowserPortlet</portlet-class>
-		<init-param>
-			<name>ViewPage</name>
-			<value>/WEB-INF/view/view.jsp</value>
-		</init-param>
-		<init-param>
-			<name>HelpPage</name>
-			<value>/WEB-INF/view/help.html</value>
-		</init-param>
-		<init-param>
-			<name>EditPage</name>
-			<value>/WEB-INF/view/edit.jsp</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>
-		<supported-locale>fr</supported-locale>
-		<resource-bundle>org.apache.portals.graffito.portlets.resources.messages</resource-bundle>
-		<portlet-preferences>
+			</preference>
 			<preference>
-				<name>graffito.content.scope</name>
-				<value>/graffito</value>
+				<name>edit.tabs</name>
+				<value>Tab1:Action1:/WEB-INF/view/tab1.vm</value>
 			</preference>
-		</portlet-preferences>
-		<portlet-info>
-			<title>Graffito Content Browser</title>
-			<short-title>ContentBrowser</short-title>
-			<keywords>cms, content, document</keywords>
-		</portlet-info>
+			
+			
+		</portlet-preferences>
 	</portlet>
 </portlet-app>

Deleted: /incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/edit-prefs.vm
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/edit-prefs.vm?view=auto&rev=124693
==============================================================================

Deleted: /incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/edit.jsp
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/edit.jsp?view=auto&rev=124693
==============================================================================

Deleted: /incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/help.html
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/help.html?view=auto&rev=124693
==============================================================================

Deleted: /incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/view.jsp
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/view.jsp?view=auto&rev=124693
==============================================================================

Deleted: /incubator/graffito/trunk/portlets/src/webapp/WEB-INF/web-velocity.xml
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/portlets/src/webapp/WEB-INF/web-velocity.xml?view=auto&rev=124693
==============================================================================

Modified: incubator/graffito/trunk/portlets/src/webapp/WEB-INF/web.xml
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/portlets/src/webapp/WEB-INF/web.xml?view=diff&rev=124694&p1=incubator/graffito/trunk/portlets/src/webapp/WEB-INF/web.xml&r1=124693&p2=incubator/graffito/trunk/portlets/src/webapp/WEB-INF/web.xml&r2=124694
==============================================================================
--- incubator/graffito/trunk/portlets/src/webapp/WEB-INF/web.xml	(original)
+++ incubator/graffito/trunk/portlets/src/webapp/WEB-INF/web.xml	Sat Jan  8 16:54:46 2005
@@ -1,115 +1,38 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright 2004 Sun Microsystems, Inc. All Rights Reserved.
- 
- Redistribution and use in source and binary forms, with or
- without modification, are permitted provided that the following
- conditions are met:
- 
- - Redistributions of source code must retain the above copyright
-   notice, this list of conditions and the following disclaimer.
- 
- - Redistribution in binary form must reproduce the above
-   copyright notice, this list of conditions and the following
-   disclaimer in the documentation and/or other materials
-   provided with the distribution.
-    
- Neither the name of Sun Microsystems, Inc. or the names of
- contributors may be used to endorse or promote products derived
- from this software without specific prior written permission.
-  
- This software is provided "AS IS," without a warranty of any
- kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
- WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
- EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY
- DAMAGES OR LIABILITIES SUFFERED BY LICENSEE AS A RESULT OF OR
- RELATING TO USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE OR
- ITS DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE
- FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT,
- SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER
- CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF
- THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS
- BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-  
- You acknowledge that this software is not designed, licensed or
- intended for use in the design, construction, operation or
- maintenance of any nuclear facility.
--->
-<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
-
-<web-app>
-	<display-name>JavaServer Faces Guess Number Sample Application</display-name>
-	<description>JavaServer Faces Guess Number Sample Application</description>
-	<context-param>
-    	<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
-    	<param-value>server</param-value>
-	</context-param>
-	<context-param>
-    	<param-name>javax.faces.application.CONFIG_FILES</param-name>
-    	<param-value>/WEB-INF/faces-config.xml</param-value>
-  	</context-param>
-   	<context-param>
-        <param-name>org.apache.myfaces.ALLOW_JAVASCRIPT</param-name>
-        <param-value>true</param-value>
-        <description>
-            This parameter tells MyFaces if javascript code should be allowed in the
-            rendered HTML output.
-            If javascript is allowed, command_link anchors will have javascript code
-            that submits the corresponding form.
-            If javascript is not allowed, the state saving info and nested parameters
-            will be added as url parameters.
-            Default: "true"
-        </description>
-    </context-param>
-    
-    <context-param>
-        <param-name>org.apache.myfaces.DETECT_JAVASCRIPT</param-name>
-        <param-value>false</param-value>
-        <description>
-            This parameter tells MyFaces if javascript code should be allowed in the
-            rendered HTML output.
-            If javascript is allowed, command_link anchors will have javascript code
-            that submits the corresponding form.
-            If javascript is not allowed, the state saving info and nested parameters
-            will be added as url parameters.
-            Default: "false"
-
-            Setting this param to true should be combined with STATE_SAVING_METHOD "server"
for
-            best results.
-
-            This is an EXPERIMENTAL feature. You also have to enable the detector filter/filter
mapping below to get
-            JavaScript detection working.
-        </description>
-    </context-param>
-
-    <context-param>
-        <param-name>org.apache.myfaces.PRETTY_HTML</param-name>
-        <param-value>true</param-value>
-        <description>
-            If true, rendered HTML code will be formatted, so that it is "human readable".
-            i.e. additional line separators and whitespace will be written, that do not
-            influence the HTML code.
-            Default: "true"
-        </description>
-    </context-param>
-  
-  	<!-- Listener, that does all the startup work (configuration, init). -->
-  	<listener>
-    	<listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
-  	</listener>
-  
-  	<!-- Faces Servlet -->
-  	<servlet>
-    	<servlet-name>Faces Servlet</servlet-name>
-    	<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
-    	<load-on-startup>1</load-on-startup>
-  	</servlet>
-  	<!-- extension mapping -->
-  	<servlet-mapping>
-  		<servlet-name>Faces Servlet</servlet-name>
-   		<url-pattern>*.jsf</url-pattern>
-  	</servlet-mapping>
-
-</web-app>
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright 2004 The Apache Software Foundation
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
+<web-app>
+	<!-- Define Velocity Servlet -->
+	<servlet>
+		<servlet-name>velocity</servlet-name>
+		<servlet-class>org.apache.portals.bridges.velocity.BridgesVelocityViewServlet</servlet-class>
+		<init-param>
+			<param-name>org.apache.velocity.toolbox</param-name>
+			<param-value>/WEB-INF/velocity/toolbox.xml</param-value>
+		</init-param>
+		<init-param>
+			<param-name>org.apache.velocity.properties</param-name>
+			<param-value>/WEB-INF/velocity/velocity.properties</param-value>
+		</init-param>
+		<load-on-startup>10</load-on-startup>
+	</servlet>
+	<!-- Map *.vm files to Velocity  -->
+	<servlet-mapping>
+		<servlet-name>velocity</servlet-name>
+		<url-pattern>*.vm</url-pattern>
+	</servlet-mapping>
+</web-app>
\ No newline at end of file

Mime
View raw message