incubator-connectors-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1226429 - in /incubator/lcf/trunk: ./ connectors/meridio/ connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/ connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meri...
Date Mon, 02 Jan 2012 14:21:27 GMT
Author: kwright
Date: Mon Jan  2 14:21:26 2012
New Revision: 1226429

URL: http://svn.apache.org/viewvc?rev=1226429&view=rev
Log:
Fix for CONNECTORS-353.  Move .wsdd files into resources.

Added:
    incubator/lcf/trunk/connectors/meridio/connector/src/main/resource/org/
      - copied from r1226428, incubator/lcf/branches/CONNECTORS-353/connectors/meridio/connector/src/main/resource/org/
    incubator/lcf/trunk/connectors/sharepoint/connector/src/main/resource/org/
      - copied from r1226428, incubator/lcf/branches/CONNECTORS-353/connectors/sharepoint/connector/src/main/resource/org/
Removed:
    incubator/lcf/trunk/connectors/meridio/connector/src/main/resouce/
    incubator/lcf/trunk/connectors/meridio/meridio-client-config.wsdd
    incubator/lcf/trunk/connectors/sharepoint/sharepoint-client-config.wsdd
Modified:
    incubator/lcf/trunk/   (props changed)
    incubator/lcf/trunk/CHANGES.txt
    incubator/lcf/trunk/build.xml
    incubator/lcf/trunk/connectors/meridio/build.xml
    incubator/lcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/MeridioAuthority.java
    incubator/lcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/MeridioConnector.java
    incubator/lcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/meridiowrapper/MeridioWrapper.java
    incubator/lcf/trunk/connectors/sharepoint/build.xml
    incubator/lcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SPSProxyHelper.java
    incubator/lcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SharePointRepository.java
    incubator/lcf/trunk/site/src/documentation/content/xdocs/how-to-build-and-deploy.xml

Propchange: incubator/lcf/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Jan  2 14:21:26 2012
@@ -16,3 +16,4 @@
 /incubator/lcf/branches/CONNECTORS-314:1221058
 /incubator/lcf/branches/CONNECTORS-32:1092556-1094216
 /incubator/lcf/branches/CONNECTORS-335:1222285-1225060
+/incubator/lcf/branches/CONNECTORS-353:1226361-1226428

Modified: incubator/lcf/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/CHANGES.txt?rev=1226429&r1=1226428&r2=1226429&view=diff
==============================================================================
--- incubator/lcf/trunk/CHANGES.txt (original)
+++ incubator/lcf/trunk/CHANGES.txt Mon Jan  2 14:21:26 2012
@@ -3,6 +3,12 @@ $Id$
 
 ======================= 0.5-dev =====================
 
+CONNECTORS-353: Ship .wsdd configuration files as part of connector
+jars rather than separate files with configuration parameters.  This
+simplifies the building and deployment of the SharePoint and Meridio
+connectors considerably.
+(Karl Wright)
+
 CONNECTORS-352: Remove duplicate logfile property output for tests.
 (Martin Goldhahn)
 

Modified: incubator/lcf/trunk/build.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/build.xml?rev=1226429&r1=1226428&r2=1226429&view=diff
==============================================================================
--- incubator/lcf/trunk/build.xml (original)
+++ incubator/lcf/trunk/build.xml Mon Jan  2 14:21:26 2012
@@ -1719,18 +1719,12 @@
         <copy todir="dist/connector-lib">
             <fileset dir="connectors/meridio/dist/lib"/>
         </copy>
-        <mkdir dir="dist/wsdd"/>
-        <copy todir="dist/wsdd">
-            <fileset dir="connectors/meridio/dist/wsdd"/>
-        </copy>
         <mkdir dir="dist/meridio-integration"/>
         <copy todir="dist/meridio-integration">
             <fileset dir="connectors/meridio/dist/integration"/>
         </copy>
         <replace file="dist/connectors.xml" token="&lt;!-- Add your authority connectors
here --&gt;" value="&lt;!-- Add your authority connectors here --&gt;&#0010;
 &lt;authorityconnector name=&quot;Meridio&quot; class=&quot;org.apache.manifoldcf.crawler.connectors.meridio.MeridioAuthority&quot;/&gt;"/>
         <replace file="dist/connectors.xml" token="&lt;!-- Add your repository connectors
