本文整理汇总了Java中org.kuali.rice.kns.web.struts.form.KualiMaintenanceForm.getDocument方法的典型用法代码示例。如果您正苦于以下问题:Java KualiMaintenanceForm.getDocument方法的具体用法?Java KualiMaintenanceForm.getDocument怎么用?Java KualiMaintenanceForm.getDocument使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.kns.web.struts.form.KualiMaintenanceForm
的用法示例。
在下文中一共展示了KualiMaintenanceForm.getDocument方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toggleInactiveRecordDisplay
import org.kuali.rice.kns.web.struts.form.KualiMaintenanceForm; //导入方法依赖的package包/类
/**
* Turns on (or off) the inactive record display for a maintenance collection.
*/
public ActionForward toggleInactiveRecordDisplay(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
KualiMaintenanceForm maintenanceForm = (KualiMaintenanceForm) form;
MaintenanceDocument document = (MaintenanceDocument) maintenanceForm.getDocument();
Maintainable oldMaintainable = document.getOldMaintainableObject();
Maintainable newMaintainable = document.getNewMaintainableObject();
String collectionName = extractCollectionName(request, KRADConstants.TOGGLE_INACTIVE_METHOD);
if (collectionName == null) {
LOG.error("Unable to get find collection name in request.");
throw new RuntimeException("Unable to get find collection class in request.");
}
String parameterName = (String) request.getAttribute(KRADConstants.METHOD_TO_CALL_ATTRIBUTE);
boolean showInactive = Boolean.parseBoolean(StringUtils.substringBetween(parameterName, KRADConstants.METHOD_TO_CALL_BOPARM_LEFT_DEL, "."));
oldMaintainable.setShowInactiveRecords(collectionName, showInactive);
newMaintainable.setShowInactiveRecords(collectionName, showInactive);
return mapping.findForward(RiceConstants.MAPPING_BASIC);
}
示例2: setDerivedValues
import org.kuali.rice.kns.web.struts.form.KualiMaintenanceForm; //导入方法依赖的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);
}
}
示例3: getKeyValues
import org.kuali.rice.kns.web.struts.form.KualiMaintenanceForm; //导入方法依赖的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: docHandler
import org.kuali.rice.kns.web.struts.form.KualiMaintenanceForm; //导入方法依赖的package包/类
/**
* Handles creating and loading of documents.
*/
@Override
public ActionForward docHandler(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
ActionForward af = super.docHandler(mapping, form, request, response);
if (af.getName().equals(KRADConstants.KRAD_INITIATED_DOCUMENT_VIEW_NAME))
{
return af;
}
KualiMaintenanceForm kualiMaintenanceForm = (KualiMaintenanceForm) form;
if (KewApiConstants.ACTIONLIST_COMMAND.equals(kualiMaintenanceForm.getCommand()) || KewApiConstants.DOCSEARCH_COMMAND.equals(kualiMaintenanceForm.getCommand()) || KewApiConstants.SUPERUSER_COMMAND.equals(kualiMaintenanceForm.getCommand()) || KewApiConstants.HELPDESK_ACTIONLIST_COMMAND.equals(kualiMaintenanceForm.getCommand()) && kualiMaintenanceForm.getDocId() != null) {
if (kualiMaintenanceForm.getDocument() instanceof MaintenanceDocument) {
kualiMaintenanceForm.setReadOnly(true);
kualiMaintenanceForm.setMaintenanceAction(((MaintenanceDocument) kualiMaintenanceForm.getDocument()).getNewMaintainableObject().getMaintenanceAction());
//Retrieving the FileName from BO table
Maintainable tmpMaintainable = ((MaintenanceDocument) kualiMaintenanceForm.getDocument()).getNewMaintainableObject();
if(tmpMaintainable.getBusinessObject() instanceof PersistableAttachment) {
PersistableAttachment bo = (PersistableAttachment) getBusinessObjectService().retrieve(tmpMaintainable.getBusinessObject());
if (bo != null) {
request.setAttribute("fileName", bo.getFileName());
}
}
}
else {
LOG.error("Illegal State: document is not a maintenance document");
throw new IllegalArgumentException("Document is not a maintenance document");
}
}
else if (KewApiConstants.INITIATE_COMMAND.equals(kualiMaintenanceForm.getCommand())) {
kualiMaintenanceForm.setReadOnly(false);
return setupMaintenance(mapping, form, request, response, KRADConstants.MAINTENANCE_NEW_ACTION);
}
else {
LOG.error("We should never have gotten to here");
throw new IllegalArgumentException("docHandler called with invalid parameters");
}
return mapping.findForward(RiceConstants.MAPPING_BASIC);
}
示例5: populateAuthorizationFields
import org.kuali.rice.kns.web.struts.form.KualiMaintenanceForm; //导入方法依赖的package包/类
protected void populateAuthorizationFields(KualiDocumentFormBase formBase){
super.populateAuthorizationFields(formBase);
KualiMaintenanceForm maintenanceForm = (KualiMaintenanceForm) formBase;
MaintenanceDocument maintenanceDocument = (MaintenanceDocument) maintenanceForm.getDocument();
MaintenanceDocumentAuthorizer maintenanceDocumentAuthorizer = (MaintenanceDocumentAuthorizer) getDocumentHelperService().getDocumentAuthorizer(maintenanceDocument);
Person user = GlobalVariables.getUserSession().getPerson();
maintenanceForm.setReadOnly(!formBase.getDocumentActions().containsKey(KRADConstants.KUALI_ACTION_CAN_EDIT));
MaintenanceDocumentRestrictions maintenanceDocumentAuthorizations = getBusinessObjectAuthorizationService().getMaintenanceDocumentRestrictions(maintenanceDocument, user);
maintenanceForm.setAuthorizations(maintenanceDocumentAuthorizations);
}
示例6: refresh
import org.kuali.rice.kns.web.struts.form.KualiMaintenanceForm; //导入方法依赖的package包/类
/**
* Called on return from a lookup.
*/
@Override
public ActionForward refresh(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
KualiMaintenanceForm maintenanceForm = (KualiMaintenanceForm) form;
WebUtils.reuseErrorMapFromPreviousRequest(maintenanceForm);
maintenanceForm.setDerivedValuesOnForm(request);
refreshAdHocRoutingWorkgroupLookups(request, maintenanceForm);
MaintenanceDocument document = (MaintenanceDocument) maintenanceForm.getDocument();
// call refresh on new maintainable
Map<String, String> requestParams = new HashMap<String, String>();
for (Enumeration i = request.getParameterNames(); i.hasMoreElements();) {
String requestKey = (String) i.nextElement();
String requestValue = request.getParameter(requestKey);
requestParams.put(requestKey, requestValue);
}
// Add multiple values from Lookup
Collection<PersistableBusinessObject> rawValues = null;
if (StringUtils.equals(KRADConstants.MULTIPLE_VALUE, maintenanceForm.getRefreshCaller())) {
String lookupResultsSequenceNumber = maintenanceForm.getLookupResultsSequenceNumber();
if (StringUtils.isNotBlank(lookupResultsSequenceNumber)) {
// actually returning from a multiple value lookup
String lookupResultsBOClassName = maintenanceForm.getLookupResultsBOClassName();
Class lookupResultsBOClass = Class.forName(lookupResultsBOClassName);
rawValues = getLookupResultsService().retrieveSelectedResultBOs(lookupResultsSequenceNumber, lookupResultsBOClass, GlobalVariables.getUserSession().getPerson().getPrincipalId());
}
}
if (rawValues != null) { // KULCOA-1073 - caused by this block running unnecessarily?
// we need to run the business rules on all the newly added items to the collection
// KULCOA-1000, KULCOA-1004 removed business rule validation on multiple value return
// (this was running before the objects were added anyway)
// getKualiRuleService().applyRules(new SaveDocumentEvent(document));
String collectionName = maintenanceForm.getLookedUpCollectionName();
//TODO: Cathy remember to delete this block of comments after I've tested.
// PersistableBusinessObject bo = document.getNewMaintainableObject().getBusinessObject();
// Collection maintCollection = this.extractCollection(bo, collectionName);
// String docTypeName = ((MaintenanceDocument) maintenanceForm.getDocument()).getDocumentHeader().getWorkflowDocument().getDocumentType();
// Class collectionClass = extractCollectionClass(docTypeName, collectionName);
//
// List<MaintainableSectionDefinition> sections = maintenanceDocumentDictionaryService.getMaintainableSections(docTypeName);
// Map<String, String> template = MaintenanceUtils.generateMultipleValueLookupBOTemplate(sections, collectionName);
// for (PersistableBusinessObject nextBo : rawValues) {
// PersistableBusinessObject templatedBo = (PersistableBusinessObject) ObjectUtils.createHybridBusinessObject(collectionClass, nextBo, template);
// templatedBo.setNewCollectionRecord(true);
// maintCollection.add(templatedBo);
// }
document.getNewMaintainableObject().addMultipleValueLookupResults(document, collectionName, rawValues, false, document.getNewMaintainableObject().getBusinessObject());
if (LOG.isInfoEnabled()) {
LOG.info("********************doing editing 3 in refersh()***********************.");
}
boolean isEdit = KRADConstants.MAINTENANCE_EDIT_ACTION.equals(maintenanceForm.getMaintenanceAction());
boolean isCopy = KRADConstants.MAINTENANCE_COPY_ACTION.equals(maintenanceForm.getMaintenanceAction());
if (isEdit || isCopy) {
document.getOldMaintainableObject().addMultipleValueLookupResults(document, collectionName, rawValues, true, document.getOldMaintainableObject().getBusinessObject());
document.getOldMaintainableObject().refresh(maintenanceForm.getRefreshCaller(), requestParams, document);
}
}
document.getNewMaintainableObject().refresh(maintenanceForm.getRefreshCaller(), requestParams, document);
//pass out customAction from methodToCall parameter. Call processAfterPost
String fullParameter = (String) request.getAttribute(KRADConstants.METHOD_TO_CALL_ATTRIBUTE);
if(StringUtils.contains(fullParameter, KRADConstants.CUSTOM_ACTION)){
String customAction = StringUtils.substringBetween(fullParameter, KRADConstants.METHOD_TO_CALL_PARM1_LEFT_DEL, KRADConstants.METHOD_TO_CALL_PARM1_RIGHT_DEL);
String[] actionValue = new String[1];
actionValue[0]= StringUtils.substringAfter(customAction, ".");
Map<String,String[]> paramMap = new HashMap<String,String[]>(request.getParameterMap());
paramMap.put(KRADConstants.CUSTOM_ACTION, actionValue);
doProcessingAfterPost( (KualiMaintenanceForm) form, paramMap );
}
return mapping.findForward(RiceConstants.MAPPING_BASIC);
}