info.magnolia.jcr.util
Class NodeTypes.LastModified

java.lang.Object
  extended by info.magnolia.jcr.util.NodeTypes.LastModified
Enclosing class:
NodeTypes

public static class NodeTypes.LastModified
extends Object

Represents the mixin mgnl:lastModified.


Field Summary
static String LAST_MODIFIED
           
static String LAST_MODIFIED_BY
           
static String NAME
           
 
Constructor Summary
NodeTypes.LastModified()
           
 
Method Summary
static Calendar getLastModified(javax.jcr.Node node)
          Returns the date when this node was last modified.
static String getLastModifiedBy(javax.jcr.Node node)
          Returns the name of the user that last modified the node.
static void update(javax.jcr.Node node)
          Sets the date of modification to current Calendar and uses MgnlContext to set the name of the user.
static void update(javax.jcr.Node node, Calendar lastModified)
          Sets the date of modification.
static void update(javax.jcr.Node node, String userName, Calendar lastModified)
          Sets the date of modification and the name of the user modifying a node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final String NAME
See Also:
Constant Field Values

LAST_MODIFIED

public static final String LAST_MODIFIED
See Also:
Constant Field Values

LAST_MODIFIED_BY

public static final String LAST_MODIFIED_BY
See Also:
Constant Field Values
Constructor Detail

NodeTypes.LastModified

public NodeTypes.LastModified()
Method Detail

getLastModified

public static Calendar getLastModified(javax.jcr.Node node)
                                throws javax.jcr.RepositoryException
Returns the date when this node was last modified. If the no modification date has been stored on the node this method return the creation date if set, otherwise null is returned.

Throws:
javax.jcr.RepositoryException

getLastModifiedBy

public static String getLastModifiedBy(javax.jcr.Node node)
                                throws javax.jcr.RepositoryException
Returns the name of the user that last modified the node. If no modification has been stored on the node this method return the name of the user that created the node if set, otherwise null is returned.

Throws:
javax.jcr.RepositoryException

update

public static void update(javax.jcr.Node node)
                   throws javax.jcr.RepositoryException
Sets the date of modification to current Calendar and uses MgnlContext to set the name of the user. It should not be necessary to call this method explicitly as all Magnolia treated node instances are self updating the property defined by mixin.

Throws:
javax.jcr.RepositoryException
See Also:
for more details.

update

public static void update(javax.jcr.Node node,
                          Calendar lastModified)
                   throws javax.jcr.RepositoryException
Sets the date of modification. It should not be necessary to call this method explicitly as all Magnolia treated node instances are self updating the property defined by mixin.

Throws:
javax.jcr.RepositoryException
See Also:
for more details.

update

public static void update(javax.jcr.Node node,
                          String userName,
                          Calendar lastModified)
                   throws javax.jcr.RepositoryException
Sets the date of modification and the name of the user modifying a node. It should not be necessary to call this method explicitly as all Magnolia treated node instances are self updating the property defined by mixin.

Throws:
javax.jcr.RepositoryException
See Also:
for more details.


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