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

public interface IMenuDefinitionManager

This is the primary interface for performing persistent store operations on `MenuDefinitions`. 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.

"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
  `BookDefinitionManager`

## Method Summary

`public `MenuDefinition`` | `createMenuDefinition`(`CustomizationContext` customizationContext, `MenuDefinition` menuDefinition) Creates a new MenuView Definition with its placeholders.
`public void` | `deleteMenuDefinition`(`CustomizationContext` customizationContext, `MenuDefinitionId` menuDefinitionId) Delete a menu definition.
`public void` | `deleteMenuDefinitionWithReplacement`(`CustomizationContext` customizationContext, `MenuDefinitionId` deleteMenuDefinitionId, `MenuDefinitionId` replacementMenuDefinitionId) Delete a menu definition and replace any uses of that menu with a replacement menu.
`public `MenuDefinition`` | `getMenuDefinition`(`CustomizationContext` customizationContext, `MenuDefinitionId` menuDefinitionId) Getter for returning a single `MenuDefinition` object given a supplied menu definition identifier.
`public `MenuDefinition`` | `getMenuDefinitionFromFile`(`CustomizationContext` customizationContext, `String` menuFileName, `String` webAppName) Getter for returning a single `MenuDefinition` object given a supplied menu definition identifier.
`public `MenuDefinitionId`` | `getMenuDefinitionId`(`CustomizationContext` customizationContext, `String` markupName, `String` webAppName) Getter for returning a single `MenuDefinitionId` object given a supplied menu markup name.
`public `MenuDefinition`[]` | `getMenuDefinitions`(`CustomizationContext` customizationContext, `String` webapp) Getter for returning a list of all `MenuDefinitions` scoped to the supplied webapp.
`public `MenuDefinition`[]` | `getMenuDefinitions`(`CustomizationContext` customizationContext, `String` webapp, `MenuDefinitionId` firstMenuDefinitionId, int limit) Returns `MenuDefinition`s in `definitionId` order (create order).
`public `MenuView`` | `getMenuView`(`CustomizationContext` customizationContext, `MenuDefinitionId` menuDefinitionId) Getter for returning an immutable deep copy of a `MenuView`.
`public void` | `updateMenuDefinition`(`CustomizationContext` customizationContext, `MenuDefinition` menuDefinition) Update the menu definition with the new data.

## Method Detail

### createMenuDefinition(CustomizationContext, MenuDefinition) Method

    public MenuDefinition createMenuDefinition(CustomizationContext customizationContext,
                                               MenuDefinition menuDefinition)
         throws RemoteException, MissingDataException, NotEntitledException

Creates a new MenuView Definition with its placeholders.

#### Parameters

customizationContext
  customization information such as preferred locales and desktopInstanceId

menuDefinition
  the menu data and associated placeholders

#### Returns

a fully populated MenuDefinition

#### Exceptions

``RemoteException``
``MissingDataException``
  the menuDefiniiton supplied as an argument is missing some vital data.
``NotEntitledException``
  the caller is not entitled to create a new menu.

### deleteMenuDefinition(CustomizationContext, MenuDefinitionId) Method

    public void deleteMenuDefinition(CustomizationContext customizationContext,
                                     MenuDefinitionId menuDefinitionId)
         throws RemoteException, ObjectNotFoundException, ObjectInUseException, NotEntitledException

Delete a menu definition.

#### Parameters

customizationContext
  customization information such as preferred locales and desktopInstanceId

menuDefinitionId
  the id of the menu definition to delete.

#### Exceptions

``RemoteException``
``ObjectNotFoundException``
  if the menuDefinitionId is bogus
``ObjectInUseException``
  if page instances are currently using this menu
``NotEntitledException``
  the caller is not entitled to perform this operation.

Related Topics

``IMenuDefinitionManager.deleteMenuDefinitionWithReplacement(CustomizationContext, MenuDefinitionId, MenuDefinitionId)``

### deleteMenuDefinitionWithReplacement(CustomizationContext, MenuDefinitionId, MenuDefinitionId) Method

    public void deleteMenuDefinitionWithReplacement(CustomizationContext customizationContext,
                                                    MenuDefinitionId deleteMenuDefinitionId,
                                                    MenuDefinitionId replacementMenuDefinitionId)
         throws RemoteException, ObjectNotFoundException, NotEntitledException

Delete a menu definition and replace any uses of that menu with a replacement menu. This method is useful for deleting a menu that is in use by book instances and not having to delete those book instances.

#### Parameters

customizationContext
  customization information such as preferred locales and desktopInstanceId

deleteMenuDefinitionId
  the id of the menu definition to delete.

replacementMenuDefinitionId
  the id of the replacement menu

#### Exceptions

``RemoteException``
``ObjectNotFoundException``
  if either of the menuDefinitionIds are bogus
``NotEntitledException``
  the caller is not entitled to perform this operation.

Related Topics

``IMenuDefinitionManager.deleteMenuDefinition(CustomizationContext, MenuDefinitionId)``

