info.magnolia.cms.core
Class MetaData

java.lang.Object
  extended by info.magnolia.cms.core.MetaData

public class MetaData
extends Object

Meta data of a content like creation date, modification date, assigned template, ...


Field Summary
static String ACTIVATED
           
static int ACTIVATION_STATUS_ACTIVATED
           
static int ACTIVATION_STATUS_MODIFIED
           
static int ACTIVATION_STATUS_NOT_ACTIVATED
           
static String ACTIVATOR_ID
           
static String AUTHOR_ID
           
static String CREATION_DATE
           
static String DEFAULT_META_NODE
           
static String LAST_ACTION
           
static String LAST_MODIFIED
           
static String TEMPLATE
           
static String TEMPLATE_TYPE
           
static String TITLE
          Top level atoms viewed as metadata of the specified content these must be set by the authoring system itself, but could be changed via custom templates if necessary.
 
Constructor Summary
protected MetaData()
           
protected MetaData(javax.jcr.Node workingNode, AccessManager manager)
          Package private constructor.
 
Method Summary
 int getActivationStatus()
          Returns one of the ACTIVATION_STATUS_* constants.
 String getActivatorId()
          Part of metadata, last known activator of this node.
 String getAuthorId()
          Part of metadata, last known author of this node.
 boolean getBooleanProperty(String name)
           
 Calendar getCreationDate()
          Part of metadata, get creation date of the current node.
 Calendar getDateProperty(String name)
          Gets date property or null if such property doesn't exist.
 double getDoubleProperty(String name)
           
 String getHandle()
           
 boolean getIsActivated()
          Part of metadata, get last activated status of the current node.
 String getLabel()
          Part of metadata, same as name of actual storage node.
 Calendar getLastActionDate()
          Part of metadata, get last activated/de- date of the current node.
 long getLongProperty(String name)
           
 Calendar getModificationDate()
          Get last modified date of the node to which this meta data belongs or creation date in case content was not modified since.
 javax.jcr.PropertyIterator getProperties()
          Deprecated. since 4.0 - not used.
 String getStringProperty(String name)
          Returns a String property.
 String getTemplate()
          Part of metadata, template which will be used to render content of this node.
 String getTitle()
          Part of metadata , could be used as html header.
 boolean hasProperty(String name)
          Deprecated. since 4.0 - not used
 void removeProperty(String name)
          remove specified property.
 void setActivated()
          Part of metadata, adds activated status of the current node.
 void setActivatorId(String value)
          Part of metadata, current logged-in author who last activated this page.
 void setAuthorId(String value)
          Part of metadata, current logged-in author who did some action on this page.
 void setCreationDate()
          Part of metadata, adds creation date of the current node.
 void setLastActivationActionDate()
          Part of metadata, adds activated date of the current node.
 void setModificationDate()
          Part of metadata, adds modification date of the current node.
 void setProperty(String name, boolean value)
           
 void setProperty(String name, Calendar value)
           
 void setProperty(String name, double value)
           
 void setProperty(String name, long value)
           
 void setProperty(String name, String value)
           
 void setTemplate(String value)
          Part of metadata, template which will be used to render content of this node.
 void setTemplateType(String value)
          Deprecated. since 4.0 - not used - template type is determined by template definition
 void setTitle(String value)
          Part of metadata, could be used as html header.
 void setUnActivated()
          Part of metadata, adds activated status of the current node.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TITLE

public static final String TITLE
Top level atoms viewed as metadata of the specified content these must be set by the authoring system itself, but could be changed via custom templates if necessary.

See Also:
Constant Field Values

CREATION_DATE

public static final String CREATION_DATE
See Also:
Constant Field Values

LAST_MODIFIED

public static final String LAST_MODIFIED
See Also:
Constant Field Values

LAST_ACTION

public static final String LAST_ACTION
See Also:
Constant Field Values

AUTHOR_ID

public static final String AUTHOR_ID
See Also:
Constant Field Values

ACTIVATOR_ID

public static final String ACTIVATOR_ID
See Also:
Constant Field Values

TEMPLATE

public static final String TEMPLATE
See Also:
Constant Field Values

TEMPLATE_TYPE

public static final String TEMPLATE_TYPE
See Also:
Constant Field Values

ACTIVATED

public static final String ACTIVATED
See Also:
Constant Field Values

DEFAULT_META_NODE

public static final String DEFAULT_META_NODE
See Also:
Constant Field Values

ACTIVATION_STATUS_NOT_ACTIVATED

public static final int ACTIVATION_STATUS_NOT_ACTIVATED
See Also:
Constant Field Values

ACTIVATION_STATUS_MODIFIED

public static final int ACTIVATION_STATUS_MODIFIED
See Also:
Constant Field Values

ACTIVATION_STATUS_ACTIVATED

public static final int ACTIVATION_STATUS_ACTIVATED
See Also:
Constant Field Values
Constructor Detail

MetaData

protected MetaData(javax.jcr.Node workingNode,
                   AccessManager manager)
Package private constructor.

Parameters:
workingNode - current Node on which MetaData is requested

MetaData

protected MetaData()
Method Detail