here --&gt;" value="&lt;!-- Add your repository connectors here --&gt;&#0010;
 &lt;repositoryconnector name=&quot;Meridio&quot; class=&quot;org.apache.manifoldcf.crawler.connectors.meridio.MeridioConnector&quot;/&gt;"/>
-        <replace file="dist/example/properties.xml" token="&lt;!-- WSDD references
--&gt;" value="&lt;!-- WSDD references --&gt;&#0010;  &lt;property name=&quot;org.apache.manifoldcf.meridio.wsddpath&quot;
value=&quot;../wsdd/meridio-client-config.wsdd&quot;/&gt;"/>
-        <replace file="dist/multiprocess-example/properties.xml" token="&lt;!-- WSDD
references --&gt;" value="&lt;!-- WSDD references --&gt;&#0010;  &lt;property
name=&quot;org.apache.manifoldcf.meridio.wsddpath&quot; value=&quot;../wsdd/meridio-client-config.wsdd&quot;/&gt;"/>
     </target>
     
     <target name="deliver-meridio-connector-doc" depends="calculate-meridio-doc-condition"
if="meridio-doc.include">
@@ -1875,17 +1869,11 @@
         <copy todir="dist/connector-lib">
             <fileset dir="connectors/sharepoint/dist/lib"/>
         </copy>
-        <mkdir dir="dist/wsdd"/>
-        <copy todir="dist/wsdd">
-            <fileset dir="connectors/sharepoint/dist/wsdd"/>
-        </copy>
         <mkdir dir="dist/sharepoint-integration"/>
         <copy todir="dist/sharepoint-integration">
             <fileset dir="connectors/sharepoint/dist/integration"/>
         </copy>
         <replace file="dist/connectors.xml" token="&lt;!-- Add your repository connectors
here --&gt;" value="&lt;!-- Add your repository connectors here --&gt;&#0010;
 &lt;repositoryconnector name=&quot;SharePoint&quot; class=&quot;org.apache.manifoldcf.crawler.connectors.sharepoint.SharePointRepository&quot;/&gt;"/>
-        <replace file="dist/example/properties.xml" token="&lt;!-- WSDD references
--&gt;" value="&lt;!-- WSDD references --&gt;&#0010;  &lt;property name=&quot;org.apache.manifoldcf.sharepoint.wsddpath&quot;
value=&quot;../wsdd/sharepoint-client-config.wsdd&quot;/&gt;"/>
-        <replace file="dist/multiprocess-example/properties.xml" token="&lt;!-- WSDD
references --&gt;" value="&lt;!-- WSDD references --&gt;&#0010;  &lt;property
name=&quot;org.apache.manifoldcf.sharepoint.wsddpath&quot; value=&quot;../wsdd/sharepoint-client-config.wsdd&quot;/&gt;"/>
     </target>
     
     <target name="deliver-sharepoint-connector-doc" depends="calculate-sharepoint-doc-condition"
if="sharepoint-doc.include">

Modified: incubator/lcf/trunk/connectors/meridio/build.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/meridio/build.xml?rev=1226429&r1=1226428&r2=1226429&view=diff
==============================================================================
--- incubator/lcf/trunk/connectors/meridio/build.xml (original)
+++ incubator/lcf/trunk/connectors/meridio/build.xml Mon Jan  2 14:21:26 2012
@@ -175,11 +175,6 @@
         <jar destfile="build/jar/mcf-meridio-xsdstub.jar" basedir="build/xsdclasses"/>
     </target>
 
-    <target name="wsdd" depends="precompile-check" if="canBuild">
-        <mkdir dir="dist/wsdd"/>
-        <copy todir="dist/wsdd" file="meridio-client-config.wsdd"/>
-    </target>
-    
     <target name="integration">
         <mkdir dir="dist/integration"/>
         <copy todir="dist/integration">
@@ -211,7 +206,7 @@
         </copy>
     </target>
 
-    <target name="build" depends="lib,wsdd,integration"/>
+    <target name="build" depends="lib,integration"/>
     <target name="build-tests">
       <mkdir dir="build/test-jar"/>
     </target>

