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


Java PortletPreferences.store方法代碼示例

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


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

示例1: processAction

import javax.portlet.PortletPreferences; //導入方法依賴的package包/類
@Override
public void processAction(PortletConfig portletConfig, ActionRequest actionRequest,
		ActionResponse arg2) throws Exception {
	if (!Constants.UPDATE.equals(actionRequest.getParameter(Constants.CMD))) 
		return;
	
	PortletPreferences prefs;
	String portletResource = ParamUtil.getString(actionRequest, "portletResource");	
	if (Validator.isNotNull(portletResource)){
		prefs = PortletPreferencesFactoryUtil.getPortletSetup(actionRequest, portletResource);
	} else {
		prefs = actionRequest.getPreferences();
	}
	prefs.setValue("numerateModules", actionRequest.getParameter("numerateModules"));
	
	prefs.store();
	SessionMessages.add(actionRequest,portletConfig.getPortletName() + ".doConfigure");
	
}
 
開發者ID:TelefonicaED,項目名稱:liferaylms-portlet,代碼行數:20,代碼來源:ModuleTitleConfigurationAction.java

示例2: _noRetry

import javax.portlet.PortletPreferences; //導入方法依賴的package包/類
private void _noRetry() {

		try {
			PortletPreferences portletPreferences =
							PrefsPropsUtil.getPreferences();

			portletPreferences.setValue(
				PortletPropsKeys.MQTT_ERRORS_RETRY_CONNECT,
				String.valueOf(false));

			portletPreferences.store();
		}
		catch (Exception e1) {
			_log.error(e1);
		}
	}
 
開發者ID:baxtheman,項目名稱:mqtt-liferay-plugins,代碼行數:17,代碼來源:MqttLocalServiceImpl.java

示例3: _setupRetry

import javax.portlet.PortletPreferences; //導入方法依賴的package包/類
private void _setupRetry(Throwable e) {

		try {
			PortletPreferences portletPreferences =
				PrefsPropsUtil.getPreferences();

			portletPreferences.setValue(
				PortletPropsKeys.MQTT_ERRORS_RETRY_CONNECT,
				String.valueOf(true));

			portletPreferences.store();
		}
		catch (Exception e1) {
			_log.error(e);
		}
	}
 
開發者ID:baxtheman,項目名稱:mqtt-liferay-plugins,代碼行數:17,代碼來源:MqttLocalServiceImpl.java

示例4: processAction

import javax.portlet.PortletPreferences; //導入方法依賴的package包/類
public void processAction( 
		PortletConfig portletConfig, ActionRequest actionRequest, 
		ActionResponse actionResponse) 
	throws Exception { 
	
	if (!Constants.UPDATE.equals(actionRequest.getParameter(Constants.CMD))){ 
		return;
	}
	
	PortletPreferences prefs;
	String portletResource = ParamUtil.getString(actionRequest, "portletResource");	
	if (Validator.isNotNull(portletResource)){
		prefs = PortletPreferencesFactoryUtil.getPortletSetup(actionRequest, portletResource);
	} else {
		prefs = actionRequest.getPreferences();
	}
	
	prefs.setValue("showActionSocial", actionRequest.getParameter("showActionSocial"));
	prefs.setValue("showActionAudit", actionRequest.getParameter("showActionAudit"));
	
	
	prefs.store();
	SessionMessages.add( 
			actionRequest, portletConfig.getPortletName() + ".doConfigure"); 
	//SessionMessages.add(actionRequest,"success");
}
 
開發者ID:TelefonicaED,項目名稱:liferaylms-portlet,代碼行數:27,代碼來源:StudentManagementConfigurationAction.java

示例5: processAction

import javax.portlet.PortletPreferences; //導入方法依賴的package包/類
@Override
public void processAction(PortletConfig portletConfig, ActionRequest actionRequest,
		ActionResponse arg2) throws Exception {
	if (!Constants.UPDATE.equals(actionRequest.getParameter(Constants.CMD))) 
		return;
	
	PortletPreferences prefs;
	String portletResource = ParamUtil.getString(actionRequest, "portletResource");	
	if (Validator.isNotNull(portletResource)){
		prefs = PortletPreferencesFactoryUtil.getPortletSetup(actionRequest, portletResource);
	} else {
		prefs = actionRequest.getPreferences();
	}
	
	prefs.setValue("viewAlways", actionRequest.getParameter("viewAlways"));
	
	prefs.store();
	SessionMessages.add(actionRequest,portletConfig.getPortletName() + ".doConfigure");
	
}
 
開發者ID:TelefonicaED,項目名稱:liferaylms-portlet,代碼行數:21,代碼來源:ModuleAction.java

示例6: processAction

