Author: ilya_shaikovsky
Date: 2009-04-24 08:32:33 -0400 (Fri, 24 Apr 2009)
New Revision: 13821
Added:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/modifiableModel/
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/modifiableModel/DataItem.java
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/modifiableModel/HibernateBean.java
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/modifiableModel/HibernateDataModel.java
trunk/samples/richfaces-demo/src/main/resources/JIRA.csv
trunk/samples/richfaces-demo/src/main/resources/dataItem.hbm.xml
trunk/samples/richfaces-demo/src/main/resources/hibernate.cfg.xml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTable/examples/modifiableModel.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTable/modifiableModel.xhtml
Modified:
trunk/samples/richfaces-demo/pom.xml
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties
trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTable.xhtml
Log:
Modified: trunk/samples/richfaces-demo/pom.xml
===================================================================
--- trunk/samples/richfaces-demo/pom.xml 2009-04-24 12:29:02 UTC (rev 13820)
+++ trunk/samples/richfaces-demo/pom.xml 2009-04-24 12:32:33 UTC (rev 13821)
@@ -371,6 +371,22 @@
<groupId>javax.faces</groupId>
</exclusion>
</exclusions>
- </dependency>
+ </dependency>
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>jsr250-api</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <version>1.8.0.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate</artifactId>
+ <version>3.2.6.ga</version>
+ </dependency>
</dependencies>
</project>
Added:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/modifiableModel/DataItem.java
===================================================================
---
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/modifiableModel/DataItem.java
(rev 0)
+++
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/modifiableModel/DataItem.java 2009-04-24
12:32:33 UTC (rev 13821)
@@ -0,0 +1,136 @@
+package org.richfaces.demo.modifiableModel;
+
+public class DataItem {
+
+ private Long id;
+
+ private String issueType;
+
+ private String key;
+
+ private String summary;
+
+ private String assignee;
+
+ private String fixVersion;
+
+ private String reporter;
+
+ private String priority;
+
+ private String status;
+
+ private String resolution;
+
+ private String created;
+
+ private String updated;
+
+ private String dueDate;
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getIssueType() {
+ return issueType;
+ }
+
+ public void setIssueType(String issueType) {
+ this.issueType = issueType;
+ }
+
+ public String getKey() {
+ return key;
+ }
+
+ public void setKey(String key) {
+ this.key = key;
+ }
+
+ public String getSummary() {
+ return summary;
+ }
+
+ public void setSummary(String summary) {
+ this.summary = summary;
+ }
+
+ public String getAssignee() {
+ return assignee;
+ }
+
+ public void setAssignee(String assignee) {
+ this.assignee = assignee;
+ }
+
+ public String getFixVersion() {
+ return fixVersion;
+ }
+
+ public void setFixVersion(String fixVersion) {
+ this.fixVersion = fixVersion;
+ }
+
+ public String getReporter() {
+ return reporter;
+ }
+
+ public void setReporter(String reporter) {
+ this.reporter = reporter;
+ }
+
+ public String getPriority() {
+ return priority;
+ }
+
+ public void setPriority(String priority) {
+ this.priority = priority;
+ }
+
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(String status) {
+ this.status = status;
+ }
+
+ public String getResolution() {
+ return resolution;
+ }
+
+ public void setResolution(String resolution) {
+ this.resolution = resolution;
+ }
+
+ public String getCreated() {
+ return created;
+ }
+
+ public void setCreated(String created) {
+ this.created = created;
+ }
+
+ public String getUpdated() {
+ return updated;
+ }
+
+ public void setUpdated(String updated) {
+ this.updated = updated;
+ }
+
+ public String getDueDate() {
+ return dueDate;
+ }
+
+ public void setDueDate(String dueDate) {
+ this.dueDate = dueDate;
+ }
+
+
+}
Added:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/modifiableModel/HibernateBean.java
===================================================================
---
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/modifiableModel/HibernateBean.java
(rev 0)
+++
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/modifiableModel/HibernateBean.java 2009-04-24
12:32:33 UTC (rev 13821)
@@ -0,0 +1,117 @@
+/**
+ *
+ */
+package org.richfaces.demo.modifiableModel;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.faces.FacesException;
+
+import org.hibernate.SessionFactory;
+import org.hibernate.cfg.Configuration;
+import org.hibernate.classic.Session;
+import org.richfaces.model.SortOrder;
+
+/**
+ * @author mikalaj
+ *
+ */
+public class HibernateBean {
+
+ private SessionFactory factory;
+
+ private static final String[] CSV_FIELDS = {
+ "issueType", "key", "summary",
+ "assignee", "fixVersion", "reporter",
"priority", "status",
+ "resolution", "created", "updated"
+ };
+
+ private static final Method[] CSV_FIELDS_SETTERS;
+
+ public String[] getCsvFields() {
+ return CSV_FIELDS;
+ }
+
+ static {
+ CSV_FIELDS_SETTERS = new Method[CSV_FIELDS.length];
+
+ for (int i = 0; i < CSV_FIELDS.length; i++) {
+ char[] cs = CSV_FIELDS[i].toCharArray();
+ cs[0] = Character.toUpperCase(cs[0]);
+
+ try {
+ CSV_FIELDS_SETTERS[i] = DataItem.class.getMethod("set" + new String(cs),
String.class);
+ } catch (SecurityException e) {
+ throw new FacesException(e.getMessage(), e);
+ } catch (NoSuchMethodException e) {
+ throw new FacesException(e.getMessage(), e);
+ }
+ }
+ }
+
+ public HibernateBean() {
+ Configuration configuration = new Configuration();
+ configuration.addResource("dataItem.hbm.xml");
+ configuration.configure();
+
+ factory = configuration.buildSessionFactory();
+ Session session = factory.openSession();
+
+ BufferedReader reader = null;
+ try {
+ reader = new BufferedReader(
+ new InputStreamReader(getClass().getResourceAsStream("/JIRA.csv")));
+
+ String line;
+
+ while ((line = reader.readLine()) != null) {
+ String[] split = line.split(";");
+
+ DataItem dataItem = new DataItem();
+ for (int i = 0; i < split.length && i < CSV_FIELDS_SETTERS.length; i++)
{
+ try {
+ CSV_FIELDS_SETTERS[i].invoke(dataItem, split[i]);
+ } catch (IllegalArgumentException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (InvocationTargetException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ session.persist(dataItem);
+ }
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } finally {
+ try {
+ if (reader != null) {
+ reader.close();
+ }
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+
+ session.flush();
+ session.close();
+ }
+
+ public SessionFactory getSessionFactory() {
+ return factory;
+ }
+
+}
Added:
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/modifiableModel/HibernateDataModel.java
===================================================================
---
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/modifiableModel/HibernateDataModel.java
(rev 0)
+++
trunk/samples/richfaces-demo/src/main/java/org/richfaces/demo/modifiableModel/HibernateDataModel.java 2009-04-24
12:32:33 UTC (rev 13821)
@@ -0,0 +1,242 @@
+package org.richfaces.demo.modifiableModel;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.annotation.PreDestroy;
+import javax.el.ELException;
+import javax.el.Expression;
+import javax.el.ValueExpression;
+import javax.faces.FacesException;
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.model.DataVisitor;
+import org.ajax4jsf.model.ExtendedDataModel;
+import org.ajax4jsf.model.Range;
+import org.ajax4jsf.model.SequenceRange;
+import org.hibernate.Criteria;
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.hibernate.criterion.MatchMode;
+import org.hibernate.criterion.Order;
+import org.hibernate.criterion.Restrictions;
+import org.richfaces.model.ExtendedFilterField;
+import org.richfaces.model.FilterField;
+import org.richfaces.model.Modifiable;
+import org.richfaces.model.Ordering;
+import org.richfaces.model.SortField2;
+import org.richfaces.model.SortOrder;
+
+public class HibernateDataModel extends ExtendedDataModel implements Modifiable {
+
+ private SessionFactory sessionFactory;
+
+ public void setSessionFactory(SessionFactory sessionFactory) {
+ this.sessionFactory = sessionFactory;
+ }
+
+ private Session session;
+
+ protected Session getSession() {
+ if (session == null) {
+ session = sessionFactory.openSession();
+ }
+
+ return session;
+ }
+
+ @PreDestroy
+ public void destroy() {
+ if (session != null) {
+ session.close();
+ }
+ }
+
+ private Long rowKey;
+
+ private SortOrder sortOrder = new SortOrder();
+
+ private DataItem dataItem;
+
+ private SequenceRange cachedRange;
+
+ private List<DataItem> cachedItems;
+
+ private List<FilterField> filterFields;
+
+ private List<SortField2> sortFields;
+
+ private Map<String, SortOrder> sortOrders = new HashMap<String,
SortOrder>();
+
+ private Map<String, Object> columnFilterValues = new HashMap<String,
Object>();
+
+
+ public Map<String, Object> getColumnFilterValues() {
+ return columnFilterValues;
+ }
+
+ public void setColumnFilterValues(Map<String, Object> columnFilterValues) {
+ this.columnFilterValues = columnFilterValues;
+ }
+
+ public Map<String, SortOrder> getSortOrders() {
+ return sortOrders;
+ }
+
+ public void setSortOrders(Map<String, SortOrder> sortOrders) {
+ this.sortOrders = sortOrders;
+ }
+
+ private static boolean areEqualRanges(SequenceRange range1, SequenceRange range2) {
+ if (range1 == null || range2 == null) {
+ return range1 == null && range2 == null;
+ } else {
+ return range1.getFirstRow() == range2.getFirstRow() && range1.getRows() ==
range2.getRows();
+ }
+ }
+
+ private Criteria createCriteria() {
+ return getSession().createCriteria(DataItem.class);
+ }
+
+ private void appendFilters(FacesContext context, Criteria criteria) {
+ if (filterFields != null) {
+ for (FilterField filterField : filterFields) {
+ String propertyName = getPropertyName(context, filterField.getExpression());
+
+ String filterValue = ((ExtendedFilterField) filterField).getFilterValue();
+ if (filterValue != null && filterValue.length() != 0) {
+ criteria.add(Restrictions.like(propertyName,
+ filterValue,
+ MatchMode.ANYWHERE).ignoreCase());
+ }
+ }
+ }
+ }
+
+ private void appendSorts(FacesContext context, Criteria criteria) {
+ if (sortFields != null) {
+ for (SortField2 sortField : sortFields) {
+ Ordering ordering = sortField.getOrdering();
+
+ if (Ordering.ASCENDING.equals(ordering) || Ordering.DESCENDING.equals(ordering)) {
+ String propertyName = getPropertyName(context, sortField.getExpression());
+
+ Order order = Ordering.ASCENDING.equals(ordering) ?
+ Order.asc(propertyName) : Order.desc(propertyName);
+
+ criteria.addOrder(order.ignoreCase());
+ }
+ }
+ }
+ }
+
+ private String getPropertyName(FacesContext facesContext, Expression expression) {
+ try {
+ return (String) ((ValueExpression) expression).getValue(facesContext.getELContext());
+ } catch (ELException e) {
+ throw new FacesException(e.getMessage(), e);
+ }
+ }
+
+ @Override
+ public Object getRowKey() {
+ return rowKey;
+ }
+
+ @Override
+ public void setRowKey(Object key) {
+ this.rowKey = (Long) key;
+ this.dataItem = null;
+
+ if (this.rowKey != null) {
+ this.dataItem = (DataItem) session.load(DataItem.class, this.rowKey);
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public void walk(FacesContext facesContext, DataVisitor visitor, Range range,
+ Object argument) throws IOException {
+
+ SequenceRange sequenceRange = (SequenceRange) range;
+
+ if (this.cachedItems == null || !areEqualRanges(this.cachedRange, sequenceRange)) {
+ Criteria criteria = createCriteria();
+ appendFilters(facesContext, criteria);
+ appendSorts(facesContext, criteria);
+
+ if (sequenceRange != null) {
+ int first = sequenceRange.getFirstRow();
+ int rows = sequenceRange.getRows();
+
+ criteria.setFirstResult(first);
+ if (rows > 0) {
+ criteria.setMaxResults(rows);
+ }
+ }
+
+ this.cachedRange = sequenceRange;
+ this.cachedItems = criteria.list();
+ }
+
+ //System.out.println(getRowCount());
+
+ for (DataItem item: cachedItems) {
+ visitor.process(facesContext, item.getId(), argument);
+ }
+ }
+
+ @Override
+ public int getRowCount() {
+ Criteria criteria = createCriteria();
+ appendFilters(FacesContext.getCurrentInstance(), criteria);
+ return (Integer) criteria.list().size();
+ }
+
+ @Override
+ public Object getRowData() {
+ return this.dataItem;
+ }
+
+ @Override
+ public int getRowIndex() {
+ return -1;
+ }
+
+ @Override
+ public Object getWrappedData() {
+ return null;
+ }
+
+ @Override
+ public boolean isRowAvailable() {
+ return (this.dataItem != null);
+ }
+
+ @Override
+ public void setRowIndex(int rowIndex) {
+ }
+
+ @Override
+ public void setWrappedData(Object data) {
+ }
+
+ public void modify(List<FilterField> filterFields, List<SortField2>
sortFields) {
+ this.filterFields = filterFields;
+ this.sortFields = sortFields;
+
+ this.cachedItems = null;
+ this.cachedRange = null;
+ }
+
+ public SortOrder getSortOrder() {
+ return sortOrder;
+ }
+
+ public void setSortOrder(SortOrder sortOrder) {
+ this.sortOrder = sortOrder;
+ }
+}
Added: trunk/samples/richfaces-demo/src/main/resources/JIRA.csv
===================================================================
--- trunk/samples/richfaces-demo/src/main/resources/JIRA.csv (rev
0)
+++ trunk/samples/richfaces-demo/src/main/resources/JIRA.csv 2009-04-24 12:32:33 UTC (rev
13821)
@@ -0,0 +1,25 @@
+Bug;RF-6338;PanelMenu does not work in 3.3.1.SNAPSHOT;Alex
Kolonitsky;03.03.2001;Alexander Dubovsky;Critical;Open;UNRESOLVED;23/Feb/09 06:17
AM;24/Feb/09 11:59 AM;;;;;1
+Bug;RF-3686;listShuttle and s:entityConverter;Alex Kolonitsky;03.03.2001;Marcell
Barbacena;Major;Open;UNRESOLVED;11/Jun/08 05:51 PM;17/Feb/09 10:06 AM;;;;;0
+Bug;RF-6278;ScriptUtils: toScript() fails with java.sql.* types;Alex
Kolonitsky;03.03.2001;Nick Belaevski;Major;Open;UNRESOLVED;20/Feb/09 06:47 PM;24/Feb/09
12:07 PM;;;;;0
+Bug;RF-5671;Panel Menu. selectedChild problems;Alex Kolonitsky;03.03.2001;Ilya
Shaikovsky;Major;Open;UNRESOLVED;13/Jan/09 05:26 AM;24/Feb/09 08:43 PM;;;;;0
+Bug;RF-6155;Column: rendered attribute handled wrong;Alexander Smirnov;03.03.2001;Nick
Belaevski;Major;Open;UNRESOLVED;13/Feb/09 10:36 AM;13/Feb/09 10:36 AM;;;;;1
+Bug;RF-6040;Columns: component does not work without value attribute defined;Andrei
Markavtsov;03.03.2001;Andrei Markavtsov;Critical;Open;UNRESOLVED;06/Feb/09 04:57
AM;06/Feb/09 09:28 AM;;;;;0
+Bug;RF-6031;columns: allow to use few columns and to use columns together with static
column components within the one table .;Andrei Markavtsov;03.03.2001;Ilya
Shaikovsky;Major;Open;UNRESOLVED;04/Feb/09 09:05 AM;05/Feb/09 08:40 AM;;;;;0
+Bug;RF-5960;FileUpload sends id parameter to server on each upload.;Andrei
Markavtsov;03.03.2001;Andrei Markavtsov;Major;Open;UNRESOLVED;29/Jan/09 05:57 AM;11/Feb/09
10:58 AM;;;;;1
+Bug;RF-6266;FileUpload: AJAX polling problems;Andrei Markavtsov;03.03.2001;Nick
Belaevski;Major;Open;UNRESOLVED;19/Feb/09 12:16 PM;24/Feb/09 11:56 AM;;;;;0
+Bug;RF-6143;inplaceSelect: is not expanded in FF;Anton Belevich;03.03.2001;Tsikhon
Kuprevich;Critical;Open;UNRESOLVED;11/Feb/09 09:29 AM;12/Feb/09 06:58 AM;;;;;0
+Bug;RF-5735;InplaceInput: input is possible after pressing green (OK) control icon under
FF2-3, Safari;Anton Belevich;03.03.2001;Alexander Dubovsky;Major;Open;UNRESOLVED;14/Jan/09
08:05 AM;15/Jan/09 05:20 AM;;;;;0
+Bug;RF-5717;editor: special characters escapement problem;Anton Belevich;03.03.2001;Ilya
Shaikovsky;Major;Reopened;UNRESOLVED;13/Jan/09 10:15 AM;15/Jan/09 11:34 AM;;;;;1
+Bug;RF-5790;Editor: converter error if use nesting formatting.;Anton
Belevich;03.03.2001;Alexander Dubovsky;Major;Open;UNRESOLVED;19/Jan/09 08:34 AM;20/Jan/09
10:42 AM;;;;;1
+Bug;RF-5825;Editor: convertion failed in case past formatted text in editor.;Anton
Belevich;03.03.2001;Alexander Dubovsky;Major;Open;UNRESOLVED;19/Jan/09 09:20 AM;20/Jan/09
11:36 AM;;;;;0
+Bug;RF-5209;Calendar: currentDateChangeListener does not trigger;Anton
Belevich;03.03.2001;Andrei Markavtsov;Major;Reopened;UNRESOLVED;03/Dec/08 10:02
AM;10/Feb/09 06:04 AM;;;14400;14400;0
+Bug;RF-5265;Calendar does not switch the current month/year properlly if
'preLoadDateRangeStart' & 'preLoadDateRangeEnd' attributes defined in
ajax mode;Anton Belevich;03.03.2001;Andrei Markavtsov;Major;Open;UNRESOLVED;05/Dec/08
12:01 PM;10/Feb/09 06:05 AM;;;;;0
+Bug;RF-6141;ComboBox: Style, styleClass and events attributes wasn't encoded on
highest-level html-element of this component..;Anton Belevich;03.03.2001;Konstantin
Mishin;Major;Open;UNRESOLVED;11/Feb/09 08:45 AM;11/Feb/09 06:55 PM;;;;;0
+Bug;RF-6142;inplaceSelect: symbols are encoded in output;Anton
Belevich;03.03.2001;Tsikhon Kuprevich;Major;Open;UNRESOLVED;11/Feb/09 09:22 AM;11/Feb/09
06:55 PM;;;;;0
+Bug;RF-6000;liveDemo: dropDownMenu bottom example. The 'class' attribute is
incorrect for the tag h:panelGrid;Ilya Shaikovsky;03.03.2001;Tsikhon
Kuprevich;Major;Open;UNRESOLVED;02/Feb/09 04:52 AM;05/Feb/09 03:05 PM;;;;;0
+Bug;RF-5999;liveDemo: dropDownMenu: remove 'border' attribute from the spacer tag
in the top code example;Ilya Shaikovsky;03.03.2001;Tsikhon
Kuprevich;Major;Open;UNRESOLVED;02/Feb/09 04:43 AM;05/Feb/09 03:05 PM;;;;;0
+Bug;RF-6018;panelMenu: Attribute iconCollapsedTopPosition invalid for tag panelMenu
(demo);Ilya Shaikovsky;03.03.2001;Inna Shchibrya;Major;Open;UNRESOLVED;03/Feb/09 10:16
AM;05/Feb/09 03:05 PM;;;;;0
+Bug;RF-5780;DataScroller: incorrect page name in richfaces-demo;Ilya
Shaikovsky;03.03.2001;Alexander Dubovsky;Minor;Open;UNRESOLVED;19/Jan/09 08:04
AM;05/Feb/09 06:22 PM;;;;;0
+Bug;RF-6263;Demo: There is rich:dataList insted of rich:dataOrderedList on
dataOrderedList page.;Ilya Shaikovsky;03.03.2001;Konstantin
Mishin;Minor;Open;UNRESOLVED;19/Feb/09 09:17 AM;24/Feb/09 11:53 AM;;;;;0
+Bug;RF-5764;demosite: preview state mark on extended table to be removed.;Ilya
Shaikovsky;03.03.2001;Ilya Shaikovsky;Trivial;Open;UNRESOLVED;16/Jan/09 04:22 AM;16/Jan/09
04:22 AM;;;;;0
+Bug;RF-5638;DragListener/dropListener do not have 'type' attribute;Nick
Belaevski;03.03.2001;Alexandr Levkovsky;Major;Open;UNRESOLVED;10/Jan/09 10:37 AM;09/Feb/09
06:27 PM;;;;;0
Added: trunk/samples/richfaces-demo/src/main/resources/dataItem.hbm.xml
===================================================================
--- trunk/samples/richfaces-demo/src/main/resources/dataItem.hbm.xml
(rev 0)
+++ trunk/samples/richfaces-demo/src/main/resources/dataItem.hbm.xml 2009-04-24 12:32:33
UTC (rev 13821)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping>
+ <class name="org.richfaces.demo.modifiableModel.DataItem">
+ <id name="id">
+ <generator class="native" />
+ </id>
+
+ <property name="issueType" />
+ <property name="key" />
+ <property name="summary" />
+ <property name="assignee" />
+ <property name="fixVersion" />
+ <property name="reporter" />
+ <property name="priority" />
+ <property name="status" />
+ <property name="resolution" />
+ <property name="created" />
+ <property name="updated" />
+ <property name="dueDate" />
+ </class>
+
+</hibernate-mapping>
\ No newline at end of file
Added: trunk/samples/richfaces-demo/src/main/resources/hibernate.cfg.xml
===================================================================
--- trunk/samples/richfaces-demo/src/main/resources/hibernate.cfg.xml
(rev 0)
+++ trunk/samples/richfaces-demo/src/main/resources/hibernate.cfg.xml 2009-04-24 12:32:33
UTC (rev 13821)
@@ -0,0 +1,17 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!DOCTYPE hibernate-configuration PUBLIC
+"-//Hibernate/Hibernate Configuration DTD//EN"
+"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+
+<hibernate-configuration>
+ <session-factory>
+ <property
name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
+ <property
name="hibernate.connection.url">jdbc:hsqldb:mem:abc</property>
+ <property name="hibernate.connection.username">sa</property>
+ <property name="hibernate.connection.password"></property>
+ <property name="hibernate.connection.pool_size">10</property>
+ <property name="show_sql">true</property>
+ <property
name="dialect">org.hibernate.dialect.HSQLDialect</property>
+ <property name="hibernate.hbm2ddl.auto">create</property>
+ </session-factory>
+</hibernate-configuration>
\ No newline at end of file
Modified:
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties
===================================================================
---
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties 2009-04-24
12:29:02 UTC (rev 13820)
+++
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties 2009-04-24
12:32:33 UTC (rev 13821)
@@ -7,7 +7,7 @@
inputNumberSlider= richInputs, Input Number Slider,
/images/ico_DataFilterSlider.gif, /images/cn_slider.gif,
inputNumberSlider.html,
jbossrichfaces/freezone/docs/tlddoc/rich/inputNumberSlider.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIInputNumberSlider.html,
/richfaces/inputNumberSlider.jsf
inputNumberSpinner= richInputs, Input Number Spinner, /images/ico_spinner.gif,
/images/cn_spinner.gif, inputNumberSpinner.html,
jbossrichfaces/freezone/docs/tlddoc/rich/inputNumberSpinner.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIInputNumberSpinner.html,
/richfaces/inputNumberSpinner.jsf
dataFilterSlider= richDataIterators, Data Filter Slider,
/images/ico_DataFilterSlider.gif, /images/cn_DataFilterSlider.gif,
dataFilterSlider.html,
jbossrichfaces/freezone/docs/tlddoc/rich/dataFilterSlider.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIDataFltrSlider.html,
/richfaces/dataFilterSlider.jsf
-dataTable=richDataIterators, Data Table, /images/ico_DataTable.gif,
/images/cn_DataTable.gif, dataTable.html,
jbossrichfaces/freezone/docs/tlddoc/rich/dataTable.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIDataTable.html,
/richfaces/dataTable.jsf
+dataTable=richDataIterators, Data Table, /images/ico_DataTable.gif,
/images/cn_DataTable.gif, dataTable.html,
jbossrichfaces/freezone/docs/tlddoc/rich/dataTable.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIDataTable.html,
/richfaces/dataTable.jsf, new
column= richDataIterators, Column, /images/ico_Column.gif,
/images/cn_Column.gif, column.html,
jbossrichfaces/freezone/docs/tlddoc/rich/column.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIColumn.html,
/richfaces/dataTable.jsf
columnGroup= richDataIterators, Column Group, /images/ico_ColumnGroup.gif,
/images/cn_ColumnGroup.gif, columnGroup.html,
jbossrichfaces/freezone/docs/tlddoc/rich/columnGroup.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIColumnGroup.html,
/richfaces/dataTable.jsf
dataDefinitionList= richDataIterators, Data Definition List,
/images/ico_DataDefinitionList.gif, /images/cn_DataDefinitionList.gif,
dataDefinitionList.html,
jbossrichfaces/freezone/docs/tlddoc/rich/dataDefinitionList.html,
jbossrichfaces/freezone/docs/apidoc/org/richfaces/component/UIDataDefinitionList.html,
/richfaces/dataLists.jsf
Modified: trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml 2009-04-24
12:29:02 UTC (rev 13820)
+++ trunk/samples/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml 2009-04-24
12:32:33 UTC (rev 13821)
@@ -3,6 +3,10 @@
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
<converter>
+ <converter-id>longConverter</converter-id>
+ <converter-class>javax.faces.convert.LongConverter</converter-class>
+ </converter>
+ <converter>
<converter-id>listShuttleconverter</converter-id>
<converter-class>org.richfaces.demo.listShuttle.Converter</converter-class>
</converter>
@@ -10,6 +14,20 @@
<converter-id>orderingListConverter</converter-id>
<converter-class>org.richfaces.demo.orderingList.SongConverter</converter-class>
</converter>
+ <managed-bean>
+ <managed-bean-name>hibernateBean</managed-bean-name>
+ <managed-bean-class>org.richfaces.demo.modifiableModel.HibernateBean</managed-bean-class>
+ <managed-bean-scope>application</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>hibernateDataModel</managed-bean-name>
+ <managed-bean-class>org.richfaces.demo.modifiableModel.HibernateDataModel</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ <managed-property>
+ <property-name>sessionFactory</property-name>
+ <value>#{hibernateBean.sessionFactory}</value>
+ </managed-property>
+ </managed-bean>
<managed-bean>
<managed-bean-name>loginbean</managed-bean-name>
<managed-bean-class>org.richfaces.demo.stateApi.Bean</managed-bean-class>
Added:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTable/examples/modifiableModel.xhtml
===================================================================
---
trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTable/examples/modifiableModel.xhtml
(rev 0)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTable/examples/modifiableModel.xhtml 2009-04-24
12:32:33 UTC (rev 13821)
@@ -0,0 +1,27 @@
+<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:rich="http://richfaces.org/rich">
+ <h:form>
+ <a4j:queue requestDelay="100" />
+ <rich:messages />
+ <rich:dataTable value="#{hibernateDataModel}" var="row"
rows="10"
+ rowKeyConverter="#{longConverter}" reRender="datascroller">
+ <rich:columns value="#{hibernateBean.csvFields}" var="field"
+ sortBy="#{field}" filterBy="#{field}"
filterEvent="onkeyup"
+ index="index" id="column#{index}"
+ sortOrder="#{hibernateDataModel.sortOrders[field]}"
+ filterValue="#{hibernateDataModel.columnFilterValues[field]}">
+ <f:facet name="header">
+ <h:outputText value="#{field}" />
+ </f:facet>
+ <h:outputText value="#{row[field]}" />
+ </rich:columns>
+ <f:facet name="footer">
+ <rich:datascroller id="datascroller" />
+ </f:facet>
+ </rich:dataTable>
+ </h:form>
+</ui:composition>
Added:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTable/modifiableModel.xhtml
===================================================================
---
trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTable/modifiableModel.xhtml
(rev 0)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTable/modifiableModel.xhtml 2009-04-24
12:32:33 UTC (rev 13821)
@@ -0,0 +1,29 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:rich="http://richfaces.org/rich">
+ <ui:composition template="/templates/component-sample.xhtml">
+ <ui:define name="sample">
+ <p>
+ Descriptions
+ </p>
+ <div class="sample-container" >
+
+ <ui:include
src="/richfaces/dataTable/examples/modifiableModel.xhtml"/>
+ <ui:include src="/templates/include/sourceview.xhtml">
+ <ui:param name="sourcepath"
value="/richfaces/dataTable/examples/modifiableModel.xhtml"/>
+ <ui:param name="openlabel" value="View Source" />
+ </ui:include>
+
+ <ui:include src="/templates/include/sourceview.xhtml">
+ <ui:param name="sourcepath"
value="/WEB-INF/src/org/richfaces/demo/extendeddatamodel/AuctionDataModel.java"/>
+ <ui:param name="openlabel" value="View AuctionDataModel.java
Source" />
+ <ui:param name="sourcetype" value="java" />
+ </ui:include>
+ </div>
+ </ui:define>
+ </ui:composition>
+</html>
\ No newline at end of file
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTable.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTable.xhtml 2009-04-24
12:29:02 UTC (rev 13820)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/dataTable.xhtml 2009-04-24
12:32:33 UTC (rev 13821)
@@ -18,6 +18,9 @@
<rich:tab label="Edit Table with ModalPanel"
name="editDataTable">
<ui:include src="/richfaces/dataTable/editDataTable.xhtml"/>
</rich:tab>
+ <rich:tab label="Modifiable Data Model"
name="modifiableDataModel">
+ <ui:include src="/richfaces/dataTable/modifiableModel.xhtml"/>
+ </rich:tab>
<rich:tab name="info" label="Tag Information">
<rich:insert
src="/WEB-INF/#{componentNavigator.currentComponent.tagInfoLocation}"