Clean spring files
authorbsinou <bsinou@argeo.org>
Wed, 22 Feb 2017 16:47:39 +0000 (17:47 +0100)
committerbsinou <bsinou@argeo.org>
Wed, 22 Feb 2017 16:47:39 +0000 (17:47 +0100)
org.argeo.suite.core/META-INF/spring/services.xml
org.argeo.suite.core/src/org/argeo/suite/ArgeoSuiteRole.java
org.argeo.suite.core/src/org/argeo/suite/SuiteConstants.java
org.argeo.suite.core/src/org/argeo/suite/core/DefaultSuiteAppService.java
org.argeo.suite.web/META-INF/spring/people.xml
org.argeo.suite.workbench.rap/META-INF/spring/services.xml
org.argeo.suite.workbench.rap/src/org/argeo/suite/workbench/SuiteWorkbenchService.java [moved from org.argeo.suite.workbench.rap/src/org/argeo/suite/workbench/AsWorkbenchServiceImpl.java with 71% similarity]
org.argeo.suite.workbench.rap/src/org/argeo/suite/workbench/parts/DefaultDashboardEditor.java

index 31dc32ede1fca679b945b28b7dfa7389eca0f5e8..fe6b79184e9e11725431778dbe0ab4e138832d9e 100644 (file)
@@ -32,7 +32,7 @@
                <ref bean="trackerMaintenanceService" />\r
        </util:list>\r
 \r
-       <!-- Make the DJ-aying between the various known Apps Maintenance  -->\r
+       <!-- Make the DJ-aying between the various known Apps Maintenance -->\r
        <bean id="suiteMaintenanceService" class="org.argeo.suite.core.DefaultSuiteMaintenanceService"\r
                init-method="init" destroy-method="destroy">\r
                <property name="repository" ref="repository" />\r
@@ -40,7 +40,7 @@
                <property name="maintenanceServices" ref="knownMaintenanceServices" />\r
        </bean>\r
 \r
-       <!--  APP SERVICES (backends) -->\r
+       <!-- APP SERVICES (backends) -->\r
        <bean id="resourcesService" class="org.argeo.connect.resources.core.ResourcesServiceImpl" />\r
 \r
        <bean id="activitiesService" class="org.argeo.connect.activities.core.ActivitiesServiceImpl">\r
@@ -53,7 +53,9 @@
                <property name="resourcesService" ref="resourcesService" />\r
        </bean>\r
 \r
-       <bean id="trackerService" class="org.argeo.connect.tracker.core.TrackerServiceImpl" />\r
+       <bean id="trackerService" class="org.argeo.connect.tracker.core.TrackerServiceImpl">\r
+               <property name="activitiesService" ref="activitiesService" />\r
+       </bean>\r
 \r
        <bean id="documentsService" class="org.argeo.connect.documents.DocumentsService" />\r
 \r
@@ -65,7 +67,7 @@
                <property name="documentsService" ref="documentsService" />\r
        </bean>\r
 \r
-       <!--  VARIOUS -->\r
+       <!-- VARIOUS -->\r
 \r
        <!-- Execute initialization with a system authentication -->\r
        <bean\r
index 0b19f66861dd6490866528a7b84402628dbc3484..31ddca31ff0f815efec4f59db2e4d669bbba17ee 100644 (file)
@@ -8,7 +8,7 @@ public enum ArgeoSuiteRole {
        coworker, manager;
 
        public String dn() {
-               return new StringBuilder(LdapAttrs.cn.name()).append("=").append(SuiteConstants.AS_DOMAIN_PREFIX).append(".")
+               return new StringBuilder(LdapAttrs.cn.name()).append("=").append(SuiteConstants.SUITE_APP_PREFIX).append(".")
                                .append(name()).append(",").append(NodeConstants.ROLES_BASEDN).toString();
        }
 }
index 26f2aac96c556fadaacc6ac34222c013a91af874..06c28e47549a8714b58522d56daa1e37796835da 100644 (file)
@@ -3,5 +3,7 @@ package org.argeo.suite;
 /** Argeo Suite constants */
 public interface SuiteConstants {
 
-       String AS_DOMAIN_PREFIX = "org.argeo.suite";
+       String SUITE_APP_PREFIX = "org.argeo.suite";
+       String SUITE_APP_BASE_NAME = "suite";
+
 }
