chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1516861 - in /chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main: java/org/apache/chemistry/opencmis/fileshare/ resources/ webapp/WEB-INF/classes/
Date Fri, 23 Aug 2013 14:36:36 GMT
Author: fmui
Date: Fri Aug 23 14:36:35 2013
New Revision: 1516861

URL: http://svn.apache.org/r1516861
Log:
FileShare: reenabled custom type definitions

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareCmisServiceFactory.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareTypeManager.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/resources/example-type.xml
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/webapp/WEB-INF/classes/repository.properties

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareCmisServiceFactory.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareCmisServiceFactory.java?rev=1516861&r1=1516860&r2=1516861&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareCmisServiceFactory.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareCmisServiceFactory.java
Fri Aug 23 14:36:35 2013
@@ -147,9 +147,24 @@ public class FileShareCmisServiceFactory
                 userManager.addLogin(username, password);
             } else if (key.startsWith(PREFIX_TYPE)) {
                 // load type definition
-                String typeFile = replaceSystemProperties(parameters.get(key));
-
-                LOG.info("Loading type definition from file: {}", typeFile);
+                String typeFile = replaceSystemProperties(parameters.get(key).trim());
+                if (typeFile.length() == 0) {
+                    continue;
+                }
+
+                LOG.info("Loading type definition: {}", typeFile);
+
+                if (typeFile.charAt(0) == '/') {
+                    try {
+                        typeManager.loadTypeDefinitionFromResource(typeFile);
+                        continue;
+                    } catch (IllegalArgumentException e) {
+                        // resource not found -> try it as a regular file
+                    } catch (Exception e) {
+                        LOG.warn("Could not load type defintion from resource '{}': {}",
typeFile, e.getMessage(), e);
+                        continue;
+                    }
+                }
 
                 try {
                     typeManager.loadTypeDefinitionFromFile(typeFile);

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareTypeManager.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareTypeManager.java?rev=1516861&r1=1516860&r2=1516861&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareTypeManager.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/java/org/apache/chemistry/opencmis/fileshare/FileShareTypeManager.java
Fri Aug 23 14:36:35 2013
@@ -117,6 +117,8 @@ public class FileShareTypeManager {
             newType.addPropertyDefinition(basePropDef);
         }
 
+        typeDefinitions.put(newType.getId(), newType);
+
         if (LOG.isDebugEnabled()) {
             LOG.debug("Added type '{}'.", type.getId());
         }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/resources/example-type.xml
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/resources/example-type.xml?rev=1516861&r1=1516860&r2=1516861&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/resources/example-type.xml
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/resources/example-type.xml
Fri Aug 23 14:36:35 2013
@@ -23,7 +23,7 @@
 	xsi:type="cmis:cmisTypeDocumentDefinitionType">
 	<cmis:id>myTestDocumentType</cmis:id>
 	<cmis:localName>myTestDocumentType</cmis:localName>
-	<cmis:localNamespace>http://opencmis.org/demo/</cmis:localNamespace>
+	<cmis:localNamespace>http://chemistry.apache.org/opencmis/demo/</cmis:localNamespace>
 	<cmis:parentId>cmis:document</cmis:parentId>
 	<cmis:displayName>My Test Document Type</cmis:displayName>
 	<cmis:queryName>TESTDOCTYPE</cmis:queryName>
@@ -32,7 +32,7 @@
 	<cmis:creatable>true</cmis:creatable>
 	<cmis:fileable>true</cmis:fileable>
 	<cmis:queryable>false</cmis:queryable>
-	<cmis:fulltextindexed>false</cmis:fulltextindexed>
+	<cmis:fulltextIndexed>false</cmis:fulltextIndexed>
 	<cmis:includedInSupertypeQuery>true</cmis:includedInSupertypeQuery>
 	<cmis:controllablePolicy>false</cmis:controllablePolicy>
 	<cmis:controllableACL>false</cmis:controllableACL>

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/webapp/WEB-INF/classes/repository.properties
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/webapp/WEB-INF/classes/repository.properties?rev=1516861&r1=1516860&r2=1516861&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/webapp/WEB-INF/classes/repository.properties
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-fileshare/src/main/webapp/WEB-INF/classes/repository.properties
Fri Aug 23 14:36:35 2013
@@ -19,8 +19,9 @@ login.1 = test:test
 login.2 = cmisuser:password
 login.3 = reader:reader
 
-#type.1 = {user.home}{file.separator}type1.xml
-#type.2 = {user.home}{file.separator}type2.xml
+type.1 = /example-type.xml
+#type.2 = {user.home}{file.separator}type1.xml
+#type.3 = {user.home}{file.separator}type2.xml
 
 repository.test = {user.home}
 repository.test.readwrite = test, cmisuser



Mime
View raw message