当前位置: 首页>>代码示例>>Java>>正文


Java Constants类代码示例

本文整理汇总了Java中com.liferay.portal.kernel.util.Constants的典型用法代码示例。如果您正苦于以下问题:Java Constants类的具体用法?Java Constants怎么用?Java Constants使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Constants类属于com.liferay.portal.kernel.util包,在下文中一共展示了Constants类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doServeResource

import com.liferay.portal.kernel.util.Constants; //导入依赖的package包/类
@Override
protected void doServeResource(ResourceRequest request, ResourceResponse response)
		throws Exception {
	String cmd = ParamUtil.getString(request, Constants.CMD);
	String serializedJson = "";
	
	if(cmd.equals(CMD_PAGELIST)) {
		serializedJson = getPageLists(request,response );
	} else {
		_log.error("Unknown command is passed <" + cmd + ">");
	}
	
	HttpServletResponse servletResponse = _portal.getHttpServletResponse(
			response);

	servletResponse.setContentType(ContentTypes.APPLICATION_JSON);

	ServletResponseUtil.write(servletResponse, serializedJson);		
}
 
开发者ID:yasuflatland-lf,项目名称:liferay-dummy-factory,代码行数:20,代码来源:PageMVCResourceCommand.java

示例2: processAction

import com.liferay.portal.kernel.util.Constants; //导入依赖的package包/类
@Override
public void processAction(PortletConfig portletConfig, ActionRequest actionRequest,
		ActionResponse arg2) throws Exception {
	if (!Constants.UPDATE.equals(actionRequest.getParameter(Constants.CMD))) 
		return;
	
	PortletPreferences prefs;
	String portletResource = ParamUtil.getString(actionRequest, "portletResource");	
	if (Validator.isNotNull(portletResource)){
		prefs = PortletPreferencesFactoryUtil.getPortletSetup(actionRequest, portletResource);
	} else {
		prefs = actionRequest.getPreferences();
	}
	prefs.setValue("numerateModules", actionRequest.getParameter("numerateModules"));
	
	prefs.store();
	SessionMessages.add(actionRequest,portletConfig.getPortletName() + ".doConfigure");
	
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:20,代码来源:ModuleTitleConfigurationAction.java

示例3: doServeResource

import com.liferay.portal.kernel.util.Constants; //导入依赖的package包/类
@Override
protected void doServeResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse)
        throws Exception {
    
    String cmd = ParamUtil.getString(resourceRequest, Constants.CMD);

    PortletRequestDispatcher portletRequestDispatcher = null;

    if (cmd.equals(Constants.IMPORT)) {
        portletRequestDispatcher = getPortletRequestDispatcher(resourceRequest, "/import/processes_list/view.jsp");
    } else {
        portletRequestDispatcher = getPortletRequestDispatcher(resourceRequest,
                "/import/new_import/import_task_records_resources.jsp");
    }

    portletRequestDispatcher.include(resourceRequest, resourceResponse);
}
 
开发者ID:inofix,项目名称:ch-inofix-timetracker,代码行数:18,代码来源:ImportTaskRecordsMVCResourceCommand.java

示例4: getSaveAndContinueRedirect

import com.liferay.portal.kernel.util.Constants; //导入依赖的package包/类
protected String getSaveAndContinueRedirect(
        ActionRequest actionRequest, TaskRecord taskRecord, Layout layout, String redirect)
    throws Exception {

    PortletConfig portletConfig = (PortletConfig)actionRequest.getAttribute(
        JavaConstants.JAVAX_PORTLET_CONFIG);
    
    LiferayPortletURL portletURL = PortletURLFactoryUtil.create(actionRequest, portletConfig.getPortletName(), layout, PortletRequest.RENDER_PHASE);

    portletURL.setParameter("mvcRenderCommandName", "editTaskRecord");

    portletURL.setParameter(Constants.CMD, Constants.UPDATE, false);
    portletURL.setParameter("redirect", redirect, false);
    portletURL.setParameter(
        "groupId", String.valueOf(taskRecord.getGroupId()), false);
    portletURL.setParameter(
        "taskRecordId", String.valueOf(taskRecord.getTaskRecordId()), false);
    portletURL.setWindowState(actionRequest.getWindowState());

    return portletURL.toString();
}
 
开发者ID:inofix,项目名称:ch-inofix-timetracker,代码行数:22,代码来源:EditTaskRecordMVCActionCommand.java

示例5: doProcessAction

import com.liferay.portal.kernel.util.Constants; //导入依赖的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);

    if (cmd.equals(Constants.DELETE)) {
        deleteBackgroundTasks(actionRequest, actionResponse);
    } else if (cmd.equals(Constants.EXPORT)) {
        exportTaskRecords(actionRequest, actionResponse);
    }

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

    if (Validator.isNotNull(redirect)) {
        sendRedirect(actionRequest, actionResponse, redirect);
    }
}
 
