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


Java KRADUtils.translateRequestParameterMap方法代码示例

本文整理汇总了Java中org.kuali.rice.krad.util.KRADUtils.translateRequestParameterMap方法的典型用法代码示例。如果您正苦于以下问题:Java KRADUtils.translateRequestParameterMap方法的具体用法?Java KRADUtils.translateRequestParameterMap怎么用?Java KRADUtils.translateRequestParameterMap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.kuali.rice.krad.util.KRADUtils的用法示例。


在下文中一共展示了KRADUtils.translateRequestParameterMap方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getViewIdFromRequest

import org.kuali.rice.krad.util.KRADUtils; //导入方法依赖的package包/类
/**
 * Attempts to resolve a view id from the given request
 *
 * <p>
 * First an attempt will be made to find the view id as a request parameter. If no such request parameter
 * is found, the request will be looked at for view type information and a call will be made to the
 * view service to find the view id by type
 * </p>
 *
 * <p>
 * If a view id is found it is stuck in the request as an attribute (under the key
 * {@link org.kuali.rice.krad.uif.UifParameters#VIEW_ID}) for subsequent retrieval
 * </p>
 *
 * @param request instance to resolve view id for
 * @return view id if one is found, null if not found
 */
protected String getViewIdFromRequest(HttpServletRequest request) {
    String viewId = request.getParameter(UifParameters.VIEW_ID);

    if (StringUtils.isBlank(viewId)) {
        String viewTypeName = request.getParameter(UifParameters.VIEW_TYPE_NAME);

        UifConstants.ViewType viewType = null;
        if (StringUtils.isNotBlank(viewTypeName)) {
            viewType = UifConstants.ViewType.valueOf(viewTypeName);
        }

        if (viewType != null) {
            @SuppressWarnings("unchecked") Map<String, String> parameterMap =
                    KRADUtils.translateRequestParameterMap(request.getParameterMap());
            viewId = getViewService().getViewIdForViewType(viewType, parameterMap);
        }
    }

    if (StringUtils.isNotBlank(viewId)) {
        request.setAttribute(UifParameters.VIEW_ID, viewId);
    }

    return viewId;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:42,代码来源:UifSessionTimeoutFilter.java

示例2: buildKeyMapFromRequest

import org.kuali.rice.krad.util.KRADUtils; //导入方法依赖的package包/类
/**
 * Based on the maintenance object class retrieves the key field names from
 * the <code>BusinessObjectMetaDataService</code> (or alternatively from the
 * request parameters), then retrieves any matching key value pairs from the
 * request parameters
 *
 * @param requestParameters - map of parameters from the request
 * @param dataObjectClass - class to use for checking security parameter restrictions
 * @return Map<String, String> key value pairs
 */
protected Map<String, String> buildKeyMapFromRequest(Map<String, String[]> requestParameters,
        Class<?> dataObjectClass) {
    List<String> keyFieldNames = null;

    // translate request parameters
    Map<String, String> parameters = KRADUtils.translateRequestParameterMap(requestParameters);

    // are override keys listed in the request? If so, then those need to be
    // our keys, not the primary key fields for the BO
    if (!StringUtils.isBlank(parameters.get(KRADConstants.OVERRIDE_KEYS))) {
        String[] overrideKeys =
                parameters.get(KRADConstants.OVERRIDE_KEYS).split(KRADConstants.FIELD_CONVERSIONS_SEPARATOR);
        keyFieldNames = Arrays.asList(overrideKeys);
    } else {
        keyFieldNames = legacyDataAdapter.listPrimaryKeyFieldNames(dataObjectClass);
    }

    return KRADUtils.getParametersFromRequest(keyFieldNames, dataObjectClass, parameters);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:30,代码来源:MaintenanceDocumentServiceImpl.java

示例3: getViewByType

import org.kuali.rice.krad.util.KRADUtils; //导入方法依赖的package包/类
/**
 * Attempts to get a view instance by looking for a view type name in the request or the form and querying
 * that view type with the request parameters
 *
 * @param request request instance to pull parameters from
 * @param form form instance to pull values from
 * @return View instance if found or null
 */
protected View getViewByType(ServletRequest request, UifFormBase form) {
    View view = null;

    String viewTypeName = request.getParameter(UifParameters.VIEW_TYPE_NAME);
    ViewType viewType = StringUtils.isBlank(viewTypeName) ? form.getViewTypeName() : ViewType.valueOf(viewTypeName);

    if (viewType != null) {
        Map<String, String> parameterMap = KRADUtils.translateRequestParameterMap(request.getParameterMap());
        view = getViewService().getViewByType(viewType, parameterMap);
    }

    return view;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:22,代码来源:UifServletRequestDataBinder.java


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