# com.bea.netuix.application.manager
IPortletInstanceManager Interface

public interface IPortletInstanceManager

This is the primary interface for performing persistent store operations on `PortletInstances`. In general this interface provides coarse grain getters and fine grain setters.

It is important to note that all methods on this interface are fully internationalized and entitled. All `titles` and `descriptions` on the objects returned by these methods are internationalized to the preferred locale. Also, all methods are entitled, meaning if the caller does not have the required credentials the method may return a subset of the actual list or be unable to perform the specified function.

Most "Instances" can be thought of as objects tied to a desktop, An Admin has instances derived from the Library Definition, and the "end user" has instances derived from the admin instance. Changes made via these APIs require a DesktopDefinitionId and the changes are scoped to that desktop. In other words changes made here do not affect the Library or other Desktops. If the "visitorMode" on the customization Context is set the false (default) and the user executing the call is in the "Admin" or "PortalSystemAdministrator" role then these changes take affect at the admin level, and affect ALL users. If the visitorMode is false then the changes only affect the calling user.

Related Topics

``CustomizationContext.setVisitorMode(boolean)``

All Known Subinterfaces
  `PortalCustomizationManager`

## Method Summary

`public `PortletInstanceId`` | `createSuccessor`(`CustomizationContext` customizationContext, `DesktopDefinitionId` desktopDefinitionId, `PortletInstanceId` portletInstanceId) Creates a successor instance and returns its instance ID.
`public `PortletInstanceId`` | `createSuccessor`(`CustomizationContext` customizationContext, `DesktopDefinitionId` desktopDefinitionId, `PortletInstanceId` portletInstanceId, boolean forceCreateSuccessor) Creates a successor instance and returns its instance ID.
`public void` | `deletePortletInstance`(`CustomizationContext` customizationContext, `PortletInstanceId` portletInstanceId) Deletes a portlet instance.
`public `PortletInstance`` | `getPortletInstance`(`CustomizationContext` customizationContext, `PortletInstanceId` portletInstanceId) Getter for returning a single `PortletInstance`.
`public `PortletView`` | `getPortletView`(`CustomizationContext` customizationContext, `PortletInstanceId` portletInstanceId) Getter for returning an immutable deep copy of a `PortletView`.
`public `PortletInstanceId`` | `getPredecessor`(`CustomizationContext` customizationContext, `PortletInstanceId` portletInstanceId) Returns the instance ID that the given instance is based on.
`public `PortletInstanceId`[]` | `getSuccessors`(`CustomizationContext` customizationContext, `PortletInstanceId` portletInstanceId) Returns a list of successor instances.
`public `PortletInstance`` | `updatePortletInstance`(`CustomizationContext` customizationContext, `DesktopDefinitionId` desktopDefinitionId, `PortletInstance` portletInstance) Update the portlet instance with the new data.
`public `PortletInstance`` | `updatePortletInstance`(`CustomizationContext` customizationContext, `PortletInstance` portletInstance) Update the portlet instance outside the context of a desktop (in a Library).

## Method Detail

### createSuccessor(CustomizationContext, DesktopDefinitionId, PortletInstanceId) Method

    public PortletInstanceId createSuccessor(CustomizationContext customizationContext,
                                             DesktopDefinitionId desktopDefinitionId,
                                             PortletInstanceId portletInstanceId)
         throws RemoteException, ObjectNotFoundException, NotEntitledException

Creates a successor instance and returns its instance ID. Returns the same instance ID if there is no need to create a successor instance.

#### Parameters

customizationContext
  the desktop context to which this chage applies.

desktopDefinitionId
  the portlet instance ID

#### Returns

successor instance ID

#### Exceptions

``RemoteException``
``ObjectNotFoundException``
  if the PortletInstanceId does not exist.
``NotEntitledException``

### createSuccessor(CustomizationContext, DesktopDefinitionId, PortletInstanceId, boolean) Method

    public PortletInstanceId createSuccessor(CustomizationContext customizationContext,
                                             DesktopDefinitionId desktopDefinitionId,
                                             PortletInstanceId portletInstanceId,
                                             boolean forceCreateSuccessor)
         throws RemoteException, ObjectNotFoundException, NotEntitledException

Creates a successor instance and returns its instance ID. Returns the same instance ID if there is no need to create a successor instance.

#### Parameters

customizationContext
  the desktop context to which this chage applies.

desktopDefinitionId
  the portlet instance ID

portletInstanceId
  if `true` - forces the underlying store to create a new successor

#### Returns

successor instance ID

#### Exceptions

