Interface IProjectLifecycleManager


public interface IProjectLifecycleManager
Manages the life cycle of projects.
Author:
dobisekm
  • Field Details

  • Method Details

    • getAvailableProjectTemplates

      IProjectTemplate[] getAvailableProjectTemplates()
      Returns:
      List of existing templates for project creation.
    • getAvailableProjectTemplates

      IProjectTemplate[] getAvailableProjectTemplates(boolean checkForLicense)
      Parameters:
      checkForLicense - if false all templates are returned, even if user shouldn't be able to see them
      Returns:
      List of existing templates for project creation. returns empty if array if no templates found
      Since:
      3.5
    • createProject

      void createProject(ILocation location, String projectId, String templateId, Map paramValues) throws UserProjectCreationException, ProjectCreationException
      Creates the project with the given parameters.
      Parameters:
      location -
      projectId -
      templateId - Might be null (no template will by applied).
      paramValues - Must contain all params specified by the template
      Throws:
      UserProjectCreationException - Thrown if the operation fails in the user-understandable way (e.g. the project Id is duplicate). The exception message can be safely rendered to the user, who initiated the operation.
      ProjectCreationException - Thrown if the operation fails for some unknown reason (e.g. error during commit) and contains rather technical info, suitable for log file.
    • markAsProject

      void markAsProject(ILocation location, String projectId, String templateId, Map paramValues) throws UserProjectCreationException, ProjectCreationException
      Marks the given location as project with the given ID.

      The ID is checked for duplicities, illegal characters, etc. and UserProjectCreationException is eventually thrown.

      This method has to be called inside of transaction. The project is marked once the transaction is commited - it's not visible before. If the transaction is rolled back, then the project is not marked.

      The template is applied in a defensive way - existing user data are not overriden. If there is already the .polarion folder in the given project, then templateId must be null, otherwise an exception is thrown.

      Parameters:
      location -
      projectId -
      templateId - Might be null (no template will by applied).
      paramValues - Must contain all params specified by the template
      Throws:
      UserProjectCreationException - Thrown if the operation fails in the user-understandable way (e.g. the project Id is duplicate). The exception message can be safely rendered to the user, who initiated the operation.
      ProjectCreationException - Thrown if the operation fails for some unknown reason (e.g. error during commit) and contains rather technical info, suitable for log file.
    • markAsProject

      void markAsProject(ILocation location, String projectId) throws UserProjectCreationException, ProjectCreationException
      Shortcut for markAsProject(location, projectId, null, null)
      Throws:
      UserProjectCreationException
      ProjectCreationException
      See Also:
    • unmarkProject

      void unmarkProject(String projectId) throws UserProjectCreationException, ProjectCreationException
      Marks that the given location is no more projec, but all the data stay in the repository and the project can be later marked again.

      This method has to be called inside of transaction. The project is unmarked once the transaction is commited - it's still visible before. If the transaction is rolled back, then the project is not unmarked.

      Parameters:
      projectId -
      Throws:
      UserProjectCreationException - Thrown if the operation fails in the user-understandable way (e.g. the project Id is duplicate). The exception message can be safely rendered to the user, who initiated the operation.
      ProjectCreationException - Thrown if the operation fails for some unknown reason (e.g. error during commit) and contains rather technical info, suitable for log file.
    • deleteProject

      void deleteProject(String projectId) throws UserProjectCreationException, ProjectCreationException
      Deletes the project, including all it's content from the repository.

      This method has to be called inside of transaction. The project is deleted once the transaction is commited - it's still visible before. If the transaction is rolled back, then the project is not deleted.

      Parameters:
      projectId -
      Throws:
      UserProjectCreationException - Thrown if the operation fails in the user-understandable way (e.g. the project Id is duplicate). The exception message can be safely rendered to the user, who initiated the operation.
      ProjectCreationException - Thrown if the operation fails for some unknown reason (e.g. error during commit) and contains rather technical info, suitable for log file.
    • saveProjectTemplate

      void saveProjectTemplate(String id, Properties props, String serverPath)
      Save a changed Project template. (Only the template.properties descriptor file is saved.)
      Parameters:
      id - The Project template's ID.
      props - properties containing 'template.properties' file content
      serverPath - path to uploaded template .zip file. Can be null
      Since:
      3.5
    • duplicateProjectTemplate

      void duplicateProjectTemplate(String id, Properties props, String newTemplateId, String serverPath)
      Duplicate old template to new one
      Parameters:
      id - The original Project template's id
      props - properties containing 'template.properties' file content
      newTemplateId - new template ID
      serverPath - path to file, can be null
      Since:
      3.5
    • writeProjectTemplateTo

      void writeProjectTemplateTo(ZipOutputStream zipOutputStream, String id, boolean defaultTemplate)
      Return zip template output stream
      Parameters:
      zipOutputStream - The output stream to write.
      id - The Project template's ID.
      defaultTemplate - if true, it is the plugin template.
      Since:
      3.5
    • getAllProjectTemplateIDs

      Set<String> getAllProjectTemplateIDs()
      Return Set of all existing template repository IDs
      Returns:
      Set of all existing template repository IDs, or empty Set if there are none
      Since:
      3.5
    • getAllProjectTemplates

      List<IProjectTemplate> getAllProjectTemplates(boolean moduleTemplates)
      Get all project templates and mark if they are available for current user
      Parameters:
      moduleTemplates - true if the template is a module template.
      Returns:
      empty collection if there are no templates
      Since:
      3.5
    • getProjectTemplateCustomIco

      void getProjectTemplateCustomIco(BufferedOutputStream outputStream, String id, String ico, boolean systemTemplate)
      Get custom ico from project template in stream
      Parameters:
      outputStream - output stream
      id - The template's ID.
      ico - icon name
      systemTemplate - true if the template is a system template.
      Since:
      3.5