Adapt to changes in Argeo Commons.
authorMathieu Baudier <mbaudier@argeo.org>
Thu, 24 Oct 2019 07:58:39 +0000 (09:58 +0200)
committerMathieu Baudier <mbaudier@argeo.org>
Thu, 24 Oct 2019 07:58:39 +0000 (09:58 +0200)
dep/pom.xml
org.argeo.suite.e4.rap/OSGI-INF/argeo-office-rap.xml
org.argeo.suite.e4.rap/bnd.bnd
org.argeo.suite.e4.rap/src/org/argeo/suite/e4/rap/ArgeoOffice.java [deleted file]
org.argeo.suite.e4.rap/src/org/argeo/suite/e4/rap/ArgeoOfficeRapE4App.java
org.argeo.suite.e4.rap/src/org/argeo/suite/e4/rap/ArgeoSuiteEntryPoint.java [deleted file]
pom.xml
sdk/argeo-office-e4-rap.properties

index 3516108ddffeea73bc3868e86863f90ec0b90113..3d9925a0737b3cf446f8627b3b943018fef6273f 100644 (file)
                        <artifactId>org.junit</artifactId>
                        <scope>test</scope>
                </dependency>
+               <dependency>
+                       <groupId>org.argeo.tp.sdk</groupId>
+                       <artifactId>org.hamcrest</artifactId>
+                       <scope>test</scope>
+               </dependency>
        </dependencies>
        <profiles>
                <profile>
index 74b518f0d6fcfb848bbd80326595abdf224cbc2b..d257e178aea9545fbe155c113c948ddd4cdb6836 100644 (file)
@@ -1,8 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" configuration-policy="optional" name="CMS Office RAP">
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="init" configuration-policy="optional" deactivate="destroy" name="Argeo Office RAP">
    <implementation class="org.argeo.suite.e4.rap.ArgeoOfficeRapE4App"/>
    <service>
       <provide interface="org.eclipse.rap.rwt.application.ApplicationConfiguration"/>
       <property name="contextName" type="String" value="suite"/>
    </service>
+   <property name="org.eclipse.rap.rwt.webclient.pageTitle" type="String" value="Argeo Office"/>
+   <property name="org.eclipse.rap.rwt.webclient.favicon" type="String" value="icons/argeo-e.png"/>
 </scr:component>
index 668bf3175d376dd5c2e13801db5336f0a5cc7bf1..d33d61d98a5bdc5357647f8916e067a4a21066b2 100644 (file)
@@ -1,7 +1,7 @@
 Bundle-SymbolicName: org.argeo.suite.e4.rap;singleton:=true
-Bundle-Activator: org.argeo.cms.script.ScriptAppActivator
+Bundle-ActivationPolicy: lazy
 
-#Service-Component: OSGI-INF/argeo-office-rap.xml
+Service-Component: OSGI-INF/argeo-office-rap.xml
 
 Import-Package: org.argeo.node,\
 org.eclipse.swt,\
diff --git a/org.argeo.suite.e4.rap/src/org/argeo/suite/e4/rap/ArgeoOffice.java b/org.argeo.suite.e4.rap/src/org/argeo/suite/e4/rap/ArgeoOffice.java
deleted file mode 100644 (file)
index 3e13fe7..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-package org.argeo.suite.e4.rap;
-
-import org.argeo.cms.e4.rap.CmsE4EntryPointFactory;
-
-public class ArgeoOffice extends CmsE4EntryPointFactory {
-
-       public ArgeoOffice(String e4Xmi, String lifeCycleUri) {
-               super(e4Xmi, lifeCycleUri);
-       }
-
-       public ArgeoOffice() {
-               super("org.argeo.suite.e4/e4xmi/argeo-office.e4xmi",
-                               "bundleclass://org.argeo.suite.e4.rap/org.argeo.suite.e4.rap.ArgeoSuiteLoginLifecycle");
-       }
-
-}
index f9180c7ccf4d7dab30f6cb74ec9366f33a64d42d..3e732ef664f642b4d1bbf6e180b8369462d45649 100644 (file)
@@ -1,45 +1,46 @@
 package org.argeo.suite.e4.rap;
 
-import java.util.Map;
-
 import org.argeo.cms.e4.rap.AbstractRapE4App;
-import org.argeo.cms.util.BundleResourceLoader;
-import org.eclipse.rap.e4.E4ApplicationConfig;
-import org.eclipse.rap.rwt.RWT;
+import org.argeo.cms.util.CmsTheme;
 import org.eclipse.rap.rwt.application.Application;
 import org.eclipse.rap.rwt.client.WebClient;
-import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.FrameworkUtil;
 
