Package javax.portlet

Examples of javax.portlet.PortletPreferences.store()


         UIApplicationRegistryEditMode uiForm = event.getSource();
         boolean isShowImport = uiForm.getUIFormCheckBoxInput(SHOW_IMPORT).isChecked();
         PortletRequestContext pcontext = (PortletRequestContext)WebuiRequestContext.getCurrentInstance();
         PortletPreferences pref = pcontext.getRequest().getPreferences();
         pref.setValue(SHOW_IMPORT, Boolean.toString(isShowImport));
         pref.store();
         UIPortalApplication portalApp = Util.getUIPortalApplication();
         if (portalApp.getModeState() == UIPortalApplication.NORMAL_MODE)
            pcontext.setApplicationMode(PortletMode.VIEW);
        
      }
View Full Code Here


    prefs.setValue("subject", request.getParameter("subject"));
    prefs.setValue("title", request.getParameter("title"));
    prefs.setValue("message", request.getParameter("message"));
   
    try {
      prefs.store();
    } catch(Exception e) {
      logger.error("Unexpected exception ocurred while editing preferences: Cause : " + e.getCause() + ". Message : " + e.getMessage());
    }
  }
 
View Full Code Here

            if (LOG.isDebugEnabled()) {
              LOG.debug("Modified VALIDATION_TEST_KEY preference:");
              logPreferences(preferences);
            }
            // Call store() method to invoke the validator.
            preferences.store();

        } catch (ReadOnlyException ex) {
          TestUtils.failOnException("Unable to set preference value.", ex, result);
          return result;
View Full Code Here

        try {
            preferences.setValue(
                PreferencesValidatorImpl.CHECK_VALIDATOR_COUNT,
                "true");
            // Call store() method to invoke the validator.
            preferences.store();
            result.setReturnCode(TestResult.PASSED);
        } catch (ReadOnlyException ex) {
          TestUtils.failOnException("Unable to set preference value.", ex, result);
        } catch (IOException ex) {
          TestUtils.failOnException("Unable to store preference value.", ex, result);
View Full Code Here

        } catch (ValidatorException ex) {
          TestUtils.failOnException("Unable to store preference value.", ex, result);
        } finally {
          try {
            preferences.reset(PreferencesValidatorImpl.CHECK_VALIDATOR_COUNT);
            preferences.store();
          } catch (Exception ex) {
            TestUtils.failOnException("Unable to reset preference value for "
                + PreferencesValidatorImpl.CHECK_VALIDATOR_COUNT,
                ex, result);
          }
View Full Code Here

            String value = preferences.getValue(PREF_NAME, DEF_VALUE);
            if (NEW_VALUE.equals(value)) {
                setOccured = true;
            }
            // Store the preference and get value.
            preferences.store();
            value = preferences.getValue(PREF_NAME, DEF_VALUE);
            if (NEW_VALUE.equals(value)) {
                storeOccured = true;
            }
        } catch (ReadOnlyException ex) {
View Full Code Here

          return result;
        } finally {
            // Reset preference to default value, and store!
          try {
            preferences.reset(PREF_NAME);
            preferences.store();
          } catch (Exception ex) {
              TestUtils.failOnException("Unable to set preference value.", ex, result);
              return result;
          }
        }
View Full Code Here

        if (curMode == PortletMode.EDIT ||
            curMode.equals(JetspeedActions.EDIT_DEFAULTS_MODE))
        {
            PortletPreferences prefs = actionRequest.getPreferences();
            PreferencesHelper.requestParamsToPreferences(actionRequest);
            prefs.store();
            actionResponse.setPortletMode(PortletMode.VIEW);
            return;
        }
       
        try
View Full Code Here

        PortletPreferences prefs = request.getPreferences();
       
        try
        {
            prefs.setValue(TOP_RANGE_NAME, topRange);
            prefs.store();
            PortletSession session = request.getPortletSession();           
            session.setAttribute( TOP_RANGE_NAME, new Long(range), PortletSession.APPLICATION_SCOPE);           
        }
        catch (Exception e)
        {
View Full Code Here

    {  
        if (actionRequest.getPortletMode() == PortletMode.EDIT)
        {
            PortletPreferences prefs = actionRequest.getPreferences();
            PreferencesHelper.requestParamsToPreferences(actionRequest);
            prefs.store();
            actionResponse.setPortletMode(PortletMode.VIEW);
            initPrefsAndAttr(actionRequest);
            actionRequest.getPortletSession().removeAttribute(SUBSITES_CONTROL);
            return;
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.