# com.bea.netuix.application.view
PortletView Interface

public interface PortletView
extends `PlaceableView`, `ThemedMarkupBasedView`

"Views" are deep copy immutable objects. Unlike "Definitions" and "Instances" Views cannot be modified by the developer. A Instance or a Definition however can always be obtained from the view. The persistence APIs provides course grain and fine grain getters but only fine grain setters. If you are interested in an object and all its children then retrieve the View, if you are only interested in the immediate object and don't care about its children then retrieve the Definition.

View class for a portlet.

Related Topics

``View``

All Superinterfaces
  `MarkupBasedView`, `PlaceableView`, `Serializable`, `ThemedMarkupBasedView`, `View`

## Field Summary

`public static final `String`` | `CATEGORY_ID_DELIM` String
`public static final short` | `ORIENTATION_BOTTOM` Constant for signifying where the titlebar orientation.
`public static final short` | `ORIENTATION_LEFT` Constant for signifying where the titlebar orientation.
`public static final short` | `ORIENTATION_RIGHT` Constant for signifying where the titlebar orientation.
`public static final short` | `ORIENTATION_TOP` Constant for signifying where the titlebar orientation.

## Method Summary

`public `String`` | `getBackingFile`() Get the path to the backing file for the portlet.
`public int` | `getCacheExpires`() Return the ttl for this portlet.
`public int[]` | `getCategoryIds`() Returns an array of category ids that this portlet is a part of
`public `String`` | `getContentUri`() Getter for the contentUri attribute in the .portlet file.
`public `String`` | `getEditUri`() Get the URI to the content that should be displayed when this portlet enters edit mode.
`public `String`[]` | `getEnabledClientClassifications`() Returns a list of classifications for which the Portlet is enabled, meaning the Portal framework will display it if the current request's client classification is found in this list.
`public `String`` | `getHelpUri`()
`public `String`` | `getInstanceLabel`() Return the unique label for this portlet.
`public `PlacementId`` | `getPlacementId`() Getter for portlet's placement id.
`public `PortletCategoryDefinitionId`[]` | `getPortletCategoryDefinitionIds`() Returns an array of category ids that this portlet is a part of.
`public `PortletDefinition`` | `getPortletDefinition`() Retrieve the associated `PortletDefinition` from this Portlet View.
`public `PortletDefinitionId`` | `getPortletDefinitionId`() Getter for portlet definition id.
`public `String`` | `getPortletFile`() Get the file path to the .portlet definition file.
`public `String`` | `getPortletHandle`() For proxy portlets, returns portletHandle assigned by the producer.
`public `PortletInstance`` | `getPortletInstance`() Retrieve the associated `PortletInstance` from this Portlet View.
`public `PortletInstanceId`` | `getPortletInstanceId`() Getter for portlet instance id.
`public byte[]` | `getPortletState`() For proxy portlets, this method returns binary portletState if allocated by the producer.
`public `Map`` | `getPreferences`() Returns preferences, if any.
`public `String`` | `getProducerHandle`() For proxy portlets, returns the handle of the producer that this portlet is associated with.
`public byte` | `getStateChangeFlag`() For proxy portlets, returns the state change flag.
`public short` | `getTitlebarOrientation`() Returns the titlebars's orientation.
`public `String`` | `getWebAppName`() Return the name of the webapp that this layout is associated with.
`public boolean` | `isDefaultMinimized`() Has this portlet been set to default minimized state.
`public boolean` | `isDeleted`() If isDeleted is true then the portlet has been removed from the file system.
`public boolean` | `isForkable`() Can this portlet run in a separate thread.
`public boolean` | `isForkRender`() Should the framework span this portlet in a separate thread.
`public boolean` | `isRenderCacheable`() Does this portlet support caching.
`public boolean` | `isRequiresUrlTemplates`() For proxy portlets, returns whether the remote portlet requires URL templates or not.
`public boolean` | `isTemplatesStoredInSession`() For proxy portlets, returns whether the remote portlet stores URL templates in session or not.

Methods from interface `com.bea.netuix.application.view.`MarkupBasedView``
``getMarkupView``

Methods from interface `com.bea.netuix.application.view.`PlaceableView``
``getDefinitionLabel`, `getLocalizationResourceView`, `getPlaceableInstance`, `getPlaceholderPosition``

Methods from interface `com.bea.netuix.application.view.`ThemedMarkupBasedView``
``getThemeView``

Methods from interface `com.bea.netuix.application.view.`View``
``getDescription`, `getTitle``

## Field Detail