``RemoteException``
``ObjectNotFoundException``
  if the PortletInstanceId does not exist.
``NotEntitledException``

### deletePortletInstance(CustomizationContext, PortletInstanceId) Method

    public void deletePortletInstance(CustomizationContext customizationContext,
                                      PortletInstanceId portletInstanceId)
         throws RemoteException, NotEntitledException

Deletes a portlet instance. Note that instances associated with other aggregating entities such as pages should not be deleted directly using this method.

#### Exceptions

``RemoteException``
``NotEntitledException``
  if the caller is entitled to delete the instance

### getPortletInstance(CustomizationContext, PortletInstanceId) Method

    public PortletInstance getPortletInstance(CustomizationContext customizationContext,
                                              PortletInstanceId portletInstanceId)
         throws RemoteException

Getter for returning a single `PortletInstance`.

#### Parameters

customizationContext
  the preferred language, country and variant to which the titles and descriptions are returned.

#### Returns

an fully populated PortletInstance object.

#### Exceptions

``RemoteException``

Related Topics

``PortletDefinition``

### getPortletView(CustomizationContext, PortletInstanceId) Method

    public PortletView getPortletView(CustomizationContext customizationContext,
                                      PortletInstanceId portletInstanceId)
         throws RemoteException

Getter for returning an immutable deep copy of a `PortletView`. The `PortletView` object, unlike the `PortletDefinition` or the `PortletInstance` objects contains a full set of references to all child portlets, portlets and so on. The `PortletView` object however is immutable.

#### Parameters

customizationContext
  customization information such as Locales and DesktopInstaceId

portletInstanceId
  the unique portletInstanceId.

#### Returns

an immutable deep copy PortletView object if one exist, otherwise null.

#### Exceptions

``RemoteException``

### getPredecessor(CustomizationContext, PortletInstanceId) Method

    public PortletInstanceId getPredecessor(CustomizationContext customizationContext,
                                            PortletInstanceId portletInstanceId)
         throws RemoteException, ObjectNotFoundException

Returns the instance ID that the given instance is based on. Returns `null` if there is no predecessor

#### Parameters

customizationContext
  the portlet instance ID

#### Returns

successor instance ID

#### Exceptions

``RemoteException``
``ObjectNotFoundException``
  if the PortletInstanceId does not exist.

### getSuccessors(CustomizationContext, PortletInstanceId) Method

    public PortletInstanceId[] getSuccessors(CustomizationContext customizationContext,
                                           PortletInstanceId portletInstanceId)
         throws RemoteException, ObjectNotFoundException

Returns a list of successor instances. Returns an empty list if there are no successors.

#### Parameters

customizationContext
  the portlet instance ID

#### Returns

array of successor instance IDs

#### Exceptions

``RemoteException``
``ObjectNotFoundException``
  if the PortletInstanceId does not exist.

### updatePortletInstance(CustomizationContext, DesktopDefinitionId, PortletInstance) Method

    public PortletInstance updatePortletInstance(CustomizationContext customizationContext,
                                                 DesktopDefinitionId desktopDefinitionId,
                                                 PortletInstance portletInstance)
         throws RemoteException, ObjectNotFoundException, NotEntitledException

Update the portlet instance with the new data. If the portlet instance is the primary portlet instance then a new instance will be created specifically for this user or admin.

For an admin editing a portlet outside the context of a desktop (in a Library) you should use `updatePortletInstance(PortletInstance)`

.

#### Parameters

customizationContext
  the desktop context this instance is associated with.

desktopDefinitionId
  the portlet instance containing the new data

#### Returns

the new updated portlet instance, with possible a new portletInstanceId

#### Exceptions

``RemoteException``
``ObjectNotFoundException``
  if the PortletInstanceId in the PortletInstance, or desktopInstanceId is bogus.
``NotEntitledException``

Related Topics

``IPortletInstanceManager.updatePortletInstance(CustomizationContext, PortletInstance)``

### updatePortletInstance(CustomizationContext, PortletInstance) Method

    public PortletInstance updatePortletInstance(CustomizationContext customizationContext,
                                                 PortletInstance portletInstance)
         throws RemoteException, ObjectNotFoundException, NotEntitledException

Update the portlet instance outside the context of a desktop (in a Library). For Admins editing the primary instance (not placed on any page) use the PortletDefinitionManager.updatePortletDefinition().

#### Parameters

customizationContext
  the portlet instance containing the new data

#### Returns

the new updated portlet instance.

#### Exceptions

``RemoteException``
``ObjectNotFoundException``
  if the PortletInstanceId in the PortletInstance is bogus.
``NotEntitledException``