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


Java ActionRedirect.setPath方法代码示例

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


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

示例1: processMaintDocument

import org.apache.struts.action.ActionRedirect; //导入方法依赖的package包/类
public ActionForward processMaintDocument(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
  	ProcessMaintForm aDocForm = (ProcessMaintForm) form;
  	String category = aDocForm.getCategory();
  	String reason = aDocForm.getReason();
  	String positionId = aDocForm.getPositionId();
  	
  	String path = ConfigContext.getCurrentContextConfig().getProperty("application.url"); 
  	String string1 = path + "/portal.do?channelTitle=Position&channelUrl=" + path + "/kpme/positionMaintenance?";
  	String idString = "hrPositionId=" + positionId + "&category=" + category + "&reason=" + reason;
  	String string2 = "&viewTypeName=MAINTENANCE&returnLocation=" + path + "/portal.do&methodToCall=maintenanceEdit&dataObjectClassName=org.kuali.kpme.pm.position.Position";
  	
  	ActionRedirect redirect = new ActionRedirect();
      redirect.setPath(string1 + idString + string2);
return redirect;
  }
 
开发者ID:kuali-mirror,项目名称:kpme,代码行数:16,代码来源:ProcessMaintAction.java

示例2: cancel

import org.apache.struts.action.ActionRedirect; //导入方法依赖的package包/类
public ActionForward cancel(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		
		LeavePayoutForm lpf = (LeavePayoutForm) form;
		LeavePayout leavePayout = lpf.getLeavePayout();
		String accrualCategoryRuleId = leavePayout.getAccrualCategoryRule();
		AccrualCategoryRule accrualRule = HrServiceLocator.getAccrualCategoryRuleService().getAccrualCategoryRule(accrualCategoryRuleId);
		String actionFrequency = accrualRule.getMaxBalanceActionFrequency();
		
		if(StringUtils.equals(actionFrequency,HrConstants.MAX_BAL_ACTION_FREQ.ON_DEMAND))
			return mapping.findForward("closeLeavePayoutDoc");
		else 
			if(StringUtils.equals(actionFrequency, HrConstants.MAX_BAL_ACTION_FREQ.LEAVE_APPROVE) ||
					StringUtils.equals(actionFrequency, HrConstants.MAX_BAL_ACTION_FREQ.YEAR_END)) {
				
				String documentId = leavePayout.getLeaveCalendarDocumentId();
				TimesheetDocumentHeader tsdh = TkServiceLocator.getTimesheetDocumentHeaderService().getDocumentHeader(documentId);
				LeaveCalendarDocumentHeader lcdh = LmServiceLocator.getLeaveCalendarDocumentHeaderService().getDocumentHeader(documentId);
				String strutsActionForward = "";
				if(ObjectUtils.isNull(tsdh) && ObjectUtils.isNull(lcdh)) {
					strutsActionForward = "/";
				}
				else if(ObjectUtils.isNotNull(tsdh)) {
					//Throws runtime exception, separate action forwards for timesheet/leave calendar transfers.
					strutsActionForward = mapping.findForward("timesheetCancel").getPath() + "?documentId=" + leavePayout.getLeaveCalendarDocumentId();
				}
				else {
					strutsActionForward = mapping.findForward("leaveCalendarCancel").getPath() + "?documentId=" + leavePayout.getLeaveCalendarDocumentId();
				}

				ActionRedirect redirect = new ActionRedirect();
				redirect.setPath(strutsActionForward);
				return redirect;

			}
			else {
				LOG.warn("Action should only be reachable through triggers with frequency ON_DEMAND or LEAVE_APPROVE");
				GlobalVariables.getMessageMap().putError(KRADConstants.GLOBAL_ERRORS, "action.reachable.through.triggers");
//				throw new RuntimeException("Action should only be reachable through triggers with frequency ON_DEMAND or LEAVE_APPROVE");
				return mapping.findForward("basic");
			}
	}
 
开发者ID:kuali-mirror,项目名称:kpme,代码行数:44,代码来源:LeavePayoutAction.java

示例3: approveLeaveCalendar

