Author: chris.laprun(a)jboss.com
Date: 2008-03-28 16:55:59 -0400 (Fri, 28 Mar 2008)
New Revision: 10408
Added:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationChangeListener.java
branches/JBoss_Portal_Branch_2_7/wsrp/src/resources/portal-wsrp-sar/xsd/jboss-wsrp-producer_2_7.xsd
branches/JBoss_Portal_Branch_2_7/wsrp/src/resources/tests/test-producer-configuration-lib-jar/strict-mode.xml
branches/JBoss_Portal_Branch_2_7/wsrp/src/resources/tests/test-producer-configuration-lib-jar/xsd/
branches/JBoss_Portal_Branch_2_7/wsrp/src/resources/tests/test-producer-configuration-lib-jar/xsd/jboss-wsrp-producer_2_7.xsd
branches/JBoss_Portal_Branch_2_7/wsrp/src/resources/tests/test-producer-configuration-lib-jar/xsd/xml.xsd
Modified:
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ProducerBean.java
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer/producer.xhtml
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/wsrp/config/ProducerConfigurationTestCase.java
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfiguration.java
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationFactory.java
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationProvider.java
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerConfigurationImpl.java
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerConfigurationServiceImpl.java
branches/JBoss_Portal_Branch_2_7/wsrp/src/resources/portal-wsrp-sar/META-INF/jboss-service.xml
Log:
- Updated producer configuration schema to add strict mode and support for property
description description to a new 2.7 version of the schema.
- JBPORTAL-1964:
+ Use producer configuration instead of jboss-service.xml for strict mode.
+ Added GUI configuration for producer. Needs more testing.
+ This won't be backported to 2.6 (which will keep using configuration via MBeans
and won't provide a GUI interface to it).
- Use WSRPConstants.DEFAULT_LOCALES in Producer as well.
- Added more tests.
Modified:
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ProducerBean.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ProducerBean.java 2008-03-28
20:43:08 UTC (rev 10407)
+++
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ProducerBean.java 2008-03-28
20:55:59 UTC (rev 10408)
@@ -132,6 +132,16 @@
validatorClassName = className;
}
+ public boolean isStrictMode()
+ {
+ return getConfiguration().isUsingStrictMode();
+ }
+
+ public void setStrictMode(boolean strictMode)
+ {
+ getConfiguration().setUsingStrictMode(strictMode);
+ }
+
public List<RegistrationPropertyDescription> getRegistrationProperties()
{
Map descriptions = getRegRequirements().getRegistrationProperties();
Modified:
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer/producer.xhtml
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer/producer.xhtml 2008-03-28
20:43:08 UTC (rev 10407)
+++
branches/JBoss_Portal_Branch_2_7/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/jsf/producer/producer.xhtml 2008-03-28
20:55:59 UTC (rev 10408)
@@ -12,6 +12,9 @@
<h:selectBooleanCheckbox
value="#{producer.registrationRequiredForFullDescription}"/>
<h:outputText value="Access to full service description requires
consumers to be registered."/>
+ <h:selectBooleanCheckbox value="#{producer.strictMode}"/>
+ <h:outputText value="Use strict WSRP compliance."/>
+
<h:selectBooleanCheckbox
value="#{producer.registrationRequired}" immediate="true"
onchange="this.form.submit()"
valueChangeListener="#{producer.requireRegistrationListener}"/>
Modified:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/wsrp/config/ProducerConfigurationTestCase.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/wsrp/config/ProducerConfigurationTestCase.java 2008-03-28
20:43:08 UTC (rev 10407)
+++
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/test/wsrp/config/ProducerConfigurationTestCase.java 2008-03-28
20:55:59 UTC (rev 10408)
@@ -30,17 +30,33 @@
import org.jboss.portal.registration.policies.RegistrationPropertyValidator;
import org.jboss.portal.wsrp.WSRPConstants;
import org.jboss.portal.wsrp.producer.config.ProducerConfiguration;
+import org.jboss.portal.wsrp.producer.config.ProducerConfigurationChangeListener;
import org.jboss.portal.wsrp.producer.config.ProducerConfigurationFactory;
+import org.jboss.portal.wsrp.producer.config.ProducerConfigurationProvider;
import org.jboss.portal.wsrp.producer.config.ProducerRegistrationRequirements;
+import org.jboss.portal.wsrp.producer.config.impl.ProducerConfigurationImpl;
import org.jboss.portal.wsrp.registration.LocalizedString;
import org.jboss.portal.wsrp.registration.RegistrationPropertyDescription;
import org.jboss.xb.binding.JBossXBException;
import org.jboss.xb.binding.ObjectModelFactory;
+import org.jboss.xb.binding.ObjectModelProvider;
import org.jboss.xb.binding.Unmarshaller;
import org.jboss.xb.binding.UnmarshallerFactory;
+import org.jboss.xb.binding.XercesXsMarshaller;
+import org.jboss.xb.binding.sunday.unmarshalling.DefaultSchemaResolver;
+import org.xml.sax.SAXException;
import javax.xml.namespace.QName;
+import javax.xml.parsers.ParserConfigurationException;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.io.StringWriter;
+import java.io.Writer;
import java.net.URL;
import java.util.Locale;
import java.util.Map;
@@ -55,7 +71,16 @@
private Unmarshaller unmarshaller;
private ObjectModelFactory factory;
+ private static DefaultSchemaResolver RESOLVER;
+ static
+ {
+ RESOLVER = new DefaultSchemaResolver();
+ RESOLVER.setCacheResolvedSchemas(true);
+
RESOLVER.addSchemaLocation("http://www.w3.org/XML/1998/namespace",
"xsd/xml.xsd");
+ RESOLVER.addSchemaLocation("urn:jboss:portal:wsrp:producer:v2_7",
"xsd/jboss-wsrp-producer_2_7.xsd");
+ }
+
protected void setUp() throws Exception
{
unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
@@ -66,6 +91,8 @@
public void testCustomPolicyUnmarshalling() throws Exception
{
ProducerConfiguration producerConfiguration =
getProducerConfiguration("custom-policy.xml");
+ assertTrue(producerConfiguration.isUsingStrictMode());
+
ProducerRegistrationRequirements requirements =
producerConfiguration.getRegistrationRequirements();
assertNotNull(requirements);
RegistrationPolicy policy = requirements.getPolicy();
@@ -75,6 +102,8 @@
public void testExtendedUnmarshalling() throws Exception
{
ProducerConfiguration producerConfiguration =
getProducerConfiguration("extended.xml");
+ assertTrue(producerConfiguration.isUsingStrictMode());
+
ProducerRegistrationRequirements requirements =
producerConfiguration.getRegistrationRequirements();
assertNotNull(requirements);
RegistrationPolicy policy = requirements.getPolicy();
@@ -95,6 +124,8 @@
public void testMinimalRegistrationUnmarshalling() throws Exception
{
ProducerConfiguration producerConfiguration =
getProducerConfiguration("minimal-registration.xml");
+ assertTrue(producerConfiguration.isUsingStrictMode());
+
ProducerRegistrationRequirements requirements =
producerConfiguration.getRegistrationRequirements();
assertNotNull(requirements);
assertTrue(requirements.isRegistrationRequired());
@@ -108,6 +139,8 @@
public void testMinimalUnmarshalling() throws Exception
{
ProducerConfiguration producerConfiguration =
getProducerConfiguration("minimal.xml");
+ assertTrue(producerConfiguration.isUsingStrictMode());
+
ProducerRegistrationRequirements requirements =
producerConfiguration.getRegistrationRequirements();
assertNotNull(requirements);
assertFalse(requirements.isRegistrationRequired());
@@ -164,12 +197,129 @@
}
}
+ public void testUseStrictMode() throws IOException, JBossXBException
+ {
+ ProducerConfiguration producerConfiguration =
getProducerConfiguration("strict-mode.xml");
+ assertFalse(producerConfiguration.isUsingStrictMode());
+ }
+
+ public void testChangeListeners() throws IOException, JBossXBException
+ {
+ ProducerConfiguration producerConfiguration =
getProducerConfiguration("minimal.xml");
+ assertTrue(producerConfiguration.isUsingStrictMode());
+
+ TestProducerConfigurationChangeListener listener = new
TestProducerConfigurationChangeListener();
+ producerConfiguration.addChangeListener(listener);
+ assertFalse(listener.called);
+
+ // we're not changing the value, the listeners shouldn't be called
+ producerConfiguration.setUsingStrictMode(true);
+ assertFalse(listener.called);
+
+ producerConfiguration.setUsingStrictMode(false);
+ assertFalse(producerConfiguration.isUsingStrictMode());
+ assertTrue(listener.called);
+ }
+
+ public void testSaveAndReload() throws IOException, ParserConfigurationException,
SAXException, JBossXBException
+ {
+ ProducerConfiguration configuration = new ProducerConfigurationImpl();
+ configuration.setUsingStrictMode(false);
+ ProducerRegistrationRequirements registrationRequirements =
configuration.getRegistrationRequirements();
+ registrationRequirements.setRegistrationRequiredForFullDescription(true);
+ registrationRequirements.setRegistrationRequired(true);
+ String prop1 = "prop1";
+ registrationRequirements.addEmptyRegistrationProperty(prop1);
+
registrationRequirements.getRegistrationPropertyWith(prop1).setDefaultLabel("label1");
+ String prop2 = "prop2";
+ registrationRequirements.addEmptyRegistrationProperty(prop2);
+
registrationRequirements.getRegistrationPropertyWith(prop2).setDefaultHint("hint2");
+ String prop3 = "prop3";
+ registrationRequirements.addEmptyRegistrationProperty(prop3);
+
registrationRequirements.getRegistrationPropertyWith(prop3).setDefaultDescription("description3");
+ String prop4 = "prop4";
+ registrationRequirements.addEmptyRegistrationProperty(prop4);
+ RegistrationPropertyDescription propDesc4 =
registrationRequirements.getRegistrationPropertyWith(prop4);
+ propDesc4.setDefaultLabel("label4");
+ propDesc4.setDefaultHint("hint4");
+ propDesc4.setDefaultDescription("description4");
+
+ File tmp = File.createTempFile("producer-configuration-test-case",
"xml");
+ tmp.deleteOnExit();
+
+ writeConfigToFile(configuration, tmp);
+
+ configuration = getProducerConfiguration(tmp.toURL());
+
+ assertFalse(configuration.isUsingStrictMode());
+
+ registrationRequirements = configuration.getRegistrationRequirements();
+ assertTrue(registrationRequirements.isRegistrationRequired());
+ assertTrue(registrationRequirements.isRegistrationRequiredForFullDescription());
+
+ assertEquals(4, registrationRequirements.getRegistrationProperties().size());
+ assertEquals("label1",
registrationRequirements.getRegistrationPropertyWith(prop1).getLabel().getValue());
+ assertEquals("hint2",
registrationRequirements.getRegistrationPropertyWith(prop2).getHint().getValue());
+ assertEquals("description3",
registrationRequirements.getRegistrationPropertyWith(prop3).getDescription().getValue());
+ propDesc4 = registrationRequirements.getRegistrationPropertyWith(prop4);
+ assertEquals("label4", propDesc4.getLabel().getValue());
+ assertEquals("hint4", propDesc4.getHint().getValue());
+ assertEquals("description4", propDesc4.getDescription().getValue());
+ }
+
+ private void writeConfigToFile(ProducerConfiguration configuration, File file)
+ throws IOException, ParserConfigurationException, SAXException
+ {
+ StringWriter xmlOutput = new StringWriter();
+
+ // get the XML Schema source
+ InputStream is =
Thread.currentThread().getContextClassLoader().getResourceAsStream("xsd/jboss-wsrp-producer_2_7.xsd");
+
+ Reader xsReader = new InputStreamReader(is);
+
+ // create an instance of XML Schema marshaller
+ XercesXsMarshaller marshaller = new XercesXsMarshaller();
+
+ marshaller.setSchemaResolver(RESOLVER);
+
+ // we need to specify what elements are top most (roots) providing namespace URI,
prefix and local name
+ marshaller.addRootElement("urn:jboss:portal:wsrp:producer:v2_7",
"", "producer-configuration");
+
+ // declare default namespace
+ marshaller.declareNamespace("wpc",
"urn:jboss:portal:wsrp:producer:v2_7");
+
+ // add schema location by declaring xsi namespace and adding xsi:schemaLocation
attribute
+ marshaller.declareNamespace("xsi",
"http://www.w3.org/2001/XMLSchema-instance");
+ marshaller.addAttribute("xsi", "schemaLocation",
"string",
+ "urn:jboss:portal:wsrp:producer:v2_7
http://www.jboss.org/portal/xsd/jboss-wsrp-producer_2_7.xsd");
+
+ // create an instance of Object Model Provider
+ ObjectModelProvider provider = new ProducerConfigurationProvider();
+
+ marshaller.setProperty("org.jboss.xml.binding.marshalling.indent",
"true");
+ marshaller.marshal(xsReader, provider, configuration, xmlOutput);
+
+ // close XML Schema reader
+ xsReader.close();
+
+ file.createNewFile();
+ Writer configFile = new BufferedWriter(new FileWriter(file));
+ configFile.write(xmlOutput.toString());
+ configFile.flush();
+ configFile.close();
+ }
+
private ProducerConfiguration getProducerConfiguration(String fileName) throws
JBossXBException, IOException
{
URL location =
Thread.currentThread().getContextClassLoader().getResource(fileName);
assertNotNull(location);
System.out.println("location = " + location);
+ return getProducerConfiguration(location);
+ }
+
+ private ProducerConfiguration getProducerConfiguration(URL location) throws
JBossXBException, IOException
+ {
Object o = unmarshaller.unmarshal(location.openStream(), factory, null);
assertNotNull(o);
assertTrue(o instanceof ProducerConfiguration);
@@ -193,4 +343,14 @@
localizedString.setValue("label" + index);
assertEquals(localizedString, desc.getLabel());
}
+
+ private static class TestProducerConfigurationChangeListener implements
ProducerConfigurationChangeListener
+ {
+ boolean called = false;
+
+ public void usingStrictModeChangedTo(boolean strictMode)
+ {
+ called = true;
+ }
+ }
}
Modified:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java 2008-03-28
20:43:08 UTC (rev 10407)
+++
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/WSRPProducerImpl.java 2008-03-28
20:55:59 UTC (rev 10408)
@@ -36,6 +36,7 @@
import org.jboss.portal.registration.RegistrationManager;
import org.jboss.portal.registration.RegistrationUtils;
import org.jboss.portal.wsrp.ResponseDebugFactory;
+import org.jboss.portal.wsrp.WSRPConstants;
import org.jboss.portal.wsrp.WSRPExceptionFactory;
import org.jboss.portal.wsrp.WSRPProducer;
import org.jboss.portal.wsrp.core.AccessDeniedFault;
@@ -79,6 +80,7 @@
import org.jboss.portal.wsrp.core.UnsupportedModeFault;
import org.jboss.portal.wsrp.core.UnsupportedWindowStateFault;
import org.jboss.portal.wsrp.producer.config.ProducerConfiguration;
+import org.jboss.portal.wsrp.producer.config.ProducerConfigurationChangeListener;
import org.jboss.portal.wsrp.producer.config.ProducerConfigurationService;
import org.jboss.portal.wsrp.producer.config.ProducerRegistrationRequirements;
@@ -92,7 +94,7 @@
* @version $Revision$
* @since 2.4
*/
-public class WSRPProducerImpl extends AbstractJBossService implements WSRPProducer
+public class WSRPProducerImpl extends AbstractJBossService implements WSRPProducer,
ProducerConfigurationChangeListener
{
/** logger used for logging ;) */
private static final Logger log = Logger.getLogger(WSRPProducerImpl.class);
@@ -123,7 +125,7 @@
private CookieProtocol requiresInitCookie = CookieProtocol.none;
/** Supported locales. */
- private String[] supportedLocales = new String[]{"en", "en-US"};
+ private String[] supportedLocales = WSRPConstants.DEFAULT_LOCALES;
private ProducerConfigurationService configurationService;
@@ -270,17 +272,16 @@
return configurationService;
}
- public void setUseStrictMode(boolean strict)
- {
- RegistrationUtils.setStrict(strict);
- }
-
protected void startService() throws Exception
{
super.startService();
producerConfiguration = configurationService.getConfiguration();
+ // register to listen to changes in configuration and get initial state
+ producerConfiguration.addChangeListener(this);
+ usingStrictModeChangedTo(producerConfiguration.isUsingStrictMode());
+
ProducerRegistrationRequirements registrationRequirements =
getProducerRegistrationRequirements();
registrationRequirements.addRegistrationPolicyChangeListener(registrationManager);
registrationRequirements.addRegistrationPropertyChangeListener(registrationManager);
@@ -297,6 +298,8 @@
registrationRequirements.removeRegistrationPropertyChangeListener(registrationManager);
registrationRequirements.removeRegistrationPolicyChangeListener(registrationManager);
+ producerConfiguration.removeChangeListener(this);
+
super.stopService();
}
@@ -528,4 +531,8 @@
return supportedLocales; // todo: avoid hardcoding this at some point...
}
+ public void usingStrictModeChangedTo(boolean strictMode)
+ {
+ RegistrationUtils.setStrict(strictMode);
+ }
}
Modified:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfiguration.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfiguration.java 2008-03-28
20:43:08 UTC (rev 10407)
+++
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfiguration.java 2008-03-28
20:55:59 UTC (rev 10408)
@@ -31,4 +31,12 @@
public interface ProducerConfiguration
{
ProducerRegistrationRequirements getRegistrationRequirements();
+
+ boolean isUsingStrictMode();
+
+ void setUsingStrictMode(boolean strict);
+
+ void addChangeListener(ProducerConfigurationChangeListener listener);
+
+ void removeChangeListener(ProducerConfigurationChangeListener listener);
}
Added:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationChangeListener.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationChangeListener.java
(rev 0)
+++
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationChangeListener.java 2008-03-28
20:55:59 UTC (rev 10408)
@@ -0,0 +1,32 @@
+/*
+* 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.wsrp.producer.config;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+public interface ProducerConfigurationChangeListener
+{
+ void usingStrictModeChangedTo(boolean strictMode);
+}
Modified:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationFactory.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationFactory.java 2008-03-28
20:43:08 UTC (rev 10407)
+++
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationFactory.java 2008-03-28
20:55:59 UTC (rev 10408)
@@ -61,7 +61,9 @@
if ("producer-configuration".equals(localName))
{
- return new ProducerConfigurationImpl();
+ ProducerConfiguration producerConfiguration = new ProducerConfigurationImpl();
+ producerConfiguration.setUsingStrictMode(getBooleanAttributeValue(attrs,
"useStrictMode", true));
+ return producerConfiguration;
}
throw new IllegalArgumentException("The processed file doesn't seem to
have the proper format, " +
"was expecting producer-configuration, instead got " + localName);
@@ -84,19 +86,7 @@
ProducerRegistrationRequirements registrationRequirements = new
ProducerRegistrationRequirementsImpl();
registrationRequirements.setRegistrationRequired(true);
- String descRequiresRegistration =
attrs.getValue("fullServiceDescriptionRequiresRegistration");
- if ("true".equals(descRequiresRegistration))
- {
- registrationRequirements.setRegistrationRequiredForFullDescription(true);
- }
- else if (descRequiresRegistration == null ||
"false".equals(descRequiresRegistration))
- {
- registrationRequirements.setRegistrationRequiredForFullDescription(false);
- }
- else
- {
- throw new IllegalArgumentException("Invalid value for
fullServiceDescriptionRequiresRegistration attribute. Acceptable values are: true,
false.");
- }
+
registrationRequirements.setRegistrationRequiredForFullDescription(getBooleanAttributeValue(attrs,
"fullServiceDescriptionRequiresRegistration", false));
registrationDone = true;
return registrationRequirements;
}
@@ -180,7 +170,7 @@
System.out.println("newchild desc " + localName);
}
- if ("hint".equals(localName) || "label".equals(localName))
+ if ("hint".equals(localName) || "label".equals(localName) ||
"description".equals(localName))
{
String lang = attrs.getValue("xml:lang");
ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(lang,
"xml:lang", localName);
@@ -256,5 +246,36 @@
{
desc.setLabel(string);
}
+ else if ("description".equals(localName))
+ {
+ desc.setDescription(string);
+ }
}
+
+ private boolean getBooleanAttributeValue(Attributes attrs, String attributeName,
boolean defaultValue)
+ {
+ String value = attrs.getValue(attributeName);
+
+ // figure out which is the default value
+ String defaultString = "false";
+ String other = "true";
+ if (defaultValue)
+ {
+ defaultString = "true";
+ other = "false";
+ }
+
+ if (other.equals(value))
+ {
+ return !defaultValue;
+ }
+ else if (value == null || defaultString.equals(value))
+ {
+ return defaultValue;
+ }
+ else
+ {
+ throw new IllegalArgumentException("Invalid value for " +
attributeName + " attribute. Acceptable values are: true, false.");
+ }
+ }
}
Modified:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationProvider.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationProvider.java 2008-03-28
20:43:08 UTC (rev 10407)
+++
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationProvider.java 2008-03-28
20:55:59 UTC (rev 10408)
@@ -75,9 +75,19 @@
public Object getAttributeValue(ProducerConfigurationImpl configuration, String
namespaceUri, String localName)
{
+ if ("useStrictMode".equals(localName))
+ {
+ return configuration.isUsingStrictMode();
+ }
+
+ return null;
+ }
+
+ public Object getAttributeValue(ProducerRegistrationRequirementsImpl regReq, String
namespaceUri, String localName)
+ {
if ("fullServiceDescriptionRequiresRegistration".equals(localName))
{
- return
configuration.getRegistrationRequirements().isRegistrationRequiredForFullDescription();
+ return regReq.isRegistrationRequiredForFullDescription();
}
return null;
@@ -129,6 +139,10 @@
{
value = getLocalizedStringOrNull(propertyDescription.getHint());
}
+ else if ("description".equals(localName))
+ {
+ value = getLocalizedStringOrNull(propertyDescription.getDescription());
+ }
return value;
}
Modified:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerConfigurationImpl.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerConfigurationImpl.java 2008-03-28
20:43:08 UTC (rev 10407)
+++
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerConfigurationImpl.java 2008-03-28
20:55:59 UTC (rev 10408)
@@ -23,9 +23,14 @@
package org.jboss.portal.wsrp.producer.config.impl;
+import org.jboss.portal.common.util.ParameterValidation;
import org.jboss.portal.wsrp.producer.config.ProducerConfiguration;
+import org.jboss.portal.wsrp.producer.config.ProducerConfigurationChangeListener;
import org.jboss.portal.wsrp.producer.config.ProducerRegistrationRequirements;
+import java.util.ArrayList;
+import java.util.List;
+
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
* @version $Revision$
@@ -35,6 +40,11 @@
{
private ProducerRegistrationRequirements requirements;
+ // use strict mode by default
+ private boolean strictMode = true;
+
+ private List<ProducerConfigurationChangeListener> listeners = new
ArrayList<ProducerConfigurationChangeListener>(7);
+
public ProducerRegistrationRequirements getRegistrationRequirements()
{
if (requirements == null)
@@ -45,6 +55,35 @@
return requirements;
}
+ public boolean isUsingStrictMode()
+ {
+ return strictMode;
+ }
+
+ public void setUsingStrictMode(boolean strict)
+ {
+ if (strictMode != strict)
+ {
+ strictMode = strict;
+ for (ProducerConfigurationChangeListener listener : listeners)
+ {
+ listener.usingStrictModeChangedTo(strict);
+ }
+ }
+ }
+
+ public void addChangeListener(ProducerConfigurationChangeListener listener)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(listener,
"ProducerConfigurationChangeListener");
+ listeners.add(listener);
+ }
+
+ public void removeChangeListener(ProducerConfigurationChangeListener listener)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(listener,
"ProducerConfigurationChangeListener");
+ listeners.remove(listener);
+ }
+
public void setRegistrationRequirements(ProducerRegistrationRequirements
requirements)
{
this.requirements = requirements;
Modified:
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerConfigurationServiceImpl.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerConfigurationServiceImpl.java 2008-03-28
20:43:08 UTC (rev 10407)
+++
branches/JBoss_Portal_Branch_2_7/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerConfigurationServiceImpl.java 2008-03-28
20:55:59 UTC (rev 10408)
@@ -73,6 +73,7 @@
RESOLVER.setCacheResolvedSchemas(true);
RESOLVER.addSchemaLocation("http://www.w3.org/XML/1998/namespace",
"xsd/xml.xsd");
RESOLVER.addSchemaLocation("urn:jboss:portal:wsrp:producer:v2_6",
"xsd/jboss-wsrp-producer_2_6.xsd");
+ RESOLVER.addSchemaLocation("urn:jboss:portal:wsrp:producer:v2_7",
"xsd/jboss-wsrp-producer_2_7.xsd");
}
public String getConfigLocation()
Modified:
branches/JBoss_Portal_Branch_2_7/wsrp/src/resources/portal-wsrp-sar/META-INF/jboss-service.xml
===================================================================
---
branches/JBoss_Portal_Branch_2_7/wsrp/src/resources/portal-wsrp-sar/META-INF/jboss-service.xml 2008-03-28
20:43:08 UTC (rev 10407)
+++
branches/JBoss_Portal_Branch_2_7/wsrp/src/resources/portal-wsrp-sar/META-INF/jboss-service.xml 2008-03-28
20:55:59 UTC (rev 10408)
@@ -38,8 +38,6 @@
<depends optional-attribute-name="ProducerConfigurationService"
proxy-type="attribute">
portal.wsrp:service=ProducerConfiguration
</depends>
- <attribute name="UseStrictMode">true</attribute>
- <!-- Set to false to switch to lenient mode -->
</mbean>
<!-- Registration manager -->
Added:
branches/JBoss_Portal_Branch_2_7/wsrp/src/resources/portal-wsrp-sar/xsd/jboss-wsrp-producer_2_7.xsd
===================================================================
---
branches/JBoss_Portal_Branch_2_7/wsrp/src/resources/portal-wsrp-sar/xsd/jboss-wsrp-producer_2_7.xsd
(rev 0)
+++
branches/JBoss_Portal_Branch_2_7/wsrp/src/resources/portal-wsrp-sar/xsd/jboss-wsrp-producer_2_7.xsd 2008-03-28
20:55:59 UTC (rev 10408)
@@ -0,0 +1,70 @@
+<?xml version="1.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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="urn:jboss:portal:wsrp:producer:v2_7"
+ xmlns="urn:jboss:portal:wsrp:producer:v2_7"
+
xmlns:xml="http://www.w3.org/XML/1998/namespace"
+ xmlns:wpc="urn:jboss:portal:wsrp:producer:v2_7"
elementFormDefault="qualified">
+
+ <xs:import
namespace="http://www.w3.org/XML/1998/namespace"/>
+
+ <xs:element name="producer-configuration">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="registration-configuration"
type="wpc:RegistrationConfiguration"/>
+ </xs:sequence>
+ <xs:attribute name="useStrictMode" type="xs:boolean"
use="optional"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:complexType name="RegistrationConfiguration">
+ <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="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="wpc:LocalizedString"
minOccurs="0"/>
+ <xs:element name="hint" type="wpc:LocalizedString"
minOccurs="0"/>
+ <xs:element name="description" type="wpc:LocalizedString"
minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="LocalizedString">
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute ref="xml:lang" use="required"/>
+ <xs:attribute name="resourceName" type="xs:string"
use="optional"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+</xs:schema>
Added:
branches/JBoss_Portal_Branch_2_7/wsrp/src/resources/tests/test-producer-configuration-lib-jar/strict-mode.xml
===================================================================
---
branches/JBoss_Portal_Branch_2_7/wsrp/src/resources/tests/test-producer-configuration-lib-jar/strict-mode.xml
(rev 0)
+++
branches/JBoss_Portal_Branch_2_7/wsrp/src/resources/tests/test-producer-configuration-lib-jar/strict-mode.xml 2008-03-28
20:55:59 UTC (rev 10408)
@@ -0,0 +1,28 @@
+<?xml version="1.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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<producer-configuration xmlns="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
http://www.jboss.org/portal/xsd/jboss-wsrp-producer_2_6.xsd"
+ useStrictMode="false"/>
\ No newline at end of file
Copied:
branches/JBoss_Portal_Branch_2_7/wsrp/src/resources/tests/test-producer-configuration-lib-jar/xsd/jboss-wsrp-producer_2_7.xsd
(from rev 10400,
branches/JBoss_Portal_Branch_2_7/wsrp/src/resources/portal-wsrp-sar/xsd/jboss-wsrp-producer_2_6.xsd)
===================================================================
---
branches/JBoss_Portal_Branch_2_7/wsrp/src/resources/tests/test-producer-configuration-lib-jar/xsd/jboss-wsrp-producer_2_7.xsd
(rev 0)
+++
branches/JBoss_Portal_Branch_2_7/wsrp/src/resources/tests/test-producer-configuration-lib-jar/xsd/jboss-wsrp-producer_2_7.xsd 2008-03-28
20:55:59 UTC (rev 10408)
@@ -0,0 +1,70 @@
+<?xml version="1.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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="urn:jboss:portal:wsrp:producer:v2_7"
+ xmlns="urn:jboss:portal:wsrp:producer:v2_7"
+
xmlns:xml="http://www.w3.org/XML/1998/namespace"
+ xmlns:wpc="urn:jboss:portal:wsrp:producer:v2_7"
elementFormDefault="qualified">
+
+ <xs:import
namespace="http://www.w3.org/XML/1998/namespace"/>
+
+ <xs:element name="producer-configuration">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="registration-configuration"
type="wpc:RegistrationConfiguration"/>
+ </xs:sequence>
+ <xs:attribute name="useStrictMode" type="xs:boolean"
use="optional"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:complexType name="RegistrationConfiguration">
+ <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="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="wpc:LocalizedString"
minOccurs="0"/>
+ <xs:element name="hint" type="wpc:LocalizedString"
minOccurs="0"/>
+ <xs:element name="description" type="wpc:LocalizedString"
minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="LocalizedString">
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute ref="xml:lang" use="required"/>
+ <xs:attribute name="resourceName" type="xs:string"
use="optional"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+</xs:schema>
Property changes on:
branches/JBoss_Portal_Branch_2_7/wsrp/src/resources/tests/test-producer-configuration-lib-jar/xsd/jboss-wsrp-producer_2_7.xsd
___________________________________________________________________
Name: svn:keywords
+ LastChangedDate LastChangedBy LastChangedRevision Id
Copied:
branches/JBoss_Portal_Branch_2_7/wsrp/src/resources/tests/test-producer-configuration-lib-jar/xsd/xml.xsd
(from rev 10400,
branches/JBoss_Portal_Branch_2_7/wsrp/src/resources/portal-wsrp-sar/xsd/xml.xsd)
===================================================================
---
branches/JBoss_Portal_Branch_2_7/wsrp/src/resources/tests/test-producer-configuration-lib-jar/xsd/xml.xsd
(rev 0)
+++
branches/JBoss_Portal_Branch_2_7/wsrp/src/resources/tests/test-producer-configuration-lib-jar/xsd/xml.xsd 2008-03-28
20:55:59 UTC (rev 10408)
@@ -0,0 +1,151 @@
+<?xml version='1.0'?>
+
+<xs:schema
targetNamespace="http://www.w3.org/XML/1998/namespace"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xml:lang="en">
+
+ <xs:annotation>
+ <xs:documentation>
+ See
http://www.w3.org/XML/1998/namespace.html and
+
http://www.w3.org/TR/REC-xml for information about this namespace.
+
+ This schema document describes the XML namespace, in a form
+ suitable for import by other schema documents.
+
+ Note that local names in this namespace are intended to be defined
+ only by the World Wide Web Consortium or its subgroups. The
+ following names are currently defined in this namespace and should
+ not be used with conflicting semantics by any Working Group,
+ specification, or document instance:
+
+ base (as an attribute name): denotes an attribute whose value
+ provides a URI to be used as the base for interpreting any
+ relative URIs in the scope of the element on which it
+ appears; its value is inherited. This name is reserved
+ by virtue of its definition in the XML Base specification.
+
+ id (as an attribute name): denotes an attribute whose value
+ should be interpreted as if declared to be of type ID.
+ This name is reserved by virtue of its definition in the
+ xml:id specification.
+
+ lang (as an attribute name): denotes an attribute whose value
+ is a language code for the natural language of the content of
+ any element; its value is inherited. This name is reserved
+ by virtue of its definition in the XML specification.
+
+ space (as an attribute name): denotes an attribute whose
+ value is a keyword indicating what whitespace processing
+ discipline is intended for the content of the element; its
+ value is inherited. This name is reserved by virtue of its
+ definition in the XML specification.
+
+ Father (in any context at all): denotes Jon Bosak, the chair of
+ the original XML Working Group. This name is reserved by
+ the following decision of the W3C XML Plenary and
+ XML Coordination groups:
+
+ In appreciation for his vision, leadership and dedication
+ the W3C XML Plenary on this 10th day of February, 2000
+ reserves for Jon Bosak in perpetuity the XML name
+ xml:Father
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:annotation>
+ <xs:documentation>This schema defines attributes and an attribute group
+ suitable for use by
+ schemas wishing to allow xml:base, xml:lang, xml:space or xml:id
+ attributes on elements they define.
+
+ To enable this, such a schema must import this schema
+ for the XML namespace, e.g. as follows:
+ <schema . . .>
+ . . .
+ <import
namespace="http://www.w3.org/XML/1998/namespace"
+
schemaLocation="http://www.w3.org/2001/xml.xsd"/>
+
+ Subsequently, qualified reference to any of the attributes
+ or the group defined below will have the desired effect, e.g.
+
+ <type . . .>
+ . . .
+ <attributeGroup ref="xml:specialAttrs"/>
+
+ will define a type which will schema-validate an instance
+ element with any of those attributes
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:annotation>
+ <xs:documentation>In keeping with the XML Schema WG's standard
versioning
+ policy, this schema document will persist at
+
http://www.w3.org/2007/08/xml.xsd.
+ At the date of issue it can also be found at
+
http://www.w3.org/2001/xml.xsd.
+ The schema document at that URI may however change in the future,
+ in order to remain compatible with the latest version of XML Schema
+ itself, or with the XML namespace itself. In other words, if the XML
+ Schema or XML namespaces change, the version of this document at
+
http://www.w3.org/2001/xml.xsd will change
+ accordingly; the version at
+
http://www.w3.org/2007/08/xml.xsd will not change.
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:attribute name="lang">
+ <xs:annotation>
+ <xs:documentation>Attempting to install the relevant ISO 2- and 3-letter
+ codes as the enumerated possible values is probably never
+ going to be a realistic possibility. See
+ RFC 3066 at
http://www.ietf.org/rfc/rfc3066.txt and the IANA registry
+ at
http://www.iana.org/assignments/lang-tag-apps.htm for
+ further information.
+
+ The union allows for the 'un-declaration' of xml:lang with
+ the empty string.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:simpleType>
+ <xs:union memberTypes="xs:language">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value=""/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ </xs:attribute>
+
+ <xs:attribute name="space">
+ <xs:simpleType>
+ <xs:restriction base="xs:NCName">
+ <xs:enumeration value="default"/>
+ <xs:enumeration value="preserve"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+
+ <xs:attribute name="base" type="xs:anyURI">
+ <xs:annotation>
+ <xs:documentation>See
http://www.w3.org/TR/xmlbase/ for
+ information about this attribute.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+
+ <xs:attribute name="id" type="xs:ID">
+ <xs:annotation>
+ <xs:documentation>See
http://www.w3.org/TR/xml-id/ for
+ information about this attribute.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+
+ <xs:attributeGroup name="specialAttrs">
+ <xs:attribute ref="xml:base"/>
+ <xs:attribute ref="xml:lang"/>
+ <xs:attribute ref="xml:space"/>
+ <xs:attribute ref="xml:id"/>
+ </xs:attributeGroup>
+
+</xs:schema>