Adapt to changes in Argeo Connect
authorMathieu Baudier <mbaudier@argeo.org>
Thu, 15 Mar 2018 10:44:13 +0000 (11:44 +0100)
committerMathieu Baudier <mbaudier@argeo.org>
Thu, 15 Mar 2018 10:44:13 +0000 (11:44 +0100)
dep/org.argeo.suite.platform/pom.xml
org.argeo.suite.apps/META-INF/spring/backend-services.xml
org.argeo.suite.workbench.rap/src/org/argeo/suite/workbench/commands/ImportEntities.java
org.argeo.suite.workbench.rap/src/org/argeo/suite/workbench/commands/JxlUtils.java [new file with mode: 0644]
pom.xml

index 5d34a80d773578068e13891620cc2d59a763c673..4e6153d36a6b3fd1b145e3f0d746f0647b0ed2ba 100644 (file)
                        <artifactId>org.argeo.suite.workbench.rap</artifactId>
                        <version>0.1.13-SNAPSHOT</version>
                </dependency>
                        <artifactId>org.argeo.suite.workbench.rap</artifactId>
                        <version>0.1.13-SNAPSHOT</version>
                </dependency>
-               <dependency>
-                       <groupId>org.argeo.connect</groupId>
-                       <artifactId>org.argeo.theme.argeo2</artifactId>
-                       <version>2.1.79-SNAPSHOT</version>
-               </dependency>
                <dependency>
                        <groupId>org.argeo.suite</groupId>
                        <artifactId>org.argeo.suite.web</artifactId>
                <dependency>
                        <groupId>org.argeo.suite</groupId>
                        <artifactId>org.argeo.suite.web</artifactId>
                        <artifactId>org.argeo.connect.platform</artifactId>
                        <version>${version.argeo-connect}</version>
                </dependency>
                        <artifactId>org.argeo.connect.platform</artifactId>
                        <version>${version.argeo-connect}</version>
                </dependency>
+               
+               <!-- Argeo TP Extras -->
+               <dependency>
+                       <groupId>org.argeo.tp.payment</groupId>
+                       <artifactId>com.stripe</artifactId>
+               </dependency>
+               
        </dependencies>
        <profiles>
                <profile>
        </dependencies>
        <profiles>
                <profile>
index d8b2e4eaab7bb9a16da620c41ec099ba86c6db0a..3fdd31002bbc322838fb8f3ba9df3d8e1ab459ed 100644 (file)
@@ -26,7 +26,7 @@
                <property name="activitiesService" ref="activitiesService" />\r
        </bean>\r
 \r
                <property name="activitiesService" ref="activitiesService" />\r
        </bean>\r
 \r
-       <bean id="documentsService" class="org.argeo.documents.DocumentsService" />\r
+       <bean id="documentsService" class="org.argeo.documents.core.DocumentsServiceImpl" />\r
 \r
        <!-- order is important -->\r
        <util:list id="knownAppServices">\r
 \r
        <!-- order is important -->\r
        <util:list id="knownAppServices">\r
index 1771486a85d71d8d8bb553d88c132090d55d8712..b9906e912aaae9b4e2e5e266e73573b931851a7d 100644 (file)
@@ -1,7 +1,7 @@
 package org.argeo.suite.workbench.commands;
 
 package org.argeo.suite.workbench.commands;
 
-import static org.argeo.connect.util.JxlUtils.getStringValue;
 import static org.argeo.eclipse.ui.EclipseUiUtils.notEmpty;
 import static org.argeo.eclipse.ui.EclipseUiUtils.notEmpty;
+import static org.argeo.suite.workbench.commands.JxlUtils.getStringValue;
 
 import java.io.File;
 import java.io.FileInputStream;
 
 import java.io.File;
 import java.io.FileInputStream;
@@ -31,7 +31,6 @@ import org.argeo.connect.ConnectNames;
 import org.argeo.connect.resources.ResourcesNames;
 import org.argeo.connect.resources.ResourcesService;
 import org.argeo.connect.util.ConnectJcrUtils;
 import org.argeo.connect.resources.ResourcesNames;
 import org.argeo.connect.resources.ResourcesService;
 import org.argeo.connect.util.ConnectJcrUtils;
-import org.argeo.connect.util.JxlUtils;
 import org.argeo.eclipse.ui.EclipseUiUtils;
 import org.argeo.jcr.JcrUtils;
 import org.argeo.people.ContactValueCatalogs;
 import org.argeo.eclipse.ui.EclipseUiUtils;
 import org.argeo.jcr.JcrUtils;
 import org.argeo.people.ContactValueCatalogs;