import org.apache.struts.action.ActionRedirect; //导入方法依赖的package包/类
public ActionForward approveLeaveCalendar(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
	String documentId = request.getParameter("documentId");
	String action = request.getParameter("action");
    LeaveCalendarDocument document = LmServiceLocator.getLeaveCalendarService().getLeaveCalendarDocument(documentId);

    // Switched to grab the target (chain, resolution: target -> backdoor -> actual) user.
    // Approvals still using backdoor > actual
    if (StringUtils.equals(action, HrConstants.DOCUMENT_ACTIONS.ROUTE)) {
        if (DocumentStatus.INITIATED.getCode().equals(document.getDocumentHeader().getDocumentStatus())
                || DocumentStatus.SAVED.getCode().equals(document.getDocumentHeader().getDocumentStatus())) {
        	
    		Map<String,Set<LeaveBlock>> eligibilities = LmServiceLocator.getAccrualCategoryMaxBalanceService().getMaxBalanceViolations(document.getCalendarEntry(), document.getPrincipalId());
    		
    		ActionRedirect transferRedirect = new ActionRedirect();
    		ActionRedirect payoutRedirect = new ActionRedirect();

List<LeaveBlock> eligibleTransfers = new ArrayList<LeaveBlock>();
List<LeaveBlock> eligiblePayouts = new ArrayList<LeaveBlock>();
    		Interval interval = new Interval(document.getCalendarEntry().getBeginPeriodFullDateTime(), document.getCalendarEntry().getEndPeriodFullDateTime());
    		for(Entry<String,Set<LeaveBlock>> entry : eligibilities.entrySet()) {
    			
        		for(LeaveBlock lb : entry.getValue()) {
        			if(interval.contains(lb.getLeaveDateTime())) {
         			//maxBalanceViolations should, if a violation exists, return a leave block with leave date either current date, or the end period date - 1 days.
                		PrincipalHRAttributes pha = HrServiceLocator.getPrincipalHRAttributeService().getPrincipalCalendar(document.getPrincipalId(), lb.getLeaveLocalDate());
     				AccrualCategoryRuleContract aRule = lb.getAccrualCategoryRule();
	
         			if(ObjectUtils.isNotNull(aRule)
         					&& !StringUtils.equals(aRule.getMaxBalanceActionFrequency(),HrConstants.MAX_BAL_ACTION_FREQ.ON_DEMAND)) {
         				if(StringUtils.equals(aRule.getMaxBalanceActionFrequency(),HrConstants.MAX_BAL_ACTION_FREQ.LEAVE_APPROVE)
         						|| (StringUtils.equals(aRule.getMaxBalanceActionFrequency(),HrConstants.MAX_BAL_ACTION_FREQ.YEAR_END)
         								&& HrServiceLocator.getLeavePlanService().isLastCalendarPeriodOfLeavePlan(document.getCalendarEntry(),pha.getLeavePlan(),lb.getLeaveLocalDate())))
           			if(StringUtils.equals(aRule.getActionAtMaxBalance(),HrConstants.ACTION_AT_MAX_BALANCE.PAYOUT)) {
           				eligiblePayouts.add(lb);
           			}
           			else if(StringUtils.equals(aRule.getActionAtMaxBalance(), HrConstants.ACTION_AT_MAX_BALANCE.TRANSFER)
           					|| StringUtils.equals(aRule.getActionAtMaxBalance(), HrConstants.ACTION_AT_MAX_BALANCE.LOSE)) {
           				eligibleTransfers.add(lb);
           			}
         			}
        			}
        		}
    		}
    		if(CollectionUtils.isNotEmpty(eligibleTransfers)) {
    			//LOSE actions get lumped into this set, and are redirected back to this page to handle submission via dialog.
        		transferRedirect.setPath("/BalanceTransfer.do?"+request.getQueryString());
        		request.getSession().setAttribute("eligibilities", eligibleTransfers);
        		return transferRedirect;
    		}
    		if(CollectionUtils.isNotEmpty(eligiblePayouts)) {
        		payoutRedirect.setPath("/LeavePayout.do?"+request.getQueryString());
        		request.getSession().setAttribute("eligibilities", eligiblePayouts);
        		return payoutRedirect;           			
    		}
            LmServiceLocator.getLeaveCalendarService().routeLeaveCalendar(HrContext.getTargetPrincipalId(), document);
        }
    } else if (StringUtils.equals(action, HrConstants.DOCUMENT_ACTIONS.APPROVE)) {
        if (LmServiceLocator.getLeaveCalendarService().isReadyToApprove(document)) {
            if (document.getDocumentHeader().getDocumentStatus().equals(DocumentStatus.ENROUTE.getCode())) {
                LmServiceLocator.getLeaveCalendarService().approveLeaveCalendar(HrContext.getPrincipalId(), document);
            }
        } else {
            //ERROR!!!!
        }
    } else if (StringUtils.equals(action, HrConstants.DOCUMENT_ACTIONS.DISAPPROVE)) {
        if (document.getDocumentHeader().getDocumentStatus().equals(DocumentStatus.ENROUTE.getCode())) {
            LmServiceLocator.getLeaveCalendarService().disapproveLeaveCalendar(HrContext.getPrincipalId(), document);
        }
    }
    ActionRedirect rd = new ActionRedirect(mapping.findForward("leaveCalendarRedirect"));
    TkServiceLocator.getTkSearchableAttributeService().updateSearchableAttribute(document, document.getAsOfDate());
    rd.addParameter("documentId", documentId);

    return rd;
}
 
