chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1069457 - in /incubator/chemistry/opencmis/trunk: chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/ chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/a...
Date Thu, 10 Feb 2011 16:35:01 GMT
Author: fmui
Date: Thu Feb 10 16:35:00 2011
New Revision: 1069457

URL: http://svn.apache.org/viewvc?rev=1069457&view=rev
Log:
- fixed JavaDoc
- added some minor improvements to Workbench

Modified:
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/CmisObjectProperties.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/VersionTable.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/scripts/CMIS.groovy
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/scripts/template.groovy

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/CmisObjectProperties.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/CmisObjectProperties.java?rev=1069457&r1=1069456&r2=1069457&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/CmisObjectProperties.java
(original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/CmisObjectProperties.java
Thu Feb 10 16:35:00 2011
@@ -60,54 +60,54 @@ public interface CmisObjectProperties {
 
     /**
      * Returns the name of this CMIS object (CMIS property
-     * <code>cmis:name<code>).
+     * <code>cmis:name</code>).
      */
     String getName();
 
     /**
      * Returns the user who created this CMIS object (CMIS property
-     * <code>cmis:createdBy<code>).
+     * <code>cmis:createdBy</code>).
      */
     String getCreatedBy();
 
     /**
      * Returns the timestamp when this CMIS object has been created (CMIS
-     * property <code>cmis:creationDate<code>).
+     * property <code>cmis:creationDate</code>).
      */
     GregorianCalendar getCreationDate();
 
     /**
      * Returns the user who modified this CMIS object (CMIS property
-     * <code>cmis:lastModifiedBy<code>).
+     * <code>cmis:lastModifiedBy</code>).
      */
     String getLastModifiedBy();
 
     /**
      * Returns the timestamp when this CMIS object has been modified (CMIS
-     * property <code>cmis:lastModificationDate<code>).
+     * property <code>cmis:lastModificationDate</code>).
      */
     GregorianCalendar getLastModificationDate();
 
     /**
      * Returns the id of the base type of this CMIS object (CMIS property
-     * <code>cmis:baseTypeId<code>).
+     * <code>cmis:baseTypeId</code>).
      */
     BaseTypeId getBaseTypeId();
 
     /**
      * Returns the base type of this CMIS object (object type identified by
-     * <code>cmis:baseTypeId<code>).
+     * <code>cmis:baseTypeId</code>).
      */
     ObjectType getBaseType();
 
     /**
      * Returns the type of this CMIS object (object type identified by
-     * <code>cmis:objectTypeId<code>).
+     * <code>cmis:objectTypeId</code>).
      */
     ObjectType getType();
 
     /**
-     * Returns the change token (CMIS property <code>cmis:changeToken<code>).
+     * Returns the change token (CMIS property <code>cmis:changeToken</code>).
      */
     String getChangeToken();
 }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/VersionTable.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/VersionTable.java?rev=1069457&r1=1069456&r2=1069457&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/VersionTable.java
(original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/java/org/apache/chemistry/opencmis/workbench/details/VersionTable.java
Thu Feb 10 16:35:00 2011
@@ -32,8 +32,8 @@ public class VersionTable extends Abstra
 
     private static final long serialVersionUID = 1L;
 
-    private static final String[] COLUMN_NAMES = { "Name", "Label", "Major", "Id" };
-    private static final int[] COLUMN_WIDTHS = { 200, 200, 80, 400 };
+    private static final String[] COLUMN_NAMES = { "Name", "Label", "Latest", "Major", "Latest
Major", "Id", "Filename", "MIME Type", "Length" };
+    private static final int[] COLUMN_WIDTHS = { 200, 200, 50, 50, 50, 400, 200, 100, 100
};
 
     private static final int OLD = 60 * 1000;
 
@@ -78,14 +78,36 @@ public class VersionTable extends Abstra
         case 1:
             return version.getVersionLabel();
         case 2:
-            return version.isMajorVersion();
+            return version.isLatestVersion();
         case 3:
+            return version.isMajorVersion();
+        case 4:
+            return version.isLatestMajorVersion();
+        case 5:
             return version.getId();
+        case 6:
+            return version.getContentStreamFileName();
+        case 7:
+            return version.getContentStreamMimeType();
+        case 8:
+            return version.getContentStreamLength() == -1 ? null : version.getContentStreamLength();
         }
 
         return null;
     }
 
+    @Override
+    public Class<?> getDetailColumClass(int columnIndex) {
+        if((columnIndex == 2) || (columnIndex == 3) || (columnIndex == 4)) {
+            return Boolean.class;            
+        }
+        else if (columnIndex == 8) {
+            return Long.class;
+        }
+
+        return super.getDetailColumClass(columnIndex);
+    }
+
     private List<Document> getVersions() {
         // not a document -> no versions
         if (!(getObject() instanceof Document)) {

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/scripts/CMIS.groovy
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/scripts/CMIS.groovy?rev=1069457&r1=1069456&r2=1069457&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/scripts/CMIS.groovy
(original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/scripts/CMIS.groovy
Thu Feb 10 16:35:00 2011
@@ -79,6 +79,11 @@ class CMIS {
     void printProperties(id) {
         CmisObject object = getObject(id)
         
+        if(object.getProperties() == null || object.getProperties().isEmpty()) {
+            println "- no properties (???) -"
+            return
+        }
+        
         for(Property prop: object.getProperties()) {
             printProperty(prop)
         }
@@ -88,6 +93,123 @@ class CMIS {
         println prop.getId() + ": " + prop.getValuesAsString()
     }
     
+    void printAllowableActions(id) {
+        CmisObject object = getObject(id)
+        
+        if(object.getAllowableActions() == null || 
+            object.getAllowableActions().getAllowableActions() == null || 
+            object.getAllowableActions().getAllowableActions().isEmpty()) {
+            println "- no allowable actions -"
+            return
+        }
+        
+        for(Action action: object.getAllowableActions().getAllowableActions()) {
+            println action.value()
+        }
+    }
+    
+    void printVersions(id) {
+         Document doc = getDocument(id)
+        
+         List<Document> versions = doc.getAllVersions()
+         
+         if(versions == null || versions.isEmpty()) {
+             println "- no versions -"
+             return
+         }
+         
+         for(Document version: doc.getAllVersions()) {
+             println(version.getVersionLabel() + " (" + version.getId() +") [" + version.getType().getId()
+ "]")
+         }
+    }
+    
+    void printChildren(id) {
+        Folder folder = getFolder(id)
+       
+        boolean hasChildren = false
+        for(CmisObject child: folder.getChildren()) {
+            println(child.getName() + " (" + child.getId() +") [" + child.getType().getId()
+ "]")
+            hasChildren = true;
+        }
+        
+        if(!hasChildren) {
+            println "- no children -"
+        }
+    }
+    
+    void printRelationships(id) {
+        CmisObject object = getObject(id)
+           
+        boolean hasRelationships = false
+        for(CmisObject rel: object.getRelationships()) {
+            println(rel.getName() + " (" + rel.getId() +") [" + rel.getType().getId() + "]")
+            hasRelationships = true
+        }
+        
+        if(!hasRelationships) {
+            println "- no relationships -"
+        }
+    }
+    
+    void printRenditions(id) {
+         Document doc = getDocument(id)
+        
+         List<Rendition> renditons = doc.getRenditions()
+         
+         if(renditons == null || renditons.isEmpty()) {
+             println "- no renditions -"
+             return
+         }
+         
+         for(Rendition rendition: renditons) {
+             println(rendition.getTitle() + " (MIME type: " + rendition.getMimeType() + ",
length: "  + rendition.getLength() + " bytes)")
+         }
+    }
+    
+    void printObjectSummary(id) {
+        CmisObject object = getObject(id)
+        
+        println "Name:        " + object.getName()
+        println "Object Id:   " + object.getId()
+        println "Object Type: " + object.getType().getId()
+        println ""
+        println "--------------------------------------------------"
+        println "Properties:"
+        println "--------------------------------------------------"
+        printProperties(object)
+        println ""
+        println "--------------------------------------------------"
+        println "Allowable Actions:"
+        println "--------------------------------------------------"
+        printAllowableActions(object)
+        println ""
+        println "--------------------------------------------------"
+        println "Relationships:"
+        println "--------------------------------------------------"
+        printRelationships(object)
+        
+        if(object instanceof Document) {
+            println ""
+            println "--------------------------------------------------"
+            println "Versions:"
+            println "--------------------------------------------------"
+            printVersions(object)
+            println ""
+            println "--------------------------------------------------"
+            println "Renditions:"
+            println "--------------------------------------------------"
+            printRenditions(object)
+        }
+        
+        if(object instanceof Folder) {
+            println ""
+            println "--------------------------------------------------"
+            println "Children:"
+            println "--------------------------------------------------"
+            printChildren(id)
+        }
+    }
+    
     void download(id, destination) {
         Document doc = getDocument(id)
         

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/scripts/template.groovy
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/scripts/template.groovy?rev=1069457&r1=1069456&r2=1069457&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/scripts/template.groovy
(original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-workbench/chemistry-opencmis-workbench/src/main/resources/scripts/template.groovy
Thu Feb 10 16:35:00 2011
@@ -22,4 +22,5 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.client.api.*
 
 // def cmis = new scripts.CMIS(session)
-// println session.repositoryInfo.name
\ No newline at end of file
+// println session.repositoryInfo.name
+// cmis.printObjectSummary "/"
\ No newline at end of file



Mime
View raw message