本文整理匯總了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");
}
示例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);
}
}
示例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);
}
}
示例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");
}
示例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");
}
示例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");
}
示例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");
}
示例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");
}
示例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");
}
示例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");
}
示例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);
}
示例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;
}
示例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);
}
示例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();
}
示例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();
}