From: <luc...@us...> - 2009-08-13 10:46:17
|
Revision: 1261 http://openutils.svn.sourceforge.net/openutils/?rev=1261&view=rev Author: lucaboati Date: 2009-08-13 10:46:07 +0000 (Thu, 13 Aug 2009) Log Message: ----------- default node type added Modified Paths: -------------- trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/lifecycle/BootstrapSyncModuleLifecycle.java Modified: trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/lifecycle/BootstrapSyncModuleLifecycle.java =================================================================== --- trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/lifecycle/BootstrapSyncModuleLifecycle.java 2009-08-13 08:42:22 UTC (rev 1260) +++ trunk/openutils-mgnlbootstrapsync/src/main/java/it/openutils/mgnlbootstrapsync/lifecycle/BootstrapSyncModuleLifecycle.java 2009-08-13 10:46:07 UTC (rev 1261) @@ -1,5 +1,16 @@ package it.openutils.mgnlbootstrapsync.lifecycle; +import info.magnolia.cms.beans.config.ContentRepository; +import info.magnolia.cms.core.HierarchyManager; +import info.magnolia.cms.core.ItemType; +import info.magnolia.cms.core.SystemProperty; +import info.magnolia.context.MgnlContext; +import info.magnolia.module.ModuleLifecycle; +import info.magnolia.module.ModuleLifecycleContext; +import it.openutils.mgnlbootstrapsync.listener.AbstractBootstrapSyncListener; +import it.openutils.mgnlbootstrapsync.listener.BootstrapSyncListener; +import it.openutils.mgnlbootstrapsync.watch.BootstrapSyncRepositoryWatch; + import java.util.HashMap; import java.util.Map; @@ -10,17 +21,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import info.magnolia.cms.core.HierarchyManager; -import info.magnolia.cms.core.ItemType; -import info.magnolia.cms.core.SystemProperty; -import info.magnolia.context.MgnlContext; -import info.magnolia.module.ModuleLifecycle; -import info.magnolia.module.ModuleLifecycleContext; -import it.openutils.mgnlbootstrapsync.listener.AbstractBootstrapSyncListener; -import it.openutils.mgnlbootstrapsync.listener.BootstrapSyncListener; -import it.openutils.mgnlbootstrapsync.watch.BootstrapSyncRepositoryWatch; - /** * @author molaschi * @version $Id: $ @@ -67,13 +68,26 @@ // get roots from which to export (one file for each node (ordering problem)) String enableRoots = SystemProperty .getProperty("magnolia.bootstrapSync." + repository + ".enablePaths"); - + // get node type to export - String nodeType = SystemProperty - .getProperty("magnolia.bootstrapSync." + repository + ".nodeType"); + String nodeType = null;// SystemProperty.getProperty("magnolia.bootstrapSync." + repository + + // ".nodeType"); if (nodeType == null) { + // set default nodeType nodeType = ItemType.CONTENT.getSystemName(); + if (ContentRepository.USERS.equalsIgnoreCase(repository)) + { + nodeType = ItemType.USER.getSystemName(); + } + else if (ContentRepository.USER_ROLES.equalsIgnoreCase(repository)) + { + nodeType = ItemType.ROLE.getSystemName(); + } + else if (ContentRepository.USER_GROUPS.equalsIgnoreCase(repository)) + { + nodeType = ItemType.GROUP.getSystemName(); + } } // create watch @@ -90,7 +104,7 @@ try { HierarchyManager hm = MgnlContext.getSystemContext().getHierarchyManager(repository); - + log.debug("Starting listener on repository {}", repository); hm.getWorkspace().getObservationManager().addEventListener( listener, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |