Bric::Biz::Asset::Business::Media - The parent class of all media objects $LastChangedRevision$ $LastChangedDate: 2006-06-15 12:46:46 -0700 (Thu, 15 Jun 2006) $ use Bric::Biz::Asset::Business::Media; Media contains all of the data that will result in published media files. It contains the metadata and associations with media documents. It inherits from Bric::Biz::Asset::Business

Constructors
This will create a new media object with an optionally defined initial state Supported Keys: user__id - Required. active priority title - same as name name - Will be overridden by title description workflow_id element_type_id - Required unless asset type object passed element_type - the object required unless id is passed site_id - required source__id - required cover_date - will set expire date in conjunction with the source media_type_id category__id Throws: NONE. Side Effects: NONE. Notes: NONE. This will return a media asset that matches the criteria defined Throws: NONE. Side Effects: NONE. Notes: Inherited from Bric::Biz::Asset. returns a list or list ref of media objects that match the criteria defined Supported Keys: The title of the media document. May use "ANY" for a list of possible values. Same as "title". Media Document description. May use "ANY" for a list of possible values. The media document ID. May use "ANY" for a list of possible values. The media document UUID. May use "ANY" for a list of possible values. A media document ID to exclude from the list. May use "ANY" for a list of possible values. The media document version number. May use "ANY" for a list of possible values. The ID of a version of a media document. May use "ANY" for a list of possible values. The media document file name. May use "ANY" for a list of possible values. Returns the versions that are checked out by the user, otherwise returns the most recent version. May use "ANY" for a list of possible values. A boolean value indicating whether to return only checked out or not checked out media. If passed a true value, this parameter causes the checked in version of the most current version of the media document to be returned. When a media document is checked out, there are two instances of the current version: the one checked in last, and the one currently being edited. When the "checked_in" parameter is a true value, then the instance last checked in is returned, rather than the instance currently checked out. This is useful for users who do not currently have a media document checked out and wish to see the media document as of the last check in, rather than as currently being worked on in the current checkout. If a media document is not currently checked out, this parameter has no effect. Returns the versions of the media documents as they were last published. The "checked_out" parameter will be ignored if this parameter is passed a true value. Boolean indicating whether to return pass version objects for each media document listed. Boolean indicating whether to return active or inactive media. Returns only inactive media. Returns a list of media aliased to the media ID passed as its value. May use "ANY" for a list of possible values. Returns a list of media in the category represented by a category ID. May use "ANY" for a list of possible values. Returns a list of media with a given category URI. May use "ANY" for a list of possible values. Returns media associated with a given keyword string (not object). May use "ANY" for a list of possible values. Returns media with a note matching the value associated with any of their versions. May use "ANY" for a list of possible values. Return a list of media in the workflow represented by the workflow ID. May use "ANY" for a list of possible values. Returns a list of media on a desk with the given ID. May use "ANY" for a list of possible values. Returns a list of media with a given URI. May use "ANY" for a list of possible values. Returns a list of media associated with a given site ID. May use "ANY" for a list of possible values. Returns a list of media associated with a given site name. May use "ANY" for a list of possible values. Returns a list of media associated with a given element type ID. May use "ANY" for a list of possible values. Returns a list of media associated with a given source ID. May use "ANY" for a list of possible values. Returns a list of media associated with a given output channel ID. May use "ANY" for a list of possible values. Returns a list of media associated with a given primary output channel ID. May use "ANY" for a list of possible values. Returns a list of media associated with a given priority value. May use "ANY" for a list of possible values. Returns a list of media associated with a given contributor ID. May use "ANY" for a list of possible values. Returns a list of media that are members of the group with the specified group ID. May use "ANY" for a list of possible values. Boolean value indicating whether to return published or unpublished media. Returns a list of media first published on or after a given date/time. Returns a list of media first published on or before a given date/time. Returns a list of media last published on or after a given date/time. Returns a list of media last published on or before a given date/time. Returns a list of media with a cover date on or after a given date/time. Returns a list of media with a cover date on or before a given date/time. Returns a list of media with a expire date on or after a given date/time. Returns a list of media with a expire date on or before a given date/time. A boolean parameter. Returns a list of media without an expire date, or with an expire date set in the future. The key name for the media type element. May use "ANY" for a list of possible values. The key name for a container element that's a subelement of a media document. May use "ANY" for a list of possible values. The ID for a container element that's a subelement of a media document. May use "ANY" for a list of possible values. Returns a list of media that have this story ID as a related story. May use "ANY" for a list of possible values. Returns a list of media that have this media ID as a related media document. May use "ANY" for a list of possible values. Text stored in the fields of the media element or any of its subelements. Only fields that use the "short" storage type will be searched. May use "ANY" for a list of possible values. Triggers a single OR search that hits title, description, uri and keywords. A property name or array reference of property names to order by. The direction in which to order the records, either "ASC" for ascending (the default) or "DESC" for descending. This value is applied to the property specified by the "Order" parameter, and may also be an array reference. If no value is supplied for any "Order" property name, it will default to ascending. A maximum number of objects to return. If not specified, all objects that match the query will be returned. The number of objects to skip before listing the remaining objcts or the number of objects specified by "Limit". Throws: Unable to connect to database. Unable to prepare SQL statement. Unable to select column into arrayref. Unable to execute SQL statement. Unable to bind to columns to statement handle. Unable to fetch row from statement handle. Side Effects: NONE Notes: Inherited from Bric::Biz::Asset.

