Interface NavigationService

All Known Subinterfaces:
NavigationService

@Deprecated(forRemoval=true, since="6.5") public interface NavigationService
Deprecated, for removal: This API element is subject to removal in a future version.
user NavigationService instead since the new one helps on layer separations and naming

The navigation service takes care of managing the various portal navigations and their nodes. In order to manage an efficient loading of the nodes, a Scope is used to describe the set of nodes that should be retrieved when a loading operation is performed.

The node operations does not provide a model per se, but instead use the NodeModel interface to plug an API model. Various node operations are quite complex and any API in front of this service would need to perform a manual, error prone and tedious synchronization. Instead the model interface allows the navigation service to operate directly on an existing model.

Version:
$Revision$
Author:
Julien Viet
  • Method Details

    • loadNavigation

      Deprecated, for removal: This API element is subject to removal in a future version.
      Find and returns a navigation, if no such site exist, null is returned instead.
      Parameters:
      key - the navigation key
      Returns:
      the matching navigation
      Throws:
      NullPointerException - if the key is null
      NavigationServiceException - anything that would prevent the operation to succeed
    • saveNavigation

      Deprecated, for removal: This API element is subject to removal in a future version.
      Create, update a navigation. When the navigation state is not null, the navigation will be created or updated depending on whether or not the navigation already exists.
      Parameters:
      navigation - the navigation
      Throws:
      NullPointerException - if the key is null
      IllegalArgumentException - if the navigation is already destroyed
      NavigationServiceException - anything that would prevent the operation to succeed
    • destroyNavigation

      Deprecated, for removal: This API element is subject to removal in a future version.
      Destroy a navigation.
      Parameters:
      navigation - the navigation
      Returns:
      true if the navigation was destroyed
      Throws:
      NullPointerException - if the navigation is null
      IllegalArgumentException - if the navigation is destroyed
      NavigationServiceException - anything that would prevent the operation to succeed
    • loadNode

      <N> NodeContext<N> loadNode(NodeModel<N> model, NavigationContext navigation, Scope scope, NodeChangeListener<NodeContext<N>> listener) throws NullPointerException, NavigationServiceException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Load a navigation node from a specified navigation. The returned context will be the root node of the navigation.
      Type Parameters:
      N - the node generic type
      Parameters:
      model - the node model
      navigation - the navigation
      scope - the scope
      listener - the optional listener
      Returns:
      the loaded node
      Throws:
      NullPointerException - if any argument is null
      NavigationServiceException - anything that would prevent the operation to succeed
    • loadNodeById

      default <N> NodeContext<N> loadNodeById(NodeModel<N> model, String nodeId, Scope scope, NodeChangeListener<NodeContext<N>> listener)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Load a navigation node from a specified navigation by its id
      Type Parameters:
      N - the node generic type
      Parameters:
      model - the node model
      nodeId - the node id
      scope - the scope
      listener - the optional listener
      Returns:
      the loaded node
    • saveNode

      <N> void saveNode(NodeContext<N> context, NodeChangeListener<NodeContext<N>> listener) throws NavigationServiceException
      Deprecated, for removal: This API element is subject to removal in a future version.

      Save the specified context state to the persistent storage. The operation takes the pending changes done to the tree and attempt to save them to the persistent storage. When conflicts happens, a merge will be attempted however it can lead to a failure.

      Parameters:
      context - the context to save
      listener - the optional listener
      Throws:
      NavigationServiceException - anything that would prevent the operation to succeed
    • updateNode

      <N> void updateNode(NodeContext<N> context, Scope scope, NodeChangeListener<NodeContext<N>> listener) throws IllegalArgumentException, NavigationServiceException
      Deprecated, for removal: This API element is subject to removal in a future version.

      Update the specified context argument with the most recent state. The update operation will affect the entire tree even if the context argument is not the root of the tree. The context argument determines the root from which the scope argument applies to.

      The update operation compares the actual tree and the most recent version of the same tree. When the scope argument is not null, it will be used to augment the tree with new nodes. During the operation, any modification done to the tree wil be reported as a change to the optional listener argument.

      The update operates recursively by doing a comparison of the node intrisic state (name or state) and its structural state (the children). The comparison between the children of two nodes is done thanks to the Longest Common Subsequence algorithm to minimize the number of changes to perform. The operation assumes that no changes have been performed on the actual tree.

      Type Parameters:
      N - the node generic type
      Parameters:
      context - the context to update
      scope - the optional scope
      listener - the optional node change listener
      Throws:
      NavigationServiceException - anything that would prevent the operation to succeed
      IllegalArgumentException - if the context argument has pending changes
    • rebaseNode

      <N> void rebaseNode(NodeContext<N> context, Scope scope, NodeChangeListener<NodeContext<N>> listener) throws NavigationServiceException
      Deprecated, for removal: This API element is subject to removal in a future version.

      Rebase the specified context argument with the most recent state. The rebase operation will affect the entire tree even if the context argument is not the root of the tree. The context argument determines the root from which the scope argument applies to.

      The rebase operation compares the actual tree and the most recent version of the same tree. When the scope argument is not null, it will be used to augment the tree with new nodes. During the operation, any modification done to the tree wil be reported as a change to the optional listener argument.

      The rebase operates in a similar way of the update operation, however it assumes that it can have pending changes done to the tree (i.e changes that have not been saved). Actually a rebase operation with no changes will do the same than an update operation. The rebase operation attempts to bring the most recent changes to the tree, by doing a rebase of the pending operations on the actual tree. When conflicting changes exist, a merge will be attempted, however it could fail and lead to a non resolvable situation.

      Type Parameters:
      N - the node generic type
      Parameters:
      context - the context to rebase
      scope - the optional scope
      listener - the option node change listener @throws NullPointerException if the context argument is null
      Throws:
      NavigationServiceException - anything that would prevent the operation to succeed