Introduce Argeo Work based on plain RWT.
authorMathieu Baudier <mbaudier@argeo.org>
Sat, 3 Oct 2020 15:41:44 +0000 (17:41 +0200)
committerMathieu Baudier <mbaudier@argeo.org>
Sat, 3 Oct 2020 15:41:44 +0000 (17:41 +0200)
37 files changed:
dep/org.argeo.suite.dep.e4.rap/pom.xml
org.argeo.suite.theme.default/.gitignore [new file with mode: 0644]
org.argeo.suite.theme.default/.project [new file with mode: 0644]
org.argeo.suite.theme.default/META-INF/.gitignore [new file with mode: 0644]
org.argeo.suite.theme.default/bnd.bnd [new file with mode: 0644]
org.argeo.suite.theme.default/build.properties [new file with mode: 0644]
org.argeo.suite.theme.default/pom.xml [new file with mode: 0644]
org.argeo.suite.theme.default/rap/work.css [new file with mode: 0644]
org.argeo.suite.ui.rap/.classpath [new file with mode: 0644]
org.argeo.suite.ui.rap/.gitignore [new file with mode: 0644]
org.argeo.suite.ui.rap/.project [new file with mode: 0644]
org.argeo.suite.ui.rap/META-INF/.gitignore [new file with mode: 0644]
org.argeo.suite.ui.rap/OSGI-INF/argeoSuiteWebApp.xml [new file with mode: 0644]
org.argeo.suite.ui.rap/bnd.bnd [new file with mode: 0644]
org.argeo.suite.ui.rap/build.properties [new file with mode: 0644]
org.argeo.suite.ui.rap/pom.xml [new file with mode: 0644]
org.argeo.suite.ui/.classpath [new file with mode: 0644]
org.argeo.suite.ui/.gitignore [new file with mode: 0644]
org.argeo.suite.ui/.project [new file with mode: 0644]
org.argeo.suite.ui/META-INF/.gitignore [new file with mode: 0644]
org.argeo.suite.ui/OSGI-INF/argeoSuiteApp.xml [new file with mode: 0644]
org.argeo.suite.ui/OSGI-INF/l10n/bundle.properties [new file with mode: 0644]
org.argeo.suite.ui/OSGI-INF/leadPane.properties [new file with mode: 0644]
org.argeo.suite.ui/OSGI-INF/leadPane.xml [new file with mode: 0644]
org.argeo.suite.ui/OSGI-INF/workHeader.properties [new file with mode: 0644]
org.argeo.suite.ui/OSGI-INF/workHeader.xml [new file with mode: 0644]
org.argeo.suite.ui/bnd.bnd [new file with mode: 0644]
org.argeo.suite.ui/build.properties [new file with mode: 0644]
org.argeo.suite.ui/pom.xml [new file with mode: 0644]
org.argeo.suite.ui/src/org/argeo/suite/ui/ArgeoSuiteApp.java [new file with mode: 0644]
org.argeo.suite.ui/src/org/argeo/suite/ui/ArgeoSuiteUi.java [new file with mode: 0644]
org.argeo.suite.ui/src/org/argeo/suite/ui/DefaultHeader.java [new file with mode: 0644]
org.argeo.suite.ui/src/org/argeo/suite/ui/DefaultLeadPane.java [new file with mode: 0644]
org.argeo.suite.ui/src/org/argeo/suite/ui/WorkMsg.java [new file with mode: 0644]
org.argeo.suite.ui/src/org/argeo/suite/ui/WorkStyles.java [new file with mode: 0644]
pom.xml
sdk/argeo-suite-rap.properties [new file with mode: 0644]

index 4c424fd5a22191494a8b66a6505226c6f4c06452..76a59c501850a52d5d1ed065006e4bcf3d91f24f 100644 (file)
                </dependency>
                <dependency>
                        <groupId>org.argeo.suite</groupId>
-                       <artifactId>org.argeo.suite.e4</artifactId>
+                       <artifactId>org.argeo.suite.ui</artifactId>
                        <version>2.1.16-SNAPSHOT</version>
                </dependency>
                <dependency>
                        <groupId>org.argeo.suite</groupId>
