Oracle9iAS Portal Developer Kit

add_item_post_upload function

Contained in package wwsbr_api.

Call this function to create a new item within a content area and return a master item ID.

This function assumes that all files and images have been uploaded to the WWDOC_DOCUMENT$ table in the repository and that all file names are actually the value in the wwdoc_document$.name column of that table.

Note: Items are created in the default language of the content area to which they are added.

function add_item_post_upload
(
  p_caid number,
  p_folder_id number,
  p_display_name varchar2,
  p_type_id number,
  p_type_caid number,
  p_region_id number,
  p_display_option in varchar2 default FULL_SCREEN,
  p_category_id number default GENERAL_CATEGORY,
  p_category_caid number default SHARED_OBJECTS,
  p_perspectives g_perspectiveidarray  default g_perspectiveidemptyarray,
  p_perspectives_caid g_caid_array   default g_empty_caid_array,
  p_author varchar2 default wwctx_api.get_user,
  p_image_name varchar2 default null,
  p_image_alignment varchar2 default ALIGN_BOTTOM,
  p_description varchar2 default null,
  p_keywords varchar2 default null,
  p_file_name varchar2 default null,
  p_text varchar2 default null,
  p_url varchar2 default null,
  p_plsql varchar2 default null,
  p_plsql_execute_mode varchar2 default null,
  p_plsql_execute_user varchar2 default null,
  p_app_component varchar2 default null,
  p_app_param_screen number default NO,
  p_folderlink_id number default null,
  p_folderlink_caid number default null,
  p_jarfile_name varchar2 default null,
  p_initial_page_name varchar2 default null,
  p_java_app_type varchar2 default APP_TYPE_JSP,
  p_publish_date varchar2 default null,
  p_expire_mode varchar2 default PERMANENT,
  p_expiration varchar2 default null,
  p_master_item_id number default null,
  p_hide_in_browse number default NO,
  p_checkable in number default NO,
  p_parent_item_id number default null,
  p_attribute_id wwsbr_type.array default wwsbr_type.empty,
  p_attribute_caid wwsbr_type.array  default wwsbr_type.empty,
  p_attribute_data_type wwsbr_type.array  default wwsbr_type.empty,
  p_attribute_value wwsbr_type.array default wwsbr_type.empty
  )
return number;

Version: Oracle Portal 3.0.9
(Not available Oracle9iAS Portal 9.0.2)

Parameters:

p_caid number

The content area ID into which this item is to be added.

Datatype: number

p_folder_id

The folder ID into which this item is to be added.

Datatype: number

p_display_name

The display name for the item. This name is displayed in many places, including in the content area navigator and content area map.

Datatype: varchar2

p_type_id

The item type ID corresponding to the type of item being created.

Note: Item type constants can be used.

Datatype: number

p_type_caid

The content area ID for the item type.

Datatype: number

p_region_id

The ID of a region within the folder into which this item should be added. This value can be found in WWSBR_ALL_FOLDER_REGIONS.ID

Datatype: number

p_display_option

The display option for the item. The default value is FULL_SCREEN.

Datatype: varchar2
Default: FULL_SCREEN

p_category_id number

The ID for the category to be assigned to the new item. The value can be found in WWSBR_ALL_CATEGORIES.ID.

The category selected must either belong to content area 0 (shared objects) or the same content area as the new item.

Datatype: number
Default: GENERAL_CATEGORY

p_category_caid

The content area ID for the category to be assigned to the item.

Note: This value must either be 0 (shared objects) or the same as the value of p_caid.

Datatype: number
Default: SHARED_OBJECTS

p_perspectives

An array of perspective IDs which correspond to the perspectives to be assigned to the item. Values or this can be found in WWSBR_ALL_PERSPECTIVES.ID.

Note: The perspectives selected must either belong to content area 0 (shared objects) or the same content area as the new item.

Datatype: g_perspectiveidarray
Default: g_perspectiveidemptyarray

p_perspectives_caid

An array of content area IDs for the perspectives in p_perspectives. Values can be found in WWSBR_ALL_PERSPECTIVES.CAID.

Note: The value must either be 0 (shared objects) or the same as the value of p_caid.

Datatype: g_caid_array
Default: g_empty_caid_array

p_author

The author of the item. If left null, the user who creates the item is listed as the author.

Datatype: varchar2
Default: wwctx_api.get_user

p_image_name

The document name stored in the wwdoc_document$.name column.

