From 30f7e4a5a1bdb27156511eb9ea88d2ec492d7e01 Mon Sep 17 00:00:00 2001 From: Mathieu Baudier Date: Tue, 13 Oct 2020 10:06:58 +0200 Subject: [PATCH] Remove legacy Argeo Suite based on Eclipse 4. --- dep/org.argeo.suite.dep.e4.rap/pom.xml | 44 +- dep/org.argeo.suite.dep.e4.rcp/pom.xml | 52 +-- library/.gitignore | 1 - library/org.argeo.suite.docs/.gitignore | 2 - library/org.argeo.suite.docs/.project | 27 -- .../org.argeo.suite.docs/META-INF/.gitignore | 1 - library/org.argeo.suite.docs/bnd.bnd | 0 library/org.argeo.suite.docs/build.properties | 4 - .../org.argeo.suite.docs/e4xmi/browse.e4xmi | 85 ---- library/org.argeo.suite.docs/pom.xml | 31 -- library/pom.xml | 19 - org.argeo.suite.cms/.classpath | 6 - org.argeo.suite.cms/.gitignore | 2 - org.argeo.suite.cms/.project | 33 -- org.argeo.suite.cms/META-INF/.gitignore | 1 - .../OSGI-INF/activitiesMaintenanceService.xml | 10 - .../OSGI-INF/activitiesService.xml | 10 - .../OSGI-INF/documentsService.xml | 8 - .../OSGI-INF/peopleMaintenanceService.xml | 10 - .../OSGI-INF/peopleService.xml | 10 - .../OSGI-INF/resourcesMaintenanceService.xml | 11 - .../OSGI-INF/resourcesService.xml | 8 - .../OSGI-INF/systemAppService.xml | 8 - .../OSGI-INF/systemMaintenanceService.xml | 10 - org.argeo.suite.cms/bnd.bnd | 28 -- org.argeo.suite.cms/build.properties | 16 - org.argeo.suite.cms/pom.xml | 20 - .../src/org/argeo/suite/util/XPathUtils.java | 177 ++++++++ org.argeo.suite.e4.rap/.classpath | 7 - org.argeo.suite.e4.rap/.gitignore | 2 - org.argeo.suite.e4.rap/.project | 33 -- org.argeo.suite.e4.rap/META-INF/.gitignore | 1 - .../OSGI-INF/appDeployer.xml | 4 - .../OSGI-INF/argeo-office-rap.xml | 10 - org.argeo.suite.e4.rap/bnd.bnd | 12 - org.argeo.suite.e4.rap/build.properties | 7 - org.argeo.suite.e4.rap/cms/app.js | 19 - .../e4xmi/argeo-settings.e4xmi | 19 - .../e4xmi/argeo-suite-rap-addons.e4xmi | 6 - org.argeo.suite.e4.rap/fonts.txt | 1 - org.argeo.suite.e4.rap/plugin.xml | 12 - org.argeo.suite.e4.rap/pom.xml | 34 -- .../suite/e4/rap/ArgeoOfficeRapE4App.java | 46 -- .../e4/rap/ArgeoSuiteLoginLifecycle.java | 87 ---- .../argeo/suite/e4/rap/RapMainShellAddon.java | 26 -- .../suite/e4/rap/settings/AppDeployer.java | 81 ---- .../argeo/suite/e4/rap/settings/AppsPart.java | 13 - .../suite/e4/rap/settings/ArgeoRapApp.java | 70 --- org.argeo.suite.e4/.classpath | 7 - org.argeo.suite.e4/.gitignore | 2 - org.argeo.suite.e4/.project | 33 -- org.argeo.suite.e4/META-INF/.gitignore | 1 - .../OSGI-INF/activitiesE4Service.xml | 10 - .../OSGI-INF/documentsE4Service.xml | 8 - .../OSGI-INF/l10n/bundle.properties | 23 - .../OSGI-INF/l10n/bundle_ar.properties | 20 - .../OSGI-INF/l10n/bundle_de.properties | 23 - .../OSGI-INF/l10n/bundle_fr.properties | 23 - .../OSGI-INF/peopleE4Service.xml | 10 - .../OSGI-INF/resourcesE4Service.xml | 8 - .../OSGI-INF/systemE4Service.xml | 10 - org.argeo.suite.e4/bnd.bnd | 23 - org.argeo.suite.e4/build.properties | 6 - org.argeo.suite.e4/e4xmi/argeo-docs.e4xmi | 85 ---- org.argeo.suite.e4/e4xmi/argeo-office.e4xmi | 140 ------ org.argeo.suite.e4/icons/argeo-icon-32.png | Bin 1291 -> 0 bytes org.argeo.suite.e4/pom.xml | 29 -- .../src/org/argeo/suite/e4/ActiveFeature.java | 17 - .../src/org/argeo/suite/e4/SuiteMsg.java | 7 - .../e4/parts/AbstractSuiteDashboard.java | 188 -------- .../e4/parts/DefaultDashboardEditor.java | 420 ------------------ .../EntitySingleColumnLabelProvider.java | 92 ---- .../argeo/suite/e4/parts/QuickSearchView.java | 279 ------------ org.argeo.suite.standard/.classpath | 7 - org.argeo.suite.standard/.gitignore | 2 - org.argeo.suite.standard/.project | 28 -- org.argeo.suite.standard/META-INF/.gitignore | 1 - .../OSGI-INF/l10n/bundle.properties | 7 - .../OSGI-INF/l10n/bundle_ar.properties | 7 - .../OSGI-INF/l10n/bundle_de.properties | 7 - .../OSGI-INF/l10n/bundle_fr.properties | 4 - org.argeo.suite.standard/bnd.bnd | 2 - org.argeo.suite.standard/build.properties | 7 - .../e4xmi/standard-toolbars.e4xmi | 32 -- org.argeo.suite.standard/plugin.xml | 12 - org.argeo.suite.standard/pom.xml | 20 - org.argeo.suite.tracker/.classpath | 7 - org.argeo.suite.tracker/.gitignore | 2 - org.argeo.suite.tracker/.project | 33 -- .../.settings/org.eclipse.jdt.core.prefs | 7 - .../.settings/org.eclipse.pde.core.prefs | 3 - org.argeo.suite.tracker/META-INF/.gitignore | 1 - .../OSGI-INF/l10n/bundle.properties | 3 - .../OSGI-INF/l10n/bundle_ar.properties | 3 - .../OSGI-INF/l10n/bundle_de.properties | 3 - .../OSGI-INF/l10n/bundle_fr.properties | 3 - .../OSGI-INF/trackerE4Service.xml | 12 - .../OSGI-INF/trackerMaintenanceService.xml | 9 - .../OSGI-INF/trackerService.xml | 9 - org.argeo.suite.tracker/bnd.bnd | 16 - org.argeo.suite.tracker/build.properties | 7 - .../e4xmi/tracker-toolbars.e4xmi | 22 - org.argeo.suite.tracker/plugin.xml | 12 - org.argeo.suite.tracker/pom.xml | 20 - org.argeo.suite.ui/bnd.bnd | 1 - org.argeo.suite.ui/pom.xml | 13 +- .../src/org/argeo/suite/ui/DelayedText.java | 127 ++++++ .../src/org/argeo/suite/ui/RecentItems.java | 36 +- pom.xml | 12 - systems/.gitignore | 1 - systems/org.argeo.suite.studio/.classpath | 7 - systems/org.argeo.suite.studio/.gitignore | 2 - systems/org.argeo.suite.studio/.project | 33 -- .../META-INF/.gitignore | 1 - systems/org.argeo.suite.studio/bnd.bnd | 6 - .../org.argeo.suite.studio/build.properties | 4 - .../org.argeo.suite.studio/e4xmi/mvc.e4xmi | 87 ---- systems/org.argeo.suite.studio/pom.xml | 31 -- .../argeo/suite/studio/parts/RwtAppElem.java | 21 - .../argeo/suite/studio/parts/ServletElem.java | 62 --- .../argeo/suite/studio/parts/SiteElem.java | 37 -- .../argeo/suite/studio/parts/SiteMapPart.java | 96 ---- systems/pom.xml | 19 - 123 files changed, 354 insertions(+), 3138 deletions(-) delete mode 100644 library/.gitignore delete mode 100644 library/org.argeo.suite.docs/.gitignore delete mode 100644 library/org.argeo.suite.docs/.project delete mode 100644 library/org.argeo.suite.docs/META-INF/.gitignore delete mode 100644 library/org.argeo.suite.docs/bnd.bnd delete mode 100644 library/org.argeo.suite.docs/build.properties delete mode 100644 library/org.argeo.suite.docs/e4xmi/browse.e4xmi delete mode 100644 library/org.argeo.suite.docs/pom.xml delete mode 100644 library/pom.xml delete mode 100644 org.argeo.suite.cms/.classpath delete mode 100644 org.argeo.suite.cms/.gitignore delete mode 100644 org.argeo.suite.cms/.project delete mode 100644 org.argeo.suite.cms/META-INF/.gitignore delete mode 100644 org.argeo.suite.cms/OSGI-INF/activitiesMaintenanceService.xml delete mode 100644 org.argeo.suite.cms/OSGI-INF/activitiesService.xml delete mode 100644 org.argeo.suite.cms/OSGI-INF/documentsService.xml delete mode 100644 org.argeo.suite.cms/OSGI-INF/peopleMaintenanceService.xml delete mode 100644 org.argeo.suite.cms/OSGI-INF/peopleService.xml delete mode 100644 org.argeo.suite.cms/OSGI-INF/resourcesMaintenanceService.xml delete mode 100644 org.argeo.suite.cms/OSGI-INF/resourcesService.xml delete mode 100644 org.argeo.suite.cms/OSGI-INF/systemAppService.xml delete mode 100644 org.argeo.suite.cms/OSGI-INF/systemMaintenanceService.xml delete mode 100644 org.argeo.suite.cms/bnd.bnd delete mode 100644 org.argeo.suite.cms/build.properties delete mode 100644 org.argeo.suite.cms/pom.xml create mode 100644 org.argeo.suite.core/src/org/argeo/suite/util/XPathUtils.java delete mode 100644 org.argeo.suite.e4.rap/.classpath delete mode 100644 org.argeo.suite.e4.rap/.gitignore delete mode 100644 org.argeo.suite.e4.rap/.project delete mode 100644 org.argeo.suite.e4.rap/META-INF/.gitignore delete mode 100644 org.argeo.suite.e4.rap/OSGI-INF/appDeployer.xml delete mode 100644 org.argeo.suite.e4.rap/OSGI-INF/argeo-office-rap.xml delete mode 100644 org.argeo.suite.e4.rap/bnd.bnd delete mode 100644 org.argeo.suite.e4.rap/build.properties delete mode 100644 org.argeo.suite.e4.rap/cms/app.js delete mode 100644 org.argeo.suite.e4.rap/e4xmi/argeo-settings.e4xmi delete mode 100644 org.argeo.suite.e4.rap/e4xmi/argeo-suite-rap-addons.e4xmi delete mode 100644 org.argeo.suite.e4.rap/fonts.txt delete mode 100644 org.argeo.suite.e4.rap/plugin.xml delete mode 100644 org.argeo.suite.e4.rap/pom.xml delete mode 100644 org.argeo.suite.e4.rap/src/org/argeo/suite/e4/rap/ArgeoOfficeRapE4App.java delete mode 100644 org.argeo.suite.e4.rap/src/org/argeo/suite/e4/rap/ArgeoSuiteLoginLifecycle.java delete mode 100644 org.argeo.suite.e4.rap/src/org/argeo/suite/e4/rap/RapMainShellAddon.java delete mode 100644 org.argeo.suite.e4.rap/src/org/argeo/suite/e4/rap/settings/AppDeployer.java delete mode 100644 org.argeo.suite.e4.rap/src/org/argeo/suite/e4/rap/settings/AppsPart.java delete mode 100644 org.argeo.suite.e4.rap/src/org/argeo/suite/e4/rap/settings/ArgeoRapApp.java delete mode 100644 org.argeo.suite.e4/.classpath delete mode 100644 org.argeo.suite.e4/.gitignore delete mode 100644 org.argeo.suite.e4/.project delete mode 100644 org.argeo.suite.e4/META-INF/.gitignore delete mode 100644 org.argeo.suite.e4/OSGI-INF/activitiesE4Service.xml delete mode 100644 org.argeo.suite.e4/OSGI-INF/documentsE4Service.xml delete mode 100644 org.argeo.suite.e4/OSGI-INF/l10n/bundle.properties delete mode 100644 org.argeo.suite.e4/OSGI-INF/l10n/bundle_ar.properties delete mode 100644 org.argeo.suite.e4/OSGI-INF/l10n/bundle_de.properties delete mode 100644 org.argeo.suite.e4/OSGI-INF/l10n/bundle_fr.properties delete mode 100644 org.argeo.suite.e4/OSGI-INF/peopleE4Service.xml delete mode 100644 org.argeo.suite.e4/OSGI-INF/resourcesE4Service.xml delete mode 100644 org.argeo.suite.e4/OSGI-INF/systemE4Service.xml delete mode 100644 org.argeo.suite.e4/bnd.bnd delete mode 100644 org.argeo.suite.e4/build.properties delete mode 100644 org.argeo.suite.e4/e4xmi/argeo-docs.e4xmi delete mode 100644 org.argeo.suite.e4/e4xmi/argeo-office.e4xmi delete mode 100644 org.argeo.suite.e4/icons/argeo-icon-32.png delete mode 100644 org.argeo.suite.e4/pom.xml delete mode 100644 org.argeo.suite.e4/src/org/argeo/suite/e4/ActiveFeature.java delete mode 100644 org.argeo.suite.e4/src/org/argeo/suite/e4/SuiteMsg.java delete mode 100644 org.argeo.suite.e4/src/org/argeo/suite/e4/parts/AbstractSuiteDashboard.java delete mode 100644 org.argeo.suite.e4/src/org/argeo/suite/e4/parts/DefaultDashboardEditor.java delete mode 100644 org.argeo.suite.e4/src/org/argeo/suite/e4/parts/EntitySingleColumnLabelProvider.java delete mode 100644 org.argeo.suite.e4/src/org/argeo/suite/e4/parts/QuickSearchView.java delete mode 100644 org.argeo.suite.standard/.classpath delete mode 100644 org.argeo.suite.standard/.gitignore delete mode 100644 org.argeo.suite.standard/.project delete mode 100644 org.argeo.suite.standard/META-INF/.gitignore delete mode 100644 org.argeo.suite.standard/OSGI-INF/l10n/bundle.properties delete mode 100644 org.argeo.suite.standard/OSGI-INF/l10n/bundle_ar.properties delete mode 100644 org.argeo.suite.standard/OSGI-INF/l10n/bundle_de.properties delete mode 100644 org.argeo.suite.standard/OSGI-INF/l10n/bundle_fr.properties delete mode 100644 org.argeo.suite.standard/bnd.bnd delete mode 100644 org.argeo.suite.standard/build.properties delete mode 100644 org.argeo.suite.standard/e4xmi/standard-toolbars.e4xmi delete mode 100644 org.argeo.suite.standard/plugin.xml delete mode 100644 org.argeo.suite.standard/pom.xml delete mode 100644 org.argeo.suite.tracker/.classpath delete mode 100644 org.argeo.suite.tracker/.gitignore delete mode 100644 org.argeo.suite.tracker/.project delete mode 100644 org.argeo.suite.tracker/.settings/org.eclipse.jdt.core.prefs delete mode 100644 org.argeo.suite.tracker/.settings/org.eclipse.pde.core.prefs delete mode 100644 org.argeo.suite.tracker/META-INF/.gitignore delete mode 100644 org.argeo.suite.tracker/OSGI-INF/l10n/bundle.properties delete mode 100644 org.argeo.suite.tracker/OSGI-INF/l10n/bundle_ar.properties delete mode 100644 org.argeo.suite.tracker/OSGI-INF/l10n/bundle_de.properties delete mode 100644 org.argeo.suite.tracker/OSGI-INF/l10n/bundle_fr.properties delete mode 100644 org.argeo.suite.tracker/OSGI-INF/trackerE4Service.xml delete mode 100644 org.argeo.suite.tracker/OSGI-INF/trackerMaintenanceService.xml delete mode 100644 org.argeo.suite.tracker/OSGI-INF/trackerService.xml delete mode 100644 org.argeo.suite.tracker/bnd.bnd delete mode 100644 org.argeo.suite.tracker/build.properties delete mode 100644 org.argeo.suite.tracker/e4xmi/tracker-toolbars.e4xmi delete mode 100644 org.argeo.suite.tracker/plugin.xml delete mode 100644 org.argeo.suite.tracker/pom.xml create mode 100644 org.argeo.suite.ui/src/org/argeo/suite/ui/DelayedText.java delete mode 100644 systems/.gitignore delete mode 100644 systems/org.argeo.suite.studio/.classpath delete mode 100644 systems/org.argeo.suite.studio/.gitignore delete mode 100644 systems/org.argeo.suite.studio/.project delete mode 100644 systems/org.argeo.suite.studio/META-INF/.gitignore delete mode 100644 systems/org.argeo.suite.studio/bnd.bnd delete mode 100644 systems/org.argeo.suite.studio/build.properties delete mode 100644 systems/org.argeo.suite.studio/e4xmi/mvc.e4xmi delete mode 100644 systems/org.argeo.suite.studio/pom.xml delete mode 100644 systems/org.argeo.suite.studio/src/org/argeo/suite/studio/parts/RwtAppElem.java delete mode 100644 systems/org.argeo.suite.studio/src/org/argeo/suite/studio/parts/ServletElem.java delete mode 100644 systems/org.argeo.suite.studio/src/org/argeo/suite/studio/parts/SiteElem.java delete mode 100644 systems/org.argeo.suite.studio/src/org/argeo/suite/studio/parts/SiteMapPart.java delete mode 100644 systems/pom.xml diff --git a/dep/org.argeo.suite.dep.e4.rap/pom.xml b/dep/org.argeo.suite.dep.e4.rap/pom.xml index c6508a9..ebf2530 100644 --- a/dep/org.argeo.suite.dep.e4.rap/pom.xml +++ b/dep/org.argeo.suite.dep.e4.rap/pom.xml @@ -47,49 +47,19 @@ 2.1.16-SNAPSHOT - - - org.argeo.suite - org.argeo.suite.cms - 2.1.16-SNAPSHOT - - - - - - - - - - - - - - - - - - - - org.argeo.connect - org.argeo.connect.dep.e4.rap - ${version.argeo-connect} - pom - - - org.argeo.slc - org.argeo.slc.dep.e4.rap - ${version.argeo-slc} + org.argeo.commons + org.argeo.dep.cms.e4.rap + ${version.argeo-commons} pom - - org.argeo.tp.payment - com.stripe - + + + + diff --git a/dep/org.argeo.suite.dep.e4.rcp/pom.xml b/dep/org.argeo.suite.dep.e4.rcp/pom.xml index 77dffe6..57e5b2b 100644 --- a/dep/org.argeo.suite.dep.e4.rcp/pom.xml +++ b/dep/org.argeo.suite.dep.e4.rcp/pom.xml @@ -13,50 +13,6 @@ Suite E4 Platform RCP jar - - - org.argeo.suite - org.argeo.suite.cms - 2.1.16-SNAPSHOT - - - org.argeo.suite - org.argeo.suite.e4 - 2.1.16-SNAPSHOT - - - - - - - - - - org.argeo.connect - org.argeo.connect.dep.node - ${version.argeo-connect} - pom - - - - - org.argeo.connect - org.argeo.theme.argeo2 - ${version.argeo-connect} - - - - - org.argeo.connect - org.argeo.connect.ui - ${version.argeo-connect} - - - org.argeo.connect - org.argeo.connect.e4 - ${version.argeo-connect} - - org.argeo.slc.rcp @@ -66,10 +22,10 @@ - - org.argeo.tp.payment - com.stripe - + + + + diff --git a/library/.gitignore b/library/.gitignore deleted file mode 100644 index b83d222..0000000 --- a/library/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/target/ diff --git a/library/org.argeo.suite.docs/.gitignore b/library/org.argeo.suite.docs/.gitignore deleted file mode 100644 index 09e3bc9..0000000 --- a/library/org.argeo.suite.docs/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/bin/ -/target/ diff --git a/library/org.argeo.suite.docs/.project b/library/org.argeo.suite.docs/.project deleted file mode 100644 index b73240a..0000000 --- a/library/org.argeo.suite.docs/.project +++ /dev/null @@ -1,27 +0,0 @@ - - - org.argeo.suite.docs - - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.pde.ds.core.builder - - - - - - org.eclipse.pde.PluginNature - - diff --git a/library/org.argeo.suite.docs/META-INF/.gitignore b/library/org.argeo.suite.docs/META-INF/.gitignore deleted file mode 100644 index 4854a41..0000000 --- a/library/org.argeo.suite.docs/META-INF/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/MANIFEST.MF diff --git a/library/org.argeo.suite.docs/bnd.bnd b/library/org.argeo.suite.docs/bnd.bnd deleted file mode 100644 index e69de29..0000000 diff --git a/library/org.argeo.suite.docs/build.properties b/library/org.argeo.suite.docs/build.properties deleted file mode 100644 index 34d2e4d..0000000 --- a/library/org.argeo.suite.docs/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - . diff --git a/library/org.argeo.suite.docs/e4xmi/browse.e4xmi b/library/org.argeo.suite.docs/e4xmi/browse.e4xmi deleted file mode 100644 index 2faa633..0000000 --- a/library/org.argeo.suite.docs/e4xmi/browse.e4xmi +++ /dev/null @@ -1,85 +0,0 @@ - - - - - shellMaximized - auth.cn=org.argeo.office.coworker,ou=roles,ou=node - - - - entityEditorArea - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/library/org.argeo.suite.docs/pom.xml b/library/org.argeo.suite.docs/pom.xml deleted file mode 100644 index 2c98ea2..0000000 --- a/library/org.argeo.suite.docs/pom.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - 4.0.0 - - org.argeo.suite.library - suite-library - 2.1.16-SNAPSHOT - .. - - org.argeo.suite.docs - Docs App - jar - - - org.argeo.connect - org.argeo.connect.e4 - ${version.argeo-connect} - - - - - org.argeo.tp - argeo-tp-rap-e4 - ${version.argeo-tp} - pom - provided - - - diff --git a/library/pom.xml b/library/pom.xml deleted file mode 100644 index 8d2983d..0000000 --- a/library/pom.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - 4.0.0 - - org.argeo.suite - argeo-suite - 2.1.16-SNAPSHOT - .. - - org.argeo.suite.library - suite-library - Library Suite - pom - - org.argeo.suite.docs - - diff --git a/org.argeo.suite.cms/.classpath b/org.argeo.suite.cms/.classpath deleted file mode 100644 index 075009d..0000000 --- a/org.argeo.suite.cms/.classpath +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/org.argeo.suite.cms/.gitignore b/org.argeo.suite.cms/.gitignore deleted file mode 100644 index 09e3bc9..0000000 --- a/org.argeo.suite.cms/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/bin/ -/target/ diff --git a/org.argeo.suite.cms/.project b/org.argeo.suite.cms/.project deleted file mode 100644 index 159bcce..0000000 --- a/org.argeo.suite.cms/.project +++ /dev/null @@ -1,33 +0,0 @@ - - - org.argeo.suite.cms - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.pde.ds.core.builder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/org.argeo.suite.cms/META-INF/.gitignore b/org.argeo.suite.cms/META-INF/.gitignore deleted file mode 100644 index 4854a41..0000000 --- a/org.argeo.suite.cms/META-INF/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/MANIFEST.MF diff --git a/org.argeo.suite.cms/OSGI-INF/activitiesMaintenanceService.xml b/org.argeo.suite.cms/OSGI-INF/activitiesMaintenanceService.xml deleted file mode 100644 index 8d8728f..0000000 --- a/org.argeo.suite.cms/OSGI-INF/activitiesMaintenanceService.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/org.argeo.suite.cms/OSGI-INF/activitiesService.xml b/org.argeo.suite.cms/OSGI-INF/activitiesService.xml deleted file mode 100644 index e017305..0000000 --- a/org.argeo.suite.cms/OSGI-INF/activitiesService.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/org.argeo.suite.cms/OSGI-INF/documentsService.xml b/org.argeo.suite.cms/OSGI-INF/documentsService.xml deleted file mode 100644 index c4cc045..0000000 --- a/org.argeo.suite.cms/OSGI-INF/documentsService.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/org.argeo.suite.cms/OSGI-INF/peopleMaintenanceService.xml b/org.argeo.suite.cms/OSGI-INF/peopleMaintenanceService.xml deleted file mode 100644 index e50911b..0000000 --- a/org.argeo.suite.cms/OSGI-INF/peopleMaintenanceService.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/org.argeo.suite.cms/OSGI-INF/peopleService.xml b/org.argeo.suite.cms/OSGI-INF/peopleService.xml deleted file mode 100644 index 00e7e5a..0000000 --- a/org.argeo.suite.cms/OSGI-INF/peopleService.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/org.argeo.suite.cms/OSGI-INF/resourcesMaintenanceService.xml b/org.argeo.suite.cms/OSGI-INF/resourcesMaintenanceService.xml deleted file mode 100644 index f1da4f1..0000000 --- a/org.argeo.suite.cms/OSGI-INF/resourcesMaintenanceService.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/org.argeo.suite.cms/OSGI-INF/resourcesService.xml b/org.argeo.suite.cms/OSGI-INF/resourcesService.xml deleted file mode 100644 index 5f7bce1..0000000 --- a/org.argeo.suite.cms/OSGI-INF/resourcesService.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/org.argeo.suite.cms/OSGI-INF/systemAppService.xml b/org.argeo.suite.cms/OSGI-INF/systemAppService.xml deleted file mode 100644 index fd7f32a..0000000 --- a/org.argeo.suite.cms/OSGI-INF/systemAppService.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/org.argeo.suite.cms/OSGI-INF/systemMaintenanceService.xml b/org.argeo.suite.cms/OSGI-INF/systemMaintenanceService.xml deleted file mode 100644 index 9ee4a35..0000000 --- a/org.argeo.suite.cms/OSGI-INF/systemMaintenanceService.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/org.argeo.suite.cms/bnd.bnd b/org.argeo.suite.cms/bnd.bnd deleted file mode 100644 index fac8279..0000000 --- a/org.argeo.suite.cms/bnd.bnd +++ /dev/null @@ -1,28 +0,0 @@ -Bundle-ActivationPolicy: lazy -Service-Component: OSGI-INF/systemAppService.xml,\ -OSGI-INF/resourcesService.xml,\ -OSGI-INF/activitiesService.xml,\ -OSGI-INF/peopleService.xml,\ -OSGI-INF/documentsService.xml,\ -OSGI-INF/systemMaintenanceService.xml,\ -OSGI-INF/activitiesMaintenanceService.xml,\ -OSGI-INF/resourcesMaintenanceService.xml,\ -OSGI-INF/peopleMaintenanceService.xml - -Import-Package: javax.jcr,\ -javax.transaction,\ -org.osgi.service.useradmin,\ -org.argeo.cms,\ -org.argeo.connect,\ -org.argeo.activities,\ -org.argeo.people,\ -org.argeo.documents,\ -org.argeo.tracker,\ -org.argeo.connect.resources,\ -org.argeo.connect.core,\ -org.argeo.activities.core,\ -org.argeo.people.core,\ -org.argeo.documents.core,\ -org.argeo.tracker.core,\ -org.argeo.connect.resources.core,\ -* diff --git a/org.argeo.suite.cms/build.properties b/org.argeo.suite.cms/build.properties deleted file mode 100644 index 5833b74..0000000 --- a/org.argeo.suite.cms/build.properties +++ /dev/null @@ -1,16 +0,0 @@ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - OSGI-INF/resourcesService.xml,\ - OSGI-INF/activitiesService.xml,\ - OSGI-INF/systemAppService.xml,\ - OSGI-INF/userManagerService.xml,\ - OSGI-INF/peopleService.xml,\ - OSGI-INF/systemMaintenanceService.xml,\ - OSGI-INF/activitiesMaintenanceService.xml,\ - OSGI-INF/resourcesMaintenanceService.xml,\ - OSGI-INF/peopleMaintenanceService.xml,\ - OSGI-INF/trackerService.xml,\ - OSGI-INF/documentsService.xml,\ - OSGI-INF/trackerMaintenanceService.xml -source.. = src/ diff --git a/org.argeo.suite.cms/pom.xml b/org.argeo.suite.cms/pom.xml deleted file mode 100644 index 8d03838..0000000 --- a/org.argeo.suite.cms/pom.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - 4.0.0 - - org.argeo.suite - argeo-suite - 2.1.16-SNAPSHOT - .. - - org.argeo.suite.cms - Suite Deployment - jar - - - org.argeo.connect - org.argeo.connect.core - ${version.argeo-connect} - - - diff --git a/org.argeo.suite.core/src/org/argeo/suite/util/XPathUtils.java b/org.argeo.suite.core/src/org/argeo/suite/util/XPathUtils.java new file mode 100644 index 0000000..66d9aa0 --- /dev/null +++ b/org.argeo.suite.core/src/org/argeo/suite/util/XPathUtils.java @@ -0,0 +1,177 @@ +package org.argeo.suite.util; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Calendar; + +import javax.jcr.RepositoryException; +import javax.jcr.Session; +import javax.jcr.query.Query; +import javax.jcr.query.QueryManager; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.jackrabbit.util.ISO9075; + +/** Ease XPath generation for JCR requests */ +public class XPathUtils { + private final static Log log = LogFactory.getLog(XPathUtils.class); + + private final static String QUERY_XPATH = "xpath"; + + public static String descendantFrom(String parentPath) { + if (notEmpty(parentPath)) { + if ("/".equals(parentPath)) + parentPath = ""; + // Hardcoded dependency to Jackrabbit. Remove + String result = "/jcr:root" + ISO9075.encodePath(parentPath); + if (log.isTraceEnabled()) { + String result2 = "/jcr:root" + parentPath; + if (!result2.equals(result)) + log.warn("Encoded Path " + result2 + " --> " + result); + } + return result; + } else + return ""; + } + + public static String localAnd(String... conditions) { + StringBuilder builder = new StringBuilder(); + for (String condition : conditions) { + if (notEmpty(condition)) { + builder.append(" ").append(condition).append(" and "); + } + } + if (builder.length() > 3) + return builder.substring(0, builder.length() - 4); + else + return ""; + } + + public static String xPathNot(String condition) { + if (notEmpty(condition)) + return "not(" + condition + ")"; + else + return ""; + } + + public static String getFreeTextConstraint(String filter) throws RepositoryException { + StringBuilder builder = new StringBuilder(); + if (notEmpty(filter)) { + String[] strs = filter.trim().split(" "); + for (String token : strs) { + builder.append("jcr:contains(.,'*" + encodeXPathStringValue(token) + "*') and "); + } + return builder.substring(0, builder.length() - 4); + } + return ""; + } + + public static String getPropertyContains(String propertyName, String filter) throws RepositoryException { + if (notEmpty(filter)) + return "jcr:contains(@" + propertyName + ",'*" + encodeXPathStringValue(filter) + "*')"; + return ""; + } + + private final static DateFormat jcrRefFormatter = new SimpleDateFormat("yyyy-MM-dd'T'hh:mm:ss.SSS'+02:00'"); + + /** + * @param propertyName + * @param calendar the reference date + * @param lowerOrGreater "<", ">" TODO validate ">=" + * @return + * @throws RepositoryException + */ + public static String getPropertyDateComparaison(String propertyName, Calendar cal, String lowerOrGreater) + throws RepositoryException { + if (cal != null) { + String jcrDateStr = jcrRefFormatter.format(cal.getTime()); + + // jcrDateStr = "2015-08-03T05:00:03:000Z"; + String result = "@" + propertyName + " " + lowerOrGreater + " xs:dateTime('" + jcrDateStr + "')"; + return result; + } + return ""; + } + + public static String getPropertyEquals(String propertyName, String value) { + if (notEmpty(value)) + return "@" + propertyName + "='" + encodeXPathStringValue(value) + "'"; + return ""; + } + + public static String encodeXPathStringValue(String propertyValue) { + // TODO implement safer mechanism to escape invalid characters + // Also check why we have used this regex in ResourceSerrviceImpl l 474 + // String cleanedKey = key.replaceAll("(?:')", "''"); + String result = propertyValue.replaceAll("'", "''"); + return result; + } + + public static void andAppend(StringBuilder builder, String condition) { + if (notEmpty(condition)) { + builder.append(condition); + builder.append(" and "); + } + } + + public static void appendOrderByProperties(StringBuilder builder, boolean ascending, String... propertyNames) { + if (propertyNames.length > 0) { + builder.append(" order by "); + for (String propName : propertyNames) + builder.append("@").append(propName).append(", "); + builder = builder.delete(builder.length() - 2, builder.length()); + if (ascending) + builder.append(" ascending "); + else + builder.append(" descending "); + } + } + + public static void appendAndPropStringCondition(StringBuilder builder, String propertyName, String filter) + throws RepositoryException { + if (notEmpty(filter)) { + andAppend(builder, getPropertyContains(propertyName, filter)); + } + } + + public static void appendAndNotPropStringCondition(StringBuilder builder, String propertyName, String filter) + throws RepositoryException { + if (notEmpty(filter)) { + String cond = getPropertyContains(propertyName, filter); + builder.append(xPathNot(cond)); + builder.append(" and "); + } + } + + public static Query createQuery(Session session, String queryString) throws RepositoryException { + QueryManager queryManager = session.getWorkspace().getQueryManager(); + // Localise JCR properties for XPATH + queryString = localiseJcrItemNames(queryString); + return queryManager.createQuery(queryString, QUERY_XPATH); + } + + private final static String NS_JCR = "\\{http://www.jcp.org/jcr/1.0\\}"; + private final static String NS_NT = "\\{http://www.jcp.org/jcr/nt/1.0\\}"; + private final static String NS_MIX = "\\{http://www.jcp.org/jcr/mix/1.0\\}"; + + /** + * Replace the generic namespace with the local "jcr:", "nt:", "mix:" values. It + * is a workaround that must be later cleaned + */ + public static String localiseJcrItemNames(String name) { + name = name.replaceAll(NS_JCR, "jcr:"); + name = name.replaceAll(NS_NT, "nt:"); + name = name.replaceAll(NS_MIX, "mix:"); + return name; + } + + private static boolean notEmpty(String stringToTest) { + return !(stringToTest == null || "".equals(stringToTest.trim())); + } + + /** Singleton. */ + private XPathUtils() { + + } +} diff --git a/org.argeo.suite.e4.rap/.classpath b/org.argeo.suite.e4.rap/.classpath deleted file mode 100644 index eca7bdb..0000000 --- a/org.argeo.suite.e4.rap/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.argeo.suite.e4.rap/.gitignore b/org.argeo.suite.e4.rap/.gitignore deleted file mode 100644 index 09e3bc9..0000000 --- a/org.argeo.suite.e4.rap/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/bin/ -/target/ diff --git a/org.argeo.suite.e4.rap/.project b/org.argeo.suite.e4.rap/.project deleted file mode 100644 index ab1169e..0000000 --- a/org.argeo.suite.e4.rap/.project +++ /dev/null @@ -1,33 +0,0 @@ - - - org.argeo.suite.e4.rap - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.pde.ds.core.builder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/org.argeo.suite.e4.rap/META-INF/.gitignore b/org.argeo.suite.e4.rap/META-INF/.gitignore deleted file mode 100644 index 4854a41..0000000 --- a/org.argeo.suite.e4.rap/META-INF/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/MANIFEST.MF diff --git a/org.argeo.suite.e4.rap/OSGI-INF/appDeployer.xml b/org.argeo.suite.e4.rap/OSGI-INF/appDeployer.xml deleted file mode 100644 index 55057ef..0000000 --- a/org.argeo.suite.e4.rap/OSGI-INF/appDeployer.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/org.argeo.suite.e4.rap/OSGI-INF/argeo-office-rap.xml b/org.argeo.suite.e4.rap/OSGI-INF/argeo-office-rap.xml deleted file mode 100644 index 4bc1d6c..0000000 --- a/org.argeo.suite.e4.rap/OSGI-INF/argeo-office-rap.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/org.argeo.suite.e4.rap/bnd.bnd b/org.argeo.suite.e4.rap/bnd.bnd deleted file mode 100644 index 2c856d8..0000000 --- a/org.argeo.suite.e4.rap/bnd.bnd +++ /dev/null @@ -1,12 +0,0 @@ -Bundle-SymbolicName: org.argeo.suite.e4.rap;singleton:=true -Bundle-ActivationPolicy: lazy - -Service-Component: OSGI-INF/argeo-office-rap.xml,\ -OSGI-INF/appDeployer.xml - -Import-Package: org.argeo.api,\ -org.eclipse.swt,\ -org.eclipse.rap.rwt,\ -org.eclipse.rap.rwt.client,\ -org.argeo.cms.ui,\ -* diff --git a/org.argeo.suite.e4.rap/build.properties b/org.argeo.suite.e4.rap/build.properties deleted file mode 100644 index 4d5c0ad..0000000 --- a/org.argeo.suite.e4.rap/build.properties +++ /dev/null @@ -1,7 +0,0 @@ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - plugin.xml,\ - OSGI-INF/,\ - e4xmi/ -source.. = src/ diff --git a/org.argeo.suite.e4.rap/cms/app.js b/org.argeo.suite.e4.rap/cms/app.js deleted file mode 100644 index cef9cc8..0000000 --- a/org.argeo.suite.e4.rap/cms/app.js +++ /dev/null @@ -1,19 +0,0 @@ -// Standard CMS App -APP.webPath = 'suite' - -// Common -APP.pageTitle = 'Argeo Suite'; -APP.favicon = 'icons/argeo-e.png'; -APP.theme = new org.argeo.cms.ui.script.Theme(BC, 'org.argeo.theme.argeo2') - -// Office -APP.ui['office'] = new org.argeo.cms.ui.script.AppUi(APP, - new org.argeo.suite.e4.rap.ArgeoSuiteEntryPoint( - 'org.argeo.suite.e4/e4xmi/argeo-office.e4xmi')); -APP.ui['office'].pageTitle = 'Office'; - -// Docs -APP.ui['docs'] = new org.argeo.cms.ui.script.AppUi(APP, - new org.argeo.suite.e4.rap.ArgeoSuiteEntryPoint( - 'org.argeo.suite.e4/e4xmi/argeo-docs.e4xmi')); -APP.ui['docs'].pageTitle = 'Docs'; diff --git a/org.argeo.suite.e4.rap/e4xmi/argeo-settings.e4xmi b/org.argeo.suite.e4.rap/e4xmi/argeo-settings.e4xmi deleted file mode 100644 index 7c667ce..0000000 --- a/org.argeo.suite.e4.rap/e4xmi/argeo-settings.e4xmi +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/org.argeo.suite.e4.rap/e4xmi/argeo-suite-rap-addons.e4xmi b/org.argeo.suite.e4.rap/e4xmi/argeo-suite-rap-addons.e4xmi deleted file mode 100644 index fe4dfc8..0000000 --- a/org.argeo.suite.e4.rap/e4xmi/argeo-suite-rap-addons.e4xmi +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/org.argeo.suite.e4.rap/fonts.txt b/org.argeo.suite.e4.rap/fonts.txt deleted file mode 100644 index aac6147..0000000 --- a/org.argeo.suite.e4.rap/fonts.txt +++ /dev/null @@ -1 +0,0 @@ -http://fonts.googleapis.com/css?family=Source+Sans+Pro \ No newline at end of file diff --git a/org.argeo.suite.e4.rap/plugin.xml b/org.argeo.suite.e4.rap/plugin.xml deleted file mode 100644 index 27fe8b9..0000000 --- a/org.argeo.suite.e4.rap/plugin.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - diff --git a/org.argeo.suite.e4.rap/pom.xml b/org.argeo.suite.e4.rap/pom.xml deleted file mode 100644 index 1d2a0ef..0000000 --- a/org.argeo.suite.e4.rap/pom.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - 4.0.0 - - org.argeo.suite - argeo-suite - 2.1.16-SNAPSHOT - .. - - org.argeo.suite.e4.rap - Eclipse 4 RAP - jar - - - org.argeo.suite - org.argeo.suite.e4 - 2.1.16-SNAPSHOT - - - org.argeo.commons - org.argeo.cms.e4.rap - ${version.argeo-commons} - - - - - org.argeo.tp - argeo-tp-rap-e4 - ${version.argeo-tp} - pom - provided - - - diff --git a/org.argeo.suite.e4.rap/src/org/argeo/suite/e4/rap/ArgeoOfficeRapE4App.java b/org.argeo.suite.e4.rap/src/org/argeo/suite/e4/rap/ArgeoOfficeRapE4App.java deleted file mode 100644 index 213e5d2..0000000 --- a/org.argeo.suite.e4.rap/src/org/argeo/suite/e4/rap/ArgeoOfficeRapE4App.java +++ /dev/null @@ -1,46 +0,0 @@ - -package org.argeo.suite.e4.rap; - -import org.argeo.cms.e4.rap.AbstractRapE4App; -import org.eclipse.rap.rwt.application.Application; -import org.eclipse.rap.rwt.client.WebClient; -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"); - setLifeCycleUri("bundleclass://org.argeo.suite.e4.rap/org.argeo.suite.e4.rap.ArgeoSuiteLoginLifecycle"); - } - - @Override - protected void addEntryPoints(Application application) { -// CmsTheme cmsTheme = new CmsTheme(bc, "org.argeo.theme.argeo2"); -// cmsTheme.apply(application); - - String font = ""; - getBaseProperties().put(WebClient.HEAD_HTML, font); - - 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 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 = ""; -// 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/ArgeoSuiteLoginLifecycle.java b/org.argeo.suite.e4.rap/src/org/argeo/suite/e4/rap/ArgeoSuiteLoginLifecycle.java deleted file mode 100644 index 91837d8..0000000 --- a/org.argeo.suite.e4.rap/src/org/argeo/suite/e4/rap/ArgeoSuiteLoginLifecycle.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.argeo.suite.e4.rap; - -import java.security.PrivilegedActionException; -import java.security.PrivilegedExceptionAction; - -import javax.inject.Inject; -import javax.jcr.Node; -import javax.jcr.Repository; -import javax.jcr.RepositoryException; -import javax.jcr.Session; -import javax.security.auth.Subject; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.argeo.cms.e4.rap.CmsLoginLifecycle; -import org.argeo.connect.ui.SystemWorkbenchService; -import org.argeo.jcr.JcrUtils; - -/** Extends the CMS login lifecycle by managing the state of the current context. */ -public class ArgeoSuiteLoginLifecycle extends CmsLoginLifecycle { - private final static Log log = LogFactory.getLog(ArgeoSuiteLoginLifecycle.class); - @Inject - SystemWorkbenchService systemWorkbenchService; - - @Inject - Repository repository; - - @Override - protected void startupComplete() { - loadState(); - } - - @Override - protected void stateChanged() { - loadState(); - } - - private void loadState() { - String state = getState(); - // for the time being we systematically open a session, in order to make sure - // that home is initialised - Session session = null; - try { - if (state != null && state.startsWith("/")) { - String path = state.substring(1); - String workspace; - if (path.equals("")) { - workspace = null; - path = "/"; - } else { - int index = path.indexOf('/'); - if (index == 0) { - log.error("Cannot interpret // " + state); - getBrowserNavigation().pushState("~", null); - return; - } else if (index > 0) { - workspace = path.substring(0, index); - path = path.substring(index); - } else {// index<0, assuming root node - workspace = path; - path = "/"; - } - } - Subject subject = getSubject(); - session = Subject.doAs(subject, new PrivilegedExceptionAction() { - - @Override - public Session run() throws PrivilegedActionException { - try { - return repository.login(workspace); - } catch (RepositoryException e) { - throw new PrivilegedActionException(e); - } - } - - }); - Node node = session.getNode(path); - systemWorkbenchService.openEntityEditor(node); - } - } catch (RepositoryException | PrivilegedActionException e) { - log.error("Cannot load state " + state, e); - getBrowserNavigation().pushState("~", null); - } finally { - JcrUtils.logoutQuietly(session); - } - } -} diff --git a/org.argeo.suite.e4.rap/src/org/argeo/suite/e4/rap/RapMainShellAddon.java b/org.argeo.suite.e4.rap/src/org/argeo/suite/e4/rap/RapMainShellAddon.java deleted file mode 100644 index 4564e11..0000000 --- a/org.argeo.suite.e4.rap/src/org/argeo/suite/e4/rap/RapMainShellAddon.java +++ /dev/null @@ -1,26 +0,0 @@ -package org.argeo.suite.e4.rap; - -import javax.annotation.PostConstruct; - -import org.eclipse.e4.ui.model.application.MApplication; -import org.eclipse.e4.ui.model.application.ui.basic.MWindow; -import org.eclipse.e4.ui.workbench.modeling.EModelService; -import org.eclipse.swt.SWT; - -public class RapMainShellAddon { - private final static String STYLE_OVERRIDE = "styleOverride"; - private final static String SHELL_MAXIMIZED = "shellMaximized"; - - @PostConstruct - void init(EModelService modelService, MApplication application) { - MWindow window = (MWindow) modelService.find("org.argeo.suite.e4.trimmedwindow.main", application); - String currentStyle = window.getPersistedState().get(STYLE_OVERRIDE); - int style = 8; - if (currentStyle != null) { - style = Integer.parseInt(currentStyle); - } - style = style | SWT.NO_TRIM; - window.getPersistedState().put(STYLE_OVERRIDE, Integer.toString(style)); - window.getTags().add(SHELL_MAXIMIZED); - } -} diff --git a/org.argeo.suite.e4.rap/src/org/argeo/suite/e4/rap/settings/AppDeployer.java b/org.argeo.suite.e4.rap/src/org/argeo/suite/e4/rap/settings/AppDeployer.java deleted file mode 100644 index 978a8e2..0000000 --- a/org.argeo.suite.e4.rap/src/org/argeo/suite/e4/rap/settings/AppDeployer.java +++ /dev/null @@ -1,81 +0,0 @@ -package org.argeo.suite.e4.rap.settings; - -import java.util.Dictionary; -import java.util.Hashtable; -import java.util.Map; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.argeo.cms.e4.rap.AbstractRapE4App; -import org.argeo.util.LangUtils; -import org.eclipse.rap.rwt.application.ApplicationConfiguration; -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleContext; -import org.osgi.service.cm.ConfigurationException; -import org.osgi.service.cm.ManagedServiceFactory; - -/** - * Managed service factory deploying Argeo RAP app based on OSGi configurations. - */ -public class AppDeployer implements ManagedServiceFactory { - private final static Log log = LogFactory.getLog(AppDeployer.class); - private BundleContext bundleContext; - - public void init(BundleContext bundleContext, Map properties) { - this.bundleContext = bundleContext; - - deploy(findBundle("org.argeo.suite.studio", null), properties); - deploy(findBundle("org.argeo.suite.docs", null), properties); - } - - public void destroy() { - - } - - @Override - public String getName() { - return "Argeo App Deployer"; - } - - @Override - public void updated(String pid, Dictionary properties) throws ConfigurationException { - Bundle bundle = findBundle(pid, properties); - deploy(bundle, LangUtils.dictToStringMap(properties)); - } - - protected void deploy(Bundle bundle, Map properties) { -// CmsTheme cmsTheme; -// if (properties.containsKey(CmsTheme.CMS_THEME_BUNDLE_PROPERTY)) { -// String cmsThemeBundle = properties.get(CmsTheme.CMS_THEME_BUNDLE_PROPERTY); -// cmsTheme = new CmsTheme(bundleContext, cmsThemeBundle); -// } else { -// cmsTheme = new CmsTheme(bundleContext, CmsTheme.DEFAULT_CMS_THEME_BUNDLE); -// } - - ArgeoRapApp app = new ArgeoRapApp(bundleContext, bundle, null); - - Hashtable props = new Hashtable(); - props.put(AbstractRapE4App.CONTEXT_NAME_PROPERTY, app.getContextName()); - bundleContext.registerService(ApplicationConfiguration.class, app, props); - - if (log.isDebugEnabled()) - log.debug("Deployed Argeo App " + bundle.getSymbolicName() + " to " + app.getContextName()); - } - - @Override - public void deleted(String pid) { - } - - protected Bundle findBundle(String pid, Dictionary properties) { - Bundle bundle = null; - for (Bundle b : bundleContext.getBundles()) { - if (b.getSymbolicName().equals(pid)) { - bundle = b; - break; - } - } - if (bundle == null) - throw new IllegalStateException("Bundle " + pid + " not found"); - return bundle; - } -} diff --git a/org.argeo.suite.e4.rap/src/org/argeo/suite/e4/rap/settings/AppsPart.java b/org.argeo.suite.e4.rap/src/org/argeo/suite/e4/rap/settings/AppsPart.java deleted file mode 100644 index 2f80ec8..0000000 --- a/org.argeo.suite.e4.rap/src/org/argeo/suite/e4/rap/settings/AppsPart.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.argeo.suite.e4.rap.settings; - -import javax.annotation.PostConstruct; - -import org.eclipse.swt.widgets.Composite; - -/** Overview of the active and activable Apps. */ -public class AppsPart { - @PostConstruct - public void createUi(Composite parent) { - - } -} diff --git a/org.argeo.suite.e4.rap/src/org/argeo/suite/e4/rap/settings/ArgeoRapApp.java b/org.argeo.suite.e4.rap/src/org/argeo/suite/e4/rap/settings/ArgeoRapApp.java deleted file mode 100644 index 3bdc902..0000000 --- a/org.argeo.suite.e4.rap/src/org/argeo/suite/e4/rap/settings/ArgeoRapApp.java +++ /dev/null @@ -1,70 +0,0 @@ -package org.argeo.suite.e4.rap.settings; - -import java.util.Enumeration; -import java.util.Map; - -import org.apache.commons.io.FilenameUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.argeo.cms.e4.rap.AbstractRapE4App; -import org.argeo.cms.ui.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; - -/** Argeo RAP app. */ -public class ArgeoRapApp extends AbstractRapE4App { - private final static Log log = LogFactory.getLog(ArgeoRapApp.class); - - private CmsTheme cmsTheme; - private String baseE4xmi = "/e4xmi"; - private Bundle bundle; - - public ArgeoRapApp(BundleContext bundleContext, Bundle bundle, CmsTheme cmsTheme) { - setBundleContext(bundleContext); - this.cmsTheme = cmsTheme; - this.bundle = bundle; - setLifeCycleUri("bundleclass://org.argeo.suite.e4.rap/org.argeo.suite.e4.rap.ArgeoSuiteLoginLifecycle"); - String contextName = "apps/" + FilenameUtils.getExtension(bundle.getSymbolicName()); - setContextName(contextName); - } - - public ArgeoRapApp() { - setLifeCycleUri("bundleclass://org.argeo.suite.e4.rap/org.argeo.suite.e4.rap.ArgeoSuiteLoginLifecycle"); - } - - @Override - public void init(BundleContext bundleContext, Map properties) { - super.init(bundleContext, properties); - // super must be first -// if (getBaseProperties().containsKey(CmsTheme.CMS_THEME_BUNDLE_PROPERTY)) { -// String cmsThemeBundle = getBaseProperties().get(CmsTheme.CMS_THEME_BUNDLE_PROPERTY); -// cmsTheme = new CmsTheme(getBundleContext(), cmsThemeBundle); -// } else { -// cmsTheme = new CmsTheme(getBundleContext(), CmsTheme.DEFAULT_CMS_THEME_BUNDLE); -// } - bundle = bundleContext.getBundle(); - } - - @Override - protected void addEntryPoints(Application application) { -// if (cmsTheme != null) -// cmsTheme.apply(application); - - String font = ""; - getBaseProperties().put(WebClient.HEAD_HTML, font); - - Enumeration paths = bundle.getEntryPaths(baseE4xmi); - while (paths.hasMoreElements()) { - String p = paths.nextElement(); - if (p.endsWith(".e4xmi")) { - String e4xmiPath = bundle.getSymbolicName() + '/' + p; - String name = '/' + FilenameUtils.removeExtension(FilenameUtils.getName(p)); - addE4EntryPoint(application, name, e4xmiPath, getBaseProperties()); - if (log.isDebugEnabled()) - log.debug("Registered " + e4xmiPath + " as " + getContextName() + name); - } - } - } -} diff --git a/org.argeo.suite.e4/.classpath b/org.argeo.suite.e4/.classpath deleted file mode 100644 index eca7bdb..0000000 --- a/org.argeo.suite.e4/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.argeo.suite.e4/.gitignore b/org.argeo.suite.e4/.gitignore deleted file mode 100644 index 09e3bc9..0000000 --- a/org.argeo.suite.e4/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/bin/ -/target/ diff --git a/org.argeo.suite.e4/.project b/org.argeo.suite.e4/.project deleted file mode 100644 index 38541c0..0000000 --- a/org.argeo.suite.e4/.project +++ /dev/null @@ -1,33 +0,0 @@ - - - org.argeo.suite.e4 - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.pde.ds.core.builder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/org.argeo.suite.e4/META-INF/.gitignore b/org.argeo.suite.e4/META-INF/.gitignore deleted file mode 100644 index 4854a41..0000000 --- a/org.argeo.suite.e4/META-INF/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/MANIFEST.MF diff --git a/org.argeo.suite.e4/OSGI-INF/activitiesE4Service.xml b/org.argeo.suite.e4/OSGI-INF/activitiesE4Service.xml deleted file mode 100644 index 7115835..0000000 --- a/org.argeo.suite.e4/OSGI-INF/activitiesE4Service.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/org.argeo.suite.e4/OSGI-INF/documentsE4Service.xml b/org.argeo.suite.e4/OSGI-INF/documentsE4Service.xml deleted file mode 100644 index 8cd25e0..0000000 --- a/org.argeo.suite.e4/OSGI-INF/documentsE4Service.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/org.argeo.suite.e4/OSGI-INF/l10n/bundle.properties b/org.argeo.suite.e4/OSGI-INF/l10n/bundle.properties deleted file mode 100644 index 37e5f5d..0000000 --- a/org.argeo.suite.e4/OSGI-INF/l10n/bundle.properties +++ /dev/null @@ -1,23 +0,0 @@ -# Standard toolbar -save=Save -saveAll=Save all -closeAll=Close all -delete=Delete -exit=Exit -changePassword=Change password... - -# Dashboard perspective -dashboard=Dashboard -search=Search -documents=Documents - -# Folders perspective -folders=Folders - -# Commands -newEntity=New... -newTodo=New task - -# Editors -person=Person -organisation=Organisation diff --git a/org.argeo.suite.e4/OSGI-INF/l10n/bundle_ar.properties b/org.argeo.suite.e4/OSGI-INF/l10n/bundle_ar.properties deleted file mode 100644 index 115943f..0000000 --- a/org.argeo.suite.e4/OSGI-INF/l10n/bundle_ar.properties +++ /dev/null @@ -1,20 +0,0 @@ -# Standard toolbar -save=\u062D\u0641\u0638 -saveAll=\u0627\u062D\u0641\u0638 \u0627\u0644\u0643\u0644 -closeAll=\u0623\u063A\u0644\u0642 \u0643\u0644 \u0634\u064A\u0621 -delete=\u062D\u0630\u0641 -exit=\u0649\u062E\u0631\u062C - -# Dashboard perspective -dashboard=\u0644\u0648\u062D\u0629 \u0627\u0644\u0642\u064A\u0627\u062F\u0629 -search=\u0627\u0643\u062A\u0634\u0641 -documents=\u0645\u0633\u062A\u0646\u062F\u0627\u062A - -# Folders perspective -folders=\u0645\u0644\u0641\u0627\u062A - -# Commands -newEntity=\u062E\u0644\u0642... -newTodo=\u0645\u0647\u0645\u0629 \u062C\u062F\u064A\u062F\u0629 - -# Editors diff --git a/org.argeo.suite.e4/OSGI-INF/l10n/bundle_de.properties b/org.argeo.suite.e4/OSGI-INF/l10n/bundle_de.properties deleted file mode 100644 index fb12b59..0000000 --- a/org.argeo.suite.e4/OSGI-INF/l10n/bundle_de.properties +++ /dev/null @@ -1,23 +0,0 @@ -# Standard toolbar -save=Speichern -saveAll=Alles speichern -closeAll=Alles schließen -delete=Entfernen -exit=Verlassen -changePassword=Password ändern... - -# Dashboard perspective -dashboard=Dashboard -search=Suchen -documents=Dokumente - -# Folders perspective -folders=Ordner - -# Commands -newEntity=Neu... -newTodo=Neue Aufgabe - -# Editors -person=Person -organisation=Organisation diff --git a/org.argeo.suite.e4/OSGI-INF/l10n/bundle_fr.properties b/org.argeo.suite.e4/OSGI-INF/l10n/bundle_fr.properties deleted file mode 100644 index 4c44e5a..0000000 --- a/org.argeo.suite.e4/OSGI-INF/l10n/bundle_fr.properties +++ /dev/null @@ -1,23 +0,0 @@ -# Standard toolbar -save=Sauver -saveAll=Tout sauver -closeAll=Tout fermer -delete=Supprimer -exit=Quitter -changePassword=Changer de mot de passe... - -# Dashboard perspective -dashboard=Dashboard -search=Recherche -documents=Documents - -# Folders perspective -folders=Fichiers - -# Commands -newEntity=Nouveau... -newTodo=Nouvelle tâche - -# Editors -person=Personne -organisation=Organisation diff --git a/org.argeo.suite.e4/OSGI-INF/peopleE4Service.xml b/org.argeo.suite.e4/OSGI-INF/peopleE4Service.xml deleted file mode 100644 index 8e894f4..0000000 --- a/org.argeo.suite.e4/OSGI-INF/peopleE4Service.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/org.argeo.suite.e4/OSGI-INF/resourcesE4Service.xml b/org.argeo.suite.e4/OSGI-INF/resourcesE4Service.xml deleted file mode 100644 index 7617639..0000000 --- a/org.argeo.suite.e4/OSGI-INF/resourcesE4Service.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/org.argeo.suite.e4/OSGI-INF/systemE4Service.xml b/org.argeo.suite.e4/OSGI-INF/systemE4Service.xml deleted file mode 100644 index 3cd10d9..0000000 --- a/org.argeo.suite.e4/OSGI-INF/systemE4Service.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/org.argeo.suite.e4/bnd.bnd b/org.argeo.suite.e4/bnd.bnd deleted file mode 100644 index 0b51fd8..0000000 --- a/org.argeo.suite.e4/bnd.bnd +++ /dev/null @@ -1,23 +0,0 @@ -Bundle-ActivationPolicy: lazy -Service-Component: OSGI-INF/systemE4Service.xml,\ -OSGI-INF/resourcesE4Service.xml,\ -OSGI-INF/activitiesE4Service.xml,\ -OSGI-INF/peopleE4Service.xml,\ -OSGI-INF/documentsE4Service.xml - -Import-Package: org.eclipse.swt,\ -org.eclipse.core.commands.common,\ -javax.jcr.nodetype,\ -org.eclipse.e4.core.contexts,\ -org.eclipse.e4.ui.model.application.ui,\ -org.argeo.entity,\ -org.argeo.connect.ui,\ -org.argeo.connect.e4,\ -org.argeo.connect.e4.handlers,\ -org.argeo.activities.e4,\ -org.argeo.people.e4,\ -org.argeo.people.e4.handlers,\ -org.argeo.documents.e4,\ -org.argeo.connect.e4.resources,\ -org.eclipse.rap.*;version="0.0.0",\ -* diff --git a/org.argeo.suite.e4/build.properties b/org.argeo.suite.e4/build.properties deleted file mode 100644 index e9765d7..0000000 --- a/org.argeo.suite.e4/build.properties +++ /dev/null @@ -1,6 +0,0 @@ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - OSGI-INF/,\ - e4xmi/ -source.. = src/ diff --git a/org.argeo.suite.e4/e4xmi/argeo-docs.e4xmi b/org.argeo.suite.e4/e4xmi/argeo-docs.e4xmi deleted file mode 100644 index 2faa633..0000000 --- a/org.argeo.suite.e4/e4xmi/argeo-docs.e4xmi +++ /dev/null @@ -1,85 +0,0 @@ - - - - - shellMaximized - auth.cn=org.argeo.office.coworker,ou=roles,ou=node - - - - entityEditorArea - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/org.argeo.suite.e4/e4xmi/argeo-office.e4xmi b/org.argeo.suite.e4/e4xmi/argeo-office.e4xmi deleted file mode 100644 index b721154..0000000 --- a/org.argeo.suite.e4/e4xmi/argeo-office.e4xmi +++ /dev/null @@ -1,140 +0,0 @@ - - - - - shellMaximized - auth.cn=org.argeo.office.coworker,ou=roles,ou=node - - - - - minimized - - - - - - - - - - - - - - - - - - - - - entityEditorArea - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - removeOnHide - - - - - - removeOnHide - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/org.argeo.suite.e4/icons/argeo-icon-32.png b/org.argeo.suite.e4/icons/argeo-icon-32.png deleted file mode 100644 index 42dd206a1fdbf3dfe4c581770f629ee8ffd2896f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1291 zcmV+m1@!ufP)QaQgVWfwGnzR0 zp|VLGC-00|Hf3WuL<(u>4rPmlP(tF%YUP%ah#J5oacX@bKyTWal0E8nG|588smcGpiW&!a@<7%y#p#TOMvHrDF*K4z(&bINneSG zzJMz-Yk?L0NKg}yBRM#Jrvx4ZDu9^Vtke?8!H3}-q%h!50f+7Y9AICkESbWioQav-D7+pU*YDx=qf^hg zTN4&kyNYW7>~=cK3;|c-pmc;d$tG%xoWFV_; zUifjA>#IGb*?Ok{_+jNp8hx?~EVtW-8G4)P>&W|Uy?`x>%$t!qqmZE4XQkkDno`m@VYSz1ecMw}5YU#fH-UJ)Km*M; zrIo12yaOx_3v7bAD}yMkOKbnSY22!6SJ8WL?B;iE8G94Z6>)0ZWm?un?*)H$Bw)8U zksW95Z7jc(lwVV}qY!E$w#wcF8uT30=8_!_xV$NeFVChPbGIa}s4gpVX>WR;Td^V& z>hmTEcAp*3&a)HC>N*CkIN&OFhm)z%^Q@I&6_6F~Mk^sfVO<)#8YX;k$rqD62mqjR|r7L>;x1}XZhg$qsjDR(RObIYiU7iHA3CJ)cpfcX17t~@3;;^~D z0VtVa4BVq$MdmP&t8uZmc3XZKm6eyKOF#{<%qR;MDVV0ncm#~l0qp@^3$z21^%Ns} zGTYBreR4AFKoZ;_mI@Kt7(opC)uE*gNCF-M9tzhPx1LJp<64_7!Q%Jyl+SP`yuLwH zn?z{JU77t&u;q6fTWW3750({GM4Sn|Ypui;ygIEbX!1hedV`U5D<)PR%If^|kMwjc zxFLbWd>@DAeHP5Cnl+)hE7~i>?VZ}$n8MTh=X@R;?1+uG_3r^B$2ddDMm$?jd(E9UcUoTRiFGNl z?O7RvTfp>pgzjz=$J-L9X&$b8cVW!7KYcN44!DX>g=@|I{x`fCY{*9Iq|EBswn42K zR&#Jjvp?E@?pka;@YCUa+kd{r_usPqyng>X`wMx6(Gv#~$fy7S002ovPDHLkV1hS6 BVetR} diff --git a/org.argeo.suite.e4/pom.xml b/org.argeo.suite.e4/pom.xml deleted file mode 100644 index ed9810b..0000000 --- a/org.argeo.suite.e4/pom.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - 4.0.0 - - org.argeo.suite - argeo-suite - 2.1.16-SNAPSHOT - .. - - org.argeo.suite.e4 - Eclipse 4 - jar - - - org.argeo.connect - org.argeo.connect.e4 - ${version.argeo-connect} - - - - - org.argeo.tp - argeo-tp-rap-e4 - ${version.argeo-tp} - pom - provided - - - diff --git a/org.argeo.suite.e4/src/org/argeo/suite/e4/ActiveFeature.java b/org.argeo.suite.e4/src/org/argeo/suite/e4/ActiveFeature.java deleted file mode 100644 index 24a17b0..0000000 --- a/org.argeo.suite.e4/src/org/argeo/suite/e4/ActiveFeature.java +++ /dev/null @@ -1,17 +0,0 @@ - -package org.argeo.suite.e4; - -import org.eclipse.e4.core.di.annotations.Evaluate; - -public class ActiveFeature { - - - public ActiveFeature() { - super(); - } - - @Evaluate - public boolean evaluate() { - return false; - } -} diff --git a/org.argeo.suite.e4/src/org/argeo/suite/e4/SuiteMsg.java b/org.argeo.suite.e4/src/org/argeo/suite/e4/SuiteMsg.java deleted file mode 100644 index 46b7842..0000000 --- a/org.argeo.suite.e4/src/org/argeo/suite/e4/SuiteMsg.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.argeo.suite.e4; - -import org.argeo.cms.Localized; - -public enum SuiteMsg implements Localized { - newTodo; -} diff --git a/org.argeo.suite.e4/src/org/argeo/suite/e4/parts/AbstractSuiteDashboard.java b/org.argeo.suite.e4/src/org/argeo/suite/e4/parts/AbstractSuiteDashboard.java deleted file mode 100644 index 1271b0d..0000000 --- a/org.argeo.suite.e4/src/org/argeo/suite/e4/parts/AbstractSuiteDashboard.java +++ /dev/null @@ -1,188 +0,0 @@ -package org.argeo.suite.e4.parts; - -import javax.annotation.PostConstruct; -import javax.annotation.PreDestroy; -import javax.inject.Inject; -import javax.jcr.Node; -import javax.jcr.Repository; -import javax.jcr.Session; - -import org.argeo.api.NodeConstants; -import org.argeo.cms.ui.eclipse.forms.FormToolkit; -import org.argeo.cms.ui.util.CmsUiUtils; -import org.argeo.connect.SystemAppService; -import org.argeo.connect.resources.ResourcesService; -import org.argeo.connect.ui.AppWorkbenchService; -import org.argeo.connect.ui.ConnectUiStyles; -import org.argeo.connect.ui.SystemWorkbenchService; -import org.argeo.connect.util.ConnectJcrUtils; -import org.argeo.eclipse.ui.EclipseUiUtils; -import org.argeo.jcr.JcrUtils; -import org.eclipse.e4.ui.di.Focus; -import org.eclipse.rap.rwt.RWT; -import org.eclipse.rap.rwt.client.service.BrowserNavigation; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Link; - -/** Generic dashboard for Argeo Suite applications */ -public abstract class AbstractSuiteDashboard { - // private final static Log log = - // LogFactory.getLog(AbstractSuiteDashboard.class); - - // DEPENDENCY INJECTION - @Inject - private Repository repository; - @Inject - private ResourcesService resourcesService; - @Inject - private SystemAppService systemAppService; - @Inject - private SystemWorkbenchService systemWorkbenchService; - - private Session homeSession; - private Session mainSession; - - // UI Objects - private FormToolkit toolkit; - - // RAP specific - private BrowserNavigation browserNavigation; - - public void init() { - homeSession = ConnectJcrUtils.login(repository, NodeConstants.HOME_WORKSPACE); - mainSession = ConnectJcrUtils.login(repository); - // updateTooltip(input); - } - - // private void updateTooltip(IEditorInput input) { - // if (input instanceof EntityEditorInput) { - // EntityEditorInput sei = (EntityEditorInput) input; - // sei.setTooltipText("My Dashboard"); - // } - // } - - /** - * Implementing classes must call super in order to create the correct form - * toolkit - */ - @PostConstruct - public void createPartControl(Composite parent) { - toolkit = new FormToolkit(Display.getCurrent()); - init(); - browserNavigation = RWT.getClient().getService(BrowserNavigation.class); - } - - // UTILS - protected Composite createGadgetCmp(Composite parent, int widthHint, int heightHint) { - Composite gadgetCmp = toolkit.createComposite(parent, SWT.BORDER); - GridData gd = new GridData(SWT.CENTER, SWT.CENTER, false, false); - gd.widthHint = widthHint; - gd.heightHint = heightHint; - gadgetCmp.setLayoutData(gd); - CmsUiUtils.style(gadgetCmp, ConnectUiStyles.GADGET_BOX); - return gadgetCmp; - } - - protected Composite createGadgetTitleCmp(Composite parent, String title) { - Composite titleCmp = toolkit.createComposite(parent, SWT.BACKGROUND | SWT.INHERIT_NONE); - CmsUiUtils.style(titleCmp, ConnectUiStyles.GADGET_HEADER); - titleCmp.setBackground(null); - GridData gd = new GridData(SWT.FILL, SWT.TOP, true, false); - titleCmp.setLayoutData(gd); - titleCmp.setLayout(new GridLayout()); - - Label titleLbl = toolkit.createLabel(titleCmp, title + " ", SWT.BOLD); - CmsUiUtils.style(titleLbl, ConnectUiStyles.GADGET_HEADER); - titleLbl.setBackground(null); - return titleCmp; - } - - protected Composite createGadgetBodyCmp(Composite parent) { - Composite bodyCmp = toolkit.createComposite(parent, SWT.BACKGROUND | SWT.INHERIT_NONE); - bodyCmp.setLayoutData(EclipseUiUtils.fillAll()); - bodyCmp.setLayout(new GridLayout()); - return bodyCmp; - } - - protected Link createOpenEntityEditorLink(final AppWorkbenchService peopleUiService, Composite parent, - final String label, final Node entity) { - Link link = new Link(parent, SWT.NONE); - link.setText("" + label + ""); - link.setLayoutData(EclipseUiUtils.fillWidth()); - link.addSelectionListener(new SelectionAdapter() { - private static final long serialVersionUID = 1L; - - @Override - public void widgetSelected(final SelectionEvent event) { - // Map params = new HashMap(); - // params.put(ConnectEditor.PARAM_JCR_ID, - // ConnectJcrUtils.getIdentifier(entity)); - // CommandUtils.callCommand(peopleUiService.getOpenEntityEditorCmdId(), params); - peopleUiService.openEntityEditor(entity); - } - }); - return link; - } - - // Life cycle - @PreDestroy - public void dispose() { - JcrUtils.logoutQuietly(homeSession); - JcrUtils.logoutQuietly(mainSession); - } - - @Focus - public void setFocus() { - browserNavigation.pushState("~", "Dashboard"); - } - - // Expose to implementing classes - protected Session getHomeSession() { - return homeSession; - } - - public Session getMainSession() { - return mainSession; - } - - public ResourcesService getResourcesService() { - return resourcesService; - } - - protected SystemAppService getSystemAppService() { - return systemAppService; - } - - protected SystemWorkbenchService getSystemWorkbenchService() { - return systemWorkbenchService; - } - - protected FormToolkit getFormToolkit() { - return toolkit; - } - - /* DEPENDENCY INJECTION */ - // public void setRepository(Repository repository) { - // this.repository = repository; - // } - // - // public void setResourcesService(ResourcesService resourcesService) { - // this.resourcesService = resourcesService; - // } - // - // public void setSystemAppService(SystemAppService systemAppService) { - // this.systemAppService = systemAppService; - // } - // - // public void setSystemWorkbenchService(SystemWorkbenchService - // systemWorkbenchService) { - // this.systemWorkbenchService = systemWorkbenchService; - // } -} diff --git a/org.argeo.suite.e4/src/org/argeo/suite/e4/parts/DefaultDashboardEditor.java b/org.argeo.suite.e4/src/org/argeo/suite/e4/parts/DefaultDashboardEditor.java deleted file mode 100644 index dd1c2b0..0000000 --- a/org.argeo.suite.e4/src/org/argeo/suite/e4/parts/DefaultDashboardEditor.java +++ /dev/null @@ -1,420 +0,0 @@ -package org.argeo.suite.e4.parts; - -import java.util.ArrayList; -import java.util.Calendar; -import java.util.GregorianCalendar; -import java.util.List; - -import javax.annotation.PostConstruct; -import javax.inject.Inject; -import javax.jcr.Node; -import javax.jcr.NodeIterator; -import javax.jcr.Property; -import javax.jcr.RepositoryException; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.argeo.activities.ActivitiesNames; -import org.argeo.activities.ActivitiesService; -import org.argeo.activities.ActivitiesTypes; -import org.argeo.activities.ui.TaskViewerContextMenu; -import org.argeo.api.NodeUtils; -import org.argeo.cms.auth.CurrentUser; -import org.argeo.cms.ui.util.CmsUiUtils; -import org.argeo.connect.ConnectException; -import org.argeo.connect.ConnectNames; -import org.argeo.connect.ui.ConnectWorkbenchUtils; -import org.argeo.connect.ui.Refreshable; -import org.argeo.connect.util.ConnectJcrUtils; -import org.argeo.eclipse.ui.EclipseUiUtils; -import org.argeo.jcr.JcrUtils; -import org.argeo.suite.e4.SuiteMsg; -import org.argeo.tracker.TrackerNames; -import org.argeo.tracker.TrackerService; -import org.argeo.tracker.core.TrackerUtils; -import org.argeo.tracker.ui.TaskListLabelProvider; -import org.argeo.tracker.ui.TaskVirtualListComposite; -import org.eclipse.e4.core.di.annotations.Optional; -import org.eclipse.jface.viewers.ColumnLabelProvider; -import org.eclipse.jface.viewers.DoubleClickEvent; -import org.eclipse.jface.viewers.IDoubleClickListener; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.TableViewer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.MouseAdapter; -import org.eclipse.swt.events.MouseEvent; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.graphics.Color; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.layout.RowLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Link; - -/** Argeo Suite Default Dashboard */ -public class DefaultDashboardEditor extends AbstractSuiteDashboard implements Refreshable { - final static Log log = LogFactory.getLog(DefaultDashboardEditor.class); - // public final static String ID = AsUiPlugin.PLUGIN_ID + - // ".defaultDashboardEditor"; - - @Inject - private ActivitiesService activitiesService; - - @Inject - @Optional - private TrackerService trackerService; - - private String datePattern = "dd MMM yyyy"; - - private Composite headerCmp; - private Composite taskListCmp; - private TaskVirtualListComposite tvlc; - - @PostConstruct - public void createPartControl(Composite parent) { - super.createPartControl(parent); - parent.setLayout(EclipseUiUtils.noSpaceGridLayout()); - Composite bodyCmp = new Composite(parent, SWT.NO_FOCUS); - bodyCmp.setLayoutData(EclipseUiUtils.fillAll()); - bodyCmp.setLayout(new GridLayout()); - - headerCmp = new Composite(bodyCmp, SWT.NO_FOCUS); - headerCmp.setLayoutData(EclipseUiUtils.fillWidth()); - - taskListCmp = new Composite(bodyCmp, SWT.NO_FOCUS); - taskListCmp.setLayoutData(EclipseUiUtils.fillAll()); - forceRefresh(null); - } - - @Override - public void forceRefresh(Object object) { - CmsUiUtils.clear(headerCmp); - populateHeaderPart(headerCmp, NodeUtils.getUserHome(getHomeSession())); - - CmsUiUtils.clear(taskListCmp); - populateTaskListCmp(taskListCmp); - - headerCmp.getParent().layout(true, true); - } - - private void populateTaskListCmp(Composite parent) { - parent.setLayout(EclipseUiUtils.noSpaceGridLayout()); - NodeIterator nit = activitiesService.getMyTasks(getMainSession(), true); - if (!nit.hasNext()) { - Composite noTaskCmp = new Composite(parent, SWT.NO_FOCUS); - noTaskCmp.setLayoutData(EclipseUiUtils.fillAll()); - noTaskCmp.setLayout(new GridLayout()); - - // Label noTaskLbl = new Label(noTaskCmp, SWT.CENTER); - // noTaskLbl.setText(" You have no pending Task. "); - // CmsUiUtils.markup(noTaskLbl); - // noTaskLbl.setLayoutData(new GridData(SWT.CENTER, SWT.BOTTOM, true, true)); - - } else { - TaskListLabelProvider labelProvider = new TaskListLabelProvider(getSystemAppService()); - tvlc = new TaskVirtualListComposite(parent, SWT.NO_FOCUS, (ILabelProvider) labelProvider, 54); - tvlc.setLayoutData(EclipseUiUtils.fillAll()); - final TableViewer viewer = tvlc.getTableViewer(); - viewer.setInput(JcrUtils.nodeIteratorToList(nit).toArray()); - final TaskViewerContextMenu contextMenu = new TaskViewerContextMenu(viewer, getHomeSession(), - activitiesService) { - @Override - public boolean performAction(String actionId) { - boolean hasChanged = super.performAction(actionId); - if (hasChanged) { - viewer.getTable().setFocus(); - forceRefresh(null); - // NodeIterator nit = - // activitiesService.getMyTasks(getSession(), true); - // viewer.setInput(JcrUtils.nodeIteratorToList(nit).toArray()); - } - return hasChanged; - } - }; - viewer.getTable().addMouseListener(new MouseAdapter() { - private static final long serialVersionUID = 6737579410648595940L; - - @Override - public void mouseDown(MouseEvent e) { - if (e.button == 3) { - // contextMenu.setCurrFolderPath(currDisplayedFolder); - contextMenu.show(viewer.getTable(), new Point(e.x, e.y), - (IStructuredSelection) viewer.getSelection()); - } - } - }); - viewer.addDoubleClickListener(new IDoubleClickListener() { - - @Override - public void doubleClick(DoubleClickEvent event) { - IStructuredSelection sel = (IStructuredSelection) viewer.getSelection(); - Node task = (Node) sel.getFirstElement(); - getSystemWorkbenchService().openEntityEditor(task); - } - }); - } - } - - private boolean isOverdue(Node node, String propName) { - try { - Calendar now = GregorianCalendar.getInstance(); - return node.hasProperty(propName) && node.getProperty(propName).getDate().before(now); - } catch (RepositoryException e) { - throw new ConnectException("Cannot check overdue status with property " + propName + " on " + node, e); - } - } - - private void populateHeaderPart(Composite bodyCmp, Node context) { - bodyCmp.setLayout(EclipseUiUtils.noSpaceGridLayout(new GridLayout(2, true))); - - Composite leftCmp = new Composite(bodyCmp, SWT.NO_FOCUS); - leftCmp.setLayout(new GridLayout()); - leftCmp.setLayoutData(EclipseUiUtils.fillWidth()); - Composite rightCmp = new Composite(bodyCmp, SWT.NO_FOCUS); - rightCmp.setLayout(new GridLayout()); - rightCmp.setLayoutData(EclipseUiUtils.fillWidth()); - - // Title - Label titleLbl = new Label(leftCmp, SWT.WRAP | SWT.LEAD); - CmsUiUtils.markup(titleLbl); - String titleStr = "" + CurrentUser.getDisplayName() + ""; - titleLbl.setText(titleStr); - GridData gd = new GridData(SWT.BEGINNING, SWT.TOP, false, false); - // gd.verticalIndent = 5; - // gd.horizontalIndent = 10; - titleLbl.setLayoutData(gd); - - final Link createTaskLk = new Link(leftCmp, SWT.CENTER); - // createTaskLk.setText("Create a task"); - createTaskLk.setText("" + SuiteMsg.newTodo.lead() + ""); - gd = new GridData(SWT.BEGINNING, SWT.TOP, false, false); - // gd.verticalIndent = 5; - gd.horizontalIndent = 10; - createTaskLk.setLayoutData(gd); - - createTaskLk.addSelectionListener(new SelectionAdapter() { - private static final long serialVersionUID = -9028457805156989935L; - - @Override - public void widgetSelected(SelectionEvent e) { - // String mainMixin = TrackerTypes.TRACKER_TASK; - String mainMixin = ActivitiesTypes.ACTIVITIES_TASK; - String pathCreated = ConnectWorkbenchUtils.createAndConfigureEntity(createTaskLk.getShell(), - getHomeSession(), getSystemAppService(), getSystemWorkbenchService(), mainMixin); - if (EclipseUiUtils.notEmpty(pathCreated)) - forceRefresh(null); - } - }); - - NodeIterator nit = activitiesService.getMyTasks(getHomeSession(), true); - if (nit.hasNext()) { - List overdueTasks = new ArrayList<>(); - while (nit.hasNext()) { - Node currNode = nit.nextNode(); - if (isOverdue(currNode, ActivitiesNames.ACTIVITIES_DUE_DATE)) - overdueTasks.add(currNode); - } - if (!overdueTasks.isEmpty()) { - Composite overdueCmp = new Composite(leftCmp, SWT.NO_FOCUS); - long size = overdueTasks.size(); - String overdueStr = "You have " + size + " overdue task" + (size > 1 ? "s" : "") + ": "; - populateMuliValueClickableList(overdueCmp, overdueTasks.toArray(new Node[0]), new TaskLp(), overdueStr); - } - } - - if (trackerService != null) { - nit = trackerService.getMyMilestones(getHomeSession(), true); - List openMilestones = new ArrayList<>(); - - if (nit.hasNext()) { - List overdueMilestones = new ArrayList<>(); - while (nit.hasNext()) { - Node currNode = nit.nextNode(); - openMilestones.add(currNode); - if (isOverdue(currNode, TrackerNames.TRACKER_TARGET_DATE)) - overdueMilestones.add(currNode); - } - if (!overdueMilestones.isEmpty()) { - Composite overdueCmp = new Composite(leftCmp, SWT.NO_FOCUS); - long size = overdueMilestones.size(); - String overdueStr = "You have " + size + " overdue milestone" + (size > 1 ? "s" : "") + ": "; - populateMuliValueClickableList(overdueCmp, overdueMilestones.toArray(new Node[0]), - new MilestoneLp(), overdueStr); - } - } - - // My projects - List openProjects = JcrUtils.nodeIteratorToList(trackerService.getMyProjects(getHomeSession(), true)); - if (!openProjects.isEmpty()) { - Group myProjectsGp = new Group(rightCmp, SWT.NO_FOCUS); - myProjectsGp.setText("My open projects"); - myProjectsGp.setLayoutData(EclipseUiUtils.fillWidth()); - populateMuliValueClickableList(myProjectsGp, openProjects.toArray(new Node[0]), new ProjectLp(), null); - } - - // My Milestones - if (!openMilestones.isEmpty()) { - Group myMilestoneGp = new Group(rightCmp, SWT.NO_FOCUS); - myMilestoneGp.setText("My open milestones"); - myMilestoneGp.setLayoutData(EclipseUiUtils.fillWidth()); - populateMuliValueClickableList(myMilestoneGp, openMilestones.toArray(new Node[0]), new MilestoneLp(), - null); - } - } - } - - private class ProjectLp extends ColumnLabelProvider { - private static final long serialVersionUID = 7231233932794865555L; - - @Override - public String getText(Object element) { - Node project = (Node) element; - - String percent; - NodeIterator nit = TrackerUtils.getIssues(project, null, null, null, true); - long openNb = nit.getSize(); - - nit = TrackerUtils.getIssues(project, null, null, null, false); - long allNb = nit.getSize(); - - if (allNb < 1) - percent = "empty"; - else { - double num = allNb - openNb; - double result = num / allNb * 100; - percent = String.format("%.1f", result) + "% done"; - } - StringBuilder builder = new StringBuilder(); - builder.append("").append(ConnectJcrUtils.get(project, Property.JCR_TITLE)).append(""); - builder.append(" (").append(percent).append(")"); - - return builder.toString(); - } - } - - private class MilestoneLp extends ColumnLabelProvider { - private static final long serialVersionUID = 7231233932794865555L; - - @Override - public String getText(Object element) { - Node milestone = (Node) element; - Node project = TrackerUtils.getRelatedProject(trackerService, milestone); - String dueDate = ConnectJcrUtils.getDateFormattedAsString(milestone, TrackerNames.TRACKER_TARGET_DATE, - datePattern); - - String percent; - String propName = TrackerNames.TRACKER_MILESTONE_UID; - String muid = ConnectJcrUtils.get(milestone, ConnectNames.CONNECT_UID); - NodeIterator nit = TrackerUtils.getIssues(project, null, propName, muid, true); - long openNb = nit.getSize(); - - nit = TrackerUtils.getIssues(project, null, propName, muid, false); - long allNb = nit.getSize(); - - if (allNb < 1) - percent = "empty"; - else { - double num = allNb - openNb; - double result = num / allNb * 100; - percent = String.format("%.1f", result) + "% done"; - } - StringBuilder builder = new StringBuilder(); - builder.append("").append(ConnectJcrUtils.get(milestone, Property.JCR_TITLE)).append(""); - builder.append(" ("); - if (EclipseUiUtils.notEmpty(dueDate)) - builder.append("due to ").append(dueDate).append(", "); - - builder.append(percent).append(")"); - return builder.toString(); - } - - @Override - public Color getForeground(Object element) { - Node milestone = (Node) element; - Calendar dueDate = ConnectJcrUtils.getDateValue(milestone, TrackerNames.TRACKER_TARGET_DATE); - if (dueDate != null && dueDate.before(Calendar.getInstance())) - return Display.getCurrent().getSystemColor(SWT.COLOR_RED); - return null; - } - } - - private class TaskLp extends ColumnLabelProvider { - private static final long serialVersionUID = 7231233932794865555L; - - @Override - public String getText(Object element) { - Node task = (Node) element; - String dueDate = ConnectJcrUtils.getDateFormattedAsString(task, ActivitiesNames.ACTIVITIES_DUE_DATE, - datePattern); - - StringBuilder builder = new StringBuilder(); - builder.append("").append(ConnectJcrUtils.get(task, Property.JCR_TITLE)).append(""); - if (EclipseUiUtils.notEmpty(dueDate)) - builder.append(" (").append("due to ").append(dueDate).append(")"); - return builder.toString(); - } - - @Override - public Color getForeground(Object element) { - Node milestone = (Node) element; - Calendar dueDate = ConnectJcrUtils.getDateValue(milestone, TrackerNames.TRACKER_TARGET_DATE); - if (dueDate != null && dueDate.before(Calendar.getInstance())) - return Display.getCurrent().getSystemColor(SWT.COLOR_RED); - return null; - } - } - - // public void setActivitiesService(ActivitiesService activitiesService) { - // this.activitiesService = activitiesService; - // } - // - // public void setTrackerService(TrackerService trackerService) { - // this.trackerService = trackerService; - // } - - // LOCAL HELPERS - private void populateMuliValueClickableList(Composite parent, Node[] nodes, ColumnLabelProvider lp, - String listLabel) { - CmsUiUtils.clear(parent); - RowLayout rl = new RowLayout(SWT.HORIZONTAL | SWT.WRAP); - rl.wrap = true; - rl.marginLeft = rl.marginTop = rl.marginBottom = 0; - rl.marginRight = 8; - parent.setLayout(rl); - - if (EclipseUiUtils.notEmpty(listLabel)) { - Link link = new Link(parent, SWT.NONE); - link.setText(listLabel); - link.setFont(EclipseUiUtils.getBoldFont(parent)); - } - - int i = 1; - for (Node node : nodes) { - Link link = new Link(parent, SWT.NONE); - CmsUiUtils.markup(link); - link.setText(lp.getText(node) + (i != nodes.length ? ", " : "")); - i++; - // Color fc = lp.getForeground(node); - // if (fc != null) - // link.setForeground(fc); - - link.addSelectionListener(new SelectionAdapter() { - private static final long serialVersionUID = 1L; - - @Override - public void widgetSelected(final SelectionEvent event) { - // CommandUtils.callCommand(getSystemWorkbenchService().getOpenEntityEditorCmdId(), - // ConnectEditor.PARAM_JCR_ID, ConnectJcrUtils.getIdentifier(node)); - getSystemWorkbenchService().openEntityEditor(node); - } - }); - } - } - -} diff --git a/org.argeo.suite.e4/src/org/argeo/suite/e4/parts/EntitySingleColumnLabelProvider.java b/org.argeo.suite.e4/src/org/argeo/suite/e4/parts/EntitySingleColumnLabelProvider.java deleted file mode 100644 index 5387d30..0000000 --- a/org.argeo.suite.e4/src/org/argeo/suite/e4/parts/EntitySingleColumnLabelProvider.java +++ /dev/null @@ -1,92 +0,0 @@ -package org.argeo.suite.e4.parts; - -import javax.jcr.Node; -import javax.jcr.Property; -import javax.jcr.RepositoryException; -import javax.jcr.nodetype.NodeType; - -import org.argeo.activities.ActivitiesService; -import org.argeo.activities.ActivitiesTypes; -import org.argeo.activities.ui.ActivityListLabelProvider; -import org.argeo.connect.resources.ResourcesService; -import org.argeo.connect.ui.ConnectUiConstants; -import org.argeo.connect.ui.SystemWorkbenchService; -import org.argeo.connect.ui.util.TagLabelProvider; -import org.argeo.connect.util.ConnectUtils; -import org.argeo.people.PeopleException; -import org.argeo.people.PeopleNames; -import org.argeo.people.PeopleService; -import org.argeo.people.PeopleTypes; -import org.argeo.people.ui.providers.GroupLabelProvider; -import org.argeo.people.ui.providers.OrgListLabelProvider; -import org.argeo.people.ui.providers.PersonListLabelProvider; -import org.argeo.tracker.TrackerTypes; -import org.argeo.tracker.ui.TrackerSingleColLP; -import org.eclipse.jface.viewers.ColumnLabelProvider; -import org.eclipse.swt.graphics.Image; - -/** - * Provide a single column label provider for entity lists. Icon and displayed - * text vary with the element node type - */ -public class EntitySingleColumnLabelProvider extends ColumnLabelProvider implements PeopleNames { - private static final long serialVersionUID = 3111885324210673320L; - - private SystemWorkbenchService systemWorkbenchService; - - private ActivityListLabelProvider activityLP; - private TrackerSingleColLP trackerLP; - private OrgListLabelProvider orgLp; - private PersonListLabelProvider personLp; - private GroupLabelProvider groupLp = new GroupLabelProvider(ConnectUiConstants.LIST_TYPE_SMALL); - private TagLabelProvider mlInstanceLp; - - public EntitySingleColumnLabelProvider(ResourcesService resourceService, ActivitiesService activitiesService, - PeopleService peopleService, SystemWorkbenchService systemWorkbenchService) { - this.systemWorkbenchService = systemWorkbenchService; - activityLP = new ActivityListLabelProvider(activitiesService); - trackerLP = new TrackerSingleColLP(activitiesService); - personLp = new PersonListLabelProvider(peopleService); - orgLp = new OrgListLabelProvider(resourceService, peopleService); - mlInstanceLp = new TagLabelProvider(resourceService, ConnectUiConstants.LIST_TYPE_SMALL); - } - - @Override - public String getText(Object element) { - try { - Node entity = (Node) element; - String result; - - if (entity.isNodeType(TrackerTypes.TRACKER_TASK) || entity.isNodeType(TrackerTypes.TRACKER_PROJECT) - || entity.isNodeType(TrackerTypes.TRACKER_MILESTONE)) - result = trackerLP.getText(element); - else if (entity.isNodeType(ActivitiesTypes.ACTIVITIES_ACTIVITY)) - result = activityLP.getText(element); - else if (entity.isNodeType(PeopleTypes.PEOPLE_PERSON)) - result = personLp.getText(element); - else if (entity.isNodeType(PeopleTypes.PEOPLE_ORG)) - result = orgLp.getText(element); - else if (entity.isNodeType(PeopleTypes.PEOPLE_MAILING_LIST)) - result = mlInstanceLp.getText(element); - else if (entity.isNodeType(PeopleTypes.PEOPLE_GROUP)) - result = groupLp.getText(element); - else if (entity.isNodeType(NodeType.MIX_TITLE)) { - if (entity.hasProperty(Property.JCR_TITLE)) - result = entity.getProperty(Property.JCR_TITLE).getString(); - else - result = entity.getName(); - } else - result = ""; - return ConnectUtils.replaceAmpersand(result); - } catch (RepositoryException re) { - throw new PeopleException("Unable to get formatted value for node", re); - } - } - - /** Overwrite this method to provide project specific images */ - @Override - public Image getImage(Object element) { - return systemWorkbenchService.getIconForType((Node) element); - } - -} diff --git a/org.argeo.suite.e4/src/org/argeo/suite/e4/parts/QuickSearchView.java b/org.argeo.suite.e4/src/org/argeo/suite/e4/parts/QuickSearchView.java deleted file mode 100644 index 5cfbc39..0000000 --- a/org.argeo.suite.e4/src/org/argeo/suite/e4/parts/QuickSearchView.java +++ /dev/null @@ -1,279 +0,0 @@ -package org.argeo.suite.e4.parts; - -import static org.argeo.eclipse.ui.EclipseUiUtils.notEmpty; - -import java.util.List; - -import javax.annotation.PostConstruct; -import javax.annotation.PreDestroy; -import javax.inject.Inject; -import javax.jcr.NodeIterator; -import javax.jcr.Repository; -import javax.jcr.RepositoryException; -import javax.jcr.Session; -import javax.jcr.observation.Event; -import javax.jcr.observation.EventIterator; -import javax.jcr.observation.EventListener; -import javax.jcr.query.Query; -import javax.jcr.query.QueryResult; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.argeo.activities.ActivitiesService; -import org.argeo.cms.ui.util.CmsUiUtils; -import org.argeo.connect.ConnectException; -import org.argeo.connect.ConnectTypes; -import org.argeo.connect.resources.ResourcesService; -import org.argeo.connect.ui.ConnectUiConstants; -import org.argeo.connect.ui.Refreshable; -import org.argeo.connect.ui.SystemWorkbenchService; -import org.argeo.connect.ui.util.BasicNodeListContentProvider; -import org.argeo.connect.ui.util.JcrViewerDClickListener; -import org.argeo.connect.ui.widgets.DelayedText; -import org.argeo.connect.util.ConnectJcrUtils; -import org.argeo.connect.util.XPathUtils; -import org.argeo.eclipse.ui.EclipseUiUtils; -import org.argeo.jcr.JcrUtils; -import org.argeo.people.PeopleService; -import org.eclipse.e4.ui.di.Focus; -import org.eclipse.e4.ui.workbench.modeling.ESelectionService; -import org.eclipse.jface.layout.TableColumnLayout; -import org.eclipse.jface.viewers.ColumnWeightData; -import org.eclipse.jface.viewers.ILabelProvider; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.viewers.TableViewer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.KeyEvent; -import org.eclipse.swt.events.KeyListener; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Table; -import org.eclipse.swt.widgets.TableColumn; -import org.eclipse.swt.widgets.Text; - -/** A table with a quick search field. */ -public class QuickSearchView implements Refreshable { - private final static Log log = LogFactory.getLog(QuickSearchView.class); - // public static final String ID = AsUiPlugin.PLUGIN_ID + ".quickSearchView"; - - /* DEPENDENCY INJECTION */ - @Inject - private Repository repository; - @Inject - private ResourcesService resourcesService; - @Inject - private ActivitiesService activitiesService; - @Inject - private PeopleService peopleService; - @Inject - private SystemWorkbenchService systemWorkbenchService; - - @Inject - private ESelectionService selectionService; - - // This page widgets - private TableViewer entityViewer; - private Text filterTxt; - - private Session session; - - // @Override - // public void init(IViewSite site) throws PartInitException { - // super.init(site); - // } - - @PostConstruct - public void createPartControl(Composite parent) { - session = ConnectJcrUtils.login(repository); - // MainLayout - parent.setLayout(new GridLayout()); - addFilterPanel(parent); - entityViewer = createListPart(parent, new EntitySingleColumnLabelProvider(resourcesService, activitiesService, - peopleService, systemWorkbenchService)); - refreshFilteredList(); - - try { - // new String[] { ConnectTypes.CONNECT_ENTITY } - session.getWorkspace().getObservationManager().addEventListener(new EventListener() { - - @Override - public void onEvent(EventIterator events) { - parent.getDisplay().asyncExec(() -> refreshFilteredList()); - } - }, Event.PROPERTY_CHANGED | Event.NODE_ADDED | Event.NODE_REMOVED | Event.PROPERTY_ADDED, "/", true, null, - null, false); - } catch (RepositoryException e) { - throw new ConnectException("Cannot add JCR observer", e); - } - - } - - private void addFilterPanel(Composite parent) { - // Use a delayed text: the query won't be done until the user stop - // typing for 800ms - int style = SWT.BORDER | SWT.SEARCH | SWT.ICON_CANCEL; - DelayedText delayedText = new DelayedText(parent, style, ConnectUiConstants.SEARCH_TEXT_DELAY); - filterTxt = delayedText.getText(); - filterTxt.setLayoutData(EclipseUiUtils.fillWidth()); - - // final ServerPushSession pushSession = new ServerPushSession(); - delayedText.addDelayedModifyListener(null, new ModifyListener() { - private static final long serialVersionUID = 5003010530960334977L; - - public void modifyText(ModifyEvent event) { - delayedText.getText().getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - refreshFilteredList(); - } - }); - // pushSession.stop(); - } - }); - - // Jump to the first item of the list using the down arrow - filterTxt.addKeyListener(new KeyListener() { - private static final long serialVersionUID = -4523394262771183968L; - - @Override - public void keyReleased(KeyEvent e) { - } - - @Override - public void keyPressed(KeyEvent e) { - // boolean shiftPressed = (e.stateMask & SWT.SHIFT) != 0; - // boolean altPressed = (e.stateMask & SWT.ALT) != 0; - if (e.keyCode == SWT.ARROW_DOWN || e.keyCode == SWT.TAB) { - Object first = entityViewer.getElementAt(0); - if (first != null) { - entityViewer.getTable().setFocus(); - entityViewer.setSelection(new StructuredSelection(first), true); - } - e.doit = false; - } - } - }); - } - - protected TableViewer createListPart(Composite parent, ILabelProvider labelProvider) { - parent.setLayout(new GridLayout()); - - Composite tableComposite = new Composite(parent, SWT.NONE); - GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_VERTICAL - | GridData.VERTICAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL); - tableComposite.setLayoutData(gd); - - TableViewer v = new TableViewer(tableComposite); - v.setLabelProvider(labelProvider); - - TableColumn singleColumn = new TableColumn(v.getTable(), SWT.V_SCROLL); - TableColumnLayout tableColumnLayout = new TableColumnLayout(); - tableColumnLayout.setColumnData(singleColumn, new ColumnWeightData(85)); - tableComposite.setLayout(tableColumnLayout); - - // Corresponding table & style - Table table = v.getTable(); - table.setLinesVisible(true); - table.setHeaderVisible(false); - CmsUiUtils.markup(table); - CmsUiUtils.setItemHeight(table, 26); - - v.setContentProvider(new BasicNodeListContentProvider()); - v.addDoubleClickListener(new JcrViewerDClickListener(systemWorkbenchService)); - v.addSelectionChangedListener(new ISelectionChangedListener() { - public void selectionChanged(SelectionChangedEvent event) { - IStructuredSelection selection = (IStructuredSelection) event.getSelection(); - List lst = selection.toList(); - if (lst != null && !lst.isEmpty()) - selectionService.setSelection(selection.toList()); - else - selectionService.setSelection(null); - } - }); - return v; - } - - @PreDestroy - public void dispose() { - JcrUtils.logoutQuietly(session); - } - - @Focus - public void setFocus() { - refreshFilteredList(); - filterTxt.setFocus(); - } - - @Override - public void forceRefresh(Object object) { - refreshFilteredList(); - } - - protected void refreshFilteredList() { - try { - String filter = filterTxt.getText(); - // Prevents the query on the full repository - // if (isEmpty(filter)) { - // entityViewer.setInput(null); - // return; - // } - - // XPATH Query - String xpathQueryStr = "//element(*, " + ConnectTypes.CONNECT_ENTITY + ")"; - String xpathFilter = XPathUtils.getFreeTextConstraint(filter); - if (notEmpty(xpathFilter)) - xpathQueryStr += "[" + xpathFilter + "]"; - - // boolean doOrder = orderResultsBtn != null - // && !(orderResultsBtn.isDisposed()) - // && orderResultsBtn.getSelection(); - // if (doOrder) { - // xpathQueryStr += " order by jcr:title"; - // } - - long begin = System.currentTimeMillis(); - // session.refresh(false); - Query xpathQuery = XPathUtils.createQuery(session, xpathQueryStr); - - xpathQuery.setLimit(ConnectUiConstants.SEARCH_DEFAULT_LIMIT); - QueryResult result = xpathQuery.execute(); - - NodeIterator nit = result.getNodes(); - entityViewer.setInput(JcrUtils.nodeIteratorToList(nit)); - if (log.isTraceEnabled()) { - long end = System.currentTimeMillis(); - log.trace("Quick Search - Found: " + nit.getSize() + " in " + (end - begin) - + " ms by executing XPath query (" + xpathQueryStr + ")."); - } - } catch (RepositoryException e) { - throw new ConnectException("Unable to list entities", e); - } - } - - // public void setRepository(Repository repository) { - // this.repository = repository; - // } - // - // public void setResourcesService(ResourcesService resourcesService) { - // this.resourcesService = resourcesService; - // } - // - // public void setActivitiesService(ActivitiesService activitiesService) { - // this.activitiesService = activitiesService; - // } - // - // public void setPeopleService(PeopleService peopleService) { - // this.peopleService = peopleService; - // } - // - // public void setSystemWorkbenchService(SystemWorkbenchService - // systemWorkbenchService) { - // this.systemWorkbenchService = systemWorkbenchService; - // } -} diff --git a/org.argeo.suite.standard/.classpath b/org.argeo.suite.standard/.classpath deleted file mode 100644 index eca7bdb..0000000 --- a/org.argeo.suite.standard/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.argeo.suite.standard/.gitignore b/org.argeo.suite.standard/.gitignore deleted file mode 100644 index e0e1cc4..0000000 --- a/org.argeo.suite.standard/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/bin/ -/target diff --git a/org.argeo.suite.standard/.project b/org.argeo.suite.standard/.project deleted file mode 100644 index 22ed203..0000000 --- a/org.argeo.suite.standard/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.argeo.suite.standard - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/org.argeo.suite.standard/META-INF/.gitignore b/org.argeo.suite.standard/META-INF/.gitignore deleted file mode 100644 index 4854a41..0000000 --- a/org.argeo.suite.standard/META-INF/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/MANIFEST.MF diff --git a/org.argeo.suite.standard/OSGI-INF/l10n/bundle.properties b/org.argeo.suite.standard/OSGI-INF/l10n/bundle.properties deleted file mode 100644 index d58cc68..0000000 --- a/org.argeo.suite.standard/OSGI-INF/l10n/bundle.properties +++ /dev/null @@ -1,7 +0,0 @@ -# New entities -newTask=New task -newPerson=New person -newOrganisation=New organisation - -# Perspectives -folders=Folders diff --git a/org.argeo.suite.standard/OSGI-INF/l10n/bundle_ar.properties b/org.argeo.suite.standard/OSGI-INF/l10n/bundle_ar.properties deleted file mode 100644 index b768c4a..0000000 --- a/org.argeo.suite.standard/OSGI-INF/l10n/bundle_ar.properties +++ /dev/null @@ -1,7 +0,0 @@ -# New entities -newTask=\u0645\u0647\u0645\u0629 \u062C\u062F\u064A\u062F\u0629 -newPerson=\u0634\u062E\u0635 \u062C\u062F\u064A\u062F -newOrganisation=\u0645\u0646\u0638\u0645\u0629 \u062C\u062F\u064A\u062F\u0629 - -# Perspectives -folders=\u0645\u0644\u0641\u0627\u062A diff --git a/org.argeo.suite.standard/OSGI-INF/l10n/bundle_de.properties b/org.argeo.suite.standard/OSGI-INF/l10n/bundle_de.properties deleted file mode 100644 index e76c1de..0000000 --- a/org.argeo.suite.standard/OSGI-INF/l10n/bundle_de.properties +++ /dev/null @@ -1,7 +0,0 @@ -# New entities -newTask=Neue Aufgabe -newPerson=Neue Personne -newOrganisation=Neue Organisation - -# Perspectives -folders=Ordner diff --git a/org.argeo.suite.standard/OSGI-INF/l10n/bundle_fr.properties b/org.argeo.suite.standard/OSGI-INF/l10n/bundle_fr.properties deleted file mode 100644 index 76b98e8..0000000 --- a/org.argeo.suite.standard/OSGI-INF/l10n/bundle_fr.properties +++ /dev/null @@ -1,4 +0,0 @@ -# New entities -newTask=Nouvelle tâche -newPerson=Nouvelle personne -newOrganisation=Nouvelle organisation diff --git a/org.argeo.suite.standard/bnd.bnd b/org.argeo.suite.standard/bnd.bnd deleted file mode 100644 index e2dbcd2..0000000 --- a/org.argeo.suite.standard/bnd.bnd +++ /dev/null @@ -1,2 +0,0 @@ -Bundle-SymbolicName: org.argeo.suite.standard;singleton:=true -Bundle-ActivationPolicy: lazy diff --git a/org.argeo.suite.standard/build.properties b/org.argeo.suite.standard/build.properties deleted file mode 100644 index a2c90fd..0000000 --- a/org.argeo.suite.standard/build.properties +++ /dev/null @@ -1,7 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - OSGI-INF/,\ - e4xmi/,\ - plugin.xml diff --git a/org.argeo.suite.standard/e4xmi/standard-toolbars.e4xmi b/org.argeo.suite.standard/e4xmi/standard-toolbars.e4xmi deleted file mode 100644 index cc375fe..0000000 --- a/org.argeo.suite.standard/e4xmi/standard-toolbars.e4xmi +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - auth.cn=org.argeo.activities.editor,ou=roles,ou=node - - - - auth.cn=org.argeo.people.editor,ou=roles,ou=node - - - - auth.cn=org.argeo.people.editor,ou=roles,ou=node - - - - - - - - - - - - diff --git a/org.argeo.suite.standard/plugin.xml b/org.argeo.suite.standard/plugin.xml deleted file mode 100644 index c4d9794..0000000 --- a/org.argeo.suite.standard/plugin.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - diff --git a/org.argeo.suite.standard/pom.xml b/org.argeo.suite.standard/pom.xml deleted file mode 100644 index d165a47..0000000 --- a/org.argeo.suite.standard/pom.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - 4.0.0 - - org.argeo.suite - argeo-suite - 2.1.16-SNAPSHOT - .. - - org.argeo.suite.standard - Standard Suite - jar - - - org.argeo.suite - org.argeo.suite.e4 - 2.1.16-SNAPSHOT - - - diff --git a/org.argeo.suite.tracker/.classpath b/org.argeo.suite.tracker/.classpath deleted file mode 100644 index eca7bdb..0000000 --- a/org.argeo.suite.tracker/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/org.argeo.suite.tracker/.gitignore b/org.argeo.suite.tracker/.gitignore deleted file mode 100644 index 09e3bc9..0000000 --- a/org.argeo.suite.tracker/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/bin/ -/target/ diff --git a/org.argeo.suite.tracker/.project b/org.argeo.suite.tracker/.project deleted file mode 100644 index b5e6542..0000000 --- a/org.argeo.suite.tracker/.project +++ /dev/null @@ -1,33 +0,0 @@ - - - org.argeo.suite.tracker - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.pde.ds.core.builder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/org.argeo.suite.tracker/.settings/org.eclipse.jdt.core.prefs b/org.argeo.suite.tracker/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 0c68a61..0000000 --- a/org.argeo.suite.tracker/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,7 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.compliance=1.8 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.8 diff --git a/org.argeo.suite.tracker/.settings/org.eclipse.pde.core.prefs b/org.argeo.suite.tracker/.settings/org.eclipse.pde.core.prefs deleted file mode 100644 index f29e940..0000000 --- a/org.argeo.suite.tracker/.settings/org.eclipse.pde.core.prefs +++ /dev/null @@ -1,3 +0,0 @@ -eclipse.preferences.version=1 -pluginProject.extensions=false -resolve.requirebundle=false diff --git a/org.argeo.suite.tracker/META-INF/.gitignore b/org.argeo.suite.tracker/META-INF/.gitignore deleted file mode 100644 index 4854a41..0000000 --- a/org.argeo.suite.tracker/META-INF/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/MANIFEST.MF diff --git a/org.argeo.suite.tracker/OSGI-INF/l10n/bundle.properties b/org.argeo.suite.tracker/OSGI-INF/l10n/bundle.properties deleted file mode 100644 index b5a3127..0000000 --- a/org.argeo.suite.tracker/OSGI-INF/l10n/bundle.properties +++ /dev/null @@ -1,3 +0,0 @@ -newProjectTask=New project task -newMilestone=New milestone -newProject=New project diff --git a/org.argeo.suite.tracker/OSGI-INF/l10n/bundle_ar.properties b/org.argeo.suite.tracker/OSGI-INF/l10n/bundle_ar.properties deleted file mode 100644 index 799f9de..0000000 --- a/org.argeo.suite.tracker/OSGI-INF/l10n/bundle_ar.properties +++ /dev/null @@ -1,3 +0,0 @@ -newProjectTask=\u0645\u0647\u0645\u0629 \u0645\u0634\u0631\u0648\u0639 \u062C\u062F\u064A\u062F -newMilestone=\u0645\u0639\u0644\u0645 \u062C\u062F\u064A\u062F -newProject=\u0645\u0634\u0631\u0648\u0639 \u062C\u062F\u064A\u062F diff --git a/org.argeo.suite.tracker/OSGI-INF/l10n/bundle_de.properties b/org.argeo.suite.tracker/OSGI-INF/l10n/bundle_de.properties deleted file mode 100644 index d8c0482..0000000 --- a/org.argeo.suite.tracker/OSGI-INF/l10n/bundle_de.properties +++ /dev/null @@ -1,3 +0,0 @@ -newProjectTask=Neue Projektaufgabe -newMilestone=Neuer Meilenstein -newProject=Neues Projekt diff --git a/org.argeo.suite.tracker/OSGI-INF/l10n/bundle_fr.properties b/org.argeo.suite.tracker/OSGI-INF/l10n/bundle_fr.properties deleted file mode 100644 index f1f61d5..0000000 --- a/org.argeo.suite.tracker/OSGI-INF/l10n/bundle_fr.properties +++ /dev/null @@ -1,3 +0,0 @@ -newProjectTask=Nouvelle tâche projet -newMilestone=Nouvelle étape -newProject=Nouveau projet diff --git a/org.argeo.suite.tracker/OSGI-INF/trackerE4Service.xml b/org.argeo.suite.tracker/OSGI-INF/trackerE4Service.xml deleted file mode 100644 index c768361..0000000 --- a/org.argeo.suite.tracker/OSGI-INF/trackerE4Service.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/org.argeo.suite.tracker/OSGI-INF/trackerMaintenanceService.xml b/org.argeo.suite.tracker/OSGI-INF/trackerMaintenanceService.xml deleted file mode 100644 index 994282d..0000000 --- a/org.argeo.suite.tracker/OSGI-INF/trackerMaintenanceService.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/org.argeo.suite.tracker/OSGI-INF/trackerService.xml b/org.argeo.suite.tracker/OSGI-INF/trackerService.xml deleted file mode 100644 index 9cb2a0d..0000000 --- a/org.argeo.suite.tracker/OSGI-INF/trackerService.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - diff --git a/org.argeo.suite.tracker/bnd.bnd b/org.argeo.suite.tracker/bnd.bnd deleted file mode 100644 index 72ab4d2..0000000 --- a/org.argeo.suite.tracker/bnd.bnd +++ /dev/null @@ -1,16 +0,0 @@ -Bundle-SymbolicName: org.argeo.suite.tracker;singleton:=true -Bundle-ActivationPolicy: lazy - -Service-Component: OSGI-INF/trackerService.xml,\ -OSGI-INF/trackerMaintenanceService.xml,\ -OSGI-INF/trackerE4Service.xml - -Import-Package: javax.jcr,\ -org.argeo.connect,\ -org.argeo.activities,\ -org.argeo.tracker,\ -org.argeo.tracker.core,\ -org.argeo.tracker.e4,\ -org.argeo.cms,\ -org.argeo.connect.ui,\ -* diff --git a/org.argeo.suite.tracker/build.properties b/org.argeo.suite.tracker/build.properties deleted file mode 100644 index 6dad7ac..0000000 --- a/org.argeo.suite.tracker/build.properties +++ /dev/null @@ -1,7 +0,0 @@ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - e4xmi/,\ - plugin.xml,\ - OSGI-INF/ -source.. = src/ diff --git a/org.argeo.suite.tracker/e4xmi/tracker-toolbars.e4xmi b/org.argeo.suite.tracker/e4xmi/tracker-toolbars.e4xmi deleted file mode 100644 index c73508f..0000000 --- a/org.argeo.suite.tracker/e4xmi/tracker-toolbars.e4xmi +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - auth.cn=org.argeo.tracker.editor,ou=roles,ou=node - - - - auth.cn=org.argeo.tracker.editor,ou=roles,ou=node - - - - auth.cn=org.argeo.tracker.editor,ou=roles,ou=node - - - - - diff --git a/org.argeo.suite.tracker/plugin.xml b/org.argeo.suite.tracker/plugin.xml deleted file mode 100644 index 96b3a7c..0000000 --- a/org.argeo.suite.tracker/plugin.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - diff --git a/org.argeo.suite.tracker/pom.xml b/org.argeo.suite.tracker/pom.xml deleted file mode 100644 index 8f96c06..0000000 --- a/org.argeo.suite.tracker/pom.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - 4.0.0 - - org.argeo.suite - argeo-suite - 2.1.16-SNAPSHOT - .. - - org.argeo.suite.tracker - Tracker - jar - - - org.argeo.suite - org.argeo.suite.e4 - 2.1.16-SNAPSHOT - - - diff --git a/org.argeo.suite.ui/bnd.bnd b/org.argeo.suite.ui/bnd.bnd index c64a5cd..b8793ec 100644 --- a/org.argeo.suite.ui/bnd.bnd +++ b/org.argeo.suite.ui/bnd.bnd @@ -10,7 +10,6 @@ Import-Package:\ org.argeo.api,\ org.eclipse.swt,\ org.osgi.framework,\ -org.argeo.connect.ui,\ org.argeo.entity,\ org.eclipse.core.commands.common,\ * diff --git a/org.argeo.suite.ui/pom.xml b/org.argeo.suite.ui/pom.xml index 310ce62..aa72921 100644 --- a/org.argeo.suite.ui/pom.xml +++ b/org.argeo.suite.ui/pom.xml @@ -13,15 +13,22 @@ Suite UI jar + + org.argeo.suite + org.argeo.suite.core + 2.1.16-SNAPSHOT + org.argeo.suite org.argeo.entity.ui 2.1.16-SNAPSHOT + + - org.argeo.connect - org.argeo.connect.ui - ${version.argeo-connect} + org.argeo.commons + org.argeo.eclipse.ui + ${version.argeo-commons} diff --git a/org.argeo.suite.ui/src/org/argeo/suite/ui/DelayedText.java b/org.argeo.suite.ui/src/org/argeo/suite/ui/DelayedText.java new file mode 100644 index 0000000..286f0ac --- /dev/null +++ b/org.argeo.suite.ui/src/org/argeo/suite/ui/DelayedText.java @@ -0,0 +1,127 @@ +package org.argeo.suite.ui; + +import java.util.Timer; +import java.util.TimerTask; + +import org.eclipse.rap.rwt.service.ServerPushSession; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Event; +import org.eclipse.swt.widgets.Text; + +/** + * Text that introduce a timer in the attached ModifyListener. + * + * Note that corresponding ModifyEvent will *NOT* be sent in the UI thread. + * Calling ModifierInstance must be implemented in consequence. Note also that + * this delayed text only manages one listener at a time. + * + */ +public class DelayedText { + final int delay; + private Object lock = new Object(); + private MyTimer timer = new MyTimer(DelayedText.this.toString()); + private ModifyListener delayedModifyListener; + private ServerPushSession pushSession; + + private Text text; + + private ModifyListener modifyListener = new ModifyListener() { + private static final long serialVersionUID = 1117506414462641980L; + + public void modifyText(ModifyEvent e) { + ModifyEvent delayedEvent = null; + synchronized (lock) { + if (delayedModifyListener != null) { + Event tmpEvent = new Event(); + tmpEvent.widget = text; + tmpEvent.display = e.display; + tmpEvent.data = e.data; + tmpEvent.time = e.time; + delayedEvent = new ModifyEvent(tmpEvent); + } + } + final ModifyEvent timerModifyEvent = delayedEvent; + + synchronized (timer) { + if (timer.timerTask != null) { + timer.timerTask.cancel(); + timer.timerTask = null; + } + + if (delayedEvent != null) { + timer.timerTask = new TimerTask() { + public void run() { + synchronized (lock) { + delayedModifyListener.modifyText(timerModifyEvent); + // Bad approach: it is not a good idea to put a + // display.asyncExec in a lock... + // DelayedText.this.getDisplay().asyncExec(new + // Runnable() { + // @Override + // public void run() { + // delayedModifyListener.modifyText(timerModifyEvent); + // } + // } + // ); + } + synchronized (timer) { + timer.timerTask = null; + } + } + }; + timer.schedule(timer.timerTask, delay); + if (pushSession != null) + pushSession.start(); + } + } + }; + }; + + public DelayedText(Composite parent, int style, int delayInMs) { + // super(parent, style); + text = new Text(parent, style); + this.delay = delayInMs; + text.addModifyListener(modifyListener); + } + + /** + * Adds a modify text listener that will be delayed. If another Modify event + * happens during the waiting delay, the older event will be canceled an a new + * one will be scheduled after another new delay. + */ + public void addDelayedModifyListener(ServerPushSession pushSession, ModifyListener listener) { + synchronized (lock) { + delayedModifyListener = listener; + this.pushSession = pushSession; + } + } + + public void removeDelayedModifyListener(ModifyListener listener) { + synchronized (lock) { + delayedModifyListener = null; + pushSession = null; + } + } + + private class MyTimer extends Timer { + private TimerTask timerTask = null; + + public MyTimer(String name) { + super(name); + } + } + + public Text getText() { + return text; + } + + public void close() { + if (pushSession != null) + pushSession.stop(); + if (timer != null) + timer.cancel(); + }; + +} diff --git a/org.argeo.suite.ui/src/org/argeo/suite/ui/RecentItems.java b/org.argeo.suite.ui/src/org/argeo/suite/ui/RecentItems.java index 0ab37c5..108b77f 100644 --- a/org.argeo.suite.ui/src/org/argeo/suite/ui/RecentItems.java +++ b/org.argeo.suite.ui/src/org/argeo/suite/ui/RecentItems.java @@ -2,6 +2,7 @@ package org.argeo.suite.ui; import static org.argeo.eclipse.ui.EclipseUiUtils.notEmpty; +import java.util.List; import java.util.Map; import javax.jcr.Node; @@ -18,15 +19,12 @@ import org.argeo.cms.ui.CmsTheme; import org.argeo.cms.ui.CmsUiProvider; import org.argeo.cms.ui.CmsView; import org.argeo.cms.ui.util.CmsUiUtils; -import org.argeo.connect.ui.ConnectUiConstants; -import org.argeo.connect.ui.util.BasicNodeListContentProvider; -import org.argeo.connect.ui.widgets.DelayedText; -import org.argeo.connect.util.XPathUtils; import org.argeo.eclipse.ui.EclipseUiUtils; import org.argeo.entity.EntityConstants; import org.argeo.entity.EntityTypes; import org.argeo.jcr.Jcr; import org.argeo.jcr.JcrUtils; +import org.argeo.suite.util.XPathUtils; import org.eclipse.jface.layout.TableColumnLayout; import org.eclipse.jface.viewers.ColumnLabelProvider; import org.eclipse.jface.viewers.ColumnWeightData; @@ -34,8 +32,10 @@ import org.eclipse.jface.viewers.DoubleClickEvent; import org.eclipse.jface.viewers.IDoubleClickListener; import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.jface.viewers.ISelectionChangedListener; +import org.eclipse.jface.viewers.IStructuredContentProvider; import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.jface.viewers.Viewer; import org.eclipse.swt.SWT; import org.eclipse.swt.events.KeyEvent; import org.eclipse.swt.events.KeyListener; @@ -53,7 +53,9 @@ import org.eclipse.swt.widgets.ToolItem; /** List recent items. */ public class RecentItems implements CmsUiProvider { -// private final static int SEARCH_TEXT_DELAY = 800; + private final static int SEARCH_TEXT_DELAY = 800; + private final static int SEARCH_DEFAULT_LIMIT = 100; + private CmsTheme theme; private String entityType; @@ -166,7 +168,7 @@ public class RecentItems implements CmsUiProvider { // Use a delayed text: the query won't be done until the user stop // typing for 800ms int style = SWT.BORDER | SWT.SEARCH | SWT.ICON_CANCEL; - DelayedText delayedText = new DelayedText(parent, style, ConnectUiConstants.SEARCH_TEXT_DELAY); + DelayedText delayedText = new DelayedText(parent, style, SEARCH_TEXT_DELAY); filterTxt = delayedText.getText(); filterTxt.setLayoutData(EclipseUiUtils.fillWidth()); @@ -301,7 +303,7 @@ public class RecentItems implements CmsUiProvider { // session.refresh(false); Query xpathQuery = XPathUtils.createQuery(session, xpathQueryStr); - xpathQuery.setLimit(ConnectUiConstants.SEARCH_DEFAULT_LIMIT); + xpathQuery.setLimit(SEARCH_DEFAULT_LIMIT); QueryResult result = xpathQuery.execute(); NodeIterator nit = result.getNodes(); @@ -329,5 +331,25 @@ public class RecentItems implements CmsUiProvider { } } + + class BasicNodeListContentProvider implements IStructuredContentProvider { + private static final long serialVersionUID = 1L; + // keep a cache of the Nodes in the content provider to be able to + // manage long request + private List nodes; + + public void dispose() { + } + + /** Expects a list of nodes as a new input */ + @SuppressWarnings("unchecked") + public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { + nodes = (List) newInput; + } + + public Object[] getElements(Object arg0) { + return nodes.toArray(); + } + } } } diff --git a/pom.xml b/pom.xml index eafe5a4..6859da9 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,6 @@ 2.1.27 2.1.13 2.1.89-SNAPSHOT - 2.1.82-SNAPSHOT 2.1.17-SNAPSHOT /srv/rpmfactory/argeo-osgi-2-gpl/el7 @@ -37,17 +36,6 @@ org.argeo.suite.ui.rap org.argeo.suite.theme.default - - org.argeo.suite.cms - org.argeo.suite.e4 - org.argeo.suite.e4.rap - org.argeo.suite.standard - - - library - systems - org.argeo.suite.tracker - dep dist lib diff --git a/systems/.gitignore b/systems/.gitignore deleted file mode 100644 index b83d222..0000000 --- a/systems/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/target/ diff --git a/systems/org.argeo.suite.studio/.classpath b/systems/org.argeo.suite.studio/.classpath deleted file mode 100644 index e801ebf..0000000 --- a/systems/org.argeo.suite.studio/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/systems/org.argeo.suite.studio/.gitignore b/systems/org.argeo.suite.studio/.gitignore deleted file mode 100644 index 09e3bc9..0000000 --- a/systems/org.argeo.suite.studio/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/bin/ -/target/ diff --git a/systems/org.argeo.suite.studio/.project b/systems/org.argeo.suite.studio/.project deleted file mode 100644 index fa5c615..0000000 --- a/systems/org.argeo.suite.studio/.project +++ /dev/null @@ -1,33 +0,0 @@ - - - org.argeo.suite.studio - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - org.eclipse.pde.ds.core.builder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/systems/org.argeo.suite.studio/META-INF/.gitignore b/systems/org.argeo.suite.studio/META-INF/.gitignore deleted file mode 100644 index 4854a41..0000000 --- a/systems/org.argeo.suite.studio/META-INF/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/MANIFEST.MF diff --git a/systems/org.argeo.suite.studio/bnd.bnd b/systems/org.argeo.suite.studio/bnd.bnd deleted file mode 100644 index 908ee52..0000000 --- a/systems/org.argeo.suite.studio/bnd.bnd +++ /dev/null @@ -1,6 +0,0 @@ -Bundle-ActivationPolicy: lazy - -Import-Package:\ -org.osgi.service.http.whiteboard,\ -org.eclipse.swt,\ -* diff --git a/systems/org.argeo.suite.studio/build.properties b/systems/org.argeo.suite.studio/build.properties deleted file mode 100644 index 34d2e4d..0000000 --- a/systems/org.argeo.suite.studio/build.properties +++ /dev/null @@ -1,4 +0,0 @@ -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - . diff --git a/systems/org.argeo.suite.studio/e4xmi/mvc.e4xmi b/systems/org.argeo.suite.studio/e4xmi/mvc.e4xmi deleted file mode 100644 index 1e72040..0000000 --- a/systems/org.argeo.suite.studio/e4xmi/mvc.e4xmi +++ /dev/null @@ -1,87 +0,0 @@ - - - - - shellMaximized - auth.cn=org.argeo.office.coworker,ou=roles,ou=node - - - - - - entityEditorArea - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/systems/org.argeo.suite.studio/pom.xml b/systems/org.argeo.suite.studio/pom.xml deleted file mode 100644 index fc25c8c..0000000 --- a/systems/org.argeo.suite.studio/pom.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - 4.0.0 - - org.argeo.suite.systems - suite-systems - 2.1.16-SNAPSHOT - .. - - org.argeo.suite.studio - Studio App - jar - - - org.argeo.connect - org.argeo.connect.e4 - ${version.argeo-connect} - - - - - org.argeo.tp - argeo-tp-rap-e4 - ${version.argeo-tp} - pom - provided - - - diff --git a/systems/org.argeo.suite.studio/src/org/argeo/suite/studio/parts/RwtAppElem.java b/systems/org.argeo.suite.studio/src/org/argeo/suite/studio/parts/RwtAppElem.java deleted file mode 100644 index 635d350..0000000 --- a/systems/org.argeo.suite.studio/src/org/argeo/suite/studio/parts/RwtAppElem.java +++ /dev/null @@ -1,21 +0,0 @@ -package org.argeo.suite.studio.parts; - -import org.eclipse.rap.rwt.application.ApplicationConfiguration; -import org.osgi.framework.ServiceReference; - -/** Site map element representing an RWT application. */ -class RwtAppElem extends SiteElem { - private final static String CONTEXT_NAME = "contextName"; - - private final ServiceReference serviceReference; - - public RwtAppElem(ServiceReference serviceReference) { - super(serviceReference.getProperties().get(CONTEXT_NAME).toString()); - this.serviceReference = serviceReference; - } - - public ServiceReference getServiceReference() { - return serviceReference; - } - -} diff --git a/systems/org.argeo.suite.studio/src/org/argeo/suite/studio/parts/ServletElem.java b/systems/org.argeo.suite.studio/src/org/argeo/suite/studio/parts/ServletElem.java deleted file mode 100644 index 5165795..0000000 --- a/systems/org.argeo.suite.studio/src/org/argeo/suite/studio/parts/ServletElem.java +++ /dev/null @@ -1,62 +0,0 @@ -package org.argeo.suite.studio.parts; - -import java.util.Arrays; -import java.util.Collection; - -import javax.servlet.Servlet; - -import org.osgi.framework.InvalidSyntaxException; -import org.osgi.framework.ServiceReference; -import org.osgi.service.http.context.ServletContextHelper; -import org.osgi.service.http.whiteboard.HttpWhiteboardConstants; - -/** Site map element which is a plain servlet. */ -class ServletElem extends SiteElem { - private final ServiceReference serviceReference; - - public ServletElem(ServiceReference serviceReference) { - super(extractPath(serviceReference)); - this.serviceReference = serviceReference; - } - - - - public ServiceReference getServiceReference() { - return serviceReference; - } - - - - private static String extractPath(ServiceReference serviceReference) { - Object servletPattern = serviceReference.getProperties() - .get(HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_PATTERN); - Object servletContextSelect = serviceReference.getProperties() - .get(HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_SELECT); - String servletContextPath = ""; - if (servletContextSelect != null) { - try { - Collection> scSr = serviceReference.getBundle() - .getBundleContext() - .getServiceReferences(ServletContextHelper.class, servletContextSelect.toString()); - if (scSr.size() > 0) { - servletContextPath = scSr.iterator().next() - .getProperty(HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_PATH).toString(); - if (servletContextPath.equals("/"))// default servlet context - servletContextPath = ""; - } - } catch (InvalidSyntaxException e) { - throw new IllegalArgumentException(e); - } - } - - if (servletPattern instanceof String) - return servletContextPath + servletPattern.toString(); - else if (servletPattern instanceof String[]) { - String[] patterns = (String[]) servletPattern; - if (patterns.length == 2 && patterns[1].equals(patterns[0] + "/*")) // RAP servlets - return servletContextPath + patterns[0]; - return servletContextPath + Arrays.asList(patterns).toString(); - } else - throw new IllegalArgumentException("Cannot interpret servlet pattern " + servletPattern.getClass()); - } -} diff --git a/systems/org.argeo.suite.studio/src/org/argeo/suite/studio/parts/SiteElem.java b/systems/org.argeo.suite.studio/src/org/argeo/suite/studio/parts/SiteElem.java deleted file mode 100644 index 4931eab..0000000 --- a/systems/org.argeo.suite.studio/src/org/argeo/suite/studio/parts/SiteElem.java +++ /dev/null @@ -1,37 +0,0 @@ -package org.argeo.suite.studio.parts; - -import org.argeo.eclipse.ui.TreeParent; - -/** Base class for site map elements. */ -abstract class SiteElem extends TreeParent { - - private final String path; - - public SiteElem(String path) { - super(extractLastSegment(path)); - this.path = path; - } - - public String getPath() { - return path; - } - - static String extractLastSegment(String path) { - if (path == null || path.equals("")) - throw new IllegalArgumentException("Path should not be null or empty."); - if (path.equals("/")) - return path; - String[] segments = path.split("/"); - for (int i = segments.length - 1; i >= 0; i--) { - if (!segments[i].equals("") && !segments[i].equals("*")) - return segments[i]; - } - return "/"; - } - - @Override - public String toString() { - return path; - } - -} diff --git a/systems/org.argeo.suite.studio/src/org/argeo/suite/studio/parts/SiteMapPart.java b/systems/org.argeo.suite.studio/src/org/argeo/suite/studio/parts/SiteMapPart.java deleted file mode 100644 index db7911f..0000000 --- a/systems/org.argeo.suite.studio/src/org/argeo/suite/studio/parts/SiteMapPart.java +++ /dev/null @@ -1,96 +0,0 @@ -package org.argeo.suite.studio.parts; - -import java.util.Collection; -import java.util.Map; -import java.util.TreeMap; - -import javax.annotation.PostConstruct; -import javax.inject.Inject; -import javax.servlet.Servlet; - -import org.argeo.eclipse.ui.AbstractTreeContentProvider; -import org.eclipse.e4.core.di.extensions.OSGiBundle; -import org.eclipse.jface.viewers.ColumnLabelProvider; -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.jface.viewers.TreeViewerColumn; -import org.eclipse.rap.rwt.application.ApplicationConfiguration; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Composite; -import org.osgi.framework.BundleContext; -import org.osgi.framework.InvalidSyntaxException; -import org.osgi.framework.ServiceReference; - -/** Overview of the URL paths provides by the system. */ -@SuppressWarnings("restriction") -public class SiteMapPart { -// private final static BundleContext bc = FrameworkUtil.getBundle(SiteMapPart.class).getBundleContext(); - - private TreeViewer viewer; - - @Inject - @OSGiBundle - BundleContext bc; - - @PostConstruct - public void createPartControl(Composite parent) { -// new Label(parent, SWT.NONE).setText("TEST"); -// - viewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); -// viewer.getTree().setHeaderVisible(true); - -// viewer.setLabelProvider(new ColumnLabelProvider()); - - TreeViewerColumn column = new TreeViewerColumn(viewer, SWT.NONE); - column.getColumn().setWidth(200); - column.getColumn().setText("Path"); - column.setLabelProvider(new ColumnLabelProvider() { - private static final long serialVersionUID = -3122136344359358605L; - - public String getText(Object element) { - return ((SiteElem) element).getPath(); - } - - @Override - public Image getImage(Object element) { - return super.getImage(element); - } - - }); - - viewer.setContentProvider(new SitePathContentProvider()); - viewer.setInput(bc); - - } - - class SitePathContentProvider extends AbstractTreeContentProvider { - private static final long serialVersionUID = -5650173256183322051L; - - @Override - public Object[] getElements(Object inputElement) { - if (inputElement instanceof BundleContext) { - BundleContext bundleContext = (BundleContext) inputElement; - Map siteElems = new TreeMap<>(); - try { - Collection> rwtApps = bundleContext - .getServiceReferences(ApplicationConfiguration.class, null); - for (ServiceReference sr : rwtApps) { - RwtAppElem elem = new RwtAppElem(sr); - siteElems.put(elem.getPath(), elem); - } - Collection> plainServlets = bundleContext - .getServiceReferences(Servlet.class, null); - for (ServiceReference sr : plainServlets) { - ServletElem elem = new ServletElem(sr); - siteElems.put(elem.getPath(), elem); - } - } catch (InvalidSyntaxException e) { - throw new IllegalArgumentException(e); - } - return siteElems.values().toArray(); - } - return null; - } - - } -} diff --git a/systems/pom.xml b/systems/pom.xml deleted file mode 100644 index e967e86..0000000 --- a/systems/pom.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - 4.0.0 - - org.argeo.suite - argeo-suite - 2.1.16-SNAPSHOT - .. - - org.argeo.suite.systems - suite-systems - Systems Suite - pom - - org.argeo.suite.studio - - -- 2.30.2