- // filter technical workspaces
- // FIXME: rely on a more robust rule than just wksp name
- if (workspaceName.lastIndexOf('-') > 0) {
- String prefix = workspaceName.substring(0,
- workspaceName.lastIndexOf('-'));
- if (!children.containsKey(prefix)) {
- children.put(prefix, new GroupElem(RepoElem.this,
- prefix));
- }
+ @Override
+ public synchronized void dispose() {
+ JcrUtils.logoutQuietly(defaultSession);
+ super.dispose();
+ }
+
+ private String getPrefix(String workspaceName) {
+ // Here is the tricks - we rely on a "hard coded" convention
+ // Workspace name should be like: name-major.minor
+ if (workspaceName.lastIndexOf(VERSION_SEP) > 0)
+ return workspaceName.substring(0,
+ workspaceName.lastIndexOf(VERSION_SEP));
+ else
+ return workspaceName;
+ }
+
+ /* Exposes this to the children workspace group */
+ protected boolean isWorkspaceVisible(String wkspName) {
+ Boolean result = true;
+ if (ARGEO_SYSTEM_WKSP.contains(wkspName))
+ return false;
+ // Add a supplementary check to hide workspace that are not
+ // public to anonymous user
+ if (repoNode == null) {
+ Session tmpSession = null;
+ try {
+ tmpSession = repository.login(wkspName);
+ try {
+ tmpSession.checkPermission("/", "read");
+ } catch (AccessControlException e) {
+ result = false;