]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/editors/DistributionEditor.java
Improve dist UI
[gpl/argeo-slc.git] / plugins / org.argeo.slc.client.ui.dist / src / main / java / org / argeo / slc / client / ui / dist / editors / DistributionEditor.java
index 44825043782efc25b3ed5f5fffb8d1918ce67a8d..4fd85c2c20b4a458f87a0e5c8770db75f7c517cb 100644 (file)
  */
 package org.argeo.slc.client.ui.dist.editors;
 
+import javax.jcr.Credentials;
+import javax.jcr.GuestCredentials;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 
 import org.argeo.ArgeoException;
+import org.argeo.jcr.JcrUtils;
 import org.argeo.slc.client.ui.dist.DistPlugin;
 import org.argeo.slc.jcr.SlcNames;
 import org.eclipse.core.runtime.IProgressMonitor;
@@ -42,7 +45,8 @@ public class DistributionEditor extends FormEditor implements SlcNames {
                        throws PartInitException {
                DistributionEditorInput dei = (DistributionEditorInput) input;
                try {
-                       session = dei.getRepository().login(dei.getWorkspaceName());
+                       session = dei.getRepository().login(dei.getCredentials(),
+                                       dei.getWorkspaceName());
                } catch (RepositoryException e) {
                        throw new PartInitException("Cannot log to workspace "
                                        + dei.getWorkspaceName(), e);
@@ -54,6 +58,7 @@ public class DistributionEditor extends FormEditor implements SlcNames {
        @Override
        protected void addPages() {
                try {
+                       addPage(new ArtifactsBrowserPage(this, "Browser", session));
                        addPage(new DistributionOverviewPage(this, "Overview", session));
                } catch (PartInitException e) {
                        throw new ArgeoException("Cannot add distribution editor pages", e);
@@ -66,8 +71,7 @@ public class DistributionEditor extends FormEditor implements SlcNames {
 
        @Override
        public void dispose() {
-               if (session != null)
-                       session.logout();
+               JcrUtils.logoutQuietly(session);
                super.dispose();
        }