|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.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
Field Summary |
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)
Get a boolean property for the channel. |
boolean |
getBooleanProperty(String key,
boolean def)
Get a boolean property for the channel. |
boolean |
getBooleanProperty(String key,
boolean def,
List pflist)
Get the filtered boolean property for the channel. |
boolean |
getBooleanProperty(String key,
List pflist)
Get the filtered boolean property for the channel. |
String |
getClientProperty(String name)
Get the client property. |
int |
getIntegerProperty(String key)
Get an integer property for the channel. |
int |
getIntegerProperty(String key,
int def)
Get an integer property for the channel. |
int |
getIntegerProperty(String key,
int def,
List pflist)
Get an integer property for the channel. |
int |
getIntegerProperty(String key,
List pflist)
Get an integer property for the channel. |
List |
getListProperty(String key)
Get a list property for the channel. |
List |
getListProperty(String key,
List def)
Get a list property for the provider. |
Map |
getMapProperty(String key)
Get a map property for the channel. |
Map |
getMapProperty(String key,
boolean localized)
Get the localized version of a map property for the channel. |
Map |
getMapProperty(String key,
List pflist)
Get the filtered map property for the channel. |
Map |
getMapProperty(String key,
Map def)
Get a map property for the channel. |
Map |
getMapProperty(String key,
Map def,
boolean localized)
Get the localized version of a map property for the channel. |
Map |
getMapProperty(String key,
Map def,
List pflist)
Get the filtered map property for the channel. |
String |
getStringAttribute(String name)
Get a string attribute. |
String |
getStringProperty(String key)
Get a string property for the channel. |
String |
getStringProperty(String key,
boolean localized)
Get a localized string property for the channel. |
String |
getStringProperty(String key,
List pflist)
Get a filtered string property for the channel. |
String |
getStringProperty(String key,
String def)
Get a string property for the channel. |
String |
getStringProperty(String key,
String def,
boolean localized)
Get a localized string property for the channel. |
String |
getStringProperty(String key,
String def,
List pflist)
Get a filtered string property for the channel. |
StringBuffer |
getTemplate(String file)
Get template for the provider. |
StringBuffer |
getTemplate(String file,
Hashtable table)
Get template for the provider, and tag swap the results before returning. |
File |
getTemplatePath(String file)
Get the template path for the given channel name and the given template name. |
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, isPresentable, processEdit, processEdit |
Methods inherited from class java.lang.Object |
clone, equals, finalize, 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.
ProviderException
- if an error occurs in getting the
String property.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.
ProviderException
- if an error occurs in getting the
String property.public String getStringProperty(String key, List pflist) throws ProviderException
Filter criteria can be specified using a series of PropertiesFilter
objects. The order in that the PropertiesFilter objects are listed
determines the order that the property is searched.
If there is no property that exactly matches the filter criteria,
the best partial match is returned. When there is not even a
partial match, an unfiltered property is returned.
key
- The key for the property to be returned.pflist
- An ordered list of PropertiesFilter objects
ProviderException
- if an error occurs in getting the filtered
String property.PropertiesFilter
public String getStringProperty(String key, String def, List pflist) throws ProviderException
Filter criteria can be specified using a series of PropertiesFilter
objects. The order in that the PropertiesFilter objects are listed
determines the order that the property is searched.
If there is no property that exactly matches the filter criteria,
the best partial match is returned. When there is not even a
partial match, an unfiltered property is returned. If the unfiltered
property is unavailble, then the default value is returned.
key
- The key for the property to be returned.def
- Default value.pflist
- An ordered list of PropertiesFilter objects
ProviderException
- if an error occurs in getting the filtered
String property.PropertiesFilter
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.
ProviderException
- if an error occurs in getting the localized
String property.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.
ProviderException
- if an error occurs in getting the localized
String property.public List getListProperty(String key) throws ProviderException
This method assumes that the property is defined.
key
- The key for the property to be returned.
ProviderException
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.
ProviderException
public Map getMapProperty(String key) throws ProviderException
This method assumes that the property is defined.
Map
object returned from this method
does not fronts the persistent store for the property.
Changes to the return value are not persisted.
Changes must be persisted with
setMapProperty()
call. For example,
Map m = p.getMapProperty("foo");
m.put("a", "1");
p.setMapProperty("foo", m);
key
- The key for the property to be returned.
ProviderException
public Map getMapProperty(String key, List pflist) throws ProviderException
Filter criteria can be specified using a series of PropertiesFilter
objects. The order in that the PropertiesFilter objects are listed
determines the order that the property is searched.
If there is no property that exactly matches the filter criteria,
the best partial match is returned. When there is not even a
partial match, an unfiltered property is returned. If the unfiltered
property is unavailble, then the default value is returned.
key
- The key for the property to be returned.pflist
- An ordered list of PropertiesFilter objects.
ProviderException
PropertiesFilter
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.
ProviderException
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.
ProviderException
public Map getMapProperty(String key, Map def, List pflist) throws ProviderException
Filter criteria can be specified using a series of PropertiesFilter
objects. The order in that the PropertiesFilter objects are listed
determines the order that the property is searched.
If there is no property that exactly matches the filter criteria,
the best partial match is returned. When there is not even a
partial match, an unfiltered property is returned. If the unfiltered
property is unavailble, then the default value is returned.
key
- The key for the property to be returned.def
- Default value.pflist
- An ordered list of PropertiesFilter objects
ProviderException
PropertiesFilter
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.
ProviderException
public boolean getBooleanProperty(String key) throws ProviderException
This method assumes that the property is defined.
key
- The key for the property to be returned.
ProviderException
public boolean getBooleanProperty(String key, List pflist) throws ProviderException
This method assumes that the property is defined.
Filter criteria can be specified using a series of PropertiesFilter
objects. The order in that the PropertiesFilter objects are listed
determines the order that the property is searched.
If there is no property that exactly matches the filter criteria,
the best partial match is returned. When there is not even a
partial match, an unfiltered property is returned. If the unfiltered
property is unavailble, then the default value is returned.
key
- The key for the property to be returned.pflist
- An ordered list of PropertiesFilter objects
ProviderException
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.
ProviderException
public boolean getBooleanProperty(String key, boolean def, List pflist) throws ProviderException
This method returns a default
value if the property does not exist.
Filter criteria can be specified using a series of PropertiesFilter
objects. The order in that the PropertiesFilter objects are listed
determines the order that the property is searched.
If there is no property that exactly matches the filter criteria,
the best partial match is returned. When there is not even a
partial match, an unfiltered property is returned. If the unfiltered
property is unavailble, then the default value is returned.
key
- The key for the property to be returned.def
- Default value.pflist
- An ordered list of PropertiesFilter objects
ProviderException
public int getIntegerProperty(String key) throws ProviderException
This method assumes that the property is defined.
key
- The key for the property to be returned.
ProviderException
public int getIntegerProperty(String key, List pflist) throws ProviderException
This method assumes that the property is defined.
Filter criteria can be specified using a series of PropertiesFilter
objects. The order in that the PropertiesFilter objects are listed
determines the order that the property is searched.
If there is no property that exactly matches the filter criteria,
the best partial match is returned. When there is not even a
partial match, an unfiltered property is returned. If the unfiltered
property is unavailble, then the default value is returned.
key
- The key for the property to be returned.pflist
- An ordered list of PropertiesFilter objects
ProviderException
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.
ProviderException
public int getIntegerProperty(String key, int def, List pflist) throws ProviderException
This method returns a default
value if the property does not exist.
Filter criteria can be specified using a series of PropertiesFilter
objects. The order in that the PropertiesFilter objects are listed
determines the order that the property is searched.
If there is no property that exactly matches the filter criteria,
the best partial match is returned. When there is not even a
partial match, an unfiltered property is returned. If the unfiltered
property is unavailble, then the default value is returned.
key
- The key for the property to be returned.def
- Default value.pflist
- An ordered list of PropertiesFilter objects
ProviderException
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
.
ProviderException
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.
ProviderException
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.
ProviderException
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.
ProviderException
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.
ProviderException
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.
ProviderException
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.public void setClientProperty(String name, String val)
name
- The property name.public boolean existsStringProperty(String name) throws ProviderException
name
- A String
, the property name.
boolean
, true
if the
property exists, otherwise false
.
ProviderException
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
.
ProviderException
public boolean existsBooleanProperty(String name) throws ProviderException
name
- A String
, the property name.
boolean
, true
if the
property exists, otherwise false
.
ProviderException
public boolean existsIntegerProperty(String name) throws ProviderException
name
- A String
, the property name.
boolean
, true
if the
property exists, otherwise false
.
ProviderException
public boolean existsListProperty(String name) throws ProviderException
name
- A String
, the property name.
boolean
, true
if the
property exists, otherwise false
.
ProviderException
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
.
ProviderException
public StringBuffer getTemplate(String file) throws ProviderException
Get 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 name
StringBuffer
represents the template
ProviderException
public File getTemplatePath(String file) throws ProviderException
Get the template path for the given channel name and the given template name. If non-null, the key returned by this method will map to a most specific, existing template file. The format of the returned path is implementation dependent.
ProviderException
getTemplate(String)
public StringBuffer getTemplate(String file, Hashtable table) throws ProviderException
Get template for the provider, and tag swap the results before returning.
ProviderException
getTemplate(String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |