Interface IProjectLifecycleManager
- Author:
- dobisekm
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
createProject
(ILocation location, String projectId, String templateId, Map paramValues) Creates the project with the given parameters.void
deleteProject
(String projectId) Deletes the project, including all it's content from the repository.void
duplicateProjectTemplate
(String id, Properties props, String newTemplateId, String serverPath) Duplicate old template to new oneReturnSet
of all existing template repository IDsgetAllProjectTemplates
(boolean moduleTemplates) Get all project templates and mark if they are available for current usergetAvailableProjectTemplates
(boolean checkForLicense) void
getProjectTemplateCustomIco
(BufferedOutputStream outputStream, String id, String ico, boolean systemTemplate) Get custom ico from project template in streamvoid
markAsProject
(ILocation location, String projectId) Shortcut formarkAsProject(location, projectId, null, null)
void
markAsProject
(ILocation location, String projectId, String templateId, Map paramValues) Marks the given location as project with the given ID.void
saveProjectTemplate
(String id, Properties props, String serverPath) Save a changed Project template.void
unmarkProject
(String projectId) 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.void
writeProjectTemplateTo
(ZipOutputStream zipOutputStream, String id, boolean defaultTemplate) Return zip template output stream
-
Field Details
-
PROP_NAME
- Since:
- 3.5
- See Also:
-
PROP_DESCR
- Since:
- 3.5
- See Also:
-
PROP_PARAMS
- Since:
- 3.5
- See Also:
-
PROP_PARAM
- Since:
- 3.5
- See Also:
-
PROP_PARAM_NAME
- Since:
- 3.5
- See Also:
-
PROP_TEMPLATE_LOCATION
- Since:
- 3.5
- See Also:
-
PROP_DISTRIBUTIONS
- Since:
- 3.5
- See Also:
-
PROP_AVAILABLE_FOR_CURRENT_USER
- Since:
- 3.5
- See Also:
-
PROP_CUSTOM_TEMPLATE_ICO
- Since:
- 3.5
- See Also:
-
-
Method Details
-
getAvailableProjectTemplates
IProjectTemplate[] getAvailableProjectTemplates()- Returns:
- List of existing templates for project creation.
-
getAvailableProjectTemplates
- 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 benull
(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 benull
(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 formarkAsProject(location, projectId, null, null)
-
unmarkProject
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
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
Save a changed Project template. (Only thetemplate.properties
descriptor file is saved.)- Parameters:
id
- The Project template's ID.props
- properties containing 'template.properties' file contentserverPath
- path to uploaded template .zip file. Can be null- Since:
- 3.5
-
duplicateProjectTemplate
Duplicate old template to new one- Parameters:
id
- The original Project template's idprops
- properties containing 'template.properties' file contentnewTemplateId
- new template IDserverPath
- path to file, can be null- Since:
- 3.5
-
writeProjectTemplateTo
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
ReturnSet
of all existing template repository IDs -
getAllProjectTemplates
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 streamid
- The template's ID.ico
- icon namesystemTemplate
- true if the template is a system template.- Since:
- 3.5
-