Fix glitches
[gpl/argeo-suite.git] / org.argeo.suite.core / src / org / argeo / suite / people / PeopleSuiteServiceImpl.java
index 12222fad2490725848abccb8ced00279035649dc..19067bdeccb049505a5e4af87b9d8baf1218ae00 100644 (file)
@@ -26,7 +26,11 @@ import org.argeo.suite.ArgeoSuiteRole;
 import org.argeo.suite.SuiteException;
 import org.springframework.core.io.Resource;
 
-/** Default implementation of an Argeo Suite specific People Backend */
+/**
+ * Default implementation of an Argeo Suite specific People Backend
+ * 
+ * TODO refactor and clean init process and service dependencies
+ */
 public class PeopleSuiteServiceImpl extends PeopleServiceImpl implements PeopleService, PeopleConstants {
        private final static Log log = LogFactory.getLog(PeopleSuiteServiceImpl.class);
 
@@ -52,26 +56,20 @@ public class PeopleSuiteServiceImpl extends PeopleServiceImpl implements PeopleS
        // TODO Hard-coded model initialisation
        // To be cleaned once first init and config mechanisms have been implemented
        private final static String publicPath = "/public";
-       // FIXME to be added in NodeConstants
-       private final static String groupHomePath = "/groups";
        // 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";
-       // private final static String sharedFilePath = "/sharedFiles";
 
        @Override
        protected void initialiseModel(Session adminSession) throws RepositoryException {
                super.initialiseModel(adminSession);
 
                JcrUtils.mkdirs(adminSession, publicPath, NodeType.NT_UNSTRUCTURED);
-               JcrUtils.mkdirs(adminSession, groupHomePath, NodeType.NT_UNSTRUCTURED);
-               // JcrUtils.mkdirs(adminSession, sharedFilePath, NodeType.NT_FOLDER);
                if (adminSession.hasPendingChanges()) {
                        adminSession.save();
                        configureACL(adminSession);
                        log.info("Repository has been initialised with Argeo Suite model");
                }
-               initModelResources(adminSession);
        }
 
        // First draft of configuration of the people specific rights
@@ -83,13 +81,10 @@ public class PeopleSuiteServiceImpl extends PeopleServiceImpl implements PeopleS
 
                // Default configuration of the workspace
                JcrUtils.addPrivilege(session, "/", NodeConstants.ROLE_ADMIN, Privilege.JCR_ALL);
-               JcrUtils.addPrivilege(session, groupHomePath, NodeConstants.ROLE_USER_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);
-               // JcrUtils.addPrivilege(session, sharedFilePath,
-               // NodeConstants.ROLE_USER, Privilege.JCR_ALL);
+
                session.save();
                log.info("Access control configured");
        }
@@ -136,6 +131,9 @@ public class PeopleSuiteServiceImpl extends PeopleServiceImpl implements PeopleS
                                resourceService.createTagLikeResourceParent(adminSession, null, PeopleTypes.PEOPLE_MAILING_LIST, null,
                                                getBasePath(null), PeopleTypes.PEOPLE_ENTITY, PeopleNames.PEOPLE_MAILING_LISTS);
 
+                       // Initialise catalogues
+                       importCatalogue(adminSession, initResources.get("SimpleTasks"), PeopleTypes.PEOPLE_TASK);
+
                        if (adminSession.hasPendingChanges()) {
                                adminSession.save();
                                log.info("Resources have been added to Argeo Suite model");