From: Mathieu Baudier Date: Wed, 31 Oct 2012 14:20:49 +0000 (+0000) Subject: Small UI improvements and documentation X-Git-Tag: argeo-slc-2.1.7~571 X-Git-Url: http://git.argeo.org/?a=commitdiff_plain;h=996f89dad19dfa994ea33feff06543981b8f0182;hp=cec804823540f035172eabce620e636ea4f5e80d;p=gpl%2Fargeo-slc.git Small UI improvements and documentation git-svn-id: https://svn.argeo.org/slc/trunk@5683 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- diff --git a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/DistributionPerspective.java b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/DistributionPerspective.java index 5b185a89a..954f54e6d 100644 --- a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/DistributionPerspective.java +++ b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/DistributionPerspective.java @@ -15,11 +15,7 @@ */ package org.argeo.slc.client.ui.dist; -import org.argeo.slc.client.ui.dist.views.ArtifactsBrowser; import org.argeo.slc.client.ui.dist.views.DistributionsView; -import org.argeo.slc.client.ui.dist.views.QueryArtifactsForm; -import org.argeo.slc.client.ui.dist.views.QueryArtifactsText; -import org.argeo.slc.client.ui.dist.views.QueryBundlesForm; import org.eclipse.ui.IFolderLayout; import org.eclipse.ui.IPageLayout; import org.eclipse.ui.IPerspectiveFactory; @@ -36,10 +32,10 @@ public class DistributionPerspective implements IPerspectiveFactory { IFolderLayout main = layout.createFolder("main", IPageLayout.LEFT, 0.5f, editorArea); main.addView(DistributionsView.ID); - main.addView(ArtifactsBrowser.ID); - main.addView(QueryArtifactsForm.ID); - main.addView(QueryBundlesForm.ID); - main.addView(QueryArtifactsText.ID); +// main.addView(ArtifactsBrowser.ID); +// main.addView(QueryArtifactsForm.ID); +// main.addView(QueryBundlesForm.ID); +// main.addView(QueryArtifactsText.ID); main.addView("org.eclipse.ui.views.ProgressView"); } } diff --git a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/commands/RunInOsgi.java b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/commands/RunInOsgi.java index f274b4b13..f89a9b044 100644 --- a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/commands/RunInOsgi.java +++ b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/commands/RunInOsgi.java @@ -48,6 +48,7 @@ import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; +/** UNDER DEVELOPMENT. Download and prepare an OSGi runtime*/ public class RunInOsgi extends AbstractHandler implements SlcNames { private final static Log log = LogFactory.getLog(RunInOsgi.class); diff --git a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/views/DistributionsView.java b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/views/DistributionsView.java index acb503350..25e67382a 100644 --- a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/views/DistributionsView.java +++ b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/views/DistributionsView.java @@ -374,10 +374,15 @@ public class DistributionsView extends ViewPart implements SlcNames, ArgeoNames String[] workspaceNames = session.getWorkspace() .getAccessibleWorkspaceNames(); List distributionElems = new ArrayList(); - for (String workspace : workspaceNames) - distributionElems.add(new DistributionElem(this, workspace, - credentials)); - // FIXME remove deleted workspaces + for (String workspaceName : workspaceNames) { + Node workspaceNode = repoNode.hasNode(workspaceName) ? repoNode + .getNode(workspaceName) : repoNode + .addNode(workspaceName); + repoNode.getSession().save(); + distributionElems.add(new DistributionElem(this, + workspaceNode)); + // FIXME remove deleted workspaces + } return distributionElems.toArray(); } catch (RepositoryException e) { throw new SlcException( @@ -406,32 +411,22 @@ public class DistributionsView extends ViewPart implements SlcNames, ArgeoNames connect(); return repository; } + + public Credentials getCredentials() { + return credentials; + } + } /** Abstracts a distribution, that is a workspace */ private static class DistributionElem extends TreeParent { private final RepoElem repoElem; private final Node workspaceNode; - private final String workspaceName; - private final Credentials credentials; - public DistributionElem(RepoElem repoElem, String workspaceName, - Credentials credentials) { - super(workspaceName); + public DistributionElem(RepoElem repoElem, Node workspaceNode) { + super(JcrUtils.getNameQuietly(workspaceNode)); this.repoElem = repoElem; - try { - // TODO move it to repo elem - this.workspaceNode = repoElem.getRepoNode().hasNode( - workspaceName) ? repoElem.getRepoNode().getNode( - workspaceName) : repoElem.getRepoNode().addNode( - workspaceName); - repoElem.getRepoNode().getSession().save(); - } catch (RepositoryException e) { - throw new SlcException("Cannot get or add workspace node " - + workspaceName, e); - } - this.workspaceName = workspaceName; - this.credentials = credentials; + this.workspaceNode = workspaceNode; } public Node getWorkspaceNode() { @@ -439,7 +434,7 @@ public class DistributionsView extends ViewPart implements SlcNames, ArgeoNames } public String getWorkspaceName() { - return workspaceName; + return JcrUtils.getNameQuietly(workspaceNode); } public String getWorkspacePath() { @@ -447,7 +442,7 @@ public class DistributionsView extends ViewPart implements SlcNames, ArgeoNames return workspaceNode.getPath(); } catch (RepositoryException e) { throw new SlcException("Cannot get or add workspace path " - + workspaceName, e); + + getWorkspaceName(), e); } } @@ -456,7 +451,7 @@ public class DistributionsView extends ViewPart implements SlcNames, ArgeoNames return workspaceNode.getParent().getPath(); } catch (RepositoryException e) { throw new SlcException("Cannot get or add workspace path " - + workspaceName, e); + + getWorkspaceName(), e); } } @@ -465,7 +460,7 @@ public class DistributionsView extends ViewPart implements SlcNames, ArgeoNames } public Credentials getCredentials() { - return credentials; + return repoElem.getCredentials(); } } @@ -593,8 +588,8 @@ public class DistributionsView extends ViewPart implements SlcNames, ArgeoNames // QueryResult result = countQuery.execute(); // Long expectedCount = result.getNodes().getSize(); - Long expectedCount = JcrUtils.countFiles(sourceSession - .getRootNode()); + Long expectedCount = JcrUtils.countFiles(sourceSession + .getRootNode()); if (log.isDebugEnabled()) log.debug("Will copy " + expectedCount + " files...");