X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=plugins%2Forg.argeo.slc.client.ui.dist%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fclient%2Fui%2Fdist%2Fcommands%2FNormalizeWorkspace.java;h=6591a56a72d1557e186066a7639a606f1835bb09;hb=48b6f7647f12f4b96d1914bcafc95efd7f43cc43;hp=c348151c98154046cfe5d9140e60c03353856c11;hpb=3355fbcd66a8fc061b8ddbf9d287ee4d17734d0e;p=gpl%2Fargeo-slc.git diff --git a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/commands/NormalizeWorkspace.java b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/commands/NormalizeWorkspace.java index c348151c9..6591a56a7 100644 --- a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/commands/NormalizeWorkspace.java +++ b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/commands/NormalizeWorkspace.java @@ -36,8 +36,8 @@ import org.argeo.slc.SlcException; import org.argeo.slc.client.ui.dist.DistPlugin; import org.argeo.slc.jcr.SlcNames; import org.argeo.slc.repo.ArtifactIndexer; -import org.argeo.slc.repo.DistributionBundleIndexer; import org.argeo.slc.repo.JarFileIndexer; +import org.argeo.slc.repo.ModularDistributionIndexer; import org.argeo.slc.repo.PdeSourcesIndexer; import org.argeo.slc.repo.RepoConstants; import org.argeo.slc.repo.RepoUtils; @@ -74,12 +74,12 @@ public class NormalizeWorkspace extends AbstractHandler implements SlcNames { private Keyring keyring; private Repository repository; - private ArtifactIndexer artifactIndexer = new ArtifactIndexer(); + // Relevant default node indexers + private PdeSourcesIndexer pdeSourceIndexer = new PdeSourcesIndexer(); + // WARNING Order is important: must be called in the following order. + private ModularDistributionIndexer modularDistributionIndexer = new ModularDistributionIndexer(); private JarFileIndexer jarFileIndexer = new JarFileIndexer(); - private DistributionBundleIndexer distBundleIndexer = new DistributionBundleIndexer(); - - private PdeSourcesIndexer pdeSourceIndexer = new PdeSourcesIndexer( - artifactIndexer, jarFileIndexer); + private ArtifactIndexer artifactIndexer = new ArtifactIndexer(); public Object execute(ExecutionEvent event) throws ExecutionException { String targetRepoPath = event.getParameter(PARAM_TARGET_REPO_PATH); @@ -189,15 +189,30 @@ public class NormalizeWorkspace extends AbstractHandler implements SlcNames { if (jarFileIndexer.support(node.getPath())) if (artifactIndexer.support(node.getPath())) { monitor.subTask(node.getName()); - artifactIndexer.index(node); + modularDistributionIndexer.index(node); jarFileIndexer.index(node); - distBundleIndexer.index(node); - node.getSession().save(); + artifactIndexer.index(node); + if (node.getSession().hasPendingChanges()) { + node.getSession().save(); + if (log.isDebugEnabled()) + log.debug("Processed jar artifact " + + node.getPath()); + } monitor.worked(1); - if (log.isDebugEnabled()) - log.debug("Processed artifact " - + node.getPath()); } + } else if (node.getName().endsWith(".pom")) { + // Removed: we do not support binaries concept anymore. + // if (distBundleIndexer.support(node.getPath())) + // distBundleIndexer.index(node); + if (artifactIndexer.support(node.getPath())) + artifactIndexer.index(node); + if (node.getSession().hasPendingChanges()) { + node.getSession().save(); + if (log.isDebugEnabled()) + log.debug("Processed pom artifact " + + node.getPath()); + } + monitor.worked(1); } else { monitor.worked(1); }