Author: tyrell
Date: Wed May 21 02:59:41 2008
New Revision: 17220
Log:
Integrating changes done by Registry to their initialization routines. Adding
wsdl-validator library, since it is now required by the Registry as well.
Added:
trunk/mashup/java/modules/core/conf/registry.xml
Modified:
trunk/mashup/java/modules/core/conf/server.xml
trunk/mashup/java/modules/core/src/org/wso2/mashup/MashupConstants.java
trunk/mashup/java/modules/core/src/org/wso2/mashup/RegistryInitializer.java
trunk/mashup/java/modules/distribution/create-distro-build.xml
trunk/mashup/java/modules/distribution/src/assemble/bin-release-assembly.xml
trunk/mashup/java/pom.xml
Added: trunk/mashup/java/modules/core/conf/registry.xml
==============================================================================
--- (empty file)
+++ trunk/mashup/java/modules/core/conf/registry.xml Wed May 21 02:59:41 2008
@@ -0,0 +1,103 @@
+<wso2regsitry>
+
+ <currentConfig>mashup</currentConfig>
+
+ <dbconfig name="mashup">
+ <url>jdbc:derby:../database/WSO2REGISTRY_DB</url>
+ <userName>wso2mashupServer</userName>
+ <password>wso2mashupServer</password>
+ <driverName>org.apache.derby.jdbc.EmbeddedDriver</driverName>
+ </dbconfig>
+
+ <handler
class="org.wso2.registry.jdbc.handlers.builtin.SynapseRepositoryHandler">
+ <filter
class="org.wso2.registry.jdbc.handlers.filters.MediaTypeMatcher">
+ <property
name="mediaType">application/vnd.apache.synapse</property>
+ </filter>
+ </handler>
+
+ <handler
class="org.wso2.registry.jdbc.handlers.builtin.SynapseRepositoryHandler">
+ <filter
class="org.wso2.registry.jdbc.handlers.filters.MediaTypeMatcher">
+ <property name="mediaType">application/vnd.apache.esb</property>
+ </filter>
+ </handler>
+
+ <handler
class="org.wso2.registry.jdbc.handlers.builtin.Axis2RepositoryHandler">
+ <filter
class="org.wso2.registry.jdbc.handlers.filters.MediaTypeMatcher">
+ <property name="mediaType">application/vnd.apache.axis2</property>
+ </filter>
+ </handler>
+
+ <handler
class="org.wso2.registry.jdbc.handlers.builtin.Axis2RepositoryHandler">
+ <filter
class="org.wso2.registry.jdbc.handlers.filters.MediaTypeMatcher">
+ <property name="mediaType">application/vnd.apache.wsas</property>
+ </filter>
+ </handler>
+
+ <handler
class="org.wso2.registry.jdbc.handlers.builtin.WSDLMediaTypeHandler">
+ <filter
class="org.wso2.registry.jdbc.handlers.filters.MediaTypeMatcher">
+ <property name="mediaType">application/wsdl+xml</property>
+ </filter>
+ </handler>
+
+ <handler
class="org.wso2.registry.jdbc.handlers.builtin.XSDMediaTypeHandler">
+ <filter
class="org.wso2.registry.jdbc.handlers.filters.MediaTypeMatcher">
+ <property name="mediaType">application/x-xsd+xml</property>
+ </filter>
+ </handler>
+
+ <handler
class="org.wso2.registry.jdbc.handlers.builtin.WSDLValidationHandler">
+ <filter
class="org.wso2.registry.jdbc.handlers.filters.MediaTypeMatcher">
+ <property name="mediaType">application/wsdl+xml</property>
+ </filter>
+ </handler>
+
+ <handler
class="org.wso2.registry.jdbc.handlers.builtin.XSDValidationHandler">
+ <filter
class="org.wso2.registry.jdbc.handlers.filters.MediaTypeMatcher">
+ <property name="mediaType">application/x-xsd+xml</property>
+ </filter>
+ </handler>
+
+ <aspect name="default" class="org.wso2.registry.aspects.DefaultLifecycle"/>
+
+ <!--<mediaTypeHandler>-->
+ <!--<mediaType>application/vnd.apache.synapse</mediaType>-->
+
<!--<handler>org.wso2.registry.jdbc.mediatypes.builtin.SynapseRepositoryMediaTypeHandler</handler>-->
+ <!--</mediaTypeHandler>-->
+
+ <!--<mediaTypeHandler>-->
+ <!--<mediaType>application/vnd.wso2.esb</mediaType>-->
+
<!--<handler>org.wso2.registry.jdbc.mediatypes.builtin.SynapseRepositoryMediaTypeHandler</handler>-->
+ <!--</mediaTypeHandler>-->
+
+ <!--<mediaTypeHandler>-->
+ <!--<mediaType>application/vnd.apache.axis2</mediaType>-->
+
<!--<handler>org.wso2.registry.jdbc.mediatypes.builtin.Axis2RepositoryMediaTypeHandler</handler>-->
+ <!--</mediaTypeHandler>-->
+
+ <!--<mediaTypeHandler>-->
+ <!--<mediaType>application/vnd.wso2.wsas</mediaType>-->
+
<!--<handler>org.wso2.registry.jdbc.mediatypes.builtin.Axis2RepositoryMediaTypeHandler</handler>-->
+ <!--</mediaTypeHandler>-->
+
+ <!--<mediaTypeHandler>-->
+ <!--<mediaType>application/wsdl+xml</mediaType>-->
+
<!--<handler>org.wso2.registry.jdbc.mediatypes.builtin.WSDLMediaTypeHandler</handler>-->
+ <!--</mediaTypeHandler>-->
+
+ <!--<mediaTypeHandler>-->
+ <!--<mediaType>application/x-xsd+xml</mediaType>-->
+
<!--<handler>org.wso2.registry.jdbc.mediatypes.builtin.XSDMediaTypeHandler</handler>-->
+ <!--</mediaTypeHandler>-->
+
+ <!--
+ <urlHandler>org.example.com.urlhandlers.SimpleHandler</urlHandler>
+ -->
+
+ <!--
+ <queryProcessor>
+ <queryType>my-query-language</queryType>
+ <processor>org.example.processor.MyQueryProcessor</processor>
+ </queryProcessor>
+ -->
+
+</wso2regsitry>
Modified: trunk/mashup/java/modules/core/conf/server.xml
==============================================================================
--- trunk/mashup/java/modules/core/conf/server.xml (original)
+++ trunk/mashup/java/modules/core/conf/server.xml Wed May 21 02:59:41 2008
@@ -117,12 +117,7 @@
</Axis2Config>
<RegistryConfig>
- <DataBaseConnection>
- <driverClass>org.apache.derby.jdbc.EmbeddedDriver</driverClass>
- <url>jdbc:derby:../database/WSO2REGISTRY_DB</url>
- <username>wso2mashupServer</username>
- <password>wso2mashupServer</password>
- </DataBaseConnection>
+
<ConfigurationFile>${wso2mashup.home}/conf/registry.xml</ConfigurationFile>
</RegistryConfig>
<UsermanagerConfig>
Modified:
trunk/mashup/java/modules/core/src/org/wso2/mashup/MashupConstants.java
==============================================================================
--- trunk/mashup/java/modules/core/src/org/wso2/mashup/MashupConstants.java
(original)
+++ trunk/mashup/java/modules/core/src/org/wso2/mashup/MashupConstants.java
Wed May 21 02:59:41 2008
@@ -26,6 +26,7 @@
public static final String MASHUP_INIT_SERVICES = "MashupInitServices";
public static final String CONTENT_TYPE_QUERY_PARAM = "content-type";
public static final String REGISTRY_CONFIG = "RegistryConfig";
+ public static final String REGISTRY_CONFIG_FILE = "ConfigurationFile";
public static final String USERMANAGER_CONFIG = "UsermanagerConfig";
public static final String DATABASE_CONNECTION = "DataBaseConnection";
public static final String DRIVER_CLASS = "driverClass";
Modified:
trunk/mashup/java/modules/core/src/org/wso2/mashup/RegistryInitializer.java
==============================================================================
--- trunk/mashup/java/modules/core/src/org/wso2/mashup/RegistryInitializer.java
(original)
+++ trunk/mashup/java/modules/core/src/org/wso2/mashup/RegistryInitializer.java
Wed May 21 02:59:41 2008
@@ -26,6 +26,7 @@
import org.wso2.registry.RegistryConstants;
import org.wso2.registry.exceptions.RegistryException;
import org.wso2.registry.ResourceImpl;
+import org.wso2.registry.config.RegistryContext;
import org.wso2.registry.jdbc.EmbeddedRegistry;
import org.wso2.registry.jdbc.utils.RegistryDataSource;
import org.wso2.registry.session.UserRegistry;
@@ -38,6 +39,9 @@
import org.wso2.utils.ServerConfiguration;
import org.wso2.wsas.admin.service.UserAdmin;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+
public class RegistryInitializer {
/**
@@ -153,35 +157,17 @@
UserRealm realm)
throws MashupFault, RegistryException {
- // Get the database connection details for the registry database from
the server.xml
- String registryDriverClass = serverConfig
- .getFirstProperty(MashupConstants.REGISTRY_CONFIG +
MashupConstants.DOT +
- MashupConstants.DATABASE_CONNECTION +
MashupConstants.DOT +
- MashupConstants.DRIVER_CLASS);
- String registryUrl = serverConfig
- .getFirstProperty(MashupConstants.REGISTRY_CONFIG +
MashupConstants.DOT +
- MashupConstants.DATABASE_CONNECTION +
MashupConstants.DOT +
- MashupConstants.URL);
- String registryUsername = serverConfig
- .getFirstProperty(MashupConstants.REGISTRY_CONFIG +
MashupConstants.DOT +
- MashupConstants.DATABASE_CONNECTION +
MashupConstants.DOT +
- MashupConstants.USERNAME);
- String registryPassword = serverConfig
+ // Get the registry configuration file path from server.xml
+ String configPath = serverConfig
.getFirstProperty(MashupConstants.REGISTRY_CONFIG +
MashupConstants.DOT +
- MashupConstants.DATABASE_CONNECTION +
MashupConstants.DOT +
- MashupConstants.PASSWORD);
+ MashupConstants.REGISTRY_CONFIG_FILE);
- if (registryDriverClass == null || "".equals(registryDriverClass) ||
- registryUrl == null || "".equals(registryUrl)) {
- throw new MashupFault("Cannot find DataBase connection details
pertaining to " +
- "the registry. The driverClass and the url are
mandatory.");
+ try {
+ return new EmbeddedRegistry(new RegistryContext(new
FileInputStream(configPath)),
+ realm);
+ } catch (FileNotFoundException e) {
+ throw new MashupFault(e);
}
-
- RegistryDataSource datasource = new RegistryDataSource(registryUrl,
registryDriverClass,
-
registryUsername,
-
registryPassword);
-
- return new EmbeddedRegistry(datasource, realm);
}
/**
Modified: trunk/mashup/java/modules/distribution/create-distro-build.xml
==============================================================================
--- trunk/mashup/java/modules/distribution/create-distro-build.xml
(original)
+++ trunk/mashup/java/modules/distribution/create-distro-build.xml Wed May
21 02:59:41 2008
@@ -214,6 +214,7 @@
<include name="server.xml"/>
<include name="wrapper.conf"/>
<include name="log4j.properties"/>
+ <include name="registry.xml"/>
</fileset>
</copy>
Modified:
trunk/mashup/java/modules/distribution/src/assemble/bin-release-assembly.xml
==============================================================================
---
trunk/mashup/java/modules/distribution/src/assemble/bin-release-assembly.xml
(original)
+++
trunk/mashup/java/modules/distribution/src/assemble/bin-release-assembly.xml
Wed May 21 02:59:41 2008
@@ -82,6 +82,7 @@
<include>opensaml:opensaml2:jar</include>
<include>joda-time:joda-time:jar</include>
<include>commons-lang:commons-lang:jar</include>
+ <include>eclipse:eclipse-wsdl-validator:jar</include>
</includes>
</dependencySet>
</dependencySets>
Modified: trunk/mashup/java/pom.xml
==============================================================================
--- trunk/mashup/java/pom.xml (original)
+++ trunk/mashup/java/pom.xml Wed May 21 02:59:41 2008
@@ -271,6 +271,12 @@
<dependencies>
<dependency>
+ <groupId>eclipse</groupId>
+ <artifactId>eclipse-wsdl-validator</artifactId>
+ <version>${wsdlvalidator.version}</version>
+ </dependency>
+
+ <dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>${commons.logging.version}</version>
@@ -1286,7 +1292,7 @@
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>${jodatime.version}</version>
- </dependency>
+ </dependency>
</dependencies>
<modules>
@@ -1396,5 +1402,7 @@
<velocity.version>1.5</velocity.version>
<xmltooling.version>1.0</xmltooling.version>
<jodatime.version>1.5.1</jodatime.version>
+
+ <wsdlvalidator.version>3.395</wsdlvalidator.version>
</properties>
</project>
_______________________________________________
Mashup-dev mailing list
[email protected]
http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev