Oracle Fusion Middleware
Java API Reference for Oracle PDK Java
11g Release 1 (11.1.1)
E10691-01

oracle.portal.provider.v2.personalize
Class PortletReference

java.lang.Object
  extended by oracle.portal.provider.v2.personalize.PortletReference

public class PortletReference
extends java.lang.Object

A PortletReference is the 'key' with which items of customization data are accessed by a PortletPersonalizationManager. It is built on top of a PortletInstance, and adds the additional properties of the 'level' at which the customization applies (e.g. system default, locale default, or user specific), the locale to which the data applies (for locale default and user level customizations) and the user to which the data applies (for user level customizations).


Field Summary
static int TYPE_LOCALE_DEFAULT
          The constant representing the locale default level of customization.
static int TYPE_SYSTEM_DEFAULT
          The constant representing the system (least specific) level of customization.
static int TYPE_USER
          The constant representing the user (most specific) level of customization.
 
Constructor Summary
PortletReference(PortletInstance portletInstance, ProviderUser user, java.util.Locale l)
          Constructor.
 
Method Summary
 java.lang.String getInstanceName()
          Gets the name of the PortletInstance referenced by this PortletReference.
 java.lang.String getLanguagePath()
          Assembles the appropriate language path to be used when reading/writing this PortletReference from/to a persistent store based on the portlet's locale personalization level.
 java.util.Locale getLocale()
          Gets the Locale that should be used on behalf of this reference.
 PortletDefinition getPortletDefinition()
          Gets the PortletDefinition which defines the referenced PortletInstance.
 long getPortletId()
          Gets the ID of the PortletDefinition which defines the referenced PortletInstance.
 PortletInstance getPortletInstance()
          Gets the referenced PortletInstance.
 java.lang.String getProviderId()
          Gets the ID of the ProviderInstance referenced by this PortletReference.
 ProviderInstance getProviderInstance()
          Gets the ProviderInstance referenced by this PortletReference.
 int getType()
          Gets a constant representing the 'type' of this PortletReference: system default, locale default or user level.
 ProviderUser getUser()
          Gets the user whose customization is requested with this instance.
 boolean isDefault()
          Determines whether this is a system default or locale default level reference rather than a user level reference.
 boolean isLanguageDefault()
          Determines whether this is a locale default level reference.
 java.lang.String toString()
          Returns a String representation of this reference in the form ProviderId.PortletId.PortletInstanceName.UserName.
 java.lang.String toString(int refType)
          Returns a String representation of this reference modified according to the refType parameter.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE_SYSTEM_DEFAULT

public static final int TYPE_SYSTEM_DEFAULT
The constant representing the system (least specific) level of customization.

See Also:
Constant Field Values

TYPE_LOCALE_DEFAULT

public static final int TYPE_LOCALE_DEFAULT
The constant representing the locale default level of customization.

See Also:
Constant Field Values

TYPE_USER

public static final int TYPE_USER
The constant representing the user (most specific) level of customization.

See Also:
Constant Field Values
Constructor Detail

PortletReference

public PortletReference(PortletInstance portletInstance,
                        ProviderUser user,
                        java.util.Locale l)
Constructor.

Parameters:
portletInstance - The referenced portlet instance
user - user of this PortletReference (if applicable). Should be null for a system default or locale default level PortletReference.
l - locale of this PortletReference (if applicable). Should be null or equal to the instance's default locale, returned by PortletInstance.getDefaultLocale() for a locale default or system default level PortletReference.
Method Detail

getProviderInstance

public ProviderInstance getProviderInstance()
Gets the ProviderInstance referenced by this PortletReference.

Returns:
the ProviderInstance referenced by this PortletReference.

getProviderId

public java.lang.String getProviderId()
Gets the ID of the ProviderInstance referenced by this PortletReference. This is a convenience method for calling getProviderInstance().getProviderId().

Returns:
the ID of the ProviderInstance referenced by this PortletReference.

getPortletInstance

public PortletInstance getPortletInstance()
Gets the referenced PortletInstance.

Returns:
the referenced PortletInstance.

getInstanceName

public java.lang.String getInstanceName()
Gets the name of the PortletInstance referenced by this PortletReference. This is a convenience method for calling getPortletInstance().getInstanceName().

Returns:
the name of the PortletInstance referenced by this PortletReference.

getPortletDefinition

public PortletDefinition getPortletDefinition()
Gets the PortletDefinition which defines the referenced PortletInstance.

Returns:
the PortletDefinition which defines the referenced PortletInstance.

getPortletId

public long getPortletId()
Gets the ID of the PortletDefinition which defines the referenced PortletInstance. This is a convenience method for calling getPortletDefinition().getId().

Returns:
the ID of the PortletDefinition which defines the referenced PortletInstance.

getUser

public ProviderUser getUser()
Gets the user whose customization is requested with this instance.

Returns:
the user whose customization is requested with this instance. If null then this reference indicates a locale default or system default level reference.

getLocale

public java.util.Locale getLocale()
Gets the Locale that should be used on behalf of this reference.

Returns:
the Locale that should be used on behalf of this reference.

isDefault

public boolean isDefault()
Determines whether this is a system default or locale default level reference rather than a user level reference.

Returns:
true if this is a system default or locale default level reference, false otherwise.

isLanguageDefault

public boolean isLanguageDefault()
Determines whether this is a locale default level reference.

Returns:
true if this is a locale default level reference, false otherwise.

getType

public int getType()
Gets a constant representing the 'type' of this PortletReference: system default, locale default or user level.

Returns:
a constant representing the 'type' of this PortletReference. Will be one of the constants defined in this class.

getLanguagePath

public java.lang.String getLanguagePath()
Assembles the appropriate language path to be used when reading/writing this PortletReference from/to a persistent store based on the portlet's locale personalization level. For more information on the locale personalization level, see PortletDefinition.setLocalePersonalizationLevel(int).

Returns:
the appropriate language path.

toString

public java.lang.String toString()
Returns a String representation of this reference in the form ProviderId.PortletId.PortletInstanceName.UserName. If this is a system default level reference then the .Username is ommitted.

Overrides:
toString in class java.lang.Object
Returns:
a String representation of this reference.

toString

public java.lang.String toString(int refType)
Returns a String representation of this reference modified according to the refType parameter. For example, if the PortletReference is for a user level customization but the user customization does not exist so we are falling back to one of the defaults, then we need to adjust how the reference is displayed. The reference is returned in the form:

ProviderId.PortletId.PortletInstanceName.UserName

If refType denotes the locale default or system default level, then the .Username is omitted.

Returns:
a String representation of this reference

Oracle Fusion Middleware
Java API Reference for Oracle PDK Java
11g Release 1 (11.1.1)
E10691-01

Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.