Adapt after SystemApp interfaces addition
authorbsinou <bsinou@argeo.org>
Thu, 9 Mar 2017 14:40:26 +0000 (15:40 +0100)
committerbsinou <bsinou@argeo.org>
Thu, 9 Mar 2017 14:40:26 +0000 (15:40 +0100)
org.argeo.suite.apps.web/META-INF/spring/osgi.xml
org.argeo.suite.apps.web/META-INF/spring/ui.xml
org.argeo.suite.apps/META-INF/spring/osgi.xml
org.argeo.suite.apps/META-INF/spring/workbench-services.xml
org.argeo.suite.core/src/org/argeo/suite/core/DefaultSuiteAppService.java
org.argeo.suite.core/src/org/argeo/suite/core/DefaultSuiteMaintenanceService.java
org.argeo.suite.workbench.rap/META-INF/spring/osgi.xml
org.argeo.suite.workbench.rap/META-INF/spring/parts.xml
org.argeo.suite.workbench.rap/src/org/argeo/suite/workbench/DefaultSuiteWorkbenchService.java [moved from org.argeo.suite.workbench.rap/src/org/argeo/suite/workbench/SuiteWorkbenchService.java with 90% similarity]
org.argeo.suite.workbench.rap/src/org/argeo/suite/workbench/parts/AbstractSuiteDashboard.java
org.argeo.suite.workbench.rap/src/org/argeo/suite/workbench/parts/DefaultDashboardEditor.java

index 85e3a5dccce3d732cccfd0b1d0212858f761a08e..1eb932d2d05a8ca9926565e92b4f386776e4953b 100644 (file)
@@ -12,9 +12,9 @@
        <reference id="userAdminService" interface="org.argeo.connect.UserAdminService" />\r
 \r
        <!-- Maintenance service -->\r
-       <reference id="appMaintenanceService" interface="org.argeo.connect.AppMaintenanceService" />\r
+       <reference id="systemMaintenanceService" interface="org.argeo.connect.SystemMaintenanceService" />\r
        <!-- Generic DJ-ing app -->\r
-       <reference id="suiteAppService" interface="org.argeo.connect.AppService" />\r
+       <reference id="systemAppService" interface="org.argeo.connect.SystemAppService" />\r
        <!-- App specific services -->\r
        <reference id="resourcesService" interface="org.argeo.connect.resources.ResourcesService" />\r
        <reference id="activitiesService" interface="org.argeo.activities.ActivitiesService" />\r
index b33ebc79a928c9462d5019300dfd6511612a35f1..08f0c3f040b625814f8637be2eb78b9b9d60d601 100644 (file)
@@ -6,7 +6,8 @@
         http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd">
 
        <!-- Main entry point for the CMS -->
-       <bean id="about" parent="app" init-method="init" destroy-method="destroy" depends-on="appMaintenanceService">
+       <bean id="about" parent="app" init-method="init" destroy-method="destroy"
+               depends-on="systemMaintenanceService">
                <property name="workspace" value="main" />
                <property name="header" ref="headerManager" />
                <property name="pages">
index 0ef2a6cddc5435137aed052045fc40a5c147013a..72c463b012ba7ebdc4dbb9bc5ebdebef04273128 100644 (file)
@@ -19,9 +19,9 @@
        <service ref="userAdminService" interface="org.argeo.connect.UserAdminService" />\r
 \r
        <!-- Maintenance service -->\r
-       <service ref="suiteMaintenanceService" interface="org.argeo.connect.AppMaintenanceService" />\r
+       <service ref="suiteMaintenanceService" interface="org.argeo.connect.SystemMaintenanceService" />\r
 \r
-       <service ref="suiteAppService" interface="org.argeo.connect.AppService" />\r
+       <service ref="suiteAppService" interface="org.argeo.connect.SystemAppService" />\r
        <!-- App specific services -->\r
        <service ref="resourcesService" interface="org.argeo.connect.resources.ResourcesService" />\r
        <service ref="activitiesService" interface="org.argeo.activities.ActivitiesService" />\r
 \r
        <!-- Assembly of the various apps workbench services -->\r
        <service ref="suiteWorkbenchService"\r
-               interface="org.argeo.connect.workbench.AppWorkbenchService" />\r
-\r
-       <!-- Exposes People specific implementation of the AppWorkbenchService -->\r
-       <service ref="peopleWorkbenchService"\r
-               interface="org.argeo.people.workbench.PeopleWorkbenchService" />\r
+               interface="org.argeo.connect.workbench.SystemWorkbenchService" />\r
 \r
 </beans:beans>\r
index 86b14b8d612557b8f6568466780dae7edb0d2100..ea46634238f957fa7e6d1faa1262f12d9108d00a 100644 (file)
@@ -24,7 +24,7 @@
                <ref bean="resourcesWorkbenchService" />\r
        </util:list>\r
 \r
