## content_keyword

Content Repository : content_keyword

- Overview
- Related Objects
- API

### Overview

Keyword cassify a content_item. For example: If you have some press releases about dogs. You might want assigning the Keyword dog to every single content_item.

### Related Objects

See also: content_item

### API

- Function: content_keyword.get_description

  Retrieves the description of the content keyword

  Author: | Karl Goldstein
  Returns: | The description for the specified keyword
  Parameters:

  > keyword_id: |  | The keyword id

  Declaration:

      function get_description (
        keyword_id  in cr_keywords.keyword_id%TYPE
      ) return varchar2;

  See Also: | content_keyword.get_heading, content_keyword.set_description

- Function: content_keyword.get_heading

  Retrieves the heading of the content keyword

  Author: | Karl Goldstein
  Returns: | The heading for the specified keyword
  Parameters:

  > keyword_id: |  | The keyword id

  Declaration:

      function get_heading (
        keyword_id  in cr_keywords.keyword_id%TYPE
      ) return varchar2;

  See Also: | content_keyword.set_heading, content_keyword.get_description

- Function: content_keyword.get_path

  Retreives a path to the keyword/subject category, with the most general category at the root of the path

  Author: | Karl Goldstein
  Returns: | The path to the keyword, or null if no such keyword exists
  Parameters:

  > keyword_id: |  | The keyword id

  Declaration:

      function get_path (
        keyword_id in cr_keywords.keyword_id%TYPE
      ) return varchar2;

  See Also: | content_keyword.new

- Function: content_keyword.is_assigned

  Determines if the keyword is assigned to the item

  Author: | Karl Goldstein
  Returns: | 't' if the keyword may be matched to an item, 'f' otherwise
  Parameters:

  > item_id: |  | The item id
  > keyword_id: |  | The keyword id to be checked for assignment

  > recurse:

  > Specifies if the keyword search is recursive. May be set to one of the following values:
  > - none: Not recursive. Look for an exact match.
  > - up: Recursive from specific to general. A search for "attack dogs" will also match "dogs", "animals", "mammals", etc.
  > - down: Recursive from general to specific. A search for "mammals" will also match "dogs", "attack dogs", "cats", "siamese cats", etc.

  Declaration:

      function is_assigned (
        item_id      in cr_items.item_id%TYPE,
        keyword_id   in cr_keywords.keyword_id%TYPE,
        recurse      in varchar2 default 'none'
      ) return varchar2;

  See Also: | content_keyword.item_assign

- Function: content_keyword.is_leaf

  Determines if the keyword has no sub-keywords associated with it

  Author: | Karl Goldstein
  Returns: | 't' if the keyword has no descendants, 'f' otherwise
  Parameters:

  > keyword_id: |  | The keyword id

  Declaration:

      function is_leaf (
        keyword_id  in cr_keywords.keyword_id%TYPE
      ) return varchar2;

  See Also: | content_keyword.new

- Function: content_keyword.new

  Creates a new keyword (also known as "subject category").

  Author: | Karl Goldstein
  Returns: | The id of the newly created keyword
  Parameters:

  > heading: |  | The heading for the new keyword
  > description: |  | The description for the new keyword
  > parent_id: |  | The parent of this keyword, defaults to null.
  > keyword_id: |  | The id of the new keyword. A new id will be allocated if this parameter is null
  > object_type: |  | The type for the new keyword, defaults to 'content_keyword'. This parameter may be used by subclasses of `content_keyword` to initialize the superclass.
  > creation_date: |  | As in `acs_object.new`
  > creation_ip: |  | As in `acs_object.new`
  > creation_user: |  | As in `acs_object.new`

  Declaration:

      function new (
        heading       in cr_keywords.heading%TYPE,
        description   in cr_keywords.description%TYPE default null,
        parent_id     in cr_keywords.parent_id%TYPE default null,
        keyword_id    in cr_keywords.keyword_id%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,
        object_type   in acs_object_types.object_type%TYPE default 'content_keyword'
      ) return cr_keywords.keyword_id%TYPE;

  See Also: | acs_object.new, content_item.new, content_keyword.item_assign, content_keyword.delete

- Procedure: content_keyword.delete

  Deletes the specified keyword, which must be a leaf. Unassigns the keyword from all content items. Use with caution - this operation cannot be undone.

  Author: | Karl Goldstein
  Parameters:

  > keyword_id: |  | The id of the keyword to be deleted

  Declaration:

      procedure delete (
        keyword_id  in cr_keywords.keyword_id%TYPE
      );

  See Also: | acs_object.delete, content_keyword.item_unassign

- Procedure: content_keyword.item_assign

  Assigns this keyword to a content item, creating a relationship between them

  Author: | Karl Goldstein
  Parameters:

  > item_id: |  | The item to be assigned to
  > keyword_id: |  | The keyword to be assigned
  > context_id: |  | As in `acs_rel.new`, deprecated
  > creation_ip: |  | As in `acs_rel.new`, deprecated
  > creation_user: |  | As in `acs_rel.new`, deprecated

  Declaration:

      procedure item_assign (
        item_id       in cr_items.item_id%TYPE,
        keyword_id    in cr_keywords.keyword_id%TYPE,
        context_id	in acs_objects.context_id%TYPE default null,
        creation_user in acs_objects.creation_user%TYPE default null,
        creation_ip   in acs_objects.creation_ip%TYPE default null
      );

  See Also: | acs_rel.new, content_keyword.item_unassign

- Procedure: content_keyword.item_unassign

  Unassigns this keyword to a content item, removing a relationship between them

  Author: | Karl Goldstein
  Parameters:

  > item_id: |  | The item to be unassigned from
  > keyword_id: |  | The keyword to be unassigned

  Declaration:

      procedure item_unassign (
        item_id     in cr_items.item_id%TYPE,
        keyword_id  in cr_keywords.keyword_id%TYPE
      );

  See Also: | acs_rel.delete, content_keyword.item_assign

- Procedure: content_keyword.set_description

  Sets a new description for the keyword

  Author: | Karl Goldstein
  Parameters:

  > keyword_id: |  | The keyword id
  > description: |  | The new description

  Declaration:

      procedure set_description (
        keyword_id  in cr_keywords.keyword_id%TYPE,
        description in cr_keywords.description%TYPE
      );

  See Also: | content_keyword.set_heading, content_keyword.get_description

- Procedure: content_keyword.set_heading

  Sets a new heading for the keyword

  Author: | Karl Goldstein
  Parameters:

  > keyword_id: |  | The keyword id
  > heading: |  | The new heading

  Declaration:

      procedure set_heading (
        keyword_id  in cr_keywords.keyword_id%TYPE,
        heading     in cr_keywords.heading%TYPE
      );

  See Also: | content_keyword.get_heading, content_keyword.set_description

  Last Modified: $Id: keyword.html,v 1.1.1.1 2001/03/13 22:59:26 ben Exp $