Datatype: varchar2
Default: null

p_image_alignment

Alignment options for the item's image, with relationship to the rest of the displayed attributes. Valid values for this parameter are:

ALIGN_LEFT, ALIGN_RIGHT, ALIGN_TOP, ALIGN_BOTTOM, ALIGN_ABSOLUTE_MIDDLE, ALIGN_ABSOLUTE_BOTTOM, ALIGN_TEXT_TOP, ALIGN_MIDDLE, ALIGN_BASELINE

Datatype: varchar2
Default: ALIGN_BOTTOM

p_description

Description of the item.

Datatype: varchar2
Default: null

p_keywords

Keywords for the item.

Datatype: varchar2
Default: null

p_file_name

The document name for a file item, stored in the wwdoc_document$.name column.

Note: This parameter is only applicable if the item type of the item (i.e. p_type_id) is ITEM_TYPE_FILE, ITEM_TYPE_ZIP_FILE,or is a custom item type based on one of these two item types. Refer to the base_item_type column of WWSBR_ITEM_TYPES, to determine the item type.

Datatype: in varchar2
Default: null

p_text

Text to be inserted for the text item.

Note: This parameter is only applicable if the item type of the item (i.e. p_type_id) is ITEM_TYPE_TEXT,or is a custom item type based on this type. Refer to the base_item_type column of WWSBR_ITEM_TYPES, to determine the item type.

Datatype: varchar2
Default: null

p_url

A URL for the item.

Note: This parameter is only applicable if the item type of the item (i.e. p_type_id) is ITEM_TYPE_URL is a custom item type based on this type. Refer to the base_item_type column of WWSBR_ITEM_TYPES, to determine the item type.

Datatype: varchar2
Default: null

p_plsql

PL/SQL code for the PL/SQL item.

Note: This parameter is only applicable if the item type of the item (i.e. p_type_id) is ITEM_TYPE_PLSQL. Refer to the base_item_type column of WWSBR_ITEM_TYPES, to determine the item type.

Datatype: varchar2
Default: null

p_plsql_execute_mode

The execution mode for PL/SQL items folders. Valid values are PUBLIC_SCHEMA, DB_USER, CREATOR_SCHEMA.

Note: This parameter is only applicable if the item type of the item (i.e. p_type_id) is ITEM_TYPE_PLSQL. Refer to the base_item_type column of WWSBR_ITEM_TYPES, to determine the item type.

Datatype: varchar2
Default: null

p_plsql_execute_user

The user for DB_USER in PL/SQL execute mode.

Note: This parameter is only applicable if the item type of the item (i.e. p_type_id) is ITEM_TYPE_PLSQL. Refer to the base_item_type column of WWSBR_ITEM_TYPES, to determine the item type.

Datatype: varchar2
Default: null

p_app_component

The PROVIDER_ID.PORTLET_ID identifier for the application component to be used for this application component item.

Note: This parameter is only applicable if the item type of the item (i.e. p_type_id) is ITEM_TYPE_COMP,or is a custom item type based on this type. Refer to the base_item_type column of WWSBR_ITEM_TYPES, to determine the item type.

Datatype: varchar2
Default: null

p_app_param_screen

Specifies whether the application component item displays the component parameter screen. The default value is No.

Note: This parameter is only applicable if the item type of the item (i.e. p_type_id) is ITEM_TYPE_COMP,or is a custom item type based on this type. Refer to the base_item_type column of WWSBR_ITEM_TYPES, to determine the item type.

Datatype: number
Default: NO

p_folderlink_id

The folder_id for the folder that this folder link item points to.

Note: This parameter is only applicable if the item type of the item (i.e. p_type_id) is ITEM_TYPE_FOLDER_LINK,or is a custom item type based on this type. Refer to the base_item_type column of WWSBR_ITEM_TYPES, to determine the item type.

Datatype: number
Default: null

p_folderlink_caid

The content area ID for the folder that this folder link item points to.

Note: This parameter is only applicable if the item type of the item (i.e. p_type_id) is ITEM_TYPE_FOLDER_LINK. Refer to the base_item_type column of WWSBR_ITEM_TYPES, to determine the item type.

Datatype: number
Default: null

p_jarfile_name

The document name of a JAR file stored in the wwdoc_document$.name column.

Note: This parameter is only applicable if the item type of the item (i.e. p_type_id) is ITEM_TYPE_JAVA_APP. Refer to the base_item_type column of WWSBR_ITEM_TYPES, to determine the item type.

