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 changed project template. By saving template we understand save the 'template.properties' descriptor file only
      Parameters:
      id - project template 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 - original project template 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 - output stream to write
      id - project template id
      defaultTemplate - if true is 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 template is 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 - template id
      ico - icon name
      systemTemplate - true if template is system template
      Since:
      3.5