Interface IWorkspaceServiceProvider


public interface IWorkspaceServiceProvider
  • Field Details

    • TYPE_ALL

      static final int TYPE_ALL
      Specifies a constant to indicate all workspace types; TYPE_ALL is only valid for search queries.
      See Also:
    • TYPE_GENERIC

      static final int TYPE_GENERIC
      Specifies a constant to indicate a generic workspace type.
      See Also:
    • TYPE_ANALYSIS

      static final int TYPE_ANALYSIS
      Specifies a constant to indicate an analysis workspace type.
      See Also:
    • TYPE_DISPOSABLE

      static final int TYPE_DISPOSABLE
      Specifies a constant to indicate an cache only workspace type.
      See Also:
    • DELETE_DISPOSABLE_WORKSPACES_ON_LOGOUT

      static final String DELETE_DISPOSABLE_WORKSPACES_ON_LOGOUT
      See Also:
  • Method Details

    • setJcrSession

      void setJcrSession(javax.jcr.Session jcrSession)
      Sets the JCR session used by the provider.
      Parameters:
      jcrSession -
    • getJcrSession

      javax.jcr.Session getJcrSession() throws Exception
      Gets the JCR session object.
      Returns:
      Returns the JCR session used by the provider.
      Throws:
      Exception
    • getUnsavedWorkspaces

      List<IWorkspace> getUnsavedWorkspaces() throws Exception
      Returns:
      Throws:
      Exception
    • getUserWorkspaces

      List<IWorkspace> getUserWorkspaces(int type) throws Exception
      Gets a list of workspaces of a given type that are accessible to current user
      Parameters:
      type - The workspace type as a constant, see Workspace Types.
      Returns:
      Returns a list of workspace objects representing the current user's workspaces.
      Throws:
      Exception
      See Also:
    • getUserWorkspaces

      List<IWorkspace> getUserWorkspaces(int type, boolean ownerOnly) throws Exception
      Throws:
      Exception
    • getUserWorkspaceFolderID

      String getUserWorkspaceFolderID() throws Exception
      Gets the user's workspace storage folder ID.
      Returns:
      Returns the ID of the folder used to store the user's workspaces.
      Throws:
      Exception
    • getWorkspaceViewDoc

      Document getWorkspaceViewDoc() throws Exception
      Gets the document representing the user's logical workspace view.
      Returns:
      Returns an XML document representing the workspace view.
      Throws:
      Exception
    • saveWorkspaceViewDoc

      void saveWorkspaceViewDoc(Document workspaceViewDoc) throws Exception
      Saves the document representing the workspace view for the user.
      Parameters:
      workspaceViewDoc - Specifies the XML document describing the user's logical workspace view.
      Throws:
      Exception
    • searchWorkspaces

      List<IWorkspace> searchWorkspaces(IWorkspaceQuery query) throws Exception
      Gets a result list of workspaces matching a workspace query.
      Parameters:
      query - Specifies a query to execute.
      Returns:
      Returns a list of workspaces that match the query and for which the user has read access.
      Throws:
      Exception
    • getWorkspacesByContextURI

      List<IWorkspace> getWorkspacesByContextURI(String contextURI, int type, boolean ownerOnly) throws Exception
      Gets a list of workspace that have the specified contextURI as it's primary context URI.
      Parameters:
      contextURI - The context URI of the workspace. This is the URI of the MWS object being analysed by the workspace.
      type - The workspace type as a constant, see Workspace Types.
      ownerOnly - Specify true to only return workspaces owned by the current user.
      Returns:
      Returns a list of IWorkspace objects that match the query and for which the current user has read access.
      Throws:
      Exception
    • getWorkspaceByID

      IWorkspace getWorkspaceByID(String id) throws Exception
      Locates a workspace by the workspace ID.
      Parameters:
      id - The workspace ID to retrieve.
      Returns:
      Returns an IWorkspace object that matchs the workspace ID.
      Throws:
      Exception
    • createWorkspace

      IWorkspace createWorkspace(String name, int type) throws Exception
      Creates a workspace for the current user.
      Parameters:
      name - The name to give the newly created workspace.
      type - The workspace type as a constant, see Workspace Types.
      Returns:
      Returns a new IWorkspace object created in the current user's workspace storage folder.
      Throws:
      Exception
    • createWorkspace

      IWorkspace createWorkspace(String name, int type, String contextURI) throws Exception
      Creates an analysis workspace for the current user and associated with the contextURI that is the analyzed object.
      Parameters:
      name - The name to give the newly created workspace.
      type - The workspace type as a constant, see Workspace Types.
      contextURI - The URI of the MWS object that is being analysed by this workspace.
      Returns:
      Returns a new IWorkspace object created in the current user's workspace storage folder.
      Throws:
      Exception
    • createWorkspaceFromTemplate

      IWorkspace createWorkspaceFromTemplate(String name, int type, String templateURI) throws Exception
      Creates a workspace for the current user, using an existing workspace as a template.
      Parameters:
      name - The name to give the newly created workspace.
      type - The workspace type as a constant, see Workspace Types.
      templateURI - The URI of the workspace or folder to use as a template for the new workspace.
      Returns:
      Returns a new IWorkspace object created in the user's workspace storage folder.
      Throws:
      Exception
    • createWorkspaceFromTemplate

      IWorkspace createWorkspaceFromTemplate(String name, int type, String templateURI, boolean isTemp) throws Exception
      Creates a workspace for the current user using an existing workspace as a template.
      Parameters:
      name - The name to give the newly created workspace.
      type - The workspace type as a constant, see Workspace Types.
      templateURI - The URI of the workspace or folder to use as a template for the new workspace.
      isTemp - Specify true to indicate the new workspace as temporary, requiring an explicit save before it is stored permanently.
      Returns:
      Returns a new IWorkspace object created in the current user's workspace storage folder.
      Throws:
      Exception
    • createWorkspaceFromTemplate

      IWorkspace createWorkspaceFromTemplate(String name, int type, String templateURI, boolean isTemp, boolean makeUnique) throws Exception
      Creates a workspace for the current user with the specified name based on a workspace template.
      Parameters:
      name - The name to give the newly created workspace.
      type - The workspace type as a constant, see Workspace Types.
      templateURI - The URI of the workspace or folder to use as a template for the new workspace.
      isTemp - Specify true to indicate the new workspace as temporary, requiring an explicit save before it is stored permanently.
      makeUnique - Generates an unique workspace name if an existing workspace with the same name exists; a number is appended to the name in parentheses to generate the unique name, for example: myworkspace(1).
      Returns:
      Returns a new IWorkspace object created in the current user's workspace storage folder.
      Throws:
      Exception
    • createWorkspaceFromTemplate

      IWorkspace createWorkspaceFromTemplate(String name, int type, String contextURI, String templateURI) throws Exception
      Creates a workspace for the current user with the specified name and associated with a contextURI of the analyzed object based on a workspace template.
      Parameters:
      name - The name to give the newly created workspace.
      type - The workspace type as a constant, see Workspace Types.
      contextURI - The URI of the object that is being analysed by this workspace.
      templateURI - The URI of the workspace or folder to use as a template for the new workspace.
      Returns:
      Returns a new IWorkspace object created in the current user's workspace storage folder.
      Throws:
      Exception
    • createWorkspaceFromTemplate

      IWorkspace createWorkspaceFromTemplate(String name, int type, String contextURI, String templateURI, boolean isTemp, boolean makeUnique) throws Exception
      Creates a workspace for the current user with the specified name and associated with the contextURI of the analyzed object based on a workspace template.
      Parameters:
      name - The name to give the newly created workspace.
      type - The workspace type as a constant, see Workspace Types.
      contextURI - The URI of the object that is being analysed by this workspace.
      templateURI - The URI of the workspace or folder to use as a template for the new workspace.
      isTemp - Specify true to indicate the new workspace as temporary, requiring an explicit save before it is stored permanently.
      makeUnique - Generates an unique workspace name if an existing workspace with the same name exists; a number is appended to the name in parentheses to generate the unique name, for example: myworkspace(1).
      Returns:
      Returns a new IWorkspace object created in the current user's workspace storage folder.
      Throws:
      Exception
    • renameWorkspace

      void renameWorkspace(IWorkspace workspace, String newName) throws Exception
      Renames an existing workspace.
      Parameters:
      workspace - The IWorkspace object to rename.
      newName - The new name for the workspace as a String.
      Throws:
      Exception
    • deleteWorkspace

      boolean deleteWorkspace(IWorkspace workspace) throws Exception
      Deletes a workspace from the current user's storage.
      Parameters:
      workspace - The IWorkspace object to delete.
      Returns:
      Returns true if the workspace exists and was successfully deleted.
      Throws:
      Exception
    • deleteWorkspace

      boolean deleteWorkspace(String workspaceID) throws Exception
      Deletes a workspace from the current user's storage.
      Parameters:
      workspace - The workspace ID as String to delete.
      Returns:
      Returns true if the workspace exists and was successfully deleted.
      Throws:
      Exception
    • copyWorkspace

      IWorkspace copyWorkspace(String workspaceID, String folderID) throws Exception
      Creates a copy of a workspace in the specified folder.
      Parameters:
      workspace - The IWorkspace object to delete.
      folderID - The ID as String of the target folder for the copy.
      Returns:
      Returns a new IWorkspace object created in target folder.
      Throws:
      Exception
    • deleteViewFolder

      boolean deleteViewFolder(String folderID) throws Exception
      Deletes a workspace folder from the current user's logical workspace view.
      Parameters:
      folderID - The ID of the folder to delete.
      Returns:
      Returns true if the logical view folder exists and was successfully deleted.
      Throws:
      Exception
    • renameViewFolder

      boolean renameViewFolder(String folderID, String folderName) throws Exception
      Renames a workspace folder of the current user's logical workspace view.
      Parameters:
      folderID - The ID of the local view folder to rename.
      folderName - The new name for the local view folder.
      Returns:
      Returns true if the folder exists and was successfully renamed.
      Throws:
      Exception
    • createViewFolder

      INdlNode createViewFolder(String folderID, String newFolderName) throws Exception
      Creates a workspace folder of the current user's logical workspace view.
      Parameters:
      folderID - The ID of the folder in which to create the new folder. Null indicates the root folder.
      newFolderName - The name to give the new folder.
      Returns:
      Returns a node representing the new logical workspace view folder.
      Throws:
      Exception
    • createWorkspaceView

      INdlNode createWorkspaceView(String folderID, String wspaceURI) throws Exception
      Creates a reference to an existing workspace in the current user's logical workspace view.
      Parameters:
      folderID - The ID of the folder in which to create the new workspace reference.
      wspaceURI - The URI of the workspace to add to the logical view.
      Returns:
      Returns a node representing the new workspace reference.
      Throws:
      Exception
    • removeWorkspaceView

      boolean removeWorkspaceView(String folderID, String workspaceID) throws Exception
      Removes a reference to a workspace in the current user's logical workspace view. This does not delete the workspace, it only removes the reference to the workspace from the user's workspace view.
      Parameters:
      folderID - Specifies the ID of the workspace parent folder; NULL in folderID indicates the root folder.
      workspaceID - The ID of the workspace to remove.
      Returns:
      Returns true if the workspace exists and the reference was successfully removed.
      Throws:
      Exception
    • renameWorkspaceView

      void renameWorkspaceView(String workspaceID, String newName) throws Exception
      Renames a workspace ref in the current user's logical workspace view.
      Parameters:
      workspaceID - The ID of the workspace to rename.
      newName - The new name for the workspace.
      Throws:
      Exception
    • getSessionInstance

      IWorkspaceServiceProvider getSessionInstance() throws Exception
      Gets the instance on the current session, otherwise create a new one and place it on the current session.
      Returns:
      Returns an instance of the workspace provider for the current user session.
      Throws:
      Exception
    • getInstance

      IWorkspaceServiceProvider getInstance() throws Exception
      Creates a new instance
      Returns:
      Returns an instance of the workspace provider for the current user session.
      Throws:
      Exception
    • createWorkspaceWithUI

      String createWorkspaceWithUI(String name, int type, String contextURI, String templateURI, boolean createView, boolean createTab, boolean isTemp) throws Exception
      Aggregates several workspace and tab service calls when creating a new workspace. The workspace is created from a workspace template, a reference to the workspace is added to the workspace view, and a new tab is created to display the workspace.
      Parameters:
      name - name to give the newly created workspace.
      type - The workspace type as a constant, see Workspace Types.
      contextURI - The URI of the object that is being analysed by this workspace.
      templateURI - The URI of the workspace or folder to use as a template for the new workspace.
      createView - Specify true to automatically create a workspace reference in the current user's logical workspace view.
      createTab - Specify true automatically create a new view tab for the newly created workspace.
      isTemp - Specify true to indicate the new workspace as temporary, requiring an explicit save before it is stored permanently.
      Returns:
      Returns the display URI of the newly created workspace as String (usually used as a redirect target URI).
      Throws:
      Exception
    • clearCache

      void clearCache() throws Exception
      Clears the in-memory workspace caches. May be used when workspace storage has been modified manually and the workspace cache is no longer valid.
      Throws:
      Exception