Author: julien(a)jboss.com
Date: 2008-03-09 12:58:43 -0400 (Sun, 09 Mar 2008)
New Revision: 10248
Removed:
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/EventPhaseSessionImpl.java
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/event/EventPhaseSession.java
modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/controller/EventControllerContextSupport.java
Modified:
modules/portlet/trunk/build/pom.xml
modules/portlet/trunk/controller/pom.xml
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/AbstractMetaDataTestCase.java
Log:
fix wrong parsing with jboss xb
Modified: modules/portlet/trunk/build/pom.xml
===================================================================
--- modules/portlet/trunk/build/pom.xml 2008-03-09 16:04:41 UTC (rev 10247)
+++ modules/portlet/trunk/build/pom.xml 2008-03-09 16:58:43 UTC (rev 10248)
@@ -33,8 +33,8 @@
<version.jboss-logging>2.0.3.GA</version.jboss-logging>
<version.jbossxb>2.0.0.CR5</version.jbossxb>
<version.jboss-remoting>2.2.1.GA</version.jboss-remoting>
- <version.jboss.portal.common>1.2.0.Beta2</version.jboss.portal.common>
- <version.jboss.portal.web>1.2.0.Beta2</version.jboss.portal.web>
+
<version.jboss.portal.common>1.2.0-SNAPSHOT</version.jboss.portal.common>
+ <version.jboss.portal.web>1.2.0-SNAPSHOT</version.jboss.portal.web>
<version.jboss.unit>1.2.0.Beta2</version.jboss.unit>
<version.log4j>1.2.14</version.log4j>
<version.apache.commons-logging>1.1.1</version.apache.commons-logging>
@@ -46,6 +46,7 @@
<version.sun-jaxb>2.1.4</version.sun-jaxb>
<version.portlet-api>2.0</version.portlet-api>
<version.ccpp-api>1.0</version.ccpp-api>
+ <version.xerces>2.7.1</version.xerces>
</properties>
<repositories>
@@ -138,12 +139,26 @@
<version>${version.apache-taglibs}</version>
</dependency>
-
<dependency>
<groupId>sun-jaxb</groupId>
<artifactId>jaxb-api</artifactId>
<version>${version.sun-jaxb}</version>
</dependency>
+ <dependency>
+ <groupId>apache-xerces</groupId>
+ <artifactId>resolver</artifactId>
+ <version>${version.xerces}</version>
+ </dependency>
+ <dependency>
+ <groupId>apache-xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ <version>${version.xerces}</version>
+ </dependency>
+ <dependency>
+ <groupId>apache-xerces</groupId>
+ <artifactId>xml-apis</artifactId>
+ <version>${version.xerces}</version>
+ </dependency>
<dependency>
<groupId>org.jboss.portal.common</groupId>
Modified: modules/portlet/trunk/controller/pom.xml
===================================================================
--- modules/portlet/trunk/controller/pom.xml 2008-03-09 16:04:41 UTC (rev 10247)
+++ modules/portlet/trunk/controller/pom.xml 2008-03-09 16:58:43 UTC (rev 10248)
@@ -37,6 +37,20 @@
</dependency>
<!--TEST SCOPE-->
+
+ <dependency>
+ <groupId>apache-xerces</groupId>
+ <artifactId>resolver</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>apache-xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>apache-xerces</groupId>
+ <artifactId>xml-apis</artifactId>
+ </dependency>
+
<!--
<dependency>
<groupId>org.jboss.portal.portlet</groupId>
Deleted:
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/EventPhaseSessionImpl.java
===================================================================
---
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/EventPhaseSessionImpl.java 2008-03-09
16:04:41 UTC (rev 10247)
+++
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/EventPhaseSessionImpl.java 2008-03-09
16:58:43 UTC (rev 10248)
@@ -1,111 +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.portlet.controller;
-
-import org.jboss.portal.portlet.controller.event.EventPhaseSession;
-import org.jboss.portal.portlet.controller.event.Event;
-import org.apache.log4j.Logger;
-
-import java.util.Iterator;
-import java.util.LinkedList;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-class EventPhaseSessionImpl implements EventPhaseSession
-{
-
- /** . */
- static final int READ_MODE = 0;
-
- /** . */
- static final int READ_WRITE_MODE = 1;
-
- /** . */
- static final int INTERRUPTED_MODE = 2;
-
- /** . */
- private final Logger log;
-
- /** . */
- LinkedList<EventProduction> producedEvents;
-
- /** . */
- LinkedList<Event> toConsumeEvents;
-
- /** . */
- int consumedEventSize;
-
- /** . */
- int producedEventSize;
-
- /** . */
- int mode;
-
- EventPhaseSessionImpl(Logger log)
- {
- this.log = log;
- this.producedEvents = new LinkedList<EventProduction>();
- this.toConsumeEvents = new LinkedList<Event>();
- this.consumedEventSize = 0;
- this.producedEventSize = 0;
- this.mode = READ_MODE;
- }
-
- public void queueEvent(Event event)
- {
- if (mode == INTERRUPTED_MODE)
- {
- throw new IllegalStateException("The event phase cannot queue events
because it is interruped");
- }
- if (mode == READ_MODE)
- {
- throw new IllegalStateException("The event phase cannot queue
events");
- }
- if (event == null)
- {
- throw new IllegalArgumentException("No null event accepted");
- }
-
- //
- log.trace("Queued event " + event + " in the session");
-
- //
- this.toConsumeEvents.addLast(event);
- }
-
- public void interrupt()
- {
- if (mode == READ_MODE)
- {
- throw new IllegalStateException("The event phase is not
interruptable");
- }
-
- //
- log.trace("Event delivery interruped");
-
- //
- this.mode = INTERRUPTED_MODE;
- }
-}
Deleted:
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/event/EventPhaseSession.java
===================================================================
---
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/event/EventPhaseSession.java 2008-03-09
16:04:41 UTC (rev 10247)
+++
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/event/EventPhaseSession.java 2008-03-09
16:58:43 UTC (rev 10248)
@@ -1,48 +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.portlet.controller.event;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public interface EventPhaseSession
-{
-
- /**
- * Queue an event for consumption. The queue is a FIFO queue.
- *
- * @param event an event
- * @throws IllegalArgumentException if the event is null
- * @throws IllegalStateException if an event cannot be published
- */
- void queueEvent(Event event) throws IllegalArgumentException, IllegalStateException;
-
- /**
- * Stop processing of all events and returns from the controller.
- *
- * @throws IllegalStateException if the session cannot be interrupted.
- */
- void interrupt() throws IllegalStateException;
-
-}
Deleted:
modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/controller/EventControllerContextSupport.java
===================================================================
---
modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/controller/EventControllerContextSupport.java 2008-03-09
16:04:41 UTC (rev 10247)
+++
modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/controller/EventControllerContextSupport.java 2008-03-09
16:58:43 UTC (rev 10248)
@@ -1,142 +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.portlet.controller;
-
-import org.jboss.portal.portlet.controller.event.EventControllerContext;
-import org.jboss.portal.portlet.controller.event.Event;
-import org.jboss.portal.portlet.controller.event.EventPhaseContext;
-import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
-
-import javax.xml.namespace.QName;
-import java.util.List;
-import java.util.Map;
-import java.util.ArrayList;
-import java.util.HashMap;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class EventControllerContextSupport implements EventControllerContext
-{
-
- /** . */
- private final Map<Point, List<Point>> wires = new HashMap<Point,
List<Point>>();
-
- public void eventProduced(EventPhaseContext context, Event sourceEvent, Event
producedEvent)
- {
- List<Point> dsts = wires.get(new Point(producedEvent.getName(),
producedEvent.getWindowId()));
-
- //
- if (dsts != null)
- {
- for (Point dst : dsts)
- {
- context.queueEvent(new Event(dst.name, producedEvent.getPayload(),
dst.windowId));
- }
- }
- }
-
- public void eventConsumed(EventPhaseContext context, Event consumedEvent,
PortletInvocationResponse consumerResponse)
- {
- }
-
- public void eventFailed(EventPhaseContext context, Event failedEvent, Throwable
throwable)
- {
- }
-
- public void eventDiscarded(EventPhaseContext context, Event discardedEvent, int
cause)
- {
- }
-
- public void createWire(QName srcName, String srcWindowId, QName dstName, String
dstWindowId)
- {
- Point src = new Point(srcName, srcWindowId);
-
- //
- List<Point> dsts = wires.get(src);
-
- //
- if (dsts == null)
- {
- dsts = new ArrayList<Point>();
- wires.put(src, dsts);
- }
-
- //
- Point dst = new Point(dstName, dstWindowId);
-
- if (dsts.contains(dst))
- {
- throw new IllegalStateException("Such a wire already exists");
- }
-
- //
- dsts.add(dst);
- }
-
- private static class Point
- {
-
- /** . */
- final QName name;
-
- /** . */
- final String windowId;
-
- private Point(QName name, String windowId)
- {
- if (name == null)
- {
- throw new IllegalArgumentException();
- }
- if (windowId == null)
- {
- throw new IllegalArgumentException();
- }
-
- //
- this.name = name;
- this.windowId = windowId;
- }
-
- public boolean equals(Object obj)
- {
- if (obj == this)
- {
- return true;
- }
- if (obj instanceof Point)
- {
- Point that = (Point)obj;
- return name.equals(that.name) && windowId.equals(that.windowId);
- }
- return false;
- }
-
- public int hashCode()
- {
- return name.hashCode() + windowId.hashCode();
- }
- }
-}
Modified:
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/AbstractMetaDataTestCase.java
===================================================================
---
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/AbstractMetaDataTestCase.java 2008-03-09
16:04:41 UTC (rev 10247)
+++
modules/portlet/trunk/mc/src/test/java/org/jboss/portal/portlet/mc/metadata/AbstractMetaDataTestCase.java 2008-03-09
16:58:43 UTC (rev 10248)
@@ -43,6 +43,7 @@
import org.jboss.xb.binding.sunday.unmarshalling.SingletonSchemaResolverFactory;
import org.xml.sax.SAXException;
import static org.jboss.unit.api.Assert.*;
+import org.jboss.util.xml.JBossEntityResolver;
/**
* @author <a href="mailto:emuckenh@redhat.com">Emanuel
Muckenhuber</a>
@@ -83,8 +84,12 @@
resolver = (DefaultSchemaResolver) factory.getSchemaBindingResolver();
/** SchemaResolver */
- resolver.addSchemaLocation(PORTLET_JSR_168_NS,
"portlet-app_1_0.xsd");
- resolver.addSchemaLocation(PORTLET_JSR_286_NS,
"portlet-app_2_0.xsd");
+ // The two following lines are not effective, we need for now to register xsd
globally
+// resolver.addSchemaLocation(PORTLET_JSR_168_NS,
"portlet-app_1_0.xsd");
+// resolver.addSchemaLocation(PORTLET_JSR_286_NS,
"portlet-app_2_0.xsd");
+ JBossEntityResolver.registerEntity(PORTLET_JSR_168_NS,
"metadata/portlet-app_1_0.xsd");
+ JBossEntityResolver.registerEntity(PORTLET_JSR_286_NS,
"metadata/portlet-app_2_0.xsd");
+
resolver.addClassBinding(PORTLET_JSR_286_NS,
AnnotationPortletApplication20MetaData.class);
resolver.addClassBinding(PORTLET_JSR_168_NS,
AnnotationPortletApplication10MetaData.class);
}