|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object KennewickObject com.mf.roundhouse.core.domain.RoundhouseObject com.mf.roundhouse.portal.domain.PortletPreferencesImpl
Represents system, user or group level portlet preferences.
Field Summary | |
static java.lang.String |
OWNER_GROUP_ID
|
static java.lang.String |
OWNER_USER_ID
|
static java.lang.String |
PORTLET_DEFINITION_ID
|
static java.lang.String |
PREFERENCES
|
Constructor Summary | |
PortletPreferencesImpl()
|
|
PortletPreferencesImpl(ObjectIdentifier anId)
|
Method Summary | |
void |
addPreference(PortletPreference pref)
|
java.util.Map |
getMap()
Returns a Map of the preferences. |
java.util.Enumeration |
getNames()
Returns all of the keys that have an associated value, or an empty Enumeration if no keys are
available. |
ObjectIdentifier |
getOwnerGroupId()
|
ObjectIdentifier |
getOwnerUserId()
|
PortletDefinition |
getPortletDefinition()
|
ObjectIdentifier |
getPortletDefinitionId()
|
PortletPreference |
getPreference(java.lang.String key)
|
java.util.Map |
getPreferences()
|
java.security.Principal |
getRuntimePrincipal()
|
java.lang.String |
getValue(java.lang.String key,
java.lang.String def)
Returns the first String value associated with the specified key of this preference. |
java.lang.String[] |
getValues(java.lang.String key,
java.lang.String[] def)
Returns the String array value associated with the specified key in this preference. |
boolean |
isReadOnly(java.lang.String key)
Returns true, if the value of this key cannot be modified by the user. |
void |
reset(java.lang.String key)
Resets or removes the value associated with the specified key. |
void |
setOwnerGroupId(ObjectIdentifier identifier)
|
void |
setOwnerUserId(ObjectIdentifier identifier)
|
void |
setPortletDefinitionId(ObjectIdentifier identifier)
|
void |
setPreferences(java.util.Map prefMap)
|
void |
setRuntimePrincipal(java.security.Principal principal)
|
void |
setValue(java.lang.String key,
java.lang.String value)
Associates the specified String value with the specified key in this preference. |
void |
setValues(java.lang.String key,
java.lang.String[] values)
Associates the specified String array value with the specified key in this preference. |
void |
store()
Commits all changes made to the preferences via the set methods in the persistent store. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String PREFERENCES
public static final java.lang.String OWNER_GROUP_ID
public static final java.lang.String OWNER_USER_ID
public static final java.lang.String PORTLET_DEFINITION_ID
Constructor Detail |
public PortletPreferencesImpl(ObjectIdentifier anId) throws java.lang.Exception
anId
-
java.lang.Exception
public PortletPreferencesImpl()
Method Detail |
public java.util.Enumeration getNames()
PortletPreferences
Enumeration
if no keys are
available.
getNames
in interface PortletPreferences
Enumeration
if no keys are
available.public java.lang.String getValue(java.lang.String key, java.lang.String def)
PortletPreferences
getValue
in interface PortletPreferences
key
- key for which the associated value is to be returneddef
- the value to be returned in the event that there is no
value available associated with this key
.
key
, or def
if no value is associated with key
, or the backing
store is inaccessible.PortletPreferences.getValues(String, String[])
public java.lang.String[] getValues(java.lang.String key, java.lang.String[] def)
PortletPreferences
Returns the specified default if there is no value associated with the key, or if the backing store is inaccessible.
If the implementation supports stored defaults and such a default exists and is accessible, it is used in favor of the specified default.
getValues
in interface PortletPreferences
key
- key for which associated value is to be returned.def
- the value to be returned in the event that this
preference node has no value associated with key
or the associated value cannot be interpreted as a String array,
or the backing store is inaccessible.
key
, or def
if the
associated value does not exist.PortletPreferences.getValue(String,String)
public PortletPreference getPreference(java.lang.String key)
public boolean isReadOnly(java.lang.String key)
PortletPreferences
Modifiable preferences can be changed by the
portlet in any standard portlet mode (EDIT, HELP, VIEW
).
Per default every preference is modifiable.
Read-only preferences cannot be changed by the
portlet in any standard portlet mode, but inside of custom modes
it may be allowed changing them.
Preferences are read-only, if they are defined in the
deployment descriptor with read-only
set to true
,
or if the portlet container restricts write access.
isReadOnly
in interface PortletPreferences
public void reset(java.lang.String key) throws ReadOnlyException
PortletPreferences
If this implementation supports stored defaults, and there is such a default for the specified preference, the given key will be reset to the stored default.
If there is no default available the key will be removed.
reset
in interface PortletPreferences
key
- to reset
ReadOnlyException
- if this preference cannot be modified for this requestpublic void setValue(java.lang.String key, java.lang.String value) throws ReadOnlyException
PortletPreferences
The key cannot be null
, but null
values
for the value parameter are allowed.
setValue
in interface PortletPreferences
key
- key with which the specified value is to be associated.value
- value to be associated with the specified key.
ReadOnlyException
- if this preference cannot be modified for this requestPortletPreferences.setValues(String, String[])
public void setValues(java.lang.String key, java.lang.String[] values) throws ReadOnlyException
PortletPreferences
The key cannot be null
, but null
values
in the values parameter are allowed.
setValues
in interface PortletPreferences
key
- key with which the value is to be associatedvalues
- values to be associated with key
ReadOnlyException
- if this preference cannot be modified for this requestPortletPreferences.setValue(String,String)
public void store() throws java.io.IOException, ValidatorException
PortletPreferences
set
methods in the persistent store.
If this call returns succesfull, all changes are made persistent. If this call fails, no changes are made in the persistent store. This call is an atomic operation regardless of how many preference attributes have been modified.
All changes made to preferences not followed by a call
to the store
method are discarded when the
portlet finishes the processAction
method.
If a validator is defined for this preferences in the
deployment descriptor, this validator is called before
the actual store is performed to check wether the given
preferences are vaild. If this check fails a
ValidatorException
is thrown.
store
in interface PortletPreferences
ValidatorException
- if the validation performed by the
associated validator fails
java.io.IOException
- if changes cannot be written into
the backend storePreferencesValidator
public ObjectIdentifier getOwnerGroupId()
public java.util.Map getPreferences()
public void setOwnerGroupId(ObjectIdentifier identifier)
identifier
- public void setPreferences(java.util.Map prefMap)
public ObjectIdentifier getOwnerUserId()
public void setOwnerUserId(ObjectIdentifier identifier)
identifier
- public PortletDefinition getPortletDefinition() throws java.lang.Exception
java.lang.Exception
public ObjectIdentifier getPortletDefinitionId()
public void setPortletDefinitionId(ObjectIdentifier identifier)
identifier
- public void addPreference(PortletPreference pref)
public java.security.Principal getRuntimePrincipal()
public void setRuntimePrincipal(java.security.Principal principal)
principal
- public java.util.Map getMap()
PortletPreferences
Map
of the preferences.
The values in the returned Map
are from type
String array (String[]
).
If no preferences exist this method returns an empty Map
.
getMap
in interface PortletPreferences
Map
containing preference names as
keys and preference values as map values, or an empty Map
if no preference exist. The keys in the preference
map are of type String. The values in the preference map are of type
String array (String[]
).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |