Folder Resource Iterator/1.0

From WebLab Wiki
Jump to navigationJump to search
Folder Resource Iterator
Details
Service Interfaces QueueManager, Configurable
Exchange model: WebLab 1.2.2
Versions: <ListSubPages />
Licence LGPL 2.1
Supported OS Windows/Linux/MacOs
Integrated COTS Commons-IO
Binary folder-resource-iterator-1.0.war
Sources folder-resource-iterator-1.0-sources.jar
Javadoc folder-resource-iterator-1.0-javadoc.jar
SVN Resource Iterator%2Ffolder-resource-iterator%2F folder-resource-iterator
Maven Artifact

<groupId>org.ow2.weblab.webservices</groupId>

<artifactId>folder-resource-iterator</artifactId>

<version>1.0</version>
Release Note


This service aims to gather files from a local folder and create a Resource pointing to each file, in order to allow others services to work on these files.

Configuration

The configuration can be done by two means.

First of all, the use of Spring/CXF constructor enables to set some properties, especially the default behavior when no configure request has been sent to a particular usage context. The following fields car be defined on a ConfigurationBean object, i.e. the singleton used for both Configurable and QueueManager interface.

The Configurable interface allows to configure a specific folder to a specific UsageContext. The ConfigureArgs must contain :

  • a UsageContext
  • a POK containing the following triples:
    • <serviceUri> <hasConfiguration> <uriOfTheConfigurationCreated> that links the service to a configuration definition
    • <uriOfTheConfigurationCreated> a <configurationType>
    • <uriOfTheConfigurationCreated> <hasFolderToCrawl> "The folder to be crawled"
    • <uriOfTheConfigurationCreated> <isLinkedToContext> "The usageContext to be used in queue manager"

UsageContext effects

The specification of a usage context allow to crawl a particular folder, previously configurated. It is the key used to retrieve iterator inside.

Examples of SOAP Input/Output

  • configure Request TODO
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:con="http://weblab.ow2.org/core/1.2/services/configurable">
   <soapenv:Header/>
   <soapenv:Body>
      <con:configureArgs>
	<usageContext>Configured</usageContext>
         <configuration xsi:type="wl:PieceOfKnowledge" uri="weblab://configuration/PoK" xmlns:wl="http://weblab.ow2.org/core/1.2/model#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <data>
               <rdf:RDF xmlns:dct="http://purl.org/dc/terms/" xmlns:conf="http://weblab.ow2.org/core/1.2/ontology/configuration#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:wlr="http://weblab.ow2.org/core/1.2/ontology/retrieval#" xmlns:wlp="http://weblab.ow2.org/core/1.2/ontology/processing#">
                  <rdf:Description rdf:about="weblab:theSampleConfiguration">
                     <conf:hasFolderToCrawl>C:\tmp</conf:hasFolderToCrawl>
                     <conf:isLinkedToContext>Configured</conf:isLinkedToContext>
                     <rdf:type rdf:resource="http://weblab.ow2.org/core/1.2/ontology/configuration#Configuration"/>
                  </rdf:Description>
                  <rdf:Description rdf:about="http://weblab.ow2.org/services/folder-resource-iterator">
                     <conf:hasConfiguration rdf:resource="weblab:theSampleConfiguration"/>
                  </rdf:Description>
               </rdf:RDF>
            </data>
         </configuration>
      </con:configureArgs>
   </soapenv:Body>
</soapenv:Envelope>
  • configure Return
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <ns8:configureReturn xmlns:ns2="http://weblab.ow2.org/core/1.2/services/trainable" xmlns:ns3="http://weblab.ow2.org/core/1.2/services/indexer" xmlns:ns4="http://weblab.ow2.org/core/1.2/services/reportprovider" xmlns:ns5="http://weblab.ow2.org/core/1.2/services/exception" xmlns:wl="http://weblab.ow2.org/core/1.2/model#" xmlns:ns7="http://weblab.ow2.org/core/1.2/services/searcher" xmlns:ns8="http://weblab.ow2.org/core/1.2/services/configurable" xmlns:ns9="http://weblab.ow2.org/core/1.2/services/queuemanager" xmlns:ns10="http://weblab.ow2.org/core/1.2/services/resourcecontainer" xmlns:ns11="http://weblab.ow2.org/core/1.2/services/sourcereader" xmlns:ns12="http://weblab.ow2.org/core/1.2/services/analyser"/>
   </soap:Body>
</soap:Envelope>
  • resetConfiguration Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:con="http://weblab.ow2.org/core/1.2/services/configurable">
   <soapenv:Header/>
   <soapenv:Body>
      <con:resetConfigurationArgs>
         <usageContext>weblab://randomUri/randomUri</usageContext>
      </con:resetConfigurationArgs>
   </soapenv:Body>
</soapenv:Envelope>
  • resetConfiguration Return
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <ns4:resetConfigurationReturn xmlns:ns2="http://weblab.ow2.org/core/1.2/services/queuemanager" xmlns:ns3="http://weblab.ow2.org/core/1.2/model#" xmlns:ns4="http://weblab.ow2.org/core/1.2/services/configurable" xmlns:ns5="http://weblab.ow2.org/core/1.2/services/sourcereader"/>
   </soap:Body>
</soap:Envelope>
  • nextResource Request
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:que="http://weblab.ow2.org/core/1.2/services/queuemanager">
   <soapenv:Header/>
   <soapenv:Body>
      <que:nextResourceArgs>
         <usageContext>Configured</usageContext>
      </que:nextResourceArgs>
   </soapenv:Body>
