Class SiteService


  • public class SiteService
    extends Object
    SiteService.
    • Constructor Detail

      • SiteService

        public SiteService()
    • Method Detail

      • getSite

        public static Site getSite​(int nSiteId,
                                   javax.servlet.http.HttpServletRequest request,
                                   Locale locale)
        Load a site from its id.
        Parameters:
        nSiteId - The site id
        request - the request
        locale - the locale
        Returns:
        A site object
      • getOriginVersion

        public static String getOriginVersion​(String strLastRelease,
                                              String strCurrentVersion)
        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 release
        strCurrentVersion - 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 site
        strArtifactId - the str artifact id
        bIsProject - 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

        public static void buildComments​(Site site,
                                         Locale locale)
        Build release comments for a given site.
        Parameters:
        site - The site
        locale - The locale to use for comments
      • upgradeComponent

        public static void upgradeComponent​(Site site,
                                            String strArtifactId)
        Upgrade component.
        Parameters:
        site - the site
        strArtifactId - the str artifact id
      • cancelUpgradeComponent

        public static void cancelUpgradeComponent​(Site site,
                                                  String strArtifactId)
        Cancel upgrade component.
        Parameters:
        site - the site
        strArtifactId - the str artifact id
      • downgradeComponent

        public static void downgradeComponent​(Site site,
                                              String strArtifactId)
        Downgrade component.
        Parameters:
        site - the site
        strArtifactId - the str artifact id
      • cancelDowngradeComponent

        public static void cancelDowngradeComponent​(Site site,
                                                    String strArtifactId)
        Cancel downgrade component.
        Parameters:
        site - the site
        strArtifactId - 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 site
        strArtifactId - the str artifact id
        locale - the locale
        user - the user
        request - 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 site
        locale - the locale
        user - the user
        request - the request
        Returns:
        the map
      • toggleProjectComponent

        public static void toggleProjectComponent​(Site site,
                                                  String strArtifactId)
        Add or Remove a component from the project's components list.
        Parameters:
        site - The site
        strArtifactId - The component artifact id
      • changeNextReleaseVersion

        public static void changeNextReleaseVersion​(Site site,
                                                    String strArtifactId)
        Change the next release version.
        Parameters:
        site - The site
        strArtifactId - The component artifact id
      • changeNextReleaseVersion

        public static void changeNextReleaseVersion​(Site site)
        Change the next release version.
        Parameters:
        site - The site
      • generateTargetPOM

        public String generateTargetPOM​(Site site)
        Generate the pom.xml file for a given site
        Parameters:
        site - The site
        Returns:
        The pom.xml content
      • getAuthorizedSites

        public static List<Site> getAuthorizedSites​(int clusterId,
                                                    fr.paris.lutece.portal.business.user.AdminUser adminUser)
      • IsUserAuthorized

        public static boolean IsUserAuthorized​(fr.paris.lutece.portal.business.user.AdminUser adminUser,
                                               String siteId,
                                               String permission)
      • IsSiteAlreadyExist

        public static boolean IsSiteAlreadyExist​(String siteName,
                                                 String artifactId,
                                                 String scmUrl)