當前位置: 首頁>>代碼示例>>Java>>正文


Java ActionResponse.setRenderParameters方法代碼示例

本文整理匯總了Java中javax.portlet.ActionResponse.setRenderParameters方法的典型用法代碼示例。如果您正苦於以下問題:Java ActionResponse.setRenderParameters方法的具體用法?Java ActionResponse.setRenderParameters怎麽用?Java ActionResponse.setRenderParameters使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.portlet.ActionResponse的用法示例。


在下文中一共展示了ActionResponse.setRenderParameters方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: clearAllRenderParameters

import javax.portlet.ActionResponse; //導入方法依賴的package包/類
/**
 * Clear all the render parameters from the {@link javax.portlet.ActionResponse}.
 * This may not be called when the action will call
 * {@link ActionResponse#sendRedirect sendRedirect}.
 * @param response the current action response
 * @see ActionResponse#setRenderParameters
 */
public static void clearAllRenderParameters(ActionResponse response) {
	try {
		response.setRenderParameters(new HashMap<String, String[]>(0));
	}
	catch (IllegalStateException ex) {
		// Ignore in case sendRedirect was already set.
	}
}
 
開發者ID:langtianya,項目名稱:spring4-understanding,代碼行數:16,代碼來源:PortletUtils.java

示例2: edit

import javax.portlet.ActionResponse; //導入方法依賴的package包/類
public void edit(ActionRequest actionRequest,ActionResponse actionResponse)throws Exception {

		actionResponse.setRenderParameters(actionRequest.getParameterMap());
		if(ParamUtil.getLong(actionRequest, "actId", 0)==0)
		{
			actionResponse.setRenderParameter("jspPage", "/html/offlinetaskactivity/admin/edit.jsp");
		}
	}
 
開發者ID:TelefonicaED,項目名稱:liferaylms-portlet,代碼行數:9,代碼來源:OfflineActivity.java

示例3: edit

import javax.portlet.ActionResponse; //導入方法依賴的package包/類
public void edit(ActionRequest actionRequest, ActionResponse actionResponse)
		throws PortalException, SystemException, Exception {

	actionResponse.setRenderParameters(actionRequest.getParameterMap());
	if(ParamUtil.getLong(actionRequest, "actId", 0)==0)// TODO Auto-generated method stub
	{
		actionResponse.setRenderParameter("jspPage", "/html/lmsactivitieslist/view.jsp");
	}
}
 
開發者ID:TelefonicaED,項目名稱:liferaylms-portlet,代碼行數:10,代碼來源:ExecActivity.java

示例4: addUserRole

