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

public interface IPortalDefinitionManager

Defines methods to manage a hierarchy of `PortalDefinition`s. Assumes that the hierarchy is a top down tree with each portal having only one parent portal. However, the same `PortalDefinition` can reside under multiple portals.
Imposes only a one level hierarchy of `PortalDefinition`s i.e. all `PortalDefinitions`s have to be first level children of the root `PortalDefinition` and cannot have chidren of their own. Also disallows the root `PortalDefinition` to have any `DesktopDefinition`s categorized under it. "Definitions" can be thought of as objects in the Library. Objects in the library are not associated to any one Desktop. In other words definitions can be placed on zero or more desktops and changes made in the Library (to the definitions) are cascaded down to object on the desktops. If you are only interested in effecting a single desktop then use the `PortalCustomizationManager` and make changes to the "Instances".

All Known Subinterfaces
  `PortalDefinitionManager`

## Method Summary

`public `PortalDefinition`` | `createPortalDefinition`(`CustomizationContext` customizationContext, `PortalDefinition` pd) Creates a persistent version of a `PortalDefinition` from the provided `PortalDefinition`.
`public int` | `deletePortalDefinition`(`CustomizationContext` customizationContext, `PortalPath` portalPath, `String` webapp) Deletes a PortalDefinition.
`public `DefinitionCount`` | `getDefinitionCount`(`CustomizationContext` customizationContext, boolean _public) Return a count of all the definitions in the system.
`public `DefinitionCount`` | `getDefinitionCount`(`CustomizationContext` customizationContext, `String` webapp, boolean _public) Return a count of all the definitions scoped to a webapp.
`public int` | `getDesktopDefinitionCount`(`CustomizationContext` customizationContext, `PortalPath` portalPath, `String` webapp) Returns the number of `DesktopDefinition`s under `portal` `portalPath`.
`public `PortalPath`[]` | `getDesktopDefinitionPortals`(`CustomizationContext` customizationContext, `DesktopPath` desktopPath, `String` webapp) Returns all the `PortalPath`s that a `DesktopDefinition` is a part of.
`public `DesktopDefinition`[]` | `getDesktopDefinitions`(`CustomizationContext` customizationContext, `PortalPath` portalPath, int begin, int end, `String` webapp) Returns `DesktopDefinition`s in the `begin` and `end` range under the portal `portalPath`.
`public `DesktopView`[]` | `getDesktopViews`(`CustomizationContext` customizationContext, `PortalPath` portalPath, int begin, int end, `String` webapp) Returns `DesktopView`s in the `begin` and `end` range under the portal `portalPath`.
`public `PortalDefinition`` | `getPortalDefinition`(`CustomizationContext` customizationContext, `PortalPath` portalPath, `String` webapp) Returns a `PortalDefinition` corresponding to a `PortalPath`.
`public int` | `getPortalDefinitionCount`(`CustomizationContext` customizationContext, `String` webapp) Returns the number of portals.
`public `PortalDefinition`[]` | `getPortalDefinitions`(`CustomizationContext` customizationContext, `PortalPath`[] portalPaths, `String` webapp) Returns an array of `PortalDefinition`s corresponding to an array of `PortalPath`s.
`public `PortalView`` | `getPortalDefinitionView`(`CustomizationContext` customizationContext, `PortalPath` portalPath, `String` webapp) Returns a `PortalView` corresponding to a `PortalPath`.
`public `PortalView`[]` | `getPortalDefinitionViews`(`CustomizationContext` customizationContext, `PortalPath`[] portalPaths, `String` webapp) Returns an array of `PortalView`s corresponding to an array of `PortalPath`s.
`public `PortalPath`[]` | `getPortalPaths`(`CustomizationContext` customizationContext, int begin, int end, `String` webapp) Returns an array of `PortalPath`s in the `begin` and `end` range.
`public `String`[]` | `getPortalWebApps`(`CustomizationContext` customizationContext) Return a set of portal webapps that are `customizable`.
`public void` | `updatePortalDefinition`(`CustomizationContext` customizationContext, `PortalPath` portalPath, `PortalDefinition` newPd) Updates a PortalDefinition based on a new PortalDefinition.

## Method Detail

### createPortalDefinition(CustomizationContext, PortalDefinition) Method

    public PortalDefinition createPortalDefinition(CustomizationContext customizationContext,
                                                   PortalDefinition pd)
         throws RemoteException, NotEntitledException, MissingDataException, DuplicateObjectException

Creates a persistent version of a `PortalDefinition` from the provided `PortalDefinition`.

#### Parameters

customizationContext
  customization information such as prefered locales

pd
  `PortalDefinition`

#### Returns

handle to persisted `PortalDefinition`

#### Exceptions