Modified: incubator/lcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/MeridioAuthority.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/MeridioAuthority.java?rev=1226429&r1=1226428&r2=1226429&view=diff
==============================================================================
--- incubator/lcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/MeridioAuthority.java
(original)
+++ incubator/lcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/MeridioAuthority.java
Mon Jan  2 14:21:26 2012
@@ -221,16 +221,13 @@ public class MeridioAuthority extends or
         * Now try and login to Meridio; the wrapper's constructor can be
         * used as it calls the Meridio login method
         *================================================================*/
-        File meridioWSDDLocation = ManifoldCF.getFileProperty(wsddPathProperty);
-        if (meridioWSDDLocation == null)
-          throw new ManifoldCFException("Meridio wsdd location path (property "+wsddPathProperty+")
must be specified!");
-
         meridio_ = new MeridioWrapper(Logging.authorityConnectors, DmwsURL, RmwsURL, MetaCartawsURL,
           DMWSProxyHost, DMWSProxyPort, RMWSProxyHost, RMWSProxyPort, MetaCartaWSProxyHost,
MetaCartaWSProxyPort,
           UserName, Password,
           InetAddress.getLocalHost().getHostName(),
           myFactory,
-          meridioWSDDLocation.toString());
+          getClass(),
+          "meridio-client-config.wsdd");
       }
       catch (UnknownHostException unknownHostException)
       {

Modified: incubator/lcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/MeridioConnector.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/MeridioConnector.java?rev=1226429&r1=1226428&r2=1226429&view=diff
==============================================================================
--- incubator/lcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/MeridioConnector.java
(original)
+++ incubator/lcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/MeridioConnector.java
Mon Jan  2 14:21:26 2012
@@ -183,10 +183,6 @@ public class MeridioConnector extends or
         * Now try and login to Meridio; the wrapper's constructor can be
         * used as it calls the Meridio login method
         *================================================================*/
-        File meridioWSDDLocation = ManifoldCF.getFileProperty(wsddPathProperty);
-        if (meridioWSDDLocation == null)
-          throw new ManifoldCFException("Meridio wsdd location path (property "+wsddPathProperty+")
must be specified!");
-
         meridio_ = new MeridioWrapper(Logging.connectors, DmwsURL, RmwsURL, null,
           params.getParameter("DMWSProxyHost"),
           params.getParameter("DMWSProxyPort"),
@@ -199,7 +195,8 @@ public class MeridioConnector extends or
           params.getObfuscatedParameter("Password"),
           InetAddress.getLocalHost().getHostName(),
           myFactory,
-          meridioWSDDLocation.toString());
+          getClass(),
+          "meridio-client-config.wsdd");
       }
       catch (UnknownHostException unknownHostException)
       {

Modified: incubator/lcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/meridiowrapper/MeridioWrapper.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/meridiowrapper/MeridioWrapper.java?rev=1226429&r1=1226428&r2=1226429&view=diff
==============================================================================
--- incubator/lcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/meridiowrapper/MeridioWrapper.java
(original)
+++ incubator/lcf/trunk/connectors/meridio/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/meridio/meridiowrapper/MeridioWrapper.java
Mon Jan  2 14:21:26 2012
@@ -38,10 +38,25 @@ import org.apache.axis.holders.*;
 import org.apache.axis.message.*;
 import org.apache.log4j.Logger;
 
+import javax.xml.namespace.QName;
+
 import org.apache.commons.httpclient.protocol.ProtocolFactory;
 import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
 import org.apache.axis.EngineConfiguration;
-import org.apache.axis.configuration.FileProvider;
+import org.apache.axis.AxisEngine;
+import org.apache.axis.ConfigurationException;
+import org.apache.axis.Handler;
+import org.apache.axis.WSDDEngineConfiguration;
+import org.apache.axis.components.logger.LogFactory;
+import org.apache.axis.deployment.wsdd.WSDDDeployment;
+import org.apache.axis.deployment.wsdd.WSDDDocument;
+import org.apache.axis.deployment.wsdd.WSDDGlobalConfiguration;
+import org.apache.axis.encoding.TypeMappingRegistry;
+import org.apache.axis.handlers.soap.SOAPService;
+import org.apache.axis.utils.Admin;
+import org.apache.axis.utils.Messages;
+import org.apache.axis.utils.XMLUtils;
+import org.w3c.dom.Document;
 
 import org.exolab.castor.xml.MarshalException;
 import org.exolab.castor.xml.ValidationException;
@@ -156,6 +171,7 @@ public class MeridioWrapper
     String password,
     String clientWorkstation,
     ProtocolFactory protocolFactory,
+    Class resourceClass,
     String engineConfigurationFile
   )
     throws RemoteException