开发者ID:inofix,项目名称:ch-inofix-timetracker,代码行数:22,代码来源:ExportTaskRecordsMVCActionCommand.java

示例6: getPercentage

import com.liferay.portal.kernel.util.Constants; //导入依赖的package包/类
@Override
public int getPercentage() {
    if (_percentage > PERCENTAGE_NONE) {
        return _percentage;
    }

    _percentage = PERCENTAGE_MAX;

    if (_allProgressBarCountersTotal > PERCENTAGE_MIN) {
        int base = PERCENTAGE_MAX;

        if (_phase.equals(Constants.EXPORT) && !Objects.equals(_cmd, Constants.PUBLISH_TO_REMOTE)) {

            base = _EXPORT_PHASE_MAX_PERCENTAGE;
        }

        _percentage = Math.round((float) _currentProgressBarCountersTotal / _allProgressBarCountersTotal * base);
    }

    return _percentage;
}
 
开发者ID:inofix,项目名称:ch-inofix-timetracker,代码行数:22,代码来源:ExportImportBackgroundTaskDisplay.java

示例7: getStatusMessageKey

import com.liferay.portal.kernel.util.Constants; //导入依赖的package包/类
protected String getStatusMessageKey() {
    if (Validator.isNotNull(_messageKey)) {
        return _messageKey;
    }

    _messageKey = StringPool.BLANK;

    if (hasRemoteMessage()) {
        _messageKey = "please-wait-as-the-publication-processes-on-the-remote-site";
    } else if (hasStagedModelMessage()) {
        _messageKey = "exporting";

        if (Objects.equals(_cmd, Constants.IMPORT)) {
            _messageKey = "importing";
        } else if (Objects.equals(_cmd, Constants.PUBLISH_TO_LIVE)
                || Objects.equals(_cmd, Constants.PUBLISH_TO_REMOTE)) {

            _messageKey = "publishing";
        }
    }

    return _messageKey;
}
 
开发者ID:inofix,项目名称:ch-inofix-timetracker,代码行数:24,代码来源:ExportImportBackgroundTaskDisplay.java

示例8: getSaveAndContinueRedirect

import com.liferay.portal.kernel.util.Constants; //导入依赖的package包/类
protected String getSaveAndContinueRedirect(
        ActionRequest actionRequest, Contact contact, Layout layout, String redirect)
    throws Exception {
    
    _log.info("getSaveAndContinueRedirect()");

    PortletConfig portletConfig = (PortletConfig)actionRequest.getAttribute(
        JavaConstants.JAVAX_PORTLET_CONFIG);
    
    LiferayPortletURL portletURL = PortletURLFactoryUtil.create(actionRequest, portletConfig.getPortletName(), layout, PortletRequest.RENDER_PHASE);

    portletURL.setParameter("mvcRenderCommandName", "editContact");

    portletURL.setParameter(Constants.CMD, Constants.UPDATE, false);
    portletURL.setParameter("redirect", redirect, false);
    portletURL.setParameter(
        "groupId", String.valueOf(contact.getGroupId()), false);
    portletURL.setParameter(
        "contactId", String.valueOf(contact.getContactId()), false);
    portletURL.setWindowState(actionRequest.getWindowState());

    return portletURL.toString();
}
 
开发者ID:inofix,项目名称:ch-inofix-contact-manager,代码行数:24,代码来源:EditContactMVCActionCommand.java

示例9: doServeResource

import com.liferay.portal.kernel.util.Constants; //导入依赖的package包/类
@Override
protected void doServeResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse)
        throws Exception {
    
    String cmd = ParamUtil.getString(resourceRequest, Constants.CMD);

    PortletRequestDispatcher portletRequestDispatcher = null;

    if (cmd.equals(Constants.IMPORT)) {
        portletRequestDispatcher = getPortletRequestDispatcher(resourceRequest, "/import/processes_list/view.jsp");
    } else {
        portletRequestDispatcher = getPortletRequestDispatcher(resourceRequest,
                "/import/new_import/import_contacts_resources.jsp");
    }

    portletRequestDispatcher.include(resourceRequest, resourceResponse);
}
 
开发者ID:inofix,项目名称:ch-inofix-contact-manager,代码行数:18,代码来源:ImportContactsMVCResourceCommand.java

示例10: doProcessAction