import javax.portlet.ActionResponse; //導入方法依賴的package包/類
public void addUserRole(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception{

		long courseId = ParamUtil.getLong(actionRequest, "courseId", 0);
		long roleId = ParamUtil.getLong(actionRequest, "roleId", 0);
//		long userId = ParamUtil.getLong(actionRequest, "userId", 0);
		// Multiusuario
		long[] to = ParamUtil.getLongValues(actionRequest, "to");
//		long[] userIds=new long[1];
//		userIds[0]=ParamUtil.getLong(actionRequest, "userId");
		Course course = CourseLocalServiceUtil.getCourse(courseId);
		
		LmsPrefs prefs=LmsPrefsLocalServiceUtil.getLmsPrefs(course.getCompanyId());
		Long teacherRoleId=RoleLocalServiceUtil.getRole(prefs.getTeacherRole()).getRoleId();
		Long editorRoleId=RoleLocalServiceUtil.getRole(prefs.getEditorRole()).getRoleId();
		
		for (long userId : to) {
			if (!GroupLocalServiceUtil.hasUserGroup(userId, course.getGroupCreatedId())) {
				GroupLocalServiceUtil.addUserGroups(userId,	new long[] { course.getGroupCreatedId() });
			//The application only send one mail at listener
			//User user = UserLocalServiceUtil.getUser(userId);
			//sendEmail(user, course);
			}
			UserGroupRoleLocalServiceUtil.addUserGroupRoles(new long[] { userId }, course.getGroupCreatedId(), roleId);
			
			if(roleId == teacherRoleId){
				AuditingLogFactory.audit(course.getCompanyId(), course.getGroupCreatedId(), Course.class.getName(), 
						course.getCourseId(),userId, AuditConstants.REGISTER, "COURSE_TUTOR_ADD");
			}
			if(roleId == editorRoleId){
				AuditingLogFactory.audit(course.getCompanyId(), course.getGroupCreatedId(), Course.class.getName(), 
						course.getCourseId(),userId, AuditConstants.REGISTER, "COURSE_EDITOR_ADD");
			}
		}	
		
		actionResponse.setRenderParameters(actionRequest.getParameterMap());
	}
 
開發者ID:TelefonicaED,項目名稱:liferaylms-portlet,代碼行數:37,代碼來源:BaseCourseAdminPortlet.java

示例5: edit

import javax.portlet.ActionResponse; //導入方法依賴的package包/類
public void edit(ActionRequest actionRequest,ActionResponse actionResponse)throws Exception {

		actionResponse.setRenderParameters(actionRequest.getParameterMap());
		if(ParamUtil.getLong(actionRequest, "actId", 0)==0)
		{
			actionResponse.setRenderParameter("jspPage", "/html/surveyactivity/view.jsp");
		}
	}
 
開發者ID:TelefonicaED,項目名稱:liferaylms-portlet,代碼行數:9,代碼來源:SurveyActivity.java

示例6: edit

import javax.portlet.ActionResponse; //導入方法依賴的package包/類
public void edit(ActionRequest actionRequest,ActionResponse actionResponse)throws Exception {

		actionResponse.setRenderParameters(actionRequest.getParameterMap());
		if(ParamUtil.getLong(actionRequest, "actId", 0)==0)
		{
			actionResponse.setRenderParameter("jspPage", "/html/onlinetaskactivity/admin/edit.jsp");
		}
	}
 
開發者ID:TelefonicaED,項目名稱:liferaylms-portlet,代碼行數:9,代碼來源:OnlineActivity.java

示例7: editInscriptionDates

import javax.portlet.ActionResponse; //導入方法依賴的package包/類
public void editInscriptionDates(ActionRequest actionRequest,
		ActionResponse actionResponse) throws Exception 
{

	long courseId = ParamUtil.getLong(actionRequest, "courseId", 0);
	long userId = ParamUtil.getLong(actionRequest, "userId", 0);
	User user = UserLocalServiceUtil.getUser(userId);
	Course course = CourseLocalServiceUtil.getCourse(courseId);
	int startMonth = ParamUtil.getInteger(actionRequest, "startMon");
	int startYear = ParamUtil.getInteger(actionRequest, "startYear");
	int startDay = ParamUtil.getInteger(actionRequest, "startDay");
	int stopMonth = ParamUtil.getInteger(actionRequest, "stopMon");
	int stopYear = ParamUtil.getInteger(actionRequest, "stopYear");
	int stopDay = ParamUtil.getInteger(actionRequest, "stopDay");
	boolean startDateEnabled=ParamUtil.getBoolean(actionRequest,"startdate-enabled",false);
	boolean stopDateEnabled=ParamUtil.getBoolean(actionRequest,"stopdate-enabled",false);
	Date allowStartDate = PortalUtil.getDate(startMonth, startDay, startYear,
			0, 0, user.getTimeZone(),
			new EntryDisplayDateException());
	
	if(!startDateEnabled)
    {
		allowStartDate=null;
    }
	
	Date allowFinishDate = PortalUtil.getDate(stopMonth, stopDay, stopYear,
			0, 0, user.getTimeZone(),
			new EntryDisplayDateException());
	if(!stopDateEnabled)
    {
		allowFinishDate=null;
    }
	CourseServiceUtil.editUserInscriptionDates(courseId,userId,allowStartDate,allowFinishDate);
	actionResponse.setRenderParameters(actionRequest.getParameterMap());
}
 
開發者ID:TelefonicaED,項目名稱:liferaylms-portlet,代碼行數:36,代碼來源:CourseAdmin.java

示例8: deleteMyTries

import javax.portlet.ActionResponse; //導入方法依賴的package包/類
public void deleteMyTries(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
	
	log.debug("***deleteMyTries***");
	
	long actId = ParamUtil.getLong(actionRequest, "resId", 0);
	String redirect = ParamUtil.getString(actionRequest, "redirect");
	
	if(actId>0){
	LearningActivity larn=LearningActivityLocalServiceUtil.getLearningActivity(actId);
	ThemeDisplay themeDisplay = (ThemeDisplay) actionRequest.getAttribute(WebKeys.THEME_DISPLAY);
	actionResponse.setRenderParameters(actionRequest.getParameterMap());
	actionRequest.setAttribute("editing", "true");
	LearningActivityTryLocalServiceUtil.deleteUserTries(actId, themeDisplay.getUserId());
	
	if(P2pActivityLocalServiceUtil.existP2pAct(actId, themeDisplay.getUserId())){
		P2pActivity p2pact=P2pActivityLocalServiceUtil.findByActIdAndUserId(actId, themeDisplay.getUserId());
		P2pActivityLocalServiceUtil.deleteP2pActivity(p2pact.getP2pActivityId());			
		java.util.List<P2pActivityCorrections> p2pactcorrcs=P2pActivityCorrectionsLocalServiceUtil.findByP2pActivityId(p2pact.getP2pActivityId());
		
		for(P2pActivityCorrections p2pactcorr:p2pactcorrcs){
			P2pActivityCorrectionsLocalServiceUtil.deleteP2pActivityCorrections(p2pactcorr);
		}			
		}
		
	actionRequest.setAttribute("activity", larn);
	}
	WindowState windowState = actionRequest.getWindowState();
	if (redirect != null && !"".equals(redirect)) {
		if (!windowState.equals(LiferayWindowState.POP_UP)) {
			actionResponse.sendRedirect(redirect);
		}else {
			redirect = PortalUtil.escapeRedirect(redirect);

			if (Validator.isNotNull(redirect)) {
				actionResponse.sendRedirect(redirect);
			}
		}
	}
	
	SessionMessages.add(actionRequest, "ok-deleting-tries");
	
}
 
開發者ID:TelefonicaED,項目名稱:liferaylms-portlet,代碼行數:43,代碼來源:LmsActivitiesList.java

示例9: QuestionTypeRegistry

import javax.portlet.ActionResponse; //導入方法依賴的package包/類
public void correct	(ActionRequest actionRequest,ActionResponse actionResponse)	throws Exception {

		long actId=ParamUtil.getLong(actionRequest, "actId");
		long latId=ParamUtil.getLong(actionRequest,"latId" );
		boolean isTablet = ParamUtil.getBoolean(actionRequest,"isTablet" );
		String navigate = ParamUtil.getString(actionRequest, "navigate");
		boolean isPartial = false;
		if (Validator.isNotNull(navigate)) {
			if (Validator.equals(navigate, "backward") || Validator.equals(navigate, "forward")) {
				isPartial = true;
			}
		}

		LearningActivityTry larntry=LearningActivityTryLocalServiceUtil.getLearningActivityTry(latId);

		//Comprobar que el usuario tenga intentos posibles.
		if (larntry.getEndDate() == null){

			long correctanswers=0,penalizedAnswers=0;
			Element resultadosXML=SAXReaderUtil.createElement("results");
			Document resultadosXMLDoc=SAXReaderUtil.createDocument(resultadosXML);

			long[] questionIds = ParamUtil.getLongValues(actionRequest, "question");


			for (long questionId : questionIds) {
				TestQuestion question = TestQuestionLocalServiceUtil.fetchTestQuestion(questionId);
				QuestionType qt = new QuestionTypeRegistry().getQuestionType(question.getQuestionType());
				if(!isPartial){
					if(qt.correct(actionRequest, questionId)>0) {
						correctanswers += qt.correct(actionRequest, questionId) ;
					}else if(question.isPenalize()){
						penalizedAnswers++;
					}
				}
				resultadosXML.add(qt.getResults(actionRequest, questionId));								
			}

			long random = GetterUtil.getLong(LearningActivityLocalServiceUtil.getExtraContentValue(actId,"random"));
			long score=isPartial ? 0 : correctanswers/((random!=0 && random<questionIds.length)?random:questionIds.length);
			if(score < 0)score = 0;
			
			LearningActivityResult learningActivityResult = LearningActivityResultLocalServiceUtil.getByActIdAndUserId(actId, PortalUtil.getUserId(actionRequest));
			long oldResult=-1;
			if(learningActivityResult!=null) oldResult=learningActivityResult.getResult();

			larntry.setTryResultData(resultadosXMLDoc.formattedString());
			if (!isPartial) {
				larntry.setResult(score);
				larntry.setEndDate(new java.util.Date(System.currentTimeMillis()));
			}

			LearningActivityTryLocalServiceUtil.updateLearningActivityTry(larntry);

			actionResponse.setRenderParameters(actionRequest.getParameterMap());

			if (isPartial) {
				actionResponse.setRenderParameter("improve", ParamUtil.getString(actionRequest, "improve", Boolean.FALSE.toString()));
				if(isTablet)actionResponse.setRenderParameter("isTablet", Boolean.toString(true));
				actionResponse.setRenderParameter("jspPage", "/html/execactivity/test/view.jsp");
			} else {
				actionResponse.setRenderParameter("oldResult", Long.toString(oldResult));
				actionResponse.setRenderParameter("correction", Boolean.toString(true));
				if(isTablet)actionResponse.setRenderParameter("isTablet", Boolean.toString(true));
				actionResponse.setRenderParameter("jspPage", "/html/execactivity/test/results.jsp");
			}
		}else{
			actionResponse.setRenderParameters(actionRequest.getParameterMap());
			actionRequest.setAttribute("actId", actId);
			actionResponse.setRenderParameter("jspPage", "/html/execactivity/test/preview.jsp");
		}						

	}
 
開發者ID:TelefonicaED,項目名稱:liferaylms-portlet,代碼行數:74,代碼來源:ExecActivity.java


注:本文中的javax.portlet.ActionResponse.setRenderParameters方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。