private boolean closeDocumentEditor(final String documentHandleUuid) { final IEditorManager editorManager = context.getService(editorManagerServiceId, IEditorManager.class); try { final Node documentHandle = UserSession.get().getJcrSession().getNodeByIdentifier(documentHandleUuid); final JcrNodeModel documentHandleModel = new JcrNodeModel(documentHandle); final IEditor<?> editor = editorManager.getEditor(documentHandleModel); if (editor == null) { return true; } if (editor.isValid()) { editor.close(); return true; } } catch (ItemNotFoundException e) { ChannelEditor.log.warn("Could not find document with uuid '{}'", documentHandleUuid, e); return true; } catch (EditorException | RepositoryException e) { ChannelEditor.log.warn("Failed to close editor for document with uuid '{}'", documentHandleUuid, e); } return false; }