Author: chris.laprun(a)jboss.com
Date: 2007-10-05 11:50:22 -0400 (Fri, 05 Oct 2007)
New Revision: 8541
Added:
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationProvider.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/xsd/
branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/xsd/jboss-wsrp-producer_2_6.xsd
Modified:
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ManagedBean.java
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ProducerBean.java
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/faces-config.xml
branches/JBoss_Portal_Branch_2_6/wsrp/build.xml
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationService.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/main/org/jboss/portal/wsrp/producer/config/impl/ProducerRegistrationRequirementsImpl.java
Log:
- JBPORTAL-1715: Added support for saving producer configuration (finally figured out that
you can't use a FileWriter directly to marshall objects with XB).
- Added XML Schema version of the producer configuration file format (required for XB
marshalling to work properly, haven't been able to use the DTD for that purpose).
- Added logging to ManagedBean.
Modified:
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ManagedBean.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ManagedBean.java 2007-10-05
15:42:10 UTC (rev 8540)
+++
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ManagedBean.java 2007-10-05
15:50:22 UTC (rev 8541)
@@ -23,6 +23,9 @@
package org.jboss.portal.wsrp.admin.ui;
+import org.jboss.logging.Logger;
+
+
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
* @version $Revision: 7509 $
@@ -30,6 +33,8 @@
*/
public class ManagedBean
{
+ protected Logger log = Logger.getLogger(getClass());
+
protected BeanContext beanContext;
public void setBeanContext(BeanContext beanContext)
Modified:
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ProducerBean.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ProducerBean.java 2007-10-05
15:42:10 UTC (rev 8540)
+++
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ProducerBean.java 2007-10-05
15:50:22 UTC (rev 8541)
@@ -26,6 +26,7 @@
import org.jboss.portal.registration.RegistrationPolicy;
import org.jboss.portal.registration.policies.DefaultRegistrationPolicy;
import org.jboss.portal.wsrp.producer.config.ProducerConfiguration;
+import org.jboss.portal.wsrp.producer.config.ProducerConfigurationService;
import org.jboss.portal.wsrp.producer.config.ProducerRegistrationRequirements;
import org.jboss.portal.wsrp.registration.RegistrationPropertyDescription;
@@ -43,20 +44,25 @@
*/
public class ProducerBean extends ManagedBean
{
- private ProducerConfiguration configuration;
+ private ProducerConfigurationService configurationService;
private String policyClassName;
private String validatorClassName;
- public ProducerConfiguration getConfiguration()
+ public ProducerConfigurationService getConfigurationService()
{
- return configuration;
+ return configurationService;
}
- public void setConfiguration(ProducerConfiguration configuration)
+ public void setConfigurationService(ProducerConfigurationService
configurationService)
{
- this.configuration = configuration;
+ this.configurationService = configurationService;
}
+ public ProducerConfiguration getConfiguration()
+ {
+ return configurationService.getConfiguration();
+ }
+
public boolean isRegistrationRequiredForFullDescription()
{
return getRegRequirements().isRegistrationRequiredForFullDescription();
@@ -64,7 +70,7 @@
private ProducerRegistrationRequirements getRegRequirements()
{
- return configuration.getRegistrationRequirements();
+ return getConfiguration().getRegistrationRequirements();
}
public void setRegistrationRequiredForFullDescription(boolean
requireRegForFullDescription)
@@ -139,4 +145,18 @@
{
return Collections.singletonList(new SelectItem("xsd:string"));
}
+
+ public String save()
+ {
+ try
+ {
+ configurationService.saveConfiguration();
+ }
+ catch (Exception e)
+ {
+ log.debug(e);
+ beanContext.createErrorMessage("status", "Couldn't save
producer configuration. Cause: " + e.getLocalizedMessage());
+ }
+ return null;
+ }
}
Modified:
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/faces-config.xml
===================================================================
---
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/faces-config.xml 2007-10-05
15:42:10 UTC (rev 8540)
+++
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/resources/portal-wsrp-admin-war/WEB-INF/faces-config.xml 2007-10-05
15:50:22 UTC (rev 8541)
@@ -85,9 +85,9 @@
<managed-bean-class>org.jboss.portal.wsrp.admin.ui.ProducerBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
- <property-name>configuration</property-name>
-
<property-class>org.jboss.portal.wsrp.producer.config.ProducerConfiguration</property-class>
-
<value>#{applicationScope.ProducerConfigurationService.configuration}</value>
+ <property-name>configurationService</property-name>
+
<property-class>org.jboss.portal.wsrp.producer.config.ProducerConfigurationService</property-class>
+ <value>#{applicationScope.ProducerConfigurationService}</value>
</managed-property>
<managed-property>
<property-name>beanContext</property-name>
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/build.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/build.xml 2007-10-05 15:42:10 UTC (rev 8540)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/build.xml 2007-10-05 15:50:22 UTC (rev 8541)
@@ -135,7 +135,8 @@
<!-- needed to compile on JDK 1.4 -->
<pathelement path="${jbossas/core.libs.lib}/namespace.jar"/>
-
+
+ <path refid="apache.xerces.classpath"/>
<path refid="ibm.wsdl4j.classpath"/>
<path refid="jboss.jbossxb.classpath"/>
<path refid="apache.httpclient.classpath"/>
@@ -314,13 +315,14 @@
<!-- Build Admin GUI... -->
<ant inheritAll="false" antfile="../core-wsrp/build.xml"
output="output.log" dir="../core-wsrp" target="output">
- <property name="build.lib" value="${build.lib}"/>
- <property name="build.resources"
value="${build.resources}"/>
+ <property name="build.lib" value="${build.lib}"/>
+ <property name="build.resources"
value="${build.resources}"/>
</ant>
<copy todir="${build.resources}/portal-wsrp-sar"
overwrite="true">
<fileset dir="${build.lib}"
includes="portal-wsrp-client.jar"/>
<fileset dir="${build.lib}"
includes="portal-wsrp.jse"/>
- </copy>
+ </copy>
+
<copy todir="${build.resources}/portal-wsrp-sar"
overwrite="true">
<fileset dir="${build.lib}"
includes="portal-wsrp-lib.jar"/>
<fileset dir="./output/lib"
includes="portal-wsrp-admin.war"/>
Added:
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationProvider.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationProvider.java
(rev 0)
+++
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationProvider.java 2007-10-05
15:50:22 UTC (rev 8541)
@@ -0,0 +1,147 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2007, 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;
+
+import org.jboss.portal.registration.RegistrationPolicy;
+import org.jboss.portal.registration.policies.DefaultRegistrationPolicy;
+import org.jboss.portal.wsrp.producer.config.impl.ProducerConfigurationImpl;
+import org.jboss.portal.wsrp.producer.config.impl.ProducerRegistrationRequirementsImpl;
+import org.jboss.portal.wsrp.registration.LocalizedString;
+import org.jboss.portal.wsrp.registration.RegistrationPropertyDescription;
+import org.jboss.xb.binding.MarshallingContext;
+import org.jboss.xb.binding.ObjectModelProvider;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ * @since 2.6.3
+ */
+public class ProducerConfigurationProvider implements ObjectModelProvider
+{
+ public Object getRoot(Object o, MarshallingContext marshallingContext, String s,
String s1)
+ {
+ return o;
+ }
+
+ public Object getChildren(ProducerConfigurationImpl configuration, String
namespaceUri, String localName)
+ {
+ if ("registration-configuration".equals(localName))
+ {
+ ProducerRegistrationRequirements registrationRequirements =
configuration.getRegistrationRequirements();
+ if (registrationRequirements != null &&
registrationRequirements.isRegistrationRequired())
+ {
+ return registrationRequirements;
+ }
+ }
+ else if ("producer-configuration".equals(localName))
+ {
+ return configuration;
+ }
+
+ return null;
+ }
+
+ public Object getChildren(ProducerRegistrationRequirementsImpl regReq, String
namespaceUri, String localName)
+ {
+ if ("registration-property-description".equals(localName))
+ {
+ return regReq.getRegistrationProperties().values();
+ }
+
+ return null;
+ }
+
+ public Object getAttributeValue(ProducerConfigurationImpl configuration, String
namespaceUri, String localName)
+ {
+ if ("fullServiceDescriptionRequiresRegistration".equals(localName))
+ {
+ return
configuration.getRegistrationRequirements().isRegistrationRequiredForFullDescription();
+ }
+
+ return null;
+ }
+
+ public Object getElementValue(ProducerRegistrationRequirementsImpl regReq, String
namespaceUri, String localName)
+ {
+ Object value = null;
+ if ("registration-policy".equals(localName))
+ {
+ RegistrationPolicy policy = regReq.getPolicy();
+ if (policy != null)
+ {
+ value = policy.getClass().getName();
+ }
+ }
+ else if ("registration-property-validator".equals(localName))
+ {
+ RegistrationPolicy policy = regReq.getPolicy();
+ if (policy instanceof DefaultRegistrationPolicy)
+ {
+ DefaultRegistrationPolicy defaultRegistrationPolicy =
(DefaultRegistrationPolicy)policy;
+ value = defaultRegistrationPolicy.getValidator().getClass().getName();
+ }
+ }
+ else
+ {
+ value = null;
+ }
+ return value;
+ }
+
+ public Object getElementValue(RegistrationPropertyDescription propertyDescription,
String namespaceUri, String localName)
+ {
+ Object value = null;
+ if ("name".equals(localName))
+ {
+ value = propertyDescription.getName();
+ }
+ else if ("type".equals(localName))
+ {
+ value = propertyDescription.getType();
+ }
+ else if ("label".equals(localName))
+ {
+ value = propertyDescription.getLabel();
+ }
+ else if ("hint".equals(localName))
+ {
+ value = propertyDescription.getHint();
+ }
+ return value;
+ }
+
+ public Object getAttributeValue(LocalizedString localizedString, String namespaceUri,
String localName)
+ {
+ Object value = null;
+ if ("lang".equals(localName))
+ {
+ value = localizedString.getLocale().getCountry();
+ }
+ else if ("resourceName".equals(localName))
+ {
+ value = localizedString.getResourceName();
+ }
+ return value;
+ }
+}
Property changes on:
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationProvider.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified:
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationService.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationService.java 2007-10-05
15:42:10 UTC (rev 8540)
+++
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/ProducerConfigurationService.java 2007-10-05
15:50:22 UTC (rev 8541)
@@ -31,4 +31,20 @@
public interface ProducerConfigurationService
{
public ProducerConfiguration getConfiguration();
+
+ /**
+ * Reloads the producer configuration from persistent storage.
+ *
+ * @throws Exception
+ * @since 2.6.3
+ */
+ void reloadConfiguration() throws Exception;
+
+ /**
+ * Saves the producer configuration to persistent storage.
+ *
+ * @throws Exception
+ * @since 2.6.3
+ */
+ void saveConfiguration() throws Exception;
}
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-10-05
15:42:10 UTC (rev 8540)
+++
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerConfigurationServiceImpl.java 2007-10-05
15:50:22 UTC (rev 8541)
@@ -23,15 +23,32 @@
package org.jboss.portal.wsrp.producer.config.impl;
+import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.mx.util.ObjectNameFactory;
import org.jboss.portal.common.net.URLTools;
import org.jboss.portal.jems.as.system.AbstractJBossService;
import org.jboss.portal.wsrp.producer.config.ProducerConfiguration;
import org.jboss.portal.wsrp.producer.config.ProducerConfigurationFactory;
+import org.jboss.portal.wsrp.producer.config.ProducerConfigurationProvider;
import org.jboss.portal.wsrp.producer.config.ProducerConfigurationService;
+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 javax.management.MBeanServer;
+import javax.management.ObjectName;
+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.Enumeration;
@@ -45,6 +62,10 @@
private String configLocation;
private ProducerConfiguration configuration;
+
+ private File dataDir;
+ private File config;
+
public String getConfigLocation()
{
return configLocation;
@@ -63,32 +84,119 @@
protected void startService() throws Exception
{
- // Setup URLs
- if (configLocation == null)
+ MBeanServer server = MBeanServerLocator.locateJBoss();
+ ObjectName oname =
ObjectNameFactory.create("jboss.system:type=ServerConfig");
+ try
{
- throw new Exception("The config location is null");
+ dataDir = (File)server.getAttribute(oname, "ServerDataDir");
}
-
- // make sure we pick the furthest down the path in case there's several
similarly named resources in the path
- Enumeration resources =
Thread.currentThread().getContextClassLoader().getResources(configLocation);
- URL configURL = null;
- while (resources.hasMoreElements())
+ catch (Exception e)
{
- configURL = (URL)resources.nextElement();
+ throw new RuntimeException("Couldn't locate server data dir!",
e);
}
+ config = new File(dataDir, "portal/wsrp-producer-config.xml");
- if (configURL == null)
+ reloadConfiguration();
+ }
+
+ public void reloadConfiguration() throws Exception
+ {
+ URL configURL = getConfigLocationURL();
+
+ try
{
- throw new Exception("The config " + configLocation + " does not
exist");
+ loadConfigurationAt(configURL);
}
- if (!URLTools.exists(configURL))
+ catch (Exception e)
{
- throw new Exception("The config " + configURL + " does not
exist");
+ if (config.exists())
+ {
+ log.debug("Configuration saved at " + config.getCanonicalPath()
+ + " is not loading properly. Falling back to default
configuration.");
+ config.delete(); // delete improper config so that we retrieve the default
configuration
+ loadConfigurationAt(getConfigLocationURL());
+ }
}
+ }
+ private void loadConfigurationAt(URL configURL) throws JBossXBException, IOException
+ {
log.debug("About to parse producer configuration " + configURL);
Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
ObjectModelFactory factory = new ProducerConfigurationFactory();
configuration =
(ProducerConfiguration)unmarshaller.unmarshal(configURL.openStream(), factory, null);
}
+
+ private URL getConfigLocationURL() throws Exception
+ {
+ if (!config.exists())
+ {
+ // Setup URLs
+ if (configLocation == null)
+ {
+ throw new Exception("The config location is null");
+ }
+
+ // make sure we pick the furthest down the path in case there's several
similarly named resources in the path
+ Enumeration resources =
Thread.currentThread().getContextClassLoader().getResources(configLocation);
+ URL configURL = null;
+ while (resources.hasMoreElements())
+ {
+ configURL = (URL)resources.nextElement();
+ }
+
+ if (configURL == null)
+ {
+ throw new Exception("The config " + configLocation + " does
not exist");
+ }
+ if (!URLTools.exists(configURL))
+ {
+ throw new Exception("The config " + configURL + " does not
exist");
+ }
+ return configURL;
+ }
+ else
+ {
+ return config.toURL();
+ }
+ }
+
+ public void saveConfiguration() throws Exception
+ {
+ // get the output writer to write the XML content
+ StringWriter xmlOutput = new StringWriter();
+
+ // get the XML Schema source
+ InputStream is =
Thread.currentThread().getContextClassLoader().getResourceAsStream("xsd/jboss-wsrp-producer_2_6.xsd");
+
+ Reader xsReader = new InputStreamReader(is);
+
+ // create an instance of XML Schema marshaller
+ XercesXsMarshaller marshaller = new XercesXsMarshaller();
+
+ // 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_6",
"", "producer-configuration");
+
+ // declare default namespace
+ marshaller.declareNamespace(null,
"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");
+ marshaller.addAttribute("xsi", "schemaLocation",
"string", "urn:jboss:portal:wsrp:producer:v2_6
xsd/jboss-wsrp-producer_2_6.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();
+
+ config.createNewFile();
+ Writer configFile = new BufferedWriter(new FileWriter(config));
+ configFile.write(xmlOutput.toString());
+ configFile.flush();
+ configFile.close();
+ }
}
Modified:
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerRegistrationRequirementsImpl.java
===================================================================
---
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerRegistrationRequirementsImpl.java 2007-10-05
15:42:10 UTC (rev 8540)
+++
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/producer/config/impl/ProducerRegistrationRequirementsImpl.java 2007-10-05
15:50:22 UTC (rev 8541)
@@ -192,9 +192,11 @@
if (policy != null)
{
policyClassName = policy.getClass().getName();
- if (DEFAULT_POLICY_CLASS_NAME.equals(policyClassName))
+
+ if (policy instanceof DefaultRegistrationPolicy)
{
- validatorClassName =
((DefaultRegistrationPolicy)policy).getValidator().getClass().getName();
+ DefaultRegistrationPolicy registrationPolicy =
(DefaultRegistrationPolicy)policy;
+ validatorClassName = registrationPolicy.getValidator().getClass().getName();
}
}
}
@@ -212,7 +214,7 @@
public void reloadPolicyFrom(String policyClassName, String validatorClassName)
{
- if (policyClassName != null)
+ if (policyClassName != null &&
!DEFAULT_POLICY_CLASS_NAME.equals(policyClassName))
{
log.debug("Using registration policy: " + policyClassName);
ClassLoader loader = Thread.currentThread().getContextClassLoader();
Added:
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
(rev 0)
+++
branches/JBoss_Portal_Branch_2_6/wsrp/src/resources/portal-wsrp-sar/xsd/jboss-wsrp-producer_2_6.xsd 2007-10-05
15:50:22 UTC (rev 8541)
@@ -0,0 +1,67 @@
+<?xml version="1.0"?>
+
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2007, 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_6"
+ xmlns="urn:jboss:portal:wsrp:producer:v2_6"
+
xmlns:xml="http://www.w3.org/XML/1998/namespace">
+
+ <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:sequence>
+ <xs:attribute name="fullServiceDescriptionRequiresRegistration"
type="xs:boolean" default="false"/>
+ </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="RegistrationPropertyDescription" minOccurs="0"
+ maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="RegistrationPropertyDescription">
+ <xs:sequence>
+ <xs:element name="name" type="xs:string"/>
+ <xs:element name="type" type="xs:string"/>
+ <xs:element name="label" type="LocalizedString"/>
+ <xs:element name="hint" type="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>