Author: julien_viet
Date: 2010-09-20 18:39:18 -0400 (Mon, 20 Sep 2010)
New Revision: 4261
Modified:
portal/branches/navcontroller/component/web/controller/pom.xml
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/metadata/DescriptorBuilder.java
portal/branches/navcontroller/packaging/module/src/main/javascript/portal.packaging.module.js
Log:
remove staxmate experiment for now and rely only on stax provided in JDK
Modified: portal/branches/navcontroller/component/web/controller/pom.xml
===================================================================
--- portal/branches/navcontroller/component/web/controller/pom.xml 2010-09-20 18:34:59 UTC
(rev 4260)
+++ portal/branches/navcontroller/component/web/controller/pom.xml 2010-09-20 22:39:18 UTC
(rev 4261)
@@ -40,10 +40,5 @@
<groupId>org.exoplatform.portal</groupId>
<artifactId>exo.portal.component.web.resources</artifactId>
</dependency>
- <dependency>
- <groupId>org.codehaus.staxmate</groupId>
- <artifactId>staxmate</artifactId>
- <version>2.0.0</version>
- </dependency>
</dependencies>
</project>
Modified:
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/metadata/DescriptorBuilder.java
===================================================================
---
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/metadata/DescriptorBuilder.java 2010-09-20
18:34:59 UTC (rev 4260)
+++
portal/branches/navcontroller/component/web/controller/src/main/java/org/exoplatform/web/controller/metadata/DescriptorBuilder.java 2010-09-20
22:39:18 UTC (rev 4261)
@@ -19,12 +19,10 @@
package org.exoplatform.web.controller.metadata;
-import org.codehaus.staxmate.SMInputFactory;
-import org.codehaus.staxmate.in.SMHierarchicCursor;
-import org.codehaus.staxmate.in.SMInputCursor;
import org.exoplatform.web.controller.QualifiedName;
import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamConstants;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
import java.util.List;
@@ -47,48 +45,69 @@
public RouterDescriptor build(XMLStreamReader reader) throws Exception
{
+ System.out.println("reader = " + reader);
+ System.out.println("reader = " + reader.getClass().getName());
RouterDescriptor routerDesc = new RouterDescriptor();
- SMHierarchicCursor routerC = SMInputFactory.rootElementCursor(reader);
- routerC.getNext();
//
- SMInputCursor routeC = routerC.childElementCursor(routeQN);
- while (routeC.getNext() != null)
+ while (true)
{
- build(routeC, routerDesc.getRoutes());
+ int event = reader.next();
+ if (event == XMLStreamConstants.END_DOCUMENT)
+ {
+ reader.close();
+ break;
+ }
+ else if (event == XMLStreamConstants.START_ELEMENT)
+ {
+ if (routeQN.equals(reader.getName()))
+ {
+ build(reader, routerDesc.getRoutes());
+ }
+ }
}
//
return routerDesc;
}
- private void build(SMInputCursor routeC, List<RouteDescriptor> descriptors)
throws XMLStreamException
+ private void build(XMLStreamReader reader, List<RouteDescriptor> descriptors)
throws XMLStreamException
{
- String path = routeC.getAttrValue("path");
+ String path = reader.getAttributeValue(null, "path");
RouteDescriptor routeDesc = new RouteDescriptor(path);
//
- SMInputCursor childC = routeC.childElementCursor();
- while (childC.getNext() != null)
+ while (true)
{
- if (childC.getQName().equals(paramQN))
+ int event = reader.next();
+ if (event == XMLStreamConstants.END_ELEMENT)
{
- String name = childC.getAttrValue("name");
- String value = childC.getAttrValue("value");
- routeDesc.addParam(QualifiedName.parse(name), value);
+ if (routeQN.equals(reader.getName()))
+ {
+ break;
+ }
}
- else if (childC.getQName().equals(requestParamQN))
+ else if (event == XMLStreamConstants.START_ELEMENT)
{
- String name = childC.getAttrValue("name");
- String matchName = childC.getAttrValue("matchName");
- String matchValue = childC.getAttrValue("matchValue");
- String optional = childC.getAttrValue("required");
- routeDesc.addRequestParam(QualifiedName.parse(name), matchName, matchValue,
"true".equals(optional));
+ if (paramQN.equals(reader.getName()))
+ {
+ String name = reader.getAttributeValue(null, "name");
+ String value = reader.getAttributeValue(null, "value");
+ routeDesc.addParam(QualifiedName.parse(name), value);
+ }
+ else if (requestParamQN.equals(reader.getName()))
+ {
+ String name = reader.getAttributeValue(null, "name");
+ String matchName = reader.getAttributeValue(null, "matchName");
+ String matchValue = reader.getAttributeValue(null,
"matchValue");
+ String optional = reader.getAttributeValue(null, "required");
+ routeDesc.addRequestParam(QualifiedName.parse(name), matchName,
matchValue, "true".equals(optional));
+ }
+ else if (routeQN.equals(reader.getName()))
+ {
+ build(reader, routeDesc.getChildren());
+ }
}
- else if (childC.getQName().equals(routeQN))
- {
- build(childC, routeDesc.getChildren());
- }
}
//
Modified:
portal/branches/navcontroller/packaging/module/src/main/javascript/portal.packaging.module.js
===================================================================
---
portal/branches/navcontroller/packaging/module/src/main/javascript/portal.packaging.module.js 2010-09-20
18:34:59 UTC (rev 4260)
+++
portal/branches/navcontroller/packaging/module/src/main/javascript/portal.packaging.module.js 2010-09-20
22:39:18 UTC (rev 4261)
@@ -100,8 +100,6 @@
module.component.web = {}
module.component.web.controller =
new Project("org.exoplatform.portal",
"exo.portal.component.web.controller", "jar", module.version).
- addDependency(new Project("org.codehaus.staxmate", "staxmate",
"jar", "2.0.0")).
- addDependency(new Project("org.codehaus.woodstox", "stax2-api",
"jar", "3.0.2")).
addDependency(module.component.common);
module.component.web.security =
Show replies by date