import com.liferay.portal.kernel.util.Constants; //导入依赖的package包/类
@Override
protected void doProcessAction(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {

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

    if (cmd.equals(Constants.DELETE)) {
        deleteBackgroundTasks(actionRequest, actionResponse);
    } else if (cmd.equals(Constants.EXPORT)) {
        exportContacts(actionRequest, actionResponse);
    }

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

    if (Validator.isNotNull(redirect)) {
        sendRedirect(actionRequest, actionResponse, redirect);
    }
}
 
开发者ID:inofix,项目名称:ch-inofix-contact-manager,代码行数:18,代码来源:ExportContactsMVCActionCommand.java

示例11: doServeResource

import com.liferay.portal.kernel.util.Constants; //导入依赖的package包/类
@Override
protected void doServeResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse) throws Exception {
	String cmd = ParamUtil.getString(resourceRequest, Constants.CMD);
	String serializedJson = "";

	if (cmd.equals(CMD_ROLELIST)) {
		serializedJson = getRoleLists(resourceRequest, resourceResponse);
	} else {
		_log.error("Unknown command is passed <" + cmd + ">");
	}

	HttpServletResponse response = _portal.getHttpServletResponse(resourceResponse);

	response.setContentType(ContentTypes.APPLICATION_JSON);

	ServletResponseUtil.write(response, serializedJson);
}
 
开发者ID:yasuflatland-lf,项目名称:liferay-dummy-factory,代码行数:18,代码来源:RoleMVCResourceCommand.java

示例12: doServeResource

import com.liferay.portal.kernel.util.Constants; //导入依赖的package包/类
@Override
protected void doServeResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse)
		throws Exception {
	String cmd = ParamUtil.getString(resourceRequest, Constants.CMD);
	String serializedJson = "";
	
	if(cmd.equals(CMD_THREAD_LIST)) {
		serializedJson = getThreadList(resourceRequest,resourceResponse );
		
	} else if (cmd.equals(CMD_CATEGORY_LIST)) {
		serializedJson = getCategoryList(resourceRequest,resourceResponse );
		
	} else {
		_log.error("Unknown command is passed <" + cmd + ">");
	}
	
	HttpServletResponse response = _portal.getHttpServletResponse(
			resourceResponse);

	response.setContentType(ContentTypes.APPLICATION_JSON);

	ServletResponseUtil.write(response, serializedJson);		
}
 
开发者ID:yasuflatland-lf,项目名称:liferay-dummy-factory,代码行数:24,代码来源:MBMVCResourceCommand.java

示例13: doServeResource

import com.liferay.portal.kernel.util.Constants; //导入依赖的package包/类
@Override
    protected void doServeResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse)
            throws Exception {
        
//        _log.info("doServeResource()");

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

//        _log.info("cmd = " + cmd);

        PortletRequestDispatcher portletRequestDispatcher = null;

        if (cmd.equals(Constants.IMPORT)) {
            portletRequestDispatcher = getPortletRequestDispatcher(resourceRequest, "/import/processes_list/view.jsp");
        } else {
            portletRequestDispatcher = getPortletRequestDispatcher(resourceRequest,
                    "/import/new_import/import_measurements_resources.jsp");
        }

        portletRequestDispatcher.include(resourceRequest, resourceResponse);
    }
 
开发者ID:inofix,项目名称:ch-inofix-data-manager,代码行数:22,代码来源:ImportMeasurementsMVCResourceCommand.java

示例14: getSaveAndContinueRedirect

import com.liferay.portal.kernel.util.Constants; //导入依赖的package包/类
protected String getSaveAndContinueRedirect(
        ActionRequest actionRequest, Measurement measurement, Layout layout, String redirect)
    throws Exception {

    PortletConfig portletConfig = (PortletConfig)actionRequest.getAttribute(
        JavaConstants.JAVAX_PORTLET_CONFIG);
    
    LiferayPortletURL portletURL = PortletURLFactoryUtil.create(actionRequest, portletConfig.getPortletName(), layout, PortletRequest.RENDER_PHASE);

    portletURL.setParameter("mvcRenderCommandName", "editMeasurement");

    portletURL.setParameter(Constants.CMD, Constants.UPDATE, false);
    portletURL.setParameter("redirect", redirect, false);
    portletURL.setParameter(
        "groupId", String.valueOf(measurement.getGroupId()), false);
    portletURL.setParameter(
        "measurementId", String.valueOf(measurement.getMeasurementId()), false);
    portletURL.setWindowState(actionRequest.getWindowState());

    return portletURL.toString();
}
 
开发者ID:inofix,项目名称:ch-inofix-data-manager,代码行数:22,代码来源:EditMeasurementMVCActionCommand.java

示例15: serveResource

import com.liferay.portal.kernel.util.Constants; //导入依赖的package包/类
@Override
public boolean serveResource(
		ResourceRequest resourceRequest, ResourceResponse resourceResponse)
	throws PortletException {

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

	if (cmd.equals("BOOKMARK_ORDERABLE")) {
		serveOlderUserBookmarks(resourceRequest, resourceResponse);
	}
	else {
		_editFolderMVCResourceCommand.serveResource(
			resourceRequest, resourceResponse);
	}

	return true;
}
 
开发者ID:liferay,项目名称:liferay-blade-samples,代码行数:18,代码来源:CustomMVCResourceCommand.java


注:本文中的com.liferay.portal.kernel.util.Constants类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。