public class ResourceContext extends Object implements IResourceContext, Serializable
IResourceContext
,
Serialized FormModifier 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
IResourceContext
setObjectValue
in interface IResourceContext
name
- A unique namevalue
- An objectResourceException
- If the name paramater is invalidpublic Object getObjectValue(String name)
IResourceContext
getObjectValue
in interface IResourceContext
name
- TBD: Description of the incoming method parameterpublic void setValue(String name, String value) throws ResourceException
IResourceContext
setValue
in interface IResourceContext
name
- A unique namevalue
- The valueResourceException
- If the name paramater is invalidpublic String getValue(String name)
IResourceContext
getValue
in interface IResourceContext
name
- TBD: Description of the incoming method parameterpublic void setValues(HashMap properties)
IResourceContext
setValues
in interface IResourceContext
properties
- propertiespublic HashMap getValues()
IResourceContext
getValues
in interface IResourceContext
public Locale getLocale()
IResourceContext
getLocale
in interface IResourceContext
Locale
the locale to use.Locale
public void setLocale(Locale locale)
IResourceContext
setLocale
in interface IResourceContext
locale
- locale to be setLocale
public void setUser(com.sapportals.portal.security.usermanagement.IUser user)
setUserUME(com.sap.security.api.IUser)
IResourceContext
setUser
in interface IResourceContext
user
- user to be setpublic void setUserUME(IUser user)
setUserUME
in interface IResourceContext
user
- user to be setpublic com.sapportals.portal.security.usermanagement.IUser getUser()
getUserUME()
IResourceContext
getUser
in interface IResourceContext
IUser
the user.public IUser getUserUME()
IResourceContext
getUserUME
in interface IResourceContext
IUser
the user.public IPropertyMap getVariantContext()
IResourceContext
null
.getVariantContext
in interface IResourceContext
null
.IResourceContext.getVariantContext()
public void setVariantContext(IPropertyMap variantContext)
IResourceContext
null
.setVariantContext
in interface IResourceContext
public String getTuccId()
IResourceContext
null
.getTuccId
in interface IResourceContext
null
.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 2018 SAP AG Complete Copyright Notice