+/** Argeo Office RAP application. */
 public class ArgeoOfficeRapE4App extends AbstractRapE4App {
        private BundleContext bc = FrameworkUtil.getBundle(getClass()).getBundleContext();
 
        public ArgeoOfficeRapE4App() {
-               setPageTitle("Argeo Office");
-               setE4Xmi("org.argeo.suite.e4/e4xmi/argeo-office.e4xmi");
-               setPath("/office");
+//             setPageTitle("Argeo Office");
+//             setE4Xmi("org.argeo.suite.e4/e4xmi/argeo-office.e4xmi");
+//             setPath("/office");
                setLifeCycleUri("bundleclass://org.argeo.suite.e4.rap/org.argeo.suite.e4.rap.ArgeoSuiteLoginLifecycle");
        }
 
        @Override
-       protected void addEntryPoint(Application application, E4ApplicationConfig config, Map<String, String> properties) {
-               // String theme ="org.argeo.theme.argeo2.office";
-               String theme = RWT.DEFAULT_THEME_ID;
-               Bundle themeBundle = findTheme("org.argeo.theme.argeo2");
-               // application.addStyleSheet(theme, "rap/office-rwt.css", new
-               // BundleResourceLoader(themeBundle));
-               application.addStyleSheet(theme, "rap/office.css", new BundleResourceLoader(themeBundle));
-               properties.put(WebClient.THEME_ID, theme);
+       protected void addEntryPoints(Application application) {
+               CmsTheme cmsTheme = new CmsTheme(bc, "org.argeo.theme.argeo2");
+               cmsTheme.apply(application);
+
                String font = "<link rel='stylesheet' href='http://fonts.googleapis.com/css?family=Source+Sans+Pro'/>";
-               properties.put(WebClient.HEAD_HTML, font);
-               super.addEntryPoint(application, config, properties);
-       }
+               getBaseProperties().put(WebClient.HEAD_HTML, font);
 
-       Bundle findTheme(String symbolicName) {
-               for (Bundle b : bc.getBundles())
-                       if (symbolicName.equals(b.getSymbolicName()))
-                               return b;
-               throw new RuntimeException("Theme bundle " + symbolicName + " not found");
+               addE4EntryPoint(application, "/office", "org.argeo.suite.e4/e4xmi/argeo-office.e4xmi", customise("Office"));
+               addE4EntryPoint(application, "/docs", "org.argeo.suite.e4/e4xmi/argeo-docs.e4xmi", customise("Docs"));
        }
+
+//     protected void addEntryPoint(Application application, E4ApplicationConfig config, Map<String, String> properties) {
+//             // String theme ="org.argeo.theme.argeo2.office";
+//             String theme = RWT.DEFAULT_THEME_ID;
+//             Bundle themeBundle = findTheme("org.argeo.theme.argeo2");
+//             // application.addStyleSheet(theme, "rap/office-rwt.css", new
+//             // BundleResourceLoader(themeBundle));
+//             application.addStyleSheet(theme, "rap/office.css", new BundleResourceLoader(themeBundle));
+//             properties.put(WebClient.THEME_ID, theme);
+//             String font = "<link rel='stylesheet' href='http://fonts.googleapis.com/css?family=Source+Sans+Pro'/>";
+//             properties.put(WebClient.HEAD_HTML, font);
+//             //super.addEntryPoint(application, config, properties);
+//     }
+
 }
diff --git a/org.argeo.suite.e4.rap/src/org/argeo/suite/e4/rap/ArgeoSuiteEntryPoint.java b/org.argeo.suite.e4.rap/src/org/argeo/suite/e4/rap/ArgeoSuiteEntryPoint.java
deleted file mode 100644 (file)
index 121937c..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.argeo.suite.e4.rap;
-
-import org.argeo.cms.e4.rap.CmsE4EntryPointFactory;
-
-public class ArgeoSuiteEntryPoint extends CmsE4EntryPointFactory {
-
-       public ArgeoSuiteEntryPoint(String e4Xmi) {
-               super(e4Xmi, "bundleclass://org.argeo.suite.e4.rap/org.argeo.suite.e4.rap.ArgeoSuiteLoginLifecycle");
-       }
-
-}
diff --git a/pom.xml b/pom.xml
index 5c4e69738737afebede30b10cbc5bd2e88b4d1ac..fff53795281b89a37181d378118a73a45d3ba9ab 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
        <parent>
                <groupId>org.argeo.commons</groupId>
                <artifactId>argeo-commons</artifactId>
-               <version>2.1.80-SNAPSHOT</version>
+               <version>2.1.81-SNAPSHOT</version>
        </parent>
        <groupId>org.argeo.suite</groupId>
        <artifactId>argeo-suite</artifactId>
index 97d952c9460829a7b0a22b64cf854c8621c23c93..bf5adc603b70ac59882098abfe2400aeb34c7ec5 100644 (file)
@@ -1,6 +1,5 @@
 argeo.osgi.start.2.node=\
 org.eclipse.equinox.http.servlet,\
-org.eclipse.equinox.http.jetty,\
 org.eclipse.equinox.metatype,\
 org.eclipse.equinox.cm,\
 org.eclipse.rap.rwt.osgi,\