@@ -163,7 +179,7 @@ public class MeridioWrapper
     // Initialize local instance variables
     oLog = log;
     this.protocolFactory = protocolFactory;
-    this.engineConfiguration = new FileProvider(engineConfigurationFile);
+    this.engineConfiguration = new ResourceProvider(resourceClass,engineConfigurationFile);
     this.connectionManager = new MultiThreadedHttpConnectionManager();
     this.connectionManager.getParams().setMaxTotalConnections(1);
     this.clientWorkstation = clientWorkstation;
@@ -2138,5 +2154,170 @@ public class MeridioWrapper
     }
   }
 
+  /** Implementation of EngineConfiguration that we'll use to get the wsdd file from a
+  * local resource.
+  */
+  protected static class ResourceProvider implements WSDDEngineConfiguration
+  {
+    private WSDDDeployment deployment = null;
+
+    private Class resourceClass;
+    private String resourceName;
+
+    /**
+     * Constructor setting the resource name.
+     */
+    public ResourceProvider(Class resourceClass, String resourceName) 
+    {
+      this.resourceClass = resourceClass;
+      this.resourceName = resourceName;
+    }
+
+    public WSDDDeployment getDeployment() {
+        return deployment;
+    }
+
+    public void configureEngine(AxisEngine engine)
+      throws ConfigurationException
+    {
+      try
+      {
+        InputStream resourceStream = resourceClass.getResourceAsStream(resourceName);
+        if (resourceStream == null)
+          throw new ConfigurationException("Resource not found: '"+resourceName+"'");
+        try
+        {
+          WSDDDocument doc = new WSDDDocument(XMLUtils.newDocument(resourceStream));
+          deployment = doc.getDeployment();
+
+          deployment.configureEngine(engine);
+          engine.refreshGlobalOptions();
+        }
+        finally
+        {
+          resourceStream.close();
+        }
+      }
+      catch (ConfigurationException e)
+      {
+        throw e;
+      }
+      catch (Exception e)
+      {
+        throw new ConfigurationException(e);
+      }
+    }
+
+    public void writeEngineConfig(AxisEngine engine)
+      throws ConfigurationException
+    {
+      // Do nothing
+    }
+
+    /**
+     * retrieve an instance of the named handler
+     * @param qname XXX
+     * @return XXX
+     * @throws ConfigurationException XXX
+     */
+    public Handler getHandler(QName qname) throws ConfigurationException
+    {
+      return deployment.getHandler(qname);
+    }
+
+    /**
+     * retrieve an instance of the named service
+     * @param qname XXX
+     * @return XXX
+     * @throws ConfigurationException XXX
+     */
+    public SOAPService getService(QName qname) throws ConfigurationException
+    {
+      SOAPService service = deployment.getService(qname);
+      if (service == null)
+      {
+        throw new ConfigurationException(Messages.getMessage("noService10",
+          qname.toString()));
+      }
+      return service;
+    }
+
+    /**
+     * Get a service which has been mapped to a particular namespace
+     * 
+     * @param namespace a namespace URI
+     * @return an instance of the appropriate Service, or null
+     */
+    public SOAPService getServiceByNamespaceURI(String namespace)
+      throws ConfigurationException
+    {
+      return deployment.getServiceByNamespaceURI(namespace);
+    }
+
+    /**
+     * retrieve an instance of the named transport
+     * @param qname XXX
+     * @return XXX
+     * @throws ConfigurationException XXX
+     */
+    public Handler getTransport(QName qname) throws ConfigurationException
+    {
+      return deployment.getTransport(qname);
+    }
+
+    public TypeMappingRegistry getTypeMappingRegistry()
+        throws ConfigurationException
+    {
+      return deployment.getTypeMappingRegistry();
+    }
+
+    /**
+     * Returns a global request handler.
+     */
+    public Handler getGlobalRequest() throws ConfigurationException
+    {
+      return deployment.getGlobalRequest();
+    }
+
+    /**
+     * Returns a global response handler.
+     */
+    public Handler getGlobalResponse() throws ConfigurationException
+    {
+      return deployment.getGlobalResponse();
+    }
+
+    /**
+     * Returns the global configuration options.
+     */
+    public Hashtable getGlobalOptions() throws ConfigurationException
+    {
+      WSDDGlobalConfiguration globalConfig = deployment.getGlobalConfiguration();
+            
+      if (globalConfig != null)
+        return globalConfig.getParametersTable();
+
+      return null;
+    }
+
+    /**
+     * Get an enumeration of the services deployed to this engine
+     */
+    public Iterator getDeployedServices() throws ConfigurationException
+    {
+      return deployment.getDeployedServices();
+    }
+
+    /**
+     * Get a list of roles that this engine plays globally.  Services
+     * within the engine configuration may also add additional roles.
+     *
+     * @return a <code>List</code> of the roles for this engine
+     */
+    public List getRoles()
+    {
+      return deployment.getRoles();
+    }
+  }
 
 }

