com.sapportals.wcm.repository

Class ResourceContext

java.lang.Object
  extended by com.sapportals.wcm.repository.ResourceContext
All Implemented Interfaces:
IResourceContext, Serializable

public class ResourceContext
extends Object
implements IResourceContext, Serializable

See Also:
IResourceContext, Serialized Form

Field Summary
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
 
Fields inherited from interface com.sapportals.wcm.repository.IResourceContext
J2EE_SCAN_PROFILE, NO_KEYWORD_SUBSTITUTION, TRANSPORT_EXPORT, TRANSPORT_IMPORT
 
Constructor Summary
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)
 
Method Summary
 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()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

SESSION

protected static final String SESSION
See Also:
Constant Field Values

properties

protected HashMap properties
Properties used by setValue()/getValue()


locale

protected Locale locale
the locale object


user

protected transient IUser user
the current user in that context


placeholders

protected Properties placeholders
URI placeholder used by resource factory


transformedAccessContext

public AccessContext transformedAccessContext
Used for an optimization in ContextTransformer class.

Constructor Detail

ResourceContext

public ResourceContext(com.sapportals.portal.security.usermanagement.IUser user)
Deprecated. As of NetWeaver 7.1, replaced by getInstance(com.sap.security.api.IUser)


ResourceContext

public 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

public ResourceContext(com.sapportals.portal.security.usermanagement.IUser user,
                       Locale locale,
                       boolean isPrimaryLocale)
Deprecated. As of NetWeaver 7.1, replaced by getInstance(IUser, Locale, boolean)

Method Detail

getInstance

public static ResourceContext getInstance(IUser user)
Returns a new resource context instance.

Parameters:
user - The user object to assign to the context. The user should be authenticated. Use null to assign the (automatically authenticated) ANONYMOUS user.
Returns:
a new resource context instance.
Since:
NetWeaver 7.1

getInstance

public static ResourceContext getInstance(IUser user,
                                          Locale fallbackLocale)
Returns a new resource context instance.

Parameters:
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.
Returns:
a new resource context instance.
Since:
NetWeaver 7.1

getInstance

public static ResourceContext getInstance(IUser user,
                                          Locale locale,
                                          boolean isPrimaryLocale)
Returns a new resource context instance.

Parameters:
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 versa
Returns:
a new resource context instance.
Since:
NetWeaver 7.1

getInstance

public static final ResourceContext getInstance(IUser user,
                                                Locale locale,
                                                boolean isPrimaryLocale,
                                                IPropertyMap variantContext)
                                         throws WcmException
Returns a new resource context instance that contains a variant context.

Parameters:
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 versa
variantContext - 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.
Returns:
a new resource context instance.
Throws:
WcmException - If at least one of the properties is a multi-value ot multi-language property.
Since:
NetWeaver 7.1

getInstance

public static final ResourceContext getInstance(IUser user,
                                                Locale locale,
                                                boolean isPrimaryLocale,
                                                IPropertyMap variantContext,
                                                String tuccId)
Returns a new resource context instance that contains a TUCC transaction identifier.

Parameters:
user -
locale -
isPrimaryLocale -
variantContext -
tuccId -
Returns:
a new resource context instance.

getCreationTime

public long getCreationTime()

setObjectValue

public void setObjectValue(String name,
                           Object value)
                    throws ResourceException
Description copied from interface: IResourceContext
Add/update a name/value pair

Specified by:
setObjectValue in interface IResourceContext
Parameters:
name - A unique name
value - An object
Throws:
ResourceException - If the name paramater is invalid

getObjectValue

public Object getObjectValue(String name)
Description copied from interface: IResourceContext
Returns the value for the specified name

Specified by:
getObjectValue in interface IResourceContext
Parameters:
name - TBD: Description of the incoming method parameter
Returns:
The result object or null if the name was not found

setValue

public void setValue(String name,
                     String value)
              throws ResourceException
Description copied from interface: IResourceContext
Add/update a name/value pair

Specified by:
setValue in interface IResourceContext
Parameters:
name - A unique name
value - The value
Throws:
ResourceException - If the name paramater is invalid

getValue

public String getValue(String name)
Description copied from interface: IResourceContext
Returns the value for the specified name

Specified by:
getValue in interface IResourceContext
Parameters:
name - TBD: Description of the incoming method parameter
Returns:
The value or null if the name was not found

setValues

public void setValues(HashMap properties)
Description copied from interface: IResourceContext
Takes and sets the properties as is without copying them to be used and possibly modified as internal properties map.

Specified by:
setValues in interface IResourceContext
Parameters:
properties - properties

getValues

public HashMap getValues()
Description copied from interface: IResourceContext
Returns the internal properties map as is without copying them to be used and possible modified from outside.

Specified by:
getValues in interface IResourceContext
Returns:
properties

getLocale

public Locale getLocale()
Description copied from interface: IResourceContext
Get the locale for that context.

Specified by:
getLocale in interface IResourceContext
Returns:
Locale the locale to use.
See Also:
Locale

setLocale

public void setLocale(Locale locale)
Description copied from interface: IResourceContext
Set the locale for that context.

Specified by:
setLocale in interface IResourceContext
Parameters:
locale - locale to be set
See Also:
Locale

setUser

public void setUser(com.sapportals.portal.security.usermanagement.IUser user)
Deprecated. As of NetWeaver 7.1, replaced by setUserUME(com.sap.security.api.IUser)

Description copied from interface: IResourceContext
Set the current user for that context.

Specified by:
setUser in interface IResourceContext
Parameters:
user - user to be set

setUserUME

public void setUserUME(IUser user)
Assigns a new user object to the context

Specified by:
setUserUME in interface IResourceContext
Parameters:
user - user to be set
Since:
NetWeaver 7.1

getUser

public com.sapportals.portal.security.usermanagement.IUser getUser()
Deprecated. As of NetWeaver 7.1, replaced by getUserUME()

Description copied from interface: IResourceContext
Get the current user for that context.

Specified by:
getUser in interface IResourceContext
Returns:
IUser the user.

getUserUME

public IUser getUserUME()
Description copied from interface: IResourceContext
Get the current user for that context.

Specified by:
getUserUME in interface IResourceContext
Returns:
IUser the user.
Since:
NetWeaver 7.1

getVariantContext

public IPropertyMap getVariantContext()
Description copied from interface: IResourceContext
Returns a map of context properties used for variant handling - may be null.

Specified by:
getVariantContext in interface IResourceContext
Returns:
a map of context properties used for variant handling - may be null.
See Also:
IResourceContext.getVariantContext()

setVariantContext

public void setVariantContext(IPropertyMap variantContext)
Description copied from interface: IResourceContext
Sets a map of context properties used for variant handling - may be null.

Specified by:
setVariantContext in interface IResourceContext

getTuccId

public String getTuccId()
Description copied from interface: IResourceContext
Returns the TUCC transaction identifier - can be null.

Specified by:
getTuccId in interface IResourceContext
Returns:
the TUCC transaction identifier - can be null.

cloneContext

public IResourceContext cloneContext()
Clone resource context.


toString

public String toString()
Overrides:
toString in class Object

equals

public final boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public final int hashCode()
Overrides:
hashCode in class Object
Access Rights

This class can be accessed from:


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 2014 SAP AG Complete Copyright Notice