|
Oracle Fusion Middleware Java API for Oracle WebLogic Portal 10g Release 3 (10.3.2) E14255-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PortalAttributes
This is an interface for attaching arbitrary data to portal elements. Attributes can be set in two ways: via the API described below, or in a .portal/.portlet file. To set an attribute in a file, use the <portalAttribute> element. Here is an example <netuix:book ... > <netuix:portalAttribute name="myKey" value="show me" scope="request" /> ... </netuix:book>
This snippet attaches a request-scoped attribute with name="myKey" to the given book. The value of the attribute can be retrieved by calling the getAttribute
method as described below. These values specified in the .portal file are used as defaults for each new request, session, or web application, depending on the scope specified. They can be overridden for the life of the request/session using the setAttribute
method. Use the Factory class to get PortalAttributes instances from a backing or presentation context.
Nested Class Summary | |
---|---|
static class |
PortalAttributes.Factory |
static class |
PortalAttributes.Scope This defines the scope of an attribute. |
Method Summary | |
---|---|
Object |
getAttribute(String key, PortalAttributes.Scope scope) Retrieve the given attribute for the given key, at the given scope level. |
int |
getAttributeAsInt(String key, PortalAttributes.Scope scope) Same behavior as getAttribute , but the result is coerced into an int value. |
Collection<String> |
getAttributeNames(PortalAttributes.Scope scope) Return a collection consisting of all the names of attributes for a certain portal element at a certain scope. |
void |
removeAttribute(String key, PortalAttributes.Scope scope) Clear the attribute value for a given key at a given scope. |
void |
setAttribute(String key, int value, PortalAttributes.Scope scope) Set an integer attribute value for a given key at a given scope. |
void |
setAttribute(String key, Object value, PortalAttributes.Scope scope) Set the attribute value for a given key at a given scope. |
Method Detail |
---|
Object getAttribute(String key, PortalAttributes.Scope scope)
int getAttributeAsInt(String key, PortalAttributes.Scope scope) throws NumberFormatException
getAttribute
, but the result is coerced into an int value.NumberFormatException
void setAttribute(String key, Object value, PortalAttributes.Scope scope)
void setAttribute(String key, int value, PortalAttributes.Scope scope)
void removeAttribute(String key, PortalAttributes.Scope scope)
Collection<String> getAttributeNames(PortalAttributes.Scope scope)
|
Oracle Fusion Middleware Java API for Oracle WebLogic Portal 10g Release 3 (10.3.2) E14255-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2010, Oracle. All rights reserved.