Author: julien(a)jboss.com
Date: 2008-05-30 09:44:38 -0400 (Fri, 30 May 2008)
New Revision: 10861
Added:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/UINodeFactory.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/UINodeImpl.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIPaneImpl.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/UINode.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/Constants.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/DefaultLayout.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/Layout.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/LayoutFactory.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/Orientation.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/RegionLayout.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/SimpleLayout.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ui/UIPane.java
Removed:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/tree/UINodeFactory.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/tree/UINodeImpl.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/tree/UINode.java
Modified:
modules/presentation/trunk/classic/src/main/artifacts/presentation-war/WEB-INF/page-structure.xml
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/ClassicPresentationClient.java
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/model/ClassicUINode.java
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/PortletPresentationServer.java
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/controller/PresentationPortletControllerContext.java
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/PresentationInstanceContext.java
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/PresentationWindowContext.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIObjectImpl.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIPageImpl.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/structural/NodeImporter.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/structural/StructuralNode.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/structural/StructuralStateImpl.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ui/UIPage.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/state/structural/StructuralState.java
modules/presentation/trunk/presentation/src/main/resources/org/jboss/portal/presentation/impl/state/structural/page_structure_1_0.xsd
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/AbstractModelTestCase.java
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/state/structural/MockObject.java
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/state/structural/MockObjectImpl.java
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/state/structural/StructuralStateImpl.java
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/state/structural/StructuralStateContextTestCase.java
Log:
adding early support for layout
Modified:
modules/presentation/trunk/classic/src/main/artifacts/presentation-war/WEB-INF/page-structure.xml
===================================================================
---
modules/presentation/trunk/classic/src/main/artifacts/presentation-war/WEB-INF/page-structure.xml 2008-05-30
12:06:26 UTC (rev 10860)
+++
modules/presentation/trunk/classic/src/main/artifacts/presentation-war/WEB-INF/page-structure.xml 2008-05-30
13:44:38 UTC (rev 10861)
@@ -2,39 +2,14 @@
<context-def
xmlns="urn:jboss:portal:presentation:page:1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
<page-def name="default">
- <window-def name="windowA">
- <properties>
- <property>
- <name>portlet-ref</name>
- <value>/classic-presentation.Catalog</value>
- </property>
- </properties>
- <content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis
pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing
nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin
viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce
et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum,
libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac
urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id
mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante.
Aenean molestie ipsum in nisi.</content>
- </window-def>
- <window-def name="windowB">
- <properties>
- <property>
- <name>portlet-ref</name>
- <value>/classic-presentation.Cart</value>
- </property>
- </properties>
- <content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis
pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing
nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin
viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce
et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum,
libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac
urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id
mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante.
Aenean molestie ipsum in nisi.</content>
- </window-def>
- <page-def name="child-page-default-1">
+ <simple-layout>
<window-def name="windowA">
- <content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis
pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing
nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin
viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce
et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum,
libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac
urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id
mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante.
Aenean molestie ipsum in nisi.</content>
- </window-def>
- <window-def name="windowB">
- <content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis
pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing
nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin
viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce
et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum,
libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac
urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id
mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante.
Aenean molestie ipsum in nisi.</content>
- </window-def>
- </page-def>
- <page-def name="child-page-default-2">
- <window-def name="windowA">
<properties>
<property>
<name>portlet-ref</name>
-
<value>/classic-presentation.PublicParameterPortlet1</value>
+ <value>/classic-presentation.Catalog</value>
</property>
</properties>
<content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis
pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing
nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin
viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce
et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum,
libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac
urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id
mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante.
Aenean molestie ipsum in nisi.</content>
@@ -43,37 +18,71 @@
<properties>
<property>
<name>portlet-ref</name>
-
<value>/classic-presentation.PublicParameterPortlet2</value>
+ <value>/classic-presentation.Cart</value>
</property>
</properties>
<content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis
pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing
nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin
viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce
et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum,
libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac
urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id
mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante.
Aenean molestie ipsum in nisi.</content>
</window-def>
+ </simple-layout>
+ <page-def name="child-page-default-1">
+ <simple-layout>
+ <window-def name="windowA">
+ <content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis
pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing
nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin
viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce
et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum,
libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac
urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id
mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante.
Aenean molestie ipsum in nisi.</content>
+ </window-def>
+ <window-def name="windowB">
+ <content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis
pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing
nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin
viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce
et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum,
libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac
urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id
mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante.
Aenean molestie ipsum in nisi.</content>
+ </window-def>
+ </simple-layout>
+ </page-def>
+ <page-def name="child-page-default-2">
+ <simple-layout>
+ <window-def name="windowA">
+ <properties>
+ <property>
+ <name>portlet-ref</name>
+
<value>/classic-presentation.PublicParameterPortlet1</value>
+ </property>
+ </properties>
+ <content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis
pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing
nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin
viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce
et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum,
libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac
urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id
mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante.
Aenean molestie ipsum in nisi.</content>
+ </window-def>
+ <window-def name="windowB">
+ <properties>
+ <property>
+ <name>portlet-ref</name>
+
<value>/classic-presentation.PublicParameterPortlet2</value>
+ </property>
+ </properties>
+ <content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis
pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing
nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin
viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce
et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum,
libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac
urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id
mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante.
Aenean molestie ipsum in nisi.</content>
+ </window-def>
+ <window-def name="windowC">
+ <properties>
+ <property>
+ <name>portlet-ref</name>
+
<value>/classic-presentation.PublicParameterPortlet3</value>
+ </property>
+ </properties>
+ <content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis
pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing
nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin
viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce
et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum,
libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac
urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id
mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante.
Aenean molestie ipsum in nisi.</content>
+ </window-def>
+ </simple-layout>
+ </page-def>
+ </page-def>
+ <page-def name="default-sibling-1">
+ <simple-layout>
+ <window-def name="windowA">
+ <content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis
pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing
nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin
viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce
et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum,
libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac
urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id
mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante.
Aenean molestie ipsum in nisi.</content>
+ </window-def>
+ <window-def name="windowB">
+ <content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis
pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing
nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin
viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce
et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum,
libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac
urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id
mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante.
Aenean molestie ipsum in nisi.</content>
+ </window-def>
<window-def name="windowC">
- <properties>
- <property>
- <name>portlet-ref</name>
-
<value>/classic-presentation.PublicParameterPortlet3</value>
- </property>
- </properties>
<content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis
pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing
nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin
viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce
et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum,
libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac
urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id
mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante.
Aenean molestie ipsum in nisi.</content>
</window-def>
- </page-def>
+ <window-def name="windowD">
+ <content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis
pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing
nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin
viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce
et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum,
libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac
urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id
mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante.
Aenean molestie ipsum in nisi.</content>
+ </window-def>
+ <window-def name="windowE">
+ <content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis
pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing
nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin
viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce
et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum,
libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac
urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id
mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante.
Aenean molestie ipsum in nisi.</content>
+ </window-def>
+ </simple-layout>
</page-def>
- <page-def name="default-sibling-1">
- <window-def name="windowA">
- <content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis
pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing
nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin
viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce
et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum,
libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac
urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id
mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante.
Aenean molestie ipsum in nisi.</content>
- </window-def>
- <window-def name="windowB">
- <content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis
pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing
nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin
viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce
et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum,
libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac
urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id
mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante.
Aenean molestie ipsum in nisi.</content>
- </window-def>
- <window-def name="windowC">
- <content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis
pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing
nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin
viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce
et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum,
libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac
urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id
mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante.
Aenean molestie ipsum in nisi.</content>
- </window-def>
- <window-def name="windowD">
- <content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis
pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing
nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin
viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce
et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum,
libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac
urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id
mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante.
Aenean molestie ipsum in nisi.</content>
- </window-def>
- <window-def name="windowE">
- <content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis
pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing
nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin
viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce
et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum,
libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac
urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id
mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante.
Aenean molestie ipsum in nisi.</content>
- </window-def>
- </page-def>
</context-def>
Modified:
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/ClassicPresentationClient.java
===================================================================
---
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/ClassicPresentationClient.java 2008-05-30
12:06:26 UTC (rev 10860)
+++
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/ClassicPresentationClient.java 2008-05-30
13:44:38 UTC (rev 10861)
@@ -35,6 +35,9 @@
import org.jboss.portal.presentation.model.ui.UIObject;
import org.jboss.portal.presentation.model.ViewPort;
import org.jboss.portal.presentation.model.ViewPortScope;
+import org.jboss.portal.presentation.model.layout.LayoutFactory;
+import org.jboss.portal.presentation.model.layout.Layout;
+import org.jboss.portal.presentation.model.layout.SimpleLayout;
import org.jboss.portal.presentation.model.content.WindowContent;
import org.jboss.portal.presentation.model.ui.UIContext;
import org.jboss.portal.presentation.model.ui.UIPage;
@@ -55,6 +58,7 @@
import org.jboss.portal.web.WebResponse;
import org.jboss.portal.web.impl.DefaultServletContainerFactory;
import org.jboss.portal.common.servlet.URLFormat;
+import org.jboss.portal.common.NotYetImplemented;
import java.io.IOException;
import java.io.PrintWriter;
@@ -234,13 +238,26 @@
{
if (node.getChildren() != null)
{
- writer.print("<div>");
+ LayoutFactory layoutFactory = new LayoutFactory();
//
- renderChildren(node, writer);
+ Layout layout = layoutFactory.getLayout(node);
//
- writer.print("</div>");
+ if (layout instanceof SimpleLayout)
+ {
+ writer.print("<div>");
+
+ //
+ renderChildren(node, writer);
+
+ //
+ writer.print("</div>");
+ }
+ else
+ {
+ throw new NotYetImplemented();
+ }
}
else
{
Modified:
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/model/ClassicUINode.java
===================================================================
---
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/model/ClassicUINode.java 2008-05-30
12:06:26 UTC (rev 10860)
+++
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/model/ClassicUINode.java 2008-05-30
13:44:38 UTC (rev 10861)
@@ -23,6 +23,7 @@
package org.jboss.portal.presentation.classic.model;
import org.jboss.portal.presentation.model.ui.UIObject;
+import org.jboss.portal.presentation.model.UINode;
import java.util.Collection;
import java.util.Map;
@@ -31,7 +32,7 @@
* @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
* @version $Revision: 630 $
*/
-public class ClassicUINode
+public class ClassicUINode implements UINode
{
/** . */
@@ -68,7 +69,7 @@
return object;
}
- public Collection<ClassicUINode> getChildren()
+ public Collection getChildren()
{
return children == null ? null : children.values();
}
Modified:
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/PortletPresentationServer.java
===================================================================
---
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/PortletPresentationServer.java 2008-05-30
12:06:26 UTC (rev 10860)
+++
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/PortletPresentationServer.java 2008-05-30
13:44:38 UTC (rev 10861)
@@ -31,12 +31,12 @@
import org.jboss.portal.presentation.protocol.ProtocolAction;
import org.jboss.portal.presentation.protocol.ShowUIObjectResponse;
import org.jboss.portal.presentation.model.content.WindowContent;
-import org.jboss.portal.presentation.model.tree.UINode;
+import org.jboss.portal.presentation.model.UINode;
import org.jboss.portal.presentation.client.PresentationClient;
import org.jboss.portal.presentation.portlet.protocol.PortletContainerAction;
import
org.jboss.portal.presentation.portlet.controller.PresentationPortletPageNavigationalState;
import
org.jboss.portal.presentation.portlet.controller.PresentationPortletControllerContext;
-import org.jboss.portal.presentation.impl.model.tree.UINodeFactory;
+import org.jboss.portal.presentation.impl.model.UINodeFactory;
import org.jboss.portal.portlet.controller.request.ControllerRequest;
import org.jboss.portal.portlet.controller.request.PortletActionRequest;
import org.jboss.portal.portlet.controller.request.PortletRenderRequest;
Modified:
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/controller/PresentationPortletControllerContext.java
===================================================================
---
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/controller/PresentationPortletControllerContext.java 2008-05-30
12:06:26 UTC (rev 10860)
+++
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/controller/PresentationPortletControllerContext.java 2008-05-30
13:44:38 UTC (rev 10861)
@@ -26,6 +26,7 @@
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.PortletContext;
import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.NoSuchPortletException;
import org.jboss.portal.portlet.impl.spi.AbstractUserContext;
import org.jboss.portal.portlet.controller.PortletControllerContext;
import org.jboss.portal.portlet.controller.event.EventControllerContext;
@@ -47,7 +48,7 @@
import org.jboss.portal.presentation.portlet.spi.PresentationPortalContext;
import org.jboss.portal.presentation.portlet.spi.PresentationSecurityContext;
import org.jboss.portal.presentation.client.PresentationClient;
-import org.jboss.portal.presentation.model.tree.UINode;
+import org.jboss.portal.presentation.model.UINode;
import org.jboss.portal.presentation.model.ui.UIObject;
import org.jboss.portal.presentation.model.ui.UIWindow;
import org.jboss.portal.presentation.state.StateType;
@@ -190,6 +191,12 @@
//
Portlet portlet = portlets.get(ctx.getWindowId());
+ if (portlet == null)
+ {
+ throw new NoSuchPortletException(ctx.getWindowId());
+ }
+
+ //
portletInvocation.setTarget(portlet.getContext());
//
Modified:
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/PresentationInstanceContext.java
===================================================================
---
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/PresentationInstanceContext.java 2008-05-30
12:06:26 UTC (rev 10860)
+++
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/PresentationInstanceContext.java 2008-05-30
13:44:38 UTC (rev 10861)
@@ -25,7 +25,7 @@
import org.jboss.portal.portlet.StateEvent;
import org.jboss.portal.portlet.spi.InstanceContext;
import org.jboss.portal.portlet.state.AccessMode;
-import org.jboss.portal.presentation.model.tree.UINode;
+import org.jboss.portal.presentation.model.UINode;
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
Modified:
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/PresentationWindowContext.java
===================================================================
---
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/PresentationWindowContext.java 2008-05-30
12:06:26 UTC (rev 10860)
+++
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/PresentationWindowContext.java 2008-05-30
13:44:38 UTC (rev 10861)
@@ -23,7 +23,7 @@
package org.jboss.portal.presentation.portlet.spi;
import org.jboss.portal.portlet.spi.WindowContext;
-import org.jboss.portal.presentation.model.tree.UINode;
+import org.jboss.portal.presentation.model.UINode;
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
Copied:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/UINodeFactory.java
(from rev 10724,
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/tree/UINodeFactory.java)
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/UINodeFactory.java
(rev 0)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/UINodeFactory.java 2008-05-30
13:44:38 UTC (rev 10861)
@@ -0,0 +1,63 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software 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 software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.presentation.impl.model;
+
+import org.jboss.portal.presentation.model.UINode;
+import org.jboss.portal.presentation.state.structural.StructuralStateContext;
+import org.jboss.portal.presentation.state.structural.StructuralObject;
+import org.jboss.portal.presentation.state.navigational.NavigationalStateContext;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class UINodeFactory
+{
+
+ /**
+ * Creates a user interface node.
+ *
+ * @param navigationalStateContext the navigational state context
+ * @param structuralStateContext the structural state context
+ * @param objectId the object id
+ * @return the corresponding node
+ */
+ public static UINode createNode(
+ NavigationalStateContext navigationalStateContext,
+ StructuralStateContext structuralStateContext,
+ String objectId)
+ {
+ StructuralObject object = structuralStateContext.load(objectId);
+
+ //
+ if (object != null)
+ {
+ return new UINodeImpl(navigationalStateContext, structuralStateContext,
object);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+}
Copied:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/UINodeImpl.java
(from rev 10724,
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/tree/UINodeImpl.java)
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/UINodeImpl.java
(rev 0)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/UINodeImpl.java 2008-05-30
13:44:38 UTC (rev 10861)
@@ -0,0 +1,164 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software 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 software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.presentation.impl.model;
+
+import org.jboss.portal.presentation.model.UINode;
+import org.jboss.portal.presentation.model.ui.UIObject;
+import org.jboss.portal.presentation.state.structural.StructuralObject;
+import org.jboss.portal.presentation.state.structural.StructuralStateContext;
+import org.jboss.portal.presentation.state.navigational.NavigationalStateContext;
+import org.jboss.portal.presentation.impl.model.ui.UIObjectContext;
+import org.jboss.portal.presentation.impl.model.ui.UIObjectImpl;
+
+import java.util.Collection;
+import java.util.ArrayList;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+class UINodeImpl implements UINode, UIObjectContext
+{
+
+ /** . */
+ private final NavigationalStateContext navigationalStateContext;
+
+ /** . */
+ private final StructuralStateContext structuralStateContext;
+
+ /** . */
+ private final StructuralObject structuralObject;
+
+ /** . */
+ private Collection<UINode> children;
+
+ /** . */
+ private UINode parent;
+
+ /** . */
+ private boolean parentVisited;
+
+ /** . */
+ private UIObject object;
+
+ UINodeImpl(NavigationalStateContext navigationalStateContext, StructuralStateContext
structuralStateContext, StructuralObject structuralObject)
+ {
+ this.navigationalStateContext = navigationalStateContext;
+ this.structuralStateContext = structuralStateContext;
+ this.structuralObject = structuralObject;
+ this.children = null;
+ this.parentVisited = false;
+ }
+
+ private UINodeImpl(NavigationalStateContext navigationalStateContext,
StructuralStateContext structuralStateContext, StructuralObject structuralObject,
Collection<UINode> children)
+ {
+ this.navigationalStateContext = navigationalStateContext;
+ this.structuralStateContext = structuralStateContext;
+ this.structuralObject = structuralObject;
+ this.children = children;
+ this.parentVisited = true;
+ }
+
+ public UIObject getObject()
+ {
+ if (object == null)
+ {
+ object = UIObjectImpl.create(structuralObject, this);
+ }
+
+ //
+ return object;
+ }
+
+ public UINode getParent()
+ {
+ if (!parentVisited)
+ {
+ StructuralObject parentObject =
structuralStateContext.loadParent(structuralObject);
+
+ //
+ if (parentObject != null)
+ {
+ Collection<StructuralObject> siblingObjects =
structuralStateContext.loadChildren(parentObject);
+ ArrayList<UINode> siblings = new
ArrayList<UINode>(siblingObjects.size());
+ for (StructuralObject siblingObject : siblingObjects)
+ {
+ UINodeImpl sibling;
+ if (siblingObject.getId().equals(structuralObject.getId()))
+ {
+ sibling = this;
+ }
+ else
+ {
+ sibling = new UINodeImpl(navigationalStateContext,
structuralStateContext, siblingObject);
+ sibling.parent = this;
+ sibling.parentVisited = true;
+ }
+
+ //
+ siblings.add(sibling);
+ }
+
+ //
+ parent = new UINodeImpl(navigationalStateContext, structuralStateContext,
parentObject, siblings);
+ }
+
+ //
+ parentVisited = true;
+ }
+
+ //
+ return parent;
+ }
+
+ public Collection<UINode> getChildren()
+ {
+ if (children == null)
+ {
+ Collection<StructuralObject> childrenObject =
structuralStateContext.loadChildren(structuralObject);
+ ArrayList<UINode> children = new
ArrayList<UINode>(childrenObject.size());
+ for (StructuralObject childObject : childrenObject)
+ {
+ UINodeImpl child = new UINodeImpl(navigationalStateContext,
structuralStateContext, childObject);
+ child.parent = this;
+ child.parentVisited = true;
+
+ //
+ children.add(child);
+ }
+
+ //
+ this.children = children;
+ }
+
+ //
+ return children;
+ }
+
+ // UIObjectContext implementation
***********************************************************************************
+
+ public NavigationalStateContext getNavigationalStateContext()
+ {
+ return navigationalStateContext;
+ }
+}
Deleted:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/tree/UINodeFactory.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/tree/UINodeFactory.java 2008-05-30
12:06:26 UTC (rev 10860)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/tree/UINodeFactory.java 2008-05-30
13:44:38 UTC (rev 10861)
@@ -1,63 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software 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 software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.presentation.impl.model.tree;
-
-import org.jboss.portal.presentation.model.tree.UINode;
-import org.jboss.portal.presentation.state.structural.StructuralStateContext;
-import org.jboss.portal.presentation.state.structural.StructuralObject;
-import org.jboss.portal.presentation.state.navigational.NavigationalStateContext;
-
-/**
- * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
- * @version $Revision: 630 $
- */
-public class UINodeFactory
-{
-
- /**
- * Creates a user interface node.
- *
- * @param navigationalStateContext the navigational state context
- * @param structuralStateContext the structural state context
- * @param objectId the object id
- * @return the corresponding node
- */
- public static UINode createNode(
- NavigationalStateContext navigationalStateContext,
- StructuralStateContext structuralStateContext,
- String objectId)
- {
- StructuralObject object = structuralStateContext.load(objectId);
-
- //
- if (object != null)
- {
- return new UINodeImpl(navigationalStateContext, structuralStateContext,
object);
- }
- else
- {
- return null;
- }
- }
-
-}
Deleted:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/tree/UINodeImpl.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/tree/UINodeImpl.java 2008-05-30
12:06:26 UTC (rev 10860)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/tree/UINodeImpl.java 2008-05-30
13:44:38 UTC (rev 10861)
@@ -1,164 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software 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 software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.presentation.impl.model.tree;
-
-import org.jboss.portal.presentation.model.tree.UINode;
-import org.jboss.portal.presentation.model.ui.UIObject;
-import org.jboss.portal.presentation.state.structural.StructuralObject;
-import org.jboss.portal.presentation.state.structural.StructuralStateContext;
-import org.jboss.portal.presentation.state.navigational.NavigationalStateContext;
-import org.jboss.portal.presentation.impl.model.ui.UIObjectContext;
-import org.jboss.portal.presentation.impl.model.ui.UIObjectImpl;
-
-import java.util.Collection;
-import java.util.ArrayList;
-
-/**
- * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
- * @version $Revision: 630 $
- */
-class UINodeImpl implements UINode, UIObjectContext
-{
-
- /** . */
- private final NavigationalStateContext navigationalStateContext;
-
- /** . */
- private final StructuralStateContext structuralStateContext;
-
- /** . */
- private final StructuralObject structuralObject;
-
- /** . */
- private Collection<UINode> children;
-
- /** . */
- private UINode parent;
-
- /** . */
- private boolean parentVisited;
-
- /** . */
- private UIObject object;
-
- UINodeImpl(NavigationalStateContext navigationalStateContext, StructuralStateContext
structuralStateContext, StructuralObject structuralObject)
- {
- this.navigationalStateContext = navigationalStateContext;
- this.structuralStateContext = structuralStateContext;
- this.structuralObject = structuralObject;
- this.children = null;
- this.parentVisited = false;
- }
-
- private UINodeImpl(NavigationalStateContext navigationalStateContext,
StructuralStateContext structuralStateContext, StructuralObject structuralObject,
Collection<UINode> children)
- {
- this.navigationalStateContext = navigationalStateContext;
- this.structuralStateContext = structuralStateContext;
- this.structuralObject = structuralObject;
- this.children = children;
- this.parentVisited = true;
- }
-
- public UIObject getObject()
- {
- if (object == null)
- {
- object = UIObjectImpl.create(structuralObject, this);
- }
-
- //
- return object;
- }
-
- public UINode getParent()
- {
- if (!parentVisited)
- {
- StructuralObject parentObject =
structuralStateContext.loadParent(structuralObject);
-
- //
- if (parentObject != null)
- {
- Collection<StructuralObject> siblingObjects =
structuralStateContext.loadChildren(parentObject);
- ArrayList<UINode> siblings = new
ArrayList<UINode>(siblingObjects.size());
- for (StructuralObject siblingObject : siblingObjects)
- {
- UINodeImpl sibling;
- if (siblingObject.getId().equals(structuralObject.getId()))
- {
- sibling = this;
- }
- else
- {
- sibling = new UINodeImpl(navigationalStateContext,
structuralStateContext, siblingObject);
- sibling.parent = this;
- sibling.parentVisited = true;
- }
-
- //
- siblings.add(sibling);
- }
-
- //
- parent = new UINodeImpl(navigationalStateContext, structuralStateContext,
parentObject, siblings);
- }
-
- //
- parentVisited = true;
- }
-
- //
- return parent;
- }
-
- public Collection<UINode> getChildren()
- {
- if (children == null)
- {
- Collection<StructuralObject> childrenObject =
structuralStateContext.loadChildren(structuralObject);
- ArrayList<UINode> children = new
ArrayList<UINode>(childrenObject.size());
- for (StructuralObject childObject : childrenObject)
- {
- UINodeImpl child = new UINodeImpl(navigationalStateContext,
structuralStateContext, childObject);
- child.parent = this;
- child.parentVisited = true;
-
- //
- children.add(child);
- }
-
- //
- this.children = children;
- }
-
- //
- return children;
- }
-
- // UIObjectContext implementation
***********************************************************************************
-
- public NavigationalStateContext getNavigationalStateContext()
- {
- return navigationalStateContext;
- }
-}
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIObjectImpl.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIObjectImpl.java 2008-05-30
12:06:26 UTC (rev 10860)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIObjectImpl.java 2008-05-30
13:44:38 UTC (rev 10861)
@@ -28,6 +28,7 @@
import org.jboss.portal.presentation.model.ui.UIContext;
import org.jboss.portal.presentation.model.ui.UIPage;
import org.jboss.portal.presentation.model.ui.UIWindow;
+import org.jboss.portal.presentation.model.ui.UIPane;
import org.jboss.portal.presentation.state.StateException;
import org.jboss.portal.presentation.state.StateType;
import org.jboss.portal.presentation.state.structural.StructuralObject;
@@ -65,6 +66,10 @@
{
object = new UIPageImpl(structuralObject, objectContext);
}
+ else if (type == UIPane.class)
+ {
+ object = new UIPaneImpl(structuralObject, objectContext);
+ }
else if (type == UIContext.class)
{
object = new UIContextImpl(structuralObject, objectContext);
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIPageImpl.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIPageImpl.java 2008-05-30
12:06:26 UTC (rev 10860)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIPageImpl.java 2008-05-30
13:44:38 UTC (rev 10861)
@@ -29,7 +29,7 @@
* @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
* @version $Revision: 630 $
*/
-public class UIPageImpl extends UIObjectImpl implements UIPage
+public class UIPageImpl extends UIPaneImpl implements UIPage
{
public UIPageImpl(
StructuralObject structuralObject,
Added:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIPaneImpl.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIPaneImpl.java
(rev 0)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIPaneImpl.java 2008-05-30
13:44:38 UTC (rev 10861)
@@ -0,0 +1,39 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software 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 software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.presentation.impl.model.ui;
+
+import org.jboss.portal.presentation.model.ui.UIPane;
+import org.jboss.portal.presentation.state.structural.StructuralObject;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class UIPaneImpl extends UIObjectImpl implements UIPane
+{
+
+ public UIPaneImpl(StructuralObject structuralObject, UIObjectContext context)
+ {
+ super(structuralObject, context);
+ }
+}
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/structural/NodeImporter.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/structural/NodeImporter.java 2008-05-30
12:06:26 UTC (rev 10860)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/structural/NodeImporter.java 2008-05-30
13:44:38 UTC (rev 10861)
@@ -24,7 +24,9 @@
import org.jboss.portal.common.io.IOTools;
import org.jboss.portal.common.xml.XMLTools;
+import org.jboss.portal.common.NotYetImplemented;
import static org.jboss.portal.common.xml.XMLTools.*;
+import org.jboss.portal.presentation.model.layout.Constants;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.xml.sax.SAXException;
@@ -37,6 +39,7 @@
import javax.xml.validation.SchemaFactory;
import java.io.IOException;
import java.io.InputStream;
+import java.io.Serializable;
import java.net.URL;
/**
@@ -119,11 +122,6 @@
}
}
- private void importProperties()
- {
-
- }
-
private void importContextDef(Element contextDefElt)
{
// Children pages
@@ -143,16 +141,42 @@
importPageDef(pageNode, childElt);
}
- // Windows
- for (Element childElt : getChildren(pageDefElt, "window-def"))
+ //
+ Element layoutElt = getUniqueChild(pageDefElt, "simple-layout", false);
+
+ //
+ if (layoutElt != null)
{
- importWindowDef(pageNode, childElt);
+ importLayout(pageNode, layoutElt);
}
//
return pageNode;
}
+ private void importLayout(StructuralNode paneNode, Element layoutElt)
+ {
+ if ("simple-layout".equals(layoutElt.getNodeName()))
+ {
+ paneNode.setProperty(Constants.LAYOUT_ID, Constants.SIMPLE_LAYOUT);
+ paneNode.setProperty(Constants.SIMPLE_LAYOUT_ORIENTATION,
Constants.VERTICAL_ORIENTATION);
+
+ //
+ int index = 0;
+ for (Element childElt : getChildren(layoutElt, "window-def"))
+ {
+ WindowNode windowNode = importWindowDef(paneNode, childElt);
+
+ //
+ windowNode.setProperty(Constants.SIMPLE_LAYOUT_INDEX, index++);
+ }
+ }
+ else
+ {
+ throw new NotYetImplemented();
+ }
+ }
+
private WindowNode importWindowDef(StructuralNode parentNode, Element windowDefElt)
{
WindowNode windowNode = createStructuralNode(parentNode, WindowNode.class,
windowDefElt);
@@ -188,8 +212,23 @@
//
Element valueElt = XMLTools.getUniqueChild(propertyElt, "value",
true);
- String propertyValue = XMLTools.asString(valueElt);
+ String litteralPropertyValue = XMLTools.asString(valueElt);
+ Serializable propertyValue;
+ String propertyType = valueElt.getAttribute("type");
+ if (propertyType == null || "string".equals(propertyType))
+ {
+ propertyValue = litteralPropertyValue;
+ }
+ else if ("int".equals(propertyType))
+ {
+ propertyValue = Integer.parseInt(litteralPropertyValue);
+ }
+ else
+ {
+ throw new AssertionError();
+ }
+
//
node.setProperty(propertyName, propertyValue);
}
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/structural/StructuralNode.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/structural/StructuralNode.java 2008-05-30
12:06:26 UTC (rev 10860)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/structural/StructuralNode.java 2008-05-30
13:44:38 UTC (rev 10861)
@@ -35,6 +35,7 @@
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
+import java.io.Serializable;
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
@@ -65,14 +66,14 @@
private boolean valid;
/** . */
- private final Map<String, String> properties;
+ private final Map<String, Serializable> properties;
protected StructuralNode(String name, StructuralStateContextImpl
structuralStateContext)
{
this.name = name;
this.id = structuralStateContext.nextId();
this.structuralStateContext = structuralStateContext;
- this.properties = new HashMap<String, String>();
+ this.properties = new HashMap<String, Serializable>();
this.valid = true;
}
@@ -120,7 +121,7 @@
StructuralStateImpl state = new StructuralStateImpl(
getType(),
name,
- Collections.unmodifiableMap(new HashMap<String, String>(properties)));
+ Collections.unmodifiableMap(new HashMap<String,
Serializable>(properties)));
//
Set<String> childrenIds = new HashSet<String>();
@@ -209,7 +210,7 @@
return Collections.unmodifiableSet(properties.keySet());
}
- public String getProperty(String propertyName)
+ public Serializable getProperty(String propertyName)
{
if (propertyName == null)
{
@@ -223,7 +224,7 @@
}
}
- public void setProperty(String propertyName, String propertyValue)
+ public void setProperty(String propertyName, Serializable propertyValue)
{
if (propertyName == null)
{
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/structural/StructuralStateImpl.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/structural/StructuralStateImpl.java 2008-05-30
12:06:26 UTC (rev 10860)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/structural/StructuralStateImpl.java 2008-05-30
13:44:38 UTC (rev 10861)
@@ -26,6 +26,7 @@
import org.jboss.portal.presentation.state.structural.StructuralState;
import java.util.Map;
+import java.io.Serializable;
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
@@ -41,12 +42,12 @@
private final String name;
/** . */
- private final Map<String, String> properties;
+ private final Map<String, Serializable> properties;
public StructuralStateImpl(
Class<? extends UIObject> type,
String name,
- Map<String, String> properties)
+ Map<String, Serializable> properties)
{
this.type = type;
this.name = name;
@@ -63,7 +64,7 @@
return name;
}
- public Map<String, String> getProperties()
+ public Map<String, Serializable> getProperties()
{
return properties;
}
Copied:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/UINode.java
(from rev 10727,
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/tree/UINode.java)
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/UINode.java
(rev 0)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/UINode.java 2008-05-30
13:44:38 UTC (rev 10861)
@@ -0,0 +1,60 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software 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 software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.presentation.model;
+
+import org.jboss.portal.presentation.model.ui.UIObject;
+
+import java.util.Collection;
+
+/**
+ * The node interface provides a pull style api for interacting with an ui object.
+ *
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public interface UINode
+{
+
+ /**
+ * Returns the related ui object.
+ *
+ * @return the ui object
+ */
+ UIObject getObject();
+
+ /**
+ * Returns the parent node or null if it cannot be loaded (because it is the root or
+ * because the viewport scope does not go beyond)
+ *
+ * @return the parent node
+ */
+ UINode getParent();
+
+ /**
+ * Returns a collection of children nodes or null if the node children cannot be
loaded.
+ *
+ * @return the children
+ */
+ Collection<UINode> getChildren();
+
+}
Added:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/Constants.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/Constants.java
(rev 0)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/Constants.java 2008-05-30
13:44:38 UTC (rev 10861)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software 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 software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.presentation.model.layout;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class Constants
+{
+
+ /** . */
+ public static final String LAYOUT_ID =
"org.jboss.portal.presentation.layout_id";
+
+ /** . */
+ public static final String SIMPLE_LAYOUT_ORIENTATION =
"org.jboss.portal.presentation.layout.simple.orientation";
+
+ /** . */
+ public static final String SIMPLE_LAYOUT_INDEX =
"org.jboss.portal.presentation.layout.simple.index";
+
+ /** . */
+ public static final String VERTICAL_ORIENTATION = "vertical";
+
+ /** . */
+ public static final String HORIZONTAL_ORIENTATION = "horizontal";
+
+ /** . */
+ public static final String SIMPLE_LAYOUT = "simple_layout";
+
+ /** . */
+ public static final String REGION_LAYOUT = "region_layout";
+
+ /** . */
+ public static final String REGION_LAYOUT_NAME =
"org.jboss.portal.presentation.layout.region.name";
+
+ /** . */
+ public static final String REGION_LAYOUT_INDEX =
"org.jboss.portal.presentation.layout.region.index";
+}
Added:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/DefaultLayout.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/DefaultLayout.java
(rev 0)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/DefaultLayout.java 2008-05-30
13:44:38 UTC (rev 10861)
@@ -0,0 +1,31 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software 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 software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.presentation.model.layout;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class DefaultLayout implements Layout
+{
+}
Added:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/Layout.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/Layout.java
(rev 0)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/Layout.java 2008-05-30
13:44:38 UTC (rev 10861)
@@ -0,0 +1,31 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software 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 software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.presentation.model.layout;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public interface Layout
+{
+}
Added:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/LayoutFactory.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/LayoutFactory.java
(rev 0)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/LayoutFactory.java 2008-05-30
13:44:38 UTC (rev 10861)
@@ -0,0 +1,135 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software 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 software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.presentation.model.layout;
+
+import org.jboss.portal.presentation.model.ui.UIPane;
+import org.jboss.portal.presentation.model.ui.UIObject;
+import org.jboss.portal.presentation.model.UINode;
+import org.jboss.portal.presentation.state.StateType;
+
+import org.jboss.portal.common.NotYetImplemented;
+import org.jboss.portal.common.util.SetMap;
+
+import java.util.Collection;
+import java.util.TreeMap;
+import java.util.Comparator;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class LayoutFactory
+{
+
+ public Layout getLayout(UINode node)
+ {
+ UIPane pane = (UIPane)node.getObject();
+
+ //
+ String layoutId = pane.getProperty(StateType.STRUCTURAL, Constants.LAYOUT_ID,
String.class);
+
+ //
+ if (Constants.SIMPLE_LAYOUT.equals(layoutId))
+ {
+ String orientationValue = pane.getProperty(StateType.STRUCTURAL,
Constants.SIMPLE_LAYOUT_ORIENTATION, String.class);
+
+ //
+ Orientation orientation = Orientation.HORIZONTAL;
+
+ //
+ if (Constants.VERTICAL_ORIENTATION.equals(orientationValue))
+ {
+ orientation = Orientation.VERTICAL;
+ }
+
+ //
+ Collection<? extends UINode> chidrenNodes = node.getChildren();
+
+ //
+ if (chidrenNodes == null)
+ {
+ throw new IllegalStateException("No children found for the simple layout
" + pane.getId());
+ }
+
+ //
+ TreeMap<Integer, UINode> layoutNodes = new TreeMap<Integer,
UINode>();
+ for (UINode childNode : chidrenNodes)
+ {
+ UIObject child = childNode.getObject();
+
+ //
+ Integer index = child.getProperty(StateType.STRUCTURAL,
Constants.SIMPLE_LAYOUT_INDEX, Integer.class);
+
+ //
+ if (index != null)
+ {
+ layoutNodes.put(index, childNode);
+ }
+ }
+
+ //
+ return new SimpleLayout(orientation, layoutNodes.values());
+ }
+ else if (Constants.REGION_LAYOUT.equals(layoutId))
+ {
+ Collection<? extends UINode> chidrenNodes = node.getChildren();
+
+ //
+ SetMap<String, UINode> map = new SetMap<String,
UINode>(comparator);
+ for (UINode childNode : chidrenNodes)
+ {
+ UIObject child = childNode.getObject();
+
+ //
+ String regionName = child.getProperty(StateType.STRUCTURAL,
Constants.REGION_LAYOUT_NAME, String.class);
+ Integer regionIndex = child.getProperty(StateType.STRUCTURAL,
Constants.REGION_LAYOUT_INDEX, Integer.class);
+
+ //
+ if (regionName != null && regionIndex != null)
+ {
+ map.put(regionName, childNode);
+ }
+ }
+
+ //
+ return new RegionLayout(map);
+ }
+ else
+ {
+ throw new NotYetImplemented();
+ }
+ }
+
+ /** . */
+ private static final Comparator<UINode> comparator = new
Comparator<UINode>()
+ {
+ public int compare(UINode node1, UINode node2)
+ {
+ UIObject object1 = node1.getObject();
+ UIObject object2 = node2.getObject();
+ Integer index1 = object1.getProperty(StateType.STRUCTURAL,
Constants.REGION_LAYOUT_INDEX, Integer.class);
+ Integer index2 = object2.getProperty(StateType.STRUCTURAL,
Constants.REGION_LAYOUT_INDEX, Integer.class);
+ return index1.compareTo(index2);
+ }
+ };
+}
Added:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/Orientation.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/Orientation.java
(rev 0)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/Orientation.java 2008-05-30
13:44:38 UTC (rev 10861)
@@ -0,0 +1,34 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software 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 software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.presentation.model.layout;
+
+/**
+ * An orientation.
+ *
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public enum Orientation
+{
+ VERTICAL, HORIZONTAL
+}
Added:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/RegionLayout.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/RegionLayout.java
(rev 0)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/RegionLayout.java 2008-05-30
13:44:38 UTC (rev 10861)
@@ -0,0 +1,56 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software 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 software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.presentation.model.layout;
+
+import org.jboss.portal.presentation.model.UINode;
+
+import org.jboss.portal.common.util.CollectionMap;
+
+import java.util.Set;
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class RegionLayout implements Layout
+{
+
+ /** . */
+ private final CollectionMap<String, UINode> map;
+
+ RegionLayout(CollectionMap<String, UINode> map)
+ {
+ this.map = map;
+ }
+
+ public Set<String> getRegionNames()
+ {
+ return map.keySet();
+ }
+
+ public Collection<? extends UINode> getNodes(String regionName)
+ {
+ return map.get(regionName);
+ }
+}
Added:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/SimpleLayout.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/SimpleLayout.java
(rev 0)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/layout/SimpleLayout.java 2008-05-30
13:44:38 UTC (rev 10861)
@@ -0,0 +1,57 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software 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 software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.presentation.model.layout;
+
+import org.jboss.portal.presentation.model.UINode;
+
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class SimpleLayout implements Layout
+{
+
+ /** . */
+ private final Orientation orientation;
+
+ /** . */
+ private final Collection<? extends UINode> nodes;
+
+ SimpleLayout(Orientation orientation, Collection<? extends UINode> nodes)
+ {
+ this.orientation = orientation;
+ this.nodes = nodes;
+ }
+
+ public Orientation getOrientation()
+ {
+ return orientation;
+ }
+
+ public Collection<? extends UINode> getNodes()
+ {
+ return nodes;
+ }
+}
Deleted:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/tree/UINode.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/tree/UINode.java 2008-05-30
12:06:26 UTC (rev 10860)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/tree/UINode.java 2008-05-30
13:44:38 UTC (rev 10861)
@@ -1,59 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software 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 software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.presentation.model.tree;
-
-import org.jboss.portal.presentation.model.ui.UIObject;
-
-import java.util.Collection;
-
-/**
- * The node interface provides a pull style api for interacting with the structural
context.
- *
- * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
- * @version $Revision: 630 $
- */
-public interface UINode
-{
-
- /**
- * Returns the related ui object.
- *
- * @return the ui object
- */
- UIObject getObject();
-
- /**
- * Returns the parent node or null if it does not exist.
- *
- * @return the parent node
- */
- UINode getParent();
-
- /**
- * Returns a collection of children nodes.
- *
- * @return the children
- */
- Collection<UINode> getChildren();
-
-}
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ui/UIPage.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ui/UIPage.java 2008-05-30
12:06:26 UTC (rev 10860)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ui/UIPage.java 2008-05-30
13:44:38 UTC (rev 10861)
@@ -26,6 +26,6 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public interface UIPage extends UIObject
+public interface UIPage extends UIPane
{
}
\ No newline at end of file
Added:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ui/UIPane.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ui/UIPane.java
(rev 0)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/ui/UIPane.java 2008-05-30
13:44:38 UTC (rev 10861)
@@ -0,0 +1,31 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software 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 software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.presentation.model.ui;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public interface UIPane extends UIObject
+{
+}
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/state/structural/StructuralState.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/state/structural/StructuralState.java 2008-05-30
12:06:26 UTC (rev 10860)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/state/structural/StructuralState.java 2008-05-30
13:44:38 UTC (rev 10861)
@@ -25,6 +25,7 @@
import org.jboss.portal.presentation.model.ui.UIObject;
import java.util.Map;
+import java.io.Serializable;
/**
* The structural state.
@@ -39,5 +40,5 @@
String getName();
- Map<String, String> getProperties();
+ Map<String, Serializable> getProperties();
}
\ No newline at end of file
Modified:
modules/presentation/trunk/presentation/src/main/resources/org/jboss/portal/presentation/impl/state/structural/page_structure_1_0.xsd
===================================================================
---
modules/presentation/trunk/presentation/src/main/resources/org/jboss/portal/presentation/impl/state/structural/page_structure_1_0.xsd 2008-05-30
12:06:26 UTC (rev 10860)
+++
modules/presentation/trunk/presentation/src/main/resources/org/jboss/portal/presentation/impl/state/structural/page_structure_1_0.xsd 2008-05-30
13:44:38 UTC (rev 10861)
@@ -7,10 +7,7 @@
attributeFormDefault="unqualified"
version="1.0">
- <xsd:element
- name="context-def"
- type="contextDefType">
- <xsd:annotation><xsd:documentation>A jboss-unit is the top container
element.</xsd:documentation></xsd:annotation>
+ <xsd:element name="context-def" type="contextDefType">
</xsd:element>
<xsd:complexType name="nodeDefType">
@@ -34,10 +31,31 @@
</xsd:complexType>
<xsd:complexType name="nodePropertyType">
- <xsd:attribute name="name" type="xsd:string"
use="required"/>
- <xsd:attribute name="value" type="xsd:string"
use="required"/>
+ <xsd:sequence>
+ <xsd:element name="name" type="xsd:string"
minOccurs="1" maxOccurs="1"/>
+ <xsd:element name="value" type="propertyValueType"
minOccurs="1" maxOccurs="1"/>
+ </xsd:sequence>
</xsd:complexType>
+ <xsd:complexType name="propertyValueType">
+ <xsd:simpleContent>
+ <xsd:extension base="xsd:string">
+ <xsd:attribute name="type" use="optional"
default="string">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="string"/>
+ <xsd:enumeration value="int"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:attribute>
+ </xsd:extension>
+ </xsd:simpleContent>
+ </xsd:complexType>
+
+ <xsd:simpleType name="contentType" >
+ <xsd:restriction base="xsd:string"/>
+ </xsd:simpleType>
+
<xsd:complexType name="contextDefType">
<xsd:complexContent>
<xsd:extension base="nodeDefType">
@@ -53,10 +71,15 @@
<xsd:complexType name="pageDefType">
<xsd:complexContent>
<xsd:extension base="namedNodeDefType">
- <xsd:choice minOccurs="0" maxOccurs="unbounded">
- <xsd:element name="page-def"
type="pageDefType"/>
- <xsd:element name="window-def"
type="windowDefType"/>
- </xsd:choice>
+ <xsd:sequence>
+ <xsd:choice minOccurs="1" maxOccurs="1">
+ <xsd:element name="simple-layout"
type="simpleLayoutType"/>
+ <xsd:element name="region-layout"
type="regionLayoutType"/>
+ </xsd:choice>
+ <xsd:choice minOccurs="0"
maxOccurs="unbounded">
+ <xsd:element name="page-def"
type="pageDefType"/>
+ </xsd:choice>
+ </xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
@@ -71,8 +94,31 @@
</xsd:complexContent>
</xsd:complexType>
- <xsd:simpleType name="contentType" >
- <xsd:restriction base="xsd:string"/>
- </xsd:simpleType>
+ <xsd:complexType name="simpleLayoutType">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="window-def" type="windowDefType"/>
+ </xsd:choice>
+ <xsd:attribute name="orientation" use="optional"
default="vertical">
+ <xsd:simpleType>
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="vertical"/>
+ <xsd:enumeration value="horizontal"/>
+ </xsd:restriction>
+ </xsd:simpleType>
+ </xsd:attribute>
+ </xsd:complexType>
+ <xsd:complexType name="regionLayoutType">
+ <xsd:sequence>
+ <xsd:element name="region" type="regionType"
minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="regionType">
+ <xsd:choice minOccurs="0" maxOccurs="unbounded">
+ <xsd:element name="window-def" type="windowDefType"/>
+ </xsd:choice>
+ <xsd:attribute name="orientation" use="required"
type="xsd:string"/>
+ </xsd:complexType>
+
</xsd:schema>
Modified:
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/AbstractModelTestCase.java
===================================================================
---
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/AbstractModelTestCase.java 2008-05-30
12:06:26 UTC (rev 10860)
+++
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/AbstractModelTestCase.java 2008-05-30
13:44:38 UTC (rev 10861)
@@ -39,6 +39,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.io.Serializable;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -80,7 +81,7 @@
protected abstract void setProperty(MockObject object, String propertyName, String
propertyValue);
- protected abstract String getProperty(MockObject object, String name);
+ protected abstract Serializable getProperty(MockObject object, String name);
protected final StructuralObject getStructuralObject(MockObject object)
{
Modified:
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/state/structural/MockObject.java
===================================================================
---
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/state/structural/MockObject.java 2008-05-30
12:06:26 UTC (rev 10860)
+++
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/state/structural/MockObject.java 2008-05-30
13:44:38 UTC (rev 10861)
@@ -28,6 +28,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.io.Serializable;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -81,13 +82,13 @@
int getVersion();
- String getPropertyValue(String propertyName) throws IllegalArgumentException;
+ Serializable getPropertyValue(String propertyName) throws IllegalArgumentException;
void setPropertyBehavior(String propertyName, UpdateBehavior propertyBehavior) throws
IllegalArgumentException;
UpdateBehavior getPropertyBehavior(String propertyName) throws
IllegalArgumentException;
- void setPropertyValue(String propertyName, String propertyValue) throws
MockException;
+ void setPropertyValue(String propertyName, Serializable propertyValue) throws
MockException;
Set<String> getPropertyNames();
Modified:
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/state/structural/MockObjectImpl.java
===================================================================
---
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/state/structural/MockObjectImpl.java 2008-05-30
12:06:26 UTC (rev 10860)
+++
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/state/structural/MockObjectImpl.java 2008-05-30
13:44:38 UTC (rev 10861)
@@ -31,6 +31,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.io.Serializable;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -49,7 +50,7 @@
private final String name;
/** . */
- private final Map<String, String> propertyValues;
+ private final Map<String, Serializable> propertyValues;
/** . */
private final Map<String, UpdateBehavior> propertyBehaviors;
@@ -75,7 +76,7 @@
this.name = name;
this.type = type;
this.children = new LinkedHashMap<String, MockObjectImpl>();
- this.propertyValues = new HashMap<String, String>();
+ this.propertyValues = new HashMap<String, Serializable>();
this.propertyBehaviors = new HashMap<String, UpdateBehavior>();
this.valid = true;
this.handle = new StructuralObjectHandle(id, 0);
@@ -101,7 +102,7 @@
return handle.id;
}
- public String getPropertyValue(String propertyName)
+ public Serializable getPropertyValue(String propertyName)
{
if (name == null)
{
@@ -216,7 +217,7 @@
return propertyBehaviors.get(propertyName);
}
- public void setPropertyValue(String propertyName, String propertyValue) throws
MockException
+ public void setPropertyValue(String propertyName, Serializable propertyValue) throws
MockException
{
if (!valid)
{
@@ -256,7 +257,7 @@
}
//
- StructuralStateImpl state = new StructuralStateImpl(type, name, new
HashMap<String, String>(propertyValues));
+ StructuralStateImpl state = new StructuralStateImpl(type, name, new
HashMap<String, Serializable>(propertyValues));
//
return new StructuralObjectImpl(handle, parentHandle, childrenHandles, state);
Modified:
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/state/structural/StructuralStateImpl.java
===================================================================
---
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/state/structural/StructuralStateImpl.java 2008-05-30
12:06:26 UTC (rev 10860)
+++
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/model/state/structural/StructuralStateImpl.java 2008-05-30
13:44:38 UTC (rev 10861)
@@ -26,6 +26,7 @@
import org.jboss.portal.presentation.state.structural.StructuralState;
import java.util.Map;
+import java.io.Serializable;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -41,9 +42,9 @@
private final String name;
/** . */
- private final Map<String, String> properties;
+ private final Map<String, Serializable> properties;
- public StructuralStateImpl(Class<? extends UIObject> type, String name,
Map<String, String> properties)
+ public StructuralStateImpl(Class<? extends UIObject> type, String name,
Map<String, Serializable> properties)
{
this.type = type;
this.name = name;
@@ -60,7 +61,7 @@
return name;
}
- public Map<String, String> getProperties()
+ public Map<String, Serializable> getProperties()
{
return properties;
}
Modified:
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/state/structural/StructuralStateContextTestCase.java
===================================================================
---
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/state/structural/StructuralStateContextTestCase.java 2008-05-30
12:06:26 UTC (rev 10860)
+++
modules/presentation/trunk/presentation/src/test/java/org/jboss/portal/presentation/test/state/structural/StructuralStateContextTestCase.java 2008-05-30
13:44:38 UTC (rev 10861)
@@ -37,6 +37,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
+import java.io.Serializable;
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
@@ -124,7 +125,7 @@
structuralNode.setProperty(propertyName, propertyValue);
}
- protected String getProperty(StructuralNode structuralNode, String name)
+ protected Serializable getProperty(StructuralNode structuralNode, String name)
{
return structuralNode.getProperty(name);
}