Centralize the Data explorer and the Osgi explorer in a single bundle.
authorBruno Sinou <bsinou@argeo.org>
Wed, 10 Dec 2014 18:30:56 +0000 (18:30 +0000)
committerBruno Sinou <bsinou@argeo.org>
Wed, 10 Dec 2014 18:30:56 +0000 (18:30 +0000)
Remove workbench dependencies from eclipse.ui base bundle
Fix a few glitches from latest refactoring
Some cleaning

git-svn-id: https://svn.argeo.org/commons/trunk@7558 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

425 files changed:
demo/argeo_node_rap.properties
demo/argeo_node_rcp_remote.properties
dep/org.argeo.security.dep.node.rap/pom.xml
dep/org.argeo.security.dep.node.rcp/pom.xml
org.argeo.eclipse.ui.workbench/.classpath [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/.project [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/META-INF/MANIFEST.MF [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/META-INF/spring/commands.xml [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/META-INF/spring/jcr.xml [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/META-INF/spring/osgi.xml [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/META-INF/spring/parts.xml [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/WorkbenchConstants.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/WorkbenchUiPlugin.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/AddFolderNode.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/AddPrivileges.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/AddRemoteRepository$RemoteRepositoryLoginDialog$1.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/AddRemoteRepository$RemoteRepositoryLoginDialog.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/AddRemoteRepository.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/CreateWorkspace.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/DeleteNodes.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/DumpNode.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/EditNode.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/GetNodeSize.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/ImportFileSystem.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/OpenEditor.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/Refresh.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/RemoveRemoteRepository.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/SortChildNodes.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/DefaultNodeEditor.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/GenericJcrQueryEditor$1.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/GenericJcrQueryEditor.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserPerspective.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$1.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$2.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$3.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$4.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$TreeObserver.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/JcrImages.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/FullVersioningTreeContentProvider.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/GenericNodeDoubleClickListener.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/JcrBrowserUtils.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/NodeContentProvider$TreeBrowserComparator.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/NodeContentProvider.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/NodeLabelProvider.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/PropertiesContentProvider.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/PropertyLabelProvider.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/SingleNodeAsTreeContentProvider.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/VersionLabelProvider.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/model/MaintainedRepositoryElem.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/model/RemoteRepositoryElem.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/model/RepositoriesElem.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/model/RepositoryElem.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/model/SingleJcrNodeElem.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/model/WorkspaceElem.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/ChangeRightsWizard.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/ChildNodesPage.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/ChooseNameDialog.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/ChooseRightsPage.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/EmptyNodePage.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/GenericNodeEditorInput.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/GenericNodePage$1.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/GenericNodePage$ModifiedFieldListener.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/GenericNodePage.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/GenericPropertyPage$TreeContentProvider.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/GenericPropertyPage.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/ImportFileSystemWizard$1.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/ImportFileSystemWizard$Stats.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/ImportFileSystemWizard.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/NodeRightsManagementPage$1.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/NodeRightsManagementPage$2.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/NodeRightsManagementPage$RightsContentProvider.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/NodeRightsManagementPage.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/NodeVersionHistoryPage$1.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/NodeVersionHistoryPage.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/StringNodeEditorInput.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/messages.properties [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/BundlesView$1.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/BundlesView$2.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/BundlesView$3.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/BundlesView$4.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/BundlesView$5.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/BundlesView$6.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/BundlesView$7.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/BundlesView$BundleContentProvider.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/BundlesView$StateLabelProvider.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/BundlesView.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/ModulesView$1.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/ModulesView$BundleNode.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/ModulesView$ConflictingPackageNode.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/ModulesView$ExportedPackageNode.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/ModulesView$ModulesContentProvider.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/ModulesView$ModulesLabelProvider.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/ModulesView$MultiplePackagesNode.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/ModulesView$ServiceReferenceNode.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/ModulesView.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/OsgiExplorerImages.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/OsgiExplorerPerspective.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/bnd.bnd [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/build.properties [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/icons/active.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/icons/add.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/icons/addFolder.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/icons/addPrivileges.png [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/icons/addRepo.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/icons/addWorkspace.png [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/icons/binary.png [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/icons/browser.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/icons/bundles.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/icons/dumpNode.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/icons/file.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/icons/folder.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/icons/getSize.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/icons/home.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/icons/import_fs.png [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/icons/installed.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/icons/node.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/icons/nodes.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/icons/osgi_explorer.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/icons/query.png [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/icons/refresh.png [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/icons/remote_connected.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/icons/remote_disconnected.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/icons/remove.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/icons/repositories.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/icons/repository_connected.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/icons/repository_disconnected.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/icons/resolved.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/icons/sort.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/icons/starting.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/icons/workspace_connected.png [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/icons/workspace_disconnected.png [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/plugin.xml [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/pom.xml [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/WorkbenchConstants.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/WorkbenchUiPlugin.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/AddFolderNode.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/AddPrivileges.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/AddRemoteRepository.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/CreateWorkspace.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/DeleteNodes.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/DumpNode.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/EditNode.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/GetNodeSize.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/ImportFileSystem.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/OpenEditor.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/Refresh.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/RemoveRemoteRepository.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/SortChildNodes.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/DefaultNodeEditor.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/GenericJcrQueryEditor.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserPerspective.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/JcrImages.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/FullVersioningTreeContentProvider.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/GenericNodeDoubleClickListener.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/JcrBrowserUtils.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/NodeContentProvider.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/NodeLabelProvider.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/PropertiesContentProvider.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/PropertyLabelProvider.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/SingleNodeAsTreeContentProvider.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/VersionLabelProvider.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/model/MaintainedRepositoryElem.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/model/RemoteRepositoryElem.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/model/RepositoriesElem.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/model/RepositoryElem.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/model/SingleJcrNodeElem.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/model/WorkspaceElem.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/parts/ChangeRightsWizard.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/parts/ChildNodesPage.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/parts/ChooseNameDialog.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/parts/ChooseRightsPage.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/parts/EmptyNodePage.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/parts/GenericNodeEditorInput.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/parts/GenericNodePage.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/parts/GenericPropertyPage.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/parts/ImportFileSystemWizard.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/parts/NodeRightsManagementPage.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/parts/NodeVersionHistoryPage.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/parts/StringNodeEditorInput.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/messages.properties [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/osgi/BundlesView.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/osgi/ModulesView.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/osgi/OsgiExplorerImages.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/osgi/OsgiExplorerPerspective.java [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/META-INF/spring/commands.xml [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/META-INF/spring/jcr.xml [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/META-INF/spring/osgi.xml [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/META-INF/spring/parts.xml [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/icons/active.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/icons/add.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/icons/addFolder.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/icons/addPrivileges.png [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/icons/addRepo.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/icons/addWorkspace.png [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/icons/binary.png [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/icons/browser.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/icons/bundles.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/icons/dumpNode.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/icons/file.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/icons/folder.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/icons/getSize.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/icons/home.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/icons/import_fs.png [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/icons/installed.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/icons/node.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/icons/nodes.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/icons/osgi_explorer.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/icons/query.png [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/icons/refresh.png [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/icons/remote_connected.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/icons/remote_disconnected.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/icons/remove.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/icons/repositories.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/icons/repository_connected.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/icons/repository_disconnected.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/icons/resolved.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/icons/sort.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/icons/starting.gif [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/icons/workspace_connected.png [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/icons/workspace_disconnected.png [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/WorkbenchConstants.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/WorkbenchUiPlugin.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/AddFolderNode.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/AddPrivileges.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/AddRemoteRepository$1.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/AddRemoteRepository$RemoteRepositoryLoginDialog.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/AddRemoteRepository.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/CreateWorkspace.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/DeleteNodes.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/DumpNode.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/EditNode.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/GetNodeSize.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/ImportFileSystem.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/OpenEditor.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/Refresh.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/RemoveRemoteRepository.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/SortChildNodes.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/DefaultNodeEditor.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/GenericJcrQueryEditor$1.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/GenericJcrQueryEditor.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserPerspective.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$1.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$2.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$3.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$4.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$TreeObserver.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/JcrImages.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/ChangeRightsWizard.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/ChildNodesPage.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/ChooseNameDialog.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/ChooseRightsPage.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/DefaultNodeLabelProvider.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/EmptyNodePage.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/FullVersioningTreeContentProvider.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/GenericNodeDoubleClickListener.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/GenericNodeEditorInput.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/GenericNodePage$1.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/GenericNodePage$ModifiedFieldListener.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/GenericNodePage.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/GenericPropertyPage$TreeContentProvider.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/GenericPropertyPage.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/ImportFileSystemWizard$1.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/ImportFileSystemWizard$Stats.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/ImportFileSystemWizard.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/JcrUiUtils.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeContentProvider$TreeBrowserComparator.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeContentProvider.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeLabelProvider.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeRightsManagementPage$1.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeRightsManagementPage$2.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeRightsManagementPage$RightsContentProvider.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeRightsManagementPage.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeVersionHistoryPage$1.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeVersionHistoryPage.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/PropertiesContentProvider.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/PropertyLabelProvider.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/SingleNodeAsTreeContentProvider.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/StringNodeEditorInput.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/TreeObjectsComparator.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/VersionLabelProvider.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/model/MaintainedRepositoryElem.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/model/RemoteRepositoryElem.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/model/RepositoriesElem.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/model/RepositoryElem.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/model/SingleJcrNodeElem.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/model/WorkspaceElem.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/messages.properties [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/BundlesView$1.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/BundlesView$2.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/BundlesView$3.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/BundlesView$4.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/BundlesView$5.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/BundlesView$6.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/BundlesView$7.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/BundlesView$BundleContentProvider.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/BundlesView$StateLabelProvider.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/BundlesView.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/ModulesView$1.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/ModulesView$BundleNode.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/ModulesView$ConflictingPackageNode.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/ModulesView$ExportedPackageNode.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/ModulesView$ModulesContentProvider.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/ModulesView$ModulesLabelProvider.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/ModulesView$MultiplePackagesNode.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/ModulesView$ServiceReferenceNode.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/ModulesView.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/OsgiExplorerImages.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/OsgiExplorerPerspective.class [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/classes/plugin.xml [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/maven-archiver/pom.properties [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst [new file with mode: 0644]
org.argeo.eclipse.ui.workbench/target/org.argeo.eclipse.ui.workbench-2.1.12-SNAPSHOT.jar [new file with mode: 0644]
org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/dialogs/Error.java [deleted file]
org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/jcr/AbstractNodeContentProvider.java
org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/jcr/DefaultNodeLabelProvider.java [deleted file]
org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/jcr/JcrImages.java [deleted file]
org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/jcr/JcrPreferenceStore.java
org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/jcr/JcrUiPlugin.java [deleted file]
org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/jcr/JcrUiUtils.java
org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/jcr/SimpleNodeContentProvider.java
org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/jcr/commands/AddFileFolder.java [deleted file]
org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/jcr/commands/DeleteNodes.java [deleted file]
org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/jcr/commands/OpenGenericJcrQueryEditor.java [deleted file]
org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/jcr/commands/Refresh.java [deleted file]
org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/jcr/views/AbstractJcrBrowser.java
org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/utils/CommandUtils.java
org.argeo.jcr.ui.explorer/.classpath [deleted file]
org.argeo.jcr.ui.explorer/.project [deleted file]
org.argeo.jcr.ui.explorer/META-INF/spring/commands.xml [deleted file]
org.argeo.jcr.ui.explorer/META-INF/spring/editors.xml [deleted file]
org.argeo.jcr.ui.explorer/META-INF/spring/jcr.xml [deleted file]
org.argeo.jcr.ui.explorer/META-INF/spring/osgi.xml [deleted file]
org.argeo.jcr.ui.explorer/META-INF/spring/views.xml [deleted file]
org.argeo.jcr.ui.explorer/bnd.bnd [deleted file]
org.argeo.jcr.ui.explorer/build.properties [deleted file]
org.argeo.jcr.ui.explorer/icons/add.gif [deleted file]
org.argeo.jcr.ui.explorer/icons/addFolder.gif [deleted file]
org.argeo.jcr.ui.explorer/icons/addPrivileges.png [deleted file]
org.argeo.jcr.ui.explorer/icons/addRepo.gif [deleted file]
org.argeo.jcr.ui.explorer/icons/addWorkspace.png [deleted file]
org.argeo.jcr.ui.explorer/icons/browser.gif [deleted file]
org.argeo.jcr.ui.explorer/icons/dumpNode.gif [deleted file]
org.argeo.jcr.ui.explorer/icons/getSize.gif [deleted file]
org.argeo.jcr.ui.explorer/icons/import_fs.png [deleted file]
org.argeo.jcr.ui.explorer/icons/nodes.gif [deleted file]
org.argeo.jcr.ui.explorer/icons/query.png [deleted file]
org.argeo.jcr.ui.explorer/icons/refresh.png [deleted file]
org.argeo.jcr.ui.explorer/icons/remove.gif [deleted file]
org.argeo.jcr.ui.explorer/icons/repositories.gif [deleted file]
org.argeo.jcr.ui.explorer/icons/sort.gif [deleted file]
org.argeo.jcr.ui.explorer/plugin.properties [deleted file]
org.argeo.jcr.ui.explorer/plugin.xml [deleted file]
org.argeo.jcr.ui.explorer/pom.xml [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/JcrExplorerConstants.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/JcrExplorerPerspective.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/JcrExplorerPlugin.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/JcrExplorerView.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/browser/NodeContentProvider.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/browser/NodeLabelProvider.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/browser/PropertiesContentProvider.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/commands/AddFolderNode.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/commands/AddPrivileges.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/commands/AddRemoteRepository.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/commands/CreateWorkspace.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/commands/DeleteNodes.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/commands/DumpNode.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/commands/EditNode.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/commands/GetNodeSize.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/commands/ImportFileSystem.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/commands/OpenGenericNodeEditor.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/commands/Refresh.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/commands/RemoveRemoteRepository.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/commands/SortChildNodes.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/dialogs/ChooseNameDialog.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/editors/ChildNodesPage.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/editors/EmptyNodePage.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/editors/GenericJcrQueryEditor.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/editors/GenericNodeEditor.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/editors/GenericNodeEditorInput.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/editors/GenericNodePage.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/editors/GenericPropertyPage.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/editors/NodeRightsManagementPage.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/editors/NodeVersionHistoryPage.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/editors/StringNodeEditorInput.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/messages.properties [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/model/MaintainedRepositoryElem.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/model/RemoteRepositoryElem.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/model/RepositoriesElem.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/model/RepositoryElem.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/model/SingleJcrNodeElem.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/model/WorkspaceElem.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/providers/FullVersioningTreeContentProvider.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/providers/PropertyLabelProvider.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/providers/SingleNodeAsTreeContentProvider.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/providers/VersionLabelProvider.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/utils/GenericNodeDoubleClickListener.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/utils/JcrUiUtils.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/utils/TreeObjectsComparator.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/views/GenericJcrBrowser.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/wizards/ChangeRightsWizard.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/wizards/ChooseRightsPage.java [deleted file]
org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/wizards/ImportFileSystemWizard.java [deleted file]
org.argeo.osgi.ui.explorer/.classpath [deleted file]
org.argeo.osgi.ui.explorer/.project [deleted file]
org.argeo.osgi.ui.explorer/.settings/org.eclipse.jdt.core.prefs [deleted file]
org.argeo.osgi.ui.explorer/bnd.bnd [deleted file]
org.argeo.osgi.ui.explorer/build.properties [deleted file]
org.argeo.osgi.ui.explorer/icons/active.gif [deleted file]
org.argeo.osgi.ui.explorer/icons/bundles.gif [deleted file]
org.argeo.osgi.ui.explorer/icons/installed.gif [deleted file]
org.argeo.osgi.ui.explorer/icons/osgi_explorer.gif [deleted file]
org.argeo.osgi.ui.explorer/icons/resolved.gif [deleted file]
org.argeo.osgi.ui.explorer/icons/starting.gif [deleted file]
org.argeo.osgi.ui.explorer/plugin.xml [deleted file]
org.argeo.osgi.ui.explorer/pom.xml [deleted file]
org.argeo.osgi.ui.explorer/src/org/argeo/osgi/ui/explorer/OsgiExplorerImages.java [deleted file]
org.argeo.osgi.ui.explorer/src/org/argeo/osgi/ui/explorer/OsgiExplorerPerspective.java [deleted file]
org.argeo.osgi.ui.explorer/src/org/argeo/osgi/ui/explorer/OsgiExplorerPlugin.java [deleted file]
org.argeo.osgi.ui.explorer/src/org/argeo/osgi/ui/explorer/views/BundlesView.java [deleted file]
org.argeo.osgi.ui.explorer/src/org/argeo/osgi/ui/explorer/views/ModulesView.java [deleted file]
pom.xml

index 2ea940032428f622235f9b2308ea527cd8150c37..c927c4472bac6b6c86480824f6faf218a738d0bc 100644 (file)
@@ -26,9 +26,6 @@ org.eclipse.equinox.http.jetty.log.stderr.threshold=info
 org.eclipse.equinox.http.jetty.context.path=/ui
 
 # Initial perspective
-#org.argeo.security.ui.initialPerspective=org.argeo.osgi.ui.explorer.perspective
-#org.argeo.security.ui.initialPerspective=org.argeo.jcr.ui.explorer.perspective
-
 log4j.configuration=file:../../log4j.properties
 argeo.server.tomcat.config=conf/default-server-ssl.xml
 
index 1a6dfba67e6aa5d0a2c4d77aee4eca8df0f057ab..b9a96164128164bc5ca69330977277b37fa6e462 100644 (file)
@@ -4,7 +4,6 @@ org.argeo.node.repofactory.jackrabbit,\
 org.argeo.security.dao.jackrabbit,\
 org.argeo.security.equinox,\
 
-#org.argeo.security.ui.initialPerspective=org.argeo.osgi.ui.explorer.perspective
 argeo.node.repo.uri=http://localhost:7070/data/jcr/node
 
 log4j.configuration=file:../../log4j.properties
index b3ea1f45cfdc21a6a4138936586c931476c68762..9e0875511240da7600ab4eaba493793d3503b0ce 100644 (file)
                <!-- Applications -->
                <dependency>
                        <groupId>org.argeo.commons</groupId>
-                       <artifactId>org.argeo.jcr.ui.explorer</artifactId>
-                       <version>2.1.12-SNAPSHOT</version>
-               </dependency>
-               <dependency>
-                       <groupId>org.argeo.commons</groupId>
-                       <artifactId>org.argeo.osgi.ui.explorer</artifactId>
+                       <artifactId>org.argeo.eclipse.ui.workbench</artifactId>
                        <version>2.1.12-SNAPSHOT</version>
                </dependency>
                <dependency>
index ee5580d2d44418ba0df58358730d1d7cb5536690..9f8b48de08d4d6b5b6add84ec12fd827f4c3aef2 100644 (file)
                <!-- Applications -->
                <dependency>
                        <groupId>org.argeo.commons</groupId>
-                       <artifactId>org.argeo.jcr.ui.explorer</artifactId>
-                       <version>2.1.12-SNAPSHOT</version>
-               </dependency>
-               <dependency>
-                       <groupId>org.argeo.commons</groupId>
-                       <artifactId>org.argeo.osgi.ui.explorer</artifactId>
+                       <artifactId>org.argeo.eclipse.ui.workbench</artifactId>
                        <version>2.1.12-SNAPSHOT</version>
                </dependency>
                <dependency>
diff --git a/org.argeo.eclipse.ui.workbench/.classpath b/org.argeo.eclipse.ui.workbench/.classpath
new file mode 100644 (file)
index 0000000..d2953a6
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="src" path="src" />
+       <classpathentry kind="con"
+               path="org.eclipse.pde.core.requiredPlugins" />
+       <classpathentry kind="con"
+               path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6" />
+       <classpathentry kind="output" path="bin" />
+</classpath>
diff --git a/org.argeo.eclipse.ui.workbench/.project b/org.argeo.eclipse.ui.workbench/.project
new file mode 100644 (file)
index 0000000..c8666b0
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.argeo.eclipse.ui.workbench</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.jdt.core.javabuilder</name>
+                       <arguments />
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.ManifestBuilder</name>
+                       <arguments />
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.SchemaBuilder</name>
+                       <arguments />
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.pde.PluginNature</nature>
+               <nature>org.eclipse.jdt.core.javanature</nature>
+       </natures>
+</projectDescription>
diff --git a/org.argeo.eclipse.ui.workbench/META-INF/MANIFEST.MF b/org.argeo.eclipse.ui.workbench/META-INF/MANIFEST.MF
new file mode 100644 (file)
index 0000000..f74e01c
--- /dev/null
@@ -0,0 +1,156 @@
+Manifest-Version: 1.0\r
+Bundle-ActivationPolicy: lazy\r
+Bundle-Activator: org.argeo.eclipse.ui.workbench.WorkbenchUiPlugin\r
+Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt\r
+Bundle-ManifestVersion: 2\r
+Bundle-Name: Commons Eclipse UI Workbench\r
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6\r
+Bundle-SymbolicName: org.argeo.eclipse.ui.workbench;singleton:=true\r
+Bundle-Version: 2.1.12.SNAPSHOT-r201412101730\r
+Export-Package: org.argeo.eclipse.ui.workbench;version="2.1.12.SNAPSHOT-r201412101730";\r
+  uses:="org.eclipse.jface.resource,\r
+   org.apache.commons.logging,\r
+   org.eclipse.ui.plugin,\r
+   org.osgi.framework",\r
+ org.argeo.eclipse.ui.workbench.commands;version="2.1.12.SNAPSHOT-r201412101730";\r
+  uses:="javax.jcr,\r
+   org.eclipse.ui.handlers,\r
+   org.argeo.eclipse.ui.workbench.jcr.browser.model,\r
+   org.argeo.eclipse.ui.dialogs,\r
+   org.eclipse.ui,\r
+   org.argeo.eclipse.ui.workbench,\r
+   org.eclipse.jface.viewers,\r
+   org.eclipse.core.commands,\r
+   org.argeo.eclipse.ui.workbench.jcr,\r
+   org.argeo.eclipse.ui,\r
+   org.argeo,\r
+   org.eclipse.jface.wizard,\r
+   org.eclipse.swt.widgets,\r
+   org.eclipse.swt.events,\r
+   org.eclipse.swt.layout,\r
+   org.argeo.util.security,\r
+   org.argeo.jcr,\r
+   org.eclipse.swt.graphics,\r
+   org.eclipse.jface.dialogs,\r
+   org.argeo.eclipse.ui.utils,\r
+   org.argeo.eclipse.ui.jcr.editors,\r
+   org.eclipse.ui.commands",\r
+ org.argeo.eclipse.ui.workbench.jcr;version="2.1.12.SNAPSHOT-r201412101730";\r
+  uses:="javax.jcr,\r
+   org.argeo,\r
+   org.eclipse.ui.forms.editor,\r
+   org.eclipse.core.runtime,\r
+   org.argeo.jcr,\r
+   org.eclipse.ui,\r
+   org.argeo.eclipse.ui.workbench,\r
+   org.eclipse.swt.widgets,\r
+   org.eclipse.swt.layout,\r
+   org.argeo.eclipse.ui.jcr.editors,\r
+   org.argeo.eclipse.ui.workbench.jcr.browser.model,\r
+   org.eclipse.jface.viewers,\r
+   org.argeo.eclipse.ui.jcr,\r
+   org.apache.commons.logging,\r
+   javax.jcr.observation,\r
+   org.argeo.eclipse.ui.jcr.utils,\r
+   org.eclipse.swt.custom,\r
+   org.eclipse.ui.part,\r
+   org.eclipse.jface.action,\r
+   org.argeo.util.security,\r
+   org.argeo.eclipse.ui,\r
+   org.eclipse.jface.resource,\r
+   org.eclipse.swt.graphics",\r
+ org.argeo.eclipse.ui.workbench.jcr.internal.model;version="2.1.12.SNAPSHOT-r201412101730";\r
+  uses:="org.argeo,\r
+   javax.jcr,\r
+   org.argeo.jcr,\r
+   org.argeo.eclipse.ui,\r
+   org.argeo.util.security",\r
+ org.argeo.eclipse.ui.workbench.osgi;version="2.1.12.SNAPSHOT-r201412101730";\r
+  uses:="org.eclipse.jface.viewers,\r
+   org.osgi.framework,\r
+   org.eclipse.swt.widgets,\r
+   org.eclipse.swt.graphics,\r
+   org.argeo.eclipse.ui.specific,\r
+   org.argeo.eclipse.ui.workbench,\r
+   org.eclipse.ui.part,\r
+   org.argeo.eclipse.ui,\r
+   org.osgi.service.packageadmin,\r
+   org.apache.commons.logging,\r
+   org.eclipse.jface.resource,\r
+   org.eclipse.ui"\r
+Import-Package: javax.jcr;version="[2.0,3)",\r
+ javax.jcr.nodetype;version="[2.0,3)",\r
+ javax.jcr.observation;version="[2.0,3)",\r
+ javax.jcr.security;version="[2.0,3)",\r
+ javax.jcr.version;version="[2.0,3)",\r
+ org.apache.commons.io;version="[1.4,2)",\r
+ org.apache.commons.logging;version="[1.1,2)",\r
+ org.argeo;version="[2.1,3)",\r
+ org.argeo.eclipse.spring;version="[2.1,3)",\r
+ org.argeo.eclipse.ui;version="[2.1,3)",\r
+ org.argeo.eclipse.ui.dialogs;version="[2.1,3)",\r
+ org.argeo.eclipse.ui.jcr;version="[2.1,3)",\r
+ org.argeo.eclipse.ui.jcr.editors;version="[2.1,3)",\r
+ org.argeo.eclipse.ui.jcr.utils;version="[2.1,3)",\r
+ org.argeo.eclipse.ui.specific;version="[2.1,3)",\r
+ org.argeo.eclipse.ui.utils;version="[2.1,3)",\r
+ org.argeo.eclipse.ui.workbench,\r
+ org.argeo.eclipse.ui.workbench.jcr.internal.model,\r
+ org.argeo.jcr;version="[2.1,3)",\r
+ org.argeo.security.crypto,\r
+ org.argeo.util.security;version="[2.1,3)",\r
+ org.eclipse.core.commands,\r
+ org.eclipse.core.runtime;version="[3.4,4)",\r
+ org.eclipse.jface.action,\r
+ org.eclipse.jface.dialogs,\r
+ org.eclipse.jface.operation,\r
+ org.eclipse.jface.resource,\r
+ org.eclipse.jface.viewers,\r
+ org.eclipse.jface.wizard,\r
+ org.eclipse.swt.custom,\r
+ org.eclipse.swt.events,\r
+ org.eclipse.swt.graphics,\r
+ org.eclipse.swt.layout,\r
+ org.eclipse.swt.widgets,\r
+ org.eclipse.ui;ui.workbench=split,\r
+ org.eclipse.ui.commands,\r
+ org.eclipse.ui.forms,\r
+ org.eclipse.ui.forms.editor,\r
+ org.eclipse.ui.forms.widgets,\r
+ org.eclipse.ui.handlers,\r
+ org.eclipse.ui.part;ui.workbench=split,\r
+ org.eclipse.ui.plugin,\r
+ org.osgi.framework;version="[1.3,2)",\r
+ org.osgi.service.packageadmin;version="[1.2,2)",\r
+ org.springframework.beans.factory;version="[2.5,3)",\r
+ org.springframework.core.io.support;version="[2.5,3)"\r
+Include-Resource: org/argeo/eclipse/ui/workbench/messages.properties=src\r
+ /org/argeo/eclipse/ui/workbench/messages.properties,META-INF/spring/jcr\r
+ .xml=META-INF/spring/jcr.xml,META-INF/spring/commands.xml=META-INF/spri\r
+ ng/commands.xml,META-INF/spring/parts.xml=META-INF/spring/parts.xml,MET\r
+ A-INF/spring/osgi.xml=META-INF/spring/osgi.xml,plugin.xml=plugin.xml,ic\r
+ ons/resolved.gif=icons/resolved.gif,icons/refresh.png=icons/refresh.png\r
+ ,icons/getSize.gif=icons/getSize.gif,icons/addFolder.gif=icons/addFolde\r
+ r.gif,icons/workspace_connected.png=icons/workspace_connected.png,icons\r
+ /remote_disconnected.gif=icons/remote_disconnected.gif,icons/import_fs.\r
+ png=icons/import_fs.png,icons/bundles.gif=icons/bundles.gif,icons/repos\r
+ itories.gif=icons/repositories.gif,icons/query.png=icons/query.png,icon\r
+ s/workspace_disconnected.png=icons/workspace_disconnected.png,icons/rep\r
+ ository_connected.gif=icons/repository_connected.gif,icons/addPrivilege\r
+ s.png=icons/addPrivileges.png,icons/starting.gif=icons/starting.gif,ico\r
+ ns/remote_connected.gif=icons/remote_connected.gif,icons/node.gif=icons\r
+ /node.gif,icons/installed.gif=icons/installed.gif,icons/folder.gif=icon\r
+ s/folder.gif,icons/browser.gif=icons/browser.gif,icons/repository_disco\r
+ nnected.gif=icons/repository_disconnected.gif,icons/home.gif=icons/home\r
+ .gif,icons/sort.gif=icons/sort.gif,icons/nodes.gif=icons/nodes.gif,icon\r
+ s/add.gif=icons/add.gif,icons/dumpNode.gif=icons/dumpNode.gif,icons/act\r
+ ive.gif=icons/active.gif,icons/osgi_explorer.gif=icons/osgi_explorer.gi\r
+ f,icons/remove.gif=icons/remove.gif,icons/addWorkspace.png=icons/addWor\r
+ kspace.png,icons/addRepo.gif=icons/addRepo.gif,icons/file.gif=icons/fil\r
+ e.gif,icons/binary.png=icons/binary.png\r
+Private-Package: icons,.,org.argeo.eclipse.ui.workbench.jcr.browser.inte\r
+ rnal\r
+Require-Bundle: org.eclipse.ui;resolution:=optional,org.eclipse.core.run\r
+ time,org.eclipse.rap.ui;resolution:=optional,org.eclipse.rap.ui.workben\r
+ ch;resolution:=optional\r
+SLC-Category: org.argeo.commons\r
diff --git a/org.argeo.eclipse.ui.workbench/META-INF/spring/commands.xml b/org.argeo.eclipse.ui.workbench/META-INF/spring/commands.xml
new file mode 100644 (file)
index 0000000..5466e75
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+        http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+       <bean id="addRemoteRepository" class="org.argeo.eclipse.ui.workbench.commands.AddRemoteRepository">
+               <property name="repositoryFactory" ref="repositoryFactory" />
+               <property name="nodeRepository" ref="nodeRepository" />
+               <property name="keyring" ref="keyring" />
+       </bean>
+</beans>
\ No newline at end of file
diff --git a/org.argeo.eclipse.ui.workbench/META-INF/spring/jcr.xml b/org.argeo.eclipse.ui.workbench/META-INF/spring/jcr.xml
new file mode 100644 (file)
index 0000000..e074154
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
+       xmlns:p="http://www.springframework.org/schema/p"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+        http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd">
+
+       <bean id="repositoryRegister" class="org.argeo.jcr.DefaultRepositoryRegister" />
+
+</beans>
diff --git a/org.argeo.eclipse.ui.workbench/META-INF/spring/osgi.xml b/org.argeo.eclipse.ui.workbench/META-INF/spring/osgi.xml
new file mode 100644 (file)
index 0000000..255462b
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<beans:beans xmlns="http://www.springframework.org/schema/osgi"\r
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"\r
+       xmlns:osgi="http://www.springframework.org/schema/osgi"\r
+       xsi:schemaLocation="http://www.springframework.org/schema/osgi  \r
+       http://www.springframework.org/schema/osgi/spring-osgi-1.1.xsd\r
+       http://www.springframework.org/schema/beans   \r
+       http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"\r
+       osgi:default-timeout="30000">\r
+\r
+       <list id="repositories" interface="javax.jcr.Repository"\r
+               cardinality="0..N">\r
+               <listener ref="repositoryRegister" bind-method="register"\r
+                       unbind-method="unregister" />\r
+       </list>\r
+\r
+       <reference id="nodeRepository" interface="javax.jcr.Repository"\r
+               filter="(argeo.jcr.repository.alias=node)" />\r
+       <reference id="repositoryFactory" interface="javax.jcr.RepositoryFactory" />\r
+\r
+       <reference id="keyring" interface="org.argeo.security.crypto.CryptoKeyring" />\r
+\r
+</beans:beans>
\ No newline at end of file
diff --git a/org.argeo.eclipse.ui.workbench/META-INF/spring/parts.xml b/org.argeo.eclipse.ui.workbench/META-INF/spring/parts.xml
new file mode 100644 (file)
index 0000000..78aec86
--- /dev/null
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
+       xmlns:p="http://www.springframework.org/schema/p"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+        http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd">
+
+       <!-- EDITORS -->
+       <bean id="genericJcrQueryEditor"
+               class="org.argeo.eclipse.ui.workbench.jcr.GenericJcrQueryEditor"
+               scope="prototype">
+               <property name="session" ref="nodeSession" />
+       </bean>
+       <bean id="defaultNodeEditor" class="org.argeo.eclipse.ui.workbench.jcr.DefaultNodeEditor"
+               scope="prototype">
+       </bean>
+
+       <!-- Views -->
+       <bean id="jcrBrowserView" class="org.argeo.eclipse.ui.workbench.jcr.JcrBrowserView"
+               scope="prototype">
+               <property name="repositoryRegister" ref="repositoryRegister" />
+               <property name="repositoryFactory" ref="repositoryFactory" />
+               <property name="nodeRepository" ref="nodeRepository" />
+               <property name="keyring" ref="keyring" />
+       </bean>
+</beans>
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/WorkbenchConstants.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/WorkbenchConstants.class
new file mode 100644 (file)
index 0000000..41e9b5c
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/WorkbenchConstants.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/WorkbenchUiPlugin.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/WorkbenchUiPlugin.class
new file mode 100644 (file)
index 0000000..8e4d9a0
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/WorkbenchUiPlugin.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/AddFolderNode.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/AddFolderNode.class
new file mode 100644 (file)
index 0000000..c414000
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/AddFolderNode.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/AddPrivileges.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/AddPrivileges.class
new file mode 100644 (file)
index 0000000..ea4825c
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/AddPrivileges.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/AddRemoteRepository$RemoteRepositoryLoginDialog$1.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/AddRemoteRepository$RemoteRepositoryLoginDialog$1.class
new file mode 100644 (file)
index 0000000..8de1c2e
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/AddRemoteRepository$RemoteRepositoryLoginDialog$1.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/AddRemoteRepository$RemoteRepositoryLoginDialog.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/AddRemoteRepository$RemoteRepositoryLoginDialog.class
new file mode 100644 (file)
index 0000000..7ff2720
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/AddRemoteRepository$RemoteRepositoryLoginDialog.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/AddRemoteRepository.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/AddRemoteRepository.class
new file mode 100644 (file)
index 0000000..f2c8591
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/AddRemoteRepository.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/CreateWorkspace.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/CreateWorkspace.class
new file mode 100644 (file)
index 0000000..d95fa28
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/CreateWorkspace.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/DeleteNodes.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/DeleteNodes.class
new file mode 100644 (file)
index 0000000..c7d4f74
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/DeleteNodes.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/DumpNode.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/DumpNode.class
new file mode 100644 (file)
index 0000000..ed262c2
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/DumpNode.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/EditNode.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/EditNode.class
new file mode 100644 (file)
index 0000000..4d96c3e
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/EditNode.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/GetNodeSize.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/GetNodeSize.class
new file mode 100644 (file)
index 0000000..d6744c1
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/GetNodeSize.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/ImportFileSystem.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/ImportFileSystem.class
new file mode 100644 (file)
index 0000000..787ab9a
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/ImportFileSystem.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/OpenEditor.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/OpenEditor.class
new file mode 100644 (file)
index 0000000..f48bd99
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/OpenEditor.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/Refresh.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/Refresh.class
new file mode 100644 (file)
index 0000000..bd8eca8
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/Refresh.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/RemoveRemoteRepository.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/RemoveRemoteRepository.class
new file mode 100644 (file)
index 0000000..645de5a
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/RemoveRemoteRepository.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/SortChildNodes.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/SortChildNodes.class
new file mode 100644 (file)
index 0000000..d7d558c
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/commands/SortChildNodes.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/DefaultNodeEditor.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/DefaultNodeEditor.class
new file mode 100644 (file)
index 0000000..6a4315c
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/DefaultNodeEditor.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/GenericJcrQueryEditor$1.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/GenericJcrQueryEditor$1.class
new file mode 100644 (file)
index 0000000..e973708
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/GenericJcrQueryEditor$1.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/GenericJcrQueryEditor.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/GenericJcrQueryEditor.class
new file mode 100644 (file)
index 0000000..0989acd
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/GenericJcrQueryEditor.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserPerspective.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserPerspective.class
new file mode 100644 (file)
index 0000000..9bd3254
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserPerspective.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$1.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$1.class
new file mode 100644 (file)
index 0000000..c393161
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$1.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$2.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$2.class
new file mode 100644 (file)
index 0000000..cab531b
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$2.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$3.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$3.class
new file mode 100644 (file)
index 0000000..7b18b88
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$3.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$4.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$4.class
new file mode 100644 (file)
index 0000000..8422bb4
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$4.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$TreeObserver.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$TreeObserver.class
new file mode 100644 (file)
index 0000000..e88d490
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$TreeObserver.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView.class
new file mode 100644 (file)
index 0000000..745ec3f
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/JcrImages.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/JcrImages.class
new file mode 100644 (file)
index 0000000..23afd71
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/JcrImages.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/FullVersioningTreeContentProvider.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/FullVersioningTreeContentProvider.class
new file mode 100644 (file)
index 0000000..0d0bb84
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/FullVersioningTreeContentProvider.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/GenericNodeDoubleClickListener.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/GenericNodeDoubleClickListener.class
new file mode 100644 (file)
index 0000000..b479322
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/GenericNodeDoubleClickListener.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/JcrBrowserUtils.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/JcrBrowserUtils.class
new file mode 100644 (file)
index 0000000..a8e4653
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/JcrBrowserUtils.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/NodeContentProvider$TreeBrowserComparator.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/NodeContentProvider$TreeBrowserComparator.class
new file mode 100644 (file)
index 0000000..a531bae
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/NodeContentProvider$TreeBrowserComparator.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/NodeContentProvider.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/NodeContentProvider.class
new file mode 100644 (file)
index 0000000..711885b
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/NodeContentProvider.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/NodeLabelProvider.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/NodeLabelProvider.class
new file mode 100644 (file)
index 0000000..17972e0
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/NodeLabelProvider.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/PropertiesContentProvider.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/PropertiesContentProvider.class
new file mode 100644 (file)
index 0000000..517945a
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/PropertiesContentProvider.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/PropertyLabelProvider.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/PropertyLabelProvider.class
new file mode 100644 (file)
index 0000000..0bfc00c
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/PropertyLabelProvider.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/SingleNodeAsTreeContentProvider.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/SingleNodeAsTreeContentProvider.class
new file mode 100644 (file)
index 0000000..63f913d
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/SingleNodeAsTreeContentProvider.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/VersionLabelProvider.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/VersionLabelProvider.class
new file mode 100644 (file)
index 0000000..228fd9e
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/VersionLabelProvider.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/model/MaintainedRepositoryElem.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/model/MaintainedRepositoryElem.class
new file mode 100644 (file)
index 0000000..df5012b
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/model/MaintainedRepositoryElem.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/model/RemoteRepositoryElem.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/model/RemoteRepositoryElem.class
new file mode 100644 (file)
index 0000000..d4ff92e
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/model/RemoteRepositoryElem.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/model/RepositoriesElem.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/model/RepositoriesElem.class
new file mode 100644 (file)
index 0000000..b11d2ee
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/model/RepositoriesElem.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/model/RepositoryElem.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/model/RepositoryElem.class
new file mode 100644 (file)
index 0000000..1e8cf79
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/model/RepositoryElem.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/model/SingleJcrNodeElem.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/model/SingleJcrNodeElem.class
new file mode 100644 (file)
index 0000000..6dbea56
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/model/SingleJcrNodeElem.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/model/WorkspaceElem.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/model/WorkspaceElem.class
new file mode 100644 (file)
index 0000000..7e0e9ee
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/model/WorkspaceElem.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/ChangeRightsWizard.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/ChangeRightsWizard.class
new file mode 100644 (file)
index 0000000..995d722
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/ChangeRightsWizard.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/ChildNodesPage.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/ChildNodesPage.class
new file mode 100644 (file)
index 0000000..1aa28fb
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/ChildNodesPage.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/ChooseNameDialog.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/ChooseNameDialog.class
new file mode 100644 (file)
index 0000000..52e3d50
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/ChooseNameDialog.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/ChooseRightsPage.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/ChooseRightsPage.class
new file mode 100644 (file)
index 0000000..acd7b7f
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/ChooseRightsPage.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/EmptyNodePage.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/EmptyNodePage.class
new file mode 100644 (file)
index 0000000..aa84ef4
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/EmptyNodePage.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/GenericNodeEditorInput.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/GenericNodeEditorInput.class
new file mode 100644 (file)
index 0000000..e11b8a5
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/GenericNodeEditorInput.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/GenericNodePage$1.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/GenericNodePage$1.class
new file mode 100644 (file)
index 0000000..ccf96ff
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/GenericNodePage$1.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/GenericNodePage$ModifiedFieldListener.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/GenericNodePage$ModifiedFieldListener.class
new file mode 100644 (file)
index 0000000..7bbeef7
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/GenericNodePage$ModifiedFieldListener.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/GenericNodePage.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/GenericNodePage.class
new file mode 100644 (file)
index 0000000..5844f31
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/GenericNodePage.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/GenericPropertyPage$TreeContentProvider.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/GenericPropertyPage$TreeContentProvider.class
new file mode 100644 (file)
index 0000000..fa8690a
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/GenericPropertyPage$TreeContentProvider.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/GenericPropertyPage.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/GenericPropertyPage.class
new file mode 100644 (file)
index 0000000..88f5db7
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/GenericPropertyPage.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/ImportFileSystemWizard$1.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/ImportFileSystemWizard$1.class
new file mode 100644 (file)
index 0000000..9c2a7f5
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/ImportFileSystemWizard$1.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/ImportFileSystemWizard$Stats.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/ImportFileSystemWizard$Stats.class
new file mode 100644 (file)
index 0000000..9ff6184
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/ImportFileSystemWizard$Stats.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/ImportFileSystemWizard.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/ImportFileSystemWizard.class
new file mode 100644 (file)
index 0000000..fdcba38
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/ImportFileSystemWizard.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/NodeRightsManagementPage$1.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/NodeRightsManagementPage$1.class
new file mode 100644 (file)
index 0000000..ff7130f
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/NodeRightsManagementPage$1.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/NodeRightsManagementPage$2.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/NodeRightsManagementPage$2.class
new file mode 100644 (file)
index 0000000..b7ea93f
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/NodeRightsManagementPage$2.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/NodeRightsManagementPage$RightsContentProvider.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/NodeRightsManagementPage$RightsContentProvider.class
new file mode 100644 (file)
index 0000000..6863d53
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/NodeRightsManagementPage$RightsContentProvider.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/NodeRightsManagementPage.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/NodeRightsManagementPage.class
new file mode 100644 (file)
index 0000000..acee590
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/NodeRightsManagementPage.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/NodeVersionHistoryPage$1.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/NodeVersionHistoryPage$1.class
new file mode 100644 (file)
index 0000000..808af35
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/NodeVersionHistoryPage$1.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/NodeVersionHistoryPage.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/NodeVersionHistoryPage.class
new file mode 100644 (file)
index 0000000..dc852d0
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/NodeVersionHistoryPage.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/StringNodeEditorInput.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/StringNodeEditorInput.class
new file mode 100644 (file)
index 0000000..4309724
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/jcr/internal/parts/StringNodeEditorInput.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/messages.properties b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/messages.properties
new file mode 100644 (file)
index 0000000..3023c52
--- /dev/null
@@ -0,0 +1,28 @@
+## English labels for Agreo JCR UI application 
+
+## Generic labels 
+
+## Errors & warnings 
+errorUnvalidNtFolderNodeType= Error: folder can only be created on a Jcr Node
+warningInvalidNodeToImport=Can only import to a node
+warningInvalidMultipleSelection=This functionality is implemented only on a single node for the time being.
+warningUnversionableNode= Current node is not versionable.
+warningNoChildNode= Current node has no child.
+
+## Commands 
+getNodeSizeCmdLbl= Get approx. size
+addFolderNodeCmdLbl= Add Folder
+
+## GenericNodeEditor 
+nodeEditorLbl=Generic node editor
+genericNodePageTitle=Properties
+childNodesPageTitle=Children
+nodeRightsManagementPageTitle=Rights
+nodeVersionHistoryPageTitle=History
+
+# History 
+versionTreeSectionTitle=Version list
+versionHistorySectionTitle=History
+## Dummy ones 
+testLbl=Internationalizations of messages seems to work properly.
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/BundlesView$1.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/BundlesView$1.class
new file mode 100644 (file)
index 0000000..5b50f45
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/BundlesView$1.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/BundlesView$2.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/BundlesView$2.class
new file mode 100644 (file)
index 0000000..f25e0e6
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/BundlesView$2.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/BundlesView$3.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/BundlesView$3.class
new file mode 100644 (file)
index 0000000..720c679
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/BundlesView$3.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/BundlesView$4.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/BundlesView$4.class
new file mode 100644 (file)
index 0000000..66bf2e2
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/BundlesView$4.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/BundlesView$5.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/BundlesView$5.class
new file mode 100644 (file)
index 0000000..56e1d77
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/BundlesView$5.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/BundlesView$6.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/BundlesView$6.class
new file mode 100644 (file)
index 0000000..5cc2497
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/BundlesView$6.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/BundlesView$7.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/BundlesView$7.class
new file mode 100644 (file)
index 0000000..edbf3b3
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/BundlesView$7.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/BundlesView$BundleContentProvider.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/BundlesView$BundleContentProvider.class
new file mode 100644 (file)
index 0000000..1aa4a9d
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/BundlesView$BundleContentProvider.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/BundlesView$StateLabelProvider.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/BundlesView$StateLabelProvider.class
new file mode 100644 (file)
index 0000000..2537be2
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/BundlesView$StateLabelProvider.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/BundlesView.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/BundlesView.class
new file mode 100644 (file)
index 0000000..b26d5b5
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/BundlesView.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/ModulesView$1.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/ModulesView$1.class
new file mode 100644 (file)
index 0000000..e32420c
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/ModulesView$1.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/ModulesView$BundleNode.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/ModulesView$BundleNode.class
new file mode 100644 (file)
index 0000000..206348a
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/ModulesView$BundleNode.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/ModulesView$ConflictingPackageNode.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/ModulesView$ConflictingPackageNode.class
new file mode 100644 (file)
index 0000000..1334b04
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/ModulesView$ConflictingPackageNode.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/ModulesView$ExportedPackageNode.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/ModulesView$ExportedPackageNode.class
new file mode 100644 (file)
index 0000000..387ac08
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/ModulesView$ExportedPackageNode.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/ModulesView$ModulesContentProvider.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/ModulesView$ModulesContentProvider.class
new file mode 100644 (file)
index 0000000..f59c4e9
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/ModulesView$ModulesContentProvider.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/ModulesView$ModulesLabelProvider.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/ModulesView$ModulesLabelProvider.class
new file mode 100644 (file)
index 0000000..e95ebc6
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/ModulesView$ModulesLabelProvider.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/ModulesView$MultiplePackagesNode.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/ModulesView$MultiplePackagesNode.class
new file mode 100644 (file)
index 0000000..035e04f
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/ModulesView$MultiplePackagesNode.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/ModulesView$ServiceReferenceNode.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/ModulesView$ServiceReferenceNode.class
new file mode 100644 (file)
index 0000000..a8fc751
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/ModulesView$ServiceReferenceNode.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/ModulesView.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/ModulesView.class
new file mode 100644 (file)
index 0000000..e746ed3
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/ModulesView.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/OsgiExplorerImages.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/OsgiExplorerImages.class
new file mode 100644 (file)
index 0000000..c4553ea
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/OsgiExplorerImages.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/OsgiExplorerPerspective.class b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/OsgiExplorerPerspective.class
new file mode 100644 (file)
index 0000000..2f9d4fe
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/bin/org/argeo/eclipse/ui/workbench/osgi/OsgiExplorerPerspective.class differ
diff --git a/org.argeo.eclipse.ui.workbench/bnd.bnd b/org.argeo.eclipse.ui.workbench/bnd.bnd
new file mode 100644 (file)
index 0000000..12e9e59
--- /dev/null
@@ -0,0 +1,16 @@
+Bundle-SymbolicName: org.argeo.eclipse.ui.workbench;singleton:=true
+Bundle-ActivationPolicy: lazy
+Bundle-Activator: org.argeo.eclipse.ui.workbench.WorkbenchUiPlugin
+
+Require-Bundle: org.eclipse.ui;resolution:=optional,\
+                               org.eclipse.core.runtime,\
+                               org.eclipse.rap.ui;resolution:=optional,\
+                               org.eclipse.rap.ui.workbench;resolution:=optional
+
+Import-Package: org.argeo.eclipse.ui.specific,\
+                               org.argeo.eclipse.spring,\
+                               org.osgi.framework,\
+                               org.osgi.service.packageadmin,\
+                               org.springframework.beans.factory,\
+                               org.springframework.core.io.support,\
+                               *
diff --git a/org.argeo.eclipse.ui.workbench/build.properties b/org.argeo.eclipse.ui.workbench/build.properties
new file mode 100644 (file)
index 0000000..d3d3fb3
--- /dev/null
@@ -0,0 +1,6 @@
+source.. =     src/
+output.. =  bin/
+bin.includes = META-INF/,\
+               .,\
+               icons/,\
+               plugin.xml
diff --git a/org.argeo.eclipse.ui.workbench/icons/active.gif b/org.argeo.eclipse.ui.workbench/icons/active.gif
new file mode 100644 (file)
index 0000000..7d24707
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/icons/active.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/icons/add.gif b/org.argeo.eclipse.ui.workbench/icons/add.gif
new file mode 100644 (file)
index 0000000..252d7eb
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/icons/add.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/icons/addFolder.gif b/org.argeo.eclipse.ui.workbench/icons/addFolder.gif
new file mode 100644 (file)
index 0000000..d3f43d9
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/icons/addFolder.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/icons/addPrivileges.png b/org.argeo.eclipse.ui.workbench/icons/addPrivileges.png
new file mode 100644 (file)
index 0000000..a6b251f
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/icons/addPrivileges.png differ
diff --git a/org.argeo.eclipse.ui.workbench/icons/addRepo.gif b/org.argeo.eclipse.ui.workbench/icons/addRepo.gif
new file mode 100644 (file)
index 0000000..26d81c0
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/icons/addRepo.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/icons/addWorkspace.png b/org.argeo.eclipse.ui.workbench/icons/addWorkspace.png
new file mode 100644 (file)
index 0000000..bbee775
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/icons/addWorkspace.png differ
diff --git a/org.argeo.eclipse.ui.workbench/icons/binary.png b/org.argeo.eclipse.ui.workbench/icons/binary.png
new file mode 100644 (file)
index 0000000..fdf4f82
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/icons/binary.png differ
diff --git a/org.argeo.eclipse.ui.workbench/icons/browser.gif b/org.argeo.eclipse.ui.workbench/icons/browser.gif
new file mode 100644 (file)
index 0000000..6c7320c
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/icons/browser.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/icons/bundles.gif b/org.argeo.eclipse.ui.workbench/icons/bundles.gif
new file mode 100644 (file)
index 0000000..e9a6bd9
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/icons/bundles.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/icons/dumpNode.gif b/org.argeo.eclipse.ui.workbench/icons/dumpNode.gif
new file mode 100644 (file)
index 0000000..14eb1be
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/icons/dumpNode.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/icons/file.gif b/org.argeo.eclipse.ui.workbench/icons/file.gif
new file mode 100644 (file)
index 0000000..ef30288
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/icons/file.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/icons/folder.gif b/org.argeo.eclipse.ui.workbench/icons/folder.gif
new file mode 100644 (file)
index 0000000..42e027c
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/icons/folder.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/icons/getSize.gif b/org.argeo.eclipse.ui.workbench/icons/getSize.gif
new file mode 100644 (file)
index 0000000..b05bf3e
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/icons/getSize.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/icons/home.gif b/org.argeo.eclipse.ui.workbench/icons/home.gif
new file mode 100644 (file)
index 0000000..fd0c669
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/icons/home.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/icons/import_fs.png b/org.argeo.eclipse.ui.workbench/icons/import_fs.png
new file mode 100644 (file)
index 0000000..d7c890c
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/icons/import_fs.png differ
diff --git a/org.argeo.eclipse.ui.workbench/icons/installed.gif b/org.argeo.eclipse.ui.workbench/icons/installed.gif
new file mode 100644 (file)
index 0000000..2988716
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/icons/installed.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/icons/node.gif b/org.argeo.eclipse.ui.workbench/icons/node.gif
new file mode 100644 (file)
index 0000000..364c0e7
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/icons/node.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/icons/nodes.gif b/org.argeo.eclipse.ui.workbench/icons/nodes.gif
new file mode 100644 (file)
index 0000000..bba3dbc
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/icons/nodes.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/icons/osgi_explorer.gif b/org.argeo.eclipse.ui.workbench/icons/osgi_explorer.gif
new file mode 100644 (file)
index 0000000..e9a6bd9
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/icons/osgi_explorer.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/icons/query.png b/org.argeo.eclipse.ui.workbench/icons/query.png
new file mode 100644 (file)
index 0000000..54c089d
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/icons/query.png differ
diff --git a/org.argeo.eclipse.ui.workbench/icons/refresh.png b/org.argeo.eclipse.ui.workbench/icons/refresh.png
new file mode 100644 (file)
index 0000000..a3884fb
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/icons/refresh.png differ
diff --git a/org.argeo.eclipse.ui.workbench/icons/remote_connected.gif b/org.argeo.eclipse.ui.workbench/icons/remote_connected.gif
new file mode 100644 (file)
index 0000000..1492b4e
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/icons/remote_connected.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/icons/remote_disconnected.gif b/org.argeo.eclipse.ui.workbench/icons/remote_disconnected.gif
new file mode 100644 (file)
index 0000000..6c54da9
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/icons/remote_disconnected.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/icons/remove.gif b/org.argeo.eclipse.ui.workbench/icons/remove.gif
new file mode 100644 (file)
index 0000000..0ae6dec
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/icons/remove.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/icons/repositories.gif b/org.argeo.eclipse.ui.workbench/icons/repositories.gif
new file mode 100644 (file)
index 0000000..c13bea1
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/icons/repositories.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/icons/repository_connected.gif b/org.argeo.eclipse.ui.workbench/icons/repository_connected.gif
new file mode 100644 (file)
index 0000000..a15fa55
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/icons/repository_connected.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/icons/repository_disconnected.gif b/org.argeo.eclipse.ui.workbench/icons/repository_disconnected.gif
new file mode 100644 (file)
index 0000000..4576dc5
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/icons/repository_disconnected.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/icons/resolved.gif b/org.argeo.eclipse.ui.workbench/icons/resolved.gif
new file mode 100644 (file)
index 0000000..f4a1ea1
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/icons/resolved.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/icons/sort.gif b/org.argeo.eclipse.ui.workbench/icons/sort.gif
new file mode 100644 (file)
index 0000000..23c5d0b
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/icons/sort.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/icons/starting.gif b/org.argeo.eclipse.ui.workbench/icons/starting.gif
new file mode 100644 (file)
index 0000000..563743d
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/icons/starting.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/icons/workspace_connected.png b/org.argeo.eclipse.ui.workbench/icons/workspace_connected.png
new file mode 100644 (file)
index 0000000..0430baa
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/icons/workspace_connected.png differ
diff --git a/org.argeo.eclipse.ui.workbench/icons/workspace_disconnected.png b/org.argeo.eclipse.ui.workbench/icons/workspace_disconnected.png
new file mode 100644 (file)
index 0000000..fddcb8c
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/icons/workspace_disconnected.png differ
diff --git a/org.argeo.eclipse.ui.workbench/plugin.xml b/org.argeo.eclipse.ui.workbench/plugin.xml
new file mode 100644 (file)
index 0000000..be3cb43
--- /dev/null
@@ -0,0 +1,385 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+   <!-- PERSPECTIVES --> 
+   <extension
+         point="org.eclipse.ui.perspectives">
+      <perspective
+            name="Monitoring"
+            class="org.argeo.eclipse.ui.workbench.osgi.OsgiExplorerPerspective"
+            id="org.argeo.eclipse.ui.workbench.osgiPerspective"
+            icon="icons/osgi_explorer.gif">
+      </perspective>
+      <perspective
+            name="Data Explorer"
+            class="org.argeo.eclipse.ui.workbench.jcr.JcrBrowserPerspective"
+            id="org.argeo.eclipse.ui.workbench.jcrBrowserPerspective"
+            icon="icons/nodes.gif">
+      </perspective>
+       </extension>
+    
+    <!-- Definition of the OSGI perspective -->
+    <extension point="org.eclipse.ui.perspectiveExtensions"> 
+        <perspectiveExtension targetID="org.argeo.eclipse.ui.workbench.osgiPerspective"> 
+            <view 
+               id="org.argeo.eclipse.ui.workbench.bundlesView" 
+               minimized="false"
+               ratio="0.5" 
+               relationship="left" 
+               relative="org.eclipse.ui.editorss"/> 
+            <view 
+               id="org.argeo.eclipse.ui.workbench.modulesView" 
+               minimized="false"
+               relationship="stack" 
+               relative="org.argeo.eclipse.ui.workbench.bundlesView"/> 
+        </perspectiveExtension> 
+    </extension> 
+   
+       <!-- VIEWS --> 
+       <extension
+        point="org.eclipse.ui.views">
+               <view
+               name="Modules"
+            id="org.argeo.eclipse.ui.workbench.modulesView"
+            icon="icons/bundles.gif"
+                       class="org.argeo.eclipse.ui.workbench.osgi.ModulesView">
+               </view>
+               <view
+               name="Bundles"
+            id="org.argeo.eclipse.ui.workbench.bundlesView" 
+            icon="icons/bundles.gif"
+            class="org.argeo.eclipse.ui.workbench.osgi.BundlesView">
+               </view>
+               <view
+          name="JCR Browser"
+          id="org.argeo.eclipse.ui.workbench.jcrBrowserView"
+          icon="icons/browser.gif"
+          class="org.argeo.eclipse.spring.SpringExtensionFactory">
+          </view>
+   </extension>
+   
+   <!-- EDITORS --> 
+   <extension
+               point="org.eclipse.ui.editors">
+               <editor
+                       name="JCR Query"
+                       id="org.argeo.eclipse.ui.workbench.genericJcrQueryEditor"
+                       icon="icons/query.png"
+                       class="org.argeo.eclipse.spring.SpringExtensionFactory"
+                       default="false">
+        </editor>
+               <editor
+                       name="Node Editor"
+            id="org.argeo.eclipse.ui.workbench.defaultNodeEditor"
+                       icon="icons/query.png"
+                       class="org.argeo.eclipse.spring.SpringExtensionFactory"
+                       default="false">
+               </editor>
+       </extension>
+       
+       <!-- COMMANDS --> 
+       <extension
+               point="org.eclipse.ui.commands">
+               <command
+                       defaultHandler="org.argeo.eclipse.ui.workbench.commands.OpenEditor"
+            id="org.argeo.eclipse.ui.workbench.openEditor"
+            name="Open an editor given its ID">
+            <commandParameter
+                               id="param.jcrNodePath"
+                               name="Node path">
+                       </commandParameter>
+            <!-- The path to the corresponding node if needed. -->
+            <commandParameter
+                               id="param.jcrNodePath"
+                               name="Node path">
+                       </commandParameter>
+               </command>
+       <command
+                       defaultHandler="org.argeo.eclipse.ui.workbench.commands.GetNodeSize"
+                       id="org.argeo.eclipse.ui.workbench.getNodeSize"
+                       name="Get node size">
+               </command>    
+       <command
+                       defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
+                       id="org.argeo.eclipse.ui.workbench.addRemoteRepository"
+                       name="Add remote JCR repository">
+                       <!-- <commandParameter
+                               id="param.repositoryUri"
+                               name="Repository URI">
+                       </commandParameter> -->
+               </command>    
+       <command
+                       defaultHandler="org.argeo.eclipse.ui.workbench.commands.RemoveRemoteRepository"
+                       id="org.argeo.eclipse.ui.workbench.removeRemoteRepository"
+                       name="Remove remote JCR repository">
+               </command>    
+               <command
+               defaultHandler="org.argeo.eclipse.ui.workbench.commands.AddFolderNode"
+               id="org.argeo.eclipse.ui.workbench.addFolderNode"
+               name="Create a new folder">
+               </command>
+               <command
+                       defaultHandler="org.argeo.eclipse.ui.workbench.commands.AddPrivileges"
+                       id="org.argeo.eclipse.ui.workbench.addPrivileges"
+                       name="Add Privileges">
+               </command>
+               <command
+                       defaultHandler="org.argeo.eclipse.ui.workbench.commands.CreateWorkspace"
+                       id="org.argeo.eclipse.ui.workbench.createWorkspace"
+                       name="Create a new workspace">
+               </command>
+               <command
+                       defaultHandler="org.argeo.eclipse.ui.workbench.commands.Refresh"
+                       id="org.argeo.eclipse.ui.workbench.refresh"
+                       name="Refresh">
+               </command>
+               <command
+                       defaultHandler="org.argeo.eclipse.ui.workbench.commands.DeleteNodes"
+                       id="org.argeo.eclipse.ui.workbench.deleteNodes"
+                       name="Delete nodes">
+               </command>
+               <command
+               defaultHandler="org.argeo.eclipse.ui.workbench.commands.ImportFileSystem"
+               id="org.argeo.eclipse.ui.workbench.importFileSystem"
+               name="Import files...">
+               </command>
+               <!-- <command
+               defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
+               id="org.argeo.eclipse.ui.workbench.openFile"
+               name="Open current file">
+               </command> -->
+               <command
+               defaultHandler="org.argeo.eclipse.ui.workbench.commands.DumpNode"
+               id="org.argeo.eclipse.ui.workbench.dumpNode"
+               name="Dump Current Selected Node">
+               </command>
+               <command
+                       defaultHandler="org.argeo.eclipse.ui.workbench.commands.SortChildNodes"
+                       id="org.argeo.eclipse.ui.workbench.sortChildNodes"
+                       name="Sort node tree">
+            <!-- FIXME: default value does not work -->
+            <state 
+                               id="org.argeo.eclipse.ui.workbench.sortChildNodes.toggleState" 
+                               class="org.eclipse.ui.handlers.RegistryToggleState:true" >
+                               <!-- <class class="org.eclipse.jface.commands.ToggleState"> 
+                                       <parameter
+                                               name="default"
+                                       value="true" />
+                               </class> -->
+                       </state>
+               </command>
+       </extension>
+
+    <!-- Menus --> 
+       <extension point="org.eclipse.ui.menus">
+               <!-- Browser view specific menu --> 
+               <menuContribution
+                       locationURI="menu:org.argeo.eclipse.ui.workbench.jcrBrowserView">
+            <!-- See bug 149 --> 
+            <!-- <command
+               commandId="org.argeo.eclipse.ui.workbench.openGenericJcrQueryEditor"
+                icon="icons/query.png"
+                style="push">
+            </command> --> 
+            <command
+               commandId="org.argeo.eclipse.ui.workbench.addRemoteRepository"
+                icon="icons/addRepo.gif"
+                style="push">
+            </command>
+             <command
+               commandId="org.argeo.eclipse.ui.workbench.sortChildNodes"
+                icon="icons/sort.gif"
+                style="toggle"
+                label="Sort child nodes"
+                tooltip="NOTE: displaying unsorted nodes will enhance overall performances">
+            </command>
+               </menuContribution>
+               <!-- Browser view popup context menu --> 
+               <menuContribution
+                       locationURI="popup:org.argeo.eclipse.ui.workbench.jcrBrowserView">
+                       <command
+                               commandId="org.argeo.eclipse.ui.workbench.refresh"
+                               icon="icons/refresh.png"
+                               style="push">
+                       </command>
+                       <command
+                        commandId="org.argeo.eclipse.ui.workbench.addFolderNode"
+                        icon="icons/addFolder.gif"
+                        label="Add Folder"
+                        style="push">
+                               <visibleWhen>
+                                       <iterate>
+                                     <and>
+                                        <or>
+                                           <instanceof
+                                                 value="org.argeo.eclipse.ui.workbench.jcr.internal.model.SingleJcrNodeElem">
+                                           </instanceof>
+                                           <instanceof
+                                                 value="org.argeo.eclipse.ui.workbench.jcr.internal.model.WorkspaceElem">
+                                           </instanceof>
+                                        </or>
+                               <with variable="activeMenuSelection"><count value="1"/></with>
+                                     </and>
+                                       </iterate>
+                               </visibleWhen>
+                       </command>
+                       <command
+                        commandId="org.argeo.eclipse.ui.workbench.addPrivileges"
+                        icon="icons/addPrivileges.png"
+                        label="Add Privileges"
+                        style="push">
+                               <visibleWhen>
+                                       <iterate>
+                                     <and>
+                                        <or>
+                                           <instanceof
+                                                 value="org.argeo.eclipse.ui.workbench.jcr.internal.model.SingleJcrNodeElem">
+                                           </instanceof>
+                                           <instanceof
+                                                 value="org.argeo.eclipse.ui.workbench.jcr.internal.model.WorkspaceElem">
+                                           </instanceof>
+                                        </or>
+                               <with variable="activeMenuSelection"><count value="1"/></with>
+                                     </and>
+                                       </iterate>
+                               </visibleWhen>
+                       </command>
+                       <command
+                        commandId="org.argeo.eclipse.ui.workbench.createWorkspace"
+                        icon="icons/addWorkspace.png"
+                        label="Create Workspace"
+                        style="push">
+                               <visibleWhen>
+                                       <iterate>
+                                       <and>
+                                               <or>
+                                               <instanceof
+                                                       value="org.argeo.eclipse.ui.workbench.jcr.internal.model.RepositoryElem">
+                                               </instanceof>
+                                               </or>
+                                       <with variable="activeMenuSelection"><count value="1"/></with>
+                                               </and>
+                                       </iterate>
+                               </visibleWhen>
+                       </command>
+                       <command
+                               commandId="org.argeo.eclipse.ui.workbench.deleteNodes"
+                               icon="icons/remove.gif"
+                               label="Delete Nodes"
+                               style="push">
+                               <visibleWhen>
+                                       <iterate>
+                                               <or>
+                                                       <instanceof
+                                                               value="org.argeo.eclipse.ui.workbench.jcr.internal.model.SingleJcrNodeElem" />
+                                                       <instanceof
+                                                               value="org.argeo.eclipse.ui.workbench.jcr.internal.model.WorkspaceElem" />
+                                               </or>
+                                       </iterate>
+                               </visibleWhen>
+                       </command>
+                       <command
+                               commandId="org.argeo.eclipse.ui.workbench.importFileSystem"
+                               icon="icons/import_fs.png"
+                               style="push"
+                               tooltip="Import files from the files sytem">
+                               <visibleWhen>
+                                       <iterate>
+                                               <and>
+                                                       <or>
+                                                               <instanceof
+                                                                       value="org.argeo.eclipse.ui.workbench.jcr.internal.model.SingleJcrNodeElem" />
+                                                               <instanceof
+                                               value="org.argeo.eclipse.ui.workbench.jcr.internal.model.WorkspaceElem" />
+                                       </or>
+                                       <with variable="activeMenuSelection"><count value="1"/></with>
+                                               </and>
+                                       </iterate>
+                               </visibleWhen>
+                       </command>
+                       <command
+                               commandId="org.argeo.eclipse.ui.workbench.addRemoteRepository"
+                               icon="icons/addRepo.gif"
+                               style="push">
+                                       <visibleWhen>
+                                               <iterate> 
+                                                       <or>
+                                                               <instanceof
+                                               value="org.argeo.eclipse.ui.workbench.jcr.internal.model.RepositoriesElem" />
+                                                               <instanceof
+                                                                       value="org.argeo.eclipse.ui.workbench.jcr.internal.model.RepositoryElem" />
+                                                       </or> 
+                                               </iterate>
+                                       </visibleWhen>
+                       </command>
+                       <command
+                               commandId="org.argeo.eclipse.ui.workbench.removeRemoteRepository"
+                               icon="icons/remove.gif"
+                               style="push">
+                               <visibleWhen>
+                                       <iterate> 
+                                               <or>
+                                                       <instanceof
+                                                               value="org.argeo.eclipse.ui.workbench.jcr.internal.model.RemoteRepositoryElem" />
+                                               </or> 
+                               </iterate>
+                               </visibleWhen>
+                       </command>
+                       <command
+                               commandId="org.argeo.eclipse.ui.workbench.getNodeSize"
+                               icon="icons/getSize.gif"
+                               style="push">
+                                       <visibleWhen>
+                                               <iterate>
+                                                       <or>
+                                                               <instanceof
+                                                                       value="org.argeo.eclipse.ui.workbench.jcr.internal.model.SingleJcrNodeElem" />
+                                                               <instanceof
+                                                                       value="org.argeo.eclipse.ui.workbench.jcr.internal.model.WorkspaceElem" />
+                                       </or>
+                                       </iterate>
+                                       </visibleWhen>
+                       </command>
+                       <command
+                       commandId="org.argeo.eclipse.ui.workbench.dumpNode"
+                       icon="icons/dumpNode.gif"
+                               label="Dump Node"
+                               style="push">
+                               <visibleWhen>
+                                       <iterate> <and>
+                                               <instanceof value="org.argeo.eclipse.ui.workbench.jcr.internal.model.SingleJcrNodeElem"></instanceof>
+                               <with variable="activeMenuSelection"><count value="1"/></with>
+                                       </and> </iterate>
+                               </visibleWhen>
+                       </command>
+               </menuContribution>
+       </extension>
+
+       <!-- Reduce visibility of JCR Browser perspective to users that are in ROLE_ADMIN -->   
+       <extension
+       point="org.eclipse.ui.activities">
+               <activity
+                       description="Only for admins"
+                       id="org.argeo.eclipse.ui.workbench.adminActivity"
+            name="Jcr Technical Admin">
+                       <enabledWhen>
+                               <with variable="roles">
+                                       <iterate ifEmpty="false" operator="or">
+                                               <equals value="ROLE_ADMIN" />
+                                       </iterate>
+                               </with>
+                       </enabledWhen>
+               </activity>
+        <activityPatternBinding
+                       pattern="org.argeo.eclipse.ui.workbench/org.argeo.eclipse.ui.workbench.osgiPerspective"
+                       isEqualityPattern="true"
+                       activityId="org.argeo.eclipse.ui.workbench.adminActivity">
+                       <!-- activityId="org.argeo.security.ui.adminActivity" -->
+        </activityPatternBinding>
+        <activityPatternBinding
+                       pattern="org.argeo.eclipse.ui.workbench/org.argeo.eclipse.ui.workbench.jcrBrowserPerspective"
+                       isEqualityPattern="true"
+                       activityId="org.argeo.eclipse.ui.workbench.adminActivity">
+               </activityPatternBinding>
+       </extension>
+</plugin>
\ No newline at end of file
diff --git a/org.argeo.eclipse.ui.workbench/pom.xml b/org.argeo.eclipse.ui.workbench/pom.xml
new file mode 100644 (file)
index 0000000..67451c8
--- /dev/null
@@ -0,0 +1,75 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+       <modelVersion>4.0.0</modelVersion>
+       <parent>
+               <groupId>org.argeo.commons</groupId>
+               <version>2.1.12-SNAPSHOT</version>
+               <artifactId>argeo-commons</artifactId>
+               <relativePath>..</relativePath>
+       </parent>
+       <artifactId>org.argeo.eclipse.ui.workbench</artifactId>
+       <name>Commons Eclipse UI Workbench</name>
+<!--   <build> -->
+<!--           <plugins> -->
+<!--                   <plugin> -->
+<!--                           <groupId>org.apache.felix</groupId> -->
+<!--                           <artifactId>maven-bundle-plugin</artifactId> -->
+<!--                           <configuration> -->
+<!--                                   <instructions> -->
+<!--                                           <Bundle-SymbolicName>${project.artifactId};singleton:=true</Bundle-SymbolicName> -->
+<!--                                           <Bundle-ActivationPolicy>lazy</Bundle-ActivationPolicy> -->
+<!--                                           <Bundle-Activator>org.argeo.osgi.ui.explorer.OsgiExplorerPlugin</Bundle-Activator> -->
+<!--                                           <Require-Bundle>org.eclipse.ui;resolution:=optional, -->
+<!--                                                   org.eclipse.rap.ui;resolution:=optional, -->
+<!--                                                   org.eclipse.core.runtime</Require-Bundle> -->
+<!--                                           <Export-Package>org.argeo.osgi.ui.explorer.*</Export-Package> -->
+<!--                                   </instructions> -->
+<!--                           </configuration> -->
+<!--                   </plugin> -->
+<!--           </plugins> -->
+<!--   </build> -->
+       <dependencies>
+
+               <!-- Generic Eclipse UI Dependencies -->
+               <dependency>
+                       <groupId>org.argeo.commons</groupId>
+                       <artifactId>org.argeo.eclipse.ui</artifactId>
+                       <version>2.1.12-SNAPSHOT</version>
+               </dependency>
+
+               <!-- RCP only dependency, needed at compile time -->
+               <dependency>
+                       <groupId>org.argeo.commons</groupId>
+                       <artifactId>org.argeo.eclipse.ui.rcp</artifactId>
+                       <version>2.1.12-SNAPSHOT</version>
+                       <scope>provided</scope>
+               </dependency>
+
+               <dependency>
+                       <groupId>org.argeo.commons</groupId>
+                       <artifactId>org.argeo.eclipse.dep.rap</artifactId>
+                       <type>pom</type>
+                       <version>2.1.12-SNAPSHOT</version>
+                       <scope>provided</scope>
+               </dependency>
+
+
+               <!-- Business dependencies -->
+               <dependency>
+                       <groupId>org.argeo.tp</groupId>
+                       <artifactId>org.eclipse.osgi</artifactId>
+                       <scope>provided</scope>
+               </dependency>
+
+               <dependency>
+                       <groupId>org.argeo.commons</groupId>
+                       <artifactId>org.argeo.util</artifactId>
+                       <version>2.1.12-SNAPSHOT</version>
+               </dependency>
+
+               <!-- <dependency> <groupId>org.argeo.commons</groupId> <artifactId>org.argeo.eclipse.dep.rap</artifactId> 
+                       <type>pom</type> <version>2.1.12-SNAPSHOT</version> <scope>provided</scope> 
+                       </dependency> <dependency> <groupId>org.argeo.commons</groupId> <artifactId>org.argeo.eclipse.ui.rcp</artifactId> 
+                       <version>2.1.12-SNAPSHOT</version> <scope>provided</scope> </dependency> -->
+       </dependencies>
+</project>
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/WorkbenchConstants.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/WorkbenchConstants.java
new file mode 100644 (file)
index 0000000..f08b040
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * 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.eclipse.ui.workbench;
+
+/** Constants used across the application. */
+public interface WorkbenchConstants {
+       /*
+        * MISCEALLENEOUS
+        */
+       public final static String DATE_TIME_FORMAT = "dd/MM/yyyy, HH:mm";
+
+}
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/WorkbenchUiPlugin.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/WorkbenchUiPlugin.java
new file mode 100644 (file)
index 0000000..48ed861
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * 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.eclipse.ui.workbench;
+
+import java.util.ResourceBundle;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class WorkbenchUiPlugin extends AbstractUIPlugin {
+       private final static Log log = LogFactory.getLog(WorkbenchUiPlugin.class);
+       private ResourceBundle messages;
+
+       // The plug-in ID
+       public static final String ID = "org.argeo.eclipse.ui.workbench"; //$NON-NLS-1$
+
+       // The shared instance
+       private static WorkbenchUiPlugin plugin;
+
+       /**
+        * The constructor
+        */
+       public WorkbenchUiPlugin() {
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see
+        * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
+        * )
+        */
+       public void start(BundleContext context) throws Exception {
+               super.start(context);
+               plugin = this;
+               messages = ResourceBundle.getBundle(ID + ".messages");
+
+       }
+
+       /*
+        * (non-Javadoc)
+        * 
+        * @see
+        * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
+        * )
+        */
+       public void stop(BundleContext context) throws Exception {
+               plugin = null;
+               super.stop(context);
+       }
+
+       /**
+        * Returns the shared instance
+        * 
+        * @return the shared instance
+        */
+       public static WorkbenchUiPlugin getDefault() {
+               return plugin;
+       }
+
+       public static ImageDescriptor getImageDescriptor(String path) {
+               return imageDescriptorFromPlugin(ID, path);
+       }
+
+       /** Returns the internationalized label for the given key */
+       public static String getMessage(String key) {
+               try {
+                       return getDefault().messages.getString(key);
+               } catch (NullPointerException npe) {
+                       log.warn(key + " not found.");
+                       return key;
+               }
+       }
+
+       /**
+        * Gives access to the internationalization message bundle. Returns null in
+        * case this UiPlugin is not started (for JUnit tests, by instance)
+        */
+       public static ResourceBundle getMessagesBundle() {
+               if (getDefault() != null)
+                       // To avoid NPE
+                       return getDefault().messages;
+               else
+                       return null;
+       }
+
+}
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/AddFolderNode.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/AddFolderNode.java
new file mode 100644 (file)
index 0000000..3ac7116
--- /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.eclipse.ui.workbench.commands;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+import javax.jcr.nodetype.NodeType;
+
+import org.argeo.eclipse.ui.ErrorFeedback;
+import org.argeo.eclipse.ui.TreeParent;
+import org.argeo.eclipse.ui.dialogs.SingleValue;
+import org.argeo.eclipse.ui.workbench.WorkbenchUiPlugin;
+import org.argeo.eclipse.ui.workbench.jcr.JcrBrowserView;
+import org.argeo.eclipse.ui.workbench.jcr.internal.model.SingleJcrNodeElem;
+import org.argeo.eclipse.ui.workbench.jcr.internal.model.WorkspaceElem;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/**
+ * Adds a node of type nt:folder, only on {@link SingleJcrNodeElem} and
+ * {@link WorkspaceElem} TreeObject types.
+ * 
+ * This handler assumes that a selection provider is available and picks only
+ * first selected item. It is UI's job to enable the command only when the
+ * selection contains one and only one element. Thus no parameter is passed
+ * through the command.
+ */
+public class AddFolderNode extends AbstractHandler {
+
+       public final static String ID = WorkbenchUiPlugin.ID + ".addFolderNode";
+
+       public Object execute(ExecutionEvent event) throws ExecutionException {
+
+               ISelection selection = HandlerUtil.getActiveWorkbenchWindow(event)
+                               .getActivePage().getSelection();
+
+               JcrBrowserView view = (JcrBrowserView) HandlerUtil
+                               .getActiveWorkbenchWindow(event).getActivePage()
+                               .findView(HandlerUtil.getActivePartId(event));
+
+               if (selection != null && !selection.isEmpty()
+                               && selection instanceof IStructuredSelection) {
+                       Object obj = ((IStructuredSelection) selection).getFirstElement();
+                       TreeParent treeParentNode = null;
+                       Node jcrParentNode = null;
+
+                       if (obj instanceof SingleJcrNodeElem) {
+                               treeParentNode = (TreeParent) obj;
+                               jcrParentNode = ((SingleJcrNodeElem) treeParentNode).getNode();
+                       } else if (obj instanceof WorkspaceElem) {
+                               treeParentNode = (TreeParent) obj;
+                               jcrParentNode = ((WorkspaceElem) treeParentNode).getRootNode();
+                       } else
+                               return null;
+
+                       String folderName = SingleValue.ask("Folder name",
+                                       "Enter folder name");
+                       if (folderName != null) {
+                               try {
+                                       jcrParentNode.addNode(folderName, NodeType.NT_FOLDER);
+                                       jcrParentNode.getSession().save();
+                                       view.nodeAdded(treeParentNode);
+                               } catch (RepositoryException e) {
+                                       ErrorFeedback.show("Cannot create folder " + folderName
+                                                       + " under " + treeParentNode, e);
+                               }
+                       }
+               } else {
+                       ErrorFeedback.show(WorkbenchUiPlugin
+                                       .getMessage("errorUnvalidNtFolderNodeType"));
+               }
+               return null;
+       }
+}
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/AddPrivileges.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/AddPrivileges.java
new file mode 100644 (file)
index 0000000..6f5f6cc
--- /dev/null
@@ -0,0 +1,76 @@
+/*
+ * 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.eclipse.ui.workbench.commands;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+
+import org.argeo.ArgeoException;
+import org.argeo.eclipse.ui.ErrorFeedback;
+import org.argeo.eclipse.ui.TreeParent;
+import org.argeo.eclipse.ui.workbench.WorkbenchUiPlugin;
+import org.argeo.eclipse.ui.workbench.jcr.internal.model.SingleJcrNodeElem;
+import org.argeo.eclipse.ui.workbench.jcr.internal.model.WorkspaceElem;
+import org.argeo.eclipse.ui.workbench.jcr.internal.parts.ChangeRightsWizard;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/** Open a dialog to change rights on the selected node. */
+public class AddPrivileges extends AbstractHandler {
+       public final static String ID = WorkbenchUiPlugin.ID + ".addPrivileges";
+
+       public Object execute(ExecutionEvent event) throws ExecutionException {
+
+               ISelection selection = HandlerUtil.getActiveWorkbenchWindow(event)
+                               .getActivePage().getSelection();
+               if (selection != null && !selection.isEmpty()
+                               && selection instanceof IStructuredSelection) {
+                       Object obj = ((IStructuredSelection) selection).getFirstElement();
+                       TreeParent treeParentNode = null;
+                       Node jcrParentNode = null;
+
+                       if (obj instanceof SingleJcrNodeElem) {
+                               treeParentNode = (TreeParent) obj;
+                               jcrParentNode = ((SingleJcrNodeElem) treeParentNode).getNode();
+                       } else if (obj instanceof WorkspaceElem) {
+                               treeParentNode = (TreeParent) obj;
+                               jcrParentNode = ((WorkspaceElem) treeParentNode).getRootNode();
+                       } else
+                               return null;
+
+                       try {
+                               ChangeRightsWizard wizard = new ChangeRightsWizard(
+                                               jcrParentNode.getSession(), jcrParentNode.getPath());
+                               WizardDialog dialog = new WizardDialog(
+                                               HandlerUtil.getActiveShell(event), wizard);
+                               dialog.open();
+                               return null;
+                       } catch (RepositoryException re) {
+                               throw new ArgeoException(
+                                               "Unexpected error while creating the new workspace.",
+                                               re);
+                       }
+               } else {
+                       ErrorFeedback.show("Cannot add privileges");
+               }
+               return null;
+       }
+}
\ No newline at end of file
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/AddRemoteRepository.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/AddRemoteRepository.java
new file mode 100644 (file)
index 0000000..8c4536a
--- /dev/null
@@ -0,0 +1,233 @@
+/*
+ * 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.eclipse.ui.workbench.commands;
+
+import java.net.URI;
+import java.util.Hashtable;
+
+import javax.jcr.Node;
+import javax.jcr.Repository;
+import javax.jcr.RepositoryFactory;
+import javax.jcr.Session;
+import javax.jcr.SimpleCredentials;
+
+import org.argeo.ArgeoException;
+import org.argeo.eclipse.ui.ErrorFeedback;
+import org.argeo.eclipse.ui.utils.CommandUtils;
+import org.argeo.eclipse.ui.workbench.WorkbenchConstants;
+import org.argeo.jcr.ArgeoJcrConstants;
+import org.argeo.jcr.ArgeoNames;
+import org.argeo.jcr.ArgeoTypes;
+import org.argeo.jcr.JcrUtils;
+import org.argeo.jcr.UserJcrUtils;
+import org.argeo.util.security.Keyring;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.dialogs.TitleAreaDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * Connect to a remote repository and, if successful publish it as an OSGi
+ * service.
+ */
+public class AddRemoteRepository extends AbstractHandler implements
+               WorkbenchConstants, ArgeoNames {
+
+       private RepositoryFactory repositoryFactory;
+       private Repository nodeRepository;
+       private Keyring keyring;
+
+       public Object execute(ExecutionEvent event) throws ExecutionException {
+               RemoteRepositoryLoginDialog dlg = new RemoteRepositoryLoginDialog(
+                               Display.getDefault().getActiveShell());
+               if (dlg.open() == Dialog.OK) {
+                       CommandUtils.callCommand(Refresh.ID);
+               }
+               return null;
+       }
+
+       public void setRepositoryFactory(RepositoryFactory repositoryFactory) {
+               this.repositoryFactory = repositoryFactory;
+       }
+
+       public void setKeyring(Keyring keyring) {
+               this.keyring = keyring;
+       }
+
+       public void setNodeRepository(Repository nodeRepository) {
+               this.nodeRepository = nodeRepository;
+       }
+
+       class RemoteRepositoryLoginDialog extends TitleAreaDialog {
+               private static final long serialVersionUID = 2234006887750103399L;
+               private Text name;
+               private Text uri;
+               private Text username;
+               private Text password;
+               private Button saveInKeyring;
+
+               public RemoteRepositoryLoginDialog(Shell parentShell) {
+                       super(parentShell);
+               }
+
+               protected Point getInitialSize() {
+                       return new Point(600, 400);
+               }
+
+               protected Control createDialogArea(Composite parent) {
+                       Composite dialogarea = (Composite) super.createDialogArea(parent);
+                       dialogarea.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true,
+                                       true));
+                       Composite composite = new Composite(dialogarea, SWT.NONE);
+                       composite.setLayout(new GridLayout(2, false));
+                       composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true,
+                                       false));
+                       setMessage("Login to remote repository", IMessageProvider.NONE);
+                       name = createLT(composite, "Name", "remoteRepository");
+                       uri = createLT(composite, "URI",
+                                       "http://localhost:7070/data/jcr/node");
+                       username = createLT(composite, "User", "");
+                       password = createLP(composite, "Password");
+
+                       saveInKeyring = createLC(composite, "Remember password", false);
+                       parent.pack();
+                       return composite;
+               }
+
+               @Override
+               protected void createButtonsForButtonBar(Composite parent) {
+                       super.createButtonsForButtonBar(parent);
+                       Button test = createButton(parent, 2, "Test", false);
+                       test.addSelectionListener(new SelectionAdapter() {
+                               private static final long serialVersionUID = -1829962269440419560L;
+
+                               public void widgetSelected(SelectionEvent arg0) {
+                                       testConnection();
+                               }
+                       });
+               }
+
+               void testConnection() {
+                       Session session = null;
+                       try {
+                               URI checkedUri = new URI(uri.getText());
+                               String checkedUriStr = checkedUri.toString();
+
+                               Hashtable<String, String> params = new Hashtable<String, String>();
+                               params.put(ArgeoJcrConstants.JCR_REPOSITORY_URI, checkedUriStr);
+                               Repository repository = repositoryFactory.getRepository(params);
+                               if (username.getText().trim().equals("")) {// anonymous
+                                       session = repository.login();
+                               } else {
+                                       // FIXME use getTextChars() when upgrading to 3.7
+                                       // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=297412
+                                       char[] pwd = password.getText().toCharArray();
+                                       SimpleCredentials sc = new SimpleCredentials(
+                                                       username.getText(), pwd);
+                                       session = repository.login(sc);
+                                       MessageDialog.openInformation(getParentShell(), "Success",
+                                                       "Connection to '" + uri.getText() + "' successful");
+                               }
+                       } catch (Exception e) {
+                               ErrorFeedback.show(
+                                               "Connection test failed for " + uri.getText(), e);
+                       } finally {
+                               JcrUtils.logoutQuietly(session);
+                       }
+               }
+
+               @Override
+               protected void okPressed() {
+                       Session nodeSession = null;
+                       try {
+                               nodeSession = nodeRepository.login();
+                               Node home = UserJcrUtils.getUserHome(nodeSession);
+
+                               Node remote = home.hasNode(ARGEO_REMOTE) ? home
+                                               .getNode(ARGEO_REMOTE) : home.addNode(ARGEO_REMOTE);
+                               if (remote.hasNode(name.getText()))
+                                       throw new ArgeoException(
+                                                       "There is already a remote repository named "
+                                                                       + name.getText());
+                               Node remoteRepository = remote.addNode(name.getText(),
+                                               ArgeoTypes.ARGEO_REMOTE_REPOSITORY);
+                               remoteRepository.setProperty(ARGEO_URI, uri.getText());
+                               remoteRepository.setProperty(ARGEO_USER_ID, username.getText());
+                               nodeSession.save();
+                               if (saveInKeyring.getSelection()) {
+                                       String pwdPath = remoteRepository.getPath() + '/'
+                                                       + ARGEO_PASSWORD;
+                                       keyring.set(pwdPath, password.getText().toCharArray());
+                               }
+                               nodeSession.save();
+                               MessageDialog.openInformation(
+                                               getParentShell(),
+                                               "Repository Added",
+                                               "Remote repository '" + username.getText() + "@"
+                                                               + uri.getText() + "' added");
+
+                               super.okPressed();
+                       } catch (Exception e) {
+                               ErrorFeedback.show("Cannot add remote repository", e);
+                       } finally {
+                               JcrUtils.logoutQuietly(nodeSession);
+                       }
+               }
+
+               /** Creates label and text. */
+               protected Text createLT(Composite parent, String label, String initial) {
+                       new Label(parent, SWT.NONE).setText(label);
+                       Text text = new Text(parent, SWT.SINGLE | SWT.LEAD | SWT.BORDER);
+                       text.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+                       text.setText(initial);
+                       return text;
+               }
+
+               /** Creates label and check. */
+               protected Button createLC(Composite parent, String label,
+                               Boolean initial) {
+                       new Label(parent, SWT.NONE).setText(label);
+                       Button check = new Button(parent, SWT.CHECK);
+                       check.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+                       check.setSelection(initial);
+                       return check;
+               }
+
+               protected Text createLP(Composite parent, String label) {
+                       new Label(parent, SWT.NONE).setText(label);
+                       Text text = new Text(parent, SWT.SINGLE | SWT.LEAD | SWT.BORDER
+                                       | SWT.PASSWORD);
+                       text.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+                       return text;
+               }
+       }
+}
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/CreateWorkspace.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/CreateWorkspace.java
new file mode 100644 (file)
index 0000000..024601d
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * 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.eclipse.ui.workbench.commands;
+
+import java.util.Arrays;
+
+import org.argeo.eclipse.ui.ErrorFeedback;
+import org.argeo.eclipse.ui.dialogs.SingleValue;
+import org.argeo.eclipse.ui.workbench.WorkbenchUiPlugin;
+import org.argeo.eclipse.ui.workbench.jcr.JcrBrowserView;
+import org.argeo.eclipse.ui.workbench.jcr.internal.model.RepositoryElem;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/** Creates a new JCR workspace */
+public class CreateWorkspace extends AbstractHandler {
+
+       public final static String ID = WorkbenchUiPlugin.ID + ".addFolderNode";
+
+       public Object execute(ExecutionEvent event) throws ExecutionException {
+
+               ISelection selection = HandlerUtil.getActiveWorkbenchWindow(event)
+                               .getActivePage().getSelection();
+
+               JcrBrowserView view = (JcrBrowserView) HandlerUtil
+                               .getActiveWorkbenchWindow(event).getActivePage()
+                               .findView(HandlerUtil.getActivePartId(event));
+
+               if (selection != null && !selection.isEmpty()
+                               && selection instanceof IStructuredSelection) {
+                       Object obj = ((IStructuredSelection) selection).getFirstElement();
+                       if (!(obj instanceof RepositoryElem))
+                               return null;
+
+                       RepositoryElem repositoryNode = (RepositoryElem) obj;
+                       String workspaceName = SingleValue.ask("Workspace name",
+                                       "Enter workspace name");
+                       if (workspaceName != null) {
+                               if (Arrays.asList(repositoryNode.getAccessibleWorkspaceNames())
+                                               .contains(workspaceName)) {
+                                       ErrorFeedback.show("Workspace " + workspaceName
+                                                       + " already exists.");
+                               } else {
+                                       repositoryNode.createWorkspace(workspaceName);
+                                       view.nodeAdded(repositoryNode);
+                               }
+                       }
+               } else {
+                       ErrorFeedback.show("Cannot create workspace");
+               }
+               return null;
+       }
+}
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/DeleteNodes.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/DeleteNodes.java
new file mode 100644 (file)
index 0000000..e3518e5
--- /dev/null
@@ -0,0 +1,118 @@
+/*
+ * 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.eclipse.ui.workbench.commands;
+
+import java.util.Iterator;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+
+import org.argeo.ArgeoException;
+import org.argeo.eclipse.ui.ErrorFeedback;
+import org.argeo.eclipse.ui.TreeParent;
+import org.argeo.eclipse.ui.workbench.jcr.JcrBrowserView;
+import org.argeo.eclipse.ui.workbench.jcr.internal.model.SingleJcrNodeElem;
+import org.argeo.eclipse.ui.workbench.jcr.internal.model.WorkspaceElem;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/**
+ * Deletes the selected nodes: both in the JCR repository and in the UI view.
+ * Warning no check is done, except implementation dependent native checks,
+ * handle with care.
+ * 
+ * This handler is still 'hard linked' to a GenericJcrBrowser view to enable
+ * correct tree refresh when a node is added. This must be corrected in future
+ * versions.
+ */
+public class DeleteNodes extends AbstractHandler {
+       public Object execute(ExecutionEvent event) throws ExecutionException {
+               ISelection selection = HandlerUtil.getActiveWorkbenchWindow(event)
+                               .getActivePage().getSelection();
+               if (selection == null || !(selection instanceof IStructuredSelection))
+                       return null;
+
+               JcrBrowserView view = (JcrBrowserView) HandlerUtil
+                               .getActiveWorkbenchWindow(event).getActivePage()
+                               .findView(HandlerUtil.getActivePartId(event));
+
+               // confirmation
+               StringBuffer buf = new StringBuffer("");
+               Iterator<?> lst = ((IStructuredSelection) selection).iterator();
+               while (lst.hasNext()) {
+                       SingleJcrNodeElem sjn = ((SingleJcrNodeElem) lst.next());
+                       buf.append(sjn.getName()).append(' ');
+               }
+               Boolean ok = MessageDialog.openConfirm(
+                               HandlerUtil.getActiveShell(event), "Confirm deletion",
+                               "Do you want to delete " + buf + "?");
+
+               // operation
+               if (ok) {
+                       Iterator<?> it = ((IStructuredSelection) selection).iterator();
+                       Object obj = null;
+                       SingleJcrNodeElem ancestor = null;
+                       WorkspaceElem rootAncestor = null;
+                       try {
+                               while (it.hasNext()) {
+                                       obj = it.next();
+                                       if (obj instanceof SingleJcrNodeElem) {
+                                               // Cache objects
+                                               SingleJcrNodeElem sjn = (SingleJcrNodeElem) obj;
+                                               TreeParent tp = (TreeParent) sjn.getParent();
+                                               Node node = sjn.getNode();
+
+                                               // Jcr Remove
+                                               node.remove();
+                                               node.getSession().save();
+                                               // UI remove
+                                               tp.removeChild(sjn);
+
+                                               // Check if the parent is the root node
+                                               if (tp instanceof WorkspaceElem)
+                                                       rootAncestor = (WorkspaceElem) tp;
+                                               else
+                                                       ancestor = getOlder(ancestor, (SingleJcrNodeElem) tp);
+                                       }
+                               }
+                               if (rootAncestor != null)
+                                       view.nodeRemoved(rootAncestor);
+                               else if (ancestor != null)
+                                       view.nodeRemoved(ancestor);
+                       } catch (Exception e) {
+                               ErrorFeedback.show("Cannot delete selected node ", e);
+                       }
+               }
+               return null;
+       }
+
+       private SingleJcrNodeElem getOlder(SingleJcrNodeElem A, SingleJcrNodeElem B) {
+               try {
+                       if (A == null)
+                               return B == null ? null : B;
+                       // Todo enhanced this method
+                       else
+                               return A.getNode().getDepth() <= B.getNode().getDepth() ? A : B;
+               } catch (RepositoryException re) {
+                       throw new ArgeoException("Cannot find ancestor", re);
+               }
+       }
+}
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/DumpNode.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/DumpNode.java
new file mode 100644 (file)
index 0000000..e919eb2
--- /dev/null
@@ -0,0 +1,110 @@
+/*
+ * 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.eclipse.ui.workbench.commands;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.GregorianCalendar;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+
+import org.argeo.ArgeoException;
+import org.argeo.eclipse.ui.specific.OpenFile;
+import org.argeo.eclipse.ui.utils.CommandUtils;
+import org.argeo.eclipse.ui.workbench.WorkbenchUiPlugin;
+import org.argeo.jcr.JcrUtils;
+import org.argeo.eclipse.ui.workbench.jcr.internal.model.SingleJcrNodeElem;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/**
+ * If the method
+ * <code> HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getSelection() </code>
+ * exits and has a SingleJcrNodeElem as first element, it canonically calls the
+ * JCR Session.exportSystemView() method on the underlying node with both
+ * skipBinary & noRecurse boolean flags set to false.
+ * 
+ * Resulting stream is saved in a tmp file and opened via the "open file"
+ * single-sourced command.
+ */
+public class DumpNode extends AbstractHandler {
+       public final static String ID = WorkbenchUiPlugin.ID + ".dumpNode";
+
+       private final static DateFormat df = new SimpleDateFormat(
+                       "yyyy-MM-dd_HH-mm");
+
+       public Object execute(ExecutionEvent event) throws ExecutionException {
+               ISelection selection = HandlerUtil.getActiveWorkbenchWindow(event)
+                               .getActivePage().getSelection();
+               if (selection == null || !(selection instanceof IStructuredSelection))
+                       return null;
+
+               Iterator<?> lst = ((IStructuredSelection) selection).iterator();
+               if (lst.hasNext()) {
+                       Object element = lst.next();
+                       if (element instanceof SingleJcrNodeElem) {
+                               SingleJcrNodeElem sjn = (SingleJcrNodeElem) element;
+                               Node node = sjn.getNode();
+
+                               // TODO add a dialog to configure the export and ask for
+                               // confirmation
+                               // Boolean ok = MessageDialog.openConfirm(
+                               // HandlerUtil.getActiveShell(event), "Confirm deletion",
+                               // "Do you want to delete " + buf + "?");
+
+                               File tmpFile;
+                               FileOutputStream fos;
+                               try {
+                                       tmpFile = File.createTempFile("JcrExport", ".xml");
+                                       tmpFile.deleteOnExit();
+                                       fos = new FileOutputStream(tmpFile);
+                                       String dateVal = df.format(new GregorianCalendar()
+                                                       .getTime());
+                                       node.getSession().exportSystemView(node.getPath(), fos,
+                                                       true, false);
+                                       openGeneratedFile(tmpFile.getAbsolutePath(),
+                                                       "Dump-" + JcrUtils.replaceInvalidChars(node.getName())+ "-" + dateVal + ".xml");
+                               } catch (RepositoryException e) {
+                                       throw new ArgeoException(
+                                                       "Unable to perform SystemExport on " + node, e);
+                               } catch (IOException e) {
+                                       throw new ArgeoException("Unable to SystemExport " + node,
+                                                       e);
+                               }
+                       }
+               }
+               return null;
+       }
+
+       private synchronized void openGeneratedFile(String path, String fileName) {
+               Map<String, String> params = new HashMap<String, String>();
+               params.put(OpenFile.PARAM_FILE_NAME, fileName);
+               params.put(OpenFile.PARAM_FILE_URI, "file://" + path);
+               CommandUtils.callCommand("org.argeo.security.ui.specific.openFile",
+                               params);
+       }
+}
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/EditNode.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/EditNode.java
new file mode 100644 (file)
index 0000000..c021877
--- /dev/null
@@ -0,0 +1,69 @@
+/*
+ * 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.eclipse.ui.workbench.commands;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.jcr.Property;
+import javax.jcr.nodetype.NodeType;
+
+import org.argeo.eclipse.ui.ErrorFeedback;
+import org.argeo.eclipse.ui.jcr.editors.NodeEditorInput;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/** Generic command to open a path in an editor. */
+public class EditNode extends AbstractHandler {
+       public final static String EDITOR_PARAM = "editor";
+
+       private String defaultEditorId;
+
+       private Map<String, String> nodeTypeToEditor = new HashMap<String, String>();
+
+       public Object execute(ExecutionEvent event) throws ExecutionException {
+               String path = event.getParameter(Property.JCR_PATH);
+
+               String type = event.getParameter(NodeType.NT_NODE_TYPE);
+               if (type == null)
+                       type = NodeType.NT_UNSTRUCTURED;
+
+               String editorId = event.getParameter(NodeType.NT_NODE_TYPE);
+               if (editorId == null)
+                       editorId = nodeTypeToEditor.containsKey(type) ? nodeTypeToEditor
+                                       .get(type) : defaultEditorId;
+                                       
+               NodeEditorInput nei = new NodeEditorInput(path);
+
+               try {
+                       HandlerUtil.getActiveWorkbenchWindow(event).getActivePage()
+                                       .openEditor(nei, editorId);
+               } catch (PartInitException e) {
+                       ErrorFeedback.show("Cannot open " + editorId + " with " + path
+                                       + " of type " + type, e);
+               }
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       public void setDefaultEditorId(String defaultEditorId) {
+               this.defaultEditorId = defaultEditorId;
+       }
+
+}
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/GetNodeSize.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/GetNodeSize.java
new file mode 100644 (file)
index 0000000..c31f4d6
--- /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.eclipse.ui.workbench.commands;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.jcr.Node;
+
+import org.argeo.eclipse.ui.ErrorFeedback;
+import org.argeo.eclipse.ui.workbench.WorkbenchUiPlugin;
+import org.argeo.jcr.JcrUtils;
+import org.argeo.eclipse.ui.workbench.jcr.internal.model.SingleJcrNodeElem;
+import org.argeo.eclipse.ui.workbench.jcr.internal.model.WorkspaceElem;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/** Opens the generic node editor. */
+public class GetNodeSize extends AbstractHandler {
+       // private final static Log log = LogFactory.getLog(GetNodeSize.class);
+
+       public final static String ID = WorkbenchUiPlugin.ID + ".getNodeSize";
+
+       // public final static String DEFAULT_ICON_REL_PATH = "icons/getSize.gif";
+       // public final static String DEFAULT_LABEL = JcrExplorerPlugin
+       // .getMessage("getNodeSizeCmdLbl");
+
+       public Object execute(ExecutionEvent event) throws ExecutionException {
+               // JcrUtils.getRepositoryByAlias(repositoryRegister,
+               // ArgeoJcrConstants.ALIAS_NODE);
+
+               ISelection selection = HandlerUtil.getActiveWorkbenchWindow(event)
+                               .getActivePage().getSelection();
+
+               if (selection != null && !selection.isEmpty()
+                               && selection instanceof IStructuredSelection) {
+
+                       // IStructuredSelection iss = (IStructuredSelection) selection;
+                       // if (iss.size() > 1)
+                       // ErrorFeedback.show(JcrExplorerPlugin
+                       // .getMessage("warningInvalidMultipleSelection"), null);
+
+                       long size = 0;
+
+                       Iterator<?> it = ((IStructuredSelection) selection).iterator();
+
+                       // as the size method is recursive, we keep track of nodes for which
+                       // we already have computed size so that we don't count them twice.
+                       // In a first approximation, we assume that the structure selection
+                       // keep the nodes ordered.
+                       // TODO : enhance that.
+                       List<String> importedPathes = new ArrayList<String>();
+                       try {
+                               nodesIt: while (it.hasNext()) {
+                                       Object obj = it.next();
+                                       String curPath;
+                                       Node node;
+                                       if (obj instanceof SingleJcrNodeElem) {
+                                               node = ((SingleJcrNodeElem) obj).getNode();
+                                               curPath = node.getSession().getWorkspace().getName();
+                                               curPath += "/" + node.getPath();
+                                       } else if (obj instanceof WorkspaceElem) {
+                                               node = ((WorkspaceElem) obj).getRootNode();
+                                               curPath = node.getSession().getWorkspace().getName();
+                                       } else
+                                               // unvalid object type
+                                               continue nodesIt;
+
+                                       Iterator<String> itPath = importedPathes.iterator();
+                                       while (itPath.hasNext()) {
+                                               String refPath = itPath.next();
+                                               if (curPath.startsWith(refPath))
+                                                       // Already done : skip node
+                                                       continue nodesIt;
+                                       }
+                                       size += JcrUtils.getNodeApproxSize(node);
+                                       importedPathes.add(curPath);
+                               }
+                       } catch (Exception e) {
+                               ErrorFeedback.show("Cannot Get size of selected node ", e);
+                       }
+
+                       String[] labels = { "OK" };
+                       Shell shell = HandlerUtil.getActiveWorkbenchWindow(event)
+                                       .getShell();
+                       MessageDialog md = new MessageDialog(shell, "Node size", null,
+                                       "Node size is: " + size / 1024 + " KB",
+                                       MessageDialog.INFORMATION, labels, 0);
+                       md.open();
+               }
+               return null;
+       }
+}
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/ImportFileSystem.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/ImportFileSystem.java
new file mode 100644 (file)
index 0000000..0531c3a
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * 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.eclipse.ui.workbench.commands;
+
+import javax.jcr.Node;
+
+import org.argeo.eclipse.ui.ErrorFeedback;
+import org.argeo.eclipse.ui.TreeParent;
+import org.argeo.eclipse.ui.workbench.WorkbenchUiPlugin;
+import org.argeo.eclipse.ui.workbench.jcr.JcrBrowserView;
+import org.argeo.eclipse.ui.workbench.jcr.internal.model.SingleJcrNodeElem;
+import org.argeo.eclipse.ui.workbench.jcr.internal.model.WorkspaceElem;
+import org.argeo.eclipse.ui.workbench.jcr.internal.parts.ImportFileSystemWizard;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/** Import a local file system directory tree. */
+public class ImportFileSystem extends AbstractHandler {
+       public Object execute(ExecutionEvent event) throws ExecutionException {
+               ISelection selection = HandlerUtil.getActiveWorkbenchWindow(event)
+                               .getActivePage().getSelection();
+               JcrBrowserView view = (JcrBrowserView) HandlerUtil
+                               .getActiveWorkbenchWindow(event).getActivePage()
+                               .findView(HandlerUtil.getActivePartId(event));
+               if (selection != null && !selection.isEmpty()
+                               && selection instanceof IStructuredSelection) {
+                       Object obj = ((IStructuredSelection) selection).getFirstElement();
+                       try {
+                               Node folder = null;
+                               if (obj instanceof SingleJcrNodeElem) {
+                                       folder = ((SingleJcrNodeElem) obj).getNode();
+                               } else if (obj instanceof WorkspaceElem) {
+                                       folder = ((WorkspaceElem) obj).getRootNode();
+                               } else {
+                                       ErrorFeedback.show(WorkbenchUiPlugin
+                                                       .getMessage("warningInvalidNodeToImport"));
+                               }
+                               if (folder != null) {
+                                       ImportFileSystemWizard wizard = new ImportFileSystemWizard(
+                                                       folder);
+                                       WizardDialog dialog = new WizardDialog(
+                                                       HandlerUtil.getActiveShell(event), wizard);
+                                       dialog.open();
+                                       view.nodeAdded((TreeParent) obj);
+                               }
+                       } catch (Exception e) {
+                               ErrorFeedback.show("Cannot import files to " + obj, e);
+                       }
+               }
+               return null;
+       }
+}
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/OpenEditor.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/OpenEditor.java
new file mode 100644 (file)
index 0000000..f6e57c3
--- /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.eclipse.ui.workbench.commands;
+
+import org.argeo.ArgeoException;
+import org.argeo.eclipse.ui.jcr.editors.JcrQueryEditorInput;
+import org.argeo.eclipse.ui.jcr.editors.NodeEditorInput;
+import org.argeo.eclipse.ui.workbench.WorkbenchUiPlugin;
+import org.argeo.eclipse.ui.workbench.jcr.GenericJcrQueryEditor;
+import org.argeo.eclipse.ui.workbench.jcr.DefaultNodeEditor;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/** Opens an editor given its ID. */
+public class OpenEditor extends AbstractHandler {
+       public final static String ID = WorkbenchUiPlugin.ID + ".openEditor";
+
+       public final static String PARAM_PATH = "param.jcrNodePath";
+       public final static String PARAM_EDITOR_ID = "param.editorId";
+
+       public Object execute(ExecutionEvent event) throws ExecutionException {
+               String editorId = event.getParameter(PARAM_EDITOR_ID);
+               try {
+                       IWorkbenchPage activePage = HandlerUtil.getActiveWorkbenchWindow(
+                                       event).getActivePage();
+                       if (DefaultNodeEditor.ID.equals(editorId)) {
+                               String path = event.getParameter(PARAM_PATH);
+                               NodeEditorInput nei = new NodeEditorInput(path);
+                               activePage.openEditor(nei, DefaultNodeEditor.ID);
+                       } else if (GenericJcrQueryEditor.ID.equals(editorId)) {
+                               JcrQueryEditorInput editorInput = new JcrQueryEditorInput(
+                                               GenericJcrQueryEditor.ID, null);
+                               activePage.openEditor(editorInput, editorId);
+                       }
+               } catch (PartInitException e) {
+                       throw new ArgeoException("Cannot open editor of ID " + editorId, e);
+               }
+               return null;
+       }
+}
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/Refresh.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/Refresh.java
new file mode 100644 (file)
index 0000000..72e3457
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * 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.eclipse.ui.workbench.commands;
+
+import java.util.Iterator;
+
+import org.argeo.eclipse.ui.TreeParent;
+import org.argeo.eclipse.ui.workbench.WorkbenchUiPlugin;
+import org.argeo.eclipse.ui.workbench.jcr.JcrBrowserView;
+import org.argeo.eclipse.ui.workbench.jcr.internal.JcrBrowserUtils;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+
+/**
+ * Force the selected objects of the active view to be refreshed doing the
+ * following:
+ * <ol>
+ * <li>The model objects are recomputed</li>
+ * <li>the view is refreshed</li>
+ * </ol>
+ */
+public class Refresh extends AbstractHandler {
+
+       public final static String ID = WorkbenchUiPlugin.ID + ".refresh";
+
+       public Object execute(ExecutionEvent event) throws ExecutionException {
+
+               JcrBrowserView view = (JcrBrowserView) WorkbenchUiPlugin
+                               .getDefault().getWorkbench().getActiveWorkbenchWindow()
+                               .getActivePage().getActivePart();//
+
+               ISelection selection = WorkbenchUiPlugin.getDefault().getWorkbench()
+                               .getActiveWorkbenchWindow().getActivePage().getSelection();
+
+               if (selection != null && selection instanceof IStructuredSelection
+                               && !selection.isEmpty()) {
+                       Iterator<?> it = ((IStructuredSelection) selection).iterator();
+                       while (it.hasNext()) {
+                               Object obj = it.next();
+                               if (obj instanceof TreeParent) {
+                                       TreeParent tp = (TreeParent) obj;
+                                       JcrBrowserUtils.forceRefreshIfNeeded(tp);
+                                       view.refresh(obj);
+                               }
+                       }
+               } else if (view instanceof JcrBrowserView)
+                       ((JcrBrowserView) view).refresh(null); // force full refresh
+
+               return null;
+       }
+}
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/RemoveRemoteRepository.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/RemoveRemoteRepository.java
new file mode 100644 (file)
index 0000000..83938a8
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * 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.eclipse.ui.workbench.commands;
+
+import org.argeo.eclipse.ui.workbench.jcr.JcrBrowserView;
+import org.argeo.eclipse.ui.workbench.jcr.internal.model.RemoteRepositoryElem;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/** Remove a registered remote repository */
+public class RemoveRemoteRepository extends AbstractHandler {
+
+       public Object execute(ExecutionEvent event) throws ExecutionException {
+
+               ISelection selection = HandlerUtil.getActiveWorkbenchWindow(event)
+                               .getActivePage().getSelection();
+
+               JcrBrowserView view = (JcrBrowserView) HandlerUtil
+                               .getActiveWorkbenchWindow(event).getActivePage()
+                               .findView(HandlerUtil.getActivePartId(event));
+
+               if (selection != null && !selection.isEmpty()
+                               && selection instanceof IStructuredSelection) {
+                       Object obj = ((IStructuredSelection) selection).getFirstElement();
+
+                       if (obj instanceof RemoteRepositoryElem) {
+                               ((RemoteRepositoryElem) obj).remove();
+                               view.refresh(null);
+                       }
+               }
+               return null;
+       }
+
+}
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/SortChildNodes.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/SortChildNodes.java
new file mode 100644 (file)
index 0000000..e5b7a7f
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * 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.eclipse.ui.workbench.commands;
+
+import org.argeo.eclipse.ui.workbench.WorkbenchUiPlugin;
+import org.argeo.eclipse.ui.workbench.jcr.JcrBrowserView;
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.Command;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.State;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.commands.ICommandService;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+/**
+ * Change isSorted state of the JcrExplorer Browser
+ */
+public class SortChildNodes extends AbstractHandler {
+       public final static String ID = WorkbenchUiPlugin.ID + ".sortChildNodes";
+
+       public Object execute(ExecutionEvent event) throws ExecutionException {
+               JcrBrowserView view = (JcrBrowserView) HandlerUtil
+                               .getActiveWorkbenchWindow(event).getActivePage()
+                               .findView(JcrBrowserView.ID);
+
+               ICommandService service = (ICommandService) PlatformUI.getWorkbench()
+                               .getService(ICommandService.class);
+               Command command = service.getCommand(ID);
+               State state = command.getState(ID + ".toggleState");
+
+               boolean wasSorted = (Boolean) state.getValue();
+               view.setSortChildNodes(!wasSorted);
+               state.setValue(!wasSorted);
+               return null;
+       }
+}
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/DefaultNodeEditor.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/DefaultNodeEditor.java
new file mode 100644 (file)
index 0000000..b4f3de3
--- /dev/null
@@ -0,0 +1,119 @@
+/*
+ * 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.eclipse.ui.workbench.jcr;
+
+import javax.jcr.Node;
+
+import org.argeo.ArgeoException;
+import org.argeo.eclipse.ui.workbench.WorkbenchUiPlugin;
+import org.argeo.eclipse.ui.workbench.jcr.internal.parts.ChildNodesPage;
+import org.argeo.eclipse.ui.workbench.jcr.internal.parts.GenericNodeEditorInput;
+import org.argeo.eclipse.ui.workbench.jcr.internal.parts.GenericPropertyPage;
+import org.argeo.eclipse.ui.workbench.jcr.internal.parts.NodeRightsManagementPage;
+import org.argeo.eclipse.ui.workbench.jcr.internal.parts.NodeVersionHistoryPage;
+import org.argeo.jcr.JcrUtils;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.forms.editor.FormEditor;
+
+/**
+ * Container for the node editor page. At creation time, it takes a JCR Node
+ * that cannot be changed afterwards.
+ */
+public class DefaultNodeEditor extends FormEditor {
+       private static final long serialVersionUID = -5397680152514917137L;
+
+       // private final static Log log =
+       // LogFactory.getLog(GenericNodeEditor.class);
+       public final static String ID = WorkbenchUiPlugin.ID + ".defaultNodeEditor";
+
+       private Node currentNode;
+
+       private GenericPropertyPage genericPropertyPage;
+       private ChildNodesPage childNodesPage;
+       private NodeRightsManagementPage nodeRightsManagementPage;
+       private NodeVersionHistoryPage nodeVersionHistoryPage;
+
+       public void init(IEditorSite site, IEditorInput input)
+                       throws PartInitException {
+               super.init(site, input);
+               GenericNodeEditorInput nei = (GenericNodeEditorInput) getEditorInput();
+               currentNode = nei.getCurrentNode();
+               this.setPartName(JcrUtils.lastPathElement(nei.getPath()));
+       }
+
+       @Override
+       protected void addPages() {
+               try {
+                       // genericNodePage = new GenericNodePage(this,
+                       // JcrExplorerPlugin.getMessage("genericNodePageTitle"),
+                       // currentNode);
+                       // addPage(genericNodePage);
+
+                       genericPropertyPage = new GenericPropertyPage(this,
+                                       WorkbenchUiPlugin.getMessage("genericNodePageTitle"),
+                                       currentNode);
+                       addPage(genericPropertyPage);
+
+                       childNodesPage = new ChildNodesPage(this,
+                                       WorkbenchUiPlugin.getMessage("childNodesPageTitle"),
+                                       currentNode);
+                       addPage(childNodesPage);
+
+                       nodeRightsManagementPage = new NodeRightsManagementPage(this,
+                                       WorkbenchUiPlugin
+                                                       .getMessage("nodeRightsManagementPageTitle"),
+                                       currentNode);
+                       addPage(nodeRightsManagementPage);
+
+                       nodeVersionHistoryPage = new NodeVersionHistoryPage(
+                                       this,
+                                       WorkbenchUiPlugin.getMessage("nodeVersionHistoryPageTitle"),
+                                       currentNode);
+                       addPage(nodeVersionHistoryPage);
+               } catch (PartInitException e) {
+                       throw new ArgeoException("Not able to add an empty page ", e);
+               }
+       }
+
+       @Override
+       public void doSaveAs() {
+               // unused compulsory method
+       }
+
+       @Override
+       public void doSave(IProgressMonitor monitor) {
+               try {
+                       // Automatically commit all pages of the editor
+                       commitPages(true);
+                       firePropertyChange(PROP_DIRTY);
+               } catch (Exception e) {
+                       throw new ArgeoException("Error while saving node", e);
+               }
+
+       }
+
+       @Override
+       public boolean isSaveAsAllowed() {
+               return true;
+       }
+
+       Node getCurrentNode() {
+               return currentNode;
+       }
+}
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/GenericJcrQueryEditor.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/GenericJcrQueryEditor.java
new file mode 100644 (file)
index 0000000..dcb14ea
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * 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.eclipse.ui.workbench.jcr;
+
+import org.argeo.eclipse.ui.jcr.editors.AbstractJcrQueryEditor;
+import org.argeo.eclipse.ui.workbench.WorkbenchUiPlugin;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Text;
+
+/** Enables end user to type and execute any JCR query. */
+public class GenericJcrQueryEditor extends AbstractJcrQueryEditor {
+       public final static String ID = WorkbenchUiPlugin.ID
+                       + ".genericJcrQueryEditor";
+
+       private Text queryField;
+
+       @Override
+       public void createQueryForm(Composite parent) {
+               parent.setLayout(new GridLayout(1, false));
+
+               queryField = new Text(parent, SWT.BORDER | SWT.MULTI | SWT.WRAP);
+               queryField.setText(initialQuery);
+               queryField.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+               Button execute = new Button(parent, SWT.PUSH);
+               execute.setText("Execute");
+
+               Listener executeListener = new Listener() {
+                       private static final long serialVersionUID = -918256291554301699L;
+
+                       public void handleEvent(Event event) {
+                               executeQuery(queryField.getText());
+                       }
+               };
+
+               execute.addListener(SWT.Selection, executeListener);
+               // queryField.addListener(SWT.DefaultSelection, executeListener);
+       }
+
+       @Override
+       public void setFocus() {
+               queryField.setFocus();
+       }
+}
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserPerspective.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserPerspective.java
new file mode 100644 (file)
index 0000000..a7e4ecf
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * 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.eclipse.ui.workbench.jcr;
+
+import org.argeo.eclipse.ui.workbench.WorkbenchUiPlugin;
+import org.eclipse.ui.IFolderLayout;
+import org.eclipse.ui.IPageLayout;
+import org.eclipse.ui.IPerspectiveFactory;
+
+/** Base perspective for the Jcr browser */
+public class JcrBrowserPerspective implements IPerspectiveFactory {
+
+       public void createInitialLayout(IPageLayout layout) {
+               layout.setEditorAreaVisible(true);
+               IFolderLayout upperLeft = layout.createFolder(WorkbenchUiPlugin.ID
+                               + ".upperLeft", IPageLayout.LEFT, 0.4f, layout.getEditorArea());
+               upperLeft.addView(JcrBrowserView.ID);
+
+       }
+}
\ No newline at end of file
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView.java
new file mode 100644 (file)
index 0000000..6a04870
--- /dev/null
@@ -0,0 +1,363 @@
+/*
+ * 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.eclipse.ui.workbench.jcr;
+
+import java.util.List;
+
+import javax.jcr.Property;
+import javax.jcr.PropertyType;
+import javax.jcr.Repository;
+import javax.jcr.RepositoryException;
+import javax.jcr.RepositoryFactory;
+import javax.jcr.Session;
+import javax.jcr.Value;
+import javax.jcr.observation.Event;
+import javax.jcr.observation.EventListener;
+import javax.jcr.observation.ObservationManager;
+
+import org.argeo.ArgeoException;
+import org.argeo.eclipse.ui.TreeParent;
+import org.argeo.eclipse.ui.jcr.AsyncUiEventListener;
+import org.argeo.eclipse.ui.jcr.utils.NodeViewerComparer;
+import org.argeo.eclipse.ui.workbench.WorkbenchUiPlugin;
+import org.argeo.eclipse.ui.workbench.jcr.internal.GenericNodeDoubleClickListener;
+import org.argeo.eclipse.ui.workbench.jcr.internal.JcrBrowserUtils;
+import org.argeo.eclipse.ui.workbench.jcr.internal.NodeContentProvider;
+import org.argeo.eclipse.ui.workbench.jcr.internal.NodeLabelProvider;
+import org.argeo.eclipse.ui.workbench.jcr.internal.PropertiesContentProvider;
+import org.argeo.eclipse.ui.workbench.jcr.internal.model.SingleJcrNodeElem;
+import org.argeo.jcr.RepositoryRegister;
+import org.argeo.util.security.Keyring;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TableViewerColumn;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.ui.part.ViewPart;
+
+/**
+ * Basic View to display a sash form to browse a JCR compliant multiple
+ * repository environment
+ */
+public class JcrBrowserView extends ViewPart {
+       public final static String ID = WorkbenchUiPlugin.ID + ".jcrBrowserView";
+       private boolean sortChildNodes = true;
+
+       /* DEPENDENCY INJECTION */
+       private Keyring keyring;
+       private RepositoryRegister repositoryRegister;
+       private RepositoryFactory repositoryFactory;
+       private Repository nodeRepository;
+
+       // Current user session on the "Argeo node" default workspace
+       private Session userSession;
+
+       // This page widgets
+       private TreeViewer nodesViewer;
+       private NodeContentProvider nodeContentProvider;
+       private TableViewer propertiesViewer;
+       private EventListener resultsObserver;
+
+       @Override
+       public void createPartControl(Composite parent) {
+               parent.setLayout(new FillLayout());
+               SashForm sashForm = new SashForm(parent, SWT.VERTICAL);
+               sashForm.setSashWidth(4);
+               sashForm.setLayout(new FillLayout());
+
+               // Create the tree on top of the view
+               Composite top = new Composite(sashForm, SWT.NONE);
+               GridLayout gl = new GridLayout(1, false);
+               top.setLayout(gl);
+
+               try {
+                       this.userSession = this.nodeRepository.login();
+               } catch (RepositoryException e) {
+                       throw new ArgeoException("Cannot open user session", e);
+               }
+
+               nodeContentProvider = new NodeContentProvider(userSession, keyring,
+                               repositoryRegister, repositoryFactory, sortChildNodes);
+
+               // nodes viewer
+               nodesViewer = createNodeViewer(top, nodeContentProvider);
+
+               // context menu : it is completely defined in the plugin.xml file.
+               MenuManager menuManager = new MenuManager();
+               Menu menu = menuManager.createContextMenu(nodesViewer.getTree());
+
+               nodesViewer.getTree().setMenu(menu);
+               getSite().registerContextMenu(menuManager, nodesViewer);
+               getSite().setSelectionProvider(nodesViewer);
+
+               nodesViewer.setInput(getViewSite());
+
+               // Create the property viewer on the bottom
+               Composite bottom = new Composite(sashForm, SWT.NONE);
+               bottom.setLayout(new GridLayout(1, false));
+               propertiesViewer = createPropertiesViewer(bottom);
+
+               sashForm.setWeights(getWeights());
+               nodesViewer.setComparer(new NodeViewerComparer());
+       }
+
+       public void refresh(Object obj) {
+               // Enable full refresh from a command when no element of the tree is
+               // selected
+               if (obj == null) {
+                       Object[] elements = nodeContentProvider.getElements(null);
+                       for (Object el : elements) {
+                               if (el instanceof TreeParent)
+                                       JcrBrowserUtils.forceRefreshIfNeeded((TreeParent) el);
+                               getNodeViewer().refresh(el);
+                       }
+               } else
+                       getNodeViewer().refresh(obj);
+       }
+
+       /**
+        * To be overridden to adapt size of form and result frames.
+        */
+       protected int[] getWeights() {
+               return new int[] { 70, 30 };
+       }
+
+       protected TreeViewer createNodeViewer(Composite parent,
+                       final ITreeContentProvider nodeContentProvider) {
+
+               final TreeViewer tmpNodeViewer = new TreeViewer(parent, SWT.MULTI);
+
+               tmpNodeViewer.getTree().setLayoutData(
+                               new GridData(SWT.FILL, SWT.FILL, true, true));
+
+               tmpNodeViewer.setContentProvider(nodeContentProvider);
+               tmpNodeViewer.setLabelProvider(new NodeLabelProvider());
+               tmpNodeViewer
+                               .addSelectionChangedListener(new ISelectionChangedListener() {
+                                       public void selectionChanged(SelectionChangedEvent event) {
+                                               if (!event.getSelection().isEmpty()) {
+                                                       IStructuredSelection sel = (IStructuredSelection) event
+                                                                       .getSelection();
+                                                       Object firstItem = sel.getFirstElement();
+                                                       if (firstItem instanceof SingleJcrNodeElem)
+                                                               propertiesViewer
+                                                                               .setInput(((SingleJcrNodeElem) firstItem)
+                                                                                               .getNode());
+                                               } else {
+                                                       propertiesViewer.setInput(getViewSite());
+                                               }
+                                       }
+                               });
+
+               resultsObserver = new TreeObserver(tmpNodeViewer.getTree().getDisplay());
+               if (keyring != null)
+                       try {
+                               ObservationManager observationManager = userSession
+                                               .getWorkspace().getObservationManager();
+                               observationManager.addEventListener(resultsObserver,
+                                               Event.PROPERTY_ADDED | Event.PROPERTY_CHANGED, "/",
+                                               true, null, null, false);
+                       } catch (RepositoryException e) {
+                               throw new ArgeoException("Cannot register listeners", e);
+                       }
+
+               tmpNodeViewer
+                               .addDoubleClickListener(new GenericNodeDoubleClickListener(
+                                               tmpNodeViewer));
+               return tmpNodeViewer;
+       }
+
+       protected TableViewer createPropertiesViewer(Composite parent) {
+               propertiesViewer = new TableViewer(parent);
+               propertiesViewer.getTable().setLayoutData(
+                               new GridData(SWT.FILL, SWT.FILL, true, true));
+               propertiesViewer.getTable().setHeaderVisible(true);
+               propertiesViewer.setContentProvider(new PropertiesContentProvider());
+               TableViewerColumn col = new TableViewerColumn(propertiesViewer,
+                               SWT.NONE);
+               col.getColumn().setText("Name");
+               col.getColumn().setWidth(200);
+               col.setLabelProvider(new ColumnLabelProvider() {
+                       private static final long serialVersionUID = -6684361063107478595L;
+
+                       public String getText(Object element) {
+                               try {
+                                       return ((Property) element).getName();
+                               } catch (RepositoryException e) {
+                                       throw new ArgeoException(
+                                                       "Unexpected exception in label provider", e);
+                               }
+                       }
+               });
+               col = new TableViewerColumn(propertiesViewer, SWT.NONE);
+               col.getColumn().setText("Value");
+               col.getColumn().setWidth(400);
+               col.setLabelProvider(new ColumnLabelProvider() {
+                       private static final long serialVersionUID = -8201994187693336657L;
+
+                       public String getText(Object element) {
+                               try {
+                                       Property property = (Property) element;
+                                       if (property.getType() == PropertyType.BINARY)
+                                               return "<binary>";
+                                       else if (property.isMultiple()) {
+                                               StringBuffer buf = new StringBuffer("[");
+                                               Value[] values = property.getValues();
+                                               for (int i = 0; i < values.length; i++) {
+                                                       if (i != 0)
+                                                               buf.append(", ");
+                                                       buf.append(values[i].getString());
+                                               }
+                                               buf.append(']');
+                                               return buf.toString();
+                                       } else
+                                               return property.getValue().getString();
+                               } catch (RepositoryException e) {
+                                       throw new ArgeoException(
+                                                       "Unexpected exception in label provider", e);
+                               }
+                       }
+               });
+               col = new TableViewerColumn(propertiesViewer, SWT.NONE);
+               col.getColumn().setText("Type");
+               col.getColumn().setWidth(200);
+               col.setLabelProvider(new ColumnLabelProvider() {
+                       private static final long serialVersionUID = -6009599998150286070L;
+
+                       public String getText(Object element) {
+                               try {
+                                       return PropertyType.nameFromValue(((Property) element)
+                                                       .getType());
+                               } catch (RepositoryException e) {
+                                       throw new ArgeoException(
+                                                       "Unexpected exception in label provider", e);
+                               }
+                       }
+               });
+               propertiesViewer.setInput(getViewSite());
+               return propertiesViewer;
+       }
+
+       @Override
+       public void dispose() {
+               super.dispose();
+       }
+
+       protected TreeViewer getNodeViewer() {
+               return nodesViewer;
+       }
+
+       /**
+        * Resets the tree content provider
+        * 
+        * @param sortChildNodes
+        *            if true the content provider will use a comparer to sort nodes
+        *            that might slow down the display
+        * */
+       public void setSortChildNodes(boolean sortChildNodes) {
+               this.sortChildNodes = sortChildNodes;
+               ((NodeContentProvider) nodesViewer.getContentProvider())
+                               .setSortChildren(sortChildNodes);
+               nodesViewer.setInput(getViewSite());
+       }
+
+       /** Notifies the current view that a node has been added */
+       public void nodeAdded(TreeParent parentNode) {
+               // insure that Ui objects have been correctly created:
+               JcrBrowserUtils.forceRefreshIfNeeded(parentNode);
+               getNodeViewer().refresh(parentNode);
+               getNodeViewer().expandToLevel(parentNode, 1);
+       }
+
+       /** Notifies the current view that a node has been removed */
+       public void nodeRemoved(TreeParent parentNode) {
+               IStructuredSelection newSel = new StructuredSelection(parentNode);
+               getNodeViewer().setSelection(newSel, true);
+               // Force refresh
+               IStructuredSelection tmpSel = (IStructuredSelection) getNodeViewer()
+                               .getSelection();
+               getNodeViewer().refresh(tmpSel.getFirstElement());
+       }
+
+       class TreeObserver extends AsyncUiEventListener {
+
+               public TreeObserver(Display display) {
+                       super(display);
+               }
+
+               @Override
+               protected Boolean willProcessInUiThread(List<Event> events)
+                               throws RepositoryException {
+                       for (Event event : events) {
+                               if (getLog().isTraceEnabled())
+                                       getLog().debug("Received event " + event);
+                               String path = event.getPath();
+                               int index = path.lastIndexOf('/');
+                               String propertyName = path.substring(index + 1);
+                               if (getLog().isTraceEnabled())
+                                       getLog().debug("Concerned property " + propertyName);
+                       }
+                       return false;
+               }
+
+               protected void onEventInUiThread(List<Event> events)
+                               throws RepositoryException {
+                       if (getLog().isTraceEnabled())
+                               getLog().trace("Refresh result list");
+                       nodesViewer.refresh();
+               }
+
+       }
+
+       public boolean getSortChildNodes() {
+               return sortChildNodes;
+       }
+
+       /* DEPENDENCY INJECTION */
+       public void setRepositoryRegister(RepositoryRegister repositoryRegister) {
+               this.repositoryRegister = repositoryRegister;
+       }
+
+       public void setKeyring(Keyring keyring) {
+               this.keyring = keyring;
+       }
+
+       public void setRepositoryFactory(RepositoryFactory repositoryFactory) {
+               this.repositoryFactory = repositoryFactory;
+       }
+
+       public void setNodeRepository(Repository nodeRepository) {
+               this.nodeRepository = nodeRepository;
+       }
+
+       @Override
+       public void setFocus() {
+               getNodeViewer().getTree().setFocus();
+       }
+}
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/JcrImages.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/JcrImages.java
new file mode 100644 (file)
index 0000000..db24d6c
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ * 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.eclipse.ui.workbench.jcr;
+
+import org.argeo.eclipse.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 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.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/FullVersioningTreeContentProvider.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/FullVersioningTreeContentProvider.java
new file mode 100644 (file)
index 0000000..0371a23
--- /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.eclipse.ui.workbench.jcr.internal;
+
+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.ArgeoException;
+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 ArgeoException(
+                                       "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 ArgeoException("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 ArgeoException("Cannot check children of " + element, e);
+               }
+       }
+
+       public void dispose() {
+       }
+
+       public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+       }
+
+}
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/GenericNodeDoubleClickListener.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/GenericNodeDoubleClickListener.java
new file mode 100644 (file)
index 0000000..0a93bce
--- /dev/null
@@ -0,0 +1,108 @@
+/*
+ * 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.eclipse.ui.workbench.jcr.internal;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+import javax.jcr.nodetype.NodeType;
+
+import org.argeo.ArgeoException;
+import org.argeo.eclipse.ui.jcr.utils.JcrFileProvider;
+import org.argeo.eclipse.ui.specific.FileHandler;
+import org.argeo.eclipse.ui.workbench.WorkbenchUiPlugin;
+import org.argeo.eclipse.ui.workbench.jcr.DefaultNodeEditor;
+import org.argeo.eclipse.ui.workbench.jcr.internal.model.RepositoryElem;
+import org.argeo.eclipse.ui.workbench.jcr.internal.model.SingleJcrNodeElem;
+import org.argeo.eclipse.ui.workbench.jcr.internal.model.WorkspaceElem;
+import org.argeo.eclipse.ui.workbench.jcr.internal.parts.GenericNodeEditorInput;
+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 GenericNodeDoubleClickListener implements IDoubleClickListener {
+
+       // private final static Log log = LogFactory
+       // .getLog(GenericNodeDoubleClickListener.class);
+
+       private TreeViewer nodeViewer;
+       private JcrFileProvider jfp;
+       private FileHandler fileHandler;
+
+       public GenericNodeDoubleClickListener(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.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)) {
+                                       // double click on a file node triggers its opening
+                                       String name = node.getName();
+                                       String id = node.getIdentifier();
+
+                                       // For the file provider to be able to browse the
+                                       // various
+                                       // repository.
+                                       // TODO : enhanced that.
+                                       // ITreeContentProvider itcp = (ITreeContentProvider)
+                                       // nodeViewer
+                                       // .getContentProvider();
+                                       jfp.setReferenceNode(node);
+                                       if (fileHandler != null)
+                                               fileHandler.openFile(name, id);
+                               }
+                               GenericNodeEditorInput gnei = new GenericNodeEditorInput(node);
+                               WorkbenchUiPlugin.getDefault().getWorkbench()
+                                               .getActiveWorkbenchWindow().getActivePage()
+                                               .openEditor(gnei, DefaultNodeEditor.ID);
+                       } catch (RepositoryException re) {
+                               throw new ArgeoException(
+                                               "Repository error while getting node info", re);
+                       } catch (PartInitException pie) {
+                               throw new ArgeoException(
+                                               "Unexepected exception while opening node editor", pie);
+                       }
+               }
+       }
+}
\ No newline at end of file
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/JcrBrowserUtils.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/JcrBrowserUtils.java
new file mode 100644 (file)
index 0000000..8649023
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * 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.eclipse.ui.workbench.jcr.internal;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+
+import org.argeo.ArgeoException;
+import org.argeo.eclipse.ui.TreeParent;
+import org.argeo.eclipse.ui.workbench.jcr.internal.model.RepositoriesElem;
+import org.argeo.eclipse.ui.workbench.jcr.internal.model.RepositoryElem;
+import org.argeo.eclipse.ui.workbench.jcr.internal.model.SingleJcrNodeElem;
+import org.argeo.eclipse.ui.workbench.jcr.internal.model.WorkspaceElem;
+
+/** Centralizes useful methods to manage the JCR Browser */
+public class JcrBrowserUtils {
+
+       /** 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 ArgeoException(
+                                       "Unexpected error while synchronising the UI with the JCR repository",
+                                       re);
+               }
+       }
+}
\ No newline at end of file
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/NodeContentProvider.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/NodeContentProvider.java
new file mode 100644 (file)
index 0000000..c8b4be9
--- /dev/null
@@ -0,0 +1,189 @@
+/*
+ * 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.eclipse.ui.workbench.jcr.internal;
+
+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.eclipse.ui.TreeParent;
+import org.argeo.jcr.ArgeoJcrConstants;
+import org.argeo.jcr.RepositoryRegister;
+import org.argeo.jcr.UserJcrUtils;
+import org.argeo.eclipse.ui.workbench.jcr.internal.model.RepositoriesElem;
+import org.argeo.eclipse.ui.workbench.jcr.internal.model.SingleJcrNodeElem;
+import org.argeo.util.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 = UserJcrUtils.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(), ArgeoJcrConstants.ALIAS_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();
+                               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());
+               }
+       }
+}
\ No newline at end of file
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/NodeLabelProvider.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/NodeLabelProvider.java
new file mode 100644 (file)
index 0000000..f8949e7
--- /dev/null
@@ -0,0 +1,124 @@
+/*
+ * 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.eclipse.ui.workbench.jcr.internal;
+
+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.ArgeoException;
+import org.argeo.eclipse.ui.workbench.jcr.JcrImages;
+import org.argeo.eclipse.ui.workbench.jcr.internal.model.RemoteRepositoryElem;
+import org.argeo.eclipse.ui.workbench.jcr.internal.model.RepositoriesElem;
+import org.argeo.eclipse.ui.workbench.jcr.internal.model.RepositoryElem;
+import org.argeo.eclipse.ui.workbench.jcr.internal.model.SingleJcrNodeElem;
+import org.argeo.eclipse.ui.workbench.jcr.internal.model.WorkspaceElem;
+import org.argeo.jcr.ArgeoTypes;
+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
+                               return super.getText(element);
+               } catch (RepositoryException e) {
+                       throw new ArgeoException(
+                                       "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;
+                       else if (node.isNodeType(ArgeoTypes.ARGEO_USER_HOME))
+                               return JcrImages.HOME;
+                       else
+                               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.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/PropertiesContentProvider.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/PropertiesContentProvider.java
new file mode 100644 (file)
index 0000000..c9c5a6e
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * 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.eclipse.ui.workbench.jcr.internal;
+
+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.ArgeoException;
+import org.argeo.eclipse.ui.jcr.utils.JcrItemsComparator;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+
+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 ArgeoException("Cannot get element for " + inputElement,
+                                       e);
+               }
+       }
+}
\ No newline at end of file
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/PropertyLabelProvider.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/PropertyLabelProvider.java
new file mode 100644 (file)
index 0000000..5781afe
--- /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.eclipse.ui.workbench.jcr.internal;
+
+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.ArgeoException;
+import org.argeo.eclipse.ui.workbench.WorkbenchConstants;
+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_ATTRIBUTES = 2;
+
+       // 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_ATTRIBUTES:
+                                               return JcrUtils.getPropertyDefinitionAsString(prop);
+                                       }
+                               } else {
+                                       switch (columnIndex) {
+                                       case COLUMN_PROPERTY:
+                                               return prop.getName();
+                                       case COLUMN_VALUE:
+                                               return formatValueAsString(prop.getValue());
+                                       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_ATTRIBUTES:
+                                       // Corresponding attributes are listed on the parent
+                                       return "";
+                               }
+                       }
+
+               } catch (RepositoryException re) {
+                       throw new ArgeoException(
+                                       "Unexepected error while getting property values", 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 ArgeoException("unexpected error while formatting value",
+                                       e);
+               }
+       }
+}
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/SingleNodeAsTreeContentProvider.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/SingleNodeAsTreeContentProvider.java
new file mode 100644 (file)
index 0000000..01cba72
--- /dev/null
@@ -0,0 +1,106 @@
+/*
+ * 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.eclipse.ui.workbench.jcr.internal;
+
+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.ArgeoException;
+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 SingleNodeAsTreeContentProvider 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 ArgeoException(
+                                       "Unexpected error while getting child nodes for children editor page ",
+                                       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 ArgeoException("Cannot check children of " + element, e);
+               }
+       }
+
+       public void dispose() {
+       }
+
+       public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+       }
+
+       protected Object[] childrenNodes(Node parentNode) {
+               try {
+                       List<Node> children = new ArrayList<Node>();
+                       NodeIterator nit = parentNode.getNodes();
+                       while (nit.hasNext()) {
+                               Node node = nit.nextNode();
+                               children.add(node);
+                       }
+                       Node[] arr = children.toArray(new Node[children.size()]);
+                       Arrays.sort(arr, itemComparator);
+                       return arr;
+               } catch (RepositoryException e) {
+                       throw new ArgeoException("Cannot list children of " + parentNode, e);
+               }
+       }
+}
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/VersionLabelProvider.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/VersionLabelProvider.java
new file mode 100644 (file)
index 0000000..873b6b6
--- /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.eclipse.ui.workbench.jcr.internal;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+import javax.jcr.version.Version;
+
+import org.argeo.ArgeoException;
+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 Get text method does not assume that
+ * Version extends 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 ArgeoException(
+                                       "Unexpected error while getting element name", re);
+               }
+               return super.getText(element);
+       }
+}
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/model/MaintainedRepositoryElem.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/model/MaintainedRepositoryElem.java
new file mode 100644 (file)
index 0000000..87e40e4
--- /dev/null
@@ -0,0 +1,24 @@
+package org.argeo.eclipse.ui.workbench.jcr.internal.model;
+
+import javax.jcr.Repository;
+
+import org.argeo.ArgeoException;
+import org.argeo.eclipse.ui.TreeParent;
+import org.argeo.jcr.MaintainedRepository;
+
+/** Wraps a {@link 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 amiantained repository");
+               }
+       }
+
+       protected MaintainedRepository getMaintainedRepository() {
+               return (MaintainedRepository) getRepository();
+       }
+}
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/model/RemoteRepositoryElem.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/model/RemoteRepositoryElem.java
new file mode 100644 (file)
index 0000000..3e94f88
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ * 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.eclipse.ui.workbench.jcr.internal.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.ArgeoException;
+import org.argeo.eclipse.ui.TreeParent;
+import org.argeo.jcr.ArgeoJcrUtils;
+import org.argeo.jcr.ArgeoNames;
+import org.argeo.util.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();
+               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 = ArgeoJcrUtils.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 ArgeoException("Cannot remove " + remoteNodePath, e);
+               }
+       }
+
+}
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/model/RepositoriesElem.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/model/RepositoriesElem.java
new file mode 100644 (file)
index 0000000..0f5ca6e
--- /dev/null
@@ -0,0 +1,134 @@
+/*
+ * 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.eclipse.ui.workbench.jcr.internal.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.ArgeoException;
+import org.argeo.eclipse.ui.ErrorFeedback;
+import org.argeo.eclipse.ui.TreeParent;
+import org.argeo.jcr.ArgeoNames;
+import org.argeo.jcr.MaintainedRepository;
+import org.argeo.jcr.RepositoryRegister;
+import org.argeo.jcr.UserJcrUtils;
+import org.argeo.util.security.Keyring;
+
+/**
+ * UI Tree component. 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 ArgeoException(
+                                                       "Cannot browse remote repositories", e);
+                               }
+                       }
+                       return super.getChildren();
+               }
+       }
+
+       protected void addRemoteRepositories(Keyring jcrKeyring)
+                       throws RepositoryException {
+               Node userHome = UserJcrUtils.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.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/model/RepositoryElem.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/model/RepositoryElem.java
new file mode 100644 (file)
index 0000000..6a42bd8
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+ * 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.eclipse.ui.workbench.jcr.internal.model;
+
+import javax.jcr.Repository;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+
+import org.argeo.ArgeoException;
+import org.argeo.eclipse.ui.TreeParent;
+
+/**
+ * UI Tree component. Wraps a JCR {@link Repository}. It also keeps a reference
+ * to its parent Tree Ui component; typically the unique {@link Repositories}
+ * 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 & 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(null);
+                       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 ArgeoException("Cannot connect to repository " + alias, e);
+               }
+       }
+
+       /**
+        * 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 ArgeoException("Cannot retrieve workspace names", e);
+               }
+       }
+
+       public void createWorkspace(String workspaceName) {
+               if (!isConnected())
+                       login();
+               try {
+                       defaultSession.getWorkspace().createWorkspace(workspaceName);
+               } catch (RepositoryException e) {
+                       throw new ArgeoException("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.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/model/SingleJcrNodeElem.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/model/SingleJcrNodeElem.java
new file mode 100644 (file)
index 0000000..06d0fa2
--- /dev/null
@@ -0,0 +1,108 @@
+/*
+ * 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.eclipse.ui.workbench.jcr.internal.model;
+
+import javax.jcr.Node;
+import javax.jcr.NodeIterator;
+import javax.jcr.RepositoryException;
+import javax.jcr.Workspace;
+
+import org.argeo.ArgeoException;
+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;
+
+       // keeps a local reference to the node's name to avoid exception when the
+       // session is lost
+       // private final String name;
+
+       /** 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;
+       }
+
+       /**
+        * Override normal behavior to initialize 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 ArgeoException(
+                                               "Unexcpected error while initializing children SingleJcrNode",
+                                               re);
+                       }
+               }
+       }
+
+       @Override
+       public boolean hasChildren() {
+               try {
+                       if (node.getSession().isLive())
+                               return node.hasNodes();
+                       else
+                               return false;
+               } catch (RepositoryException re) {
+                       throw new ArgeoException(
+                                       "Unexpected error while checking children node existence",
+                                       re);
+               }
+       }
+
+}
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/model/WorkspaceElem.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/model/WorkspaceElem.java
new file mode 100644 (file)
index 0000000..8cd08d9
--- /dev/null
@@ -0,0 +1,130 @@
+/*
+ * 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.eclipse.ui.workbench.jcr.internal.model;
+
+import javax.jcr.Node;
+import javax.jcr.NodeIterator;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.Workspace;
+
+import org.argeo.ArgeoException;
+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 Session getSession() {
+               return session;
+       }
+
+       public Node getRootNode() {
+               try {
+                       if (session != null)
+                               return session.getRootNode();
+                       else
+                               return null;
+               } catch (RepositoryException e) {
+                       throw new ArgeoException("Cannot get root node of workspace "
+                                       + getName(), e);
+               }
+       }
+
+       public void login() {
+               try {
+                       session = ((RepositoryElem) getParent()).repositoryLogin(getName());
+               } catch (RepositoryException e) {
+                       throw new ArgeoException("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 void logout() {
+               clearChildren();
+               JcrUtils.logoutQuietly(session);
+       }
+
+       @Override
+       public boolean hasChildren() {
+               try {
+                       if (isConnected())
+                               return session.getRootNode().hasNodes();
+                       else
+                               return false;
+               } catch (RepositoryException re) {
+                       throw new ArgeoException(
+                                       "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 ArgeoException(
+                                               "Cannot initialize WorkspaceNode UI object."
+                                                               + getName(), e);
+                       }
+               }
+       }
+}
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/parts/ChangeRightsWizard.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/parts/ChangeRightsWizard.java
new file mode 100644 (file)
index 0000000..4564b5f
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * 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.eclipse.ui.workbench.jcr.internal.parts;
+
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+
+import org.argeo.ArgeoException;
+import org.argeo.jcr.JcrUtils;
+import org.eclipse.jface.wizard.Wizard;
+
+/**
+ * Small wizard to manage authorizations on the root node of the current
+ * workspace
+ */
+public class ChangeRightsWizard extends Wizard {
+
+       private Session currentSession;
+       private String path;
+
+       // This page widget
+       private ChooseRightsPage page;
+
+       public ChangeRightsWizard(Session currentSession, String path) {
+               super();
+               this.currentSession = currentSession;
+               this.path = path;
+       }
+
+       @Override
+       public void addPages() {
+               try {
+                       page = new ChooseRightsPage(path);
+                       addPage(page);
+               } catch (Exception e) {
+                       throw new ArgeoException("Cannot add page to wizard ", e);
+               }
+       }
+
+       @Override
+       public boolean performFinish() {
+               if (!canFinish())
+                       return false;
+               try {
+                       JcrUtils.addPrivilege(currentSession, path, page.getGroupName(),
+                                       page.getAuthTypeStr());
+               } catch (RepositoryException re) {
+                       throw new ArgeoException(
+                                       "Unexpected error while setting privileges", re);
+               }
+               return true;
+       }
+}
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/parts/ChildNodesPage.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/parts/ChildNodesPage.java
new file mode 100644 (file)
index 0000000..2340f36
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+ * 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.eclipse.ui.workbench.jcr.internal.parts;
+
+import javax.jcr.Node;
+
+import org.argeo.ArgeoException;
+import org.argeo.eclipse.ui.workbench.WorkbenchUiPlugin;
+import org.argeo.eclipse.ui.workbench.jcr.internal.GenericNodeDoubleClickListener;
+import org.argeo.eclipse.ui.workbench.jcr.internal.NodeLabelProvider;
+import org.argeo.eclipse.ui.workbench.jcr.internal.SingleNodeAsTreeContentProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.forms.editor.FormPage;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+
+/**
+ * List all childs of the current node and brings some browsing capabilities
+ * accross the repository
+ */
+public class ChildNodesPage extends FormPage {
+       // private final static Log log = LogFactory.getLog(ChildNodesPage.class);
+
+       // business objects
+       private Node currentNode;
+
+       // this page UI components
+       private SingleNodeAsTreeContentProvider nodeContentProvider;
+       private TreeViewer nodesViewer;
+
+       public ChildNodesPage(FormEditor editor, String title, Node currentNode) {
+               super(editor, "ChildNodesPage", title);
+               this.currentNode = currentNode;
+       }
+
+       protected void createFormContent(IManagedForm managedForm) {
+               try {
+                       ScrolledForm form = managedForm.getForm();
+                       form.setText(WorkbenchUiPlugin.getMessage("childNodesPageTitle"));
+                       Composite body = form.getBody();
+                       GridLayout twt = new GridLayout(1, false);
+                       twt.marginWidth = twt.marginHeight = 5;
+                       body.setLayout(twt);
+                       if (!currentNode.hasNodes()) {
+                               managedForm.getToolkit().createLabel(body,
+                                               WorkbenchUiPlugin.getMessage("warningNoChildNode"));
+                       } else {
+
+                               nodeContentProvider = new SingleNodeAsTreeContentProvider();
+                               nodesViewer = createNodeViewer(body, nodeContentProvider);
+                               nodesViewer.setInput(currentNode);
+                       }
+               } catch (Exception e) {
+                       throw new ArgeoException(
+                                       "Unexpected error while creating child node page", e);
+               }
+       }
+
+       protected TreeViewer createNodeViewer(Composite parent,
+                       final ITreeContentProvider nodeContentProvider) {
+
+               final TreeViewer tmpNodeViewer = new TreeViewer(parent, SWT.MULTI);
+
+               tmpNodeViewer.getTree().setLayoutData(
+                               new GridData(SWT.FILL, SWT.FILL, true, true));
+
+               tmpNodeViewer.setContentProvider(nodeContentProvider);
+               tmpNodeViewer.setLabelProvider(new NodeLabelProvider());
+               tmpNodeViewer
+                               .addDoubleClickListener(new GenericNodeDoubleClickListener(
+                                               tmpNodeViewer));
+               return tmpNodeViewer;
+       }
+}
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/parts/ChooseNameDialog.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/parts/ChooseNameDialog.java
new file mode 100644 (file)
index 0000000..02518d5
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+ * 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.eclipse.ui.workbench.jcr.internal.parts;
+
+import org.eclipse.jface.dialogs.IMessageProvider;
+import org.eclipse.jface.dialogs.TitleAreaDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+
+/** Dialog to change the current user password */
+public class ChooseNameDialog extends TitleAreaDialog {
+       private static final long serialVersionUID = 280139710002698692L;
+       private Text nameTxt;
+
+       public ChooseNameDialog(Shell parentShell) {
+               super(parentShell);
+               setTitle("Choose name");
+       }
+
+       protected Point getInitialSize() {
+               return new Point(300, 250);
+       }
+
+       protected Control createDialogArea(Composite parent) {
+               Composite dialogarea = (Composite) super.createDialogArea(parent);
+               dialogarea.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+               Composite composite = new Composite(dialogarea, SWT.NONE);
+               composite.setLayout(new GridLayout(2, false));
+               composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+               nameTxt = createLT(composite, "Name");
+
+               setMessage("Choose name", IMessageProvider.INFORMATION);
+               parent.pack();
+               return composite;
+       }
+
+       /** Creates label and text. */
+       protected Text createLT(Composite parent, String label) {
+               new Label(parent, SWT.NONE).setText(label);
+               Text text = new Text(parent, SWT.SINGLE | SWT.LEAD | SWT.BORDER);
+               text.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+               return text;
+       }
+
+       public String getName() {
+               return nameTxt.getText();
+       }
+}
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/parts/ChooseRightsPage.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/parts/ChooseRightsPage.java
new file mode 100644 (file)
index 0000000..f8a3608
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * 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.eclipse.ui.workbench.jcr.internal.parts;
+
+import javax.jcr.security.Privilege;
+
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+
+public class ChooseRightsPage extends WizardPage implements ModifyListener {
+       private static final long serialVersionUID = 8084431378762283920L;
+
+       // This page widget
+       private Text groupNameTxt;
+       private Combo authorizationCmb;
+
+       // USABLE SHORTCUTS
+       protected final static String[] validAuthType = { Privilege.JCR_READ,
+                       Privilege.JCR_WRITE, Privilege.JCR_ALL };
+
+       public ChooseRightsPage(String path) {
+               super("Main");
+               setTitle("Add privilege to " + path);
+       }
+
+       public void createControl(Composite parent) {
+               // specify subject
+               Composite composite = new Composite(parent, SWT.NONE);
+               composite.setLayout(new GridLayout(2, false));
+               Label lbl = new Label(composite, SWT.LEAD);
+               lbl.setText("Group or user name (no blank, no special chars)");
+               lbl.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
+               groupNameTxt = new Text(composite, SWT.LEAD | SWT.BORDER);
+               groupNameTxt.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true,
+                               false));
+               if (groupNameTxt != null)
+                       groupNameTxt.addModifyListener(this);
+
+               // Choose rigths
+               new Label(composite, SWT.NONE).setText("Choose corresponding rights");
+               authorizationCmb = new Combo(composite, SWT.BORDER | SWT.V_SCROLL);
+               authorizationCmb.setItems(validAuthType);
+               GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+               authorizationCmb.setLayoutData(gd);
+
+               authorizationCmb.select(0);
+
+               // Compulsory
+               setControl(composite);
+       }
+
+       protected String getGroupName() {
+               return groupNameTxt.getText();
+       }
+
+       protected String getAuthTypeStr() {
+               return authorizationCmb.getItem(authorizationCmb.getSelectionIndex());
+       }
+
+       public void modifyText(ModifyEvent event) {
+               String message = checkComplete();
+               if (message != null)
+                       setMessage(message, WizardPage.ERROR);
+               else {
+                       setMessage("Complete", WizardPage.INFORMATION);
+                       setPageComplete(true);
+               }
+       }
+
+       /** @return error message or null if complete */
+       protected String checkComplete() {
+               String groupStr = groupNameTxt.getText();
+               if (groupStr == null || "".equals(groupStr))
+                       return "Please enter the name of the corresponding group.";
+               // Remove regexp check for the time being.
+               // else if (!match(groupStr))
+               // return
+               // "Please use only alphanumerical chars for the short technical name.";
+               return null;
+       }
+}
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/parts/EmptyNodePage.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/parts/EmptyNodePage.java
new file mode 100644 (file)
index 0000000..45823f7
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * 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.eclipse.ui.workbench.jcr.internal.parts;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.forms.editor.FormPage;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+
+/**
+ * This page is only used at editor's creation time when current node has not
+ * yet been set
+ */
+public class EmptyNodePage extends FormPage {
+       // private final static Log log = LogFactory.getLog(EmptyNodePage.class);
+
+       public EmptyNodePage(FormEditor editor, String title) {
+               super(editor, "Empty Page", title);
+       }
+
+       protected void createFormContent(IManagedForm managedForm) {
+               try {
+                       ScrolledForm form = managedForm.getForm();
+                       GridLayout twt = new GridLayout(1, false);
+                       twt.marginWidth = twt.marginHeight = 0;
+                       form.getBody().setLayout(twt);
+                       Label lbl = new Label(form.getBody(), SWT.NONE);
+                       lbl.setText("Empty page");
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+       }
+}
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/parts/GenericNodeEditorInput.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/parts/GenericNodeEditorInput.java
new file mode 100644 (file)
index 0000000..bc9cc30
--- /dev/null
@@ -0,0 +1,111 @@
+/*
+ * 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.eclipse.ui.workbench.jcr.internal.parts;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+
+import org.argeo.ArgeoException;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IPersistableElement;
+
+/**
+ * An editor input based the JCR node object.
+ * */
+
+public class GenericNodeEditorInput implements IEditorInput {
+       private final Node currentNode;
+
+       // cache key properties at creation time to avoid Exception at recoring time
+       // when the session has been closed
+       private String path;
+       private String uid;
+       private String name;
+
+       public GenericNodeEditorInput(Node currentNode) {
+               this.currentNode = currentNode;
+               try {
+                       name = currentNode.getName();
+                       uid = currentNode.getIdentifier();
+                       path = currentNode.getPath();
+               } catch (RepositoryException re) {
+                       throw new ArgeoException(
+                                       "unexpected error while getting node key values at creation time",
+                                       re);
+               }
+       }
+
+       public Node getCurrentNode() {
+               return currentNode;
+       }
+
+       public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) {
+               return null;
+       }
+
+       public boolean exists() {
+               return true;
+       }
+
+       public ImageDescriptor getImageDescriptor() {
+               return null;
+       }
+
+       public String getName() {
+               return name;
+       }
+
+       public String getUid() {
+               return uid;
+       }
+
+       public String getToolTipText() {
+               return path;
+       }
+
+       public String getPath() {
+               return path;
+       }
+
+       public IPersistableElement getPersistable() {
+               return null;
+       }
+
+       /**
+        * equals method based on UID that is unique within a workspace and path of
+        * the node, thus 2 shared node that have same UID as defined in the spec
+        * but 2 different pathes will open two distinct editors.
+        * 
+        * TODO enhance this method to support multirepository and multiworkspace
+        * environments
+        */
+       public boolean equals(Object obj) {
+               if (this == obj)
+                       return true;
+               if (obj == null)
+                       return false;
+               if (getClass() != obj.getClass())
+                       return false;
+
+               GenericNodeEditorInput other = (GenericNodeEditorInput) obj;
+               if (!getUid().equals(other.getUid()))
+                       return false;
+               if (!getPath().equals(other.getPath()))
+                       return false;
+               return true;
+       }
+}
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/parts/GenericNodePage.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/parts/GenericNodePage.java
new file mode 100644 (file)
index 0000000..8aaeb33
--- /dev/null
@@ -0,0 +1,207 @@
+/*
+ * 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.eclipse.ui.workbench.jcr.internal.parts;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.ListIterator;
+
+import javax.jcr.Node;
+import javax.jcr.Property;
+import javax.jcr.PropertyIterator;
+import javax.jcr.PropertyType;
+import javax.jcr.RepositoryException;
+
+import org.argeo.ArgeoException;
+import org.argeo.eclipse.ui.workbench.WorkbenchConstants;
+import org.argeo.jcr.JcrUtils;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.AbstractFormPart;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.forms.editor.FormPage;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+
+/**
+ * Main node editor page. Lists all properties of the current node and enable
+ * access and editing for some of them.
+ */
+
+public class GenericNodePage extends FormPage implements WorkbenchConstants {
+       // private final static Log log = LogFactory.getLog(GenericNodePage.class);
+
+       // local constants
+       private final static String JCR_PROPERTY_NAME = "jcr:name";
+
+       // Utils
+       protected DateFormat timeFormatter = new SimpleDateFormat(DATE_TIME_FORMAT);
+
+       // Main business Objects
+       private Node currentNode;
+
+       // This page widgets
+       private FormToolkit tk;
+       private List<Control> modifyableProperties = new ArrayList<Control>();
+
+       public GenericNodePage(FormEditor editor, String title, Node currentNode) {
+               super(editor, "id", title);
+               this.currentNode = currentNode;
+       }
+
+       protected void createFormContent(IManagedForm managedForm) {
+               tk = managedForm.getToolkit();
+               ScrolledForm form = managedForm.getForm();
+               GridLayout twt = new GridLayout(3, false);
+               twt.marginWidth = twt.marginHeight = 5;
+
+               form.getBody().setLayout(twt);
+               createPropertiesPart(form.getBody());
+       }
+
+       private void createPropertiesPart(Composite parent) {
+               try {
+
+                       PropertyIterator pi = currentNode.getProperties();
+
+                       // Initializes form part
+                       AbstractFormPart part = new AbstractFormPart() {
+                               public void commit(boolean onSave) {
+                                       try {
+                                               if (onSave) {
+                                                       ListIterator<Control> it = modifyableProperties
+                                                                       .listIterator();
+                                                       while (it.hasNext()) {
+                                                               // we only support Text controls for the time
+                                                               // being
+                                                               Text curControl = (Text) it.next();
+                                                               String value = curControl.getText();
+                                                               currentNode.setProperty((String) curControl
+                                                                               .getData(JCR_PROPERTY_NAME), value);
+                                                       }
+
+                                                       // We only commit when onSave = true,
+                                                       // thus it is still possible to save after a tab
+                                                       // change.
+                                                       super.commit(onSave);
+                                               }
+                                       } catch (RepositoryException re) {
+                                               throw new ArgeoException(
+                                                               "Unexpected error while saving properties", re);
+                                       }
+                               }
+                       };
+
+                       while (pi.hasNext()) {
+                               Property prop = pi.nextProperty();
+                               addPropertyLine(parent, part, prop);
+                       }
+
+                       getManagedForm().addPart(part);
+               } catch (RepositoryException re) {
+                       throw new ArgeoException(
+                                       "Error during creation of network details section", re);
+               }
+
+       }
+
+       private void addPropertyLine(Composite parent, AbstractFormPart part,
+                       Property prop) {
+               try {
+                       tk.createLabel(parent, prop.getName());
+                       tk.createLabel(parent,
+                                       "[" + JcrUtils.getPropertyDefinitionAsString(prop) + "]");
+
+                       if (prop.getDefinition().isProtected()) {
+                               tk.createLabel(parent, formatReadOnlyPropertyValue(prop));
+                       } else
+                               addModifyableValueWidget(parent, part, prop);
+               } catch (RepositoryException re) {
+                       throw new ArgeoException("Cannot get property " + prop, re);
+               }
+       }
+
+       private String formatReadOnlyPropertyValue(Property prop) {
+               try {
+                       String strValue;
+
+                       if (prop.getType() == PropertyType.BINARY)
+                               strValue = "<binary>";
+                       else if (prop.isMultiple())
+                               strValue = Arrays.asList(prop.getValues()).toString();
+                       else if (prop.getType() == PropertyType.DATE)
+                               strValue = timeFormatter.format(prop.getValue().getDate()
+                                               .getTime());
+                       else
+                               strValue = prop.getValue().getString();
+
+                       return strValue;
+               } catch (RepositoryException re) {
+                       throw new ArgeoException(
+                                       "Unexpected error while formatting read only property value",
+                                       re);
+               }
+       }
+
+       private Control addModifyableValueWidget(Composite parent,
+                       AbstractFormPart part, Property prop) {
+               GridData gd;
+               try {
+                       if (prop.getType() == PropertyType.STRING) {
+                               Text txt = tk.createText(parent, prop.getString());
+                               gd = new GridData(GridData.FILL_HORIZONTAL);
+                               txt.setLayoutData(gd);
+                               txt.addModifyListener(new ModifiedFieldListener(part));
+                               txt.setData(JCR_PROPERTY_NAME, prop.getName());
+                               modifyableProperties.add(txt);
+                       } else {
+                               // unsupported property type for editing, we create a read only
+                               // label.
+                               return tk
+                                               .createLabel(parent, formatReadOnlyPropertyValue(prop));
+                       }
+                       return null;
+               } catch (RepositoryException re) {
+                       throw new ArgeoException(
+                                       "Unexpected error while formatting read only property value",
+                                       re);
+               }
+
+       }
+
+       private class ModifiedFieldListener implements ModifyListener {
+               private static final long serialVersionUID = 2117484480773434646L;
+               private AbstractFormPart formPart;
+
+               public ModifiedFieldListener(AbstractFormPart generalPart) {
+                       this.formPart = generalPart;
+               }
+
+               public void modifyText(ModifyEvent e) {
+                       formPart.markDirty();
+               }
+       }
+
+}
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/parts/GenericPropertyPage.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/parts/GenericPropertyPage.java
new file mode 100644 (file)
index 0000000..1947202
--- /dev/null
@@ -0,0 +1,304 @@
+/*
+ * 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.eclipse.ui.workbench.jcr.internal.parts;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.jcr.Node;
+import javax.jcr.Property;
+import javax.jcr.PropertyIterator;
+import javax.jcr.RepositoryException;
+import javax.jcr.Value;
+
+import org.argeo.ArgeoException;
+import org.argeo.eclipse.ui.workbench.WorkbenchConstants;
+import org.argeo.eclipse.ui.workbench.WorkbenchUiPlugin;
+import org.argeo.eclipse.ui.workbench.jcr.internal.PropertyLabelProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeColumn;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.forms.editor.FormPage;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+
+/**
+ * Generic editor property page. Lists all properties of current node as a
+ * complex tree. TODO: enable editing
+ */
+
+public class GenericPropertyPage extends FormPage implements WorkbenchConstants {
+       // private final static Log log =
+       // LogFactory.getLog(GenericPropertyPage.class);
+
+       // Main business Objects
+       private Node currentNode;
+
+       public GenericPropertyPage(FormEditor editor, String title, Node currentNode) {
+               super(editor, "id", title);
+               this.currentNode = currentNode;
+       }
+
+       protected void createFormContent(IManagedForm managedForm) {
+               ScrolledForm form = managedForm.getForm();
+               form.setText(WorkbenchUiPlugin.getMessage("genericNodePageTitle"));
+               FillLayout layout = new FillLayout();
+               layout.marginHeight = 5;
+               layout.marginWidth = 5;
+               form.getBody().setLayout(layout);
+
+               createComplexTree(form.getBody());
+       }
+
+       private TreeViewer createComplexTree(Composite parent) {
+               int style = SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION;
+               Tree tree = new Tree(parent, style);
+               createColumn(tree, "Property", SWT.LEFT, 200);
+               createColumn(tree, "Value(s)", SWT.LEFT, 300);
+               createColumn(tree, "Attributes", SWT.LEFT, 65);
+               tree.setLinesVisible(true);
+               tree.setHeaderVisible(true);
+
+               TreeViewer result = new TreeViewer(tree);
+               result.setContentProvider(new TreeContentProvider());
+               result.setLabelProvider(new PropertyLabelProvider());
+               result.setInput(currentNode);
+               result.expandAll();
+               return result;
+       }
+
+       private static TreeColumn createColumn(Tree parent, String name, int style,
+                       int width) {
+               TreeColumn result = new TreeColumn(parent, style);
+               result.setText(name);
+               result.setWidth(width);
+               result.setMoveable(true);
+               result.setResizable(true);
+               return result;
+       }
+
+       //
+       // private void createPropertiesPart(Composite parent) {
+       // try {
+       //
+       // PropertyIterator pi = currentNode.getProperties();
+       //
+       // // Initializes form part
+       // AbstractFormPart part = new AbstractFormPart() {
+       // public void commit(boolean onSave) {
+       // try {
+       // if (onSave) {
+       // ListIterator<Control> it = modifyableProperties
+       // .listIterator();
+       // while (it.hasNext()) {
+       // // we only support Text controls for the time
+       // // being
+       // Text curControl = (Text) it.next();
+       // String value = curControl.getText();
+       // currentNode.setProperty((String) curControl
+       // .getData(JCR_PROPERTY_NAME), value);
+       // }
+       //
+       // // We only commit when onSave = true,
+       // // thus it is still possible to save after a tab
+       // // change.
+       // super.commit(onSave);
+       // }
+       // } catch (RepositoryException re) {
+       // throw new ArgeoException(
+       // "Unexpected error while saving properties", re);
+       // }
+       // }
+       // };
+       //
+       // while (pi.hasNext()) {
+       // Property prop = pi.nextProperty();
+       // addPropertyLine(parent, part, prop);
+       // }
+       //
+       // getManagedForm().addPart(part);
+       // } catch (RepositoryException re) {
+       // throw new ArgeoException(
+       // "Error during creation of network details section", re);
+       // }
+       //
+       // }
+       //
+       // private void addPropertyLine(Composite parent, AbstractFormPart part,
+       // Property prop) {
+       // try {
+       // tk.createLabel(parent, prop.getName());
+       // tk.createLabel(parent,
+       // "[" + JcrUtils.getPropertyDefinitionAsString(prop) + "]");
+       //
+       // if (prop.getDefinition().isProtected()) {
+       // tk.createLabel(parent, formatReadOnlyPropertyValue(prop));
+       // } else
+       // addModifyableValueWidget(parent, part, prop);
+       // } catch (RepositoryException re) {
+       // throw new ArgeoException("Cannot get property " + prop, re);
+       // }
+       // }
+       //
+       // private String formatReadOnlyPropertyValue(Property prop) {
+       // try {
+       // String strValue;
+       //
+       // if (prop.getType() == PropertyType.BINARY)
+       // strValue = "<binary>";
+       // else if (prop.isMultiple())
+       // strValue = Arrays.asList(prop.getValues()).toString();
+       // else if (prop.getType() == PropertyType.DATE)
+       // strValue = timeFormatter.format(prop.getValue().getDate()
+       // .getTime());
+       // else
+       // strValue = prop.getValue().getString();
+       //
+       // return strValue;
+       // } catch (RepositoryException re) {
+       // throw new ArgeoException(
+       // "Unexpected error while formatting read only property value",
+       // re);
+       // }
+       // }
+       //
+       // private Control addModifyableValueWidget(Composite parent,
+       // AbstractFormPart part, Property prop) {
+       // GridData gd;
+       // try {
+       // if (prop.getType() == PropertyType.STRING) {
+       // Text txt = tk.createText(parent, prop.getString());
+       // gd = new GridData(GridData.FILL_HORIZONTAL);
+       // txt.setLayoutData(gd);
+       // txt.addModifyListener(new ModifiedFieldListener(part));
+       // txt.setData(JCR_PROPERTY_NAME, prop.getName());
+       // modifyableProperties.add(txt);
+       // } else {
+       // // unsupported property type for editing, we create a read only
+       // // label.
+       // return tk
+       // .createLabel(parent, formatReadOnlyPropertyValue(prop));
+       // }
+       // return null;
+       // } catch (RepositoryException re) {
+       // throw new ArgeoException(
+       // "Unexpected error while formatting read only property value",
+       // re);
+       // }
+       //
+       // }
+
+       // Multiple Value Model
+       // protected class MultipleValueItem {
+       // private int index;
+       // private Value value;
+       //
+       // public MultipleValueItem(int index, Value value) {
+       // this.index = index;
+       // this.value = value;
+       // }
+       //
+       // public int getIndex() {
+       // return index;
+       // }
+       //
+       // public Object getValue() {
+       // return value;
+       // }
+       // }
+
+       private class TreeContentProvider implements ITreeContentProvider {
+               private static final long serialVersionUID = -6162736530019406214L;
+
+               public Object[] getElements(Object parent) {
+                       Object[] props = null;
+                       try {
+
+                               if (parent instanceof Node) {
+                                       Node node = (Node) parent;
+                                       PropertyIterator pi;
+                                       pi = node.getProperties();
+                                       List<Property> propList = new ArrayList<Property>();
+                                       while (pi.hasNext()) {
+                                               propList.add(pi.nextProperty());
+                                       }
+                                       props = propList.toArray();
+                               }
+                       } catch (RepositoryException e) {
+                               throw new ArgeoException(
+                                               "Unexpected exception while listing node properties", e);
+                       }
+                       return props;
+               }
+
+               public Object getParent(Object child) {
+                       return null;
+               }
+
+               public Object[] getChildren(Object parent) {
+                       Object[] result = null;
+                       if (parent instanceof Property) {
+                               Property prop = (Property) parent;
+                               try {
+
+                                       if (prop.isMultiple()) {
+                                               Value[] values = prop.getValues();
+                                               // List<MultipleValueItem> list = new
+                                               // ArrayList<MultipleValueItem>();
+                                               // for (int i = 0; i < values.length; i++) {
+                                               // MultipleValueItem mvi = new MultipleValueItem(i,
+                                               // values[i]);
+                                               // list.add(mvi);
+                                               // }
+
+                                               return values;
+                                       }
+                               } catch (RepositoryException e) {
+                                       throw new ArgeoException(
+                                                       "Unexpected error getting multiple values property.",
+                                                       e);
+                               }
+                       }
+                       return result;
+               }
+
+               public boolean hasChildren(Object parent) {
+                       try {
+                               if (parent instanceof Property
+                                               && ((Property) parent).isMultiple()) {
+                                       return true;
+                               }
+                       } catch (RepositoryException e) {
+                               throw new ArgeoException(
+                                               "Unexpected exception while checking if property is multiple",
+                                               e);
+                       }
+                       return false;
+               }
+
+               public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+               }
+
+               public void dispose() {
+               }
+       }
+}
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/parts/ImportFileSystemWizard.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/parts/ImportFileSystemWizard.java
new file mode 100644 (file)
index 0000000..cded3a4
--- /dev/null
@@ -0,0 +1,236 @@
+/*
+ * 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.eclipse.ui.workbench.jcr.internal.parts;
+
+import java.io.File;
+import java.io.FileInputStream;
+
+import javax.jcr.Binary;
+import javax.jcr.Node;
+import javax.jcr.Property;
+import javax.jcr.nodetype.NodeType;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.argeo.ArgeoException;
+import org.argeo.eclipse.ui.ErrorFeedback;
+import org.argeo.eclipse.ui.specific.ImportToServerWizardPage;
+import org.argeo.eclipse.ui.specific.UploadFileWizardPage;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.wizard.Wizard;
+
+public class ImportFileSystemWizard extends Wizard {
+       private final static Log log = LogFactory
+                       .getLog(ImportFileSystemWizard.class);
+
+       private UploadFileWizardPage importPage;
+       private final Node folder;
+
+       public ImportFileSystemWizard(Node folder) {
+               this.folder = folder;
+               setWindowTitle("Import from file system");
+       }
+
+       @Override
+       public void addPages() {
+               importPage = new UploadFileWizardPage();
+               addPage(importPage);
+               setNeedsProgressMonitor(importPage.getNeedsProgressMonitor());
+       }
+
+       /**
+        * Called when the user click on 'Finish' in the wizard. The real upload to
+        * the JCR repository is done here.
+        */
+       @Override
+       public boolean performFinish() {
+
+               // Initialization
+               final String objectType = importPage.getObjectType();
+               final String objectPath = importPage.getObjectPath();
+
+               // We do not display a progress bar for one file only
+               if (ImportToServerWizardPage.FILE_ITEM_TYPE.equals(objectType)) {
+                       // In Rap we must force the "real" upload of the file
+                       importPage.performFinish();
+                       try {
+                               Node fileNode = folder.addNode(importPage.getObjectName(),
+                                               NodeType.NT_FILE);
+                               Node resNode = fileNode.addNode(Property.JCR_CONTENT,
+                                               NodeType.NT_RESOURCE);
+                               Binary binary = null;
+                               try {
+                                       binary = folder.getSession().getValueFactory()
+                                                       .createBinary(importPage.getFileInputStream());
+                                       resNode.setProperty(Property.JCR_DATA, binary);
+                               } finally {
+                                       if (binary != null)
+                                               binary.dispose();
+                                       IOUtils.closeQuietly(importPage.getFileInputStream());
+                               }
+                               folder.getSession().save();
+                       } catch (Exception e) {
+                               e.printStackTrace();
+                               return false;
+                       }
+                       return true;
+               } else if (ImportToServerWizardPage.FOLDER_ITEM_TYPE.equals(objectType)) {
+                       if (objectPath == null || !new File(objectPath).exists()) {
+                               ErrorFeedback.show("Directory " + objectPath
+                                               + " does not exist");
+                               return false;
+                       }
+
+                       Boolean failed = false;
+                       final File dir = new File(objectPath).getAbsoluteFile();
+                       final Long sizeB = directorySize(dir, 0l);
+                       final Stats stats = new Stats();
+                       Long begin = System.currentTimeMillis();
+                       try {
+                               getContainer().run(true, true, new IRunnableWithProgress() {
+                                       public void run(IProgressMonitor monitor) {
+                                               try {
+                                                       Integer sizeKB = (int) (sizeB / FileUtils.ONE_KB);
+                                                       monitor.beginTask("", sizeKB);
+                                                       importDirectory(folder, dir, monitor, stats);
+                                                       monitor.done();
+                                               } catch (Exception e) {
+                                                       if (e instanceof RuntimeException)
+                                                               throw (RuntimeException) e;
+                                                       else
+                                                               throw new ArgeoException("Cannot import "
+                                                                               + objectPath, e);
+                                               }
+                                       }
+                               });
+                       } catch (Exception e) {
+                               ErrorFeedback.show("Cannot import " + objectPath, e);
+                               failed = true;
+                       }
+
+                       Long duration = System.currentTimeMillis() - begin;
+                       Long durationS = duration / 1000l;
+                       String durationStr = (durationS / 60) + " min " + (durationS % 60)
+                                       + " s";
+                       StringBuffer message = new StringBuffer("Imported\n");
+                       message.append(stats.fileCount).append(" files\n");
+                       message.append(stats.dirCount).append(" directories\n");
+                       message.append(FileUtils.byteCountToDisplaySize(stats.sizeB));
+                       if (failed)
+                               message.append(" of planned ").append(
+                                               FileUtils.byteCountToDisplaySize(sizeB));
+                       message.append("\n");
+                       message.append("in ").append(durationStr).append("\n");
+                       if (failed)
+                               MessageDialog.openError(getShell(), "Import failed",
+                                               message.toString());
+                       else
+                               MessageDialog.openInformation(getShell(), "Import successful",
+                                               message.toString());
+
+                       return true;
+               }
+               return false;
+
+       }
+
+       /** Recursively computes the size of the directory in bytes. */
+       protected Long directorySize(File dir, Long currentSize) {
+               Long size = currentSize;
+               File[] files = dir.listFiles();
+               for (File file : files) {
+                       if (file.isDirectory()) {
+                               size = directorySize(file, size);
+                       } else {
+                               size = size + file.length();
+                       }
+               }
+               return size;
+       }
+
+       /**
+        * Import recursively a directory and its content to the repository.
+        */
+       protected void importDirectory(Node folder, File dir,
+                       IProgressMonitor monitor, Stats stats) {
+               try {
+                       File[] files = dir.listFiles();
+                       for (File file : files) {
+                               if (file.isDirectory()) {
+                                       Node childFolder = folder.addNode(file.getName(),
+                                                       NodeType.NT_FOLDER);
+                                       importDirectory(childFolder, file, monitor, stats);
+                                       folder.getSession().save();
+                                       stats.dirCount++;
+                               } else {
+                                       Long fileSize = file.length();
+                                       // we skip temporary files that are created by apps when a
+                                       // file is being edited.
+                                       // TODO : make this configurable.
+                                       if (file.getName().lastIndexOf('~') != file.getName()
+                                                       .length() - 1) {
+
+                                               monitor.subTask(file.getName() + " ("
+                                                               + FileUtils.byteCountToDisplaySize(fileSize)
+                                                               + ") " + file.getCanonicalPath());
+                                               try {
+                                                       Node fileNode = folder.addNode(file.getName(),
+                                                                       NodeType.NT_FILE);
+                                                       Node resNode = fileNode.addNode(
+                                                                       Property.JCR_CONTENT, NodeType.NT_RESOURCE);
+                                                       Binary binary = null;
+                                                       try {
+                                                               binary = folder
+                                                                               .getSession()
+                                                                               .getValueFactory()
+                                                                               .createBinary(new FileInputStream(file));
+                                                               resNode.setProperty(Property.JCR_DATA, binary);
+                                                       } finally {
+                                                               if (binary != null)
+                                                                       binary.dispose();
+                                                       }
+                                                       folder.getSession().save();
+                                                       stats.fileCount++;
+                                                       stats.sizeB = stats.sizeB + fileSize;
+                                               } catch (Exception e) {
+                                                       log.warn("Import of "
+                                                                       + file
+                                                                       + " ("
+                                                                       + FileUtils
+                                                                                       .byteCountToDisplaySize(fileSize)
+                                                                       + ") failed: " + e);
+                                                       folder.getSession().refresh(false);
+                                               }
+                                               monitor.worked((int) (fileSize / FileUtils.ONE_KB));
+                                       }
+                               }
+                       }
+               } catch (Exception e) {
+                       throw new ArgeoException("Cannot import " + dir + " to " + folder,
+                                       e);
+               }
+       }
+
+       static class Stats {
+               public Long fileCount = 0l;
+               public Long dirCount = 0l;
+               public Long sizeB = 0l;
+       }
+}
\ No newline at end of file
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/parts/NodeRightsManagementPage.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/parts/NodeRightsManagementPage.java
new file mode 100644 (file)
index 0000000..212244b
--- /dev/null
@@ -0,0 +1,139 @@
+/*
+ * 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.eclipse.ui.workbench.jcr.internal.parts;
+
+import javax.jcr.Node;
+import javax.jcr.security.AccessControlManager;
+import javax.jcr.security.Privilege;
+
+import org.argeo.ArgeoException;
+import org.argeo.eclipse.ui.workbench.WorkbenchUiPlugin;
+import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TableViewerColumn;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.forms.editor.FormPage;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+
+/** Display and edit a given node rights */
+public class NodeRightsManagementPage extends FormPage {
+
+       private Node currentNode;
+
+       private TableViewer viewer;
+
+       public NodeRightsManagementPage(FormEditor editor, String title,
+                       Node currentNode) {
+               super(editor, "NodeRightsManagementPage", title);
+               this.currentNode = currentNode;
+       }
+
+       protected void createFormContent(IManagedForm managedForm) {
+               ScrolledForm form = managedForm.getForm();
+               form.setText(WorkbenchUiPlugin
+                               .getMessage("nodeRightsManagementPageTitle"));
+               FillLayout layout = new FillLayout();
+               layout.marginHeight = 5;
+               layout.marginWidth = 5;
+               form.getBody().setLayout(layout);
+               createRightsPart(form.getBody());
+       }
+
+       /** Creates the rights part */
+       protected void createRightsPart(Composite parent) {
+               Table table = new Table(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
+               table.setLinesVisible(true);
+               table.setHeaderVisible(true);
+               viewer = new TableViewer(table);
+
+               // check column
+               TableViewerColumn column = createTableViewerColumn(viewer, "checked",
+                               20);
+               column.setLabelProvider(new ColumnLabelProvider() {
+                       private static final long serialVersionUID = 3314605415711811035L;
+
+                       public String getText(Object element) {
+                               return null;
+                       }
+
+                       public Image getImage(Object element) {
+                               return null;
+                       }
+               });
+               // column.setEditingSupport(new RoleEditingSupport(rolesViewer, part));
+
+               // role column
+               column = createTableViewerColumn(viewer, "Role", 200);
+               column.setLabelProvider(new ColumnLabelProvider() {
+                       private static final long serialVersionUID = -2290781173498395973L;
+
+                       public String getText(Object element) {
+                               Privilege p = (Privilege) element;
+                               return p.getName();
+                       }
+
+                       public Image getImage(Object element) {
+                               return null;
+                       }
+               });
+               viewer.setContentProvider(new RightsContentProvider());
+               viewer.setInput(getEditorSite());
+       }
+
+       protected TableViewerColumn createTableViewerColumn(TableViewer viewer,
+                       String title, int bound) {
+               final TableViewerColumn viewerColumn = new TableViewerColumn(viewer,
+                               SWT.NONE);
+               final TableColumn column = viewerColumn.getColumn();
+               column.setText(title);
+               column.setWidth(bound);
+               column.setResizable(true);
+               column.setMoveable(true);
+               return viewerColumn;
+       }
+
+       private class RightsContentProvider implements IStructuredContentProvider {
+               private static final long serialVersionUID = -7631476348552802706L;
+
+               public void dispose() {
+               }
+
+               public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+               }
+
+               public Object[] getElements(Object inputElement) {
+                       try {
+                               AccessControlManager accessControlManager = currentNode
+                                               .getSession().getAccessControlManager();
+                               Privilege[] privileges = accessControlManager
+                                               .getPrivileges(currentNode.getPath());
+                               return privileges;
+                       } catch (Exception e) {
+                               throw new ArgeoException("Cannot retrieve rights", e);
+                       }
+               }
+
+       }
+}
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/parts/NodeVersionHistoryPage.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/parts/NodeVersionHistoryPage.java
new file mode 100644 (file)
index 0000000..fa79a24
--- /dev/null
@@ -0,0 +1,319 @@
+/*
+ * 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.eclipse.ui.workbench.jcr.internal.parts;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.List;
+import java.util.Map;
+
+import javax.jcr.Node;
+import javax.jcr.Property;
+import javax.jcr.PropertyType;
+import javax.jcr.RepositoryException;
+import javax.jcr.Value;
+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.ArgeoException;
+import org.argeo.eclipse.ui.workbench.WorkbenchConstants;
+import org.argeo.eclipse.ui.workbench.WorkbenchUiPlugin;
+import org.argeo.jcr.JcrUtils;
+import org.argeo.jcr.PropertyDiff;
+import org.argeo.jcr.VersionDiff;
+import org.argeo.eclipse.ui.workbench.jcr.internal.FullVersioningTreeContentProvider;
+import org.argeo.eclipse.ui.workbench.jcr.internal.GenericNodeDoubleClickListener;
+import org.argeo.eclipse.ui.workbench.jcr.internal.VersionLabelProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.AbstractFormPart;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.forms.editor.FormPage;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+import org.eclipse.ui.forms.widgets.Section;
+import org.eclipse.ui.forms.widgets.TableWrapData;
+import org.eclipse.ui.forms.widgets.TableWrapLayout;
+
+/**
+ * Offers two main sections : one to display a text area with a summary of all
+ * variations between a version and its predecessor and one tree view that
+ * enable browsing
+ * */
+public class NodeVersionHistoryPage extends FormPage implements
+               WorkbenchConstants {
+       // private final static Log log = LogFactory
+       // .getLog(NodeVersionHistoryPage.class);
+
+       // Utils
+       protected DateFormat timeFormatter = new SimpleDateFormat(DATE_TIME_FORMAT);
+
+       // business objects
+       private Node currentNode;
+
+       // this page UI components
+       private FullVersioningTreeContentProvider nodeContentProvider;
+       private TreeViewer nodesViewer;
+       private FormToolkit tk;
+
+       public NodeVersionHistoryPage(FormEditor editor, String title,
+                       Node currentNode) {
+               super(editor, "NodeVersionHistoryPage", title);
+               this.currentNode = currentNode;
+       }
+
+       protected void createFormContent(IManagedForm managedForm) {
+               ScrolledForm form = managedForm.getForm();
+               form.setText(WorkbenchUiPlugin
+                               .getMessage("nodeVersionHistoryPageTitle"));
+               tk = managedForm.getToolkit();
+               GridLayout twt = new GridLayout(1, false);
+               twt.marginWidth = twt.marginHeight = 5;
+               Composite body = form.getBody();
+               body.setLayout(twt);
+
+               try {
+                       if (!currentNode.isNodeType(NodeType.MIX_VERSIONABLE)) {
+                               tk.createLabel(body, WorkbenchUiPlugin
+                                               .getMessage("warningUnversionableNode"));
+                       } else {
+                               createHistorySection(form.getBody());
+                               createTreeSection(form.getBody());
+                       }
+               } catch (RepositoryException e) {
+                       throw new ArgeoException(
+                                       "Unexpected error while checking if node is versionable", e);
+               }
+       }
+
+       protected void createTreeSection(Composite parent) {
+               // Section Layout & MetaData
+               Section section = tk.createSection(parent, Section.TWISTIE);
+               section.setLayoutData(new GridData(GridData.FILL_BOTH));
+               section.setText(WorkbenchUiPlugin.getMessage("versionTreeSectionTitle"));
+
+               // Section Body
+               Composite body = tk.createComposite(section, SWT.FILL);
+               // WARNING : 2 following lines are compulsory or body won't be
+               // displayed.
+               body.setLayout(new GridLayout());
+               section.setClient(body);
+
+               body.setLayoutData(new GridData(GridData.FILL_BOTH));
+               section.setExpanded(true);
+
+               nodeContentProvider = new FullVersioningTreeContentProvider();
+               nodesViewer = createNodeViewer(body, nodeContentProvider);
+               nodesViewer.setInput(currentNode);
+       }
+
+       protected TreeViewer createNodeViewer(Composite parent,
+                       final ITreeContentProvider nodeContentProvider) {
+
+               final TreeViewer tmpNodeViewer = new TreeViewer(parent, SWT.MULTI);
+
+               tmpNodeViewer.getTree().setLayoutData(
+                               new GridData(SWT.FILL, SWT.FILL, true, true));
+
+               tmpNodeViewer.setContentProvider(nodeContentProvider);
+               tmpNodeViewer.setLabelProvider(new VersionLabelProvider());
+               tmpNodeViewer
+                               .addDoubleClickListener(new GenericNodeDoubleClickListener(
+                                               tmpNodeViewer));
+               return tmpNodeViewer;
+       }
+
+       protected void createHistorySection(Composite parent) {
+
+               // Section Layout
+               Section section = tk.createSection(parent, Section.TWISTIE);
+               section.setLayoutData(new GridData(TableWrapData.FILL_GRAB));
+               TableWrapLayout twt = new TableWrapLayout();
+               section.setLayout(twt);
+
+               // Set title of the section
+               section.setText(WorkbenchUiPlugin
+                               .getMessage("versionHistorySectionTitle"));
+
+               final Text styledText = tk.createText(section, "", SWT.FULL_SELECTION
+                               | SWT.BORDER | SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
+               styledText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+               section.setClient(styledText);
+               refreshHistory(styledText);
+               styledText.setEditable(false);
+               section.setExpanded(false);
+
+               AbstractFormPart part = new AbstractFormPart() {
+                       public void commit(boolean onSave) {
+                       }
+
+                       public void refresh() {
+                               super.refresh();
+                               refreshHistory(styledText);
+                       }
+               };
+               getManagedForm().addPart(part);
+       }
+
+       protected void refreshHistory(Text styledText) {
+               try {
+                       List<VersionDiff> lst = listHistoryDiff();
+                       StringBuffer main = new StringBuffer("");
+
+                       for (int i = lst.size() - 1; i >= 0; i--) {
+                               if (i == 0)
+                                       main.append("Creation (");
+                               else
+                                       main.append("Update " + i + " (");
+
+                               if (lst.get(i).getUserId() != null)
+                                       main.append("UserId : " + lst.get(i).getUserId());
+
+                               if (lst.get(i).getUserId() != null
+                                               && lst.get(i).getUpdateTime() != null)
+                                       main.append(", ");
+
+                               if (lst.get(i).getUpdateTime() != null)
+                                       main.append("Date : "
+                                                       + timeFormatter.format(lst.get(i).getUpdateTime()
+                                                                       .getTime()) + ")\n");
+
+                               StringBuffer buf = new StringBuffer("");
+                               Map<String, PropertyDiff> diffs = lst.get(i).getDiffs();
+                               for (String prop : diffs.keySet()) {
+                                       PropertyDiff pd = diffs.get(prop);
+                                       // String propName = pd.getRelPath();
+                                       Value refValue = pd.getReferenceValue();
+                                       Value newValue = pd.getNewValue();
+                                       String refValueStr = "";
+                                       String newValueStr = "";
+
+                                       if (refValue != null) {
+                                               if (refValue.getType() == PropertyType.DATE) {
+                                                       refValueStr = timeFormatter.format(refValue
+                                                                       .getDate().getTime());
+                                               } else
+                                                       refValueStr = refValue.getString();
+                                       }
+                                       if (newValue != null) {
+                                               if (newValue.getType() == PropertyType.DATE) {
+                                                       newValueStr = timeFormatter.format(newValue
+                                                                       .getDate().getTime());
+                                               } else
+                                                       newValueStr = newValue.getString();
+                                       }
+
+                                       if (pd.getType() == PropertyDiff.MODIFIED) {
+                                               buf.append(prop).append(": ");
+                                               buf.append(refValueStr);
+                                               buf.append(" > ");
+                                               buf.append(newValueStr);
+                                               buf.append("\n");
+                                       } else if (pd.getType() == PropertyDiff.ADDED
+                                                       && !"".equals(newValueStr)) {
+                                               // we don't list property that have been added with an
+                                               // empty string as value
+                                               buf.append(prop).append(": ");
+                                               buf.append(" + ");
+                                               buf.append(newValueStr);
+                                               buf.append("\n");
+                                       } else if (pd.getType() == PropertyDiff.REMOVED) {
+                                               buf.append(prop).append(": ");
+                                               buf.append(" - ");
+                                               buf.append(refValueStr);
+                                               buf.append("\n");
+                                       }
+                               }
+                               buf.append("\n");
+                               main.append(buf);
+                       }
+                       styledText.setText(main.toString());
+               } catch (RepositoryException e) {
+                       throw new ArgeoException("Cannot generate history for node", e);
+               }
+
+       }
+
+       public List<VersionDiff> listHistoryDiff() {
+               try {
+                       List<VersionDiff> res = new ArrayList<VersionDiff>();
+                       VersionManager versionManager = currentNode.getSession()
+                                       .getWorkspace().getVersionManager();
+                       VersionHistory versionHistory = versionManager
+                                       .getVersionHistory(currentNode.getPath());
+
+                       VersionIterator vit = versionHistory.getAllLinearVersions();
+                       while (vit.hasNext()) {
+                               Version version = vit.nextVersion();
+                               Node node = version.getFrozenNode();
+                               Version predecessor = null;
+                               try {
+                                       predecessor = version.getLinearPredecessor();
+                               } catch (Exception e) {
+                                       // no predecessor seems to throw an exception even if it
+                                       // shouldn't...
+                               }
+                               if (predecessor == null) {// original
+                               } else {
+                                       Map<String, PropertyDiff> diffs = JcrUtils.diffProperties(
+                                                       predecessor.getFrozenNode(), node);
+                                       if (!diffs.isEmpty()) {
+                                               String lastUserName = null;
+                                               Calendar lastUpdate = null;
+                                               try {
+                                                       if (currentNode
+                                                                       .isNodeType(NodeType.MIX_LAST_MODIFIED)) {
+                                                               lastUserName = node.getProperty(
+                                                                               Property.JCR_LAST_MODIFIED_BY)
+                                                                               .getString();
+                                                               lastUpdate = node.getProperty(
+                                                                               Property.JCR_LAST_MODIFIED).getDate();
+                                                       } else
+                                                               lastUpdate = version.getProperty(
+                                                                               Property.JCR_CREATED).getDate();
+
+                                               } catch (Exception e) {
+                                                       // Silent that info is optional
+                                               }
+                                               VersionDiff vd = new VersionDiff(lastUserName,
+                                                               lastUpdate, diffs);
+                                               res.add(vd);
+                                       }
+                               }
+                       }
+                       return res;
+               } catch (RepositoryException e) {
+                       throw new ArgeoException("Cannot generate history for node ");
+               }
+
+       }
+
+       @Override
+       public void setActive(boolean active) {
+               super.setActive(active);
+       }
+}
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/parts/StringNodeEditorInput.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/internal/parts/StringNodeEditorInput.java
new file mode 100644 (file)
index 0000000..67b40a3
--- /dev/null
@@ -0,0 +1,120 @@
+/*
+ * 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.eclipse.ui.workbench.jcr.internal.parts;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IPersistableElement;
+
+/**
+ * An editor input based on three strings define a node :
+ * <ul>
+ * <li>complete path to the node</li>
+ * <li>the workspace name</li>
+ * <li>the repository alias</li>
+ * </ul>
+ * In a single workspace and/or repository environment, name and alias can be
+ * null.
+ * 
+ * Note : unused for the time being.
+ */
+
+public class StringNodeEditorInput implements IEditorInput {
+       private final String path;
+       private final String repositoryAlias;
+       private final String workspaceName;
+
+       /**
+        * In order to implement a generic explorer that supports remote and multi
+        * workspaces repositories, node path can be detailed by these strings.
+        * 
+        * @param repositoryAlias
+        *            : can be null
+        * @param workspaceName
+        *            : can be null
+        * @param path
+        */
+       public StringNodeEditorInput(String repositoryAlias, String workspaceName,
+                       String path) {
+               this.path = path;
+               this.repositoryAlias = repositoryAlias;
+               this.workspaceName = workspaceName;
+       }
+
+       public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) {
+               return null;
+       }
+
+       public boolean exists() {
+               return true;
+       }
+
+       public ImageDescriptor getImageDescriptor() {
+               return null;
+       }
+
+       public String getName() {
+               return path;
+       }
+
+       public String getRepositoryAlias() {
+               return repositoryAlias;
+       }
+
+       public String getWorkspaceName() {
+               return workspaceName;
+       }
+
+       public IPersistableElement getPersistable() {
+               return null;
+       }
+
+       public String getToolTipText() {
+               return path;
+       }
+
+       public String getPath() {
+               return path;
+       }
+
+       public boolean equals(Object obj) {
+               if (this == obj)
+                       return true;
+               if (obj == null)
+                       return false;
+               if (getClass() != obj.getClass())
+                       return false;
+
+               StringNodeEditorInput other = (StringNodeEditorInput) obj;
+
+               if (!path.equals(other.getPath()))
+                       return false;
+
+               String own = other.getWorkspaceName();
+               if ((workspaceName == null && own != null)
+                               || (workspaceName != null && (own == null || !workspaceName
+                                               .equals(own))))
+                       return false;
+
+               String ora = other.getRepositoryAlias();
+               if ((repositoryAlias == null && ora != null)
+                               || (repositoryAlias != null && (ora == null || !repositoryAlias
+                                               .equals(ora))))
+                       return false;
+
+               return true;
+       }
+}
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/messages.properties b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/messages.properties
new file mode 100644 (file)
index 0000000..3023c52
--- /dev/null
@@ -0,0 +1,28 @@
+## English labels for Agreo JCR UI application 
+
+## Generic labels 
+
+## Errors & warnings 
+errorUnvalidNtFolderNodeType= Error: folder can only be created on a Jcr Node
+warningInvalidNodeToImport=Can only import to a node
+warningInvalidMultipleSelection=This functionality is implemented only on a single node for the time being.
+warningUnversionableNode= Current node is not versionable.
+warningNoChildNode= Current node has no child.
+
+## Commands 
+getNodeSizeCmdLbl= Get approx. size
+addFolderNodeCmdLbl= Add Folder
+
+## GenericNodeEditor 
+nodeEditorLbl=Generic node editor
+genericNodePageTitle=Properties
+childNodesPageTitle=Children
+nodeRightsManagementPageTitle=Rights
+nodeVersionHistoryPageTitle=History
+
+# History 
+versionTreeSectionTitle=Version list
+versionHistorySectionTitle=History
+## Dummy ones 
+testLbl=Internationalizations of messages seems to work properly.
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/osgi/BundlesView.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/osgi/BundlesView.java
new file mode 100644 (file)
index 0000000..ca32da0
--- /dev/null
@@ -0,0 +1,216 @@
+//package org.argeo.eclipse.ui.workbench.osgi;
+//public class BundlesView {}
+
+/*
+ * 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.eclipse.ui.workbench.osgi;
+
+import java.util.Comparator;
+
+import org.argeo.eclipse.ui.ColumnViewerComparator;
+import org.argeo.eclipse.ui.specific.EclipseUiSpecificUtils;
+import org.argeo.eclipse.ui.workbench.WorkbenchUiPlugin;
+import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.TableViewerColumn;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.part.ViewPart;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+
+/**
+ * Overview of the bundles as a table. Equivalent to Equinox 'ss' console
+ * command.
+ */
+
+// public class BundlesView {}
+
+public class BundlesView extends ViewPart {
+       private TableViewer viewer;
+
+       @Override
+       public void createPartControl(Composite parent) {
+               viewer = new TableViewer(parent);
+               viewer.setContentProvider(new BundleContentProvider());
+               viewer.getTable().setHeaderVisible(true);
+
+               EclipseUiSpecificUtils.enableToolTipSupport(viewer);
+
+               // ID
+               TableViewerColumn column = new TableViewerColumn(viewer, SWT.NONE);
+               column.getColumn().setWidth(30);
+               column.getColumn().setText("ID");
+               column.getColumn().setAlignment(SWT.RIGHT);
+               column.setLabelProvider(new ColumnLabelProvider() {
+                       private static final long serialVersionUID = -3122136344359358605L;
+
+                       public String getText(Object element) {
+                               return Long.toString(((Bundle) element).getBundleId());
+                       }
+               });
+               new ColumnViewerComparator<Bundle>(column, new Comparator<Bundle>() {
+                       public int compare(Bundle o1, Bundle o2) {
+                               return (int) (o1.getBundleId() - o2.getBundleId());
+                       }
+               });
+
+               // State
+               column = new TableViewerColumn(viewer, SWT.NONE);
+               column.getColumn().setWidth(18);
+               column.getColumn().setText("State");
+               column.setLabelProvider(new StateLabelProvider());
+               new ColumnViewerComparator<Bundle>(column, new Comparator<Bundle>() {
+                       public int compare(Bundle o1, Bundle o2) {
+                               return o1.getState() - o2.getState();
+                       }
+               });
+
+               // Symbolic name
+               column = new TableViewerColumn(viewer, SWT.NONE);
+               column.getColumn().setWidth(300);
+               column.getColumn().setText("Symbolic Name");
+               column.setLabelProvider(new ColumnLabelProvider() {
+                       private static final long serialVersionUID = -4280840684440451080L;
+
+                       public String getText(Object element) {
+                               return ((Bundle) element).getSymbolicName();
+                       }
+               });
+               new ColumnViewerComparator<Bundle>(column, new Comparator<Bundle>() {
+                       public int compare(Bundle o1, Bundle o2) {
+                               return o1.getSymbolicName().compareTo(o2.getSymbolicName());
+                       }
+               });
+
+               // Version
+               column = new TableViewerColumn(viewer, SWT.NONE);
+               column.getColumn().setWidth(150);
+               column.getColumn().setText("Version");
+               column.setLabelProvider(new ColumnLabelProvider() {
+                       private static final long serialVersionUID = 6871926308708629989L;
+
+                       public String getText(Object element) {
+
+                               return "";
+                               // FIXME triggers compilation failure
+                               // return ((Bundle) element).getVersion().toString();
+                       }
+               });
+               new ColumnViewerComparator<Bundle>(column, new Comparator<Bundle>() {
+                       public int compare(Bundle o1, Bundle o2) {
+                               return 0;
+                               // FIXME getVersion() triggers compilation failure
+                               // return o1.getVersion().compareTo(o2.getVersion());
+                       }
+               });
+
+               viewer.setInput(WorkbenchUiPlugin.getDefault().getBundle()
+                               .getBundleContext());
+
+       }
+
+       @Override
+       public void setFocus() {
+               if (viewer != null)
+                       viewer.getControl().setFocus();
+       }
+
+       /** Content provider managing the array of bundles */
+       private static class BundleContentProvider implements
+                       IStructuredContentProvider {
+               private static final long serialVersionUID = -8533792785725875977L;
+
+               public Object[] getElements(Object inputElement) {
+                       if (inputElement instanceof BundleContext) {
+                               BundleContext bc = (BundleContext) inputElement;
+                               return bc.getBundles();
+                       }
+                       return null;
+               }
+
+               public void dispose() {
+               }
+
+               public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+               }
+
+       }
+
+       /** Label provider for the state column */
+       private static class StateLabelProvider extends ColumnLabelProvider {
+               private static final long serialVersionUID = -7885583135316000733L;
+
+               @Override
+               public Image getImage(Object element) {
+                       Integer state = ((Bundle) element).getState();
+                       switch (state) {
+                       case Bundle.UNINSTALLED:
+                               return OsgiExplorerImages.INSTALLED;
+                       case Bundle.INSTALLED:
+                               return OsgiExplorerImages.INSTALLED;
+                       case Bundle.RESOLVED:
+                               return OsgiExplorerImages.RESOLVED;
+                       case Bundle.STARTING:
+                               return OsgiExplorerImages.STARTING;
+                       case Bundle.STOPPING:
+                               return OsgiExplorerImages.STARTING;
+                       case Bundle.ACTIVE:
+                               return OsgiExplorerImages.ACTIVE;
+                       default:
+                               return null;
+                       }
+               }
+
+               @Override
+               public String getText(Object element) {
+                       return null;
+               }
+
+               @Override
+               public String getToolTipText(Object element) {
+                       Bundle bundle = (Bundle) element;
+                       Integer state = bundle.getState();
+                       switch (state) {
+                       case Bundle.UNINSTALLED:
+                               return "UNINSTALLED";
+                       case Bundle.INSTALLED:
+                               return "INSTALLED";
+                       case Bundle.RESOLVED:
+                               return "RESOLVED";
+                       case Bundle.STARTING:
+                               String activationPolicy = bundle.getHeaders()
+                                               .get("Bundle-ActivationPolicy").toString();
+                               // FIXME constant triggers the compilation failure
+                               // .get(Constants.BUNDLE_ACTIVATIONPOLICY).toString();
+                               if (activationPolicy != null && activationPolicy.equals("lazy"))
+                                       // FIXME constant triggers the compilation failure
+                                       // && activationPolicy.equals(Constants.ACTIVATION_LAZY))
+                                       return "<<LAZY>>";
+                               return "STARTING";
+                       case Bundle.STOPPING:
+                               return "STOPPING";
+                       case Bundle.ACTIVE:
+                               return "ACTIVE";
+                       default:
+                               return null;
+                       }
+               }
+       }
+}
\ No newline at end of file
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/osgi/ModulesView.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/osgi/ModulesView.java
new file mode 100644 (file)
index 0000000..b0d6b64
--- /dev/null
@@ -0,0 +1,379 @@
+/*
+ * 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.eclipse.ui.workbench.osgi;
+
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+import java.util.TreeSet;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.argeo.eclipse.ui.TreeParent;
+import org.argeo.eclipse.ui.workbench.WorkbenchUiPlugin;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.part.ViewPart;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.packageadmin.ExportedPackage;
+import org.osgi.service.packageadmin.PackageAdmin;
+
+/** <b>Experimental</b> The OSGi runtime from a module perspective. */
+public class ModulesView extends ViewPart {
+       private final static Log log = LogFactory.getLog(ModulesView.class);
+
+       private TreeViewer viewer;
+
+       private PackageAdmin packageAdmin;
+
+       private Comparator<ExportedPackage> exportedPackageComparator = new Comparator<ExportedPackage>() {
+
+               public int compare(ExportedPackage o1, ExportedPackage o2) {
+                       if (!o1.getName().equals(o2.getName()))
+                               return o1.getName().compareTo(o2.getName());
+                       else
+                               return o1.getVersion().compareTo(o2.getVersion());
+               }
+       };
+
+       @Override
+       public void createPartControl(Composite parent) {
+               viewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
+               viewer.setContentProvider(new ModulesContentProvider());
+               viewer.setLabelProvider(new ModulesLabelProvider());
+               viewer.setInput(WorkbenchUiPlugin.getDefault().getBundle()
+                               .getBundleContext());
+       }
+
+       @Override
+       public void setFocus() {
+               viewer.getTree().setFocus();
+       }
+
+       private class ModulesContentProvider implements ITreeContentProvider {
+
+               public Object[] getElements(Object inputElement) {
+                       return getChildren(inputElement);
+               }
+
+               public Object[] getChildren(Object parentElement) {
+                       if (parentElement instanceof BundleContext) {
+                               BundleContext bundleContext = (BundleContext) parentElement;
+                               Bundle[] bundles = bundleContext.getBundles();
+
+                               TreeParent bundlesNode = new TreeParent("Bundles");
+                               for (Bundle bundle : bundles) {
+                                       if (bundle.getState() == Bundle.ACTIVE)
+                                               bundlesNode.addChild(new BundleNode(bundle));
+                               }
+
+                               // scan packages
+                               ServiceReference paSr = bundleContext
+                                               .getServiceReference(PackageAdmin.class.getName());
+                               // TODO: make a cleaner referencing
+                               packageAdmin = (PackageAdmin) bundleContext.getService(paSr);
+
+                               Bundle bundle1 = null;
+                               Bundle bundle2 = null;
+
+                               Map<Bundle, Set<ExportedPackage>> importedPackages = new HashMap<Bundle, Set<ExportedPackage>>();
+                               Map<String, Set<ExportedPackage>> packages = new TreeMap<String, Set<ExportedPackage>>();
+                               for (Bundle bundle : bundles) {
+                                       if (bundle.getSymbolicName()
+                                                       .equals("org.argeo.security.ui"))
+                                               bundle1 = bundle;
+                                       if (bundle.getSymbolicName().equals(
+                                                       "org.argeo.security.equinox"))
+                                               bundle2 = bundle;
+
+                                       ExportedPackage[] pkgs = packageAdmin
+                                                       .getExportedPackages(bundle);
+                                       if (pkgs != null)
+                                               for (ExportedPackage pkg : pkgs) {
+                                                       if (!packages.containsKey(pkg.getName()))
+                                                               packages.put(pkg.getName(),
+                                                                               new TreeSet<ExportedPackage>(
+                                                                                               exportedPackageComparator));
+                                                       Set<ExportedPackage> expPackages = (Set<ExportedPackage>) packages
+                                                                       .get(pkg.getName());
+                                                       expPackages.add(pkg);
+
+                                                       // imported
+                                                       for (Bundle b : pkg.getImportingBundles()) {
+                                                               if (bundle.getBundleId() != b.getBundleId()) {
+                                                                       if (!importedPackages.containsKey(b))
+                                                                               importedPackages
+                                                                                               .put(b,
+                                                                                                               new TreeSet<ExportedPackage>(
+                                                                                                                               exportedPackageComparator));
+                                                                       Set<ExportedPackage> impPackages = (Set<ExportedPackage>) importedPackages
+                                                                                       .get(b);
+                                                                       impPackages.add(pkg);
+                                                               }
+                                                       }
+                                               }
+                               }
+
+                               TreeParent mPackageNode = new TreeParent("Multiple Packages");
+                               // TreeParent aPackageNode = new TreeParent("All Packages");
+                               for (String packageName : packages.keySet()) {
+                                       Set<ExportedPackage> pkgs = packages.get(packageName);
+                                       if (pkgs.size() > 1) {
+                                               MultiplePackagesNode mpn = new MultiplePackagesNode(
+                                                               packageName, pkgs);
+                                               mPackageNode.addChild(mpn);
+                                               // aPackageNode.addChild(mpn);
+                                       } else {
+                                               // aPackageNode.addChild(new ExportedPackageNode(pkgs
+                                               // .iterator().next()));
+                                       }
+                               }
+
+                               return new Object[] { bundlesNode, mPackageNode };// ,
+                                                                                                                                       // aPackageNode
+                                                                                                                                       // };
+                       } else if (parentElement instanceof TreeParent) {
+                               return ((TreeParent) parentElement).getChildren();
+                       } else {
+                               return null;
+                       }
+               }
+
+               public Object getParent(Object element) {
+                       // TODO Auto-generated method stub
+                       return null;
+               }
+
+               public boolean hasChildren(Object element) {
+                       if (element instanceof TreeParent) {
+                               return ((TreeParent) element).hasChildren();
+                       }
+                       return false;
+               }
+
+               public void dispose() {
+                       // TODO Auto-generated method stub
+
+               }
+
+               public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+                       // TODO Auto-generated method stub
+
+               }
+
+       }
+
+       protected Map<String, ExportedPackage> dependencySpace(Bundle bundle,
+                       Map<Bundle, Set<ExportedPackage>> importedPackages,
+                       Map<String, Set<String>> traces) {
+               log.debug("Dependency space for " + bundle.getSymbolicName());
+               Map<String, ExportedPackage> space = new TreeMap<String, ExportedPackage>();
+               fillDependencySpace(space, bundle, importedPackages,
+                               bundle.getSymbolicName(), traces);
+               return space;
+       }
+
+       /** Recursive */
+       protected void fillDependencySpace(Map<String, ExportedPackage> space,
+                       Bundle bundle, Map<Bundle, Set<ExportedPackage>> importedPackages,
+                       String currTrace, Map<String, Set<String>> traces) {
+               if (importedPackages.containsKey(bundle)) {
+                       Set<ExportedPackage> imports = importedPackages.get(bundle);
+                       // log.debug("## Fill dependency space for " + bundle + " : ");
+                       for (ExportedPackage pkg : imports) {
+                               if (!traces.containsKey(pkg.getName()))
+                                       traces.put(pkg.getName(), new TreeSet<String>());
+                               traces.get(pkg.getName()).add(currTrace);
+                               if (!space.containsKey(pkg.getName())) {
+                                       space.put(pkg.getName(), pkg);
+                                       Bundle exportingBundle = pkg.getExportingBundle();
+                                       // if (bundle.getBundleId() !=
+                                       // exportingBundle.getBundleId())
+                                       fillDependencySpace(space, exportingBundle,
+                                                       importedPackages, currTrace + " > "
+                                                                       + exportingBundle.getSymbolicName(), traces);
+                               }
+                       }
+               }
+       }
+
+       private class ModulesLabelProvider extends LabelProvider implements
+                       ITableLabelProvider {
+
+               public Image getColumnImage(Object element, int columnIndex) {
+                       // TODO Auto-generated method stub
+                       return null;
+               }
+
+               public String getColumnText(Object element, int columnIndex) {
+                       return getText(element);
+               }
+
+       }
+
+       class BundleNode extends TreeParent {
+               private final Bundle bundle;
+
+               public BundleNode(Bundle bundle) {
+                       super(bundle.getSymbolicName());
+                       this.bundle = bundle;
+
+                       // Registered services
+                       ServiceReference[] registeredServices = bundle
+                                       .getRegisteredServices();
+                       if (registeredServices != null) {
+                               TreeParent registeredServicesNode = new TreeParent(
+                                               "Registered Services");
+                               addChild(registeredServicesNode);
+                               for (ServiceReference sr : registeredServices) {
+                                       if (sr != null)
+                                               registeredServicesNode
+                                                               .addChild(new ServiceReferenceNode(sr));
+                               }
+                       }
+
+                       // Used services
+                       ServiceReference[] usedServices = bundle.getRegisteredServices();
+                       if (usedServices != null) {
+                               TreeParent usedServicesNode = new TreeParent("Used Services");
+                               addChild(usedServicesNode);
+                               for (ServiceReference sr : usedServices) {
+                                       if (sr != null)
+                                               usedServicesNode.addChild(new ServiceReferenceNode(sr));
+                               }
+                       }
+               }
+
+               public Bundle getBundle() {
+                       return bundle;
+               }
+
+       }
+
+       class ServiceReferenceNode extends TreeParent {
+               private final ServiceReference serviceReference;
+
+               public ServiceReferenceNode(ServiceReference serviceReference) {
+                       super(serviceReference.toString());
+                       this.serviceReference = serviceReference;
+
+                       Bundle[] usedBundles = serviceReference.getUsingBundles();
+                       if (usedBundles != null) {
+                               TreeParent usingBundles = new TreeParent("Using Bundles");
+                               addChild(usingBundles);
+                               for (Bundle b : usedBundles) {
+                                       if (b != null)
+                                               usingBundles.addChild(new TreeParent(b
+                                                               .getSymbolicName()));
+                               }
+                       }
+
+                       TreeParent properties = new TreeParent("Properties");
+                       addChild(properties);
+                       for (String key : serviceReference.getPropertyKeys()) {
+                               properties.addChild(new TreeParent(key + "="
+                                               + serviceReference.getProperty(key)));
+                       }
+
+               }
+
+               public ServiceReference getServiceReference() {
+                       return serviceReference;
+               }
+
+       }
+
+       class MultiplePackagesNode extends TreeParent {
+               private String packageName;
+               private Set<ExportedPackage> exportedPackages;
+
+               public MultiplePackagesNode(String packageName,
+                               Set<ExportedPackage> exportedPackages) {
+                       super(packageName);
+                       this.packageName = packageName;
+                       this.exportedPackages = exportedPackages;
+                       for (ExportedPackage pkg : exportedPackages) {
+                               addChild(new ExportedPackageNode(pkg));
+                       }
+               }
+
+       }
+
+       class ConflictingPackageNode extends TreeParent {
+               private ExportedPackage exportedPackage;
+
+               public ConflictingPackageNode(ExportedPackage exportedPackage) {
+                       super(exportedPackage.getName() + " - "
+                                       + exportedPackage.getVersion() + " ("
+                                       + exportedPackage.getExportingBundle() + ")");
+                       this.exportedPackage = exportedPackage;
+
+                       TreeParent bundlesNode = new TreeParent("Dependent Bundles");
+                       this.addChild(bundlesNode);
+                       Map<String, Bundle> bundles = new TreeMap<String, Bundle>();
+                       for (Bundle b : exportedPackage.getImportingBundles()) {
+                               bundles.put(b.getSymbolicName(), b);
+                       }
+                       for (String key : bundles.keySet()) {
+                               addDependentBundles(bundlesNode, bundles.get(key));
+                       }
+               }
+       }
+
+       protected void addDependentBundles(TreeParent parent, Bundle bundle) {
+               TreeParent bundleNode = new TreeParent(bundle.toString());
+               parent.addChild(bundleNode);
+               Map<String, Bundle> bundles = new TreeMap<String, Bundle>();
+               ExportedPackage[] pkgs = packageAdmin.getExportedPackages(bundle);
+               if (pkgs != null)
+                       for (ExportedPackage pkg : pkgs) {
+                               for (Bundle b : pkg.getImportingBundles()) {
+                                       if (!bundles.containsKey(b.getSymbolicName())
+                                                       && b.getBundleId() != bundle.getBundleId()) {
+                                               bundles.put(b.getSymbolicName(), b);
+                                       }
+                               }
+                       }
+
+               for (String key : bundles.keySet()) {
+                       addDependentBundles(bundleNode, bundles.get(key));
+               }
+       }
+
+       class ExportedPackageNode extends TreeParent {
+               private ExportedPackage exportedPackage;
+
+               public ExportedPackageNode(ExportedPackage exportedPackage) {
+                       super(exportedPackage.getName() + " - "
+                                       + exportedPackage.getVersion() + " ("
+                                       + exportedPackage.getExportingBundle() + ")");
+                       this.exportedPackage = exportedPackage;
+                       for (Bundle bundle : exportedPackage.getImportingBundles()) {
+                               addChild(new BundleNode(bundle));
+                       }
+               }
+       }
+}
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/osgi/OsgiExplorerImages.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/osgi/OsgiExplorerImages.java
new file mode 100644 (file)
index 0000000..64a240c
--- /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.eclipse.ui.workbench.osgi;
+
+import org.argeo.eclipse.ui.workbench.WorkbenchUiPlugin;
+import org.eclipse.swt.graphics.Image;
+
+/** Shared icons. */
+public class OsgiExplorerImages {
+       public final static Image INSTALLED = WorkbenchUiPlugin
+                       .getImageDescriptor("icons/installed.gif").createImage();
+       public final static Image RESOLVED = WorkbenchUiPlugin.getImageDescriptor(
+                       "icons/resolved.gif").createImage();
+       public final static Image STARTING = WorkbenchUiPlugin.getImageDescriptor(
+                       "icons/starting.gif").createImage();
+       public final static Image ACTIVE = WorkbenchUiPlugin.getImageDescriptor(
+                       "icons/active.gif").createImage();
+}
diff --git a/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/osgi/OsgiExplorerPerspective.java b/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/osgi/OsgiExplorerPerspective.java
new file mode 100644 (file)
index 0000000..8f7f262
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * 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.eclipse.ui.workbench.osgi;
+
+import org.eclipse.ui.IPageLayout;
+import org.eclipse.ui.IPerspectiveFactory;
+
+/** OSGi explorer perspective (to be enriched declaratively) */
+public class OsgiExplorerPerspective implements IPerspectiveFactory {
+
+       public void createInitialLayout(IPageLayout layout) {
+               layout.setEditorAreaVisible(true);
+               layout.setFixed(false);
+
+       }
+
+}
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/META-INF/spring/commands.xml b/org.argeo.eclipse.ui.workbench/target/classes/META-INF/spring/commands.xml
new file mode 100644 (file)
index 0000000..493ba2e
--- /dev/null
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+        http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+       <bean id="addRemoteRepository" class="org.argeo.eclipse.ui.workbench.commands.AddRemoteRepository">
+               <property name="repositoryFactory" ref="repositoryFactory" />
+               <property name="nodeRepository" ref="nodeRepository" />
+               <property name="keyring" ref="keyring" />
+       </bean>
+
+       <bean id="removeRemoteRepository"
+               class="org.argeo.eclipse.ui.workbench.commands.RemoveRemoteRepository">
+       </bean>
+
+       <bean id="addFolderNode" class="org.argeo.eclipse.ui.workbench.commands.AddFolderNode"
+               scope="prototype" />
+
+       <bean id="addPrivileges" class="org.argeo.eclipse.ui.workbench.commands.AddPrivileges"
+               scope="prototype" />
+
+       <bean id="createWorkspace" class="org.argeo.eclipse.ui.workbench.commands.CreateWorkspace"
+               scope="prototype" />
+
+       <bean id="refresh" class="org.argeo.eclipse.ui.workbench.commands.Refresh"
+               scope="prototype" />
+
+       <bean id="deleteNodes" class="org.argeo.eclipse.ui.workbench.commands.DeleteNodes"
+               scope="prototype" />
+
+       <bean id="importFileSystem" class="org.argeo.eclipse.ui.workbench.commands.ImportFileSystem"
+               scope="prototype" />
+</beans>
\ No newline at end of file
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/META-INF/spring/jcr.xml b/org.argeo.eclipse.ui.workbench/target/classes/META-INF/spring/jcr.xml
new file mode 100644 (file)
index 0000000..e074154
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
+       xmlns:p="http://www.springframework.org/schema/p"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+        http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd">
+
+       <bean id="repositoryRegister" class="org.argeo.jcr.DefaultRepositoryRegister" />
+
+</beans>
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/META-INF/spring/osgi.xml b/org.argeo.eclipse.ui.workbench/target/classes/META-INF/spring/osgi.xml
new file mode 100644 (file)
index 0000000..255462b
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<beans:beans xmlns="http://www.springframework.org/schema/osgi"\r
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"\r
+       xmlns:osgi="http://www.springframework.org/schema/osgi"\r
+       xsi:schemaLocation="http://www.springframework.org/schema/osgi  \r
+       http://www.springframework.org/schema/osgi/spring-osgi-1.1.xsd\r
+       http://www.springframework.org/schema/beans   \r
+       http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"\r
+       osgi:default-timeout="30000">\r
+\r
+       <list id="repositories" interface="javax.jcr.Repository"\r
+               cardinality="0..N">\r
+               <listener ref="repositoryRegister" bind-method="register"\r
+                       unbind-method="unregister" />\r
+       </list>\r
+\r
+       <reference id="nodeRepository" interface="javax.jcr.Repository"\r
+               filter="(argeo.jcr.repository.alias=node)" />\r
+       <reference id="repositoryFactory" interface="javax.jcr.RepositoryFactory" />\r
+\r
+       <reference id="keyring" interface="org.argeo.security.crypto.CryptoKeyring" />\r
+\r
+</beans:beans>
\ No newline at end of file
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/META-INF/spring/parts.xml b/org.argeo.eclipse.ui.workbench/target/classes/META-INF/spring/parts.xml
new file mode 100644 (file)
index 0000000..78aec86
--- /dev/null
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
+       xmlns:p="http://www.springframework.org/schema/p"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+        http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd">
+
+       <!-- EDITORS -->
+       <bean id="genericJcrQueryEditor"
+               class="org.argeo.eclipse.ui.workbench.jcr.GenericJcrQueryEditor"
+               scope="prototype">
+               <property name="session" ref="nodeSession" />
+       </bean>
+       <bean id="defaultNodeEditor" class="org.argeo.eclipse.ui.workbench.jcr.DefaultNodeEditor"
+               scope="prototype">
+       </bean>
+
+       <!-- Views -->
+       <bean id="jcrBrowserView" class="org.argeo.eclipse.ui.workbench.jcr.JcrBrowserView"
+               scope="prototype">
+               <property name="repositoryRegister" ref="repositoryRegister" />
+               <property name="repositoryFactory" ref="repositoryFactory" />
+               <property name="nodeRepository" ref="nodeRepository" />
+               <property name="keyring" ref="keyring" />
+       </bean>
+</beans>
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/icons/active.gif b/org.argeo.eclipse.ui.workbench/target/classes/icons/active.gif
new file mode 100644 (file)
index 0000000..7d24707
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/icons/active.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/icons/add.gif b/org.argeo.eclipse.ui.workbench/target/classes/icons/add.gif
new file mode 100644 (file)
index 0000000..252d7eb
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/icons/add.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/icons/addFolder.gif b/org.argeo.eclipse.ui.workbench/target/classes/icons/addFolder.gif
new file mode 100644 (file)
index 0000000..d3f43d9
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/icons/addFolder.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/icons/addPrivileges.png b/org.argeo.eclipse.ui.workbench/target/classes/icons/addPrivileges.png
new file mode 100644 (file)
index 0000000..a6b251f
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/icons/addPrivileges.png differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/icons/addRepo.gif b/org.argeo.eclipse.ui.workbench/target/classes/icons/addRepo.gif
new file mode 100644 (file)
index 0000000..26d81c0
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/icons/addRepo.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/icons/addWorkspace.png b/org.argeo.eclipse.ui.workbench/target/classes/icons/addWorkspace.png
new file mode 100644 (file)
index 0000000..bbee775
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/icons/addWorkspace.png differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/icons/binary.png b/org.argeo.eclipse.ui.workbench/target/classes/icons/binary.png
new file mode 100644 (file)
index 0000000..fdf4f82
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/icons/binary.png differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/icons/browser.gif b/org.argeo.eclipse.ui.workbench/target/classes/icons/browser.gif
new file mode 100644 (file)
index 0000000..6c7320c
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/icons/browser.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/icons/bundles.gif b/org.argeo.eclipse.ui.workbench/target/classes/icons/bundles.gif
new file mode 100644 (file)
index 0000000..e9a6bd9
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/icons/bundles.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/icons/dumpNode.gif b/org.argeo.eclipse.ui.workbench/target/classes/icons/dumpNode.gif
new file mode 100644 (file)
index 0000000..14eb1be
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/icons/dumpNode.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/icons/file.gif b/org.argeo.eclipse.ui.workbench/target/classes/icons/file.gif
new file mode 100644 (file)
index 0000000..ef30288
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/icons/file.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/icons/folder.gif b/org.argeo.eclipse.ui.workbench/target/classes/icons/folder.gif
new file mode 100644 (file)
index 0000000..42e027c
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/icons/folder.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/icons/getSize.gif b/org.argeo.eclipse.ui.workbench/target/classes/icons/getSize.gif
new file mode 100644 (file)
index 0000000..b05bf3e
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/icons/getSize.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/icons/home.gif b/org.argeo.eclipse.ui.workbench/target/classes/icons/home.gif
new file mode 100644 (file)
index 0000000..fd0c669
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/icons/home.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/icons/import_fs.png b/org.argeo.eclipse.ui.workbench/target/classes/icons/import_fs.png
new file mode 100644 (file)
index 0000000..d7c890c
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/icons/import_fs.png differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/icons/installed.gif b/org.argeo.eclipse.ui.workbench/target/classes/icons/installed.gif
new file mode 100644 (file)
index 0000000..2988716
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/icons/installed.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/icons/node.gif b/org.argeo.eclipse.ui.workbench/target/classes/icons/node.gif
new file mode 100644 (file)
index 0000000..364c0e7
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/icons/node.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/icons/nodes.gif b/org.argeo.eclipse.ui.workbench/target/classes/icons/nodes.gif
new file mode 100644 (file)
index 0000000..bba3dbc
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/icons/nodes.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/icons/osgi_explorer.gif b/org.argeo.eclipse.ui.workbench/target/classes/icons/osgi_explorer.gif
new file mode 100644 (file)
index 0000000..e9a6bd9
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/icons/osgi_explorer.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/icons/query.png b/org.argeo.eclipse.ui.workbench/target/classes/icons/query.png
new file mode 100644 (file)
index 0000000..54c089d
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/icons/query.png differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/icons/refresh.png b/org.argeo.eclipse.ui.workbench/target/classes/icons/refresh.png
new file mode 100644 (file)
index 0000000..a3884fb
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/icons/refresh.png differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/icons/remote_connected.gif b/org.argeo.eclipse.ui.workbench/target/classes/icons/remote_connected.gif
new file mode 100644 (file)
index 0000000..1492b4e
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/icons/remote_connected.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/icons/remote_disconnected.gif b/org.argeo.eclipse.ui.workbench/target/classes/icons/remote_disconnected.gif
new file mode 100644 (file)
index 0000000..6c54da9
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/icons/remote_disconnected.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/icons/remove.gif b/org.argeo.eclipse.ui.workbench/target/classes/icons/remove.gif
new file mode 100644 (file)
index 0000000..0ae6dec
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/icons/remove.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/icons/repositories.gif b/org.argeo.eclipse.ui.workbench/target/classes/icons/repositories.gif
new file mode 100644 (file)
index 0000000..c13bea1
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/icons/repositories.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/icons/repository_connected.gif b/org.argeo.eclipse.ui.workbench/target/classes/icons/repository_connected.gif
new file mode 100644 (file)
index 0000000..a15fa55
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/icons/repository_connected.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/icons/repository_disconnected.gif b/org.argeo.eclipse.ui.workbench/target/classes/icons/repository_disconnected.gif
new file mode 100644 (file)
index 0000000..4576dc5
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/icons/repository_disconnected.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/icons/resolved.gif b/org.argeo.eclipse.ui.workbench/target/classes/icons/resolved.gif
new file mode 100644 (file)
index 0000000..f4a1ea1
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/icons/resolved.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/icons/sort.gif b/org.argeo.eclipse.ui.workbench/target/classes/icons/sort.gif
new file mode 100644 (file)
index 0000000..23c5d0b
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/icons/sort.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/icons/starting.gif b/org.argeo.eclipse.ui.workbench/target/classes/icons/starting.gif
new file mode 100644 (file)
index 0000000..563743d
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/icons/starting.gif differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/icons/workspace_connected.png b/org.argeo.eclipse.ui.workbench/target/classes/icons/workspace_connected.png
new file mode 100644 (file)
index 0000000..0430baa
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/icons/workspace_connected.png differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/icons/workspace_disconnected.png b/org.argeo.eclipse.ui.workbench/target/classes/icons/workspace_disconnected.png
new file mode 100644 (file)
index 0000000..fddcb8c
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/icons/workspace_disconnected.png differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/WorkbenchConstants.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/WorkbenchConstants.class
new file mode 100644 (file)
index 0000000..41e9b5c
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/WorkbenchConstants.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/WorkbenchUiPlugin.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/WorkbenchUiPlugin.class
new file mode 100644 (file)
index 0000000..b7fdadc
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/WorkbenchUiPlugin.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/AddFolderNode.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/AddFolderNode.class
new file mode 100644 (file)
index 0000000..2c29e73
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/AddFolderNode.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/AddPrivileges.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/AddPrivileges.class
new file mode 100644 (file)
index 0000000..c22c977
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/AddPrivileges.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/AddRemoteRepository$1.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/AddRemoteRepository$1.class
new file mode 100644 (file)
index 0000000..4c9d005
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/AddRemoteRepository$1.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/AddRemoteRepository$RemoteRepositoryLoginDialog.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/AddRemoteRepository$RemoteRepositoryLoginDialog.class
new file mode 100644 (file)
index 0000000..1230677
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/AddRemoteRepository$RemoteRepositoryLoginDialog.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/AddRemoteRepository.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/AddRemoteRepository.class
new file mode 100644 (file)
index 0000000..f2c8591
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/AddRemoteRepository.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/CreateWorkspace.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/CreateWorkspace.class
new file mode 100644 (file)
index 0000000..6090e12
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/CreateWorkspace.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/DeleteNodes.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/DeleteNodes.class
new file mode 100644 (file)
index 0000000..ce4d88b
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/DeleteNodes.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/DumpNode.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/DumpNode.class
new file mode 100644 (file)
index 0000000..c7b8347
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/DumpNode.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/EditNode.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/EditNode.class
new file mode 100644 (file)
index 0000000..e9264ec
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/EditNode.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/GetNodeSize.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/GetNodeSize.class
new file mode 100644 (file)
index 0000000..2e08e35
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/GetNodeSize.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/ImportFileSystem.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/ImportFileSystem.class
new file mode 100644 (file)
index 0000000..6ee0375
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/ImportFileSystem.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/OpenEditor.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/OpenEditor.class
new file mode 100644 (file)
index 0000000..939b66d
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/OpenEditor.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/Refresh.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/Refresh.class
new file mode 100644 (file)
index 0000000..eb68588
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/Refresh.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/RemoveRemoteRepository.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/RemoveRemoteRepository.class
new file mode 100644 (file)
index 0000000..d7254bd
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/RemoveRemoteRepository.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/SortChildNodes.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/SortChildNodes.class
new file mode 100644 (file)
index 0000000..d7d558c
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/commands/SortChildNodes.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/DefaultNodeEditor.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/DefaultNodeEditor.class
new file mode 100644 (file)
index 0000000..29f7054
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/DefaultNodeEditor.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/GenericJcrQueryEditor$1.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/GenericJcrQueryEditor$1.class
new file mode 100644 (file)
index 0000000..e973708
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/GenericJcrQueryEditor$1.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/GenericJcrQueryEditor.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/GenericJcrQueryEditor.class
new file mode 100644 (file)
index 0000000..0989acd
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/GenericJcrQueryEditor.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserPerspective.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserPerspective.class
new file mode 100644 (file)
index 0000000..1cee554
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserPerspective.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$1.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$1.class
new file mode 100644 (file)
index 0000000..6b72edc
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$1.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$2.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$2.class
new file mode 100644 (file)
index 0000000..cab531b
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$2.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$3.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$3.class
new file mode 100644 (file)
index 0000000..7b18b88
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$3.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$4.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$4.class
new file mode 100644 (file)
index 0000000..8422bb4
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$4.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$TreeObserver.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$TreeObserver.class
new file mode 100644 (file)
index 0000000..e88d490
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$TreeObserver.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView.class
new file mode 100644 (file)
index 0000000..24c873d
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/JcrImages.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/JcrImages.class
new file mode 100644 (file)
index 0000000..4752b2f
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/JcrImages.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/ChangeRightsWizard.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/ChangeRightsWizard.class
new file mode 100644 (file)
index 0000000..8bdeb10
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/ChangeRightsWizard.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/ChildNodesPage.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/ChildNodesPage.class
new file mode 100644 (file)
index 0000000..bc5684a
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/ChildNodesPage.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/ChooseNameDialog.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/ChooseNameDialog.class
new file mode 100644 (file)
index 0000000..249f476
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/ChooseNameDialog.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/ChooseRightsPage.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/ChooseRightsPage.class
new file mode 100644 (file)
index 0000000..6a270de
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/ChooseRightsPage.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/DefaultNodeLabelProvider.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/DefaultNodeLabelProvider.class
new file mode 100644 (file)
index 0000000..5b8924d
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/DefaultNodeLabelProvider.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/EmptyNodePage.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/EmptyNodePage.class
new file mode 100644 (file)
index 0000000..e1ca7be
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/EmptyNodePage.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/FullVersioningTreeContentProvider.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/FullVersioningTreeContentProvider.class
new file mode 100644 (file)
index 0000000..c90e2ff
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/FullVersioningTreeContentProvider.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/GenericNodeDoubleClickListener.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/GenericNodeDoubleClickListener.class
new file mode 100644 (file)
index 0000000..2eac39e
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/GenericNodeDoubleClickListener.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/GenericNodeEditorInput.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/GenericNodeEditorInput.class
new file mode 100644 (file)
index 0000000..8d54d86
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/GenericNodeEditorInput.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/GenericNodePage$1.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/GenericNodePage$1.class
new file mode 100644 (file)
index 0000000..9d602e8
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/GenericNodePage$1.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/GenericNodePage$ModifiedFieldListener.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/GenericNodePage$ModifiedFieldListener.class
new file mode 100644 (file)
index 0000000..b31bf3c
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/GenericNodePage$ModifiedFieldListener.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/GenericNodePage.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/GenericNodePage.class
new file mode 100644 (file)
index 0000000..91c8092
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/GenericNodePage.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/GenericPropertyPage$TreeContentProvider.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/GenericPropertyPage$TreeContentProvider.class
new file mode 100644 (file)
index 0000000..c251846
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/GenericPropertyPage$TreeContentProvider.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/GenericPropertyPage.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/GenericPropertyPage.class
new file mode 100644 (file)
index 0000000..d3ab772
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/GenericPropertyPage.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/ImportFileSystemWizard$1.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/ImportFileSystemWizard$1.class
new file mode 100644 (file)
index 0000000..65a358c
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/ImportFileSystemWizard$1.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/ImportFileSystemWizard$Stats.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/ImportFileSystemWizard$Stats.class
new file mode 100644 (file)
index 0000000..e8be5f3
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/ImportFileSystemWizard$Stats.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/ImportFileSystemWizard.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/ImportFileSystemWizard.class
new file mode 100644 (file)
index 0000000..fe37cf7
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/ImportFileSystemWizard.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/JcrUiUtils.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/JcrUiUtils.class
new file mode 100644 (file)
index 0000000..61ed03a
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/JcrUiUtils.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeContentProvider$TreeBrowserComparator.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeContentProvider$TreeBrowserComparator.class
new file mode 100644 (file)
index 0000000..85bf3cb
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeContentProvider$TreeBrowserComparator.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeContentProvider.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeContentProvider.class
new file mode 100644 (file)
index 0000000..d10ee27
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeContentProvider.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeLabelProvider.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeLabelProvider.class
new file mode 100644 (file)
index 0000000..d29a3a3
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeLabelProvider.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeRightsManagementPage$1.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeRightsManagementPage$1.class
new file mode 100644 (file)
index 0000000..afaee09
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeRightsManagementPage$1.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeRightsManagementPage$2.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeRightsManagementPage$2.class
new file mode 100644 (file)
index 0000000..c081d27
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeRightsManagementPage$2.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeRightsManagementPage$RightsContentProvider.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeRightsManagementPage$RightsContentProvider.class
new file mode 100644 (file)
index 0000000..f72131e
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeRightsManagementPage$RightsContentProvider.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeRightsManagementPage.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeRightsManagementPage.class
new file mode 100644 (file)
index 0000000..41c9cfe
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeRightsManagementPage.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeVersionHistoryPage$1.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeVersionHistoryPage$1.class
new file mode 100644 (file)
index 0000000..d66d1a2
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeVersionHistoryPage$1.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeVersionHistoryPage.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeVersionHistoryPage.class
new file mode 100644 (file)
index 0000000..9c15c59
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeVersionHistoryPage.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/PropertiesContentProvider.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/PropertiesContentProvider.class
new file mode 100644 (file)
index 0000000..2bcc75d
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/PropertiesContentProvider.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/PropertyLabelProvider.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/PropertyLabelProvider.class
new file mode 100644 (file)
index 0000000..9ba7eca
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/PropertyLabelProvider.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/SingleNodeAsTreeContentProvider.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/SingleNodeAsTreeContentProvider.class
new file mode 100644 (file)
index 0000000..4c0c2c1
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/SingleNodeAsTreeContentProvider.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/StringNodeEditorInput.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/StringNodeEditorInput.class
new file mode 100644 (file)
index 0000000..bf72264
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/StringNodeEditorInput.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/TreeObjectsComparator.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/TreeObjectsComparator.class
new file mode 100644 (file)
index 0000000..570a0f3
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/TreeObjectsComparator.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/VersionLabelProvider.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/VersionLabelProvider.class
new file mode 100644 (file)
index 0000000..04d8474
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/internal/VersionLabelProvider.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/model/MaintainedRepositoryElem.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/model/MaintainedRepositoryElem.class
new file mode 100644 (file)
index 0000000..cd0cda6
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/model/MaintainedRepositoryElem.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/model/RemoteRepositoryElem.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/model/RemoteRepositoryElem.class
new file mode 100644 (file)
index 0000000..424efb3
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/model/RemoteRepositoryElem.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/model/RepositoriesElem.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/model/RepositoriesElem.class
new file mode 100644 (file)
index 0000000..619464e
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/model/RepositoriesElem.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/model/RepositoryElem.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/model/RepositoryElem.class
new file mode 100644 (file)
index 0000000..74a7ede
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/model/RepositoryElem.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/model/SingleJcrNodeElem.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/model/SingleJcrNodeElem.class
new file mode 100644 (file)
index 0000000..c88b1e9
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/model/SingleJcrNodeElem.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/model/WorkspaceElem.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/model/WorkspaceElem.class
new file mode 100644 (file)
index 0000000..295db24
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/jcr/browser/model/WorkspaceElem.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/messages.properties b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/messages.properties
new file mode 100644 (file)
index 0000000..3023c52
--- /dev/null
@@ -0,0 +1,28 @@
+## English labels for Agreo JCR UI application 
+
+## Generic labels 
+
+## Errors & warnings 
+errorUnvalidNtFolderNodeType= Error: folder can only be created on a Jcr Node
+warningInvalidNodeToImport=Can only import to a node
+warningInvalidMultipleSelection=This functionality is implemented only on a single node for the time being.
+warningUnversionableNode= Current node is not versionable.
+warningNoChildNode= Current node has no child.
+
+## Commands 
+getNodeSizeCmdLbl= Get approx. size
+addFolderNodeCmdLbl= Add Folder
+
+## GenericNodeEditor 
+nodeEditorLbl=Generic node editor
+genericNodePageTitle=Properties
+childNodesPageTitle=Children
+nodeRightsManagementPageTitle=Rights
+nodeVersionHistoryPageTitle=History
+
+# History 
+versionTreeSectionTitle=Version list
+versionHistorySectionTitle=History
+## Dummy ones 
+testLbl=Internationalizations of messages seems to work properly.
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/BundlesView$1.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/BundlesView$1.class
new file mode 100644 (file)
index 0000000..5b50f45
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/BundlesView$1.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/BundlesView$2.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/BundlesView$2.class
new file mode 100644 (file)
index 0000000..f25e0e6
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/BundlesView$2.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/BundlesView$3.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/BundlesView$3.class
new file mode 100644 (file)
index 0000000..720c679
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/BundlesView$3.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/BundlesView$4.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/BundlesView$4.class
new file mode 100644 (file)
index 0000000..66bf2e2
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/BundlesView$4.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/BundlesView$5.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/BundlesView$5.class
new file mode 100644 (file)
index 0000000..56e1d77
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/BundlesView$5.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/BundlesView$6.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/BundlesView$6.class
new file mode 100644 (file)
index 0000000..5cc2497
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/BundlesView$6.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/BundlesView$7.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/BundlesView$7.class
new file mode 100644 (file)
index 0000000..edbf3b3
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/BundlesView$7.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/BundlesView$BundleContentProvider.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/BundlesView$BundleContentProvider.class
new file mode 100644 (file)
index 0000000..1aa4a9d
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/BundlesView$BundleContentProvider.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/BundlesView$StateLabelProvider.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/BundlesView$StateLabelProvider.class
new file mode 100644 (file)
index 0000000..4173797
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/BundlesView$StateLabelProvider.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/BundlesView.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/BundlesView.class
new file mode 100644 (file)
index 0000000..b26d5b5
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/BundlesView.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/ModulesView$1.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/ModulesView$1.class
new file mode 100644 (file)
index 0000000..c5f215c
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/ModulesView$1.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/ModulesView$BundleNode.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/ModulesView$BundleNode.class
new file mode 100644 (file)
index 0000000..206348a
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/ModulesView$BundleNode.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/ModulesView$ConflictingPackageNode.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/ModulesView$ConflictingPackageNode.class
new file mode 100644 (file)
index 0000000..1334b04
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/ModulesView$ConflictingPackageNode.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/ModulesView$ExportedPackageNode.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/ModulesView$ExportedPackageNode.class
new file mode 100644 (file)
index 0000000..387ac08
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/ModulesView$ExportedPackageNode.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/ModulesView$ModulesContentProvider.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/ModulesView$ModulesContentProvider.class
new file mode 100644 (file)
index 0000000..8381e05
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/ModulesView$ModulesContentProvider.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/ModulesView$ModulesLabelProvider.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/ModulesView$ModulesLabelProvider.class
new file mode 100644 (file)
index 0000000..e95ebc6
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/ModulesView$ModulesLabelProvider.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/ModulesView$MultiplePackagesNode.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/ModulesView$MultiplePackagesNode.class
new file mode 100644 (file)
index 0000000..035e04f
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/ModulesView$MultiplePackagesNode.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/ModulesView$ServiceReferenceNode.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/ModulesView$ServiceReferenceNode.class
new file mode 100644 (file)
index 0000000..a8fc751
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/ModulesView$ServiceReferenceNode.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/ModulesView.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/ModulesView.class
new file mode 100644 (file)
index 0000000..d2be11d
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/ModulesView.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/OsgiExplorerImages.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/OsgiExplorerImages.class
new file mode 100644 (file)
index 0000000..f5c94c7
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/OsgiExplorerImages.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/OsgiExplorerPerspective.class b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/OsgiExplorerPerspective.class
new file mode 100644 (file)
index 0000000..2f9d4fe
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/classes/org/argeo/eclipse/ui/workbench/osgi/OsgiExplorerPerspective.class differ
diff --git a/org.argeo.eclipse.ui.workbench/target/classes/plugin.xml b/org.argeo.eclipse.ui.workbench/target/classes/plugin.xml
new file mode 100644 (file)
index 0000000..cea7722
--- /dev/null
@@ -0,0 +1,389 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+   <!-- PERSPECTIVES --> 
+   <extension
+         point="org.eclipse.ui.perspectives">
+      <perspective
+            name="Monitoring"
+            class="org.argeo.eclipse.ui.workbench.osgi.OsgiExplorerPerspective"
+            id="org.argeo.eclipse.ui.workbench.osgiPerspective"
+            icon="icons/osgi_explorer.gif">
+      </perspective>
+      <perspective
+            name="Data Explorer"
+            class="org.argeo.eclipse.ui.workbench.jcr.JcrBrowserPerspective"
+            id="org.argeo.eclipse.ui.workbench.jcrBrowserPerspective"
+            icon="icons/nodes.gif">
+      </perspective>
+       </extension>
+    
+    <!-- Definition of the OSGI perspective -->
+    <extension point="org.eclipse.ui.perspectiveExtensions"> 
+        <perspectiveExtension targetID="org.argeo.eclipse.ui.workbench.osgiPerspective"> 
+            <view 
+               id="org.argeo.eclipse.ui.workbench.bundlesView" 
+               minimized="false"
+               ratio="0.5" 
+               relationship="left" 
+               relative="org.eclipse.ui.editors"/> 
+            <view 
+               id="org.argeo.eclipse.ui.workbench.modulesView" 
+               minimized="false"
+               relationship="stack" 
+               relative="org.argeo.eclipse.ui.workbench.bundlesView"/> 
+        </perspectiveExtension> 
+    </extension> 
+   
+       <!-- VIEWS --> 
+       <extension
+        point="org.eclipse.ui.views">
+               <view
+               name="Modules"
+            id="org.argeo.eclipse.ui.workbench.modulesView"
+            icon="icons/bundles.gif"
+                       class="org.argeo.eclipse.ui.workbench.osgi.ModulesView">
+               </view>
+               <view
+               name="Bundles"
+            id="org.argeo.eclipse.ui.workbench.bundlesView" 
+            icon="icons/bundles.gif"
+            class="org.argeo.eclipse.ui.workbench.osgi.BundlesView">
+               </view>
+               <view
+          name="JCR Browser"
+          id="org.argeo.eclipse.ui.workbench.browserView"
+          icon="icons/browser.gif"
+          class="org.argeo.eclipse.spring.SpringExtensionFactory">
+          </view>
+   </extension>
+   
+   <!-- EDITORS --> 
+   <extension
+               point="org.eclipse.ui.editors">
+               <editor
+                       name="JCR Query"
+                       id="org.argeo.eclipse.ui.workbench.genericJcrQueryEditor"
+                       icon="icons/query.png"
+                       class="org.argeo.eclipse.spring.SpringExtensionFactory"
+                       default="false">
+        </editor>
+               <editor
+                       name="Node Editor"
+            id="org.argeo.eclipse.ui.workbench.defaultNodeEditor"
+                       icon="icons/query.png"
+                       class="org.argeo.eclipse.spring.SpringExtensionFactory"
+                       default="false">
+               </editor>
+       </extension>
+       
+       <!-- COMMANDS --> 
+       <extension
+         point="org.eclipse.ui.commands">
+               <command
+            defaultHandler="org.argeo.eclipse.ui.workbench.commands.OpenEditor"
+            id="org.argeo.eclipse.ui.workbench.openEditor"
+            name="Open an editor given its ID">
+            <commandParameter
+                               id="param.jcrNodePath"
+                               name="Node path">
+                       </commandParameter>
+            <!-- The path to the corresponding node if needed. -->
+            <commandParameter
+                               id="param.jcrNodePath"
+                               name="Node path">
+                       </commandParameter>
+       </command>
+       <command
+                       defaultHandler="org.argeo.eclipse.ui.workbench.commands.GetNodeSize"
+                       id="org.argeo.eclipse.ui.workbench.getNodeSize"
+                       name="Get node size">
+               </command>    
+       <command
+                       defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
+                       id="org.argeo.eclipse.ui.workbench.addRemoteRepository"
+                       name="Add remote JCR repository">
+                       <commandParameter
+                               id="org.argeo.jcr.ui.explorer.repositoryUri"
+                               name="Repository URI">
+                       </commandParameter>
+               </command>    
+       <command
+                       defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
+                       id="org.argeo.eclipse.ui.workbench.removeRemoteRepository"
+                       name="Remove remote JCR repository">
+               </command>    
+         <command
+               defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
+               id="org.argeo.eclipse.ui.workbench.addFolderNode"
+               name="Create a new folder">
+         </command>
+         <command
+               defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
+               id="org.argeo.eclipse.ui.workbench.addPrivileges"
+               name="Add Privileges">
+         </command>
+         <command
+               defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
+               id="org.argeo.eclipse.ui.workbench.createWorkspace"
+               name="Create a new workspace">
+         </command>
+         <command
+               defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
+               id="org.argeo.eclipse.ui.workbench.refresh"
+               name="Refresh">
+         </command>
+         <command
+               defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
+               id="org.argeo.eclipse.ui.workbench.deleteNodes"
+               name="Delete nodes">
+         </command>
+         <command
+               defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
+               id="org.argeo.eclipse.ui.workbench.importFileSystem"
+               name="Import files...">
+         </command>
+        <!-- <command
+               defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
+               id="org.argeo.eclipse.ui.workbench.openFile"
+               name="Open current file">
+         </command>
+         -->
+         <command
+               defaultHandler="org.argeo.eclipse.ui.workbench.commands.DumpNode"
+               id="org.argeo.eclipse.ui.workbench.dumpNode"
+               name="Dump Current Selected Node">
+         </command>
+         <command
+            defaultHandler="org.argeo.eclipse.ui.workbench.commands.SortChildNodes"
+            id="org.argeo.eclipse.ui.workbench.sortChildNodes"
+            name="Sort node tree">
+            <!-- FIXME: default value does not work -->
+            <state 
+                               id="org.argeo.eclipse.ui.workbench.sortChildNodes.toggleState" 
+                               class="org.eclipse.ui.handlers.RegistryToggleState:true" >
+                               <!-- <class class="org.eclipse.jface.commands.ToggleState"> 
+                                       <parameter
+                                               name="default"
+                                       value="true" />
+                               </class> -->
+                       </state>
+     </command>
+    </extension>
+
+    <!-- Menus --> 
+       <extension point="org.eclipse.ui.menus">
+               <!-- Browser view specific menu --> 
+               <menuContribution
+                       locationURI="menu:org.argeo.jcr.ui.explorer.browserView">
+            <!-- See bug 149 --> 
+            <!-- <command
+               commandId="org.argeo.eclipse.ui.workbench.openGenericJcrQueryEditor"
+                icon="icons/query.png"
+                style="push">
+            </command> --> 
+            <command
+               commandId="org.argeo.eclipse.ui.workbench.addRemoteRepository"
+                icon="icons/addRepo.gif"
+                style="push">
+            </command>
+             <command
+               commandId="org.argeo.eclipse.ui.workbench.sortChildNodes"
+                icon="icons/sort.gif"
+                style="toggle"
+                label="Sort child nodes"
+                tooltip="Warning: stopping to sort children nodes might enhance overall performances">
+            </command>
+               </menuContribution>
+               <!-- Browser view popup context menu --> 
+               <menuContribution
+                       locationURI="popup:org.argeo.jcr.ui.explorer.browserView">
+                       <command
+                               commandId="org.argeo.eclipse.ui.workbench.refresh"
+                               icon="icons/refresh.png"
+                               style="push">
+                       </command>
+                       <command
+                        commandId="org.argeo.eclipse.ui.workbench.addFolderNode"
+                        icon="icons/addFolder.gif"
+                        label="Add Folder"
+                        style="push">
+                               <visibleWhen>
+                                       <iterate>
+                                     <and>
+                                        <or>
+                                           <instanceof
+                                                 value="org.argeo.eclipse.ui.workbench.jcr.internal.model.SingleJcrNodeElem">
+                                           </instanceof>
+                                           <instanceof
+                                                 value="org.argeo.eclipse.ui.workbench.jcr.internal.model.WorkspaceElem">
+                                           </instanceof>
+                                        </or>
+                               <with variable="activeMenuSelection"><count value="1"/></with>
+                                     </and>
+                                       </iterate>
+                               </visibleWhen>
+                       </command>
+                       <command
+                        commandId="org.argeo.eclipse.ui.workbench.addPrivileges"
+                        icon="icons/addPrivileges.png"
+                        label="Add Privileges"
+                        style="push">
+                               <visibleWhen>
+                                       <iterate>
+                                     <and>
+                                        <or>
+                                           <instanceof
+                                                 value="org.argeo.eclipse.ui.workbench.jcr.internal.model.SingleJcrNodeElem">
+                                           </instanceof>
+                                           <instanceof
+                                                 value="org.argeo.eclipse.ui.workbench.jcr.internal.model.WorkspaceElem">
+                                           </instanceof>
+                                        </or>
+                               <with variable="activeMenuSelection"><count value="1"/></with>
+                                     </and>
+                                       </iterate>
+                               </visibleWhen>
+                       </command>
+                       <command
+                        commandId="org.argeo.eclipse.ui.workbench.createWorkspace"
+                        icon="icons/addWorkspace.png"
+                        label="Create Workspace"
+                        style="push">
+                               <visibleWhen>
+                                       <iterate>
+                                       <and>
+                                               <or>
+                                               <instanceof
+                                                       value="org.argeo.eclipse.ui.workbench.jcr.internal.model.RepositoryElem">
+                                               </instanceof>
+                                               </or>
+                                       <with variable="activeMenuSelection"><count value="1"/></with>
+                                               </and>
+                                       </iterate>
+                               </visibleWhen>
+                       </command>
+                       <command
+                               commandId="org.argeo.eclipse.ui.workbench.deleteNodes"
+                               icon="icons/remove.gif"
+                               label="Delete Nodes"
+                               style="push">
+                               <visibleWhen>
+                                       <iterate>
+                                               <or>
+                                                       <instanceof
+                                                               value="org.argeo.eclipse.ui.workbench.jcr.internal.model.SingleJcrNodeElem" />
+                                                       <instanceof
+                                                               value="org.argeo.eclipse.ui.workbench.jcr.internal.model.WorkspaceElem" />
+                                               </or>
+                                       </iterate>
+                               </visibleWhen>
+                       </command>
+                       <command
+                               commandId="org.argeo.eclipse.ui.workbench.importFileSystem"
+                               icon="icons/import_fs.png"
+                               style="push"
+                               tooltip="Import files from the files sytem">
+                               <visibleWhen>
+                                       <iterate>
+                                               <and>
+                                                       <or>
+                                                               <instanceof
+                                                                       value="org.argeo.eclipse.ui.workbench.jcr.internal.model.SingleJcrNodeElem" />
+                                                               <instanceof
+                                               value="org.argeo.eclipse.ui.workbench.jcr.internal.model.WorkspaceElem" />
+                                       </or>
+                                       <with variable="activeMenuSelection"><count value="1"/></with>
+                                               </and>
+                                       </iterate>
+                               </visibleWhen>
+                       </command>
+                       <command
+                               commandId="org.argeo.eclipse.ui.workbench.addRemoteRepository"
+                               icon="icons/addRepo.gif"
+                               style="push">
+                                       <visibleWhen>
+                                               <iterate> 
+                                                       <or>
+                                                               <instanceof
+                                               value="org.argeo.eclipse.ui.workbench.jcr.internal.model.RepositoriesElem" />
+                                                               <instanceof
+                                                                       value="org.argeo.eclipse.ui.workbench.jcr.internal.model.RepositoryElem" />
+                                                       </or> 
+                                               </iterate>
+                                       </visibleWhen>
+                       </command>
+                       <command
+                               commandId="org.argeo.eclipse.ui.workbench.removeRemoteRepository"
+                               icon="icons/remove.gif"
+                               style="push">
+                               <visibleWhen>
+                                       <iterate> 
+                                               <or>
+                                                       <instanceof
+                                                               value="org.argeo.eclipse.ui.workbench.jcr.internal.model.RemoteRepositoryElem" />
+                                               </or> 
+                               </iterate>
+                               </visibleWhen>
+                       </command>
+                       <command
+                               commandId="org.argeo.eclipse.ui.workbench.getNodeSize"
+                               icon="icons/getSize.gif"
+                               style="push">
+                                       <visibleWhen>
+                                               <iterate>
+                                                       <or>
+                                                               <instanceof
+                                                                       value="org.argeo.eclipse.ui.workbench.jcr.internal.model.SingleJcrNodeElem" />
+                                                               <instanceof
+                                                                       value="org.argeo.eclipse.ui.workbench.jcr.internal.model.WorkspaceElem" />
+                                       </or>
+                                       </iterate>
+                                       </visibleWhen>
+                       </command>
+                       <command
+                        commandId="org.argeo.eclipse.ui.workbench.dumpNode"
+                        icon="icons/dumpNode.gif"
+                        label="Dump Node"
+                        style="push">
+                               <visibleWhen>
+                                       <iterate>
+                                     <and>
+                                               <instanceof value="org.argeo.eclipse.ui.workbench.jcr.internal.model.SingleJcrNodeElem"></instanceof>
+                               <with variable="activeMenuSelection"><count value="1"/></with>
+                                     </and>
+                                       </iterate>
+                               </visibleWhen>
+                       </command>
+                       
+               </menuContribution>
+       </extension>
+
+       <!-- Reduce visibility of JCR Browser perspective to users that are in ROLE_ADMIN -->   
+       <extension
+       point="org.eclipse.ui.activities">
+               <activity
+                       description="Only for admins"
+                       id="org.argeo.eclipse.ui.workbench.adminActivity"
+            name="Jcr Technical Admin">
+                       <enabledWhen>
+                               <with variable="roles">
+                                       <iterate ifEmpty="false" operator="or">
+                                               <equals value="ROLE_ADMIN" />
+                                       </iterate>
+                               </with>
+                       </enabledWhen>
+               </activity>
+        <activityPatternBinding
+                       pattern="org.argeo.eclipse.ui.workbench/org.argeo.eclipse.ui.workbench.osgiPerspective"
+                       isEqualityPattern="true"
+                       activityId="org.argeo.eclipse.ui.workbench.adminActivity">
+                       <!-- activityId="org.argeo.security.ui.adminActivity" -->
+        </activityPatternBinding>
+        <activityPatternBinding
+                       pattern="org.argeo.eclipse.ui.workbench/org.argeo.eclipse.ui.workbench.jcrBrowserPerspective"
+                       isEqualityPattern="true"
+                       activityId="org.argeo.eclipse.ui.workbench.adminActivity">
+               </activityPatternBinding>
+       </extension>
+</plugin>
\ No newline at end of file
diff --git a/org.argeo.eclipse.ui.workbench/target/maven-archiver/pom.properties b/org.argeo.eclipse.ui.workbench/target/maven-archiver/pom.properties
new file mode 100644 (file)
index 0000000..14d7291
--- /dev/null
@@ -0,0 +1,5 @@
+#Generated by Maven
+#Wed Dec 10 17:30:04 CET 2014
+version=2.1.12-SNAPSHOT
+groupId=org.argeo.commons
+artifactId=org.argeo.eclipse.ui.workbench
diff --git a/org.argeo.eclipse.ui.workbench/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/org.argeo.eclipse.ui.workbench/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
new file mode 100644 (file)
index 0000000..00bb437
--- /dev/null
@@ -0,0 +1,88 @@
+org/argeo/eclipse/ui/workbench/commands/AddRemoteRepository$RemoteRepositoryLoginDialog.class
+org/argeo/eclipse/ui/workbench/WorkbenchConstants.class
+org/argeo/eclipse/ui/workbench/jcr/browser/internal/StringNodeEditorInput.class
+org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeVersionHistoryPage$1.class
+org/argeo/eclipse/ui/workbench/commands/OpenEditor.class
+org/argeo/eclipse/ui/workbench/commands/AddRemoteRepository$1.class
+org/argeo/eclipse/ui/workbench/osgi/OsgiExplorerImages.class
+org/argeo/eclipse/ui/workbench/osgi/BundlesView$1.class
+org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeLabelProvider.class
+org/argeo/eclipse/ui/workbench/jcr/browser/internal/ImportFileSystemWizard$Stats.class
+org/argeo/eclipse/ui/workbench/osgi/ModulesView$MultiplePackagesNode.class
+org/argeo/eclipse/ui/workbench/WorkbenchUiPlugin.class
+org/argeo/eclipse/ui/workbench/jcr/GenericJcrQueryEditor$1.class
+org/argeo/eclipse/ui/workbench/osgi/BundlesView$BundleContentProvider.class
+org/argeo/eclipse/ui/workbench/jcr/browser/internal/PropertiesContentProvider.class
+org/argeo/eclipse/ui/workbench/jcr/DefaultNodeEditor.class
+org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeRightsManagementPage$1.class
+org/argeo/eclipse/ui/workbench/jcr/browser/internal/ImportFileSystemWizard.class
+org/argeo/eclipse/ui/workbench/commands/Refresh.class
+org/argeo/eclipse/ui/workbench/jcr/JcrImages.class
+org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$3.class
+org/argeo/eclipse/ui/workbench/osgi/ModulesView$ConflictingPackageNode.class
+org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeRightsManagementPage$RightsContentProvider.class
+org/argeo/eclipse/ui/workbench/jcr/browser/internal/DefaultNodeLabelProvider.class
+org/argeo/eclipse/ui/workbench/commands/GetNodeSize.class
+org/argeo/eclipse/ui/workbench/osgi/ModulesView$ModulesContentProvider.class
+org/argeo/eclipse/ui/workbench/jcr/browser/model/RepositoryElem.class
+org/argeo/eclipse/ui/workbench/commands/AddRemoteRepository.class
+org/argeo/eclipse/ui/workbench/jcr/browser/internal/GenericNodePage$1.class
+org/argeo/eclipse/ui/workbench/jcr/browser/internal/JcrUiUtils.class
+org/argeo/eclipse/ui/workbench/jcr/browser/model/SingleJcrNodeElem.class
+org/argeo/eclipse/ui/workbench/jcr/browser/model/RemoteRepositoryElem.class
+org/argeo/eclipse/ui/workbench/commands/SortChildNodes.class
+org/argeo/eclipse/ui/workbench/osgi/ModulesView$ServiceReferenceNode.class
+org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$1.class
+org/argeo/eclipse/ui/workbench/jcr/browser/internal/PropertyLabelProvider.class
+org/argeo/eclipse/ui/workbench/osgi/BundlesView$StateLabelProvider.class
+org/argeo/eclipse/ui/workbench/osgi/BundlesView$4.class
+org/argeo/eclipse/ui/workbench/osgi/ModulesView.class
+org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeRightsManagementPage$2.class
+org/argeo/eclipse/ui/workbench/jcr/browser/internal/ChooseRightsPage.class
+org/argeo/eclipse/ui/workbench/osgi/BundlesView$3.class
+org/argeo/eclipse/ui/workbench/jcr/browser/internal/GenericNodeEditorInput.class
+org/argeo/eclipse/ui/workbench/jcr/browser/model/MaintainedRepositoryElem.class
+org/argeo/eclipse/ui/workbench/jcr/GenericJcrQueryEditor.class
+org/argeo/eclipse/ui/workbench/commands/ImportFileSystem.class
+org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$2.class
+org/argeo/eclipse/ui/workbench/osgi/ModulesView$1.class
+org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeRightsManagementPage.class
+org/argeo/eclipse/ui/workbench/commands/DumpNode.class
+org/argeo/eclipse/ui/workbench/osgi/BundlesView.class
+org/argeo/eclipse/ui/workbench/osgi/ModulesView$ExportedPackageNode.class
+org/argeo/eclipse/ui/workbench/jcr/browser/internal/GenericPropertyPage$TreeContentProvider.class
+org/argeo/eclipse/ui/workbench/jcr/browser/internal/ChangeRightsWizard.class
+org/argeo/eclipse/ui/workbench/jcr/browser/internal/FullVersioningTreeContentProvider.class
+org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$TreeObserver.class
+org/argeo/eclipse/ui/workbench/jcr/browser/internal/ChooseNameDialog.class
+org/argeo/eclipse/ui/workbench/jcr/browser/internal/GenericNodeDoubleClickListener.class
+org/argeo/eclipse/ui/workbench/jcr/browser/internal/GenericNodePage$ModifiedFieldListener.class
+org/argeo/eclipse/ui/workbench/jcr/browser/internal/GenericNodePage.class
+org/argeo/eclipse/ui/workbench/commands/DeleteNodes.class
+org/argeo/eclipse/ui/workbench/osgi/OsgiExplorerPerspective.class
+org/argeo/eclipse/ui/workbench/jcr/browser/internal/GenericPropertyPage.class
+org/argeo/eclipse/ui/workbench/jcr/browser/internal/ChildNodesPage.class
+org/argeo/eclipse/ui/workbench/osgi/BundlesView$7.class
+org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView$4.class
+org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeVersionHistoryPage.class
+org/argeo/eclipse/ui/workbench/commands/AddPrivileges.class
+org/argeo/eclipse/ui/workbench/commands/RemoveRemoteRepository.class
+org/argeo/eclipse/ui/workbench/osgi/BundlesView$5.class
+org/argeo/eclipse/ui/workbench/osgi/ModulesView$ModulesLabelProvider.class
+org/argeo/eclipse/ui/workbench/commands/AddFolderNode.class
+org/argeo/eclipse/ui/workbench/commands/CreateWorkspace.class
+org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeContentProvider.class
+org/argeo/eclipse/ui/workbench/jcr/browser/model/RepositoriesElem.class
+org/argeo/eclipse/ui/workbench/jcr/browser/internal/EmptyNodePage.class
+org/argeo/eclipse/ui/workbench/osgi/BundlesView$6.class
+org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeContentProvider$TreeBrowserComparator.class
+org/argeo/eclipse/ui/workbench/osgi/BundlesView$2.class
+org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView.class
+org/argeo/eclipse/ui/workbench/jcr/browser/internal/ImportFileSystemWizard$1.class
+org/argeo/eclipse/ui/workbench/jcr/browser/internal/SingleNodeAsTreeContentProvider.class
+org/argeo/eclipse/ui/workbench/jcr/browser/internal/VersionLabelProvider.class
+org/argeo/eclipse/ui/workbench/jcr/browser/internal/TreeObjectsComparator.class
+org/argeo/eclipse/ui/workbench/jcr/JcrBrowserPerspective.class
+org/argeo/eclipse/ui/workbench/commands/EditNode.class
+org/argeo/eclipse/ui/workbench/jcr/browser/model/WorkspaceElem.class
+org/argeo/eclipse/ui/workbench/osgi/ModulesView$BundleNode.class
diff --git a/org.argeo.eclipse.ui.workbench/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/org.argeo.eclipse.ui.workbench/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
new file mode 100644 (file)
index 0000000..78c09dd
--- /dev/null
@@ -0,0 +1,53 @@
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserView.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/browser/internal/PropertyLabelProvider.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/browser/internal/DefaultNodeLabelProvider.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/browser/internal/PropertiesContentProvider.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/JcrBrowserPerspective.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeContentProvider.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeVersionHistoryPage.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/Refresh.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/browser/model/RepositoriesElem.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/DeleteNodes.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/osgi/ModulesView.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/GetNodeSize.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/DumpNode.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/browser/internal/GenericNodeEditorInput.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/browser/internal/JcrUiUtils.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/AddFolderNode.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/browser/model/MaintainedRepositoryElem.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/GenericJcrQueryEditor.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/browser/internal/ChooseRightsPage.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/osgi/OsgiExplorerPerspective.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/ImportFileSystem.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/browser/internal/ChildNodesPage.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeRightsManagementPage.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/DefaultNodeEditor.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/AddPrivileges.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/SortChildNodes.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/browser/internal/GenericNodeDoubleClickListener.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/osgi/BundlesView.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/OpenEditor.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/browser/internal/StringNodeEditorInput.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/EditNode.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/WorkbenchUiPlugin.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/browser/internal/FullVersioningTreeContentProvider.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/browser/internal/ChangeRightsWizard.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/browser/model/RemoteRepositoryElem.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/AddRemoteRepository.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/browser/internal/TreeObjectsComparator.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/browser/internal/GenericNodePage.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/browser/model/SingleJcrNodeElem.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/RemoveRemoteRepository.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/browser/internal/SingleNodeAsTreeContentProvider.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/browser/model/RepositoryElem.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/osgi/OsgiExplorerImages.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/browser/internal/ImportFileSystemWizard.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/JcrImages.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/browser/internal/NodeLabelProvider.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/WorkbenchConstants.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/browser/internal/GenericPropertyPage.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/browser/internal/VersionLabelProvider.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/browser/internal/ChooseNameDialog.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/browser/internal/EmptyNodePage.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/jcr/browser/model/WorkspaceElem.java
+/home/bsinou/dev/src/commons/org.argeo.eclipse.ui.workbench/src/org/argeo/eclipse/ui/workbench/commands/CreateWorkspace.java
diff --git a/org.argeo.eclipse.ui.workbench/target/org.argeo.eclipse.ui.workbench-2.1.12-SNAPSHOT.jar b/org.argeo.eclipse.ui.workbench/target/org.argeo.eclipse.ui.workbench-2.1.12-SNAPSHOT.jar
new file mode 100644 (file)
index 0000000..2b607ec
Binary files /dev/null and b/org.argeo.eclipse.ui.workbench/target/org.argeo.eclipse.ui.workbench-2.1.12-SNAPSHOT.jar differ
diff --git a/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/dialogs/Error.java b/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/dialogs/Error.java
deleted file mode 100644 (file)
index 918bfd2..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.eclipse.ui.dialogs;
-
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Generic error dialog to be used in try/catch blocks
- * 
- * @deprecated use {@link org.argeo.eclipse.ui.ErrorFeedback} instead.
- */
-public class Error extends org.argeo.eclipse.ui.ErrorFeedback {
-       private static final long serialVersionUID = -93864960090248736L;
-
-       public Error(Shell parentShell, String message, Throwable e) {
-               super(parentShell, message, e);
-       }
-}
index ef2b8a84503dfeac72a5d07eb3fb27c3d2c64930..69d24a7528971c8e198805361b97d985ba5b3871 100644 (file)
@@ -31,6 +31,8 @@ import org.argeo.eclipse.ui.AbstractTreeContentProvider;
 /** Canonic implementation of tree content provider manipulating JCR nodes. */
 public abstract class AbstractNodeContentProvider extends
                AbstractTreeContentProvider {
+       private static final long serialVersionUID = -4905836490027272569L;
+
        private final static Log log = LogFactory
                        .getLog(AbstractNodeContentProvider.class);
 
@@ -149,4 +151,4 @@ public abstract class AbstractNodeContentProvider extends
        public Session getSession() {
                return session;
        }
-}
+}
\ No newline at end of file
diff --git a/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/jcr/DefaultNodeLabelProvider.java b/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/jcr/DefaultNodeLabelProvider.java
deleted file mode 100644 (file)
index 76fac12..0000000
+++ /dev/null
@@ -1,125 +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.eclipse.ui.jcr;
-
-import javax.jcr.Node;
-import javax.jcr.Property;
-import javax.jcr.RepositoryException;
-import javax.jcr.nodetype.NodeType;
-
-import org.argeo.ArgeoException;
-import org.argeo.jcr.ArgeoTypes;
-import org.eclipse.jface.viewers.ColumnLabelProvider;
-import org.eclipse.swt.graphics.Image;
-
-/** Provides reasonable overridable defaults for know JCR types. */
-public class DefaultNodeLabelProvider extends ColumnLabelProvider {
-       // Images
-       /**
-        * @deprecated Use {@link JcrImages#NODE} instead
-        */
-       public final static Image NODE = JcrImages.NODE;
-       /**
-        * @deprecated Use {@link JcrImages#FOLDER} instead
-        */
-       public final static Image FOLDER = JcrImages.FOLDER;
-       /**
-        * @deprecated Use {@link JcrImages#FILE} instead
-        */
-       public final static Image FILE = JcrImages.FILE;
-       /**
-        * @deprecated Use {@link JcrImages#BINARY} instead
-        */
-       public final static Image BINARY = JcrImages.BINARY;
-       /**
-        * @deprecated Use {@link JcrImages#HOME} instead
-        */
-       public final static Image HOME = JcrImages.HOME;
-
-       public String getText(Object element) {
-               try {
-                       if (element instanceof Node) {
-                               return getText((Node) element);
-                       } else if (element instanceof WrappedNode) {
-                               return getText(((WrappedNode) element).getNode());
-                       } else if (element instanceof NodesWrapper) {
-                               return getText(((NodesWrapper) element).getNode());
-                       }
-                       return super.getText(element);
-               } catch (RepositoryException e) {
-                       throw new ArgeoException("Cannot get text for of " + element, e);
-               }
-       }
-
-       protected String getText(Node node) throws RepositoryException {
-               if (node.isNodeType(NodeType.MIX_TITLE)
-                               && node.hasProperty(Property.JCR_TITLE))
-                       return node.getProperty(Property.JCR_TITLE).getString();
-               else
-                       return node.getName();
-       }
-
-       @Override
-       public Image getImage(Object element) {
-               try {
-                       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());
-                       }
-               } catch (RepositoryException e) {
-                       throw new ArgeoException("Cannot retrieve image for " + element, e);
-               }
-               return super.getImage(element);
-       }
-
-       protected Image getImage(Node node) throws RepositoryException {
-               // optimized order
-               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;
-               else if (node.isNodeType(ArgeoTypes.ARGEO_USER_HOME))
-                       return JcrImages.HOME;
-               else
-                       return JcrImages.NODE;
-       }
-
-       @Override
-       public String getToolTipText(Object element) {
-               try {
-                       if (element instanceof Node) {
-                               return getToolTipText((Node) element);
-                       } else if (element instanceof WrappedNode) {
-                               return getToolTipText(((WrappedNode) element).getNode());
-                       } else if (element instanceof NodesWrapper) {
-                               return getToolTipText(((NodesWrapper) element).getNode());
-                       }
-               } catch (RepositoryException e) {
-                       throw new ArgeoException("Cannot get tooltip for " + element, e);
-               }
-               return super.getToolTipText(element);
-       }
-
-       protected String getToolTipText(Node node) throws RepositoryException {
-               return null;
-       }
-
-}
diff --git a/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/jcr/JcrImages.java b/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/jcr/JcrImages.java
deleted file mode 100644 (file)
index 255ea7a..0000000
+++ /dev/null
@@ -1,52 +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.eclipse.ui.jcr;
-
-import org.eclipse.swt.graphics.Image;
-
-/** Shared icons. */
-public class JcrImages {
-       public final static Image NODE = JcrUiPlugin.getImageDescriptor(
-                       "icons/node.gif").createImage();
-       public final static Image FOLDER = JcrUiPlugin.getImageDescriptor(
-                       "icons/folder.gif").createImage();
-       public final static Image FILE = JcrUiPlugin.getImageDescriptor(
-                       "icons/file.gif").createImage();
-       public final static Image BINARY = JcrUiPlugin.getImageDescriptor(
-                       "icons/binary.png").createImage();
-       public final static Image HOME = JcrUiPlugin.getImageDescriptor(
-                       "icons/home.gif").createImage();
-       public final static Image SORT = JcrUiPlugin.getImageDescriptor(
-                       "icons/sort.gif").createImage();
-
-       public final static Image REPOSITORIES = JcrUiPlugin.getImageDescriptor(
-                       "icons/repositories.gif").createImage();
-       public final static Image REPOSITORY_DISCONNECTED = JcrUiPlugin
-                       .getImageDescriptor("icons/repository_disconnected.gif")
-                       .createImage();
-       public final static Image REPOSITORY_CONNECTED = JcrUiPlugin
-                       .getImageDescriptor("icons/repository_connected.gif").createImage();
-       public final static Image REMOTE_DISCONNECTED = JcrUiPlugin
-                       .getImageDescriptor("icons/remote_disconnected.gif").createImage();
-       public final static Image REMOTE_CONNECTED = JcrUiPlugin
-                       .getImageDescriptor("icons/remote_connected.gif").createImage();
-       public final static Image WORKSPACE_DISCONNECTED = JcrUiPlugin
-                       .getImageDescriptor("icons/workspace_disconnected.png")
-                       .createImage();
-       public final static Image WORKSPACE_CONNECTED = JcrUiPlugin
-                       .getImageDescriptor("icons/workspace_connected.png").createImage();
-
-}
index c9777cefde34c6106cdeed2ebe42d328a56629a9..ef14d175eb79f3a8f651c2daed8809da918a77ec 100644 (file)
@@ -45,6 +45,8 @@ import org.osgi.framework.BundleContext;
  * - better integrate with {@link ScopedPreferenceStore} provided by RAP
  */
 public class JcrPreferenceStore extends PreferenceStore implements ArgeoNames {
+       private static final long serialVersionUID = 1854011367784598758L;
+
        private Session session;
        private BundleContext bundleContext;
 
diff --git a/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/jcr/JcrUiPlugin.java b/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/jcr/JcrUiPlugin.java
deleted file mode 100644 (file)
index adfa1a4..0000000
+++ /dev/null
@@ -1,70 +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.eclipse.ui.jcr;
-
-import java.util.ResourceBundle;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-public class JcrUiPlugin extends AbstractUIPlugin {
-       private final static Log log = LogFactory.getLog(JcrUiPlugin.class);
-
-       public final static String ID = "org.argeo.eclipse.ui.jcr";
-
-       private ResourceBundle messages;
-
-       private static JcrUiPlugin plugin;
-
-       public void start(BundleContext context) throws Exception {
-               super.start(context);
-               plugin = this;
-               messages = ResourceBundle.getBundle("org.argeo.eclipse.ui.jcr");
-       }
-
-       public static JcrUiPlugin getDefault() {
-               return plugin;
-       }
-
-       public static ImageDescriptor getImageDescriptor(String path) {
-               return imageDescriptorFromPlugin(ID, path);
-       }
-
-       /** Returns the internationalized label for the given key */
-       public static String getMessage(String key) {
-               try {
-                       return getDefault().messages.getString(key);
-               } catch (NullPointerException npe) {
-                       log.warn(key + " not found.");
-                       return key;
-               }
-       }
-
-       /**
-        * Gives access to the internationalization message bundle. Returns null in
-        * case the ClientUiPlugin is not started (for JUnit tests, by instance)
-        */
-       public static ResourceBundle getMessagesBundle() {
-               if (getDefault() != null)
-                       // To avoid NPE
-                       return getDefault().messages;
-               else
-                       return null;
-       }
-}
index 8ee13aab0f8e3f176773c50eec85beed7dcef3fb..97930319205e3692a4ebc462e5897f9d4e1ea625 100644 (file)
@@ -100,6 +100,8 @@ public class JcrUiUtils {
                        final String propertyName, final RowViewerComparator comparator,
                        final TableViewer viewer) {
                SelectionAdapter selectionAdapter = new SelectionAdapter() {
+                       private static final long serialVersionUID = -5738918304901437720L;
+
                        @Override
                        public void widgetSelected(SelectionEvent e) {
                                Table table = viewer.getTable();
@@ -126,6 +128,8 @@ public class JcrUiUtils {
                        final int propertyType, final String propertyName,
                        final NodeViewerComparator comparator, final TableViewer viewer) {
                SelectionAdapter selectionAdapter = new SelectionAdapter() {
+                       private static final long serialVersionUID = -1683220869195484625L;
+
                        @Override
                        public void widgetSelected(SelectionEvent e) {
                                Table table = viewer.getTable();
index 0dad19cfee6d4e4ef1974b0cb23005d3c3dbc8f4..89883073d41efabf8e3b5e35f705c90bcff96f8f 100644 (file)
@@ -28,6 +28,7 @@ import org.argeo.jcr.JcrUtils;
 
 /** Simple JCR node content provider taking a list of String as base path. */
 public class SimpleNodeContentProvider extends AbstractNodeContentProvider {
+       private static final long serialVersionUID = -8245193308831384269L;
        private final List<String> basePaths;
        private Boolean mkdirs = false;
 
diff --git a/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/jcr/commands/AddFileFolder.java b/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/jcr/commands/AddFileFolder.java
deleted file mode 100644 (file)
index 5fc7db0..0000000
+++ /dev/null
@@ -1,69 +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.eclipse.ui.jcr.commands;
-
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-import javax.jcr.nodetype.NodeType;
-
-import org.argeo.eclipse.ui.ErrorFeedback;
-import org.argeo.eclipse.ui.dialogs.SingleValue;
-import org.argeo.eclipse.ui.jcr.JcrUiPlugin;
-import org.argeo.eclipse.ui.jcr.views.AbstractJcrBrowser;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/** Adds a node of type nt:folder */
-public class AddFileFolder extends AbstractHandler {
-
-       public Object execute(ExecutionEvent event) throws ExecutionException {
-               ISelection selection = HandlerUtil.getActiveWorkbenchWindow(event)
-                               .getActivePage().getSelection();
-               AbstractJcrBrowser view = (AbstractJcrBrowser) HandlerUtil
-                               .getActiveWorkbenchWindow(event).getActivePage()
-                               .findView(HandlerUtil.getActivePartId(event));
-               if (selection != null && !selection.isEmpty()
-                               && selection instanceof IStructuredSelection) {
-                       Object obj = ((IStructuredSelection) selection).getFirstElement();
-
-                       if (obj instanceof Node) {
-                               String folderName = SingleValue.ask("Folder name",
-                                               "Enter folder name");
-                               if (folderName != null) {
-                                       Node parentNode = (Node) obj;
-                                       try {
-                                               Node newNode = parentNode.addNode(folderName,
-                                                               NodeType.NT_FOLDER);
-                                               view.nodeAdded(parentNode, newNode);
-                                               parentNode.getSession().save();
-                                       } catch (RepositoryException e) {
-                                               ErrorFeedback.show("Cannot create folder " + folderName
-                                                               + " under " + parentNode, e);
-                                       }
-                               }
-                       } else {
-                               ErrorFeedback.show(JcrUiPlugin
-                                               .getMessage("errorUnvalidNtFolderNodeType"));
-                       }
-               }
-               return null;
-       }
-
-}
diff --git a/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/jcr/commands/DeleteNodes.java b/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/jcr/commands/DeleteNodes.java
deleted file mode 100644 (file)
index 1686748..0000000
+++ /dev/null
@@ -1,85 +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.eclipse.ui.jcr.commands;
-
-import java.util.Iterator;
-
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-
-import org.argeo.ArgeoException;
-import org.argeo.eclipse.ui.ErrorFeedback;
-import org.argeo.eclipse.ui.jcr.views.AbstractJcrBrowser;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/**
- * Deletes the selected nodes and refresh the corresponding AbstractJcrView.
- * Note that no model specific check is done to see if the node can be removed
- * or not. Extend or override to implement specific behaviour.
- */
-public class DeleteNodes extends AbstractHandler {
-       public final static String ID = "org.argeo.eclipse.ui.jcr.deleteNodes";
-       public final static String DEFAULT_LABEL = "Delete selected nodes";
-
-       public Object execute(ExecutionEvent event) throws ExecutionException {
-               ISelection selection = HandlerUtil.getActiveWorkbenchWindow(event)
-                               .getActivePage().getSelection();
-               AbstractJcrBrowser view = (AbstractJcrBrowser) HandlerUtil
-                               .getActiveWorkbenchWindow(event).getActivePage()
-                               .findView(HandlerUtil.getActivePartId(event));
-
-               if (selection != null && selection instanceof IStructuredSelection) {
-                       Iterator<?> it = ((IStructuredSelection) selection).iterator();
-                       Object obj = null;
-                       Node ancestor = null;
-                       try {
-                               while (it.hasNext()) {
-                                       obj = it.next();
-                                       if (obj instanceof Node) {
-                                               Node node = (Node) obj;
-                                               Node parentNode = node.getParent();
-                                               node.remove();
-                                               node.getSession().save();
-                                               ancestor = getOlder(ancestor, parentNode);
-                                       }
-                               }
-                               if (ancestor != null)
-                                       view.nodeRemoved(ancestor);
-                       } catch (Exception e) {
-                               ErrorFeedback.show("Cannot delete node " + obj, e);
-                       }
-               }
-               return null;
-       }
-
-       protected Node getOlder(Node A, Node B) {
-               try {
-
-                       if (A == null)
-                               return B == null ? null : B;
-                       // Todo enhanced this method
-                       else
-                               return A.getDepth() <= B.getDepth() ? A : B;
-               } catch (RepositoryException re) {
-                       throw new ArgeoException("Cannot find ancestor", re);
-               }
-       }
-}
diff --git a/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/jcr/commands/OpenGenericJcrQueryEditor.java b/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/jcr/commands/OpenGenericJcrQueryEditor.java
deleted file mode 100644 (file)
index ce42266..0000000
+++ /dev/null
@@ -1,45 +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.eclipse.ui.jcr.commands;
-
-import org.argeo.eclipse.ui.jcr.editors.JcrQueryEditorInput;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/** Open a JCR query editor. */
-public class OpenGenericJcrQueryEditor extends AbstractHandler {
-       private String editorId;
-
-       public Object execute(ExecutionEvent event) throws ExecutionException {
-               try {
-                       JcrQueryEditorInput editorInput = new JcrQueryEditorInput("", null);
-                       IWorkbenchPage activePage = HandlerUtil.getActiveWorkbenchWindow(
-                                       event).getActivePage();
-                       activePage.openEditor(editorInput, editorId);
-               } catch (Exception e) {
-                       throw new ExecutionException("Cannot open editor", e);
-               }
-               return null;
-       }
-
-       public void setEditorId(String editorId) {
-               this.editorId = editorId;
-       }
-
-}
diff --git a/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/jcr/commands/Refresh.java b/org.argeo.eclipse.ui/src/org/argeo/eclipse/ui/jcr/commands/Refresh.java
deleted file mode 100644 (file)
index f62be37..0000000
+++ /dev/null
@@ -1,53 +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.eclipse.ui.jcr.commands;
-
-import java.util.Iterator;
-
-import org.argeo.eclipse.ui.jcr.views.AbstractJcrBrowser;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/**
- * Call the refresh method of the active AbstractJcrBrowser instance.
- * 
- * Warning: this method only refreshes the viewer, if the model is "stale", e.g.
- * if some changes in the underlying data have not yet been propagated to the
- * model, the view will not display up-to-date information.
- */
-@Deprecated
-public class Refresh extends AbstractHandler {
-
-       public Object execute(ExecutionEvent event) throws ExecutionException {
-               ISelection selection = HandlerUtil.getActiveWorkbenchWindow(event)
-                               .getActivePage().getSelection();
-               AbstractJcrBrowser view = (AbstractJcrBrowser) HandlerUtil
-                               .getActiveWorkbenchWindow(event).getActivePage()
-                               .findView(HandlerUtil.getActivePartId(event));
-               if (selection != null && selection instanceof IStructuredSelection) {
-                       Iterator<?> it = ((IStructuredSelection) selection).iterator();
-                       while (it.hasNext()) {
-                               Object obj = it.next();
-                               view.refresh(obj);
-                       }
-               }
-               return null;
-       }
-}
index 133a65fd14cbfc278cc470c02deaad1121cebcb5..58f56c281fef9fa222077f1b2d9948c42d540bb5 100644 (file)
  */
 package org.argeo.eclipse.ui.jcr.views;
 
-import javax.jcr.Node;
 
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.part.ViewPart;
+@ Deprecated 
+public abstract class AbstractJcrBrowser {}
 
-public abstract class AbstractJcrBrowser extends ViewPart {
-
-       @Override
-       public abstract void createPartControl(Composite parent);
-
-       /**
-        * To be overridden to adapt size of form and result frames.
-        */
-       abstract protected int[] getWeights();
-
-       /**
-        * To be overridden to provide an adapted size nodeViewer
-        */
-       abstract protected TreeViewer createNodeViewer(Composite parent,
-                       ITreeContentProvider nodeContentProvider);
-
-       /**
-        * To be overridden to retrieve the current nodeViewer
-        */
-       abstract protected TreeViewer getNodeViewer();
-
-       /*
-        * Enables the refresh of the tree.
-        */
-       @Override
-       public void setFocus() {
-               getNodeViewer().getTree().setFocus();
-       }
-
-       public void refresh(Object obj) {
-               // getNodeViewer().update(obj, null);
-               getNodeViewer().refresh(obj);
-               // getNodeViewer().expandToLevel(obj, 1);
-       }
-
-       public void nodeAdded(Node parentNode, Node newNode) {
-               getNodeViewer().refresh(parentNode);
-               getNodeViewer().expandToLevel(newNode, 0);
-       }
-
-       public void nodeRemoved(Node parentNode) {
-               IStructuredSelection newSel = new StructuredSelection(parentNode);
-               getNodeViewer().setSelection(newSel, true);
-               // Force refresh
-               IStructuredSelection tmpSel = (IStructuredSelection) getNodeViewer()
-                               .getSelection();
-               getNodeViewer().refresh(tmpSel.getFirstElement());
-       }
-}
+// public abstract class AbstractJcrBrowser extends ViewPart {
+//
+// @Override
+// public abstract void createPartControl(Composite parent);
+//
+// /**
+// * To be overridden to adapt size of form and result frames.
+// */
+// abstract protected int[] getWeights();
+//
+// /**
+// * To be overridden to provide an adapted size nodeViewer
+// */
+// abstract protected TreeViewer createNodeViewer(Composite parent,
+// ITreeContentProvider nodeContentProvider);
+//
+// /**
+// * To be overridden to retrieve the current nodeViewer
+// */
+// abstract protected TreeViewer getNodeViewer();
+//
+// /*
+// * Enables the refresh of the tree.
+// */
+// @Override
+// public void setFocus() {
+// getNodeViewer().getTree().setFocus();
+// }
+//
+// public void refresh(Object obj) {
+// // getNodeViewer().update(obj, null);
+// getNodeViewer().refresh(obj);
+// // getNodeViewer().expandToLevel(obj, 1);
+// }
+//
+// public void nodeAdded(Node parentNode, Node newNode) {
+// getNodeViewer().refresh(parentNode);
+// getNodeViewer().expandToLevel(newNode, 0);
+// }
+//
+// public void nodeRemoved(Node parentNode) {
+// IStructuredSelection newSel = new StructuredSelection(parentNode);
+// getNodeViewer().setSelection(newSel, true);
+// // Force refresh
+// IStructuredSelection tmpSel = (IStructuredSelection) getNodeViewer()
+// .getSelection();
+// getNodeViewer().refresh(tmpSel.getFirstElement());
+// }
+// }
index 22a139f134aa565b119106ed292511d3693e29d5..0979bace052b50ba3340363aa0630fc1c94ca04a 100644 (file)
@@ -22,7 +22,6 @@ import java.util.Map;
 import org.argeo.ArgeoException;
 import org.argeo.eclipse.ui.ArgeoUiPlugin;
 import org.eclipse.core.commands.Command;
-import org.eclipse.core.commands.IParameter;
 import org.eclipse.core.commands.Parameterization;
 import org.eclipse.core.commands.ParameterizedCommand;
 import org.eclipse.jface.action.IContributionItem;
@@ -30,7 +29,6 @@ import org.eclipse.jface.action.IMenuManager;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.swt.SWT;
 import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.commands.ICommandService;
 import org.eclipse.ui.handlers.IHandlerService;
 import org.eclipse.ui.menus.CommandContributionItem;
@@ -180,59 +178,4 @@ public class CommandUtils {
                                        + " calling the command " + commandID, e);
                }
        }
-
-       // legacy methods. Should be removed soon
-
-       /**
-        * Shortcut to call a command with a single parameter.
-        * 
-        * WARNING: none of the parameter can be null
-        * 
-        * @deprecated rather use <code>callCommand(commandID,parameterID,
-                       parameterValue)</code>
-        */
-       public static void CallCommandWithOneParameter(String commandId,
-                       String paramId, String paramValue) {
-               try {
-                       IWorkbench iw = ArgeoUiPlugin.getDefault().getWorkbench();
-                       IHandlerService handlerService = (IHandlerService) iw
-                                       .getService(IHandlerService.class);
-
-                       // Gets a command that must have been previously registered
-                       IWorkbenchWindow window = iw.getActiveWorkbenchWindow();
-                       ICommandService cmdService = (ICommandService) window
-                                       .getService(ICommandService.class);
-                       Command cmd = cmdService.getCommand(commandId);
-
-                       // Manages the single parameter
-                       ArrayList<Parameterization> parameters = new ArrayList<Parameterization>();
-                       IParameter iparam = cmd.getParameter(paramId);
-                       Parameterization params = new Parameterization(iparam, paramValue);
-                       parameters.add(params);
-
-                       // Create and execute the command
-                       ParameterizedCommand pc = new ParameterizedCommand(cmd,
-                                       parameters.toArray(new Parameterization[parameters.size()]));
-                       handlerService = (IHandlerService) window
-                                       .getService(IHandlerService.class);
-                       handlerService.executeCommand(pc, null);
-               } catch (Exception e) {
-                       throw new ArgeoException(
-                                       "Error calling command of id:" + commandId, e);
-               }
-       }
-
-       /**
-        * Commodities the refresh of a single command with a map of parameters in a
-        * Menu.aboutToShow method to simplify further development Rather use
-        * {@link refreshParameterizedCommand()}
-        */
-       @Deprecated
-       public static void refreshParametrizedCommand(IMenuManager menuManager,
-                       IServiceLocator locator, String cmdId, String label,
-                       ImageDescriptor icon, boolean showCommand,
-                       Map<String, String> params) {
-               refreshParameterizedCommand(menuManager, locator, cmdId, label, icon,
-                               showCommand, params);
-       }
 }
\ No newline at end of file
diff --git a/org.argeo.jcr.ui.explorer/.classpath b/org.argeo.jcr.ui.explorer/.classpath
deleted file mode 100644 (file)
index d2953a6..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-       <classpathentry kind="src" path="src" />
-       <classpathentry kind="con"
-               path="org.eclipse.pde.core.requiredPlugins" />
-       <classpathentry kind="con"
-               path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6" />
-       <classpathentry kind="output" path="bin" />
-</classpath>
diff --git a/org.argeo.jcr.ui.explorer/.project b/org.argeo.jcr.ui.explorer/.project
deleted file mode 100644 (file)
index 162cd6b..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-       <name>org.argeo.jcr.ui.explorer</name>
-       <comment></comment>
-       <projects>
-       </projects>
-       <buildSpec>
-               <buildCommand>
-                       <name>org.eclipse.jdt.core.javabuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>org.eclipse.pde.ManifestBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>org.eclipse.pde.SchemaBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-       </buildSpec>
-       <natures>
-               <nature>org.eclipse.pde.PluginNature</nature>
-               <nature>org.eclipse.jdt.core.javanature</nature>
-       </natures>
-</projectDescription>
diff --git a/org.argeo.jcr.ui.explorer/META-INF/spring/commands.xml b/org.argeo.jcr.ui.explorer/META-INF/spring/commands.xml
deleted file mode 100644 (file)
index ef9f3f1..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
-       xsi:schemaLocation="http://www.springframework.org/schema/beans
-        http://www.springframework.org/schema/beans/spring-beans.xsd">
-
-       <bean id="openGenericJcrQueryEditor"
-               class="org.argeo.eclipse.ui.jcr.commands.OpenGenericJcrQueryEditor"
-               scope="prototype">
-               <property name="editorId"
-                       value="org.argeo.jcr.ui.explorer.genericJcrQueryEditor" />
-       </bean>
-
-       <bean id="openGenericNodeEditor"
-               class="org.argeo.jcr.ui.explorer.commands.OpenGenericNodeEditor"
-               scope="prototype">
-       </bean>
-
-       <bean id="getNodeSize" class="org.argeo.jcr.ui.explorer.commands.GetNodeSize"
-               scope="prototype">
-       </bean>
-
-       <bean id="addRemoteRepository" class="org.argeo.jcr.ui.explorer.commands.AddRemoteRepository">
-               <property name="repositoryFactory" ref="repositoryFactory" />
-               <property name="nodeRepository" ref="nodeRepository" />
-               <property name="keyring" ref="keyring" />
-       </bean>
-
-       <bean id="removeRemoteRepository"
-               class="org.argeo.jcr.ui.explorer.commands.RemoveRemoteRepository">
-       </bean>
-
-       <bean id="addFolderNode" class="org.argeo.jcr.ui.explorer.commands.AddFolderNode"
-               scope="prototype" />
-
-       <bean id="addPrivileges" class="org.argeo.jcr.ui.explorer.commands.AddPrivileges"
-               scope="prototype" />
-
-       <bean id="createWorkspace" class="org.argeo.jcr.ui.explorer.commands.CreateWorkspace"
-               scope="prototype" />
-
-       <bean id="refresh" class="org.argeo.jcr.ui.explorer.commands.Refresh"
-               scope="prototype" />
-
-       <bean id="deleteNodes" class="org.argeo.jcr.ui.explorer.commands.DeleteNodes"
-               scope="prototype" />
-
-       <bean id="importFileSystem" class="org.argeo.jcr.ui.explorer.commands.ImportFileSystem"
-               scope="prototype" />
-</beans>
diff --git a/org.argeo.jcr.ui.explorer/META-INF/spring/editors.xml b/org.argeo.jcr.ui.explorer/META-INF/spring/editors.xml
deleted file mode 100644 (file)
index fc86cee..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
-       xmlns:p="http://www.springframework.org/schema/p"
-       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
-        http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd">
-
-       <bean id="genericJcrQueryEditor" class="org.argeo.jcr.ui.explorer.editors.GenericJcrQueryEditor"
-               scope="prototype">
-               <property name="session" ref="nodeSession" />
-       </bean>
-       <bean id="genericNodeEditor" class="org.argeo.jcr.ui.explorer.editors.GenericNodeEditor"
-               scope="prototype">
-       </bean>
-</beans>
diff --git a/org.argeo.jcr.ui.explorer/META-INF/spring/jcr.xml b/org.argeo.jcr.ui.explorer/META-INF/spring/jcr.xml
deleted file mode 100644 (file)
index e074154..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
-       xmlns:p="http://www.springframework.org/schema/p"
-       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
-        http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd">
-
-       <bean id="repositoryRegister" class="org.argeo.jcr.DefaultRepositoryRegister" />
-
-</beans>
diff --git a/org.argeo.jcr.ui.explorer/META-INF/spring/osgi.xml b/org.argeo.jcr.ui.explorer/META-INF/spring/osgi.xml
deleted file mode 100644 (file)
index 255462b..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<beans:beans xmlns="http://www.springframework.org/schema/osgi"\r
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"\r
-       xmlns:osgi="http://www.springframework.org/schema/osgi"\r
-       xsi:schemaLocation="http://www.springframework.org/schema/osgi  \r
-       http://www.springframework.org/schema/osgi/spring-osgi-1.1.xsd\r
-       http://www.springframework.org/schema/beans   \r
-       http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"\r
-       osgi:default-timeout="30000">\r
-\r
-       <list id="repositories" interface="javax.jcr.Repository"\r
-               cardinality="0..N">\r
-               <listener ref="repositoryRegister" bind-method="register"\r
-                       unbind-method="unregister" />\r
-       </list>\r
-\r
-       <reference id="nodeRepository" interface="javax.jcr.Repository"\r
-               filter="(argeo.jcr.repository.alias=node)" />\r
-       <reference id="repositoryFactory" interface="javax.jcr.RepositoryFactory" />\r
-\r
-       <reference id="keyring" interface="org.argeo.security.crypto.CryptoKeyring" />\r
-\r
-</beans:beans>
\ No newline at end of file
diff --git a/org.argeo.jcr.ui.explorer/META-INF/spring/views.xml b/org.argeo.jcr.ui.explorer/META-INF/spring/views.xml
deleted file mode 100644 (file)
index 14f1943..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
-       xsi:schemaLocation="http://www.springframework.org/schema/beans
-        http://www.springframework.org/schema/beans/spring-beans.xsd">
-
-       <!-- Views -->
-       <bean id="browserView" class="org.argeo.jcr.ui.explorer.views.GenericJcrBrowser"
-               scope="prototype">
-               <property name="repositoryRegister" ref="repositoryRegister" />
-               <property name="repositoryFactory" ref="repositoryFactory" />
-               <property name="nodeRepository" ref="nodeRepository" />
-               <property name="keyring" ref="keyring" />
-       </bean>
-</beans>
diff --git a/org.argeo.jcr.ui.explorer/bnd.bnd b/org.argeo.jcr.ui.explorer/bnd.bnd
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/org.argeo.jcr.ui.explorer/build.properties b/org.argeo.jcr.ui.explorer/build.properties
deleted file mode 100644 (file)
index 410bf3a..0000000
+++ /dev/null
@@ -1 +0,0 @@
-source.. =     src/
diff --git a/org.argeo.jcr.ui.explorer/icons/add.gif b/org.argeo.jcr.ui.explorer/icons/add.gif
deleted file mode 100644 (file)
index 252d7eb..0000000
Binary files a/org.argeo.jcr.ui.explorer/icons/add.gif and /dev/null differ
diff --git a/org.argeo.jcr.ui.explorer/icons/addFolder.gif b/org.argeo.jcr.ui.explorer/icons/addFolder.gif
deleted file mode 100755 (executable)
index d3f43d9..0000000
Binary files a/org.argeo.jcr.ui.explorer/icons/addFolder.gif and /dev/null differ
diff --git a/org.argeo.jcr.ui.explorer/icons/addPrivileges.png b/org.argeo.jcr.ui.explorer/icons/addPrivileges.png
deleted file mode 100644 (file)
index a6b251f..0000000
Binary files a/org.argeo.jcr.ui.explorer/icons/addPrivileges.png and /dev/null differ
diff --git a/org.argeo.jcr.ui.explorer/icons/addRepo.gif b/org.argeo.jcr.ui.explorer/icons/addRepo.gif
deleted file mode 100755 (executable)
index 26d81c0..0000000
Binary files a/org.argeo.jcr.ui.explorer/icons/addRepo.gif and /dev/null differ
diff --git a/org.argeo.jcr.ui.explorer/icons/addWorkspace.png b/org.argeo.jcr.ui.explorer/icons/addWorkspace.png
deleted file mode 100644 (file)
index bbee775..0000000
Binary files a/org.argeo.jcr.ui.explorer/icons/addWorkspace.png and /dev/null differ
diff --git a/org.argeo.jcr.ui.explorer/icons/browser.gif b/org.argeo.jcr.ui.explorer/icons/browser.gif
deleted file mode 100644 (file)
index 6c7320c..0000000
Binary files a/org.argeo.jcr.ui.explorer/icons/browser.gif and /dev/null differ
diff --git a/org.argeo.jcr.ui.explorer/icons/dumpNode.gif b/org.argeo.jcr.ui.explorer/icons/dumpNode.gif
deleted file mode 100644 (file)
index 14eb1be..0000000
Binary files a/org.argeo.jcr.ui.explorer/icons/dumpNode.gif and /dev/null differ
diff --git a/org.argeo.jcr.ui.explorer/icons/getSize.gif b/org.argeo.jcr.ui.explorer/icons/getSize.gif
deleted file mode 100755 (executable)
index b05bf3e..0000000
Binary files a/org.argeo.jcr.ui.explorer/icons/getSize.gif and /dev/null differ
diff --git a/org.argeo.jcr.ui.explorer/icons/import_fs.png b/org.argeo.jcr.ui.explorer/icons/import_fs.png
deleted file mode 100644 (file)
index d7c890c..0000000
Binary files a/org.argeo.jcr.ui.explorer/icons/import_fs.png and /dev/null differ
diff --git a/org.argeo.jcr.ui.explorer/icons/nodes.gif b/org.argeo.jcr.ui.explorer/icons/nodes.gif
deleted file mode 100644 (file)
index bba3dbc..0000000
Binary files a/org.argeo.jcr.ui.explorer/icons/nodes.gif and /dev/null differ
diff --git a/org.argeo.jcr.ui.explorer/icons/query.png b/org.argeo.jcr.ui.explorer/icons/query.png
deleted file mode 100644 (file)
index 54c089d..0000000
Binary files a/org.argeo.jcr.ui.explorer/icons/query.png and /dev/null differ
diff --git a/org.argeo.jcr.ui.explorer/icons/refresh.png b/org.argeo.jcr.ui.explorer/icons/refresh.png
deleted file mode 100644 (file)
index a3884fb..0000000
Binary files a/org.argeo.jcr.ui.explorer/icons/refresh.png and /dev/null differ
diff --git a/org.argeo.jcr.ui.explorer/icons/remove.gif b/org.argeo.jcr.ui.explorer/icons/remove.gif
deleted file mode 100644 (file)
index 0ae6dec..0000000
Binary files a/org.argeo.jcr.ui.explorer/icons/remove.gif and /dev/null differ
diff --git a/org.argeo.jcr.ui.explorer/icons/repositories.gif b/org.argeo.jcr.ui.explorer/icons/repositories.gif
deleted file mode 100644 (file)
index c13bea1..0000000
Binary files a/org.argeo.jcr.ui.explorer/icons/repositories.gif and /dev/null differ
diff --git a/org.argeo.jcr.ui.explorer/icons/sort.gif b/org.argeo.jcr.ui.explorer/icons/sort.gif
deleted file mode 100644 (file)
index 23c5d0b..0000000
Binary files a/org.argeo.jcr.ui.explorer/icons/sort.gif and /dev/null differ
diff --git a/org.argeo.jcr.ui.explorer/plugin.properties b/org.argeo.jcr.ui.explorer/plugin.properties
deleted file mode 100644 (file)
index 6dff863..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-## commands label
-addNewFolderCmdLbl=Add folder
\ No newline at end of file
diff --git a/org.argeo.jcr.ui.explorer/plugin.xml b/org.argeo.jcr.ui.explorer/plugin.xml
deleted file mode 100644 (file)
index 67b8751..0000000
+++ /dev/null
@@ -1,360 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
-       <!-- Perspectives -->
-   <extension
-         point="org.eclipse.ui.perspectives">
-      <perspective
-            class="org.argeo.jcr.ui.explorer.JcrExplorerPerspective"
-            icon="icons/nodes.gif"
-            id="org.argeo.jcr.ui.explorer.perspective"
-            name="Data Explorer">
-      </perspective>
-   </extension>
-   <!-- Views --> 
-   <extension
-         point="org.eclipse.ui.views">
-          <view
-          class="org.argeo.eclipse.spring.SpringExtensionFactory"
-          icon="icons/browser.gif"
-          id="org.argeo.jcr.ui.explorer.browserView"
-          name="JCR Browser">
-          </view>
-   </extension>
-   <!-- Editors --> 
-   <extension
-           point="org.eclipse.ui.editors">
-            <editor
-                 class="org.argeo.eclipse.spring.SpringExtensionFactory"
-              id="org.argeo.jcr.ui.explorer.genericJcrQueryEditor"
-              name="JCR Query"
-              icon="icons/query.png"
-              default="false">
-        </editor>
-            <editor
-                 class="org.argeo.eclipse.spring.SpringExtensionFactory"
-              id="org.argeo.jcr.ui.explorer.genericNodeEditor"
-              name="Node Editor"
-              icon="icons/query.png"
-              default="false">
-        </editor>
-     </extension>
-       <!-- Commands --> 
-       <extension
-         point="org.eclipse.ui.commands">
-               <command
-            defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
-            id="org.argeo.jcr.ui.explorer.openGenericJcrQueryEditor"
-            name="New generic JCR query">
-       </command>
-       <command
-                       defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
-                       id="org.argeo.jcr.ui.explorer.openGenericNodeEditor"
-                       name="Open generic node Editor">
-                       <commandParameter
-                               id="org.argeo.jcr.ui.explorer.nodePath"
-                               name="Node path">
-                       </commandParameter>
-               </command>    
-       <command
-                       defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
-                       id="org.argeo.jcr.ui.explorer.getNodeSize"
-                       name="Get node size">
-               </command>    
-       <command
-                       defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
-                       id="org.argeo.jcr.ui.explorer.addRemoteRepository"
-                       name="Add remote JCR repository">
-                       <commandParameter
-                               id="org.argeo.jcr.ui.explorer.repositoryUri"
-                               name="Repository URI">
-                       </commandParameter>
-               </command>    
-       <command
-                       defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
-                       id="org.argeo.jcr.ui.explorer.removeRemoteRepository"
-                       name="Remove remote JCR repository">
-               </command>    
-         <command
-               defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
-               id="org.argeo.jcr.ui.explorer.addFolderNode"
-               name="Create a new folder">
-         </command>
-         <command
-               defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
-               id="org.argeo.jcr.ui.explorer.addPrivileges"
-               name="Add Privileges">
-         </command>
-         <command
-               defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
-               id="org.argeo.jcr.ui.explorer.createWorkspace"
-               name="Create a new workspace">
-         </command>
-         <command
-               defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
-               id="org.argeo.jcr.ui.explorer.refresh"
-               name="Refresh">
-         </command>
-         <command
-               defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
-               id="org.argeo.jcr.ui.explorer.deleteNodes"
-               name="Delete nodes">
-         </command>
-         <command
-               defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
-               id="org.argeo.jcr.ui.explorer.importFileSystem"
-               name="Import files...">
-         </command>
-        <!-- <command
-               defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
-               id="org.argeo.jcr.ui.explorer.openFile"
-               name="Open current file">
-         </command>
-         -->
-         <command
-               defaultHandler="org.argeo.jcr.ui.explorer.commands.DumpNode"
-               id="org.argeo.jcr.ui.explorer.dumpNode"
-               name="Dump Current Selected Node">
-         </command>
-         <command
-            defaultHandler="org.argeo.jcr.ui.explorer.commands.SortChildNodes"
-            id="org.argeo.jcr.ui.explorer.sortChildNodes"
-            name="Sort node tree">
-            <!-- FIXME: default value does not work -->
-            <state 
-                               id="org.argeo.jcr.ui.explorer.sortChildNodes.toggleState" 
-                               class="org.eclipse.ui.handlers.RegistryToggleState:true" >
-                               <!-- <class class="org.eclipse.jface.commands.ToggleState"> 
-                                       <parameter
-                                               name="default"
-                                       value="true" />
-                               </class> -->
-                       </state>
-     </command>
-    </extension>
-
-    <!-- Menus --> 
-       <extension point="org.eclipse.ui.menus">
-               <!-- Browser view specific menu --> 
-               <menuContribution
-                       locationURI="menu:org.argeo.jcr.ui.explorer.browserView">
-            <!-- See bug 149 --> 
-            <!-- <command
-               commandId="org.argeo.jcr.ui.explorer.openGenericJcrQueryEditor"
-                icon="icons/query.png"
-                style="push">
-            </command> --> 
-            <command
-               commandId="org.argeo.jcr.ui.explorer.addRemoteRepository"
-                icon="icons/addRepo.gif"
-                style="push">
-            </command>
-             <command
-               commandId="org.argeo.jcr.ui.explorer.sortChildNodes"
-                icon="icons/sort.gif"
-                style="toggle"
-                label="Sort child nodes"
-                tooltip="Warning: stopping to sort children nodes might enhance overall performances">
-            </command>
-               </menuContribution>
-               <!-- Browser view popup context menu --> 
-               <menuContribution
-                       locationURI="popup:org.argeo.jcr.ui.explorer.browserView">
-                       <command
-                               commandId="org.argeo.jcr.ui.explorer.refresh"
-                               icon="icons/refresh.png"
-                               style="push">
-                       </command>
-                       <command
-                        commandId="org.argeo.jcr.ui.explorer.addFolderNode"
-                        icon="icons/addFolder.gif"
-                        label="Add Folder"
-                        style="push">
-                               <visibleWhen>
-                                       <iterate>
-                                     <and>
-                                        <or>
-                                           <instanceof
-                                                 value="org.argeo.jcr.ui.explorer.model.SingleJcrNodeElem">
-                                           </instanceof>
-                                           <instanceof
-                                                 value="org.argeo.jcr.ui.explorer.model.WorkspaceElem">
-                                           </instanceof>
-                                        </or>
-                               <with variable="activeMenuSelection"><count value="1"/></with>
-                                     </and>
-                                       </iterate>
-                               </visibleWhen>
-                       </command>
-                       <command
-                        commandId="org.argeo.jcr.ui.explorer.addPrivileges"
-                        icon="icons/addPrivileges.png"
-                        label="Add Privileges"
-                        style="push">
-                               <visibleWhen>
-                                       <iterate>
-                                     <and>
-                                        <or>
-                                           <instanceof
-                                                 value="org.argeo.jcr.ui.explorer.model.SingleJcrNodeElem">
-                                           </instanceof>
-                                           <instanceof
-                                                 value="org.argeo.jcr.ui.explorer.model.WorkspaceElem">
-                                           </instanceof>
-                                        </or>
-                               <with variable="activeMenuSelection"><count value="1"/></with>
-                                     </and>
-                                       </iterate>
-                               </visibleWhen>
-                       </command>
-                       <command
-                        commandId="org.argeo.jcr.ui.explorer.createWorkspace"
-                        icon="icons/addWorkspace.png"
-                        label="Create Workspace"
-                        style="push">
-                               <visibleWhen>
-                                       <iterate>
-                                       <and>
-                                               <or>
-                                               <instanceof
-                                                       value="org.argeo.jcr.ui.explorer.model.RepositoryElem">
-                                               </instanceof>
-                                               </or>
-                                       <with variable="activeMenuSelection"><count value="1"/></with>
-                                               </and>
-                                       </iterate>
-                               </visibleWhen>
-                       </command>
-                       <command
-                               commandId="org.argeo.jcr.ui.explorer.deleteNodes"
-                               icon="icons/remove.gif"
-                               label="Delete Nodes"
-                               style="push">
-                               <visibleWhen>
-                                       <iterate>
-                                               <or>
-                                                       <instanceof
-                                                               value="org.argeo.jcr.ui.explorer.model.SingleJcrNodeElem" />
-                                                       <instanceof
-                                                               value="org.argeo.jcr.ui.explorer.model.WorkspaceElem" />
-                                               </or>
-                                       </iterate>
-                               </visibleWhen>
-                       </command>
-                       <command
-                               commandId="org.argeo.jcr.ui.explorer.importFileSystem"
-                               icon="icons/import_fs.png"
-                               style="push"
-                               tooltip="Import files from the files sytem">
-                               <visibleWhen>
-                                       <iterate>
-                                               <and>
-                                                       <or>
-                                                               <instanceof
-                                                                       value="org.argeo.jcr.ui.explorer.model.SingleJcrNodeElem" />
-                                                               <instanceof
-                                               value="org.argeo.jcr.ui.explorer.model.WorkspaceElem" />
-                                       </or>
-                                       <with variable="activeMenuSelection"><count value="1"/></with>
-                                               </and>
-                                       </iterate>
-                               </visibleWhen>
-                       </command>
-                       <command
-                               commandId="org.argeo.jcr.ui.explorer.addRemoteRepository"
-                               icon="icons/addRepo.gif"
-                               style="push">
-                                       <visibleWhen>
-                                               <iterate> 
-                                                       <or>
-                                                               <instanceof
-                                               value="org.argeo.jcr.ui.explorer.model.RepositoriesElem" />
-                                                               <instanceof
-                                                                       value="org.argeo.jcr.ui.explorer.model.RepositoryElem" />
-                                                       </or> 
-                                               </iterate>
-                                       </visibleWhen>
-                       </command>
-                       <command
-                               commandId="org.argeo.jcr.ui.explorer.removeRemoteRepository"
-                               icon="icons/remove.gif"
-                               style="push">
-                               <visibleWhen>
-                                       <iterate> 
-                                               <or>
-                                                       <instanceof
-                                                               value="org.argeo.jcr.ui.explorer.model.RemoteRepositoryElem" />
-                                               </or> 
-                               </iterate>
-                               </visibleWhen>
-                       </command>
-                       <command
-                               commandId="org.argeo.jcr.ui.explorer.getNodeSize"
-                               icon="icons/getSize.gif"
-                               style="push">
-                                       <visibleWhen>
-                                               <iterate>
-                                                       <or>
-                                                               <instanceof
-                                                                       value="org.argeo.jcr.ui.explorer.model.SingleJcrNodeElem" />
-                                                               <instanceof
-                                                                       value="org.argeo.jcr.ui.explorer.model.WorkspaceElem" />
-                                       </or>
-                                       </iterate>
-                                       </visibleWhen>
-                       </command>
-                       <command
-                        commandId="org.argeo.jcr.ui.explorer.dumpNode"
-                        icon="icons/dumpNode.gif"
-                        label="Dump Node"
-                        style="push">
-                               <visibleWhen>
-                                       <iterate>
-                                     <and>
-                                               <instanceof value="org.argeo.jcr.ui.explorer.model.SingleJcrNodeElem"></instanceof>
-                               <with variable="activeMenuSelection"><count value="1"/></with>
-                                     </and>
-                                       </iterate>
-                               </visibleWhen>
-                       </command>
-                       
-               </menuContribution>
-       </extension>
-
-       <!-- Reduce visibility of JCR Explorer perspective to users that are in ROLE_ADMIN -->  
-       <extension
-       point="org.eclipse.ui.activities">
-               <activity
-                       description="Only for admins"
-                       id="org.argeo.jcr.ui.explorer.adminActivity"
-            name="Jcr Technical Admin">
-                       <enabledWhen>
-                               <with variable="roles">
-                                       <iterate ifEmpty="false" operator="or">
-                                               <equals value="ROLE_ADMIN" />
-                                       </iterate>
-                               </with>
-                       </enabledWhen>
-               </activity>
-        <activityPatternBinding
-                       activityId="org.argeo.jcr.ui.explorer.adminActivity"
-                       isEqualityPattern="true"
-                       pattern="org.argeo.jcr.ui.explorer/org.argeo.jcr.ui.explorer.perspective">
-               </activityPatternBinding>
-       </extension>
-
-       <!-- Core expression definition 
-       <extension
-         point="org.eclipse.core.expressions.definitions">
-      <definition
-            id="expression.onlyOneItemSelected">
-         <with
-               variable="activeMenuSelection">
-            <count
-                  value="1">
-            </count>
-         </with>
-      </definition>
-   </extension>
-       --> 
-</plugin>
\ No newline at end of file
diff --git a/org.argeo.jcr.ui.explorer/pom.xml b/org.argeo.jcr.ui.explorer/pom.xml
deleted file mode 100644 (file)
index 3c9866f..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-       <modelVersion>4.0.0</modelVersion>
-       <parent>
-               <groupId>org.argeo.commons</groupId>
-               <version>2.1.12-SNAPSHOT</version>
-               <artifactId>argeo-commons</artifactId>
-               <relativePath>..</relativePath>
-       </parent>
-       <artifactId>org.argeo.jcr.ui.explorer</artifactId>
-       <name>Commons JCR Explorer</name>
-       <build>
-               <plugins>
-                       <plugin>
-                               <groupId>org.apache.felix</groupId>
-                               <artifactId>maven-bundle-plugin</artifactId>
-                               <configuration>
-                                       <instructions>
-                                               <Bundle-SymbolicName>${project.artifactId};singleton:=true</Bundle-SymbolicName>
-                                               <Bundle-ActivationPolicy>lazy</Bundle-ActivationPolicy>
-                                               <Bundle-Localization>plugin</Bundle-Localization>
-                                               <Bundle-Activator>org.argeo.jcr.ui.explorer.JcrExplorerPlugin</Bundle-Activator>
-                                               <Require-Bundle>org.eclipse.ui;resolution:=optional,
-                                                       org.eclipse.core.runtime;resolution:=optional,
-                                                       org.eclipse.rap.ui;resolution:=optional,
-                                                       org.eclipse.rap.ui.workbench;resolution:=optional</Require-Bundle>
-                                               <Import-Package>
-                                                       *,
-                                                       org.argeo.eclipse.spring,
-                                               </Import-Package>
-                                               <Export-Package>org.argeo.jcr.ui.explorer.*</Export-Package>
-                                       </instructions>
-                               </configuration>
-                       </plugin>
-               </plugins>
-       </build>
-       <dependencies>
-               <dependency>
-                       <groupId>org.argeo.commons</groupId>
-                       <artifactId>org.argeo.util</artifactId>
-                       <version>2.1.12-SNAPSHOT</version>
-               </dependency>
-               <dependency>
-                       <groupId>org.argeo.commons</groupId>
-                       <artifactId>org.argeo.eclipse.ui</artifactId>
-                       <version>2.1.12-SNAPSHOT</version>
-               </dependency>
-
-               <!-- RAP only dependency, needed at compile time -->
-               <dependency>
-                       <groupId>org.argeo.commons</groupId>
-                       <artifactId>org.argeo.eclipse.dep.rap</artifactId>
-                       <type>pom</type>
-                       <version>2.1.12-SNAPSHOT</version>
-                       <scope>provided</scope>
-               </dependency>
-               <dependency>
-                       <groupId>org.argeo.commons</groupId>
-                       <artifactId>org.argeo.eclipse.ui.rap</artifactId>
-                       <version>2.1.12-SNAPSHOT</version>
-                       <scope>provided</scope>
-               </dependency>
-       </dependencies>
-</project>
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/JcrExplorerConstants.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/JcrExplorerConstants.java
deleted file mode 100644 (file)
index a9cb258..0000000
+++ /dev/null
@@ -1,27 +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.jcr.ui.explorer;
-
-/** Constants used across the application. */
-public interface JcrExplorerConstants {
-       /*
-        * MISCEALLENEOUS
-        */
-       public final static String DATE_TIME_FORMAT = "dd/MM/yyyy, HH:mm";
-
-       public final static String PARAM_PATH = "org.argeo.jcr.ui.explorer.nodePath";
-
-}
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/JcrExplorerPerspective.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/JcrExplorerPerspective.java
deleted file mode 100644 (file)
index 2626415..0000000
+++ /dev/null
@@ -1,41 +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.jcr.ui.explorer;
-
-import org.eclipse.ui.IFolderLayout;
-import org.eclipse.ui.IPageLayout;
-import org.eclipse.ui.IPerspectiveFactory;
-
-/** Base perspective for JcrExplorer browser */
-public class JcrExplorerPerspective implements IPerspectiveFactory {
-       public static String BROWSER_VIEW_ID = JcrExplorerPlugin.ID
-                       + ".browserView";
-
-       public void createInitialLayout(IPageLayout layout) {
-               layout.setEditorAreaVisible(true);
-
-               IFolderLayout upperLeft = layout.createFolder(JcrExplorerPlugin.ID
-                               + ".upperLeft", IPageLayout.LEFT, 0.4f, layout.getEditorArea());
-               upperLeft.addView(BROWSER_VIEW_ID);
-
-//             String editorArea = layout.getEditorArea();
-//             String logViewId = "org.argeo.security.ui.logView";
-//             IFolderLayout bottom = layout.createFolder("bottom",
-//                             IPageLayout.BOTTOM, 0.50f, editorArea);
-//             bottom.addView(logViewId);
-       }
-
-}
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/JcrExplorerPlugin.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/JcrExplorerPlugin.java
deleted file mode 100644 (file)
index 3bf9e7f..0000000
+++ /dev/null
@@ -1,107 +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.jcr.ui.explorer;
-
-import java.util.ResourceBundle;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class JcrExplorerPlugin extends AbstractUIPlugin {
-       private final static Log log = LogFactory.getLog(JcrExplorerPlugin.class);
-       private ResourceBundle messages;
-
-       // The plug-in ID
-       public static final String ID = "org.argeo.jcr.ui.explorer"; //$NON-NLS-1$
-
-       // The shared instance
-       private static JcrExplorerPlugin plugin;
-
-       /**
-        * The constructor
-        */
-       public JcrExplorerPlugin() {
-       }
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see
-        * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
-        * )
-        */
-       public void start(BundleContext context) throws Exception {
-               super.start(context);
-               plugin = this;
-               messages = ResourceBundle
-                               .getBundle("org.argeo.jcr.ui.explorer.messages");
-
-       }
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see
-        * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
-        * )
-        */
-       public void stop(BundleContext context) throws Exception {
-               plugin = null;
-               super.stop(context);
-       }
-
-       /**
-        * Returns the shared instance
-        * 
-        * @return the shared instance
-        */
-       public static JcrExplorerPlugin getDefault() {
-               return plugin;
-       }
-
-       public static ImageDescriptor getImageDescriptor(String path) {
-               return imageDescriptorFromPlugin(ID, path);
-       }
-
-       /** Returns the internationalized label for the given key */
-       public static String getMessage(String key) {
-               try {
-                       return getDefault().messages.getString(key);
-               } catch (NullPointerException npe) {
-                       log.warn(key + " not found.");
-                       return key;
-               }
-       }
-
-       /**
-        * Gives access to the internationalization message bundle. Returns null in
-        * case the ClientUiPlugin is not started (for JUnit tests, by instance)
-        */
-       public static ResourceBundle getMessagesBundle() {
-               if (getDefault() != null)
-                       // To avoid NPE
-                       return getDefault().messages;
-               else
-                       return null;
-       }
-
-}
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/JcrExplorerView.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/JcrExplorerView.java
deleted file mode 100644 (file)
index 01a957a..0000000
+++ /dev/null
@@ -1,22 +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.jcr.ui.explorer;
-
-import org.argeo.jcr.ui.explorer.views.GenericJcrBrowser;
-
-public class JcrExplorerView extends GenericJcrBrowser {
-
-}
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/browser/NodeContentProvider.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/browser/NodeContentProvider.java
deleted file mode 100644 (file)
index fb6bd1a..0000000
+++ /dev/null
@@ -1,197 +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.jcr.ui.explorer.browser;
-
-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.eclipse.ui.TreeParent;
-import org.argeo.jcr.ArgeoJcrConstants;
-import org.argeo.jcr.RepositoryRegister;
-import org.argeo.jcr.UserJcrUtils;
-import org.argeo.jcr.ui.explorer.model.RepositoriesElem;
-import org.argeo.jcr.ui.explorer.model.SingleJcrNodeElem;
-import org.argeo.util.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 {
-       final private RepositoryRegister repositoryRegister;
-       final private RepositoryFactory repositoryFactory;
-       /**
-        * A session of the logged in user on the default workspace of the node
-        * repository.
-        */
-       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 = UserJcrUtils.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(), ArgeoJcrConstants.ALIAS_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) {
-                               // TreeParent[] arr = (TreeParent[]) ((TreeParent)
-                               // parentElement)
-                               // .getChildren();
-                               Object[] tmpArr = ((TreeParent) parentElement).getChildren();
-                               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 spec in BUG :
-        * 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());
-               }
-       }
-}
\ No newline at end of file
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/browser/NodeLabelProvider.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/browser/NodeLabelProvider.java
deleted file mode 100644 (file)
index d6d593c..0000000
+++ /dev/null
@@ -1,86 +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.jcr.ui.explorer.browser;
-
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-import javax.jcr.nodetype.NodeType;
-
-import org.argeo.ArgeoException;
-import org.argeo.eclipse.ui.jcr.DefaultNodeLabelProvider;
-import org.argeo.eclipse.ui.jcr.JcrImages;
-import org.argeo.jcr.ui.explorer.model.RemoteRepositoryElem;
-import org.argeo.jcr.ui.explorer.model.RepositoriesElem;
-import org.argeo.jcr.ui.explorer.model.RepositoryElem;
-import org.argeo.jcr.ui.explorer.model.SingleJcrNodeElem;
-import org.argeo.jcr.ui.explorer.model.WorkspaceElem;
-import org.eclipse.swt.graphics.Image;
-
-public class NodeLabelProvider extends DefaultNodeLabelProvider {
-       // Images
-
-       public String getText(Object element) {
-               try {
-                       if (element instanceof SingleJcrNodeElem) {
-                               SingleJcrNodeElem sjn = (SingleJcrNodeElem) element;
-                               return getText(sjn.getNode());
-                       } else
-                               return super.getText(element);
-               } catch (RepositoryException e) {
-                       throw new ArgeoException(
-                                       "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)
-                       try {
-                               return super.getImage(((SingleJcrNodeElem) element).getNode());
-                       } catch (RepositoryException e) {
-                               return null;
-                       }
-               return super.getImage(element);
-       }
-
-}
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/browser/PropertiesContentProvider.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/browser/PropertiesContentProvider.java
deleted file mode 100644 (file)
index d39f319..0000000
+++ /dev/null
@@ -1,56 +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.jcr.ui.explorer.browser;
-
-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.ArgeoException;
-import org.argeo.eclipse.ui.jcr.utils.JcrItemsComparator;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-
-public class PropertiesContentProvider implements IStructuredContentProvider {
-       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 ArgeoException("Cannot get element for " + inputElement,
-                                       e);
-               }
-       }
-
-}
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/commands/AddFolderNode.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/commands/AddFolderNode.java
deleted file mode 100644 (file)
index 0389aee..0000000
+++ /dev/null
@@ -1,101 +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.jcr.ui.explorer.commands;
-
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-import javax.jcr.nodetype.NodeType;
-
-import org.argeo.eclipse.ui.ErrorFeedback;
-import org.argeo.eclipse.ui.TreeParent;
-import org.argeo.eclipse.ui.dialogs.SingleValue;
-import org.argeo.eclipse.ui.jcr.JcrUiPlugin;
-import org.argeo.jcr.ui.explorer.JcrExplorerPlugin;
-import org.argeo.jcr.ui.explorer.model.SingleJcrNodeElem;
-import org.argeo.jcr.ui.explorer.model.WorkspaceElem;
-import org.argeo.jcr.ui.explorer.views.GenericJcrBrowser;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/**
- * Adds a node of type nt:folder, only on {@link SingleJcrNodeElem} and
- * {@link WorkspaceElem} TreeObject types.
- * 
- * 
- * This handler assumes that a selection provider is available and picks only
- * first selected item. It is UI's job to enable the command only when the
- * selection contains one and only one element. Thus no parameter is passed
- * through the command.
- * 
- * This handler is still 'hard linked' to a GenericJcrBrowser view to enable
- * correct tree refresh when a node is added. This must be corrected in future
- * versions.
- */
-public class AddFolderNode extends AbstractHandler {
-
-       public final static String ID = JcrExplorerPlugin.ID + ".addFolderNode";
-
-       // public final static String DEFAULT_LABEL = JcrExplorerPlugin
-       // .getMessage("addFolderNodeCmdLbl");
-       // public final static String DEFAULT_ICON_REL_PATH = "icons/addRepo.gif";
-
-       public Object execute(ExecutionEvent event) throws ExecutionException {
-
-               ISelection selection = HandlerUtil.getActiveWorkbenchWindow(event)
-                               .getActivePage().getSelection();
-
-               GenericJcrBrowser view = (GenericJcrBrowser) HandlerUtil
-                               .getActiveWorkbenchWindow(event).getActivePage()
-                               .findView(HandlerUtil.getActivePartId(event));
-
-               if (selection != null && !selection.isEmpty()
-                               && selection instanceof IStructuredSelection) {
-                       Object obj = ((IStructuredSelection) selection).getFirstElement();
-                       TreeParent treeParentNode = null;
-                       Node jcrParentNode = null;
-
-                       if (obj instanceof SingleJcrNodeElem) {
-                               treeParentNode = (TreeParent) obj;
-                               jcrParentNode = ((SingleJcrNodeElem) treeParentNode).getNode();
-                       } else if (obj instanceof WorkspaceElem) {
-                               treeParentNode = (TreeParent) obj;
-                               jcrParentNode = ((WorkspaceElem) treeParentNode).getRootNode();
-                       } else
-                               return null;
-
-                       String folderName = SingleValue.ask("Folder name",
-                                       "Enter folder name");
-                       if (folderName != null) {
-                               try {
-                                       jcrParentNode.addNode(folderName, NodeType.NT_FOLDER);
-                                       jcrParentNode.getSession().save();
-                                       view.nodeAdded(treeParentNode);
-                               } catch (RepositoryException e) {
-                                       ErrorFeedback.show("Cannot create folder " + folderName
-                                                       + " under " + treeParentNode, e);
-                               }
-                       }
-               } else {
-                       ErrorFeedback.show(JcrUiPlugin
-                                       .getMessage("errorUnvalidNtFolderNodeType"));
-               }
-               return null;
-       }
-}
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/commands/AddPrivileges.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/commands/AddPrivileges.java
deleted file mode 100644 (file)
index 829290e..0000000
+++ /dev/null
@@ -1,79 +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.jcr.ui.explorer.commands;
-
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-
-import org.argeo.ArgeoException;
-import org.argeo.eclipse.ui.ErrorFeedback;
-import org.argeo.eclipse.ui.TreeParent;
-import org.argeo.jcr.ui.explorer.JcrExplorerPlugin;
-import org.argeo.jcr.ui.explorer.model.SingleJcrNodeElem;
-import org.argeo.jcr.ui.explorer.model.WorkspaceElem;
-import org.argeo.jcr.ui.explorer.wizards.ChangeRightsWizard;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/**
- * Open a dialog to change rights on the selected node.
- */
-
-public class AddPrivileges extends AbstractHandler {
-       public final static String ID = JcrExplorerPlugin.ID + ".addPrivileges";
-
-       public Object execute(ExecutionEvent event) throws ExecutionException {
-
-               ISelection selection = HandlerUtil.getActiveWorkbenchWindow(event)
-                               .getActivePage().getSelection();
-               if (selection != null && !selection.isEmpty()
-                               && selection instanceof IStructuredSelection) {
-                       Object obj = ((IStructuredSelection) selection).getFirstElement();
-                       TreeParent treeParentNode = null;
-                       Node jcrParentNode = null;
-
-                       if (obj instanceof SingleJcrNodeElem) {
-                               treeParentNode = (TreeParent) obj;
-                               jcrParentNode = ((SingleJcrNodeElem) treeParentNode).getNode();
-                       } else if (obj instanceof WorkspaceElem) {
-                               treeParentNode = (TreeParent) obj;
-                               jcrParentNode = ((WorkspaceElem) treeParentNode).getRootNode();
-                       } else
-                               return null;
-
-                       try {
-                               ChangeRightsWizard wizard = new ChangeRightsWizard(
-                                               jcrParentNode.getSession(), jcrParentNode.getPath());
-                               WizardDialog dialog = new WizardDialog(
-                                               HandlerUtil.getActiveShell(event), wizard);
-                               dialog.open();
-                               return null;
-                       } catch (RepositoryException re) {
-                               throw new ArgeoException(
-                                               "Unexpected error while creating the new workspace.",
-                                               re);
-                       }
-               } else {
-                       ErrorFeedback.show("Cannot add privileges");
-               }
-               return null;
-       }
-}
\ No newline at end of file
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/commands/AddRemoteRepository.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/commands/AddRemoteRepository.java
deleted file mode 100644 (file)
index e41edfc..0000000
+++ /dev/null
@@ -1,230 +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.jcr.ui.explorer.commands;
-
-import java.net.URI;
-import java.util.Hashtable;
-
-import javax.jcr.Node;
-import javax.jcr.Repository;
-import javax.jcr.RepositoryFactory;
-import javax.jcr.Session;
-import javax.jcr.SimpleCredentials;
-
-import org.argeo.ArgeoException;
-import org.argeo.eclipse.ui.ErrorFeedback;
-import org.argeo.eclipse.ui.utils.CommandUtils;
-import org.argeo.jcr.ArgeoJcrConstants;
-import org.argeo.jcr.ArgeoNames;
-import org.argeo.jcr.ArgeoTypes;
-import org.argeo.jcr.JcrUtils;
-import org.argeo.jcr.UserJcrUtils;
-import org.argeo.jcr.ui.explorer.JcrExplorerConstants;
-import org.argeo.util.security.Keyring;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.dialogs.TitleAreaDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Connect to a remote repository and, if successful publish it as an OSGi
- * service.
- */
-public class AddRemoteRepository extends AbstractHandler implements
-               JcrExplorerConstants, ArgeoNames {
-
-       private RepositoryFactory repositoryFactory;
-       private Repository nodeRepository;
-       private Keyring keyring;
-
-       public Object execute(ExecutionEvent event) throws ExecutionException {
-               RemoteRepositoryLoginDialog dlg = new RemoteRepositoryLoginDialog(
-                               Display.getDefault().getActiveShell());
-               if (dlg.open() == Dialog.OK) {
-                       CommandUtils.callCommand(Refresh.ID);
-               }
-               return null;
-       }
-
-       public void setRepositoryFactory(RepositoryFactory repositoryFactory) {
-               this.repositoryFactory = repositoryFactory;
-       }
-
-       public void setKeyring(Keyring keyring) {
-               this.keyring = keyring;
-       }
-
-       public void setNodeRepository(Repository nodeRepository) {
-               this.nodeRepository = nodeRepository;
-       }
-
-       class RemoteRepositoryLoginDialog extends TitleAreaDialog {
-               private Text name;
-               private Text uri;
-               private Text username;
-               private Text password;
-               private Button saveInKeyring;
-
-               public RemoteRepositoryLoginDialog(Shell parentShell) {
-                       super(parentShell);
-               }
-
-               protected Point getInitialSize() {
-                       return new Point(600, 400);
-               }
-
-               protected Control createDialogArea(Composite parent) {
-                       Composite dialogarea = (Composite) super.createDialogArea(parent);
-                       dialogarea.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true,
-                                       true));
-                       Composite composite = new Composite(dialogarea, SWT.NONE);
-                       composite.setLayout(new GridLayout(2, false));
-                       composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true,
-                                       false));
-                       setMessage("Login to remote repository", IMessageProvider.NONE);
-                       name = createLT(composite, "Name", "remoteRepository");
-                       uri = createLT(composite, "URI",
-                                       "http://localhost:7070/data/jcr/node");
-                       username = createLT(composite, "User", "");
-                       password = createLP(composite, "Password");
-
-                       saveInKeyring = createLC(composite, "Remember password", false);
-                       parent.pack();
-                       return composite;
-               }
-
-               @Override
-               protected void createButtonsForButtonBar(Composite parent) {
-                       super.createButtonsForButtonBar(parent);
-                       Button test = createButton(parent, 2, "Test", false);
-                       test.addSelectionListener(new SelectionAdapter() {
-                               public void widgetSelected(SelectionEvent arg0) {
-                                       testConnection();
-                               }
-                       });
-               }
-
-               void testConnection() {
-                       Session session = null;
-                       try {
-                               URI checkedUri = new URI(uri.getText());
-                               String checkedUriStr = checkedUri.toString();
-
-                               Hashtable<String, String> params = new Hashtable<String, String>();
-                               params.put(ArgeoJcrConstants.JCR_REPOSITORY_URI, checkedUriStr);
-                               Repository repository = repositoryFactory.getRepository(params);
-                               if (username.getText().trim().equals("")) {// anonymous
-                                       session = repository.login();
-                               } else {
-                                       // FIXME use getTextChars() when upgrading to 3.7
-                                       // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=297412
-                                       char[] pwd = password.getText().toCharArray();
-                                       SimpleCredentials sc = new SimpleCredentials(
-                                                       username.getText(), pwd);
-                                       session = repository.login(sc);
-                                       MessageDialog.openInformation(getParentShell(), "Success",
-                                                       "Connection to '" + uri.getText() + "' successful");
-                               }
-                       } catch (Exception e) {
-                               ErrorFeedback.show(
-                                               "Connection test failed for " + uri.getText(), e);
-                       } finally {
-                               JcrUtils.logoutQuietly(session);
-                       }
-               }
-
-               @Override
-               protected void okPressed() {
-                       Session nodeSession = null;
-                       try {
-                               nodeSession = nodeRepository.login();
-                               Node home = UserJcrUtils.getUserHome(nodeSession);
-
-                               Node remote = home.hasNode(ARGEO_REMOTE) ? home
-                                               .getNode(ARGEO_REMOTE) : home.addNode(ARGEO_REMOTE);
-                               if (remote.hasNode(name.getText()))
-                                       throw new ArgeoException(
-                                                       "There is already a remote repository named "
-                                                                       + name.getText());
-                               Node remoteRepository = remote.addNode(name.getText(),
-                                               ArgeoTypes.ARGEO_REMOTE_REPOSITORY);
-                               remoteRepository.setProperty(ARGEO_URI, uri.getText());
-                               remoteRepository.setProperty(ARGEO_USER_ID, username.getText());
-                               nodeSession.save();
-                               if (saveInKeyring.getSelection()) {
-                                       String pwdPath = remoteRepository.getPath() + '/'
-                                                       + ARGEO_PASSWORD;
-                                       keyring.set(pwdPath, password.getText().toCharArray());
-                               }
-                               nodeSession.save();
-                               MessageDialog.openInformation(
-                                               getParentShell(),
-                                               "Repository Added",
-                                               "Remote repository '" + username.getText() + "@"
-                                                               + uri.getText() + "' added");
-
-                               super.okPressed();
-                       } catch (Exception e) {
-                               ErrorFeedback.show("Cannot add remote repository", e);
-                       } finally {
-                               JcrUtils.logoutQuietly(nodeSession);
-                       }
-               }
-
-               /** Creates label and text. */
-               protected Text createLT(Composite parent, String label, String initial) {
-                       new Label(parent, SWT.NONE).setText(label);
-                       Text text = new Text(parent, SWT.SINGLE | SWT.LEAD | SWT.BORDER);
-                       text.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-                       text.setText(initial);
-                       return text;
-               }
-
-               /** Creates label and check. */
-               protected Button createLC(Composite parent, String label,
-                               Boolean initial) {
-                       new Label(parent, SWT.NONE).setText(label);
-                       Button check = new Button(parent, SWT.CHECK);
-                       check.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-                       check.setSelection(initial);
-                       return check;
-               }
-
-               protected Text createLP(Composite parent, String label) {
-                       new Label(parent, SWT.NONE).setText(label);
-                       Text text = new Text(parent, SWT.SINGLE | SWT.LEAD | SWT.BORDER
-                                       | SWT.PASSWORD);
-                       text.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-                       return text;
-               }
-       }
-}
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/commands/CreateWorkspace.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/commands/CreateWorkspace.java
deleted file mode 100644 (file)
index e579630..0000000
+++ /dev/null
@@ -1,70 +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.jcr.ui.explorer.commands;
-
-import java.util.Arrays;
-
-import org.argeo.eclipse.ui.ErrorFeedback;
-import org.argeo.eclipse.ui.dialogs.SingleValue;
-import org.argeo.jcr.ui.explorer.JcrExplorerPlugin;
-import org.argeo.jcr.ui.explorer.model.RepositoryElem;
-import org.argeo.jcr.ui.explorer.views.GenericJcrBrowser;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/** Creates a new JCR workspace */
-public class CreateWorkspace extends AbstractHandler {
-
-       public final static String ID = JcrExplorerPlugin.ID + ".addFolderNode";
-
-       public Object execute(ExecutionEvent event) throws ExecutionException {
-
-               ISelection selection = HandlerUtil.getActiveWorkbenchWindow(event)
-                               .getActivePage().getSelection();
-
-               GenericJcrBrowser view = (GenericJcrBrowser) HandlerUtil
-                               .getActiveWorkbenchWindow(event).getActivePage()
-                               .findView(HandlerUtil.getActivePartId(event));
-
-               if (selection != null && !selection.isEmpty()
-                               && selection instanceof IStructuredSelection) {
-                       Object obj = ((IStructuredSelection) selection).getFirstElement();
-                       if (!(obj instanceof RepositoryElem))
-                               return null;
-
-                       RepositoryElem repositoryNode = (RepositoryElem) obj;
-                       String workspaceName = SingleValue.ask("Workspace name",
-                                       "Enter workspace name");
-                       if (workspaceName != null) {
-                               if (Arrays.asList(repositoryNode.getAccessibleWorkspaceNames())
-                                               .contains(workspaceName)) {
-                                       ErrorFeedback.show("Workspace " + workspaceName
-                                                       + " already exists.");
-                               } else {
-                                       repositoryNode.createWorkspace(workspaceName);
-                                       view.nodeAdded(repositoryNode);
-                               }
-                       }
-               } else {
-                       ErrorFeedback.show("Cannot create workspace");
-               }
-               return null;
-       }
-}
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/commands/DeleteNodes.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/commands/DeleteNodes.java
deleted file mode 100644 (file)
index 26d4cdd..0000000
+++ /dev/null
@@ -1,118 +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.jcr.ui.explorer.commands;
-
-import java.util.Iterator;
-
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-
-import org.argeo.ArgeoException;
-import org.argeo.eclipse.ui.ErrorFeedback;
-import org.argeo.eclipse.ui.TreeParent;
-import org.argeo.jcr.ui.explorer.model.SingleJcrNodeElem;
-import org.argeo.jcr.ui.explorer.model.WorkspaceElem;
-import org.argeo.jcr.ui.explorer.views.GenericJcrBrowser;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/**
- * Deletes the selected nodes: both in the JCR repository and in the UI view.
- * Warning no check is done, except implementation dependent native checks,
- * handle with care.
- * 
- * This handler is still 'hard linked' to a GenericJcrBrowser view to enable
- * correct tree refresh when a node is added. This must be corrected in future
- * versions.
- */
-public class DeleteNodes extends AbstractHandler {
-       public Object execute(ExecutionEvent event) throws ExecutionException {
-               ISelection selection = HandlerUtil.getActiveWorkbenchWindow(event)
-                               .getActivePage().getSelection();
-               if (selection == null || !(selection instanceof IStructuredSelection))
-                       return null;
-
-               GenericJcrBrowser view = (GenericJcrBrowser) HandlerUtil
-                               .getActiveWorkbenchWindow(event).getActivePage()
-                               .findView(HandlerUtil.getActivePartId(event));
-
-               // confirmation
-               StringBuffer buf = new StringBuffer("");
-               Iterator<?> lst = ((IStructuredSelection) selection).iterator();
-               while (lst.hasNext()) {
-                       SingleJcrNodeElem sjn = ((SingleJcrNodeElem) lst.next());
-                       buf.append(sjn.getName()).append(' ');
-               }
-               Boolean ok = MessageDialog.openConfirm(
-                               HandlerUtil.getActiveShell(event), "Confirm deletion",
-                               "Do you want to delete " + buf + "?");
-
-               // operation
-               if (ok) {
-                       Iterator<?> it = ((IStructuredSelection) selection).iterator();
-                       Object obj = null;
-                       SingleJcrNodeElem ancestor = null;
-                       WorkspaceElem rootAncestor = null;
-                       try {
-                               while (it.hasNext()) {
-                                       obj = it.next();
-                                       if (obj instanceof SingleJcrNodeElem) {
-                                               // Cache objects
-                                               SingleJcrNodeElem sjn = (SingleJcrNodeElem) obj;
-                                               TreeParent tp = (TreeParent) sjn.getParent();
-                                               Node node = sjn.getNode();
-
-                                               // Jcr Remove
-                                               node.remove();
-                                               node.getSession().save();
-                                               // UI remove
-                                               tp.removeChild(sjn);
-
-                                               // Check if the parent is the root node
-                                               if (tp instanceof WorkspaceElem)
-                                                       rootAncestor = (WorkspaceElem) tp;
-                                               else
-                                                       ancestor = getOlder(ancestor, (SingleJcrNodeElem) tp);
-                                       }
-                               }
-                               if (rootAncestor != null)
-                                       view.nodeRemoved(rootAncestor);
-                               else if (ancestor != null)
-                                       view.nodeRemoved(ancestor);
-                       } catch (Exception e) {
-                               ErrorFeedback.show("Cannot delete selected node ", e);
-                       }
-               }
-               return null;
-       }
-
-       private SingleJcrNodeElem getOlder(SingleJcrNodeElem A, SingleJcrNodeElem B) {
-               try {
-                       if (A == null)
-                               return B == null ? null : B;
-                       // Todo enhanced this method
-                       else
-                               return A.getNode().getDepth() <= B.getNode().getDepth() ? A : B;
-               } catch (RepositoryException re) {
-                       throw new ArgeoException("Cannot find ancestor", re);
-               }
-       }
-}
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/commands/DumpNode.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/commands/DumpNode.java
deleted file mode 100644 (file)
index c8a235d..0000000
+++ /dev/null
@@ -1,110 +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.jcr.ui.explorer.commands;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.GregorianCalendar;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-
-import org.argeo.ArgeoException;
-import org.argeo.eclipse.ui.specific.OpenFile;
-import org.argeo.eclipse.ui.utils.CommandUtils;
-import org.argeo.jcr.JcrUtils;
-import org.argeo.jcr.ui.explorer.JcrExplorerPlugin;
-import org.argeo.jcr.ui.explorer.model.SingleJcrNodeElem;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/**
- * If the method
- * <code> HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getSelection() </code>
- * exits and has a SingleJcrNodeElem as first element, it canonically calls the
- * JCR Session.exportSystemView() method on the underlying node with both
- * skipBinary & noRecurse boolean flags set to false.
- * 
- * Resulting stream is saved in a tmp file and opened via the "open file"
- * single-sourced command.
- */
-public class DumpNode extends AbstractHandler {
-       public final static String ID = JcrExplorerPlugin.ID + ".dumpNode";
-
-       private final static DateFormat df = new SimpleDateFormat(
-                       "yyyy-MM-dd_HH-mm");
-
-       public Object execute(ExecutionEvent event) throws ExecutionException {
-               ISelection selection = HandlerUtil.getActiveWorkbenchWindow(event)
-                               .getActivePage().getSelection();
-               if (selection == null || !(selection instanceof IStructuredSelection))
-                       return null;
-
-               Iterator<?> lst = ((IStructuredSelection) selection).iterator();
-               if (lst.hasNext()) {
-                       Object element = lst.next();
-                       if (element instanceof SingleJcrNodeElem) {
-                               SingleJcrNodeElem sjn = (SingleJcrNodeElem) element;
-                               Node node = sjn.getNode();
-
-                               // TODO add a dialog to configure the export and ask for
-                               // confirmation
-                               // Boolean ok = MessageDialog.openConfirm(
-                               // HandlerUtil.getActiveShell(event), "Confirm deletion",
-                               // "Do you want to delete " + buf + "?");
-
-                               File tmpFile;
-                               FileOutputStream fos;
-                               try {
-                                       tmpFile = File.createTempFile("JcrExport", ".xml");
-                                       tmpFile.deleteOnExit();
-                                       fos = new FileOutputStream(tmpFile);
-                                       String dateVal = df.format(new GregorianCalendar()
-                                                       .getTime());
-                                       node.getSession().exportSystemView(node.getPath(), fos,
-                                                       true, false);
-                                       openGeneratedFile(tmpFile.getAbsolutePath(),
-                                                       "Dump-" + JcrUtils.replaceInvalidChars(node.getName())+ "-" + dateVal + ".xml");
-                               } catch (RepositoryException e) {
-                                       throw new ArgeoException(
-                                                       "Unable to perform SystemExport on " + node, e);
-                               } catch (IOException e) {
-                                       throw new ArgeoException("Unable to SystemExport " + node,
-                                                       e);
-                               }
-                       }
-               }
-               return null;
-       }
-
-       private synchronized void openGeneratedFile(String path, String fileName) {
-               Map<String, String> params = new HashMap<String, String>();
-               params.put(OpenFile.PARAM_FILE_NAME, fileName);
-               params.put(OpenFile.PARAM_FILE_URI, "file://" + path);
-               CommandUtils.callCommand("org.argeo.security.ui.specific.openFile",
-                               params);
-       }
-}
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/commands/EditNode.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/commands/EditNode.java
deleted file mode 100644 (file)
index e98973e..0000000
+++ /dev/null
@@ -1,69 +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.jcr.ui.explorer.commands;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.jcr.Property;
-import javax.jcr.nodetype.NodeType;
-
-import org.argeo.eclipse.ui.ErrorFeedback;
-import org.argeo.eclipse.ui.jcr.editors.NodeEditorInput;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/** Generic command to open a path in an editor. */
-public class EditNode extends AbstractHandler {
-       public final static String EDITOR_PARAM = "editor";
-
-       private String defaultEditorId;
-
-       private Map<String, String> nodeTypeToEditor = new HashMap<String, String>();
-
-       public Object execute(ExecutionEvent event) throws ExecutionException {
-               String path = event.getParameter(Property.JCR_PATH);
-
-               String type = event.getParameter(NodeType.NT_NODE_TYPE);
-               if (type == null)
-                       type = NodeType.NT_UNSTRUCTURED;
-
-               String editorId = event.getParameter(NodeType.NT_NODE_TYPE);
-               if (editorId == null)
-                       editorId = nodeTypeToEditor.containsKey(type) ? nodeTypeToEditor
-                                       .get(type) : defaultEditorId;
-                                       
-               NodeEditorInput nei = new NodeEditorInput(path);
-
-               try {
-                       HandlerUtil.getActiveWorkbenchWindow(event).getActivePage()
-                                       .openEditor(nei, editorId);
-               } catch (PartInitException e) {
-                       ErrorFeedback.show("Cannot open " + editorId + " with " + path
-                                       + " of type " + type, e);
-               }
-               // TODO Auto-generated method stub
-               return null;
-       }
-
-       public void setDefaultEditorId(String defaultEditorId) {
-               this.defaultEditorId = defaultEditorId;
-       }
-
-}
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/commands/GetNodeSize.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/commands/GetNodeSize.java
deleted file mode 100644 (file)
index cfcac13..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.jcr.ui.explorer.commands;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.jcr.Node;
-
-import org.argeo.eclipse.ui.ErrorFeedback;
-import org.argeo.jcr.JcrUtils;
-import org.argeo.jcr.ui.explorer.JcrExplorerPlugin;
-import org.argeo.jcr.ui.explorer.model.SingleJcrNodeElem;
-import org.argeo.jcr.ui.explorer.model.WorkspaceElem;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/** Opens the generic node editor. */
-public class GetNodeSize extends AbstractHandler {
-       // private final static Log log = LogFactory.getLog(GetNodeSize.class);
-
-       public final static String ID = JcrExplorerPlugin.ID + ".getNodeSize";
-
-       // public final static String DEFAULT_ICON_REL_PATH = "icons/getSize.gif";
-       // public final static String DEFAULT_LABEL = JcrExplorerPlugin
-       // .getMessage("getNodeSizeCmdLbl");
-
-       public Object execute(ExecutionEvent event) throws ExecutionException {
-               // JcrUtils.getRepositoryByAlias(repositoryRegister,
-               // ArgeoJcrConstants.ALIAS_NODE);
-
-               ISelection selection = HandlerUtil.getActiveWorkbenchWindow(event)
-                               .getActivePage().getSelection();
-
-               if (selection != null && !selection.isEmpty()
-                               && selection instanceof IStructuredSelection) {
-
-                       // IStructuredSelection iss = (IStructuredSelection) selection;
-                       // if (iss.size() > 1)
-                       // ErrorFeedback.show(JcrExplorerPlugin
-                       // .getMessage("warningInvalidMultipleSelection"), null);
-
-                       long size = 0;
-
-                       Iterator<?> it = ((IStructuredSelection) selection).iterator();
-
-                       // as the size method is recursive, we keep track of nodes for which
-                       // we already have computed size so that we don't count them twice.
-                       // In a first approximation, we assume that the structure selection
-                       // keep the nodes ordered.
-                       // TODO : enhance that.
-                       List<String> importedPathes = new ArrayList<String>();
-                       try {
-                               nodesIt: while (it.hasNext()) {
-                                       Object obj = it.next();
-                                       String curPath;
-                                       Node node;
-                                       if (obj instanceof SingleJcrNodeElem) {
-                                               node = ((SingleJcrNodeElem) obj).getNode();
-                                               curPath = node.getSession().getWorkspace().getName();
-                                               curPath += "/" + node.getPath();
-                                       } else if (obj instanceof WorkspaceElem) {
-                                               node = ((WorkspaceElem) obj).getRootNode();
-                                               curPath = node.getSession().getWorkspace().getName();
-                                       } else
-                                               // unvalid object type
-                                               continue nodesIt;
-
-                                       Iterator<String> itPath = importedPathes.iterator();
-                                       while (itPath.hasNext()) {
-                                               String refPath = itPath.next();
-                                               if (curPath.startsWith(refPath))
-                                                       // Already done : skip node
-                                                       continue nodesIt;
-                                       }
-                                       size += JcrUtils.getNodeApproxSize(node);
-                                       importedPathes.add(curPath);
-                               }
-                       } catch (Exception e) {
-                               ErrorFeedback.show("Cannot Get size of selected node ", e);
-                       }
-
-                       String[] labels = { "OK" };
-                       Shell shell = HandlerUtil.getActiveWorkbenchWindow(event)
-                                       .getShell();
-                       MessageDialog md = new MessageDialog(shell, "Node size", null,
-                                       "Node size is: " + size / 1024 + " KB",
-                                       MessageDialog.INFORMATION, labels, 0);
-                       md.open();
-               }
-               return null;
-       }
-}
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/commands/ImportFileSystem.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/commands/ImportFileSystem.java
deleted file mode 100644 (file)
index 5c4bf7e..0000000
+++ /dev/null
@@ -1,70 +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.jcr.ui.explorer.commands;
-
-import javax.jcr.Node;
-
-import org.argeo.eclipse.ui.ErrorFeedback;
-import org.argeo.eclipse.ui.TreeParent;
-import org.argeo.jcr.ui.explorer.JcrExplorerPlugin;
-import org.argeo.jcr.ui.explorer.model.SingleJcrNodeElem;
-import org.argeo.jcr.ui.explorer.model.WorkspaceElem;
-import org.argeo.jcr.ui.explorer.views.GenericJcrBrowser;
-import org.argeo.jcr.ui.explorer.wizards.ImportFileSystemWizard;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/** Import a local file system directory tree. */
-public class ImportFileSystem extends AbstractHandler {
-       public Object execute(ExecutionEvent event) throws ExecutionException {
-               ISelection selection = HandlerUtil.getActiveWorkbenchWindow(event)
-                               .getActivePage().getSelection();
-               GenericJcrBrowser view = (GenericJcrBrowser) HandlerUtil
-                               .getActiveWorkbenchWindow(event).getActivePage()
-                               .findView(HandlerUtil.getActivePartId(event));
-               if (selection != null && !selection.isEmpty()
-                               && selection instanceof IStructuredSelection) {
-                       Object obj = ((IStructuredSelection) selection).getFirstElement();
-                       try {
-                               Node folder = null;
-                               if (obj instanceof SingleJcrNodeElem) {
-                                       folder = ((SingleJcrNodeElem) obj).getNode();
-                               } else if (obj instanceof WorkspaceElem) {
-                                       folder = ((WorkspaceElem) obj).getRootNode();
-                               } else {
-                                       ErrorFeedback.show(JcrExplorerPlugin
-                                                       .getMessage("warningInvalidNodeToImport"));
-                               }
-                               if (folder != null) {
-                                       ImportFileSystemWizard wizard = new ImportFileSystemWizard(
-                                                       folder);
-                                       WizardDialog dialog = new WizardDialog(
-                                                       HandlerUtil.getActiveShell(event), wizard);
-                                       dialog.open();
-                                       view.nodeAdded((TreeParent) obj);
-                               }
-                       } catch (Exception e) {
-                               ErrorFeedback.show("Cannot import files to " + obj, e);
-                       }
-               }
-               return null;
-       }
-}
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/commands/OpenGenericNodeEditor.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/commands/OpenGenericNodeEditor.java
deleted file mode 100644 (file)
index 6799d17..0000000
+++ /dev/null
@@ -1,44 +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.jcr.ui.explorer.commands;
-
-import org.argeo.ArgeoException;
-import org.argeo.eclipse.ui.jcr.editors.NodeEditorInput;
-import org.argeo.jcr.ui.explorer.JcrExplorerConstants;
-import org.argeo.jcr.ui.explorer.JcrExplorerPlugin;
-import org.argeo.jcr.ui.explorer.editors.GenericNodeEditor;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/** Opens the generic node editor. */
-public class OpenGenericNodeEditor extends AbstractHandler {
-       public final static String ID = JcrExplorerPlugin.ID + ".openGenericNodeEditor";
-
-       public Object execute(ExecutionEvent event) throws ExecutionException {
-               String path = event.getParameter(JcrExplorerConstants.PARAM_PATH);
-               try {
-                       NodeEditorInput nei = new NodeEditorInput(path);
-                       HandlerUtil.getActiveWorkbenchWindow(event).getActivePage()
-                                       .openEditor(nei, GenericNodeEditor.ID);
-               } catch (Exception e) {
-                       throw new ArgeoException("Cannot open editor", e);
-               }
-               return null;
-       }
-
-}
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/commands/Refresh.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/commands/Refresh.java
deleted file mode 100644 (file)
index 21ce256..0000000
+++ /dev/null
@@ -1,68 +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.jcr.ui.explorer.commands;
-
-import java.util.Iterator;
-
-import org.argeo.eclipse.ui.TreeParent;
-import org.argeo.eclipse.ui.jcr.views.AbstractJcrBrowser;
-import org.argeo.jcr.ui.explorer.JcrExplorerPlugin;
-import org.argeo.jcr.ui.explorer.utils.JcrUiUtils;
-import org.argeo.jcr.ui.explorer.views.GenericJcrBrowser;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-
-/**
- * Force the selected objects of the active view to be refreshed doing the
- * following:
- * <ol>
- * <li>The model objects are recomputed</li>
- * <li>the view is refreshed</li>
- * </ol>
- */
-public class Refresh extends AbstractHandler {
-
-       public final static String ID = JcrExplorerPlugin.ID + ".refresh";
-
-       public Object execute(ExecutionEvent event) throws ExecutionException {
-
-               AbstractJcrBrowser view = (AbstractJcrBrowser) JcrExplorerPlugin
-                               .getDefault().getWorkbench().getActiveWorkbenchWindow()
-                               .getActivePage().getActivePart();//
-
-               ISelection selection = JcrExplorerPlugin.getDefault().getWorkbench()
-                               .getActiveWorkbenchWindow().getActivePage().getSelection();
-
-               if (selection != null && selection instanceof IStructuredSelection
-                               && !selection.isEmpty()) {
-                       Iterator<?> it = ((IStructuredSelection) selection).iterator();
-                       while (it.hasNext()) {
-                               Object obj = it.next();
-                               if (obj instanceof TreeParent) {
-                                       TreeParent tp = (TreeParent) obj;
-                                       JcrUiUtils.forceRefreshIfNeeded(tp);
-                                       view.refresh(obj);
-                               }
-                       }
-               } else if (view instanceof GenericJcrBrowser)
-                       ((GenericJcrBrowser) view).refresh(null); // force full refresh
-
-               return null;
-       }
-}
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/commands/RemoveRemoteRepository.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/commands/RemoveRemoteRepository.java
deleted file mode 100644 (file)
index ec23dd0..0000000
+++ /dev/null
@@ -1,51 +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.jcr.ui.explorer.commands;
-
-import org.argeo.jcr.ui.explorer.model.RemoteRepositoryElem;
-import org.argeo.jcr.ui.explorer.views.GenericJcrBrowser;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/** Remove a registered remote repository */
-public class RemoveRemoteRepository extends AbstractHandler {
-
-       public Object execute(ExecutionEvent event) throws ExecutionException {
-
-               ISelection selection = HandlerUtil.getActiveWorkbenchWindow(event)
-                               .getActivePage().getSelection();
-
-               GenericJcrBrowser view = (GenericJcrBrowser) HandlerUtil
-                               .getActiveWorkbenchWindow(event).getActivePage()
-                               .findView(HandlerUtil.getActivePartId(event));
-
-               if (selection != null && !selection.isEmpty()
-                               && selection instanceof IStructuredSelection) {
-                       Object obj = ((IStructuredSelection) selection).getFirstElement();
-
-                       if (obj instanceof RemoteRepositoryElem) {
-                               ((RemoteRepositoryElem) obj).remove();
-                               view.refresh(null);
-                       }
-               }
-               return null;
-       }
-
-}
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/commands/SortChildNodes.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/commands/SortChildNodes.java
deleted file mode 100644 (file)
index 2961529..0000000
+++ /dev/null
@@ -1,50 +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.jcr.ui.explorer.commands;
-
-import org.argeo.jcr.ui.explorer.JcrExplorerPlugin;
-import org.argeo.jcr.ui.explorer.views.GenericJcrBrowser;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.Command;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.State;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.commands.ICommandService;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/**
- * Change isSorted state of the JcrExplorer Browser
- */
-public class SortChildNodes extends AbstractHandler {
-       public final static String ID = JcrExplorerPlugin.ID + ".sortChildNodes";
-
-       public Object execute(ExecutionEvent event) throws ExecutionException {
-               GenericJcrBrowser view = (GenericJcrBrowser) HandlerUtil
-                               .getActiveWorkbenchWindow(event).getActivePage()
-                               .findView(GenericJcrBrowser.ID);
-
-               ICommandService service = (ICommandService) PlatformUI.getWorkbench()
-                               .getService(ICommandService.class);
-               Command command = service.getCommand(ID);
-               State state = command.getState(ID + ".toggleState");
-
-               boolean wasSorted = (Boolean) state.getValue();
-               view.setSortChildNodes(!wasSorted);
-               state.setValue(!wasSorted);
-               return null;
-       }
-}
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/dialogs/ChooseNameDialog.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/dialogs/ChooseNameDialog.java
deleted file mode 100644 (file)
index d4a5cc7..0000000
+++ /dev/null
@@ -1,67 +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.jcr.ui.explorer.dialogs;
-
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.jface.dialogs.TitleAreaDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/** Dialog to change the current user password */
-public class ChooseNameDialog extends TitleAreaDialog {
-       private Text nameT;
-
-       public ChooseNameDialog(Shell parentShell) {
-               super(parentShell);
-               setTitle("Choose name");
-       }
-
-       protected Point getInitialSize() {
-               return new Point(300, 250);
-       }
-
-       protected Control createDialogArea(Composite parent) {
-               Composite dialogarea = (Composite) super.createDialogArea(parent);
-               dialogarea.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-               Composite composite = new Composite(dialogarea, SWT.NONE);
-               composite.setLayout(new GridLayout(2, false));
-               composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
-               nameT = createLT(composite, "Name");
-
-               setMessage("Choose name", IMessageProvider.INFORMATION);
-               parent.pack();
-               return composite;
-       }
-
-       /** Creates label and text. */
-       protected Text createLT(Composite parent, String label) {
-               new Label(parent, SWT.NONE).setText(label);
-               Text text = new Text(parent, SWT.SINGLE | SWT.LEAD | SWT.BORDER);
-               text.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
-               return text;
-       }
-
-       public String getName() {
-               return nameT.getText();
-       }
-}
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/editors/ChildNodesPage.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/editors/ChildNodesPage.java
deleted file mode 100644 (file)
index 682254a..0000000
+++ /dev/null
@@ -1,93 +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.jcr.ui.explorer.editors;
-
-import javax.jcr.Node;
-
-import org.argeo.ArgeoException;
-import org.argeo.jcr.ui.explorer.JcrExplorerPlugin;
-import org.argeo.jcr.ui.explorer.browser.NodeLabelProvider;
-import org.argeo.jcr.ui.explorer.providers.SingleNodeAsTreeContentProvider;
-import org.argeo.jcr.ui.explorer.utils.GenericNodeDoubleClickListener;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.forms.IManagedForm;
-import org.eclipse.ui.forms.editor.FormEditor;
-import org.eclipse.ui.forms.editor.FormPage;
-import org.eclipse.ui.forms.widgets.ScrolledForm;
-
-/**
- * List all childs of the current node and brings some browsing capabilities
- * accross the repository
- */
-public class ChildNodesPage extends FormPage {
-       // private final static Log log = LogFactory.getLog(ChildNodesPage.class);
-
-       // business objects
-       private Node currentNode;
-
-       // this page UI components
-       private SingleNodeAsTreeContentProvider nodeContentProvider;
-       private TreeViewer nodesViewer;
-
-       public ChildNodesPage(FormEditor editor, String title, Node currentNode) {
-               super(editor, "ChildNodesPage", title);
-               this.currentNode = currentNode;
-       }
-
-       protected void createFormContent(IManagedForm managedForm) {
-               try {
-                       ScrolledForm form = managedForm.getForm();
-                       form.setText(JcrExplorerPlugin.getMessage("childNodesPageTitle"));
-                       Composite body = form.getBody();
-                       GridLayout twt = new GridLayout(1, false);
-                       twt.marginWidth = twt.marginHeight = 5;
-                       body.setLayout(twt);
-                       if (!currentNode.hasNodes()) {
-                               managedForm.getToolkit().createLabel(body,
-                                               JcrExplorerPlugin.getMessage("warningNoChildNode"));
-                       } else {
-
-                               nodeContentProvider = new SingleNodeAsTreeContentProvider();
-                               nodesViewer = createNodeViewer(body, nodeContentProvider);
-                               nodesViewer.setInput(currentNode);
-                       }
-               } catch (Exception e) {
-                       throw new ArgeoException(
-                                       "Unexpected error while creating child node page", e);
-               }
-       }
-
-       protected TreeViewer createNodeViewer(Composite parent,
-                       final ITreeContentProvider nodeContentProvider) {
-
-               final TreeViewer tmpNodeViewer = new TreeViewer(parent, SWT.MULTI);
-
-               tmpNodeViewer.getTree().setLayoutData(
-                               new GridData(SWT.FILL, SWT.FILL, true, true));
-
-               tmpNodeViewer.setContentProvider(nodeContentProvider);
-               tmpNodeViewer.setLabelProvider(new NodeLabelProvider());
-               tmpNodeViewer
-                               .addDoubleClickListener(new GenericNodeDoubleClickListener(
-                                               tmpNodeViewer));
-               return tmpNodeViewer;
-       }
-}
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/editors/EmptyNodePage.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/editors/EmptyNodePage.java
deleted file mode 100644 (file)
index 322c7eb..0000000
+++ /dev/null
@@ -1,49 +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.jcr.ui.explorer.editors;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.forms.IManagedForm;
-import org.eclipse.ui.forms.editor.FormEditor;
-import org.eclipse.ui.forms.editor.FormPage;
-import org.eclipse.ui.forms.widgets.ScrolledForm;
-
-/**
- * This page is only used at editor's creation time when current node has not
- * yet been set
- */
-public class EmptyNodePage extends FormPage {
-       // private final static Log log = LogFactory.getLog(EmptyNodePage.class);
-
-       public EmptyNodePage(FormEditor editor, String title) {
-               super(editor, "Empty Page", title);
-       }
-
-       protected void createFormContent(IManagedForm managedForm) {
-               try {
-                       ScrolledForm form = managedForm.getForm();
-                       GridLayout twt = new GridLayout(1, false);
-                       twt.marginWidth = twt.marginHeight = 0;
-                       form.getBody().setLayout(twt);
-                       Label lbl = new Label(form.getBody(), SWT.NONE);
-                       lbl.setText("Empty page");
-               } catch (Exception e) {
-                       e.printStackTrace();
-               }
-       }
-}
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/editors/GenericJcrQueryEditor.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/editors/GenericJcrQueryEditor.java
deleted file mode 100644 (file)
index 3b98ed1..0000000
+++ /dev/null
@@ -1,60 +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.jcr.ui.explorer.editors;
-
-import org.argeo.eclipse.ui.jcr.editors.AbstractJcrQueryEditor;
-import org.argeo.jcr.ui.explorer.JcrExplorerPlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Text;
-
-/** Enables end user to type and execute any JCR query. */
-public class GenericJcrQueryEditor extends AbstractJcrQueryEditor {
-       public final static String ID = JcrExplorerPlugin.ID + ".genericJcrQueryEditor";
-
-       private Text queryField;
-
-       @Override
-       public void createQueryForm(Composite parent) {
-               parent.setLayout(new GridLayout(1, false));
-
-               queryField = new Text(parent, SWT.BORDER | SWT.MULTI | SWT.WRAP);
-               queryField.setText(initialQuery);
-               queryField.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-
-               Button execute = new Button(parent, SWT.PUSH);
-               execute.setText("Execute");
-
-               Listener executeListener = new Listener() {
-                       public void handleEvent(Event event) {
-                               executeQuery(queryField.getText());
-                       }
-               };
-
-               execute.addListener(SWT.Selection, executeListener);
-               // queryField.addListener(SWT.DefaultSelection, executeListener);
-       }
-
-       @Override
-       public void setFocus() {
-               queryField.setFocus();
-       }
-}
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/editors/GenericNodeEditor.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/editors/GenericNodeEditor.java
deleted file mode 100644 (file)
index 57f3aa2..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.jcr.ui.explorer.editors;
-
-import javax.jcr.Node;
-
-import org.argeo.ArgeoException;
-import org.argeo.jcr.JcrUtils;
-import org.argeo.jcr.ui.explorer.JcrExplorerPlugin;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.forms.editor.FormEditor;
-
-/**
- * Container for the node editor page. At creation time, it takes a JCR Node
- * that cannot be changed afterwards.
- */
-public class GenericNodeEditor extends FormEditor {
-
-       // private final static Log log =
-       // LogFactory.getLog(GenericNodeEditor.class);
-       public final static String ID = JcrExplorerPlugin.ID + ".genericNodeEditor";
-
-       private Node currentNode;
-
-       private GenericPropertyPage genericPropertyPage;
-       private ChildNodesPage childNodesPage;
-       private NodeRightsManagementPage nodeRightsManagementPage;
-       private NodeVersionHistoryPage nodeVersionHistoryPage;
-
-       public void init(IEditorSite site, IEditorInput input)
-                       throws PartInitException {
-               super.init(site, input);
-               GenericNodeEditorInput nei = (GenericNodeEditorInput) getEditorInput();
-               currentNode = nei.getCurrentNode();
-               this.setPartName(JcrUtils.lastPathElement(nei.getPath()));
-       }
-
-       @Override
-       protected void addPages() {
-               try {
-                       // genericNodePage = new GenericNodePage(this,
-                       // JcrExplorerPlugin.getMessage("genericNodePageTitle"),
-                       // currentNode);
-                       // addPage(genericNodePage);
-
-                       genericPropertyPage = new GenericPropertyPage(this,
-                                       JcrExplorerPlugin.getMessage("genericNodePageTitle"),
-                                       currentNode);
-                       addPage(genericPropertyPage);
-
-                       childNodesPage = new ChildNodesPage(this,
-                                       JcrExplorerPlugin.getMessage("childNodesPageTitle"),
-                                       currentNode);
-                       addPage(childNodesPage);
-
-                       nodeRightsManagementPage = new NodeRightsManagementPage(this,
-                                       JcrExplorerPlugin
-                                                       .getMessage("nodeRightsManagementPageTitle"),
-                                       currentNode);
-                       addPage(nodeRightsManagementPage);
-
-                       nodeVersionHistoryPage = new NodeVersionHistoryPage(
-                                       this,
-                                       JcrExplorerPlugin.getMessage("nodeVersionHistoryPageTitle"),
-                                       currentNode);
-                       addPage(nodeVersionHistoryPage);
-               } catch (PartInitException e) {
-                       throw new ArgeoException("Not able to add an empty page ", e);
-               }
-       }
-
-       @Override
-       public void doSaveAs() {
-               // unused compulsory method
-       }
-
-       @Override
-       public void doSave(IProgressMonitor monitor) {
-               try {
-                       // Automatically commit all pages of the editor
-                       commitPages(true);
-                       firePropertyChange(PROP_DIRTY);
-               } catch (Exception e) {
-                       throw new ArgeoException("Error while saving node", e);
-               }
-
-       }
-
-       @Override
-       public boolean isSaveAsAllowed() {
-               return true;
-       }
-
-       Node getCurrentNode() {
-               return currentNode;
-       }
-}
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/editors/GenericNodeEditorInput.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/editors/GenericNodeEditorInput.java
deleted file mode 100644 (file)
index 45e337e..0000000
+++ /dev/null
@@ -1,111 +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.jcr.ui.explorer.editors;
-
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-
-import org.argeo.ArgeoException;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IPersistableElement;
-
-/**
- * An editor input based the JCR node object.
- * */
-
-public class GenericNodeEditorInput implements IEditorInput {
-       private final Node currentNode;
-
-       // cache key properties at creation time to avoid Exception at recoring time
-       // when the session has been closed
-       private String path;
-       private String uid;
-       private String name;
-
-       public GenericNodeEditorInput(Node currentNode) {
-               this.currentNode = currentNode;
-               try {
-                       name = currentNode.getName();
-                       uid = currentNode.getIdentifier();
-                       path = currentNode.getPath();
-               } catch (RepositoryException re) {
-                       throw new ArgeoException(
-                                       "unexpected error while getting node key values at creation time",
-                                       re);
-               }
-       }
-
-       public Node getCurrentNode() {
-               return currentNode;
-       }
-
-       public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) {
-               return null;
-       }
-
-       public boolean exists() {
-               return true;
-       }
-
-       public ImageDescriptor getImageDescriptor() {
-               return null;
-       }
-
-       public String getName() {
-               return name;
-       }
-
-       public String getUid() {
-               return uid;
-       }
-
-       public String getToolTipText() {
-               return path;
-       }
-
-       public String getPath() {
-               return path;
-       }
-
-       public IPersistableElement getPersistable() {
-               return null;
-       }
-
-       /**
-        * equals method based on UID that is unique within a workspace and path of
-        * the node, thus 2 shared node that have same UID as defined in the spec
-        * but 2 different pathes will open two distinct editors.
-        * 
-        * TODO enhance this method to support multirepository and multiworkspace
-        * environments
-        */
-       public boolean equals(Object obj) {
-               if (this == obj)
-                       return true;
-               if (obj == null)
-                       return false;
-               if (getClass() != obj.getClass())
-                       return false;
-
-               GenericNodeEditorInput other = (GenericNodeEditorInput) obj;
-               if (!getUid().equals(other.getUid()))
-                       return false;
-               if (!getPath().equals(other.getPath()))
-                       return false;
-               return true;
-       }
-}
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/editors/GenericNodePage.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/editors/GenericNodePage.java
deleted file mode 100644 (file)
index fd4dafe..0000000
+++ /dev/null
@@ -1,211 +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.jcr.ui.explorer.editors;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.ListIterator;
-
-import javax.jcr.Node;
-import javax.jcr.Property;
-import javax.jcr.PropertyIterator;
-import javax.jcr.PropertyType;
-import javax.jcr.RepositoryException;
-
-import org.argeo.ArgeoException;
-import org.argeo.jcr.JcrUtils;
-import org.argeo.jcr.ui.explorer.JcrExplorerConstants;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.forms.AbstractFormPart;
-import org.eclipse.ui.forms.IManagedForm;
-import org.eclipse.ui.forms.editor.FormEditor;
-import org.eclipse.ui.forms.editor.FormPage;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.ScrolledForm;
-
-/**
- * Main node editor page. Lists all properties of the current node and enable
- * access and editing for some of them.
- */
-
-public class GenericNodePage extends FormPage implements JcrExplorerConstants {
-       // private final static Log log = LogFactory.getLog(GenericNodePage.class);
-
-       // local constants
-       private final static String JCR_PROPERTY_NAME = "jcr:name";
-
-       // Utils
-       protected DateFormat timeFormatter = new SimpleDateFormat(DATE_TIME_FORMAT);
-
-       // Main business Objects
-       private Node currentNode;
-
-       // This page widgets
-       private FormToolkit tk;
-       private List<Control> modifyableProperties = new ArrayList<Control>();
-
-       public GenericNodePage(FormEditor editor, String title, Node currentNode) {
-               super(editor, "id", title);
-               this.currentNode = currentNode;
-       }
-
-       protected void createFormContent(IManagedForm managedForm) {
-               tk = managedForm.getToolkit();
-               ScrolledForm form = managedForm.getForm();
-               GridLayout twt = new GridLayout(3, false);
-               twt.marginWidth = twt.marginHeight = 5;
-
-               form.getBody().setLayout(twt);
-               createPropertiesPart(form.getBody());
-       }
-
-       private void createPropertiesPart(Composite parent) {
-               try {
-
-                       PropertyIterator pi = currentNode.getProperties();
-
-                       // Initializes form part
-                       AbstractFormPart part = new AbstractFormPart() {
-                               public void commit(boolean onSave) {
-                                       try {
-                                               if (onSave) {
-                                                       ListIterator<Control> it = modifyableProperties
-                                                                       .listIterator();
-                                                       while (it.hasNext()) {
-                                                               // we only support Text controls for the time
-                                                               // being
-                                                               Text curControl = (Text) it.next();
-                                                               String value = curControl.getText();
-                                                               currentNode.setProperty((String) curControl
-                                                                               .getData(JCR_PROPERTY_NAME), value);
-                                                       }
-
-                                                       // We only commit when onSave = true,
-                                                       // thus it is still possible to save after a tab
-                                                       // change.
-                                                       super.commit(onSave);
-                                               }
-                                       } catch (RepositoryException re) {
-                                               throw new ArgeoException(
-                                                               "Unexpected error while saving properties", re);
-                                       }
-                               }
-                       };
-
-                       while (pi.hasNext()) {
-                               Property prop = pi.nextProperty();
-                               addPropertyLine(parent, part, prop);
-                       }
-
-                       getManagedForm().addPart(part);
-               } catch (RepositoryException re) {
-                       throw new ArgeoException(
-                                       "Error during creation of network details section", re);
-               }
-
-       }
-
-       private void addPropertyLine(Composite parent, AbstractFormPart part,
-                       Property prop) {
-               try {
-                       tk.createLabel(parent, prop.getName());
-                       tk.createLabel(parent,
-                                       "[" + JcrUtils.getPropertyDefinitionAsString(prop) + "]");
-
-                       if (prop.getDefinition().isProtected()) {
-                               tk.createLabel(parent, formatReadOnlyPropertyValue(prop));
-                       } else
-                               addModifyableValueWidget(parent, part, prop);
-               } catch (RepositoryException re) {
-                       throw new ArgeoException("Cannot get property " + prop, re);
-               }
-       }
-
-       private String formatReadOnlyPropertyValue(Property prop) {
-               try {
-                       String strValue;
-
-                       if (prop.getType() == PropertyType.BINARY)
-                               strValue = "<binary>";
-                       else if (prop.isMultiple())
-                               strValue = Arrays.asList(prop.getValues()).toString();
-                       else if (prop.getType() == PropertyType.DATE)
-                               strValue = timeFormatter.format(prop.getValue().getDate()
-                                               .getTime());
-                       else
-                               strValue = prop.getValue().getString();
-
-                       return strValue;
-               } catch (RepositoryException re) {
-                       throw new ArgeoException(
-                                       "Unexpected error while formatting read only property value",
-                                       re);
-               }
-       }
-
-       private Control addModifyableValueWidget(Composite parent,
-                       AbstractFormPart part, Property prop) {
-               GridData gd;
-               try {
-                       if (prop.getType() == PropertyType.STRING) {
-                               Text txt = tk.createText(parent, prop.getString());
-                               gd = new GridData(GridData.FILL_HORIZONTAL);
-                               txt.setLayoutData(gd);
-                               txt.addModifyListener(new ModifiedFieldListener(part));
-                               txt.setData(JCR_PROPERTY_NAME, prop.getName());
-                               modifyableProperties.add(txt);
-                       } else {
-                               // unsupported property type for editing, we create a read only
-                               // label.
-                               return tk
-                                               .createLabel(parent, formatReadOnlyPropertyValue(prop));
-                       }
-                       return null;
-               } catch (RepositoryException re) {
-                       throw new ArgeoException(
-                                       "Unexpected error while formatting read only property value",
-                                       re);
-               }
-
-       }
-
-       //
-       // LISTENERS
-       //
-
-       private class ModifiedFieldListener implements ModifyListener {
-
-               private AbstractFormPart formPart;
-
-               public ModifiedFieldListener(AbstractFormPart generalPart) {
-                       this.formPart = generalPart;
-               }
-
-               public void modifyText(ModifyEvent e) {
-                       formPart.markDirty();
-               }
-       }
-
-}
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/editors/GenericPropertyPage.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/editors/GenericPropertyPage.java
deleted file mode 100644 (file)
index 3aec453..0000000
+++ /dev/null
@@ -1,306 +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.jcr.ui.explorer.editors;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.jcr.Node;
-import javax.jcr.Property;
-import javax.jcr.PropertyIterator;
-import javax.jcr.RepositoryException;
-import javax.jcr.Value;
-
-import org.argeo.ArgeoException;
-import org.argeo.jcr.ui.explorer.JcrExplorerConstants;
-import org.argeo.jcr.ui.explorer.JcrExplorerPlugin;
-import org.argeo.jcr.ui.explorer.providers.PropertyLabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeColumn;
-import org.eclipse.ui.forms.IManagedForm;
-import org.eclipse.ui.forms.editor.FormEditor;
-import org.eclipse.ui.forms.editor.FormPage;
-import org.eclipse.ui.forms.widgets.ScrolledForm;
-
-/**
- * Generic editor property page. Lists all properties of current node as a
- * complex tree. TODO: enable editing
- */
-
-public class GenericPropertyPage extends FormPage implements
-               JcrExplorerConstants {
-       // private final static Log log =
-       // LogFactory.getLog(GenericPropertyPage.class);
-
-       // Main business Objects
-       private Node currentNode;
-
-       public GenericPropertyPage(FormEditor editor, String title, Node currentNode) {
-               super(editor, "id", title);
-               this.currentNode = currentNode;
-       }
-
-       protected void createFormContent(IManagedForm managedForm) {
-               ScrolledForm form = managedForm.getForm();
-               form.setText(JcrExplorerPlugin.getMessage("genericNodePageTitle"));
-               FillLayout layout = new FillLayout();
-               layout.marginHeight = 5;
-               layout.marginWidth = 5;
-               form.getBody().setLayout(layout);
-
-               createComplexTree(form.getBody());
-
-               // TODO remove following
-               // createPropertiesPart(form.getBody());
-       }
-
-       private TreeViewer createComplexTree(Composite parent) {
-               int style = SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION;
-               Tree tree = new Tree(parent, style);
-               createColumn(tree, "Property", SWT.LEFT, 200);
-               createColumn(tree, "Value(s)", SWT.LEFT, 300);
-               createColumn(tree, "Attributes", SWT.LEFT, 65);
-               tree.setLinesVisible(true);
-               tree.setHeaderVisible(true);
-
-               TreeViewer result = new TreeViewer(tree);
-               result.setContentProvider(new TreeContentProvider());
-               result.setLabelProvider(new PropertyLabelProvider());
-               result.setInput(currentNode);
-               result.expandAll();
-               return result;
-       }
-
-       private static TreeColumn createColumn(Tree parent, String name, int style,
-                       int width) {
-               TreeColumn result = new TreeColumn(parent, style);
-               result.setText(name);
-               result.setWidth(width);
-               result.setMoveable(true);
-               result.setResizable(true);
-               return result;
-       }
-
-       //
-       // private void createPropertiesPart(Composite parent) {
-       // try {
-       //
-       // PropertyIterator pi = currentNode.getProperties();
-       //
-       // // Initializes form part
-       // AbstractFormPart part = new AbstractFormPart() {
-       // public void commit(boolean onSave) {
-       // try {
-       // if (onSave) {
-       // ListIterator<Control> it = modifyableProperties
-       // .listIterator();
-       // while (it.hasNext()) {
-       // // we only support Text controls for the time
-       // // being
-       // Text curControl = (Text) it.next();
-       // String value = curControl.getText();
-       // currentNode.setProperty((String) curControl
-       // .getData(JCR_PROPERTY_NAME), value);
-       // }
-       //
-       // // We only commit when onSave = true,
-       // // thus it is still possible to save after a tab
-       // // change.
-       // super.commit(onSave);
-       // }
-       // } catch (RepositoryException re) {
-       // throw new ArgeoException(
-       // "Unexpected error while saving properties", re);
-       // }
-       // }
-       // };
-       //
-       // while (pi.hasNext()) {
-       // Property prop = pi.nextProperty();
-       // addPropertyLine(parent, part, prop);
-       // }
-       //
-       // getManagedForm().addPart(part);
-       // } catch (RepositoryException re) {
-       // throw new ArgeoException(
-       // "Error during creation of network details section", re);
-       // }
-       //
-       // }
-       //
-       // private void addPropertyLine(Composite parent, AbstractFormPart part,
-       // Property prop) {
-       // try {
-       // tk.createLabel(parent, prop.getName());
-       // tk.createLabel(parent,
-       // "[" + JcrUtils.getPropertyDefinitionAsString(prop) + "]");
-       //
-       // if (prop.getDefinition().isProtected()) {
-       // tk.createLabel(parent, formatReadOnlyPropertyValue(prop));
-       // } else
-       // addModifyableValueWidget(parent, part, prop);
-       // } catch (RepositoryException re) {
-       // throw new ArgeoException("Cannot get property " + prop, re);
-       // }
-       // }
-       //
-       // private String formatReadOnlyPropertyValue(Property prop) {
-       // try {
-       // String strValue;
-       //
-       // if (prop.getType() == PropertyType.BINARY)
-       // strValue = "<binary>";
-       // else if (prop.isMultiple())
-       // strValue = Arrays.asList(prop.getValues()).toString();
-       // else if (prop.getType() == PropertyType.DATE)
-       // strValue = timeFormatter.format(prop.getValue().getDate()
-       // .getTime());
-       // else
-       // strValue = prop.getValue().getString();
-       //
-       // return strValue;
-       // } catch (RepositoryException re) {
-       // throw new ArgeoException(
-       // "Unexpected error while formatting read only property value",
-       // re);
-       // }
-       // }
-       //
-       // private Control addModifyableValueWidget(Composite parent,
-       // AbstractFormPart part, Property prop) {
-       // GridData gd;
-       // try {
-       // if (prop.getType() == PropertyType.STRING) {
-       // Text txt = tk.createText(parent, prop.getString());
-       // gd = new GridData(GridData.FILL_HORIZONTAL);
-       // txt.setLayoutData(gd);
-       // txt.addModifyListener(new ModifiedFieldListener(part));
-       // txt.setData(JCR_PROPERTY_NAME, prop.getName());
-       // modifyableProperties.add(txt);
-       // } else {
-       // // unsupported property type for editing, we create a read only
-       // // label.
-       // return tk
-       // .createLabel(parent, formatReadOnlyPropertyValue(prop));
-       // }
-       // return null;
-       // } catch (RepositoryException re) {
-       // throw new ArgeoException(
-       // "Unexpected error while formatting read only property value",
-       // re);
-       // }
-       //
-       // }
-
-       // Multiple Value Model
-       // protected class MultipleValueItem {
-       // private int index;
-       // private Value value;
-       //
-       // public MultipleValueItem(int index, Value value) {
-       // this.index = index;
-       // this.value = value;
-       // }
-       //
-       // public int getIndex() {
-       // return index;
-       // }
-       //
-       // public Object getValue() {
-       // return value;
-       // }
-       // }
-
-       private class TreeContentProvider implements ITreeContentProvider {
-               public Object[] getElements(Object parent) {
-                       Object[] props = null;
-                       try {
-
-                               if (parent instanceof Node) {
-                                       Node node = (Node) parent;
-                                       PropertyIterator pi;
-                                       pi = node.getProperties();
-                                       List<Property> propList = new ArrayList<Property>();
-                                       while (pi.hasNext()) {
-                                               propList.add(pi.nextProperty());
-                                       }
-                                       props = propList.toArray();
-                               }
-                       } catch (RepositoryException e) {
-                               throw new ArgeoException(
-                                               "Unexpected exception while listing node properties", e);
-                       }
-                       return props;
-               }
-
-               public Object getParent(Object child) {
-                       return null;
-               }
-
-               public Object[] getChildren(Object parent) {
-                       Object[] result = null;
-                       if (parent instanceof Property) {
-                               Property prop = (Property) parent;
-                               try {
-
-                                       if (prop.isMultiple()) {
-                                               Value[] values = prop.getValues();
-                                               // List<MultipleValueItem> list = new
-                                               // ArrayList<MultipleValueItem>();
-                                               // for (int i = 0; i < values.length; i++) {
-                                               // MultipleValueItem mvi = new MultipleValueItem(i,
-                                               // values[i]);
-                                               // list.add(mvi);
-                                               // }
-
-                                               return values;
-                                       }
-                               } catch (RepositoryException e) {
-                                       throw new ArgeoException(
-                                                       "Unexpected error getting multiple values property.",
-                                                       e);
-                               }
-                       }
-                       return result;
-               }
-
-               public boolean hasChildren(Object parent) {
-                       try {
-                               if (parent instanceof Property
-                                               && ((Property) parent).isMultiple()) {
-                                       return true;
-                               }
-                       } catch (RepositoryException e) {
-                               throw new ArgeoException(
-                                               "Unexpected exception while checking if property is multiple",
-                                               e);
-                       }
-                       return false;
-               }
-
-               public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-               }
-
-               public void dispose() {
-               }
-       }
-}
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/editors/NodeRightsManagementPage.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/editors/NodeRightsManagementPage.java
deleted file mode 100644 (file)
index cc5efb5..0000000
+++ /dev/null
@@ -1,138 +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.jcr.ui.explorer.editors;
-
-import javax.jcr.Node;
-import javax.jcr.security.AccessControlManager;
-import javax.jcr.security.Privilege;
-
-import org.argeo.ArgeoException;
-import org.argeo.jcr.ui.explorer.JcrExplorerPlugin;
-import org.eclipse.jface.viewers.ColumnLabelProvider;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TableViewerColumn;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.ui.forms.IManagedForm;
-import org.eclipse.ui.forms.editor.FormEditor;
-import org.eclipse.ui.forms.editor.FormPage;
-import org.eclipse.ui.forms.widgets.ScrolledForm;
-
-/**
- * This comments will be nicely fill by mbaudier in.
- */
-public class NodeRightsManagementPage extends FormPage {
-       // private final static Log log =
-       // LogFactory.getLog(NodeRightsManagementPage.class);
-
-       private Node currentNode;
-
-       private TableViewer viewer;
-
-       public NodeRightsManagementPage(FormEditor editor, String title,
-                       Node currentNode) {
-               super(editor, "NodeRightsManagementPage", title);
-               this.currentNode = currentNode;
-       }
-
-       protected void createFormContent(IManagedForm managedForm) {
-               ScrolledForm form = managedForm.getForm();
-               form.setText(JcrExplorerPlugin
-                               .getMessage("nodeRightsManagementPageTitle"));
-               FillLayout layout = new FillLayout();
-               layout.marginHeight = 5;
-               layout.marginWidth = 5;
-               form.getBody().setLayout(layout);
-               createRightsPart(form.getBody());
-       }
-
-       /** Creates the rights part */
-       protected void createRightsPart(Composite parent) {
-               Table table = new Table(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
-               table.setLinesVisible(true);
-               table.setHeaderVisible(true);
-               viewer = new TableViewer(table);
-
-               // check column
-               TableViewerColumn column = createTableViewerColumn(viewer, "checked",
-                               20);
-               column.setLabelProvider(new ColumnLabelProvider() {
-                       public String getText(Object element) {
-                               return null;
-                       }
-
-                       public Image getImage(Object element) {
-                               return null;
-                       }
-               });
-               // column.setEditingSupport(new RoleEditingSupport(rolesViewer, part));
-
-               // role column
-               column = createTableViewerColumn(viewer, "Role", 200);
-               column.setLabelProvider(new ColumnLabelProvider() {
-                       public String getText(Object element) {
-                               Privilege p = (Privilege) element;
-                               return p.getName();
-                       }
-
-                       public Image getImage(Object element) {
-                               return null;
-                       }
-               });
-               viewer.setContentProvider(new RightsContentProvider());
-               viewer.setInput(getEditorSite());
-       }
-
-       protected TableViewerColumn createTableViewerColumn(TableViewer viewer,
-                       String title, int bound) {
-               final TableViewerColumn viewerColumn = new TableViewerColumn(viewer,
-                               SWT.NONE);
-               final TableColumn column = viewerColumn.getColumn();
-               column.setText(title);
-               column.setWidth(bound);
-               column.setResizable(true);
-               column.setMoveable(true);
-               return viewerColumn;
-       }
-
-       private class RightsContentProvider implements IStructuredContentProvider {
-
-               public void dispose() {
-               }
-
-               public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-               }
-
-               public Object[] getElements(Object inputElement) {
-                       try {
-                               AccessControlManager accessControlManager = currentNode
-                                               .getSession().getAccessControlManager();
-                               Privilege[] privileges = accessControlManager
-                                               .getPrivileges(currentNode.getPath());
-                               return privileges;
-                       } catch (Exception e) {
-                               throw new ArgeoException("Cannot retrieve rights", e);
-                       }
-               }
-
-       }
-}
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/editors/NodeVersionHistoryPage.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/editors/NodeVersionHistoryPage.java
deleted file mode 100644 (file)
index 59fff5e..0000000
+++ /dev/null
@@ -1,319 +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.jcr.ui.explorer.editors;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.List;
-import java.util.Map;
-
-import javax.jcr.Node;
-import javax.jcr.Property;
-import javax.jcr.PropertyType;
-import javax.jcr.RepositoryException;
-import javax.jcr.Value;
-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.ArgeoException;
-import org.argeo.jcr.JcrUtils;
-import org.argeo.jcr.PropertyDiff;
-import org.argeo.jcr.VersionDiff;
-import org.argeo.jcr.ui.explorer.JcrExplorerConstants;
-import org.argeo.jcr.ui.explorer.JcrExplorerPlugin;
-import org.argeo.jcr.ui.explorer.providers.FullVersioningTreeContentProvider;
-import org.argeo.jcr.ui.explorer.providers.VersionLabelProvider;
-import org.argeo.jcr.ui.explorer.utils.GenericNodeDoubleClickListener;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.forms.AbstractFormPart;
-import org.eclipse.ui.forms.IManagedForm;
-import org.eclipse.ui.forms.editor.FormEditor;
-import org.eclipse.ui.forms.editor.FormPage;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.ScrolledForm;
-import org.eclipse.ui.forms.widgets.Section;
-import org.eclipse.ui.forms.widgets.TableWrapData;
-import org.eclipse.ui.forms.widgets.TableWrapLayout;
-
-/**
- * Offers two main sections : one to display a text area with a summary of all
- * variations between a version and its predecessor and one tree view that
- * enable browsing
- * */
-public class NodeVersionHistoryPage extends FormPage implements
-               JcrExplorerConstants {
-       // private final static Log log = LogFactory
-       // .getLog(NodeVersionHistoryPage.class);
-
-       // Utils
-       protected DateFormat timeFormatter = new SimpleDateFormat(DATE_TIME_FORMAT);
-
-       // business objects
-       private Node currentNode;
-
-       // this page UI components
-       private FullVersioningTreeContentProvider nodeContentProvider;
-       private TreeViewer nodesViewer;
-       private FormToolkit tk;
-
-       public NodeVersionHistoryPage(FormEditor editor, String title,
-                       Node currentNode) {
-               super(editor, "NodeVersionHistoryPage", title);
-               this.currentNode = currentNode;
-       }
-
-       protected void createFormContent(IManagedForm managedForm) {
-               ScrolledForm form = managedForm.getForm();
-               form.setText(JcrExplorerPlugin
-                               .getMessage("nodeVersionHistoryPageTitle"));
-               tk = managedForm.getToolkit();
-               GridLayout twt = new GridLayout(1, false);
-               twt.marginWidth = twt.marginHeight = 5;
-               Composite body = form.getBody();
-               body.setLayout(twt);
-
-               try {
-                       if (!currentNode.isNodeType(NodeType.MIX_VERSIONABLE)) {
-                               tk.createLabel(body, JcrExplorerPlugin
-                                               .getMessage("warningUnversionableNode"));
-                       } else {
-                               createHistorySection(form.getBody());
-                               createTreeSection(form.getBody());
-                       }
-               } catch (RepositoryException e) {
-                       throw new ArgeoException(
-                                       "Unexpected error while checking if node is versionable", e);
-               }
-       }
-
-       protected void createTreeSection(Composite parent) {
-               // Section Layout & MetaData
-               Section section = tk.createSection(parent, Section.TWISTIE);
-               section.setLayoutData(new GridData(GridData.FILL_BOTH));
-               section.setText(JcrExplorerPlugin.getMessage("versionTreeSectionTitle"));
-
-               // Section Body
-               Composite body = tk.createComposite(section, SWT.FILL);
-               // WARNING : 2 following lines are compulsory or body won't be
-               // displayed.
-               body.setLayout(new GridLayout());
-               section.setClient(body);
-
-               body.setLayoutData(new GridData(GridData.FILL_BOTH));
-               section.setExpanded(true);
-
-               nodeContentProvider = new FullVersioningTreeContentProvider();
-               nodesViewer = createNodeViewer(body, nodeContentProvider);
-               nodesViewer.setInput(currentNode);
-       }
-
-       protected TreeViewer createNodeViewer(Composite parent,
-                       final ITreeContentProvider nodeContentProvider) {
-
-               final TreeViewer tmpNodeViewer = new TreeViewer(parent, SWT.MULTI);
-
-               tmpNodeViewer.getTree().setLayoutData(
-                               new GridData(SWT.FILL, SWT.FILL, true, true));
-
-               tmpNodeViewer.setContentProvider(nodeContentProvider);
-               tmpNodeViewer.setLabelProvider(new VersionLabelProvider());
-               tmpNodeViewer
-                               .addDoubleClickListener(new GenericNodeDoubleClickListener(
-                                               tmpNodeViewer));
-               return tmpNodeViewer;
-       }
-
-       protected void createHistorySection(Composite parent) {
-
-               // Section Layout
-               Section section = tk.createSection(parent, Section.TWISTIE);
-               section.setLayoutData(new GridData(TableWrapData.FILL_GRAB));
-               TableWrapLayout twt = new TableWrapLayout();
-               section.setLayout(twt);
-
-               // Set title of the section
-               section.setText(JcrExplorerPlugin
-                               .getMessage("versionHistorySectionTitle"));
-
-               final Text styledText = tk.createText(section, "", SWT.FULL_SELECTION
-                               | SWT.BORDER | SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
-               styledText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-               section.setClient(styledText);
-               refreshHistory(styledText);
-               styledText.setEditable(false);
-               section.setExpanded(false);
-
-               AbstractFormPart part = new AbstractFormPart() {
-                       public void commit(boolean onSave) {
-                       }
-
-                       public void refresh() {
-                               super.refresh();
-                               refreshHistory(styledText);
-                       }
-               };
-               getManagedForm().addPart(part);
-       }
-
-       protected void refreshHistory(Text styledText) {
-               try {
-                       List<VersionDiff> lst = listHistoryDiff();
-                       StringBuffer main = new StringBuffer("");
-
-                       for (int i = lst.size() - 1; i >= 0; i--) {
-                               if (i == 0)
-                                       main.append("Creation (");
-                               else
-                                       main.append("Update " + i + " (");
-
-                               if (lst.get(i).getUserId() != null)
-                                       main.append("UserId : " + lst.get(i).getUserId());
-
-                               if (lst.get(i).getUserId() != null
-                                               && lst.get(i).getUpdateTime() != null)
-                                       main.append(", ");
-
-                               if (lst.get(i).getUpdateTime() != null)
-                                       main.append("Date : "
-                                                       + timeFormatter.format(lst.get(i).getUpdateTime()
-                                                                       .getTime()) + ")\n");
-
-                               StringBuffer buf = new StringBuffer("");
-                               Map<String, PropertyDiff> diffs = lst.get(i).getDiffs();
-                               for (String prop : diffs.keySet()) {
-                                       PropertyDiff pd = diffs.get(prop);
-                                       // String propName = pd.getRelPath();
-                                       Value refValue = pd.getReferenceValue();
-                                       Value newValue = pd.getNewValue();
-                                       String refValueStr = "";
-                                       String newValueStr = "";
-
-                                       if (refValue != null) {
-                                               if (refValue.getType() == PropertyType.DATE) {
-                                                       refValueStr = timeFormatter.format(refValue
-                                                                       .getDate().getTime());
-                                               } else
-                                                       refValueStr = refValue.getString();
-                                       }
-                                       if (newValue != null) {
-                                               if (newValue.getType() == PropertyType.DATE) {
-                                                       newValueStr = timeFormatter.format(newValue
-                                                                       .getDate().getTime());
-                                               } else
-                                                       newValueStr = newValue.getString();
-                                       }
-
-                                       if (pd.getType() == PropertyDiff.MODIFIED) {
-                                               buf.append(prop).append(": ");
-                                               buf.append(refValueStr);
-                                               buf.append(" > ");
-                                               buf.append(newValueStr);
-                                               buf.append("\n");
-                                       } else if (pd.getType() == PropertyDiff.ADDED
-                                                       && !"".equals(newValueStr)) {
-                                               // we don't list property that have been added with an
-                                               // empty string as value
-                                               buf.append(prop).append(": ");
-                                               buf.append(" + ");
-                                               buf.append(newValueStr);
-                                               buf.append("\n");
-                                       } else if (pd.getType() == PropertyDiff.REMOVED) {
-                                               buf.append(prop).append(": ");
-                                               buf.append(" - ");
-                                               buf.append(refValueStr);
-                                               buf.append("\n");
-                                       }
-                               }
-                               buf.append("\n");
-                               main.append(buf);
-                       }
-                       styledText.setText(main.toString());
-               } catch (RepositoryException e) {
-                       throw new ArgeoException("Cannot generate history for node", e);
-               }
-
-       }
-
-       public List<VersionDiff> listHistoryDiff() {
-               try {
-                       List<VersionDiff> res = new ArrayList<VersionDiff>();
-                       VersionManager versionManager = currentNode.getSession()
-                                       .getWorkspace().getVersionManager();
-                       VersionHistory versionHistory = versionManager
-                                       .getVersionHistory(currentNode.getPath());
-
-                       VersionIterator vit = versionHistory.getAllLinearVersions();
-                       while (vit.hasNext()) {
-                               Version version = vit.nextVersion();
-                               Node node = version.getFrozenNode();
-                               Version predecessor = null;
-                               try {
-                                       predecessor = version.getLinearPredecessor();
-                               } catch (Exception e) {
-                                       // no predecessor seems to throw an exception even if it
-                                       // shouldn't...
-                               }
-                               if (predecessor == null) {// original
-                               } else {
-                                       Map<String, PropertyDiff> diffs = JcrUtils.diffProperties(
-                                                       predecessor.getFrozenNode(), node);
-                                       if (!diffs.isEmpty()) {
-                                               String lastUserName = null;
-                                               Calendar lastUpdate = null;
-                                               try {
-                                                       if (currentNode
-                                                                       .isNodeType(NodeType.MIX_LAST_MODIFIED)) {
-                                                               lastUserName = node.getProperty(
-                                                                               Property.JCR_LAST_MODIFIED_BY)
-                                                                               .getString();
-                                                               lastUpdate = node.getProperty(
-                                                                               Property.JCR_LAST_MODIFIED).getDate();
-                                                       } else
-                                                               lastUpdate = version.getProperty(
-                                                                               Property.JCR_CREATED).getDate();
-
-                                               } catch (Exception e) {
-                                                       // Silent that info is optional
-                                               }
-                                               VersionDiff vd = new VersionDiff(lastUserName,
-                                                               lastUpdate, diffs);
-                                               res.add(vd);
-                                       }
-                               }
-                       }
-                       return res;
-               } catch (RepositoryException e) {
-                       throw new ArgeoException("Cannot generate history for node ");
-               }
-
-       }
-
-       @Override
-       public void setActive(boolean active) {
-               super.setActive(active);
-       }
-}
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/editors/StringNodeEditorInput.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/editors/StringNodeEditorInput.java
deleted file mode 100644 (file)
index 654b2ae..0000000
+++ /dev/null
@@ -1,120 +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.jcr.ui.explorer.editors;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IPersistableElement;
-
-/**
- * An editor input based on three strings define a node :
- * <ul>
- * <li>complete path to the node</li>
- * <li>the workspace name</li>
- * <li>the repository alias</li>
- * </ul>
- * In a single workspace and/or repository environment, name and alias can be
- * null.
- * 
- * Note : unused for the time being.
- */
-
-public class StringNodeEditorInput implements IEditorInput {
-       private final String path;
-       private final String repositoryAlias;
-       private final String workspaceName;
-
-       /**
-        * In order to implement a generic explorer that supports remote and multi
-        * workspaces repositories, node path can be detailed by these strings.
-        * 
-        * @param repositoryAlias
-        *            : can be null
-        * @param workspaceName
-        *            : can be null
-        * @param path
-        */
-       public StringNodeEditorInput(String repositoryAlias, String workspaceName,
-                       String path) {
-               this.path = path;
-               this.repositoryAlias = repositoryAlias;
-               this.workspaceName = workspaceName;
-       }
-
-       public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) {
-               return null;
-       }
-
-       public boolean exists() {
-               return true;
-       }
-
-       public ImageDescriptor getImageDescriptor() {
-               return null;
-       }
-
-       public String getName() {
-               return path;
-       }
-
-       public String getRepositoryAlias() {
-               return repositoryAlias;
-       }
-
-       public String getWorkspaceName() {
-               return workspaceName;
-       }
-
-       public IPersistableElement getPersistable() {
-               return null;
-       }
-
-       public String getToolTipText() {
-               return path;
-       }
-
-       public String getPath() {
-               return path;
-       }
-
-       public boolean equals(Object obj) {
-               if (this == obj)
-                       return true;
-               if (obj == null)
-                       return false;
-               if (getClass() != obj.getClass())
-                       return false;
-
-               StringNodeEditorInput other = (StringNodeEditorInput) obj;
-
-               if (!path.equals(other.getPath()))
-                       return false;
-
-               String own = other.getWorkspaceName();
-               if ((workspaceName == null && own != null)
-                               || (workspaceName != null && (own == null || !workspaceName
-                                               .equals(own))))
-                       return false;
-
-               String ora = other.getRepositoryAlias();
-               if ((repositoryAlias == null && ora != null)
-                               || (repositoryAlias != null && (ora == null || !repositoryAlias
-                                               .equals(ora))))
-                       return false;
-
-               return true;
-       }
-}
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/messages.properties b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/messages.properties
deleted file mode 100644 (file)
index 3023c52..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-## English labels for Agreo JCR UI application 
-
-## Generic labels 
-
-## Errors & warnings 
-errorUnvalidNtFolderNodeType= Error: folder can only be created on a Jcr Node
-warningInvalidNodeToImport=Can only import to a node
-warningInvalidMultipleSelection=This functionality is implemented only on a single node for the time being.
-warningUnversionableNode= Current node is not versionable.
-warningNoChildNode= Current node has no child.
-
-## Commands 
-getNodeSizeCmdLbl= Get approx. size
-addFolderNodeCmdLbl= Add Folder
-
-## GenericNodeEditor 
-nodeEditorLbl=Generic node editor
-genericNodePageTitle=Properties
-childNodesPageTitle=Children
-nodeRightsManagementPageTitle=Rights
-nodeVersionHistoryPageTitle=History
-
-# History 
-versionTreeSectionTitle=Version list
-versionHistorySectionTitle=History
-## Dummy ones 
-testLbl=Internationalizations of messages seems to work properly.
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/model/MaintainedRepositoryElem.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/model/MaintainedRepositoryElem.java
deleted file mode 100644 (file)
index abb97a9..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-package org.argeo.jcr.ui.explorer.model;
-
-import javax.jcr.Repository;
-
-import org.argeo.ArgeoException;
-import org.argeo.eclipse.ui.TreeParent;
-import org.argeo.jcr.MaintainedRepository;
-
-/** Wraps a {@link 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 amiantained repository");
-               }
-       }
-
-       protected MaintainedRepository getMaintainedRepository() {
-               return (MaintainedRepository) getRepository();
-       }
-}
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/model/RemoteRepositoryElem.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/model/RemoteRepositoryElem.java
deleted file mode 100644 (file)
index 0be6978..0000000
+++ /dev/null
@@ -1,94 +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.jcr.ui.explorer.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.ArgeoException;
-import org.argeo.eclipse.ui.TreeParent;
-import org.argeo.jcr.ArgeoJcrUtils;
-import org.argeo.jcr.ArgeoNames;
-import org.argeo.util.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();
-               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 = ArgeoJcrUtils.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 ArgeoException("Cannot remove " + remoteNodePath, e);
-               }
-       }
-
-}
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/model/RepositoriesElem.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/model/RepositoriesElem.java
deleted file mode 100644 (file)
index b123727..0000000
+++ /dev/null
@@ -1,134 +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.jcr.ui.explorer.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.ArgeoException;
-import org.argeo.eclipse.ui.ErrorFeedback;
-import org.argeo.eclipse.ui.TreeParent;
-import org.argeo.jcr.ArgeoNames;
-import org.argeo.jcr.MaintainedRepository;
-import org.argeo.jcr.RepositoryRegister;
-import org.argeo.jcr.UserJcrUtils;
-import org.argeo.util.security.Keyring;
-
-/**
- * UI Tree component. 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 ArgeoException(
-                                                       "Cannot browse remote repositories", e);
-                               }
-                       }
-                       return super.getChildren();
-               }
-       }
-
-       protected void addRemoteRepositories(Keyring jcrKeyring)
-                       throws RepositoryException {
-               Node userHome = UserJcrUtils.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.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/model/RepositoryElem.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/model/RepositoryElem.java
deleted file mode 100644 (file)
index 935bac1..0000000
+++ /dev/null
@@ -1,103 +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.jcr.ui.explorer.model;
-
-import javax.jcr.Repository;
-import javax.jcr.RepositoryException;
-import javax.jcr.Session;
-
-import org.argeo.ArgeoException;
-import org.argeo.eclipse.ui.TreeParent;
-
-/**
- * UI Tree component. Wraps a JCR {@link Repository}. It also keeps a reference
- * to its parent Tree Ui component; typically the unique {@link Repositories}
- * 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 & 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(null);
-                       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 ArgeoException("Cannot connect to repository " + alias, e);
-               }
-       }
-
-       /**
-        * 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 ArgeoException("Cannot retrieve workspace names", e);
-               }
-       }
-
-       public void createWorkspace(String workspaceName) {
-               if (!isConnected())
-                       login();
-               try {
-                       defaultSession.getWorkspace().createWorkspace(workspaceName);
-               } catch (RepositoryException e) {
-                       throw new ArgeoException("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.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/model/SingleJcrNodeElem.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/model/SingleJcrNodeElem.java
deleted file mode 100644 (file)
index 7b588f8..0000000
+++ /dev/null
@@ -1,108 +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.jcr.ui.explorer.model;
-
-import javax.jcr.Node;
-import javax.jcr.NodeIterator;
-import javax.jcr.RepositoryException;
-import javax.jcr.Workspace;
-
-import org.argeo.ArgeoException;
-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;
-
-       // keeps a local reference to the node's name to avoid exception when the
-       // session is lost
-       // private final String name;
-
-       /** 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;
-       }
-
-       /**
-        * Override normal behavior to initialize 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 ArgeoException(
-                                               "Unexcpected error while initializing children SingleJcrNode",
-                                               re);
-                       }
-               }
-       }
-
-       @Override
-       public boolean hasChildren() {
-               try {
-                       if (node.getSession().isLive())
-                               return node.hasNodes();
-                       else
-                               return false;
-               } catch (RepositoryException re) {
-                       throw new ArgeoException(
-                                       "Unexpected error while checking children node existence",
-                                       re);
-               }
-       }
-
-}
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/model/WorkspaceElem.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/model/WorkspaceElem.java
deleted file mode 100644 (file)
index bb9b69c..0000000
+++ /dev/null
@@ -1,130 +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.jcr.ui.explorer.model;
-
-import javax.jcr.Node;
-import javax.jcr.NodeIterator;
-import javax.jcr.RepositoryException;
-import javax.jcr.Session;
-import javax.jcr.Workspace;
-
-import org.argeo.ArgeoException;
-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 Session getSession() {
-               return session;
-       }
-
-       public Node getRootNode() {
-               try {
-                       if (session != null)
-                               return session.getRootNode();
-                       else
-                               return null;
-               } catch (RepositoryException e) {
-                       throw new ArgeoException("Cannot get root node of workspace "
-                                       + getName(), e);
-               }
-       }
-
-       public void login() {
-               try {
-                       session = ((RepositoryElem) getParent()).repositoryLogin(getName());
-               } catch (RepositoryException e) {
-                       throw new ArgeoException("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 void logout() {
-               clearChildren();
-               JcrUtils.logoutQuietly(session);
-       }
-
-       @Override
-       public boolean hasChildren() {
-               try {
-                       if (isConnected())
-                               return session.getRootNode().hasNodes();
-                       else
-                               return false;
-               } catch (RepositoryException re) {
-                       throw new ArgeoException(
-                                       "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 ArgeoException(
-                                               "Cannot initialize WorkspaceNode UI object."
-                                                               + getName(), e);
-                       }
-               }
-       }
-}
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/providers/FullVersioningTreeContentProvider.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/providers/FullVersioningTreeContentProvider.java
deleted file mode 100644 (file)
index 736a5aa..0000000
+++ /dev/null
@@ -1,115 +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.jcr.ui.explorer.providers;
-
-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.ArgeoException;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-
-/**
- * Implementation of the {@code ITreeContentProvider} in order to display some
- * version informations of a JCR full versionable node in a tree like structure
- * 
- */
-public class FullVersioningTreeContentProvider implements ITreeContentProvider {
-       // private Node rootNode;
-       // private ItemComparator itemComparator = new ItemComparator();
-
-       /**
-        * 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 ArgeoException(
-                                       "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 ArgeoException("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 ArgeoException("Cannot check children of " + element, e);
-               }
-       }
-
-       public void dispose() {
-       }
-
-       public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-       }
-
-}
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/providers/PropertyLabelProvider.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/providers/PropertyLabelProvider.java
deleted file mode 100644 (file)
index decbe63..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.jcr.ui.explorer.providers;
-
-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.ArgeoException;
-import org.argeo.jcr.JcrUtils;
-import org.argeo.jcr.ui.explorer.JcrExplorerConstants;
-import org.eclipse.jface.viewers.ColumnLabelProvider;
-import org.eclipse.jface.viewers.ViewerCell;
-
-public class PropertyLabelProvider extends ColumnLabelProvider implements
-               JcrExplorerConstants {
-
-       // 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_ATTRIBUTES = 2;
-
-       // Utils
-       protected DateFormat timeFormatter = new SimpleDateFormat(DATE_TIME_FORMAT);
-
-       public void update(ViewerCell cell) {
-               Object element = cell.getElement();
-               cell.setText(getColumnText(element, cell.getColumnIndex()));
-               // Image image = getImage(element);
-               // cell.setImage(image);
-               // cell.setBackground(getBackground(element));
-               // cell.setForeground(getForeground(element));
-               // cell.setFont(getFont(element));
-       }
-
-       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_ATTRIBUTES:
-                                               return JcrUtils.getPropertyDefinitionAsString(prop);
-                                       }
-                               } else {
-                                       switch (columnIndex) {
-                                       case COLUMN_PROPERTY:
-                                               return prop.getName();
-                                       case COLUMN_VALUE:
-                                               return formatValueAsString(prop.getValue());
-                                       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_ATTRIBUTES:
-                                       // Corresponding attributes are listed on the parent
-                                       return "";
-                               }
-                       }
-
-               } catch (RepositoryException re) {
-                       throw new ArgeoException(
-                                       "Unexepected error while getting property values", 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 ArgeoException("unexpected error while formatting value",
-                                       e);
-               }
-       }
-}
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/providers/SingleNodeAsTreeContentProvider.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/providers/SingleNodeAsTreeContentProvider.java
deleted file mode 100644 (file)
index 8c69b6b..0000000
+++ /dev/null
@@ -1,106 +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.jcr.ui.explorer.providers;
-
-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.ArgeoException;
-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 SingleNodeAsTreeContentProvider implements ITreeContentProvider {
-       // 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 ArgeoException(
-                                       "Unexpected error while getting child nodes for children editor page ",
-                                       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 ArgeoException("Cannot check children of " + element, e);
-               }
-       }
-
-       public void dispose() {
-       }
-
-       public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-       }
-
-       protected Object[] childrenNodes(Node parentNode) {
-               try {
-                       List<Node> children = new ArrayList<Node>();
-                       NodeIterator nit = parentNode.getNodes();
-                       while (nit.hasNext()) {
-                               Node node = nit.nextNode();
-                               children.add(node);
-                       }
-                       Node[] arr = children.toArray(new Node[children.size()]);
-                       Arrays.sort(arr, itemComparator);
-                       return arr;
-               } catch (RepositoryException e) {
-                       throw new ArgeoException("Cannot list children of " + parentNode, e);
-               }
-       }
-}
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/providers/VersionLabelProvider.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/providers/VersionLabelProvider.java
deleted file mode 100644 (file)
index 69b35eb..0000000
+++ /dev/null
@@ -1,47 +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.jcr.ui.explorer.providers;
-
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-import javax.jcr.version.Version;
-
-import org.argeo.ArgeoException;
-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 Get text method does not assume that
- * Version extends Node class to respect JCR 2.0 specification
- * 
- */
-public class VersionLabelProvider extends ColumnLabelProvider {
-
-       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 ArgeoException(
-                                       "Unexpected error while getting element name", re);
-               }
-               return super.getText(element);
-       }
-}
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/utils/GenericNodeDoubleClickListener.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/utils/GenericNodeDoubleClickListener.java
deleted file mode 100644 (file)
index 0f93450..0000000
+++ /dev/null
@@ -1,109 +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.jcr.ui.explorer.utils;
-
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-import javax.jcr.nodetype.NodeType;
-
-import org.argeo.ArgeoException;
-import org.argeo.eclipse.ui.jcr.utils.JcrFileProvider;
-import org.argeo.eclipse.ui.specific.FileHandler;
-import org.argeo.jcr.ui.explorer.JcrExplorerPlugin;
-import org.argeo.jcr.ui.explorer.editors.GenericNodeEditor;
-import org.argeo.jcr.ui.explorer.editors.GenericNodeEditorInput;
-import org.argeo.jcr.ui.explorer.model.RepositoryElem;
-import org.argeo.jcr.ui.explorer.model.SingleJcrNodeElem;
-import org.argeo.jcr.ui.explorer.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;
-import org.eclipse.ui.PartInitException;
-
-/**
- * Centralizes the management of double click on a NodeTreeViewer
- */
-public class GenericNodeDoubleClickListener implements IDoubleClickListener {
-
-       // private final static Log log = LogFactory
-       // .getLog(GenericNodeDoubleClickListener.class);
-
-       private TreeViewer nodeViewer;
-       private JcrFileProvider jfp;
-       private FileHandler fileHandler;
-
-       public GenericNodeDoubleClickListener(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.login();
-                               nodeViewer.refresh(obj);
-                       }
-                       // else do nothing
-               } 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)) {
-                                       // double click on a file node triggers its opening
-                                       String name = node.getName();
-                                       String id = node.getIdentifier();
-
-                                       // For the file provider to be able to browse the
-                                       // various
-                                       // repository.
-                                       // TODO : enhanced that.
-                                       // ITreeContentProvider itcp = (ITreeContentProvider)
-                                       // nodeViewer
-                                       // .getContentProvider();
-                                       jfp.setReferenceNode(node);
-                                       if (fileHandler != null)
-                                               fileHandler.openFile(name, id);
-                               }
-                               GenericNodeEditorInput gnei = new GenericNodeEditorInput(node);
-                               JcrExplorerPlugin.getDefault().getWorkbench()
-                                               .getActiveWorkbenchWindow().getActivePage()
-                                               .openEditor(gnei, GenericNodeEditor.ID);
-                       } catch (RepositoryException re) {
-                               throw new ArgeoException(
-                                               "Repository error while getting node info", re);
-                       } catch (PartInitException pie) {
-                               throw new ArgeoException(
-                                               "Unexepected exception while opening node editor", pie);
-                       }
-               }
-       }
-}
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/utils/JcrUiUtils.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/utils/JcrUiUtils.java
deleted file mode 100644 (file)
index ca32113..0000000
+++ /dev/null
@@ -1,179 +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.jcr.ui.explorer.utils;
-
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-
-import org.argeo.ArgeoException;
-import org.argeo.eclipse.ui.TreeParent;
-import org.argeo.jcr.ui.explorer.model.RepositoriesElem;
-import org.argeo.jcr.ui.explorer.model.RepositoryElem;
-import org.argeo.jcr.ui.explorer.model.SingleJcrNodeElem;
-import org.argeo.jcr.ui.explorer.model.WorkspaceElem;
-
-/** Centralizes some useful methods to build UIs with JCR */
-public class JcrUiUtils {
-
-       /** 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 ArgeoException(
-                                       "Unexpected error while synchronising the UI with the JCR repository",
-                                       re);
-               }
-       }
-
-       /**
-        * Insure that a model element is inline with the underlying data by
-        * cleaning the corresponding subtree and building it again.
-        */
-       public static void forceRebuild(TreeParent element) {
-               // TODO implement this method if needed.
-       }
-       /**
-        * Workaround to get the alias of the repository that contains the given
-        * element. As we cannot browse the UI tree upward we recursively browse it
-        * downward until we find the given element
-        * */
-       // public static String getRepositoryAliasFromITreeElement(
-       // NodeContentProvider ncp, Object element) {
-       // RepositoryNode repositoryNode = null;
-       // if (element instanceof RepositoryNode)
-       // return ((RepositoryNode) element).getName();
-       // else if (element instanceof RepositoryRegister)
-       // throw new ArgeoException(
-       // "Cannot get alias for a repository register");
-       //
-       // // Get root elements
-       // Object[] elements = ncp.getElements(null);
-       //
-       // try {
-       // for (int i = 0; i < elements.length; i++) {
-       // if (elements[i] instanceof Node) {
-       // Node curNode = (Node) elements[i];
-       // if (curNode.isNodeType(ArgeoTypes.ARGEO_USER_HOME)) {
-       // // Do nothing, we'll find the node in the "normal" tree
-       // // and
-       // // get corresponding alias this way round
-       // } else
-       // throw new ArgeoException(
-       // "Normal nodes should not be at the root of NodeTreeViewer");
-       // } else if (elements[i] instanceof RepositoryRegister) {
-       // RepositoryRegister repositoryRegister = (RepositoryRegister) elements[i];
-       // Map<String, Repository> repositories = repositoryRegister
-       // .getRepositories();
-       //
-       // for (String name : repositories.keySet()) {
-       // boolean found = isElementInCurrentTreePart(
-       // ncp,
-       // new RepositoryNode(name, repositories.get(name)),
-       // (Node) element);
-       // if (found)
-       // return name;
-       // }
-       // } else
-       // throw new ArgeoException(
-       // "Unexpected object class at the root of NodeTreeViewer");
-       // }
-       // } catch (RepositoryException re) {
-       // throw new ArgeoException(
-       // "Unexpected error while retrieving Alias name", re);
-       // }
-       // return null;
-       // }
-       //
-       // /** implements the recursivity */
-       // private static boolean isElementInCurrentTreePart(NodeContentProvider
-       // ncp,
-       // Object parentElement, NodParente searchedElement) {
-       // boolean found = false;
-       // if (parentElement instanceof WorkspaceNode) {
-       // WorkspaceNode wn = (WorkspaceNode) parentElement;
-       // Object[] children = wn.getChildren();
-       // int i = children.length - 1;
-       // while (!found && i >= 0) {
-       // found = isElementInCurrentTreePart(ncp, children[i],
-       // searchedElement);
-       // }
-       // return found;
-       // } else if (parentElement instanceof RepositoryNode) {
-       // RepositoryNode rn = (RepositoryNode) parentElement;
-       // Object[] children = rn.getChildren();
-       // int i = children.length - 1;
-       // while (!found && i >= 0) {
-       // found = isElementInCurrentTreePart(ncp, children[i],
-       // searchedElement);
-       // }
-       // return found;
-       // } else {
-       // Node node = (Node) parentElement;
-       // if (node.equals(searchedElement))
-       // return true;
-       // NodeIterator ni;
-       // try {
-       // ni = node.getNodes();
-       // while (!found && ni.hasNext()) {
-       // found = isElementInCurrentTreePart(ncp, ni.nextNode(),
-       // searchedElement);
-       // }
-       // } catch (RepositoryException e) {
-       // throw new ArgeoException("unexpected erreur while recursively"
-       // + " recovering RepositoryNode for selected object", e);
-       // }
-       //
-       // return found;
-       // }
-       // }
-}
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/utils/TreeObjectsComparator.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/utils/TreeObjectsComparator.java
deleted file mode 100644 (file)
index 02450d6..0000000
+++ /dev/null
@@ -1,26 +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.jcr.ui.explorer.utils;
-
-import java.util.Comparator;
-
-import org.argeo.eclipse.ui.TreeParent;
-
-public class TreeObjectsComparator implements Comparator<TreeParent> {
-       public int compare(TreeParent o1, TreeParent o2) {
-               return o1.getName().compareTo(o2.getName());
-       }
-}
\ No newline at end of file
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/views/GenericJcrBrowser.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/views/GenericJcrBrowser.java
deleted file mode 100644 (file)
index f401ae8..0000000
+++ /dev/null
@@ -1,357 +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.jcr.ui.explorer.views;
-
-import java.util.List;
-
-import javax.jcr.Property;
-import javax.jcr.PropertyType;
-import javax.jcr.Repository;
-import javax.jcr.RepositoryException;
-import javax.jcr.RepositoryFactory;
-import javax.jcr.Session;
-import javax.jcr.Value;
-import javax.jcr.observation.Event;
-import javax.jcr.observation.EventListener;
-import javax.jcr.observation.ObservationManager;
-
-import org.argeo.ArgeoException;
-import org.argeo.eclipse.ui.TreeParent;
-import org.argeo.eclipse.ui.jcr.AsyncUiEventListener;
-import org.argeo.eclipse.ui.jcr.utils.NodeViewerComparer;
-import org.argeo.eclipse.ui.jcr.views.AbstractJcrBrowser;
-import org.argeo.jcr.RepositoryRegister;
-import org.argeo.jcr.ui.explorer.JcrExplorerPlugin;
-import org.argeo.jcr.ui.explorer.browser.NodeContentProvider;
-import org.argeo.jcr.ui.explorer.browser.NodeLabelProvider;
-import org.argeo.jcr.ui.explorer.browser.PropertiesContentProvider;
-import org.argeo.jcr.ui.explorer.model.SingleJcrNodeElem;
-import org.argeo.jcr.ui.explorer.utils.GenericNodeDoubleClickListener;
-import org.argeo.jcr.ui.explorer.utils.JcrUiUtils;
-import org.argeo.util.security.Keyring;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.viewers.ColumnLabelProvider;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TableViewerColumn;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Menu;
-
-/**
- * Basic View to display a sash form to browse a JCR compliant multirepository
- * environment
- */
-public class GenericJcrBrowser extends AbstractJcrBrowser {
-       public final static String ID = JcrExplorerPlugin.ID + ".browserView";
-       private boolean sortChildNodes = true;
-
-       /* DEPENDENCY INJECTION */
-       private Keyring keyring;
-       private RepositoryRegister repositoryRegister;
-       private RepositoryFactory repositoryFactory;
-       private Repository nodeRepository;
-       /**
-        * A session of the logged in user on the default workspace of the node
-        * repository.
-        */
-       private Session userSession;
-
-       // This page widgets
-       private TreeViewer nodesViewer;
-       private NodeContentProvider nodeContentProvider;
-       private TableViewer propertiesViewer;
-       private EventListener resultsObserver;
-
-       @Override
-       public void createPartControl(Composite parent) {
-               parent.setLayout(new FillLayout());
-               SashForm sashForm = new SashForm(parent, SWT.VERTICAL);
-               sashForm.setSashWidth(4);
-               sashForm.setLayout(new FillLayout());
-
-               // Create the tree on top of the view
-               Composite top = new Composite(sashForm, SWT.NONE);
-               GridLayout gl = new GridLayout(1, false);
-               top.setLayout(gl);
-
-               try {
-                       this.userSession = this.nodeRepository.login();
-               } catch (RepositoryException e) {
-                       throw new ArgeoException("Cannot open user session", e);
-               }
-
-               nodeContentProvider = new NodeContentProvider(userSession, keyring,
-                               repositoryRegister, repositoryFactory, sortChildNodes);
-
-               // nodes viewer
-               nodesViewer = createNodeViewer(top, nodeContentProvider);
-
-               // context menu : it is completely defined in the plugin.xml file.
-               MenuManager menuManager = new MenuManager();
-               Menu menu = menuManager.createContextMenu(nodesViewer.getTree());
-
-               nodesViewer.getTree().setMenu(menu);
-               getSite().registerContextMenu(menuManager, nodesViewer);
-               getSite().setSelectionProvider(nodesViewer);
-
-               nodesViewer.setInput(getViewSite());
-
-               // Create the property viewer on the bottom
-               Composite bottom = new Composite(sashForm, SWT.NONE);
-               bottom.setLayout(new GridLayout(1, false));
-               propertiesViewer = createPropertiesViewer(bottom);
-
-               sashForm.setWeights(getWeights());
-               nodesViewer.setComparer(new NodeViewerComparer());
-       }
-
-       @Override
-       public void refresh(Object obj) {
-               // Enable full refresh from a command when no element of the tree is
-               // selected
-               if (obj == null) {
-                       Object[] elements = nodeContentProvider.getElements(null);
-                       for (Object el : elements) {
-                               if (el instanceof TreeParent)
-                                       JcrUiUtils.forceRefreshIfNeeded((TreeParent) el);
-                               getNodeViewer().refresh(el);
-                       }
-               }
-               super.refresh(obj);
-       }
-
-       /**
-        * To be overridden to adapt size of form and result frames.
-        */
-       protected int[] getWeights() {
-               return new int[] { 70, 30 };
-       }
-
-       protected TreeViewer createNodeViewer(Composite parent,
-                       final ITreeContentProvider nodeContentProvider) {
-
-               final TreeViewer tmpNodeViewer = new TreeViewer(parent, SWT.MULTI);
-
-               tmpNodeViewer.getTree().setLayoutData(
-                               new GridData(SWT.FILL, SWT.FILL, true, true));
-
-               tmpNodeViewer.setContentProvider(nodeContentProvider);
-               tmpNodeViewer.setLabelProvider(new NodeLabelProvider());
-               tmpNodeViewer
-                               .addSelectionChangedListener(new ISelectionChangedListener() {
-                                       public void selectionChanged(SelectionChangedEvent event) {
-                                               if (!event.getSelection().isEmpty()) {
-                                                       IStructuredSelection sel = (IStructuredSelection) event
-                                                                       .getSelection();
-                                                       Object firstItem = sel.getFirstElement();
-                                                       if (firstItem instanceof SingleJcrNodeElem)
-                                                               propertiesViewer
-                                                                               .setInput(((SingleJcrNodeElem) firstItem)
-                                                                                               .getNode());
-                                               } else {
-                                                       propertiesViewer.setInput(getViewSite());
-                                               }
-                                       }
-                               });
-
-               resultsObserver = new TreeObserver(tmpNodeViewer.getTree().getDisplay());
-               if (keyring != null)
-                       try {
-                               ObservationManager observationManager = userSession
-                                               .getWorkspace().getObservationManager();
-                               observationManager.addEventListener(resultsObserver,
-                                               Event.PROPERTY_ADDED | Event.PROPERTY_CHANGED, "/",
-                                               true, null, null, false);
-                       } catch (RepositoryException e) {
-                               throw new ArgeoException("Cannot register listeners", e);
-                       }
-
-               tmpNodeViewer
-                               .addDoubleClickListener(new GenericNodeDoubleClickListener(
-                                               tmpNodeViewer));
-               return tmpNodeViewer;
-       }
-
-       protected TableViewer createPropertiesViewer(Composite parent) {
-               propertiesViewer = new TableViewer(parent);
-               propertiesViewer.getTable().setLayoutData(
-                               new GridData(SWT.FILL, SWT.FILL, true, true));
-               propertiesViewer.getTable().setHeaderVisible(true);
-               propertiesViewer.setContentProvider(new PropertiesContentProvider());
-               TableViewerColumn col = new TableViewerColumn(propertiesViewer,
-                               SWT.NONE);
-               col.getColumn().setText("Name");
-               col.getColumn().setWidth(200);
-               col.setLabelProvider(new ColumnLabelProvider() {
-                       public String getText(Object element) {
-                               try {
-                                       return ((Property) element).getName();
-                               } catch (RepositoryException e) {
-                                       throw new ArgeoException(
-                                                       "Unexpected exception in label provider", e);
-                               }
-                       }
-               });
-               col = new TableViewerColumn(propertiesViewer, SWT.NONE);
-               col.getColumn().setText("Value");
-               col.getColumn().setWidth(400);
-               col.setLabelProvider(new ColumnLabelProvider() {
-                       public String getText(Object element) {
-                               try {
-                                       Property property = (Property) element;
-                                       if (property.getType() == PropertyType.BINARY)
-                                               return "<binary>";
-                                       else if (property.isMultiple()) {
-                                               StringBuffer buf = new StringBuffer("[");
-                                               Value[] values = property.getValues();
-                                               for (int i = 0; i < values.length; i++) {
-                                                       if (i != 0)
-                                                               buf.append(", ");
-                                                       buf.append(values[i].getString());
-                                               }
-                                               buf.append(']');
-                                               return buf.toString();
-                                       } else
-                                               return property.getValue().getString();
-                               } catch (RepositoryException e) {
-                                       throw new ArgeoException(
-                                                       "Unexpected exception in label provider", e);
-                               }
-                       }
-               });
-               col = new TableViewerColumn(propertiesViewer, SWT.NONE);
-               col.getColumn().setText("Type");
-               col.getColumn().setWidth(200);
-               col.setLabelProvider(new ColumnLabelProvider() {
-                       public String getText(Object element) {
-                               try {
-                                       return PropertyType.nameFromValue(((Property) element)
-                                                       .getType());
-                               } catch (RepositoryException e) {
-                                       throw new ArgeoException(
-                                                       "Unexpected exception in label provider", e);
-                               }
-                       }
-               });
-               propertiesViewer.setInput(getViewSite());
-               return propertiesViewer;
-       }
-
-       @Override
-       public void dispose() {
-               super.dispose();
-       }
-
-       @Override
-       protected TreeViewer getNodeViewer() {
-               return nodesViewer;
-       }
-
-       /**
-        * Resets the tree content provider
-        * 
-        * @param sortChildNodes
-        *            if true the content provider will use a comparer to sort nodes
-        *            that might slow down the display
-        * */
-       public void setSortChildNodes(boolean sortChildNodes) {
-               this.sortChildNodes = sortChildNodes;
-               ((NodeContentProvider) nodesViewer.getContentProvider())
-                               .setSortChildren(sortChildNodes);
-               nodesViewer.setInput(getViewSite());
-       }
-
-       /** Notifies the current view that a node has been added */
-       public void nodeAdded(TreeParent parentNode) {
-               // insure that Ui objects have been correctly created:
-               JcrUiUtils.forceRefreshIfNeeded(parentNode);
-               getNodeViewer().refresh(parentNode);
-               getNodeViewer().expandToLevel(parentNode, 1);
-       }
-
-       /** Notifies the current view that a node has been removed */
-       public void nodeRemoved(TreeParent parentNode) {
-               IStructuredSelection newSel = new StructuredSelection(parentNode);
-               getNodeViewer().setSelection(newSel, true);
-               // Force refresh
-               IStructuredSelection tmpSel = (IStructuredSelection) getNodeViewer()
-                               .getSelection();
-               getNodeViewer().refresh(tmpSel.getFirstElement());
-       }
-
-       class TreeObserver extends AsyncUiEventListener {
-
-               public TreeObserver(Display display) {
-                       super(display);
-               }
-
-               @Override
-               protected Boolean willProcessInUiThread(List<Event> events)
-                               throws RepositoryException {
-                       for (Event event : events) {
-                               if (getLog().isTraceEnabled())
-                                       getLog().debug("Received event " + event);
-                               String path = event.getPath();
-                               int index = path.lastIndexOf('/');
-                               String propertyName = path.substring(index + 1);
-                               if (getLog().isTraceEnabled())
-                                       getLog().debug("Concerned property " + propertyName);
-                       }
-                       return false;
-               }
-
-               protected void onEventInUiThread(List<Event> events)
-                               throws RepositoryException {
-                       if (getLog().isTraceEnabled())
-                               getLog().trace("Refresh result list");
-                       nodesViewer.refresh();
-               }
-
-       }
-
-       public boolean getSortChildNodes() {
-               return sortChildNodes;
-       }
-
-       /* DEPENDENCY INJECTION */
-       public void setRepositoryRegister(RepositoryRegister repositoryRegister) {
-               this.repositoryRegister = repositoryRegister;
-       }
-
-       public void setKeyring(Keyring keyring) {
-               this.keyring = keyring;
-       }
-
-       public void setRepositoryFactory(RepositoryFactory repositoryFactory) {
-               this.repositoryFactory = repositoryFactory;
-       }
-
-       public void setNodeRepository(Repository nodeRepository) {
-               this.nodeRepository = nodeRepository;
-       }
-
-}
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/wizards/ChangeRightsWizard.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/wizards/ChangeRightsWizard.java
deleted file mode 100644 (file)
index 4381837..0000000
+++ /dev/null
@@ -1,66 +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.jcr.ui.explorer.wizards;
-
-import javax.jcr.RepositoryException;
-import javax.jcr.Session;
-
-import org.argeo.ArgeoException;
-import org.argeo.jcr.JcrUtils;
-import org.eclipse.jface.wizard.Wizard;
-
-/**
- * Small wizard to manage authorizations on the root node of the current
- * workspace
- */
-public class ChangeRightsWizard extends Wizard {
-
-       private Session currentSession;
-       private String path;
-
-       // This page widget
-       private ChooseRightsPage page;
-
-       public ChangeRightsWizard(Session currentSession, String path) {
-               super();
-               this.currentSession = currentSession;
-               this.path = path;
-       }
-
-       @Override
-       public void addPages() {
-               try {
-                       page = new ChooseRightsPage(path);
-                       addPage(page);
-               } catch (Exception e) {
-                       throw new ArgeoException("Cannot add page to wizard ", e);
-               }
-       }
-
-       @Override
-       public boolean performFinish() {
-               if (!canFinish())
-                       return false;
-               try {
-                       JcrUtils.addPrivilege(currentSession, path, page.getGroupName(),
-                                       page.getAuthTypeStr());
-               } catch (RepositoryException re) {
-                       throw new ArgeoException(
-                                       "Unexpected error while setting privileges", re);
-               }
-               return true;
-       }
-}
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/wizards/ChooseRightsPage.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/wizards/ChooseRightsPage.java
deleted file mode 100644 (file)
index 69948ce..0000000
+++ /dev/null
@@ -1,101 +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.jcr.ui.explorer.wizards;
-
-import javax.jcr.security.Privilege;
-
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-
-public class ChooseRightsPage extends WizardPage implements ModifyListener {
-
-       // This page widget
-       private Text groupNameTxt;
-       private Combo authorizationCmb;
-
-       // USABLE SHORTCUTS
-       protected final static String[] validAuthType = { Privilege.JCR_READ,
-                       Privilege.JCR_WRITE, Privilege.JCR_ALL };
-
-       public ChooseRightsPage(String path) {
-               super("Main");
-               setTitle("Add privilege to " + path);
-       }
-
-       public void createControl(Composite parent) {
-               // specify subject
-               Composite composite = new Composite(parent, SWT.NONE);
-               composite.setLayout(new GridLayout(2, false));
-               Label lbl = new Label(composite, SWT.LEAD);
-               lbl.setText("Group or user name (no blank, no special chars)");
-               lbl.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
-               groupNameTxt = new Text(composite, SWT.LEAD | SWT.BORDER);
-               groupNameTxt.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true,
-                               false));
-               if (groupNameTxt != null)
-                       groupNameTxt.addModifyListener(this);
-
-               // Choose rigths
-               new Label(composite, SWT.NONE).setText("Choose corresponding rights");
-               authorizationCmb = new Combo(composite, SWT.BORDER | SWT.V_SCROLL);
-               authorizationCmb.setItems(validAuthType);
-               GridData gd = new GridData(GridData.FILL_HORIZONTAL);
-               authorizationCmb.setLayoutData(gd);
-
-               authorizationCmb.select(0);
-
-               // Compulsory
-               setControl(composite);
-       }
-
-       protected String getGroupName() {
-               return groupNameTxt.getText();
-       }
-
-       protected String getAuthTypeStr() {
-               return authorizationCmb.getItem(authorizationCmb.getSelectionIndex());
-       }
-
-       public void modifyText(ModifyEvent event) {
-               String message = checkComplete();
-               if (message != null)
-                       setMessage(message, WizardPage.ERROR);
-               else {
-                       setMessage("Complete", WizardPage.INFORMATION);
-                       setPageComplete(true);
-               }
-       }
-
-       /** @return error message or null if complete */
-       protected String checkComplete() {
-               String groupStr = groupNameTxt.getText();
-               if (groupStr == null || "".equals(groupStr))
-                       return "Please enter the name of the corresponding group.";
-               // Remove regexp check for the time being.
-               // else if (!match(groupStr))
-               // return
-               // "Please use only alphanumerical chars for the short technical name.";
-               return null;
-       }
-}
diff --git a/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/wizards/ImportFileSystemWizard.java b/org.argeo.jcr.ui.explorer/src/org/argeo/jcr/ui/explorer/wizards/ImportFileSystemWizard.java
deleted file mode 100644 (file)
index 127c2cd..0000000
+++ /dev/null
@@ -1,237 +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.jcr.ui.explorer.wizards;
-
-import java.io.File;
-import java.io.FileInputStream;
-
-import javax.jcr.Binary;
-import javax.jcr.Node;
-import javax.jcr.Property;
-import javax.jcr.nodetype.NodeType;
-
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.argeo.ArgeoException;
-import org.argeo.eclipse.ui.ErrorFeedback;
-import org.argeo.eclipse.ui.specific.ImportToServerWizardPage;
-import org.argeo.eclipse.ui.specific.UploadFileWizardPage;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.wizard.Wizard;
-
-public class ImportFileSystemWizard extends Wizard {
-       private final static Log log = LogFactory
-                       .getLog(ImportFileSystemWizard.class);
-
-       private UploadFileWizardPage importPage;
-       private final Node folder;
-
-       public ImportFileSystemWizard(Node folder) {
-               this.folder = folder;
-               setWindowTitle("Import from file system");
-       }
-
-       @Override
-       public void addPages() {
-               importPage = new UploadFileWizardPage();
-               addPage(importPage);
-               setNeedsProgressMonitor(importPage.getNeedsProgressMonitor());
-       }
-
-       /**
-        * Called when the user click on 'Finish' in the wizard. The real upload to
-        * the JCR repository is done here.
-        */
-       @Override
-       public boolean performFinish() {
-
-               // Initialization
-               final String objectType = importPage.getObjectType();
-               final String objectPath = importPage.getObjectPath();
-
-               // We do not display a progress bar for one file only
-               if (ImportToServerWizardPage.FILE_ITEM_TYPE.equals(objectType)) {
-                       // In Rap we must force the "real" upload of the file
-                       importPage.performFinish();
-                       try {
-                               Node fileNode = folder.addNode(importPage.getObjectName(),
-                                               NodeType.NT_FILE);
-                               Node resNode = fileNode.addNode(Property.JCR_CONTENT,
-                                               NodeType.NT_RESOURCE);
-                               Binary binary = null;
-                               try {
-                                       binary = folder.getSession().getValueFactory()
-                                                       .createBinary(importPage.getFileInputStream());
-                                       resNode.setProperty(Property.JCR_DATA, binary);
-                               } finally {
-                                       if (binary != null)
-                                               binary.dispose();
-                                       IOUtils.closeQuietly(importPage.getFileInputStream());
-                               }
-                               folder.getSession().save();
-                       } catch (Exception e) {
-                               e.printStackTrace();
-                               return false;
-                       }
-                       return true;
-               } else if (ImportToServerWizardPage.FOLDER_ITEM_TYPE.equals(objectType)) {
-                       if (objectPath == null || !new File(objectPath).exists()) {
-                               ErrorFeedback.show("Directory " + objectPath
-                                               + " does not exist");
-                               return false;
-                       }
-
-                       Boolean failed = false;
-                       final File dir = new File(objectPath).getAbsoluteFile();
-                       final Long sizeB = directorySize(dir, 0l);
-                       final Stats stats = new Stats();
-                       Long begin = System.currentTimeMillis();
-                       try {
-                               getContainer().run(true, true, new IRunnableWithProgress() {
-                                       public void run(IProgressMonitor monitor) {
-                                               try {
-                                                       Integer sizeKB = (int) (sizeB / FileUtils.ONE_KB);
-                                                       monitor.beginTask("", sizeKB);
-                                                       importDirectory(folder, dir, monitor, stats);
-                                                       monitor.done();
-                                               } catch (Exception e) {
-                                                       if (e instanceof RuntimeException)
-                                                               throw (RuntimeException) e;
-                                                       else
-                                                               throw new ArgeoException("Cannot import "
-                                                                               + objectPath, e);
-                                               }
-                                       }
-                               });
-                       } catch (Exception e) {
-                               ErrorFeedback.show("Cannot import " + objectPath, e);
-                               failed = true;
-                       }
-
-                       Long duration = System.currentTimeMillis() - begin;
-                       Long durationS = duration / 1000l;
-                       String durationStr = (durationS / 60) + " min " + (durationS % 60)
-                                       + " s";
-                       StringBuffer message = new StringBuffer("Imported\n");
-                       message.append(stats.fileCount).append(" files\n");
-                       message.append(stats.dirCount).append(" directories\n");
-                       message.append(FileUtils.byteCountToDisplaySize(stats.sizeB));
-                       if (failed)
-                               message.append(" of planned ").append(
-                                               FileUtils.byteCountToDisplaySize(sizeB));
-                       message.append("\n");
-                       message.append("in ").append(durationStr).append("\n");
-                       if (failed)
-                               MessageDialog.openError(getShell(), "Import failed",
-                                               message.toString());
-                       else
-                               MessageDialog.openInformation(getShell(), "Import successful",
-                                               message.toString());
-
-                       return true;
-               }
-               return false;
-
-       }
-
-       /** Recursively computes the size of the directory in bytes. */
-       protected Long directorySize(File dir, Long currentSize) {
-               Long size = currentSize;
-               File[] files = dir.listFiles();
-               for (File file : files) {
-                       if (file.isDirectory()) {
-                               size = directorySize(file, size);
-                       } else {
-                               size = size + file.length();
-                       }
-               }
-               return size;
-       }
-
-       /**
-        * Import recursively a directory and its content to the repository.
-        */
-       protected void importDirectory(Node folder, File dir,
-                       IProgressMonitor monitor, Stats stats) {
-               try {
-                       File[] files = dir.listFiles();
-                       for (File file : files) {
-                               if (file.isDirectory()) {
-                                       Node childFolder = folder.addNode(file.getName(),
-                                                       NodeType.NT_FOLDER);
-                                       importDirectory(childFolder, file, monitor, stats);
-                                       folder.getSession().save();
-                                       stats.dirCount++;
-                               } else {
-                                       Long fileSize = file.length();
-
-                                       // we skip tempory files that are created by apps when a
-                                       // file is being edited.
-                                       // TODO : make this configurable.
-                                       if (file.getName().lastIndexOf('~') != file.getName()
-                                                       .length() - 1) {
-
-                                               monitor.subTask(file.getName() + " ("
-                                                               + FileUtils.byteCountToDisplaySize(fileSize)
-                                                               + ") " + file.getCanonicalPath());
-                                               try {
-                                                       Node fileNode = folder.addNode(file.getName(),
-                                                                       NodeType.NT_FILE);
-                                                       Node resNode = fileNode.addNode(
-                                                                       Property.JCR_CONTENT, NodeType.NT_RESOURCE);
-                                                       Binary binary = null;
-                                                       try {
-                                                               binary = folder
-                                                                               .getSession()
-                                                                               .getValueFactory()
-                                                                               .createBinary(new FileInputStream(file));
-                                                               resNode.setProperty(Property.JCR_DATA, binary);
-                                                       } finally {
-                                                               if (binary != null)
-                                                                       binary.dispose();
-                                                       }
-                                                       folder.getSession().save();
-                                                       stats.fileCount++;
-                                                       stats.sizeB = stats.sizeB + fileSize;
-                                               } catch (Exception e) {
-                                                       log.warn("Import of "
-                                                                       + file
-                                                                       + " ("
-                                                                       + FileUtils
-                                                                                       .byteCountToDisplaySize(fileSize)
-                                                                       + ") failed: " + e);
-                                                       folder.getSession().refresh(false);
-                                               }
-                                               monitor.worked((int) (fileSize / FileUtils.ONE_KB));
-                                       }
-                               }
-                       }
-               } catch (Exception e) {
-                       throw new ArgeoException("Cannot import " + dir + " to " + folder,
-                                       e);
-               }
-       }
-
-       static class Stats {
-               public Long fileCount = 0l;
-               public Long dirCount = 0l;
-               public Long sizeB = 0l;
-       }
-}
diff --git a/org.argeo.osgi.ui.explorer/.classpath b/org.argeo.osgi.ui.explorer/.classpath
deleted file mode 100644 (file)
index d2953a6..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-       <classpathentry kind="src" path="src" />
-       <classpathentry kind="con"
-               path="org.eclipse.pde.core.requiredPlugins" />
-       <classpathentry kind="con"
-               path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6" />
-       <classpathentry kind="output" path="bin" />
-</classpath>
diff --git a/org.argeo.osgi.ui.explorer/.project b/org.argeo.osgi.ui.explorer/.project
deleted file mode 100644 (file)
index 1a4f4d3..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-       <name>org.argeo.osgi.ui.explorer</name>
-       <comment></comment>
-       <projects>
-       </projects>
-       <buildSpec>
-               <buildCommand>
-                       <name>org.eclipse.jdt.core.javabuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>org.eclipse.pde.ManifestBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>org.eclipse.pde.SchemaBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-       </buildSpec>
-       <natures>
-               <nature>org.eclipse.pde.PluginNature</nature>
-               <nature>org.eclipse.jdt.core.javanature</nature>
-       </natures>
-</projectDescription>
diff --git a/org.argeo.osgi.ui.explorer/.settings/org.eclipse.jdt.core.prefs b/org.argeo.osgi.ui.explorer/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644 (file)
index 9916a22..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#Sun Sep 04 16:04:00 CEST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/org.argeo.osgi.ui.explorer/bnd.bnd b/org.argeo.osgi.ui.explorer/bnd.bnd
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/org.argeo.osgi.ui.explorer/build.properties b/org.argeo.osgi.ui.explorer/build.properties
deleted file mode 100644 (file)
index 4f799f2..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-source.. = src/main/java/
-output.. = target/classes/
-bin.includes = META-INF/,\
-               .,\
-               icons/,\
-               plugin.xml
diff --git a/org.argeo.osgi.ui.explorer/icons/active.gif b/org.argeo.osgi.ui.explorer/icons/active.gif
deleted file mode 100644 (file)
index 7d24707..0000000
Binary files a/org.argeo.osgi.ui.explorer/icons/active.gif and /dev/null differ
diff --git a/org.argeo.osgi.ui.explorer/icons/bundles.gif b/org.argeo.osgi.ui.explorer/icons/bundles.gif
deleted file mode 100644 (file)
index e9a6bd9..0000000
Binary files a/org.argeo.osgi.ui.explorer/icons/bundles.gif and /dev/null differ
diff --git a/org.argeo.osgi.ui.explorer/icons/installed.gif b/org.argeo.osgi.ui.explorer/icons/installed.gif
deleted file mode 100644 (file)
index 2988716..0000000
Binary files a/org.argeo.osgi.ui.explorer/icons/installed.gif and /dev/null differ
diff --git a/org.argeo.osgi.ui.explorer/icons/osgi_explorer.gif b/org.argeo.osgi.ui.explorer/icons/osgi_explorer.gif
deleted file mode 100644 (file)
index e9a6bd9..0000000
Binary files a/org.argeo.osgi.ui.explorer/icons/osgi_explorer.gif and /dev/null differ
diff --git a/org.argeo.osgi.ui.explorer/icons/resolved.gif b/org.argeo.osgi.ui.explorer/icons/resolved.gif
deleted file mode 100644 (file)
index f4a1ea1..0000000
Binary files a/org.argeo.osgi.ui.explorer/icons/resolved.gif and /dev/null differ
diff --git a/org.argeo.osgi.ui.explorer/icons/starting.gif b/org.argeo.osgi.ui.explorer/icons/starting.gif
deleted file mode 100644 (file)
index 563743d..0000000
Binary files a/org.argeo.osgi.ui.explorer/icons/starting.gif and /dev/null differ
diff --git a/org.argeo.osgi.ui.explorer/plugin.xml b/org.argeo.osgi.ui.explorer/plugin.xml
deleted file mode 100644 (file)
index c0815ca..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.4"?>
-<plugin>
-   <extension
-         point="org.eclipse.ui.perspectives">
-      <perspective
-            name="Monitoring"
-            class="org.argeo.osgi.ui.explorer.OsgiExplorerPerspective"
-            id="org.argeo.osgi.ui.explorer.perspective"
-            icon="icons/osgi_explorer.gif">
-      </perspective>
-   </extension>
-    <extension point="org.eclipse.ui.perspectiveExtensions"> 
-        <perspectiveExtension 
-            targetID="org.argeo.osgi.ui.explorer.perspective"> 
-            <view id="org.argeo.osgi.ui.explorer.bundlesView" minimized="false"
-             ratio="0.5" relationship="left" relative="org.eclipse.ui.editorss"/> 
-            <view id="org.argeo.osgi.ui.explorer.modulesView" minimized="false"
-             relationship="stack" relative="org.argeo.osgi.ui.explorer.bundlesView"/> 
-        </perspectiveExtension> 
-    </extension> 
-   <extension
-         point="org.eclipse.ui.views">
-      <view
-            class="org.argeo.osgi.ui.explorer.views.ModulesView"
-            icon="icons/bundles.gif"
-            id="org.argeo.osgi.ui.explorer.modulesView"
-            name="Modules">
-      </view>
-      <view
-            class="org.argeo.osgi.ui.explorer.views.BundlesView"
-            icon="icons/bundles.gif"
-            id="org.argeo.osgi.ui.explorer.bundlesView"
-            name="Bundles">
-      </view>
-   </extension>
-  <extension
-           point="org.eclipse.ui.activities">
-        <activityPatternBinding
-              activityId="org.argeo.security.ui.adminActivity"
-              isEqualityPattern="true"
-              pattern="org.argeo.osgi.ui.explorer/org.argeo.osgi.ui.explorer.perspective">
-        </activityPatternBinding>
-     </extension>
-</plugin>
diff --git a/org.argeo.osgi.ui.explorer/pom.xml b/org.argeo.osgi.ui.explorer/pom.xml
deleted file mode 100644 (file)
index a7c6add..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-       <modelVersion>4.0.0</modelVersion>
-       <parent>
-               <groupId>org.argeo.commons</groupId>
-               <version>2.1.12-SNAPSHOT</version>
-               <artifactId>argeo-commons</artifactId>
-               <relativePath>..</relativePath>
-       </parent>
-       <artifactId>org.argeo.osgi.ui.explorer</artifactId>
-       <name>Commons OSGi Explorer</name>
-       <build>
-               <plugins>
-                       <plugin>
-                               <groupId>org.apache.felix</groupId>
-                               <artifactId>maven-bundle-plugin</artifactId>
-                               <configuration>
-                                       <instructions>
-                                               <Bundle-SymbolicName>${project.artifactId};singleton:=true</Bundle-SymbolicName>
-                                               <Bundle-ActivationPolicy>lazy</Bundle-ActivationPolicy>
-                                               <Bundle-Activator>org.argeo.osgi.ui.explorer.OsgiExplorerPlugin</Bundle-Activator>
-                                               <Require-Bundle>org.eclipse.ui;resolution:=optional,
-                                                       org.eclipse.rap.ui;resolution:=optional,
-                                                       org.eclipse.core.runtime</Require-Bundle>
-                                               <Export-Package>org.argeo.osgi.ui.explorer.*</Export-Package>
-                                       </instructions>
-                               </configuration>
-                       </plugin>
-               </plugins>
-       </build>
-       <dependencies>
-               <dependency>
-                       <groupId>org.argeo.tp</groupId>
-                       <artifactId>org.eclipse.osgi</artifactId>
-                       <scope>provided</scope>
-               </dependency>
-
-               <dependency>
-                       <groupId>org.argeo.commons</groupId>
-                       <artifactId>org.argeo.eclipse.ui</artifactId>
-                       <version>2.1.12-SNAPSHOT</version>
-               </dependency>
-
-               <!-- RAP only dependency, needed at compile time -->
-               <dependency>
-                       <groupId>org.argeo.commons</groupId>
-                       <artifactId>org.argeo.eclipse.dep.rap</artifactId>
-                       <type>pom</type>
-                       <version>2.1.12-SNAPSHOT</version>
-                       <scope>provided</scope>
-               </dependency>
-               <dependency>
-                       <groupId>org.argeo.commons</groupId>
-                       <artifactId>org.argeo.eclipse.ui.rcp</artifactId>
-                       <version>2.1.12-SNAPSHOT</version>
-                       <scope>provided</scope>
-               </dependency>
-       </dependencies>
-</project>
diff --git a/org.argeo.osgi.ui.explorer/src/org/argeo/osgi/ui/explorer/OsgiExplorerImages.java b/org.argeo.osgi.ui.explorer/src/org/argeo/osgi/ui/explorer/OsgiExplorerImages.java
deleted file mode 100644 (file)
index 77bdfe9..0000000
+++ /dev/null
@@ -1,30 +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.osgi.ui.explorer;
-
-import org.eclipse.swt.graphics.Image;
-
-/** Shared icons. */
-public class OsgiExplorerImages {
-       public final static Image INSTALLED = OsgiExplorerPlugin
-                       .getImageDescriptor("icons/installed.gif").createImage();
-       public final static Image RESOLVED = OsgiExplorerPlugin.getImageDescriptor(
-                       "icons/resolved.gif").createImage();
-       public final static Image STARTING = OsgiExplorerPlugin.getImageDescriptor(
-                       "icons/starting.gif").createImage();
-       public final static Image ACTIVE = OsgiExplorerPlugin.getImageDescriptor(
-                       "icons/active.gif").createImage();
-}
diff --git a/org.argeo.osgi.ui.explorer/src/org/argeo/osgi/ui/explorer/OsgiExplorerPerspective.java b/org.argeo.osgi.ui.explorer/src/org/argeo/osgi/ui/explorer/OsgiExplorerPerspective.java
deleted file mode 100644 (file)
index 153abcd..0000000
+++ /dev/null
@@ -1,30 +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.osgi.ui.explorer;
-
-import org.eclipse.ui.IPageLayout;
-import org.eclipse.ui.IPerspectiveFactory;
-
-/** OSGi explorer perspective (to be enriched declaratively) */
-public class OsgiExplorerPerspective implements IPerspectiveFactory {
-
-       public void createInitialLayout(IPageLayout layout) {
-               layout.setEditorAreaVisible(true);
-               layout.setFixed(false);
-
-       }
-
-}
diff --git a/org.argeo.osgi.ui.explorer/src/org/argeo/osgi/ui/explorer/OsgiExplorerPlugin.java b/org.argeo.osgi.ui.explorer/src/org/argeo/osgi/ui/explorer/OsgiExplorerPlugin.java
deleted file mode 100644 (file)
index 80146d1..0000000
+++ /dev/null
@@ -1,76 +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.osgi.ui.explorer;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class OsgiExplorerPlugin extends AbstractUIPlugin {
-
-       // The plug-in ID
-       public static final String PLUGIN_ID = "org.argeo.osgi.ui.explorer"; //$NON-NLS-1$
-
-       // The shared instance
-       private static OsgiExplorerPlugin plugin;
-
-       /**
-        * The constructor
-        */
-       public OsgiExplorerPlugin() {
-       }
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see
-        * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
-        * )
-        */
-       public void start(BundleContext context) throws Exception {
-               super.start(context);
-               plugin = this;
-       }
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see
-        * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
-        * )
-        */
-       public void stop(BundleContext context) throws Exception {
-               plugin = null;
-               super.stop(context);
-       }
-
-       /**
-        * Returns the shared instance
-        * 
-        * @return the shared instance
-        */
-       public static OsgiExplorerPlugin getDefault() {
-               return plugin;
-       }
-
-       public static ImageDescriptor getImageDescriptor(String path) {
-               return imageDescriptorFromPlugin(PLUGIN_ID, path);
-       }
-
-}
diff --git a/org.argeo.osgi.ui.explorer/src/org/argeo/osgi/ui/explorer/views/BundlesView.java b/org.argeo.osgi.ui.explorer/src/org/argeo/osgi/ui/explorer/views/BundlesView.java
deleted file mode 100644 (file)
index 98d74a6..0000000
+++ /dev/null
@@ -1,195 +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.osgi.ui.explorer.views;
-
-import java.util.Comparator;
-
-import org.argeo.eclipse.ui.ColumnViewerComparator;
-import org.argeo.eclipse.ui.specific.EclipseUiSpecificUtils;
-import org.argeo.osgi.ui.explorer.OsgiExplorerImages;
-import org.argeo.osgi.ui.explorer.OsgiExplorerPlugin;
-import org.eclipse.jface.viewers.ColumnLabelProvider;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TableViewerColumn;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.part.ViewPart;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-
-/**
- * Overview of the bundles as a table. Equivalent to Equinox 'ss' console
- * command.
- */
-public class BundlesView extends ViewPart {
-       private TableViewer viewer;
-
-       @Override
-       public void createPartControl(Composite parent) {
-               viewer = new TableViewer(parent);
-               viewer.setContentProvider(new BundleContentProvider());
-               viewer.getTable().setHeaderVisible(true);
-
-               EclipseUiSpecificUtils.enableToolTipSupport(viewer);
-
-               // ID
-               TableViewerColumn column = new TableViewerColumn(viewer, SWT.NONE);
-               column.getColumn().setWidth(30);
-               column.getColumn().setText("ID");
-               column.getColumn().setAlignment(SWT.RIGHT);
-               column.setLabelProvider(new ColumnLabelProvider() {
-                       public String getText(Object element) {
-                               return Long.toString(((Bundle) element).getBundleId());
-                       }
-               });
-               new ColumnViewerComparator<Bundle>(column, new Comparator<Bundle>() {
-                       public int compare(Bundle o1, Bundle o2) {
-                               return (int) (o1.getBundleId() - o2.getBundleId());
-                       }
-               });
-
-               // State
-               column = new TableViewerColumn(viewer, SWT.NONE);
-               column.getColumn().setWidth(18);
-               column.getColumn().setText("State");
-               column.setLabelProvider(new StateLabelProvider());
-               new ColumnViewerComparator<Bundle>(column, new Comparator<Bundle>() {
-                       public int compare(Bundle o1, Bundle o2) {
-                               return o1.getState() - o2.getState();
-                       }
-               });
-
-               // Symbolic name
-               column = new TableViewerColumn(viewer, SWT.NONE);
-               column.getColumn().setWidth(300);
-               column.getColumn().setText("Symbolic Name");
-               column.setLabelProvider(new ColumnLabelProvider() {
-                       public String getText(Object element) {
-                               return ((Bundle) element).getSymbolicName();
-                       }
-               });
-               new ColumnViewerComparator<Bundle>(column, new Comparator<Bundle>() {
-                       public int compare(Bundle o1, Bundle o2) {
-                               return o1.getSymbolicName().compareTo(o2.getSymbolicName());
-                       }
-               });
-
-               // Version
-               column = new TableViewerColumn(viewer, SWT.NONE);
-               column.getColumn().setWidth(150);
-               column.getColumn().setText("Version");
-               column.setLabelProvider(new ColumnLabelProvider() {
-                       public String getText(Object element) {
-                               return ((Bundle) element).getVersion().toString();
-                       }
-               });
-               new ColumnViewerComparator<Bundle>(column, new Comparator<Bundle>() {
-                       public int compare(Bundle o1, Bundle o2) {
-                               return o1.getVersion().compareTo(o2.getVersion());
-                       }
-               });
-
-               viewer.setInput(OsgiExplorerPlugin.getDefault().getBundle()
-                               .getBundleContext());
-
-       }
-
-       @Override
-       public void setFocus() {
-               if (viewer != null)
-                       viewer.getControl().setFocus();
-       }
-
-       /** Content provider managing the array of bundles */
-       private static class BundleContentProvider implements
-                       IStructuredContentProvider {
-               public Object[] getElements(Object inputElement) {
-                       if (inputElement instanceof BundleContext) {
-                               BundleContext bc = (BundleContext) inputElement;
-                               return bc.getBundles();
-                       }
-                       return null;
-               }
-
-               public void dispose() {
-               }
-
-               public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-               }
-
-       }
-
-       /** Label provider for the state column */
-       private static class StateLabelProvider extends ColumnLabelProvider {
-               @Override
-               public Image getImage(Object element) {
-                       Integer state = ((Bundle) element).getState();
-                       switch (state) {
-                       case Bundle.UNINSTALLED:
-                               return OsgiExplorerImages.INSTALLED;
-                       case Bundle.INSTALLED:
-                               return OsgiExplorerImages.INSTALLED;
-                       case Bundle.RESOLVED:
-                               return OsgiExplorerImages.RESOLVED;
-                       case Bundle.STARTING:
-                               return OsgiExplorerImages.STARTING;
-                       case Bundle.STOPPING:
-                               return OsgiExplorerImages.STARTING;
-                       case Bundle.ACTIVE:
-                               return OsgiExplorerImages.ACTIVE;
-                       default:
-                               return null;
-                       }
-               }
-
-               @Override
-               public String getText(Object element) {
-                       return null;
-               }
-
-               @Override
-               public String getToolTipText(Object element) {
-                       Bundle bundle = (Bundle) element;
-                       Integer state = bundle.getState();
-                       switch (state) {
-                       case Bundle.UNINSTALLED:
-                               return "UNINSTALLED";
-                       case Bundle.INSTALLED:
-                               return "INSTALLED";
-                       case Bundle.RESOLVED:
-                               return "RESOLVED";
-                       case Bundle.STARTING:
-                               String activationPolicy = bundle.getHeaders()
-                                               .get(Constants.BUNDLE_ACTIVATIONPOLICY).toString();
-                               if (activationPolicy != null
-                                               && activationPolicy.equals(Constants.ACTIVATION_LAZY))
-                                       return "<<LAZY>>";
-                               return "STARTING";
-                       case Bundle.STOPPING:
-                               return "STOPPING";
-                       case Bundle.ACTIVE:
-                               return "ACTIVE";
-                       default:
-                               return null;
-                       }
-               }
-
-       }
-}
diff --git a/org.argeo.osgi.ui.explorer/src/org/argeo/osgi/ui/explorer/views/ModulesView.java b/org.argeo.osgi.ui.explorer/src/org/argeo/osgi/ui/explorer/views/ModulesView.java
deleted file mode 100644 (file)
index 5d67bd4..0000000
+++ /dev/null
@@ -1,379 +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.osgi.ui.explorer.views;
-
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeMap;
-import java.util.TreeSet;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.argeo.eclipse.ui.TreeParent;
-import org.argeo.osgi.ui.explorer.OsgiExplorerPlugin;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.part.ViewPart;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.packageadmin.ExportedPackage;
-import org.osgi.service.packageadmin.PackageAdmin;
-
-/** <b>Experimental</b> The OSGi runtime from a module perspective. */
-public class ModulesView extends ViewPart {
-       private final static Log log = LogFactory.getLog(ModulesView.class);
-
-       private TreeViewer viewer;
-
-       private PackageAdmin packageAdmin;
-
-       private Comparator<ExportedPackage> exportedPackageComparator = new Comparator<ExportedPackage>() {
-
-               public int compare(ExportedPackage o1, ExportedPackage o2) {
-                       if (!o1.getName().equals(o2.getName()))
-                               return o1.getName().compareTo(o2.getName());
-                       else
-                               return o1.getVersion().compareTo(o2.getVersion());
-               }
-       };
-
-       @Override
-       public void createPartControl(Composite parent) {
-               viewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
-               viewer.setContentProvider(new ModulesContentProvider());
-               viewer.setLabelProvider(new ModulesLabelProvider());
-               viewer.setInput(OsgiExplorerPlugin.getDefault().getBundle()
-                               .getBundleContext());
-       }
-
-       @Override
-       public void setFocus() {
-               viewer.getTree().setFocus();
-       }
-
-       private class ModulesContentProvider implements ITreeContentProvider {
-
-               public Object[] getElements(Object inputElement) {
-                       return getChildren(inputElement);
-               }
-
-               public Object[] getChildren(Object parentElement) {
-                       if (parentElement instanceof BundleContext) {
-                               BundleContext bundleContext = (BundleContext) parentElement;
-                               Bundle[] bundles = bundleContext.getBundles();
-
-                               TreeParent bundlesNode = new TreeParent("Bundles");
-                               for (Bundle bundle : bundles) {
-                                       if (bundle.getState() == Bundle.ACTIVE)
-                                               bundlesNode.addChild(new BundleNode(bundle));
-                               }
-
-                               // scan packages
-                               ServiceReference paSr = bundleContext
-                                               .getServiceReference(PackageAdmin.class.getName());
-                               // TODO: make a cleaner referencing
-                               packageAdmin = (PackageAdmin) bundleContext.getService(paSr);
-
-                               Bundle bundle1 = null;
-                               Bundle bundle2 = null;
-
-                               Map<Bundle, Set<ExportedPackage>> importedPackages = new HashMap<Bundle, Set<ExportedPackage>>();
-                               Map<String, Set<ExportedPackage>> packages = new TreeMap<String, Set<ExportedPackage>>();
-                               for (Bundle bundle : bundles) {
-                                       if (bundle.getSymbolicName()
-                                                       .equals("org.argeo.security.ui"))
-                                               bundle1 = bundle;
-                                       if (bundle.getSymbolicName().equals(
-                                                       "org.argeo.security.equinox"))
-                                               bundle2 = bundle;
-
-                                       ExportedPackage[] pkgs = packageAdmin
-                                                       .getExportedPackages(bundle);
-                                       if (pkgs != null)
-                                               for (ExportedPackage pkg : pkgs) {
-                                                       if (!packages.containsKey(pkg.getName()))
-                                                               packages.put(pkg.getName(),
-                                                                               new TreeSet<ExportedPackage>(
-                                                                                               exportedPackageComparator));
-                                                       Set<ExportedPackage> expPackages = (Set<ExportedPackage>) packages
-                                                                       .get(pkg.getName());
-                                                       expPackages.add(pkg);
-
-                                                       // imported
-                                                       for (Bundle b : pkg.getImportingBundles()) {
-                                                               if (bundle.getBundleId() != b.getBundleId()) {
-                                                                       if (!importedPackages.containsKey(b))
-                                                                               importedPackages
-                                                                                               .put(b,
-                                                                                                               new TreeSet<ExportedPackage>(
-                                                                                                                               exportedPackageComparator));
-                                                                       Set<ExportedPackage> impPackages = (Set<ExportedPackage>) importedPackages
-                                                                                       .get(b);
-                                                                       impPackages.add(pkg);
-                                                               }
-                                                       }
-                                               }
-                               }
-
-                               TreeParent mPackageNode = new TreeParent("Multiple Packages");
-                               // TreeParent aPackageNode = new TreeParent("All Packages");
-                               for (String packageName : packages.keySet()) {
-                                       Set<ExportedPackage> pkgs = packages.get(packageName);
-                                       if (pkgs.size() > 1) {
-                                               MultiplePackagesNode mpn = new MultiplePackagesNode(
-                                                               packageName, pkgs);
-                                               mPackageNode.addChild(mpn);
-                                               // aPackageNode.addChild(mpn);
-                                       } else {
-                                               // aPackageNode.addChild(new ExportedPackageNode(pkgs
-                                               // .iterator().next()));
-                                       }
-                               }
-
-                               return new Object[] { bundlesNode, mPackageNode };// ,
-                                                                                                                                       // aPackageNode
-                                                                                                                                       // };
-                       } else if (parentElement instanceof TreeParent) {
-                               return ((TreeParent) parentElement).getChildren();
-                       } else {
-                               return null;
-                       }
-               }
-
-               public Object getParent(Object element) {
-                       // TODO Auto-generated method stub
-                       return null;
-               }
-
-               public boolean hasChildren(Object element) {
-                       if (element instanceof TreeParent) {
-                               return ((TreeParent) element).hasChildren();
-                       }
-                       return false;
-               }
-
-               public void dispose() {
-                       // TODO Auto-generated method stub
-
-               }
-
-               public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-                       // TODO Auto-generated method stub
-
-               }
-
-       }
-
-       protected Map<String, ExportedPackage> dependencySpace(Bundle bundle,
-                       Map<Bundle, Set<ExportedPackage>> importedPackages,
-                       Map<String, Set<String>> traces) {
-               log.debug("Dependency space for " + bundle.getSymbolicName());
-               Map<String, ExportedPackage> space = new TreeMap<String, ExportedPackage>();
-               fillDependencySpace(space, bundle, importedPackages,
-                               bundle.getSymbolicName(), traces);
-               return space;
-       }
-
-       /** Recursive */
-       protected void fillDependencySpace(Map<String, ExportedPackage> space,
-                       Bundle bundle, Map<Bundle, Set<ExportedPackage>> importedPackages,
-                       String currTrace, Map<String, Set<String>> traces) {
-               if (importedPackages.containsKey(bundle)) {
-                       Set<ExportedPackage> imports = importedPackages.get(bundle);
-                       // log.debug("## Fill dependency space for " + bundle + " : ");
-                       for (ExportedPackage pkg : imports) {
-                               if (!traces.containsKey(pkg.getName()))
-                                       traces.put(pkg.getName(), new TreeSet<String>());
-                               traces.get(pkg.getName()).add(currTrace);
-                               if (!space.containsKey(pkg.getName())) {
-                                       space.put(pkg.getName(), pkg);
-                                       Bundle exportingBundle = pkg.getExportingBundle();
-                                       // if (bundle.getBundleId() !=
-                                       // exportingBundle.getBundleId())
-                                       fillDependencySpace(space, exportingBundle,
-                                                       importedPackages, currTrace + " > "
-                                                                       + exportingBundle.getSymbolicName(), traces);
-                               }
-                       }
-               }
-       }
-
-       private class ModulesLabelProvider extends LabelProvider implements
-                       ITableLabelProvider {
-
-               public Image getColumnImage(Object element, int columnIndex) {
-                       // TODO Auto-generated method stub
-                       return null;
-               }
-
-               public String getColumnText(Object element, int columnIndex) {
-                       return getText(element);
-               }
-
-       }
-
-       class BundleNode extends TreeParent {
-               private final Bundle bundle;
-
-               public BundleNode(Bundle bundle) {
-                       super(bundle.getSymbolicName());
-                       this.bundle = bundle;
-
-                       // Registered services
-                       ServiceReference[] registeredServices = bundle
-                                       .getRegisteredServices();
-                       if (registeredServices != null) {
-                               TreeParent registeredServicesNode = new TreeParent(
-                                               "Registered Services");
-                               addChild(registeredServicesNode);
-                               for (ServiceReference sr : registeredServices) {
-                                       if (sr != null)
-                                               registeredServicesNode
-                                                               .addChild(new ServiceReferenceNode(sr));
-                               }
-                       }
-
-                       // Used services
-                       ServiceReference[] usedServices = bundle.getRegisteredServices();
-                       if (usedServices != null) {
-                               TreeParent usedServicesNode = new TreeParent("Used Services");
-                               addChild(usedServicesNode);
-                               for (ServiceReference sr : usedServices) {
-                                       if (sr != null)
-                                               usedServicesNode.addChild(new ServiceReferenceNode(sr));
-                               }
-                       }
-               }
-
-               public Bundle getBundle() {
-                       return bundle;
-               }
-
-       }
-
-       class ServiceReferenceNode extends TreeParent {
-               private final ServiceReference serviceReference;
-
-               public ServiceReferenceNode(ServiceReference serviceReference) {
-                       super(serviceReference.toString());
-                       this.serviceReference = serviceReference;
-
-                       Bundle[] usedBundles = serviceReference.getUsingBundles();
-                       if (usedBundles != null) {
-                               TreeParent usingBundles = new TreeParent("Using Bundles");
-                               addChild(usingBundles);
-                               for (Bundle b : usedBundles) {
-                                       if (b != null)
-                                               usingBundles.addChild(new TreeParent(b
-                                                               .getSymbolicName()));
-                               }
-                       }
-
-                       TreeParent properties = new TreeParent("Properties");
-                       addChild(properties);
-                       for (String key : serviceReference.getPropertyKeys()) {
-                               properties.addChild(new TreeParent(key + "="
-                                               + serviceReference.getProperty(key)));
-                       }
-
-               }
-
-               public ServiceReference getServiceReference() {
-                       return serviceReference;
-               }
-
-       }
-
-       class MultiplePackagesNode extends TreeParent {
-               private String packageName;
-               private Set<ExportedPackage> exportedPackages;
-
-               public MultiplePackagesNode(String packageName,
-                               Set<ExportedPackage> exportedPackages) {
-                       super(packageName);
-                       this.packageName = packageName;
-                       this.exportedPackages = exportedPackages;
-                       for (ExportedPackage pkg : exportedPackages) {
-                               addChild(new ExportedPackageNode(pkg));
-                       }
-               }
-
-       }
-
-       class ConflictingPackageNode extends TreeParent {
-               private ExportedPackage exportedPackage;
-
-               public ConflictingPackageNode(ExportedPackage exportedPackage) {
-                       super(exportedPackage.getName() + " - "
-                                       + exportedPackage.getVersion() + " ("
-                                       + exportedPackage.getExportingBundle() + ")");
-                       this.exportedPackage = exportedPackage;
-
-                       TreeParent bundlesNode = new TreeParent("Dependent Bundles");
-                       this.addChild(bundlesNode);
-                       Map<String, Bundle> bundles = new TreeMap<String, Bundle>();
-                       for (Bundle b : exportedPackage.getImportingBundles()) {
-                               bundles.put(b.getSymbolicName(), b);
-                       }
-                       for (String key : bundles.keySet()) {
-                               addDependentBundles(bundlesNode, bundles.get(key));
-                       }
-               }
-       }
-
-       protected void addDependentBundles(TreeParent parent, Bundle bundle) {
-               TreeParent bundleNode = new TreeParent(bundle.toString());
-               parent.addChild(bundleNode);
-               Map<String, Bundle> bundles = new TreeMap<String, Bundle>();
-               ExportedPackage[] pkgs = packageAdmin.getExportedPackages(bundle);
-               if (pkgs != null)
-                       for (ExportedPackage pkg : pkgs) {
-                               for (Bundle b : pkg.getImportingBundles()) {
-                                       if (!bundles.containsKey(b.getSymbolicName())
-                                                       && b.getBundleId() != bundle.getBundleId()) {
-                                               bundles.put(b.getSymbolicName(), b);
-                                       }
-                               }
-                       }
-
-               for (String key : bundles.keySet()) {
-                       addDependentBundles(bundleNode, bundles.get(key));
-               }
-       }
-
-       class ExportedPackageNode extends TreeParent {
-               private ExportedPackage exportedPackage;
-
-               public ExportedPackageNode(ExportedPackage exportedPackage) {
-                       super(exportedPackage.getName() + " - "
-                                       + exportedPackage.getVersion() + " ("
-                                       + exportedPackage.getExportingBundle() + ")");
-                       this.exportedPackage = exportedPackage;
-                       for (Bundle bundle : exportedPackage.getImportingBundles()) {
-                               addChild(new BundleNode(bundle));
-                       }
-               }
-       }
-}
diff --git a/pom.xml b/pom.xml
index 259e56559a9b1d366631f65a7c355a80a835f684..a4df50190e0322f3a014455b5059a9c728c7bb9e 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -51,8 +51,8 @@
                <module>org.argeo.node.repo.jackrabbit</module>
                <module>org.argeo.cms</module>
                <!-- Standard Workbench Perspectives -->
-               <module>org.argeo.osgi.ui.explorer</module>
-               <module>org.argeo.jcr.ui.explorer</module>
+               <module>org.argeo.eclipse.ui.workbench</module>
+               <!-- <module>org.argeo.osgi.ui.explorer</module> <module>org.argeo.jcr.ui.explorer</module> -->
                <module>org.argeo.security.equinox</module>
                <module>org.argeo.security.ui</module>
                <module>org.argeo.security.ui.admin</module>