index 02eda618e39ce220edb5821c10c5a3a5c58e8982..cb349938245ac762e4492f6e7fd44f404aae532f 100644 (file)
@@ -15,6 +15,7 @@ import org.argeo.connect.resources.ResourcesTypes;
 import org.argeo.connect.tracker.TrackerService;
 import org.argeo.connect.tracker.TrackerTypes;
 import org.argeo.connect.util.ConnectJcrUtils;
+import org.argeo.suite.SuiteConstants;
 
 public class DefaultSuiteAppService implements AppService {
 
@@ -26,12 +27,29 @@ public class DefaultSuiteAppService implements AppService {
 
        @Override
        public String getAppBaseName() {
-               return null;
+               return SuiteConstants.SUITE_APP_BASE_NAME;
        }
 
        @Override
        public String getDefaultRelPath(Node entity) throws RepositoryException {
-               return null;
+               if (ConnectJcrUtils.isNodeType(entity, ResourcesTypes.RESOURCES_TAG_PARENT)
+                               || ConnectJcrUtils.isNodeType(entity, ResourcesTypes.RESOURCES_NODE_TEMPLATE)
+                               || ConnectJcrUtils.isNodeType(entity, ResourcesTypes.RESOURCES_ENCODED_TAG)
+                               || ConnectJcrUtils.isNodeType(entity, ResourcesTypes.RESOURCES_TAG))
+                       return resourcesService.getDefaultRelPath(entity);
+               else if (ConnectJcrUtils.isNodeType(entity, TrackerTypes.TRACKER_PROJECT))
+                       return trackerService.getDefaultRelPath(entity);
+               else if (ConnectJcrUtils.isNodeType(entity, ActivitiesTypes.ACTIVITIES_TASK)
+                               || ConnectJcrUtils.isNodeType(entity, ActivitiesTypes.ACTIVITIES_ACTIVITY))
+                       return activitiesService.getDefaultRelPath(entity);
+               else if (ConnectJcrUtils.isNodeType(entity, PeopleTypes.PEOPLE_PERSON)
+                               || ConnectJcrUtils.isNodeType(entity, PeopleTypes.PEOPLE_ORG))
+                       return peopleService.getDefaultRelPath(entity);
+               else if (ConnectJcrUtils.isNodeType(entity, NodeType.NT_FILE)
+                               || ConnectJcrUtils.isNodeType(entity, NodeType.NT_FOLDER))
+                       return documentsService.getDefaultRelPath(entity);
+               else
+                       return null;
        }
 
        @Override
@@ -44,8 +62,8 @@ public class DefaultSuiteAppService implements AppService {
        public Node saveEntity(Node entity, boolean publish) {
                if (ConnectJcrUtils.isNodeType(entity, ResourcesTypes.RESOURCES_TAG_PARENT)
                                || ConnectJcrUtils.isNodeType(entity, ResourcesTypes.RESOURCES_NODE_TEMPLATE)
-                               || ConnectJcrUtils.isNodeType(entity, ResourcesTypes.RESOURCES_TAG_ENCODED_INSTANCE)
-                               || ConnectJcrUtils.isNodeType(entity, ResourcesTypes.RESOURCES_TAG_INSTANCE))
+                               || ConnectJcrUtils.isNodeType(entity, ResourcesTypes.RESOURCES_ENCODED_TAG)
+                               || ConnectJcrUtils.isNodeType(entity, ResourcesTypes.RESOURCES_TAG))
                        return resourcesService.saveEntity(entity, publish);
                else if (ConnectJcrUtils.isNodeType(entity, TrackerTypes.TRACKER_PROJECT))
                        return trackerService.saveEntity(entity, publish);
index 0fdd5019702c19f70f3efe8e88176998a0cec2be..f42e1b764af59dde2afa7062d0c1d9e563acd81a 100644 (file)
@@ -60,7 +60,7 @@
                <entry>
                        <key>
                                <util:constant
-                                       static-field="org.argeo.connect.resources.ResourcesTypes.RESOURCES_TAG_INSTANCE" />
+                                       static-field="org.argeo.connect.resources.ResourcesTypes.RESOURCES_TAG" />
                        </key>
                        <bean class="org.argeo.connect.people.web.pages.TagLikeInstancePage">
                                <property name="peopleService" ref="peopleService" />
index 0d7396892520c1d3053a1e7ee74222cbb633f02b..e06bff6e8c8a60b3e36dd78b065be48d17a48fd1 100644 (file)
@@ -5,6 +5,9 @@
        http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd">
 
        <!-- Assembly of the various AppWorkbenchServices -->
+       <bean id="resourcesWorkbenchService"
+               class="org.argeo.connect.resources.workbench.ResourcesWorkbenchService" />
+
        <bean id="activitiesWorkbenchService"
                class="org.argeo.connect.activities.workbench.ActivitiesWorkbenchService" />
 
 
        <!--order is important -->
        <util:list id="knownWbServices">
-               <ref bean="activitiesWorkbenchService" />
                <ref bean="peopleWorkbenchService" />
                <ref bean="documentsWorkbenchService" />
+               <ref bean="activitiesWorkbenchService" />
+               <ref bean="resourcesWorkbenchService" />
        </util:list>
 
-       <bean id="suiteWorkbenchService" class="org.argeo.suite.workbench.AsWorkbenchServiceImpl">
+       <bean id="suiteWorkbenchService" class="org.argeo.suite.workbench.SuiteWorkbenchService">
                <property name="knownAppWbServices" ref="knownWbServices" />
        </bean>
-
-</beans>
\ No newline at end of file
+</beans>
similarity index 71%
rename from org.argeo.suite.workbench.rap/src/org/argeo/suite/workbench/AsWorkbenchServiceImpl.java
rename to org.argeo.suite.workbench.rap/src/org/argeo/suite/workbench/SuiteWorkbenchService.java
index 73bfdbd499d5416fdf98587c759055a80fa6492f..17697eeabe90755afe1bc5dd9b97229d3be7c348 100644 (file)
@@ -11,7 +11,7 @@ import org.eclipse.jface.wizard.Wizard;
 import org.eclipse.swt.graphics.Image;
 
 /** Centralize workbench services from the various base apps */
-public class AsWorkbenchServiceImpl implements AppWorkbenchService {
+public class SuiteWorkbenchService implements AppWorkbenchService {
 
        // Injected known AppWorkbenchServices: order is important, first found
        // result will be returned by the various methods.
@@ -22,28 +22,6 @@ public class AsWorkbenchServiceImpl implements AppWorkbenchService {
                return DefaultDashboardEditor.ID;
        }
 
-       // @Override
-       // public String getOpenEntityEditorCmdId() {
-       //// String result = null;
-       //// for (AppWorkbenchService appWbService : knownAppWbServices) {
-       //// result = appWbService.getOpenEntityEditorCmdId();
-       //// if (EclipseUiUtils.notEmpty(result))
-       //// return result;
-       //// }
-       // return OpenEntityEditor.ID;
-       // }
-
-       // @Override
-       // public String getOpenSearchEntityEditorCmdId() {
-       // String result = null;
-       // for (AppWorkbenchService appWbService : knownAppWbServices) {
-       // result = appWbService.getOpenSearchEntityEditorCmdId();
-       // if (EclipseUiUtils.notEmpty(result))
-       // return result;
-       // }
-       // return null;
-       // }
-
        @Override
        public String getEntityEditorId(Node entity) {
                String result = null;
@@ -88,11 +66,6 @@ public class AsWorkbenchServiceImpl implements AppWorkbenchService {
                return null;
        }
 
-       @Override
-       public String getOpenFileCmdId() {
-               return null;
-       }
-
        /* DEPENDENCY INJECTION */
        public void setKnownAppWbServices(List<AppWorkbenchService> knownAppWbServices) {
                this.knownAppWbServices = knownAppWbServices;
index db04a738ac2481673823bcb637db892bc1b3cd19..4582f776c1a7f75c8232d80fcc376495e92fef9d 100644 (file)
@@ -90,6 +90,6 @@ public class DefaultDashboardEditor extends AbstractSuiteDashboard implements Re
                ConnectWorkbenchUtils.createOpenSearchEditorLink(getAppWorkbenchService(), bodyCmp, "Tasks",
                                ActivitiesTypes.ACTIVITIES_TASK);
                ConnectWorkbenchUtils.createOpenSearchEditorLink(getAppWorkbenchService(), bodyCmp, "Tags",
-                               ResourcesTypes.RESOURCES_TAG_INSTANCE);
+                               ResourcesTypes.RESOURCES_TAG);
        }
 }