Destructors
dummy method to not waste the time of AUTOLOAD

Public Class Methods
Returns a list or list ref of media object IDs that match the criteria defined. The criteria are the same as those for the list() method. Throws: NONE. Side Effects: NONE. Notes: Inherited from Bric::Biz::Asset. Returns a list of the names of fields that are registered in the database as being autopopulatable for a given sub class Throws: NONE. Side Effects: NONE. Notes: NONE. Returns the key name of this class. Throws: NONE. Side Effects: NONE. Notes: NONE. This method returns a local URI pointing to an icon representing the media type of the media document. If no file has been uploaded to the media document, "thumbnail_uri()" will return "undef". This method is only enabled if the "USE_THUMBNAILS" bricolage.conf directive is enabled. It may be overridden in subclasses to return a different URI value (See Bric::Biz::Asset::Business::Media::Image for an example). Throws: NONE. Side Effects: NONE. Notes: NONE. Returns an anonymous hash of introspection data for this object. If called with a true argument, it will return an ordered list or anonymous array of introspection data. If a second true argument is passed instead of a first, then a list or anonymous array of introspection data will be returned for properties that uniquely identify an object (excluding "id", which is assumed). Each hash key is the name of a property or attribute of the object. The value for a hash key is another anonymous hash containing the following keys: The name of the property or attribute. Is the same as the hash key when an anonymous hash is returned. The display name of the property or attribute. A reference to the method that will retrieve the value of the property or attribute. An anonymous array of arguments to pass to a call to get_meth in order to retrieve the value of the property or attribute. A reference to the method that will set the value of the property or attribute. An anonymous array of arguments to pass to a call to set_meth in order to set the value of the property or attribute. The type of value the property or attribute contains. There are only three types: If the value is a 'short' value, this hash key contains the length of the field. The property is searchable via the list() and list_ids() methods. The property or attribute is required. An anonymous hash of properties used to display the property or attribute. Possible keys include: The display field type. Possible values are The Length, in letters, to display a text or password field. The maximum length of the property or value - usually defined by the SQL DDL. The number of rows to format in a textarea field. The number of columns to format in a textarea field. An anonymous hash of key/value pairs reprsenting the values and display names to use in a select list. Throws: NONE. Side Effects: NONE. Notes: NONE. Returns the class id of the Media object or class. Throws: NONE. Side Effects: NONE. Notes: NONE. Returns the value of the Bric::Biz::Workflow "MEDIA_WORKFLOW" constant.