``RemoteException``
``NotEntitledException``
  if caller does not have permission for this operation
``MissingDataException``
  if data required to create a portal is missing
``DuplicateObjectException``
  if this or another webapp already has a portal with the same partial path

### deletePortalDefinition(CustomizationContext, PortalPath, String) Method

    public int deletePortalDefinition(CustomizationContext customizationContext,
                                      PortalPath portalPath,
                                      String webapp)
         throws RemoteException, NotEntitledException

Deletes a PortalDefinition.

#### Parameters

customizationContext
  customization information such as prefered locales

portalPath
  PortalPath for PortalDefinition to be removed

webapp
  web application these desktop definitions are scoped to.

#### Returns

number of portals deleted

#### Exceptions

``RemoteException``
``NotEntitledException``
  if caller does not have permission for this operation

### getDefinitionCount(CustomizationContext, boolean) Method

    public DefinitionCount getDefinitionCount(CustomizationContext customizationContext,
                                              boolean _public)
         throws RemoteException

Return a count of all the definitions in the system. This method is useful for getting counts of all the definitions in the system

#### Returns

a class containing all the definitions counts

#### Exceptions

``RemoteException``

### getDefinitionCount(CustomizationContext, String, boolean) Method

    public DefinitionCount getDefinitionCount(CustomizationContext customizationContext,
                                              String webapp,
                                              boolean _public)
         throws RemoteException

Return a count of all the definitions scoped to a webapp. This method is useful for getting counts of all the definitions in a particulare webapp.

#### Returns

a class containing all the definitions counts

#### Exceptions

``RemoteException``

### getDesktopDefinitionCount(CustomizationContext, PortalPath, String) Method

    public int getDesktopDefinitionCount(CustomizationContext customizationContext,
                                         PortalPath portalPath,
                                         String webapp)
         throws RemoteException

Returns the number of `DesktopDefinition`s under `portal` `portalPath`.

#### Parameters

customizationContext
  `PortalPath`

portalPath
  web application these desktop definitions are scoped to.

#### Returns

number of `PortletDefinition`s under portal represented by `portalPath`

#### Exceptions

``RemoteException``

### getDesktopDefinitionPortals(CustomizationContext, DesktopPath, String) Method

    public PortalPath[] getDesktopDefinitionPortals(CustomizationContext customizationContext,
                                                  DesktopPath desktopPath,
                                                  String webapp)
         throws RemoteException

Returns all the `PortalPath`s that a `DesktopDefinition` is a part of. Returns an empty array if the latter is noncategorized.

#### Parameters

customizationContext
  `DesktopPath`

desktopPath
  web application these desktop definitions are scoped to.

#### Returns

an array of `PortalPath`s

#### Exceptions

``RemoteException``

### getDesktopDefinitions(CustomizationContext, PortalPath, int, int, String) Method

    public DesktopDefinition[] getDesktopDefinitions(CustomizationContext customizationContext,
                                                   PortalPath portalPath,
                                                   int begin,
                                                   int end,
                                                   String webapp)
         throws RemoteException

Returns `DesktopDefinition`s in the `begin` and `end` range under the portal `portalPath`. If fewer `DesktopDefinition`s than (begin-end) exist then the former number is returned. If no definitions are found an empty array is returned.
Use this method after getting the number of `DesktopDefinition`s.
Implementation has to ensure that repeated calls to this method return `DesktopDefinition`s in a consistent order.

#### Parameters

customizationContext
  customization information such as prefered locales

portalPath
  `PortalPath`

begin
  begin index

end
  end index

webapp
  web application these desktop definitions are scoped to.

#### Returns

array of `DesktopDefinition`s

#### Exceptions

``RemoteException``

### getDesktopViews(CustomizationContext, PortalPath, int, int, String) Method

    public DesktopView[] getDesktopViews(CustomizationContext customizationContext,
                                       PortalPath portalPath,
                                       int begin,
                                       int end,
                                       String webapp)
         throws RemoteException, ObjectNotFoundException

Returns `DesktopView`s in the `begin` and `end` range under the portal `portalPath`. If fewer views than (begin-end) exist then the former number of views is returned. If no views are found an empty array is returned.
Use this method after getting the number of `DesktopDefinition`s.
Implementation has to ensure that repeated calls to this method return `DesktopView`s in a consistent order.

#### Parameters

customizationContext
  customization information such as prefered locales

portalPath
  `PortalPath`

begin
  begin index

end
  end index

webapp
  web application these desktop definitions are scoped to.

#### Returns

array of `DesktopView`s

#### Exceptions

``RemoteException``
``ObjectNotFoundException``

### getPortalDefinition(CustomizationContext, PortalPath, String) Method

    public PortalDefinition getPortalDefinition(CustomizationContext customizationContext,
                                                PortalPath portalPath,
                                                String webapp)
         throws RemoteException, ObjectNotFoundException

