chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1213082 - in /chemistry/playground/moreq2010/moreq2010: ./ src/main/java/org/apache/chemistry/moreq2010/util/
Date Sun, 11 Dec 2011 21:34:29 GMT
Author: jens
Date: Sun Dec 11 21:34:29 2011
New Revision: 1213082

URL: http://svn.apache.org/viewvc?rev=1213082&view=rev
Log:
MoReq2010 example code in playground: fix bugs, add manifest, allow command line parameters

Modified:
    chemistry/playground/moreq2010/moreq2010/pom.xml
    chemistry/playground/moreq2010/moreq2010/src/main/java/org/apache/chemistry/moreq2010/util/CmisClient.java
    chemistry/playground/moreq2010/moreq2010/src/main/java/org/apache/chemistry/moreq2010/util/Main.java
    chemistry/playground/moreq2010/moreq2010/src/main/java/org/apache/chemistry/moreq2010/util/Validator.java

Modified: chemistry/playground/moreq2010/moreq2010/pom.xml
URL: http://svn.apache.org/viewvc/chemistry/playground/moreq2010/moreq2010/pom.xml?rev=1213082&r1=1213081&r2=1213082&view=diff
==============================================================================
--- chemistry/playground/moreq2010/moreq2010/pom.xml (original)
+++ chemistry/playground/moreq2010/moreq2010/pom.xml Sun Dec 11 21:34:29 2011
@@ -135,6 +135,16 @@
                 <configuration>
                     <archive>  
                         <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
+                        <addMavenDescriptor>false</addMavenDescriptor>
+                        <manifest>
+                            <mainClass>org.apache.chemistry.moreq2010.util.Main</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>  

Modified: chemistry/playground/moreq2010/moreq2010/src/main/java/org/apache/chemistry/moreq2010/util/CmisClient.java
URL: http://svn.apache.org/viewvc/chemistry/playground/moreq2010/moreq2010/src/main/java/org/apache/chemistry/moreq2010/util/CmisClient.java?rev=1213082&r1=1213081&r2=1213082&view=diff
==============================================================================
--- chemistry/playground/moreq2010/moreq2010/src/main/java/org/apache/chemistry/moreq2010/util/CmisClient.java
(original)
+++ chemistry/playground/moreq2010/moreq2010/src/main/java/org/apache/chemistry/moreq2010/util/CmisClient.java
Sun Dec 11 21:34:29 2011
@@ -45,6 +45,7 @@ import org.apache.chemistry.moreq2010.ja
 import org.apache.chemistry.moreq2010.jaxb.EventTYPE;
 import org.apache.chemistry.moreq2010.jaxb.Export;
 import org.apache.chemistry.moreq2010.jaxb.GroupTYPE;
+import org.apache.chemistry.moreq2010.jaxb.GroupmembershipTYPE;
 import org.apache.chemistry.moreq2010.jaxb.HeldTYPE;
 import org.apache.chemistry.moreq2010.jaxb.HierarchicalClass;
 import org.apache.chemistry.moreq2010.jaxb.MceTYPE;
@@ -524,6 +525,11 @@ public class CmisClient implements Moreq
             properties.put(Constants.DESCRIPTION , user.getDescription().getValue() );
         properties.put(Constants.FIRST_USED_TIMESTAMP , convert(user.getFirstUsed()));
         properties.put(Constants.DESTROYED_TIMESTAMP , convert(user.getDestroyed()));
+        if (user.getGroupMembership() != null && user.getGroupMembership().getGroupId()
!= null) {
+            GroupmembershipTYPE groups = user.getGroupMembership();
+            if (groups.getGroupId().size() > 0)
+                properties.put(Constants.GROUP_IDENTIFIER, groups.getGroupId());
+        }
         // TODO: contextual metadada
 
         Document doc = usersFolder.createDocument(properties, null, VersioningState.NONE);

Modified: chemistry/playground/moreq2010/moreq2010/src/main/java/org/apache/chemistry/moreq2010/util/Main.java
URL: http://svn.apache.org/viewvc/chemistry/playground/moreq2010/moreq2010/src/main/java/org/apache/chemistry/moreq2010/util/Main.java?rev=1213082&r1=1213081&r2=1213082&view=diff
==============================================================================
--- chemistry/playground/moreq2010/moreq2010/src/main/java/org/apache/chemistry/moreq2010/util/Main.java
(original)
+++ chemistry/playground/moreq2010/moreq2010/src/main/java/org/apache/chemistry/moreq2010/util/Main.java
Sun Dec 11 21:34:29 2011
@@ -46,7 +46,9 @@ public class Main {
     public static void main( String[] args ) {
 
         LOG.info("Main starting...");
-        String inputFileName = "src/test/resources/example1.xml";
+        String inputFileName = args.length > 0 ? args[0] : null;
+        if (null == inputFileName || inputFileName.length() == 0)
+            inputFileName = "src/test/resources/example1.xml";
         try {
             MoreqParserCallback cmisClient = ParserCallbackFactory.createParserCallback(CmisClient.class.getName());
             MoreqXmlParser parser = new MoreqXmlParser(cmisClient);

Modified: chemistry/playground/moreq2010/moreq2010/src/main/java/org/apache/chemistry/moreq2010/util/Validator.java
URL: http://svn.apache.org/viewvc/chemistry/playground/moreq2010/moreq2010/src/main/java/org/apache/chemistry/moreq2010/util/Validator.java?rev=1213082&r1=1213081&r2=1213082&view=diff
==============================================================================
--- chemistry/playground/moreq2010/moreq2010/src/main/java/org/apache/chemistry/moreq2010/util/Validator.java
(original)
+++ chemistry/playground/moreq2010/moreq2010/src/main/java/org/apache/chemistry/moreq2010/util/Validator.java
Sun Dec 11 21:34:29 2011
@@ -49,7 +49,12 @@ public class Validator {
         Document doc = null;
         try {
             DocumentBuilder parser = factory.newDocumentBuilder();
-            String fileName = "src/test/resources/example1.xml";
+            String fileName = args[0];
+            if (args.length > 0)
+                fileName = args[0];
+            else
+                fileName = "src/test/resources/example1.xml";
+            
             doc = parser.parse(fileName);
             System.out.println("Parsing of file " + fileName + " succeded.");
             fileName = "src/test/resources/example2.xml";



Mime
View raw message