Class SiteService
java.lang.Object
fr.paris.lutece.plugins.releaser.service.SiteService
SiteService.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic StringMinimum pom parent version to create docker image. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidbuildComments(Site site, Locale locale) Build release comments for a given site.static voidcancelDowngradeComponent(Site site, String strArtifactId) Cancel downgrade component.static voidcancelUpgradeComponent(Site site, String strArtifactId) Cancel upgrade component.static voidchangeNextReleaseVersion(Site site) Change the next release version.static voidchangeNextReleaseVersion(Site site, String strArtifactId) Change the next release version.static SitechangeSiteBranch(Site site, String strBranchName, ReleaserUser user, javax.servlet.http.HttpServletRequest request, Locale locale) Changes the site branch and reloads version information and components from the new branch POM.static voiddowngradeComponent(Site site, String strArtifactId) Downgrade component.generateTargetPOM(Site site) Generate the pom.xml file for a given sitegetAuthorizedSites(int clusterId, fr.paris.lutece.portal.business.user.AdminUser adminUser) static StringgetOriginVersion(String strLastRelease, String strCurrentVersion) Define which version between last released or current snapshot should be the origin for next release versions.static SiteLoad a site from its id.static SitegetSiteBranchList(Site site, ReleaserUser user) Gets the branch list for a site repository.static booleanIsSiteAlreadyExist(String siteName, String artifactId, String scmUrl) static booleanisSiteCreateDockerImage(Site site) static booleanIsUserAuthorized(fr.paris.lutece.portal.business.user.AdminUser adminUser, String siteId, String permission) static intreleaseComponent(Site site, String strArtifactId, Locale locale, fr.paris.lutece.portal.business.user.AdminUser user, javax.servlet.http.HttpServletRequest request) Release component.releaseSite(Site site, Locale locale, fr.paris.lutece.portal.business.user.AdminUser user, javax.servlet.http.HttpServletRequest request) Release site.static voidremoveComponentAsProjectBySite(int nIdSite) Removes the component as project by site.static voidtoggleProjectComponent(Site site, String strArtifactId) Add or Remove a component from the project's components list.static voidupdateComponentAsProjectStatus(Site site, String strArtifactId, Boolean bIsProject) Update component as project status.static voidupgradeComponent(Site site, String strArtifactId) Upgrade component.
-
Field Details
-
POM_PARENT_MIN_VERSION_TO_CREATE_DOCKET_IMAGE
Minimum pom parent version to create docker image.
-
-
Constructor Details
-
SiteService
public SiteService()
-
-
Method Details
-
getSite
public static Site getSite(int nSiteId, javax.servlet.http.HttpServletRequest request, Locale locale) Load a site from its id.- Parameters:
nSiteId- The site idrequest- the requestlocale- the locale- Returns:
- A site object
-
isSiteCreateDockerImage
-
getOriginVersion
Define which version between last released or current snapshot should be the origin for next release versions. Ex of cases :
last release : 3.2.1 current : 4.0.0-SNAPSHOT -- current
last release : 3.2.1 current : 3.2.2-SNAPSHOT -- last or current
last release : missing current : 1.0.0-SNAPSHOT -- current
last release : 3.2.1-RC-02 current : 3.2.1-SNAPSHOT -- last- Parameters:
strLastRelease- The last releasestrCurrentVersion- The current release- Returns:
- The origin version
-
updateComponentAsProjectStatus
public static void updateComponentAsProjectStatus(Site site, String strArtifactId, Boolean bIsProject) Update component as project status.- Parameters:
site- the sitestrArtifactId- the str artifact idbIsProject- the b is project
-
removeComponentAsProjectBySite
public static void removeComponentAsProjectBySite(int nIdSite) Removes the component as project by site.- Parameters:
nIdSite- the n id site
-
buildComments
Build release comments for a given site.- Parameters:
site- The sitelocale- The locale to use for comments
-
upgradeComponent
Upgrade component.- Parameters:
site- the sitestrArtifactId- the str artifact id
-
cancelUpgradeComponent
Cancel upgrade component.- Parameters:
site- the sitestrArtifactId- the str artifact id
-
downgradeComponent
Downgrade component.- Parameters:
site- the sitestrArtifactId- the str artifact id
-
cancelDowngradeComponent
Cancel downgrade component.- Parameters:
site- the sitestrArtifactId- the str artifact id
-
releaseComponent
public static int releaseComponent(Site site, String strArtifactId, Locale locale, fr.paris.lutece.portal.business.user.AdminUser user, javax.servlet.http.HttpServletRequest request) Release component.- Parameters:
site- the sitestrArtifactId- the str artifact idlocale- the localeuser- the userrequest- the request- Returns:
- the int
-
releaseSite
public static Map<String,Integer> releaseSite(Site site, Locale locale, fr.paris.lutece.portal.business.user.AdminUser user, javax.servlet.http.HttpServletRequest request) Release site.- Parameters:
site- the sitelocale- the localeuser- the userrequest- the request- Returns:
- the map
-
toggleProjectComponent
Add or Remove a component from the project's components list.- Parameters:
site- The sitestrArtifactId- The component artifact id
-
changeNextReleaseVersion
Change the next release version.- Parameters:
site- The sitestrArtifactId- The component artifact id
-
changeNextReleaseVersion
Change the next release version.- Parameters:
site- The site
-
generateTargetPOM
Generate the pom.xml file for a given site- Parameters:
site- The site- Returns:
- The pom.xml content
-
getAuthorizedSites
-
IsUserAuthorized
-
IsSiteAlreadyExist
-
getSiteBranchList
Gets the branch list for a site repository.- Parameters:
site- the siteuser- the releaser user- Returns:
- the site with branch list populated
-
changeSiteBranch
public static Site changeSiteBranch(Site site, String strBranchName, ReleaserUser user, javax.servlet.http.HttpServletRequest request, Locale locale) Changes the site branch and reloads version information and components from the new branch POM.- Parameters:
site- the sitestrBranchName- the target branch nameuser- the releaser userrequest- the requestlocale- the locale- Returns:
- the site with updated version info and components
-