本文整理匯總了Java中com.liferay.exportimport.kernel.exception.LayoutImportException類的典型用法代碼示例。如果您正苦於以下問題:Java LayoutImportException類的具體用法?Java LayoutImportException怎麽用?Java LayoutImportException使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
LayoutImportException類屬於com.liferay.exportimport.kernel.exception包,在下文中一共展示了LayoutImportException類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: doProcessAction
import com.liferay.exportimport.kernel.exception.LayoutImportException; //導入依賴的package包/類
@Override
protected void doProcessAction(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
_log.info("doProcessAction()");
String cmd = ParamUtil.getString(actionRequest, Constants.CMD);
_log.info("cmd = " + cmd);
String redirect = ParamUtil.getString(actionRequest, "redirect");
try {
if (cmd.equals(Constants.ADD_TEMP)) {
addTempFileEntry(actionRequest, ExportImportHelper.TEMP_FOLDER_NAME);
validateFile(actionRequest, actionResponse, ExportImportHelper.TEMP_FOLDER_NAME);
hideDefaultSuccessMessage(actionRequest);
} else if (cmd.equals(Constants.DELETE)) {
deleteBackgroundTasks(actionRequest, actionResponse);
sendRedirect(actionRequest, actionResponse, redirect);
} else if (cmd.equals(Constants.DELETE_TEMP)) {
deleteTempFileEntry(actionRequest, actionResponse, ExportImportHelper.TEMP_FOLDER_NAME);
hideDefaultSuccessMessage(actionRequest);
} else if (cmd.equals(Constants.IMPORT)) {
importData(actionRequest, ExportImportHelper.TEMP_FOLDER_NAME);
sendRedirect(actionRequest, actionResponse, redirect);
}
} catch (Exception e) {
if (cmd.equals(Constants.ADD_TEMP) || cmd.equals(Constants.DELETE_TEMP)) {
hideDefaultSuccessMessage(actionRequest);
handleUploadException(actionRequest, actionResponse, ExportImportHelper.TEMP_FOLDER_NAME, e);
} else {
// TODO: remove dependencies to LARFile*
if (e instanceof LARFileException || e instanceof LARFileSizeException
|| e instanceof LARTypeException) {
SessionErrors.add(actionRequest, e.getClass());
} else if (e instanceof LayoutPrototypeException || e instanceof LocaleException) {
SessionErrors.add(actionRequest, e.getClass(), e);
} else {
_log.error(e, e);
SessionErrors.add(actionRequest, LayoutImportException.class.getName());
}
}
}
}
示例2: doProcessAction
import com.liferay.exportimport.kernel.exception.LayoutImportException; //導入依賴的package包/類
@Override
protected void doProcessAction(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
_log.info("doProcessAction()");
String cmd = ParamUtil.getString(actionRequest, Constants.CMD);
_log.info("cmd = " + cmd);
String redirect = ParamUtil.getString(actionRequest, "redirect");
try {
if (cmd.equals(Constants.ADD_TEMP)) {
addTempFileEntry(actionRequest, ExportImportHelper.TEMP_FOLDER_NAME);
validateFile(actionRequest, actionResponse, ExportImportHelper.TEMP_FOLDER_NAME);
hideDefaultSuccessMessage(actionRequest);
} else if (cmd.equals(Constants.DELETE)) {
deleteBackgroundTasks(actionRequest, actionResponse);
hideDefaultSuccessMessage(actionRequest);
if (Validator.isNotNull(redirect)) {
sendRedirect(actionRequest, actionResponse, redirect);
}
} else if (cmd.equals(Constants.DELETE_TEMP)) {
deleteTempFileEntry(actionRequest, actionResponse, ExportImportHelper.TEMP_FOLDER_NAME);
hideDefaultSuccessMessage(actionRequest);
} else if (cmd.equals(Constants.IMPORT)) {
hideDefaultSuccessMessage(actionRequest);
importData(actionRequest, ExportImportHelper.TEMP_FOLDER_NAME);
sendRedirect(actionRequest, actionResponse, redirect);
}
} catch (Exception e) {
if (cmd.equals(Constants.ADD_TEMP) || cmd.equals(Constants.DELETE_TEMP)) {
hideDefaultSuccessMessage(actionRequest);
handleUploadException(actionRequest, actionResponse, ExportImportHelper.TEMP_FOLDER_NAME, e);
} else {
// TODO: remove dependencies to LARFile*
if (e instanceof LARFileException || e instanceof LARFileSizeException
|| e instanceof LARTypeException) {
SessionErrors.add(actionRequest, e.getClass());
} else if (e instanceof LayoutPrototypeException || e instanceof LocaleException) {
SessionErrors.add(actionRequest, e.getClass(), e);
} else {
_log.error(e, e);
SessionErrors.add(actionRequest, LayoutImportException.class.getName());
}
}
}
}
示例3: doProcessAction
import com.liferay.exportimport.kernel.exception.LayoutImportException; //導入依賴的package包/類
@Override
protected void doProcessAction(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
_log.info("doProcessAction()");
String cmd = ParamUtil.getString(actionRequest, Constants.CMD);
_log.info("cmd = " + cmd);
String redirect = ParamUtil.getString(actionRequest, "redirect");
try {
if (cmd.equals(Constants.ADD_TEMP)) {
addTempFileEntry(actionRequest, ExportImportHelper.TEMP_FOLDER_NAME);
validateFile(actionRequest, actionResponse, ExportImportHelper.TEMP_FOLDER_NAME);
hideDefaultSuccessMessage(actionRequest);
} else if (cmd.equals(Constants.DELETE)) {
deleteBackgroundTasks(actionRequest, actionResponse);
sendRedirect(actionRequest, actionResponse, redirect);
} else if (cmd.equals(Constants.DELETE_TEMP)) {
deleteTempFileEntry(actionRequest, actionResponse, ExportImportHelper.TEMP_FOLDER_NAME);
hideDefaultSuccessMessage(actionRequest);
} else if (cmd.equals(Constants.IMPORT)) {
importData(actionRequest, ExportImportHelper.TEMP_FOLDER_NAME);
sendRedirect(actionRequest, actionResponse, redirect);
} else if (cmd.equals("importDataFromURL")) {
_log.info("importDataFromURL");
importDataFromURL(actionRequest, ExportImportHelper.TEMP_FOLDER_NAME);
sendRedirect(actionRequest, actionResponse, redirect);
}
} catch (Exception e) {
if (cmd.equals(Constants.ADD_TEMP) || cmd.equals(Constants.DELETE_TEMP)) {
hideDefaultSuccessMessage(actionRequest);
handleUploadException(actionRequest, actionResponse, ExportImportHelper.TEMP_FOLDER_NAME, e);
} else {
// TODO: remove dependencies to LARFile*
if (e instanceof LARFileException || e instanceof LARFileSizeException
|| e instanceof LARTypeException) {
SessionErrors.add(actionRequest, e.getClass());
} else if (e instanceof LayoutPrototypeException || e instanceof LocaleException) {
SessionErrors.add(actionRequest, e.getClass(), e);
} else {
_log.error(e, e);
SessionErrors.add(actionRequest, LayoutImportException.class.getName());
}
}
}
}