|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sun.portal.providers.ProviderAdapter | +--com.sun.portal.providers.ProfileProviderAdapter
This class adds convenience wrappers around some commonly used
methods in the ProviderContext interface.
Provider
,
ProviderAdapter
,
ProviderContext
Fields inherited from interface com.sun.portal.providers.ProviderWidths |
WIDTH_FULL_BOTTOM, WIDTH_FULL_TOP, WIDTH_THICK, WIDTH_THIN |
Fields inherited from interface com.sun.portal.providers.ProviderEditTypes |
EDIT_COMPLETE, EDIT_SUBSET |
Constructor Summary | |
ProfileProviderAdapter()
|
Method Summary | |
boolean |
existsBooleanProperty(String name)
Tests for the existence of a boolean property in the channel. |
boolean |
existsIntegerProperty(String name)
Tests for the existence of an integer property in the channel. |
boolean |
existsListProperty(String name)
Tests for the existence of a list property in the channel. |
boolean |
existsListProperty(String name,
boolean localized)
Tests for the existence of a listproperty in the channel. |
boolean |
existsStringProperty(String name)
Tests for the existence of a string property in the channel. |
boolean |
existsStringProperty(String name,
boolean localized)
Tests for the existence of a string property in the channel. |
boolean |
getBooleanProperty(String key)
Gets a boolean property for the channel. |
boolean |
getBooleanProperty(String key,
boolean def)
Gets a boolean property for the channel. |
String |
getClientProperty(String name)
Gets the client property. |
int |
getIntegerProperty(String key)
Gets an integer property for the channel. |
int |
getIntegerProperty(String key,
int def)
Gets an integer property for the channel. |
List |
getListProperty(String key)
Gets a list property for the channel. |
List |
getListProperty(String key,
List def)
Gets a list property for the provider. |
Map |
getMapProperty(String key)
Gets a map property for the channel. |
Map |
getMapProperty(String key,
boolean localized)
Gets the localized version of a map property for the channel. |
Map |
getMapProperty(String key,
Map def)
Gets a map property for the channel. |
Map |
getMapProperty(String key,
Map def,
boolean localized)
Gets the localized version of a map property for the channel. |
String |
getStringAttribute(String name)
Gets a string attribute. |
String |
getStringProperty(String key)
Gets a string property for the channel. |
String |
getStringProperty(String key,
boolean localized)
Gets a localized string property for the channel. |
String |
getStringProperty(String key,
String def)
Gets a string property for the channel. |
String |
getStringProperty(String key,
String def,
boolean localized)
Gets a localized string property for the channel. |
StringBuffer |
getTemplate(String file)
Gets template for the provider. |
StringBuffer |
getTemplate(String file,
Hashtable table)
Gets template for the provider, and tag swap the results before returning. |
boolean |
isAllowed(String priv)
Deprecated. use getBooleanProperty() |
boolean |
setBooleanProperty(String key,
boolean val)
Sets a boolean property for the channel. |
void |
setClientProperty(String name,
String val)
Sets a client property. |
int |
setIntegerProperty(String key,
int val)
Sets a integer property for the channel. |
List |
setListProperty(String key,
List val)
Sets a list property for the channel. |
Map |
setMapProperty(String key,
Map val)
Sets a map property for the channel. |
void |
setStringAttribute(String name,
String val)
Sets a string attribute. |
String |
setStringProperty(String key,
String val)
Sets a string property for the channel. |
Methods inherited from class com.sun.portal.providers.ProviderAdapter |
getContent, getContent, getDescription, getEdit, getEdit, getEditType, getHelp, getHelp, getName, getProviderContext, getRefreshTime, getResourceBundle, getResourceBundle, getTitle, getWidth, init, isEditable, isPresentable, processEdit, processEdit |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ProfileProviderAdapter()
Method Detail |
public String getStringProperty(String key) throws ProviderException
This method assumes that the property is defined.
key
- The key for the property to be returned.public String getStringProperty(String key, String def) throws ProviderException
This method returns a
default value if the property does not exist.
key
- The key for the property to be returned.def
- The default value to be returned if the property
does not exist.public String getStringProperty(String key, boolean localized) throws ProviderException
If localized is true, then this method will attempt to find a localized
version of the string named by the key. The locale for the user
who this object is executing is read from the ProviderContext object
associated with this provider object. Locale-based strings are
searched for from more specific to less specific locales. For exmaple,
if the user locale was "en_US_SW",
the search order would be:
java.lang.Error
is thrown.
Client of this call can catch the error and provide code to handle the
error condition accordingly.key
- The key for the property to be returned.localized
- If true, first search for a localized string matching
the given key.public String getStringProperty(String key, String def, boolean localized) throws ProviderException
If localized is true, then this method will attempt to find a localized
version of the string named by the key. The locale for the user
who this object is executing is read from the ProviderContext object
associated with this provider object. Locale-based strings are
searched for from more specific to less specific locales. For exmaple,
if the user locale was "en_US_SW",
the search order would be:
key
- The key for the property to be returned.def
- Default value.localized
- If true, first search for a localized string matching
the given key.public List getListProperty(String key) throws ProviderException
This method assumes that the property is defined.
key
- The key for the property to be returned.public List getListProperty(String key, List def) throws ProviderException
This method will return the defaule list passed in if the
property is undefined for the channel.
key
- The key for the property to be returned.def
- The default list to be returned if the property
does not exist.public Map getMapProperty(String key) throws ProviderException
This method assumes that the property is defined.
The Java Map
object returned from this method fronts
the persistent store for the property. Changes to this
object are immediately reflected in the
persistent store.
Because of this, it is not necessary to call
setMapProperty()
to persist changes made
to a property returned from this method. However, if you are
setting a new map value, you must call
setMapProperty()
. For example, it is not
necessary to call setMapProperty()
in
the following example:
Map m = p.getMapProperty("foo");
This is because the Map m is returned from
m.put("a", "1");
getMapProperty()
and is therefore
persistent. However, in the example below, you must call
setMapProperty()
:
Map m = new HashMap();
Map m is not persistent because it was not returned from
m.put("a", "1");
getMapProperty()
method. The following
line is required to persist the changes:
p.setMapProperty("foo", m);
key
- The key for the property to be returned.public Map getMapProperty(String key, boolean localized) throws ProviderException
If localized is true, then this method will attempt to find a localized
version of the map named by the key. The locale for the user
who this object is executing is read from the ProviderContext object
associated with this providero object. Locale-based maps are
searched for from more specific to less specific locales. For exmaple,
if the user locale was "en_US_SW",
the search order would be:
java.lang.Error
is thrown.
Client of this call can catch the error and provide code to handle the
error condition accordingly.key
- The key for the property to be returned.localized
- If true, first search for a localized map matching
the given key.public Map getMapProperty(String key, Map def) throws ProviderException
This method returns a default
value if the property does not exist.
This method assumes that the property is defined.
key
- The key for the property to be returned.def
- Default value.public Map getMapProperty(String key, Map def, boolean localized) throws ProviderException
If localized is true, then this method will attempt to find a localized
version of the map named by the key. The locale for the user
who this object is executing is read from the ProviderContext object
associated with this providero object. Locale-based maps are
searched for from more specific to less specific locales. For exmaple,
if the user locale was "en_US_SW",
the search order would be:
key
- The key for the property to be returned.def
- Default value.localized
- If true, first search for a localized map matching
the given key.public boolean getBooleanProperty(String key) throws ProviderException
This method assumes that the property is defined.
key
- The key for the property to be returned.public boolean getBooleanProperty(String key, boolean def) throws ProviderException
This method returns a default
value if the property does not exist.
key
- The key for the property to be returned.def
- Default value.public int getIntegerProperty(String key) throws ProviderException
This method assumes that the property is defined.
key
- The key for the property to be returned.public int getIntegerProperty(String key, int def) throws ProviderException
This method returns a default
value if the property does not exist.
key
- The key for the property to be returned.def
- Default value.public String getStringAttribute(String name)
"Attributes" are settings that are not
channel-specific. An example of an attribute might be the user's
first and last name. Channel-specific settings are called
"properties".
Properties can be retrieved by calling the
get*Property()
methods.
Whether
a particular value is considered a property or an attribute depends
on the underlying implementation of ProviderContext
.
name
- Attribute name.public String getClientProperty(String name)
name
- Property name.public boolean isAllowed(String priv) throws ProviderException
This method is provided for backwards compatibility. There is
no longer a concept of a privilege in the Provider API. Instead, use
boolean properties.
This method simply calls getBooleanProperty() to determine its
return value.
priv
- The privilege to check.boolean
value. true
if the user is granted access by the named
privilege, otherwise false
.public String setStringProperty(String key, String val) throws ProviderException
This method assumes that the property is defined.
key
- The key for the property to be set.val
- The value for the propery to be set.public List setListProperty(String key, List val) throws ProviderException
This method assumes that the property is defined.
key
- The key for the property to be set.val
- The value for the propery to be set.public Map setMapProperty(String key, Map val) throws ProviderException
This method assumes that the property is defined.
key
- The key for the property to be set.val
- The value for the propery to be set.public boolean setBooleanProperty(String key, boolean val) throws ProviderException
This method assumes that the property is defined.
key
- The key for the property to be set.val
- The value for the propery to be set.public int setIntegerProperty(String key, int val) throws ProviderException
This method assumes that the property is defined.
key
- The key for the property to be set.val
- The value for the propery to be set.public void setStringAttribute(String name, String val)
"Attributes" are settings that are not
channel-specific. An example of an attribute might be the user's
first and last name. Channel-specific settings are called
"properties".
Properties can be set by calling the
set*Property()
methods.
Whether
a particular value is considered a property or an attribute depends
on the underlying implementation of ProviderContext
.
name
- Attribute name.name
- Attribute value.public void setClientProperty(String name, String val)
name
- The property name.value
- The property value.public boolean existsStringProperty(String name) throws ProviderException
name
- A String
, the property name.boolean
, true
if the
property exists, otherwise false
.public boolean existsStringProperty(String name, boolean localized) throws ProviderException
This method will also check for the existence of the localized
version of the property.
name
- A String
, the property name.localized
- A boolean
, whether to check the
existence of localized properties.boolean
, true
if the
property exists, otherwise false
.public boolean existsBooleanProperty(String name) throws ProviderException
name
- A String
, the property name.boolean
, true
if the
property exists, otherwise false
.public boolean existsIntegerProperty(String name) throws ProviderException
name
- A String
, the property name.boolean
, true
if the
property exists, otherwise false
.public boolean existsListProperty(String name) throws ProviderException
name
- A String
, the property name.boolean
, true
if the
property exists, otherwise false
.public boolean existsListProperty(String name, boolean localized) throws ProviderException
This method will also check for the existence of the localized
version of the property.
name
- A String
, the property name.localized
- A boolean
, whether to check the
existence of localized properties.boolean
, true
if the
property exists, otherwise false
.public StringBuffer getTemplate(String file) throws ProviderException
Gets template for the provider.
The directory search order of the template file is as follows:
Where
If there is no <clientPath> specified, then the directory search order is as follows:
file
- The template file nameStringBuffer
represents the templatepublic StringBuffer getTemplate(String file, Hashtable table) throws ProviderException
Gets template for the provider, and tag swap the results before returning.
getTemplate(String)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |