chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1363574 - in /chemistry/opencmis/trunk: chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/resources/ chemistry-opencmis-test/chemistry-opencmis-test-client/resources/ chemistry-opencmis-test/chemistry-opencmis-test-clie...
Date Thu, 19 Jul 2012 23:02:09 GMT
Author: jens
Date: Thu Jul 19 23:02:08 2012
New Revision: 1363574

URL: http://svn.apache.org/viewvc?rev=1363574&view=rev
Log:
InMemory: add a video sample type, fix some minor bugs in metadata extraction

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/resources/types.xml
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-client/resources/TypeDefinitions.txt
    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/main/java/org/apache/chemistry/opencmis/client/main/ObjGenApp.java
    chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-client/src/main/resources/mapping.properties

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/resources/types.xml
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/resources/types.xml?rev=1363574&r1=1363573&r2=1363574&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/resources/types.xml
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/resources/types.xml
Thu Jul 19 23:02:08 2012
@@ -5,7 +5,7 @@
      xmlns:chem="http://chemistry.apache.org/schemas/TypeDefnitions">
 <cmisra:type xsi:type="cmisTypeDocumentDefinitionType">
     <id>audioFile</id>
-    <localName>sap</localName>
+    <localName>apache</localName>
     <localNamespace>ns</localNamespace>
     <parentId>cmis:document</parentId>
     <displayName>Audio File</displayName>
@@ -277,7 +277,7 @@
 
 <cmisra:type xsi:type="cmisTypeDocumentDefinitionType">
     <id>emailDocument</id>
-    <localName>sap</localName>
+    <localName>apache</localName>
     <localNamespace>ns</localNamespace>
     <parentId>cmis:document</parentId>
     <displayName>Email Document</displayName>
@@ -425,7 +425,7 @@
 
 <cmisra:type xsi:type="cmisTypeDocumentDefinitionType">
     <id>exifImage</id>
-    <localName>sap</localName>
+    <localName>apache</localName>
     <localNamespace>ns</localNamespace>
     <parentId>cmis:document</parentId>
     <displayName>EXIF Image</displayName>
@@ -1621,7 +1621,7 @@
 
 <cmisra:type xsi:type="cmisTypeDocumentDefinitionType">
     <id>officeDocument</id>
-    <localName>sap</localName>
+    <localName>apache</localName>
     <localNamespace>ns</localNamespace>
     <parentId>cmis:document</parentId>
     <displayName>Office Document</displayName>
@@ -2073,7 +2073,7 @@
 
 <cmisra:type xsi:type="cmisTypeDocumentDefinitionType">
     <id>pdfDocument</id>
-    <localName>sap</localName>
+    <localName>apache</localName>
     <localNamespace>ns</localNamespace>
     <parentId>cmis:document</parentId>
     <displayName>PDF Document</displayName>
@@ -2251,4 +2251,200 @@
     </propertyStringDefinition>
 </cmisra:type>
 
