Class StagingUtil
Object
com.liferay.exportimport.kernel.staging.StagingUtil
- Author:
- Raymond Augé
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends BaseModel>
voidaddModelToChangesetCollection
(T model) static long
copyFromLive
(PortletRequest portletRequest) static long
copyFromLive
(PortletRequest portletRequest, Portlet portlet) static long
copyRemoteLayouts
(long exportImportConfigurationId) static long
copyRemoteLayouts
(long sourceGroupId, boolean privateLayout, Map<Long, Boolean> layoutIdMap, String name, Map<String, String[]> parameterMap, String remoteAddress, int remotePort, String remotePathContext, boolean secureConnection, long remoteGroupId, boolean remotePrivateLayout) static long
copyRemoteLayouts
(long sourceGroupId, boolean privateLayout, Map<Long, Boolean> layoutIdMap, Map<String, String[]> parameterMap, String remoteAddress, int remotePort, String remotePathContext, boolean secureConnection, long remoteGroupId, boolean remotePrivateLayout) static long
copyRemoteLayouts
(ExportImportConfiguration exportImportConfiguration) static void
deleteLastImportSettings
(Group liveGroup, boolean privateLayout) static void
deleteRecentLayoutRevisionId
(long userId, long layoutSetBranchId, long plid) static void
deleteRecentLayoutRevisionId
(javax.servlet.http.HttpServletRequest httpServletRequest, long layoutSetBranchId, long plid) static JSONArray
getErrorMessagesJSONArray
(Locale locale, Map<String, MissingReference> missingReferences) static JSONObject
getExceptionMessagesJSONObject
(Locale locale, Exception exception, ExportImportConfiguration exportImportConfiguration) static Group
getLiveGroup
(long groupId) static Group
getLiveGroup
(Group group) static long
getLiveGroupId
(long groupId) static Group
getPermissionStagingGroup
(Group group) static long
getRecentLayoutRevisionId
(User user, long layoutSetBranchId, long plid) static long
getRecentLayoutRevisionId
(javax.servlet.http.HttpServletRequest httpServletRequest, long layoutSetBranchId, long plid) static long
getRecentLayoutSetBranchId
(User user, long layoutSetId) static long
getRecentLayoutSetBranchId
(javax.servlet.http.HttpServletRequest httpServletRequest, long layoutSetId) static Layout
getRemoteLayout
(long userId, long stagingGroupId, long plid) static long
getRemoteLayoutPlid
(long userId, long stagingGroupId, long plid) static String
getRemoteSiteURL
(Group stagingGroup, boolean privateLayout) static String
getSchedulerGroupName
(String destinationName, long groupId) static String
getStagedPortletId
(String portletId) static long[]
getStagingAndLiveGroupIds
(long groupId) static Group
getStagingGroup
(long groupId) static JSONArray
getWarningMessagesJSONArray
(Locale locale, Map<String, MissingReference> missingReferences) static WorkflowTask
getWorkflowTask
(long userId, LayoutRevision layoutRevision) static boolean
hasRemoteLayout
(long userId, long stagingGroupId, long plid) static boolean
hasWorkflowTask
(long userId, LayoutRevision layoutRevision) static boolean
isGroupAccessible
(long groupId, long fromGroupId) static boolean
isGroupAccessible
(Group group, Group fromGroup) static boolean
isIncomplete
(Layout layout) static boolean
isIncomplete
(Layout layout, long layoutSetBranchId) static boolean
isRemoteLayoutHasPortletId
(long userId, long stagingGroupId, long plid, String portletId) static void
populateLastPublishDateCounts
(PortletDataContext portletDataContext, StagedModelType[] stagedModelTypes) static void
populateLastPublishDateCounts
(PortletDataContext portletDataContext, String[] classNames) static long
publishLayout
(long userId, long plid, long liveGroupId, boolean includeChildren) static long
publishLayouts
(long userId, long exportImportConfigurationId) static long
publishLayouts
(long userId, long sourceGroupId, long targetGroupId, boolean privateLayout, long[] layoutIds, String name, Map<String, String[]> parameterMap) static long
publishLayouts
(long userId, long sourceGroupId, long targetGroupId, boolean privateLayout, long[] layoutIds, Map<String, String[]> parameterMap) static long
publishLayouts
(long userId, long sourceGroupId, long targetGroupId, boolean privateLayout, Map<String, String[]> parameterMap) static long
publishLayouts
(long userId, ExportImportConfiguration exportImportConfiguration) static long
publishPortlet
(long userId, long exportImportConfigurationId) static long
publishPortlet
(long userId, long sourceGroupId, long targetGroupId, long sourcePlid, long targetPlid, String portletId, Map<String, String[]> parameterMap) static long
publishPortlet
(long userId, ExportImportConfiguration exportImportConfiguration) static long
publishToLive
(PortletRequest portletRequest) static long
publishToLive
(PortletRequest portletRequest, Portlet portlet) static long
publishToRemote
(PortletRequest portletRequest) static <T extends BaseModel>
voidremoveModelFromChangesetCollection
(T model) static void
scheduleCopyFromLive
(PortletRequest portletRequest) static void
schedulePublishToLive
(PortletRequest portletRequest) static void
schedulePublishToRemote
(PortletRequest portletRequest) static void
setRecentLayoutBranchId
(User user, long layoutSetBranchId, long plid, long layoutBranchId) static void
setRecentLayoutBranchId
(javax.servlet.http.HttpServletRequest httpServletRequest, long layoutSetBranchId, long plid, long layoutBranchId) static void
setRecentLayoutRevisionId
(User user, long layoutSetBranchId, long plid, long layoutRevisionId) static void
setRecentLayoutRevisionId
(javax.servlet.http.HttpServletRequest httpServletRequest, long layoutSetBranchId, long plid, long layoutRevisionId) static void
setRecentLayoutSetBranchId
(User user, long layoutSetId, long layoutSetBranchId) static void
setRecentLayoutSetBranchId
(javax.servlet.http.HttpServletRequest httpServletRequest, long layoutSetId, long layoutSetBranchId) static void
setRemoteSiteURL
(Group stagingGroup, boolean overrideRemoteSiteURL, String remoteSiteURL) static String
stripProtocolFromRemoteAddress
(String remoteAddress) static void
transferFileToRemoteLive
(File file, long stagingRequestId, HttpPrincipal httpPrincipal) static void
unscheduleCopyFromLive
(PortletRequest portletRequest) static void
unschedulePublishToLive
(PortletRequest portletRequest) static void
unschedulePublishToRemote
(PortletRequest portletRequest) static void
updateLastImportSettings
(Element layoutElement, Layout layout, PortletDataContext portletDataContext) static void
validateRemoteGroupIsSame
(long groupId, long remoteGroupId, String remoteAddress, int remotePort, String remotePathContext, boolean secureConnection)
-
Constructor Details
-
StagingUtil
public StagingUtil()
-
-
Method Details
-
addModelToChangesetCollection
public static <T extends BaseModel> void addModelToChangesetCollection(T model) throws PortalException - Throws:
PortalException
-
copyFromLive
- Throws:
PortalException
-
copyFromLive
public static long copyFromLive(PortletRequest portletRequest, Portlet portlet) throws PortalException - Throws:
PortalException
-
copyRemoteLayouts
public static long copyRemoteLayouts(ExportImportConfiguration exportImportConfiguration) throws PortalException - Throws:
PortalException
-
copyRemoteLayouts
- Throws:
PortalException
-
copyRemoteLayouts
public static long copyRemoteLayouts(long sourceGroupId, boolean privateLayout, Map<Long, Boolean> layoutIdMap, Map<String, throws PortalExceptionString[]> parameterMap, String remoteAddress, int remotePort, String remotePathContext, boolean secureConnection, long remoteGroupId, boolean remotePrivateLayout) - Throws:
PortalException
-
copyRemoteLayouts
public static long copyRemoteLayouts(long sourceGroupId, boolean privateLayout, Map<Long, Boolean> layoutIdMap, String name, Map<String, throws PortalExceptionString[]> parameterMap, String remoteAddress, int remotePort, String remotePathContext, boolean secureConnection, long remoteGroupId, boolean remotePrivateLayout) - Throws:
PortalException
-
deleteLastImportSettings
public static void deleteLastImportSettings(Group liveGroup, boolean privateLayout) throws PortalException - Throws:
PortalException
-
deleteRecentLayoutRevisionId
public static void deleteRecentLayoutRevisionId(javax.servlet.http.HttpServletRequest httpServletRequest, long layoutSetBranchId, long plid) -
deleteRecentLayoutRevisionId
public static void deleteRecentLayoutRevisionId(long userId, long layoutSetBranchId, long plid) -
getErrorMessagesJSONArray
public static JSONArray getErrorMessagesJSONArray(Locale locale, Map<String, MissingReference> missingReferences) -
getExceptionMessagesJSONObject
public static JSONObject getExceptionMessagesJSONObject(Locale locale, Exception exception, ExportImportConfiguration exportImportConfiguration) -
getLiveGroup
-
getLiveGroup
-
getLiveGroupId
public static long getLiveGroupId(long groupId) -
getPermissionStagingGroup
-
getRecentLayoutRevisionId
public static long getRecentLayoutRevisionId(javax.servlet.http.HttpServletRequest httpServletRequest, long layoutSetBranchId, long plid) throws PortalException - Throws:
PortalException
-
getRecentLayoutRevisionId
public static long getRecentLayoutRevisionId(User user, long layoutSetBranchId, long plid) throws PortalException - Throws:
PortalException
-
getRecentLayoutSetBranchId
public static long getRecentLayoutSetBranchId(javax.servlet.http.HttpServletRequest httpServletRequest, long layoutSetId) -
getRecentLayoutSetBranchId
-
getRemoteLayout
public static Layout getRemoteLayout(long userId, long stagingGroupId, long plid) throws PortalException - Throws:
PortalException
-
getRemoteLayoutPlid
public static long getRemoteLayoutPlid(long userId, long stagingGroupId, long plid) throws PortalException - Throws:
PortalException
-
getRemoteSiteURL
public static String getRemoteSiteURL(Group stagingGroup, boolean privateLayout) throws PortalException - Throws:
PortalException
-
getSchedulerGroupName
-
getStagedPortletId
-
getStagingAndLiveGroupIds
- Throws:
PortalException
-
getStagingGroup
-
getWarningMessagesJSONArray
public static JSONArray getWarningMessagesJSONArray(Locale locale, Map<String, MissingReference> missingReferences) -
getWorkflowTask
public static WorkflowTask getWorkflowTask(long userId, LayoutRevision layoutRevision) throws PortalException - Throws:
PortalException
-
hasRemoteLayout
public static boolean hasRemoteLayout(long userId, long stagingGroupId, long plid) throws PortalException - Throws:
PortalException
-
hasWorkflowTask
public static boolean hasWorkflowTask(long userId, LayoutRevision layoutRevision) throws PortalException - Throws:
PortalException
-
isGroupAccessible
-
isGroupAccessible
- Throws:
PortalException
-
isIncomplete
-
isIncomplete
-
isRemoteLayoutHasPortletId
public static boolean isRemoteLayoutHasPortletId(long userId, long stagingGroupId, long plid, String portletId) -
populateLastPublishDateCounts
public static void populateLastPublishDateCounts(PortletDataContext portletDataContext, StagedModelType[] stagedModelTypes) throws PortalException - Throws:
PortalException
-
populateLastPublishDateCounts
public static void populateLastPublishDateCounts(PortletDataContext portletDataContext, String[] classNames) throws PortalException - Throws:
PortalException
-
publishLayout
public static long publishLayout(long userId, long plid, long liveGroupId, boolean includeChildren) throws PortalException - Throws:
PortalException
-
publishLayouts
public static long publishLayouts(long userId, ExportImportConfiguration exportImportConfiguration) throws PortalException - Throws:
PortalException
-
publishLayouts
public static long publishLayouts(long userId, long exportImportConfigurationId) throws PortalException - Throws:
PortalException
-
publishLayouts
public static long publishLayouts(long userId, long sourceGroupId, long targetGroupId, boolean privateLayout, long[] layoutIds, Map<String, String[]> parameterMap) throws PortalException- Throws:
PortalException
-
publishLayouts
public static long publishLayouts(long userId, long sourceGroupId, long targetGroupId, boolean privateLayout, long[] layoutIds, String name, Map<String, String[]> parameterMap) throws PortalException- Throws:
PortalException
-
publishLayouts
public static long publishLayouts(long userId, long sourceGroupId, long targetGroupId, boolean privateLayout, Map<String, String[]> parameterMap) throws PortalException- Throws:
PortalException
-
publishPortlet
public static long publishPortlet(long userId, ExportImportConfiguration exportImportConfiguration) throws PortalException - Throws:
PortalException
-
publishPortlet
public static long publishPortlet(long userId, long exportImportConfigurationId) throws PortalException - Throws:
PortalException
-
publishPortlet
public static long publishPortlet(long userId, long sourceGroupId, long targetGroupId, long sourcePlid, long targetPlid, String portletId, Map<String, String[]> parameterMap) throws PortalException- Throws:
PortalException
-
publishToLive
- Throws:
PortalException
-
publishToLive
public static long publishToLive(PortletRequest portletRequest, Portlet portlet) throws PortalException - Throws:
PortalException
-
publishToRemote
- Throws:
PortalException
-
removeModelFromChangesetCollection
public static <T extends BaseModel> void removeModelFromChangesetCollection(T model) throws PortalException - Throws:
PortalException
-
scheduleCopyFromLive
- Throws:
PortalException
-
schedulePublishToLive
- Throws:
PortalException
-
schedulePublishToRemote
- Throws:
PortalException
-
setRecentLayoutBranchId
public static void setRecentLayoutBranchId(javax.servlet.http.HttpServletRequest httpServletRequest, long layoutSetBranchId, long plid, long layoutBranchId) throws PortalException - Throws:
PortalException
-
setRecentLayoutBranchId
public static void setRecentLayoutBranchId(User user, long layoutSetBranchId, long plid, long layoutBranchId) throws PortalException - Throws:
PortalException
-
setRecentLayoutRevisionId
public static void setRecentLayoutRevisionId(javax.servlet.http.HttpServletRequest httpServletRequest, long layoutSetBranchId, long plid, long layoutRevisionId) throws PortalException - Throws:
PortalException
-
setRecentLayoutRevisionId
public static void setRecentLayoutRevisionId(User user, long layoutSetBranchId, long plid, long layoutRevisionId) throws PortalException - Throws:
PortalException
-
setRecentLayoutSetBranchId
public static void setRecentLayoutSetBranchId(javax.servlet.http.HttpServletRequest httpServletRequest, long layoutSetId, long layoutSetBranchId) throws PortalException - Throws:
PortalException
-
setRecentLayoutSetBranchId
public static void setRecentLayoutSetBranchId(User user, long layoutSetId, long layoutSetBranchId) throws PortalException - Throws:
PortalException
-
setRemoteSiteURL
public static void setRemoteSiteURL(Group stagingGroup, boolean overrideRemoteSiteURL, String remoteSiteURL) throws PortalException - Throws:
PortalException
-
stripProtocolFromRemoteAddress
-
transferFileToRemoteLive
public static void transferFileToRemoteLive(File file, long stagingRequestId, HttpPrincipal httpPrincipal) throws Exception - Throws:
Exception
-
unscheduleCopyFromLive
- Throws:
PortalException
-
unschedulePublishToLive
- Throws:
PortalException
-
unschedulePublishToRemote
- Throws:
PortalException
-
updateLastImportSettings
public static void updateLastImportSettings(Element layoutElement, Layout layout, PortletDataContext portletDataContext) throws PortalException - Throws:
PortalException
-
validateRemoteGroupIsSame
public static void validateRemoteGroupIsSame(long groupId, long remoteGroupId, String remoteAddress, int remotePort, String remotePathContext, boolean secureConnection) throws PortalException - Throws:
PortalException
-