### CATEGORY_ID_DELIM

    public static final String CATEGORY_ID_DELIM

### ORIENTATION_BOTTOM

    public static final short ORIENTATION_BOTTOM

  Constant for signifying where the titlebar orientation.

### ORIENTATION_LEFT

    public static final short ORIENTATION_LEFT

  Constant for signifying where the titlebar orientation.

### ORIENTATION_RIGHT

    public static final short ORIENTATION_RIGHT

  Constant for signifying where the titlebar orientation.

### ORIENTATION_TOP

    public static final short ORIENTATION_TOP

  Constant for signifying where the titlebar orientation.

## Method Detail

### getBackingFile() Method

    public String getBackingFile()

Get the path to the backing file for the portlet. A backing file is not a file but a Java class example: "com.somecompany.MyBackingFile"

### getCacheExpires() Method

    public int getCacheExpires()

Return the ttl for this portlet.

### getCategoryIds() Method

DEPRECATED use getPortletCategoryDefinitionIds();

    public int[] getCategoryIds()

Returns an array of category ids that this portlet is a part of

### getContentUri() Method

    public String getContentUri()

Getter for the contentUri attribute in the .portlet file.

#### Returns

the relative path from the webapp to the contents of this portlet.

### getEditUri() Method

    public String getEditUri()

Get the URI to the content that should be displayed when this portlet enters edit mode.

#### Returns

return the helpUri as defined in the database column: EDIT_URI otherwise null if none has been defined.

### getEnabledClientClassifications() Method

    public String[] getEnabledClientClassifications()

Returns a list of classifications for which the Portlet is enabled, meaning the Portal framework will display it if the current request's client classification is found in this list. The `String` returned for each classification corresponds to the "description" attribute in client-classifications.xml.

#### Returns

the description `String` for each enabled classification.

### getHelpUri() Method

    public String getHelpUri()

### getInstanceLabel() Method

    public String getInstanceLabel()

Return the unique label for this portlet. This value comes from the instance label on the portletInstance element in the .portal file.

#### Returns

non null instance label for this portlet.

### getPlacementId() Method

    public PlacementId getPlacementId()

Getter for portlet's placement id. The placement id represents a unique placement of a portlet on a page. Pages may contain Portlets just like they may contain Portlets. If this portlet is placed on a Page then this placement id represents the primary key value of the PF_PLACEMENT.PLACEMENT_ID value in the database. Note: this portlet may not be placed on a page as it may be place on another portlet or be the main portlet of the desktop. Also, if this view was obtained directly and not from a parent view object then this value may also be null.

#### Returns

the placement id if this portlet is placed on a page and this PortletView object was retrieved view a higher level view object (example DesktopView.getPortletView()).

### getPortletCategoryDefinitionIds() Method

    public PortletCategoryDefinitionId[] getPortletCategoryDefinitionIds()

Returns an array of category ids that this portlet is a part of.

#### Returns

a non null array of `PortletCategoryDefinitionId`s

### getPortletDefinition() Method

    public PortletDefinition getPortletDefinition()

Retrieve the associated `PortletDefinition` from this Portlet View. Portlet Views are immutable but Instances and Definitions are not. Therefore it is often necessary to retrieve the definition from the view in order to update its values and then in turn call the persistence API.

#### Returns

a non null Portlet Definition.

### getPortletDefinitionId() Method

    public PortletDefinitionId getPortletDefinitionId()

Getter for portlet definition id. The definition id is the primary key value for the portlet definition in the PF_PORTLET_DEFINITION table. A Portlet Definition may have many instance these instance are created when administrators or users customize their portal. A Portlet Definition always has at least one instance namely the "primary" instance.

#### Returns

a non null unique definition id. This value should never be null as views are constructed via the persistence API.

### getPortletFile() Method

    public String getPortletFile()

Get the file path to the .portlet definition file.

#### Returns

a relative path name from the webapp to the .portlet file.

### getPortletHandle() Method

    public String getPortletHandle()

For proxy portlets, returns portletHandle assigned by the producer. For local portlets, returns null.

#### Returns

portletHandle offered by the producer

### getPortletInstance() Method

    public PortletInstance getPortletInstance()

Retrieve the associated `PortletInstance` from this Portlet View. Portlet Views are immutable but Instances and Definitions are not. Therefore it is often necessary to retrieve the instance from the view in order to update its values and then in turn call the persistence API.

#### Returns

a non null Portlet Instance.

### getPortletInstanceId() Method

    public PortletInstanceId getPortletInstanceId()

