You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2012/07/09 23:19:26 UTC
svn commit: r1359407 - in /incubator/isis/trunk/framework:
core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/
core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/
core/metamodel/src/test/java/org/apache/isis/core/metamode...
Author: danhaywood
Date: Mon Jul 9 21:19:25 2012
New Revision: 1359407
URL: http://svn.apache.org/viewvc?rev=1359407&view=rev
Log:
ISIS-14: ResolveState simplifications - combined representsTransient with isTransient (since now only a single state can ever 'represent transient')
Removed:
incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/spec/ObjectMetaModel.java
Modified:
incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/ObjectAdapter.java
incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/ResolveState.java
incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsTransientTest.java
incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/main/java/org/apache/isis/runtimes/dflt/objectstores/datanucleus/persistence/IsisLifecycleListener.java
incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/main/java/org/apache/isis/runtimes/dflt/objectstores/datanucleus/persistence/spi/ResolveStateUtil.java
incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/spi/ResolveStateUtil.java
incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/memento/Memento.java
incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adapterfactory/pojo/PojoAdapter.java
incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/algorithm/dflt/DefaultPersistAlgorithm.java
incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/algorithm/topdown/TopDownPersistAlgorithm.java
incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/algorithm/twopass/TwoPassPersistAlgorithm.java
incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/view/collection/AbstractCollectionContent.java
incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/view/content/AbstractObjectContent.java
incubator/isis/trunk/framework/viewer/html/src/main/java/org/apache/isis/viewer/html/action/edit/EditObject.java
incubator/isis/trunk/framework/viewer/html/src/main/java/org/apache/isis/viewer/html/task/EditTask.java
Modified: incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/ObjectAdapter.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/ObjectAdapter.java?rev=1359407&r1=1359406&r2=1359407&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/ObjectAdapter.java (original)
+++ incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/ObjectAdapter.java Mon Jul 9 21:19:25 2012
@@ -24,17 +24,90 @@ import org.apache.isis.core.metamodel.ad
import org.apache.isis.core.metamodel.adapter.oid.CollectionOid;
import org.apache.isis.core.metamodel.adapter.oid.Oid;
import org.apache.isis.core.metamodel.adapter.version.Version;
-import org.apache.isis.core.metamodel.spec.ObjectMetaModel;
+import org.apache.isis.core.metamodel.spec.ElementSpecificationProvider;
+import org.apache.isis.core.metamodel.spec.Instance;
+import org.apache.isis.core.metamodel.spec.ObjectSpecification;
+import org.apache.isis.core.metamodel.spec.Specification;
/**
* Adapters to domain objects, where the application is written in terms of
* domain objects and those objects are represented within the NOF through these
* adapter, and not directly.
- *
- * @see ObjectMetaModel
*/
-public interface ObjectAdapter extends ObjectMetaModel {
+public interface ObjectAdapter extends Instance {
+
+ /**
+ * Refines {@link Instance#getSpecification()}.
+ */
+ @Override
+ ObjectSpecification getSpecification();
+
+ /**
+ * Returns the adapted domain object, the POJO, that this adapter represents
+ * with the NOF.
+ */
+ Object getObject();
+
+ /**
+ * Returns the title to display this object with, which is usually got from
+ * the wrapped {@link #getObject() domain object}.
+ */
+ String titleString();
+
+ /**
+ * Return an {@link Instance} of the specified {@link Specification} with
+ * respect to this {@link ObjectAdapter}.
+ *
+ * <p>
+ * If called with {@link ObjectSpecification}, then just returns
+ * <tt>this</tt>). If called for other subinterfaces, then should provide an
+ * appropriate {@link Instance} implementation.
+ *
+ * <p>
+ * Designed to be called in a double-dispatch design from
+ * {@link Specification#getInstance(ObjectAdapter)}.
+ *
+ * <p>
+ * Note: this method will throw an {@link UnsupportedOperationException}
+ * unless the extended <tt>PojoAdapterXFactory</tt> is configured. (That is,
+ * only <tt>PojoAdapterX</tt> provides support for this; the regular
+ * <tt>PojoAdapter</tt> does not currently.
+ *
+ * @param adapter
+ * @return
+ */
+ Instance getInstance(Specification specification);
+
+ /**
+ * Sometimes it is necessary to manage the replacement of the underlying
+ * domain object (by another component such as an object store). This method
+ * allows the adapter to be kept while the domain object is replaced.
+ */
+ void replacePojo(Object pojo);
+
+ /**
+ * For (stand-alone) collections, returns the element type.
+ *
+ * <p>
+ * For owned (aggregated) collections, the element type can be determined
+ * from the <tt>TypeOfFacet</tt> associated with the
+ * <tt>ObjectAssociation</tt> representing the collection.
+ *
+ * @see #setElementSpecificationProvider(ElementSpecificationProvider)
+ */
+ ObjectSpecification getElementSpecification();
+
+ /**
+ * For (stand-alone) collections, returns the element type.
+ *
+ * @see #getElementSpecification()
+ */
+ void setElementSpecificationProvider(ElementSpecificationProvider elementSpecificationProvider);
+
+
+
+
/**
* Returns the name of an icon to use if this object is to be displayed
* graphically.
@@ -88,6 +161,48 @@ public interface ObjectAdapter extends O
*/
ResolveState getResolveState();
+
+ /**
+ * Whether the object is persisted.
+ *
+ * <p>
+ * Note: not necessarily the reciprocal of {@link #representsTransient()};
+ * standalone adapters (with {@link ResolveState#VALUE}) report as neither
+ * persistent or transient.
+ */
+ boolean isPersistent();
+
+ /**
+ * Whether the object is transient.
+ *
+ * <p>
+ * Note: not necessarily the reciprocal of {@link #isPersistent()};
+ * standalone adapters (with {@link ResolveState#VALUE}) report as neither
+ * persistent or transient.
+ */
+ boolean representsTransient();
+
+
+ boolean isResolved();
+
+ boolean isGhost();
+
+ boolean isTitleAvailable();
+
+ void markAsResolvedIfPossible();
+
+ boolean isDestroyed();
+
+ boolean isResolving();
+
+ boolean isUpdating();
+
+ boolean isNew();
+
+ boolean canTransitionToResolving();
+
+
+
Version getVersion();
void setVersion(Version version);
@@ -119,25 +234,6 @@ public interface ObjectAdapter extends O
*/
ObjectAdapter getAggregateRoot();
- boolean isResolved();
-
- boolean isGhost();
-
- boolean isTitleAvailable();
-
- void markAsResolvedIfPossible();
-
- boolean isDestroyed();
-
- boolean isTransient();
-
- boolean isResolving();
-
- boolean isUpdating();
-
- boolean isNew();
-
- boolean canTransitionToResolving();
Modified: incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/ResolveState.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/ResolveState.java?rev=1359407&r1=1359406&r2=1359407&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/ResolveState.java (original)
+++ incubator/isis/trunk/framework/core/metamodel/src/main/java/org/apache/isis/core/metamodel/adapter/ResolveState.java Mon Jul 9 21:19:25 2012
@@ -21,8 +21,6 @@ package org.apache.isis.core.metamodel.a
import static org.apache.isis.core.metamodel.adapter.ResolveState.RepresentsPersistent.DOES_NOT_REPRESENT_PERSISTENT;
import static org.apache.isis.core.metamodel.adapter.ResolveState.RepresentsPersistent.REPRESENTS_PERSISTENT;
-import static org.apache.isis.core.metamodel.adapter.ResolveState.RepresentsTransient.DOES_NOT_REPRESENT_TRANSIENT;
-import static org.apache.isis.core.metamodel.adapter.ResolveState.RepresentsTransient.REPRESENTS_TRANSIENT;
import static org.apache.isis.core.metamodel.adapter.ResolveState.TransitionFrom.CANNOT_TRANSITION_FROM;
import static org.apache.isis.core.metamodel.adapter.ResolveState.TransitionFrom.CAN_TRANSITION_FROM;
import static org.apache.isis.core.metamodel.adapter.ResolveState.RespondsToChanges.DOES_NOT_RESPOND_TO_CHANGES;
@@ -47,10 +45,6 @@ public final class ResolveState {
RESPONDS_TO_CHANGES, DOES_NOT_RESPOND_TO_CHANGES
}
- static enum RepresentsTransient {
- REPRESENTS_TRANSIENT, DOES_NOT_REPRESENT_TRANSIENT
- }
-
static enum RepresentsPersistent {
REPRESENTS_PERSISTENT, DOES_NOT_REPRESENT_PERSISTENT
}
@@ -58,14 +52,14 @@ public final class ResolveState {
/**
* When first instantiated by <tt>PojoAdapterFactory</tt>.
*/
- public static final ResolveState NEW = new ResolveState("New", "N~~", null, CANNOT_TRANSITION_FROM, DOES_NOT_RESPOND_TO_CHANGES, DOES_NOT_REPRESENT_TRANSIENT, DOES_NOT_REPRESENT_PERSISTENT);
- public static final ResolveState TRANSIENT = new ResolveState("Transient", "T~~", null, CANNOT_TRANSITION_FROM, DOES_NOT_RESPOND_TO_CHANGES, REPRESENTS_TRANSIENT, DOES_NOT_REPRESENT_PERSISTENT);
- public static final ResolveState GHOST = new ResolveState("Ghost", "PG~", null, CAN_TRANSITION_FROM, RESPONDS_TO_CHANGES, DOES_NOT_REPRESENT_TRANSIENT, REPRESENTS_PERSISTENT);
- public static final ResolveState RESOLVED = new ResolveState("Resolved", "PR~", null, CAN_TRANSITION_FROM, RESPONDS_TO_CHANGES, DOES_NOT_REPRESENT_TRANSIENT, REPRESENTS_PERSISTENT);
- public static final ResolveState RESOLVING = new ResolveState("Resolving", "Pr~", RESOLVED, CANNOT_TRANSITION_FROM, DOES_NOT_RESPOND_TO_CHANGES, DOES_NOT_REPRESENT_TRANSIENT, REPRESENTS_PERSISTENT);
- public static final ResolveState UPDATING = new ResolveState("Updating", "PU~", RESOLVED, CANNOT_TRANSITION_FROM, DOES_NOT_RESPOND_TO_CHANGES, DOES_NOT_REPRESENT_TRANSIENT, REPRESENTS_PERSISTENT);
- public static final ResolveState DESTROYED = new ResolveState("Destroyed", "D~~", null, CANNOT_TRANSITION_FROM, RESPONDS_TO_CHANGES, DOES_NOT_REPRESENT_TRANSIENT, DOES_NOT_REPRESENT_PERSISTENT);
- public static final ResolveState VALUE = new ResolveState("Value", "V~~", null, CANNOT_TRANSITION_FROM, RESPONDS_TO_CHANGES, DOES_NOT_REPRESENT_TRANSIENT, DOES_NOT_REPRESENT_PERSISTENT);
+ public static final ResolveState NEW = new ResolveState("New", "N~~", null, CANNOT_TRANSITION_FROM, DOES_NOT_RESPOND_TO_CHANGES, DOES_NOT_REPRESENT_PERSISTENT);
+ public static final ResolveState TRANSIENT = new ResolveState("Transient", "T~~", null, CANNOT_TRANSITION_FROM, DOES_NOT_RESPOND_TO_CHANGES, DOES_NOT_REPRESENT_PERSISTENT);
+ public static final ResolveState GHOST = new ResolveState("Ghost", "PG~", null, CAN_TRANSITION_FROM, RESPONDS_TO_CHANGES, REPRESENTS_PERSISTENT);
+ public static final ResolveState RESOLVED = new ResolveState("Resolved", "PR~", null, CAN_TRANSITION_FROM, RESPONDS_TO_CHANGES, REPRESENTS_PERSISTENT);
+ public static final ResolveState RESOLVING = new ResolveState("Resolving", "Pr~", RESOLVED, CANNOT_TRANSITION_FROM, DOES_NOT_RESPOND_TO_CHANGES, REPRESENTS_PERSISTENT);
+ public static final ResolveState UPDATING = new ResolveState("Updating", "PU~", RESOLVED, CANNOT_TRANSITION_FROM, DOES_NOT_RESPOND_TO_CHANGES, REPRESENTS_PERSISTENT);
+ public static final ResolveState DESTROYED = new ResolveState("Destroyed", "D~~", null, CANNOT_TRANSITION_FROM, RESPONDS_TO_CHANGES, DOES_NOT_REPRESENT_PERSISTENT);
+ public static final ResolveState VALUE = new ResolveState("Value", "V~~", null, CANNOT_TRANSITION_FROM, RESPONDS_TO_CHANGES, DOES_NOT_REPRESENT_PERSISTENT);
// 20120709: used only in <tt>Memento</tt>, when recreating a transient object.
// however, analysis is that could equally set to TRANSIENT, rendering this state
@@ -140,17 +134,15 @@ public final class ResolveState {
private final String name;
private final TransitionFrom transitionFrom;
private final RespondsToChanges respondsToChanges;
- private final RepresentsTransient representsTransient;
private final RepresentsPersistent representsPersistent;
private HashSet<ResolveState> changeToStates;
- private ResolveState(final String name, final String code, final ResolveState endState, final TransitionFrom transitionFrom, final RespondsToChanges respondsToChanges, final RepresentsTransient representsTransient, final RepresentsPersistent representsPersistent) {
+ private ResolveState(final String name, final String code, final ResolveState endState, final TransitionFrom transitionFrom, final RespondsToChanges respondsToChanges, final RepresentsPersistent representsPersistent) {
this.name = name;
this.code = code;
this.endState = endState;
this.transitionFrom = transitionFrom;
this.respondsToChanges = respondsToChanges;
- this.representsTransient = representsTransient;
this.representsPersistent = representsPersistent;
statesByName.put(name, this);
}
@@ -207,17 +199,6 @@ public final class ResolveState {
}
/**
- * Returns <tt>true</tt> when an object has not yet been made persistent
- * (except for {@link #VALUE} adapters)..
- *
- * <p>
- * Always returns <tt>false</tt> for {@link #VALUE}.
- */
- public boolean representsTransient() {
- return this.representsTransient == REPRESENTS_TRANSIENT;
- }
-
- /**
* As per {@link #isValidToChangeTo(ResolveState)}, but will additionally
* return <tt>false</tt> if the current state can never be transitioned from.
*/
@@ -235,40 +216,38 @@ public final class ResolveState {
return respondsToChanges == RESPONDS_TO_CHANGES;
}
- public boolean isGhost() {
- return this == GHOST;
+ public boolean isNew() {
+ return this == NEW;
}
-
+
public boolean isValue() {
return this == VALUE;
}
- public boolean isNew() {
- return this == NEW;
+ public boolean isTransient() {
+ return this == TRANSIENT;
}
+ public boolean isGhost() {
+ return this == GHOST;
+ }
+
public boolean isUpdating() {
return this == UPDATING;
}
- public boolean isDestroyed() {
- return this == DESTROYED;
- }
-
public boolean isResolved() {
return this == RESOLVED;
}
- public boolean isTransient() {
- return this == TRANSIENT;
- }
-
- /**
- * Return true if the state reflects some kind of loading.
- */
public boolean isResolving() {
return this == RESOLVING;
}
+
+ public boolean isDestroyed() {
+ return this == DESTROYED;
+ }
+
/**
* Determines if the resolved state can be changed from this state to the
Modified: incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsTransientTest.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsTransientTest.java?rev=1359407&r1=1359406&r2=1359407&view=diff
==============================================================================
--- incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsTransientTest.java (original)
+++ incubator/isis/trunk/framework/core/metamodel/src/test/java/org/apache/isis/core/metamodel/adapter/ResolveState_IsTransientTest.java Mon Jul 9 21:19:25 2012
@@ -70,7 +70,7 @@ public class ResolveState_IsTransientTes
@Test
public void testIsTransient() {
- assertThat(state.representsTransient(), is(whetherIs));
+ assertThat(state.isTransient(), is(whetherIs));
}
}
Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/main/java/org/apache/isis/runtimes/dflt/objectstores/datanucleus/persistence/IsisLifecycleListener.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/main/java/org/apache/isis/runtimes/dflt/objectstores/datanucleus/persistence/IsisLifecycleListener.java?rev=1359407&r1=1359406&r2=1359407&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/main/java/org/apache/isis/runtimes/dflt/objectstores/datanucleus/persistence/IsisLifecycleListener.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/main/java/org/apache/isis/runtimes/dflt/objectstores/datanucleus/persistence/IsisLifecycleListener.java Mon Jul 9 21:19:25 2012
@@ -278,7 +278,7 @@ public class IsisLifecycleListener imple
if(!pojo.jdoIsPersistent()) {
// make sure the adapter is transient
- if (!adapter.getResolveState().representsTransient()) {
+ if (!adapter.getResolveState().isTransient()) {
throw new IsisException(MessageFormat.format("adapter is in invalid state; should be {0} but is {1}", ResolveState.TRANSIENT, adapter.getResolveState()));
}
Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/main/java/org/apache/isis/runtimes/dflt/objectstores/datanucleus/persistence/spi/ResolveStateUtil.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/main/java/org/apache/isis/runtimes/dflt/objectstores/datanucleus/persistence/spi/ResolveStateUtil.java?rev=1359407&r1=1359406&r2=1359407&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/main/java/org/apache/isis/runtimes/dflt/objectstores/datanucleus/persistence/spi/ResolveStateUtil.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jdo/jdo-datanucleus/src/main/java/org/apache/isis/runtimes/dflt/objectstores/datanucleus/persistence/spi/ResolveStateUtil.java Mon Jul 9 21:19:25 2012
@@ -90,7 +90,7 @@ public final class ResolveStateUtil {
public static void markAsUpdating(final ObjectAdapter adapter) {
- if (adapter.isTransient()) {
+ if (adapter.representsTransient()) {
adapter.changeState(ResolveState.RESOLVED);
}
if (adapter.isResolved()) {
Modified: incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/spi/ResolveStateUtil.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/spi/ResolveStateUtil.java?rev=1359407&r1=1359406&r2=1359407&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/spi/ResolveStateUtil.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/objectstores/jpa/jpa-openjpa/src/main/java/org/apache/isis/runtimes/dflt/objectstores/jpa/openjpa/persistence/spi/ResolveStateUtil.java Mon Jul 9 21:19:25 2012
@@ -90,7 +90,7 @@ public final class ResolveStateUtil {
public static void markAsUpdating(final ObjectAdapter adapter) {
- if (adapter.isTransient()) {
+ if (adapter.representsTransient()) {
adapter.changeState(ResolveState.RESOLVED);
}
if (adapter.isResolved()) {
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/memento/Memento.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/memento/Memento.java?rev=1359407&r1=1359406&r2=1359407&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/memento/Memento.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/memento/Memento.java Mon Jul 9 21:19:25 2012
@@ -285,7 +285,7 @@ public class Memento implements Serializ
PersistorUtil.startStateTransition(objectAdapter, targetState);
updateFields(objectAdapter, data);
PersistorUtil.endStateTransition(objectAdapter);
- } else if (objectAdapter.isTransient() && targetState == ResolveState.TRANSIENT) {
+ } else if (objectAdapter.representsTransient() && targetState == ResolveState.TRANSIENT) {
updateFields(objectAdapter, data);
} else if (objectAdapter.isParented()) {
updateFields(objectAdapter, data);
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adapterfactory/pojo/PojoAdapter.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adapterfactory/pojo/PojoAdapter.java?rev=1359407&r1=1359406&r2=1359407&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adapterfactory/pojo/PojoAdapter.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/adapterfactory/pojo/PojoAdapter.java Mon Jul 9 21:19:25 2012
@@ -184,12 +184,12 @@ public class PojoAdapter extends Instanc
/**
* Just delegates to {@link #getResolveState() resolve state}.
*
- * @see ResolveState#representsTransient()
+ * @see ResolveState#isTransient()
* @see #isPersistent()
*/
@Override
public boolean representsTransient() {
- return getResolveState().representsTransient();
+ return getResolveState().isTransient();
}
@Override
@@ -222,11 +222,6 @@ public class PojoAdapter extends Instanc
return getResolveState().isDestroyed();
}
- @Override
- public boolean isTransient() {
- return getResolveState().isTransient();
- }
-
@Override
public boolean canTransitionToResolving() {
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/algorithm/dflt/DefaultPersistAlgorithm.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/algorithm/dflt/DefaultPersistAlgorithm.java?rev=1359407&r1=1359406&r2=1359407&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/algorithm/dflt/DefaultPersistAlgorithm.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/algorithm/dflt/DefaultPersistAlgorithm.java Mon Jul 9 21:19:25 2012
@@ -53,7 +53,7 @@ public class DefaultPersistAlgorithm ext
if (adapter.isGhost()) {
adapter.changeState(ResolveState.RESOLVING);
adapter.changeState(ResolveState.RESOLVED);
- } else if (adapter.isTransient()) {
+ } else if (adapter.representsTransient()) {
adapter.changeState(ResolveState.RESOLVED);
}
final CollectionFacet facet = CollectionFacetUtils.getCollectionFacetFromSpec(adapter);
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/algorithm/topdown/TopDownPersistAlgorithm.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/algorithm/topdown/TopDownPersistAlgorithm.java?rev=1359407&r1=1359406&r2=1359407&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/algorithm/topdown/TopDownPersistAlgorithm.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/algorithm/topdown/TopDownPersistAlgorithm.java Mon Jul 9 21:19:25 2012
@@ -87,7 +87,7 @@ public class TopDownPersistAlgorithm ext
private void makeCollectionPersistent(final ObjectAdapter collectionAdapter, final ToPersistObjectSet toPersistObjectSet) {
LOG.info("persist " + collectionAdapter);
- if (collectionAdapter.isTransient()) {
+ if (collectionAdapter.representsTransient()) {
collectionAdapter.changeState(ResolveState.RESOLVED);
}
final CollectionFacet facet = CollectionFacetUtils.getCollectionFacetFromSpec(collectionAdapter);
Modified: incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/algorithm/twopass/TwoPassPersistAlgorithm.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/algorithm/twopass/TwoPassPersistAlgorithm.java?rev=1359407&r1=1359406&r2=1359407&view=diff
==============================================================================
--- incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/algorithm/twopass/TwoPassPersistAlgorithm.java (original)
+++ incubator/isis/trunk/framework/runtimes/dflt/runtime/src/main/java/org/apache/isis/runtimes/dflt/runtime/persistence/objectstore/algorithm/twopass/TwoPassPersistAlgorithm.java Mon Jul 9 21:19:25 2012
@@ -114,7 +114,7 @@ public class TwoPassPersistAlgorithm ext
private void makeCollectionPersistent(final ObjectAdapter collection, final ToPersistObjectSet toPersistObjectSet) {
LOG.info("persist " + collection);
- if (collection.isTransient()) {
+ if (collection.representsTransient()) {
collection.changeState(ResolveState.RESOLVED);
}
final CollectionFacet facet = CollectionFacetUtils.getCollectionFacetFromSpec(collection);
Modified: incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/view/collection/AbstractCollectionContent.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/view/collection/AbstractCollectionContent.java?rev=1359407&r1=1359406&r2=1359407&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/view/collection/AbstractCollectionContent.java (original)
+++ incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/view/collection/AbstractCollectionContent.java Mon Jul 9 21:19:25 2012
@@ -132,7 +132,7 @@ public abstract class AbstractCollection
options.add(new UserActionAbstract("Clear resolved", ActionType.DEBUG) {
@Override
public Consent disabled(final View component) {
- return ConsentAbstract.allowIf(collection == null || !(collection.isTransient()) || collection.isGhost());
+ return ConsentAbstract.allowIf(collection == null || !(collection.representsTransient()) || collection.isGhost());
}
@Override
Modified: incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/view/content/AbstractObjectContent.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/view/content/AbstractObjectContent.java?rev=1359407&r1=1359406&r2=1359407&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/view/content/AbstractObjectContent.java (original)
+++ incubator/isis/trunk/framework/viewer/dnd/src/main/java/org/apache/isis/viewer/dnd/view/content/AbstractObjectContent.java Mon Jul 9 21:19:25 2012
@@ -118,7 +118,7 @@ public abstract class AbstractObjectCont
@Override
public Consent disabled(final View view) {
final ObjectAdapter object = view.getContent().getAdapter();
- return ConsentAbstract.allowIf(object == null || !object.isTransient() || object.isGhost());
+ return ConsentAbstract.allowIf(object == null || !object.representsTransient() || object.isGhost());
}
@Override
Modified: incubator/isis/trunk/framework/viewer/html/src/main/java/org/apache/isis/viewer/html/action/edit/EditObject.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/html/src/main/java/org/apache/isis/viewer/html/action/edit/EditObject.java?rev=1359407&r1=1359406&r2=1359407&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/html/src/main/java/org/apache/isis/viewer/html/action/edit/EditObject.java (original)
+++ incubator/isis/trunk/framework/viewer/html/src/main/java/org/apache/isis/viewer/html/action/edit/EditObject.java Mon Jul 9 21:19:25 2012
@@ -38,7 +38,7 @@ public class EditObject implements Actio
throw new ActionException("Task no longer in progress");
}
final ObjectAdapter object = context.getMappedObject(idString);
- if (!(object.isTransient())) {
+ if (!(object.representsTransient())) {
context.setObjectCrumb(object);
}
final EditTask editTask = new EditTask(context, object);
Modified: incubator/isis/trunk/framework/viewer/html/src/main/java/org/apache/isis/viewer/html/task/EditTask.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/viewer/html/src/main/java/org/apache/isis/viewer/html/task/EditTask.java?rev=1359407&r1=1359406&r2=1359407&view=diff
==============================================================================
--- incubator/isis/trunk/framework/viewer/html/src/main/java/org/apache/isis/viewer/html/task/EditTask.java (original)
+++ incubator/isis/trunk/framework/viewer/html/src/main/java/org/apache/isis/viewer/html/task/EditTask.java Mon Jul 9 21:19:25 2012
@@ -93,7 +93,7 @@ public class EditTask extends Task {
i++;
}
- final boolean isTransient = adapter.isTransient();
+ final boolean isTransient = adapter.representsTransient();
newType = isTransient ? getTarget(context).getSpecification().getSingularName() : null;
}