-                       <artifactId>org.argeo.suite.e4.rap</artifactId>
+                       <artifactId>org.argeo.suite.ui.rap</artifactId>
                        <version>2.1.16-SNAPSHOT</version>
                </dependency>
                <!-- <dependency> -->
                <!-- </dependency> -->
                
                <!-- Apps -->
-               <dependency>
-                       <groupId>org.argeo.suite.library</groupId>
-                       <artifactId>org.argeo.suite.docs</artifactId>
-                       <version>2.1.16-SNAPSHOT</version>
-               </dependency>
-               <dependency>
-                       <groupId>org.argeo.suite.systems</groupId>
-                       <artifactId>org.argeo.suite.studio</artifactId>
-                       <version>2.1.16-SNAPSHOT</version>
-               </dependency>
+<!--           <dependency> -->
+<!--                   <groupId>org.argeo.suite.library</groupId> -->
+<!--                   <artifactId>org.argeo.suite.docs</artifactId> -->
+<!--                   <version>2.1.16-SNAPSHOT</version> -->
+<!--           </dependency> -->
+<!--           <dependency> -->
+<!--                   <groupId>org.argeo.suite.systems</groupId> -->
+<!--                   <artifactId>org.argeo.suite.studio</artifactId> -->
+<!--                   <version>2.1.16-SNAPSHOT</version> -->
+<!--           </dependency> -->
 
                <!-- Base CMS distribution -->
                <dependency>