import javax.portlet.PortletPreferences; //導入方法依賴的package包/類
@Override
public void processAction(PortletConfig portletConfig, ActionRequest actionRequest,
		ActionResponse arg2) throws Exception {
	if (!Constants.UPDATE.equals(actionRequest.getParameter(Constants.CMD))) 
		return;
	
	PortletPreferences prefs;
	String portletResource = ParamUtil.getString(actionRequest, "portletResource");	
	if (Validator.isNotNull(portletResource)){
		prefs = PortletPreferencesFactoryUtil.getPortletSetup(actionRequest, portletResource);
	} else {
		prefs = actionRequest.getPreferences();
	}
	prefs.setValue("viewMode", actionRequest.getParameter("viewMode"));
	prefs.setValue("numerateModules", actionRequest.getParameter("numerateModules"));
	
	prefs.store();
	SessionMessages.add(actionRequest,portletConfig.getPortletName() + ".doConfigure");
	
}
 
開發者ID:TelefonicaED,項目名稱:liferaylms-portlet,代碼行數:21,代碼來源:LmsActivitiesListAction.java

示例7: processAction

import javax.portlet.PortletPreferences; //導入方法依賴的package包/類
@Override
public void processAction(PortletConfig portletConfig, ActionRequest actionRequest,	ActionResponse arg2) throws Exception {
	if (!Constants.UPDATE.equals(actionRequest.getParameter(Constants.CMD))){ 
		return;
	}
	
	PortletPreferences prefs;
	String portletResource = ParamUtil.getString(actionRequest, "portletResource");	
	if (Validator.isNotNull(portletResource)){
		prefs = PortletPreferencesFactoryUtil.getPortletSetup(actionRequest, portletResource);
	} else {
		prefs = actionRequest.getPreferences();
	}
	
	prefs.setValue("showPreviousModuleButton", actionRequest.getParameter("showPreviousModuleButton"));
	
	prefs.store();
	SessionMessages.add(actionRequest,portletConfig.getPortletName() + ".doConfigure");
	
}
 
開發者ID:TelefonicaED,項目名稱:liferaylms-portlet,代碼行數:21,代碼來源:ModuleNavigationAction.java

示例8: processAction

import javax.portlet.PortletPreferences; //導入方法依賴的package包/類
public void processAction( 
		PortletConfig portletConfig, ActionRequest actionRequest, 
		ActionResponse actionResponse) 
	throws Exception { 
	
	PortletPreferences portletPreferences =
	PortletPreferencesFactoryUtil.getPortletSetup( 
			actionRequest, ParamUtil.getString(actionRequest, "portletResource")); 
	
	/**
	 * boolean showAllways = 		preferences.getValue("showAllways", "false").equals("true");
boolean showOnlyWhenFinishDate = 	preferences.getValue("showOnlyWhenFinishDate", "true").equals("true");
	 */
	

	
	portletPreferences.setValue("showCalificationMode",ParamUtil.getString(actionRequest, "showCalificationMode"));

	portletPreferences.store();
	SessionMessages.add( 
			actionRequest, portletConfig.getPortletName() + ".doConfigure"); 
	//SessionMessages.add(actionRequest,"success");
}
 
開發者ID:TelefonicaED,項目名稱:liferaylms-portlet,代碼行數:24,代碼來源:FinalCourseResultConfigurationAction.java

示例9: processAction

import javax.portlet.PortletPreferences; //導入方法依賴的package包/類
public void processAction( 
		PortletConfig portletConfig, ActionRequest actionRequest, 
		ActionResponse actionResponse) 
	throws Exception { 
	
	PortletPreferences portletPreferences =
	PortletPreferencesFactoryUtil.getPortletSetup( 
			actionRequest, ParamUtil.getString(actionRequest, "portletResource")); 
	
	portletPreferences.setValue("myCoursesOrder",Integer.toString(ParamUtil.getInteger(actionRequest, "myCoursesOrder",0)));
	
	portletPreferences.store();
	SessionMessages.add( 
			actionRequest, portletConfig.getPortletName() + ".doConfigure"); 
	//SessionMessages.add(actionRequest,"success");
}
 
開發者ID:TelefonicaED,項目名稱:liferaylms-portlet,代碼行數:17,代碼來源:MyCoursesConfigurationAction.java

示例10: processActionReset

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

	// TODO: Check Role
	log.debug("Removing preferences....");
	clearSession(request);
	PortletSession pSession = request.getPortletSession(true);
	PortletPreferences prefs = request.getPreferences();
	try {
		prefs.reset("sakai.descriptor");
		for (String element : fieldList) {
			prefs.reset("imsti."+element);
			prefs.reset("sakai:imsti."+element);
		}
		log.debug("Preference removed");
	} catch (ReadOnlyException e) {
		setErrorMessage(request, rb.getString("error.modify.prefs")) ;
		return;
	}
	prefs.store();

	// Go back to the main edit page
	pSession.setAttribute("sakai.view", "edit");
}
 
開發者ID:sakaiproject,項目名稱:sakai,代碼行數:25,代碼來源:IMSBLTIPortlet.java

