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.content
Class AbstractRegistryNode

java.lang.Object
  extended by org.torweg.pulse.util.entity.AbstractBasicEntity
      extended by org.torweg.pulse.util.entity.Node
          extended by org.torweg.pulse.site.content.AbstractRegistryNode
All Implemented Interfaces:
java.io.Serializable, JDOMable, INameable, INamed
Direct Known Subclasses:
RegistryBundleNode, RegistryLocaleNode

@Entity
public abstract class AbstractRegistryNode
extends Node
implements INameable, JDOMable, java.io.Serializable

a AbstractRegistryNode is an entry in the websites ContentRegistry.

Version:
$Revision: 1822 $
Author:
Thomas Weber, Daniel Dietz
See Also:
ContentRegistry, Serialized Form

Field Summary
protected static org.slf4j.Logger LOGGER
          the logger.
 
Constructor Summary
protected AbstractRegistryNode()
          needed for HibernateTM.
 
Method Summary
 void addChild(int pos, Node n)
          adds a new AbstractRegistryNode at a given position to the list children of this AbstractRegistryNode if Locales match.
 void addChild(Node n)
          Adds a new AbstractRegistryNode to the children of this AbstractRegistryNode if Locales match.
 org.jdom.Element deserializeToJDOM()
          calls deserializeToJDOM(ServiceRequest) with null.
abstract  org.jdom.Element deserializeToJDOM(ServiceRequest request)
           
abstract  java.util.Map<java.lang.String,java.lang.String> getActionURLs(ServiceRequest req)
          returns a map of all the possible actions and their corresponding URLs for the AbstractRegistryNode.
 Bundle getBundle()
          returns the Bundle of the RegistryBundleNode.
 AbstractRegistryNode getChildByName(java.lang.String n)
          Returns a child by name if exists.
abstract  java.lang.String getDisabledActions()
          returns a string with the disabled tree actions delimited by colons.
 java.lang.String getName()
          returns the name.
 java.lang.StringBuilder getPathBuilder()
          Returns a StringBuilder with the ContentRegistry-path of the AbstractRegistryNode.
 void setBundle(Bundle b)
          sets the Bundle of the RegistryBundleNode.
<E extends Node>
void
setChildren(java.util.List<E> nodeList)
          sets the children of the AbstractRegistryNode if Locales match.
 void setName(java.lang.String n)
          sets a new name for the AbstractRegistryNode.
 net.sf.json.JSONObject toJSON()
          /** returns a JSONObject representation of the AbstractRegistryNode.
 
Methods inherited from class org.torweg.pulse.util.entity.Node
getChild, getChildIndex, getChildren, getParent, hasChildren, removeChild
 
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
 

Field Detail

LOGGER

protected static final org.slf4j.Logger LOGGER
the logger.

Constructor Detail

AbstractRegistryNode

protected AbstractRegistryNode()
needed for HibernateTM.

Method Detail

getName

public final java.lang.String getName()
Description copied from interface: INamed
returns the name.

Specified by:
getName in interface INamed
Returns:
returns the name of the AbstractRegistryNode.

setName

public final void setName(java.lang.String n)
sets a new name for the AbstractRegistryNode.

Specified by:
setName in interface INameable
Parameters:
n - the name to be set

setBundle

public void setBundle(Bundle b)
sets the Bundle of the RegistryBundleNode. The name of the RegistryBundleNode is set to Bundle#getName().

Parameters:
b - the Bundle

getBundle

public final Bundle getBundle()
returns the Bundle of the RegistryBundleNode.

Returns:
the Bundle of the RegistryBundleNode

addChild

public void addChild(Node n)
Adds a new AbstractRegistryNode to the children of this AbstractRegistryNode if Locales match.

Overrides:
addChild in class Node
Parameters:
n - the AbstractRegistryNode to be added.

addChild

public void addChild(int pos, Node n)
adds a new AbstractRegistryNode at a given position to the list children of this AbstractRegistryNode if Locales match.

Overrides:
addChild in class Node
Parameters:
pos - the position in the list of children
n - the AbstractRegistryNode to become a child of this AbstractRegistryNode.

setChildren

public <E extends Node> void setChildren(java.util.List<E> nodeList)
sets the children of the AbstractRegistryNode if Locales match.

Overrides:
setChildren in class Node
Type Parameters:
E - a class extending Node
Parameters:
nodeList - the list of child AbstractRegistryNodes

getChildByName

public final AbstractRegistryNode getChildByName(java.lang.String n)
Returns a child by name if exists.

Parameters:
n - the name to look for
Returns:
an AbstractRegistryNode if found, null otherwise

getPathBuilder

public final java.lang.StringBuilder getPathBuilder()
Returns a StringBuilder with the ContentRegistry-path of the AbstractRegistryNode. System.getProperty("file.separator") will be used as path-separator.

Returns:
a StringBuilder with the ContentRegistry-path of the AbstractRegistryNode

getDisabledActions

public abstract java.lang.String getDisabledActions()
returns a string with the disabled tree actions delimited by colons.

Returns:
a string with the disabled tree actions delimited by colons

getActionURLs

public abstract java.util.Map<java.lang.String,java.lang.String> getActionURLs(ServiceRequest req)
returns a map of all the possible actions and their corresponding URLs for the AbstractRegistryNode.

Parameters:
req - the current request
Returns:
a map of all the possible actions and their corresponding URLs for the AbstractRegistryNode

deserializeToJDOM

public final org.jdom.Element deserializeToJDOM()
calls deserializeToJDOM(ServiceRequest) with null.

Specified by:
deserializeToJDOM in interface JDOMable
Returns:
the AbstractRegistryNode as an Element

deserializeToJDOM

public abstract org.jdom.Element deserializeToJDOM(ServiceRequest request)
Parameters:
request - the current request
Returns:
the AbstractRegistryNode as an Element

toJSON

public net.sf.json.JSONObject toJSON()
/** returns a JSONObject representation of the AbstractRegistryNode.

Overrides:
toJSON in class Node
Returns:
a JSONObject representation of the AbstractRegistryNode