Modified: incubator/lcf/trunk/connectors/sharepoint/build.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/sharepoint/build.xml?rev=1226429&r1=1226428&r2=1226429&view=diff
==============================================================================
--- incubator/lcf/trunk/connectors/sharepoint/build.xml (original)
+++ incubator/lcf/trunk/connectors/sharepoint/build.xml Mon Jan  2 14:21:26 2012
@@ -120,7 +120,7 @@
         <mkdir dir="build/jar"/>
         <jar destfile="build/jar/mcf-sharepoint-connector.jar">
         	<fileset dir="build/connector/classes"/>
-          <!-- fileset dir="connector/src/main/resource"/ -->
+          <fileset dir="connector/src/main/resource"/>
         </jar>
     </target>
     
@@ -129,11 +129,6 @@
         <jar destfile="build/jar/mcf-sharepoint-wsdlstub.jar" basedir="build/wsdlclasses"/>
     </target>
 
-    <target name="wsdd" depends="precompile-check" if="canBuild">
-        <mkdir dir="dist/wsdd"/>
-        <copy todir="dist/wsdd" file="sharepoint-client-config.wsdd"/>
-    </target>
-
     <target name="integration">
         <mkdir dir="dist/integration"/>
         <copy todir="dist/integration">
@@ -160,7 +155,7 @@
         </copy>
     </target>
 
-    <target name="build" depends="lib,wsdd,integration"/>
+    <target name="build" depends="lib,integration"/>
     <target name="build-tests">
       <mkdir dir="build/test-jar"/>
     </target>

Modified: incubator/lcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SPSProxyHelper.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SPSProxyHelper.java?rev=1226429&r1=1226428&r2=1226429&view=diff
==============================================================================
--- incubator/lcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SPSProxyHelper.java
(original)
+++ incubator/lcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SPSProxyHelper.java
Mon Jan  2 14:21:26 2012
@@ -20,6 +20,11 @@ package org.apache.manifoldcf.crawler.co
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+
+import java.io.InputStream;
 
 import javax.xml.soap.*;
 
@@ -35,7 +40,23 @@ import org.apache.commons.httpclient.pro
 import org.apache.commons.httpclient.protocol.ProtocolFactory;
 import org.apache.commons.httpclient.HttpConnectionManager;
 import org.apache.axis.EngineConfiguration;
-import org.apache.axis.configuration.FileProvider;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axis.AxisEngine;
+import org.apache.axis.ConfigurationException;
+import org.apache.axis.Handler;
+import org.apache.axis.WSDDEngineConfiguration;
+import org.apache.axis.components.logger.LogFactory;
+import org.apache.axis.deployment.wsdd.WSDDDeployment;
+import org.apache.axis.deployment.wsdd.WSDDDocument;
+import org.apache.axis.deployment.wsdd.WSDDGlobalConfiguration;
+import org.apache.axis.encoding.TypeMappingRegistry;
+import org.apache.axis.handlers.soap.SOAPService;
+import org.apache.axis.utils.Admin;
+import org.apache.axis.utils.Messages;
+import org.apache.axis.utils.XMLUtils;
+import org.w3c.dom.Document;
 
 /**
 *
@@ -64,7 +85,8 @@ public class SPSProxyHelper {
   * @param userName
   * @param password
   */