开发者ID:kuali-mirror,项目名称:kpme,代码行数:76,代码来源:LeaveCalendarSubmitAction.java

示例4: cancel

import org.apache.struts.action.ActionRedirect; //导入方法依赖的package包/类
public ActionForward cancel(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		
		BalanceTransferForm btf = (BalanceTransferForm) form;
		BalanceTransfer bt = btf.getBalanceTransfer();

		if(btf.isSstoTransfer()) {
			return mapping.findForward("closeBalanceTransferDoc");
		}
		
		String accrualCategoryRuleId = bt.getAccrualCategoryRule();
		AccrualCategoryRule accrualRule = HrServiceLocator.getAccrualCategoryRuleService().getAccrualCategoryRule(accrualCategoryRuleId);
		String actionFrequency = accrualRule.getMaxBalanceActionFrequency();
		
		if(StringUtils.equals(actionFrequency,HrConstants.MAX_BAL_ACTION_FREQ.ON_DEMAND)) 
			return mapping.findForward("closeBalanceTransferDoc");
		else 
			if(StringUtils.equals(actionFrequency, HrConstants.MAX_BAL_ACTION_FREQ.LEAVE_APPROVE) ||
					StringUtils.equals(actionFrequency, HrConstants.MAX_BAL_ACTION_FREQ.YEAR_END)) {
				String documentId = bt.getLeaveCalendarDocumentId();
				//HrServiceLocator.getCalendarDocumentHeaderService().getCalendarDocumentHeader(documentId)
				TimesheetDocumentHeader tsdh = TkServiceLocator.getTimesheetDocumentHeaderService().getDocumentHeader(documentId);
				LeaveCalendarDocumentHeader lcdh = LmServiceLocator.getLeaveCalendarDocumentHeaderService().getDocumentHeader(documentId);
				String strutsActionForward = "";
				if(ObjectUtils.isNull(tsdh) && ObjectUtils.isNull(lcdh)) {
					strutsActionForward = "/";
				}
				else if(ObjectUtils.isNotNull(tsdh)) {
					//Throws runtime exception, separate action forwards for timesheet/leave calendar transfers.
					strutsActionForward = mapping.findForward("timesheetCancel").getPath() + "?documentId=" + bt.getLeaveCalendarDocumentId();
				}
				else {
					strutsActionForward = mapping.findForward("leaveCalendarCancel").getPath() + "?documentId=" + bt.getLeaveCalendarDocumentId();
				}

				ActionRedirect redirect = new ActionRedirect();
				redirect.setPath(strutsActionForward);
				return redirect;
			}
			else {
				LOG.error("Action should only be reachable through triggers with frequency ON_DEMAND or LEAVE_APPROVE");
				GlobalVariables.getMessageMap().putError(KRADConstants.GLOBAL_ERRORS, "action.reachable.through.triggers");
				return mapping.findForward("basic");
//				throw new RuntimeException("Action should only be reachable through triggers with frequency ON_DEMAND or LEAVE_APPROVE");
			}
	}
 
开发者ID:kuali-mirror,项目名称:kpme,代码行数:48,代码来源:BalanceTransferAction.java

示例5: userLogout

import org.apache.struts.action.ActionRedirect; //导入方法依赖的package包/类
public ActionForward userLogout(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
	request.getSession().invalidate();
       ActionRedirect redirect = new ActionRedirect();
       redirect.setPath("portal.do");
	return redirect;
}
 
开发者ID:kuali-mirror,项目名称:kpme,代码行数:7,代码来源:KPMEAction.java


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