API:EPrints/DataObj/SneepComment

From EPrints Documentation
Revision as of 18:29, 11 August 2009 by Tdb01r (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Latest Source Code (3.3, 3.2) | Revision Log | Before editing this page please read Pod2Wiki

NAME

EPrints::DataObj::SneepComment - A single comment.

DESCRIPTION

SneepComment represents a single comment from a user - this may be associated with one of a number of different objetcs.

This class is a subclass of DataObj, with the following metadata fields:

commentid

 commentid (int)

The unique ID of the comment.

ownerid

 ownerid (itemref)

The id number of the user to which this comment belongs.

objectid

 objectid (itemref)

The id number of the object with which this comment is associated.

object_type

 object_type (text or maybe int or even a namedset?)

The type of the object with which this comment is associated. (EPrint, Documment, User, etc)

created

 created (datetime)

The date and time at which the comment was created

lastmod

 lastmod (datetime)

The date and time at which the comment was last modified

text

 text (text)

The text of the comment. Allows a subset of html which can be defined in the sneep.xml config file.

security

 security (namedset)

The security type of this comment - who can view it. One of the types of the dataset "security".

get_system_field_info

 $metadata = EPrints::DataObj::SneepComment->get_system_field_info

Return an array describing the system metadata of the SneepComment dataset.

new

 $thing = EPrints::DataObj::SneepComment->new( $session, $commentid )

Return the SneepComment with the given $commentid, or undef if it does not exist.

new_from_data

 $comment = EPrints::DataObj::SneepComment->new_from_data( $session, $data )

Construct a new EPrints::DataObj::SneepComment based on the ref to a hash of metadata.

is_public

 $boolean = $doc->is_public()

True if this document has no security set and is in the live archive.

get_url

 $url = $doc->get_url( [$file] )

Return the full URL of the document. Overrides the stub in DataObj.

If file is not specified then the "main" file is used.

commit

 $success = $doc->commit

Commit any changes that have been made to this object to the database.

(might) Call "set_sneep_comment_automatic_fields" in the ArchiveConfig first to set any automatic fields that may be needed.

remove

 $success = $comment->remove

Remove this comment from the database.

get_defaults

 $defaults = EPrints::DataObj::EPrint->get_defaults( $session, $data )

Return default values for this object based on the starting data.

validate

 $problems = $doc->validate( [$for_archive] )

Return an array of XHTML DOM objects describing validation problems with the entire document, including the metadata and repository config specific requirements.

A reference to an empty array indicates no problems.

UNDOCUMENTED METHODS

Warning These methods were found in the source code but didn't have any POD associated with them. This may be because we haven't got around to documenting them yet or it could be because they are internal to the API and not intended for use by other parts of EPrints.

create

create_from_data