當前位置: 首頁>>代碼示例>>Java>>正文


Java LARTypeException類代碼示例

本文整理匯總了Java中com.liferay.exportimport.kernel.exception.LARTypeException的典型用法代碼示例。如果您正苦於以下問題:Java LARTypeException類的具體用法?Java LARTypeException怎麽用?Java LARTypeException使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


LARTypeException類屬於com.liferay.exportimport.kernel.exception包,在下文中一共展示了LARTypeException類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: doProcessAction

import com.liferay.exportimport.kernel.exception.LARTypeException; //導入依賴的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());
            }
        }
    }
}
 
開發者ID:inofix,項目名稱:ch-inofix-timetracker,代碼行數:61,代碼來源:ImportTaskRecordsMVCActionCommand.java

示例2: doProcessAction

import com.liferay.exportimport.kernel.exception.LARTypeException; //導入依賴的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());
            }
        }
    }
}
 
開發者ID:inofix,項目名稱:ch-inofix-contact-manager,代碼行數:65,代碼來源:ImportContactsMVCActionCommand.java

示例3: doProcessAction

import com.liferay.exportimport.kernel.exception.LARTypeException; //導入依賴的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());
            }
        }
    }
}
 
開發者ID:inofix,項目名稱:ch-inofix-data-manager,代碼行數:69,代碼來源:ImportMeasurementsMVCActionCommand.java


注:本文中的com.liferay.exportimport.kernel.exception.LARTypeException類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。