Datatype: varchar2
Default: null

p_initial_page_name

The name of the initial page for the Java application item.

Note: This parameter is only applicable if the item type of the item (i.e. p_type_id) is ITEM_TYPE_JAVA_APP. Refer to the base_item_type column of WWSBR_ITEM_TYPES, to determine the item type.

Datatype: varchar2
Default: null

p_java_app_type

The type of Java application. Currently, JSP only.

Note: This parameter is only applicable if the item type of the item (i.e. p_type_id) is ITEM_TYPE_JAVA_APP. Refer to the base_item_type column of WWSBR_ITEM_TYPES, to determine the item type.

Datatype: varchar2
Default: APP_TYPE_JSP

p_publish_date

The date to publish the item. If no value is specified, the item is published immediately.

Datatype: varchar2
Default: null

p_expire_mode

The expiration mode. Valid values are PERMANENT, EXP_NUMBER and EXP_DATE.

The value specified here determines what is passed to p_expiration.

Datatype: varchar2
Default: PERMANENT

p_expiration

If p_expire_mode is defined as:

  • PERMANENT, this should be null.

  • EXP_NUMBER, this value specifies the number of days.

  • EXP_DATE, this value specifies the expiration date.

Note: For dates, the format should match the NLS_DATE format. For example, for 'us' this is 'DD-MON-YYYY'.

Datatype: varchar2
Default: null

p_master_item_id

(Used when adding a new version for the item).
The master_item_id of the item. The value can be found in WWSBR_ALL_ITEMS.MASTERID.

Datatype: number
Default: null

p_hide_in_browse

Specifies whether the item is hidden in View or Browse mode.

Datatype: number
Default: NO

p_checkable

Specifies whether this item can be checked out by users with appropriate modify item privileges. Valid values for this parameter are YES or NO.

Datatype: number
Default: NO

p_parent_item_id

The ID for the parent item ID. When this parameter is used it implies that this item will become a child of the item whose ID is passed as the p_parent_item_id.

Datatype: number
Default: null

p_attribute_id

An array of attributes ids (for items based on custom types which has attributes).

Datatype: wwsbr_type.array
Default: wwsbr_type.empty

p_attribute_caid

An array of attribute content area IDs (for items based on custom types which has attributes).

Note: The values must either match p_caid or be 0.

Datatype: wwsbr_type.array
Default: wwsbr_type.empty

p_attribute_data_type

An array of attribute type values (such as 'url','text' etc.) Values for this can be found in WWSBR_ATTRIBUTES.DATA_TYPE

Datatype: wwsbr_type.array
Default: wwsbr_type.empty

p_attribute_value

An array of attribute values. All values are passed as varchar2.

Datatype: wwsbr_type.array
Default: wwsbr_type.empty

Returns:

This function returns a master item ID.

Exceptions:

  • If the specified combination of category ID and category content area ID does not exist, INVALID_CATEGORY exception is raised.

  • If p_type_id is not specified, MISSING_ITEM_TYPE exception is raised.

  • When an uploaded file exceeds quota, QUOTA_EXCEEDED exception is raised.

  • If the date format specified for the publish date is invalid, INVALID_PUBLISH_DATE_FORMAT exception is raised.

  • The publish date specified must be today's date or later. It must also be earlier than the expire date, otherwise INVALID_PUBLISH_DATE_VALUE exception is raised.

  • If the value for p_expire_mode is EXP_NUMBER but no value is specified for p_expiration, NULL_EXPIRE_NUMBER exception is raised.

  • If an invalid number is specified for p_expiration, INVALID_EXPIRE_NUMBER exception is raised. (Only applicable when p_expire_mode = EXP_NUMBER).

  • If the value for p_expire_mode is EXP_DATE but no value is specified for p_expiration, NULL_EXPIRE_DATE exception is raised

  • If some other error occurs while attempting to create an item, ITEM_CREATION_ERROR exception is raised

Example:

New_Master_Item_Id := wwsbr_api.add_item_post_upload(
  p_caid => 33,
  p_folder_id => 45,
  p_display_name => 'Movie Review',
  p_type_id => wwsbr_api.ITEM_TYPE_TEXT,
  p_type_caid => wwsbr_api.SHARED_OBJECTS,
  p_region_id => 5,
  p_text => 'This is the text of the review.'
);

Related topics

The PL/SQL API Reference is part of the Portal Developer Kit on Portal Studio