### getMenuDefinition(CustomizationContext, MenuDefinitionId) Method

    public MenuDefinition getMenuDefinition(CustomizationContext customizationContext,
                                            MenuDefinitionId menuDefinitionId)
         throws RemoteException

Getter for returning a single `MenuDefinition` object given a supplied menu definition identifier.

#### Parameters

customizationContext
  customization information such as preferred locales and desktopInstanceId

menuDefinitionId
  the unique menu definition identifier.

#### Returns

a `MenuDefinition` object fully populated and internationalized, otherwise, `null>/code> if the object does not exist.`

#### Exceptions

``RemoteException``

Related Topics

``MenuDefinition``

### getMenuDefinitionFromFile(CustomizationContext, String, String) Method

    public MenuDefinition getMenuDefinitionFromFile(CustomizationContext customizationContext,
                                                    String menuFileName,
                                                    String webAppName)
         throws RemoteException

Getter for returning a single `MenuDefinition` object given a supplied menu definition identifier.

#### Parameters

customizationContext
  customization information such as preferred locales and desktopInstanceId

menuFileName
  the name of the .menu file

webAppName
  the name of the webapp as defined in the config.xml

#### Returns

a `MenuDefinition` object fully populated and internationalized, otherwise, `null>/code> if the object does not exist.`

#### Exceptions

``RemoteException``

Related Topics

``MenuDefinition``

### getMenuDefinitionId(CustomizationContext, String, String) Method

    public MenuDefinitionId getMenuDefinitionId(CustomizationContext customizationContext,
                                                String markupName,
                                                String webAppName)
         throws RemoteException

Getter for returning a single `MenuDefinitionId` object given a supplied menu markup name.

#### Parameters

customizationContext
  customization information such as preferred locales and desktopInstanceId

markupName
  the markup name attribute supplied on the tag,

webAppName
  as defined in the config.xml

#### Returns

menuDefinitionId the unique menu definition identifier or null if none exist.

#### Exceptions

``RemoteException``

### getMenuDefinitions(CustomizationContext, String) Method

    public MenuDefinition[] getMenuDefinitions(CustomizationContext customizationContext,
                                             String webapp)
         throws RemoteException

Getter for returning a list of all `MenuDefinitions` scoped to the supplied webapp.

#### Parameters

customizationContext
  customization information such as preferred locales and desktopInstanceId

webapp
  the web application these menu definitions are scoped to.

#### Returns

an array of `MenuDefinition` objects if they exist, otherwise, an empty array.

#### Exceptions

``RemoteException``

Related Topics

``MenuDefinition``

### getMenuDefinitions(CustomizationContext, String, MenuDefinitionId, int) Method

    public MenuDefinition[] getMenuDefinitions(CustomizationContext customizationContext,
                                             String webapp,
                                             MenuDefinitionId firstMenuDefinitionId,
                                             int limit)
         throws RemoteException

Returns `MenuDefinition`s in `definitionId` order (create order). Starting with the supplied definitionId and limiting the result set to size `limit` If fewer `MenuDefinition`s exist than `limit`, then a smaller result set will be returned. If no definitions are found an empty array is returned. To start at the beginning of the list specify `null` as the `menuDefinitionId`. To retrieve from the end of the list and back specify `null` as the `menuDefinitionId` and a negative `limit`. To retrieve all the menuDefinitions in the database supply a limit of 0. Implementation has to ensure that repeated calls to this method return `MenuDefinition`s in a consistent order.

#### Parameters

customizationContext
  customization information such as preferred locales.

webapp
  the web application these menu definitions are scoped to.

firstMenuDefinitionId
  optional parameter to indicate where the list should start.

limit
  the maximum result set size. Note the limit may be negative indicating a reverse sort order. For all the records specify a limit of zero. Note: some elements may be pruned because of entitlements.

#### Returns

array of `MenuDefinition`s no greater than `limit` in size.

#### Exceptions

``RemoteException``

### getMenuView(CustomizationContext, MenuDefinitionId) Method

    public MenuView getMenuView(CustomizationContext customizationContext,
                                MenuDefinitionId menuDefinitionId)
         throws RemoteException

Getter for returning an immutable deep copy of a `MenuView`. The `MenuView` object, unlike the `MenuDefinition` or the `MenuInstance` objects contains a full set of references to all child pages, menus and so on. The `MenuView` object however is immutable.

#### Parameters

customizationContext
  customization information such as preferred locales and desktopInstanceId

menuDefinitionId
  the unique menuDefinitionId.

#### Returns

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

#### Exceptions

``RemoteException``

### updateMenuDefinition(CustomizationContext, MenuDefinition) Method

    public void updateMenuDefinition(CustomizationContext customizationContext,
                                     MenuDefinition menuDefinition)
         throws RemoteException, ObjectNotFoundException, NotEntitledException

Update the menu definition with the new data.

#### Parameters

customizationContext
  customization information such as preferred locales and desktopInstanceId

menuDefinition
  the menu definition containing the new data

#### Exceptions

``RemoteException``
``ObjectNotFoundException``
  if the LocalizationIntersectionId in the LocalizationResource is bogus.
``NotEntitledException``