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


Java KRADConstants.QUESTION_TEXT_ATTRIBUTE_NAME属性代码示例

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


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

示例1: performQuestion

/**
 * Handles rendering a question prompt - with a specified context.
 *
 * @param mapping
 * @param form
 * @param request
 * @param response
 * @param questionId
 * @param questionText
 * @param questionType
 * @param caller
 * @param context
 * @param showReasonField
 * @param reason
 * @param errorKey
 * @param errorPropertyName
 * @param errorParameter
 * @return ActionForward
 * @throws Exception
 */
private ActionForward performQuestion(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response, String questionId, String questionText, String questionType, String caller, String context, boolean showReasonField, String reason, String errorKey, String errorPropertyName, String errorParameter) throws Exception {
    Properties parameters = new Properties();

    parameters.put(KRADConstants.DISPATCH_REQUEST_PARAMETER, "start");
    parameters.put(KRADConstants.DOC_FORM_KEY, GlobalVariables.getUserSession().addObjectWithGeneratedKey(form));
    parameters.put(KRADConstants.CALLING_METHOD, caller);
    parameters.put(KRADConstants.QUESTION_INST_ATTRIBUTE_NAME, questionId);
    parameters.put(KRADConstants.QUESTION_IMPL_ATTRIBUTE_NAME, questionType);
    //parameters.put(KRADConstants.QUESTION_TEXT_ATTRIBUTE_NAME, questionText);
    parameters.put(KRADConstants.RETURN_LOCATION_PARAMETER, getReturnLocation(request, mapping));
    parameters.put(KRADConstants.QUESTION_CONTEXT, context);
    parameters.put(KRADConstants.QUESTION_SHOW_REASON_FIELD, Boolean.toString(showReasonField));
    parameters.put(KRADConstants.QUESTION_REASON_ATTRIBUTE_NAME, reason);
    parameters.put(KRADConstants.QUESTION_ERROR_KEY, errorKey);
    parameters.put(KRADConstants.QUESTION_ERROR_PROPERTY_NAME, errorPropertyName);
    parameters.put(KRADConstants.QUESTION_ERROR_PARAMETER, errorParameter);
    parameters.put(KRADConstants.QUESTION_ANCHOR, form instanceof KualiForm ? ObjectUtils.toString(((KualiForm) form).getAnchor()) : "");
    Object methodToCallAttribute = request.getAttribute(KRADConstants.METHOD_TO_CALL_ATTRIBUTE);
    if (methodToCallAttribute != null) {
        parameters.put(KRADConstants.METHOD_TO_CALL_PATH, methodToCallAttribute);
        ((PojoForm) form).registerEditableProperty(String.valueOf(methodToCallAttribute));
    }
    
    if (form instanceof KualiDocumentFormBase) {
        String docNum = ((KualiDocumentFormBase) form).getDocument().getDocumentNumber();
        if(docNum != null){
            parameters.put(KRADConstants.DOC_NUM, ((KualiDocumentFormBase) form)
                .getDocument().getDocumentNumber());
        }
    }
    
    // KULRICE-8077: PO Quote Limitation of Only 9 Vendors
    String questionTextAttributeName = KRADConstants.QUESTION_TEXT_ATTRIBUTE_NAME + questionId;
    GlobalVariables.getUserSession().addObject(questionTextAttributeName, (Object)questionText);

    String questionUrl = UrlFactory.parameterizeUrl(getApplicationBaseUrl() + "/kr/" + KRADConstants.QUESTION_ACTION, parameters);
    return new ActionForward(questionUrl, true);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:58,代码来源:KualiAction.java

示例2: populate

/**
 * @see org.kuali.rice.krad.web.struts.pojo.PojoForm#populate(javax.servlet.http.HttpServletRequest)
 */
public void populate(HttpServletRequest request) {
    super.populate(request);

    // set the title of the jsp, this should come from a resource bundle
    title = KRADConstants.QUESTION_PAGE_TITLE;

    if (request.getAttribute(KRADConstants.DOC_FORM_KEY) != null) {
        this.setFormKey((String) request.getAttribute(KRADConstants.DOC_FORM_KEY));
    }
    else if (request.getParameter(KRADConstants.DOC_FORM_KEY) != null) {
        this.setFormKey(request.getParameter(KRADConstants.DOC_FORM_KEY));
    }
    
    if (request.getAttribute(KRADConstants.DOC_NUM) != null) {
        this.setFormKey((String) request.getAttribute(KRADConstants.DOC_NUM));
    }
    

    if (request.getParameter(KRADConstants.RETURN_LOCATION_PARAMETER) != null) {
        this.setBackLocation(request.getParameter(KRADConstants.RETURN_LOCATION_PARAMETER));
    }

    if (getMethodToCall().equals(KRADConstants.START_METHOD)) { // don't do this for the processAnswer action otherwise it blows up
        Question kualiQuestion = KNSServiceLocator.getQuestion(questionType);
        if (kualiQuestion == null) {
            throw new RuntimeException("question implementation not found: " + request.getParameter(KRADConstants.QUESTION_IMPL_ATTRIBUTE_NAME));
        }
       
        // KULRICE-8077: PO Quote Limitation of Only 9 Vendors
        String questionId = request.getParameter(KRADConstants.QUESTION_INST_ATTRIBUTE_NAME);
        String questionTextAttributeName = KRADConstants.QUESTION_TEXT_ATTRIBUTE_NAME + questionId;
        
        if (GlobalVariables.getUserSession().retrieveObject(questionTextAttributeName)!=null) {
            this.setQuestionText((String)GlobalVariables.getUserSession().retrieveObject(questionTextAttributeName));
            GlobalVariables.getUserSession().removeObject(questionTextAttributeName);
        }
       
        // some questions types default these so we should default if not
        // present in request
        if (questionText == null) {
            questionText = kualiQuestion.getQuestion();
        }

        if (buttons == null) {
            buttons = kualiQuestion.getButtons();
        }
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:51,代码来源:QuestionPromptForm.java


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