diff --git a/org.argeo.suite.theme.default/.gitignore b/org.argeo.suite.theme.default/.gitignore
new file mode 100644 (file)
index 0000000..09e3bc9
--- /dev/null
@@ -0,0 +1,2 @@
+/bin/
+/target/
diff --git a/org.argeo.suite.theme.default/.project b/org.argeo.suite.theme.default/.project
new file mode 100644 (file)
index 0000000..5453bb1
--- /dev/null
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.argeo.suite.theme.default</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.pde.ManifestBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.SchemaBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.pde.PluginNature</nature>
+       </natures>
+</projectDescription>
diff --git a/org.argeo.suite.theme.default/META-INF/.gitignore b/org.argeo.suite.theme.default/META-INF/.gitignore
new file mode 100644 (file)
index 0000000..4854a41
--- /dev/null
@@ -0,0 +1 @@
+/MANIFEST.MF
diff --git a/org.argeo.suite.theme.default/bnd.bnd b/org.argeo.suite.theme.default/bnd.bnd
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/org.argeo.suite.theme.default/build.properties b/org.argeo.suite.theme.default/build.properties
new file mode 100644 (file)
index 0000000..5f22cdd
--- /dev/null
@@ -0,0 +1 @@
+bin.includes = META-INF/
diff --git a/org.argeo.suite.theme.default/pom.xml b/org.argeo.suite.theme.default/pom.xml
new file mode 100644 (file)
index 0000000..b4e5dd9
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+       <modelVersion>4.0.0</modelVersion>
+       <parent>
+               <groupId>org.argeo.suite</groupId>
+               <artifactId>argeo-suite</artifactId>
+               <version>2.1.16-SNAPSHOT</version>
+               <relativePath>..</relativePath>
+       </parent>
+       <artifactId>org.argeo.suite.theme.default</artifactId>
+       <name>Suite Default Theme</name>
+       <packaging>jar</packaging>
+       <dependencies>
+       </dependencies>
+</project>
diff --git a/org.argeo.suite.theme.default/rap/work.css b/org.argeo.suite.theme.default/rap/work.css
new file mode 100644 (file)
index 0000000..07589da
--- /dev/null
@@ -0,0 +1,11 @@
+.argeo-work-header {
+       font: bold 22px sans-serif;
+       color: white;
+       background-color: #204a87;
+}
+
+.argeo-work-leadPane {
+       font: bold 14px sans-serif;
+       color: white;
+       background-color: #204a87;
+}
\ No newline at end of file
diff --git a/org.argeo.suite.ui.rap/.classpath b/org.argeo.suite.ui.rap/.classpath
new file mode 100644 (file)
index 0000000..e801ebf
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
+       <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+       <classpathentry kind="src" path="src"/>
+       <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/org.argeo.suite.ui.rap/.gitignore b/org.argeo.suite.ui.rap/.gitignore
new file mode 100644 (file)
index 0000000..09e3bc9
--- /dev/null
@@ -0,0 +1,2 @@
+/bin/
+/target/
diff --git a/org.argeo.suite.ui.rap/.project b/org.argeo.suite.ui.rap/.project
new file mode 100644 (file)
index 0000000..4e66caa
--- /dev/null
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.argeo.suite.ui.rap</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.jdt.core.javabuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.ManifestBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.SchemaBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.ds.core.builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.pde.PluginNature</nature>
+               <nature>org.eclipse.jdt.core.javanature</nature>
+       </natures>
+</projectDescription>
diff --git a/org.argeo.suite.ui.rap/META-INF/.gitignore b/org.argeo.suite.ui.rap/META-INF/.gitignore
new file mode 100644 (file)
index 0000000..4854a41
--- /dev/null
@@ -0,0 +1 @@
+/MANIFEST.MF
diff --git a/org.argeo.suite.ui.rap/OSGI-INF/argeoSuiteWebApp.xml b/org.argeo.suite.ui.rap/OSGI-INF/argeoSuiteWebApp.xml
new file mode 100644 (file)
index 0000000..9d316f4
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="init" deactivate="destroy" name="Argeo Suite Web App">
+   <implementation class="org.argeo.cms.web.CmsWebApp"/>
+   <property name="contextName" type="String" value="argeo"/>
+   <property name="argeo.cms.theme.bundle" type="String" value="org.argeo.suite.theme.default"/>
+   <service>
+      <provide interface="org.eclipse.rap.rwt.application.ApplicationConfiguration"/>
+   </service>
+   <reference bind="setCmsApp" cardinality="1..1" interface="org.argeo.cms.ui.CmsApp" name="CmsApp" policy="static" target="(contextName=argeo)"/>
+</scr:component>
diff --git a/org.argeo.suite.ui.rap/bnd.bnd b/org.argeo.suite.ui.rap/bnd.bnd
new file mode 100644 (file)
index 0000000..121f1ab
--- /dev/null
@@ -0,0 +1,6 @@
+Service-Component: OSGI-INF/argeoSuiteWebApp.xml
+
+Import-Package:\
+org.argeo.cms.web,\
+org.eclipse.rap.rwt.application,\
+*
diff --git a/org.argeo.suite.ui.rap/build.properties b/org.argeo.suite.ui.rap/build.properties
new file mode 100644 (file)
index 0000000..8d783b3
--- /dev/null
@@ -0,0 +1,5 @@
+output.. = bin/
+bin.includes = META-INF/,\
+               .,\
+               OSGI-INF/argeoSuiteWebApp.xml
+source.. = src/
diff --git a/org.argeo.suite.ui.rap/pom.xml b/org.argeo.suite.ui.rap/pom.xml
new file mode 100644 (file)
index 0000000..664158f
--- /dev/null
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+       <modelVersion>4.0.0</modelVersion>
+       <parent>
+               <groupId>org.argeo.suite</groupId>
+               <artifactId>argeo-suite</artifactId>
+               <version>2.1.16-SNAPSHOT</version>
+               <relativePath>..</relativePath>
+       </parent>
+       <artifactId>org.argeo.suite.ui.rap</artifactId>
+       <name>Suite UI RAP</name>
+       <packaging>jar</packaging>
+       <dependencies>
+               <dependency>
+                       <groupId>org.argeo.suite</groupId>
+                       <artifactId>org.argeo.suite.ui</artifactId>
+                       <version>2.1.16-SNAPSHOT</version>
+               </dependency>
+
+               <!-- Eclipse E4 -->
+               <dependency>
+                       <groupId>org.argeo.tp</groupId>
+                       <artifactId>argeo-tp-rap-e4</artifactId>
+                       <version>${version.argeo-tp}</version>
+                       <type>pom</type>
+                       <scope>provided</scope>
+               </dependency>
+       </dependencies>
+</project>
diff --git a/org.argeo.suite.ui/.classpath b/org.argeo.suite.ui/.classpath
new file mode 100644 (file)
index 0000000..e801ebf
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
+       <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+       <classpathentry kind="src" path="src"/>
+       <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/org.argeo.suite.ui/.gitignore b/org.argeo.suite.ui/.gitignore
new file mode 100644 (file)
index 0000000..09e3bc9
--- /dev/null
@@ -0,0 +1,2 @@
+/bin/
+/target/
diff --git a/org.argeo.suite.ui/.project b/org.argeo.suite.ui/.project
new file mode 100644 (file)
index 0000000..7146bab
--- /dev/null
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.argeo.suite.ui</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.jdt.core.javabuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.ManifestBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.SchemaBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.ds.core.builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.pde.PluginNature</nature>
+               <nature>org.eclipse.jdt.core.javanature</nature>
+       </natures>
+</projectDescription>
diff --git a/org.argeo.suite.ui/META-INF/.gitignore b/org.argeo.suite.ui/META-INF/.gitignore
new file mode 100644 (file)
index 0000000..4854a41
--- /dev/null
@@ -0,0 +1 @@
+/MANIFEST.MF
diff --git a/org.argeo.suite.ui/OSGI-INF/argeoSuiteApp.xml b/org.argeo.suite.ui/OSGI-INF/argeoSuiteApp.xml
new file mode 100644 (file)
index 0000000..d046f6b
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="Argeo Suite App">
+   <implementation class="org.argeo.suite.ui.ArgeoSuiteApp"/>
+   <property name="contextName" type="String" value="argeo"/>
+   <service>
+      <provide interface="org.argeo.cms.ui.CmsApp"/>
+   </service>
+   <reference bind="addUiProvider" cardinality="1..n" interface="org.argeo.cms.ui.CmsUiProvider" name="CmsUiProvider" policy="static" unbind="removeUiProvider"/>
+</scr:component>
diff --git a/org.argeo.suite.ui/OSGI-INF/l10n/bundle.properties b/org.argeo.suite.ui/OSGI-INF/l10n/bundle.properties
new file mode 100644 (file)
index 0000000..0b11430
--- /dev/null
@@ -0,0 +1,3 @@
+dashboard=dashboard
+
+defaultWorkAppTitle=Argeo Suite
\ No newline at end of file
diff --git a/org.argeo.suite.ui/OSGI-INF/leadPane.properties b/org.argeo.suite.ui/OSGI-INF/leadPane.properties
new file mode 100644 (file)
index 0000000..24dad49
--- /dev/null
@@ -0,0 +1 @@
+service.pid=argeo.work.leadPane
diff --git a/org.argeo.suite.ui/OSGI-INF/leadPane.xml b/org.argeo.suite.ui/OSGI-INF/leadPane.xml
new file mode 100644 (file)
index 0000000..bf492a3
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="Default Lead Pane">
+   <implementation class="org.argeo.suite.ui.DefaultLeadPane"/>
+   <service>
+      <provide interface="org.argeo.cms.ui.CmsUiProvider"/>
+      <provide interface="org.osgi.service.cm.ManagedService"/>
+   </service>
+   <properties entry="OSGI-INF/leadPane.properties"/>
+</scr:component>
diff --git a/org.argeo.suite.ui/OSGI-INF/workHeader.properties b/org.argeo.suite.ui/OSGI-INF/workHeader.properties
new file mode 100644 (file)
index 0000000..fc69864
--- /dev/null
@@ -0,0 +1,2 @@
+service.pid=argeo.work.header
+argeo.work.header.title=%defaultWorkAppTitle
\ No newline at end of file
diff --git a/org.argeo.suite.ui/OSGI-INF/workHeader.xml b/org.argeo.suite.ui/OSGI-INF/workHeader.xml
new file mode 100644 (file)
index 0000000..3339b47
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="init" name="Default Work Header">
+   <implementation class="org.argeo.suite.ui.DefaultHeader"/>
+   <service>
+      <provide interface="org.argeo.cms.ui.CmsUiProvider"/>
+      <provide interface="org.osgi.service.cm.ManagedService"/>
+   </service>
+   <properties entry="OSGI-INF/workHeader.properties"/>
+</scr:component>
diff --git a/org.argeo.suite.ui/bnd.bnd b/org.argeo.suite.ui/bnd.bnd
new file mode 100644 (file)
index 0000000..8fd262a
--- /dev/null
@@ -0,0 +1,10 @@
+Service-Component:\
+OSGI-INF/argeoSuiteApp.xml,\
+OSGI-INF/workHeader.xml,\
+OSGI-INF/leadPane.xml
+
+Import-Package:\
+org.argeo.api,\
+org.eclipse.swt,\
+org.osgi.framework,\
+*
diff --git a/org.argeo.suite.ui/build.properties b/org.argeo.suite.ui/build.properties
new file mode 100644 (file)
index 0000000..2e0c968
--- /dev/null
@@ -0,0 +1,7 @@
+output.. = bin/
+bin.includes = META-INF/,\
+               .,\
+               OSGI-INF/argeoSuiteApp.xml,\
+               OSGI-INF/workHeader.xml,\
+               OSGI-INF/leadPane.xml
+source.. = src/
diff --git a/org.argeo.suite.ui/pom.xml b/org.argeo.suite.ui/pom.xml
new file mode 100644 (file)
index 0000000..321ddea
--- /dev/null
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+       <modelVersion>4.0.0</modelVersion>
+       <parent>
+               <groupId>org.argeo.suite</groupId>
+               <artifactId>argeo-suite</artifactId>
+               <version>2.1.16-SNAPSHOT</version>
+               <relativePath>..</relativePath>
+       </parent>
+       <artifactId>org.argeo.suite.ui</artifactId>
+       <name>Suite UI</name>
+       <packaging>jar</packaging>
+       <dependencies>
+               <dependency>
+                       <groupId>org.argeo.connect</groupId>
+                       <artifactId>org.argeo.connect.ui</artifactId>
+                       <version>${version.argeo-connect}</version>
+               </dependency>
+               
+               <!-- Eclipse E4 -->
+               <dependency>
+                       <groupId>org.argeo.tp</groupId>
+                       <artifactId>argeo-tp-rap-e4</artifactId>
+                       <version>${version.argeo-tp}</version>
+                       <type>pom</type>
+                       <scope>provided</scope>
+               </dependency>
+       </dependencies>
+</project>
diff --git a/org.argeo.suite.ui/src/org/argeo/suite/ui/ArgeoSuiteApp.java b/org.argeo.suite.ui/src/org/argeo/suite/ui/ArgeoSuiteApp.java
new file mode 100644 (file)
index 0000000..7aebdc2
--- /dev/null
@@ -0,0 +1,79 @@
+package org.argeo.suite.ui;
+
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+
+import javax.jcr.Node;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.argeo.cms.ui.CmsApp;
+import org.argeo.cms.ui.CmsUiProvider;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.osgi.framework.Constants;
+
+public class ArgeoSuiteApp implements CmsApp {
+       private final static Log log = LogFactory.getLog(ArgeoSuiteApp.class);
+       public final static String PID_PREFIX = "argeo.work.";
+       public final static String HEADER_PID = PID_PREFIX + "header";
+       public final static String LEAD_PANE_PID = PID_PREFIX + "leadPane";
+
+       private final static String DEFAULT_UI_NAME = "work";
+
+       private ArgeoSuiteUi argeoSuiteUi;
+
+       private Map<String, CmsUiProvider> uiProviders = new TreeMap<>();
+
+       @Override
+       public Set<String> getUiNames() {
+               HashSet<String> uiNames = new HashSet<>();
+               uiNames.add(DEFAULT_UI_NAME);
+               return uiNames;
+       }
+
+       @Override
+       public void initUi(String uiName, Composite parent) {
+               if (DEFAULT_UI_NAME.equals(uiName)) {
+                       argeoSuiteUi = new ArgeoSuiteUi(parent, SWT.NONE);
+                       refresh(uiName);
+               }
+
+       }
+
+       public void refresh(String uiName) {
+               if (DEFAULT_UI_NAME.equals(uiName)) {
+                       Node context = null;
+                       uiProviders.get(HEADER_PID).createUiPart(argeoSuiteUi.getHeader(), context);
+                       uiProviders.get(LEAD_PANE_PID).createUiPart(argeoSuiteUi.getLeadPane(), context);
+               }
+       }
+
+       public void addUiProvider(CmsUiProvider uiProvider, Map<String, String> properties) {
+               String servicePid = properties.get(Constants.SERVICE_PID);
+               if (servicePid == null) {
+                       log.error("No service pid found for " + uiProvider.getClass() + ", " + properties);
+               } else {
+                       uiProviders.put(servicePid, uiProvider);
+               }
+
+       }
+
+       public void removeUiProvider(CmsUiProvider uiProvider, Map<String, String> properties) {
+               String servicePid = properties.get(Constants.SERVICE_PID);
+               uiProviders.remove(servicePid);
+
+       }
+
+//     static class UiProviderKey {
+//             private Map<String, String> properties;
+//
+//             public UiProviderKey(Map<String, String> properties) {
+//                     super();
+//                     this.properties = properties;
+//             }
+//
+//     }
+}
diff --git a/org.argeo.suite.ui/src/org/argeo/suite/ui/ArgeoSuiteUi.java b/org.argeo.suite.ui/src/org/argeo/suite/ui/ArgeoSuiteUi.java
new file mode 100644 (file)
index 0000000..2505c45
--- /dev/null
@@ -0,0 +1,99 @@
+package org.argeo.suite.ui;
+
+import org.argeo.cms.ui.util.CmsUiUtils;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CTabFolder;
+import org.eclipse.swt.custom.CTabItem;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.layout.RowLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+
+public class ArgeoSuiteUi {
+       private Composite parent;
+
+       private Composite header;
+       private Composite leadPane;
+
+       private SashForm dynamicArea;
+       private Composite entryArea;
+       private CTabFolder editorArea;
+
+       private Composite defaultBody;
+
+       public ArgeoSuiteUi(Composite parent, int style) {
+               this.parent = parent;
+               parent.setLayout(CmsUiUtils.noSpaceGridLayout());
+
+               header = new Composite(parent, SWT.NONE);
+               CmsUiUtils.style(header, WorkStyles.header);
+               header.setLayoutData(CmsUiUtils.fillWidth());
+
+               Composite belowHeader = new Composite(parent, SWT.NONE);
+               belowHeader.setLayoutData(CmsUiUtils.fillAll());
+               belowHeader.setLayout(CmsUiUtils.noSpaceGridLayout(2));
+
+               if (SWT.RIGHT_TO_LEFT == (style & SWT.RIGHT_TO_LEFT)) {// arabic, hebrew, etc.
+                       dynamicArea = new SashForm(belowHeader, SWT.HORIZONTAL);
+                       leadPane = new Composite(belowHeader, SWT.NONE);
+               } else {
+                       leadPane = new Composite(belowHeader, SWT.NONE);
+                       dynamicArea = new SashForm(belowHeader, SWT.HORIZONTAL);
+               }
+               leadPane.setLayoutData(CmsUiUtils.fillHeight());
+               CmsUiUtils.style(leadPane, WorkStyles.leadPane);
+               dynamicArea.setLayoutData(CmsUiUtils.fillAll());
+
+               if (SWT.RIGHT_TO_LEFT == (style & SWT.RIGHT_TO_LEFT)) {// arabic, hebrew, etc.
+                       editorArea = new CTabFolder(dynamicArea, SWT.NONE);
+                       entryArea = new Composite(dynamicArea, SWT.NONE);
+               } else {
+                       entryArea = new Composite(dynamicArea, SWT.NONE);
+                       editorArea = new CTabFolder(dynamicArea, SWT.NONE);
+               }
+               int[] weights = new int[] { 2000, 8000 };
+               dynamicArea.setWeights(weights);
+
+               Composite buttons = new Composite(editorArea, SWT.NONE);
+               buttons.setLayout(new RowLayout(SWT.HORIZONTAL));
+               Button delete = new Button(buttons, SWT.PUSH);
+               delete.setText("Delete");
+               editorArea.setTopRight(buttons);
+
+               CTabItem defaultTab = new CTabItem(editorArea, SWT.NONE);
+               defaultTab.setText("Home");
+               defaultBody = new Composite(editorArea, SWT.NONE);
+               defaultTab.setControl(defaultBody);
+
+               // editorArea.setSingle(true);
+       }
+
+       Composite getParent() {
+               return parent;
+       }
+
+       Composite getHeader() {
+               return header;
+       }
+
+       Composite getLeadPane() {
+               return leadPane;
+       }
+
+       SashForm getDynamicArea() {
+               return dynamicArea;
+       }
+
+       Composite getEntryArea() {
+               return entryArea;
+       }
+
+       CTabFolder getEditorArea() {
+               return editorArea;
+       }
+
+       Composite getDefaultBody() {
+               return defaultBody;
+       }
+
+}
diff --git a/org.argeo.suite.ui/src/org/argeo/suite/ui/DefaultHeader.java b/org.argeo.suite.ui/src/org/argeo/suite/ui/DefaultHeader.java
new file mode 100644 (file)
index 0000000..de38c44
--- /dev/null
@@ -0,0 +1,48 @@
+package org.argeo.suite.ui;
+
+import java.util.Dictionary;
+import java.util.Map;
+import java.util.TreeMap;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+
+import org.argeo.cms.LocaleUtils;
+import org.argeo.cms.ui.CmsUiProvider;
+import org.argeo.cms.ui.util.CmsUiUtils;
+import org.argeo.util.LangUtils;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.osgi.service.cm.ConfigurationException;
+import org.osgi.service.cm.ManagedService;
+
+public class DefaultHeader implements CmsUiProvider, ManagedService {
+       public final static String TITLE_PROPERTY = "argeo.work.header.title";
+       private Map<String, String> properties;
+
+       @Override
+       public Control createUi(Composite parent, Node context) throws RepositoryException {
+               parent.setLayout(new GridLayout());
+               Label lbl = new Label(parent, SWT.NONE);
+               String title = properties.get(TITLE_PROPERTY);
+               lbl.setText(LocaleUtils.isLocaleKey(title) ? LocaleUtils.local(title, getClass().getClassLoader()).toString()
+                               : title);
+               CmsUiUtils.style(lbl, WorkStyles.header);
+               lbl.setLayoutData(CmsUiUtils.fillWidth());
+               return lbl;
+       }
+
+       public void init(Map<String, String> properties) {
+               this.properties = new TreeMap<>(properties);
+       }
+
+       @Override
+       public void updated(Dictionary<String, ?> properties) throws ConfigurationException {
+               if (properties != null)
+                       this.properties.putAll(LangUtils.dictToStringMap(properties));
+       }
+
+}
diff --git a/org.argeo.suite.ui/src/org/argeo/suite/ui/DefaultLeadPane.java b/org.argeo.suite.ui/src/org/argeo/suite/ui/DefaultLeadPane.java
new file mode 100644 (file)
index 0000000..73b81b0
--- /dev/null
@@ -0,0 +1,36 @@
+package org.argeo.suite.ui;
+
+import java.util.Dictionary;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+
+import org.argeo.cms.ui.CmsUiProvider;
+import org.argeo.cms.ui.util.CmsUiUtils;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.osgi.service.cm.ConfigurationException;
+import org.osgi.service.cm.ManagedService;
+
+public class DefaultLeadPane implements CmsUiProvider, ManagedService {
+
+       @Override
+       public Control createUi(Composite parent, Node context) throws RepositoryException {
+               parent.setLayout(new GridLayout());
+
+               Label dashboard = new Label(parent, SWT.NONE);
+               CmsUiUtils.style(dashboard, WorkStyles.leadPane);
+               dashboard.setText(WorkMsg.dashboard.lead());
+               return dashboard;
+       }
+
+       @Override
+       public void updated(Dictionary<String, ?> properties) throws ConfigurationException {
+               // TODO Auto-generated method stub
+
+       }
+
+}
diff --git a/org.argeo.suite.ui/src/org/argeo/suite/ui/WorkMsg.java b/org.argeo.suite.ui/src/org/argeo/suite/ui/WorkMsg.java
new file mode 100644 (file)
index 0000000..679ad50
--- /dev/null
@@ -0,0 +1,8 @@
+package org.argeo.suite.ui;
+
+import org.argeo.cms.Localized;
+
+/** Localized messages. */
+public enum WorkMsg implements Localized {
+       dashboard;
+}
diff --git a/org.argeo.suite.ui/src/org/argeo/suite/ui/WorkStyles.java b/org.argeo.suite.ui/src/org/argeo/suite/ui/WorkStyles.java
new file mode 100644 (file)
index 0000000..7547154
--- /dev/null
@@ -0,0 +1,14 @@
+package org.argeo.suite.ui;
+
+import org.argeo.cms.ui.util.CmsStyle;
+
+/** Styles used by Argeo Suite work UI. */
+public enum WorkStyles implements CmsStyle {
+       header, leadPane;
+
+       @Override
+       public String getClassPrefix() {
+               return "argeo-work";
+       }
+
+}
diff --git a/pom.xml b/pom.xml
index f8c6c7f6dbc463e4c8bbd0ad3dba15c9ece52894..2f0a80c5fb41c263ab74477d14263f73a3cffbf4 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -1,4 +1,6 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <parent>
                <groupId>org.argeo.maven</groupId>
                <git.rw />
        </properties>
        <modules>