Public Instance Methods
Associates this media asset with the given category Throws: NONE. Side Effects: Updates the media document's URI and group associations. Notes: NONE. Returns the category id that has been associated with this media object Throws: NONE. Side Effects: NONE. Notes: NONE. Sets the cover date and updates the URI. Throws: Bric::_get() - Problems retrieving fields. Unable to unpack date. Unable to format date. Incorrect number of args to Bric::_set(). Bric::set() - Problems setting fields. Side Effects: Changes the media document's URI. Notes: NONE. Returns the object of the category that this is a member of Throws: NONE. Side Effects: NONE. Notes: NONE. Returns the URI for the media object. If the $oc output channel parameter is passed in, then the URI will be returned in the output channel's preferred format. Throws: Output channel not associated with media. Side Effects: NONE. Notes: NONE. Returns the uri of the media object for the Bricolage application server. Throws: NONE. Side Effects: NONE. Notes: NONE. Returns the path of the media object on the Bricolage file system. Throws: NONE. Side Effects: NONE. Notes: NONE. Returns the media type object associated with this object. Throws: NONE. Side Effects: NONE. Notes: NONE. Reads a file from the passed $file_handle and stores it in the media object under $file_name. If $media_type is passed, it will be used to set the media type of the file. Otherwise, "upload_file()" will use Bric::Util::MediaType to determine the media type. If $size is passed, its value will be used for the size of the file; otherwise, "upload_file()" will figure out the file size itself. Throws: NONE. Side Effects: Closes the $file_handle after reading. Updates the media document's URI. Notes: NONE. Returns the name of the file for this given media object. Throws: NONE. Side Effects: NONE. Notes: NONE. Returns the file handle for this given media object Throws: Error getting File. Side Effects: NONE. Notes: NONE. The will return the location of the file on the file system, relative to MEDIA_FILE_ROOT. Throws: NONE. Side Effects: NONE. Notes: NONE. This is the size of the media file in bytes Throws: Unable to retrieve category__id of this media. Side Effects: NONE. Notes: NONE. Reverts the current version to a prior version Throws: NONE. Side Effects: NONE. Notes: NONE. Clones the media object Throws: NONE. Side Effects: NONE. Notes: NONE. Saves the object to the database doing either an insert or an update Throws: NONE. Side Effects: NONE. Notes: NONE. Returns the contributors from a cache or looks em up Throws: NONE. Side Effects: NONE. Notes: NONE. Inserts a row into the mapping table for contributors. Throws: NONE. Side Effects: NONE. Notes: NONE. Updates the contributor mapping table Throws: NONE. Side Effects: NONE. Notes: NONE. Deletes the rows from these mapping tables Throws: NONE. Side Effects: NONE. Notes: NONE. returns a hash ref of the fields that are to be autopopulated from this type of media object. Throws: NONE. Side Effects: NONE. Notes: NONE. Inserts a media record into the database Throws: NONE. Side Effects: NONE. Notes: NONE. Preforms the SQL that updates the media table Throws: NONE. Side Effects: NONE. Notes: NONE. Preforms the sql that inserts a record into the media instance table Throws: NONE. Side Effects: NONE. Notes: NONE. Preforms the sql that updates the media_instance table Throws: NONE. Side Effects: NONE. Notes: NONE. Removes the media row from the database Throws: NONE. Side Effects: NONE. Notes: NONE. Removes the instance row from the database Throws: NONE. Side Effects: NONE. Notes: NONE. Deletes the version directory for the current version if it exists. Throws: NONE. Side Effects: If the "AUTO_PREVIEW_MEDIA" bricolage.conf directive is enabled, the previous version of the media document will be looked up and its media file previewed, so as to replace the deleted media preview. Notes: NONE. Populates the object from a database row Throws: NONE. Side Effects: NONE. Notes: NONE. Updates the row in the data base Throws: NONE. Side Effects: NONE. Notes: NONE. Previews the media document. Throws: NONE. Side Effects: NONE. Notes: NONE. Some additional fields may be needed here such as a field for what kind of object this represents etc. "Michael Soderstrom" <miraso@pacbell.net> perl, Bric, Bric::Biz::Asset, Bric::Biz::Asset::Business