Author: julien(a)jboss.com
Date: 2008-04-07 05:06:32 -0400 (Mon, 07 Apr 2008)
New Revision: 10510
Added:
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/model/PageViewPortScope.java
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/protocol/
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/protocol/ActionDecoder.java
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/protocol/ActionEncoder.java
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/protocol/Constants.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/structural/NodeImporter.java
modules/presentation/trunk/presentation/src/main/resources/
modules/presentation/trunk/presentation/src/main/resources/org/
modules/presentation/trunk/presentation/src/main/resources/org/jboss/
modules/presentation/trunk/presentation/src/main/resources/org/jboss/portal/
modules/presentation/trunk/presentation/src/main/resources/org/jboss/portal/presentation/
modules/presentation/trunk/presentation/src/main/resources/org/jboss/portal/presentation/impl/
modules/presentation/trunk/presentation/src/main/resources/org/jboss/portal/presentation/impl/state/
modules/presentation/trunk/presentation/src/main/resources/org/jboss/portal/presentation/impl/state/stuctural/
modules/presentation/trunk/presentation/src/main/resources/org/jboss/portal/presentation/impl/state/stuctural/page_structure_1_0.xsd
Modified:
modules/presentation/trunk/classic/src/assemble/presentation-war.xml
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/PresentationServerImpl.java
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/ClassicPresentationServlet.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/structural/StructuralStateContextImpl.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/structural/WindowNode.java
Log:
created a node importer for creating page structure from an XML definition instead of
using a programmatic approach
Modified: modules/presentation/trunk/classic/src/assemble/presentation-war.xml
===================================================================
--- modules/presentation/trunk/classic/src/assemble/presentation-war.xml 2008-04-07
08:53:27 UTC (rev 10509)
+++ modules/presentation/trunk/classic/src/assemble/presentation-war.xml 2008-04-07
09:06:32 UTC (rev 10510)
@@ -25,6 +25,7 @@
<includes>
<include>org.jboss.portal.common:common-common</include>
<include>org.jboss.portal.common:common-portal</include>
+ <include>org.jboss.portal.web:web-web</include>
<include>org.jboss.portal.presentation:presentation-presentation</include>
</includes>
</dependencySet>
Added:
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
(rev 0)
+++
modules/presentation/trunk/classic/src/main/artifacts/presentation-war/WEB-INF/page-structure.xml 2008-04-07
09:06:32 UTC (rev 10510)
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<context-def
+ xmlns="urn:jboss:portal:presentation:page:1.0"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jboss:jboss-unit:1.0 page_structure_1_0.xsd"
+ >
+ <page-def name="default">
+ <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>
+ <page-def name="child-page-default-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>
+ </page-def>
+ <page-def name="child-page-default-2">
+ <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>
+ </page-def>
+ </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/PresentationServerImpl.java
===================================================================
---
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/PresentationServerImpl.java 2008-04-07
08:53:27 UTC (rev 10509)
+++
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/PresentationServerImpl.java 2008-04-07
09:06:32 UTC (rev 10510)
@@ -28,11 +28,14 @@
import org.jboss.portal.presentation.server2.PresentationRequest;
import org.jboss.portal.presentation.state.structural.StructuralStateContext;
import org.jboss.portal.presentation.protocol.ProtocolAction;
+import org.jboss.portal.presentation.protocol.ViewUIObjectAction;
+import org.jboss.portal.presentation.protocol.UIObjectAction;
+import org.jboss.portal.presentation.protocol.ErrorResponse;
+import org.jboss.portal.presentation.protocol.ShowUIObjectResponse;
import org.jboss.portal.presentation.model.content.WindowContent;
import org.jboss.portal.presentation.client2.PresentationClient;
import org.jboss.portal.presentation.impl.state.structural.StructuralStateContextImpl;
-import org.jboss.portal.presentation.impl.state.structural.ContextNode;
-import org.jboss.portal.presentation.impl.state.structural.PageNode;
+import org.jboss.portal.presentation.impl.state.structural.StructuralNode;
import org.jboss.portal.presentation.impl.state.structural.WindowNode;
/**
@@ -43,18 +46,11 @@
{
/** . */
- private StructuralStateContextImpl structuralStateContext = new
StructuralStateContextImpl();
+ private StructuralStateContextImpl structuralStateContext;
- public PresentationServerImpl()
+ public PresentationServerImpl(StructuralStateContextImpl structuralStateContext)
{
- ContextNode root = structuralStateContext.getRoot();
- PageNode defaultPage = root.addChild("default", PageNode.class);
- PageNode fooPage = root.addChild("foo", PageNode.class);
- PageNode barPage = root.addChild("bar", PageNode.class);
- defaultPage.addChild("foo", WindowNode.class);
- defaultPage.addChild("bar", WindowNode.class);
- defaultPage.addChild("juu", PageNode.class);
- defaultPage.addChild("daa", PageNode.class);
+ this.structuralStateContext = structuralStateContext;
}
public StructuralStateContext getStructuralStateContext()
@@ -69,11 +65,48 @@
public WindowContent renderWindow(PresentationClient client, String windowId) throws
PresentationServerException
{
- return new WindowContent(0, "Window " + windowId, "Some markup for
window " + windowId);
+ StructuralNode node = structuralStateContext.getNode(windowId);
+
+ //
+ if (node instanceof WindowNode)
+ {
+ WindowNode window = (WindowNode)node;
+ return new WindowContent(0, "Window " + window.getName(),
window.getContent());
+ }
+ else
+ {
+ throw new PresentationServerException("No such window " + windowId);
+ }
}
public PresentationResponse process(PresentationClient client, PresentationRequest
request) throws PresentationServerException
{
+ ProtocolAction action = request.getProtocolAction();
+
+ if (action instanceof UIObjectAction)
+ {
+ UIObjectAction objectAction = (UIObjectAction)action;
+
+ //
+ String targetId = objectAction.getTargetId();
+
+ //
+ StructuralNode targetNode = structuralStateContext.getNode(targetId);
+
+ //
+ if (targetNode == null)
+ {
+ return new PresentationResponse(new ErrorResponse(404));
+ }
+
+ //
+ if (objectAction instanceof ViewUIObjectAction)
+ {
+ return new PresentationResponse(new ShowUIObjectResponse(targetId));
+ }
+ }
+
+ //
throw new UnsupportedOperationException();
}
}
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-04-07
08:53:27 UTC (rev 10509)
+++
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/ClassicPresentationClient.java 2008-04-07
09:06:32 UTC (rev 10510)
@@ -28,19 +28,29 @@
import org.jboss.portal.presentation.classic.model.DefaultPageViewPortScope;
import org.jboss.portal.presentation.classic.model.ClassicViewPortContext;
import org.jboss.portal.presentation.classic.model.ClassicUINode;
+import org.jboss.portal.presentation.classic.model.PageViewPortScope;
+import org.jboss.portal.presentation.classic.protocol.ActionDecoder;
+import org.jboss.portal.presentation.classic.protocol.ActionEncoder;
import org.jboss.portal.presentation.server2.PresentationServer;
import org.jboss.portal.presentation.server2.PresentationServerException;
+import org.jboss.portal.presentation.server2.PresentationRequest;
+import org.jboss.portal.presentation.server2.PresentationResponse;
import org.jboss.portal.presentation.model2.UIModel;
import org.jboss.portal.presentation.model2.ViewPort;
import org.jboss.portal.presentation.model2.UIObject;
+import org.jboss.portal.presentation.model2.ViewPortScope;
import org.jboss.portal.presentation.model2.ui.UIContext;
import org.jboss.portal.presentation.model2.ui.UIPage;
import org.jboss.portal.presentation.model2.ui.UIWindow;
import org.jboss.portal.presentation.impl.model2.UIModelImpl;
import org.jboss.portal.presentation.model.content.WindowContent;
+import org.jboss.portal.presentation.protocol.ViewUIObjectAction;
+import org.jboss.portal.presentation.protocol.ProtocolAction;
+import org.jboss.portal.presentation.protocol.ProtocolResponse;
+import org.jboss.portal.presentation.protocol.ShowUIObjectResponse;
+import org.jboss.portal.web.WebRequest;
+import org.jboss.portal.web.WebResponse;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;
import java.io.IOException;
import java.util.Collection;
@@ -53,17 +63,23 @@
{
/** . */
- private final HttpServletRequest req;
+ private final WebRequest req;
/** . */
- private final HttpServletResponse resp;
+ private final WebResponse resp;
/** . */
private final PresentationServer server;
+ /** . */
+ private final ActionDecoder decoder = new ActionDecoder();
+
+ /** . */
+ private final ActionEncoder encoder = new ActionEncoder();
+
public ClassicPresentationClient(
- HttpServletRequest req,
- HttpServletResponse resp,
+ WebRequest req,
+ WebResponse resp,
PresentationServer server)
{
this.req = req;
@@ -76,42 +92,74 @@
return null;
}
- public void process() throws IOException
+ public void process() throws IOException, PresentationServerException
{
+ ProtocolAction action = decoder.decode(req);
- StructuralStateContext ssc = server.getStructuralStateContext();
+ PresentationResponse presentationResp = null;
- DefaultPageViewPortScope scope = new DefaultPageViewPortScope(ssc.getRootId());
+ if (action != null)
+ {
+ PresentationRequest request = new PresentationRequest(action);
+ presentationResp = server.process(this, request);
+ }
+
+ if (presentationResp != null)
+ {
+ ProtocolResponse protocolResp = presentationResp.getProtocolResponse();
+
+ //
+ if (protocolResp instanceof ShowUIObjectResponse)
+ {
+ ShowUIObjectResponse showObjectResp = (ShowUIObjectResponse)protocolResp;
+ PageViewPortScope scope = new
PageViewPortScope(showObjectResp.getTargetId());
+ renderDocument(scope, showObjectResp.getTargetId());
+ }
+ else
+ {
+ throw new UnsupportedOperationException("Not handled: " +
protocolResp);
+ }
+ }
+ else
+ {
+ StructuralStateContext ssc = server.getStructuralStateContext();
+ DefaultPageViewPortScope scope = new DefaultPageViewPortScope(ssc.getRootId());
+ renderDocument(scope, ssc.getRootId());
+ }
+ }
+
+ private void renderDocument(ViewPortScope scope, String nodeId) throws IOException
+ {
+ StructuralStateContext ssc = server.getStructuralStateContext();
ClassicViewPortContext context = new ClassicViewPortContext();
-
UIModel model = new UIModelImpl(null, ssc);
-
ViewPort viewPort = model.createViewPort(context, scope);
+ //
viewPort.refresh();
- ClassicUINode root = context.getNode(ssc.getRootId());
+ //
+ ClassicUINode node = context.getNode(nodeId);
+ //
resp.setContentType("text/html");
PrintWriter writer = resp.getWriter();
- render(root, writer);
+
+ //
+ writer.print("<html><body>");
+ renderNode(node, writer);
+ writer.print("</body></html>");
}
- private void render(ClassicUINode node, PrintWriter writer)
+ private void renderNode(ClassicUINode node, PrintWriter writer)
{
UIObject object = node.getObject();
//
if (object instanceof UIContext)
{
- writer.print("<html><body>");
-
- //
renderChildren(node, writer);
-
- //
- writer.print("</body></html>");
}
else if (object instanceof UIPage)
{
@@ -127,7 +175,11 @@
}
else
{
- writer.print("<div>Link to page : " + object.getId() +
"</div>");
+ ViewUIObjectAction viewPage = new ViewUIObjectAction(object.getId());
+
+ String url = encoder.encode(viewPage);
+
+ writer.print("<div>Link to page <a href=\"" +
req.getContextPath() + url + "\">" + object.getName() +
"</a></div>");
}
}
else if (object instanceof UIWindow)
@@ -138,6 +190,9 @@
//
writer.print("<div>");
+ writer.print("Window " + object.getName());
+ writer.print("</div>");
+ writer.print("<div>");
writer.print(content.getMarkup());
writer.print("</div>");
}
@@ -157,9 +212,8 @@
{
for (ClassicUINode child : children)
{
- render(child, writer);
+ renderNode(child, writer);
}
}
}
-
}
Modified:
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/ClassicPresentationServlet.java
===================================================================
---
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/ClassicPresentationServlet.java 2008-04-07
08:53:27 UTC (rev 10509)
+++
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/ClassicPresentationServlet.java 2008-04-07
09:06:32 UTC (rev 10510)
@@ -23,15 +23,23 @@
package org.jboss.portal.presentation.classic;
import org.jboss.portal.web.WebRequest;
+import org.jboss.portal.web.WebResponse;
import org.jboss.portal.presentation.server2.PresentationServer;
-import org.jboss.portal.presentation.client2.PresentationClient;
+import org.jboss.portal.presentation.server2.PresentationServerException;
import org.jboss.portal.presentation.PresentationServerImpl;
+import org.jboss.portal.presentation.impl.state.structural.ContextNode;
+import org.jboss.portal.presentation.impl.state.structural.NodeImporter;
+import org.jboss.portal.presentation.impl.state.structural.StructuralStateContextImpl;
+import org.jboss.portal.common.xml.XMLTools;
+import org.jboss.portal.common.io.IOTools;
+import org.w3c.dom.Document;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletException;
import java.io.IOException;
+import java.io.InputStream;
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
@@ -40,17 +48,51 @@
public class ClassicPresentationServlet extends HttpServlet
{
- private PresentationServer server = new PresentationServerImpl();
+ private PresentationServer server;
+ public void init() throws ServletException
+ {
+ Document doc;
+ InputStream in =
getServletContext().getResourceAsStream("/WEB-INF/page-structure.xml");
+ try
+ {
+ doc = XMLTools.getDocumentBuilderFactory().newDocumentBuilder().parse(in);
+ }
+ catch (Exception e)
+ {
+ throw new ServletException(e);
+ }
+ finally
+ {
+ IOTools.safeClose(in);
+ }
+ //
+ StructuralStateContextImpl structuralStateContext = new
StructuralStateContextImpl();
+
+ //
+ ContextNode root = structuralStateContext.getRoot();
+ new NodeImporter(root).importDocument(doc);
+
+ //
+ this.server = new PresentationServerImpl(structuralStateContext);
+ }
+
protected void service(HttpServletRequest req, HttpServletResponse resp) throws
ServletException, IOException
{
-// WebRequest webRequest = new WebRequest(req);
+ WebRequest webReq = new WebRequest(req);
+ WebResponse webResp = new WebResponse(resp);
- ClassicPresentationClient client = new ClassicPresentationClient(req, resp,
server);
+ ClassicPresentationClient client = new ClassicPresentationClient(webReq, webResp,
server);
- client.process();
-
+ try
+ {
+ client.process();
+ }
+ catch (PresentationServerException e)
+ {
+ throw new ServletException(e);
+ }
}
}
Added:
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/model/PageViewPortScope.java
===================================================================
---
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/model/PageViewPortScope.java
(rev 0)
+++
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/model/PageViewPortScope.java 2008-04-07
09:06:32 UTC (rev 10510)
@@ -0,0 +1,136 @@
+/******************************************************************************
+ * 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.classic.model;
+
+import org.jboss.portal.presentation.model2.ViewPortScope;
+import org.jboss.portal.presentation.model2.ObjectTraversalType;
+import org.jboss.portal.presentation.model2.UIObject;
+import org.jboss.portal.presentation.model2.ui.UIPage;
+import org.jboss.portal.presentation.model2.ui.UIWindow;
+import org.jboss.portal.presentation.model2.ui.UIContext;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PageViewPortScope implements ViewPortScope
+{
+
+ /** . */
+ private static final int NO_PAGE = 0;
+
+ /** . */
+ private static final int PAGE = 1;
+
+ /** . */
+ private static final int PAGE_CHILD = 2;
+
+ /** . */
+ private static final int PAGE_SIBLING = 3;
+
+ /** . */
+ private final String pageId;
+
+ /** . */
+ private int pageStatus;
+
+ public PageViewPortScope(String pageId)
+ {
+ this.pageId = pageId;
+ this.pageStatus = 0;
+ }
+
+ public String getRootId()
+ {
+ return pageId;
+ }
+
+ public ObjectTraversalType enterObject(UIObject object)
+ {
+ if (object instanceof UIPage)
+ {
+ switch (pageStatus)
+ {
+ case NO_PAGE:
+ if (pageId.equals(object.getId()))
+ {
+ pageStatus = PAGE;
+
+ // We want to traverse the children of the default page
+ return ObjectTraversalType.RECURSIVE;
+ }
+ else
+ {
+ pageStatus = PAGE_SIBLING;
+
+ // We want to see the sibbling pages of the default page
+ return ObjectTraversalType.SINGLE;
+ }
+ case PAGE:
+ pageStatus = PAGE_CHILD;
+
+ // We want to see the children pages of the default page
+ return ObjectTraversalType.SINGLE;
+ case PAGE_CHILD:
+ case PAGE_SIBLING:
+ return ObjectTraversalType.SKIP;
+ default:
+ throw new AssertionError();
+ }
+ }
+ else if (object instanceof UIWindow)
+ {
+ // We don't traverse windows (for now as they are supposed to be leaves)
+ return ObjectTraversalType.SINGLE;
+ }
+ else if (object instanceof UIContext)
+ {
+ return ObjectTraversalType.RECURSIVE;
+ }
+ else
+ {
+ return ObjectTraversalType.SKIP;
+ }
+ }
+
+ public void leaveObject(UIObject object)
+ {
+ if (object instanceof UIPage)
+ {
+ switch (pageStatus)
+ {
+ case NO_PAGE:
+ throw new AssertionError();
+ case PAGE:
+ pageStatus = NO_PAGE;
+ break;
+ case PAGE_SIBLING:
+ pageStatus = NO_PAGE;
+ break;
+ case PAGE_CHILD:
+ pageStatus = PAGE;
+ break;
+ }
+ }
+ }
+}
\ No newline at end of file
Added:
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/protocol/ActionDecoder.java
===================================================================
---
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/protocol/ActionDecoder.java
(rev 0)
+++
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/protocol/ActionDecoder.java 2008-04-07
09:06:32 UTC (rev 10510)
@@ -0,0 +1,65 @@
+/******************************************************************************
+ * 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.classic.protocol;
+
+import org.jboss.portal.presentation.protocol.ProtocolAction;
+import org.jboss.portal.presentation.protocol.ViewUIObjectAction;
+import org.jboss.portal.web.WebRequest;
+
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class ActionDecoder
+{
+
+ public ProtocolAction decode(WebRequest request)
+ {
+
+ ProtocolAction action = null;
+
+ Map<String, String[]> queryParams = request.getQueryParameterMap();
+
+ String[] actionValues = queryParams.get(Constants.ACTION_PARAM);
+
+ if (actionValues != null)
+ {
+ String actionValue = actionValues[0];
+
+ String[] targetIds = queryParams.get(Constants.TARGET_ID_PARAM);
+
+ if (targetIds != null)
+ {
+ String targetId = targetIds[0];
+
+ action = new ViewUIObjectAction(targetId);
+ }
+ }
+
+ //
+ return action;
+ }
+
+}
Added:
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/protocol/ActionEncoder.java
===================================================================
---
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/protocol/ActionEncoder.java
(rev 0)
+++
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/protocol/ActionEncoder.java 2008-04-07
09:06:32 UTC (rev 10510)
@@ -0,0 +1,48 @@
+/******************************************************************************
+ * 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.classic.protocol;
+
+import org.jboss.portal.presentation.protocol.ProtocolAction;
+import org.jboss.portal.presentation.protocol.ViewUIObjectAction;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class ActionEncoder
+{
+
+ public String encode(ProtocolAction action)
+ {
+ if (action instanceof ViewUIObjectAction)
+ {
+ ViewUIObjectAction viewObjectAction = (ViewUIObjectAction)action;
+
+ //
+ return "/index.html?action=" + Constants.VIEW_UI_OBJECT_ACTION +
"&id=" + viewObjectAction.getTargetId();
+ }
+
+ return null;
+ }
+
+}
Added:
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/protocol/Constants.java
===================================================================
---
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/protocol/Constants.java
(rev 0)
+++
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/protocol/Constants.java 2008-04-07
09:06:32 UTC (rev 10510)
@@ -0,0 +1,45 @@
+/******************************************************************************
+ * 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.classic.protocol;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+final class Constants
+{
+
+ /** . */
+ public static final String ACTION_PARAM = "action";
+
+ /** . */
+ public static final String TARGET_ID_PARAM = "id";
+
+ /** . */
+ public static final String VIEW_UI_OBJECT_ACTION = "view";
+
+ private Constants()
+ {
+ }
+
+}
Added:
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
(rev 0)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/structural/NodeImporter.java 2008-04-07
09:06:32 UTC (rev 10510)
@@ -0,0 +1,107 @@
+/******************************************************************************
+ * 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.state.structural;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import static org.jboss.portal.common.xml.XMLTools.*;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class NodeImporter
+{
+
+ /** The root to import the children to. */
+ private final StructuralNode root;
+
+ public NodeImporter(StructuralNode root)
+ {
+ this.root = root;
+ }
+
+ /**
+ * Imports the specified document.
+ *
+ * @param document the document
+ * @throws IllegalArgumentException if the document is null
+ */
+ public void importDocument(Document document) throws IllegalArgumentException
+ {
+ if (document == null)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ //
+ importContextDef(document.getDocumentElement());
+ }
+
+ private void importContextDef(Element contextDefElt)
+ {
+ // Children pages
+ for (Element childElt : getChildren(contextDefElt, "page-def"))
+ {
+ importPageDef(root, childElt);
+ }
+ }
+
+ private void importPageDef(StructuralNode parentNode, Element pageDefElt)
+ {
+ PageNode pageNode = createStructuralNode(parentNode, PageNode.class, pageDefElt);
+
+ // Sub pages
+ for (Element childElt : getChildren(pageDefElt, "page-def"))
+ {
+ importPageDef(pageNode, childElt);
+ }
+
+ // Windows
+ for (Element childElt : getChildren(pageDefElt, "window-def"))
+ {
+ importWindowDef(pageNode, childElt);
+ }
+ }
+
+ private void importWindowDef(StructuralNode parentNode, Element windowDefElt)
+ {
+ WindowNode windowNode = createStructuralNode(parentNode, WindowNode.class,
windowDefElt);
+
+ //
+ Element contentElt = getUniqueChild(windowDefElt, "content", true);
+
+ //
+ String content = asString(contentElt);
+ windowNode.setContent(content);
+ }
+
+ private <T extends StructuralNode> T createStructuralNode(StructuralNode parent,
Class<T> type, Element nodeDefElt)
+ {
+ String nodeName = nodeDefElt.getAttribute("name");
+
+ //
+ return parent.addChild(nodeName, type);
+ }
+}
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/structural/StructuralStateContextImpl.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/structural/StructuralStateContextImpl.java 2008-04-07
08:53:27 UTC (rev 10509)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/structural/StructuralStateContextImpl.java 2008-04-07
09:06:32 UTC (rev 10510)
@@ -61,6 +61,17 @@
return Long.toString(sequence.getAndIncrement());
}
+ public StructuralNode getNode(String nodeId)
+ {
+ if (nodeId == null)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ //
+ return nodes.get(nodeId);
+ }
+
public ContextNode getRoot()
{
return root;
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/structural/WindowNode.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/structural/WindowNode.java 2008-04-07
08:53:27 UTC (rev 10509)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/structural/WindowNode.java 2008-04-07
09:06:32 UTC (rev 10510)
@@ -31,6 +31,10 @@
*/
public class WindowNode extends StructuralNode
{
+
+ /** . */
+ private String content;
+
public WindowNode(String name, StructuralStateContextImpl structuralStateContext)
{
super(name, structuralStateContext);
@@ -40,4 +44,14 @@
{
return UIWindow.class;
}
+
+ public void setContent(String content)
+ {
+ this.content = content;
+ }
+
+ public String getContent()
+ {
+ return content;
+ }
}
Added:
modules/presentation/trunk/presentation/src/main/resources/org/jboss/portal/presentation/impl/state/stuctural/page_structure_1_0.xsd
===================================================================
---
modules/presentation/trunk/presentation/src/main/resources/org/jboss/portal/presentation/impl/state/stuctural/page_structure_1_0.xsd
(rev 0)
+++
modules/presentation/trunk/presentation/src/main/resources/org/jboss/portal/presentation/impl/state/stuctural/page_structure_1_0.xsd 2008-04-07
09:06:32 UTC (rev 10510)
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsd:schema
+ targetNamespace="urn:jboss:portal:presentation:page:1.0"
+ xmlns="urn:jboss:portal:presentation:page:1.0"
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified"
+ 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>
+
+ <xsd:complexType name="nodeDefType">
+ <xsd:sequence>
+ <xsd:element name="properties" type="nodePropertiesType"
minOccurs="0" maxOccurs="1"/>
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="namedNodeDefType">
+ <xsd:complexContent>
+ <xsd:extension base="nodeDefType">
+ <xsd:attribute name="name" type="xsd:string"
use="required"/>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+
+ <xsd:complexType name="nodePropertiesType">
+ <xsd:sequence>
+ <xsd:element name="property" type="nodePropertyType"
minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </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:complexType>
+
+ <xsd:complexType name="contextDefType">
+ <xsd:complexContent>
+ <xsd:extension base="nodeDefType">
+ <xsd:sequence>
+ <xsd:element name="page-def" type="pageDefType"
minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+
+ <xsd:complexType name="pageDefType">
+ <xsd:complexContent>
+ <xsd:extension base="namedNodeDefType">
+ <xsd:sequence>
+ <xsd:element name="page-def" type="pageDefType"
minOccurs="0" maxOccurs="unbounded"/>
+ <xsd:element name="window-def" type="windowDefType"
minOccurs="0" maxOccurs="unbounded"/>
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+
+ <xsd:complexType name="windowDefType">
+ <xsd:complexContent>
+ <xsd:extension base="namedNodeDefType">
+ <xsd:sequence>
+ <xsd:element name="content"
type="contentType"/>
+ </xsd:sequence>
+ </xsd:extension>
+ </xsd:complexContent>
+ </xsd:complexType>
+
+ <xsd:simpleType name="contentType" >
+ <xsd:restriction base="xsd:string"/>
+ </xsd:simpleType>
+
+</xsd:schema>