-  public SPSProxyHelper( String serverUrl, String serverLocation, String decodedServerLocation,
String userName, String password, ProtocolFactory myFactory, String configFileName, HttpConnectionManager
connectionManager )
+  public SPSProxyHelper( String serverUrl, String serverLocation, String decodedServerLocation,
String userName, String password,
+    ProtocolFactory myFactory, Class resourceClass, String configFileName, HttpConnectionManager
connectionManager )
   {
     this.serverUrl = serverUrl;
     this.serverLocation = serverLocation;
@@ -76,7 +98,7 @@ public class SPSProxyHelper {
     this.userName = userName;
     this.password = password;
     this.myFactory = myFactory;
-    this.configuration = new FileProvider(configFileName);
+    this.configuration = new ResourceProvider(resourceClass,configFileName);
     this.connectionManager = connectionManager;
   }
 
@@ -2101,4 +2123,170 @@ public class SPSProxyHelper {
     }
   }
 
+  /** Implementation of EngineConfiguration that we'll use to get the wsdd file from a
+  * local resource.
+  */
+  protected static class ResourceProvider implements WSDDEngineConfiguration
+  {
+    private WSDDDeployment deployment = null;
+
+    private Class resourceClass;
+    private String resourceName;
+
+    /**
+     * Constructor setting the resource name.
+     */
+    public ResourceProvider(Class resourceClass, String resourceName) 
+    {
+      this.resourceClass = resourceClass;
+      this.resourceName = resourceName;
+    }
+
+    public WSDDDeployment getDeployment() {
+        return deployment;
+    }
+
+    public void configureEngine(AxisEngine engine)
+      throws ConfigurationException
+    {
+      try
+      {
+        InputStream resourceStream = resourceClass.getResourceAsStream(resourceName);
+        if (resourceStream == null)
+          throw new ConfigurationException("Resource not found: '"+resourceName+"'");
+        try
+        {
+          WSDDDocument doc = new WSDDDocument(XMLUtils.newDocument(resourceStream));
+          deployment = doc.getDeployment();
+
+          deployment.configureEngine(engine);
+          engine.refreshGlobalOptions();
+        }
+        finally
+        {
+          resourceStream.close();
+        }
+      }
+      catch (ConfigurationException e)
+      {
+        throw e;
+      }
+      catch (Exception e)
+      {
+        throw new ConfigurationException(e);
+      }
+    }
+
+    public void writeEngineConfig(AxisEngine engine)
+      throws ConfigurationException
+    {
+      // Do nothing
+    }
+
+    /**
+     * retrieve an instance of the named handler
+     * @param qname XXX
+     * @return XXX
+     * @throws ConfigurationException XXX
+     */
+    public Handler getHandler(QName qname) throws ConfigurationException
+    {
+      return deployment.getHandler(qname);
+    }
+
+    /**
+     * retrieve an instance of the named service
+     * @param qname XXX
+     * @return XXX
+     * @throws ConfigurationException XXX
+     */
+    public SOAPService getService(QName qname) throws ConfigurationException
+    {
+      SOAPService service = deployment.getService(qname);
+      if (service == null)
+      {
+        throw new ConfigurationException(Messages.getMessage("noService10",
+          qname.toString()));
+      }
+      return service;
+    }
+
+    /**
+     * Get a service which has been mapped to a particular namespace
+     * 
+     * @param namespace a namespace URI
+     * @return an instance of the appropriate Service, or null
+     */
+    public SOAPService getServiceByNamespaceURI(String namespace)
+      throws ConfigurationException
+    {
+      return deployment.getServiceByNamespaceURI(namespace);
+    }
+
+    /**
+     * retrieve an instance of the named transport
+     * @param qname XXX
+     * @return XXX
+     * @throws ConfigurationException XXX
+     */
+    public Handler getTransport(QName qname) throws ConfigurationException
+    {
+      return deployment.getTransport(qname);
+    }
+
+    public TypeMappingRegistry getTypeMappingRegistry()
+        throws ConfigurationException
+    {
+      return deployment.getTypeMappingRegistry();
+    }
+
+    /**
+     * Returns a global request handler.
+     */
+    public Handler getGlobalRequest() throws ConfigurationException
+    {
+      return deployment.getGlobalRequest();
+    }
+
+    /**
+     * Returns a global response handler.
+     */
+    public Handler getGlobalResponse() throws ConfigurationException
+    {
+      return deployment.getGlobalResponse();
+    }
+
+    /**
+     * Returns the global configuration options.
+     */
+    public Hashtable getGlobalOptions() throws ConfigurationException
+    {
+      WSDDGlobalConfiguration globalConfig = deployment.getGlobalConfiguration();
+            
+      if (globalConfig != null)
+        return globalConfig.getParametersTable();
+
+      return null;
+    }
+
+    /**
+     * Get an enumeration of the services deployed to this engine
+     */
+    public Iterator getDeployedServices() throws ConfigurationException
+    {
+      return deployment.getDeployedServices();
+    }
+
+    /**
+     * Get a list of roles that this engine plays globally.  Services
+     * within the engine configuration may also add additional roles.
+     *
+     * @return a <code>List</code> of the roles for this engine
+     */
+    public List getRoles()
+    {
+      return deployment.getRoles();
+    }
+  }
+  
 }

