Author: julien(a)jboss.com
Date: 2007-11-27 11:37:49 -0500 (Tue, 27 Nov 2007)
New Revision: 9129
Modified:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIObjectImpl.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIWindowImpl.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/StateScopeType.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/content/WindowContent.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/structural/StructuralStateManager.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/test/model/ModelTestCase.java
Log:
better categorization of the different type of state scopes
Modified:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIObjectImpl.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIObjectImpl.java 2007-11-27
16:28:30 UTC (rev 9128)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIObjectImpl.java 2007-11-27
16:37:49 UTC (rev 9129)
@@ -132,13 +132,13 @@
Map map;
switch (scopeType)
{
- case TRANSIENT:
+ case CONTENT:
map = transientState;
break;
case NAVIGATIONAL:
map = navigationalState;
break;
- case PERSISTENT:
+ case STRUCTURAL:
map = state.getProperties();
break;
default:
@@ -157,13 +157,13 @@
Map map;
switch (scopeType)
{
- case TRANSIENT:
+ case CONTENT:
map = transientState;
break;
case NAVIGATIONAL:
map = navigationalState;
break;
- case PERSISTENT:
+ case STRUCTURAL:
throw new NotYetImplemented();
default:
throw new AssertionError();
Modified:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIWindowImpl.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIWindowImpl.java 2007-11-27
16:28:30 UTC (rev 9128)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIWindowImpl.java 2007-11-27
16:37:49 UTC (rev 9129)
@@ -44,12 +44,12 @@
public WindowContent getContent()
{
- return getProperty(StateScopeType.TRANSIENT, "content",
WindowContent.class);
+ return getProperty(StateScopeType.CONTENT, "content",
WindowContent.class);
}
public void setContent(WindowContent windowContent)
{
- setProperty(StateScopeType.TRANSIENT, "content", windowContent);
+ setProperty(StateScopeType.CONTENT, "content", windowContent);
}
/**
@@ -74,7 +74,7 @@
public void setMode(Mode mode)
{
setProperty(StateScopeType.NAVIGATIONAL, "mode", mode);
- setProperty(StateScopeType.TRANSIENT, "content", null);
+ setProperty(StateScopeType.CONTENT, "content", null);
}
/**
@@ -83,7 +83,7 @@
public void setWindowState(WindowState windowState)
{
setProperty(StateScopeType.NAVIGATIONAL, "windowstate", windowState);
- setProperty(StateScopeType.TRANSIENT, "content", null);
+ setProperty(StateScopeType.CONTENT, "content", null);
}
public Object getContentState()
@@ -94,7 +94,7 @@
public void setContentState(Object contentState)
{
setProperty(StateScopeType.NAVIGATIONAL, "content", contentState);
- setProperty(StateScopeType.TRANSIENT, "content", null);
+ setProperty(StateScopeType.CONTENT, "content", null);
}
/**
Modified:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/StateScopeType.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/StateScopeType.java 2007-11-27
16:28:30 UTC (rev 9128)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/StateScopeType.java 2007-11-27
16:37:49 UTC (rev 9129)
@@ -29,17 +29,20 @@
public enum StateScopeType
{
/**
- * The transient scope type.
+ * The content scope type. The content scope defines state which can be stored in the
model for convenience but can
+ * always be computed again.
*/
- TRANSIENT,
+ CONTENT,
/**
- * The navigational scope type.
+ * The navigational scope type. The navigational scope describe the a kind of change
done at runtime by the user when it
+ * interacts with the model (i.e not all interactions with the model are automatically
navigational state changes).
*/
NAVIGATIONAL,
/**
- * The persistent scope type.
+ * The structural scope type. The structural scope describe the structure of the
model, i.e it defines an enduring
+ * state managed by the presentation server.
*/
- PERSISTENT
+ STRUCTURAL
}
Modified:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/content/WindowContent.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/content/WindowContent.java 2007-11-27
16:28:30 UTC (rev 9128)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/content/WindowContent.java 2007-11-27
16:37:49 UTC (rev 9129)
@@ -23,6 +23,8 @@
package org.jboss.portal.presentation.model.state.content;
/**
+ * The content of a window.
+ *
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
Modified:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/structural/StructuralStateManager.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/structural/StructuralStateManager.java 2007-11-27
16:28:30 UTC (rev 9128)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/model/state/structural/StructuralStateManager.java 2007-11-27
16:37:49 UTC (rev 9129)
@@ -22,9 +22,9 @@
******************************************************************************/
package org.jboss.portal.presentation.model.state.structural;
-import org.jboss.portal.presentation.model.state.structural.ObjectState;
-
/**
+ * The structural state manager.
+ *
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
Modified:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/test/model/ModelTestCase.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/test/model/ModelTestCase.java 2007-11-27
16:28:30 UTC (rev 9128)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/test/model/ModelTestCase.java 2007-11-27
16:37:49 UTC (rev 9129)
@@ -194,45 +194,45 @@
//
UIPortal foo = (UIPortal)context.getObject(mockFoo.getId());
- assertEquals("foo_value", foo.getProperty(StateScopeType.PERSISTENT,
"foo_name", String.class));
- assertEquals("foo_value", foo.getProperty(StateScopeType.PERSISTENT,
"foo_name", Object.class));
- assertEquals("foo_value", foo.getProperty(StateScopeType.PERSISTENT,
"foo_name"));
- assertEquals(null, foo.getProperty(StateScopeType.PERSISTENT, "foo_name",
Float.class));
+ assertEquals("foo_value", foo.getProperty(StateScopeType.STRUCTURAL,
"foo_name", String.class));
+ assertEquals("foo_value", foo.getProperty(StateScopeType.STRUCTURAL,
"foo_name", Object.class));
+ assertEquals("foo_value", foo.getProperty(StateScopeType.STRUCTURAL,
"foo_name"));
+ assertEquals(null, foo.getProperty(StateScopeType.STRUCTURAL, "foo_name",
Float.class));
assertEquals(null, foo.getProperty(StateScopeType.NAVIGATIONAL,
"foo_name", Object.class));
assertEquals(null, foo.getProperty(StateScopeType.NAVIGATIONAL,
"foo_name"));
assertEquals(null, foo.getProperty(StateScopeType.NAVIGATIONAL,
"foo_name", Float.class));
- assertEquals(null, foo.getProperty(StateScopeType.TRANSIENT, "foo_name",
Object.class));
- assertEquals(null, foo.getProperty(StateScopeType.TRANSIENT,
"foo_name"));
- assertEquals(null, foo.getProperty(StateScopeType.TRANSIENT, "foo_name",
Float.class));
+ assertEquals(null, foo.getProperty(StateScopeType.CONTENT, "foo_name",
Object.class));
+ assertEquals(null, foo.getProperty(StateScopeType.CONTENT, "foo_name"));
+ assertEquals(null, foo.getProperty(StateScopeType.CONTENT, "foo_name",
Float.class));
//
foo.setProperty(StateScopeType.NAVIGATIONAL, "foo_name", 0);
- assertEquals("foo_value", foo.getProperty(StateScopeType.PERSISTENT,
"foo_name", String.class));
- assertEquals("foo_value", foo.getProperty(StateScopeType.PERSISTENT,
"foo_name", Object.class));
- assertEquals("foo_value", foo.getProperty(StateScopeType.PERSISTENT,
"foo_name"));
- assertEquals(null, foo.getProperty(StateScopeType.PERSISTENT, "foo_name",
Float.class));
+ assertEquals("foo_value", foo.getProperty(StateScopeType.STRUCTURAL,
"foo_name", String.class));
+ assertEquals("foo_value", foo.getProperty(StateScopeType.STRUCTURAL,
"foo_name", Object.class));
+ assertEquals("foo_value", foo.getProperty(StateScopeType.STRUCTURAL,
"foo_name"));
+ assertEquals(null, foo.getProperty(StateScopeType.STRUCTURAL, "foo_name",
Float.class));
assertEquals(0, foo.getProperty(StateScopeType.NAVIGATIONAL, "foo_name",
Object.class));
assertEquals(new Integer(0), foo.getProperty(StateScopeType.NAVIGATIONAL,
"foo_name", Integer.class));
assertEquals(0, foo.getProperty(StateScopeType.NAVIGATIONAL,
"foo_name"));
assertEquals(null, foo.getProperty(StateScopeType.NAVIGATIONAL,
"foo_name", Float.class));
- assertEquals(null, foo.getProperty(StateScopeType.TRANSIENT, "foo_name",
Object.class));
- assertEquals(null, foo.getProperty(StateScopeType.TRANSIENT,
"foo_name"));
- assertEquals(null, foo.getProperty(StateScopeType.TRANSIENT, "foo_name",
Float.class));
+ assertEquals(null, foo.getProperty(StateScopeType.CONTENT, "foo_name",
Object.class));
+ assertEquals(null, foo.getProperty(StateScopeType.CONTENT, "foo_name"));
+ assertEquals(null, foo.getProperty(StateScopeType.CONTENT, "foo_name",
Float.class));
//
- foo.setProperty(StateScopeType.TRANSIENT, "foo_name", true);
- assertEquals("foo_value", foo.getProperty(StateScopeType.PERSISTENT,
"foo_name", String.class));
- assertEquals("foo_value", foo.getProperty(StateScopeType.PERSISTENT,
"foo_name", Object.class));
- assertEquals("foo_value", foo.getProperty(StateScopeType.PERSISTENT,
"foo_name"));
- assertEquals(null, foo.getProperty(StateScopeType.PERSISTENT, "foo_name",
Float.class));
+ foo.setProperty(StateScopeType.CONTENT, "foo_name", true);
+ assertEquals("foo_value", foo.getProperty(StateScopeType.STRUCTURAL,
"foo_name", String.class));
+ assertEquals("foo_value", foo.getProperty(StateScopeType.STRUCTURAL,
"foo_name", Object.class));
+ assertEquals("foo_value", foo.getProperty(StateScopeType.STRUCTURAL,
"foo_name"));
+ assertEquals(null, foo.getProperty(StateScopeType.STRUCTURAL, "foo_name",
Float.class));
assertEquals(0, foo.getProperty(StateScopeType.NAVIGATIONAL, "foo_name",
Object.class));
assertEquals(new Integer(0), foo.getProperty(StateScopeType.NAVIGATIONAL,
"foo_name", Integer.class));
assertEquals(0, foo.getProperty(StateScopeType.NAVIGATIONAL,
"foo_name"));
assertEquals(null, foo.getProperty(StateScopeType.NAVIGATIONAL,
"foo_name", Float.class));
- assertEquals(true, foo.getProperty(StateScopeType.TRANSIENT, "foo_name",
Object.class));
- assertEquals(true, foo.getProperty(StateScopeType.TRANSIENT,
"foo_name"));
- assertEquals(Boolean.TRUE, foo.getProperty(StateScopeType.TRANSIENT,
"foo_name", Boolean.class));
- assertEquals(null, foo.getProperty(StateScopeType.TRANSIENT, "foo_name",
Float.class));
+ assertEquals(true, foo.getProperty(StateScopeType.CONTENT, "foo_name",
Object.class));
+ assertEquals(true, foo.getProperty(StateScopeType.CONTENT, "foo_name"));
+ assertEquals(Boolean.TRUE, foo.getProperty(StateScopeType.CONTENT,
"foo_name", Boolean.class));
+ assertEquals(null, foo.getProperty(StateScopeType.CONTENT, "foo_name",
Float.class));
//
}