示例11: processAction

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

  String action = request.getParameter("action");
  
  if ("editPrefs".equals(action)) {
    PortletPreferences prefs = request.getPreferences();
    for (String key : prefs.getMap().keySet()) {
      String value = request.getParameter(key);
      prefs.setValue(key, value);
    }
    prefs.store();

  } else {
    String url = request.getParameter("URL");
    if (!StringUtils.isBlank(url)) {
      PortletMessaging.publish(request, IFrameGenericPortlet.IFRAME_SRC_URL, url.trim());
    }
  }

  response.setPortletMode(PortletMode.VIEW);
}
 
開發者ID:km-works,項目名稱:reverse-web-proxy-portlet,代碼行數:24,代碼來源:ReverseProxyIFramePortlet.java

示例12: deleteVoiceCommand

import javax.portlet.PortletPreferences; //導入方法依賴的package包/類
public static PortletPreferences deleteVoiceCommand(ActionRequest request, String voiceCommand) 
        throws PortalException, SystemException, ReadOnlyException, ValidatorException, IOException {
    ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);
    long plid = themeDisplay.getLayout().getPlid();
    long ownerId = PortletKeys.PREFS_OWNER_ID_DEFAULT;
    int ownerType = PortletKeys.PREFS_OWNER_TYPE_LAYOUT;
    long companyId = themeDisplay.getCompanyId();

    PortletPreferences preference = request.getPreferences();
    Map<String, String[]> preferencesMap = new HashMap<String, String[]>(preference.getMap());
    preferencesMap.remove(voiceCommand);

    PortletPreferencesLocalServiceUtil.deletePortletPreferences(ownerId, ownerType, plid, SpeechConstants.PORTLET_NAMESPACE);

    preference = PortletPreferencesLocalServiceUtil.getPreferences(companyId, ownerId, ownerType, plid,
            SpeechConstants.PORTLET_NAMESPACE);
    
    for (Map.Entry<String, String[]> entry : preferencesMap.entrySet()) {
        preference.setValue(entry.getKey(), entry.getValue()[0]);
    }
    preference.store();
    return preference;
}
 
開發者ID:rivetlogic,項目名稱:liferay-voice-command,代碼行數:24,代碼來源:SpeechUtil.java

示例13: updateBuddyListStrategy

import javax.portlet.PortletPreferences; //導入方法依賴的package包/類
/**
 * Updates buddy list strategy preferences
 *
 * @param preferences PortletPreferences
 * @param properties  Properties
 * @throws Exception
 */
private void updateBuddyListStrategy(PortletPreferences preferences, Properties properties) throws Exception {

    // Reset previous preferences
    preferences.reset(PortletPropertiesKeys.BUDDY_LIST_STRATEGY);

    // Set the value in portlet preferences
    preferences.setValue(
            PortletPropertiesKeys.BUDDY_LIST_STRATEGY,
            properties.getBuddyListStrategy().getDescription()
    );

    // Persist
    preferences.store();

    // Save in environment
    setupBuddyListStrategy(preferences);
}
 
開發者ID:marcelmika,項目名稱:lims,代碼行數:25,代碼來源:PropertiesManagerImpl.java

示例14: saveGlobalSettings

import javax.portlet.PortletPreferences; //導入方法依賴的package包/類
@Override
public void saveGlobalSettings(String adtUuid, boolean doSearchOnStartup, String doSearchOnStartupKeywords, PortletPreferences preferences) throws ReadOnlyException, ValidatorException, IOException {
    if(Validator.isNull(doSearchOnStartupKeywords)) {
        doSearchOnStartupKeywords = FlashlightSearchService.CONFIGURATION_DEFAULT_SEARCH_KEYWORDS;
    }
    preferences.setValue(CONF_KEY_ADT_UUID, adtUuid);
    preferences.setValue(CONF_KEY_DO_SEARCH_ON_STARTUP, Boolean.toString(doSearchOnStartup));
    preferences.setValue(CONF_KEY_DO_SEARCH_ON_STARTUP_KEYWORDS, doSearchOnStartupKeywords);
    preferences.store();
}
 
開發者ID:savoirfairelinux,項目名稱:flashlight-search,代碼行數:11,代碼來源:ConfigurationStorageV1.java

示例15: saveSearchFacetConfig

import javax.portlet.PortletPreferences; //導入方法依賴的package包/類
@Override
public void saveSearchFacetConfig(FlashlightSearchConfigurationTab configurationTab, SearchFacet searchFacet, PortletPreferences preferences) throws ReadOnlyException, ValidatorException, IOException {
    String tabId = configurationTab.getId();
    String facetConfigKey = format(CONF_KEY_FORMAT_SEARCH_FACET, tabId, searchFacet.getClass().getName());
    preferences.setValue(facetConfigKey, searchFacet.getData().toJSONString());
    preferences.store();
}
 
開發者ID:savoirfairelinux,項目名稱:flashlight-search,代碼行數:8,代碼來源:ConfigurationStorageV1.java


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