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


Java ActionResponse.setPortletMode方法代碼示例

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


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

示例1: processAction

import javax.portlet.ActionResponse; //導入方法依賴的package包/類
@Override
public void processAction(ActionRequest request, ActionResponse response) throws IOException, PortletException {
	String borderColor = request.getParameter("border_color");
	PortletPreferences preferences = request.getPreferences();
	preferences.setValue("border_color", borderColor);
	preferences.store();
	response.setPortletMode(PortletMode.VIEW);
}
 
開發者ID:exo-samples,項目名稱:docs-samples,代碼行數:9,代碼來源:HelloPortlet.java

示例2: processAction

import javax.portlet.ActionResponse; //導入方法依賴的package包/類
public void processAction(ActionRequest request, ActionResponse response)
throws PortletException, IOException {

	log.debug("==== processAction called ====");

	PortletSession pSession = request.getPortletSession(true);

	// Our first challenge is to figure out which action we want to take
	// The view selects the "next action" either as a URL parameter
	// or as a hidden field in the POST data - we check both

	String doCancel = request.getParameter("sakai.cancel");
	String doUpdate = request.getParameter("sakai.update");

	// Our next challenge is to pick which action the previous view
	// has told us to do.  Note that the view may place several actions
	// on the screen and the user may have an option to pick between
	// them.  Make sure we handle the "no action" fall-through.

	pSession.removeAttribute("error.message");

	if ( doCancel != null ) {
		response.setPortletMode(PortletMode.VIEW);
	} else if ( doUpdate != null ) {
		processActionEdit(request, response);
	} else {
		log.debug("Unknown action");
		response.setPortletMode(PortletMode.VIEW);
	}

	log.debug("==== End of ProcessAction  ====");
}
 
開發者ID:sakaiproject,項目名稱:sakai,代碼行數:33,代碼來源:SakaiIFrame.java

示例3: processActionEdit

import javax.portlet.ActionResponse; //導入方法依賴的package包/類
public void processActionEdit(ActionRequest request, ActionResponse response)
throws PortletException, IOException 
{
	// TODO: Check Role

	// Stay in EDIT mode unless we are successful
	response.setPortletMode(PortletMode.EDIT);

	Placement placement = ToolManager.getCurrentPlacement();
	// get the site toolConfiguration, if this is part of a site.
	ToolConfiguration toolConfig = SiteService.findTool(placement.getId());
	String id = request.getParameter(LTIService.LTI_ID);
	String toolId = request.getParameter(LTIService.LTI_TOOL_ID);
	Properties reqProps = new Properties();
	Enumeration names = request.getParameterNames();
	while (names.hasMoreElements())
	{
		String name = (String) names.nextElement();
		reqProps.setProperty(name, request.getParameter(name));
	}
	Object retval = m_ltiService.updateContent(Long.parseLong(id), reqProps, placement.getContext());
	String fa_icon = (String)request.getParameter(LTIService.LTI_FA_ICON);
	if ( fa_icon != null && fa_icon.length() > 0 ) {
		placement.getPlacementConfig().setProperty("imsti.fa_icon",fa_icon);
	}

	placement.save();

	response.setPortletMode(PortletMode.VIEW);
}
 
開發者ID:sakaiproject,項目名稱:sakai,代碼行數:31,代碼來源:SakaiIFrame.java

示例4: processAction

import javax.portlet.ActionResponse; //導入方法依賴的package包/類
public void processAction(ActionRequest request, ActionResponse response)
throws PortletException, IOException {

	log.debug("==== processAction called ====");

	String action = request.getParameter("sakai.action");
	log.debug("sakai.action = {}", action);

	PortletSession pSession = request.getPortletSession(true);

	// Clear before Action
	clearErrorMessage(request);

	String view = (String) pSession.getAttribute("sakai.view");
	log.debug("sakai.view={}", view);

	if ( action == null ) {
		// Do nothing
	} else if ( action.equals("main") ) {
		response.setPortletMode(PortletMode.VIEW);
	} else if ( action.equals("edit") ) {
		pSession.setAttribute("sakai.view", "edit");
	} else if ( action.equals("edit.reset") ) {
		pSession.setAttribute("sakai.view","edit.reset");
	} else if (action.equals("edit.setup")){
		pSession.setAttribute("sakai.view","edit.setup");
	} else if ( action.equals("edit.clear") ) {
		clearSession(request);
		response.setPortletMode(PortletMode.VIEW);
		pSession.setAttribute("sakai.view", "main");
	} else if ( action.equals("edit.do.reset") ) {
		processActionReset(action,request, response);
	} else if ( action.equals("edit.save") ) {
		processActionSave(action,request, response);
	}
	log.debug("==== End of ProcessAction ====");
}
 
開發者ID:sakaiproject,項目名稱:sakai,代碼行數:38,代碼來源:IMSBLTIPortlet.java


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