org.gatein.mop.api.content
Interface Customization<S>

Type Parameters:
S - the content state type parameter

public interface Customization<S>

An entity representing the customization of a content.

Version:
$Revision$
Author:
Julien Viet

Method Summary
 Customization<S> customize(CustomizationMode mode, Collection<CustomizationContext> contexts)
          Customize the state with respect to the provided customization context.
 void destroy()
          Destroys the customization.
 String getContentId()
          Returns the content id this customization refers to.
 Set<CustomizationContext> getContexts()
          Returns the contexts that are associated with that customization.
 Customization<S> getCustomization(Set<CustomizationContext> contexts)
          Returns the stateful content associated with the specified customization contexts or null if no customization can be created for the desired contexts.
 String getName()
          Returns the customization name or null if it does not have any name.
 S getState()
          Returns the customization state.
 ContentType<S> getType()
          Returns the content type this customization refers to.
 void setState(S state)
          Updates the customization state.
 

Method Detail

getName

String getName()
Returns the customization name or null if it does not have any name.

Returns:
the customization name

getContentId

String getContentId()
Returns the content id this customization refers to.

Returns:
the content id

getType

ContentType<S> getType()
Returns the content type this customization refers to.

Returns:
The content type

getContexts

Set<CustomizationContext> getContexts()
Returns the contexts that are associated with that customization. Note that the set returned maintains the hierararchy order of the set from the most specific to the least specific.

Returns:
the contexts

getCustomization

Customization<S> getCustomization(Set<CustomizationContext> contexts)

Returns the stateful content associated with the specified customization contexts or null if no customization can be created for the desired contexts. The returned customization may not honour all provided the customization contexts.

Calling the method with an empty set returns the default customization of the content or null if none is available.

Calling the method with a set of contexts that is not consistent will trigger an IllegalArgumentException to be thrown. For instance two workspace contexts specifying different pages cannot lead to determine a final context.

Parameters:
contexts - the customization contexts
Returns:
the content state

customize

Customization<S> customize(CustomizationMode mode,
                           Collection<CustomizationContext> contexts)
Customize the state with respect to the provided customization context.

Parameters:
mode - the customization mode
contexts - the customization context
Returns:
the customization

getState

S getState()
Returns the customization state.

Returns:
the state

setState

void setState(S state)
Updates the customization state.

Parameters:
state - the customization state

destroy

void destroy()
Destroys the customization.



Copyright © 2009 eXo Platform SAS. All Rights Reserved.