[portal-commits] JBoss Portal SVN: r9095 - in branches/JBoss_Portal_Branch_2_6/wsrp/src: main/org/jboss/portal/wsrp/producer/config/impl and 2 other directories.

portal-commits at lists.jboss.org portal-commits at lists.jboss.org
Mon Nov 26 00:10:48 EST 2007


Author: chris.laprun at jboss.com
Date: 2007-11-26 00:10:47 -0500 (Mon, 26 Nov 2007)
New Revision: 9095

Modified:
   branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationFactory.java
   branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerConfigurationServiceImpl.java
   branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/xsd/jboss-wsrp-producer_2_6.xsd
   branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/tests/test-producer-configuration-lib-jar/extended.xml
Log:
- Added support for old-style "xsd:string" type value.
- Corrected issue with fullServiceDescriptionRequiresRegistration not being declared on the proper element.
- Improvements to XSD.

Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationFactory.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationFactory.java	2007-11-26 05:03:15 UTC (rev 9094)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationFactory.java	2007-11-26 05:10:47 UTC (rev 9095)
@@ -49,6 +49,9 @@
    private static final boolean DEBUG = false;
    private boolean registrationDone = false;
 
+   // kept to support old-style type
+   private static final String LEGACY_XSD_STRING = "xsd:string";
+
    public Object newRoot(Object root, UnmarshallingContext nav, String nsURI, String localName, Attributes attrs)
    {
       if (DEBUG)
@@ -156,10 +159,15 @@
       else if ("type".equals(localName))
       {
          value = StringPropertyReplacer.replaceProperties(value);
-         QName type = nav.resolveQName(value);
-         if (!WSRPConstants.XSD_STRING.equals(type))
+
+         // first check that we still support type as "xsd:string"...
+         if (!LEGACY_XSD_STRING.equals(value))
          {
-            throw new IllegalArgumentException("'" + value + "' is not a supported type. Currently, only 'xsd:string' is supported.");
+            QName type = nav.resolveQName(value);
+            if (!WSRPConstants.XSD_STRING.equals(type))
+            {
+               throw new IllegalArgumentException("'" + value + "' is not a supported type. Currently, only 'xsd:string' is supported.");
+            }
          }
 
          desc.setType(WSRPConstants.XSD_STRING);

Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerConfigurationServiceImpl.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerConfigurationServiceImpl.java	2007-11-26 05:03:15 UTC (rev 9094)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerConfigurationServiceImpl.java	2007-11-26 05:10:47 UTC (rev 9095)
@@ -183,7 +183,7 @@
       marshaller.addRootElement("urn:jboss:portal:wsrp:producer:v2_6", "", "producer-configuration");
 
       // declare default namespace
-      marshaller.declareNamespace(null, "urn:jboss:portal:wsrp:producer:v2_6");
+      marshaller.declareNamespace("wpc", "urn:jboss:portal:wsrp:producer:v2_6");
 
       // add schema location by declaring xsi namespace and adding xsi:schemaLocation attribute
       marshaller.declareNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance");

Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/xsd/jboss-wsrp-producer_2_6.xsd
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/xsd/jboss-wsrp-producer_2_6.xsd	2007-11-26 05:03:15 UTC (rev 9094)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/xsd/jboss-wsrp-producer_2_6.xsd	2007-11-26 05:10:47 UTC (rev 9095)
@@ -25,16 +25,16 @@
 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
            targetNamespace="urn:jboss:portal:wsrp:producer:v2_6"
            xmlns="urn:jboss:portal:wsrp:producer:v2_6"
-           xmlns:xml="http://www.w3.org/XML/1998/namespace">
+           xmlns:xml="http://www.w3.org/XML/1998/namespace"
+           xmlns:wpc="urn:jboss:portal:wsrp:producer:v2_6">
 
    <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/>
 
    <xs:element name="producer-configuration">
       <xs:complexType>
          <xs:sequence>
-            <xs:element name="registration-configuration" type="RegistrationConfiguration"/>
+            <xs:element name="registration-configuration" type="wpc:RegistrationConfiguration"/>
          </xs:sequence>
-         <xs:attribute name="fullServiceDescriptionRequiresRegistration" type="xs:boolean" default="false"/>
       </xs:complexType>
    </xs:element>
 
@@ -42,17 +42,18 @@
       <xs:sequence>
          <xs:element name="registration-policy" type="xs:string" minOccurs="0"/>
          <xs:element name="registration-property-validator" type="xs:string" minOccurs="0"/>
-         <xs:element name="registration-property-description" type="RegistrationPropertyDescription" minOccurs="0"
+         <xs:element name="registration-property-description" type="wpc:RegistrationPropertyDescription" minOccurs="0"
                      maxOccurs="unbounded"/>
       </xs:sequence>
+      <xs:attribute name="fullServiceDescriptionRequiresRegistration" type="xs:boolean" use="optional"/>
    </xs:complexType>
 
    <xs:complexType name="RegistrationPropertyDescription">
       <xs:sequence>
          <xs:element name="name" type="xs:QName"/>
          <xs:element name="type" type="xs:QName"/>
-         <xs:element name="label" type="LocalizedString"/>
-         <xs:element name="hint" type="LocalizedString" minOccurs="0"/>
+         <xs:element name="label" type="wpc:LocalizedString"/>
+         <xs:element name="hint" type="wpc:LocalizedString" minOccurs="0"/>
       </xs:sequence>
    </xs:complexType>
 

Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/tests/test-producer-configuration-lib-jar/extended.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/tests/test-producer-configuration-lib-jar/extended.xml	2007-11-26 05:03:15 UTC (rev 9094)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/tests/test-producer-configuration-lib-jar/extended.xml	2007-11-26 05:10:47 UTC (rev 9095)
@@ -1,3 +1,4 @@
+<?xml version="1.0"?>
 <!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   ~ JBoss, a division of Red Hat                                              ~
   ~ Copyright 2006, Red Hat Middleware, LLC, and individual                   ~
@@ -20,12 +21,13 @@
   ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA        ~
   ~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.                  ~
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-<!DOCTYPE producer-configuration PUBLIC "-//JBoss Portal//DTD WSRP Local Producer Configuration 2.6//EN"
-   "http://www.jboss.org/portal/dtd/jboss-wsrp-producer_2_6.dtd">
-
-<producer-configuration>
+<wpc:producer-configuration xmlns:wpc="urn:jboss:portal:wsrp:producer:v2_6"
+                            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+                            xsi:schemaLocation="urn:jboss:portal:wsrp:producer:v2_6 "
+                            xmlns:xml="http://www.w3.org/XML/1998/namespace">
    <registration-configuration fullServiceDescriptionRequiresRegistration="true">
-      <registration-property-validator>org.jboss.portal.registration.policies.DefaultRegistrationPropertyValidator</registration-property-validator>
+      <registration-property-validator>org.jboss.portal.registration.policies.DefaultRegistrationPropertyValidator
+      </registration-property-validator>
       <registration-property-description>
          <name>name1</name>
          <type>xsd:string</type>
@@ -34,9 +36,9 @@
       </registration-property-description>
       <registration-property-description>
          <name>name2</name>
-         <type>xsd:string</type>
+         <type xmlns:xs="http://www.w3.org/2001/XMLSchema">xs:string</type>
          <label xml:lang="en" resourceName="resource.label2">label2</label>
          <hint xml:lang="en" resourceName="resource.hint2">hint2</hint>
       </registration-property-description>
    </registration-configuration>
-</producer-configuration>
+</wpc:producer-configuration>




More information about the portal-commits mailing list