nl.gx.webmanager.services.contentapi
Interface ElementManagementService


public interface ElementManagementService

This class offers APIs to access elements on Pages, Page sections, Page models and Media items.

Author:
ivol

Method Summary
 Element copyElement(Element element, MediaItemArticleVersion target)
          Copies an element to the target media item version.
 Element copyElement(Element element, PageModel target)
          Copies an element to the target page model.
 Element copyElement(Element element, PageVersion target)
          Copies an element to the target page version.
 Element createAndInsertElement(MediaItemVersion mediaItemVersion, java.lang.Class<? extends Element> elementType)
          Creates a new (empty) element and add it as last element to the given MediaItemVersion.
 Element createAndInsertElement(MediaItemVersion mediaItemVersion, java.lang.Class<? extends Element> elementType, int position)
          Creates a new (empty) element and add it at the specified location to the given MediaItemVersion.
 Element createAndInsertElement(PageModel pageModel, java.lang.Class<? extends Element> elementType)
          Creates a new (empty) element and add it as last element to the given PageModel.
 Element createAndInsertElement(PageModel pageModel, java.lang.Class<? extends Element> elementType, int position)
          Creates a new (empty) element and add it at the specified location to the given PageModel.
 Element createAndInsertElement(PageVersion pageVersion, java.lang.Class<? extends Element> elementType)
          Creates a new (empty) element and add it as last element to the given PageVersion.
 Element createAndInsertElement(PageVersion pageVersion, java.lang.Class<? extends Element> elementType, int position)
          Creates a new (empty) element and add it at the specified location to the given PageVersion.
 boolean deleteElement(Element element)
          Deletes the element, including all references to the element, with the given UUID.
 

Method Detail

createAndInsertElement

Element createAndInsertElement(PageVersion pageVersion,
                               java.lang.Class<? extends Element> elementType)
Creates a new (empty) element and add it as last element to the given PageVersion.

Parameters:
pageVersion - The page version to which the new element must be added
elementType - The interface of the element to create
Returns:
The element that has been created and added to the page version

createAndInsertElement

Element createAndInsertElement(MediaItemVersion mediaItemVersion,
                               java.lang.Class<? extends Element> elementType)
Creates a new (empty) element and add it as last element to the given MediaItemVersion.

Parameters:
mediaItemVersion - The media item version to which the new element must be added
elementType - The interface of the element to create
Returns:
The element that has been created and added to the page version

createAndInsertElement

Element createAndInsertElement(PageModel pageModel,
                               java.lang.Class<? extends Element> elementType)
Creates a new (empty) element and add it as last element to the given PageModel.

Parameters:
pageModel - The page model to which the new element must be added
elementType - The interface of the element to create
Returns:
The element that has been created and added to the page version

createAndInsertElement

Element createAndInsertElement(PageVersion pageVersion,
                               java.lang.Class<? extends Element> elementType,
                               int position)
Creates a new (empty) element and add it at the specified location to the given PageVersion. If the position is invalid this method throws an IllegalArgumentException

Parameters:
pageVersion - The page version to which the new element must be added
elementType - The interface of the element to create
position - The position at which the element must be inserted, first position is 0.
Returns:
The element that has been created and inserted into the page version

createAndInsertElement

Element createAndInsertElement(MediaItemVersion mediaItemVersion,
                               java.lang.Class<? extends Element> elementType,
                               int position)
Creates a new (empty) element and add it at the specified location to the given MediaItemVersion. If the position is invalid this method throws an IllegalArgumentException

Parameters:
mediaItemVersion - The media item version to which the new element must be added
elementType - The interface of the element to create
position - The position at which the element must be inserted, first position is 0.
Returns:
The element that has been created and inserted into the page version

createAndInsertElement

Element createAndInsertElement(PageModel pageModel,
                               java.lang.Class<? extends Element> elementType,
                               int position)
Creates a new (empty) element and add it at the specified location to the given PageModel. If the position is invalid this method throws an IllegalArgumentException

Parameters:
pageModel - The page model to which the new element must be added
elementType - The interface of the element to create
position - The position at which the element must be inserted, first position is 0.
Returns:
The element that has been created and inserted into the page version

deleteElement

boolean deleteElement(Element element)
Deletes the element, including all references to the element, with the given UUID.

Parameters:
element - the element to delete
Returns:
true if the element was removed successfully, false otherwise

copyElement

Element copyElement(Element element,
                    PageVersion target)
                    throws NoAuthorizationException
Copies an element to the target page version.

The user requires CREATE permission for the element's element type. Next to that the user needs UPDATE permission for the target page version.

Performed steps:

Parameters:
element - The element that should be copied.
target - The target page version to which the element is copied.
Returns:
The copied element.
Throws:
NoAuthorizationException - If user has no rights to copy the element.

copyElement

Element copyElement(Element element,
                    MediaItemArticleVersion target)
                    throws NoAuthorizationException
Copies an element to the target media item version.

The user requires CREATE permission for the element's element type. Next to that the user needs the UPDATE permission for media items.

Performed steps:

Parameters:
element - The element that should be copied.
target - The target media item version to which the element is copied.
Returns:
The copied element.
Throws:
NoAuthorizationException - If user has no rights to copy the element.

copyElement

Element copyElement(Element element,
                    PageModel target)
                    throws NoAuthorizationException
Copies an element to the target page model.

The user requires CREATE permission for the element's element type. Next to that the user needs the UPDATE permission for page models.

Performed steps:

Parameters:
element - The element that should be copied.
target - The target page model that the copied element is added to.
Returns:
The copied element.
Throws:
NoAuthorizationException - If user has no rights to copy the element.


Copyright © 2007-2011 GX Software BV. All Rights Reserved.