• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java KualiForm类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.kuali.rice.kns.web.struts.form.KualiForm的典型用法代码示例。如果您正苦于以下问题:Java KualiForm类的具体用法?Java KualiForm怎么用?Java KualiForm使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



KualiForm类属于org.kuali.rice.kns.web.struts.form包,在下文中一共展示了KualiForm类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: toggleTab

import org.kuali.rice.kns.web.struts.form.KualiForm; //导入依赖的package包/类
/**
 * Toggles the tab state in the ui
 *
 * @param mapping
 * @param form
 * @param request
 * @param response
 * @return
 * @throws Exception
 */
public ActionForward toggleTab(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
    KualiForm kualiForm = (KualiForm) form;
    String tabToToggle = getTabToToggle(request);
    if (StringUtils.isNotBlank(tabToToggle)) {
        if (kualiForm.getTabState(tabToToggle).equals(KualiForm.TabState.OPEN.name())) {
            kualiForm.getTabStates().remove(tabToToggle);
            kualiForm.getTabStates().put(tabToToggle, KualiForm.TabState.CLOSE.name());
        }
        else {
            kualiForm.getTabStates().remove(tabToToggle);
            kualiForm.getTabStates().put(tabToToggle, KualiForm.TabState.OPEN.name());
        }
    }

    doProcessingAfterPost( kualiForm, request );
    return mapping.findForward(RiceConstants.MAPPING_BASIC);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:28,代码来源:KualiAction.java


示例2: retrieveLookupParameterValue

import org.kuali.rice.kns.web.struts.form.KualiForm; //导入依赖的package包/类
/**
 * Retrieves the value of a parameter to be passed into the lookup or inquiry frameworks.  The default implementation of this method will attempt to look
 * in the request to determine wheter the appropriate value exists as a request parameter.  If not, it will attempt to look through the form object to find
 * the property.
 * 
 * @param boClass a class implementing boClass, representing the BO that will be looked up
 * @param parameterName the name of the parameter
 * @param parameterValuePropertyName the property (relative to the form object) where the value to be passed into the lookup/inquiry may be found
 * @param form
 * @param request
 * @return
 */
protected String retrieveLookupParameterValue(Class<? extends BusinessObject> boClass, String parameterName, String parameterValuePropertyName, ActionForm form, HttpServletRequest request) throws Exception {
    String value;
    if (StringUtils.contains(parameterValuePropertyName, "'")) {
        value = StringUtils.replace(parameterValuePropertyName, "'", "");
    } else if (request.getParameterMap().containsKey(parameterValuePropertyName)) {
        value = request.getParameter(parameterValuePropertyName);
    } else if (request.getParameterMap().containsKey(KewApiConstants.DOCUMENT_ATTRIBUTE_FIELD_PREFIX + parameterValuePropertyName)) {
        value = request.getParameter(KewApiConstants.DOCUMENT_ATTRIBUTE_FIELD_PREFIX + parameterValuePropertyName);
    } else {
        if (form instanceof KualiForm) {
            value = ((KualiForm) form).retrieveFormValueForLookupInquiryParameters(parameterName, parameterValuePropertyName);
        } else {
            if (LOG.isDebugEnabled()) {
                LOG.debug("Unable to retrieve lookup/inquiry parameter value for parameter name " + parameterName + " parameter value property " + parameterValuePropertyName);
            }
            value = null;
        }
    }
    
    if (value != null && boClass != null && getBusinessObjectAuthorizationService().attributeValueNeedsToBeEncryptedOnFormsAndLinks(boClass, parameterName)) {
        LOG.warn("field name " + parameterName + " is a secure value and not returned in parameter result value");
        value = null;
    }
    return value;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:38,代码来源:KualiAction.java


示例3: canFullyUnmaskField

import org.kuali.rice.kns.web.struts.form.KualiForm; //导入依赖的package包/类
public static boolean canFullyUnmaskField(String businessObjectClassName, String fieldName, KualiForm form) {
	Class businessObjClass = null;
	try {
		businessObjClass = Class.forName(businessObjectClassName);
	}
	catch (Exception e) {
		throw new RuntimeException("Unable to resolve class name: " + businessObjectClassName);
	}
	if (form instanceof KualiDocumentFormBase) {
		return KNSServiceLocator.getBusinessObjectAuthorizationService().canFullyUnmaskField(
				GlobalVariables.getUserSession().getPerson(), businessObjClass, fieldName,
				((KualiDocumentFormBase) form).getDocument());
	}
	else {
		return KNSServiceLocator.getBusinessObjectAuthorizationService().canFullyUnmaskField(
				GlobalVariables.getUserSession().getPerson(), businessObjClass, fieldName, null);
	}
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:19,代码来源:WebUtils.java


示例4: canPartiallyUnmaskField

import org.kuali.rice.kns.web.struts.form.KualiForm; //导入依赖的package包/类
public static boolean canPartiallyUnmaskField(String businessObjectClassName, String fieldName, KualiForm form) {
	Class businessObjClass = null;
	try {
		businessObjClass = Class.forName(businessObjectClassName);
	}
	catch (Exception e) {
		throw new RuntimeException("Unable to resolve class name: " + businessObjectClassName);
	}
	if (form instanceof KualiDocumentFormBase) {
		return KNSServiceLocator.getBusinessObjectAuthorizationService().canPartiallyUnmaskField(
				GlobalVariables.getUserSession().getPerson(), businessObjClass, fieldName,
				((KualiDocumentFormBase) form).getDocument());
	}
	else {
		return KNSServiceLocator.getBusinessObjectAuthorizationService().canPartiallyUnmaskField(
				GlobalVariables.getUserSession().getPerson(), businessObjClass, fieldName, null);
	}
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:19,代码来源:WebUtils.java


示例5: getKeyValues

import org.kuali.rice.kns.web.struts.form.KualiForm; //导入依赖的package包/类
public List getKeyValues() {
    List<KeyValue> keyValues = new ArrayList<KeyValue>();

    keyValues.add(new ConcreteKeyValue("", ""));
    keyValues.add(new ConcreteKeyValue("TRT1", "Travel Request Type 1"));
    keyValues.add(new ConcreteKeyValue("TRT2", "Travel Request Type 2"));

    // This should populate Type 3 only if we can get the form from GlobalVariables
    // and if we can get the document from the form and the document is not null;
    // this should be true when this ValuesFinder is used within the context of the webapp.
    KualiForm form = KNSGlobalVariables.getKualiForm();
	if ((form != null) && (form instanceof KualiDocumentFormBase)) {
	    Document doc =((KualiDocumentFormBase)form).getDocument();
	    if (doc != null) {
	        keyValues.add(new ConcreteKeyValue("TRT3", "Travel Request Type 3"));
	    }
	}

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


示例6: doProcessingAfterPost

import org.kuali.rice.kns.web.struts.form.KualiForm; //导入依赖的package包/类
@Override
protected void doProcessingAfterPost(KualiForm actionForm, HttpServletRequest request) {
	super.doProcessingAfterPost(actionForm, request);
	BookOrderForm form = (BookOrderForm) actionForm;
       BookOrderDocument document = form.getBookOrderDocument();
       for (BookOrder entry : document.getBookOrders()) {
       	if(entry.getBookId() != null){
       	Book book = KNSServiceLocator.getBusinessObjectService().findBySinglePrimaryKey(Book.class, entry.getBookId());
       	entry.setUnitPrice(book.getPrice());
		Double totalPrice = 0.0d;
		if (book.getPrice() != null && entry.getQuantity() != null) {
			totalPrice = book.getPrice().doubleValue() * entry.getQuantity().intValue();
			if (entry.getDiscount() != null && entry.getDiscount().doubleValue() > 0) {
				totalPrice = totalPrice	- (totalPrice * entry.getDiscount().doubleValue() / 100);
			}
		}
		entry.setTotalPrice(new KualiDecimal(totalPrice));
       	entry.setBook(book);
       	}
       }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:22,代码来源:BookOrderAction.java


示例7: setDerivedValues

import org.kuali.rice.kns.web.struts.form.KualiForm; //导入依赖的package包/类
public void setDerivedValues(KualiForm form, HttpServletRequest request){
    KualiMaintenanceForm maintenanceForm = (KualiMaintenanceForm) form;
    MaintenanceDocumentBase maintenanceDocument = (MaintenanceDocumentBase) maintenanceForm.getDocument();
    Organization newOrg = (Organization) maintenanceDocument.getNewMaintainableObject().getBusinessObject();
    String organizationZipCode = newOrg.getOrganizationZipCode();
    String organizationCountryCode = newOrg.getOrganizationCountryCode();
    if (StringUtils.isNotBlank(organizationZipCode) && StringUtils.isNotBlank(organizationCountryCode)) {
        PostalCode postalZipCode = SpringContext.getBean(PostalCodeService.class).getPostalCode(organizationCountryCode, organizationZipCode);
        if (ObjectUtils.isNotNull(postalZipCode)) {
            newOrg.setOrganizationCityName(postalZipCode.getCityName());
            newOrg.setOrganizationStateCode(postalZipCode.getStateCode());
        }
        else {
            newOrg.setOrganizationCityName(KRADConstants.EMPTY_STRING);
               newOrg.setOrganizationStateCode(KRADConstants.EMPTY_STRING);
        }
    }
    else {
           newOrg.setOrganizationCityName(KRADConstants.EMPTY_STRING);
           newOrg.setOrganizationStateCode(KRADConstants.EMPTY_STRING);
    }
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:23,代码来源:OrgDerivedValuesSetter.java


示例8: insertAccountingLine

import org.kuali.rice.kns.web.struts.form.KualiForm; //导入依赖的package包/类
/**
 * When user adds an accounting line to the either source or target, if the object code on
 * that line has capital object type code group then a capital accounting line is created.
 * @see org.kuali.ole.sys.web.struts.KualiAccountingDocumentActionBase#insertAccountingLine(boolean, org.kuali.ole.sys.web.struts.KualiAccountingDocumentFormBase, org.kuali.ole.sys.businessobject.AccountingLine)
 */
@Override
protected void insertAccountingLine(boolean isSource, KualiAccountingDocumentFormBase financialDocumentForm, AccountingLine line) {
    super.insertAccountingLine(isSource, financialDocumentForm, line);

    CapitalAccountingLinesFormBase capitalAccountingLinesFormBase = (CapitalAccountingLinesFormBase) financialDocumentForm;
    CapitalAccountingLinesDocumentBase caldb = (CapitalAccountingLinesDocumentBase) capitalAccountingLinesFormBase.getFinancialDocument();
    String distributionAmountCode = capitalAccountingLinesFormBase.getCapitalAccountingLine().getDistributionCode();

    List<CapitalAccountingLines> capitalAccountingLines = caldb.getCapitalAccountingLines();

    //create the corresponding capital accounting line and then
    //sort the capital accounting lines by object code and account number
    createCapitalAccountingLine(capitalAccountingLines, line, distributionAmountCode);
    sortCaptitalAccountingLines(capitalAccountingLines);

    KualiForm kualiForm = financialDocumentForm;
    //sets the tab states for create/modify capital asset tabs...
    setTabStatesForCapitalAssets(kualiForm);
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:25,代码来源:CapitalAccountingLinesActionBase.java


示例9: uploadAccountingLines

import org.kuali.rice.kns.web.struts.form.KualiForm; //导入依赖的package包/类
/**
 * After uploading the accounting lines, the capital accounting lines will be created from these.
 * @see org.kuali.ole.sys.web.struts.KualiAccountingDocumentActionBase#uploadAccountingLines(boolean, org.apache.struts.action.ActionForm)
 */
@Override
protected void uploadAccountingLines(boolean isSource, ActionForm form) throws FileNotFoundException, IOException {
    super.uploadAccountingLines(isSource, form);

    KualiAccountingDocumentFormBase kualiAccountingDocumentFormBase = (KualiAccountingDocumentFormBase) form;
    CapitalAccountingLinesFormBase capitalAccountingLinesFormBase = (CapitalAccountingLinesFormBase) form;
    CapitalAccountingLinesDocumentBase caldb = (CapitalAccountingLinesDocumentBase) capitalAccountingLinesFormBase.getFinancialDocument();

    String distributionAmountCode = capitalAccountingLinesFormBase.getCapitalAccountingLine().getDistributionCode();

    List<CapitalAccountingLines> capitalAccountingLines = caldb.getCapitalAccountingLines();
    AccountingDocument tdoc = (AccountingDocument) kualiAccountingDocumentFormBase.getDocument();

    createCapitalAccountingLines(capitalAccountingLines, tdoc, distributionAmountCode);
    sortCaptitalAccountingLines(capitalAccountingLines);

    KualiForm kualiForm = (KualiForm) form;
    setTabStatesForCapitalAssets(kualiForm);
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:24,代码来源:CapitalAccountingLinesActionBase.java


示例10: canFullyUnmaskField

import org.kuali.rice.kns.web.struts.form.KualiForm; //导入依赖的package包/类
public static boolean canFullyUnmaskField(final String businessObjectClassName, final String fieldName, final KualiForm form) {
	try {
	    final Class businessObjClass = Class.forName(businessObjectClassName);
        TransactionTemplate template = new TransactionTemplate(getTransactionManager());
        return template.execute(new TransactionCallback<Boolean>() {
            @Override
            public Boolean doInTransaction(TransactionStatus status) {
                if (form instanceof KualiDocumentFormBase) {
                    return KNSServiceLocator.getBusinessObjectAuthorizationService().canFullyUnmaskField(
                            GlobalVariables.getUserSession().getPerson(), businessObjClass, fieldName,
                            ((KualiDocumentFormBase) form).getDocument());
                }
                else {
                    return KNSServiceLocator.getBusinessObjectAuthorizationService().canFullyUnmaskField(
                            GlobalVariables.getUserSession().getPerson(), businessObjClass, fieldName, null);
                }
            }
        });
	}
	catch (Exception e) {
		throw new RuntimeException("Unable to resolve class name: " + businessObjectClassName);
	}
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:24,代码来源:WebUtils.java


示例11: canPartiallyUnmaskField

import org.kuali.rice.kns.web.struts.form.KualiForm; //导入依赖的package包/类
public static boolean canPartiallyUnmaskField(String businessObjectClassName, final String fieldName, final KualiForm form) {
	try {
		final Class businessObjClass = Class.forName(businessObjectClassName);
        TransactionTemplate template = new TransactionTemplate(getTransactionManager());
        return template.execute(new TransactionCallback<Boolean>() {
            @Override
            public Boolean doInTransaction(TransactionStatus status) {
                if (form instanceof KualiDocumentFormBase) {
                    return KNSServiceLocator.getBusinessObjectAuthorizationService().canPartiallyUnmaskField(
                            GlobalVariables.getUserSession().getPerson(), businessObjClass, fieldName,
                            ((KualiDocumentFormBase) form).getDocument());
                }
                else {
                    return KNSServiceLocator.getBusinessObjectAuthorizationService().canPartiallyUnmaskField(
                            GlobalVariables.getUserSession().getPerson(), businessObjClass, fieldName, null);
                }
            }
        });
	}
	catch (Exception e) {
		throw new RuntimeException("Unable to resolve class name: " + businessObjectClassName);
	}
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:24,代码来源:WebUtils.java


示例12: getCurrentDocumentTypeName

import org.kuali.rice.kns.web.struts.form.KualiForm; //导入依赖的package包/类
/**
 * Looks in the form from KNSGlobalVariables to try to figure out what the document type of the current document is
 * @return
 */
protected String getCurrentDocumentTypeName() {
    final KualiForm form = KNSGlobalVariables.getKualiForm();
    if (form != null) {
        if (form instanceof KualiDocumentFormBase) {
            return ((KualiDocumentFormBase)KNSGlobalVariables.getKualiForm()).getDocTypeName();
        } else if (form instanceof LookupForm) {
            final String docNum = ((LookupForm)KNSGlobalVariables.getKualiForm()).getDocNum();
            if(!StringUtils.isBlank(docNum)) {
                WorkflowDocument workflowDocument = SpringContext.getBean(SessionDocumentService.class).getDocumentFromSession(GlobalVariables.getUserSession(), docNum);
                return workflowDocument.getDocumentTypeName();
            }
        }
    }
    return null;
}
 
开发者ID:kuali,项目名称:kfs,代码行数:20,代码来源:TravelerProfileDocLookupableHelperServiceImpl.java


示例13: setTabStateForEmergencyContacts

import org.kuali.rice.kns.web.struts.form.KualiForm; //导入依赖的package包/类
protected void setTabStateForEmergencyContacts(TravelAuthorizationForm form) {
    TravelAuthorizationDocument travelAuthDocument = (TravelAuthorizationDocument) form.getDocument();

    boolean openTab = false;
    Collection<String> internationalTrips = getParameterService().getParameterValuesAsString(TemParameterConstants.TEM_DOCUMENT.class, TravelParameters.INTERNATIONAL_TRIP_TYPES);
    if (travelAuthDocument.getTripTypeCode() != null) {
        if (internationalTrips.contains(travelAuthDocument.getTripTypeCode())){
            openTab = true;
        }

        if (openTab) {
            String tabKey = WebUtils.generateTabKey(TemConstants.TabTitles.EMERGENCY_CONTACT_INFORMATION_TAB_TITLE);
            form.getTabStates().put(tabKey, KualiForm.TabState.OPEN.name());
        }
    }
    return;
}
 
开发者ID:kuali,项目名称:kfs,代码行数:18,代码来源:TravelAuthorizationAction.java


示例14: buildBudgetUrl

import org.kuali.rice.kns.web.struts.form.KualiForm; //导入依赖的package包/类
/**
 * Builds a budget URL setting default parameters.
 * 
 * @param mapping struts action mapping
 * @param form BudgetExpansionForm
 * @param actionPath url path for requested action
 * @param additionalParameters appended to the url or replace default
 * @return string url
 */
public static String buildBudgetUrl(ActionMapping mapping, BudgetExpansionForm form, String actionPath, Map<String, String> additionalParameters) {
    Properties parameters = new Properties();
    parameters.put(KFSConstants.DISPATCH_REQUEST_PARAMETER, KFSConstants.START_METHOD);
    parameters.put(BCConstants.RETURN_FORM_KEY, GlobalVariables.getUserSession().addObjectWithGeneratedKey(form, BCConstants.FORMKEY_PREFIX));

    String basePath = SpringContext.getBean(ConfigurationService.class).getPropertyValueAsString(KFSConstants.APPLICATION_URL_KEY);
    parameters.put(KFSConstants.BACK_LOCATION, basePath + mapping.getPath() + ".do");
    parameters.put(KFSPropertyConstants.UNIVERSITY_FISCAL_YEAR, form.getUniversityFiscalYear().toString());
    parameters.put(KFSPropertyConstants.KUALI_USER_PERSON_UNIVERSAL_IDENTIFIER, GlobalVariables.getUserSession().getPerson().getPrincipalId());
    
    if (StringUtils.isNotEmpty(((KualiForm) form).getAnchor())) {
        parameters.put(BCConstants.RETURN_ANCHOR, ((KualiForm) form).getAnchor());
    }

    if (additionalParameters != null) {
        for (String parameterKey : additionalParameters.keySet()) {
            parameters.put(parameterKey, additionalParameters.get(parameterKey));
        }
    }

    return UrlFactory.parameterizeUrl(basePath + "/" + actionPath, parameters);
}
 
开发者ID:kuali,项目名称:kfs,代码行数:32,代码来源:BudgetUrlUtil.java


示例15: doProcessingAfterPost

import org.kuali.rice.kns.web.struts.form.KualiForm; //导入依赖的package包/类
@Override
protected void doProcessingAfterPost(KualiForm actionForm, HttpServletRequest request) {
    super.doProcessingAfterPost(actionForm, request);
    BookOrderForm form = (BookOrderForm) actionForm;
    BookOrderDocument document = form.getBookOrderDocument();

    for (BookOrder entry : document.getBookOrders()) {
        if (entry.getBookId() != null) {
            Book book = KRADServiceLocator.getBusinessObjectService().findBySinglePrimaryKey(Book.class,
                    entry.getBookId());
            entry.setUnitPrice(book.getPrice());
            Double totalPrice = 0.0d;

            if (book.getPrice() != null && entry.getQuantity() != null) {
                totalPrice = book.getPrice().doubleValue() * entry.getQuantity().intValue();

                if (entry.getDiscount() != null && entry.getDiscount().doubleValue() > 0) {
                    totalPrice = totalPrice - (totalPrice * entry.getDiscount().doubleValue() / 100);
                }
            }

            entry.setTotalPrice(new KualiDecimal(totalPrice));
            entry.setBook(book);
        }
    }
}
 
开发者ID:kuali,项目名称:rice,代码行数:27,代码来源:SampleAction.java


示例16: doProcessingAfterPost

import org.kuali.rice.kns.web.struts.form.KualiForm; //导入依赖的package包/类
@Override
protected void doProcessingAfterPost(KualiForm actionForm, HttpServletRequest request) {
    super.doProcessingAfterPost(actionForm, request);
    BookOrderForm form = (BookOrderForm) actionForm;
    BookOrderDocument document = form.getBookOrderDocument();
    for (BookOrder entry : document.getBookOrders()) {

        if (entry.getBookId() != null) {
            Book book = KRADServiceLocator.getBusinessObjectService().findBySinglePrimaryKey(Book.class,
                    entry.getBookId());
            entry.setUnitPrice(book.getPrice());
            Double totalPrice = 0.0d;

            if (book.getPrice() != null && entry.getQuantity() != null) {
                totalPrice = book.getPrice().doubleValue() * entry.getQuantity().intValue();
                if (entry.getDiscount() != null && entry.getDiscount().doubleValue() > 0) {
                    totalPrice = totalPrice - (totalPrice * entry.getDiscount().doubleValue() / 100);
                }
            }

            entry.setTotalPrice(new KualiDecimal(totalPrice));
            entry.setBook(book);
        }
    }
}
 
开发者ID:kuali,项目名称:rice,代码行数:26,代码来源:SampleAction.java


示例17: doProcessingAfterPost

import org.kuali.rice.kns.web.struts.form.KualiForm; //导入依赖的package包/类
@Override
protected void doProcessingAfterPost(KualiForm actionForm, HttpServletRequest request) {
	super.doProcessingAfterPost(actionForm, request);
	BookOrderForm form = (BookOrderForm) actionForm;
       BookOrderDocument document = form.getBookOrderDocument();
       for (BookOrder entry : document.getBookOrders()) {
       	if(entry.getBookId() != null){
       	Book book = KRADServiceLocator.getBusinessObjectService().findBySinglePrimaryKey(Book.class, entry.getBookId());
       	entry.setUnitPrice(book.getPrice());
		Double totalPrice = 0.0d;
		if (book.getPrice() != null && entry.getQuantity() != null) {
			totalPrice = book.getPrice().doubleValue() * entry.getQuantity().intValue();
			if (entry.getDiscount() != null && entry.getDiscount().doubleValue() > 0) {
				totalPrice = totalPrice	- (totalPrice * entry.getDiscount().doubleValue() / 100);
			}
		}
		entry.setTotalPrice(new KualiDecimal(totalPrice));
       	entry.setBook(book);
       	}
       }
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:22,代码来源:BookOrderAction.java


示例18: doProcessingAfterPost

import org.kuali.rice.kns.web.struts.form.KualiForm; //导入依赖的package包/类
@Override
protected void doProcessingAfterPost(KualiForm actionForm, HttpServletRequest request) {
    super.doProcessingAfterPost(actionForm, request);
    BookOrderForm form = (BookOrderForm) actionForm;
    BookOrderDocument document = form.getBookOrderDocument();
    for (BookOrder entry : document.getBookOrders()) {
        if(entry.getBookId() != null){
            Book book = KRADServiceLocator.getBusinessObjectService().findBySinglePrimaryKey(Book.class, entry.getBookId());
            entry.setUnitPrice(book.getPrice());
            Double totalPrice = 0.0d;
            if (book.getPrice() != null && entry.getQuantity() != null) {
                totalPrice = book.getPrice().doubleValue() * entry.getQuantity().intValue();
                if (entry.getDiscount() != null && entry.getDiscount().doubleValue() > 0) {
                    totalPrice = totalPrice	- (totalPrice * entry.getDiscount().doubleValue() / 100);
                }
            }
            entry.setTotalPrice(new KualiDecimal(totalPrice));
            entry.setBook(book);
        }
    }
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:22,代码来源:SampleAction.java


示例19: processPopulate

import org.kuali.rice.kns.web.struts.form.KualiForm; //导入依赖的package包/类
/**
 * Hooks into populate process to call form populate method if form is an
 * instanceof PojoForm.
 */
@Override
protected void processPopulate(HttpServletRequest request, HttpServletResponse response, ActionForm form, ActionMapping mapping) throws ServletException {
	if (form instanceof KualiForm) {
		// Add the ActionForm to GlobalVariables
		// This will allow developers to retrieve both the Document and any
		// request parameters that are not
		// part of the Form and make them available in ValueFinder classes
		// and other places where they are needed.
		KNSGlobalVariables.setKualiForm((KualiForm) form);
	}

	// if not PojoForm, call struts populate
	if (!(form instanceof PojoForm)) {
		super.processPopulate(request, response, form, mapping);
		return;
	}
	
	final String previousRequestGuid = request.getParameter(KualiRequestProcessor.PREVIOUS_REQUEST_EDITABLE_PROPERTIES_GUID_PARAMETER_NAME);

	((PojoForm)form).clearEditablePropertyInformation();
	((PojoForm)form).registerStrutsActionMappingScope(mapping.getScope());
	
	String multipart = mapping.getMultipartClass();
	if (multipart != null) {
		request.setAttribute(Globals.MULTIPART_KEY, multipart);
	}

	form.setServlet(this.servlet);
	form.reset(mapping, request);

	((PojoForm)form).setPopulateEditablePropertiesGuid(previousRequestGuid);
	// call populate on ActionForm
	((PojoForm) form).populate(request);
	request.setAttribute("UnconvertedValues", ((PojoForm) form).getUnconvertedValues().keySet());
	request.setAttribute("UnconvertedHash", ((PojoForm) form).getUnconvertedValues());
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:41,代码来源:KualiRequestProcessor.java


示例20: findMethodToCall

import org.kuali.rice.kns.web.struts.form.KualiForm; //导入依赖的package包/类
protected String findMethodToCall(ActionForm form, HttpServletRequest request) throws Exception {
    String methodToCall;
    if (form instanceof KualiForm && StringUtils.isNotEmpty(((KualiForm) form).getMethodToCall())) {
        methodToCall = ((KualiForm) form).getMethodToCall();
    }
    else {
        // call utility method to parse the methodToCall from the request.
        methodToCall = WebUtils.parseMethodToCall(form, request);
    }
    return methodToCall;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:12,代码来源:KualiAction.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TiclMessageValidator2类代码示例发布时间:2022-05-22
下一篇:
Java EventType类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap