Content Repository : content_item
Content items store the overview of the content published on a website. The actual content is stored in content revisions. It is implemented this way so that there can be mulitple versions of the actual content while the main idea remains constant. For example: If there is a review for the movie "Terminator," there will exist a content item by the name "terminator" with all the right parameters (supertype, parent, etc), there will also exist at least one content revision pointing to this item with the actual review content.
Retrieve the content type of this item. Only objects of this type may be used as revisions for the item.
Author: | Karl Goldstein | |||
---|---|---|---|---|
Returns: | The content type of the item | |||
Parameters: | ||||
|
||||
Declaration: | ||||
function get_content_type ( item_id in cr_items.item_id%TYPE ) return cr_items.content_type%TYPE; |
Retrieve the parent of the given item
Author: | Karl Goldstein | |||
---|---|---|---|---|
Returns: | The id of the parent for this item | |||
Parameters: | ||||
|
||||
Declaration: | ||||
function get_context ( item_id in cr_items.item_id%TYPE ) return acs_objects.context_id%TYPE; |
Takes in a path, such as "/tv/programs/star_trek/episode_203" and returns the id of the item with this path. Note: URLs are abstract (no extensions are allowed in content item names and extensions are stripped when looking up content items)
Author: | Karl Goldstein | ||||||
---|---|---|---|---|---|---|---|
Returns: | The id of the item with the given path, or null if no such item exists | ||||||
Parameters: | |||||||
|
|||||||
Declaration: | |||||||
function get_id ( item_path in varchar2, root_folder_id in cr_items.item_id%TYPE default c_root_folder_id ) return cr_items.item_id%TYPE; | |||||||
See Also: | content_item.get_path |
Retrieves the id of the latest revision for the item (as opposed to the live revision)
Author: | Karl Goldstein | |||
---|---|---|---|---|
Returns: | The id of the latest revision for this item, or null if no revisions exist | |||
Parameters: | ||||
|
||||
Declaration: | ||||
function get_latest_revision ( item_id in cr_items.item_id%TYPE ) return cr_revisions.revision_id%TYPE; | ||||
See Also: | content_item.get_live_revision |
Retrieves the id of the live revision for the item
Returns: | The id of the live revision for this item, or null if no live revision exists | |||
---|---|---|---|---|
Parameters: | ||||
|
||||
Declaration: | ||||
function get_live_revision ( item_id in cr_items.item_id%TYPE ) return cr_revisions.revision_id%TYPE; | ||||
See Also: | content_item.set_live_revision, content_item.get_latest_revision |
Get the parent folder.
Author: | Michael Pih | |||
---|---|---|---|---|
Returns: | the folder_id of the parent folder, null otherwise | |||
Parameters: | ||||
|
||||
Declaration: | ||||
function get_parent_folder ( item_id in cr_items.item_id%TYPE ) return cr_folders.folder_id%TYPE; |
Retrieves the full path to an item, in the form of "/tv/programs/star_trek/episode_203"
Author: | Karl Goldstein | ||||||
---|---|---|---|---|---|---|---|
Returns: | The path to the item | ||||||
Parameters: | |||||||
|
|||||||
Declaration: | |||||||
function get_path ( item_id in cr_items.item_id%TYPE, root_folder_id in cr_items.item_id%TYPE default c_root_folder_id ) return varchar2; | |||||||
See Also: | content_item.get_id, content_item.write_to_file |
Retrieves the publish date for the item
Author: | Karl Goldstein | ||||||
---|---|---|---|---|---|---|---|
Returns: | The publish date for the item, or null if the item has no revisions | ||||||
Parameters: | |||||||
|
|||||||
Declaration: | |||||||
function get_publish_date ( item_id in cr_items.item_id%TYPE, is_live in char default 'f' ) return cr_revisions.publish_date%TYPE; | |||||||
See Also: | content_item.get_live_revision, content_item.get_latest_revision, |
Return the total count of revisions for this item
Author: | Karl Goldstein | |||
---|---|---|---|---|
Returns: | The number of revisions for this item | |||
Parameters: | ||||
|
||||
Declaration: | ||||
function get_revision_count ( item_id in cr_items.item_id%TYPE ) return number; | ||||
See Also: | content_revision.new |
Parameters: | |
---|---|
Not yet documented | |
Declaration: | |
function get_root_folder return cr_folders.folder_id%TYPE; |
Retrieves the template which should be used to render this item. If no template is registered to specifically render the item in the given context, the default template for the item's type is returned.
Author: | Karl Goldstein | ||||||
---|---|---|---|---|---|---|---|
Returns: | The id of the registered template, or null if no template could be found | ||||||
Parameters: | |||||||
|
|||||||
Declaration: | |||||||
function get_template ( item_id in cr_items.item_id%TYPE, use_context in cr_item_template_map.use_context%TYPE ) return cr_templates.template_id%TYPE; | |||||||
See Also: | content_type.register_template, content_item.register_template, |
Retrieves the title for the item, using either the latest or the live revision. If the specified item is in fact a folder, return the folder's label. In addition, this function will automatically resolve symlinks.
Author: | Karl Goldstein | ||||||
---|---|---|---|---|---|---|---|
Returns: | The title of the item | ||||||
Parameters: | |||||||
|
|||||||
Declaration: | |||||||
function get_title ( item_id in cr_items.item_id%TYPE, is_live in char default 'f' ) return cr_revisions.title%TYPE; | |||||||
See Also: | content_item.get_live_revision, content_item.get_latest_revision, content_symlink.resolve |
Retrieves the virtual path to an item, in the form of "/tv/programs/star_trek/episode_203"
Author: | Michael Pih | ||||||
---|---|---|---|---|---|---|---|
Returns: | The virtual path to the item | ||||||
Parameters: | |||||||
|
|||||||
Declaration: | |||||||
function get_virtual_path ( item_id in cr_items.item_id%TYPE, root_folder_id in cr_items.item_id%TYPE default c_root_folder_id ) return varchar2; | |||||||
See Also: | content_item.get_id, content_item.write_to_file, content_item.get_path |
Determine if the item is an index page for the specified folder. The item is an index page for the folder if it exists in the folder and its item name is "index".
Author: | Karl Goldstein | ||||||
---|---|---|---|---|---|---|---|
Returns: | 't' if the item is an index page for the specified folder, 'f' otherwise | ||||||
Parameters: | |||||||
|
|||||||
Declaration: | |||||||
function is_index_page ( item_id in cr_items.item_id%TYPE, folder_id in cr_folders.folder_id%TYPE ) return varchar2; | |||||||
See Also: | content_folder.get_index_page |
Determines if an item is publishable. Publishable items must meet the following criteria: 1) for each child type, the item has n children, min_n < n < max_n 2) for each relation type, the item has n relations, min_n < n < max_n 3) any 'publishing_wf' workflows are finished
Author: | Michael Pih | |||
---|---|---|---|---|
Returns: | 't' if the item is publishable in it's present state, Otherwise, returns 'f' | |||
Parameters: | ||||
|
||||
Declaration: | ||||
function is_publishable ( item_id in cr_items.item_id%TYPE ) return char; |
Determines if one type is a subclass of another. A class is always a subclass of itself.
Author: | Karl Goldstein | ||||||
---|---|---|---|---|---|---|---|
Returns: | 't' if the child class is a subclass of the superclass, 'f' otherwise | ||||||
Parameters: | |||||||
|
|||||||
Declaration: | |||||||
function is_subclass ( object_type in acs_object_types.object_type%TYPE, supertype in acs_object_types.supertype%TYPE ) return char; | |||||||
See Also: | acs_object_type.create_type |
Determines if an item would be a valid child of another item by checking if the parent allows children of the would-be child's content type and if the parent already has n_max children of that content type.
Author: | Michael Pih | ||||||
---|---|---|---|---|---|---|---|
Returns: | 't' if the item would be a valid child, 'f' otherwise | ||||||
Parameters: | |||||||
|
|||||||
Declaration: | |||||||
function is_valid_child ( item_id in cr_items.item_id%TYPE, content_type in acs_object_types.object_type%TYPE ) return char; |
Creates a new content item. If the data, title or text parameters are specified, also creates a revision for the item.
Author: | Karl Goldstein | |||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns: | The id of the newly created item | |||||||||||||||||||||||||||||||||||||||||||||||||||
Parameters: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
Declaration: | ||||||||||||||||||||||||||||||||||||||||||||||||||||
function new ( name in cr_items.name%TYPE, parent_id in acs_objects.context_id%TYPE default null, item_id in acs_objects.object_id%TYPE default null, locale in cr_items.locale%TYPE default null, creation_date in acs_objects.creation_date%TYPE default sysdate, creation_user in acs_objects.creation_user%TYPE default null, creation_ip in acs_objects.creation_ip%TYPE default null, item_subtype in acs_object_types.object_type%TYPE default 'content_item', content_type in acs_object_types.object_type%TYPE default 'content_revision', title in cr_revisions.title%TYPE default null, description in cr_revisions.description%TYPE default null, mime_type in cr_revisions.mime_type%TYPE default 'text/plain', nls_language in cr_revisions.nls_language%TYPE default null, text in varchar2 default null, data in cr_revisions.content%TYPE default null, relation_tag in cr_child_rels.relation_tag%TYPE default null, is_live in char default 'f' ) return cr_items.item_id%TYPE; | ||||||||||||||||||||||||||||||||||||||||||||||||||||
See Also: | acs_object.new |
Parameters: | |
---|---|
Not yet documented | |
Declaration: | |
function relate ( item_id in cr_items.item_id%TYPE, object_id in acs_objects.object_id%TYPE, relation_tag in cr_type_relations.relation_tag%TYPE default 'generic', order_n in cr_item_rels.order_n%TYPE default null, relation_type in acs_object_types.object_type%TYPE default 'cr_item_rel' ) return cr_item_rels.rel_id%TYPE; |
Copies the item to a new location, creating an identical item with no revisions or associated workflow. If the target folder does not exist, or if the folder already contains an item with the same name as the given item, an error will be thrown.
Author: | Karl Goldstein | ||||||
---|---|---|---|---|---|---|---|
Parameters: | |||||||
|
|||||||
Declaration: | |||||||
procedure copy ( item_id in cr_items.item_id%TYPE, target_folder_id in cr_folders.folder_id%TYPE ); | |||||||
See Also: | content_item.new, content_folder.new, content_item.move |
Deletes the specified content item, along with any revisions, symlinks, workflows, and template relations for the item. Use with caution - this operation cannot be undone.
Author: | Karl Goldstein | |||
---|---|---|---|---|
Parameters: | ||||
|
||||
Declaration: | ||||
procedure delete ( item_id in cr_items.item_id%TYPE ); | ||||
See Also: | acs_object.delete |
Move the specified item to a different folder. If the target folder does not exist, or if the folder already contains an item with the same name as the given item, an error will be thrown.
Author: | Karl Goldstein | ||||||
---|---|---|---|---|---|---|---|
Parameters: | |||||||
|
|||||||
Declaration: | |||||||
procedure move ( item_id in cr_items.item_id%TYPE, target_folder_id in cr_folders.folder_id%TYPE ); | |||||||
See Also: | content_item.new, content_folder.new, content_item.copy |
Registers a template which will be used to render this item.
Author: | Karl Goldstein | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
Parameters: | ||||||||||
|
||||||||||
Declaration: | ||||||||||
procedure register_template ( item_id in cr_items.item_id%TYPE, template_id in cr_templates.template_id%TYPE, use_context in cr_item_template_map.use_context%TYPE ); | ||||||||||
See Also: | content_type.register_template, content_item.unregister_template, content_item.get_template |
Renames the item. If an item with the specified name already exists under this item's parent, an error is thrown
Author: | Karl Goldstein | ||||||
---|---|---|---|---|---|---|---|
Parameters: | |||||||
|
|||||||
Declaration: | |||||||
procedure rename ( item_id in cr_items.item_id%TYPE, name in cr_items.name%TYPE ); | |||||||
See Also: | content_item.new |
Make the specified revision the live revision for the item
Author: | Karl Goldstein | |||
---|---|---|---|---|
Parameters: | ||||
|
||||
Declaration: | ||||
procedure set_live_revision ( revision_id in cr_revisions.revision_id%TYPE, publish_status in cr_items.publish_status%TYPE default 'ready' ); | ||||
See Also: | content_item.get_live_revision |
Sets the release period for the item. This information may be used by applications to update the publishing status of items at periodic intervals.
Author: | Karl Goldstein | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
Parameters: | ||||||||||
|
||||||||||
Declaration: | ||||||||||
procedure set_release_period ( item_id in cr_items.item_id%TYPE, start_when date default null, end_when date default null ); |
Unregisters a template which will be used to render this item.
Author: | Karl Goldstein | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
Parameters: | ||||||||||
|
||||||||||
Declaration: | ||||||||||
procedure unregister_template ( item_id in cr_items.item_id%TYPE, template_id in cr_templates.template_id%TYPE default null, use_context in cr_item_template_map.use_context%TYPE default null ); | ||||||||||
See Also: | content_type.register_template, content_item.register_template, content_item.get_template |
Parameters: | |
---|---|
Not yet documented | |
Declaration: | |
procedure unset_live_revision ( --/** Set the live revision to null for the item -- @author Michael Pih -- @param item_id The id of the item for which to unset the live revision -- @see {content_item.set_live_revision} item_id in cr_items.item_id%TYPE ); |
Writes the content of the live revision of this item to a file, creating all the neccessary directories in the process
Author: | Karl Goldstein | ||||||
---|---|---|---|---|---|---|---|
Parameters: | |||||||
|
|||||||
Declaration: | |||||||
procedure write_to_file ( item_id in cr_items.item_id%TYPE, root_path in varchar2 ); | |||||||
See Also: | content_item.get_path |
Last Modified: $Id: item.html,v 1.1.1.1 2001/03/13 22:59:26 ben Exp $