Package javax.portlet

Examples of javax.portlet.ReadOnlyException


    }
   
    public void reset(String key) throws ReadOnlyException {
      // Read-only preferences cannot be reset.
        if (isReadOnly(key)) {
            throw new ReadOnlyException(EXCEPTIONS.getString(
                "error.preference.readonly", key));
        }
        // Try to reset preference to the default values.
        PortletPreference p = defaultPreferences.get(key);
        if (p != null) {
View Full Code Here


  @Override
  public void setValues(String key, String[] values) throws ReadOnlyException {
    Assert.notNull(key, "Key must not be null");
    if (isReadOnly(key)) {
      throw new ReadOnlyException("Preference '" + key + "' is read-only");
    }
    this.preferences.put(key, values);
  }
View Full Code Here

  @Override
  public void reset(String key) throws ReadOnlyException {
    Assert.notNull(key, "Key must not be null");
    if (isReadOnly(key)) {
      throw new ReadOnlyException("Preference '" + key + "' is read-only");
    }
    this.preferences.remove(key);
  }
View Full Code Here

        //Check if there is a base preference for the key
        final Map<String, IPortletPreference> basePortletPreferences = this.getBasePortletPreferences();
        final IPortletPreference basePreference = basePortletPreferences.get(key);
        if (basePreference != null) {
            if (this.isReadOnly(basePreference)) {
                throw new ReadOnlyException("Preference '" + key + "' is read only");
            }

            //if the set value matches base value, delete any target pref
            if (Arrays.equals(values, basePreference.getValues())) {
                this.reset(key);
View Full Code Here

    @Override
    public final void reset(String key) throws ReadOnlyException {
        final Map<String, IPortletPreference> basePortletPreferences = this.getBasePortletPreferences();
        final IPortletPreference basePreference = basePortletPreferences.get(key);
        if (this.isReadOnly(basePreference)) {
            throw new ReadOnlyException("Preference '" + key + "' is read only");
        }
       
        final Map<String, IPortletPreference> targetPortletPreferences = this.getTargetPortletPreferences();
        final IPortletPreference removed = targetPortletPreferences.remove(key);
View Full Code Here

      {
         throw new IllegalArgumentException("key must not be null");
      }
      if (isReadOnly(key))
      {
         throw new ReadOnlyException("Key " + key + " cannot be written");
      }
      updates.put(key, PropertyChange.newReset(key));
   }
View Full Code Here

      {
         throw new IllegalArgumentException("key must not be null");
      }
      if (isReadOnly(key))
      {
         throw new ReadOnlyException("Key " + key + " cannot be written");
      }
      updates.put(key, PropertyChange.newUpdate(key, value));
   }
View Full Code Here

      {
         throw new IllegalArgumentException("key must not be null");
      }
      if (isReadOnly(key))
      {
         throw new ReadOnlyException("Key " + key + " cannot be written");
      }
      if (values == null)
      {
         values = new String[1];
      }
View Full Code Here

        return values;
    }

    public void setValue(String key, String value) throws ReadOnlyException {
        if (isReadOnly(key)) {
            throw new ReadOnlyException(EXCEPTIONS.getString(
                "error.preference.readonly", key));
        }
        PortletPreference pref = preferences.get(key);
        if (pref != null) {
            pref.setValues(new String[] { value });
View Full Code Here

        }
    }

    public void setValues(String key, String[] values) throws ReadOnlyException {
        if (isReadOnly(key)) {
            throw new ReadOnlyException(EXCEPTIONS.getString(
                "error.preference.readonly", key));
        }
        PortletPreference pref = preferences.get(key);
        if (pref != null) {
            pref.setValues(values);
View Full Code Here

TOP

Related Classes of javax.portlet.ReadOnlyException

Copyright © 2018 www.massapicom. 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.