Package javax.portlet

Examples of javax.portlet.PortletPreferences.store()


            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

    PortletPreferences preferences = request.getPreferences();
        boolean exceptionThrown = false;
       
        // Store preferences and wait for IllegalStateException.
        try {
            preferences.store();
        } catch (ValidatorException ex) {
          TestUtils.failOnException("Unable to store preferences.", ex, result);
          return result;
        } catch (IOException ex) {
          TestUtils.failOnException("Unable to store preferences.", ex, result);
View Full Code Here

        String key = req.getParameter("name");
        String value = req.getParameter("value");
        if (key != null && value != null) {
            prefs.setValue(key, value);
            try {
                prefs.store();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
         // nothing to do
View Full Code Here

        String key = req.getParameter("name");
        String value = req.getParameter("value");
        if (key != null && value != null) {
            prefs.setValue(key, value);
            try {
                prefs.store();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
         // nothing to do
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

                throw new MessageException(new ApplicationMessage("ExpressionValidator.msg.value-invalid", args));
            }
            PortletRequestContext pcontext = (PortletRequestContext) WebuiRequestContext.getCurrentInstance();
            PortletPreferences pref = pcontext.getRequest().getPreferences();
            pref.setValue("url", uiForm.getUIStringInput(FIELD_URL).getValue());
            pref.store();

            UIPortalApplication portalApp = Util.getUIPortalApplication();
            if (portalApp.getModeState() == UIPortalApplication.NORMAL_MODE)
                pcontext.setApplicationMode(PortletMode.VIEW);
        }
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.