You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by st...@apache.org on 2011/10/20 12:49:36 UTC

svn commit: r1186730 [7/22] - in /myfaces/commons/branches/jsf_20: examples/ examples/myfaces-commons-examples/src/main/java/org/apache/myfaces/commons/examples/ examples/myfaces-commons-examples/src/main/java/org/apache/myfaces/commons/examples/access...

Modified: myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/exporter/util/ExcelExporterUtil.java
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/exporter/util/ExcelExporterUtil.java?rev=1186730&r1=1186729&r2=1186730&view=diff
==============================================================================
--- myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/exporter/util/ExcelExporterUtil.java (original)
+++ myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/exporter/util/ExcelExporterUtil.java Thu Oct 20 10:49:18 2011
@@ -1,197 +1,197 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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.commons.exporter.util;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.faces.component.UIColumn;
-import javax.faces.component.UIComponent;
-import javax.faces.component.ValueHolder;
-import javax.faces.component.html.HtmlDataTable;
-import javax.faces.context.FacesContext;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.poi.hssf.usermodel.HSSFCell;
-import org.apache.poi.hssf.usermodel.HSSFRow;
-import org.apache.poi.hssf.usermodel.HSSFSheet;
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
-
-/**
- * This class is a utility class for serving excel exporting.
- */
-public class ExcelExporterUtil 
-{
-    
-    /**
-     * This utility method is used for generating the excel 
-     * table to the HttpServletResponse object. 
-     * @param workBook
-     * @param response
-     * @param fileName
-     * @throws IOException
-     */
-    public static void generateEXCEL(FacesContext facesContext,
-            HttpServletResponse response, String fileName,
-            HtmlDataTable dataTable) throws IOException
-    {
-
-        /*
-         * By default if the fileName is not specified, then use the
-         * table id.
-         */
-        if (fileName == null)
-        {
-            fileName = dataTable.getId();
-        }
-
-        /* generate the excel model */
-        HSSFWorkbook generatedExcel = ExcelExporterUtil
-                .generateExcelTableModel(facesContext, dataTable);
-
-        writeExcelToResponse(response, generatedExcel, fileName);
-    }    
-
-    private static void addColumnHeaders(HSSFSheet sheet, List columns)
-    {
-        HSSFRow rowHeader = sheet.createRow(0);
-
-        for (int i = 0; i < columns.size(); i++)
-        {
-            UIColumn column = (UIColumn) columns.get(i);
-            addColumnValue(rowHeader, column.getHeader(), i);
-        }
-    }
-
-    private static List getColumns(HtmlDataTable table)
-    {
-        List columns = new ArrayList();
-        for (int i = 0; i < table.getChildCount(); i++)
-        {
-            UIComponent child = (UIComponent) table.getChildren().get(i);
-            if (child instanceof UIColumn)
-            {
-                columns.add(child);
-            }
-        }
-        return columns;
-    }
-
-    private static void addColumnValue(HSSFRow rowHeader,
-            UIComponent component, int index)
-    {
-        HSSFCell cell = rowHeader.createCell((short) index);
-        cell.setEncoding(HSSFCell.ENCODING_UTF_16);
-        if (component instanceof ValueHolder)
-        {
-            String stringValue = ComponentUtils.getStringValue(FacesContext
-                    .getCurrentInstance(), component);
-            cell.setCellValue(stringValue);
-        }
-    }
-
-    private static void addColumnValue(HSSFRow rowHeader, String value,
-            int index)
-    {
-        HSSFCell cell = rowHeader.createCell((short) index);
-        cell.setEncoding(HSSFCell.ENCODING_UTF_16);
-        cell.setCellValue(value);
-    }
-
-    /*
-     * This method is used for adding the columns values to the HSSFSheet.
-     */
-    private static void generateTableContent(FacesContext facesContext,
-            HSSFSheet sheet, List columns, HtmlDataTable dataTable)
-    {
-
-        int numberOfColumns = columns.size();
-        int numberOfRows = dataTable.getRowCount();
-        int startFrom = 0;
-        int currentIndex = 1;
-        int endAt = numberOfRows;
-
-        /* fill the table with the data. */
-        for (int i = startFrom; i < endAt; ++i)
-        {
-            dataTable.setRowIndex(i);
-            HSSFRow row = sheet.createRow(currentIndex++);
-            for (int j = 0; j < numberOfColumns; ++j)
-            {
-                UIColumn column = (UIColumn) columns.get(j);
-                String cellValue = "";
-
-                for (int k = 0; k < column.getChildren().size(); ++k)
-                {
-                    if (column.getChildren().get(k) instanceof ValueHolder)
-                    {
-                        cellValue += ((ValueHolder) column.getChildren().get(k))
-                                .getValue();
-                    }
-                }
-                addColumnValue(row, cellValue, j);
-            }
-        }
-    }
-
-    /*
-     * This utility method is used for writing the excelModel (generatedExcel)
-     * to the response (response) and uses the (fileName) as the generated file
-     * name.
-     */
-    private static void writeExcelToResponse(HttpServletResponse response,
-            HSSFWorkbook generatedExcel, String fileName) throws IOException
-    {
-
-        /* write the model to the stream */
-        response.setContentType("application/vnd.ms-excel");
-        response.setHeader("Expires", "0");
-        response.setHeader("Cache-Control",
-                "must-revalidate, post-check=0, pre-check=0");
-        response.setHeader("Pragma", "public");
-        response.setHeader("Content-disposition", "attachment;filename="
-                + fileName + ".xls");
-
-        generatedExcel.write(response.getOutputStream());
-    }
-
-    /*
-     * This utility method is used for generating the (HSSFWorkbook) 
-     * excel table model from the passed (HtmlDataTable).
-     * @param facesContext
-     * @param table the passed (HtmlDataTable).
-     * @return the (HSSFWorkbook) object. 
-     */
-    private static HSSFWorkbook generateExcelTableModel(
-            FacesContext facesContext, HtmlDataTable dataTable)
-    {
-
-        HSSFWorkbook workbook = new HSSFWorkbook();
-        HSSFSheet sheet = workbook.createSheet(dataTable.getId());
-        List columns = getColumns(dataTable);
-        int currentRowIndex = dataTable.getRowIndex();
-
-        addColumnHeaders(sheet, columns);
-        generateTableContent(facesContext, sheet, columns, dataTable);
-
-        dataTable.setRowIndex(currentRowIndex);
-        return workbook;
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.commons.exporter.util;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.faces.component.UIColumn;
+import javax.faces.component.UIComponent;
+import javax.faces.component.ValueHolder;
+import javax.faces.component.html.HtmlDataTable;
+import javax.faces.context.FacesContext;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.poi.hssf.usermodel.HSSFCell;
+import org.apache.poi.hssf.usermodel.HSSFRow;
+import org.apache.poi.hssf.usermodel.HSSFSheet;
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
+
+/**
+ * This class is a utility class for serving excel exporting.
+ */
+public class ExcelExporterUtil 
+{
+    
+    /**
+     * This utility method is used for generating the excel 
+     * table to the HttpServletResponse object. 
+     * @param workBook
+     * @param response
+     * @param fileName
+     * @throws IOException
+     */
+    public static void generateEXCEL(FacesContext facesContext,
+            HttpServletResponse response, String fileName,
+            HtmlDataTable dataTable) throws IOException
+    {
+
+        /*
+         * By default if the fileName is not specified, then use the
+         * table id.
+         */
+        if (fileName == null)
+        {
+            fileName = dataTable.getId();
+        }
+
+        /* generate the excel model */
+        HSSFWorkbook generatedExcel = ExcelExporterUtil
+                .generateExcelTableModel(facesContext, dataTable);
+
+        writeExcelToResponse(response, generatedExcel, fileName);
+    }    
+
+    private static void addColumnHeaders(HSSFSheet sheet, List columns)
+    {
+        HSSFRow rowHeader = sheet.createRow(0);
+
+        for (int i = 0; i < columns.size(); i++)
+        {
+            UIColumn column = (UIColumn) columns.get(i);
+            addColumnValue(rowHeader, column.getHeader(), i);
+        }
+    }
+
+    private static List getColumns(HtmlDataTable table)
+    {
+        List columns = new ArrayList();
+        for (int i = 0; i < table.getChildCount(); i++)
+        {
+            UIComponent child = (UIComponent) table.getChildren().get(i);
+            if (child instanceof UIColumn)
+            {
+                columns.add(child);
+            }
+        }
+        return columns;
+    }
+
+    private static void addColumnValue(HSSFRow rowHeader,
+            UIComponent component, int index)
+    {
+        HSSFCell cell = rowHeader.createCell((short) index);
+        cell.setEncoding(HSSFCell.ENCODING_UTF_16);
+        if (component instanceof ValueHolder)
+        {
+            String stringValue = ComponentUtils.getStringValue(FacesContext
+                    .getCurrentInstance(), component);
+            cell.setCellValue(stringValue);
+        }
+    }
+
+    private static void addColumnValue(HSSFRow rowHeader, String value,
+            int index)
+    {
+        HSSFCell cell = rowHeader.createCell((short) index);
+        cell.setEncoding(HSSFCell.ENCODING_UTF_16);
+        cell.setCellValue(value);
+    }
+
+    /*
+     * This method is used for adding the columns values to the HSSFSheet.
+     */
+    private static void generateTableContent(FacesContext facesContext,
+            HSSFSheet sheet, List columns, HtmlDataTable dataTable)
+    {
+
+        int numberOfColumns = columns.size();
+        int numberOfRows = dataTable.getRowCount();
+        int startFrom = 0;
+        int currentIndex = 1;
+        int endAt = numberOfRows;
+
+        /* fill the table with the data. */
+        for (int i = startFrom; i < endAt; ++i)
+        {
+            dataTable.setRowIndex(i);
+            HSSFRow row = sheet.createRow(currentIndex++);
+            for (int j = 0; j < numberOfColumns; ++j)
+            {
+                UIColumn column = (UIColumn) columns.get(j);
+                String cellValue = "";
+
+                for (int k = 0; k < column.getChildren().size(); ++k)
+                {
+                    if (column.getChildren().get(k) instanceof ValueHolder)
+                    {
+                        cellValue += ((ValueHolder) column.getChildren().get(k))
+                                .getValue();
+                    }
+                }
+                addColumnValue(row, cellValue, j);
+            }
+        }
+    }
+
+    /*
+     * This utility method is used for writing the excelModel (generatedExcel)
+     * to the response (response) and uses the (fileName) as the generated file
+     * name.
+     */
+    private static void writeExcelToResponse(HttpServletResponse response,
+            HSSFWorkbook generatedExcel, String fileName) throws IOException
+    {
+
+        /* write the model to the stream */
+        response.setContentType("application/vnd.ms-excel");
+        response.setHeader("Expires", "0");
+        response.setHeader("Cache-Control",
+                "must-revalidate, post-check=0, pre-check=0");
+        response.setHeader("Pragma", "public");
+        response.setHeader("Content-disposition", "attachment;filename="
+                + fileName + ".xls");
+
+        generatedExcel.write(response.getOutputStream());
+    }
+
+    /*
+     * This utility method is used for generating the (HSSFWorkbook) 
+     * excel table model from the passed (HtmlDataTable).
+     * @param facesContext
+     * @param table the passed (HtmlDataTable).
+     * @return the (HSSFWorkbook) object. 
+     */
+    private static HSSFWorkbook generateExcelTableModel(
+            FacesContext facesContext, HtmlDataTable dataTable)
+    {
+
+        HSSFWorkbook workbook = new HSSFWorkbook();
+        HSSFSheet sheet = workbook.createSheet(dataTable.getId());
+        List columns = getColumns(dataTable);
+        int currentRowIndex = dataTable.getRowIndex();
+
+        addColumnHeaders(sheet, columns);
+        generateTableContent(facesContext, sheet, columns, dataTable);
+
+        dataTable.setRowIndex(currentRowIndex);
+        return workbook;
+    }
+}

Propchange: myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/exporter/util/ExcelExporterUtil.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/exporter/util/ExporterConstants.java
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/exporter/util/ExporterConstants.java?rev=1186730&r1=1186729&r2=1186730&view=diff
==============================================================================
--- myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/exporter/util/ExporterConstants.java (original)
+++ myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/exporter/util/ExporterConstants.java Thu Oct 20 10:49:18 2011
@@ -1,27 +1,27 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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.commons.exporter.util;
-
-public interface ExporterConstants {
-    public static String EXPORTER_TABLE_ID = "exporterTableId";
-    public static String EXPORTER_FILE_NAME = "exporterFileName";
-    public static String EXPORTER_FILE_TYPE = "exporterFileType";
-    public static String PDF_FILE_TYPE = "PDF";
-    public static String EXCEL_FILE_TYPE = "XLS";    
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.commons.exporter.util;
+
+public interface ExporterConstants {
+    public static String EXPORTER_TABLE_ID = "exporterTableId";
+    public static String EXPORTER_FILE_NAME = "exporterFileName";
+    public static String EXPORTER_FILE_TYPE = "exporterFileType";
+    public static String PDF_FILE_TYPE = "PDF";
+    public static String EXCEL_FILE_TYPE = "XLS";    
+}

Propchange: myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/exporter/util/ExporterConstants.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/exporter/util/PDFExporterUtil.java
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/exporter/util/PDFExporterUtil.java?rev=1186730&r1=1186729&r2=1186730&view=diff
==============================================================================
--- myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/exporter/util/PDFExporterUtil.java (original)
+++ myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/exporter/util/PDFExporterUtil.java Thu Oct 20 10:49:18 2011
@@ -1,198 +1,198 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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.commons.exporter.util;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.util.List;
-
-import javax.faces.component.UIColumn;
-import javax.faces.component.UIComponent;
-import javax.faces.component.ValueHolder;
-import javax.faces.component.html.HtmlDataTable;
-import javax.faces.context.FacesContext;
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.HttpServletResponse;
-
-import com.lowagie.text.Document;
-import com.lowagie.text.pdf.PdfPTable;
-import com.lowagie.text.pdf.PdfWriter;
-
-/**
- * This class is a utility class for serving PDF exporting.
- */
-public class PDFExporterUtil
-{
-
-    /*
-     * This method is used for setting the response headers of the pdf.
-     */
-    private static void setPDFResponseHeaders(HttpServletResponse response,
-            ByteArrayOutputStream byteArrayStream, String fileName)
-            throws IOException
-    {
-
-        // setting response headers.
-        response.setHeader("Expires", "0");
-        response.setHeader("Cache-Control",
-                "must-revalidate, post-check=0, pre-check=0");
-        response.setHeader("Pragma", "public");
-        response.setHeader("Content-disposition", "attachment;filename="
-                + fileName + ".pdf");
-
-        // setting the content type.
-        response.setContentType("application/pdf");
-
-        // the contentlength is needed for MSIE.
-        response.setContentLength(byteArrayStream.size());
-
-        // write ByteArrayOutputStream to the ServletOutputStream.
-        ServletOutputStream outputStream = response.getOutputStream();
-
-        byteArrayStream.writeTo(outputStream);
-        outputStream.flush();
-    }
-
-    /*
-     * This method is used for adding the columns headers to the pdfTable.
-     */
-    private static void generateTableHeader(PdfPTable pdfTable, List columns)
-    {
-        for (int i = 0; i < columns.size(); i++)
-        {
-            UIColumn column = (UIColumn) columns.get(i);
-            UIComponent columnHeaderCell = column.getHeader();
-            if (columnHeaderCell instanceof ValueHolder)
-            {
-                String cellValue = ComponentUtils.getStringValue(FacesContext
-                        .getCurrentInstance(), columnHeaderCell);
-                pdfTable.addCell(cellValue);
-            }
-        }
-    }
-
-    /*
-     * This method is used for adding the columns values to the pdfTable.
-     */
-    private static void generateTableContent(FacesContext facesContext,
-            PdfPTable pdfTable, List columns, HtmlDataTable dataTable)
-    {
-        int numberOfColumns = columns.size();
-        int numberOfRows = dataTable.getRowCount();
-        int startFrom = 0;
-        int endAt = numberOfRows;
-
-        /* fill the table with the data. */
-        for (int i = startFrom; i < endAt; ++i)
-        {
-            dataTable.setRowIndex(i);
-            for (int j = 0; j < numberOfColumns; ++j)
-            {
-                String cellValue = "";
-                UIColumn currentColumn = (UIColumn) columns.get(j);
-
-                for (int k = 0; k < currentColumn.getChildren().size(); ++k)
-                {
-                    if (currentColumn.getChildren().get(k) instanceof ValueHolder)
-                    {
-                        cellValue += ((ValueHolder) currentColumn.getChildren()
-                                .get(k)).getValue();
-                    }
-                }
-
-                pdfTable.addCell(cellValue);
-            }
-        }
-    }
-
-    /*
-     * This method is used for creating the PDFTable model.
-     */
-    public static PdfPTable generatePDFTableModel(FacesContext facesContext,
-            HtmlDataTable dataTable)
-    {
-        int numberOfColumns;
-        List columns = null;
-        PdfPTable pdfTable = null;
-
-        /* getting the HTMLDataTable Columns */
-        columns = ComponentUtils.getHTMLDataTableColumns(dataTable);
-
-        if (columns.size() == 0)
-        {
-            return null;
-        }
-        else
-        {
-            numberOfColumns = columns.size();
-        }
-
-        /* creating the PDF Table */
-        pdfTable = new PdfPTable(numberOfColumns);
-
-        generateTableHeader(pdfTable, columns);
-
-        generateTableContent(facesContext, pdfTable, columns, dataTable);
-
-        return pdfTable;
-    }
-
-    /**
-     * This method is responsible for writing the PDF to the response stream.
-     * 
-     * @param facesContext
-     * @param response
-     * @param fileName
-     * @param dataTable
-     */
-    public static void generatePDF(FacesContext facesContext,
-            HttpServletResponse response, String fileName,
-            HtmlDataTable dataTable) throws Exception
-    {
-        int currentRowIndex;
-        Document document = new Document();
-        ByteArrayOutputStream byteArrayStream = new ByteArrayOutputStream();
-        PdfWriter.getInstance(document, byteArrayStream);
-        PdfPTable pdfTable = null;
-
-        /*
-         * By default if the fileName is not specified, then use the table id.
-         */
-        if (fileName == null)
-        {
-            fileName = dataTable.getId();
-        }
-
-        currentRowIndex = dataTable.getRowIndex();
-
-        // generate the PDF table model.
-        pdfTable = generatePDFTableModel(facesContext, dataTable);
-
-        // open the document and write the generated PDF.
-        document.open();
-        document.add(pdfTable);
-        document.close();
-
-        // write the response headers.
-        setPDFResponseHeaders(response, byteArrayStream, fileName);
-
-        dataTable.setRowIndex(currentRowIndex);
-
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.commons.exporter.util;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.util.List;
+
+import javax.faces.component.UIColumn;
+import javax.faces.component.UIComponent;
+import javax.faces.component.ValueHolder;
+import javax.faces.component.html.HtmlDataTable;
+import javax.faces.context.FacesContext;
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletResponse;
+
+import com.lowagie.text.Document;
+import com.lowagie.text.pdf.PdfPTable;
+import com.lowagie.text.pdf.PdfWriter;
+
+/**
+ * This class is a utility class for serving PDF exporting.
+ */
+public class PDFExporterUtil
+{
+
+    /*
+     * This method is used for setting the response headers of the pdf.
+     */
+    private static void setPDFResponseHeaders(HttpServletResponse response,
+            ByteArrayOutputStream byteArrayStream, String fileName)
+            throws IOException
+    {
+
+        // setting response headers.
+        response.setHeader("Expires", "0");
+        response.setHeader("Cache-Control",
+                "must-revalidate, post-check=0, pre-check=0");
+        response.setHeader("Pragma", "public");
+        response.setHeader("Content-disposition", "attachment;filename="
+                + fileName + ".pdf");
+
+        // setting the content type.
+        response.setContentType("application/pdf");
+
+        // the contentlength is needed for MSIE.
+        response.setContentLength(byteArrayStream.size());
+
+        // write ByteArrayOutputStream to the ServletOutputStream.
+        ServletOutputStream outputStream = response.getOutputStream();
+
+        byteArrayStream.writeTo(outputStream);
+        outputStream.flush();
+    }
+
+    /*
+     * This method is used for adding the columns headers to the pdfTable.
+     */
+    private static void generateTableHeader(PdfPTable pdfTable, List columns)
+    {
+        for (int i = 0; i < columns.size(); i++)
+        {
+            UIColumn column = (UIColumn) columns.get(i);
+            UIComponent columnHeaderCell = column.getHeader();
+            if (columnHeaderCell instanceof ValueHolder)
+            {
+                String cellValue = ComponentUtils.getStringValue(FacesContext
+                        .getCurrentInstance(), columnHeaderCell);
+                pdfTable.addCell(cellValue);
+            }
+        }
+    }
+
+    /*
+     * This method is used for adding the columns values to the pdfTable.
+     */
+    private static void generateTableContent(FacesContext facesContext,
+            PdfPTable pdfTable, List columns, HtmlDataTable dataTable)
+    {
+        int numberOfColumns = columns.size();
+        int numberOfRows = dataTable.getRowCount();
+        int startFrom = 0;
+        int endAt = numberOfRows;
+
+        /* fill the table with the data. */
+        for (int i = startFrom; i < endAt; ++i)
+        {
+            dataTable.setRowIndex(i);
+            for (int j = 0; j < numberOfColumns; ++j)
+            {
+                String cellValue = "";
+                UIColumn currentColumn = (UIColumn) columns.get(j);
+
+                for (int k = 0; k < currentColumn.getChildren().size(); ++k)
+                {
+                    if (currentColumn.getChildren().get(k) instanceof ValueHolder)
+                    {
+                        cellValue += ((ValueHolder) currentColumn.getChildren()
+                                .get(k)).getValue();
+                    }
+                }
+
+                pdfTable.addCell(cellValue);
+            }
+        }
+    }
+
+    /*
+     * This method is used for creating the PDFTable model.
+     */
+    public static PdfPTable generatePDFTableModel(FacesContext facesContext,
+            HtmlDataTable dataTable)
+    {
+        int numberOfColumns;
+        List columns = null;
+        PdfPTable pdfTable = null;
+
+        /* getting the HTMLDataTable Columns */
+        columns = ComponentUtils.getHTMLDataTableColumns(dataTable);
+
+        if (columns.size() == 0)
+        {
+            return null;
+        }
+        else
+        {
+            numberOfColumns = columns.size();
+        }
+
+        /* creating the PDF Table */
+        pdfTable = new PdfPTable(numberOfColumns);
+
+        generateTableHeader(pdfTable, columns);
+
+        generateTableContent(facesContext, pdfTable, columns, dataTable);
+
+        return pdfTable;
+    }
+
+    /**
+     * This method is responsible for writing the PDF to the response stream.
+     * 
+     * @param facesContext
+     * @param response
+     * @param fileName
+     * @param dataTable
+     */
+    public static void generatePDF(FacesContext facesContext,
+            HttpServletResponse response, String fileName,
+            HtmlDataTable dataTable) throws Exception
+    {
+        int currentRowIndex;
+        Document document = new Document();
+        ByteArrayOutputStream byteArrayStream = new ByteArrayOutputStream();
+        PdfWriter.getInstance(document, byteArrayStream);
+        PdfPTable pdfTable = null;
+
+        /*
+         * By default if the fileName is not specified, then use the table id.
+         */
+        if (fileName == null)
+        {
+            fileName = dataTable.getId();
+        }
+
+        currentRowIndex = dataTable.getRowIndex();
+
+        // generate the PDF table model.
+        pdfTable = generatePDFTableModel(facesContext, dataTable);
+
+        // open the document and write the generated PDF.
+        document.open();
+        document.add(pdfTable);
+        document.close();
+
+        // write the response headers.
+        setPDFResponseHeaders(response, byteArrayStream, fileName);
+
+        dataTable.setRowIndex(currentRowIndex);
+
+    }
+}

Propchange: myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/exporter/util/PDFExporterUtil.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/facelets/util/FaceletsFunctionLibrary.java
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/facelets/util/FaceletsFunctionLibrary.java?rev=1186730&r1=1186729&r2=1186730&view=diff
==============================================================================
--- myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/facelets/util/FaceletsFunctionLibrary.java (original)
+++ myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/facelets/util/FaceletsFunctionLibrary.java Thu Oct 20 10:49:18 2011
@@ -1,52 +1,52 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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.commons.facelets.util;
-
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-
-public final class FaceletsFunctionLibrary
-{
-
-    public FaceletsFunctionLibrary()
-    {
-        super();
-    }
-
-    public static UIComponent findComponent(String expr)
-    {
-        return FacesContext.getCurrentInstance().
-            getViewRoot().findComponent(expr);
-    }
-    
-    public static String outputClientId(String expr)
-    {
-        FacesContext ctx = FacesContext.getCurrentInstance();
-        return ctx.getViewRoot().findComponent(expr).getClientId(ctx);
-    }
-    
-    public static UIComponent findComponentFrom(UIComponent c, String expr)
-    {
-        if (c != null)
-        {
-            return c.findComponent(expr);
-        }
-        return null;
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.commons.facelets.util;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+public final class FaceletsFunctionLibrary
+{
+
+    public FaceletsFunctionLibrary()
+    {
+        super();
+    }
+
+    public static UIComponent findComponent(String expr)
+    {
+        return FacesContext.getCurrentInstance().
+            getViewRoot().findComponent(expr);
+    }
+    
+    public static String outputClientId(String expr)
+    {
+        FacesContext ctx = FacesContext.getCurrentInstance();
+        return ctx.getViewRoot().findComponent(expr).getClientId(ctx);
+    }
+    
+    public static UIComponent findComponentFrom(UIComponent c, String expr)
+    {
+        if (c != null)
+        {
+            return c.findComponent(expr);
+        }
+        return null;
+    }
+}

Propchange: myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/facelets/util/FaceletsFunctionLibrary.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/outputClientId/AbstractOutputClientId.java
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/outputClientId/AbstractOutputClientId.java?rev=1186730&r1=1186729&r2=1186730&view=diff
==============================================================================
--- myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/outputClientId/AbstractOutputClientId.java (original)
+++ myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/outputClientId/AbstractOutputClientId.java Thu Oct 20 10:49:18 2011
@@ -1,79 +1,79 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * 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.commons.outputClientId;
-
-import java.io.IOException;
-
-import javax.faces.component.UIComponent;
-import javax.faces.component.UIComponentBase;
-import javax.faces.context.FacesContext;
-
-import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFComponent;
-import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFProperty;
-
-/**
- * Output the clientId of a component specified by for property.
- * 
- * @author Leonardo Uribe
- * @since 1.0.1
- */
-@JSFComponent(
-        name = "mc:outputClientId",
-        clazz = "org.apache.myfaces.commons.outputClientId.OutputClientId",
-        tagClass = "org.apache.myfaces.commons.outputClientId.OutputClientIdTag")
-public abstract class AbstractOutputClientId extends UIComponentBase
-{
-    public static final String COMPONENT_FAMILY = "javax.faces.Output";
-    public static final String COMPONENT_TYPE = "org.apache.myfaces.commons.OutputClientId";
-
-    /**
-     * The ID of the component that should be rendered.
-     * 
-     * @return
-     */
-    @JSFProperty
-    public abstract String getFor();
-
-    @Override
-    public void encodeBegin(FacesContext context) throws IOException
-    {
-        super.encodeBegin(context);
-
-        String forId = getFor();
-        UIComponent referencedComponent = null;
-
-        if (forId == null)
-        {
-            referencedComponent = getParent();
-        }
-        else
-        {
-            referencedComponent = this.findComponent(forId);
-        }
-
-        if (referencedComponent == null)
-        {
-            throw new IllegalStateException("No component found for id : "
-                    + forId);
-        }
-
-        context.getResponseWriter().write(
-                referencedComponent.getClientId(context));
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.commons.outputClientId;
+
+import java.io.IOException;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.UIComponentBase;
+import javax.faces.context.FacesContext;
+
+import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFComponent;
+import org.apache.myfaces.buildtools.maven2.plugin.builder.annotation.JSFProperty;
+
+/**
+ * Output the clientId of a component specified by for property.
+ * 
+ * @author Leonardo Uribe
+ * @since 1.0.1
+ */
+@JSFComponent(
+        name = "mc:outputClientId",
+        clazz = "org.apache.myfaces.commons.outputClientId.OutputClientId",
+        tagClass = "org.apache.myfaces.commons.outputClientId.OutputClientIdTag")
+public abstract class AbstractOutputClientId extends UIComponentBase
+{
+    public static final String COMPONENT_FAMILY = "javax.faces.Output";
+    public static final String COMPONENT_TYPE = "org.apache.myfaces.commons.OutputClientId";
+
+    /**
+     * The ID of the component that should be rendered.
+     * 
+     * @return
+     */
+    @JSFProperty
+    public abstract String getFor();
+
+    @Override
+    public void encodeBegin(FacesContext context) throws IOException
+    {
+        super.encodeBegin(context);
+
+        String forId = getFor();
+        UIComponent referencedComponent = null;
+
+        if (forId == null)
+        {
+            referencedComponent = getParent();
+        }
+        else
+        {
+            referencedComponent = this.findComponent(forId);
+        }
+
+        if (referencedComponent == null)
+        {
+            throw new IllegalStateException("No component found for id : "
+                    + forId);
+        }
+
+        context.getResponseWriter().write(
+                referencedComponent.getClientId(context));
+    }
+}

Propchange: myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/java/org/apache/myfaces/commons/outputClientId/AbstractOutputClientId.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/resources/META-INF/componentClass20.vm
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/resources/META-INF/componentClass20.vm?rev=1186730&r1=1186729&r2=1186730&view=diff
==============================================================================
--- myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/resources/META-INF/componentClass20.vm (original)
+++ myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/resources/META-INF/componentClass20.vm Thu Oct 20 10:49:18 2011
@@ -1,518 +1,518 @@
-## Velocity template used to generate JSF1.2-compatible component classes
-## from component meta-data.
-##
-## Note that there are two types of component generation:
-##  * "subclass mode" (use annotated class as a parent class)
-##  * "template mode" (use annotated class as a template)
-## This template file is used for both.
-##
-## Variable $component refers to a ComponentMeta object to process
-## Variable $utils refers to an instance of MyfacesUtils.
-##
-## When "template mode" is being used then variable $innersource
-## holds a String containing all the non-abstract functions defined
-## in the annotated class.
-##
-## The java package of the generated class is always the same as
-## the package in which the annotated class exists.
-##
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- * 
- *  http://www.apache.org/licenses/LICENSE-2.0
- * 
- *  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 ${component.packageName};
-
-import javax.el.ValueExpression;
-import javax.faces.context.FacesContext;
-import javax.faces.component.PartialStateHolder;
-import javax.faces.component.StateHolder;
-import org.apache.myfaces.commons.util.AttachedDeltaWrapper;
-$utils.importTagClasses($component)
-
-#if ($component.isTemplate())
-#set ($generatedClassParent = $component.sourceClassParentClassName)
-#else
-#set ($generatedClassParent = $component.sourceClassName)
-#end
-// Generated from class ${component.sourceClassName}.
-//
-// WARNING: This file was automatically generated. Do not edit it directly,
-//          or you will lose your changes.
-public class ${utils.getClassFromFullClass($component.className)} extends $generatedClassParent
-#if ($component.implements)
-    implements $component.implements
-#end
-{
-#if ($component.serialuid)
-    private static final long serialVersionUID = ${component.serialuid}; 
-#end  
-
-    static public final String COMPONENT_FAMILY =
-        "$component.family";
-    static public final String COMPONENT_TYPE =
-        "$component.type";
-#if ($component.rendererType)
-#if (!($component.rendererType == ""))
-    static public final String DEFAULT_RENDERER_TYPE = 
-        "$component.rendererType";
-#end
-#end
-
-#if ($innersource)
-    //BEGIN CODE COPIED FROM $component.sourceClassName 
-$innersource
-    //END CODE COPIED FROM $component.sourceClassName
-#end
-
-    public ${utils.getClassFromFullClass($component.className)}()
-    {
-#if ($component.rendererType)
-#if ($component.rendererType == "")
-        setRendererType(null);
-#else
-        setRendererType("$component.rendererType");
-#end
-#else
-        setRendererType(null);
-#end
-    }
-
-## On myfaces 1.1 the family is inherited, so this could be commented
-## On other this should not be commented    
-    public String getFamily()
-    {
-        return COMPONENT_FAMILY;
-    }
-
-## Iterate over full component property list
-#set ($propertyList = ${component.propertyList})
-
-## TODO: this condition should be checked for parent components
-## and csv implements
-#if ($component.isClientBehaviorHolder())
-#if ($component.isOverrideEventNames())
-    static private final java.util.Collection<String> CLIENT_EVENTS_LIST = 
-        java.util.Collections.unmodifiableCollection(
-            java.util.Arrays.asList(
-#set ($commavar = "")
-#foreach( $property in $propertyList )
-#if ($property.clientEvent)
-#if ($property.clientEvent != "")
-            $commavar "$property.clientEvent"
-#set ($commavar = ",")            
-#end
-#end
-#end
-        ));
-
-    public java.util.Collection<String> getEventNames()
-    {
-        return CLIENT_EVENTS_LIST;
-    }
-#end
-#end
-#if ($component.defaultEventName)
-#if ($component.isOverrideDefaultEventName())
-
-    //ClientBehaviorHolder default: $component.defaultEventName
-    public String getDefaultEventName()
-    {
-        return "$component.defaultEventName";
-    }
-#end
-#end
-
-#set ($propertyList = ${component.propertyComponentList})
-    
-#foreach( $property in $propertyList )
-#set ($field = $property.fieldName)
-#set ($type = $utils.getClassFromFullClass($property.className))
-#if($utils.getDefaultValueField($property)) 
-#set ($defaultValue = $utils.getDefaultValueField($property))
-#else
-#set ($defaultValue = false)
-#end
-    // Property: $property.name
-#if ($property.isPartialStateHolder())
-#if ($property.isLiteralOnly() || $property.isTagExcluded() )
-    private $type $field #if($defaultValue) = $defaultValue;#{else};#{end}
-
-     
-#else
-    private $type $field;
-    
-#end
-
-    private boolean _$utils.getPrefixedPropertyName("isSet", $property.name)()
-    {
-        Boolean value = (Boolean) getStateHelper().get(PropertyKeys.${property.name}Set);
-        return value == null ? false : value;
-    }
-
-#if($utils.isPrimitiveClass($type) && !$property.isTagExcluded()
-    && !$property.isLiteralOnly() )
-    private boolean ${field}Set;
-    
-#if ($property.isSetMethod())
-    $property.setMethodScope boolean $utils.getPrefixedPropertyName("isSet", $property.name)()
-    {
-        return ${field}Set;
-    }
-#end
-#end
-#if($property.isLocalMethod())
-#if("boolean" == $type)
-#set ($methodName = $utils.getPrefixedPropertyName("isLocal", $property.name))
-#else
-#set ($methodName = $utils.getPrefixedPropertyName("getLocal", $property.name))
-#end
-    final $property.localMethodScope $type ${methodName}()
-    {
-        return $field;
-    }
-     
-#end
-    public $type $utils.getMethodReaderFromProperty($property.name, $type)()
-    {
-#if ($property.isTagExcluded() || $property.isLiteralOnly())
-        return $field;
-#else
-#if ($utils.isPrimitiveClass($type))
-        if (${field}Set)
-#else
-        if ($field != null)
-#end
-        {
-            return $field;
-        }
-        ValueExpression vb = getValueExpression("$property.name");
-        if (vb != null)
-        {
-#if ($utils.isPrimitiveClass($type))
-            return ($utils.castIfNecessary($type) vb.getValue(getFacesContext().getELContext())).${type}Value();
-#else
-#set ($pritype = $utils.getPrimitiveType($property.className))
-#if ($utils.isPrimitiveClass($pritype))
-            Object value = vb == null ? null : vb.getValue(getFacesContext().getELContext());
-            if (!(value instanceof $type)){
-                value = ${type}.valueOf(value.toString());
-            }            
-            return $utils.castIfNecessary($type) value;
-#else
-            return $utils.castIfNecessary($type) vb.getValue(getFacesContext().getELContext());
-#end
-#end
-        }
-#if ($defaultValue)
-        return $defaultValue; 
-#elseif ($utils.isPrimitiveClass($type))
-        return $utils.primitiveDefaultValue($type);
-#else       
-        return null;
-#end
-#end
-    }
-
-    public void $utils.getPrefixedPropertyName("set", $property.name)($type $utils.getVariableFromName($property.name))
-    {
-        this.$field = $utils.getVariableFromName($property.name);
-        if (initialStateMarked())
-        {
-            getStateHelper().put(PropertyKeys.${property.name}Set,Boolean.TRUE);
-        }
-#if ($utils.isPrimitiveClass($type) && !$property.isTagExcluded() )
-        this.${field}Set = true;        
-#end
-    }
-#else
-## StateHelper aware property
-#if ($property.name == "for")
-## To keep compatibility with RI, we should call it forVal
-#set ($field = "forVal")
-#else
-#set ($field = $property.name)
-#end
-#if ($property.isSetMethod())
-    $property.setMethodScope boolean $utils.getPrefixedPropertyName("isSet", $property.name)()
-    {
-        return getStateHelper().get(PropertyKeys.$field) != null;
-    }
-#end
-#if($property.isLocalMethod())
-#if("boolean" == $type)
-#set ($methodName = $utils.getPrefixedPropertyName("isLocal", $property.name))
-#else
-#set ($methodName = $utils.getPrefixedPropertyName("getLocal", $property.name))
-#end
-    final $property.localMethodScope $type ${methodName}()
-    {
-        return $utils.castIfNecessary($type) getStateHelper().get(PropertyKeys.$field);
-    }
-     
-#end
-    public $type $utils.getMethodReaderFromProperty($property.name, $type)()
-    {
-#if ($property.isLiteralOnly())
-#if ($defaultValue)
-        Object value = getStateHelper().get(PropertyKeys.$field);
-        if (value != null)
-        {
-            return $utils.castIfNecessary($type) value;        
-        }
-        return $defaultValue;        
-#elseif ($utils.isPrimitiveClass($type))
-        Object value = getStateHelper().get(PropertyKeys.$field);
-        if (value != null)
-        {
-            return $utils.castIfNecessary($type) value;        
-        }
-        return $utils.primitiveDefaultValue($type);
-#else
-        return $utils.castIfNecessary($type) getStateHelper().get(PropertyKeys.$field);        
-#end
-#else
-#if ($defaultValue)
-        return $utils.castIfNecessary($type) getStateHelper().eval(PropertyKeys.$field, $defaultValue);
-#elseif ($utils.isPrimitiveClass($type))
-        Object value = $utils.castIfNecessary($type) getStateHelper().eval(PropertyKeys.$field);
-        if (value != null)
-        {
-            return $utils.castIfNecessary($type) value;        
-        }
-        return $utils.primitiveDefaultValue($type);
-#else
-        return $utils.castIfNecessary($type) getStateHelper().eval(PropertyKeys.$field);
-#end
-#end
-    }
-    
-    public void $utils.getPrefixedPropertyName("set", $property.name)($type $utils.getVariableFromName($property.name))
-    {
-        getStateHelper().put(PropertyKeys.$field, $utils.getVariableFromName($property.name) ); 
-    }    
-#end
-#end
-
-    protected enum PropertyKeys
-    {
-#set ($comma = "")
-#set ($addc = "false")
-#foreach( $property in $propertyList )
-#if ($property.name == "for")
-#set ($addc = "true")
-## To keep compatibility with RI, we should call it forVal
-#set ($field = "forVal")
-#else
-#set ($field = $property.name)
-#end
-#set ($type = $utils.getClassFromFullClass($property.className))
-#if($utils.getDefaultValueField($property)) 
-#set ($defaultValue = $utils.getDefaultValueField($property))
-#else
-#set ($defaultValue = false)
-#end
-#if ($property.name == "for")
-        $comma $field("for")
-#else
-#if ($property.isPartialStateHolder())
-        $comma ${field}Set
-#else
-        $comma $field
-#end
-#end
-#set($comma = ",")
-#end
-#if ("true" == $addc)
-        ;
-        String c;
-        
-        PropertyKeys()
-        {
-        }
-        
-        //Constructor needed by "for" property
-        PropertyKeys(String c)
-        { 
-            this.c = c;
-        }
-        
-        public String toString()
-        {
-            return ((this.c != null) ? this.c : super.toString());
-        }
-#end
-    }
-
-#set ($primitiveCount = 1) ## $propertyList.size() + 1 
-#foreach( $property in $propertyList )
-#if ($property.isPartialStateHolder())
-#set ($primitiveCount = $primitiveCount + 1)
-#if($utils.isPrimitiveClass($property.className))
-#set ($primitiveCount = $primitiveCount + 1)
-#end
-#end
-#end
-## saveState and restoreState methods only has sense if we have properties
-## that does not use StateHelper class.
-#if ($primitiveCount > 1)
-
-    public void markInitialState()
-    {
-        super.markInitialState();
-#foreach( $property in $propertyList )
-#set ($field = $property.fieldName)
-#if ($property.isPartialStateHolder())        
-        if ($field != null && 
-            $field instanceof PartialStateHolder)
-        {
-            ((PartialStateHolder)$field).markInitialState();
-        }
-#end
-#end
-    }
-    
-    public void clearInitialState()
-    {
-        if (initialStateMarked())
-        {
-            super.clearInitialState();
-#foreach( $property in $propertyList )
-#set ($field = $property.fieldName)
-#if ($property.isPartialStateHolder())
-##          //Only has sense propagate this method if is initialStateMarked
-            if ($field != null && 
-                $field instanceof PartialStateHolder)
-            {
-                ((PartialStateHolder)$field).clearInitialState();
-            }
-#end
-#end
-        }
-    }
-
-    @Override
-    public Object saveState(FacesContext facesContext)
-    {
-        if (initialStateMarked())
-        {
-            boolean nullDelta = true;
-            Object parentSaved = super.saveState(facesContext);
-#set ($arrayIndex = 0)
-#foreach( $property in $propertyList )
-#set ($field = $property.fieldName)
-#set ($type = $property.className)
-#if ($property.isPartialStateHolder())
-#set ($arrayIndex = $arrayIndex + 1)
-            Object ${property.name}Saved = null;
-            if (!_$utils.getPrefixedPropertyName("isSet", $property.name)() &&
-                $field != null && $field instanceof PartialStateHolder)
-            {
-                //Delta
-                StateHolder holder = (StateHolder) $field;
-                if (!holder.isTransient())
-                {
-                    Object attachedState = holder.saveState(facesContext);
-                    if (attachedState != null)
-                    {
-                        nullDelta = false;
-                    }
-                    ${property.name}Saved = new AttachedDeltaWrapper(${field}.getClass(),
-                        attachedState);
-                }
-            }
-            else if (_$utils.getPrefixedPropertyName("isSet", $property.name)() || $field != null )
-            {
-                //Full
-                ${property.name}Saved = saveAttachedState(facesContext,$field);
-                nullDelta = false;
-            }        
-## StateHelper Properties does not need save and restore
-#end
-#end
-            if (parentSaved == null && nullDelta)
-            {
-                //No values
-                return null;
-            }
-            
-            Object[] values = new Object[$primitiveCount];
-            values[0] = parentSaved;
-## Save full state
-#set ($arrayIndex = 0)
-#foreach( $property in $propertyList )
-#set ($field = $property.fieldName)
-#set ($type = $property.className)
-#if ($property.isPartialStateHolder())
-#set ($arrayIndex = $arrayIndex + 1)
-            values[$arrayIndex] = ${property.name}Saved;
-## StateHelper Properties does not need save and restore
-#end
-#end
-            return values;
-        }
-        else
-        {
-            Object[] values = new Object[$primitiveCount];
-            values[0] = super.saveState(facesContext);
-## Save full state
-#set ($arrayIndex = 0)
-#foreach( $property in $propertyList )
-#set ($field = $property.fieldName)
-#set ($type = $property.className)
-#if ($property.isPartialStateHolder())
-#set ($arrayIndex = $arrayIndex + 1)
-            values[$arrayIndex] = saveAttachedState(facesContext,$field);
-## StateHelper Properties does not need save and restore
-#end
-#end
-            return values;
-        }
-    }
-
-    @Override
-    public void restoreState(FacesContext facesContext, Object state)
-    {
-        if (state == null)
-        {
-            return;
-        }
-        
-        Object[] values = (Object[])state;
-        super.restoreState(facesContext,values[0]);
-#set ($arrayIndex = 0)
-#foreach( $property in $propertyList )
-#set ($field = $property.fieldName)
-#set ($type = $property.className)
-#if ($property.isPartialStateHolder())
-#set ($arrayIndex = $arrayIndex + 1)
-        if (values[$arrayIndex] instanceof AttachedDeltaWrapper)
-        {
-            //Delta
-            ((StateHolder)$field).restoreState(facesContext, ((AttachedDeltaWrapper) values[$arrayIndex]).getWrappedStateObject());
-        }
-        else
-        {
-            //Full
-            $field = $utils.castIfNecessary($type) restoreAttachedState(facesContext,values[$arrayIndex]);
-        }         
-#else
-## StateHelper Properties does not need save and restore
-#end
-#end
-    }
-#end
-}
+## Velocity template used to generate JSF1.2-compatible component classes
+## from component meta-data.
+##
+## Note that there are two types of component generation:
+##  * "subclass mode" (use annotated class as a parent class)
+##  * "template mode" (use annotated class as a template)
+## This template file is used for both.
+##
+## Variable $component refers to a ComponentMeta object to process
+## Variable $utils refers to an instance of MyfacesUtils.
+##
+## When "template mode" is being used then variable $innersource
+## holds a String containing all the non-abstract functions defined
+## in the annotated class.
+##
+## The java package of the generated class is always the same as
+## the package in which the annotated class exists.
+##
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ * 
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ *  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 ${component.packageName};
+
+import javax.el.ValueExpression;
+import javax.faces.context.FacesContext;
+import javax.faces.component.PartialStateHolder;
+import javax.faces.component.StateHolder;
+import org.apache.myfaces.commons.util.AttachedDeltaWrapper;
+$utils.importTagClasses($component)
+
+#if ($component.isTemplate())
+#set ($generatedClassParent = $component.sourceClassParentClassName)
+#else
+#set ($generatedClassParent = $component.sourceClassName)
+#end
+// Generated from class ${component.sourceClassName}.
+//
+// WARNING: This file was automatically generated. Do not edit it directly,
+//          or you will lose your changes.
+public class ${utils.getClassFromFullClass($component.className)} extends $generatedClassParent
+#if ($component.implements)
+    implements $component.implements
+#end
+{
+#if ($component.serialuid)
+    private static final long serialVersionUID = ${component.serialuid}; 
+#end  
+
+    static public final String COMPONENT_FAMILY =
+        "$component.family";
+    static public final String COMPONENT_TYPE =
+        "$component.type";
+#if ($component.rendererType)
+#if (!($component.rendererType == ""))
+    static public final String DEFAULT_RENDERER_TYPE = 
+        "$component.rendererType";
+#end
+#end
+
+#if ($innersource)
+    //BEGIN CODE COPIED FROM $component.sourceClassName 
+$innersource
+    //END CODE COPIED FROM $component.sourceClassName
+#end
+
+    public ${utils.getClassFromFullClass($component.className)}()
+    {
+#if ($component.rendererType)
+#if ($component.rendererType == "")
+        setRendererType(null);
+#else
+        setRendererType("$component.rendererType");
+#end
+#else
+        setRendererType(null);
+#end
+    }
+
+## On myfaces 1.1 the family is inherited, so this could be commented
+## On other this should not be commented    
+    public String getFamily()
+    {
+        return COMPONENT_FAMILY;
+    }
+
+## Iterate over full component property list
+#set ($propertyList = ${component.propertyList})
+
+## TODO: this condition should be checked for parent components
+## and csv implements
+#if ($component.isClientBehaviorHolder())
+#if ($component.isOverrideEventNames())
+    static private final java.util.Collection<String> CLIENT_EVENTS_LIST = 
+        java.util.Collections.unmodifiableCollection(
+            java.util.Arrays.asList(
+#set ($commavar = "")
+#foreach( $property in $propertyList )
+#if ($property.clientEvent)
+#if ($property.clientEvent != "")
+            $commavar "$property.clientEvent"
+#set ($commavar = ",")            
+#end
+#end
+#end
+        ));
+
+    public java.util.Collection<String> getEventNames()
+    {
+        return CLIENT_EVENTS_LIST;
+    }
+#end
+#end
+#if ($component.defaultEventName)
+#if ($component.isOverrideDefaultEventName())
+
+    //ClientBehaviorHolder default: $component.defaultEventName
+    public String getDefaultEventName()
+    {
+        return "$component.defaultEventName";
+    }
+#end
+#end
+
+#set ($propertyList = ${component.propertyComponentList})
+    
+#foreach( $property in $propertyList )
+#set ($field = $property.fieldName)
+#set ($type = $utils.getClassFromFullClass($property.className))
+#if($utils.getDefaultValueField($property)) 
+#set ($defaultValue = $utils.getDefaultValueField($property))
+#else
+#set ($defaultValue = false)
+#end
+    // Property: $property.name
+#if ($property.isPartialStateHolder())
+#if ($property.isLiteralOnly() || $property.isTagExcluded() )
+    private $type $field #if($defaultValue) = $defaultValue;#{else};#{end}
+
+     
+#else
+    private $type $field;
+    
+#end
+
+    private boolean _$utils.getPrefixedPropertyName("isSet", $property.name)()
+    {
+        Boolean value = (Boolean) getStateHelper().get(PropertyKeys.${property.name}Set);
+        return value == null ? false : value;
+    }
+
+#if($utils.isPrimitiveClass($type) && !$property.isTagExcluded()
+    && !$property.isLiteralOnly() )
+    private boolean ${field}Set;
+    
+#if ($property.isSetMethod())
+    $property.setMethodScope boolean $utils.getPrefixedPropertyName("isSet", $property.name)()
+    {
+        return ${field}Set;
+    }
+#end
+#end
+#if($property.isLocalMethod())
+#if("boolean" == $type)
+#set ($methodName = $utils.getPrefixedPropertyName("isLocal", $property.name))
+#else
+#set ($methodName = $utils.getPrefixedPropertyName("getLocal", $property.name))
+#end
+    final $property.localMethodScope $type ${methodName}()
+    {
+        return $field;
+    }
+     
+#end
+    public $type $utils.getMethodReaderFromProperty($property.name, $type)()
+    {
+#if ($property.isTagExcluded() || $property.isLiteralOnly())
+        return $field;
+#else
+#if ($utils.isPrimitiveClass($type))
+        if (${field}Set)
+#else
+        if ($field != null)
+#end
+        {
+            return $field;
+        }
+        ValueExpression vb = getValueExpression("$property.name");
+        if (vb != null)
+        {
+#if ($utils.isPrimitiveClass($type))
+            return ($utils.castIfNecessary($type) vb.getValue(getFacesContext().getELContext())).${type}Value();
+#else
+#set ($pritype = $utils.getPrimitiveType($property.className))
+#if ($utils.isPrimitiveClass($pritype))
+            Object value = vb == null ? null : vb.getValue(getFacesContext().getELContext());
+            if (!(value instanceof $type)){
+                value = ${type}.valueOf(value.toString());
+            }            
+            return $utils.castIfNecessary($type) value;
+#else
+            return $utils.castIfNecessary($type) vb.getValue(getFacesContext().getELContext());
+#end
+#end
+        }
+#if ($defaultValue)
+        return $defaultValue; 
+#elseif ($utils.isPrimitiveClass($type))
+        return $utils.primitiveDefaultValue($type);
+#else       
+        return null;
+#end
+#end
+    }
+
+    public void $utils.getPrefixedPropertyName("set", $property.name)($type $utils.getVariableFromName($property.name))
+    {
+        this.$field = $utils.getVariableFromName($property.name);
+        if (initialStateMarked())
+        {
+            getStateHelper().put(PropertyKeys.${property.name}Set,Boolean.TRUE);
+        }
+#if ($utils.isPrimitiveClass($type) && !$property.isTagExcluded() )
+        this.${field}Set = true;        
+#end
+    }
+#else
+## StateHelper aware property
+#if ($property.name == "for")
+## To keep compatibility with RI, we should call it forVal
+#set ($field = "forVal")
+#else
+#set ($field = $property.name)
+#end
+#if ($property.isSetMethod())
+    $property.setMethodScope boolean $utils.getPrefixedPropertyName("isSet", $property.name)()
+    {
+        return getStateHelper().get(PropertyKeys.$field) != null;
+    }
+#end
+#if($property.isLocalMethod())
+#if("boolean" == $type)
+#set ($methodName = $utils.getPrefixedPropertyName("isLocal", $property.name))
+#else
+#set ($methodName = $utils.getPrefixedPropertyName("getLocal", $property.name))
+#end
+    final $property.localMethodScope $type ${methodName}()
+    {
+        return $utils.castIfNecessary($type) getStateHelper().get(PropertyKeys.$field);
+    }
+     
+#end
+    public $type $utils.getMethodReaderFromProperty($property.name, $type)()
+    {
+#if ($property.isLiteralOnly())
+#if ($defaultValue)
+        Object value = getStateHelper().get(PropertyKeys.$field);
+        if (value != null)
+        {
+            return $utils.castIfNecessary($type) value;        
+        }
+        return $defaultValue;        
+#elseif ($utils.isPrimitiveClass($type))
+        Object value = getStateHelper().get(PropertyKeys.$field);
+        if (value != null)
+        {
+            return $utils.castIfNecessary($type) value;        
+        }
+        return $utils.primitiveDefaultValue($type);
+#else
+        return $utils.castIfNecessary($type) getStateHelper().get(PropertyKeys.$field);        
+#end
+#else
+#if ($defaultValue)
+        return $utils.castIfNecessary($type) getStateHelper().eval(PropertyKeys.$field, $defaultValue);
+#elseif ($utils.isPrimitiveClass($type))
+        Object value = $utils.castIfNecessary($type) getStateHelper().eval(PropertyKeys.$field);
+        if (value != null)
+        {
+            return $utils.castIfNecessary($type) value;        
+        }
+        return $utils.primitiveDefaultValue($type);
+#else
+        return $utils.castIfNecessary($type) getStateHelper().eval(PropertyKeys.$field);
+#end
+#end
+    }
+    
+    public void $utils.getPrefixedPropertyName("set", $property.name)($type $utils.getVariableFromName($property.name))
+    {
+        getStateHelper().put(PropertyKeys.$field, $utils.getVariableFromName($property.name) ); 
+    }    
+#end
+#end
+
+    protected enum PropertyKeys
+    {
+#set ($comma = "")
+#set ($addc = "false")
+#foreach( $property in $propertyList )
+#if ($property.name == "for")
+#set ($addc = "true")
+## To keep compatibility with RI, we should call it forVal
+#set ($field = "forVal")
+#else
+#set ($field = $property.name)
+#end
+#set ($type = $utils.getClassFromFullClass($property.className))
+#if($utils.getDefaultValueField($property)) 
+#set ($defaultValue = $utils.getDefaultValueField($property))
+#else
+#set ($defaultValue = false)
+#end
+#if ($property.name == "for")
+        $comma $field("for")
+#else
+#if ($property.isPartialStateHolder())
+        $comma ${field}Set
+#else
+        $comma $field
+#end
+#end
+#set($comma = ",")
+#end
+#if ("true" == $addc)
+        ;
+        String c;
+        
+        PropertyKeys()
+        {
+        }
+        
+        //Constructor needed by "for" property
+        PropertyKeys(String c)
+        { 
+            this.c = c;
+        }
+        
+        public String toString()
+        {
+            return ((this.c != null) ? this.c : super.toString());
+        }
+#end
+    }
+
+#set ($primitiveCount = 1) ## $propertyList.size() + 1 
+#foreach( $property in $propertyList )
+#if ($property.isPartialStateHolder())
+#set ($primitiveCount = $primitiveCount + 1)
+#if($utils.isPrimitiveClass($property.className))
+#set ($primitiveCount = $primitiveCount + 1)
+#end
+#end
+#end
+## saveState and restoreState methods only has sense if we have properties
+## that does not use StateHelper class.
+#if ($primitiveCount > 1)
+
+    public void markInitialState()
+    {
+        super.markInitialState();
+#foreach( $property in $propertyList )
+#set ($field = $property.fieldName)
+#if ($property.isPartialStateHolder())        
+        if ($field != null && 
+            $field instanceof PartialStateHolder)
+        {
+            ((PartialStateHolder)$field).markInitialState();
+        }
+#end
+#end
+    }
+    
+    public void clearInitialState()
+    {
+        if (initialStateMarked())
+        {
+            super.clearInitialState();
+#foreach( $property in $propertyList )
+#set ($field = $property.fieldName)
+#if ($property.isPartialStateHolder())
+##          //Only has sense propagate this method if is initialStateMarked
+            if ($field != null && 
+                $field instanceof PartialStateHolder)
+            {
+                ((PartialStateHolder)$field).clearInitialState();
+            }
+#end
+#end
+        }
+    }
+
+    @Override
+    public Object saveState(FacesContext facesContext)
+    {
+        if (initialStateMarked())
+        {
+            boolean nullDelta = true;
+            Object parentSaved = super.saveState(facesContext);
+#set ($arrayIndex = 0)
+#foreach( $property in $propertyList )
+#set ($field = $property.fieldName)
+#set ($type = $property.className)
+#if ($property.isPartialStateHolder())
+#set ($arrayIndex = $arrayIndex + 1)
+            Object ${property.name}Saved = null;
+            if (!_$utils.getPrefixedPropertyName("isSet", $property.name)() &&
+                $field != null && $field instanceof PartialStateHolder)
+            {
+                //Delta
+                StateHolder holder = (StateHolder) $field;
+                if (!holder.isTransient())
+                {
+                    Object attachedState = holder.saveState(facesContext);
+                    if (attachedState != null)
+                    {
+                        nullDelta = false;
+                    }
+                    ${property.name}Saved = new AttachedDeltaWrapper(${field}.getClass(),
+                        attachedState);
+                }
+            }
+            else if (_$utils.getPrefixedPropertyName("isSet", $property.name)() || $field != null )
+            {
+                //Full
+                ${property.name}Saved = saveAttachedState(facesContext,$field);
+                nullDelta = false;
+            }        
+## StateHelper Properties does not need save and restore
+#end
+#end
+            if (parentSaved == null && nullDelta)
+            {
+                //No values
+                return null;
+            }
+            
+            Object[] values = new Object[$primitiveCount];
+            values[0] = parentSaved;
+## Save full state
+#set ($arrayIndex = 0)
+#foreach( $property in $propertyList )
+#set ($field = $property.fieldName)
+#set ($type = $property.className)
+#if ($property.isPartialStateHolder())
+#set ($arrayIndex = $arrayIndex + 1)
+            values[$arrayIndex] = ${property.name}Saved;
+## StateHelper Properties does not need save and restore
+#end
+#end
+            return values;
+        }
+        else
+        {
+            Object[] values = new Object[$primitiveCount];
+            values[0] = super.saveState(facesContext);
+## Save full state
+#set ($arrayIndex = 0)
+#foreach( $property in $propertyList )
+#set ($field = $property.fieldName)
+#set ($type = $property.className)
+#if ($property.isPartialStateHolder())
+#set ($arrayIndex = $arrayIndex + 1)
+            values[$arrayIndex] = saveAttachedState(facesContext,$field);
+## StateHelper Properties does not need save and restore
+#end
+#end
+            return values;
+        }
+    }
+
+    @Override
+    public void restoreState(FacesContext facesContext, Object state)
+    {
+        if (state == null)
+        {
+            return;
+        }
+        
+        Object[] values = (Object[])state;
+        super.restoreState(facesContext,values[0]);
+#set ($arrayIndex = 0)
+#foreach( $property in $propertyList )
+#set ($field = $property.fieldName)
+#set ($type = $property.className)
+#if ($property.isPartialStateHolder())
+#set ($arrayIndex = $arrayIndex + 1)
+        if (values[$arrayIndex] instanceof AttachedDeltaWrapper)
+        {
+            //Delta
+            ((StateHolder)$field).restoreState(facesContext, ((AttachedDeltaWrapper) values[$arrayIndex]).getWrappedStateObject());
+        }
+        else
+        {
+            //Full
+            $field = $utils.castIfNecessary($type) restoreAttachedState(facesContext,values[$arrayIndex]);
+        }         
+#else
+## StateHelper Properties does not need save and restore
+#end
+#end
+    }
+#end
+}

Propchange: myfaces/commons/branches/jsf_20/myfaces-commons-components/src/main/resources/META-INF/componentClass20.vm
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: myfaces/commons/branches/jsf_20/myfaces-commons-components/src/site/apt/index.apt
URL: http://svn.apache.org/viewvc/myfaces/commons/branches/jsf_20/myfaces-commons-components/src/site/apt/index.apt?rev=1186730&r1=1186729&r2=1186730&view=diff
==============================================================================
--- myfaces/commons/branches/jsf_20/myfaces-commons-components/src/site/apt/index.apt (original)
+++ myfaces/commons/branches/jsf_20/myfaces-commons-components/src/site/apt/index.apt Thu Oct 20 10:49:18 2011
@@ -1,18 +1,18 @@
- ------
-Apache MyFaces Commons
- ------
-
-Apache MyFaces Commons Components for JSF 2.0
-
-  The objective is have a common place where find myfaces components that
-  can be used with any jsf framework.
-  
-Documentation
-
-  * {{{./apidocs/index.html}Javadocs}}
-
-  * {{{./tagdoc.html}JSF Tag Documentation}}
-  
-  * {{{./tlddoc/index.html}TLDDoc JSP Documentation}}
-  
+ ------
+Apache MyFaces Commons
+ ------
+
+Apache MyFaces Commons Components for JSF 2.0
+
+  The objective is have a common place where find myfaces components that
+  can be used with any jsf framework.
+  
+Documentation
+
+  * {{{./apidocs/index.html}Javadocs}}
+
+  * {{{./tagdoc.html}JSF Tag Documentation}}
+  
+  * {{{./tlddoc/index.html}TLDDoc JSP Documentation}}
+  
   * {{{./tlddoc-facelets/index.html}TLDDoc Facelets Documentation}}
\ No newline at end of file

Propchange: myfaces/commons/branches/jsf_20/myfaces-commons-components/src/site/apt/index.apt
------------------------------------------------------------------------------
    svn:eol-style = native