-       <bean id="suiteWorkbenchService" class="org.argeo.suite.workbench.SuiteWorkbenchService">\r
+       <bean id="suiteWorkbenchService" class="org.argeo.suite.workbench.DefaultSuiteWorkbenchService">\r
                <property name="knownAppWbServices" ref="knownWbServices" />\r
        </bean>\r
 \r
index 52a9867cc7168bb1f4c710e9b6eb9b71621bd6b6..ea5dc23e53996bda065ea034a876320630825387 100644 (file)
@@ -6,9 +6,11 @@ import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 
 import org.argeo.connect.AppService;
+import org.argeo.connect.SystemAppService;
 import org.argeo.suite.SuiteConstants;
+import org.argeo.suite.SuiteException;
 
-public class DefaultSuiteAppService implements AppService {
+public class DefaultSuiteAppService implements SystemAppService {
 
        // Injected known AppWorkbenchServices: order is important, first found
        // result will be returned by the various methods.
@@ -64,7 +66,8 @@ public class DefaultSuiteAppService implements AppService {
                        if (appService.isKnownType(entity))
                                return appService.saveEntity(entity, publish);
                }
-               return AppService.super.saveEntity(entity, publish);
+               throw new SuiteException("Unknown NodeType for " + entity + ". Cannot save");
+               // return AppService.super.saveEntity(entity, publish);
        }
 
        @Override
index d0a04684a61ba29e81a3de411aa73d2322279a35..2ccb6cdf884783357dc369945c0513f5dd961481 100644 (file)
@@ -11,13 +11,14 @@ import javax.jcr.security.Privilege;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.argeo.connect.AppMaintenanceService;
+import org.argeo.connect.SystemMaintenanceService;
 import org.argeo.jcr.JcrUtils;
 import org.argeo.node.NodeConstants;
 import org.argeo.suite.ArgeoSuiteRole;
 import org.argeo.suite.SuiteException;
 
 /** Make the DJay-ing to provide a full running Suite platform */
-public class DefaultSuiteMaintenanceService implements AppMaintenanceService {
+public class DefaultSuiteMaintenanceService implements SystemMaintenanceService {
        private final static Log log = LogFactory.getLog(DefaultSuiteMaintenanceService.class);
 
        /* DEPENDENCY INJECTION */
index b0d5f19ad2b386d18ee14bc90259b252baced35a..330d40ee3ab2c7d900e7d145d7c14c9dc88de17b 100644 (file)
        <reference id="repository" interface="javax.jcr.Repository"\r
                filter="(cn=home)" />\r
        <reference id="resourcesService" interface="org.argeo.connect.resources.ResourcesService" />\r
-       <reference id="activitiesService"\r
-               interface="org.argeo.activities.ActivitiesService" />\r
+       <reference id="activitiesService" interface="org.argeo.activities.ActivitiesService" />\r
        <reference id="peopleService" interface="org.argeo.people.PeopleService" />\r
        <reference id="documentsService" interface="org.argeo.documents.DocumentsService" />\r
        <reference id="trackerService" interface="org.argeo.tracker.TrackerService" />\r
 \r
-       <reference id="appWorkbenchService"\r
-               interface="org.argeo.connect.workbench.AppWorkbenchService" />\r
+       <reference id="systemWorkbenchService"\r
+               interface="org.argeo.connect.workbench.SystemWorkbenchService" />\r
 \r
 </beans:beans>\r
index 5903b42b4a966f2ecebb32bfc6ec89178279fe55..5019156ed86fda86b6f6dde6e356e619880561af 100644 (file)
@@ -23,6 +23,6 @@
                <property name="activitiesService" ref="activitiesService" />
                <property name="peopleService" ref="peopleService" />
                <property name="documentsService" ref="documentsService" />
-               <property name="appWorkbenchService" ref="appWorkbenchService" />
+               <property name="systemWorkbenchService" ref="systemWorkbenchService" />
        </bean>
 </beans>
similarity index 90%
rename from org.argeo.suite.workbench.rap/src/org/argeo/suite/workbench/SuiteWorkbenchService.java
rename to org.argeo.suite.workbench.rap/src/org/argeo/suite/workbench/DefaultSuiteWorkbenchService.java
index 89dfc97ef3d50394328c055e20a9e5469dad4d24..480af06c0a5525c7a6a308bd337992f9488d203f 100644 (file)
@@ -5,13 +5,14 @@ import java.util.List;
 import javax.jcr.Node;
 
 import org.argeo.connect.workbench.AppWorkbenchService;
+import org.argeo.connect.workbench.SystemWorkbenchService;
 import org.argeo.eclipse.ui.EclipseUiUtils;
 import org.argeo.suite.workbench.parts.DefaultDashboardEditor;
 import org.eclipse.jface.wizard.Wizard;
 import org.eclipse.swt.graphics.Image;
 
-/** Centralize workbench services from the various base apps */
-public class SuiteWorkbenchService implements AppWorkbenchService {
+/** Centralise workbench services from the various base apps */
+public class DefaultSuiteWorkbenchService implements SystemWorkbenchService {
 
        // Injected known AppWorkbenchServices: order is important, first found
        // result will be returned by the various methods.
index 0ec007526f7ccb74a23948b290cd6725ff6444da..cdb802f24fe887b9cf833d0b54a1960ebe7681f8 100644 (file)
@@ -14,6 +14,7 @@ import org.argeo.connect.resources.ResourcesService;
 import org.argeo.connect.ui.ConnectUiStyles;
 import org.argeo.connect.util.ConnectJcrUtils;
 import org.argeo.connect.workbench.AppWorkbenchService;
+import org.argeo.connect.workbench.SystemWorkbenchService;
 import org.argeo.connect.workbench.util.EntityEditorInput;
 import org.argeo.documents.DocumentsService;
 import org.argeo.eclipse.ui.EclipseUiUtils;
@@ -44,7 +45,7 @@ public abstract class AbstractSuiteDashboard extends EditorPart {
        private ActivitiesService activitiesService;
        private PeopleService peopleService;
        private DocumentsService documentsService;
-       private AppWorkbenchService appWorkbenchService;
+       private SystemWorkbenchService systemWorkbenchService;
 
        private Session session;
 
@@ -202,8 +203,8 @@ public abstract class AbstractSuiteDashboard extends EditorPart {
                return documentsService;
        }
 
-       protected AppWorkbenchService getAppWorkbenchService() {
-               return appWorkbenchService;
+       protected SystemWorkbenchService getSystemWorkbenchService() {
+               return systemWorkbenchService;
        }
 
        protected Image getLogoImg() {
@@ -235,7 +236,7 @@ public abstract class AbstractSuiteDashboard extends EditorPart {
                this.peopleService = peopleService;
        }
 
-       public void setAppWorkbenchService(AppWorkbenchService appWorkbenchService) {
-               this.appWorkbenchService = appWorkbenchService;
+       public void setSystemWorkbenchService(SystemWorkbenchService systemWorkbenchService) {
+               this.systemWorkbenchService = systemWorkbenchService;
        }
 }
index b0e03b0909554bdca4a0d56d66abefbc59955693..99bc56028532d722ddd007e2bc99f403f92965a5 100644 (file)
@@ -71,7 +71,7 @@ public class DefaultDashboardEditor extends AbstractSuiteDashboard implements Re
                NodeIterator nit = getDocumentsService().getLastUpdatedDocuments(getSession());
                while (nit.hasNext()) {
                        Node file = nit.nextNode();
-                       createOpenEntityEditorLink(getAppWorkbenchService(), bodyCmp, ConnectJcrUtils.getName(file), file);
+                       createOpenEntityEditorLink(getSystemWorkbenchService(), bodyCmp, ConnectJcrUtils.getName(file), file);
                }
                lastUpdatedDocsGadget.layout(true, true);
        }
@@ -81,15 +81,15 @@ public class DefaultDashboardEditor extends AbstractSuiteDashboard implements Re
                parent.setLayout(EclipseUiUtils.noSpaceGridLayout());
                createGadgetTitleCmp(parent, "Contacts");
                Composite bodyCmp = createGadgetBodyCmp(parent);
-               ConnectWorkbenchUtils.createOpenSearchEditorLink(getAppWorkbenchService(), bodyCmp, "Persons",
+               ConnectWorkbenchUtils.createOpenSearchEditorLink(getSystemWorkbenchService(), bodyCmp, "Persons",
                                PeopleTypes.PEOPLE_PERSON);
-               ConnectWorkbenchUtils.createOpenSearchEditorLink(getAppWorkbenchService(), bodyCmp, "Organisations",
+               ConnectWorkbenchUtils.createOpenSearchEditorLink(getSystemWorkbenchService(), bodyCmp, "Organisations",
                                PeopleTypes.PEOPLE_ORG);
-               ConnectWorkbenchUtils.createOpenSearchEditorLink(getAppWorkbenchService(), bodyCmp, "Mailing lists",
+               ConnectWorkbenchUtils.createOpenSearchEditorLink(getSystemWorkbenchService(), bodyCmp, "Mailing lists",
                                PeopleTypes.PEOPLE_MAILING_LIST);
-               ConnectWorkbenchUtils.createOpenSearchEditorLink(getAppWorkbenchService(), bodyCmp, "Tasks",
+               ConnectWorkbenchUtils.createOpenSearchEditorLink(getSystemWorkbenchService(), bodyCmp, "Tasks",
                                ActivitiesTypes.ACTIVITIES_TASK);
-               ConnectWorkbenchUtils.createOpenSearchEditorLink(getAppWorkbenchService(), bodyCmp, "Tags",
+               ConnectWorkbenchUtils.createOpenSearchEditorLink(getSystemWorkbenchService(), bodyCmp, "Tags",
                                ResourcesTypes.RESOURCES_TAG);
        }
 }