Local-file-exposer/2.0

From WebLab Wiki
Jump to navigationJump to search
Local File Exposer
Details
Service Interfaces Analyser
Exchange model: WebLab 1.2.2
Versions: <ListSubPages />
Licence LGPL 2.1
Supported OS Windows/Linux/MacOs
Binary local-file-exposer-{{{version}}}.war
Sources local-file-exposer-{{{version}}}-sources.jar
Javadoc local-file-exposer-{{{version}}}-javadoc.jar
SVN local-file-exposer
Maven Artifact

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

<artifactId>local-file-exposer</artifactId>

<version>{{{version}}}</version>
Release Note


This service is used in conjunction with an Apache Tomcat or Apache server.

The purpose is to annotate documents in input with an "exposition URL" i.e. an URL that can be used in a web browser to access this document.

This service only works when processed file are exposed using the server and have the same naming pattern than the read annotation on the document (in most of the case, we use dc:source).


Configuration

This service can be configured using by passing an instance of ExposerConfigBean to the CXF constructor. The bean has the following properties:

  • annotateAsUri: Whether the URL shall be annotated as Resource. If not it will be a literal statement. Default value is false.
  • byString: The String to be added at the beginning of the String to replace; in most of the case it's protocol://host:port/exposition_pattern/. Default value is "".
  • exposedAsUri: The predicate's URI of the statement that will contain the exposed URL of the Document. Default value is http://weblab-project.org/core/model/property/isExposedAs.
  • nbStartCharToReplace: The number of character to be remove at the beginning of the String to replace; in most of the case it's the path to the whole folder that will be exposed. Default value is 0.
  • replacementForSpace: The java method for URL encoding replaces spaces by '+'. But servers like Tomcat or Apache are using "%20" (in UTF-8 and ISO-8859-1 for instance) as replacement String. Default value is %20.
  • serviceUri: The URI of the service to be added in the created annotation (with a produced by statement) or null if nothing should be added.
  • sourceUri: The predicate's URI of the statement that contains the original source of the Document to be modified. Default value is: http://purl.org/dc/elements/1.1/source.
  • sourceIsResource: Sometimes the object of the statement containing the original source of the Document is a Resource (since an URL might be an URI); in this case this parameter has to be true. Default value is false.
  • urlEncodeBetweenSlashes: Whether the URL shall be annotated as Resource. If not it will be a literal statement. Default value is false.
  • urlEncoding: When encoding a URL it's needed to use the encoding used by the server for URL encoding; otherwise some file might never be exposed (especially files containing accent in their name or other complex characters). Default value is ISO-8859-1.


UsageContext effects

The usageContext is not used.

Examples of SOAP Input/Output

Input

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:anal="http://weblab.ow2.org/core/1.2/services/analyser">
  <soapenv:Header/>
  <soapenv:Body>
    <anal:processArgs>
      <resource xsi:type="ns3:Document" uri="weblab://azerty/yuiop" xmlns:ns3="http://weblab.ow2.org/core/1.2/model#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <annotation uri="weblab://azerty/yuiop#a0">
          
            <rdf:RDF xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
              <rdf:Description rdf:about="weblab://azerty/yuiop">
                <dc:source>D:\données\fd+gg.doc</dc:source>
              </rdf:Description>
            </rdf:RDF>
          
        </annotation>
      </resource>
    </anal:processArgs>
  </soapenv:Body>
</soapenv:Envelope>


Output

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <ns5:processReturn xmlns:ns2="http://weblab.ow2.org/core/1.2/model#" xmlns:ns3="http://weblab.ow2.org/core/1.2/services/resourcecontainer" xmlns:ns4="http://weblab.ow2.org/core/1.2/services/configurable" xmlns:ns5="http://weblab.ow2.org/core/1.2/services/analyser" xmlns:ns6="http://weblab.ow2.org/core/1.2/services/searcher" xmlns:ns7="http://weblab.ow2.org/core/1.2/services/indexer" xmlns:ns8="http://weblab.ow2.org/core/1.2/services/reportprovider" xmlns:ns9="http://weblab.ow2.org/core/1.2/services/trainable" xmlns:ns10="http://weblab.ow2.org/core/1.2/services/queuemanager" xmlns:ns11="http://weblab.ow2.org/core/1.2/services/exception" xmlns:ns12="http://weblab.ow2.org/core/1.2/services/sourcereader">
      <resource xsi:type="ns2:Document" uri="weblab://azerty/yuiop" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <annotation uri="weblab://azerty/yuiop#a0">
          
            <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/">
              <rdf:Description rdf:about="weblab://azerty/yuiop">
                <dc:source>D:\données\fd+gg.doc</dc:source>
              </rdf:Description>
            </rdf:RDF>
          
        </annotation>
        <annotation uri="weblab://azerty/yuiop#a1">
          
            <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dct="http://purl.org/dc/terms/" xmlns:wlp="http://weblab.ow2.org/core/1.2/ontology/processing#" xmlns:wlr="http://weblab.ow2.org/core/1.2/ontology/retrieval#">
              <rdf:Description rdf:about="weblab://azerty/yuiop">
                <wlp:isExposedAs>http://the-server:8080/files/donn%C3%A9es/fd%2Bgg.doc</wlp:isExposedAs>
              </rdf:Description>
              <rdf:Description rdf:about="weblab://azerty/yuiop#a1">
                <wlp:isProducedBy rdf:resource="http://weblab.ow2.org/services/local-file-exposer"/>
              </rdf:Description>
            </rdf:RDF>
          
        </annotation>
      </resource>
    </ns5:processReturn>
  </soap:Body>
</soap:Envelope>

Known Limitations

N/A

Dependencies

List off all dependencies of this service:

 org.ow2.weblab.webservices:local-file-exposer:war:2.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
+- 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