diff --git a/org.argeo.suite.workbench.rap/src/org/argeo/suite/workbench/commands/JxlUtils.java b/org.argeo.suite.workbench.rap/src/org/argeo/suite/workbench/commands/JxlUtils.java
new file mode 100644 (file)
index 0000000..8be4fa4
--- /dev/null
@@ -0,0 +1,82 @@
+package org.argeo.suite.workbench.commands;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.argeo.connect.ConnectException;
+import org.argeo.eclipse.ui.EclipseUiUtils;
+
+import jxl.Cell;
+import jxl.CellType;
+import jxl.JXLException;
+import jxl.Sheet;
+import jxl.Workbook;
+import jxl.WorkbookSettings;
+
+/** Centralise useful methods to simplify development with JXL library */
+class JxlUtils {
+
+       public static boolean isEmptyCell(Sheet sheet, int x, int y) {
+               Cell cell = sheet.getCell(x, y);
+               CellType type = cell.getType();
+               return type == CellType.EMPTY;
+       }
+
+       public static String getStringValue(Sheet sheet, int x, int y) {
+               Cell cell = sheet.getCell(x, y);
+               CellType type = cell.getType();
+               String stringValue = null;
+               if (type == CellType.LABEL || type == CellType.NUMBER)
+                       stringValue = cell.getContents();
+               return stringValue;
+       }
+
+       public static String getCompulsoryStringValue(Sheet sheet, int x, int y) {
+               Cell cell = sheet.getCell(x, y);
+               CellType type = cell.getType();
+               String stringValue = null;
+               if (type == CellType.LABEL)
+                       stringValue = cell.getContents();
+               else if (type == CellType.NUMBER)
+                       stringValue = cell.getContents();
+               if (EclipseUiUtils.isEmpty(stringValue))
+                       throw new ConnectException("No name defined at [" + x + "," + y + "], cannot parse indicator file");
+               return stringValue;
+       }
+
+       public static Double getNumberValue(Sheet sheet, int x, int y) {
+               Cell cell = sheet.getCell(x, y);
+               CellType type = cell.getType();
+               if (type == CellType.NUMBER)
+                       return new Double(cell.getContents());
+               else if (type == CellType.EMPTY)
+                       return null;
+               else
+                       throw new ConnectException("Not a number at [" + x + "," + y + "]: " + type.toString());
+       }
+
+       public static Sheet getOnlySheet(InputStream in, String encoding) throws IOException {
+               Workbook wkb = toWorkbook(in, encoding);
+               Sheet sheet = wkb.getSheet(0);
+               return sheet;
+       }
+
+       public static Sheet getSheet(InputStream in, String encoding, int index) throws IOException {
+               Workbook wkb = toWorkbook(in, encoding);
+               return wkb.getSheet(index);
+       }
+
+       public static Workbook toWorkbook(InputStream in, String encoding) throws IOException {
+               try {
+                       WorkbookSettings ws = new WorkbookSettings();
+                       ws.setEncoding(encoding);
+                       return Workbook.getWorkbook(in, ws);
+               } catch (JXLException e) {
+                       throw new ConnectException("Unable to open XLS file", e);
+               }
+       }
+
+       // Prevents instantiation
+       private JxlUtils() {
+       }
+}
diff --git a/pom.xml b/pom.xml
index 93226c0529062fb69ad492902883a348030264fb..d68ade0b27e85a67013b1f7b0a86d474d2b5a2c7 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -15,7 +15,7 @@
        <modules>
                <module>org.argeo.suite.web</module>
                <module>org.argeo.suite.workbench.rap</module>
        <modules>
                <module>org.argeo.suite.web</module>
                <module>org.argeo.suite.workbench.rap</module>
-<!--           <module>org.argeo.suite.theme.argeo2</module> -->
+               <!-- <module>org.argeo.suite.theme.argeo2</module> -->
                <module>org.argeo.suite.apps</module>
                <module>org.argeo.suite.apps.web</module>
                <module>dep</module>
                <module>org.argeo.suite.apps</module>
                <module>org.argeo.suite.apps.web</module>
                <module>dep</module>
@@ -80,18 +80,6 @@ which are used as well as that of the covered work.]]>
                                <role>QA</role>
                        </roles>
                </developer>
                                <role>QA</role>
                        </roles>
                </developer>
-               <developer>
-                       <id>bsinou</id>
-                       <name>Bruno Sinou</name>
-                       <email><![CDATA[http://www.google.com/recaptcha/mailhide/d?k=01SZoYvDnJzcw0KOR7M7u6Qg==&c=SVgEjXA_Uu9ZrNzLES92w1ght6puLFiVpoNUddCfSU8=]]></email>
-                       <organization>Argeo</organization>
-                       <organizationUrl>http://www.argeo.org</organizationUrl>
-                       <roles>
-                               <role>architect</role>
-                               <role>developer</role>
-                               <role>QA</role>
-                       </roles>
-               </developer>
        </developers>
        <build>
                <plugins>
        </developers>
        <build>
                <plugins>
@@ -104,6 +92,17 @@ which are used as well as that of the covered work.]]>
                        </plugin>
                </plugins>
        </build>
                        </plugin>
                </plugins>
        </build>
+       <dependencyManagement>
+               <dependencies>
+                       <dependency>
+                               <groupId>org.argeo.tp.extras</groupId>
+                               <artifactId>argeo-tp-extras</artifactId>
+                               <version>${version.argeo-tp-extras}</version>
+                               <type>pom</type>
+                               <scope>import</scope>
+                       </dependency>
+               </dependencies>
+       </dependencyManagement>
        <dependencies>
                <!-- RAP workbench -->
                <dependency>
        <dependencies>
                <!-- RAP workbench -->
                <dependency>