myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "sean schofield (JIRA)" <myfaces-...@incubator.apache.org>
Subject [jira] Commented: (MYFACES-258) build/codegen ant generate-all-components-components fails FileNotFoundException
Date Fri, 27 May 2005 14:01:53 GMT
     [ http://issues.apache.org/jira/browse/MYFACES-258?page=comments#action_66454 ]
     
sean schofield commented on MYFACES-258:
----------------------------------------

I still must confess I do not understand why we need the source code generator.  Maybe the
MyFaces veterans can explain this to me?  My thinking was that this helped to generate a lot
of the duplicate source code between components back when that source code did not yet exist.
 Do we still need it.

Also, please make sure that the setRowOnMouseOver methods, etc. don't ultimately disappear
from HtmlDataTable as a result of the fix.  It looks like its being replaced with a auto generated
version but I can't understand the advantage of doing it that way.

> build/codegen ant generate-all-components-components fails FileNotFoundException
> --------------------------------------------------------------------------------
>
>          Key: MYFACES-258
>          URL: http://issues.apache.org/jira/browse/MYFACES-258
>      Project: MyFaces
>         Type: Bug
>     Versions: Nightly Build
>  Environment: WinXP, JDK 1.4.2_08, Ant 1.6.4
>     Reporter: Jeff Keene
>     Priority: Minor

>
> Trying to build from sources, generating components was failing on FileNotFoundException
when using the generate-all-components-components target.  Also failed on any of the targets
in build/codegen/build.xml where multiple includes were selected.  Adjusted logic in ComponentGeneratorTask,
patch appended.  Reran, found some code duplication post generation in HtmlDataTable and HtmlInputTextarea,
patches appended.
> -------------------------------
> Index: ComponentGeneratorTask.java
> ===================================================================
> --- ComponentGeneratorTask.java	(revision 178731)
> +++ ComponentGeneratorTask.java	(working copy)
> @@ -86,25 +86,20 @@
>  
>          ComponentGenerator generator = new ComponentGenerator(_destdir, _velocityLoaderPath);
>  
> -        if(_includes==null)
> +        DirectoryScanner ds = getDirectoryScanner(_basedir);
> +        if (_includes != null)
>          {
> -            DirectoryScanner ds = getDirectoryScanner(_basedir);
> -            ds.scan();
> -
> -            String[] files = ds.getIncludedFiles();
> -            for (int i = 0; i < files.length; i++)
> -            {
> -                String xmlFileName = files[i];
> -                log.info("on xmlFileName : "+files[i]);
> -                generator.generate(new File(_basedir, xmlFileName));
> -            }
> +            ds.setIncludes(_includes.split(","));
>          }
> -        else
> -        {
> -            //_includes = _includes.replace('/','\\');
>  
> -            log.info("on xmlFileName : "+_basedir+"/"+_includes);
> -            generator.generate(new File(_basedir, _includes));
> +        ds.scan();
> +
> +        String[] files = ds.getIncludedFiles();
> +        for (int i = 0; i < files.length; i++)
> +        {
> +            String xmlFileName = files[i];
> +            log.info("on xmlFileName : "+files[i]);
> +            generator.generate(new File(_basedir, xmlFileName));
>          }
>      }
>  
> Index: HtmlDataTable.java
> ===================================================================
> --- HtmlDataTable.java	(revision 178731)
> +++ HtmlDataTable.java	(working copy)
> @@ -61,8 +61,6 @@
>  
>      private String _sortColumn = null;
>      private Boolean _sortAscending = null;
> -    private String _rowOnMouseOver = null;
> -    private String _rowOnMouseOut = null;
>  
>      public void setValue(Object value)
>      {
> @@ -659,51 +657,11 @@
>          return v != null ? v.booleanValue() : DEFAULT_SORTASCENDING;
>      }
>  
> -    public void setRowOnMouseOver(String rowOnMouseOver)
> -    {
> -        _rowOnMouseOver = rowOnMouseOver;
> -        // update model is necessary here, because processUpdates is never called
> -        // reason: HtmlCommandSortHeader.isImmediate() == true
> -        ValueBinding vb = getValueBinding("rowOnMouseOver");
> -        if (vb != null)
> -        {
> -            vb.setValue(getFacesContext(), _rowOnMouseOver);
> -            _rowOnMouseOver = null;
> -        }
> -    }
> -
> -    public String getRowOnMouseOver()
> -    {
> -        if (_rowOnMouseOver != null) return _rowOnMouseOver;
> -        ValueBinding vb = getValueBinding("rowOnMouseOver");
> -        return vb != null ? (String)vb.getValue(getFacesContext()) : null;
> -    }
> -
> -    public void setRowOnMouseOut(String rowOnMouseOut)
> -    {
> -        _rowOnMouseOut = rowOnMouseOut;
> -        // update model is necessary here, because processUpdates is never called
> -        // reason: HtmlCommandSortHeader.isImmediate() == true
> -        ValueBinding vb = getValueBinding("rowOnMouseOut");
> -        if (vb != null)
> -        {
> -            vb.setValue(getFacesContext(), _rowOnMouseOut);
> -            _rowOnMouseOut = null;
> -        }
> -    }
> -
> -    public String getRowOnMouseOut()
> -    {
> -        if (_rowOnMouseOut != null) return _rowOnMouseOut;
> -        ValueBinding vb = getValueBinding("rowOnMouseOut");
> -        return vb != null ? (String)vb.getValue(getFacesContext()) : null;
> -    }
> -
>      //------------------ GENERATED CODE BEGIN (do not modify!) --------------------
>  
>      public static final String COMPONENT_TYPE = "org.apache.myfaces.HtmlDataTable";
>      private static final boolean DEFAULT_PRESERVEDATAMODEL = false;
> -    private static final boolean DEFAULT_PRESERVESORT = true;
> +    private static final boolean DEFAULT_PRESERVESORT = false;
>      private static final boolean DEFAULT_RENDEREDIFEMPTY = true;
>  
>      private Boolean _preserveDataModel = null;
> @@ -714,6 +672,8 @@
>      private String _rowIndexVar = null;
>      private String _rowCountVar = null;
>      private String _previousRowDataVar = null;
> +    private String _rowOnMouseOver = null;
> +    private String _rowOnMouseOut = null;
>  
>      public HtmlDataTable()
>      {
> @@ -733,6 +693,15 @@
>          return v != null ? v.booleanValue() : DEFAULT_PRESERVEDATAMODEL;
>      }
>  
> +
> +    public boolean isSetPreserveDataModel()
> +    {
> +        if (_preserveDataModel != null) return true;
> +        ValueBinding vb = getValueBinding("preserveDataModel");
> +        Boolean v = vb != null ? (Boolean)vb.getValue(getFacesContext()) : null;
> +        return v != null;
> +    }
> +
>      public void setPreserveSort(boolean preserveSort)
>      {
>          _preserveSort = Boolean.valueOf(preserveSort);
> @@ -746,6 +715,15 @@
>          return v != null ? v.booleanValue() : DEFAULT_PRESERVESORT;
>      }
>  
> +
> +    public boolean isSetPreserveSort()
> +    {
> +        if (_preserveSort != null) return true;
> +        ValueBinding vb = getValueBinding("preserveSort");
> +        Boolean v = vb != null ? (Boolean)vb.getValue(getFacesContext()) : null;
> +        return v != null;
> +    }
> +
>      public void setEnabledOnUserRole(String enabledOnUserRole)
>      {
>          _enabledOnUserRole = enabledOnUserRole;
> @@ -783,6 +761,15 @@
>          return v != null ? v.booleanValue() : DEFAULT_RENDEREDIFEMPTY;
>      }
>  
> +
> +    public boolean isSetRenderedIfEmpty()
> +    {
> +        if (_renderedIfEmpty != null) return true;
> +        ValueBinding vb = getValueBinding("renderedIfEmpty");
> +        Boolean v = vb != null ? (Boolean)vb.getValue(getFacesContext()) : null;
> +        return v != null;
> +    }
> +
>      public void setRowIndexVar(String rowIndexVar)
>      {
>          _rowIndexVar = rowIndexVar;
> @@ -819,7 +806,31 @@
>          return vb != null ? (String)vb.getValue(getFacesContext()) : null;
>      }
>  
> +    public void setRowOnMouseOver(String rowOnMouseOver)
> +    {
> +        _rowOnMouseOver = rowOnMouseOver;
> +    }
>  
> +    public String getRowOnMouseOver()
> +    {
> +        if (_rowOnMouseOver != null) return _rowOnMouseOver;
> +        ValueBinding vb = getValueBinding("rowOnMouseOver");
> +        return vb != null ? (String)vb.getValue(getFacesContext()) : null;
> +    }
>  
> +    public void setRowOnMouseOut(String rowOnMouseOut)
> +    {
> +        _rowOnMouseOut = rowOnMouseOut;
> +    }
> +
> +    public String getRowOnMouseOut()
> +    {
> +        if (_rowOnMouseOut != null) return _rowOnMouseOut;
> +        ValueBinding vb = getValueBinding("rowOnMouseOut");
> +        return vb != null ? (String)vb.getValue(getFacesContext()) : null;
> +    }
> +
> +
> +
>      //------------------ GENERATED CODE END ---------------------------------------
>  }
> Index: HtmlInputTextarea.java
> ===================================================================
> --- HtmlInputTextarea.java	(revision 178731)
> +++ HtmlInputTextarea.java	(working copy)
> @@ -51,8 +51,8 @@
>      private String _enabledOnUserRole = null;
>      private String _visibleOnUserRole = null;
>      private Boolean _displayValueOnly = null;
> -	private String _displayValueOnlyStyle = null;
> -	private String _displayValueOnlyStyleClass = null;
> +    private String _displayValueOnlyStyle = null;
> +    private String _displayValueOnlyStyleClass = null;
>  
>      public HtmlInputTextarea()
>      {
> @@ -83,7 +83,6 @@
>          return vb != null ? (String)vb.getValue(getFacesContext()) : null;
>      }
>  
> -
>      public boolean isRendered()
>      {
>          if (!UserRoleUtils.isVisibleOnUserRole(this)) return false;

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message