public class ResourceContext extends Object implements IResourceContext, Serializable
IResourceContext,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
protected Locale |
locale
the locale object
|
protected Properties |
placeholders
URI placeholder used by resource factory
|
protected HashMap |
properties
Properties used by
setValue()/getValue() |
protected static String |
SESSION |
AccessContext |
transformedAccessContext
Used for an optimization in ContextTransformer class.
|
protected IUser |
user
the current user in that context
|
J2EE_SCAN_PROFILE, NO_KEYWORD_SUBSTITUTION, TRANSPORT_EXPORT, TRANSPORT_IMPORT| Constructor and Description |
|---|
ResourceContext(com.sapportals.portal.security.usermanagement.IUser user)
Deprecated.
As of NetWeaver 7.1, replaced by
getInstance(com.sap.security.api.IUser) |
ResourceContext(com.sapportals.portal.security.usermanagement.IUser user,
Locale fallbackLocale)
Deprecated.
As of NetWeaver 7.1, replaced by
getInstance(com.sap.security.api.IUser, Locale) |
ResourceContext(com.sapportals.portal.security.usermanagement.IUser user,
Locale locale,
boolean isPrimaryLocale)
Deprecated.
As of NetWeaver 7.1, replaced by
getInstance(IUser, Locale, boolean) |
| Modifier and Type | Method and Description |
|---|---|
IResourceContext |
cloneContext()
Clone resource context.
|
boolean |
equals(Object other) |
long |
getCreationTime() |
static ResourceContext |
getInstance(IUser user)
Returns a new resource context instance.
|
static ResourceContext |
getInstance(IUser user,
Locale fallbackLocale)
Returns a new resource context instance.
|
static ResourceContext |
getInstance(IUser user,
Locale locale,
boolean isPrimaryLocale)
Returns a new resource context instance.
|
static ResourceContext |
getInstance(IUser user,
Locale locale,
boolean isPrimaryLocale,
IPropertyMap variantContext)
Returns a new resource context instance that contains a variant context.
|
static ResourceContext |
getInstance(IUser user,
Locale locale,
boolean isPrimaryLocale,
IPropertyMap variantContext,
String tuccId)
Returns a new resource context instance that contains a TUCC transaction identifier.
|
Locale |
getLocale()
Get the locale for that context.
|
Object |
getObjectValue(String name)
Returns the value for the specified name
|
String |
getTuccId()
Returns the TUCC transaction identifier - can be
null. |
com.sapportals.portal.security.usermanagement.IUser |
getUser()
Deprecated.
As of NetWeaver 7.1, replaced by
getUserUME() |
IUser |
getUserUME()
Get the current user for that context.
|
String |
getValue(String name)
Returns the value for the specified name
|
HashMap |
getValues()
Returns the internal properties map as is without copying them to be used and possible modified from outside.
|
IPropertyMap |
getVariantContext()
Returns a map of context properties used for variant handling - may be
null. |
int |
hashCode() |
void |
setLocale(Locale locale)
Set the locale for that context.
|
void |
setObjectValue(String name,
Object value)
Add/update a name/value pair
|
void |
setUser(com.sapportals.portal.security.usermanagement.IUser user)
Deprecated.
As of NetWeaver 7.1, replaced by
setUserUME(com.sap.security.api.IUser) |
void |
setUserUME(IUser user)
Assigns a new user object to the context
|
void |
setValue(String name,
String value)
Add/update a name/value pair
|
void |
setValues(HashMap properties)
Takes and sets the properties as is without copying them to be used and possibly modified as internal properties
map.
|
void |
setVariantContext(IPropertyMap variantContext)
Sets a map of context properties used for variant handling - may be
null. |
String |
toString() |
protected static final String SESSION
protected HashMap properties
setValue()/getValue()protected Locale locale
protected transient IUser user
protected Properties placeholders
public AccessContext transformedAccessContext
public ResourceContext(com.sapportals.portal.security.usermanagement.IUser user)
getInstance(com.sap.security.api.IUser)public ResourceContext(com.sapportals.portal.security.usermanagement.IUser user,
Locale fallbackLocale)
getInstance(com.sap.security.api.IUser, Locale)public ResourceContext(com.sapportals.portal.security.usermanagement.IUser user,
Locale locale,
boolean isPrimaryLocale)
getInstance(IUser, Locale, boolean)public static ResourceContext getInstance(IUser user)
user - The user object to assign to the context. The user should be authenticated. Use null to
assign the (automatically authenticated) ANONYMOUS user.public static ResourceContext getInstance(IUser user, Locale fallbackLocale)
user - The user object to assign to the context. The user should be authenticated. Use null to
assign the (automatically authenticated) ANONYMOUS user.fallbackLocale - The locale to be used when no locale is assigned to the user object.public static ResourceContext getInstance(IUser user, Locale locale, boolean isPrimaryLocale)
user - The user object to assign to the context. The user should be authenticated. Use null to
assign the (automatically authenticated) ANONYMOUS user.locale - The user's locale.isPrimaryLocale - true: The locale parameter overwrites the locale assigned to the user object, false: vice versapublic static final ResourceContext getInstance(IUser user, Locale locale, boolean isPrimaryLocale, IPropertyMap variantContext) throws WcmException
user - The user object to assign to the context. The user should be authenticated. Use null to
assign the (automatically authenticated) ANONYMOUS user.locale - The user's locale.isPrimaryLocale - true: The locale parameter overwrites the locale assigned to the user object, false: vice versavariantContext - A map of context properties which are user for variant handling - may be null. The map may
contain properties of any type but multi-value and multi-language properties are not allowed.WcmException - If at least one of the properties is a multi-value ot multi-language property.public static final ResourceContext getInstance(IUser user, Locale locale, boolean isPrimaryLocale, IPropertyMap variantContext, String tuccId)
user - locale - isPrimaryLocale - variantContext - tuccId - public long getCreationTime()
public void setObjectValue(String name, Object value) throws ResourceException
IResourceContextsetObjectValue in interface IResourceContextname - A unique namevalue - An objectResourceException - If the name paramater is invalidpublic Object getObjectValue(String name)
IResourceContextgetObjectValue in interface IResourceContextname - TBD: Description of the incoming method parameterpublic void setValue(String name, String value) throws ResourceException
IResourceContextsetValue in interface IResourceContextname - A unique namevalue - The valueResourceException - If the name paramater is invalidpublic String getValue(String name)
IResourceContextgetValue in interface IResourceContextname - TBD: Description of the incoming method parameterpublic void setValues(HashMap properties)
IResourceContextsetValues in interface IResourceContextproperties - propertiespublic HashMap getValues()
IResourceContextgetValues in interface IResourceContextpublic Locale getLocale()
IResourceContextgetLocale in interface IResourceContextLocale the locale to use.Localepublic void setLocale(Locale locale)
IResourceContextsetLocale in interface IResourceContextlocale - locale to be setLocalepublic void setUser(com.sapportals.portal.security.usermanagement.IUser user)
setUserUME(com.sap.security.api.IUser)IResourceContextsetUser in interface IResourceContextuser - user to be setpublic void setUserUME(IUser user)
setUserUME in interface IResourceContextuser - user to be setpublic com.sapportals.portal.security.usermanagement.IUser getUser()
getUserUME()IResourceContextgetUser in interface IResourceContextIUser the user.public IUser getUserUME()
IResourceContextgetUserUME in interface IResourceContextIUser the user.public IPropertyMap getVariantContext()
IResourceContextnull.getVariantContext in interface IResourceContextnull.IResourceContext.getVariantContext()public void setVariantContext(IPropertyMap variantContext)
IResourceContextnull.setVariantContext in interface IResourceContextpublic String getTuccId()
IResourceContextnull.getTuccId in interface IResourceContextnull.public IResourceContext cloneContext()
| Access Rights |
|---|
| SC | DC | Public Part | ACH |
|---|---|---|---|
[sap.com] KMC-CM
|
[sap.com] tc/km/frwk
|
api
|
EP-KM-CM
|
[sap.com] KMC-WPC
|
[sap.com] tc/kmc/wpc/wpcfacade
|
api
|
EP-PIN-WPC-WCM
|
Copyright 2021 SAP SE Complete Copyright Notice