X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=cms%2Forg.argeo.slc.client.ui.dist%2Fsrc%2Forg%2Fargeo%2Fslc%2Fclient%2Fui%2Fdist%2Fmodel%2FWkspGroupElem.java;fp=cms%2Forg.argeo.slc.client.ui.dist%2Fsrc%2Forg%2Fargeo%2Fslc%2Fclient%2Fui%2Fdist%2Fmodel%2FWkspGroupElem.java;h=0000000000000000000000000000000000000000;hb=6fc94d69efe089414ac9e63bde3efab1cbf7b7ca;hp=0c10777ead4319e6e0d35c09d8a866d50b7ccb0d;hpb=b36c62642bd0db11b3133b369cc026fd4b7a1ec6;p=gpl%2Fargeo-slc.git diff --git a/cms/org.argeo.slc.client.ui.dist/src/org/argeo/slc/client/ui/dist/model/WkspGroupElem.java b/cms/org.argeo.slc.client.ui.dist/src/org/argeo/slc/client/ui/dist/model/WkspGroupElem.java deleted file mode 100644 index 0c10777ea..000000000 --- a/cms/org.argeo.slc.client.ui.dist/src/org/argeo/slc/client/ui/dist/model/WkspGroupElem.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.argeo.slc.client.ui.dist.model; - -import javax.jcr.RepositoryException; -import javax.jcr.Session; - -import org.argeo.jcr.JcrUtils; -import org.argeo.slc.SlcException; - -/** - * Abstract set of similar workspaces, that is a bunch of workspaces with same - * prefix. - */ -public class WkspGroupElem extends DistParentElem { - - private Session defaultSession; - - public WkspGroupElem(RepoElem repoElem, String prefix) { - super(prefix, repoElem.inHome(), repoElem.isReadOnly()); - setParent(repoElem); - // Directly adds children upon creation - try { - defaultSession = repoElem.repositoryLogin(null); - String[] wkpNames = defaultSession.getWorkspace() - .getAccessibleWorkspaceNames(); - for (String wkpName : wkpNames) { - if (prefix.equals(getPrefix(wkpName)) - // if (wkpName.startsWith(prefix) - && repoElem.isWorkspaceVisible(wkpName)) - addChild(new WorkspaceElem(WkspGroupElem.this, repoElem, - wkpName)); - } - } catch (RepositoryException e) { - throw new SlcException("Cannot retrieve workspace names", e); - } - } - - // FIXME - we rely on a "hard coded" convention : Workspace name must have - // this format: name-major.minor - // We might expose this method as static public, to be used among others by - // the RepoElem parent objects when building its children - private String getPrefix(String workspaceName) { - if (workspaceName.lastIndexOf(VERSION_SEP) > 0) - return workspaceName.substring(0, - workspaceName.lastIndexOf(VERSION_SEP)); - else - return workspaceName; - } - - public void dispose() { - JcrUtils.logoutQuietly(defaultSession); - super.dispose(); - } -} \ No newline at end of file