@Override
  protected void doProcessAction(ActionRequest actionRequest, ActionResponse actionResponse)
      throws Exception {

    hideDefaultSuccessMessage(actionRequest);

    String cmd = ParamUtil.getString(actionRequest, Constants.CMD);

    ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);

    try {
      long exportImportConfigurationId =
          ParamUtil.getLong(actionRequest, "exportImportConfigurationId");

      if (cmd.equals(Constants.ADD) || cmd.equals(Constants.UPDATE)) {
        updatePublishConfiguration(actionRequest);
      } else if (cmd.equals(Constants.PUBLISH_TO_LIVE)) {
        StagingUtil.publishLayouts(themeDisplay.getUserId(), exportImportConfigurationId);
      } else if (cmd.equals(Constants.PUBLISH_TO_REMOTE)) {
        StagingUtil.copyRemoteLayouts(exportImportConfigurationId);
      } else if (cmd.equals(Constants.RELAUNCH)) {
        relaunchPublishLayoutConfiguration(themeDisplay.getUserId(), actionRequest);
      }

      String redirect = ParamUtil.getString(actionRequest, "redirect");

      sendRedirect(actionRequest, actionResponse, redirect);
    } catch (Exception e) {
      _log.error(e, e);

      SessionErrors.add(actionRequest, e.getClass());
    }
  }
  protected void relaunchPublishLayoutConfiguration(long userId, ActionRequest actionRequest)
      throws PortalException {

    long backgroundTaskId =
        ParamUtil.getLong(actionRequest, BackgroundTaskConstants.BACKGROUND_TASK_ID);

    BackgroundTask backgroundTask = BackgroundTaskManagerUtil.getBackgroundTask(backgroundTaskId);

    Map<String, Serializable> taskContextMap = backgroundTask.getTaskContextMap();

    ExportImportConfiguration exportImportConfiguration =
        _exportImportConfigurationLocalService.getExportImportConfiguration(
            MapUtil.getLong(taskContextMap, "exportImportConfigurationId"));

    if (exportImportConfiguration.getType()
        == ExportImportConfigurationConstants.TYPE_PUBLISH_LAYOUT_LOCAL) {

      StagingUtil.publishLayouts(userId, exportImportConfiguration);
    } else if (exportImportConfiguration.getType()
        == ExportImportConfigurationConstants.TYPE_PUBLISH_LAYOUT_REMOTE) {

      StagingUtil.copyRemoteLayouts(exportImportConfiguration);
    }
  }