Getter for portlet instance id. The instance id is the primary key value for the portlet instance in the PF_PORTLET_INSTANCE table. A Portlet Definition may have many instance these instance are created when administrators or users customize their portal. A Portlet Definition always has at least one instance namely the "primary" instance.

#### Returns

a non null unique instance id. This value should never be null as views are constructed via the persistence API.

### getPortletState() Method

    public byte[] getPortletState()

For proxy portlets, this method returns binary portletState if allocated by the producer. Returns null otherwise.

#### Returns

portlet state

### getPreferences() Method

    public Map getPreferences()

Returns preferences, if any.

Note that an empty return map does not indicate that this portlet does not have preferences.

Currently, this method returns preferences only when this `PortletView` is returned via the `PortletTokenizer`. At request time, applications should directly use the `PreferencePersistenceManager` to retrieve portlet preferences.

#### Returns

preferences

Related Topics

``PreferencePersistenceManager``

### getProducerHandle() Method

    public String getProducerHandle()

For proxy portlets, returns the handle of the producer that this portlet is associated with. Returns null for local portlets. The producerHandle is the handle assigned by the user while adding a producer.

#### Returns

producer handle

### getStateChangeFlag() Method

    public byte getStateChangeFlag()

For proxy portlets, returns the state change flag. This flag indicates whether the consumer must clone the remote portlet before creating a successor. The possible values for this flag are READ_ONLY, CLONE_BEFORE_WRITE and READ_WRITE. This flag is not relevant for local portlets.

#### Returns

state change flag

### getTitlebarOrientation() Method

    public short getTitlebarOrientation()

Returns the titlebars's orientation. The orientation is a hint to the portlet and titlebar skeleton to render the titlebar at the top, left, right or bottom of the portlet. Since this is only a hint to the portlet/titlebar skeleton, if the skeleton does not support it, it will have no effect.

#### Returns

`ORIENTATION_TOP, ORIENTATION_LEFT, ORIENTATION_RIGHTT, ORIENTATION_BOTTOM`

### getWebAppName() Method

    public String getWebAppName()

Return the name of the webapp that this layout is associated with. All resources in the portal framework database are scoped to the webapp.

#### Returns

a non null webapp name.

### isDefaultMinimized() Method

    public boolean isDefaultMinimized()

Has this portlet been set to default minimized state. If so this portlet will be minimized upon first request to the page. This value can be set via the isDefaultMinimized attribute in the .portlet file and can be overridden at the instance level in the .portal file.

#### Returns

true if this portlet is to be displayed in a minimized state by default. (default value == false)

### isDeleted() Method

    public boolean isDeleted()

If isDeleted is true then the portlet has been removed from the file system. It was not out right deleted from the database because it is in use by some page somewhere in the system. Either restore the file and this flag will go back to false or remove/replace this layout via the admin tools. If this flag is set on an object the admin tools will display the object with a different icon to denote that it has been removed from the file system

#### Returns

true if this file hase been deleted from the files system.

### isForkable() Method

    public boolean isForkable()

Can this portlet run in a separate thread. The developer marks this portlet as "forkable" and then either the developer or admin can mark the portlet as being forked via the "isForkRender" attribute. Note this asstibute alone does not fork the portlet this only enables it to be forked.

It is recommended that a separate thread ppol be allocated for poforking portlets. This can be done by adding the following to your config.xml file. <ExecuteQueue Name="portalRenderQueue" ThreadCount="5"/>

#### Returns

true if this portlet can be forked.

### isForkRender() Method

    public boolean isForkRender()

Should the framework span this portlet in a separate thread.

#### Returns

true if this portlet to run its preRender pahse and render pahse on a separate thread.

### isRenderCacheable() Method

    public boolean isRenderCacheable()

Does this portlet support caching. This calue is set in the .portlet file by the developer.

#### Returns

true if caching can be turned on for this portlet.

### isRequiresUrlTemplates() Method

    public boolean isRequiresUrlTemplates()

For proxy portlets, returns whether the remote portlet requires URL templates or not. This flag is controlled by the producer, and set at the time of creating a proxy portlet. This flag is not relevant for local portlets.

#### Returns

true if the remote portlet requires URL templates

### isTemplatesStoredInSession() Method

    public boolean isTemplatesStoredInSession()

For proxy portlets, returns whether the remote portlet stores URL templates in session or not. This flag is controlled by the producer, and set at the time of creating a proxy portlet. This flag is not relevant for local portlets.

#### Returns

true if the remote portlet stores URL templates in the session