Returns a `PortalDefinition` corresponding to a `PortalPath`.

#### Parameters

customizationContext
  customization information such as prefered locales

portalPath
  `PortalPath`

webapp
  web application these desktop definitions are scoped to.

#### Returns

`PortalDefinition`

#### Exceptions

``RemoteException``
``ObjectNotFoundException``
  if no portal is found

### getPortalDefinitionCount(CustomizationContext, String) Method

    public int getPortalDefinitionCount(CustomizationContext customizationContext,
                                        String webapp)
         throws RemoteException

Returns the number of portals.

#### Parameters

customizationContext
  web application these desktop definitions are scoped to.

#### Returns

number of portals

#### Exceptions

``RemoteException``

### getPortalDefinitions(CustomizationContext, PortalPath[], String) Method

    public PortalDefinition[] getPortalDefinitions(CustomizationContext customizationContext,
                                                 PortalPath[] portalPaths,
                                                 String webapp)
         throws RemoteException, ObjectNotFoundException

Returns an array of `PortalDefinition`s corresponding to an array of `PortalPath`s.

#### Parameters

customizationContext
  customization information such as prefered locales

portalPaths
  array of `PortalPath`s. If null return all portal definitions

webapp
  web application these desktop definitions are scoped to.

#### Returns

array of `PortalDefinition`s

#### Exceptions

``RemoteException``
``ObjectNotFoundException``
  if portal for any key does not exist

### getPortalDefinitionView(CustomizationContext, PortalPath, String) Method

    public PortalView getPortalDefinitionView(CustomizationContext customizationContext,
                                              PortalPath portalPath,
                                              String webapp)
         throws RemoteException, ObjectNotFoundException

Returns a `PortalView` corresponding to a `PortalPath`.
NOTE: This method returns a deep copy of a portal definition.

#### Parameters

customizationContext
  customization information such as prefered locales

portalPath
  `PortalPath`

webapp
  web application these desktop definitions are scoped to.

#### Returns

`PortalView`

#### Exceptions

``RemoteException``
``ObjectNotFoundException``
  if no category definition is found

### getPortalDefinitionViews(CustomizationContext, PortalPath[], String) Method

    public PortalView[] getPortalDefinitionViews(CustomizationContext customizationContext,
                                               PortalPath[] portalPaths,
                                               String webapp)
         throws RemoteException, ObjectNotFoundException

Returns an array of `PortalView`s corresponding to an array of `PortalPath`s.

#### Parameters

customizationContext
  customization information such as prefered locales

portalPaths
  array of `PortalPath`s

webapp
  web application these desktop definitions are scoped to.

#### Returns

array of `PortalView`s

#### Exceptions

``RemoteException``
``ObjectNotFoundException``
  if portal for any key does not exist

### getPortalPaths(CustomizationContext, int, int, String) Method

    public PortalPath[] getPortalPaths(CustomizationContext customizationContext,
                                     int begin,
                                     int end,
                                     String webapp)
         throws RemoteException

Returns an array of `PortalPath`s in the `begin` and `end` range. If fewer portals than (begin-end) exist then the former number of portals is returned. If no definitions are found an empty array is returned.
Implementation has to ensure that repeated calls to this method return `PortalPath`s in a consistent order.

#### Parameters

customizationContext
  customization information such as prefered locales

begin
  begin index

end
  end index

webapp
  web application these desktop definitions are scoped to.

#### Returns

an array of `PortalPath`s

#### Exceptions

``RemoteException``

### getPortalWebApps(CustomizationContext) Method

    public String[] getPortalWebApps(CustomizationContext customizationContext)
         throws RemoteException

Return a set of portal webapps that are `customizable`. Customizable webapps are webapps with `customization` element set to true in the netuix-config.xml file, and have at least on of the following: .shell files.

#### Returns

an array of webapp names.

#### Exceptions

``RemoteException``

### updatePortalDefinition(CustomizationContext, PortalPath, PortalDefinition) Method

    public void updatePortalDefinition(CustomizationContext customizationContext,
                                       PortalPath portalPath,
                                       PortalDefinition newPd)
         throws RemoteException, ObjectNotFoundException, ObjectInUseException, NotEntitledException, MissingDataException

Updates a PortalDefinition based on a new PortalDefinition.

#### Parameters

customizationContext
  customization information such as prefered locales

portalPath
  PortalPath to PortalDefinition to be updated

newPd
  new PortalDefinition

#### Exceptions

``RemoteException``
``ObjectNotFoundException``
  if portal does not exist
``ObjectInUseException``
``NotEntitledException``
  if caller does not have permission for this operation
``MissingDataException``
  if data required to update a portal is missing