</soapenv:Envelope>
  • nextResource Return
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <ns9:nextResourceReturn xmlns:ns2="http://weblab.ow2.org/core/1.2/services/trainable" xmlns:ns3="http://weblab.ow2.org/core/1.2/services/indexer" xmlns:ns4="http://weblab.ow2.org/core/1.2/services/reportprovider" xmlns:ns5="http://weblab.ow2.org/core/1.2/services/exception" xmlns:wl="http://weblab.ow2.org/core/1.2/model#" xmlns:ns7="http://weblab.ow2.org/core/1.2/services/searcher" xmlns:ns8="http://weblab.ow2.org/core/1.2/services/configurable" xmlns:ns9="http://weblab.ow2.org/core/1.2/services/queuemanager" xmlns:ns10="http://weblab.ow2.org/core/1.2/services/resourcecontainer" xmlns:ns11="http://weblab.ow2.org/core/1.2/services/sourcereader" xmlns:ns12="http://weblab.ow2.org/core/1.2/services/analyser">
         <resource xsi:type="wl:Document" uri="weblab://of/whatever/file/is/in/the/crawled/directory" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
[...]
         </resource>
      </ns9:nextResourceReturn>
   </soap:Body>
</soap:Envelope>

Known Limitations

N/A

Dependencies

List off all dependencies of this service:

org.ow2.weblab.webservices:folder-resource-iterator:war:1.0
+- org.ow2.weblab.core.helpers:rdf-helper-jena:jar:1.3.2:compile
|  \- com.hp.hpl.jena:jena:jar:2.6.4:compile
|     +- com.hp.hpl.jena:iri:jar:0.8:compile
|     +- com.ibm.icu:icu4j:jar:3.4.4:compile
|     +- xerces:xercesImpl:jar:2.7.1:compile
|     +- org.slf4j:slf4j-api:jar:1.5.8:compile
|     +- org.slf4j:slf4j-log4j12:jar:1.5.8:runtime
|     \- log4j:log4j:jar:1.2.13:runtime
+- commons-io:commons-io:jar:2.0.1:compile
+- org.ow2.weblab.core:model:jar:1.2.2:compile
+- org.ow2.weblab.core:extended:jar:1.2.2:compile
+- org.ow2.weblab.core:annotator:jar:1.2.4:compile
|  \- joda-time:joda-time:jar:1.6.2:compile
+- org.apache.cxf:cxf-rt-frontend-jaxws:jar:2.4.0:compile
|  +- xml-resolver:xml-resolver:jar:1.2:compile
|  +- asm:asm:jar:3.3:compile
|  +- org.apache.cxf:cxf-api:jar:2.4.0:compile
|  |  +- org.apache.cxf:cxf-common-utilities:jar:2.4.0:compile
|  |  +- org.apache.ws.xmlschema:xmlschema-core:jar:2.0:compile
|  |  \- org.apache.neethi:neethi:jar:3.0.0:compile
|  |     +- wsdl4j:wsdl4j:jar:1.6.2:compile
|  |     \- org.codehaus.woodstox:woodstox-core-asl:jar:4.1.1:compile
|  |        \- org.codehaus.woodstox:stax2-api:jar:3.0.2:compile
|  +- org.apache.cxf:cxf-rt-core:jar:2.4.0:compile
|  |  +- com.sun.xml.bind:jaxb-impl:jar:2.1.13:compile
|  |  \- org.apache.geronimo.specs:geronimo-javamail_1.4_spec:jar:1.7.1:compile
|  +- org.apache.cxf:cxf-rt-bindings-soap:jar:2.4.0:compile
|  |  +- org.apache.cxf:cxf-tools-common:jar:2.4.0:compile
|  |  \- org.apache.cxf:cxf-rt-databinding-jaxb:jar:2.4.0:compile
|  +- org.apache.cxf:cxf-rt-bindings-xml:jar:2.4.0:compile
|  +- org.apache.cxf:cxf-rt-frontend-simple:jar:2.4.0:compile
|  \- org.apache.cxf:cxf-rt-ws-addr:jar:2.4.0:compile
+- org.apache.cxf:cxf-rt-transports-http:jar:2.4.0:compile
|  +- org.apache.cxf:cxf-rt-transports-common:jar:2.4.0:compile
|  \- org.springframework:spring-web:jar:3.0.5.RELEASE:compile
|     +- aopalliance:aopalliance:jar:1.0:compile
|     +- org.springframework:spring-beans:jar:3.0.5.RELEASE:compile
|     +- org.springframework:spring-context:jar:3.0.5.RELEASE:compile
|     |  +- org.springframework:spring-aop:jar:3.0.5.RELEASE:compile
|     |  +- org.springframework:spring-expression:jar:3.0.5.RELEASE:compile
|     |  \- org.springframework:spring-asm:jar:3.0.5.RELEASE:compile
|     \- org.springframework:spring-core:jar:3.0.5.RELEASE:compile
+- xalan:xalan:jar:2.7.1:compile
|  \- xalan:serializer:jar:2.7.1:compile
|     \- xml-apis:xml-apis:jar:1.3.04:compile
+- commons-logging:commons-logging:jar:1.1.1:compile
+- junit:junit:jar:4.8.2:test
\- javax.servlet:servlet-api:jar:2.4:provided