<ref bean="resourcesService" />\r
</util:list>\r
\r
- <bean id="suiteAppService" class="org.argeo.suite.core.DefaultSuiteAppService">\r
+ <bean id="suiteAppService" class="org.argeo.connect.core.DefaultSystemAppService">\r
<property name="knownAppServices" ref="knownAppServices" />\r
</bean>\r
</beans>\r
</util:list>\r
\r
<!-- Make the DJ-aying between the various known Apps Maintenance -->\r
- <bean id="suiteMaintenanceService" class="org.argeo.suite.core.DefaultSuiteMaintenanceService"\r
+ <bean id="suiteMaintenanceService" class="org.argeo.connect.core.DefaultSystemMaintenanceService"\r
init-method="init" destroy-method="destroy">\r
<property name="repository" ref="repository" />\r
<property name="workspaceName" value="main" />\r
<ref bean="resourcesWorkbenchService" />\r
</util:list>\r
\r
- <bean id="suiteWorkbenchService" class="org.argeo.suite.workbench.DefaultSuiteWorkbenchService">\r
+ <bean id="suiteWorkbenchService" class="org.argeo.connect.workbench.DefaultSystemWorkbenchService">\r
<property name="knownAppWbServices" ref="knownWbServices" />\r
</bean>\r
\r
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" output="bin" path="src"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+++ /dev/null
-/target
-/*.target
-/bin/
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.argeo.suite.core</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments />
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments />
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments />
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
+++ /dev/null
-/MANIFEST.MF
+++ /dev/null
-Require-Capability: cms.datamodel; filter:="(name=people)",\
-cms.datamodel; filter:="(name=documents)",\
-cms.datamodel; filter:="(name=tracker)"
-Import-Package:\
-javax.jcr.nodetype,\
-org.argeo.connect.resources,\
-org.argeo.node,\
-org.argeo.util,\
-javax.jcr.security,\
-*
-
+++ /dev/null
-source.. = src/
-output.. = bin/
-
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.argeo.suite</groupId>
- <artifactId>argeo-suite</artifactId>
- <version>0.1.12-SNAPSHOT</version>
- <relativePath>..</relativePath>
- </parent>
- <artifactId>org.argeo.suite.core</artifactId>
- <name>Argeo Suite Core</name>
- <packaging>jar</packaging>
-
- <dependencies>
- <dependency>
- <groupId>org.argeo.connect</groupId>
- <artifactId>org.argeo.tracker</artifactId>
- <version>${version.argeo-connect}</version>
- </dependency>
- <dependency>
- <groupId>org.argeo.connect</groupId>
- <artifactId>org.argeo.people.core</artifactId>
- <version>${version.argeo-connect}</version>
- </dependency>
- <dependency>
- <groupId>org.argeo.connect</groupId>
- <artifactId>org.argeo.documents</artifactId>
- <version>${version.argeo-connect}</version>
- </dependency>
- </dependencies>
-</project>
+++ /dev/null
-package org.argeo.suite;
-
-import org.argeo.naming.LdapAttrs;
-import org.argeo.node.NodeConstants;
-
-/** Argeo Office specific roles used in the code */
-public enum ArgeoSuiteRole {
- coworker, manager;
-
- public String dn() {
- return new StringBuilder(LdapAttrs.cn.name()).append("=").append(SuiteConstants.SUITE_APP_PREFIX).append(".")
- .append(name()).append(",").append(NodeConstants.ROLES_BASEDN).toString();
- }
-}
+++ /dev/null
-package org.argeo.suite;
-
-/** Argeo Suite constants */
-public interface SuiteConstants {
-
- String SUITE_APP_PREFIX = "org.argeo.suite";
- String SUITE_APP_BASE_NAME = "suite";
-
-}
+++ /dev/null
-package org.argeo.suite;
-
-/** Argeo Suite specific exception. Wraps a usual RuntimeException */
-public class SuiteException extends RuntimeException {
- private static final long serialVersionUID = 9048360857209165816L;
-
- public SuiteException(String message) {
- super(message);
- }
-
- public SuiteException(String message, Throwable e) {
- super(message, e);
- }
-}
+++ /dev/null
-package org.argeo.suite.core;
-
-import java.util.List;
-
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-import javax.jcr.Session;
-
-import org.argeo.connect.AppService;
-import org.argeo.connect.SystemAppService;
-import org.argeo.eclipse.ui.EclipseUiUtils;
-import org.argeo.suite.SuiteConstants;
-import org.argeo.suite.SuiteException;
-
-public class DefaultSuiteAppService implements SystemAppService {
-
- // Injected known AppWorkbenchServices: order is important, first found
- // result will be returned by the various methods.
- private List<AppService> knownAppServices;
-
- @Override
- public Node publishEntity(Node parent, String nodeType, Node srcNode, boolean removeSrcNode)
- throws RepositoryException {
- for (AppService appService : knownAppServices) {
- if (appService.isKnownType(nodeType))
- return appService.publishEntity(parent, nodeType, srcNode, removeSrcNode);
- }
- return null;
- }
-
- @Override
- public String getAppBaseName() {
- return SuiteConstants.SUITE_APP_BASE_NAME;
- }
-
- @Override
- public String getBaseRelPath(String nodeType) {
- for (AppService appService : knownAppServices) {
- if (appService.isKnownType(nodeType))
- return appService.getBaseRelPath(nodeType);
- }
- return null;
- // return getAppBaseName();
- }
-
- @Override
- public String getDefaultRelPath(Node entity) throws RepositoryException {
- for (AppService appService : knownAppServices) {
- if (appService.isKnownType(entity))
- return appService.getDefaultRelPath(entity);
- }
- return null;
- }
-
- @Override
- public String getMainNodeType(Node node) {
- for (AppService appService : knownAppServices) {
- String foundType = appService.getMainNodeType(node);
- if (EclipseUiUtils.notEmpty(foundType))
- return foundType;
- }
- return null;
- }
-
- @Override
- public String getDefaultRelPath(Session session, String nodetype, String id) {
- for (AppService appService : knownAppServices) {
- if (appService.isKnownType(nodetype))
- return appService.getDefaultRelPath(session, nodetype, id);
- }
- return null;
- }
-
- /** Insures the correct service is called on save */
- @Override
- public Node saveEntity(Node entity, boolean publish) {
- for (AppService appService : knownAppServices) {
- if (appService.isKnownType(entity))
- return appService.saveEntity(entity, publish);
- }
- throw new SuiteException("Unknown NodeType for " + entity + ". Cannot save");
- // return AppService.super.saveEntity(entity, publish);
- }
-
- @Override
- public boolean isKnownType(Node entity) {
- for (AppService appService : knownAppServices) {
- if (appService.isKnownType(entity))
- return true;
- }
- return false;
- }
-
- @Override
- public boolean isKnownType(String nodeType) {
- for (AppService appService : knownAppServices) {
- if (appService.isKnownType(nodeType))
- return true;
- }
- return false;
- }
-
- public void setKnownAppServices(List<AppService> knownAppServices) {
- this.knownAppServices = knownAppServices;
- }
-
-}
+++ /dev/null
-package org.argeo.suite.core;
-
-import java.util.List;
-
-import javax.jcr.Repository;
-import javax.jcr.RepositoryException;
-import javax.jcr.Session;
-import javax.jcr.nodetype.NodeType;
-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 SystemMaintenanceService {
- private final static Log log = LogFactory.getLog(DefaultSuiteMaintenanceService.class);
-
- /* DEPENDENCY INJECTION */
- private Repository repository;
- private String workspaceName;
- private List<AppMaintenanceService> maintenanceServices;
-
- public void init() {
- Session adminSession = null;
- try {
- adminSession = repository.login(workspaceName);
- if (prepareJcrTree(adminSession)) {
- configurePrivileges(adminSession);
- }
- } catch (Exception e) {
- throw new SuiteException("Cannot initialise model", e);
- } finally {
- JcrUtils.logoutQuietly(adminSession);
- }
- }
-
- // To be cleaned once first init and config mechanisms have been implemented
- // private final static String publicPath = "/public";
- // FIXME Users must have read access on the jcr:system/jcr:versionStorage
- // node under JackRabbit to be able to manage versions
- private final static String jackRabbitVersionSystemPath = "/jcr:system";
-
- @Override
- public boolean prepareJcrTree(Session session) {
- boolean hasCHanged = false;
- try {
- // JcrUtils.mkdirs(session, publicPath, NodeType.NT_UNSTRUCTURED);
- if (session.hasPendingChanges()) {
- session.save();
- hasCHanged = true;
- }
- } catch (RepositoryException e) {
- throw new SuiteException("Cannot build model", e);
- }
- for (AppMaintenanceService service : maintenanceServices)
- hasCHanged |= service.prepareJcrTree(session);
- if (hasCHanged)
- log.info("Repository has been initialised with Argeo Suite model");
- return hasCHanged;
- }
-
- @Override
- public void configurePrivileges(Session session) {
- try {
- // Remove unused default JCR rights
- JcrUtils.clearAccessControList(session, "/", "everyone");
-
- JcrUtils.addPrivilege(session, jackRabbitVersionSystemPath, ArgeoSuiteRole.coworker.dn(),
- Privilege.JCR_READ);
- // Default configuration of the workspace
- JcrUtils.addPrivilege(session, "/", NodeConstants.ROLE_ADMIN, Privilege.JCR_ALL);
- // JcrUtils.addPrivilege(session, publicPath, NodeConstants.ROLE_USER, Privilege.JCR_READ);
- // JcrUtils.addPrivilege(session, publicPath, "anonymous", Privilege.JCR_READ);
- // JcrUtils.addPrivilege(session, publicPath, NodeConstants.ROLE_ANONYMOUS, Privilege.JCR_READ);
-
- session.save();
- } catch (RepositoryException e) {
- throw new SuiteException("Cannot build model", e);
- }
- for (AppMaintenanceService service : maintenanceServices)
- service.configurePrivileges(session);
- log.info("Access control configured");
- }
-
- public void destroy() {
- }
-
- /* DEPENDENCY INJECTION */
- public void setRepository(Repository repository) {
- this.repository = repository;
- }
-
- public void setWorkspaceName(String workspaceName) {
- this.workspaceName = workspaceName;
- }
-
- public void setMaintenanceServices(List<AppMaintenanceService> maintenanceServices) {
- this.maintenanceServices = maintenanceServices;
- }
-}
<name>Argeo Suite Web UI</name>
<packaging>jar</packaging>
<dependencies>
- <dependency>
- <groupId>org.argeo.suite</groupId>
- <artifactId>org.argeo.suite.core</artifactId>
- <version>0.1.12-SNAPSHOT</version>
- </dependency>
<dependency>
<groupId>org.argeo.connect</groupId>
<artifactId>org.argeo.people.web</artifactId>
<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.argeo.suite</groupId>
<packaging>jar</packaging>
<dependencies>
<dependency>
- <groupId>org.argeo.suite</groupId>
- <artifactId>org.argeo.suite.core</artifactId>
- <version>0.1.12-SNAPSHOT</version>
+ <groupId>org.argeo.connect</groupId>
+ <artifactId>org.argeo.documents</artifactId>
+ <version>${version.argeo-connect}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.argeo.connect</groupId>
+ <artifactId>org.argeo.tracker</artifactId>
+ <version>${version.argeo-connect}</version>
</dependency>
<dependency>
<groupId>org.argeo.connect</groupId>
+++ /dev/null
-package org.argeo.suite.workbench;
-
-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;
-
-/** 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.
- private List<AppWorkbenchService> knownAppWbServices;
- private String defaultEditorId = DefaultDashboardEditor.ID;
-
- @Override
- public String getDefaultEditorId() {
- String result = null;
- for (AppWorkbenchService appWbService : knownAppWbServices) {
- result = appWbService.getDefaultEditorId();
- if (EclipseUiUtils.notEmpty(result))
- return result;
- }
- return defaultEditorId;
- }
-
- @Override
- public String getEntityEditorId(Node entity) {
- String result = null;
- for (AppWorkbenchService appWbService : knownAppWbServices) {
- result = appWbService.getEntityEditorId(entity);
- if (EclipseUiUtils.notEmpty(result))
- return result;
- }
- return null;
- }
-
- @Override
- public String getSearchEntityEditorId(String nodeType) {
- String result = null;
- for (AppWorkbenchService appWbService : knownAppWbServices) {
- result = appWbService.getSearchEntityEditorId(nodeType);
- if (EclipseUiUtils.notEmpty(result))
- return result;
- }
- return null;
- }
-
- @Override
- public Image getIconForType(Node entity) {
- Image result = null;
- for (AppWorkbenchService appWbService : knownAppWbServices) {
- result = appWbService.getIconForType(entity);
- if (result != null)
- return result;
- }
- return null;
- }
-
- @Override
- public Wizard getCreationWizard(Node node) {
- Wizard result = null;
- for (AppWorkbenchService appWbService : knownAppWbServices) {
- result = appWbService.getCreationWizard(node);
- if (result != null)
- return result;
- }
- return null;
- }
-
- /* DEPENDENCY INJECTION */
- public void setKnownAppWbServices(List<AppWorkbenchService> knownAppWbServices) {
- this.knownAppWbServices = knownAppWbServices;
- }
-
- public void setDefaultEditorId(String defaultEditorId) {
- this.defaultEditorId = defaultEditorId;
- }
-}
--- /dev/null
+package org.argeo.suite.workbench;
+
+public class SuiteWorkbenchException extends RuntimeException {
+ private static final long serialVersionUID = 5276857785523513563L;
+
+ public SuiteWorkbenchException(String message) {
+ super(message);
+ }
+
+ public SuiteWorkbenchException(Throwable cause) {
+ super(cause);
+ }
+
+ public SuiteWorkbenchException(String message, Throwable cause) {
+ super(message, cause);
+ }
+}
import org.argeo.people.PeopleTypes;
import org.argeo.people.util.PeopleJcrUtils;
import org.argeo.people.util.PersonJcrUtils;
-import org.argeo.suite.SuiteException;
+import org.argeo.suite.workbench.SuiteWorkbenchException;
import org.argeo.suite.workbench.AsUiPlugin;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
userInputPage = new UserInputPage("User input page");
addPage(userInputPage);
} catch (Exception e) {
- throw new SuiteException("Cannot add page to wizard", e);
+ throw new SuiteWorkbenchException("Cannot add page to wizard", e);
}
}
else if (PeopleTypes.PEOPLE_PERSON.equals(type))
importDefaultPersonFile(in);
} catch (IOException e) {
- throw new SuiteException("Cannot import mapping file", e);
+ throw new SuiteWorkbenchException("Cannot import mapping file", e);
} finally {
IOUtils.closeQuietly(in);
}
resourcesService.refreshKnownTags(mlParent);
} catch (PeopleException | RepositoryException e) {
- throw new SuiteException("Cannot import mapping file, error at line: " + (i + 1), e);
+ throw new SuiteWorkbenchException("Cannot import mapping file, error at line: " + (i + 1), e);
} finally {
JcrUtils.logoutQuietly(session);
}
String message = "Cannot import mapping file, error at line: " + (i + 1);
// TODO Check why the error is swallowed.
log.error(message, e);
- throw new SuiteException(message, e);
+ throw new SuiteWorkbenchException(message, e);
} finally {
JcrUtils.logoutQuietly(session);
}
import org.argeo.eclipse.ui.EclipseUiUtils;
import org.argeo.jcr.JcrUtils;
import org.argeo.node.NodeUtils;
-import org.argeo.suite.SuiteException;
+import org.argeo.suite.workbench.SuiteWorkbenchException;
import org.argeo.suite.workbench.AsUiPlugin;
import org.argeo.tracker.TrackerNames;
import org.argeo.tracker.TrackerService;
Calendar now = GregorianCalendar.getInstance();
return node.hasProperty(propName) && node.getProperty(propName).getDate().before(now);
} catch (RepositoryException e) {
- throw new SuiteException("Cannot check overdue status with property " + propName + " on " + node, e);
+ throw new SuiteWorkbenchException("Cannot check overdue status with property " + propName + " on " + node, e);
}
}
import org.argeo.eclipse.ui.EclipseUiUtils;
import org.argeo.jcr.JcrUtils;
import org.argeo.people.PeopleService;
-import org.argeo.suite.SuiteException;
+import org.argeo.suite.workbench.SuiteWorkbenchException;
import org.argeo.suite.workbench.AsUiPlugin;
import org.argeo.suite.workbench.internal.EntitySingleColumnLabelProvider;
import org.eclipse.jface.layout.TableColumnLayout;
+ " ms by executing XPath query (" + xpathQueryStr + ").");
}
} catch (RepositoryException e) {
- throw new SuiteException("Unable to list entities", e);
+ throw new SuiteWorkbenchException("Unable to list entities", e);
}
}
<description />
<version>0.1.12-SNAPSHOT</version>
<modules>
- <module>org.argeo.suite.core</module>
<module>org.argeo.suite.web</module>
<module>org.argeo.suite.workbench.rap</module>
<module>org.argeo.suite.apps</module>