pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.site
Class View

java.lang.Object
  extended by org.torweg.pulse.util.entity.AbstractBasicEntity
      extended by org.torweg.pulse.util.entity.AbstractNamedEntity
          extended by org.torweg.pulse.util.entity.AbstractNamableEntity
              extended by org.torweg.pulse.site.View
All Implemented Interfaces:
java.io.Serializable, JDOMable, INameable, INamed

@Entity
public final class View
extends AbstractNamableEntity
implements INamed, JDOMable

is an abstract base class for Views.

A View is used to assign a specific presentation of a Content to a specific SitemapNode in the Sitemap.

Version:
$Revision: 1499 $
Author:
Thomas Weber, Daniel Dietz
See Also:
SitemapNode, Content, Serialized Form

Constructor Summary
View()
          constructs a new blank View.
View(Content c)
          builds a new View with the given Content.
 
Method Summary
 View createCopy()
          returns a copy of the View.
 View createCopy(java.util.Locale l)
          creates a copy of the View in the given locale.
 org.jdom.Element deserializeToJDOM()
          this will deserialize the state of the JDOMable as a JDOM Element.
 Command getCommand(Command currentCommand)
          Builds a Command producing the desired View for the Content.
 CommandBuilder getCommandBuilder()
          returns a copy of the CommandBuilder of the View.
 Content getContent()
           
 java.util.Set<Parameter> getParameters()
          returns the Parameters of the CommandBuilder.
 SitemapNode getSitemapNode()
          Returns the SitemapNode.
 void removeParameter(Parameter parameter)
          removes a Parameter from the CommandBuilder.
 void setCommandBuilder(CommandBuilder builder)
          sets a CommandBuilder, which describes all fields which need modification to create the right Command for getCommand(Command).
 void setContent(Content c)
           
 void setParameters(java.util.Set<Parameter> newParameters)
          sets the Parameters of the CommandBuilder.
 void setSitemapNode(SitemapNode sn)
          Sets the SitemapNode.
 
Methods inherited from class org.torweg.pulse.util.entity.AbstractNamableEntity
setName
 
Methods inherited from class org.torweg.pulse.util.entity.AbstractNamedEntity
getName
 
Methods inherited from class org.torweg.pulse.util.entity.AbstractBasicEntity
compareTo, equals, getFullQualifiedClassNameJAXB, getId, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.torweg.pulse.util.INamed
getName
 

Constructor Detail

View

public View()
constructs a new blank View.


View

public View(Content c)
builds a new View with the given Content.

Parameters:
c - the Content to be set
Method Detail

setSitemapNode

public void setSitemapNode(SitemapNode sn)
Sets the SitemapNode.

Parameters:
sn - the SitemapNode to set

getSitemapNode

public SitemapNode getSitemapNode()
Returns the SitemapNode.

Returns:
the SitemapNode

setContent

public void setContent(Content c)
Parameters:
c - The content to set.

getContent

public Content getContent()
Returns:
Returns the content.

getCommand

public Command getCommand(Command currentCommand)
Builds a Command producing the desired View for the Content.

Actually calls CommandBuilder.mixIn(Command) and sets the suffix (Command.setSuffix(String)), if the Content of this View is an instance of AbstractBasicContent.

Parameters:
currentCommand - the current Command used as a template
Returns:
the Command producing the desired View for the Content

setCommandBuilder

public void setCommandBuilder(CommandBuilder builder)
sets a CommandBuilder, which describes all fields which need modification to create the right Command for getCommand(Command).

Parameters:
builder - the CommandBuilder

deserializeToJDOM

public org.jdom.Element deserializeToJDOM()
Description copied from interface: JDOMable
this will deserialize the state of the JDOMable as a JDOM Element.

Specified by:
deserializeToJDOM in interface JDOMable
Returns:
a basic JDOM representation
See Also:
JDOMable.deserializeToJDOM()

getParameters

public java.util.Set<Parameter> getParameters()
returns the Parameters of the CommandBuilder.

Returns:
the Parameters of the CommandBuilder

removeParameter

public void removeParameter(Parameter parameter)
removes a Parameter from the CommandBuilder.

Parameters:
parameter - the Parameter to be removed

setParameters

public void setParameters(java.util.Set<Parameter> newParameters)
sets the Parameters of the CommandBuilder.

Parameters:
newParameters - the new Parameters for the CommandBuilder

getCommandBuilder

public CommandBuilder getCommandBuilder()
returns a copy of the CommandBuilder of the View.

Returns:
the CommandBuilder of the View

createCopy

public View createCopy()
returns a copy of the View.

Returns:
a copy of the View

createCopy

public View createCopy(java.util.Locale l)
creates a copy of the View in the given locale. If the localization map of the content associated with the View contains an entry for the given locale, the copied view is assigned the matching localization.

Parameters:
l - the target locale
Returns:
a copy of the view with the target locale