Author: nbelaevski
Date: 2010-12-23 09:53:40 -0500 (Thu, 23 Dec 2010)
New Revision: 20772
Removed:
trunk/core/api/src/main/java/org/ajax4jsf/model/SerializableDataModel.java
Modified:
trunk/core/api/src/main/java/org/ajax4jsf/model/ExtendedDataModel.java
trunk/ui/common/ui/src/main/java/org/richfaces/component/UIDataAdaptor.java
Log:
https://issues.jboss.org/browse/RF-10077
Modified: trunk/core/api/src/main/java/org/ajax4jsf/model/ExtendedDataModel.java
===================================================================
--- trunk/core/api/src/main/java/org/ajax4jsf/model/ExtendedDataModel.java 2010-12-23
14:27:11 UTC (rev 20771)
+++ trunk/core/api/src/main/java/org/ajax4jsf/model/ExtendedDataModel.java 2010-12-23
14:53:40 UTC (rev 20772)
@@ -53,18 +53,6 @@
public abstract Object getRowKey();
/**
- * Iteration component can support save data for use at decoding/validation/update
phases to avoid
- * unnessesary calls to original models,
- * for example - to avoid requests to database until all data is validated.
- * @return
- */
- public SerializableDataModel getSerializableModel(Range range) {
-
- // By default, model not serializable.
- return null;
- }
-
- /**
* Iterate over model by "visitor" pattern, for given range
* @param context current JSF context.
* @param visitor instance of {@link DataVisitor}, for process each row.
Deleted: trunk/core/api/src/main/java/org/ajax4jsf/model/SerializableDataModel.java
===================================================================
--- trunk/core/api/src/main/java/org/ajax4jsf/model/SerializableDataModel.java 2010-12-23
14:27:11 UTC (rev 20771)
+++ trunk/core/api/src/main/java/org/ajax4jsf/model/SerializableDataModel.java 2010-12-23
14:53:40 UTC (rev 20772)
@@ -1,42 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-
-
-package org.ajax4jsf.model;
-
-import java.io.Serializable;
-
-/**
- * Serializable version of {@link ExtendedDataModel}, for save lightweight version of
data
- *
- * @author shura
- *
- */
-@SuppressWarnings("serial")
-public abstract class SerializableDataModel extends ExtendedDataModel implements
Serializable {
-
- /**
- * Method called after update all model values. For example, developer can update
- * database with new values of modified rows.
- */
- public abstract void update();
-}
Modified: trunk/ui/common/ui/src/main/java/org/richfaces/component/UIDataAdaptor.java
===================================================================
--- trunk/ui/common/ui/src/main/java/org/richfaces/component/UIDataAdaptor.java 2010-12-23
14:27:11 UTC (rev 20771)
+++ trunk/ui/common/ui/src/main/java/org/richfaces/component/UIDataAdaptor.java 2010-12-23
14:53:40 UTC (rev 20772)
@@ -69,7 +69,6 @@
import org.ajax4jsf.model.DataVisitor;
import org.ajax4jsf.model.ExtendedDataModel;
import org.ajax4jsf.model.Range;
-import org.ajax4jsf.model.SerializableDataModel;
import org.richfaces.context.ExtendedVisitContext;
import org.richfaces.log.Logger;
import org.richfaces.log.RichfacesLogger;
@@ -104,7 +103,7 @@
private boolean componentStateIsStateHolder;
- private ExtendedDataModel<?> dataModel;
+ private transient ExtendedDataModel<?> dataModel;
public IterationState() {
super();
@@ -154,18 +153,10 @@
}
}
- Object savedSerializableModel = null;
-
- if (componentState != null && dataModel != null) {
- // TODO handle model serialization - "execute" model
- savedSerializableModel =
dataModel.getSerializableModel(componentState.getRange());
- }
-
- if (localSavedComponentState != null || savedSerializableModel != null) {
+ if (localSavedComponentState != null) {
return new Object[] {
localComponentStateIsHolder,
- localSavedComponentState,
- savedSerializableModel
+ localSavedComponentState
};
} else {
return null;
@@ -183,8 +174,6 @@
} else {
componentState = (DataComponentState) localSavedComponentState;
}
-
- dataModel = (ExtendedDataModel<?>) state[2];
}
}
@@ -961,16 +950,6 @@
preUpdate(faces);
this.iterate(faces, updateVisitor);
- ExtendedDataModel<?> dataModel = getExtendedDataModel();
-
- // If no validation errors, update values for serializable model,
- // restored from view.
- if ((dataModel instanceof SerializableDataModel) && (!isKeepSaved())) {
- SerializableDataModel serializableModel = (SerializableDataModel) dataModel;
-
- serializableModel.update();
- }
-
doUpdate();
popComponentFromEL(faces);