当前位置: 首页>>代码示例>>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;未经允许,请勿转载。