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.PdeSourcesIndexer;
import org.argeo.slc.repo.RepoConstants;
private ArtifactIndexer artifactIndexer = new ArtifactIndexer();
private JarFileIndexer jarFileIndexer = new JarFileIndexer();
+ private DistributionBundleIndexer distBundleIndexer = new DistributionBundleIndexer();
+
private PdeSourcesIndexer pdeSourceIndexer = new PdeSourcesIndexer(
artifactIndexer, jarFileIndexer);
Session currSession = null;
NormalizeJob job;
try {
- String msg = "Your are about to normalize workspace: " + wkspName
+ String msg = "Your are about to normalize workspace: "
+ + wkspName
+ ".\nThis will index OSGi bundles and Maven artifacts, "
+ "it will also convert Maven sources to PDE Sources if needed.\n"
+ "Note that no information will be overwritten: "
+ session.getWorkspace().getName(),
expectedCount.intValue());
NormalizingTraverser tiv = new NormalizingTraverser(monitor);
- session.getNode(artifactBasePath).accept(tiv);
+ Node artifactBaseNode = session.getNode(artifactBasePath);
+ artifactBaseNode.accept(tiv);
} catch (Exception e) {
+ log.error("Error normalizing workspace "
+ + session.getWorkspace().getName() + ": "
+ + e.getMessage());
+ if (log.isErrorEnabled())
+ e.printStackTrace();
return new Status(IStatus.ERROR, DistPlugin.ID,
"Cannot normalize distribution "
+ session.getWorkspace().getName(), e);
monitor.subTask(node.getName());
artifactIndexer.index(node);
jarFileIndexer.index(node);
- node.getSession().save();
+ distBundleIndexer.index(node);
+ if (node.getSession().hasPendingChanges()) {
+ node.getSession().save();
+ if (log.isDebugEnabled())
+ log.debug("Processed artifact "
+ + node.getPath());
+ }
monitor.worked(1);
- if (log.isDebugEnabled())
- log.debug("Processed artifact "
- + node.getPath());
}
+ } else if (node.getName().endsWith(".pom")) {
+ distBundleIndexer.index(node);
+ if (node.getSession().hasPendingChanges()) {
+ node.getSession().save();
+ if (log.isDebugEnabled())
+ log.debug("Processed artifact " + node.getPath());
+ }
+ monitor.worked(1);
} else {
monitor.worked(1);
}