diff --git a/oxygen-cmis-protocol/src/main/java/com/oxygenxml/cmis/core/model/impl/DocumentImpl.java b/oxygen-cmis-protocol/src/main/java/com/oxygenxml/cmis/core/model/impl/DocumentImpl.java index 27a61b7..56685b9 100644 --- a/oxygen-cmis-protocol/src/main/java/com/oxygenxml/cmis/core/model/impl/DocumentImpl.java +++ b/oxygen-cmis-protocol/src/main/java/com/oxygenxml/cmis/core/model/impl/DocumentImpl.java @@ -246,7 +246,7 @@ public boolean isCheckedOut() { if (logger.isDebugEnabled()) { Property property = doc.getProperty("cmis:isVersionSeriesCheckedOut"); if (property != null) { - logger.debug("Checked out=" + property.getValuesAsString()); + logger.debug(getDisplayName() + " is checked out=" + property.getValuesAsString()); } } Boolean versionSeriesCheckedOut = doc.isVersionSeriesCheckedOut(); diff --git a/oxygen-cmis-workspace-access/src/main/java/com/oxygenxml/cmis/ui/ItemListView.java b/oxygen-cmis-workspace-access/src/main/java/com/oxygenxml/cmis/ui/ItemListView.java index 10c1bee..aa04e70 100644 --- a/oxygen-cmis-workspace-access/src/main/java/com/oxygenxml/cmis/ui/ItemListView.java +++ b/oxygen-cmis-workspace-access/src/main/java/com/oxygenxml/cmis/ui/ItemListView.java @@ -17,6 +17,7 @@ import org.apache.chemistry.opencmis.client.api.CmisObject; import org.apache.chemistry.opencmis.client.api.Document; import org.apache.chemistry.opencmis.client.api.Folder; +import org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException; import org.apache.chemistry.opencmis.commons.exceptions.CmisUnauthorizedException; import org.apache.log4j.Logger; @@ -30,6 +31,8 @@ import com.oxygenxml.cmis.core.model.impl.FolderImpl; import com.oxygenxml.cmis.core.urlhandler.CmisURLConnection; +import ro.sync.exml.workspace.api.PluginWorkspaceProvider; + /** * Describes how the folders and documents are: displayed, rendered, their * actions. @@ -134,6 +137,9 @@ public void setContentProvider(ContentSearcher contentProvider) { */ @Override public void presentResources(URL connectionInfo, String repositoryID) { + if (logger.isDebugEnabled()) { + logger.debug("Present resources from server: " + connectionInfo + ", repository id: " + repositoryID); + } try { // Get the instance CMISAccess instance = CmisAccessSingleton.getInstance(); @@ -141,14 +147,22 @@ public void presentResources(URL connectionInfo, String repositoryID) { connectToRepository(connectionInfo, repositoryID, instance); // Get the rootFolder and set the model Folder rootFolder = instance.createResourceController().getRootFolder(); + + if (logger.isDebugEnabled()) { + logger.debug("Root folder " + rootFolder); + } final FolderImpl origin = new FolderImpl(rootFolder); setFolder(origin); } catch (UserCanceledException e1) { // The user canceled the process. logger.error("Error ", e1); - - } + } catch (CmisRuntimeException e) { + // Unexpected exception + logger.debug(e, e); + + PluginWorkspaceProvider.getPluginWorkspace().showErrorMessage("Unable to retrieve repositories because of: " + e.getMessage(), e); + } } /** diff --git a/oxygen-cmis-workspace-access/src/main/java/com/oxygenxml/cmis/ui/RepoComboBoxView.java b/oxygen-cmis-workspace-access/src/main/java/com/oxygenxml/cmis/ui/RepoComboBoxView.java index 69efd37..e68a05e 100644 --- a/oxygen-cmis-workspace-access/src/main/java/com/oxygenxml/cmis/ui/RepoComboBoxView.java +++ b/oxygen-cmis-workspace-access/src/main/java/com/oxygenxml/cmis/ui/RepoComboBoxView.java @@ -16,6 +16,7 @@ import javax.swing.JPanel; import org.apache.chemistry.opencmis.client.api.Repository; +import org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException; import org.apache.chemistry.opencmis.commons.exceptions.CmisUnauthorizedException; import org.apache.log4j.Logger; @@ -24,6 +25,8 @@ import com.oxygenxml.cmis.plugin.Tags; import com.oxygenxml.cmis.plugin.TranslationResourceController; +import ro.sync.exml.workspace.api.PluginWorkspaceProvider; + /** * Describes how the repositories a shown and their behaviors * @@ -110,6 +113,10 @@ public RepoComboBoxView() { * @param repositoryID */ protected void fireRepositoryChangedEvent(URL serverURL, String repositoryID) { + if (logger.isDebugEnabled()) { + logger.debug("Notify repository changed event. Server url: " + serverURL + ", repository id: " + repositoryID); + } + for (RepositoryListener repositoryListener : listeners) { repositoryListener.repositoryConnected(serverURL, repositoryID); } @@ -152,6 +159,7 @@ public void presentRepositories(URL serverURL) { try { // Get the repositories serverReposList = CmisAccessSingleton.getInstance().connectToServerGetRepositories(serverURL, userCredentials); + connected = true; } catch (CmisUnauthorizedException e) { // Will try again. @@ -180,7 +188,12 @@ public void presentRepositories(URL serverURL) { if (logger.isDebugEnabled()) { logger.debug(e, e); } - } + } catch (CmisRuntimeException e) { + // Unexpected exception + logger.debug(e, e); + + PluginWorkspaceProvider.getPluginWorkspace().showErrorMessage("Unable to retrieve repositories because of: " + e.getMessage(), e); + } } diff --git a/oxygen-cmis-workspace-access/src/main/java/com/oxygenxml/cmis/ui/ServerView.java b/oxygen-cmis-workspace-access/src/main/java/com/oxygenxml/cmis/ui/ServerView.java index e0cc6ce..e1cc1a9 100644 --- a/oxygen-cmis-workspace-access/src/main/java/com/oxygenxml/cmis/ui/ServerView.java +++ b/oxygen-cmis-workspace-access/src/main/java/com/oxygenxml/cmis/ui/ServerView.java @@ -132,6 +132,10 @@ public void keyPressed(KeyEvent e) { // Try presentRepositories using the URL Object selectedItem = serverItemsCombo.getSelectedItem(); + + if (logger.isDebugEnabled()) { + logger.debug("Connect to URL: " + selectedItem); + } if (selectedItem != null) { try { @@ -172,6 +176,10 @@ public void keyPressed(KeyEvent e) { private void presentRepositories(RepositoriesPresenter repoPresenter, SearchPresenter searchPresenter, URL serverURL) { try { + + if (logger.isDebugEnabled()) { + logger.debug("Present repositories for: " + serverURL); + } repoPresenter.presentRepositories(serverURL); searchPresenter.activateSearch();