getHandle

public String getHandle()
                 throws javax.jcr.RepositoryException
Throws:
javax.jcr.RepositoryException

getProperties

@Deprecated
public javax.jcr.PropertyIterator getProperties()
Deprecated. since 4.0 - not used.

Get all meta data properties.

Returns:
property iterator

getLabel

public String getLabel()
Part of metadata, same as name of actual storage node. This value is unique at the hierarchy level context.

Returns:
String value of the requested metadata

getTitle

public String getTitle()
Part of metadata , could be used as html header.

Returns:
String value of the requested metadata

setTitle

public void setTitle(String value)
              throws AccessDeniedException
Part of metadata, could be used as html header.

Parameters:
value -
Throws:
AccessDeniedException

setCreationDate

public void setCreationDate()
                     throws AccessDeniedException
Part of metadata, adds creation date of the current node.

Throws:
AccessDeniedException

getCreationDate

public Calendar getCreationDate()
Part of metadata, get creation date of the current node.

Returns:
Calendar

setActivated

public void setActivated()
                  throws AccessDeniedException
Part of metadata, adds activated status of the current node.

Throws:
AccessDeniedException

setUnActivated

public void setUnActivated()
                    throws AccessDeniedException
Part of metadata, adds activated status of the current node.

Throws:
AccessDeniedException

getIsActivated

public boolean getIsActivated()
Part of metadata, get last activated status of the current node.

Returns:
Calendar

getActivationStatus

public int getActivationStatus()
Returns one of the ACTIVATION_STATUS_* constants.


setLastActivationActionDate

public void setLastActivationActionDate()
                                 throws AccessDeniedException
Part of metadata, adds activated date of the current node.

Throws:
AccessDeniedException

getLastActionDate

public Calendar getLastActionDate()
Part of metadata, get last activated/de- date of the current node.

Returns:
Calendar

setModificationDate

public void setModificationDate()
                         throws AccessDeniedException
Part of metadata, adds modification date of the current node.

Throws:
AccessDeniedException

getModificationDate

public Calendar getModificationDate()
Get last modified date of the node to which this meta data belongs or creation date in case content was not modified since.

Returns:
Calendar when last modification date can't be found.

getAuthorId

public String getAuthorId()
Part of metadata, last known author of this node.

Returns:
String value of the requested metadata

setAuthorId

public void setAuthorId(String value)
                 throws AccessDeniedException
Part of metadata, current logged-in author who did some action on this page.

Parameters:
value -
Throws:
AccessDeniedException

getActivatorId

public String getActivatorId()
Part of metadata, last known activator of this node.

Returns:
String value of the requested metadata

setActivatorId

public void setActivatorId(String value)
                    throws AccessDeniedException
Part of metadata, current logged-in author who last activated this page.

Parameters:
value -
Throws:
AccessDeniedException

getTemplate

public String getTemplate()
Part of metadata, template which will be used to render content of this node.

Returns:
String value of the requested metadata

setTemplate

public void setTemplate(String value)
                 throws AccessDeniedException
Part of metadata, template which will be used to render content of this node.

Parameters:
value -
Throws:
AccessDeniedException

setTemplateType

@Deprecated
public void setTemplateType(String value)
                     throws AccessDeniedException
Deprecated. since 4.0 - not used - template type is determined by template definition

Part of metadata, template type : JSP - Servlet - _xxx_.

Parameters:
value -
Throws:
AccessDeniedException

setProperty

public void setProperty(String name,
                        String value)
                 throws AccessDeniedException
Throws:
AccessDeniedException

setProperty

public void setProperty(String name,
                        long value)
                 throws AccessDeniedException
Throws:
AccessDeniedException

setProperty

public void setProperty(String name,
                        double value)
                 throws AccessDeniedException
Throws:
AccessDeniedException

setProperty

public void setProperty(String name,
                        boolean value)
                 throws AccessDeniedException
Throws:
AccessDeniedException

setProperty

public void setProperty(String name,
                        Calendar value)
                 throws AccessDeniedException
Throws:
AccessDeniedException

getDateProperty

public Calendar getDateProperty(String name)
Gets date property or null if such property doesn't exist. Do not use this method for checking existence of the property.


getBooleanProperty

public boolean getBooleanProperty(String name)

getDoubleProperty

public double getDoubleProperty(String name)

getLongProperty

public long getLongProperty(String name)

getStringProperty

public String getStringProperty(String name)
Returns a String property. If the property does not exist, this will return an empty String.

Parameters:
name -
Returns:
the property value, never null

removeProperty

public void removeProperty(String name)
                    throws javax.jcr.PathNotFoundException,
                           javax.jcr.RepositoryException
remove specified property.

Parameters:
name - of the property to be removed
Throws:
javax.jcr.PathNotFoundException - if property does not exist
javax.jcr.RepositoryException - if unable to remove

hasProperty

@Deprecated
public boolean hasProperty(String name)
Deprecated. since 4.0 - not used

check if property exists.

Parameters:
name -
Returns:
true if the specified property exist

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2003-2012 Magnolia International Ltd.. All Rights Reserved.