-               <!-- Eclipse 4 -->
+               <!-- Lightweight -->
                <module>org.argeo.suite.cms</module>
+               <module>org.argeo.suite.ui</module>
+               <module>org.argeo.suite.ui.rap</module>
+               <module>org.argeo.suite.theme.default</module>
+
+               <!-- Eclipse 4 -->
                <module>org.argeo.suite.e4</module>
                <module>org.argeo.suite.e4.rap</module>
                <module>org.argeo.suite.standard</module>
diff --git a/sdk/argeo-suite-rap.properties b/sdk/argeo-suite-rap.properties
new file mode 100644 (file)
index 0000000..4c98fc0
--- /dev/null
@@ -0,0 +1,42 @@
+argeo.osgi.start.2.node=\
+org.eclipse.equinox.http.servlet,\
+org.eclipse.equinox.metatype,\
+org.eclipse.equinox.cm,\
+org.eclipse.rap.rwt.osgi
+
+argeo.osgi.start.2.suite=\
+org.apache.tika.parsers
+
+argeo.osgi.start.3.node=\
+org.argeo.cms
+
+argeo.osgi.start.5.suite=\
+org.argeo.suite.cms,\
+org.argeo.suite.ui,\
+org.argeo.suite.ui.rap
+
+# Local
+argeo.node.repo.type=h2
+org.osgi.service.http.port=7070
+#org.osgi.service.http.port.secure=7073
+
+#argeo.node.useradmin.uris=ldap://cn=Directory%20Manager:argeoargeo@localhost:10389/dc=example,dc=com
+
+argeo.node.init=../../init
+
+argeo.i18n.locales=en,fr,de,ar
+argeo.i18n.defaultLocale=en
+
+#tika.config=/home/mbaudier/dev/git/gpl/argeo-suite/sdk/exec/argeo-office-e4-rap/data/indexes/node/tika-config.xml
+
+# Logging
+log4j.configuration=file:../../log4j.properties
+
+# DON'T CHANGE BELOW
+org.eclipse.equinox.http.jetty.autostart=false
+org.osgi.framework.bootdelegation=com.sun.jndi.ldap,\
+com.sun.jndi.ldap.sasl,\
+com.sun.security.jgss,\
+com.sun.jndi.dns,\
+com.sun.nio.file,\
+com.sun.nio.sctp