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=d70d904f9bfdaf5028b6c6fed1f46018defdca53;hb=d5b315ae97d554676a77bd0e4476446da2a78264;hp=77cb0821202d9be79266c38e35e927c18528a7dd;hpb=702f1e0c7d73edeb739dd62cd4248f489e1420b7;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 77cb08212..d70d904f9 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 @@ -74,10 +74,10 @@ public class NormalizeWorkspace extends AbstractHandler implements SlcNames { private Keyring keyring; private Repository repository; + // RElevant default node indexers private ArtifactIndexer artifactIndexer = new ArtifactIndexer(); private JarFileIndexer jarFileIndexer = new JarFileIndexer(); private DistributionBundleIndexer distBundleIndexer = new DistributionBundleIndexer(); - private PdeSourcesIndexer pdeSourceIndexer = new PdeSourcesIndexer( artifactIndexer, jarFileIndexer); @@ -143,9 +143,14 @@ public class NormalizeWorkspace extends AbstractHandler implements SlcNames { + session.getWorkspace().getName(), expectedCount.intValue()); NormalizingTraverser tiv = new NormalizingTraverser(monitor); - Node artifactBaseNode =session.getNode(artifactBasePath); + 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); @@ -187,12 +192,22 @@ public class NormalizeWorkspace extends AbstractHandler implements SlcNames { artifactIndexer.index(node); jarFileIndexer.index(node); distBundleIndexer.index(node); - node.getSession().save(); + 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")) { + distBundleIndexer.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); }