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%2FDisplayRepoInformation.java;h=7cf3d1a1acfb60074f2a60f0a68beafb7d2f6795;hb=48b6f7647f12f4b96d1914bcafc95efd7f43cc43;hp=6ccd8d8eb3e196c6bb302a39108bc1b46cf853d5;hpb=706b98df2c68382d7bd501fa05cb128f329087ee;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/DisplayRepoInformation.java b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/commands/DisplayRepoInformation.java index 6ccd8d8eb..7cf3d1a1a 100644 --- a/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/commands/DisplayRepoInformation.java +++ b/plugins/org.argeo.slc.client.ui.dist/src/main/java/org/argeo/slc/client/ui/dist/commands/DisplayRepoInformation.java @@ -15,14 +15,13 @@ */ package org.argeo.slc.client.ui.dist.commands; -import javax.jcr.RepositoryFactory; +import javax.jcr.Repository; import javax.jcr.Session; import org.argeo.jcr.JcrUtils; import org.argeo.slc.client.ui.dist.DistPlugin; import org.argeo.slc.client.ui.dist.model.RepoElem; -import org.argeo.slc.repo.RepoUtils; -import org.argeo.util.security.Keyring; +import org.argeo.slc.repo.RepoService; import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; @@ -50,31 +49,32 @@ public class DisplayRepoInformation extends AbstractHandler { public final static String DEFAULT_LABEL = "Information"; public final static ImageDescriptor DEFAULT_ICON = DistPlugin .getImageDescriptor("icons/help.gif"); - + /* DEPENDENCY INJECTION */ - private RepositoryFactory repositoryFactory; - private Keyring keyring; - + private RepoService repoService; + private Repository nodeRepository; + public Object execute(ExecutionEvent event) throws ExecutionException { IStructuredSelection iss = (IStructuredSelection) HandlerUtil .getActiveSite(event).getSelectionProvider().getSelection(); if (iss.getFirstElement() instanceof RepoElem) { RepoElem re = (RepoElem) iss.getFirstElement(); - - Session defaultSession = null; - try{ - defaultSession = RepoUtils.getCorrespondingSession(repositoryFactory, keyring, re.getRepoNode(), re.getUri(), null); - - - InformationDialog inputDialog = new InformationDialog(HandlerUtil - .getActiveSite(event).getShell()); - inputDialog.create(); - inputDialog.loginTxt.setText(defaultSession.getUserID()); - inputDialog.nameTxt.setText(re.getLabel()); - inputDialog.uriTxt.setText(re.getUri()); - inputDialog.readOnlyBtn.setSelection(re.isReadOnly()); - - inputDialog.open(); + + Session defaultSession = null; + try { + defaultSession = repoService.getRemoteSession(re.getRepoNodePath(), + re.getUri(), null); + + InformationDialog inputDialog = new InformationDialog( + HandlerUtil.getActiveSite(event).getShell()); + inputDialog.create(); + // TODO add more information. + inputDialog.loginTxt.setText(defaultSession.getUserID()); + inputDialog.nameTxt.setText(re.getLabel()); + inputDialog.uriTxt.setText(re.getUri()); + inputDialog.readOnlyBtn.setSelection(re.isReadOnly()); + + inputDialog.open(); // } catch (RepositoryException e) { // throw new SlcException("Unexpected error while " // + "getting repository information.", e); @@ -147,14 +147,14 @@ public class DisplayRepoInformation extends AbstractHandler { shell.setText("Repository information"); } } - + /* DEPENDENCY INJECTION */ - public void setRepositoryFactory(RepositoryFactory repositoryFactory) { - this.repositoryFactory = repositoryFactory; + public void setRepoService(RepoService repoService) { + this.repoService = repoService; } - public void setKeyring(Keyring keyring) { - this.keyring = keyring; + public void setNodeRepository(Repository nodeRepository) { + this.nodeRepository = nodeRepository; } - + } \ No newline at end of file