Modified: incubator/lcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SharePointRepository.java
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SharePointRepository.java?rev=1226429&r1=1226428&r2=1226429&view=diff
==============================================================================
--- incubator/lcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SharePointRepository.java
(original)
+++ incubator/lcf/trunk/connectors/sharepoint/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/sharepoint/SharePointRepository.java
Mon Jan  2 14:21:26 2012
@@ -189,11 +189,8 @@ public class SharePointRepository extend
 
       fileBaseUrl = serverUrl + encodedServerLocation;
 
-      File sharepointWSDDLocation = ManifoldCF.getFileProperty(wsddPathProperty);
-      if (sharepointWSDDLocation == null)
-        throw new ManifoldCFException("SharePoint wsdd location path (property "+wsddPathProperty+")
must be specified!");
-
-      proxy = new SPSProxyHelper( serverUrl, encodedServerLocation, serverLocation, userName,
password, myFactory, sharepointWSDDLocation.toString(),
+      proxy = new SPSProxyHelper( serverUrl, encodedServerLocation, serverLocation, userName,
password,
+        myFactory, getClass(), "sharepoint-client-config.wsdd",
         connectionManager );
     }
   }

Modified: incubator/lcf/trunk/site/src/documentation/content/xdocs/how-to-build-and-deploy.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/trunk/site/src/documentation/content/xdocs/how-to-build-and-deploy.xml?rev=1226429&r1=1226428&r2=1226429&view=diff
==============================================================================
--- incubator/lcf/trunk/site/src/documentation/content/xdocs/how-to-build-and-deploy.xml (original)
+++ incubator/lcf/trunk/site/src/documentation/content/xdocs/how-to-build-and-deploy.xml Mon
Jan  2 14:21:26 2012
@@ -81,7 +81,6 @@
           <tr><th><em>dist</em> file/directory</th><th>Meaning</th></tr>
           <tr><td><em>connectors.xml</em></td><td>an
xml file describing the connectors that should be registered</td></tr>
           <tr><td><em>connector-lib</em></td><td>jars
for all the connectors, referred to by properties.xml</td></tr>
-          <tr><td><em>wsdd</em></td><td>wsdd files that
are needed by the included connectors in order to function</td></tr>
           <tr><td><em>xxx-process</em></td><td>scripts,
classpath jars, and -D switch values needed for a required connector-specific process</td></tr>
           <tr><td><em>script-engine</em></td><td>jars
and scripts for running the ManifoldCF script interpreter</td></tr>
           <tr><td><em>multiprocess-example</em></td><td>scripts
and jars for an example that uses the multiple process model</td></tr>
@@ -516,8 +515,6 @@ cd dist/example
             <tr><td>org.apache.manifoldcf.scheduling</td><td>No</td><td>Log
document scheduling activity.  Legal values INFO, WARN, or DEBUG.</td></tr>
             <tr><td>org.apache.manifoldcf.authorityconnectors</td><td>No</td><td>Log
authority connector activity.  Legal values INFO, WARN, or DEBUG.</td></tr>
             <tr><td>org.apache.manifoldcf.authorityservice</td><td>No</td><td>Log
authority service activity.  Legal values are INFO, WARN, or DEBUG.</td></tr>
-            <tr><td>org.apache.manifoldcf.sharepoint.wsddpath</td><td>Yes,
for SharePoint Connector</td><td>Path to the SharePoint Connector wsdd file.</td></tr>
-            <tr><td>org.apache.manifoldcf.meridio.wsddpath</td><td>Yes,
for Meridio Connector</td><td>Path to the Meridio Connector wsdd file.</td></tr>
           </table>
           <p></p>
         </section>



Mime
View raw message