Refactor JCR low-level components and icons
authorMathieu Baudier <mbaudier@argeo.org>
Fri, 16 Mar 2018 11:38:45 +0000 (12:38 +0100)
committerMathieu Baudier <mbaudier@argeo.org>
Fri, 16 Mar 2018 11:38:45 +0000 (12:38 +0100)
189 files changed:
.gitignore
org.argeo.cms.ui.theme/icons/active.gif [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/add.gif [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/add.png [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/addFolder.gif [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/addPrivileges.gif [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/addRepo.gif [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/addWorkspace.png [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/adminLog.gif [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/batch.gif [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/begin.gif [new file with mode: 0755]
org.argeo.cms.ui.theme/icons/binary.png [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/browser.gif [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/bundles.gif [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/changePassword.gif [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/clear.gif [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/close-all.png [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/commit.gif [new file with mode: 0755]
org.argeo.cms.ui.theme/icons/delete.png [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/dumpNode.gif [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/file.gif [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/folder.gif [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/getSize.gif [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/group.png [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/home.gif [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/home.png [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/import_fs.png [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/installed.gif [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/log.gif [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/maintenance.gif [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/node.gif [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/nodes.gif [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/osgi_explorer.gif [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/password.gif [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/person-logged-in.png [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/person.png [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/query.png [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/refresh.png [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/remote_connected.gif [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/remote_disconnected.gif [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/remove.gif [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/removePrivileges.gif [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/rename.gif [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/repositories.gif [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/repository_connected.gif [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/repository_disconnected.gif [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/resolved.gif [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/role.gif [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/rollback.gif [new file with mode: 0755]
org.argeo.cms.ui.theme/icons/save-all.png [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/save.gif [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/save.png [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/save_security.png [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/save_security_disabled.png [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/security.gif [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/service_published.gif [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/service_referenced.gif [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/sort.gif [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/starting.gif [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/sync.gif [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/user.gif [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/users.gif [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/workgroup.png [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/workgroup.xcf [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/workspace_connected.png [new file with mode: 0644]
org.argeo.cms.ui.theme/icons/workspace_disconnected.png [new file with mode: 0644]
org.argeo.cms.ui.workbench/META-INF/spring/common.xml
org.argeo.cms.ui.workbench/icons/active.gif [deleted file]
org.argeo.cms.ui.workbench/icons/add.gif [deleted file]
org.argeo.cms.ui.workbench/icons/add.png [deleted file]
org.argeo.cms.ui.workbench/icons/addFolder.gif [deleted file]
org.argeo.cms.ui.workbench/icons/addPrivileges.gif [deleted file]
org.argeo.cms.ui.workbench/icons/addRepo.gif [deleted file]
org.argeo.cms.ui.workbench/icons/addWorkspace.png [deleted file]
org.argeo.cms.ui.workbench/icons/adminLog.gif [deleted file]
org.argeo.cms.ui.workbench/icons/batch.gif [deleted file]
org.argeo.cms.ui.workbench/icons/begin.gif [deleted file]
org.argeo.cms.ui.workbench/icons/binary.png [deleted file]
org.argeo.cms.ui.workbench/icons/browser.gif [deleted file]
org.argeo.cms.ui.workbench/icons/bundles.gif [deleted file]
org.argeo.cms.ui.workbench/icons/changePassword.gif [deleted file]
org.argeo.cms.ui.workbench/icons/clear.gif [deleted file]
org.argeo.cms.ui.workbench/icons/close-all.png [deleted file]
org.argeo.cms.ui.workbench/icons/commit.gif [deleted file]
org.argeo.cms.ui.workbench/icons/delete.png [deleted file]
org.argeo.cms.ui.workbench/icons/dumpNode.gif [deleted file]
org.argeo.cms.ui.workbench/icons/file.gif [deleted file]
org.argeo.cms.ui.workbench/icons/folder.gif [deleted file]
org.argeo.cms.ui.workbench/icons/getSize.gif [deleted file]
org.argeo.cms.ui.workbench/icons/group.png [deleted file]
org.argeo.cms.ui.workbench/icons/home.gif [deleted file]
org.argeo.cms.ui.workbench/icons/home.png [deleted file]
org.argeo.cms.ui.workbench/icons/import_fs.png [deleted file]
org.argeo.cms.ui.workbench/icons/installed.gif [deleted file]
org.argeo.cms.ui.workbench/icons/log.gif [deleted file]
org.argeo.cms.ui.workbench/icons/maintenance.gif [deleted file]
org.argeo.cms.ui.workbench/icons/node.gif [deleted file]
org.argeo.cms.ui.workbench/icons/nodes.gif [deleted file]
org.argeo.cms.ui.workbench/icons/osgi_explorer.gif [deleted file]
org.argeo.cms.ui.workbench/icons/password.gif [deleted file]
org.argeo.cms.ui.workbench/icons/person-logged-in.png [deleted file]
org.argeo.cms.ui.workbench/icons/person.png [deleted file]
org.argeo.cms.ui.workbench/icons/query.png [deleted file]
org.argeo.cms.ui.workbench/icons/refresh.png [deleted file]
org.argeo.cms.ui.workbench/icons/remote_connected.gif [deleted file]
org.argeo.cms.ui.workbench/icons/remote_disconnected.gif [deleted file]
org.argeo.cms.ui.workbench/icons/remove.gif [deleted file]
org.argeo.cms.ui.workbench/icons/removePrivileges.gif [deleted file]
org.argeo.cms.ui.workbench/icons/rename.gif [deleted file]
org.argeo.cms.ui.workbench/icons/repositories.gif [deleted file]
org.argeo.cms.ui.workbench/icons/repository_connected.gif [deleted file]
org.argeo.cms.ui.workbench/icons/repository_disconnected.gif [deleted file]
org.argeo.cms.ui.workbench/icons/resolved.gif [deleted file]
org.argeo.cms.ui.workbench/icons/role.gif [deleted file]
org.argeo.cms.ui.workbench/icons/rollback.gif [deleted file]
org.argeo.cms.ui.workbench/icons/save-all.png [deleted file]
org.argeo.cms.ui.workbench/icons/save.gif [deleted file]
org.argeo.cms.ui.workbench/icons/save.png [deleted file]
org.argeo.cms.ui.workbench/icons/save_security.png [deleted file]
org.argeo.cms.ui.workbench/icons/save_security_disabled.png [deleted file]
org.argeo.cms.ui.workbench/icons/security.gif [deleted file]
org.argeo.cms.ui.workbench/icons/service_published.gif [deleted file]
org.argeo.cms.ui.workbench/icons/service_referenced.gif [deleted file]
org.argeo.cms.ui.workbench/icons/sort.gif [deleted file]
org.argeo.cms.ui.workbench/icons/starting.gif [deleted file]
org.argeo.cms.ui.workbench/icons/sync.gif [deleted file]
org.argeo.cms.ui.workbench/icons/user.gif [deleted file]
org.argeo.cms.ui.workbench/icons/users.gif [deleted file]
org.argeo.cms.ui.workbench/icons/workgroup.png [deleted file]
org.argeo.cms.ui.workbench/icons/workgroup.xcf [deleted file]
org.argeo.cms.ui.workbench/icons/workspace_connected.png [deleted file]
org.argeo.cms.ui.workbench/icons/workspace_disconnected.png [deleted file]
org.argeo.cms.ui.workbench/plugin.xml
org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/WorkbenchConstants.java
org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/DefaultRepositoryRegister.java [deleted file]
org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/FullVersioningTreeContentProvider.java [deleted file]
org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/JcrBrowserUtils.java [deleted file]
org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/JcrDClickListener.java [deleted file]
org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/JcrTreeContentProvider.java [deleted file]
org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/NodeContentProvider.java [deleted file]
org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/NodeLabelProvider.java [deleted file]
org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/PropertiesContentProvider.java [deleted file]
org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/PropertyLabelProvider.java [deleted file]
org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/RepositoryRegister.java [deleted file]
org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/VersionLabelProvider.java [deleted file]
org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/commands/AddFolderNode.java
org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/commands/AddPrivileges.java
org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/commands/ConfigurableNodeDump.java
org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/commands/CreateWorkspace.java
org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/commands/DeleteNodes.java
org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/commands/DumpNode.java
org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/commands/GetNodeSize.java
org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/commands/Refresh.java
org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/commands/RemovePrivileges.java
org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/commands/RemoveRemoteRepository.java
org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/commands/RenameNode.java
org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/commands/UploadFiles.java
org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/model/MaintainedRepositoryElem.java [deleted file]
org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/model/RemoteRepositoryElem.java [deleted file]
org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/model/RepositoriesElem.java [deleted file]
org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/model/RepositoryElem.java [deleted file]
org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/model/SingleJcrNodeElem.java [deleted file]
org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/model/WorkspaceElem.java [deleted file]
org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/parts/ChildNodesPage.java
org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/parts/GenericNodePage.java
org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/parts/GenericPropertyPage.java
org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/parts/NodeVersionHistoryPage.java
org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/jcr/JcrBrowserView.java
org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/jcr/JcrImages.java [deleted file]
org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/jcr/WorkbenchJcrDClickListener.java [new file with mode: 0644]
org.argeo.cms.ui/src/org/argeo/cms/ui/CmsConstants.java
org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/DefaultRepositoryRegister.java [new file with mode: 0644]
org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/FullVersioningTreeContentProvider.java [new file with mode: 0644]
org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/JcrBrowserUtils.java [new file with mode: 0644]
org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/JcrDClickListener.java [new file with mode: 0644]
org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/JcrImages.java [new file with mode: 0644]
org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/JcrTreeContentProvider.java [new file with mode: 0644]
org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/NodeContentProvider.java [new file with mode: 0644]
org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/NodeLabelProvider.java [new file with mode: 0644]
org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/PropertiesContentProvider.java [new file with mode: 0644]
org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/PropertyLabelProvider.java [new file with mode: 0644]
org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/RepositoryRegister.java [new file with mode: 0644]
org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/VersionLabelProvider.java [new file with mode: 0644]
org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/model/MaintainedRepositoryElem.java [new file with mode: 0644]
org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/model/RemoteRepositoryElem.java [new file with mode: 0644]
org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/model/RepositoriesElem.java [new file with mode: 0644]
org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/model/RepositoryElem.java [new file with mode: 0644]
org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/model/SingleJcrNodeElem.java [new file with mode: 0644]
org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/model/WorkspaceElem.java [new file with mode: 0644]

index 584ca59c646b16460ed049fd3538594281654f93..69b786d29977b930fcbb5b72022b4f47deaa740c 100644 (file)
@@ -1,2 +1,2 @@
 /target/
-/org.argeo.cms.app.server/
+/org.argeo.cms.e4.*
\ No newline at end of file
diff --git a/org.argeo.cms.ui.theme/icons/active.gif b/org.argeo.cms.ui.theme/icons/active.gif
new file mode 100644 (file)
index 0000000..7d24707
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/active.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/add.gif b/org.argeo.cms.ui.theme/icons/add.gif
new file mode 100644 (file)
index 0000000..252d7eb
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/add.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/add.png b/org.argeo.cms.ui.theme/icons/add.png
new file mode 100644 (file)
index 0000000..c7edfec
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/add.png differ
diff --git a/org.argeo.cms.ui.theme/icons/addFolder.gif b/org.argeo.cms.ui.theme/icons/addFolder.gif
new file mode 100644 (file)
index 0000000..d3f43d9
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/addFolder.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/addPrivileges.gif b/org.argeo.cms.ui.theme/icons/addPrivileges.gif
new file mode 100644 (file)
index 0000000..a6b251f
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/addPrivileges.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/addRepo.gif b/org.argeo.cms.ui.theme/icons/addRepo.gif
new file mode 100644 (file)
index 0000000..26d81c0
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/addRepo.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/addWorkspace.png b/org.argeo.cms.ui.theme/icons/addWorkspace.png
new file mode 100644 (file)
index 0000000..bbee775
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/addWorkspace.png differ
diff --git a/org.argeo.cms.ui.theme/icons/adminLog.gif b/org.argeo.cms.ui.theme/icons/adminLog.gif
new file mode 100644 (file)
index 0000000..6ef3bca
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/adminLog.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/batch.gif b/org.argeo.cms.ui.theme/icons/batch.gif
new file mode 100644 (file)
index 0000000..b8ca14a
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/batch.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/begin.gif b/org.argeo.cms.ui.theme/icons/begin.gif
new file mode 100755 (executable)
index 0000000..feb8e94
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/begin.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/binary.png b/org.argeo.cms.ui.theme/icons/binary.png
new file mode 100644 (file)
index 0000000..fdf4f82
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/binary.png differ
diff --git a/org.argeo.cms.ui.theme/icons/browser.gif b/org.argeo.cms.ui.theme/icons/browser.gif
new file mode 100644 (file)
index 0000000..6c7320c
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/browser.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/bundles.gif b/org.argeo.cms.ui.theme/icons/bundles.gif
new file mode 100644 (file)
index 0000000..e9a6bd9
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/bundles.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/changePassword.gif b/org.argeo.cms.ui.theme/icons/changePassword.gif
new file mode 100644 (file)
index 0000000..274a850
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/changePassword.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/clear.gif b/org.argeo.cms.ui.theme/icons/clear.gif
new file mode 100644 (file)
index 0000000..6bc10f9
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/clear.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/close-all.png b/org.argeo.cms.ui.theme/icons/close-all.png
new file mode 100644 (file)
index 0000000..85d4d42
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/close-all.png differ
diff --git a/org.argeo.cms.ui.theme/icons/commit.gif b/org.argeo.cms.ui.theme/icons/commit.gif
new file mode 100755 (executable)
index 0000000..876f3eb
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/commit.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/delete.png b/org.argeo.cms.ui.theme/icons/delete.png
new file mode 100644 (file)
index 0000000..66d1cd7
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/delete.png differ
diff --git a/org.argeo.cms.ui.theme/icons/dumpNode.gif b/org.argeo.cms.ui.theme/icons/dumpNode.gif
new file mode 100644 (file)
index 0000000..14eb1be
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/dumpNode.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/file.gif b/org.argeo.cms.ui.theme/icons/file.gif
new file mode 100644 (file)
index 0000000..ef30288
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/file.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/folder.gif b/org.argeo.cms.ui.theme/icons/folder.gif
new file mode 100644 (file)
index 0000000..42e027c
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/folder.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/getSize.gif b/org.argeo.cms.ui.theme/icons/getSize.gif
new file mode 100644 (file)
index 0000000..b05bf3e
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/getSize.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/group.png b/org.argeo.cms.ui.theme/icons/group.png
new file mode 100644 (file)
index 0000000..cc6683a
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/group.png differ
diff --git a/org.argeo.cms.ui.theme/icons/home.gif b/org.argeo.cms.ui.theme/icons/home.gif
new file mode 100644 (file)
index 0000000..fd0c669
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/home.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/home.png b/org.argeo.cms.ui.theme/icons/home.png
new file mode 100644 (file)
index 0000000..5eb0967
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/home.png differ
diff --git a/org.argeo.cms.ui.theme/icons/import_fs.png b/org.argeo.cms.ui.theme/icons/import_fs.png
new file mode 100644 (file)
index 0000000..d7c890c
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/import_fs.png differ
diff --git a/org.argeo.cms.ui.theme/icons/installed.gif b/org.argeo.cms.ui.theme/icons/installed.gif
new file mode 100644 (file)
index 0000000..2988716
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/installed.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/log.gif b/org.argeo.cms.ui.theme/icons/log.gif
new file mode 100644 (file)
index 0000000..e3ecc55
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/log.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/maintenance.gif b/org.argeo.cms.ui.theme/icons/maintenance.gif
new file mode 100644 (file)
index 0000000..e5690ec
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/maintenance.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/node.gif b/org.argeo.cms.ui.theme/icons/node.gif
new file mode 100644 (file)
index 0000000..364c0e7
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/node.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/nodes.gif b/org.argeo.cms.ui.theme/icons/nodes.gif
new file mode 100644 (file)
index 0000000..bba3dbc
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/nodes.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/osgi_explorer.gif b/org.argeo.cms.ui.theme/icons/osgi_explorer.gif
new file mode 100644 (file)
index 0000000..e9a6bd9
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/osgi_explorer.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/password.gif b/org.argeo.cms.ui.theme/icons/password.gif
new file mode 100644 (file)
index 0000000..a6b251f
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/password.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/person-logged-in.png b/org.argeo.cms.ui.theme/icons/person-logged-in.png
new file mode 100644 (file)
index 0000000..87acc14
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/person-logged-in.png differ
diff --git a/org.argeo.cms.ui.theme/icons/person.png b/org.argeo.cms.ui.theme/icons/person.png
new file mode 100644 (file)
index 0000000..7d979a5
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/person.png differ
diff --git a/org.argeo.cms.ui.theme/icons/query.png b/org.argeo.cms.ui.theme/icons/query.png
new file mode 100644 (file)
index 0000000..54c089d
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/query.png differ
diff --git a/org.argeo.cms.ui.theme/icons/refresh.png b/org.argeo.cms.ui.theme/icons/refresh.png
new file mode 100644 (file)
index 0000000..71b3481
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/refresh.png differ
diff --git a/org.argeo.cms.ui.theme/icons/remote_connected.gif b/org.argeo.cms.ui.theme/icons/remote_connected.gif
new file mode 100644 (file)
index 0000000..1492b4e
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/remote_connected.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/remote_disconnected.gif b/org.argeo.cms.ui.theme/icons/remote_disconnected.gif
new file mode 100644 (file)
index 0000000..6c54da9
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/remote_disconnected.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/remove.gif b/org.argeo.cms.ui.theme/icons/remove.gif
new file mode 100644 (file)
index 0000000..0ae6dec
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/remove.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/removePrivileges.gif b/org.argeo.cms.ui.theme/icons/removePrivileges.gif
new file mode 100644 (file)
index 0000000..aa78fd2
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/removePrivileges.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/rename.gif b/org.argeo.cms.ui.theme/icons/rename.gif
new file mode 100644 (file)
index 0000000..8048405
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/rename.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/repositories.gif b/org.argeo.cms.ui.theme/icons/repositories.gif
new file mode 100644 (file)
index 0000000..c13bea1
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/repositories.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/repository_connected.gif b/org.argeo.cms.ui.theme/icons/repository_connected.gif
new file mode 100644 (file)
index 0000000..a15fa55
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/repository_connected.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/repository_disconnected.gif b/org.argeo.cms.ui.theme/icons/repository_disconnected.gif
new file mode 100644 (file)
index 0000000..4576dc5
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/repository_disconnected.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/resolved.gif b/org.argeo.cms.ui.theme/icons/resolved.gif
new file mode 100644 (file)
index 0000000..f4a1ea1
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/resolved.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/role.gif b/org.argeo.cms.ui.theme/icons/role.gif
new file mode 100644 (file)
index 0000000..274a850
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/role.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/rollback.gif b/org.argeo.cms.ui.theme/icons/rollback.gif
new file mode 100755 (executable)
index 0000000..c753995
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/rollback.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/save-all.png b/org.argeo.cms.ui.theme/icons/save-all.png
new file mode 100644 (file)
index 0000000..b68a29b
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/save-all.png differ
diff --git a/org.argeo.cms.ui.theme/icons/save.gif b/org.argeo.cms.ui.theme/icons/save.gif
new file mode 100644 (file)
index 0000000..654ad7b
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/save.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/save.png b/org.argeo.cms.ui.theme/icons/save.png
new file mode 100644 (file)
index 0000000..f27ef2d
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/save.png differ
diff --git a/org.argeo.cms.ui.theme/icons/save_security.png b/org.argeo.cms.ui.theme/icons/save_security.png
new file mode 100644 (file)
index 0000000..ca41dc9
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/save_security.png differ
diff --git a/org.argeo.cms.ui.theme/icons/save_security_disabled.png b/org.argeo.cms.ui.theme/icons/save_security_disabled.png
new file mode 100644 (file)
index 0000000..fb7d08d
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/save_security_disabled.png differ
diff --git a/org.argeo.cms.ui.theme/icons/security.gif b/org.argeo.cms.ui.theme/icons/security.gif
new file mode 100644 (file)
index 0000000..57fb95e
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/security.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/service_published.gif b/org.argeo.cms.ui.theme/icons/service_published.gif
new file mode 100644 (file)
index 0000000..17f771a
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/service_published.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/service_referenced.gif b/org.argeo.cms.ui.theme/icons/service_referenced.gif
new file mode 100644 (file)
index 0000000..c24a95f
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/service_referenced.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/sort.gif b/org.argeo.cms.ui.theme/icons/sort.gif
new file mode 100644 (file)
index 0000000..23c5d0b
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/sort.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/starting.gif b/org.argeo.cms.ui.theme/icons/starting.gif
new file mode 100644 (file)
index 0000000..563743d
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/starting.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/sync.gif b/org.argeo.cms.ui.theme/icons/sync.gif
new file mode 100644 (file)
index 0000000..b4fa052
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/sync.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/user.gif b/org.argeo.cms.ui.theme/icons/user.gif
new file mode 100644 (file)
index 0000000..90a0014
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/user.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/users.gif b/org.argeo.cms.ui.theme/icons/users.gif
new file mode 100644 (file)
index 0000000..2de7edd
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/users.gif differ
diff --git a/org.argeo.cms.ui.theme/icons/workgroup.png b/org.argeo.cms.ui.theme/icons/workgroup.png
new file mode 100644 (file)
index 0000000..7fef996
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/workgroup.png differ
diff --git a/org.argeo.cms.ui.theme/icons/workgroup.xcf b/org.argeo.cms.ui.theme/icons/workgroup.xcf
new file mode 100644 (file)
index 0000000..f517c82
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/workgroup.xcf differ
diff --git a/org.argeo.cms.ui.theme/icons/workspace_connected.png b/org.argeo.cms.ui.theme/icons/workspace_connected.png
new file mode 100644 (file)
index 0000000..0430baa
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/workspace_connected.png differ
diff --git a/org.argeo.cms.ui.theme/icons/workspace_disconnected.png b/org.argeo.cms.ui.theme/icons/workspace_disconnected.png
new file mode 100644 (file)
index 0000000..fddcb8c
Binary files /dev/null and b/org.argeo.cms.ui.theme/icons/workspace_disconnected.png differ
index 4b1b75435da4f4fc7d9a07fd83795901b21f8b07..32a3a8f9d5926d27858232ce248307b6768b799e 100644 (file)
@@ -9,13 +9,14 @@
                <property name="userTransaction" ref="userTransaction" />\r
        </bean>\r
 \r
-       <bean id="userAdminWrapper" class="org.argeo.cms.ui.workbench.internal.useradmin.UserAdminWrapper"\r
+       <bean id="userAdminWrapper"\r
+               class="org.argeo.cms.ui.workbench.internal.useradmin.UserAdminWrapper"\r
                scope="singleton" lazy-init="false">\r
                <property name="userTransaction" ref="userTransaction" />\r
                <property name="userAdmin" ref="userAdmin" />\r
                <property name="userAdminServiceReference" ref="userAdmin" />\r
        </bean>\r
-       \r
-       <bean id="repositoryRegister" class="org.argeo.cms.ui.workbench.internal.jcr.DefaultRepositoryRegister" />\r
-       \r
+\r
+       <bean id="repositoryRegister" class="org.argeo.cms.ui.jcr.DefaultRepositoryRegister" />\r
+\r
 </beans>\r
diff --git a/org.argeo.cms.ui.workbench/icons/active.gif b/org.argeo.cms.ui.workbench/icons/active.gif
deleted file mode 100644 (file)
index 7d24707..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/active.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/add.gif b/org.argeo.cms.ui.workbench/icons/add.gif
deleted file mode 100644 (file)
index 252d7eb..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/add.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/add.png b/org.argeo.cms.ui.workbench/icons/add.png
deleted file mode 100644 (file)
index c7edfec..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/add.png and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/addFolder.gif b/org.argeo.cms.ui.workbench/icons/addFolder.gif
deleted file mode 100644 (file)
index d3f43d9..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/addFolder.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/addPrivileges.gif b/org.argeo.cms.ui.workbench/icons/addPrivileges.gif
deleted file mode 100644 (file)
index a6b251f..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/addPrivileges.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/addRepo.gif b/org.argeo.cms.ui.workbench/icons/addRepo.gif
deleted file mode 100644 (file)
index 26d81c0..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/addRepo.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/addWorkspace.png b/org.argeo.cms.ui.workbench/icons/addWorkspace.png
deleted file mode 100644 (file)
index bbee775..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/addWorkspace.png and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/adminLog.gif b/org.argeo.cms.ui.workbench/icons/adminLog.gif
deleted file mode 100644 (file)
index 6ef3bca..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/adminLog.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/batch.gif b/org.argeo.cms.ui.workbench/icons/batch.gif
deleted file mode 100644 (file)
index b8ca14a..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/batch.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/begin.gif b/org.argeo.cms.ui.workbench/icons/begin.gif
deleted file mode 100755 (executable)
index feb8e94..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/begin.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/binary.png b/org.argeo.cms.ui.workbench/icons/binary.png
deleted file mode 100644 (file)
index fdf4f82..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/binary.png and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/browser.gif b/org.argeo.cms.ui.workbench/icons/browser.gif
deleted file mode 100644 (file)
index 6c7320c..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/browser.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/bundles.gif b/org.argeo.cms.ui.workbench/icons/bundles.gif
deleted file mode 100644 (file)
index e9a6bd9..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/bundles.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/changePassword.gif b/org.argeo.cms.ui.workbench/icons/changePassword.gif
deleted file mode 100644 (file)
index 274a850..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/changePassword.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/clear.gif b/org.argeo.cms.ui.workbench/icons/clear.gif
deleted file mode 100644 (file)
index 6bc10f9..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/clear.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/close-all.png b/org.argeo.cms.ui.workbench/icons/close-all.png
deleted file mode 100644 (file)
index 85d4d42..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/close-all.png and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/commit.gif b/org.argeo.cms.ui.workbench/icons/commit.gif
deleted file mode 100755 (executable)
index 876f3eb..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/commit.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/delete.png b/org.argeo.cms.ui.workbench/icons/delete.png
deleted file mode 100644 (file)
index 66d1cd7..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/delete.png and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/dumpNode.gif b/org.argeo.cms.ui.workbench/icons/dumpNode.gif
deleted file mode 100644 (file)
index 14eb1be..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/dumpNode.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/file.gif b/org.argeo.cms.ui.workbench/icons/file.gif
deleted file mode 100644 (file)
index ef30288..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/file.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/folder.gif b/org.argeo.cms.ui.workbench/icons/folder.gif
deleted file mode 100644 (file)
index 42e027c..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/folder.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/getSize.gif b/org.argeo.cms.ui.workbench/icons/getSize.gif
deleted file mode 100644 (file)
index b05bf3e..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/getSize.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/group.png b/org.argeo.cms.ui.workbench/icons/group.png
deleted file mode 100644 (file)
index cc6683a..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/group.png and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/home.gif b/org.argeo.cms.ui.workbench/icons/home.gif
deleted file mode 100644 (file)
index fd0c669..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/home.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/home.png b/org.argeo.cms.ui.workbench/icons/home.png
deleted file mode 100644 (file)
index 5eb0967..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/home.png and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/import_fs.png b/org.argeo.cms.ui.workbench/icons/import_fs.png
deleted file mode 100644 (file)
index d7c890c..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/import_fs.png and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/installed.gif b/org.argeo.cms.ui.workbench/icons/installed.gif
deleted file mode 100644 (file)
index 2988716..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/installed.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/log.gif b/org.argeo.cms.ui.workbench/icons/log.gif
deleted file mode 100644 (file)
index e3ecc55..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/log.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/maintenance.gif b/org.argeo.cms.ui.workbench/icons/maintenance.gif
deleted file mode 100644 (file)
index e5690ec..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/maintenance.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/node.gif b/org.argeo.cms.ui.workbench/icons/node.gif
deleted file mode 100644 (file)
index 364c0e7..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/node.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/nodes.gif b/org.argeo.cms.ui.workbench/icons/nodes.gif
deleted file mode 100644 (file)
index bba3dbc..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/nodes.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/osgi_explorer.gif b/org.argeo.cms.ui.workbench/icons/osgi_explorer.gif
deleted file mode 100644 (file)
index e9a6bd9..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/osgi_explorer.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/password.gif b/org.argeo.cms.ui.workbench/icons/password.gif
deleted file mode 100644 (file)
index a6b251f..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/password.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/person-logged-in.png b/org.argeo.cms.ui.workbench/icons/person-logged-in.png
deleted file mode 100644 (file)
index 87acc14..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/person-logged-in.png and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/person.png b/org.argeo.cms.ui.workbench/icons/person.png
deleted file mode 100644 (file)
index 7d979a5..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/person.png and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/query.png b/org.argeo.cms.ui.workbench/icons/query.png
deleted file mode 100644 (file)
index 54c089d..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/query.png and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/refresh.png b/org.argeo.cms.ui.workbench/icons/refresh.png
deleted file mode 100644 (file)
index 71b3481..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/refresh.png and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/remote_connected.gif b/org.argeo.cms.ui.workbench/icons/remote_connected.gif
deleted file mode 100644 (file)
index 1492b4e..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/remote_connected.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/remote_disconnected.gif b/org.argeo.cms.ui.workbench/icons/remote_disconnected.gif
deleted file mode 100644 (file)
index 6c54da9..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/remote_disconnected.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/remove.gif b/org.argeo.cms.ui.workbench/icons/remove.gif
deleted file mode 100644 (file)
index 0ae6dec..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/remove.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/removePrivileges.gif b/org.argeo.cms.ui.workbench/icons/removePrivileges.gif
deleted file mode 100644 (file)
index aa78fd2..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/removePrivileges.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/rename.gif b/org.argeo.cms.ui.workbench/icons/rename.gif
deleted file mode 100644 (file)
index 8048405..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/rename.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/repositories.gif b/org.argeo.cms.ui.workbench/icons/repositories.gif
deleted file mode 100644 (file)
index c13bea1..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/repositories.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/repository_connected.gif b/org.argeo.cms.ui.workbench/icons/repository_connected.gif
deleted file mode 100644 (file)
index a15fa55..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/repository_connected.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/repository_disconnected.gif b/org.argeo.cms.ui.workbench/icons/repository_disconnected.gif
deleted file mode 100644 (file)
index 4576dc5..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/repository_disconnected.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/resolved.gif b/org.argeo.cms.ui.workbench/icons/resolved.gif
deleted file mode 100644 (file)
index f4a1ea1..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/resolved.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/role.gif b/org.argeo.cms.ui.workbench/icons/role.gif
deleted file mode 100644 (file)
index 274a850..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/role.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/rollback.gif b/org.argeo.cms.ui.workbench/icons/rollback.gif
deleted file mode 100755 (executable)
index c753995..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/rollback.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/save-all.png b/org.argeo.cms.ui.workbench/icons/save-all.png
deleted file mode 100644 (file)
index b68a29b..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/save-all.png and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/save.gif b/org.argeo.cms.ui.workbench/icons/save.gif
deleted file mode 100644 (file)
index 654ad7b..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/save.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/save.png b/org.argeo.cms.ui.workbench/icons/save.png
deleted file mode 100644 (file)
index f27ef2d..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/save.png and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/save_security.png b/org.argeo.cms.ui.workbench/icons/save_security.png
deleted file mode 100644 (file)
index ca41dc9..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/save_security.png and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/save_security_disabled.png b/org.argeo.cms.ui.workbench/icons/save_security_disabled.png
deleted file mode 100644 (file)
index fb7d08d..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/save_security_disabled.png and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/security.gif b/org.argeo.cms.ui.workbench/icons/security.gif
deleted file mode 100644 (file)
index 57fb95e..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/security.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/service_published.gif b/org.argeo.cms.ui.workbench/icons/service_published.gif
deleted file mode 100644 (file)
index 17f771a..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/service_published.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/service_referenced.gif b/org.argeo.cms.ui.workbench/icons/service_referenced.gif
deleted file mode 100644 (file)
index c24a95f..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/service_referenced.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/sort.gif b/org.argeo.cms.ui.workbench/icons/sort.gif
deleted file mode 100644 (file)
index 23c5d0b..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/sort.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/starting.gif b/org.argeo.cms.ui.workbench/icons/starting.gif
deleted file mode 100644 (file)
index 563743d..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/starting.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/sync.gif b/org.argeo.cms.ui.workbench/icons/sync.gif
deleted file mode 100644 (file)
index b4fa052..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/sync.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/user.gif b/org.argeo.cms.ui.workbench/icons/user.gif
deleted file mode 100644 (file)
index 90a0014..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/user.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/users.gif b/org.argeo.cms.ui.workbench/icons/users.gif
deleted file mode 100644 (file)
index 2de7edd..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/users.gif and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/workgroup.png b/org.argeo.cms.ui.workbench/icons/workgroup.png
deleted file mode 100644 (file)
index 7fef996..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/workgroup.png and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/workgroup.xcf b/org.argeo.cms.ui.workbench/icons/workgroup.xcf
deleted file mode 100644 (file)
index f517c82..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/workgroup.xcf and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/workspace_connected.png b/org.argeo.cms.ui.workbench/icons/workspace_connected.png
deleted file mode 100644 (file)
index 0430baa..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/workspace_connected.png and /dev/null differ
diff --git a/org.argeo.cms.ui.workbench/icons/workspace_disconnected.png b/org.argeo.cms.ui.workbench/icons/workspace_disconnected.png
deleted file mode 100644 (file)
index fddcb8c..0000000
Binary files a/org.argeo.cms.ui.workbench/icons/workspace_disconnected.png and /dev/null differ
index 758a9e339ea48439255d7211c7272581a4cd59db..078c21d4613f250a4b21dbc78cd6c4b29f424a47 100644 (file)
@@ -6,32 +6,32 @@
       <perspective
             id="org.argeo.cms.ui.workbench.adminSecurityPerspective"
             class="org.argeo.cms.ui.workbench.SecurityAdminPerspective"
-            icon="icons/group.png"
+            icon="platform:/plugin/org.argeo.cms.ui.theme/platform:/plugin/org.argeo.cms.ui.theme/icons/group.png"
             name="Security">
       </perspective>
       <perspective
             id="org.argeo.cms.ui.workbench.userHomePerspective"
             class="org.argeo.cms.ui.workbench.UserHomePerspective"
-            icon="icons/home.png"
+            icon="platform:/plugin/org.argeo.cms.ui.theme/platform:/plugin/org.argeo.cms.ui.theme/icons/home.png"
             name="Home">
       </perspective>
       <perspective
             id="org.argeo.cms.ui.workbench.adminMaintenancePerspective"
             class="org.argeo.cms.ui.workbench.MaintenancePerspective"
-            icon="icons/maintenance.gif"
+            icon="platform:/plugin/org.argeo.cms.ui.theme/platform:/plugin/org.argeo.cms.ui.theme/icons/maintenance.gif"
             name="Maintenance">
       </perspective>
       <perspective
             id="org.argeo.cms.ui.workbench.osgiPerspective"
             class="org.argeo.cms.ui.workbench.OsgiExplorerPerspective"
             name="Monitoring"
-            icon="icons/osgi_explorer.gif">
+            icon="platform:/plugin/org.argeo.cms.ui.theme/platform:/plugin/org.argeo.cms.ui.theme/icons/osgi_explorer.gif">
       </perspective>
       <perspective
             id="org.argeo.cms.ui.workbench.jcrBrowserPerspective"
             class="org.argeo.cms.ui.workbench.JcrBrowserPerspective"
             name="Data Explorer"
-            icon="icons/nodes.gif">
+            icon="platform:/plugin/org.argeo.cms.ui.theme/icons/nodes.gif">
       </perspective>
    </extension>
    
                <view
                        id="org.argeo.cms.ui.workbench.usersView"
                        class="org.argeo.eclipse.spring.SpringExtensionFactory"
-                       icon="icons/person.png"
+                       icon="platform:/plugin/org.argeo.cms.ui.theme/icons/person.png"
                        name="Users"
                        restorable="true">
                </view>
                <view
                        class="org.argeo.eclipse.spring.SpringExtensionFactory"
-                       icon="icons/group.png"
+                       icon="platform:/plugin/org.argeo.cms.ui.theme/icons/group.png"
                        id="org.argeo.cms.ui.workbench.groupsView"
                        name="Groups"
                        restorable="false">
@@ -85,7 +85,7 @@
                <view
                        id="org.argeo.cms.ui.workbench.userProfile"
                        class="org.argeo.cms.ui.workbench.useradmin.UserProfile"
-                       icon="icons/person-logged-in.png"
+                       icon="platform:/plugin/org.argeo.cms.ui.theme/icons/person-logged-in.png"
                        name="Profile"
                        restorable="true">
                </view>
                        id="org.argeo.cms.ui.workbench.logView"
                        class="org.argeo.eclipse.spring.SpringExtensionFactory"
                        name="Log"
-                       icon="icons/log.gif"
+                       icon="platform:/plugin/org.argeo.cms.ui.theme/icons/log.gif"
                        restorable="true">
                </view>
                <view
             id="org.argeo.cms.ui.workbench.adminLogView"
             class="org.argeo.eclipse.spring.SpringExtensionFactory"
             name="Admin Log"
-            icon="icons/adminLog.gif"
+            icon="platform:/plugin/org.argeo.cms.ui.theme/icons/adminLog.gif"
             restorable="true">
                </view>
                <!-- OSGi Monitor -->
                <view
                name="Modules"
             id="org.argeo.cms.ui.workbench.modulesView"
-            icon="icons/service_published.gif"
+            icon="platform:/plugin/org.argeo.cms.ui.theme/icons/service_published.gif"
                        class="org.argeo.cms.ui.workbench.osgi.ModulesView">
                </view>
                <view
                name="CMS Session"
             id="org.argeo.cms.ui.workbench.cmsSessionsView"
-            icon="icons/service_published.gif"
+            icon="platform:/plugin/org.argeo.cms.ui.theme/icons/service_published.gif"
                        class="org.argeo.cms.ui.workbench.osgi.CmsSessionsView">
                </view>
                <view
                name="Bundles"
             id="org.argeo.cms.ui.workbench.bundlesView" 
-            icon="icons/bundles.gif"
+            icon="platform:/plugin/org.argeo.cms.ui.theme/icons/bundles.gif"
             class="org.argeo.cms.ui.workbench.osgi.BundlesView">
                </view>
                <view
                name="Multiple Packages"
             id="org.argeo.cms.ui.workbench.multiplePackagesView" 
-            icon="icons/node.gif"
+            icon="platform:/plugin/org.argeo.cms.ui.theme/icons/node.gif"
             class="org.argeo.cms.ui.workbench.osgi.MultiplePackagesView">
                </view>
                <!-- Data Explorer -->
                <view
           name="JCR"
           id="org.argeo.cms.ui.workbench.jcrBrowserView"
-          icon="icons/browser.gif"
+          icon="platform:/plugin/org.argeo.cms.ui.theme/icons/browser.gif"
           class="org.argeo.eclipse.spring.SpringExtensionFactory">
           </view>
                <view
           name="Files"
           id="org.argeo.cms.ui.workbench.nodeFsBrowserView"
-          icon="icons/browser.gif"
+          icon="platform:/plugin/org.argeo.cms.ui.theme/icons/browser.gif"
           class="org.argeo.eclipse.spring.SpringExtensionFactory">
           </view>
     </extension> 
                        class="org.argeo.eclipse.spring.SpringExtensionFactory"
             id="org.argeo.cms.ui.workbench.userEditor"
             name="User"
-            icon="icons/person.png"
+            icon="platform:/plugin/org.argeo.cms.ui.theme/icons/person.png"
             default="false">
                </editor>
                <editor
                        class="org.argeo.eclipse.spring.SpringExtensionFactory"
             id="org.argeo.cms.ui.workbench.groupEditor"
             name="User"
-            icon="icons/group.png"
+            icon="platform:/plugin/org.argeo.cms.ui.theme/icons/group.png"
             default="false">
                </editor>
                <!-- Data Explorer -->
                <editor
                        name="JCR Query"
                        id="org.argeo.cms.ui.workbench.genericJcrQueryEditor"
-                       icon="icons/query.png"
+                       icon="platform:/plugin/org.argeo.cms.ui.theme/icons/query.png"
                        class="org.argeo.eclipse.spring.SpringExtensionFactory"
                        default="false">
         </editor>
                <editor
                        name="Node Editor"
             id="org.argeo.cms.ui.workbench.defaultNodeEditor"
-                       icon="icons/query.png"
+                       icon="platform:/plugin/org.argeo.cms.ui.theme/icons/query.png"
                        class="org.argeo.eclipse.spring.SpringExtensionFactory"
                        default="false">
                </editor>
                <toolbar id="org.argeo.cms.ui.workbench.userToolbar">
                                <command
                                        commandId="org.argeo.cms.ui.workbench.rap.mainMenuCommand"
-                                       icon="icons/home.png"
+                                       icon="platform:/plugin/org.argeo.cms.ui.theme/icons/home.png"
                                        id="org.argeo.cms.ui.workbench.rap.mainMenu"
                                        style="pulldown">
                                </command>
-                               <command commandId="org.eclipse.ui.file.save" icon="icons/save.png"/>
-                               <command commandId="org.eclipse.ui.file.saveAll" icon="icons/save-all.png"/>
+                               <command commandId="org.eclipse.ui.file.save" icon="platform:/plugin/org.argeo.cms.ui.theme/icons/save.png"/>
+                               <command commandId="org.eclipse.ui.file.saveAll" icon="platform:/plugin/org.argeo.cms.ui.theme/icons/save-all.png"/>
                        </toolbar>
                </menuContribution>
                -->
                        <!-- Transaction management --> 
                        <command
                                commandId="org.argeo.cms.ui.workbench.userTransactionHandler"
-                               icon="icons/commit.gif"
+                               icon="platform:/plugin/org.argeo.cms.ui.theme/icons/commit.gif"
                                label="Commit Transaction"
                                style="push"
                                tooltip="Commit a user transaction">
                        </command>
                        <command
                                commandId="org.argeo.cms.ui.workbench.userTransactionHandler"
-                               icon="icons/rollback.gif"
+                               icon="platform:/plugin/org.argeo.cms.ui.theme/icons/rollback.gif"
                                label="Rollback Transaction"
                                style="push"
                                tooltip="Abandon current changes and rollback to the latest commited version">
             locationURI="toolbar:org.argeo.cms.ui.workbench.usersView">
             <command
                   commandId="org.argeo.cms.ui.workbench.deleteUsers"
-                  icon="icons/delete.png"
+                  icon="platform:/plugin/org.argeo.cms.ui.theme/icons/delete.png"
                   label="Delete"
                   tooltip="Delete selected users">
             </command>
             <command
                   commandId="org.argeo.cms.ui.workbench.forceRefresh"
-                  icon="icons/refresh.png"
+                  icon="platform:/plugin/org.argeo.cms.ui.theme/icons/refresh.png"
                   label="Refresh"
                   tooltip="Force the full refresh of the user list">
             </command>
             <command
                   commandId="org.argeo.cms.ui.workbench.newUser"
-                  icon="icons/add.png"
+                  icon="platform:/plugin/org.argeo.cms.ui.theme/icons/add.png"
                   label="Add"
                   tooltip="Create a new user">
             </command>
             <command
                   commandId="org.argeo.cms.ui.workbench.userBatchUpdate"
-                  icon="icons/batch.gif"
+                  icon="platform:/plugin/org.argeo.cms.ui.theme/icons/batch.gif"
                   label="Update users"
                   tooltip="Perform maintenance activities on a list of chosen users">
             </command>
             locationURI="toolbar:org.argeo.cms.ui.workbench.groupsView">
             <command
                   commandId="org.argeo.cms.ui.workbench.deleteGroups"
-                  icon="icons/delete.png"
+                  icon="platform:/plugin/org.argeo.cms.ui.theme/icons/delete.png"
                   label="Delete Group"
                   tooltip="Delete selected groups">
             </command>
             <command
                   commandId="org.argeo.cms.ui.workbench.forceRefresh"
-                  icon="icons/refresh.png"
+                  icon="platform:/plugin/org.argeo.cms.ui.theme/icons/refresh.png"
                   label="Refresh list"
                   tooltip="Force the full refresh of the group list">
             </command>
             <command
                   commandId="org.argeo.cms.ui.workbench.newGroup"
-                  icon="icons/add.png"
+                  icon="platform:/plugin/org.argeo.cms.ui.theme/icons/add.png"
                   label="Add Group"
                   tooltip="Create a new group">
             </command>
             <!-- See bug 149 --> 
             <!-- <command
                commandId="org.argeo.cms.ui.workbench.openGenericJcrQueryEditor"
-                icon="icons/query.png"
+                icon="platform:/plugin/org.argeo.cms.ui.theme/icons/query.png"
                 style="push">
             </command> --> 
             <command
                commandId="org.argeo.cms.ui.workbench.addRemoteRepository"
-                icon="icons/addRepo.gif"
+                icon="platform:/plugin/org.argeo.cms.ui.theme/icons/addRepo.gif"
                 style="push">
             </command>
              <command
                commandId="org.argeo.cms.ui.workbench.sortChildNodes"
-                icon="icons/sort.gif"
+                icon="platform:/plugin/org.argeo.cms.ui.theme/icons/sort.gif"
                 style="toggle"
                 label="Sort child nodes"
                 tooltip="NOTE: displaying unsorted nodes will enhance overall performances">
                        locationURI="popup:org.argeo.cms.ui.workbench.jcrBrowserView">
                        <command
                                commandId="org.argeo.cms.ui.workbench.refresh"
-                               icon="icons/refresh.png"
+                               icon="platform:/plugin/org.argeo.cms.ui.theme/icons/refresh.png"
                                style="push">
                        </command>
                        <command
                         commandId="org.argeo.cms.ui.workbench.addFolderNode"
-                        icon="icons/addFolder.gif"
+                        icon="platform:/plugin/org.argeo.cms.ui.theme/icons/addFolder.gif"
                         label="Add Folder..."
                         style="push">
                                <visibleWhen>
                        </command>
                        <command
                         commandId="org.argeo.cms.ui.workbench.addPrivileges"
-                        icon="icons/addPrivileges.gif"
+                        icon="platform:/plugin/org.argeo.cms.ui.theme/icons/addPrivileges.gif"
                         label="Add Privileges..."
                         style="push">
                                <visibleWhen>
                        </command>
                        <command
                         commandId="org.argeo.cms.ui.workbench.removePrivileges"
-                        icon="icons/removePrivileges.gif"
+                        icon="platform:/plugin/org.argeo.cms.ui.theme/icons/removePrivileges.gif"
                         label="Remove Privileges..."
                         style="push">
                                <visibleWhen>
                        </command>
                        <command
                         commandId="org.argeo.cms.ui.workbench.createWorkspace"
-                        icon="icons/addWorkspace.png"
+                        icon="platform:/plugin/org.argeo.cms.ui.theme/icons/addWorkspace.png"
                         label="Create Workspace..."
                         style="push">
                                <visibleWhen>
                        </command>
                        <command
                                commandId="org.argeo.cms.ui.workbench.deleteNodes"
-                               icon="icons/remove.gif"
+                               icon="platform:/plugin/org.argeo.cms.ui.theme/icons/remove.gif"
                                label="Delete Nodes"
                                style="push">
                                <visibleWhen>
                        </command>
                        <command
                                commandId="org.argeo.cms.ui.workbench.uploadFiles"
-                               icon="icons/import_fs.png"
+                               icon="platform:/plugin/org.argeo.cms.ui.theme/icons/import_fs.png"
                                style="push"
                                tooltip="Upload files from the local file sytem">
                                <visibleWhen>
                        </command>
                        <command
                                commandId="org.argeo.cms.ui.workbench.addRemoteRepository"
-                               icon="icons/addRepo.gif"
+                               icon="platform:/plugin/org.argeo.cms.ui.theme/icons/addRepo.gif"
                                style="push">
                                        <visibleWhen>
                                                <iterate> 
                        </command>
                        <command
                                commandId="org.argeo.cms.ui.workbench.removeRemoteRepository"
-                               icon="icons/remove.gif"
+                               icon="platform:/plugin/org.argeo.cms.ui.theme/icons/remove.gif"
                                style="push">
                                <visibleWhen>
                                        <iterate> 
                        </command>
                        <command
                                commandId="org.argeo.cms.ui.workbench.getNodeSize"
-                               icon="icons/getSize.gif"
+                               icon="platform:/plugin/org.argeo.cms.ui.theme/icons/getSize.gif"
                                style="push">
                                        <visibleWhen>
                                                <iterate>
                        </command>
                        <command
                        commandId="org.argeo.cms.ui.workbench.dumpNode"
-                       icon="icons/dumpNode.gif"
+                       icon="platform:/plugin/org.argeo.cms.ui.theme/icons/dumpNode.gif"
                                label="Dump Node"
                                style="push">
                                <visibleWhen>
                        </command>
                        <command
                        commandId="org.argeo.cms.ui.workbench.renameNode"
-                       icon="icons/rename.gif"
+                       icon="platform:/plugin/org.argeo.cms.ui.theme/icons/rename.gif"
                                label="Rename..."
                                style="push">
                                <visibleWhen>
                        </command>
                        <command
                        commandId="org.argeo.cms.ui.workbench.nodeConfigurableDump"
-                       icon="icons/dumpNode.gif"
+                       icon="platform:/plugin/org.argeo.cms.ui.theme/icons/dumpNode.gif"
                                label="Configurable dump..."
                                style="push">
                                <visibleWhen>
index 441d5d10afe06a4876792de838e4b0bd7985b4a0..8cfb0e8f7a7711e788a3b16db2b9ed7e7c9b414b 100644 (file)
@@ -16,7 +16,6 @@
 package org.argeo.cms.ui.workbench.internal;
 
 /** Constants used across the application. */
+@Deprecated
 public interface WorkbenchConstants {
-       // MISCEALLENEOUS
-       public final static String DATE_TIME_FORMAT = "dd/MM/yyyy, HH:mm";
 }
diff --git a/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/DefaultRepositoryRegister.java b/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/DefaultRepositoryRegister.java
deleted file mode 100644 (file)
index c9ab946..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *         http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.argeo.cms.ui.workbench.internal.jcr;
-
-import java.util.Collections;
-import java.util.Map;
-import java.util.Observable;
-import java.util.TreeMap;
-
-import javax.jcr.Repository;
-import javax.jcr.RepositoryException;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.argeo.node.NodeConstants;
-
-public class DefaultRepositoryRegister extends Observable implements RepositoryRegister {
-       /** Key for a JCR repository alias */
-       private final static String CN = NodeConstants.CN;
-       /** Key for a JCR repository URI */
-       // public final static String JCR_REPOSITORY_URI = "argeo.jcr.repository.uri";
-       private final static Log log = LogFactory.getLog(DefaultRepositoryRegister.class);
-
-       /** Read only map which will be directly exposed. */
-       private Map<String, Repository> repositories = Collections.unmodifiableMap(new TreeMap<String, Repository>());
-
-       @SuppressWarnings("rawtypes")
-       public synchronized Repository getRepository(Map parameters) throws RepositoryException {
-               if (!parameters.containsKey(CN))
-                       throw new RepositoryException("Parameter " + CN + " has to be defined.");
-               String alias = parameters.get(CN).toString();
-               if (!repositories.containsKey(alias))
-                       throw new RepositoryException("No repository registered with alias " + alias);
-
-               return repositories.get(alias);
-       }
-
-       /** Access to the read-only map */
-       public synchronized Map<String, Repository> getRepositories() {
-               return repositories;
-       }
-
-       /** Registers a service, typically called when OSGi services are bound. */
-       @SuppressWarnings("rawtypes")
-       public synchronized void register(Repository repository, Map properties) {
-               String alias;
-               if (properties == null || !properties.containsKey(CN)) {
-                       log.warn("Cannot register a repository if no " + CN + " property is specified.");
-                       return;
-               }
-               alias = properties.get(CN).toString();
-               Map<String, Repository> map = new TreeMap<String, Repository>(repositories);
-               map.put(alias, repository);
-               repositories = Collections.unmodifiableMap(map);
-               setChanged();
-               notifyObservers(alias);
-       }
-
-       /** Unregisters a service, typically called when OSGi services are unbound. */
-       @SuppressWarnings("rawtypes")
-       public synchronized void unregister(Repository repository, Map properties) {
-               // TODO: also check bean name?
-               if (properties == null || !properties.containsKey(CN)) {
-                       log.warn("Cannot unregister a repository without property " + CN);
-                       return;
-               }
-
-               String alias = properties.get(CN).toString();
-               Map<String, Repository> map = new TreeMap<String, Repository>(repositories);
-               if (map.remove(alias) == null) {
-                       log.warn("No repository was registered with alias " + alias);
-                       return;
-               }
-               repositories = Collections.unmodifiableMap(map);
-               setChanged();
-               notifyObservers(alias);
-       }
-}
diff --git a/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/FullVersioningTreeContentProvider.java b/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/FullVersioningTreeContentProvider.java
deleted file mode 100644 (file)
index 148605b..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *         http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.argeo.cms.ui.workbench.internal.jcr;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-import javax.jcr.nodetype.NodeType;
-import javax.jcr.version.Version;
-import javax.jcr.version.VersionHistory;
-import javax.jcr.version.VersionIterator;
-import javax.jcr.version.VersionManager;
-
-import org.argeo.eclipse.ui.EclipseUiException;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-
-/**
- * Display some version information of a JCR full versionable node in a tree
- * like structure
- */
-public class FullVersioningTreeContentProvider implements ITreeContentProvider {
-       private static final long serialVersionUID = 8691772509491211112L;
-
-       /**
-        * Sends back the first level of the Tree. input element must be a single
-        * node object
-        */
-       public Object[] getElements(Object inputElement) {
-               try {
-                       Node rootNode = (Node) inputElement;
-                       String curPath = rootNode.getPath();
-                       VersionManager vm = rootNode.getSession().getWorkspace()
-                                       .getVersionManager();
-
-                       VersionHistory vh = vm.getVersionHistory(curPath);
-                       List<Version> result = new ArrayList<Version>();
-                       VersionIterator vi = vh.getAllLinearVersions();
-
-                       while (vi.hasNext()) {
-                               result.add(vi.nextVersion());
-                       }
-                       return result.toArray();
-               } catch (RepositoryException re) {
-                       throw new EclipseUiException(
-                                       "Unexpected error while getting version elements", re);
-               }
-       }
-
-       public Object[] getChildren(Object parentElement) {
-               try {
-                       if (parentElement instanceof Version) {
-                               List<Node> tmp = new ArrayList<Node>();
-                               tmp.add(((Version) parentElement).getFrozenNode());
-                               return tmp.toArray();
-                       }
-               } catch (RepositoryException re) {
-                       throw new EclipseUiException("Unexpected error while getting child "
-                                       + "node for version element", re);
-               }
-               return null;
-       }
-
-       public Object getParent(Object element) {
-               try {
-                       // this will not work in a simpleVersionning environment, parent is
-                       // not a node.
-                       if (element instanceof Node
-                                       && ((Node) element).isNodeType(NodeType.NT_FROZEN_NODE)) {
-                               Node node = (Node) element;
-                               return node.getParent();
-                       } else
-                               return null;
-               } catch (RepositoryException e) {
-                       return null;
-               }
-       }
-
-       public boolean hasChildren(Object element) {
-               try {
-                       if (element instanceof Version)
-                               return true;
-                       else if (element instanceof Node)
-                               return ((Node) element).hasNodes();
-                       else
-                               return false;
-               } catch (RepositoryException e) {
-                       throw new EclipseUiException("Cannot check children of " + element, e);
-               }
-       }
-
-       public void dispose() {
-       }
-
-       public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-       }
-
-}
diff --git a/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/JcrBrowserUtils.java b/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/JcrBrowserUtils.java
deleted file mode 100644 (file)
index 9755d95..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *         http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.argeo.cms.ui.workbench.internal.jcr;
-
-import javax.jcr.Node;
-import javax.jcr.Property;
-import javax.jcr.PropertyType;
-import javax.jcr.RepositoryException;
-
-import org.argeo.cms.ui.workbench.internal.jcr.model.RepositoriesElem;
-import org.argeo.cms.ui.workbench.internal.jcr.model.RepositoryElem;
-import org.argeo.cms.ui.workbench.internal.jcr.model.SingleJcrNodeElem;
-import org.argeo.cms.ui.workbench.internal.jcr.model.WorkspaceElem;
-import org.argeo.eclipse.ui.EclipseUiException;
-import org.argeo.eclipse.ui.TreeParent;
-
-/** Useful methods to manage the JCR Browser */
-public class JcrBrowserUtils {
-
-       public static String getPropertyTypeAsString(Property prop) {
-               try {
-                       return PropertyType.nameFromValue(prop.getType());
-               } catch (RepositoryException e) {
-                       throw new EclipseUiException("Cannot check type for " + prop, e);
-               }
-       }
-
-       /** Insure that the UI component is not stale, refresh if needed */
-       public static void forceRefreshIfNeeded(TreeParent element) {
-               Node curNode = null;
-
-               boolean doRefresh = false;
-
-               try {
-                       if (element instanceof SingleJcrNodeElem) {
-                               curNode = ((SingleJcrNodeElem) element).getNode();
-                       } else if (element instanceof WorkspaceElem) {
-                               curNode = ((WorkspaceElem) element).getRootNode();
-                       }
-
-                       if (curNode != null && element.getChildren().length != curNode.getNodes().getSize())
-                               doRefresh = true;
-                       else if (element instanceof RepositoryElem) {
-                               RepositoryElem rn = (RepositoryElem) element;
-                               if (rn.isConnected()) {
-                                       String[] wkpNames = rn.getAccessibleWorkspaceNames();
-                                       if (element.getChildren().length != wkpNames.length)
-                                               doRefresh = true;
-                               }
-                       } else if (element instanceof RepositoriesElem) {
-                               doRefresh = true;
-                               // Always force refresh for RepositoriesElem : the condition
-                               // below does not take remote repository into account and it is
-                               // not trivial to do so.
-
-                               // RepositoriesElem rn = (RepositoriesElem) element;
-                               // if (element.getChildren().length !=
-                               // rn.getRepositoryRegister()
-                               // .getRepositories().size())
-                               // doRefresh = true;
-                       }
-                       if (doRefresh) {
-                               element.clearChildren();
-                               element.getChildren();
-                       }
-               } catch (RepositoryException re) {
-                       throw new EclipseUiException("Unexpected error while synchronising the UI with the JCR repository", re);
-               }
-       }
-}
diff --git a/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/JcrDClickListener.java b/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/JcrDClickListener.java
deleted file mode 100644 (file)
index cbd9928..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *         http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.argeo.cms.ui.workbench.internal.jcr;
-
-import static javax.jcr.Node.JCR_CONTENT;
-import static javax.jcr.Property.JCR_DATA;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.jcr.Binary;
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-import javax.jcr.nodetype.NodeType;
-
-import org.apache.commons.io.IOUtils;
-import org.argeo.cms.ui.workbench.WorkbenchUiPlugin;
-import org.argeo.cms.ui.workbench.internal.jcr.model.RepositoryElem;
-import org.argeo.cms.ui.workbench.internal.jcr.model.SingleJcrNodeElem;
-import org.argeo.cms.ui.workbench.internal.jcr.model.WorkspaceElem;
-import org.argeo.cms.ui.workbench.internal.jcr.parts.GenericNodeEditorInput;
-import org.argeo.cms.ui.workbench.jcr.DefaultNodeEditor;
-import org.argeo.cms.ui.workbench.util.CommandUtils;
-import org.argeo.eclipse.ui.EclipseUiException;
-import org.argeo.eclipse.ui.specific.OpenFile;
-import org.argeo.eclipse.ui.specific.SingleSourcingException;
-import org.argeo.jcr.JcrUtils;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.ui.PartInitException;
-
-/** Centralizes the management of double click on a NodeTreeViewer */
-public class JcrDClickListener implements IDoubleClickListener {
-       // private final static Log log = LogFactory
-       // .getLog(GenericNodeDoubleClickListener.class);
-
-       private TreeViewer nodeViewer;
-
-       // private JcrFileProvider jfp;
-       // private FileHandler fileHandler;
-
-       public JcrDClickListener(TreeViewer nodeViewer) {
-               this.nodeViewer = nodeViewer;
-               // jfp = new JcrFileProvider();
-               // Commented out. see https://www.argeo.org/bugzilla/show_bug.cgi?id=188
-               // fileHandler = null;
-               // fileHandler = new FileHandler(jfp);
-       }
-
-       public void doubleClick(DoubleClickEvent event) {
-               if (event.getSelection() == null || event.getSelection().isEmpty())
-                       return;
-               Object obj = ((IStructuredSelection) event.getSelection()).getFirstElement();
-               if (obj instanceof RepositoryElem) {
-                       RepositoryElem rpNode = (RepositoryElem) obj;
-                       if (rpNode.isConnected()) {
-                               rpNode.logout();
-                       } else {
-                               rpNode.login();
-                       }
-                       nodeViewer.refresh(obj);
-               } else if (obj instanceof WorkspaceElem) {
-                       WorkspaceElem wn = (WorkspaceElem) obj;
-                       if (wn.isConnected())
-                               wn.logout();
-                       else
-                               wn.login();
-                       nodeViewer.refresh(obj);
-               } else if (obj instanceof SingleJcrNodeElem) {
-                       SingleJcrNodeElem sjn = (SingleJcrNodeElem) obj;
-                       Node node = sjn.getNode();
-                       try {
-                               if (node.isNodeType(NodeType.NT_FILE)) {
-                                       // Also open it
-
-                                       String name = node.getName();
-                                       Map<String, String> params = new HashMap<String, String>();
-                                       params.put(OpenFile.PARAM_FILE_NAME, name);
-
-                                       // TODO rather directly transmit the path to the node, once
-                                       // we have defined convention to provide an Absolute URI to
-                                       // a node in a multi repo / workspace / user context
-                                       // params.put(OpenFile.PARAM_FILE_URI,
-                                       // OpenFileService.JCR_SCHEME + node.getPath());
-
-                                       // we copy the node to a tmp file to be opened as a dirty
-                                       // workaround
-                                       File tmpFile = null;
-                                       // OutputStream os = null;
-                                       // InputStream is = null;
-                                       int i = name.lastIndexOf('.');
-                                       String prefix, suffix;
-                                       if (i == -1) {
-                                               prefix = name;
-                                               suffix = null;
-                                       } else {
-                                               prefix = name.substring(0, i);
-                                               suffix = name.substring(i);
-                                       }
-                                       Binary binary = null;
-                                       try {
-                                               tmpFile = File.createTempFile(prefix, suffix);
-                                               tmpFile.deleteOnExit();
-                                       } catch (IOException e1) {
-                                               throw new EclipseUiException("Cannot create temp file", e1);
-                                       }
-                                       try (OutputStream os = new FileOutputStream(tmpFile)) {
-                                               binary = node.getNode(JCR_CONTENT).getProperty(JCR_DATA).getBinary();
-                                               try (InputStream is = binary.getStream();) {
-                                                       IOUtils.copy(is, os);
-                                               }
-                                       } catch (IOException e) {
-                                               throw new SingleSourcingException("Cannot open file " + prefix + "." + suffix, e);
-                                       } finally {
-                                               // IOUtils.closeQuietly(is);
-                                               // IOUtils.closeQuietly(os);
-                                               JcrUtils.closeQuietly(binary);
-                                       }
-                                       Path path = Paths.get(tmpFile.getAbsolutePath());
-                                       String uri = path.toUri().toString();
-                                       params.put(OpenFile.PARAM_FILE_URI, uri);
-                                       CommandUtils.callCommand(OpenFile.ID, params);
-                               }
-                               GenericNodeEditorInput gnei = new GenericNodeEditorInput(node);
-                               WorkbenchUiPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage()
-                                               .openEditor(gnei, DefaultNodeEditor.ID);
-                       } catch (RepositoryException re) {
-                               throw new EclipseUiException("Repository error while getting node info", re);
-                       } catch (PartInitException pie) {
-                               throw new EclipseUiException("Unexepected exception while opening node editor", pie);
-                       }
-               }
-       }
-}
diff --git a/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/JcrTreeContentProvider.java b/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/JcrTreeContentProvider.java
deleted file mode 100644 (file)
index 599da9b..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *         http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.argeo.cms.ui.workbench.internal.jcr;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import javax.jcr.Node;
-import javax.jcr.NodeIterator;
-import javax.jcr.RepositoryException;
-
-import org.argeo.eclipse.ui.EclipseUiException;
-import org.argeo.eclipse.ui.jcr.utils.JcrItemsComparator;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-
-/**
- * Implementation of the {@code ITreeContentProvider} in order to display a
- * single JCR node and its children in a tree like structure
- */
-public class JcrTreeContentProvider implements ITreeContentProvider {
-       private static final long serialVersionUID = -2128326504754297297L;
-       // private Node rootNode;
-       private JcrItemsComparator itemComparator = new JcrItemsComparator();
-
-       /**
-        * Sends back the first level of the Tree. input element must be a single
-        * node object
-        */
-       public Object[] getElements(Object inputElement) {
-               try {
-                       Node rootNode = (Node) inputElement;
-                       List<Node> result = new ArrayList<Node>();
-                       NodeIterator ni = rootNode.getNodes();
-                       while (ni.hasNext())
-                               result.add(ni.nextNode());
-                       return result.toArray();
-               } catch (RepositoryException re) {
-                       throw new EclipseUiException("Unable to retrieve elements for " + inputElement, re);
-               }
-       }
-
-       public Object[] getChildren(Object parentElement) {
-               return childrenNodes((Node) parentElement);
-       }
-
-       public Object getParent(Object element) {
-               try {
-                       Node node = (Node) element;
-                       if (!node.getPath().equals("/"))
-                               return node.getParent();
-                       else
-                               return null;
-               } catch (RepositoryException e) {
-                       return null;
-               }
-       }
-
-       public boolean hasChildren(Object element) {
-               try {
-                       return ((Node) element).hasNodes();
-               } catch (RepositoryException e) {
-                       throw new EclipseUiException("Cannot check children existence on " + element, e);
-               }
-       }
-
-       protected Object[] childrenNodes(Node parentNode) {
-               try {
-                       List<Node> children = new ArrayList<Node>();
-                       NodeIterator nit = parentNode.getNodes();
-                       while (nit.hasNext())
-                               children.add(nit.nextNode());
-                       Node[] arr = children.toArray(new Node[0]);
-                       Arrays.sort(arr, itemComparator);
-                       return arr;
-               } catch (RepositoryException e) {
-                       throw new EclipseUiException("Cannot list children of " + parentNode, e);
-               }
-       }
-
-       public void dispose() {
-       }
-
-       public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-       }
-}
diff --git a/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/NodeContentProvider.java b/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/NodeContentProvider.java
deleted file mode 100644 (file)
index fc7f16a..0000000
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *         http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.argeo.cms.ui.workbench.internal.jcr;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.List;
-
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-import javax.jcr.RepositoryFactory;
-import javax.jcr.Session;
-import javax.jcr.nodetype.NodeType;
-
-import org.argeo.cms.ui.workbench.internal.jcr.model.RepositoriesElem;
-import org.argeo.cms.ui.workbench.internal.jcr.model.SingleJcrNodeElem;
-import org.argeo.eclipse.ui.TreeParent;
-import org.argeo.node.NodeConstants;
-import org.argeo.node.NodeUtils;
-import org.argeo.node.security.Keyring;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-
-/**
- * Implementation of the {@code ITreeContentProvider} to display multiple
- * repository environment in a tree like structure
- */
-public class NodeContentProvider implements ITreeContentProvider {
-       private static final long serialVersionUID = -4083809398848374403L;
-       final private RepositoryRegister repositoryRegister;
-       final private RepositoryFactory repositoryFactory;
-
-       // Current user session on the default workspace of the argeo Node
-       final private Session userSession;
-       final private Keyring keyring;
-       private boolean sortChildren;
-
-       // Reference for cleaning
-       private SingleJcrNodeElem homeNode = null;
-       private RepositoriesElem repositoriesNode = null;
-
-       // Utils
-       private TreeBrowserComparator itemComparator = new TreeBrowserComparator();
-
-       public NodeContentProvider(Session userSession, Keyring keyring,
-                       RepositoryRegister repositoryRegister,
-                       RepositoryFactory repositoryFactory, Boolean sortChildren) {
-               this.userSession = userSession;
-               this.keyring = keyring;
-               this.repositoryRegister = repositoryRegister;
-               this.repositoryFactory = repositoryFactory;
-               this.sortChildren = sortChildren;
-       }
-
-       public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-               if (newInput == null)// dispose
-                       return;
-
-               if (userSession != null) {
-                       Node userHome = NodeUtils.getUserHome(userSession);
-                       if (userHome != null) {
-                               // TODO : find a way to dynamically get alias for the node
-                               if (homeNode != null)
-                                       homeNode.dispose();
-                               homeNode = new SingleJcrNodeElem(null, userHome,
-                                               userSession.getUserID(), NodeConstants.NODE);
-                       }
-               }
-               if (repositoryRegister != null) {
-                       if (repositoriesNode != null)
-                               repositoriesNode.dispose();
-                       repositoriesNode = new RepositoriesElem("Repositories",
-                                       repositoryRegister, repositoryFactory, null, userSession,
-                                       keyring);
-               }
-       }
-
-       /**
-        * Sends back the first level of the Tree. Independent from inputElement
-        * that can be null
-        */
-       public Object[] getElements(Object inputElement) {
-               List<Object> objs = new ArrayList<Object>();
-               if (homeNode != null)
-                       objs.add(homeNode);
-               if (repositoriesNode != null)
-                       objs.add(repositoriesNode);
-               return objs.toArray();
-       }
-
-       public Object[] getChildren(Object parentElement) {
-               if (parentElement instanceof TreeParent) {
-                       if (sortChildren) {
-                               Object[] tmpArr = ((TreeParent) parentElement).getChildren();
-                               if (tmpArr == null)
-                                       return new Object[0];
-                               TreeParent[] arr = new TreeParent[tmpArr.length];
-                               for (int i = 0; i < tmpArr.length; i++)
-                                       arr[i] = (TreeParent) tmpArr[i];
-                               Arrays.sort(arr, itemComparator);
-                               return arr;
-                       } else
-                               return ((TreeParent) parentElement).getChildren();
-               } else
-                       return new Object[0];
-       }
-
-       /**
-        * Sets whether the content provider should order the children nodes or not.
-        * It is user duty to call a full refresh of the tree after changing this
-        * parameter.
-        */
-       public void setSortChildren(boolean sortChildren) {
-               this.sortChildren = sortChildren;
-       }
-
-       public Object getParent(Object element) {
-               if (element instanceof TreeParent) {
-                       return ((TreeParent) element).getParent();
-               } else
-                       return null;
-       }
-
-       public boolean hasChildren(Object element) {
-               if (element instanceof RepositoriesElem) {
-                       RepositoryRegister rr = ((RepositoriesElem) element)
-                                       .getRepositoryRegister();
-                       return rr.getRepositories().size() > 0;
-               } else if (element instanceof TreeParent) {
-                       TreeParent tp = (TreeParent) element;
-                       return tp.hasChildren();
-               }
-               return false;
-       }
-
-       public void dispose() {
-               if (homeNode != null)
-                       homeNode.dispose();
-               if (repositoriesNode != null) {
-                       // logs out open sessions
-                       // see https://bugzilla.argeo.org/show_bug.cgi?id=23
-                       repositoriesNode.dispose();
-               }
-       }
-
-       /**
-        * Specific comparator for this view. See specification here:
-        * https://www.argeo.org/bugzilla/show_bug.cgi?id=139
-        */
-       private class TreeBrowserComparator implements Comparator<TreeParent> {
-
-               public int category(TreeParent element) {
-                       if (element instanceof SingleJcrNodeElem) {
-                               Node node = ((SingleJcrNodeElem) element).getNode();
-                               try {
-                                       if (node.isNodeType(NodeType.NT_FOLDER))
-                                               return 5;
-                               } catch (RepositoryException e) {
-                                       // TODO Auto-generated catch block
-                                       e.printStackTrace();
-                               }
-                       }
-                       return 10;
-               }
-
-               public int compare(TreeParent o1, TreeParent o2) {
-                       int cat1 = category(o1);
-                       int cat2 = category(o2);
-
-                       if (cat1 != cat2) {
-                               return cat1 - cat2;
-                       }
-                       return o1.getName().compareTo(o2.getName());
-               }
-       }
-}
diff --git a/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/NodeLabelProvider.java b/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/NodeLabelProvider.java
deleted file mode 100644 (file)
index d409812..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *         http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.argeo.cms.ui.workbench.internal.jcr;
-
-import javax.jcr.NamespaceException;
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-import javax.jcr.nodetype.NodeType;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.argeo.cms.ui.workbench.internal.jcr.model.RemoteRepositoryElem;
-import org.argeo.cms.ui.workbench.internal.jcr.model.RepositoriesElem;
-import org.argeo.cms.ui.workbench.internal.jcr.model.RepositoryElem;
-import org.argeo.cms.ui.workbench.internal.jcr.model.SingleJcrNodeElem;
-import org.argeo.cms.ui.workbench.internal.jcr.model.WorkspaceElem;
-import org.argeo.cms.ui.workbench.jcr.JcrImages;
-import org.argeo.eclipse.ui.EclipseUiException;
-import org.argeo.naming.LdapAttrs;
-import org.argeo.node.NodeTypes;
-import org.eclipse.jface.viewers.ColumnLabelProvider;
-import org.eclipse.swt.graphics.Image;
-
-/** Provides reasonable defaults for know JCR types. */
-public class NodeLabelProvider extends ColumnLabelProvider {
-       private static final long serialVersionUID = -3662051696443321843L;
-
-       private final static Log log = LogFactory.getLog(NodeLabelProvider.class);
-
-       public String getText(Object element) {
-               try {
-                       if (element instanceof SingleJcrNodeElem) {
-                               SingleJcrNodeElem sjn = (SingleJcrNodeElem) element;
-                               return getText(sjn.getNode());
-                       } else if (element instanceof Node) {
-                               return getText((Node) element);
-                       } else
-                               return super.getText(element);
-               } catch (RepositoryException e) {
-                       throw new EclipseUiException("Unexpected JCR error while getting node name.");
-               }
-       }
-
-       protected String getText(Node node) throws RepositoryException {
-               String label = node.getName();
-               StringBuffer mixins = new StringBuffer("");
-               for (NodeType type : node.getMixinNodeTypes())
-                       mixins.append(' ').append(type.getName());
-
-               return label + " [" + node.getPrimaryNodeType().getName() + mixins + "]";
-       }
-
-       @Override
-       public Image getImage(Object element) {
-               if (element instanceof RemoteRepositoryElem) {
-                       if (((RemoteRepositoryElem) element).isConnected())
-                               return JcrImages.REMOTE_CONNECTED;
-                       else
-                               return JcrImages.REMOTE_DISCONNECTED;
-               } else if (element instanceof RepositoryElem) {
-                       if (((RepositoryElem) element).isConnected())
-                               return JcrImages.REPOSITORY_CONNECTED;
-                       else
-                               return JcrImages.REPOSITORY_DISCONNECTED;
-               } else if (element instanceof WorkspaceElem) {
-                       if (((WorkspaceElem) element).isConnected())
-                               return JcrImages.WORKSPACE_CONNECTED;
-                       else
-                               return JcrImages.WORKSPACE_DISCONNECTED;
-               } else if (element instanceof RepositoriesElem) {
-                       return JcrImages.REPOSITORIES;
-               } else if (element instanceof SingleJcrNodeElem) {
-                       Node nodeElem = ((SingleJcrNodeElem) element).getNode();
-                       return getImage(nodeElem);
-
-                       // if (element instanceof Node) {
-                       // return getImage((Node) element);
-                       // } else if (element instanceof WrappedNode) {
-                       // return getImage(((WrappedNode) element).getNode());
-                       // } else if (element instanceof NodesWrapper) {
-                       // return getImage(((NodesWrapper) element).getNode());
-                       // }
-               }
-               // try {
-               // return super.getImage();
-               // } catch (RepositoryException e) {
-               // return null;
-               // }
-               return super.getImage(element);
-       }
-
-       protected Image getImage(Node node) {
-               try {
-                       if (node.getPrimaryNodeType().isNodeType(NodeType.NT_FILE))
-                               return JcrImages.FILE;
-                       else if (node.getPrimaryNodeType().isNodeType(NodeType.NT_FOLDER))
-                               return JcrImages.FOLDER;
-                       else if (node.getPrimaryNodeType().isNodeType(NodeType.NT_RESOURCE))
-                               return JcrImages.BINARY;
-                       try {
-                               // optimizes
-                               if (node.hasProperty(LdapAttrs.uid.property()) && node.isNodeType(NodeTypes.NODE_USER_HOME))
-                                       return JcrImages.HOME;
-                       } catch (NamespaceException e) {
-                               // node namespace is not registered in this repo
-                       }
-                       return JcrImages.NODE;
-               } catch (RepositoryException e) {
-                       log.warn("Error while retrieving type for " + node + " in order to display corresponding image");
-                       e.printStackTrace();
-                       return null;
-               }
-       }
-}
diff --git a/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/PropertiesContentProvider.java b/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/PropertiesContentProvider.java
deleted file mode 100644 (file)
index de93b69..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *         http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.argeo.cms.ui.workbench.internal.jcr;
-
-import java.util.Set;
-import java.util.TreeSet;
-
-import javax.jcr.Node;
-import javax.jcr.Property;
-import javax.jcr.PropertyIterator;
-import javax.jcr.RepositoryException;
-
-import org.argeo.eclipse.ui.EclipseUiException;
-import org.argeo.eclipse.ui.jcr.utils.JcrItemsComparator;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-
-/** Simple content provider that displays all properties of a given Node */
-public class PropertiesContentProvider implements IStructuredContentProvider {
-       private static final long serialVersionUID = 5227554668841613078L;
-       private JcrItemsComparator itemComparator = new JcrItemsComparator();
-
-       public void dispose() {
-       }
-
-       public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-       }
-
-       public Object[] getElements(Object inputElement) {
-               try {
-                       if (inputElement instanceof Node) {
-                               Set<Property> props = new TreeSet<Property>(itemComparator);
-                               PropertyIterator pit = ((Node) inputElement).getProperties();
-                               while (pit.hasNext())
-                                       props.add(pit.nextProperty());
-                               return props.toArray();
-                       }
-                       return new Object[] {};
-               } catch (RepositoryException e) {
-                       throw new EclipseUiException("Cannot get element for "
-                                       + inputElement, e);
-               }
-       }
-}
diff --git a/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/PropertyLabelProvider.java b/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/PropertyLabelProvider.java
deleted file mode 100644 (file)
index 629368c..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *         http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.argeo.cms.ui.workbench.internal.jcr;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-
-import javax.jcr.Property;
-import javax.jcr.PropertyType;
-import javax.jcr.RepositoryException;
-import javax.jcr.Value;
-
-import org.argeo.cms.ui.workbench.internal.WorkbenchConstants;
-import org.argeo.eclipse.ui.EclipseUiException;
-import org.argeo.jcr.JcrUtils;
-import org.eclipse.jface.viewers.ColumnLabelProvider;
-import org.eclipse.jface.viewers.ViewerCell;
-
-/** Default basic label provider for a given JCR Node's properties */
-public class PropertyLabelProvider extends ColumnLabelProvider implements WorkbenchConstants {
-       private static final long serialVersionUID = -5405794508731390147L;
-
-       // To be able to change column order easily
-       public static final int COLUMN_PROPERTY = 0;
-       public static final int COLUMN_VALUE = 1;
-       public static final int COLUMN_TYPE = 2;
-       public static final int COLUMN_ATTRIBUTES = 3;
-
-       // Utils
-       protected DateFormat timeFormatter = new SimpleDateFormat(DATE_TIME_FORMAT);
-
-       public void update(ViewerCell cell) {
-               Object element = cell.getElement();
-               cell.setText(getColumnText(element, cell.getColumnIndex()));
-       }
-
-       public String getColumnText(Object element, int columnIndex) {
-               try {
-                       if (element instanceof Property) {
-                               Property prop = (Property) element;
-                               if (prop.isMultiple()) {
-                                       switch (columnIndex) {
-                                       case COLUMN_PROPERTY:
-                                               return prop.getName();
-                                       case COLUMN_VALUE:
-                                               // Corresponding values are listed on children
-                                               return "";
-                                       case COLUMN_TYPE:
-                                               return JcrBrowserUtils.getPropertyTypeAsString(prop);
-                                       case COLUMN_ATTRIBUTES:
-                                               return JcrUtils.getPropertyDefinitionAsString(prop);
-                                       }
-                               } else {
-                                       switch (columnIndex) {
-                                       case COLUMN_PROPERTY:
-                                               return prop.getName();
-                                       case COLUMN_VALUE:
-                                               return formatValueAsString(prop.getValue());
-                                       case COLUMN_TYPE:
-                                               return JcrBrowserUtils.getPropertyTypeAsString(prop);
-                                       case COLUMN_ATTRIBUTES:
-                                               return JcrUtils.getPropertyDefinitionAsString(prop);
-                                       }
-                               }
-                       } else if (element instanceof Value) {
-                               Value val = (Value) element;
-                               switch (columnIndex) {
-                               case COLUMN_PROPERTY:
-                                       // Nothing to show
-                                       return "";
-                               case COLUMN_VALUE:
-                                       return formatValueAsString(val);
-                               case COLUMN_TYPE:
-                                       // listed on the parent
-                                       return "";
-                               case COLUMN_ATTRIBUTES:
-                                       // Corresponding attributes are listed on the parent
-                                       return "";
-                               }
-                       }
-               } catch (RepositoryException re) {
-                       throw new EclipseUiException("Cannot retrieve prop value on "+element, re);
-               }
-               return null;
-       }
-
-       private String formatValueAsString(Value value) {
-               // TODO enhance this method
-               try {
-                       String strValue;
-
-                       if (value.getType() == PropertyType.BINARY)
-                               strValue = "<binary>";
-                       else if (value.getType() == PropertyType.DATE)
-                               strValue = timeFormatter.format(value.getDate().getTime());
-                       else
-                               strValue = value.getString();
-                       return strValue;
-               } catch (RepositoryException e) {
-                       throw new EclipseUiException("unexpected error while formatting value", e);
-               }
-       }
-}
diff --git a/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/RepositoryRegister.java b/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/RepositoryRegister.java
deleted file mode 100644 (file)
index cd95409..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *         http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.argeo.cms.ui.workbench.internal.jcr;
-
-import java.util.Map;
-
-import javax.jcr.Repository;
-import javax.jcr.RepositoryFactory;
-
-/** Allows to register repositories by name. */
-public interface RepositoryRegister extends RepositoryFactory {
-       /**
-        * The registered {@link Repository} as a read-only map. Note that this
-        * method should be called for each access in order to be sure to be up to
-        * date in case repositories have registered/unregistered
-        */
-       public Map<String, Repository> getRepositories();
-}
diff --git a/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/VersionLabelProvider.java b/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/VersionLabelProvider.java
deleted file mode 100644 (file)
index b33af51..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *         http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.argeo.cms.ui.workbench.internal.jcr;
-
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-import javax.jcr.version.Version;
-
-import org.argeo.eclipse.ui.EclipseUiException;
-import org.eclipse.jface.viewers.ColumnLabelProvider;
-
-/**
- * Simple wrapping of the ColumnLabelProvider class to provide text display in
- * order to build a tree for version. The getText() method does not assume that
- * {@link Version} extends {@link Node} class to respect JCR 2.0 specification
- * 
- */
-public class VersionLabelProvider extends ColumnLabelProvider {
-       private static final long serialVersionUID = 5270739851193688238L;
-
-       public String getText(Object element) {
-               try {
-                       if (element instanceof Version) {
-                               Version version = (Version) element;
-                               return version.getName();
-                       } else if (element instanceof Node) {
-                               return ((Node) element).getName();
-                       }
-               } catch (RepositoryException re) {
-                       throw new EclipseUiException(
-                                       "Unexpected error while getting element name", re);
-               }
-               return super.getText(element);
-       }
-}
index 87bf557adfe00972ec68e11f29f19e59c396b527..f17fde91d6b56847dfba3597193a24dc5a0cee70 100644 (file)
@@ -19,9 +19,9 @@ import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 import javax.jcr.nodetype.NodeType;
 
+import org.argeo.cms.ui.jcr.model.SingleJcrNodeElem;
+import org.argeo.cms.ui.jcr.model.WorkspaceElem;
 import org.argeo.cms.ui.workbench.WorkbenchUiPlugin;
-import org.argeo.cms.ui.workbench.internal.jcr.model.SingleJcrNodeElem;
-import org.argeo.cms.ui.workbench.internal.jcr.model.WorkspaceElem;
 import org.argeo.cms.ui.workbench.jcr.JcrBrowserView;
 import org.argeo.eclipse.ui.TreeParent;
 import org.argeo.eclipse.ui.dialogs.ErrorFeedback;
index e32211a1cb554aa77685b2bc4b36fa9d5f206503..fafd76b72432d0ea34253d89113611ac3e537c13 100644 (file)
@@ -18,9 +18,9 @@ package org.argeo.cms.ui.workbench.internal.jcr.commands;
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 
+import org.argeo.cms.ui.jcr.model.SingleJcrNodeElem;
+import org.argeo.cms.ui.jcr.model.WorkspaceElem;
 import org.argeo.cms.ui.workbench.WorkbenchUiPlugin;
-import org.argeo.cms.ui.workbench.internal.jcr.model.SingleJcrNodeElem;
-import org.argeo.cms.ui.workbench.internal.jcr.model.WorkspaceElem;
 import org.argeo.cms.ui.workbench.internal.jcr.parts.AddPrivilegeWizard;
 import org.argeo.eclipse.ui.EclipseUiException;
 import org.argeo.eclipse.ui.TreeParent;
index 282ed4c138af17c6f5f68dc2873c63cf54f1fb35..60f4244333c8e140456cdbd68c5cfe30877a1585 100644 (file)
@@ -31,8 +31,8 @@ import javax.jcr.Node;
 import javax.jcr.NodeIterator;
 import javax.jcr.RepositoryException;
 
+import org.argeo.cms.ui.jcr.model.SingleJcrNodeElem;
 import org.argeo.cms.ui.workbench.WorkbenchUiPlugin;
-import org.argeo.cms.ui.workbench.internal.jcr.model.SingleJcrNodeElem;
 import org.argeo.eclipse.ui.EclipseUiException;
 import org.argeo.eclipse.ui.EclipseUiUtils;
 import org.argeo.jcr.JcrUtils;
index ccccb8ecd5f10b338129c6655a4a0ac70fc10606..2d6949cd53a21ac0ca9798e2acfa7806b044b0c2 100644 (file)
@@ -17,8 +17,8 @@ package org.argeo.cms.ui.workbench.internal.jcr.commands;
 
 import java.util.Arrays;
 
+import org.argeo.cms.ui.jcr.model.RepositoryElem;
 import org.argeo.cms.ui.workbench.WorkbenchUiPlugin;
-import org.argeo.cms.ui.workbench.internal.jcr.model.RepositoryElem;
 import org.argeo.cms.ui.workbench.jcr.JcrBrowserView;
 import org.argeo.eclipse.ui.dialogs.ErrorFeedback;
 import org.argeo.eclipse.ui.dialogs.SingleValue;
index 41fa58bdc06f85fc99690b4408c2e48c29cbca2e..a0c67709132253dc258dd6f921cf371d89a32eba 100644 (file)
@@ -20,8 +20,8 @@ import java.util.Iterator;
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 
-import org.argeo.cms.ui.workbench.internal.jcr.model.SingleJcrNodeElem;
-import org.argeo.cms.ui.workbench.internal.jcr.model.WorkspaceElem;
+import org.argeo.cms.ui.jcr.model.SingleJcrNodeElem;
+import org.argeo.cms.ui.jcr.model.WorkspaceElem;
 import org.argeo.cms.ui.workbench.jcr.JcrBrowserView;
 import org.argeo.eclipse.ui.EclipseUiException;
 import org.argeo.eclipse.ui.TreeParent;
index ebf7d34f896d1622bf4dad9f560e17fd2105e143..ae23f1d542c5dd1caa9f8cb31ac3c4a6d4a6a66a 100644 (file)
@@ -31,8 +31,8 @@ import java.util.Map;
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 
+import org.argeo.cms.ui.jcr.model.SingleJcrNodeElem;
 import org.argeo.cms.ui.workbench.WorkbenchUiPlugin;
-import org.argeo.cms.ui.workbench.internal.jcr.model.SingleJcrNodeElem;
 import org.argeo.cms.ui.workbench.util.CommandUtils;
 import org.argeo.eclipse.ui.EclipseUiException;
 import org.argeo.eclipse.ui.specific.OpenFile;
index 3964fde5b27d1dd8b3d9bc73922b573dd948f0c2..38d68136fbde497acabff50407359aa3984aea76 100644 (file)
@@ -21,9 +21,9 @@ import java.util.List;
 
 import javax.jcr.Node;
 
+import org.argeo.cms.ui.jcr.model.SingleJcrNodeElem;
+import org.argeo.cms.ui.jcr.model.WorkspaceElem;
 import org.argeo.cms.ui.workbench.WorkbenchUiPlugin;
-import org.argeo.cms.ui.workbench.internal.jcr.model.SingleJcrNodeElem;
-import org.argeo.cms.ui.workbench.internal.jcr.model.WorkspaceElem;
 import org.argeo.eclipse.ui.dialogs.ErrorFeedback;
 import org.argeo.jcr.JcrUtils;
 import org.eclipse.core.commands.AbstractHandler;
index 51b2a1d9267dd52b79cf439bbc869057f35eef47..1924b63a793dfedcc8bff6097f8a9c9531634e2a 100644 (file)
@@ -17,8 +17,8 @@ package org.argeo.cms.ui.workbench.internal.jcr.commands;
 
 import java.util.Iterator;
 
+import org.argeo.cms.ui.jcr.JcrBrowserUtils;
 import org.argeo.cms.ui.workbench.WorkbenchUiPlugin;
-import org.argeo.cms.ui.workbench.internal.jcr.JcrBrowserUtils;
 import org.argeo.cms.ui.workbench.jcr.JcrBrowserView;
 import org.argeo.eclipse.ui.TreeParent;
 import org.eclipse.core.commands.AbstractHandler;
index 0f14b6dd99622212205a6cca878e5644b551a754..cd2618d5f176bb4c60e76f0ae0a398a60cb030ef 100644 (file)
@@ -25,10 +25,10 @@ import javax.jcr.security.AccessControlList;
 import javax.jcr.security.AccessControlManager;
 import javax.jcr.security.Privilege;
 
+import org.argeo.cms.ui.jcr.JcrImages;
+import org.argeo.cms.ui.jcr.model.SingleJcrNodeElem;
+import org.argeo.cms.ui.jcr.model.WorkspaceElem;
 import org.argeo.cms.ui.workbench.WorkbenchUiPlugin;
-import org.argeo.cms.ui.workbench.internal.jcr.model.SingleJcrNodeElem;
-import org.argeo.cms.ui.workbench.internal.jcr.model.WorkspaceElem;
-import org.argeo.cms.ui.workbench.jcr.JcrImages;
 import org.argeo.eclipse.ui.EclipseUiException;
 import org.argeo.eclipse.ui.EclipseUiUtils;
 import org.argeo.eclipse.ui.TreeParent;
index cd49bf0c1f3e2fd7eb2faf4c1ef58969a5af46fb..c1be6ceeadd28a88d462c7ecdb83186e6c1a71ab 100644 (file)
@@ -15,7 +15,7 @@
  */
 package org.argeo.cms.ui.workbench.internal.jcr.commands;
 
-import org.argeo.cms.ui.workbench.internal.jcr.model.RemoteRepositoryElem;
+import org.argeo.cms.ui.jcr.model.RemoteRepositoryElem;
 import org.argeo.cms.ui.workbench.jcr.JcrBrowserView;
 import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
index 07c722b23acb390a08ff15fa8457064fecea6dac..7f4b554181c459300d0e2197d0aab44eb772b041 100644 (file)
@@ -21,8 +21,8 @@ import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 
+import org.argeo.cms.ui.jcr.model.SingleJcrNodeElem;
 import org.argeo.cms.ui.workbench.WorkbenchUiPlugin;
-import org.argeo.cms.ui.workbench.internal.jcr.model.SingleJcrNodeElem;
 import org.argeo.cms.ui.workbench.jcr.JcrBrowserView;
 import org.argeo.eclipse.ui.EclipseUiException;
 import org.argeo.eclipse.ui.dialogs.SingleValue;
index 3470c8a0043f539a72a592127557e3fb1b593619..42d4b301bb8f94ab5ecabf7adae475d221f3dfbf 100644 (file)
@@ -27,9 +27,9 @@ import javax.jcr.Node;
 import javax.jcr.Property;
 import javax.jcr.nodetype.NodeType;
 
+import org.argeo.cms.ui.jcr.model.SingleJcrNodeElem;
+import org.argeo.cms.ui.jcr.model.WorkspaceElem;
 import org.argeo.cms.ui.workbench.WorkbenchUiPlugin;
-import org.argeo.cms.ui.workbench.internal.jcr.model.SingleJcrNodeElem;
-import org.argeo.cms.ui.workbench.internal.jcr.model.WorkspaceElem;
 import org.argeo.cms.ui.workbench.jcr.JcrBrowserView;
 import org.argeo.eclipse.ui.EclipseUiUtils;
 import org.argeo.eclipse.ui.TreeParent;
diff --git a/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/model/MaintainedRepositoryElem.java b/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/model/MaintainedRepositoryElem.java
deleted file mode 100644 (file)
index 284d4eb..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-package org.argeo.cms.ui.workbench.internal.jcr.model;
-
-import javax.jcr.Repository;
-
-import org.argeo.eclipse.ui.TreeParent;
-
-/** Wrap a MaintainedRepository */
-public class MaintainedRepositoryElem extends RepositoryElem {
-
-       public MaintainedRepositoryElem(String alias, Repository repository, TreeParent parent) {
-               super(alias, repository, parent);
-               // if (!(repository instanceof MaintainedRepository)) {
-               // throw new ArgeoException("Repository " + alias
-               // + " is not a maintained repository");
-               // }
-       }
-
-       // protected MaintainedRepository getMaintainedRepository() {
-       // return (MaintainedRepository) getRepository();
-       // }
-}
diff --git a/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/model/RemoteRepositoryElem.java b/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/model/RemoteRepositoryElem.java
deleted file mode 100644 (file)
index 4712f92..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *         http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.argeo.cms.ui.workbench.internal.jcr.model;
-
-import java.util.Arrays;
-
-import javax.jcr.Node;
-import javax.jcr.Repository;
-import javax.jcr.RepositoryException;
-import javax.jcr.RepositoryFactory;
-import javax.jcr.Session;
-import javax.jcr.SimpleCredentials;
-
-import org.argeo.cms.ArgeoNames;
-import org.argeo.eclipse.ui.EclipseUiException;
-import org.argeo.eclipse.ui.TreeParent;
-import org.argeo.node.NodeUtils;
-import org.argeo.node.security.Keyring;
-
-/** Root of a remote repository */
-public class RemoteRepositoryElem extends RepositoryElem {
-       private final Keyring keyring;
-       /**
-        * A session of the logged in user on the default workspace of the node
-        * repository.
-        */
-       private final Session userSession;
-       private final String remoteNodePath;
-
-       private final RepositoryFactory repositoryFactory;
-       private final String uri;
-
-       public RemoteRepositoryElem(String alias, RepositoryFactory repositoryFactory, String uri, TreeParent parent,
-                       Session userSession, Keyring keyring, String remoteNodePath) {
-               super(alias, null, parent);
-               this.repositoryFactory = repositoryFactory;
-               this.uri = uri;
-               this.keyring = keyring;
-               this.userSession = userSession;
-               this.remoteNodePath = remoteNodePath;
-       }
-
-       @Override
-       protected Session repositoryLogin(String workspaceName) throws RepositoryException {
-               Node remoteRepository = userSession.getNode(remoteNodePath);
-               String userID = remoteRepository.getProperty(ArgeoNames.ARGEO_USER_ID).getString();
-               if (userID.trim().equals("")) {
-                       return getRepository().login(workspaceName);
-               } else {
-                       String pwdPath = remoteRepository.getPath() + '/' + ArgeoNames.ARGEO_PASSWORD;
-                       char[] password = keyring.getAsChars(pwdPath);
-                       try {
-                               SimpleCredentials credentials = new SimpleCredentials(userID, password);
-                               return getRepository().login(credentials, workspaceName);
-                       } finally {
-                               Arrays.fill(password, 0, password.length, ' ');
-                       }
-               }
-       }
-
-       @Override
-       public Repository getRepository() {
-               if (repository == null)
-                       repository = NodeUtils.getRepositoryByUri(repositoryFactory, uri);
-               return super.getRepository();
-       }
-
-       public void remove() {
-               try {
-                       Node remoteNode = userSession.getNode(remoteNodePath);
-                       remoteNode.remove();
-                       remoteNode.getSession().save();
-               } catch (RepositoryException e) {
-                       throw new EclipseUiException("Cannot remove " + remoteNodePath, e);
-               }
-       }
-
-}
diff --git a/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/model/RepositoriesElem.java b/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/model/RepositoriesElem.java
deleted file mode 100644 (file)
index 45c13fb..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *         http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.argeo.cms.ui.workbench.internal.jcr.model;
-
-import java.util.Map;
-
-import javax.jcr.Node;
-import javax.jcr.NodeIterator;
-import javax.jcr.Repository;
-import javax.jcr.RepositoryException;
-import javax.jcr.RepositoryFactory;
-import javax.jcr.Session;
-
-import org.argeo.cms.ArgeoNames;
-import org.argeo.cms.ui.workbench.internal.jcr.RepositoryRegister;
-import org.argeo.eclipse.ui.EclipseUiException;
-import org.argeo.eclipse.ui.TreeParent;
-import org.argeo.eclipse.ui.dialogs.ErrorFeedback;
-import org.argeo.node.NodeUtils;
-import org.argeo.node.security.Keyring;
-
-/**
- * UI Tree component that implements the Argeo abstraction of a
- * {@link RepositoryFactory} that enable a user to "mount" various repositories
- * in a single Tree like View. It is usually meant to be at the root of the UI
- * Tree and thus {@link getParent()} method will return null.
- * 
- * The {@link RepositoryFactory} is injected at instantiation time and must be
- * use get or register new {@link Repository} objects upon which a reference is
- * kept here.
- */
-
-public class RepositoriesElem extends TreeParent implements ArgeoNames {
-       private final RepositoryRegister repositoryRegister;
-       private final RepositoryFactory repositoryFactory;
-
-       /**
-        * A session of the logged in user on the default workspace of the node
-        * repository.
-        */
-       private final Session userSession;
-       private final Keyring keyring;
-
-       public RepositoriesElem(String name, RepositoryRegister repositoryRegister, RepositoryFactory repositoryFactory,
-                       TreeParent parent, Session userSession, Keyring keyring) {
-               super(name);
-               this.repositoryRegister = repositoryRegister;
-               this.repositoryFactory = repositoryFactory;
-               this.userSession = userSession;
-               this.keyring = keyring;
-       }
-
-       /**
-        * Override normal behavior to initialize the various repositories only at
-        * request time
-        */
-       @Override
-       public synchronized Object[] getChildren() {
-               if (isLoaded()) {
-                       return super.getChildren();
-               } else {
-                       // initialize current object
-                       Map<String, Repository> refRepos = repositoryRegister.getRepositories();
-                       for (String name : refRepos.keySet()) {
-                               Repository repository = refRepos.get(name);
-                               // if (repository instanceof MaintainedRepository)
-                               // super.addChild(new MaintainedRepositoryElem(name,
-                               // repository, this));
-                               // else
-                               super.addChild(new RepositoryElem(name, repository, this));
-                       }
-
-                       // remote
-                       if (keyring != null) {
-                               try {
-                                       addRemoteRepositories(keyring);
-                               } catch (RepositoryException e) {
-                                       throw new EclipseUiException("Cannot browse remote repositories", e);
-                               }
-                       }
-                       return super.getChildren();
-               }
-       }
-
-       protected void addRemoteRepositories(Keyring jcrKeyring) throws RepositoryException {
-               Node userHome = NodeUtils.getUserHome(userSession);
-               if (userHome != null && userHome.hasNode(ARGEO_REMOTE)) {
-                       NodeIterator it = userHome.getNode(ARGEO_REMOTE).getNodes();
-                       while (it.hasNext()) {
-                               Node remoteNode = it.nextNode();
-                               String uri = remoteNode.getProperty(ARGEO_URI).getString();
-                               try {
-                                       RemoteRepositoryElem remoteRepositoryNode = new RemoteRepositoryElem(remoteNode.getName(),
-                                                       repositoryFactory, uri, this, userSession, jcrKeyring, remoteNode.getPath());
-                                       super.addChild(remoteRepositoryNode);
-                               } catch (Exception e) {
-                                       ErrorFeedback.show("Cannot add remote repository " + remoteNode, e);
-                               }
-                       }
-               }
-       }
-
-       public void registerNewRepository(String alias, Repository repository) {
-               // TODO: implement this
-               // Create a new RepositoryNode Object
-               // add it
-               // super.addChild(new RepositoriesNode(...));
-       }
-
-       /** Returns the {@link RepositoryRegister} wrapped by this object. */
-       public RepositoryRegister getRepositoryRegister() {
-               return repositoryRegister;
-       }
-}
diff --git a/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/model/RepositoryElem.java b/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/model/RepositoryElem.java
deleted file mode 100644 (file)
index 116aeee..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *         http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.argeo.cms.ui.workbench.internal.jcr.model;
-
-import javax.jcr.Repository;
-import javax.jcr.RepositoryException;
-import javax.jcr.Session;
-
-import org.argeo.eclipse.ui.EclipseUiException;
-import org.argeo.eclipse.ui.TreeParent;
-import org.argeo.jcr.JcrUtils;
-
-/**
- * UI Tree component that wraps a JCR {@link Repository}. It also keeps a
- * reference to its parent Tree Ui component; typically the unique
- * {@link RepositoriesElem} object of the current view to enable bi-directionnal
- * browsing in the tree.
- */
-
-public class RepositoryElem extends TreeParent {
-       private String alias;
-       protected Repository repository;
-       private Session defaultSession = null;
-
-       /** Create a new repository with distinct name and alias */
-       public RepositoryElem(String alias, Repository repository, TreeParent parent) {
-               super(alias);
-               this.repository = repository;
-               setParent(parent);
-               this.alias = alias;
-       }
-
-       public void login() {
-               try {
-                       defaultSession = repositoryLogin("main");
-                       String[] wkpNames = defaultSession.getWorkspace().getAccessibleWorkspaceNames();
-                       for (String wkpName : wkpNames) {
-                               if (wkpName.equals(defaultSession.getWorkspace().getName()))
-                                       addChild(new WorkspaceElem(this, wkpName, defaultSession));
-                               else
-                                       addChild(new WorkspaceElem(this, wkpName));
-                       }
-               } catch (RepositoryException e) {
-                       throw new EclipseUiException("Cannot connect to repository " + alias, e);
-               }
-       }
-
-       public synchronized void logout() {
-               for (Object child : getChildren()) {
-                       if (child instanceof WorkspaceElem)
-                               ((WorkspaceElem) child).logout();
-               }
-               clearChildren();
-               JcrUtils.logoutQuietly(defaultSession);
-               defaultSession = null;
-       }
-
-       /**
-        * Actual call to the {@link Repository#login(javax.jcr.Credentials, String)}
-        * method. To be overridden.
-        */
-       protected Session repositoryLogin(String workspaceName) throws RepositoryException {
-               return repository.login(workspaceName);
-       }
-
-       public String[] getAccessibleWorkspaceNames() {
-               try {
-                       return defaultSession.getWorkspace().getAccessibleWorkspaceNames();
-               } catch (RepositoryException e) {
-                       throw new EclipseUiException("Cannot retrieve workspace names", e);
-               }
-       }
-
-       public void createWorkspace(String workspaceName) {
-               if (!isConnected())
-                       login();
-               try {
-                       defaultSession.getWorkspace().createWorkspace(workspaceName);
-               } catch (RepositoryException e) {
-                       throw new EclipseUiException("Cannot create workspace", e);
-               }
-       }
-
-       /** returns the {@link Repository} referenced by the current UI Node */
-       public Repository getRepository() {
-               return repository;
-       }
-
-       public String getAlias() {
-               return alias;
-       }
-
-       public Boolean isConnected() {
-               if (defaultSession != null && defaultSession.isLive())
-                       return true;
-               else
-                       return false;
-       }
-}
diff --git a/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/model/SingleJcrNodeElem.java b/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/model/SingleJcrNodeElem.java
deleted file mode 100644 (file)
index f323c1b..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *         http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.argeo.cms.ui.workbench.internal.jcr.model;
-
-import javax.jcr.Node;
-import javax.jcr.NodeIterator;
-import javax.jcr.RepositoryException;
-import javax.jcr.Workspace;
-
-import org.argeo.eclipse.ui.EclipseUiException;
-import org.argeo.eclipse.ui.TreeParent;
-
-/**
- * UI Tree component. Wraps a node of a JCR {@link Workspace}. It also keeps a
- * reference to its parent node that can either be a {@link WorkspaceElem}, a
- * {@link SingleJcrNodeElem} or null if the node is "mounted" as the root of the
- * UI tree.
- */
-public class SingleJcrNodeElem extends TreeParent {
-
-       private final Node node;
-       private String alias = null;
-
-       /** Creates a new UiNode in the UI Tree */
-       public SingleJcrNodeElem(TreeParent parent, Node node, String name) {
-               super(name);
-               setParent(parent);
-               this.node = node;
-       }
-
-       /**
-        * Creates a new UiNode in the UI Tree, keeping a reference to the alias of
-        * the corresponding repository in the current UI environment. It is useful
-        * to be able to mount nodes as roots of the UI tree.
-        */
-       public SingleJcrNodeElem(TreeParent parent, Node node, String name, String alias) {
-               super(name);
-               setParent(parent);
-               this.node = node;
-               this.alias = alias;
-       }
-
-       /** Returns the node wrapped by the current UI object */
-       public Node getNode() {
-               return node;
-       }
-
-       protected String getRepositoryAlias() {
-               return alias;
-       }
-
-       /**
-        * Overrides normal behaviour to initialise children only when first
-        * requested
-        */
-       @Override
-       public synchronized Object[] getChildren() {
-               if (isLoaded()) {
-                       return super.getChildren();
-               } else {
-                       // initialize current object
-                       try {
-                               NodeIterator ni = node.getNodes();
-                               while (ni.hasNext()) {
-                                       Node curNode = ni.nextNode();
-                                       addChild(new SingleJcrNodeElem(this, curNode, curNode.getName()));
-                               }
-                               return super.getChildren();
-                       } catch (RepositoryException re) {
-                               throw new EclipseUiException("Cannot initialize SingleJcrNode children", re);
-                       }
-               }
-       }
-
-       @Override
-       public boolean hasChildren() {
-               try {
-                       if (node.getSession().isLive())
-                               return node.hasNodes();
-                       else
-                               return false;
-               } catch (RepositoryException re) {
-                       throw new EclipseUiException("Cannot check children node existence", re);
-               }
-       }
-}
diff --git a/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/model/WorkspaceElem.java b/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/jcr/model/WorkspaceElem.java
deleted file mode 100644 (file)
index 0bbd774..0000000
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *         http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.argeo.cms.ui.workbench.internal.jcr.model;
-
-import javax.jcr.Node;
-import javax.jcr.NodeIterator;
-import javax.jcr.RepositoryException;
-import javax.jcr.Session;
-// import javax.jcr.Workspace;
-import javax.jcr.Workspace;
-
-import org.argeo.eclipse.ui.EclipseUiException;
-import org.argeo.eclipse.ui.TreeParent;
-import org.argeo.jcr.JcrUtils;
-
-/**
- * UI Tree component. Wraps the root node of a JCR {@link Workspace}. It also
- * keeps a reference to its parent {@link RepositoryElem}, to be able to
- * retrieve alias of the current used repository
- */
-public class WorkspaceElem extends TreeParent {
-       private Session session = null;
-
-       public WorkspaceElem(RepositoryElem parent, String name) {
-               this(parent, name, null);
-       }
-
-       public WorkspaceElem(RepositoryElem parent, String name, Session session) {
-               super(name);
-               this.session = session;
-               setParent(parent);
-       }
-
-       public synchronized Session getSession() {
-               return session;
-       }
-
-       public synchronized Node getRootNode() {
-               try {
-                       if (session != null)
-                               return session.getRootNode();
-                       else
-                               return null;
-               } catch (RepositoryException e) {
-                       throw new EclipseUiException("Cannot get root node of workspace "
-                                       + getName(), e);
-               }
-       }
-
-       public synchronized void login() {
-               try {
-                       session = ((RepositoryElem) getParent()).repositoryLogin(getName());
-               } catch (RepositoryException e) {
-                       throw new EclipseUiException("Cannot connect to repository "
-                                       + getName(), e);
-               }
-       }
-
-       public Boolean isConnected() {
-               if (session != null && session.isLive())
-                       return true;
-               else
-                       return false;
-       }
-
-       @Override
-       public synchronized void dispose() {
-               logout();
-               super.dispose();
-       }
-
-       /** Logouts the session, does not nothing if there is no live session. */
-       public synchronized void logout() {
-               clearChildren();
-               JcrUtils.logoutQuietly(session);
-               session = null;
-       }
-
-       @Override
-       public synchronized boolean hasChildren() {
-               try {
-                       if (isConnected())
-                               return session.getRootNode().hasNodes();
-                       else
-                               return false;
-               } catch (RepositoryException re) {
-                       throw new EclipseUiException(
-                                       "Unexpected error while checking children node existence",
-                                       re);
-               }
-       }
-
-       /** Override normal behaviour to initialize display of the workspace */
-       @Override
-       public synchronized Object[] getChildren() {
-               if (isLoaded()) {
-                       return super.getChildren();
-               } else {
-                       // initialize current object
-                       try {
-                               Node rootNode;
-                               if (session == null)
-                                       return null;
-                               else
-                                       rootNode = session.getRootNode();
-                               NodeIterator ni = rootNode.getNodes();
-                               while (ni.hasNext()) {
-                                       Node node = ni.nextNode();
-                                       addChild(new SingleJcrNodeElem(this, node, node.getName()));
-                               }
-                               return super.getChildren();
-                       } catch (RepositoryException e) {
-                               throw new EclipseUiException(
-                                               "Cannot initialize WorkspaceNode UI object."
-                                                               + getName(), e);
-                       }
-               }
-       }
-}
index 742a90a157b6fc8d865251fac6e76c44996b061c..eb8629278eed8cd30d467d9b58026ae10f779edf 100644 (file)
@@ -17,9 +17,9 @@ package org.argeo.cms.ui.workbench.internal.jcr.parts;
 
 import javax.jcr.Node;
 
+import org.argeo.cms.ui.jcr.JcrTreeContentProvider;
+import org.argeo.cms.ui.jcr.NodeLabelProvider;
 import org.argeo.cms.ui.workbench.WorkbenchUiPlugin;
-import org.argeo.cms.ui.workbench.internal.jcr.JcrTreeContentProvider;
-import org.argeo.cms.ui.workbench.internal.jcr.NodeLabelProvider;
 import org.argeo.cms.ui.workbench.jcr.DefaultNodeEditor;
 import org.argeo.eclipse.ui.EclipseUiException;
 import org.argeo.eclipse.ui.EclipseUiUtils;
index f4993ac1ec74ed454db74d06d25fb6aa1314c3ad..2f2ec899a37d3e7dfbcd0fa57069fadcd4c7c440 100644 (file)
@@ -28,6 +28,7 @@ import javax.jcr.PropertyIterator;
 import javax.jcr.PropertyType;
 import javax.jcr.RepositoryException;
 
+import org.argeo.cms.ui.CmsConstants;
 import org.argeo.cms.ui.workbench.internal.WorkbenchConstants;
 import org.argeo.eclipse.ui.EclipseUiException;
 import org.argeo.jcr.JcrUtils;
@@ -59,7 +60,7 @@ public class GenericNodePage extends FormPage implements WorkbenchConstants {
        private final static String JCR_PROPERTY_NAME = "jcr:name";
 
        // Utils
-       protected DateFormat timeFormatter = new SimpleDateFormat(DATE_TIME_FORMAT);
+       protected DateFormat timeFormatter = new SimpleDateFormat(CmsConstants.DATE_TIME_FORMAT);
 
        // Main business Objects
        private Node currentNode;
index 83f9c595ac2c9f5c9ff5ad6e7425e03471084a6e..50f89625a1ff6a10e3142607e9ec467fd74d13bd 100644 (file)
@@ -23,9 +23,9 @@ import javax.jcr.Property;
 import javax.jcr.PropertyIterator;
 import javax.jcr.RepositoryException;
 
+import org.argeo.cms.ui.jcr.PropertyLabelProvider;
 import org.argeo.cms.ui.workbench.WorkbenchUiPlugin;
 import org.argeo.cms.ui.workbench.internal.WorkbenchConstants;
-import org.argeo.cms.ui.workbench.internal.jcr.PropertyLabelProvider;
 import org.argeo.eclipse.ui.EclipseUiException;
 import org.eclipse.jface.layout.TreeColumnLayout;
 import org.eclipse.jface.viewers.ColumnWeightData;
index d291d16e7a0d6d9a8c0dfd0c5230f3d99de63013..166ece9d82977098c74c319962e2d1b21d7cfc64 100644 (file)
@@ -33,11 +33,12 @@ import javax.jcr.version.VersionHistory;
 import javax.jcr.version.VersionIterator;
 import javax.jcr.version.VersionManager;
 
+import org.argeo.cms.ui.CmsConstants;
+import org.argeo.cms.ui.jcr.FullVersioningTreeContentProvider;
+import org.argeo.cms.ui.jcr.JcrDClickListener;
+import org.argeo.cms.ui.jcr.VersionLabelProvider;
 import org.argeo.cms.ui.workbench.WorkbenchUiPlugin;
 import org.argeo.cms.ui.workbench.internal.WorkbenchConstants;
-import org.argeo.cms.ui.workbench.internal.jcr.FullVersioningTreeContentProvider;
-import org.argeo.cms.ui.workbench.internal.jcr.JcrDClickListener;
-import org.argeo.cms.ui.workbench.internal.jcr.VersionLabelProvider;
 import org.argeo.eclipse.ui.EclipseUiException;
 import org.argeo.jcr.JcrUtils;
 import org.argeo.jcr.PropertyDiff;
@@ -69,7 +70,7 @@ public class NodeVersionHistoryPage extends FormPage implements WorkbenchConstan
        // .getLog(NodeVersionHistoryPage.class);
 
        // Utils
-       protected DateFormat timeFormatter = new SimpleDateFormat(DATE_TIME_FORMAT);
+       protected DateFormat timeFormatter = new SimpleDateFormat(CmsConstants.DATE_TIME_FORMAT);
 
        // business objects
        private Node currentNode;
index 44eb446df788a105e398405ac3ed5658172ef3e0..f84950b91ccb4c9061e1e256af6e467a4c900d96 100644 (file)
@@ -28,15 +28,15 @@ import javax.jcr.observation.Event;
 import javax.jcr.observation.EventListener;
 import javax.jcr.observation.ObservationManager;
 
+import org.argeo.cms.ui.jcr.DefaultRepositoryRegister;
+import org.argeo.cms.ui.jcr.JcrBrowserUtils;
+import org.argeo.cms.ui.jcr.JcrDClickListener;
+import org.argeo.cms.ui.jcr.NodeContentProvider;
+import org.argeo.cms.ui.jcr.NodeLabelProvider;
+import org.argeo.cms.ui.jcr.PropertiesContentProvider;
+import org.argeo.cms.ui.jcr.RepositoryRegister;
+import org.argeo.cms.ui.jcr.model.SingleJcrNodeElem;
 import org.argeo.cms.ui.workbench.WorkbenchUiPlugin;
-import org.argeo.cms.ui.workbench.internal.jcr.DefaultRepositoryRegister;
-import org.argeo.cms.ui.workbench.internal.jcr.JcrBrowserUtils;
-import org.argeo.cms.ui.workbench.internal.jcr.JcrDClickListener;
-import org.argeo.cms.ui.workbench.internal.jcr.NodeContentProvider;
-import org.argeo.cms.ui.workbench.internal.jcr.NodeLabelProvider;
-import org.argeo.cms.ui.workbench.internal.jcr.PropertiesContentProvider;
-import org.argeo.cms.ui.workbench.internal.jcr.RepositoryRegister;
-import org.argeo.cms.ui.workbench.internal.jcr.model.SingleJcrNodeElem;
 import org.argeo.eclipse.ui.EclipseUiException;
 import org.argeo.eclipse.ui.TreeParent;
 import org.argeo.eclipse.ui.jcr.AsyncUiEventListener;
diff --git a/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/jcr/JcrImages.java b/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/jcr/JcrImages.java
deleted file mode 100644 (file)
index d7f7b60..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *         http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.argeo.cms.ui.workbench.jcr;
-
-import org.argeo.cms.ui.workbench.WorkbenchUiPlugin;
-import org.eclipse.swt.graphics.Image;
-
-/** Shared icons. */
-public class JcrImages {
-       public final static Image NODE = WorkbenchUiPlugin.getImageDescriptor(
-                       "icons/node.gif").createImage();
-       public final static Image FOLDER = WorkbenchUiPlugin.getImageDescriptor(
-                       "icons/folder.gif").createImage();
-       public final static Image FILE = WorkbenchUiPlugin.getImageDescriptor(
-                       "icons/file.gif").createImage();
-       public final static Image BINARY = WorkbenchUiPlugin.getImageDescriptor(
-                       "icons/binary.png").createImage();
-       public final static Image HOME = WorkbenchUiPlugin.getImageDescriptor(
-                       "icons/home.gif").createImage();
-       public final static Image SORT = WorkbenchUiPlugin.getImageDescriptor(
-                       "icons/sort.gif").createImage();
-       public final static Image REMOVE = WorkbenchUiPlugin.getImageDescriptor(
-                       "icons/remove.gif").createImage();
-
-       public final static Image REPOSITORIES = WorkbenchUiPlugin
-                       .getImageDescriptor("icons/repositories.gif").createImage();
-       public final static Image REPOSITORY_DISCONNECTED = WorkbenchUiPlugin
-                       .getImageDescriptor("icons/repository_disconnected.gif")
-                       .createImage();
-       public final static Image REPOSITORY_CONNECTED = WorkbenchUiPlugin
-                       .getImageDescriptor("icons/repository_connected.gif").createImage();
-       public final static Image REMOTE_DISCONNECTED = WorkbenchUiPlugin
-                       .getImageDescriptor("icons/remote_disconnected.gif").createImage();
-       public final static Image REMOTE_CONNECTED = WorkbenchUiPlugin
-                       .getImageDescriptor("icons/remote_connected.gif").createImage();
-       public final static Image WORKSPACE_DISCONNECTED = WorkbenchUiPlugin
-                       .getImageDescriptor("icons/workspace_disconnected.png")
-                       .createImage();
-       public final static Image WORKSPACE_CONNECTED = WorkbenchUiPlugin
-                       .getImageDescriptor("icons/workspace_connected.png").createImage();
-
-}
diff --git a/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/jcr/WorkbenchJcrDClickListener.java b/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/jcr/WorkbenchJcrDClickListener.java
new file mode 100644 (file)
index 0000000..37feeb7
--- /dev/null
@@ -0,0 +1,101 @@
+package org.argeo.cms.ui.workbench.jcr;
+
+import static javax.jcr.Node.JCR_CONTENT;
+import static javax.jcr.Property.JCR_DATA;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.jcr.Binary;
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+import javax.jcr.nodetype.NodeType;
+
+import org.apache.commons.io.IOUtils;
+import org.argeo.cms.ui.jcr.JcrDClickListener;
+import org.argeo.cms.ui.workbench.WorkbenchUiPlugin;
+import org.argeo.cms.ui.workbench.internal.jcr.parts.GenericNodeEditorInput;
+import org.argeo.cms.ui.workbench.util.CommandUtils;
+import org.argeo.eclipse.ui.EclipseUiException;
+import org.argeo.eclipse.ui.specific.OpenFile;
+import org.argeo.eclipse.ui.specific.SingleSourcingException;
+import org.argeo.jcr.JcrUtils;
+import org.eclipse.jface.viewers.TreeViewer;
+
+public class WorkbenchJcrDClickListener extends JcrDClickListener {
+
+       public WorkbenchJcrDClickListener(TreeViewer nodeViewer) {
+               super(nodeViewer);
+       }
+
+       @Override
+       protected void openNode(Node node) {
+               try {
+                       if (node.isNodeType(NodeType.NT_FILE)) {
+                               // Also open it
+
+                               String name = node.getName();
+                               Map<String, String> params = new HashMap<String, String>();
+                               params.put(OpenFile.PARAM_FILE_NAME, name);
+
+                               // TODO rather directly transmit the path to the node, once
+                               // we have defined convention to provide an Absolute URI to
+                               // a node in a multi repo / workspace / user context
+                               // params.put(OpenFile.PARAM_FILE_URI,
+                               // OpenFileService.JCR_SCHEME + node.getPath());
+
+                               // we copy the node to a tmp file to be opened as a dirty
+                               // workaround
+                               File tmpFile = null;
+                               // OutputStream os = null;
+                               // InputStream is = null;
+                               int i = name.lastIndexOf('.');
+                               String prefix, suffix;
+                               if (i == -1) {
+                                       prefix = name;
+                                       suffix = null;
+                               } else {
+                                       prefix = name.substring(0, i);
+                                       suffix = name.substring(i);
+                               }
+                               Binary binary = null;
+                               try {
+                                       tmpFile = File.createTempFile(prefix, suffix);
+                                       tmpFile.deleteOnExit();
+                               } catch (IOException e1) {
+                                       throw new EclipseUiException("Cannot create temp file", e1);
+                               }
+                               try (OutputStream os = new FileOutputStream(tmpFile)) {
+                                       binary = node.getNode(JCR_CONTENT).getProperty(JCR_DATA).getBinary();
+                                       try (InputStream is = binary.getStream();) {
+                                               IOUtils.copy(is, os);
+                                       }
+                               } catch (IOException e) {
+                                       throw new SingleSourcingException("Cannot open file " + prefix + "." + suffix, e);
+                               } finally {
+                                       // IOUtils.closeQuietly(is);
+                                       // IOUtils.closeQuietly(os);
+                                       JcrUtils.closeQuietly(binary);
+                               }
+                               Path path = Paths.get(tmpFile.getAbsolutePath());
+                               String uri = path.toUri().toString();
+                               params.put(OpenFile.PARAM_FILE_URI, uri);
+                               CommandUtils.callCommand(OpenFile.ID, params);
+                       }
+                       GenericNodeEditorInput gnei = new GenericNodeEditorInput(node);
+                       WorkbenchUiPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor(gnei,
+                                       DefaultNodeEditor.ID);
+               } catch (RepositoryException re) {
+                       throw new EclipseUiException("Repository error while getting node info", re);
+               } catch (Exception pie) {
+                       throw new EclipseUiException("Unexpected exception while opening node editor", pie);
+               }
+       }
+}
index dcbc024872664e17019425a91c7974546c31be7d..53e2aee6c8d137ae6e70c649650491b0263e744a 100644 (file)
@@ -19,4 +19,6 @@ public interface CmsConstants {
        public final static String NO_IMAGE = "icons/noPic-square-640px.png";
        public final static Point NO_IMAGE_SIZE = new Point(640, 640);
        public final static Float NO_IMAGE_RATIO = 1f;
+       // MISCEALLENEOUS
+       String DATE_TIME_FORMAT = "dd/MM/yyyy, HH:mm";
 }
diff --git a/org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/DefaultRepositoryRegister.java b/org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/DefaultRepositoryRegister.java
new file mode 100644 (file)
index 0000000..d5e639f
--- /dev/null
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.argeo.cms.ui.jcr;
+
+import java.util.Collections;
+import java.util.Map;
+import java.util.Observable;
+import java.util.TreeMap;
+
+import javax.jcr.Repository;
+import javax.jcr.RepositoryException;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.argeo.node.NodeConstants;
+
+public class DefaultRepositoryRegister extends Observable implements RepositoryRegister {
+       /** Key for a JCR repository alias */
+       private final static String CN = NodeConstants.CN;
+       /** Key for a JCR repository URI */
+       // public final static String JCR_REPOSITORY_URI = "argeo.jcr.repository.uri";
+       private final static Log log = LogFactory.getLog(DefaultRepositoryRegister.class);
+
+       /** Read only map which will be directly exposed. */
+       private Map<String, Repository> repositories = Collections.unmodifiableMap(new TreeMap<String, Repository>());
+
+       @SuppressWarnings("rawtypes")
+       public synchronized Repository getRepository(Map parameters) throws RepositoryException {
+               if (!parameters.containsKey(CN))
+                       throw new RepositoryException("Parameter " + CN + " has to be defined.");
+               String alias = parameters.get(CN).toString();
+               if (!repositories.containsKey(alias))
+                       throw new RepositoryException("No repository registered with alias " + alias);
+
+               return repositories.get(alias);
+       }
+
+       /** Access to the read-only map */
+       public synchronized Map<String, Repository> getRepositories() {
+               return repositories;
+       }
+
+       /** Registers a service, typically called when OSGi services are bound. */
+       @SuppressWarnings("rawtypes")
+       public synchronized void register(Repository repository, Map properties) {
+               String alias;
+               if (properties == null || !properties.containsKey(CN)) {
+                       log.warn("Cannot register a repository if no " + CN + " property is specified.");
+                       return;
+               }
+               alias = properties.get(CN).toString();
+               Map<String, Repository> map = new TreeMap<String, Repository>(repositories);
+               map.put(alias, repository);
+               repositories = Collections.unmodifiableMap(map);
+               setChanged();
+               notifyObservers(alias);
+       }
+
+       /** Unregisters a service, typically called when OSGi services are unbound. */
+       @SuppressWarnings("rawtypes")
+       public synchronized void unregister(Repository repository, Map properties) {
+               // TODO: also check bean name?
+               if (properties == null || !properties.containsKey(CN)) {
+                       log.warn("Cannot unregister a repository without property " + CN);
+                       return;
+               }
+
+               String alias = properties.get(CN).toString();
+               Map<String, Repository> map = new TreeMap<String, Repository>(repositories);
+               if (map.remove(alias) == null) {
+                       log.warn("No repository was registered with alias " + alias);
+                       return;
+               }
+               repositories = Collections.unmodifiableMap(map);
+               setChanged();
+               notifyObservers(alias);
+       }
+}
diff --git a/org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/FullVersioningTreeContentProvider.java b/org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/FullVersioningTreeContentProvider.java
new file mode 100644 (file)
index 0000000..c9fdf56
--- /dev/null
@@ -0,0 +1,113 @@
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.argeo.cms.ui.jcr;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+import javax.jcr.nodetype.NodeType;
+import javax.jcr.version.Version;
+import javax.jcr.version.VersionHistory;
+import javax.jcr.version.VersionIterator;
+import javax.jcr.version.VersionManager;
+
+import org.argeo.eclipse.ui.EclipseUiException;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+
+/**
+ * Display some version information of a JCR full versionable node in a tree
+ * like structure
+ */
+public class FullVersioningTreeContentProvider implements ITreeContentProvider {
+       private static final long serialVersionUID = 8691772509491211112L;
+
+       /**
+        * Sends back the first level of the Tree. input element must be a single
+        * node object
+        */
+       public Object[] getElements(Object inputElement) {
+               try {
+                       Node rootNode = (Node) inputElement;
+                       String curPath = rootNode.getPath();
+                       VersionManager vm = rootNode.getSession().getWorkspace()
+                                       .getVersionManager();
+
+                       VersionHistory vh = vm.getVersionHistory(curPath);
+                       List<Version> result = new ArrayList<Version>();
+                       VersionIterator vi = vh.getAllLinearVersions();
+
+                       while (vi.hasNext()) {
+                               result.add(vi.nextVersion());
+                       }
+                       return result.toArray();
+               } catch (RepositoryException re) {
+                       throw new EclipseUiException(
+                                       "Unexpected error while getting version elements", re);
+               }
+       }
+
+       public Object[] getChildren(Object parentElement) {
+               try {
+                       if (parentElement instanceof Version) {
+                               List<Node> tmp = new ArrayList<Node>();
+                               tmp.add(((Version) parentElement).getFrozenNode());
+                               return tmp.toArray();
+                       }
+               } catch (RepositoryException re) {
+                       throw new EclipseUiException("Unexpected error while getting child "
+                                       + "node for version element", re);
+               }
+               return null;
+       }
+
+       public Object getParent(Object element) {
+               try {
+                       // this will not work in a simpleVersionning environment, parent is
+                       // not a node.
+                       if (element instanceof Node
+                                       && ((Node) element).isNodeType(NodeType.NT_FROZEN_NODE)) {
+                               Node node = (Node) element;
+                               return node.getParent();
+                       } else
+                               return null;
+               } catch (RepositoryException e) {
+                       return null;
+               }
+       }
+
+       public boolean hasChildren(Object element) {
+               try {
+                       if (element instanceof Version)
+                               return true;
+                       else if (element instanceof Node)
+                               return ((Node) element).hasNodes();
+                       else
+                               return false;
+               } catch (RepositoryException e) {
+                       throw new EclipseUiException("Cannot check children of " + element, e);
+               }
+       }
+
+       public void dispose() {
+       }
+
+       public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+       }
+
+}
diff --git a/org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/JcrBrowserUtils.java b/org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/JcrBrowserUtils.java
new file mode 100644 (file)
index 0000000..b19646d
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.argeo.cms.ui.jcr;
+
+import javax.jcr.Node;
+import javax.jcr.Property;
+import javax.jcr.PropertyType;
+import javax.jcr.RepositoryException;
+
+import org.argeo.cms.ui.jcr.model.RepositoriesElem;
+import org.argeo.cms.ui.jcr.model.RepositoryElem;
+import org.argeo.cms.ui.jcr.model.SingleJcrNodeElem;
+import org.argeo.cms.ui.jcr.model.WorkspaceElem;
+import org.argeo.eclipse.ui.EclipseUiException;
+import org.argeo.eclipse.ui.TreeParent;
+
+/** Useful methods to manage the JCR Browser */
+public class JcrBrowserUtils {
+
+       public static String getPropertyTypeAsString(Property prop) {
+               try {
+                       return PropertyType.nameFromValue(prop.getType());
+               } catch (RepositoryException e) {
+                       throw new EclipseUiException("Cannot check type for " + prop, e);
+               }
+       }
+
+       /** Insure that the UI component is not stale, refresh if needed */
+       public static void forceRefreshIfNeeded(TreeParent element) {
+               Node curNode = null;
+
+               boolean doRefresh = false;
+
+               try {
+                       if (element instanceof SingleJcrNodeElem) {
+                               curNode = ((SingleJcrNodeElem) element).getNode();
+                       } else if (element instanceof WorkspaceElem) {
+                               curNode = ((WorkspaceElem) element).getRootNode();
+                       }
+
+                       if (curNode != null && element.getChildren().length != curNode.getNodes().getSize())
+                               doRefresh = true;
+                       else if (element instanceof RepositoryElem) {
+                               RepositoryElem rn = (RepositoryElem) element;
+                               if (rn.isConnected()) {
+                                       String[] wkpNames = rn.getAccessibleWorkspaceNames();
+                                       if (element.getChildren().length != wkpNames.length)
+                                               doRefresh = true;
+                               }
+                       } else if (element instanceof RepositoriesElem) {
+                               doRefresh = true;
+                               // Always force refresh for RepositoriesElem : the condition
+                               // below does not take remote repository into account and it is
+                               // not trivial to do so.
+
+                               // RepositoriesElem rn = (RepositoriesElem) element;
+                               // if (element.getChildren().length !=
+                               // rn.getRepositoryRegister()
+                               // .getRepositories().size())
+                               // doRefresh = true;
+                       }
+                       if (doRefresh) {
+                               element.clearChildren();
+                               element.getChildren();
+                       }
+               } catch (RepositoryException re) {
+                       throw new EclipseUiException("Unexpected error while synchronising the UI with the JCR repository", re);
+               }
+       }
+}
diff --git a/org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/JcrDClickListener.java b/org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/JcrDClickListener.java
new file mode 100644 (file)
index 0000000..07a14d0
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.argeo.cms.ui.jcr;
+
+import javax.jcr.Node;
+
+import org.argeo.cms.ui.jcr.model.RepositoryElem;
+import org.argeo.cms.ui.jcr.model.SingleJcrNodeElem;
+import org.argeo.cms.ui.jcr.model.WorkspaceElem;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+
+/** Centralizes the management of double click on a NodeTreeViewer */
+public class JcrDClickListener implements IDoubleClickListener {
+       // private final static Log log = LogFactory
+       // .getLog(GenericNodeDoubleClickListener.class);
+
+       private TreeViewer nodeViewer;
+
+       // private JcrFileProvider jfp;
+       // private FileHandler fileHandler;
+
+       public JcrDClickListener(TreeViewer nodeViewer) {
+               this.nodeViewer = nodeViewer;
+               // jfp = new JcrFileProvider();
+               // Commented out. see https://www.argeo.org/bugzilla/show_bug.cgi?id=188
+               // fileHandler = null;
+               // fileHandler = new FileHandler(jfp);
+       }
+
+       public void doubleClick(DoubleClickEvent event) {
+               if (event.getSelection() == null || event.getSelection().isEmpty())
+                       return;
+               Object obj = ((IStructuredSelection) event.getSelection()).getFirstElement();
+               if (obj instanceof RepositoryElem) {
+                       RepositoryElem rpNode = (RepositoryElem) obj;
+                       if (rpNode.isConnected()) {
+                               rpNode.logout();
+                       } else {
+                               rpNode.login();
+                       }
+                       nodeViewer.refresh(obj);
+               } else if (obj instanceof WorkspaceElem) {
+                       WorkspaceElem wn = (WorkspaceElem) obj;
+                       if (wn.isConnected())
+                               wn.logout();
+                       else
+                               wn.login();
+                       nodeViewer.refresh(obj);
+               } else if (obj instanceof SingleJcrNodeElem) {
+                       SingleJcrNodeElem sjn = (SingleJcrNodeElem) obj;
+                       Node node = sjn.getNode();
+                       openNode(node);
+               }
+       }
+
+       protected void openNode(Node node) {
+               // TODO implement generic behaviour
+       }
+}
diff --git a/org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/JcrImages.java b/org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/JcrImages.java
new file mode 100644 (file)
index 0000000..d86edb5
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.argeo.cms.ui.jcr;
+
+import org.argeo.cms.ui.theme.CmsImages;
+import org.eclipse.swt.graphics.Image;
+
+/** Shared icons. */
+public class JcrImages {
+       public final static Image NODE = CmsImages.createIcon("node.gif");
+       public final static Image FOLDER = CmsImages.createIcon("folder.gif");
+       public final static Image FILE = CmsImages.createIcon("file.gif");
+       public final static Image BINARY = CmsImages.createIcon("binary.png");
+       public final static Image HOME = CmsImages.createIcon("home.gif");
+       public final static Image SORT = CmsImages.createIcon("sort.gif");
+       public final static Image REMOVE = CmsImages.createIcon("remove.gif");
+
+       public final static Image REPOSITORIES = CmsImages.createIcon("repositories.gif");
+       public final static Image REPOSITORY_DISCONNECTED = CmsImages.createIcon("repository_disconnected.gif");
+       public final static Image REPOSITORY_CONNECTED = CmsImages.createIcon("repository_connected.gif");
+       public final static Image REMOTE_DISCONNECTED = CmsImages.createIcon("remote_disconnected.gif");
+       public final static Image REMOTE_CONNECTED = CmsImages.createIcon("remote_connected.gif");
+       public final static Image WORKSPACE_DISCONNECTED = CmsImages.createIcon("workspace_disconnected.png");
+       public final static Image WORKSPACE_CONNECTED = CmsImages.createIcon("workspace_connected.png");
+
+}
diff --git a/org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/JcrTreeContentProvider.java b/org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/JcrTreeContentProvider.java
new file mode 100644 (file)
index 0000000..f45e876
--- /dev/null
@@ -0,0 +1,100 @@
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.argeo.cms.ui.jcr;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.jcr.Node;
+import javax.jcr.NodeIterator;
+import javax.jcr.RepositoryException;
+
+import org.argeo.eclipse.ui.EclipseUiException;
+import org.argeo.eclipse.ui.jcr.utils.JcrItemsComparator;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+
+/**
+ * Implementation of the {@code ITreeContentProvider} in order to display a
+ * single JCR node and its children in a tree like structure
+ */
+public class JcrTreeContentProvider implements ITreeContentProvider {
+       private static final long serialVersionUID = -2128326504754297297L;
+       // private Node rootNode;
+       private JcrItemsComparator itemComparator = new JcrItemsComparator();
+
+       /**
+        * Sends back the first level of the Tree. input element must be a single
+        * node object
+        */
+       public Object[] getElements(Object inputElement) {
+               try {
+                       Node rootNode = (Node) inputElement;
+                       List<Node> result = new ArrayList<Node>();
+                       NodeIterator ni = rootNode.getNodes();
+                       while (ni.hasNext())
+                               result.add(ni.nextNode());
+                       return result.toArray();
+               } catch (RepositoryException re) {
+                       throw new EclipseUiException("Unable to retrieve elements for " + inputElement, re);
+               }
+       }
+
+       public Object[] getChildren(Object parentElement) {
+               return childrenNodes((Node) parentElement);
+       }
+
+       public Object getParent(Object element) {
+               try {
+                       Node node = (Node) element;
+                       if (!node.getPath().equals("/"))
+                               return node.getParent();
+                       else
+                               return null;
+               } catch (RepositoryException e) {
+                       return null;
+               }
+       }
+
+       public boolean hasChildren(Object element) {
+               try {
+                       return ((Node) element).hasNodes();
+               } catch (RepositoryException e) {
+                       throw new EclipseUiException("Cannot check children existence on " + element, e);
+               }
+       }
+
+       protected Object[] childrenNodes(Node parentNode) {
+               try {
+                       List<Node> children = new ArrayList<Node>();
+                       NodeIterator nit = parentNode.getNodes();
+                       while (nit.hasNext())
+                               children.add(nit.nextNode());
+                       Node[] arr = children.toArray(new Node[0]);
+                       Arrays.sort(arr, itemComparator);
+                       return arr;
+               } catch (RepositoryException e) {
+                       throw new EclipseUiException("Cannot list children of " + parentNode, e);
+               }
+       }
+
+       public void dispose() {
+       }
+
+       public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+       }
+}
diff --git a/org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/NodeContentProvider.java b/org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/NodeContentProvider.java
new file mode 100644 (file)
index 0000000..9cccb52
--- /dev/null
@@ -0,0 +1,190 @@
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.argeo.cms.ui.jcr;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Comparator;
+import java.util.List;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+import javax.jcr.RepositoryFactory;
+import javax.jcr.Session;
+import javax.jcr.nodetype.NodeType;
+
+import org.argeo.cms.ui.jcr.model.RepositoriesElem;
+import org.argeo.cms.ui.jcr.model.SingleJcrNodeElem;
+import org.argeo.eclipse.ui.TreeParent;
+import org.argeo.node.NodeConstants;
+import org.argeo.node.NodeUtils;
+import org.argeo.node.security.Keyring;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+
+/**
+ * Implementation of the {@code ITreeContentProvider} to display multiple
+ * repository environment in a tree like structure
+ */
+public class NodeContentProvider implements ITreeContentProvider {
+       private static final long serialVersionUID = -4083809398848374403L;
+       final private RepositoryRegister repositoryRegister;
+       final private RepositoryFactory repositoryFactory;
+
+       // Current user session on the default workspace of the argeo Node
+       final private Session userSession;
+       final private Keyring keyring;
+       private boolean sortChildren;
+
+       // Reference for cleaning
+       private SingleJcrNodeElem homeNode = null;
+       private RepositoriesElem repositoriesNode = null;
+
+       // Utils
+       private TreeBrowserComparator itemComparator = new TreeBrowserComparator();
+
+       public NodeContentProvider(Session userSession, Keyring keyring,
+                       RepositoryRegister repositoryRegister,
+                       RepositoryFactory repositoryFactory, Boolean sortChildren) {
+               this.userSession = userSession;
+               this.keyring = keyring;
+               this.repositoryRegister = repositoryRegister;
+               this.repositoryFactory = repositoryFactory;
+               this.sortChildren = sortChildren;
+       }
+
+       public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+               if (newInput == null)// dispose
+                       return;
+
+               if (userSession != null) {
+                       Node userHome = NodeUtils.getUserHome(userSession);
+                       if (userHome != null) {
+                               // TODO : find a way to dynamically get alias for the node
+                               if (homeNode != null)
+                                       homeNode.dispose();
+                               homeNode = new SingleJcrNodeElem(null, userHome,
+                                               userSession.getUserID(), NodeConstants.NODE);
+                       }
+               }
+               if (repositoryRegister != null) {
+                       if (repositoriesNode != null)
+                               repositoriesNode.dispose();
+                       repositoriesNode = new RepositoriesElem("Repositories",
+                                       repositoryRegister, repositoryFactory, null, userSession,
+                                       keyring);
+               }
+       }
+
+       /**
+        * Sends back the first level of the Tree. Independent from inputElement
+        * that can be null
+        */
+       public Object[] getElements(Object inputElement) {
+               List<Object> objs = new ArrayList<Object>();
+               if (homeNode != null)
+                       objs.add(homeNode);
+               if (repositoriesNode != null)
+                       objs.add(repositoriesNode);
+               return objs.toArray();
+       }
+
+       public Object[] getChildren(Object parentElement) {
+               if (parentElement instanceof TreeParent) {
+                       if (sortChildren) {
+                               Object[] tmpArr = ((TreeParent) parentElement).getChildren();
+                               if (tmpArr == null)
+                                       return new Object[0];
+                               TreeParent[] arr = new TreeParent[tmpArr.length];
+                               for (int i = 0; i < tmpArr.length; i++)
+                                       arr[i] = (TreeParent) tmpArr[i];
+                               Arrays.sort(arr, itemComparator);
+                               return arr;
+                       } else
+                               return ((TreeParent) parentElement).getChildren();
+               } else
+                       return new Object[0];
+       }
+
+       /**
+        * Sets whether the content provider should order the children nodes or not.
+        * It is user duty to call a full refresh of the tree after changing this
+        * parameter.
+        */
+       public void setSortChildren(boolean sortChildren) {
+               this.sortChildren = sortChildren;
+       }
+
+       public Object getParent(Object element) {
+               if (element instanceof TreeParent) {
+                       return ((TreeParent) element).getParent();
+               } else
+                       return null;
+       }
+
+       public boolean hasChildren(Object element) {
+               if (element instanceof RepositoriesElem) {
+                       RepositoryRegister rr = ((RepositoriesElem) element)
+                                       .getRepositoryRegister();
+                       return rr.getRepositories().size() > 0;
+               } else if (element instanceof TreeParent) {
+                       TreeParent tp = (TreeParent) element;
+                       return tp.hasChildren();
+               }
+               return false;
+       }
+
+       public void dispose() {
+               if (homeNode != null)
+                       homeNode.dispose();
+               if (repositoriesNode != null) {
+                       // logs out open sessions
+                       // see https://bugzilla.argeo.org/show_bug.cgi?id=23
+                       repositoriesNode.dispose();
+               }
+       }
+
+       /**
+        * Specific comparator for this view. See specification here:
+        * https://www.argeo.org/bugzilla/show_bug.cgi?id=139
+        */
+       private class TreeBrowserComparator implements Comparator<TreeParent> {
+
+               public int category(TreeParent element) {
+                       if (element instanceof SingleJcrNodeElem) {
+                               Node node = ((SingleJcrNodeElem) element).getNode();
+                               try {
+                                       if (node.isNodeType(NodeType.NT_FOLDER))
+                                               return 5;
+                               } catch (RepositoryException e) {
+                                       // TODO Auto-generated catch block
+                                       e.printStackTrace();
+                               }
+                       }
+                       return 10;
+               }
+
+               public int compare(TreeParent o1, TreeParent o2) {
+                       int cat1 = category(o1);
+                       int cat2 = category(o2);
+
+                       if (cat1 != cat2) {
+                               return cat1 - cat2;
+                       }
+                       return o1.getName().compareTo(o2.getName());
+               }
+       }
+}
diff --git a/org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/NodeLabelProvider.java b/org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/NodeLabelProvider.java
new file mode 100644 (file)
index 0000000..765f320
--- /dev/null
@@ -0,0 +1,126 @@
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.argeo.cms.ui.jcr;
+
+import javax.jcr.NamespaceException;
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+import javax.jcr.nodetype.NodeType;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.argeo.cms.ui.jcr.model.RemoteRepositoryElem;
+import org.argeo.cms.ui.jcr.model.RepositoriesElem;
+import org.argeo.cms.ui.jcr.model.RepositoryElem;
+import org.argeo.cms.ui.jcr.model.SingleJcrNodeElem;
+import org.argeo.cms.ui.jcr.model.WorkspaceElem;
+import org.argeo.eclipse.ui.EclipseUiException;
+import org.argeo.naming.LdapAttrs;
+import org.argeo.node.NodeTypes;
+import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.swt.graphics.Image;
+
+/** Provides reasonable defaults for know JCR types. */
+public class NodeLabelProvider extends ColumnLabelProvider {
+       private static final long serialVersionUID = -3662051696443321843L;
+
+       private final static Log log = LogFactory.getLog(NodeLabelProvider.class);
+
+       public String getText(Object element) {
+               try {
+                       if (element instanceof SingleJcrNodeElem) {
+                               SingleJcrNodeElem sjn = (SingleJcrNodeElem) element;
+                               return getText(sjn.getNode());
+                       } else if (element instanceof Node) {
+                               return getText((Node) element);
+                       } else
+                               return super.getText(element);
+               } catch (RepositoryException e) {
+                       throw new EclipseUiException("Unexpected JCR error while getting node name.");
+               }
+       }
+
+       protected String getText(Node node) throws RepositoryException {
+               String label = node.getName();
+               StringBuffer mixins = new StringBuffer("");
+               for (NodeType type : node.getMixinNodeTypes())
+                       mixins.append(' ').append(type.getName());
+
+               return label + " [" + node.getPrimaryNodeType().getName() + mixins + "]";
+       }
+
+       @Override
+       public Image getImage(Object element) {
+               if (element instanceof RemoteRepositoryElem) {
+                       if (((RemoteRepositoryElem) element).isConnected())
+                               return JcrImages.REMOTE_CONNECTED;
+                       else
+                               return JcrImages.REMOTE_DISCONNECTED;
+               } else if (element instanceof RepositoryElem) {
+                       if (((RepositoryElem) element).isConnected())
+                               return JcrImages.REPOSITORY_CONNECTED;
+                       else
+                               return JcrImages.REPOSITORY_DISCONNECTED;
+               } else if (element instanceof WorkspaceElem) {
+                       if (((WorkspaceElem) element).isConnected())
+                               return JcrImages.WORKSPACE_CONNECTED;
+                       else
+                               return JcrImages.WORKSPACE_DISCONNECTED;
+               } else if (element instanceof RepositoriesElem) {
+                       return JcrImages.REPOSITORIES;
+               } else if (element instanceof SingleJcrNodeElem) {
+                       Node nodeElem = ((SingleJcrNodeElem) element).getNode();
+                       return getImage(nodeElem);
+
+                       // if (element instanceof Node) {
+                       // return getImage((Node) element);
+                       // } else if (element instanceof WrappedNode) {
+                       // return getImage(((WrappedNode) element).getNode());
+                       // } else if (element instanceof NodesWrapper) {
+                       // return getImage(((NodesWrapper) element).getNode());
+                       // }
+               }
+               // try {
+               // return super.getImage();
+               // } catch (RepositoryException e) {
+               // return null;
+               // }
+               return super.getImage(element);
+       }
+
+       protected Image getImage(Node node) {
+               try {
+                       if (node.getPrimaryNodeType().isNodeType(NodeType.NT_FILE))
+                               return JcrImages.FILE;
+                       else if (node.getPrimaryNodeType().isNodeType(NodeType.NT_FOLDER))
+                               return JcrImages.FOLDER;
+                       else if (node.getPrimaryNodeType().isNodeType(NodeType.NT_RESOURCE))
+                               return JcrImages.BINARY;
+                       try {
+                               // optimizes
+                               if (node.hasProperty(LdapAttrs.uid.property()) && node.isNodeType(NodeTypes.NODE_USER_HOME))
+                                       return JcrImages.HOME;
+                       } catch (NamespaceException e) {
+                               // node namespace is not registered in this repo
+                       }
+                       return JcrImages.NODE;
+               } catch (RepositoryException e) {
+                       log.warn("Error while retrieving type for " + node + " in order to display corresponding image");
+                       e.printStackTrace();
+                       return null;
+               }
+       }
+}
diff --git a/org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/PropertiesContentProvider.java b/org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/PropertiesContentProvider.java
new file mode 100644 (file)
index 0000000..d67b133
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.argeo.cms.ui.jcr;
+
+import java.util.Set;
+import java.util.TreeSet;
+
+import javax.jcr.Node;
+import javax.jcr.Property;
+import javax.jcr.PropertyIterator;
+import javax.jcr.RepositoryException;
+
+import org.argeo.eclipse.ui.EclipseUiException;
+import org.argeo.eclipse.ui.jcr.utils.JcrItemsComparator;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+
+/** Simple content provider that displays all properties of a given Node */
+public class PropertiesContentProvider implements IStructuredContentProvider {
+       private static final long serialVersionUID = 5227554668841613078L;
+       private JcrItemsComparator itemComparator = new JcrItemsComparator();
+
+       public void dispose() {
+       }
+
+       public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+       }
+
+       public Object[] getElements(Object inputElement) {
+               try {
+                       if (inputElement instanceof Node) {
+                               Set<Property> props = new TreeSet<Property>(itemComparator);
+                               PropertyIterator pit = ((Node) inputElement).getProperties();
+                               while (pit.hasNext())
+                                       props.add(pit.nextProperty());
+                               return props.toArray();
+                       }
+                       return new Object[] {};
+               } catch (RepositoryException e) {
+                       throw new EclipseUiException("Cannot get element for "
+                                       + inputElement, e);
+               }
+       }
+}
diff --git a/org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/PropertyLabelProvider.java b/org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/PropertyLabelProvider.java
new file mode 100644 (file)
index 0000000..3274fd1
--- /dev/null
@@ -0,0 +1,116 @@
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.argeo.cms.ui.jcr;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+
+import javax.jcr.Property;
+import javax.jcr.PropertyType;
+import javax.jcr.RepositoryException;
+import javax.jcr.Value;
+
+import org.argeo.cms.ui.CmsConstants;
+import org.argeo.eclipse.ui.EclipseUiException;
+import org.argeo.jcr.JcrUtils;
+import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.jface.viewers.ViewerCell;
+
+/** Default basic label provider for a given JCR Node's properties */
+public class PropertyLabelProvider extends ColumnLabelProvider {
+       private static final long serialVersionUID = -5405794508731390147L;
+
+       // To be able to change column order easily
+       public static final int COLUMN_PROPERTY = 0;
+       public static final int COLUMN_VALUE = 1;
+       public static final int COLUMN_TYPE = 2;
+       public static final int COLUMN_ATTRIBUTES = 3;
+
+       // Utils
+       protected DateFormat timeFormatter = new SimpleDateFormat(CmsConstants.DATE_TIME_FORMAT);
+
+       public void update(ViewerCell cell) {
+               Object element = cell.getElement();
+               cell.setText(getColumnText(element, cell.getColumnIndex()));
+       }
+
+       public String getColumnText(Object element, int columnIndex) {
+               try {
+                       if (element instanceof Property) {
+                               Property prop = (Property) element;
+                               if (prop.isMultiple()) {
+                                       switch (columnIndex) {
+                                       case COLUMN_PROPERTY:
+                                               return prop.getName();
+                                       case COLUMN_VALUE:
+                                               // Corresponding values are listed on children
+                                               return "";
+                                       case COLUMN_TYPE:
+                                               return JcrBrowserUtils.getPropertyTypeAsString(prop);
+                                       case COLUMN_ATTRIBUTES:
+                                               return JcrUtils.getPropertyDefinitionAsString(prop);
+                                       }
+                               } else {
+                                       switch (columnIndex) {
+                                       case COLUMN_PROPERTY:
+                                               return prop.getName();
+                                       case COLUMN_VALUE:
+                                               return formatValueAsString(prop.getValue());
+                                       case COLUMN_TYPE:
+                                               return JcrBrowserUtils.getPropertyTypeAsString(prop);
+                                       case COLUMN_ATTRIBUTES:
+                                               return JcrUtils.getPropertyDefinitionAsString(prop);
+                                       }
+                               }
+                       } else if (element instanceof Value) {
+                               Value val = (Value) element;
+                               switch (columnIndex) {
+                               case COLUMN_PROPERTY:
+                                       // Nothing to show
+                                       return "";
+                               case COLUMN_VALUE:
+                                       return formatValueAsString(val);
+                               case COLUMN_TYPE:
+                                       // listed on the parent
+                                       return "";
+                               case COLUMN_ATTRIBUTES:
+                                       // Corresponding attributes are listed on the parent
+                                       return "";
+                               }
+                       }
+               } catch (RepositoryException re) {
+                       throw new EclipseUiException("Cannot retrieve prop value on " + element, re);
+               }
+               return null;
+       }
+
+       private String formatValueAsString(Value value) {
+               // TODO enhance this method
+               try {
+                       String strValue;
+
+                       if (value.getType() == PropertyType.BINARY)
+                               strValue = "<binary>";
+                       else if (value.getType() == PropertyType.DATE)
+                               strValue = timeFormatter.format(value.getDate().getTime());
+                       else
+                               strValue = value.getString();
+                       return strValue;
+               } catch (RepositoryException e) {
+                       throw new EclipseUiException("unexpected error while formatting value", e);
+               }
+       }
+}
diff --git a/org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/RepositoryRegister.java b/org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/RepositoryRegister.java
new file mode 100644 (file)
index 0000000..b6b14d5
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.argeo.cms.ui.jcr;
+
+import java.util.Map;
+
+import javax.jcr.Repository;
+import javax.jcr.RepositoryFactory;
+
+/** Allows to register repositories by name. */
+public interface RepositoryRegister extends RepositoryFactory {
+       /**
+        * The registered {@link Repository} as a read-only map. Note that this
+        * method should be called for each access in order to be sure to be up to
+        * date in case repositories have registered/unregistered
+        */
+       public Map<String, Repository> getRepositories();
+}
diff --git a/org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/VersionLabelProvider.java b/org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/VersionLabelProvider.java
new file mode 100644 (file)
index 0000000..4d7746c
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.argeo.cms.ui.jcr;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+import javax.jcr.version.Version;
+
+import org.argeo.eclipse.ui.EclipseUiException;
+import org.eclipse.jface.viewers.ColumnLabelProvider;
+
+/**
+ * Simple wrapping of the ColumnLabelProvider class to provide text display in
+ * order to build a tree for version. The getText() method does not assume that
+ * {@link Version} extends {@link Node} class to respect JCR 2.0 specification
+ * 
+ */
+public class VersionLabelProvider extends ColumnLabelProvider {
+       private static final long serialVersionUID = 5270739851193688238L;
+
+       public String getText(Object element) {
+               try {
+                       if (element instanceof Version) {
+                               Version version = (Version) element;
+                               return version.getName();
+                       } else if (element instanceof Node) {
+                               return ((Node) element).getName();
+                       }
+               } catch (RepositoryException re) {
+                       throw new EclipseUiException(
+                                       "Unexpected error while getting element name", re);
+               }
+               return super.getText(element);
+       }
+}
diff --git a/org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/model/MaintainedRepositoryElem.java b/org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/model/MaintainedRepositoryElem.java
new file mode 100644 (file)
index 0000000..61654b6
--- /dev/null
@@ -0,0 +1,21 @@
+package org.argeo.cms.ui.jcr.model;
+
+import javax.jcr.Repository;
+
+import org.argeo.eclipse.ui.TreeParent;
+
+/** Wrap a MaintainedRepository */
+public class MaintainedRepositoryElem extends RepositoryElem {
+
+       public MaintainedRepositoryElem(String alias, Repository repository, TreeParent parent) {
+               super(alias, repository, parent);
+               // if (!(repository instanceof MaintainedRepository)) {
+               // throw new ArgeoException("Repository " + alias
+               // + " is not a maintained repository");
+               // }
+       }
+
+       // protected MaintainedRepository getMaintainedRepository() {
+       // return (MaintainedRepository) getRepository();
+       // }
+}
diff --git a/org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/model/RemoteRepositoryElem.java b/org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/model/RemoteRepositoryElem.java
new file mode 100644 (file)
index 0000000..ad173cf
--- /dev/null
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.argeo.cms.ui.jcr.model;
+
+import java.util.Arrays;
+
+import javax.jcr.Node;
+import javax.jcr.Repository;
+import javax.jcr.RepositoryException;
+import javax.jcr.RepositoryFactory;
+import javax.jcr.Session;
+import javax.jcr.SimpleCredentials;
+
+import org.argeo.cms.ArgeoNames;
+import org.argeo.eclipse.ui.EclipseUiException;
+import org.argeo.eclipse.ui.TreeParent;
+import org.argeo.node.NodeUtils;
+import org.argeo.node.security.Keyring;
+
+/** Root of a remote repository */
+public class RemoteRepositoryElem extends RepositoryElem {
+       private final Keyring keyring;
+       /**
+        * A session of the logged in user on the default workspace of the node
+        * repository.
+        */
+       private final Session userSession;
+       private final String remoteNodePath;
+
+       private final RepositoryFactory repositoryFactory;
+       private final String uri;
+
+       public RemoteRepositoryElem(String alias, RepositoryFactory repositoryFactory, String uri, TreeParent parent,
+                       Session userSession, Keyring keyring, String remoteNodePath) {
+               super(alias, null, parent);
+               this.repositoryFactory = repositoryFactory;
+               this.uri = uri;
+               this.keyring = keyring;
+               this.userSession = userSession;
+               this.remoteNodePath = remoteNodePath;
+       }
+
+       @Override
+       protected Session repositoryLogin(String workspaceName) throws RepositoryException {
+               Node remoteRepository = userSession.getNode(remoteNodePath);
+               String userID = remoteRepository.getProperty(ArgeoNames.ARGEO_USER_ID).getString();
+               if (userID.trim().equals("")) {
+                       return getRepository().login(workspaceName);
+               } else {
+                       String pwdPath = remoteRepository.getPath() + '/' + ArgeoNames.ARGEO_PASSWORD;
+                       char[] password = keyring.getAsChars(pwdPath);
+                       try {
+                               SimpleCredentials credentials = new SimpleCredentials(userID, password);
+                               return getRepository().login(credentials, workspaceName);
+                       } finally {
+                               Arrays.fill(password, 0, password.length, ' ');
+                       }
+               }
+       }
+
+       @Override
+       public Repository getRepository() {
+               if (repository == null)
+                       repository = NodeUtils.getRepositoryByUri(repositoryFactory, uri);
+               return super.getRepository();
+       }
+
+       public void remove() {
+               try {
+                       Node remoteNode = userSession.getNode(remoteNodePath);
+                       remoteNode.remove();
+                       remoteNode.getSession().save();
+               } catch (RepositoryException e) {
+                       throw new EclipseUiException("Cannot remove " + remoteNodePath, e);
+               }
+       }
+
+}
diff --git a/org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/model/RepositoriesElem.java b/org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/model/RepositoriesElem.java
new file mode 100644 (file)
index 0000000..c772424
--- /dev/null
@@ -0,0 +1,127 @@
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.argeo.cms.ui.jcr.model;
+
+import java.util.Map;
+
+import javax.jcr.Node;
+import javax.jcr.NodeIterator;
+import javax.jcr.Repository;
+import javax.jcr.RepositoryException;
+import javax.jcr.RepositoryFactory;
+import javax.jcr.Session;
+
+import org.argeo.cms.ArgeoNames;
+import org.argeo.cms.ui.jcr.RepositoryRegister;
+import org.argeo.eclipse.ui.EclipseUiException;
+import org.argeo.eclipse.ui.TreeParent;
+import org.argeo.eclipse.ui.dialogs.ErrorFeedback;
+import org.argeo.node.NodeUtils;
+import org.argeo.node.security.Keyring;
+
+/**
+ * UI Tree component that implements the Argeo abstraction of a
+ * {@link RepositoryFactory} that enable a user to "mount" various repositories
+ * in a single Tree like View. It is usually meant to be at the root of the UI
+ * Tree and thus {@link getParent()} method will return null.
+ * 
+ * The {@link RepositoryFactory} is injected at instantiation time and must be
+ * use get or register new {@link Repository} objects upon which a reference is
+ * kept here.
+ */
+
+public class RepositoriesElem extends TreeParent implements ArgeoNames {
+       private final RepositoryRegister repositoryRegister;
+       private final RepositoryFactory repositoryFactory;
+
+       /**
+        * A session of the logged in user on the default workspace of the node
+        * repository.
+        */
+       private final Session userSession;
+       private final Keyring keyring;
+
+       public RepositoriesElem(String name, RepositoryRegister repositoryRegister, RepositoryFactory repositoryFactory,
+                       TreeParent parent, Session userSession, Keyring keyring) {
+               super(name);
+               this.repositoryRegister = repositoryRegister;
+               this.repositoryFactory = repositoryFactory;
+               this.userSession = userSession;
+               this.keyring = keyring;
+       }
+
+       /**
+        * Override normal behavior to initialize the various repositories only at
+        * request time
+        */
+       @Override
+       public synchronized Object[] getChildren() {
+               if (isLoaded()) {
+                       return super.getChildren();
+               } else {
+                       // initialize current object
+                       Map<String, Repository> refRepos = repositoryRegister.getRepositories();
+                       for (String name : refRepos.keySet()) {
+                               Repository repository = refRepos.get(name);
+                               // if (repository instanceof MaintainedRepository)
+                               // super.addChild(new MaintainedRepositoryElem(name,
+                               // repository, this));
+                               // else
+                               super.addChild(new RepositoryElem(name, repository, this));
+                       }
+
+                       // remote
+                       if (keyring != null) {
+                               try {
+                                       addRemoteRepositories(keyring);
+                               } catch (RepositoryException e) {
+                                       throw new EclipseUiException("Cannot browse remote repositories", e);
+                               }
+                       }
+                       return super.getChildren();
+               }
+       }
+
+       protected void addRemoteRepositories(Keyring jcrKeyring) throws RepositoryException {
+               Node userHome = NodeUtils.getUserHome(userSession);
+               if (userHome != null && userHome.hasNode(ARGEO_REMOTE)) {
+                       NodeIterator it = userHome.getNode(ARGEO_REMOTE).getNodes();
+                       while (it.hasNext()) {
+                               Node remoteNode = it.nextNode();
+                               String uri = remoteNode.getProperty(ARGEO_URI).getString();
+                               try {
+                                       RemoteRepositoryElem remoteRepositoryNode = new RemoteRepositoryElem(remoteNode.getName(),
+                                                       repositoryFactory, uri, this, userSession, jcrKeyring, remoteNode.getPath());
+                                       super.addChild(remoteRepositoryNode);
+                               } catch (Exception e) {
+                                       ErrorFeedback.show("Cannot add remote repository " + remoteNode, e);
+                               }
+                       }
+               }
+       }
+
+       public void registerNewRepository(String alias, Repository repository) {
+               // TODO: implement this
+               // Create a new RepositoryNode Object
+               // add it
+               // super.addChild(new RepositoriesNode(...));
+       }
+
+       /** Returns the {@link RepositoryRegister} wrapped by this object. */
+       public RepositoryRegister getRepositoryRegister() {
+               return repositoryRegister;
+       }
+}
diff --git a/org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/model/RepositoryElem.java b/org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/model/RepositoryElem.java
new file mode 100644 (file)
index 0000000..6f2288c
--- /dev/null
@@ -0,0 +1,112 @@
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.argeo.cms.ui.jcr.model;
+
+import javax.jcr.Repository;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+
+import org.argeo.eclipse.ui.EclipseUiException;
+import org.argeo.eclipse.ui.TreeParent;
+import org.argeo.jcr.JcrUtils;
+
+/**
+ * UI Tree component that wraps a JCR {@link Repository}. It also keeps a
+ * reference to its parent Tree Ui component; typically the unique
+ * {@link RepositoriesElem} object of the current view to enable bi-directionnal
+ * browsing in the tree.
+ */
+
+public class RepositoryElem extends TreeParent {
+       private String alias;
+       protected Repository repository;
+       private Session defaultSession = null;
+
+       /** Create a new repository with distinct name and alias */
+       public RepositoryElem(String alias, Repository repository, TreeParent parent) {
+               super(alias);
+               this.repository = repository;
+               setParent(parent);
+               this.alias = alias;
+       }
+
+       public void login() {
+               try {
+                       defaultSession = repositoryLogin("main");
+                       String[] wkpNames = defaultSession.getWorkspace().getAccessibleWorkspaceNames();
+                       for (String wkpName : wkpNames) {
+                               if (wkpName.equals(defaultSession.getWorkspace().getName()))
+                                       addChild(new WorkspaceElem(this, wkpName, defaultSession));
+                               else
+                                       addChild(new WorkspaceElem(this, wkpName));
+                       }
+               } catch (RepositoryException e) {
+                       throw new EclipseUiException("Cannot connect to repository " + alias, e);
+               }
+       }
+
+       public synchronized void logout() {
+               for (Object child : getChildren()) {
+                       if (child instanceof WorkspaceElem)
+                               ((WorkspaceElem) child).logout();
+               }
+               clearChildren();
+               JcrUtils.logoutQuietly(defaultSession);
+               defaultSession = null;
+       }
+
+       /**
+        * Actual call to the {@link Repository#login(javax.jcr.Credentials, String)}
+        * method. To be overridden.
+        */
+       protected Session repositoryLogin(String workspaceName) throws RepositoryException {
+               return repository.login(workspaceName);
+       }
+
+       public String[] getAccessibleWorkspaceNames() {
+               try {
+                       return defaultSession.getWorkspace().getAccessibleWorkspaceNames();
+               } catch (RepositoryException e) {
+                       throw new EclipseUiException("Cannot retrieve workspace names", e);
+               }
+       }
+
+       public void createWorkspace(String workspaceName) {
+               if (!isConnected())
+                       login();
+               try {
+                       defaultSession.getWorkspace().createWorkspace(workspaceName);
+               } catch (RepositoryException e) {
+                       throw new EclipseUiException("Cannot create workspace", e);
+               }
+       }
+
+       /** returns the {@link Repository} referenced by the current UI Node */
+       public Repository getRepository() {
+               return repository;
+       }
+
+       public String getAlias() {
+               return alias;
+       }
+
+       public Boolean isConnected() {
+               if (defaultSession != null && defaultSession.isLive())
+                       return true;
+               else
+                       return false;
+       }
+}
diff --git a/org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/model/SingleJcrNodeElem.java b/org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/model/SingleJcrNodeElem.java
new file mode 100644 (file)
index 0000000..14c78c0
--- /dev/null
@@ -0,0 +1,99 @@
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.argeo.cms.ui.jcr.model;
+
+import javax.jcr.Node;
+import javax.jcr.NodeIterator;
+import javax.jcr.RepositoryException;
+import javax.jcr.Workspace;
+
+import org.argeo.eclipse.ui.EclipseUiException;
+import org.argeo.eclipse.ui.TreeParent;
+
+/**
+ * UI Tree component. Wraps a node of a JCR {@link Workspace}. It also keeps a
+ * reference to its parent node that can either be a {@link WorkspaceElem}, a
+ * {@link SingleJcrNodeElem} or null if the node is "mounted" as the root of the
+ * UI tree.
+ */
+public class SingleJcrNodeElem extends TreeParent {
+
+       private final Node node;
+       private String alias = null;
+
+       /** Creates a new UiNode in the UI Tree */
+       public SingleJcrNodeElem(TreeParent parent, Node node, String name) {
+               super(name);
+               setParent(parent);
+               this.node = node;
+       }
+
+       /**
+        * Creates a new UiNode in the UI Tree, keeping a reference to the alias of
+        * the corresponding repository in the current UI environment. It is useful
+        * to be able to mount nodes as roots of the UI tree.
+        */
+       public SingleJcrNodeElem(TreeParent parent, Node node, String name, String alias) {
+               super(name);
+               setParent(parent);
+               this.node = node;
+               this.alias = alias;
+       }
+
+       /** Returns the node wrapped by the current UI object */
+       public Node getNode() {
+               return node;
+       }
+
+       protected String getRepositoryAlias() {
+               return alias;
+       }
+
+       /**
+        * Overrides normal behaviour to initialise children only when first
+        * requested
+        */
+       @Override
+       public synchronized Object[] getChildren() {
+               if (isLoaded()) {
+                       return super.getChildren();
+               } else {
+                       // initialize current object
+                       try {
+                               NodeIterator ni = node.getNodes();
+                               while (ni.hasNext()) {
+                                       Node curNode = ni.nextNode();
+                                       addChild(new SingleJcrNodeElem(this, curNode, curNode.getName()));
+                               }
+                               return super.getChildren();
+                       } catch (RepositoryException re) {
+                               throw new EclipseUiException("Cannot initialize SingleJcrNode children", re);
+                       }
+               }
+       }
+
+       @Override
+       public boolean hasChildren() {
+               try {
+                       if (node.getSession().isLive())
+                               return node.hasNodes();
+                       else
+                               return false;
+               } catch (RepositoryException re) {
+                       throw new EclipseUiException("Cannot check children node existence", re);
+               }
+       }
+}
diff --git a/org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/model/WorkspaceElem.java b/org.argeo.cms.ui/src/org/argeo/cms/ui/jcr/model/WorkspaceElem.java
new file mode 100644 (file)
index 0000000..45cda80
--- /dev/null
@@ -0,0 +1,132 @@
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *         http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.argeo.cms.ui.jcr.model;
+
+import javax.jcr.Node;
+import javax.jcr.NodeIterator;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+// import javax.jcr.Workspace;
+import javax.jcr.Workspace;
+
+import org.argeo.eclipse.ui.EclipseUiException;
+import org.argeo.eclipse.ui.TreeParent;
+import org.argeo.jcr.JcrUtils;
+
+/**
+ * UI Tree component. Wraps the root node of a JCR {@link Workspace}. It also
+ * keeps a reference to its parent {@link RepositoryElem}, to be able to
+ * retrieve alias of the current used repository
+ */
+public class WorkspaceElem extends TreeParent {
+       private Session session = null;
+
+       public WorkspaceElem(RepositoryElem parent, String name) {
+               this(parent, name, null);
+       }
+
+       public WorkspaceElem(RepositoryElem parent, String name, Session session) {
+               super(name);
+               this.session = session;
+               setParent(parent);
+       }
+
+       public synchronized Session getSession() {
+               return session;
+       }
+
+       public synchronized Node getRootNode() {
+               try {
+                       if (session != null)
+                               return session.getRootNode();
+                       else
+                               return null;
+               } catch (RepositoryException e) {
+                       throw new EclipseUiException("Cannot get root node of workspace "
+                                       + getName(), e);
+               }
+       }
+
+       public synchronized void login() {
+               try {
+                       session = ((RepositoryElem) getParent()).repositoryLogin(getName());
+               } catch (RepositoryException e) {
+                       throw new EclipseUiException("Cannot connect to repository "
+                                       + getName(), e);
+               }
+       }
+
+       public Boolean isConnected() {
+               if (session != null && session.isLive())
+                       return true;
+               else
+                       return false;
+       }
+
+       @Override
+       public synchronized void dispose() {
+               logout();
+               super.dispose();
+       }
+
+       /** Logouts the session, does not nothing if there is no live session. */
+       public synchronized void logout() {
+               clearChildren();
+               JcrUtils.logoutQuietly(session);
+               session = null;
+       }
+
+       @Override
+       public synchronized boolean hasChildren() {
+               try {
+                       if (isConnected())
+                               return session.getRootNode().hasNodes();
+                       else
+                               return false;
+               } catch (RepositoryException re) {
+                       throw new EclipseUiException(
+                                       "Unexpected error while checking children node existence",
+                                       re);
+               }
+       }
+
+       /** Override normal behaviour to initialize display of the workspace */
+       @Override
+       public synchronized Object[] getChildren() {
+               if (isLoaded()) {
+                       return super.getChildren();
+               } else {
+                       // initialize current object
+                       try {
+                               Node rootNode;
+                               if (session == null)
+                                       return null;
+                               else
+                                       rootNode = session.getRootNode();
+                               NodeIterator ni = rootNode.getNodes();
+                               while (ni.hasNext()) {
+                                       Node node = ni.nextNode();
+                                       addChild(new SingleJcrNodeElem(this, node, node.getName()));
+                               }
+                               return super.getChildren();
+                       } catch (RepositoryException e) {
+                               throw new EclipseUiException(
+                                               "Cannot initialize WorkspaceNode UI object."
+                                                               + getName(), e);
+                       }
+               }
+       }
+}