Class ReleaserUtils
- java.lang.Object
-
- fr.paris.lutece.plugins.releaser.util.ReleaserUtils
-
public class ReleaserUtils extends java.lang.ObjectThe Class ReleaserUtils.- Author:
- merlinfe
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringREGEX_IDThe Constant REGEX_ID.
-
Constructor Summary
Constructors Constructor Description ReleaserUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddInfoError(CommandResult commandResult, java.lang.String strError, java.lang.Exception e)Adds the info error.static voidaddTechnicalError(CommandResult commandResult, java.lang.String strError)Adds the technical error.static voidaddTechnicalError(CommandResult commandResult, java.lang.String strError, java.lang.Exception e)Adds the technical error.static java.lang.StringcleanPWDInLog(java.lang.String strLog)static intcompareVersion(java.lang.String strVersion1, java.lang.String strVersion2)Compare version.static intconvertStringToInt(java.lang.String strParameter)convert a string to int.static java.lang.StringgetBranchReleaseFrom(WorkflowReleaseContext context)static java.lang.StringgetComponentName(java.lang.String strScmDeveloperConnection, java.lang.String strArtifactId)Gets the component name.static java.lang.StringgetLastReleaseNextSnapshotVersionDataKey(java.lang.String strArtifactId)Gets the last release next snapshot version data key.static java.lang.StringgetLastReleaseVersionDataKey(java.lang.String strArtifactId)Gets the last release version data key.static java.lang.StringgetLocalPath(WorkflowReleaseContext context)Gets the local path.static java.lang.StringgetLocalPomPath(WorkflowReleaseContext context)Gets the local pom path.static java.lang.StringgetLocalSitePath(Site site)Gets the local site path.static java.lang.StringgetLocalSitePomPath(Site site)Gets the local site pom path.static ReleaserUsergetReleaserUser(javax.servlet.http.HttpServletRequest request, java.util.Locale locale)Gets the releaser user.static java.lang.StringgetSiteTagName(Site site)Gets the site tag name.static java.lang.StringgetWorklowContextDataKey(java.lang.String strArtifactId, int nContextId)Gets the worklow context data key.static booleanisApplicationAccountEnable()Checks if is application account enable.static booleanIsVersionInRightFormat(java.lang.String strVersion)static voidlogEndAction(WorkflowReleaseContext context, java.lang.String strActionName)Log end action.static voidlogStartAction(WorkflowReleaseContext context, java.lang.String strActionName)Log start action.static voidpopulateReleaserUser(javax.servlet.http.HttpServletRequest request, ReleaserUser user)Populate releaser user.static voidsetReleaserUser(javax.servlet.http.HttpServletRequest request, ReleaserUser releaserUser)Sets the releaser user.static voidstartCommandResult(WorkflowReleaseContext context)Start command result.static voidstopCommandResult(WorkflowReleaseContext context)Stop command result.
-
-
-
Field Detail
-
REGEX_ID
public static final java.lang.String REGEX_ID
The Constant REGEX_ID.- See Also:
- Constant Field Values
-
-
Method Detail
-
getWorklowContextDataKey
public static java.lang.String getWorklowContextDataKey(java.lang.String strArtifactId, int nContextId)Gets the worklow context data key.- Parameters:
strArtifactId- the str artifact idnContextId- the n context id- Returns:
- the worklow context data key
-
getLastReleaseVersionDataKey
public static java.lang.String getLastReleaseVersionDataKey(java.lang.String strArtifactId)
Gets the last release version data key.- Parameters:
strArtifactId- the str artifact id- Returns:
- the last release version data key
-
getLastReleaseNextSnapshotVersionDataKey
public static java.lang.String getLastReleaseNextSnapshotVersionDataKey(java.lang.String strArtifactId)
Gets the last release next snapshot version data key.- Parameters:
strArtifactId- the str artifact id- Returns:
- the last release next snapshot version data key
-
getLocalPath
public static java.lang.String getLocalPath(WorkflowReleaseContext context)
Gets the local path.- Parameters:
context- the context- Returns:
- the local path
-
getLocalPomPath
public static java.lang.String getLocalPomPath(WorkflowReleaseContext context)
Gets the local pom path.- Parameters:
context- the context- Returns:
- the local pom path
-
getLocalSitePath
public static java.lang.String getLocalSitePath(Site site)
Gets the local site path.- Parameters:
site- the site- Returns:
- the local site path
-
getLocalSitePomPath
public static java.lang.String getLocalSitePomPath(Site site)
Gets the local site pom path.- Parameters:
site- the site- Returns:
- the local site pom path
-
getComponentName
public static java.lang.String getComponentName(java.lang.String strScmDeveloperConnection, java.lang.String strArtifactId)Gets the component name.- Parameters:
strScmDeveloperConnection- the str scm developer connectionstrArtifactId- the str artifact id- Returns:
- the component name
-
getSiteTagName
public static java.lang.String getSiteTagName(Site site)
Gets the site tag name.- Parameters:
site- the site- Returns:
- the site tag name
-
addInfoError
public static void addInfoError(CommandResult commandResult, java.lang.String strError, java.lang.Exception e)
Adds the info error.- Parameters:
commandResult- the command resultstrError- the str errore- the e
-
addTechnicalError
public static void addTechnicalError(CommandResult commandResult, java.lang.String strError, java.lang.Exception e) throws fr.paris.lutece.portal.service.util.AppException
Adds the technical error.- Parameters:
commandResult- the command resultstrError- the str errore- the e- Throws:
fr.paris.lutece.portal.service.util.AppException- the app exception
-
addTechnicalError
public static void addTechnicalError(CommandResult commandResult, java.lang.String strError) throws fr.paris.lutece.portal.service.util.AppException
Adds the technical error.- Parameters:
commandResult- the command resultstrError- the str error- Throws:
fr.paris.lutece.portal.service.util.AppException- the app exception
-
startCommandResult
public static void startCommandResult(WorkflowReleaseContext context)
Start command result.- Parameters:
context- the context
-
logStartAction
public static void logStartAction(WorkflowReleaseContext context, java.lang.String strActionName)
Log start action.- Parameters:
context- the contextstrActionName- the str action name
-
logEndAction
public static void logEndAction(WorkflowReleaseContext context, java.lang.String strActionName)
Log end action.- Parameters:
context- the contextstrActionName- the str action name
-
stopCommandResult
public static void stopCommandResult(WorkflowReleaseContext context)
Stop command result.- Parameters:
context- the context
-
convertStringToInt
public static int convertStringToInt(java.lang.String strParameter)
convert a string to int.- Parameters:
strParameter- the string parameter to convert- Returns:
- the conversion
-
getReleaserUser
public static ReleaserUser getReleaserUser(javax.servlet.http.HttpServletRequest request, java.util.Locale locale)
Gets the releaser user.- Parameters:
request- the requestlocale- the locale- Returns:
- the releaser user
-
populateReleaserUser
public static void populateReleaserUser(javax.servlet.http.HttpServletRequest request, ReleaserUser user)Populate releaser user.- Parameters:
request- the requestuser- the user
-
setReleaserUser
public static void setReleaserUser(javax.servlet.http.HttpServletRequest request, ReleaserUser releaserUser)Sets the releaser user.- Parameters:
request- the requestreleaserUser- the releaser user
-
isApplicationAccountEnable
public static boolean isApplicationAccountEnable()
Checks if is application account enable.- Returns:
- true, if is application account enable
-
compareVersion
public static int compareVersion(java.lang.String strVersion1, java.lang.String strVersion2)Compare version.- Parameters:
strVersion1- the str version 1strVersion2- the str version 2- Returns:
- the int
-
cleanPWDInLog
public static java.lang.String cleanPWDInLog(java.lang.String strLog)
-
getBranchReleaseFrom
public static java.lang.String getBranchReleaseFrom(WorkflowReleaseContext context)
-
IsVersionInRightFormat
public static boolean IsVersionInRightFormat(java.lang.String strVersion)
-
-