You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by je...@apache.org on 2012/04/19 20:34:30 UTC

svn commit: r1328069 - in /chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-client: cp.bat pom.xml runcmd.bat src/main/java/org/apache/chemistry/opencmis/client/filecopy/FileCopier.java src/test/resources/TypesXmlGenerator.groovy

Author: jens
Date: Thu Apr 19 18:34:30 2012
New Revision: 1328069

URL: http://svn.apache.org/viewvc?rev=1328069&view=rev
Log:
update to Tika 1.1
add a workaround for a tika bug when parsing MP3 tags
allow content when creating types
convert spaces to underscores when uploading files

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-client/cp.bat
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-client/pom.xml
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-client/runcmd.bat
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-client/src/main/java/org/apache/chemistry/opencmis/client/filecopy/FileCopier.java
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-client/src/test/resources/TypesXmlGenerator.groovy

Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-client/cp.bat
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-client/cp.bat?rev=1328069&r1=1328068&r2=1328069&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-client/cp.bat (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-client/cp.bat Thu Apr 19 18:34:30 2012
@@ -27,4 +27,31 @@ set CP=target\classes;^
 %M2_REPO%/org/jvnet/staxex/stax-ex/1.2/stax-ex-1.2.jar;^
 %M2_REPO%/com/sun/xml/stream/buffer/streambuffer/0.9/streambuffer-0.9.jar;^
 %M2_REPO%/org/codehaus/woodstox/wstx-asl/3.2.3/wstx-asl-3.2.3.jar;^
-%M2_REPO%/net/sf/jopt-simple/jopt-simple/3.2/jopt-simple-3.2.jar
+%M2_REPO%/net/sf/jopt-simple/jopt-simple/3.2/jopt-simple-3.2.jar;^
+%M2_REPO%/org/apache/james/apache-mime4j-core/0.7/apache-mime4j-core-0.7.jar;^
+%M2_REPO%/org/apache/james/apache-mime4j-dom/0.7/apache-mime4j-dom-0.7.jar;^
+%M2_REPO%/asm/asm/3.1/asm-3.1.jar;^
+%M2_REPO%/org/bouncycastle/bcmail-jdk15/1.45/bcmail-jdk15-1.45.jar;^
+%M2_REPO%/org/bouncycastle/bcprov-jdk15/1.45/bcprov-jdk15-1.45.jar;^
+%M2_REPO%/de/l3s/boilerpipe/boilerpipe/1.1.0/boilerpipe-1.1.0.jar;^
+%M2_REPO%/org/apache/commons/commons-compress/1.3/commons-compress-1.3.jar;^
+%M2_REPO%/commons-io/commons-io/2.0.1/commons-io-2.0.1.jar;^
+%M2_REPO%/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar;^
+%M2_REPO%/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar;^
+%M2_REPO%/org/apache/pdfbox/fontbox/1.6.0/fontbox-1.6.0.jar;^
+%M2_REPO%/org/apache/geronimo/specs/geronimo-stax-api_1.0_spec/1.0.1/geronimo-stax-api_1.0_spec-1.0.1.jar;^
+%M2_REPO%/jdom/jdom/1.0/jdom-1.0.jar;^
+%M2_REPO%/org/apache/pdfbox/jempbox/1.6.0/jempbox-1.6.0.jar;^
+%M2_REPO%/com/drewnoakes/metadata-extractor/2.4.0-beta-1/metadata-extractor-2.4.0-beta-1.jar;^
+%M2_REPO%/edu/ucar/netcdf/4.2-min/netcdf-4.2-min.jar;^
+%M2_REPO%/org/apache/pdfbox/pdfbox/1.6.0/pdfbox-1.6.0.jar;^
+%M2_REPO%/org/apache/poi/poi/3.8-beta4/poi-3.8-beta4.jar;^
+%M2_REPO%/org/apache/poi/poi-ooxml/3.8-beta4/poi-ooxml-3.8-beta4.jar;^
+%M2_REPO%/org/apache/poi/poi-ooxml-schemas/3.8-beta4/poi-ooxml-schemas-3.8-beta4.jar;^
+%M2_REPO%/org/apache/poi/poi-scratchpad/3.8-beta4/poi-scratchpad-3.8-beta4.jar;^
+%M2_REPO%/rome/rome/0.9/rome-0.9.jar;^
+%M2_REPO%/org/slf4j/slf4j-api/1.5.6/slf4j-api-1.5.6.jar;^
+%M2_REPO%/org/ccil/cowan/tagsoup/tagsoup/1.2.1/tagsoup-1.2.1.jar;^
+%M2_REPO%/org/apache/tika/tika-core/1.1/tika-core-1.1.jar;^
+%M2_REPO%/org/apache/tika/tika-parsers/1.1/tika-parsers-1.1.jar;^
+%M2_REPO%/org/apache/xmlbeans/xmlbeans/2.3.0/xmlbeans-2.3.0.jar
\ No newline at end of file

Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-client/pom.xml
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-client/pom.xml?rev=1328069&r1=1328068&r2=1328069&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-client/pom.xml (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-client/pom.xml Thu Apr 19 18:34:30 2012
@@ -1,83 +1,83 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-    <!--
-        Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
-        with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless
-        required by applicable law or agreed to in writing, software distributed under the License is distributed on an
-        "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
-        specific language governing permissions and limitations under the License.
-    -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
-    <modelVersion>4.0.0</modelVersion>
-
-    <parent>
-        <groupId>org.apache.chemistry.opencmis</groupId>
-        <artifactId>chemistry-opencmis</artifactId>
-        <version>0.8.0-SNAPSHOT</version>
-        <relativePath>../../pom.xml</relativePath>
-    </parent>
-
-    <artifactId>chemistry-opencmis-test-client</artifactId>
-    <name>OpenCMIS Test Client App</name>
-    
-    <properties>
-        <parentBasedir>../../</parentBasedir>
-    </properties>
-    
-	<build>
-		<plugins>
-			<plugin>
-                <artifactId>maven-jar-plugin</artifactId>
-                <configuration>
-                    <archive>
-                        <addMavenDescriptor>false</addMavenDescriptor>
-                        <manifest>
-                            <mainClass>org.apache.chemistry.opencmis.client.main.ObjGenApp</mainClass>
-                            <addClasspath>true</addClasspath>
-                            <classpathPrefix />
-                        </manifest>
-                        <manifestEntries>
-                            <X-Compile-Source-JDK>${maven.compile.source}</X-Compile-Source-JDK>
-                            <X-Compile-Target-JDK>${maven.compile.target}</X-Compile-Target-JDK>
-                        </manifestEntries>
-                    </archive>
-                </configuration>
-            </plugin>
-		</plugins>
-	</build>
-	
-    <dependencies>
-        <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>chemistry-opencmis-client-impl</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>chemistry-opencmis-test-util</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-		<dependency>
-            <groupId>org.apache.tika</groupId>
-            <artifactId>tika-parsers</artifactId>
-            <version>1.0</version>
-        </dependency>
-        <dependency>
-            <groupId>net.sf.jopt-simple</groupId>
-            <artifactId>jopt-simple</artifactId>
-            <version>3.2</version>
-        </dependency>
-        <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>chemistry-opencmis-client-bindings</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>commons-io</groupId>
-            <artifactId>commons-io</artifactId>
-            <version>2.0.1</version>
-        </dependency>     
-    </dependencies>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+
+    <!--
+        Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
+        with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless
+        required by applicable law or agreed to in writing, software distributed under the License is distributed on an
+        "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
+        specific language governing permissions and limitations under the License.
+    -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.chemistry.opencmis</groupId>
+        <artifactId>chemistry-opencmis</artifactId>
+        <version>0.8.0-SNAPSHOT</version>
+        <relativePath>../../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>chemistry-opencmis-test-client</artifactId>
+    <name>OpenCMIS Test Client App</name>
+    
+    <properties>
+        <parentBasedir>../../</parentBasedir>
+    </properties>
+    
+	<build>
+		<plugins>
+			<plugin>
+                <artifactId>maven-jar-plugin</artifactId>
+                <configuration>
+                    <archive>
+                        <addMavenDescriptor>false</addMavenDescriptor>
+                        <manifest>
+                            <mainClass>org.apache.chemistry.opencmis.client.main.ObjGenApp</mainClass>
+                            <addClasspath>true</addClasspath>
+                            <classpathPrefix />
+                        </manifest>
+                        <manifestEntries>
+                            <X-Compile-Source-JDK>${maven.compile.source}</X-Compile-Source-JDK>
+                            <X-Compile-Target-JDK>${maven.compile.target}</X-Compile-Target-JDK>
+                        </manifestEntries>
+                    </archive>
+                </configuration>
+            </plugin>
+		</plugins>
+	</build>
+	
+    <dependencies>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>chemistry-opencmis-client-impl</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>chemistry-opencmis-test-util</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+		<dependency>
+            <groupId>org.apache.tika</groupId>
+            <artifactId>tika-parsers</artifactId>
+            <version>1.1</version>
+        </dependency>
+        <dependency>
+            <groupId>net.sf.jopt-simple</groupId>
+            <artifactId>jopt-simple</artifactId>
+            <version>3.2</version>
+        </dependency>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>chemistry-opencmis-client-bindings</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+            <version>2.0.1</version>
+        </dependency>     
+    </dependencies>
+</project>

Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-client/runcmd.bat
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-client/runcmd.bat?rev=1328069&r1=1328068&r2=1328069&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-client/runcmd.bat (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-client/runcmd.bat Thu Apr 19 18:34:30 2012
@@ -23,5 +23,7 @@ set JAVA_HOME=d:\Java\jdk1.6.0_22-x64
 set PATH=%JAVA_HOME%\bin
 call cp.bat
 java -Dorg.apache.chemistry.opencmis.binding.atompub.url=http://localhost:8080/inmemory/atom ^
--Dorg.apache.chemistry.opencmis.binding.spi.type=atompub -cp %CP% ^
-org.apache.chemistry.opencmis.client.main.ObjGenApp %*
+-Dorg.apache.chemistry.opencmis.binding.spi.type=atompub ^
+-Dorg.apache.chemistry.opencmis.user=jens ^
+-Dorg.apache.chemistry.opencmis.password=dummy ^
+-cp %CP% org.apache.chemistry.opencmis.client.main.ObjGenApp %*

Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-client/src/main/java/org/apache/chemistry/opencmis/client/filecopy/FileCopier.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-client/src/main/java/org/apache/chemistry/opencmis/client/filecopy/FileCopier.java?rev=1328069&r1=1328068&r2=1328069&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-client/src/main/java/org/apache/chemistry/opencmis/client/filecopy/FileCopier.java (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-client/src/main/java/org/apache/chemistry/opencmis/client/filecopy/FileCopier.java Thu Apr 19 18:34:30 2012
@@ -107,7 +107,7 @@ public class FileCopier {
             // extract metadata: first get a parser
             MetadataParser parser = CFG.getParser(mimeType);
             if (null == parser) {
-                properties.put(PropertyIds.NAME, f.getName());
+                properties.put(PropertyIds.NAME, f.getName().replaceAll(" ", "_"));
                 properties.put(PropertyIds.OBJECT_TYPE_ID, CFG.getDefaultDocumentType());
             } else {
                 parser.reset();
@@ -139,7 +139,8 @@ public class FileCopier {
             ContentStream contentStream = session.getObjectFactory().createContentStream(fileName,
                     length, mimeType, is);
             if (!properties.containsKey(PropertyIds.NAME))
-                properties.put(PropertyIds.NAME, f.getName());
+                properties.put(PropertyIds.NAME, f.getName().replaceAll(" ", "_"));
+            LOG.debug("uploading document with content lenth: " + contentStream.getLength());
             Document doc = parentFolder.createDocument(properties, contentStream, VersioningState.NONE);
             id = doc.getId();
             LOG.info("New document created with id: " + id + ", name: " +  properties.get(PropertyIds.NAME) + " in folder: " + parentFolder.getId());
@@ -167,7 +168,7 @@ public class FileCopier {
             parentFolder = (Folder) session.getObject(parentFolderId);
         Map<String, Object> properties = new HashMap<String, Object>();
         File f = new File(fileName);
-        properties.put(PropertyIds.NAME, f.getName());
+        properties.put(PropertyIds.NAME, f.getName().replaceAll(" ", "_"));
         properties.put(PropertyIds.OBJECT_TYPE_ID, CFG.getDefaultFolderType());
         try {
             Folder folder = parentFolder.createFolder(properties);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-client/src/test/resources/TypesXmlGenerator.groovy
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-client/src/test/resources/TypesXmlGenerator.groovy?rev=1328069&r1=1328068&r2=1328069&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-client/src/test/resources/TypesXmlGenerator.groovy (original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-client/src/test/resources/TypesXmlGenerator.groovy Thu Apr 19 18:34:30 2012
@@ -215,7 +215,7 @@ def genTypeDef (name, id, descr, typeKin
 	outFile.println("    <controllableACL>true</controllableACL>")
     if (typeKind == "document") {
         outFile.println("    <versionable>false</versionable>")
-        outFile.println("    <contentStreamAllowed>notallowed</contentStreamAllowed>")
+        outFile.println("    <contentStreamAllowed>allowed</contentStreamAllowed>")
     }
     if (props != null)
         props.each {