You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by sv...@apache.org on 2004/12/01 17:32:03 UTC

cvs commit: incubator-myfaces/build build.xml

svieujot    2004/12/01 08:32:03

  Modified:    webapps/examples/web/inc head.inc
               src/components/org/apache/myfaces/custom/popup
                        HtmlPopupRenderer.java
               src/components/org/apache/myfaces/custom/fileupload
                        MultipartFilter.java HtmlFileUploadRenderer.java
               conf     web.xml
               build    build.xml
  Added:       src/components/org/apache/myfaces/component/html/util
                        ExtensionsFilter.java MultipartRequestWrapper.java
                        AddResource.java
               src/components/org/apache/myfaces/custom/popup/resource
                        JSPopup.js
  Removed:     src/components/org/apache/myfaces/custom/fileupload
                        MultipartRequestWrapper.java
               src/components_resource/jspopup JSPopup.js
  Log:
  Convert the Multipart filter in an ExtensionsFilter that provides an additional facility to include resources in a page.
  Tested only with javascript resources right now, but should work fine with images too.
  Some work to do to include css resources.
  The popup component has been converted to use this new Filter.
  
  Revision  Changes    Path
  1.8       +0 -3      incubator-myfaces/webapps/examples/web/inc/head.inc
  
  Index: head.inc
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/webapps/examples/web/inc/head.inc,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- head.inc	26 Nov 2004 12:52:52 -0000	1.7
  +++ head.inc	1 Dec 2004 16:32:03 -0000	1.8
  @@ -19,7 +19,4 @@
     <link rel="stylesheet" href="jscalendar/jscalendar-WH/theme.css" type="text/css">
     <link rel="stylesheet" href="jscalendar/jscalendar-DB/theme.css" type="text/css">
   
  -  <!-- JSPopup -->
  -  <script language="JavaScript" src="jspopup/JSPopup.js" type="text/javascript"></script>
  -
   </head>
  
  
  
  1.5       +8 -3      incubator-myfaces/src/components/org/apache/myfaces/custom/popup/HtmlPopupRenderer.java
  
  Index: HtmlPopupRenderer.java
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/src/components/org/apache/myfaces/custom/popup/HtmlPopupRenderer.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- HtmlPopupRenderer.java	25 Nov 2004 08:41:25 -0000	1.4
  +++ HtmlPopupRenderer.java	1 Dec 2004 16:32:03 -0000	1.5
  @@ -15,6 +15,7 @@
    */
   package org.apache.myfaces.custom.popup;
   
  +import org.apache.myfaces.component.html.util.AddResource;
   import org.apache.myfaces.renderkit.RendererUtils;
   import org.apache.myfaces.renderkit.html.HtmlRenderer;
   import org.apache.myfaces.renderkit.html.HTML;
  @@ -30,6 +31,12 @@
    * @author Martin Marinschek (latest modification by $Author$)
    * @version $Revision$ $Date$
    * $Log$
  + * Revision 1.5  2004/12/01 16:32:03  svieujot
  + * Convert the Multipart filter in an ExtensionsFilter that provides an additional facility to include resources in a page.
  + * Tested only with javascript resources right now, but should work fine with images too.
  + * Some work to do to include css resources.
  + * The popup component has been converted to use this new Filter.
  + *
    * Revision 1.4  2004/11/25 08:41:25  matzew
    * removed unused import-statements
    *
  @@ -123,11 +130,12 @@
                                       Integer displayAtDistanceX, Integer displayAtDistanceY)
           throws IOException
       {
  -        ResponseWriter writer = context.getResponseWriter();
  +        AddResource.addJavaScriptOncePerPage(HtmlPopupRenderer.class, "JSPopup.js", context);
   
           String popupId = (clientId+"Popup").replace(':','_').replaceAll("_",
                   "popupIdSeparator");
   
  +        ResponseWriter writer = context.getResponseWriter();
           writer.startElement(HTML.SCRIPT_ELEM,null);
           writer.writeAttribute(HTML.SCRIPT_LANGUAGE_ATTR,HTML.SCRIPT_LANGUAGE_JAVASCRIPT,null);
           writer.writeText("var "+popupId+"=new orgApacheMyfacesPopup('"+clientId+"',"+
  
  
  
  1.1                  incubator-myfaces/src/components/org/apache/myfaces/component/html/util/ExtensionsFilter.java
  
  Index: ExtensionsFilter.java
  ===================================================================
  /*
   * 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.
   */
  package org.apache.myfaces.component.html.util;
  
  import java.io.IOException;
  
  import javax.servlet.Filter;
  import javax.servlet.FilterChain;
  import javax.servlet.FilterConfig;
  import javax.servlet.ServletException;
  import javax.servlet.ServletRequest;
  import javax.servlet.ServletResponse;
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletResponse;
  
  import org.apache.commons.fileupload.FileUpload;
  
  /**
   * This filters is mandatory for the use of many components.
   * It handles the Multipart requests (for file upload)
   * It's used by the components that need javascript libraries
   * 
   * @author Sylvain Vieujot (latest modification by $Author: svieujot $)
   * @version $Revision: 1.1 $ $Date: 2004/12/01 16:32:03 $
   */
  public class ExtensionsFilter implements Filter {
  
      private int uploadMaxFileSize = 100 * 1024 * 1024; // 10 MB
  
      private int uploadThresholdSize = 1 * 1024 * 1024; // 1 MB
  
      private String uploadRepositoryPath = null; //standard temp directory
  
      /**
       * Init method for this filter
       */
      public void init(FilterConfig filterConfig) {
  
          String param = filterConfig.getInitParameter("uploadMaxFileSize");
  
          uploadMaxFileSize = resolveSize(param, uploadMaxFileSize);
  
          param = filterConfig.getInitParameter("uploadThresholdSize");
  
          uploadThresholdSize = resolveSize(param, uploadThresholdSize);
  
          uploadRepositoryPath = filterConfig.getInitParameter("uploadRepositoryPath");
      }
  
      private int resolveSize(String param, int defaultValue) {
          int numberParam = defaultValue;
  
          if (param != null) {
              param = param.toLowerCase();
              int factor = 1;
              String number = param;
  
              if (param.endsWith("g")) {
                  factor = 1024 * 1024 * 1024;
                  number = param.substring(0, param.length() - 1);
              } else if (param.endsWith("m")) {
                  factor = 1024 * 1024;
                  number = param.substring(0, param.length() - 1);
              } else if (param.endsWith("k")) {
                  factor = 1024;
                  number = param.substring(0, param.length() - 1);
              }
  
              numberParam = Integer.parseInt(number) * factor;
          }
          return numberParam;
      }
  
      /**
       * Add the expires Header
       */
      public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
          if (!(response instanceof HttpServletResponse)) {
              chain.doFilter(request, response);
              return;
          }
  
          HttpServletRequest httpRequest = (HttpServletRequest) request;
  
          // Process only multipart/form-data requests
          if (FileUpload.isMultipartContent(httpRequest)) {
              MultipartRequestWrapper requestWrapper = new MultipartRequestWrapper(httpRequest, uploadMaxFileSize, uploadThresholdSize, uploadRepositoryPath);
              chain.doFilter(requestWrapper, response);
              return;
          }
  
          // Serve myFaces internal resources 
          if( AddResource.isResourceMappedPath( httpRequest ) ){
              AddResource.serveResource(httpRequest, response);
              return;
          }
          
          // Standard request
          chain.doFilter(request, response);
      }
      
      /**
       * Destroy method for this filter
       */
      public void destroy() {
      }
  }
  
  
  
  1.1                  incubator-myfaces/src/components/org/apache/myfaces/component/html/util/MultipartRequestWrapper.java
  
  Index: MultipartRequestWrapper.java
  ===================================================================
  /*
   * 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.
   */
  package org.apache.myfaces.component.html.util;
  
  import org.apache.commons.fileupload.*;
  import org.apache.commons.logging.Log;
  import org.apache.commons.logging.LogFactory;
  
  import javax.servlet.http.HttpServletRequest;
  import javax.servlet.http.HttpServletRequestWrapper;
  import java.io.UnsupportedEncodingException;
  import java.util.*;
  
  /**
   * @author Sylvain Vieujot (latest modification by $Author: svieujot $)
   * @version $Revision: 1.1 $ $Date: 2004/12/01 16:32:03 $
   * $Log: MultipartRequestWrapper.java,v $
   * Revision 1.1  2004/12/01 16:32:03  svieujot
   * Convert the Multipart filter in an ExtensionsFilter that provides an additional facility to include resources in a page.
   * Tested only with javascript resources right now, but should work fine with images too.
   * Some work to do to include css resources.
   * The popup component has been converted to use this new Filter.
   *
   * Revision 1.8  2004/11/16 16:25:52  mmarinschek
   * new popup - component; not yet finished
   *
   * Revision 1.7  2004/10/13 11:50:57  matze
   * renamed packages to org.apache
   *
   * Revision 1.6  2004/09/09 13:43:59  manolito
   * query string parameters where missing in the parameter map
   *
   * Revision 1.5  2004/08/16 18:06:47  svieujot
   * Another bug fix for bug #1001511. Patch submitted by Takashi Okamoto.
   *
   * Revision 1.4  2004/08/02 04:26:06  svieujot
   * Fix for bug #1001511 : setHeaderEncoding
   *
   */
  public class MultipartRequestWrapper
  		extends HttpServletRequestWrapper
  {
      private static Log log = LogFactory.getLog(MultipartRequestWrapper.class);
  
  	HttpServletRequest request = null;
  	HashMap parametersMap = null;
  	DiskFileUpload fileUpload = null;
  	HashMap fileItems = null;
  	int maxSize;
      int thresholdSize;
      String repositoryPath;
  
      public MultipartRequestWrapper(HttpServletRequest request, 
                                     int maxSize, int thresholdSize,
                                     String repositoryPath){
  		super( request );
  		this.request = request;
          this.maxSize = maxSize;
          this.thresholdSize = thresholdSize;
          this.repositoryPath = repositoryPath;
  	}
  	
  	private void parseRequest() {
  		fileUpload = new DiskFileUpload();
  		fileUpload.setFileItemFactory(new DefaultFileItemFactory());
  		fileUpload.setSizeMax(maxSize);
  
          fileUpload.setSizeThreshold(thresholdSize);
  
          if(repositoryPath != null && repositoryPath.trim().length()>0)
              fileUpload.setRepositoryPath(repositoryPath);
  
  	    String charset = request.getCharacterEncoding();
  		fileUpload.setHeaderEncoding(charset);
  
  
  		List requestParameters = null;
  		try{
  			requestParameters = fileUpload.parseRequest(request);
          } catch (FileUploadBase.SizeLimitExceededException e) {
  
              // TODO: find a way to notify the user about the fact that the uploaded file exceeded size limit
  
              if(log.isInfoEnabled())
                  log.info("user tried to upload a file that exceeded file-size limitations.",e);
  
              requestParameters = Collections.EMPTY_LIST;
  
  		}catch(FileUploadException fue){
  			log.error("Exception while uploading file.", fue);
  			requestParameters = Collections.EMPTY_LIST;
  		}
  
  		parametersMap = new HashMap( requestParameters.size() );
  		fileItems = new HashMap();
  
      	for (Iterator iter = requestParameters.iterator(); iter.hasNext(); ){
      		FileItem fileItem = (FileItem) iter.next();
  
      		if (fileItem.isFormField()) {
      			String name = fileItem.getFieldName();
  
      			// The following code avoids commons-fileupload charset problem.
      			// After fixing commons-fileupload, this code should be
      			//
      			// 	String value = fileItem.getString();
      			//
      			String value = null;
      			if ( charset == null) {
      			    value = fileItem.getString();
      			} else {
      			    try {
      			        value = new String(fileItem.get(), charset);
      			    } catch (UnsupportedEncodingException e){
      			        value = fileItem.getString();
      			    }
      			}
  
      			addTextParameter(name, value);
      		} else { // fileItem is a File
     				if (fileItem.getName() != null) {
     					fileItems.put(fileItem.getFieldName(), fileItem);
     				}
      		}
      	}
  
      	//Add the query string paramters
          for (Iterator it = request.getParameterMap().entrySet().iterator(); it.hasNext(); )
          {
              Map.Entry entry = (Map.Entry)it.next();
              String[] valuesArray = (String[])entry.getValue();
              for (int i = 0; i < valuesArray.length; i++)
              {
                  addTextParameter((String)entry.getKey(), valuesArray[i]);
              }
          }
  	}
  	
  	private void addTextParameter(String name, String value){
  		if( ! parametersMap.containsKey( name ) ){
  			String[] valuesArray = {value};
  			parametersMap.put(name, valuesArray);
  		}else{
  			String[] storedValues = (String[])parametersMap.get( name );
  			int lengthSrc = storedValues.length;
  			String[] valuesArray = new String[lengthSrc+1];
  			System.arraycopy(storedValues, 0, valuesArray, 0, lengthSrc);
  			valuesArray[lengthSrc] = value;
  			parametersMap.put(name, valuesArray);
  		}
  	}
  	
  	public Enumeration getParameterNames() {
  		if( parametersMap == null ) parseRequest();
  		
  		return Collections.enumeration( parametersMap.keySet() );
  	}
  	
  	public String getParameter(String name) {
  		if( parametersMap == null ) parseRequest();
  		
  		String[] values = (String[])parametersMap.get( name );
  		if( values == null )
  			return null;
  		return values[0];
  	}
  	
  	public String[] getParameterValues(String name) {
  		if( parametersMap == null ) parseRequest();
  		
  		return (String[])parametersMap.get( name );
  	}
  	
  	public Map getParameterMap() {
  		if( parametersMap == null ) parseRequest();
  		
  		return parametersMap;
  	}
  	
  	// Hook for the x:inputFileUpload tag.
  	public FileItem getFileItem(String fieldName) {
  		if( fileItems == null ) parseRequest();
  		
  		return (FileItem) fileItems.get( fieldName );
  	}
  }
  
  
  
  1.1                  incubator-myfaces/src/components/org/apache/myfaces/component/html/util/AddResource.java
  
  Index: AddResource.java
  ===================================================================
  /*
   * 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.
   */
  package org.apache.myfaces.component.html.util;
  
  import java.io.IOException;
  import java.io.InputStream;
  import java.io.OutputStream;
  
  import javax.faces.context.FacesContext;
  import javax.faces.context.ResponseWriter;
  import javax.servlet.ServletResponse;
  import javax.servlet.http.HttpServletRequest;
  
  import org.apache.commons.logging.Log;
  import org.apache.commons.logging.LogFactory;
  import org.apache.myfaces.renderkit.html.HTML;
  
  /**
   * This is a utility class to render link to resources used by custom components.
   * Mostly used to avoid having to include <script src="..."></script>
   * in the head of the pages before using a component.
   *  
   * @author Sylvain Vieujot (latest modification by $Author: svieujot $)
   * @version $Revision: 1.1 $ $Date: 2004/12/01 16:32:03 $
   * $Log: AddResource.java,v $
   * Revision 1.1  2004/12/01 16:32:03  svieujot
   * Convert the Multipart filter in an ExtensionsFilter that provides an additional facility to include resources in a page.
   * Tested only with javascript resources right now, but should work fine with images too.
   * Some work to do to include css resources.
   * The popup component has been converted to use this new Filter.
   *
   * 
   */
  public class AddResource {
      private static final Log log = LogFactory.getLog(AddResource.class);
      
      private static final String COMPONENTS_PACKAGE = "org.apache.myfaces.custom.";
      
      private static final String RESOURCE_MAP_PATH = "/myFacesExtensionResource";
      
      public static void addJavaScript(Class componentClass, String resourceFileName, FacesContext context) throws IOException{
          ResponseWriter writer = context.getResponseWriter();
          
          writer.startElement(HTML.SCRIPT_ELEM,null);
          writer.writeAttribute(HTML.SCRIPT_LANGUAGE_ATTR,HTML.SCRIPT_LANGUAGE_JAVASCRIPT,null);
          writer.writeURIAttribute(HTML.SRC_ATTR,
                  getResourceMappedPath(componentClass,resourceFileName, context),
                  null);
  
          writer.endElement(HTML.SCRIPT_ELEM);
      }
      
      public static void addJavaScriptOncePerPage(Class componentClass, String resourceFileName, FacesContext context) throws IOException{
          HttpServletRequest request = (HttpServletRequest) context.getExternalContext().getRequest();
          String javascriptRenderedAttributeName = "myFacesResourceRendered"+(componentClass.hashCode()+resourceFileName.hashCode());
          
          if( request.getAttribute(javascriptRenderedAttributeName) == null ){
              addJavaScript(componentClass, resourceFileName, context);
              request.setAttribute(javascriptRenderedAttributeName, Boolean.TRUE);
          }
      }
      
      private static String getResourceMappedPath(Class componentClass, String ressourceFileName, FacesContext context){
          String contextPath = ((HttpServletRequest)context.getExternalContext().getRequest()).getContextPath(); 
          return contextPath+getAddRessourceMaping()+"?component="+getComponentName(componentClass)
          		+"&resource="+ressourceFileName;
      }
      
      private static String getAddRessourceMaping(){
          return RESOURCE_MAP_PATH+".jsf";	// TODO Make this compliant with other mapings (/faces/* for example).
      }
      
      public static boolean isResourceMappedPath(HttpServletRequest request){
          return request.getRequestURI().endsWith( getAddRessourceMaping() )
          	&& request.getParameter("component") != null
          	&& request.getParameter("resource") != null;
      }
      
      private static String getComponentName(Class componentClass){
          String name = componentClass.getName();
          if( ! name.startsWith(COMPONENTS_PACKAGE) ){
              log.error("getComponentName called for non extension component : "+name+"\n"+
                      "For security reasons, only components member of the "+COMPONENTS_PACKAGE+" are allowed to add ressources.");
              return null;
          }
          
          name = name.substring( COMPONENTS_PACKAGE.length() );
          
          /*
          int posFirstDot = name.indexOf('.');
          if( posFirstDot > 0 )
              name = name.substring(0,posFirstDot);
              */
          return name;
      }
      
      static Class getComponent(String componentName) throws ClassNotFoundException{
          return Class.forName( COMPONENTS_PACKAGE+componentName );
      }
      
      static private InputStream getResource(String componentName, String resourceFileName) {
          Class component;
          try {
              component = getComponent(componentName);
          } catch (ClassNotFoundException e) {
              log.error("Class not found for component "+componentName);
  			return null;
          }
          while( resourceFileName.startsWith(".") || resourceFileName.startsWith("/") || resourceFileName.startsWith("\\") )
                  resourceFileName = resourceFileName.substring(1);
  
          return component.getResourceAsStream( "resource/"+resourceFileName );
      }
      
      static public void serveResource(HttpServletRequest request, ServletResponse response) throws IOException{
          String componentName = request.getParameter("component");
          String resourceFileName = request.getParameter("resource");
          
          if( resourceFileName.endsWith(".js") )
              response.setContentType("text/javascript");
          
          InputStream is = getResource(componentName, resourceFileName);
          if( is == null ){
              throw new IOException("Unable to find resource "+resourceFileName+" for component "+componentName);
          }
          OutputStream os = response.getOutputStream();
          int c;
          while ((c = is.read()) != -1)
              os.write(c);
  
          os.close();
      }
  }
  
  
  1.6       +6 -2      incubator-myfaces/src/components/org/apache/myfaces/custom/fileupload/MultipartFilter.java
  
  Index: MultipartFilter.java
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/src/components/org/apache/myfaces/custom/fileupload/MultipartFilter.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- MultipartFilter.java	16 Nov 2004 16:25:52 -0000	1.5
  +++ MultipartFilter.java	1 Dec 2004 16:32:03 -0000	1.6
  @@ -16,6 +16,7 @@
   package org.apache.myfaces.custom.fileupload;
   
   import org.apache.commons.fileupload.FileUpload;
  +import org.apache.myfaces.component.html.util.MultipartRequestWrapper;
   
   import java.io.IOException;
   
  @@ -24,6 +25,9 @@
   
   
   /**
  + * Note : This filter is deprecated.
  + * It has been replaced by the new org.apache.myfaces.component.html.util.ExtensionsFilter.
  + * 
    * @author Sylvain Vieujot (latest modification by $Author$)
    * @version $Revision$ $Date$
    */
  
  
  
  1.15      +6 -2      incubator-myfaces/src/components/org/apache/myfaces/custom/fileupload/HtmlFileUploadRenderer.java
  
  Index: HtmlFileUploadRenderer.java
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/src/components/org/apache/myfaces/custom/fileupload/HtmlFileUploadRenderer.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- HtmlFileUploadRenderer.java	13 Oct 2004 11:50:57 -0000	1.14
  +++ HtmlFileUploadRenderer.java	1 Dec 2004 16:32:03 -0000	1.15
  @@ -16,6 +16,7 @@
   package org.apache.myfaces.custom.fileupload;
   
   import org.apache.myfaces.component.UserRoleUtils;
  +import org.apache.myfaces.component.html.util.MultipartRequestWrapper;
   import org.apache.myfaces.renderkit.RendererUtils;
   import org.apache.myfaces.renderkit.html.HTML;
   import org.apache.myfaces.renderkit.html.HtmlRendererUtils;
  @@ -37,6 +38,12 @@
    * @author Manfred Geiler (latest modification by $Author$)
    * @version $Revision$ $Date$
    * $Log$
  + * Revision 1.15  2004/12/01 16:32:03  svieujot
  + * Convert the Multipart filter in an ExtensionsFilter that provides an additional facility to include resources in a page.
  + * Tested only with javascript resources right now, but should work fine with images too.
  + * Some work to do to include css resources.
  + * The popup component has been converted to use this new Filter.
  + *
    * Revision 1.14  2004/10/13 11:50:57  matze
    * renamed packages to org.apache
    *
  
  
  
  1.1                  incubator-myfaces/src/components/org/apache/myfaces/custom/popup/resource/JSPopup.js
  
  Index: JSPopup.js
  ===================================================================
  var orgApacheMyfacesPopupCurrentlyOpenedPopup;
  
  function orgApacheMyfacesPopup(popupId,displayAtDistanceX,displayAtDistanceY)
  {
      this.popupId = popupId;
      this.displayAtDistanceX=displayAtDistanceX;
      this.displayAtDistanceY=displayAtDistanceY;    
      this.display = orgApacheMyfacesPopupDisplay;
      this.hide = orgApacheMyfacesPopupHide;
      this.redisplay=orgApacheMyfacesPopupRedisplay;
  }
  
  function orgApacheMyfacesPopupDisplay(ev)
  {
  
      if(orgApacheMyfacesPopupCurrentlyOpenedPopup!=null)
          orgApacheMyfacesPopupCurrentlyOpenedPopup.style.display="none";
  
      var elem;
      var x;
      var y;
  
      if(document.all)
      {
          elem = window.event.srcElement;
          x=window.event.x;
          y=window.event.y;
      }
      else
      {
          elem = ev.target;
          x=ev.pageX;
          y=ev.pageY;
      }
  
      x+=this.displayAtDistanceX;
      y+=this.displayAtDistanceY;
  
      var popupElem = document.getElementById(this.popupId);
  
      if(popupElem.style.display!="block")
      {
          popupElem.style.display="block";
          popupElem.style.left=""+x+"px";
          popupElem.style.top=""+y+"px";
          orgApacheMyfacesPopupCurrentlyOpenedPopup = popupElem;
      }
  }
  
  function orgApacheMyfacesPopupHide()
  {
      var popupElem = document.getElementById(this.popupId);
      popupElem.style.display="none";
  }
  
  function orgApacheMyfacesPopupRedisplay()
  {
      var popupElem = document.getElementById(this.popupId);
      popupElem.style.display="block";
      orgApacheMyfacesPopupCurrentlyOpenedPopup = popupElem;
  }
  
  
  1.28      +6 -6      incubator-myfaces/conf/web.xml
  
  Index: web.xml
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/conf/web.xml,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- web.xml	16 Nov 2004 16:25:52 -0000	1.27
  +++ web.xml	1 Dec 2004 16:32:03 -0000	1.28
  @@ -127,10 +127,10 @@
   
       <!-- MultiPart Filter -->
       <filter>
  -        <filter-name>multipartFilter</filter-name>
  -        <filter-class>org.apache.myfaces.custom.fileupload.MultipartFilter</filter-class>
  +        <filter-name>extensionsFilter</filter-name>
  +        <filter-class>org.apache.myfaces.component.html.util.ExtensionsFilter</filter-class>
           <init-param>
  -            <param-name>maxFileSize</param-name>
  +            <param-name>uploadMaxFileSize</param-name>
               <param-value>100m</param-value>
               <description>Set the size limit for uploaded files.
                   Format: 10 - 10 bytes
  @@ -140,7 +140,7 @@
               </description>
           </init-param>
           <init-param>
  -            <param-name>thresholdSize</param-name>
  +            <param-name>uploadThresholdSize</param-name>
               <param-value>100k</param-value>
               <description>Set the threshold size - files
                       below this limit are stored in memory, files above
  @@ -153,7 +153,7 @@
               </description>
           </init-param>
   <!--        <init-param>
  -            <param-name>repositoryPath</param-name>
  +            <param-name>uploadRepositoryPath</param-name>
               <param-value>/temp</param-value>
               <description>Set the path where the intermediary files will be stored.
               </description>
  @@ -178,7 +178,7 @@
   
   
       <filter-mapping>
  -        <filter-name>multipartFilter</filter-name>
  +        <filter-name>extensionsFilter</filter-name>
           <url-pattern>*.jsf</url-pattern>
       </filter-mapping>
   
  
  
  
  1.64      +4 -0      incubator-myfaces/build/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/incubator-myfaces/build/build.xml,v
  retrieving revision 1.63
  retrieving revision 1.64
  diff -u -r1.63 -r1.64
  --- build.xml	21 Nov 2004 12:39:09 -0000	1.63
  +++ build.xml	1 Dec 2004 16:32:03 -0000	1.64
  @@ -210,6 +210,8 @@
                           includes="faces-config.xml"
                           prefix="META-INF/"/>
               <!-- components_resources -->
  +        	<fileset dir="${components.src}"
  +        			includes="**/resource/**"/>
               <zipfileset dir="${components_resource.src}"
                           includes="**"
                           prefix="resource"/>
  @@ -265,6 +267,8 @@
                           includes="faces-config.xml"
                           prefix="META-INF/"/>
               <!-- components_resources -->
  +        	<fileset dir="${components.src}"
  +        			includes="**/resource/**"/>
               <zipfileset dir="${components_resource.src}"
                           includes="**"
                           prefix="resource"/>