本文整理汇总了Java中org.kuali.rice.kns.util.KNSGlobalVariables.getKualiForm方法的典型用法代码示例。如果您正苦于以下问题:Java KNSGlobalVariables.getKualiForm方法的具体用法?Java KNSGlobalVariables.getKualiForm怎么用?Java KNSGlobalVariables.getKualiForm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.kns.util.KNSGlobalVariables
的用法示例。
在下文中一共展示了KNSGlobalVariables.getKualiForm方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getKeyValues
import org.kuali.rice.kns.util.KNSGlobalVariables; //导入方法依赖的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;
}
示例2: getCurrentDocumentTypeName
import org.kuali.rice.kns.util.KNSGlobalVariables; //导入方法依赖的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;
}
示例3: getKeyValues
import org.kuali.rice.kns.util.KNSGlobalVariables; //导入方法依赖的package包/类
@Override
public List<KeyValue> getKeyValues() {
List<KeyValue> roleNames = new ArrayList<KeyValue>();
if (KNSGlobalVariables.getKualiForm() != null && KNSGlobalVariables.getKualiForm() instanceof KualiMaintenanceForm) {
KualiMaintenanceForm form = (KualiMaintenanceForm)KNSGlobalVariables.getKualiForm();
MaintenanceDocument document = (MaintenanceDocument)form.getDocument();
PersistableBusinessObject businessObject = document.getNewMaintainableObject().getBusinessObject();
RuleBaseValues rule = null;
if (businessObject instanceof RuleBaseValues) {
rule = (RuleBaseValues)businessObject;
} else if (businessObject instanceof RuleDelegationBo) {
rule = ((RuleDelegationBo)businessObject).getDelegationRule();
} else {
throw new RiceRuntimeException("Cannot locate RuleBaseValues business object on maintenance document. Business Object was " + businessObject);
}
RuleTemplateBo ruleTemplate = rule.getRuleTemplate();
List<RoleName> roles = ruleTemplate.getRoles();
for (RoleName role : roles) {
roleNames.add(new ConcreteKeyValue(role.getName(), role.getLabel()));
}
}
return roleNames;
}
示例4: isMultipleValueLookup
import org.kuali.rice.kns.util.KNSGlobalVariables; //导入方法依赖的package包/类
private static boolean isMultipleValueLookup() {
KualiForm kualiForm = KNSGlobalVariables.getKualiForm();
if (kualiForm instanceof LookupForm) {
LookupForm lookupForm = (LookupForm) kualiForm;
return lookupForm.isMultipleValues();
} else {
return false;
}
}
示例5: loadBusinessObjectEntry
import org.kuali.rice.kns.util.KNSGlobalVariables; //导入方法依赖的package包/类
protected BusinessObjectEntry loadBusinessObjectEntry() {
KualiForm kualiForm = KNSGlobalVariables.getKualiForm();
if (kualiForm instanceof LookupForm) {
LookupForm lookupForm = (LookupForm) kualiForm;
if (!StringUtils.isBlank(lookupForm.getBusinessObjectClassName())) {
return KRADServiceLocatorWeb.getDataDictionaryService().getDataDictionary().getBusinessObjectEntry(lookupForm.getBusinessObjectClassName());
}
}
return null;
}
示例6: getKeyValues
import org.kuali.rice.kns.util.KNSGlobalVariables; //导入方法依赖的package包/类
/**
* @see org.kuali.rice.krad.keyvalues.KeyValuesFinder#getKeyValues()
*/
@Override
public List<KeyValue> getKeyValues() {
final List<KeyValue> actionRequestCodes = new ArrayList<KeyValue>();
// Acquire the Kuali form, and return the super class' result if the form is not a Kuali maintenance form.
final KualiForm kForm = KNSGlobalVariables.getKualiForm();
if (!(kForm instanceof KualiMaintenanceForm)) {
return super.getKeyValues();
}
// Acquire the Kuali maintenance form's document and its rule template.
final MaintenanceDocument maintDoc = (MaintenanceDocument) ((KualiMaintenanceForm) kForm).getDocument();
final RuleTemplateBo ruleTemplate = ((RuleBaseValues) maintDoc.getNewMaintainableObject().getBusinessObject()).getRuleTemplate();
// Ensure that the rule template is defined.
if (ruleTemplate == null) {
throw new RuntimeException("Rule template cannot be null for document ID " + maintDoc.getDocumentNumber());
}
// get the options to check for, as well as their related KEW constants.
final RuleTemplateOptionBo[] ruleOpts = {ruleTemplate.getAcknowledge(), ruleTemplate.getComplete(),
ruleTemplate.getApprove(), ruleTemplate.getFyi()};
final String[] ruleConsts = {KewApiConstants.ACTION_REQUEST_ACKNOWLEDGE_REQ, KewApiConstants.ACTION_REQUEST_COMPLETE_REQ,
KewApiConstants.ACTION_REQUEST_APPROVE_REQ, KewApiConstants.ACTION_REQUEST_FYI_REQ};
// Add the rule options to the list if they are not defined (true by default) or if they are explicitly set to true.
for (int i = 0; i < ruleOpts.length; i++) {
if (ruleOpts[i] == null || ruleOpts[i].getValue() == null || "true".equals(ruleOpts[i].getValue())) {
actionRequestCodes.add(new ConcreteKeyValue(ruleConsts[i], KewApiConstants.ACTION_REQUEST_CODES.get(ruleConsts[i])));
}
}
return actionRequestCodes;
}
示例7: findForm
import org.kuali.rice.kns.util.KNSGlobalVariables; //导入方法依赖的package包/类
/**
* @see org.kuali.ole.sys.document.service.AccountingLineRenderingService#findForm(javax.servlet.jsp.PageContext)
*/
public KualiAccountingDocumentFormBase findForm(PageContext pageContext) {
if (pageContext.getRequest().getAttribute(KUALI_FORM_NAME) != null) return (KualiAccountingDocumentFormBase)pageContext.getRequest().getAttribute(KUALI_FORM_NAME);
if (pageContext.getSession().getAttribute(KUALI_FORM_NAME) != null) return (KualiAccountingDocumentFormBase)pageContext.getSession().getAttribute(KUALI_FORM_NAME);
return (KualiAccountingDocumentFormBase)KNSGlobalVariables.getKualiForm();
}
示例8: getKeyValues
import org.kuali.rice.kns.util.KNSGlobalVariables; //导入方法依赖的package包/类
/**
* @see org.kuali.keyvalues.KeyValuesFinder#getKeyValues()
*/
@Override
@SuppressWarnings("unchecked")
public List<KeyValue> getKeyValues() {
final ContractsGrantsInvoiceDocumentService contractsGrantsInvoiceDocumentService = SpringContext.getBean(ContractsGrantsInvoiceDocumentService.class);
final Person currentUser = GlobalVariables.getUserSession().getPerson();
List<InvoiceTemplate> boList = (List<InvoiceTemplate>) SpringContext.getBean(KeyValuesService.class).findAll(InvoiceTemplate.class);
for (InvoiceTemplate element : boList) {
if (element.isActive()) {
if (!element.isRestrictUseByChartOrg()) {
keyValues.add(new ConcreteKeyValue(element.getInvoiceTemplateCode(), element.getInvoiceTemplateDescription()));
}
else {
ContractsGrantsInvoiceDocument contractsGrantsInvoiceDocument = null;
KualiForm kualiForm = KNSGlobalVariables.getKualiForm();
if (kualiForm instanceof ContractsGrantsInvoiceDocumentForm) {
contractsGrantsInvoiceDocument = ((ContractsGrantsInvoiceDocumentForm)kualiForm).getContractsGrantsInvoiceDocument();
}
if (contractsGrantsInvoiceDocumentService.isTemplateValidForContractsGrantsInvoiceDocument(element, contractsGrantsInvoiceDocument)) {
keyValues.add(new ConcreteKeyValue(element.getInvoiceTemplateCode(), element.getInvoiceTemplateDescription()));
}
}
}
}
return keyValues;
}
示例9: getContextlessMileageRate
import org.kuali.rice.kns.util.KNSGlobalVariables; //导入方法依赖的package包/类
/**
* It's better to use the mileage rate which passes in the effective date, but when calling from the JSP, that's going to be hard. Let's just grab the document from GlobalVariables for now
* @return the MileageRate
*/
@Deprecated
public MileageRate getContextlessMileageRate() {
final TravelFormBase travelForm = (TravelFormBase)KNSGlobalVariables.getKualiForm();
if (travelForm == null) {
return null;
}
final TravelDocument travelDocument = travelForm.getTravelDocument();
if (travelDocument == null) {
return null;
}
final java.sql.Date effectiveDate = travelDocument.getEffectiveDateForMileageRate(this);
return getMileageRate(effectiveDate);
}
示例10: getKeyValues
import org.kuali.rice.kns.util.KNSGlobalVariables; //导入方法依赖的package包/类
/**
* @see org.kuali.rice.krad.keyvalues.KeyValuesFinder#getKeyValues()
*/
@Override
public List<KeyValue> getKeyValues() {
List<KeyValue> keyValues = new ArrayList<KeyValue>();
keyValues.add(new ConcreteKeyValue(KFSConstants.EMPTY_STRING, KFSConstants.EMPTY_STRING));
final KualiForm kualiForm = KNSGlobalVariables.getKualiForm();
String documentType = TemConstants.TravelDocTypes.TEM_TRANSACTIONAL_DOCUMENT;
String tripType = null;
String travelerType = null;
boolean groupOnly = false;
if (kualiForm != null && kualiForm instanceof TravelFormBase) {
final TravelFormBase travelDocForm = (TravelFormBase)kualiForm;
final TravelDocument travelDocument = travelDocForm.getTravelDocument();
documentType = SpringContext.getBean(TravelDocumentService.class).getDocumentType(travelDocument);
if (!StringUtils.isBlank(travelDocument.getTripTypeCode())) {
tripType = travelDocument.getTripTypeCode();
}
if (!ObjectUtils.isNull(travelDocument.getTraveler()) && !StringUtils.isBlank(travelDocument.getTraveler().getTravelerTypeCode())) {
travelerType = travelDocument.getTraveler().getTravelerTypeCode();
}
}
final List<ExpenseType> expenseTypes = SpringContext.getBean(TravelExpenseService.class).getExpenseTypesForDocument(documentType, tripType, travelerType, groupOnly);
for (ExpenseType expenseType : expenseTypes) {
keyValues.add(new ConcreteKeyValue(expenseType.getCode(), expenseType.getCodeAndDescription()));
}
return keyValues;
}
示例11: getSearchDateFromDocument
import org.kuali.rice.kns.util.KNSGlobalVariables; //导入方法依赖的package包/类
/**
* @return the date to search for mileage rates on, based on the effective date from the document if possible
*/
protected java.sql.Date getSearchDateFromDocument() {
final KualiForm currentForm = KNSGlobalVariables.getKualiForm();
if (currentForm instanceof KualiDocumentFormBase && ((KualiDocumentFormBase)currentForm).getDocument() instanceof TravelDocument) {
final TravelDocument travelDoc = (TravelDocument)((KualiDocumentFormBase)currentForm).getDocument();
return travelDoc.getEffectiveDateForMileageRate(new ActualExpense());
}
return null;
}
示例12: applyConditionalLogicForFieldDisplay
import org.kuali.rice.kns.util.KNSGlobalVariables; //导入方法依赖的package包/类
/**
* This is a hack. This is called by Lookup's execute and it's just our way of making sure that maint links are turned on, even for an otherwise
* erstwhile non-maintainable object
* @see org.kuali.rice.kns.lookup.AbstractLookupableHelperServiceImpl#applyConditionalLogicForFieldDisplay()
*/
@Override
public void applyConditionalLogicForFieldDisplay() {
super.applyConditionalLogicForFieldDisplay();
LookupForm lookupForm = (LookupForm)KNSGlobalVariables.getKualiForm();
lookupForm.setShowMaintenanceLinks(true);
}
示例13: getMileageTotal
import org.kuali.rice.kns.util.KNSGlobalVariables; //导入方法依赖的package包/类
public KualiDecimal getMileageTotal() {
KualiDecimal total = KualiDecimal.ZERO;
if (KNSGlobalVariables.getKualiForm() instanceof TravelFormBase) {
final TravelFormBase travelForm = (TravelFormBase)KNSGlobalVariables.getKualiForm();
if (travelForm == null) {
return KualiDecimal.ZERO;
}
final TravelDocument travelDocument = travelForm.getTravelDocument();
return getMileageTotalForDocument(travelDocument);
}
return total;
}
示例14: canInitiate
import org.kuali.rice.kns.util.KNSGlobalVariables; //导入方法依赖的package包/类
/**
* @see org.kuali.rice.krad.document.DocumentPresentationControllerBase#canInitiate(java.lang.String)
*/
@Override
public boolean canInitiate(String documentTypeName) {
//only allow if a TR can be initiated without a TA
boolean initiateReimbursementWithoutAuthorization = getConfigurationService().getPropertyValueAsBoolean(TemKeyConstants.CONFIG_PROPERTY_REIMBURSEMENT_INITIATELINK_ENABLED);
//check Trip Types to verify at least one type can initiate TR without TA
initiateReimbursementWithoutAuthorization &= !getTravelReimbursementService().doAllReimbursementTripTypesRequireTravelAuthorization();
if (!initiateReimbursementWithoutAuthorization) {
throw new DocumentInitiationException(TemKeyConstants.ERROR_TA_REQUIRED_FOR_TR_INIT,new String[] {},true);
}
KualiForm form = KNSGlobalVariables.getKualiForm();
if (form instanceof TravelReimbursementForm) {
final TravelReimbursementForm reimbForm = (TravelReimbursementForm)form;
if (!StringUtils.isBlank(reimbForm.getTravelDocumentIdentifier())) {
// we're basing this document off of another document; let's look for any other TR's in the trip to verify they are not enroute
final List<TravelReimbursementDocument> trDocsInTrip = getTravelReimbursementsInTrip(reimbForm.getTravelDocumentIdentifier());
if (!trDocsInTrip.isEmpty()) {
for (TravelReimbursementDocument trDoc : trDocsInTrip) {
if (StringUtils.equals(trDoc.getFinancialSystemDocumentHeader().getFinancialDocumentStatusCode(), KFSConstants.DocumentStatusCodes.ENROUTE)) {
throw new DocumentInitiationException(TemKeyConstants.ERROR_TR_ENROUTE_DURING_TR_INIT, new String[] {reimbForm.getTravelDocumentIdentifier(), trDoc.getDocumentNumber()}, true);
}
}
}
}
}
return super.canInitiate(documentTypeName);
}
示例15: getKeyValues
import org.kuali.rice.kns.util.KNSGlobalVariables; //导入方法依赖的package包/类
/**
* @see org.kuali.rice.kns.lookup.keyvalues.KeyValuesFinder#getKeyValues()
*/
public List getKeyValues() {
CertificationReportForm form = (CertificationReportForm) KNSGlobalVariables.getKualiForm();
EffortCertificationDocument document = (EffortCertificationDocument)form.getDocument();
List keyValues = new ArrayList();
List<String> positionNumberList = document.getPositionList();
for (String positionNumber : positionNumberList) {
keyValues.add(new ConcreteKeyValue(positionNumber, positionNumber));
}
return keyValues;
}