+<cmisra:type xsi:type="cmisTypeDocumentDefinitionType">
+    <id>videoFile</id>
+    <localName>apache</localName>
+    <localNamespace>ns</localNamespace>
+    <parentId>cmis:document</parentId>
+    <displayName>Video File</displayName>
+    <queryName>VIDEO_FILE</queryName>
+    <description>Video Movies</description>
+    <baseId>cmis:document</baseId>
+    <creatable>true</creatable>
+    <fileable>true</fileable>
+    <queryable>true</queryable>
+    <fulltextIndexed>true</fulltextIndexed>
+    <includedInSupertypeQuery>true</includedInSupertypeQuery>
+    <controllablePolicy>false</controllablePolicy>
+    <controllableACL>true</controllableACL>
+    <versionable>false</versionable>
+    <contentStreamAllowed>allowed</contentStreamAllowed>
+    <propertyStringDefinition>
+        <id>artist</id>
+        <localName>sap</localName>
+        <displayName>Artist</displayName>
+        <queryName>ARTIST</queryName>
+        <description>Artist</description>
+        <localNamespace>0x013b</localNamespace>
+        <propertyType>string</propertyType>
+        <cardinality>single</cardinality>
+        <updatability>readwrite</updatability>
+        <inherited>false</inherited>
+        <required>false</required>
+        <queryable>true</queryable>
+        <orderable>true</orderable>
+        <openChoice>false</openChoice>
+    </propertyStringDefinition>
+    <propertyStringDefinition>
+        <id>album</id>
+        <localName>sap</localName>
+        <displayName>Album</displayName>
+        <queryName>ALBUM</queryName>
+        <description>title</description>
+        <localNamespace></localNamespace>
+        <propertyType>string</propertyType>
+        <cardinality>single</cardinality>
+        <updatability>readwrite</updatability>
+        <inherited>false</inherited>
+        <required>false</required>
+        <queryable>true</queryable>
+        <orderable>true</orderable>
+        <openChoice>false</openChoice>
+    </propertyStringDefinition>
+    <propertyStringDefinition>
+        <id>title</id>
+        <localName>sap</localName>
+        <displayName>Title</displayName>
+        <queryName>TITLE</queryName>
+        <description>Title</description>
+        <localNamespace></localNamespace>
+        <propertyType>string</propertyType>
+        <cardinality>single</cardinality>
+        <updatability>readwrite</updatability>
+        <inherited>false</inherited>
+        <required>false</required>
+        <queryable>true</queryable>
+        <orderable>true</orderable>
+        <openChoice>false</openChoice>
+    </propertyStringDefinition>
+    <propertyStringDefinition>
+        <id>comment</id>
+        <localName>sap</localName>
+        <displayName>Comment</displayName>
+        <queryName>COMMENT</queryName>
+        <description>Comment</description>
+        <localNamespace></localNamespace>
+        <propertyType>string</propertyType>
+        <cardinality>single</cardinality>
+        <updatability>readwrite</updatability>
+        <inherited>false</inherited>
+        <required>false</required>
+        <queryable>false</queryable>
+        <orderable>false</orderable>
+        <openChoice>false</openChoice>
+    </propertyStringDefinition>
+    <propertyStringDefinition>
+        <id>genre</id>
+        <localName>sap</localName>
+        <displayName>Genre</displayName>
+        <queryName>GENRE</queryName>
+        <description>Genre</description>
+        <localNamespace></localNamespace>
+        <propertyType>string</propertyType>
+        <cardinality>single</cardinality>
+        <updatability>readwrite</updatability>
+        <inherited>false</inherited>
+        <required>false</required>
+        <queryable>true</queryable>
+        <orderable>true</orderable>
+        <openChoice>false</openChoice>
+    </propertyStringDefinition>
+    <propertyIntegerDefinition>
+        <id>length</id>
+        <localName>sap</localName>
+        <displayName>Length</displayName>
+        <queryName>LENGTH</queryName>
+        <description>Length in seconds</description>
+        <localNamespace></localNamespace>
+        <propertyType>integer</propertyType>
+        <cardinality>single</cardinality>
+        <updatability>readwrite</updatability>
+        <inherited>false</inherited>
+        <required>false</required>
+        <queryable>false</queryable>
+        <orderable>false</orderable>
+        <openChoice>false</openChoice>
+    </propertyIntegerDefinition>
+    <propertyIntegerDefinition>
+        <id>track</id>
+        <localName>sap</localName>
+        <displayName>Track</displayName>
+        <queryName>TRACK</queryName>
+        <description>Track in album</description>
+        <localNamespace></localNamespace>
+        <propertyType>integer</propertyType>
+        <cardinality>single</cardinality>
+        <updatability>readwrite</updatability>
+        <inherited>false</inherited>
+        <required>false</required>
+        <queryable>true</queryable>
+        <orderable>true</orderable>
+        <openChoice>false</openChoice>
+    </propertyIntegerDefinition>
+    <propertyStringDefinition>
+        <id>year</id>
+        <localName>sap</localName>
+        <displayName>Year</displayName>
+        <queryName>YEAR</queryName>
+        <description>release date of albun</description>
+        <localNamespace></localNamespace>
+        <propertyType>string</propertyType>
+        <cardinality>single</cardinality>
+        <updatability>readwrite</updatability>
+        <inherited>false</inherited>
+        <required>false</required>
+        <queryable>true</queryable>
+        <orderable>true</orderable>
+        <openChoice>false</openChoice>
+    </propertyStringDefinition>
+    <propertyStringDefinition>
+        <id>discNo</id>
+        <localName>sap</localName>
+        <displayName>Disc Number</displayName>
+        <queryName>DISC_NUMBER</queryName>
+        <description>number of disc / total discs</description>
+        <localNamespace></localNamespace>
+        <propertyType>string</propertyType>
+        <cardinality>single</cardinality>
+        <updatability>readwrite</updatability>
+        <inherited>false</inherited>
+        <required>false</required>
+        <queryable>false</queryable>
+        <orderable>false</orderable>
+        <openChoice>false</openChoice>
+    </propertyStringDefinition>
+    <propertyIntegerDefinition>
+        <id>imageWidth</id>
+        <localName>sap</localName>
+        <displayName>Image Width</displayName>
+        <queryName>IMAGE_WIDTH</queryName>
+        <description>Image Width</description>
+        <localNamespace>0x0100</localNamespace>
+        <propertyType>integer</propertyType>
+        <cardinality>single</cardinality>
+        <updatability>oncreate</updatability>
+        <inherited>false</inherited>
+        <required>false</required>
+        <queryable>false</queryable>
+        <orderable>false</orderable>
+        <openChoice>false</openChoice>
+    </propertyIntegerDefinition>
+    <propertyIntegerDefinition>
+        <id>imageHeight</id>
+        <localName>sap</localName>
+        <displayName>Image Height</displayName>
+        <queryName>IMAGE_HEIGHT</queryName>
+        <description>Image Height</description>
+        <localNamespace>0x0101</localNamespace>
+        <propertyType>integer</propertyType>
+        <cardinality>single</cardinality>
+        <updatability>oncreate</updatability>
+        <inherited>false</inherited>
+        <required>false</required>
+        <queryable>false</queryable>
+        <orderable>false</orderable>
+        <openChoice>false</openChoice>
+    </propertyIntegerDefinition>
+</cmisra:type>
+
 </chem:typeDefinitions>

Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-client/resources/TypeDefinitions.txt
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-client/resources/TypeDefinitions.txt?rev=1363574&r1=1363573&r2=1363574&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-client/resources/TypeDefinitions.txt
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-client/resources/TypeDefinitions.txt
Thu Jul 19 23:02:08 2012
@@ -1,6 +1,6 @@
 #EXIF type definition http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/EXIF.html
 document
-audioFile;sap
+audioFile;apache
 Audio File
 Audio Content (compressed or uncompressed)
     Artist
@@ -20,7 +20,7 @@ Audio Content (compressed or uncompresse
     Compressor Version
 
 document
-emailDocument;sap
+emailDocument;apache
 Email Document
 Document of type Email
     From
@@ -33,7 +33,7 @@ Document of type Email
     Last Save Date
 
 document
-exifImage;sap
+exifImage;apache
 EXIF Image
 Image with EXIF tags
     Image Width
@@ -92,7 +92,7 @@ Image with EXIF tags
     Data Precision
 
 document
-officeDocument;sap
+officeDocument;apache
 Office Document
 Document of type Office
     Application Name
@@ -124,7 +124,7 @@ Document of type Office
     Last Printed
 
 document
-pdfDocument;sap
+pdfDocument;apache
 PDF Document
 Document of type PDF
     No Pages
@@ -137,3 +137,19 @@ Document of type PDF
     Created Date
     Modified Date
     Trapped
+
+document
+videoFile;apache
+Video File
+Video Movies
+    Artist
+    Album
+    Title
+    Comment
+    Genre
+    Length
+    Track
+    Year
+    Disc Number
+    Image Width
+    Image Height

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=1363574&r1=1363573&r2=1363574&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 Jul 19 23:02:08 2012
@@ -208,11 +208,12 @@ public class FileCopier {
                 // Session available? if yes do conversion
                 TypeDefinition td = null;
                 if (null!= session) {
-                    session.getTypeDefinition(typeId);
+                    td = session.getTypeDefinition(typeId);
                     if (null == td)
                         throw new MapperException("CMIS type " + typeId + " does not exist
on server.");
+                    else
+                    	LOG.info("Detected MIME type: "+ mimeType + " is mapped to CMIS type
id: " + td.getId());
                 }
-                LOG.info("Detected MIME type: "+ mimeType + " is mapped to CMIS type id:
" + td.getId());
                 
                 parser.extractMetadata(f, td);
                 Map<String, Object> properties = parser.getCmisProperties();

Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-client/src/main/java/org/apache/chemistry/opencmis/client/main/ObjGenApp.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/main/ObjGenApp.java?rev=1363574&r1=1363573&r2=1363574&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-client/src/main/java/org/apache/chemistry/opencmis/client/main/ObjGenApp.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-client/src/main/java/org/apache/chemistry/opencmis/client/main/ObjGenApp.java
Thu Jul 19 23:02:08 2012
@@ -582,7 +582,7 @@ public class ObjGenApp {
         String fileName = options.valueOf(fLocalFile);
         
         if ((null == fileName || fileName.length() == 0)) {
-            System.out.println("Error: You either have to provide a --file option to test
metadata extraction.");
+            System.out.println("Error: You have to provide a --file option to test metadata
extraction.");
             return;
         }
         

Modified: chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-client/src/main/resources/mapping.properties
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-client/src/main/resources/mapping.properties?rev=1363574&r1=1363573&r2=1363574&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-client/src/main/resources/mapping.properties
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-test/chemistry-opencmis-test-client/src/main/resources/mapping.properties
Thu Jul 19 23:02:08 2012
@@ -15,7 +15,7 @@
 
 # configuration file how to map file metadata to CMIS types and properties
 
-mapping.contentTypes = image, mp3, pdf, office, email
+mapping.contentTypes = image, mp3, pdf, office, email, video
 #default CMIS type id for those files/folders without a special mapping configured
 mapping.contentType.default.document = cmis:document
 mapping.contentType.default.folder = cmis:folder
@@ -27,6 +27,7 @@ mapping.contentType.image = image/jpeg
 mapping.contentType.pdf = application/pdf
 mapping.contentType.office = application/vnd.openxmlformats-officedocument.presentationml.presentation:application/vnd.openxmlformats-officedocument.presentationml.template:application/vnd.openxmlformats-officedocument.presentationml.slideshow:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet:vnd.openxmlformats-officedocument.spreadsheetml.template:application/vnd.openxmlformats-officedocument.wordprocessingml.document:application/vnd.openxmlformats-officedocument.wordprocessingml.template
 mapping.contentType.email = application/vnd.ms-outlook:message/rfc822
+mapping.contentType.video = video/mp4
 
 # CMIS type ids mapped to each key in value of mapping.contentTypes
 mapping.contentType.mp3.typeId = audioFile
@@ -34,6 +35,7 @@ mapping.contentType.image.typeId = exifI
 mapping.contentType.pdf.typeId = pdfDocument
 mapping.contentType.office.typeId = officeDocument
 mapping.contentType.email.typeId = emailDocument
+mapping.contentType.video.typeId = videoFile
 
 # classes for parsers and property mappers, usually MetadataParserTika and PropertyMapperTika
 # can be overridden with special implementations for other parsers, MetadataParserTika and
@@ -48,6 +50,8 @@ mapping.contentType.office.parserClass =
 mapping.contentType.office.mapperClass = org.apache.chemistry.opencmis.client.mapper.PropertyMapperTika
 mapping.contentType.email.parserClass = org.apache.chemistry.opencmis.client.parser.MetadataParserTika
 mapping.contentType.email.mapperClass = org.apache.chemistry.opencmis.client.mapper.PropertyMapperTika
+mapping.contentType.video.parserClass = org.apache.chemistry.opencmis.client.parser.MetadataParserTika
+mapping.contentType.video.mapperClass = org.apache.chemistry.opencmis.client.mapper.PropertyMapperTika
 
 # for content types that are not detected by Tika or that you want to treat differently
 # can be overridden depending on the file extension (.xyz to foo/bar)
@@ -188,3 +192,14 @@ mapping.contentType.email.id.subject = s
 mapping.contentType.email.id.Creation-Date = creationDate
 mapping.contentType.email.id.Last-Save-Date = lastSaveDate
 
+#video
+mapping.contentType.video.id.xmpDM\:artist = artist
+mapping.contentType.video.id.xmpDM\:album = album
+mapping.contentType.video.id.title = title
+mapping.contentType.video.id.xmpDM\:logComment = comment
+mapping.contentType.video.id.xmpDM\:genre = genre
+mapping.contentType.video.id.xxx = length
+mapping.contentType.video.id.xmpDM\:trackNumber = track
+mapping.contentType.video.id.xmpDM\:releaseDate = year
+mapping.contentType.video.id.tiff:ImageWidth = imageWidth
+mapping.contentType.video.id.tiff:ImageLength = imageHeight



Mime
View raw message