| Oracle Application Server Portal PL/SQL API Reference - 904 | |||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | |||||||
| SUMMARY: EXCEPTION | TYPE | CONSTANT | VARIABLE | FUNCTION/PROCEDURE | DETAIL: EXCEPTION | TYPE | CONSTANT | VARIABLE | FUNCTION/PROCEDURE | |||||||
This package contains the supported Content Repository APIs for OracleAS Portal 10G version 9.0.4. These APIs are backward compatible with the Oracle9iAS Portal 3.0.9 Content Area APIs, except as noted. To maintain compatibility, many of the API signatures (procedure and parameter names) continue to use 3.0.9 object names: page groups are referred to as content areas, pages are referred to as folders, and navigation pages are referred to as navigation bars. Other than procedure and parameter names, this document employs the new terminology.
Differences Between 3.0.9 and 9.0.4 APIs
In this release, these APIs are backwards compatible with the 3.0.9 APIs, with the following exceptions:
New functions and new parameters to support the new functionality have been added to the API set, as noted in this documentation. For a full description of the new functionality and how it compares to the 3.0.9 release, please see the OracleAS Portal 10G Upgrade Guide or the tech note "What Happened to Content Areas?", both available on Portal Center.
General Rules for all APIs
DECLARE
p_user_name VARCHAR2(60) := 'GEORGE';
p_password VARCHAR2(60) := 'welcome';
p_company VARCHAR2(60) := NULL;
BEGIN
wwctx_api.set_context(p_user_name,p_password,p_company);
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line(SubStr('Error '||TO_CHAR(SQLCODE)||': '||SQLERRM, 1, 255));
RAISE;
END;
Using sbrapi.sql
The supplied script sbrapi.sql, located in the ORACLE_HOME/portal/admin/plsql/wws directory, can be used to grant access to these APIs. This script takes the name of a database schema as a parameter and grants EXECUTE to that schema on the WWSBR_API package. sbrapi.sql also grants SELECT on the secured content repository views to the passed SCHEMA. sbrapi.sql must be run as the owner of the Portal schema (SCHEMA_OWNER).
See Secure Content Repository Views for more information.
| Exception Summary | |
CANNOT_INSERT_DOCUMENT | |
DUPLICATE_FOLDER | |
DUPLICATE_ID | |
DUPLICATE_NAME | |
FOLDER_VERSIONING_IS_AUDIT | |
FOLDER_VERSIONING_IS_NONE | |
ILS_DISABLED | |
ILS_DISABLED_FOR_ITEM | |
INVALID_CAID | |
INVALID_CATEGORY | |
INVALID_EXPIRE_DATE | |
INVALID_EXPIRE_DATE_FORMAT | |
INVALID_EXPIRE_NUMBER | |
INVALID_FOLDER | |
INVALID_FOLDER_ID | |
INVALID_ITEM_ID | |
INVALID_ITEMTYPE | |
INVALID_MOVE | |
INVALID_NAME | |
INVALID_NUMBER | |
INVALID_PERSPECTIVE | |
INVALID_PLSQL_EXECUTE_USER | |
INVALID_PUBLISH_DATE_FORMAT | |
INVALID_PUBLISH_DATE_VALUE | |
INVALID_USERNAME | |
ITEM_CREATION_ERROR | |
ITEM_NOT_FOUND_ERROR | |
ITEM_UPDATE_ERROR | |
MISSING_DISPLAY_NAME | |
MISSING_ITEM_TYPE | |
MISSING_NAME | |
MISSING_PLSQL_EXECUTE_USER | |
NAME_TOO_LONG | |
NO_ITEM_REGION | |
NO_MASTER_ITEM_ID | |
NOT_ENOUGH_PRIVS | |
NULL_EXPIRE_DATE | |
NULL_EXPIRE_NUMBER | |
PERMISSION_DENIED | |
PLSQL_REQUIRED | |
QUOTA_EXCEEDED | |
REQD_ATTR_MISSING | |
UNKNOWN_ERROR | |
URL_REQUIRED | |
| Type Summary | |
g_array | subtype |
g_caid_array | subtype |
g_perspectiveidarray | subtype |
| Variable Summary | |
g_empty_array | g_array |
g_empty_caid_array | g_caid_array |
g_perspectiveidemptyarray | g_perspectiveidarray |
| Function/Procedure Summary | |
add_category | number |
add_content_area | number |
add_folder | number |
add_item | number |
add_item_ils_privileges | |
add_item_post_upload | number |
add_perspective | number |
delete_ils_privilege | |
enable_ils_for_item | |
inherit_folder_privileges | |
modify_item | number |
modify_item_post_upload | number |
move_folder | |
move_item | |
upload_blob | varchar2 |
| Exception Detail |
CANNOT_INSERT_DOCUMENT exception
DUPLICATE_FOLDER exception
DUPLICATE_ID exception
DUPLICATE_NAME exception
FOLDER_VERSIONING_IS_AUDIT exception
FOLDER_VERSIONING_IS_NONE exception
ILS_DISABLED exception
ILS_DISABLED_FOR_ITEM exception
INVALID_CAID exception
INVALID_CATEGORY exception
INVALID_EXPIRE_DATE exception
INVALID_EXPIRE_DATE_FORMAT exception
INVALID_EXPIRE_NUMBER exception
INVALID_FOLDER exception
INVALID_FOLDER_ID exception
INVALID_ITEM_ID exception
INVALID_ITEMTYPE exception
INVALID_MOVE exception
INVALID_NAME exception
INVALID_NUMBER exception
INVALID_PERSPECTIVE exception
INVALID_PLSQL_EXECUTE_USER exception
INVALID_PUBLISH_DATE_FORMAT exception
INVALID_PUBLISH_DATE_VALUE exception
INVALID_USERNAME exception
ITEM_CREATION_ERROR exception
ITEM_NOT_FOUND_ERROR exception
ITEM_UPDATE_ERROR exception
MISSING_DISPLAY_NAME exception
MISSING_ITEM_TYPE exception
MISSING_NAME exception
MISSING_PLSQL_EXECUTE_USER exception
NAME_TOO_LONG exception
NO_ITEM_REGION exception
NO_MASTER_ITEM_ID exception
NOT_ENOUGH_PRIVS exception
NULL_EXPIRE_DATE exception
NULL_EXPIRE_NUMBER exception
PERMISSION_DENIED exception
PLSQL_REQUIRED exception
QUOTA_EXCEEDED exception
REQD_ATTR_MISSING exception
UNKNOWN_ERROR exception
URL_REQUIRED exception
| Type Detail |
subtype g_array is wwsbr_type.array
subtype g_caid_array is wwsbr_type.array
subtype g_perspectiveidarray is wwv_perspectivedb.perspectiveidarray
| Constant Detail |
ALIGN_ABSOLUTE_BOTTOM constant varchar2(30) := 'absbottom'
ALIGN_ABSOLUTE_MIDDLE constant varchar2(30) := 'absmiddle'
ALIGN_BASELINE constant varchar2(30) := 'baseline'
ALIGN_BOTTOM constant varchar2(30) := 'bottom'
ALIGN_LEFT constant varchar2(30) := 'left'
ALIGN_MIDDLE constant varchar2(30) := 'middle'
ALIGN_RIGHT constant varchar2(30) := 'right'
ALIGN_TEXT_TOP constant varchar2(30) := 'texttop'
ALIGN_TOP constant varchar2(30) := 'top'
ATTR_DISPLAY_TYPE constant number := 63
ATTR_ELEMENT_MAP_TYPE constant number := 67
ATTR_FUNCTION_ID constant number := 68
ATTR_LOGIN_IMAGE constant number := 58
ATTR_LOGIN_LINK constant number := 57
ATTR_LOGOUT_IMAGE constant number := 60
ATTR_LOGOUT_LINK constant number := 59
ATTR_OBJECT_LIST constant number := 65
ATTR_OBJECT_TYPE_LIST constant number := 64
ATTR_PATH_DEPTH constant number := 69
ATTR_PATH_SEPARATOR constant number := 70
ATTR_PORTAL_SMART_LINK constant number := 56
ATTR_SEARCH_BOX_WIDTH constant number := 62
ATTR_SEARCH_PAGE_GROUP_ID constant number := 61
ATTR_TEXT_TYPE constant number := 66
CREATOR_SCHEMA constant varchar2(20) := '$CREATOR$'
DATA_TYPE_DATE constant varchar2(30) := 'date'
DATA_TYPE_FILE constant varchar2(30) := 'file'
DATA_TYPE_NUMBER constant varchar2(30) := 'number'
DATA_TYPE_OTHER constant varchar2(30) := 'other'
DATA_TYPE_TEXT constant varchar2(30) := 'text'
DB_USER constant varchar(20) := 'db_user'
EXP_DATE constant varchar2(20) := 'DATE'
EXP_NUMBER constant varchar2(20) := 'NUMBER'
FOLDER_ACCESS constant varchar2(30) := 'folder'
FOLDER_TYPE_CONTAINER constant number := 1
FOLDER_TYPE_PLSQL constant number := 4
FOLDER_TYPE_SEARCH constant number := 3
FOLDER_TYPE_URL constant number := 2
FULL_SCREEN constant varchar2(30) := 'fullscreen'
GENERAL_CATEGORY constant number := 30
IN_FRAME constant varchar2(30) := 'inframe'
IN_PLACE constant varchar2(30) := 'inplace'
IS_OFF constant number := 0
IS_ON constant number := 1
ITEM_ACCESS constant varchar2(30) := 'item'
ITEM_TYPE_APP_COMP constant number := 6
ITEM_TYPE_BASIC_SEARCH constant number := 24
ITEM_TYPE_ELEMENT_LIST constant number := 25
ITEM_TYPE_FILE constant number := 1
ITEM_TYPE_FOLDER_LINK constant number := 4
ITEM_TYPE_IMAGE constant number := 8
ITEM_TYPE_IMAGE_MAP constant number := 31
ITEM_TYPE_JAVA_APP constant number := 11
ITEM_TYPE_LOGIN_LOGOUT constant number := 23
ITEM_TYPE_MAP_LINK constant number := 27
ITEM_TYPE_PAGE_FUNCTION constant number := 34
ITEM_TYPE_PAGE_PATH constant number := 30
ITEM_TYPE_PLSQL constant number := 5
ITEM_TYPE_PORTLET_INST constant number := 13
ITEM_TYPE_SIMPLE_APP_COMP constant number := 18
ITEM_TYPE_SIMPLE_FILE constant number := 14
ITEM_TYPE_SIMPLE_IMAGE constant number := 20
ITEM_TYPE_SIMPLE_JAVA_APP constant number := 28
ITEM_TYPE_SIMPLE_PAGE_LINK constant number := 19
ITEM_TYPE_SIMPLE_PLSQL constant number := 17
ITEM_TYPE_SIMPLE_TEXT constant number := 16
ITEM_TYPE_SIMPLE_URL constant number := 15
ITEM_TYPE_SMART_LINK constant number := 22
ITEM_TYPE_SMART_TEXT constant number := 26
ITEM_TYPE_TEXT constant number := 2
ITEM_TYPE_URL constant number := 3
ITEM_TYPE_ZIP_FILE constant number := 12
NEW_WINDOW constant varchar2(30) := 'newbrowserwindow'
NO constant number := 0
PERMANENT constant varchar2(20) := 'PERMANENT'
PUBLIC_SCHEMA constant varchar2(20) := '$PUBLIC$'
SHARED_OBJECTS constant number := 0
VALUE_ACCOUNT_INFO constant varchar2(30) := 'account'
VALUE_ADVANCED_SEARCH constant varchar2(30) := 'advanced_search'
VALUE_BUILDER constant varchar2(30) := 'builder'
VALUE_COMMUNITY constant varchar2(30) := 'community'
VALUE_CONTACT constant varchar2(30) := 'contact'
VALUE_CURRENT_DATE constant varchar2(30) := 'currentdate'
VALUE_CURRENT_PAGE constant varchar2(30) := 'currentpage'
VALUE_CURRENT_USER constant varchar2(30) := 'currentuser'
VALUE_CUST_MOBILE_HOME_PAGE constant varchar2(30) := 'mobile'
VALUE_CUSTOMIZE_PAGE constant varchar2(30) := 'customize'
VALUE_EDIT_PAGE constant varchar2(30) := 'edit'
VALUE_HELP constant varchar2(30) := 'help'
VALUE_NAVIGATOR constant varchar2(30) := 'navigator'
VALUE_PORTAL_HOME constant varchar2(30) := 'home'
VALUE_PORTLET_REPOS constant varchar2(30) := 'portlet_repos'
VALUE_PROPERTY_SHEET constant varchar2(30) := 'sheet'
VALUE_REFRESH_PAGE constant varchar2(30) := 'refresh'
VALUE_SUBSCRIBE constant varchar2(30) := 'subscribe'
VERSIONING_AUDIT constant varchar2(30) := 'versionaudit'
VERSIONING_NONE constant varchar2(30) := 'versionnone'
VERSIONING_SIMPLE constant varchar2(30) := 'versionsimple'
YES constant number := 1
| Variable Detail |
g_empty_array g_array
g_empty_caid_array g_caid_array
g_perspectiveidemptyarray g_perspectiveidarray
| Function/Procedure Detail |
function add_category(
p_caid in number,
p_parent_id in number default 0,
p_name in varchar2,
p_display_name in varchar2,
p_description in varchar2 default null,
p_is_portlet in number default no,
p_banner_image in varchar2 default null,
p_banner_icon in varchar2 default null,
p_title_image in varchar2 default null,
p_rollover_image in varchar2 default null
) return numberTo create a new category, the calling user must have the Manage Classifications privilege or higher on the page group.
Example:
l_new_category_id := wwsbr_api.add_category(
p_caid => 33,
p_parent_id => 0,
p_name => 'newcategory1',
p_display_name => 'New Category 1'
);
p_caid - Page group ID.p_parent_id - Parent category ID. If there is no parent, use "0" (zero).p_name - Internal name of the category. Must be unique within the parent category.p_display_name - Display name of the category.p_description - Description of the category.p_is_portlet - Publish category as a portlet? Use constant values YES or NO.p_banner_image - File location of the banner image associated with this category.
This value must be a directory path and filename on the same server on which
the Portal database is located (e.g. "/usr/images/banner.gif").
The image is uploaded from this location.p_banner_icon - File location of the icon image associated with this category.
This value must be a directory path and filename on the same server on which
the Portal database is located (e.g. "/usr/images/bannericon.gif").
The image is uploaded from this location.p_title_image - File location of the title image associated with this category.
This value must be a directory path and filename on the same server on which
the Portal database is located (e.g. "/usr/images/cattitle.gif").
The image is uploaded from this location.p_rollover_image - File location of the rollover image associated with this
category. This value must be a directory path and filename on the same server
on which the Portal database is located (e.g. "/usr/images/catrollover.gif").
The image is uploaded from this location.MISSING_NAME - No value passed for p_nameMISSING_DISPLAY_NAME - No value passed for p_display_nameINVALID_CATEGORY - Parent category specified does not existINVALID_NAME - Invalid value passed for p_nameDUPLICATE_NAME - Category with same name already existsPERMISSION_DENIED - Calling user does not have the authorization
to create a categoryOTHERS - Unexpected error
function add_content_area(
p_name in varchar2,
p_display_name in varchar2,
p_versioning in varchar2 default versioning_none,
p_default_language in varchar2 default 'us',
p_root_folder_type in number default 1,
p_logo_filename in varchar2 default null
) return numberExample:
declare
l_new_page_group_id number;
begin
l_new_page_group_id := wwsbr_api.add_content_area(
p_name => 'ENTERTAINMENT',
p_display_name => 'Entertainment Site',
p_versioning => wwsbr_api.VERSIONING_AUDIT,
p_default_language => 'us');
end;
p_name - Internal reference name for the page group. Must be unique.p_display_name - Display name for the page group.p_versioning - Versioning level for items. Default is VERSIONING_NONE.
Use the following constants:
p_default_language - Default language for the page group. Default is 'us'.p_root_folder_type - Deprecated. The root page of a page group is always a
standard page.p_logo_filename - This parameter is DEPRECATED. The parameter has
been retained for backward compatibility with the 3.0.9 API signatures,
but its value is ignored.INVALID_NAME - Page group name contains spaces or special charactersDUPLICATE_NAME - A page group with p_name value already existsMISSING_NAME - No value was passed for the page group nameNAME_TOO_LONG - Name must be less than 60 charactersMISSING_DISPLAY_NAME - No value was passed for the page group display name
function add_folder(
p_caid in number,
p_parent_id in number default 1,
p_name in varchar2,
p_display_name in varchar2,
p_type_id in number default folder_type_container,
p_type_caid in number default shared_objects,
p_value in varchar2 default null,
p_plsql_execute_mode in varchar2 default null,
p_plsql_execute_user in varchar2 default null,
p_category_id in number default general_category,
p_category_caid in number default shared_objects,
p_isportlet in number default no,
p_portlet_use_page_style in number default yes,
p_perspectives in g_perspectiveidarray default g_perspectiveidemptyarray,
p_perspectives_caid in g_caid_array default g_empty_caid_array,
p_attribute_id in wwsbr_type.array default wwsbr_type . empty,
p_attribute_caid in wwsbr_type.array default wwsbr_type . empty,
p_attribute_data_type in wwsbr_type.array default wwsbr_type . empty,
p_attribute_value in wwsbr_type.array default wwsbr_type . empty
) return numberNotes:
Example:
declare
l_new_page_id number;
l_perspective_ids wwsbr_api.g_perspectiveidarray;
l_perspective_caids wwsbr_api.g_caid_array;
l_caid number := 33;
begin
select id, caid
bulk collect into l_perspective_ids, l_perspective_caids
from wwsbr_all_perspectives
where caid in (l_caid, wwsbr_api.SHARED_OBJECTS);
l_new_page_id := wwsbr_api.add_folder(
p_caid => l_caid,
p_name => 'ENTERTAINMENT',
p_display_name => 'Entertainment Site',
p_type_id => FOLDER_TYPE_CONTAINER,
p_type_caid => 0
p_perspectives => l_perspective_ids,
p_perspectives_caid => l_perspective_caids);
-- process cache invalidation messages
wwpro_api_invalidation.execute_cache_invalidation;
end;
p_caid - ID of the page group to which the page is added.p_parent_id - ID of parent page. Default value is 1, which is the
root page of the page group.p_name - Internal reference name for the page.
Must be unique within the parent page.p_display_name - Display name (title) for the page.p_type_id - ID of the page type for this page. The page type must be available
in the page group in which the page is being created. Valid values:
p_type_caid - Page group ID of the page type.
Must be the same as p_caid or the ID of the Shared Objects page group
(use the constant SHARED_OBJECTS).p_value - For URL type pages, the value of the URL.
For PL/SQL type pages, a block of PL/SQL code.p_plsql_execute_mode - Execute mode for a PL/SQL type page.
Use the following constants:
p_plsql_execute_user - Database user name.
Required when DB_USER execute mode is used for a PL/SQL type page.p_category_caid - Page group ID of the category for the page.
Default is the constant SHARED_OBJECTS.p_isportlet - Flag that indicates if the page is exposed as a portlet.
Use the constants YES or NO. The default value is NO.p_portlet_use_page_style - Flag that indicates which style to use
when the page is exposed as a portlet. Use the constants YES or NO.
If YES, the portlet uses the style of the page on which it appears.
If NO, the portlet uses its own page style.
The default value is YES.p_perspectives - Array of perspective IDs.p_perspectives_caid - Array of page group IDs for the perspectives
in p_perspectives. The position of each element in this array must
match the position of the corresponding perspective ID in
p_perspectives. p_perspectives_caid must be the same as p_caid or the ID of the
Shared Objects page group (use the constant SHARED_OBJECTS).p_attribute_id - Array of attribute IDs for the page.
Used only when the page is based on a custom page type.
The attribute must exist in the custom type definition,
as shown in the view WWSBR_FOLDER_TYPE_ATTRIBUTES.p_attribute_caid - Array of page group IDs for the attributes in
p_attribute_id. The position of each element in this array must
match the position of the corresponding attribute ID in p_attribute_id.
p_attribute_caid must be the same as p_caid or the ID of the Shared Objects
page group (use the constant SHARED_OBJECTS).p_attribute_data_type - Array of attribute data types for the
attributes in p_attribute_id. The value for this parameter can be
found in the DATA_TYPE column in the view WWSBR_ATTRIBUTES,
for example 'url', 'boolean', 'text', etc.
The position of each element in this array must match the position of
the corresponding attribute ID in p_attribute_id.p_attribute_value - Array of attribute values for the attributes in
p_attribute_id. All values are passed as varchar2. The position of
each element in this array must match the position of the
corresponding attribute ID in p_attribute_id.DUPLICATE_NAME - A page with p_name value already exists in
selected parent page idINVALID_NAME - Page name must not contain spaces or special charactersMISSING_NAME - Name is required for the page (p_name)MISSING_DISPLAY_NAME - Display name is required (p_display_name)NAME_TOO_LONG - The page name exceeds limit. The maximum is 60 charactersURL_REQUIRED - For a page with a base type of URL, a URL is required.
It must be passed to the p_value parameterPLSQL_REQUIRED - For a page with a base type of PLSQL, plsql code
is required. It must be passed to p_valueINVALID_PLSQL_EXECUTE_USER - The value for p_plsql_excute_user is invalidMISSING_PLSQL_EXECUTE_USER - The value for p_plsql_excute_user is missing
when plsql_execute_mode is set to DB_USERINVALID_FOLDER - Invalid parent page id
function add_item(
p_caid in number,
p_folder_id in number,
p_display_name in varchar2,
p_type_id in number,
p_type_caid in number,
p_region_id in number default null,
p_display_option in varchar2 default null,
p_category_id in number default general_category,
p_category_caid in number default shared_objects,
p_perspectives in g_perspectiveidarray default g_perspectiveidemptyarray,
p_perspectives_caid in g_caid_array default g_empty_caid_array,
p_author in varchar2 default null,
p_image_filename in varchar2 default null,
p_image_referenced in boolean default false,
p_post_upload in boolean default false,
p_image_alignment in varchar2 default null,
p_description in varchar2 default null,
p_keywords in varchar2 default null,
p_file_filename in varchar2 default null,
p_text in varchar2 default null,
p_url in varchar2 default null,
p_plsql in varchar2 default null,
p_plsql_execute_mode in varchar2 default null,
p_plsql_execute_user in varchar2 default null,
p_folderlink_id in number default null,
p_folderlink_caid in number default null,
p_publish_date in varchar2 default null,
p_expire_mode in varchar2 default permanent,
p_expiration in varchar2 default null,
p_master_item_id in number default null,
p_hide_in_browse in number default no,
p_checkable in number default null,
p_parent_item_id in number default 0,
p_attribute_id in wwsbr_type.array default wwsbr_type . empty,
p_attribute_caid in wwsbr_type.array default wwsbr_type . empty,
p_attribute_data_type in wwsbr_type.array default wwsbr_type . empty,
p_attribute_value in wwsbr_type.array default wwsbr_type . empty
) return numberIf this API is called from a browser session, the session is using a different language than the default language for the page group, and translations for the session language are enabled for the page group, this API creates a translation for an item when the item is created. For example, if the current language is set to French, the default language for the page group is English, and French translations are enabled, the API adds two rows to the item table: one with a value of 'us' (English) for language, and another with a value of 'f' (French) for language. Other than language, both rows will have identical values for all attributes, including the item ID.
To add a translation for an existing item, use the modify item APIs (modify_item, modify_item_post_upload). The modify item APIs must also be used to create new versions of existing items.
This function returns the master ID of the item, which is not the item's unique ID. To look up the ID of the item after it is created, query the view WWSBR_ALL_ITEMS where:
For example:
FUNCTION GET_ITEM_ID( p_caid IN number, p_masterid IN number )
RETURN number IS
-- the current session language
l_session_language varchar2(10) := wwctx_api.get_nls_language;
l_current_item_version number;
l_default_language varchar2(10);
BEGIN
-- get default language for page group
select distinct default_language
into l_default_language
from wwsbr_all_content_areas
where id = p_caid;
-- get the item
select i.id
into l_current_item_version
from wwsbr_all_items i
where i.masterid = p_masterid
and i.caid = p_caid
and i.active = 1
and i.is_current_version = 1
and (i.language = l_session_language
or ( i.language = l_default_language
and not exists ( -- a row for the item in the current language
select 1
from wwsbr_all_items i2
where i2.masterid = i.masterid
and i2.caid = i.caid
and i2.language = l_session_language
and i2.is_current_version = i.is_current_version
and i2.active = i.active )
)
)
order by i.id;
RETURN l_current_item_version ;
EXCEPTION
WHEN others THEN
htp.p('Error '||TO_CHAR(SQLCODE)||': '||SQLERRM);
END;
Notes:
See also add_item_post_upload().
Example:
declare
l_new_item_master_id number;
l_caid number := 33;
l_folder_id number := 13923;
l_perspective_ids wwsbr_api.g_perspectiveidarray;
l_perspective_caids wwsbr_api.g_caid_array;
begin
-- Select perspectives with name prefix = 'ENTERTAINMENT'
select id, caid
bulk collect into l_perspective_ids, l_perspective_caids
from wwsbr_all_perspectives
where caid in (l_caid, wwsbr_api.SHARED_OBJECTS)
and display_name like 'ENTERTAINMENT%';
l_new_item_master_id := wwsbr_api.add_item(
p_caid => l_caid,
p_folder_id => l_folder_id,
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.',
p_perspectives => l_perspective_ids,
p_perspectives_caid => l_perspective_caids);
-- process cache invalidation messages
wwpro_api_invalidation.execute_cache_invalidation;
end;
p_caid - ID of the page group to which the item is added.p_folder_id - ID of the page to which the item is added.p_display_name - Display name (title) for the item.p_type_id - ID of the item type for this item.
You can use one of the ITEM_TYPE constants for a supplied item type
(ITEM_TYPE_FILE, ITEM_TYPE_IMAGE, ITEM_TYPE_TEXT, etc.),
or a value from the column ID of the view WWSBR_ITEM_TYPES.
The item type must be available in the page group in which the item is
being created, and therefore listed in the view
WWSBR_CONTENT_AREA_ITEM_TYPES.p_type_caid - Page group ID for the item type.
Must be the same as p_caid or the ID of the Shared Objects page group
(use the constant SHARED_OBJECTS).p_region_id - ID of the region to which the item is added.
If no region is specified, or if the region ID is invalid, the item is
placed in the default item region defined for the page.
Use the view WWSBR_ALL_FOLDER_REGIONS to look up the region id.
Note that the valid region IDs used in 3.0.9 (values 1 - 5) are no longer
used; for backward compatibility, the item is added to the default
item region if one of these region IDs is used.p_display_option - How the item should be displayed.
Used for file, text, url, and pl/sql item types, ignored for others.
Use the following constants:
p_category_id - ID of category for the item.
Default is the constant GENERAL_CATEGORY.p_category_caid - Page group ID of category for item.
Default is the constant SHARED_OBJECTS.p_perspectives - Array of perspective IDs.p_perspectives_caid - Array of page group IDs for the perspectives in
p_perspectives. The position of each element in this array must match the
position of the corresponding perspective ID in p_perspectives.p_author - Author of the item.p_image_filename - Location of the image associated with this item
or the image itself if this is an image item.
p_image_referenced - Boolean flag that indicates if p_image_filename is a
reference, or a file location for uploading the item's image.
Valid values are TRUE (image is referenced) or FALSE (image is not
referenced and is uploaded from the file location specified
in p_image_filename).p_post_upload - Boolean flag that indicates if the documents associated
with this item have already been uploaded. Used for file and image
attributes, ignored for others. If TRUE, documents will not be uploaded
when this function is called.p_image_alignment - Rendering alignment for the item's image.
See the constants prefixed with "ALIGN_" for valid values.
Default is ALIGN_LEFT.p_description - Description of the item.p_keywords - Keywords for the item.p_file_filename - Location of the file associated with this item.
Used with the file item type, ignored for other item types.
p_text - The text for a text item type.p_url - The url for a url item type.p_plsql - The plsql code for a plsql item type.p_plsql_execute_mode - Execute mode for a PL/SQL type item.
Use the following constants: p_plsql_execute_user - Database user name.
Required when DB_USER execute mode is used for a PL/SQL type item.p_folderlink_id - Page ID for a page link item type.p_folderlink_caid - Page group ID for a page link item type.
May be any valid page group.p_publish_date - Date on which the item is published.
Must be in the format of 'dd-mon-yyyy HH12:MI PM'.
If no value is passed, the item is published immediately.p_expire_mode - Expiration mode for the item. Use the following constants:
p_expiration - Qualifier for p_expire_mode.
p_master_item_id - This parameter is DEPRECATED.
It has been retained for backward compatibility with the 3.0.9 API signature.
Do not use this parameter. Any value passed to it (other than null)
may cause errors.p_hide_in_browse - This parameter is DEPRECATED.
It has been retained for backward compatibility with the 3.0.9 API
signature, but its value is ignored.p_checkable - Flag that determines if the item can be checked out.
Valid constant values are YES and NO. Default is NO.p_parent_item_id - A MASTER item id. If passed, the new item is
created as a sub-item of this item.p_attribute_id - Array of attribute IDs for the item.
Used for attributes for which no other parameter exists
(e.g. custom attributes). The attribute must exist in the item's type
definition, as shown in the view WWSBR_ITEM_TYPE_ATTRIBUTES.p_attribute_caid - Array of page group IDs for the attributes in
p_attribute_id. The position of each element in this array must match
the position of the corresponding attribute ID in p_attribute_id.
p_attribute_caid must be the same as p_caid or the ID of the Shared Objects
page group (use the constant SHARED_OBJECTS).
Must be the same as p_caid or the ID of the Shared Objects page group
(use the constant SHARED_OBJECTS).p_attribute_data_type - Array of attribute data types for the attributes
in p_attribute_id. The value for this parameter can be found in the
DATA_TYPE column in the view WWSBR_ATTRIBUTES,
for example 'url', 'boolean', 'text', etc.
The position of each element in this array must match the position of
the corresponding attribute ID in p_attribute_id.p_attribute_value - Array of attribute values for the attributes in
p_attribute_id. All values are passed as varchar2. The position of each
element in this array must match the position of the corresponding
attribute ID in p_attribute_id.MISSING_ITEM_TYPE - No value was passed for p_type_idQUOTA_EXCEEDED - The uploaded file exceeds the page group quotaNOT_ENOUGH_PRIVS - Calling user does not have authorization to
add an item to the specified pageINVALID_PUBLISH_DATE_FORMAT - Date format for publish date is invalid.INVALID_PUBLISH_DATE_VALUE - Publish date must be today or later,
and publish date must be later than the expire dateNULL_EXPIRE_NUMBER - If value for p_expire_mode is EXP_NUMBER,
then a value is required for p_expirationINVALID_EXPIRE_NUMBER - Invalid number passed for p_expiration
(only raised if p_expire_mode = EXP_NUMBER)NULL_EXPIRE_DATE - If value for p_expire_mode is EXP_DATE,
then a value is required for p_expirationINVALID_EXPIRE_DATE - Invalid expiration date was passed.
The expiration date must be later than the current date.INVALID_EXPIRE_DATE_FORMAT - Date format for expiry date is invalidREQD_ATTR_MISSING - Required custom attribute was not passed when adding
an item for a custom item typeNO_ITEM_REGION - The page does not contain an item regionITEM_CREATION_ERROR - Some other error occurred
procedure add_item_ils_privileges(
p_master_item_id in number,
p_caid in number,
p_folder_id in number,
p_itemown_user in wwsbr_type.array default wwsbr_type . empty,
p_itemmanage_user in wwsbr_type.array default wwsbr_type . empty,
p_itemview_user in wwsbr_type.array default wwsbr_type . empty,
p_itemown_group in wwsbr_type.array default wwsbr_type . empty,
p_itemmanage_group in wwsbr_type.array default wwsbr_type . empty,
p_itemview_group in wwsbr_type.array default wwsbr_type . empty
) To retrieve a list of privileges that are currently defined for an item, use the function wwsec_api.grantee_list() (see the WWSEC_API documentation in the PDK-PL/SQL). This function takes three parameters:
'<page group ID>/<master item ID>'; e.g. '53/32919'
wwsec_api.grantee_list() returns an array (WWSEC_API.GRANTEE_ARRAY) with the following columns:
For example, the following routine prints the values of the grantee array for an item with master ID = 32919 and page group ID = 53:
DECLARE
l_grantees WWSEC_API.GRANTEE_ARRAY;
p_object_type_name VARCHAR2(5) := WWSEC_API.ITEM_OBJ;
p_name VARCHAR2(60) := '53/32919';
BEGIN
-- Call the function
l_grantees := wwsec_api.grantee_list(p_object_type_name,p_name);
-- Output the results
IF l_grantees IS NOT NULL THEN
IF l_grantees.count > 0 THEN
FOR i IN l_grantees.first..l_grantees.last LOOP
IF l_grantees.exists(i) THEN
htp.p('GRANTEE_TYPE ' || TO_CHAR(i) || '= '|| l_grantees(i).GRANTEE_TYPE);
htp.p('GRANTEE_ID ' || TO_CHAR(i) || '= '|| l_grantees(i).GRANTEE_ID);
htp.p('GRANTEE_NAME ' || TO_CHAR(i) || '= '|| l_grantees(i).GRANTEE_NAME);
htp.p('PRIVILEGE ' || TO_CHAR(i) || '= '|| l_grantees(i).PRIVILEGE);
END IF;
END LOOP;
END IF;
END IF;
EXCEPTION
WHEN OTHERS THEN
htp.p('Error '||TO_CHAR(SQLCODE)||': '||SQLERRM);
RAISE;
END;
Notes:
See also delete_ils_privilege(), enable_ils_for_item(), and inherit_folder_privileges(). modify_item() and modify_item_post_upload() can also be used to define ILS access privileges for an item.
Example:
declare
l_itemown_username_array wwsbr_type.array;
l_itemown_userid_array wwsbr_type.array;
begin
l_itemown_username_array(1) := 'jsmith';
l_itemown_username_array(2) := 'janesmith';
l_itemown_username_array(3) := 'joedoe';
for i in 1 .. l_itemown_username_array.count loop
-- get the userid from the wwsec_api.id_sso() function
l_itemown_userid_array(i) := wwsec_api.id_sso(
p_username => l_itemown_username_array(i));
end loop;
wwsbr_api.add_item_ils_privileges(
p_master_item_id => 453,
p_caid => 33,
p_folder_id => 45,
p_itemown_user => l_itemown_userid_array);
-- process cache invalidation messages
wwpro_api_invalidation.execute_cache_invalidation;
end;
p_master_item_id - Master_item_id of the item.
This value is found in the column MASTERID in the view WWSBR_ALL_ITEMS.p_caid - ID of the page group in which the item resides.p_folder_id - ID of the page on which the item resides.p_itemown_user - Array of user IDs to which Manage privilege is granted.p_itemmanage_user - Array of user IDs to which Edit privilege is granted.p_itemview_user - Array of user IDs to which View privilege is granted.p_itemown_group - Array of group IDs to which Manage privilege is granted.p_itemmanage_group - Array of group IDs to which Edit privilege is granted.p_itemview_group - Array of group IDs to which View privilege is granted.ITEM_NOT_FOUND_ERROR - An item with the given master item ID does not existILS_DISABLED - Page does not allow Item Level Security.
Cannot add item specific privilegesILS_DISABLED_FOR_ITEM - Item not set up to use own ILS privileges.
Use enable_ils_for_item() before calling this procedure for this itemNOT_ENOUGH_PRIVS - Calling user does not have the authorization to
assign the privileges. Requires Manage privilege or higher
on the item or the page.ITEM_UPDATE_ERROR - Some other error occurred during item update
function add_item_post_upload(
p_caid in number,
p_folder_id in number,
p_display_name in varchar2,
p_type_id in number,
p_type_caid in number,
p_region_id in number default null,
p_display_option in varchar2 default full_screen,
p_category_id in number default general_category,
p_category_caid in number default shared_objects,
p_perspectives in g_perspectiveidarray default g_perspectiveidemptyarray,
p_perspectives_caid in g_caid_array default g_empty_caid_array,
p_author in varchar2 default wwctx_api . get_user,
p_image_name in varchar2 default null,
p_image_alignment in varchar2 default align_left,
p_description in varchar2 default null,
p_keywords in varchar2 default null,
p_file_name in varchar2 default null,
p_text in varchar2 default null,
p_url in varchar2 default null,
p_plsql in varchar2 default null,
p_plsql_execute_mode in varchar2 default null,
p_plsql_execute_user in varchar2 default null,
p_folderlink_id in number default null,
p_folderlink_caid in number default null,
p_publish_date in varchar2 default null,
p_expire_mode in varchar2 default permanent,
p_expiration in varchar2 default null,
p_master_item_id in number default null,
p_hide_in_browse in number default no,
p_checkable in number default no,
p_parent_item_id in number default 0,
p_attribute_id in wwsbr_type.array default wwsbr_type . empty,
p_attribute_caid in wwsbr_type.array default wwsbr_type . empty,
p_attribute_data_type in wwsbr_type.array default wwsbr_type . empty,
p_attribute_value in wwsbr_type.array default wwsbr_type . empty
) return numberThis API requires that all files and images have already been uploaded to the document table in the repository. There are two methods that can be used to upload documents directly to the document table:
Both of these methods return a unique name for the uploaded document. This name must be passed to the desired file parameters in add_item_post_upload(), which include p_file_name (for a File type item), p_image_name (for an Image type item or for the image associated with other item types), or p_attribute_value for a custom file attribute. Note that in this release, there is no supported view for querying the document table to obtain the unique file name; therefore, you must call add_item_post_upload() immediately after uploading the document in order to associate it with an item.
Notes:
See also add_item() and upload_blob().
Example: see the example under upload_blob().
p_caid - ID of the page group to which the item is added.p_folder_id - ID of the page to which the item is added.p_display_name - Display name (title) for the item.p_type_id - ID of the item type for this item.
You can use one of the ITEM_TYPE constants for a supplied item type
(ITEM_TYPE_FILE, ITEM_TYPE_IMAGE, ITEM_TYPE_TEXT, etc.),
or a value from the column ID of the view WWSBR_ITEM_TYPES.
The item type must be available in the page group in which the item is
being created, and therefore listed in the view
WWSBR_CONTENT_AREA_ITEM_TYPES.p_type_caid - Page group ID for the item type.
Must be the same as p_caid or the ID of the Shared Objects page group
(use the constant SHARED_OBJECTS).p_region_id - ID of the region to which the item is added.
If no region is specified, or if the region ID is invalid, the item is
placed in the default item region defined for the page.
Use the view WWSBR_ALL_FOLDER_REGIONS to look up the region id.
Note that the valid region IDs used in 3.0.9 (values 1 - 5) are no longer
used; for backward compatibility, the item is added to the default
item region if one of these region IDs is used.p_display_option - How the item should be displayed.
Used for file, text, url, and pl/sql item types, ignored for others.
Use the following constants:
p_category_id - ID of category for the item.
Default is the constant GENERAL_CATEGORY.p_category_caid - Page group ID of category for item.
Default is the constant SHARED_OBJECTS.p_perspectives - Array of perspective IDs.p_perspectives_caid - Array of page group IDs for the perspectives in
p_perspectives. The position of each element in this array must match the
position of the corresponding perspective ID in p_perspectives.p_author - Author of the item.p_image_name - Internal document name for the item's image, matching a
document in the document table. Pass the value returned from
upload_blob() to this parameter to reference the uploaded document
as the image for this item.p_image_alignment - Rendering alignment for the item's image.
See the constants prefixed with "ALIGN_" for valid values.
Default is ALIGN_LEFT.p_description - Description of the item.p_keywords - Keywords for the item.p_file_name - Internal document name for a file type item, matching a
document in the document table. Pass the value returned from
upload_blob() to this parameter to reference the uploaded document
as the file for this item.p_text - The text for a text item type.p_url - The url for a url item type.p_plsql - The plsql code for a plsql item type.p_plsql_execute_mode - Execute mode for a PL/SQL type item.
Use the following constants:
p_plsql_execute_user - Database user name.
Required when DB_USER execute mode is used for a PL/SQL type item.p_folderlink_id - Page ID for a page link item type.p_folderlink_caid - Page group ID for a page link item type.
May be any valid page group.p_publish_date - Date on which the item is published.
Must be in the format 'dd-mon-yyyy HH12:MI PM'.
If no value is passed, the item is published immediately.p_expire_mode - Expiration mode for the item. Use the following constants:
p_expiration - Qualifier for p_expire_mode.
p_master_item_id - This parameter is DEPRECATED.
It has been retained for backward compatibility with the 3.0.9 API signature.
Do not use this parameter. Any value passed to it (other than null)
may cause errors.p_hide_in_browse - This parameter is DEPRECATED.
It has been retained for backward compatibility with the 3.0.9 API
signature, but its value is ignored.p_checkable - Flag that determines if the item can be checked out.
Valid constant values are YES and NO. Default is NO.p_parent_item_id - A MASTER item id. If passed, the new item is created
as a sub-item of this item.p_attribute_id - Array of attribute IDs for the item.
Used for attributes for which no other parameter exists
(e.g. custom attributes). The attribute must exist in the item's type
definition, as shown in the view WWSBR_ITEM_TYPE_ATTRIBUTES.p_attribute_caid - Array of page group IDs for the attributes in
p_attribute_id. The position of each element in this array must match
the position of the corresponding attribute ID in p_attribute_id.
p_attribute_caid must be the same as p_caid or the ID of the
Shared Objects page group (use the constant SHARED_OBJECTS).p_attribute_data_type - Array of attribute data types for the attributes
in p_attribute_id. The value for this parameter can be found in the
DATA_TYPE column in the view WWSBR_ATTRIBUTES,
for example 'url', 'boolean', 'text', etc.
The position of each element in this array must match the position of
the corresponding attribute ID in p_attribute_id.p_attribute_value - Array of attribute values for the attributes in
p_attribute_id. All values are passed as varchar2. The position of each
element in this array must match the position of the corresponding
attribute ID in p_attribute_id.MISSING_ITEM_TYPE - No value was passed for p_type_idQUOTA_EXCEEDED - The uploaded file exceeds the page group quotaINVALID_PUBLISH_DATE_FORMAT - Date format for publish date is invalidINVALID_PUBLISH_DATE_VALUE - Publish date must be today or later,
and publish date must be later than the expire dateNULL_EXPIRE_NUMBER - If value for p_expire_mode is EXP_NUMBER,
then a value is required for p_expirationINVALID_EXPIRE_NUMBER - Invalid number passed for p_expiration
(only raised if p_expire_mode = EXP_NUMBER)NULL_EXPIRE_DATE - If value for p_expire_mode is EXP_DATE,
then a value is required for p_expirationINVALID_EXPIRE_DATE - Invalid expiration date was passed.
The expiration date must be later than the current date.INVALID_EXPIRE_DATE_FORMAT - Date format for expiry date is invalidREQD_ATTR_MISSING - Required custom attribute was not passed when adding an
item for a custom item typeITEM_CREATION_ERROR - Some other error occurred
function add_perspective(
p_caid in number,
p_parent_id in number default 0,
p_name in varchar2,
p_display_name in varchar2,
p_description in varchar2 default null,
p_is_portlet in number default no,
p_banner_image in varchar2 default null,
p_banner_icon in varchar2 default null,
p_title_image in varchar2 default null,
p_rollover_image in varchar2 default null
) return numberTo create a new perspective, the calling user must have "Manage Classifications" privilege or higher on the page group.
Example:
l_new_perspective_id := wwsbr_api.add_perspective(
p_caid => 33,
p_parent_id => 0,
p_name => 'newperspective1',
p_display_name => 'New Perspective 1'
);
p_caid - Page group ID.p_parent_id - Parent perspective ID. If there is no parent, use "0" (zero).p_name - Internal name of the perspective.
Must be unique within parent perspective.p_display_name - Display name of the perspective.p_description - Description of the perspective.p_is_portlet - Publish perspective as a portlet? Use constant values YES or NO.p_banner_image - File location of the banner image associated with this
perspective. This value must be a directory path and filename on the same
server on which the Portal database is located (e.g. "/usr/images/banner.gif").
The image is uploaded from this location.p_banner_icon - File location of the icon image associated with this perspective.
This value must be a directory path and filename on the same server on which
the Portal database is located (e.g. "/usr/images/bannericon.gif").
The image is uploaded from this location.p_title_image - File location of the title image associated with this perspective.
This value must be a directory path and filename on the same server on which
the Portal database is located (e.g. "/usr/images/perstitle.gif").
The image is uploaded from this location.p_rollover_image - File location of the rollover image associated with this
perspective. This value must be a directory path and filename on the same server
on which the Portal database is located (e.g. "/usr/images/persrollover.gif").
The image is uploaded from this location.MISSING_NAME - No value passed for p_nameMISSING_DISPLAY_NAME - No value passed for p_display_nameINVALID_PERSPECTIVE - Parent perspective specified does not existINVALID_NAME - Invalid value passed for p_nameDUPLICATE_NAME - Perspective with same name already existsPERMISSION_DENIED - Calling user does not have the authorization
to create a perspectiveOTHERS - Unexpected error
procedure delete_ils_privilege(
p_grantee_type in varchar2 default wwsec_api . grantee_user,
p_user_or_group_id in number,
p_master_item_id in number,
p_folder_id in number,
p_caid in number
) Use the functions in the PDK-PL/SQL package WWSEC_API to retrieve privilege lists, including the user and group IDs associated with an item.
Notes:
See also add_item_ils_privileges(), enable_ils_for_item(), and inherit_folder_privileges().
Example:
declare
l_user_id number := 334;
l_page_group_id number := 75;
l_page_id number := 1;
l_item_id := 74637;
begin
wwsbr_api.delete_ils_privilege(
p_user_or_group_id => l_user_id,
p_caid => l_page_group_id,
p_folder_id => l_page_id,
p_master_item_id => l_item_id);
-- process cache invalidation messages
wwpro_api_invalidation.execute_cache_invalidation;
end;
p_grantee_type - specifies if privileges are being removed for
a user or group. Use the following constants:
p_user_or_group_id - ID of the user or group.p_master_item_id - The master_item_id of the item.
This value is found in the column MASTERID in the view WWSBR_ALL_ITEMS.p_folder_id - ID of the page on which the item resides.p_caid - ID of the page group in which the item resides.ITEM_NOT_FOUND_ERROR - An item with the given master item ID does not existNOT_ENOUGH_PRIVS - Calling user does not have the authorization to remove
the privileges. Requires Manage privilege or higher
on the item or the page.
procedure enable_ils_for_item(
p_master_item_id in number,
p_caid in number,
p_folder_id in number
) See also add_item_ils_privileges(), delete_ils_privilege(), and inherit_folder_privileges().
Example:
wwsbr_api.enable_ils_for_item(
p_master_item_id => 453,
p_caid => 33,
p_folder_id => 45);
p_master_item_id - The master_item_id of the item. This value is found
in the column MASTERID in the view WWSBR_ALL_ITEMS.p_caid - ID of the page group in which the item resides.p_folder_id - ID of the page on which the item resides.ITEM_NOT_FOUND_ERROR - An item with the given master item ID does not existILS_DISABLED - The page does not allow Item Level Security.
Cannot add item specific privileges.NOT_ENOUGH_PRIVS - Calling user does not have the authorization to assign
the privileges. Requires Manage privilege on the item or the page.
procedure inherit_folder_privileges(
p_master_item_id in number,
p_caid in number,
p_folder_id in number
) Notes:
See also add_item_ils_privileges(), delete_ils_privilege(), and enable_ils_for_item().
Example:
wwsbr_api.inherit_folder_privileges(
p_master_item_id => 453,
p_caid => 33,
p_folder_id => 45);
p_master_item_id - The master_item_id of the item. This value is found
in the column MASTERID in the view WWSBR_ALL_ITEMS.p_caid - ID of the page group in which the item resides.p_folder_id - ID of the page on which the item resides.ITEM_NOT_FOUND_ERROR - An item with the given master item ID does not existILS_DISABLED - The page does not allow Item Level Security.
Cannot add item specific privileges.NOT_ENOUGH_PRIVS - Calling user does not have the authorization to assign
the privileges. Requires Manage privilege on the item or the page.
function modify_item(
p_master_item_id in number,
p_item_id in number,
p_caid in number,
p_folder_id in number,
p_display_name in varchar2,
p_region_id in number,
p_display_option in varchar2 default full_screen,
p_category_id in number default general_category,
p_category_caid in number default shared_objects,
p_perspectives in g_perspectiveidarray default g_perspectiveidemptyarray,
p_perspectives_caid in g_caid_array default g_empty_caid_array,
p_author in varchar2 default wwctx_api . get_user,
p_image_filename in varchar2 default null,
p_image_referenced in boolean default false,
p_post_upload in boolean default false,
p_image_alignment in varchar2 default align_left,
p_description in varchar2 default null,
p_keywords in varchar2 default null,
p_file_filename in varchar2 default null,
p_text in varchar2 default null,
p_url in varchar2 default null,
p_plsql in varchar2 default null,
p_plsql_execute_mode in varchar2 default null,
p_plsql_execute_user in varchar2 default null,
p_folderlink_id in number default null,
p_folderlink_caid in number default null,
p_publish_date in varchar2 default null,
p_expire_mode in varchar2 default permanent,
p_expiration in varchar2 default null,
p_hide_in_browse in number default no,
p_checkable in number default no,
p_attribute_id in wwsbr_type.array default wwsbr_type . empty,
p_attribute_caid in wwsbr_type.array default wwsbr_type . empty,
p_attribute_data_type in wwsbr_type.array default wwsbr_type . empty,
p_attribute_value in wwsbr_type.array default wwsbr_type . empty,
p_addnewversion in boolean default false,
p_access_level in varchar2 default null,
p_userlist in wwsbr_type.array default wwsbr_type . empty,
p_grouplist in wwsbr_type.array default wwsbr_type . empty,
p_itemown_user in wwsbr_type.array default wwsbr_type . empty,
p_itemmanage_user in wwsbr_type.array default wwsbr_type . empty,
p_itemview_user in wwsbr_type.array default wwsbr_type . empty,
p_itemown_group in wwsbr_type.array default wwsbr_type . empty,
p_itemmanage_group in wwsbr_type.array default wwsbr_type . empty,
p_itemview_group in wwsbr_type.array default wwsbr_type . empty
) return numberDo not use this API to modify any item that does not have an ACTIVE value of 1. In this release, the API cannot be used to modify pending, rejected, or deleted items.
If this API is called from a browser session, the session is using a different language than the default language for the page group, and translations for the session language are enabled for the page group, this API will update the translation for that language, if it exists. If a translation for a translation-enabled session language does not exist, a new translation is created with the values passed to the function.
You must pass both the item's MASTERID to identify the item and its ID to identify the specific version of the item that is to be updated. The specified ID does not have to be the current version of the item. If p_addnewversion = TRUE, a new version is created for the item. The new version is given a new ID. New versions created with this API are always immediately published as the current version of the item.
In this release (9.0.2.6), this API modifies the value of every attribute, even if the attribute is not passed in the parameter list. If an attribute is not passed, its value will revert to the default value of the parameter. If you want to preserve the current value of attributes, you must retrieve those values for the item and pass them to this API. The value of attributes can be retrieved from the following views and APIs:
See also add_item(), modify_item_post_upload().
Example:
declare
l_item_master_id number;
begin
l_item_master_id := wwsbr_api.modify_item(
p_master_item_id => 453,
p_item_id => 454,
p_caid => 33,
p_folder_id => 45,
p_display_name => 'Movie Review',
p_region_id => 5,
p_text => 'This is the text of the review.');
-- process cache invalidation messages
wwpro_api_invalidation.execute_cache_invalidation;
end;
p_master_item_id - Required to identify the item that is modified.
You can look up this value in the MASTERID column in the view WWSBR_ALL_ITEMS.p_item_id - Required to identify the version of the item that is modified.
This does not have to be the item's current version.p_caid - ID of the item's page group.p_folder_id - ID of the item's page.p_display_name - Display name (title) for the item.p_region_id - ID of the region in which the item resides.
This parameter cannot be used to move an item to a different region.
You must pass the ID of the region that currently contains the item.p_display_option - How the item should be displayed.
Used for file, text, url, and pl/sql item types, ignored for others.
Use the following constants:
p_category_id - ID of category for the item.
Default is the constant GENERAL_CATEGORY.p_category_caid - Page group ID of category for item.
Default is the constant SHARED_OBJECTS.p_perspectives - Array of perspective IDs.p_perspectives_caid - Array of page group IDs for the perspectives in
p_perspectives. The position of each element in this array must match the
position of the corresponding perspective ID in p_perspectives.p_author - Author of the item.p_image_filename - Location of the image associated with this item
or the image itself if this is an image item.
p_image_referenced - Boolean flag that indicates if p_image_filename is a
reference, or a file location for uploading the item's image.
Valid values are TRUE (image is referenced) or FALSE (image is not
referenced and is uploaded from the file location specified in p_image_filename).p_post_upload - Boolean flag that indicates if the documents associated
with this item have already been uploaded. Used for file and image
attributes, ignored for others. If TRUE, documents will not be uploaded
when this function is called.p_image_alignment - Rendering alignment for the item's image.
See the constants prefixed with "ALIGN_" for valid values.
Default is ALIGN_LEFT.p_description - Description of the item.p_keywords - Keywords for the item.p_file_filename - Location of the file associated with this item.
Used with the file item type, ignored for other item types.
p_text - The text for a text item type.p_url - The url for a url item type.p_plsql - The plsql code for a plsql item type.p_plsql_execute_mode - Execute mode for a PL/SQL type item.
Use the following constants: p_plsql_execute_user - Database user name.
Required when DB_USER execute mode is used for a PL/SQL type item.p_folderlink_id - Page ID for a page link item type.p_folderlink_caid - Page group ID for a page link item type.
May be any valid page group.p_publish_date - Date on which the item is published.
Must be in the format 'dd-mon-yyyy HH12:MI PM'.
If no value is passed, the item is published immediately.p_expire_mode - Expiration mode for the item. Use the following constants:
p_expiration - Qualifier for p_expire_mode.
p_hide_in_browse - This parameter is DEPRECATED.
It has been retained for backward compatibility with the 3.0.9 API
signature. Its value is ignored.p_checkable - Flag that determines if the item can be checked out.
Valid constant values are YES and NO. Default is NO.p_attribute_id - Array of attribute IDs for the item.
Used for attributes for which no other parameter exists
(e.g. custom attributes). The attribute must exist in the item's type
definition, as shown in the view WWSBR_ITEM_TYPE_ATTRIBUTES.p_attribute_caid - Array of page group IDs for the attributes in
p_attribute_id. The position of each element in this array must match
the position of the corresponding attribute ID in p_attribute_id.
p_attribute_caid must be the same as p_caid or the ID of the Shared Objects
page group (use the constant SHARED_OBJECTS).p_attribute_data_type - Array of attribute data types for the attributes
in p_attribute_id. The value for this parameter can be found in the
DATA_TYPE column in the view WWSBR_ATTRIBUTES,
for example 'url', 'boolean', 'text', etc.
The position of each element in this array must match the position of
the corresponding attribute ID in p_attribute_id.p_attribute_value - Array of attribute values for the attributes in
p_attribute_id. All values are passed as varchar2. The position of each
element in this array must match the position of the corresponding
attribute ID in p_attribute_id.p_addnewversion - Boolean flag.
If TRUE, adds a new version of the item.
If FALSE, updates the current version.
Default is FALSE.
Must be set to FALSE when the versioning property for the page is set to NONE.
Must be set to TRUE when the versioning property for the page is set to AUDIT.p_access_level - Determines the access control level for the item.
Use the following constant values:p_userlist - This parameter is DEPRECATED. It has been retained for backward
compatibility with the 3.0.9 API signature. Its value is ignored.p_grouplist - This parameter is DEPRECATED. It has been retained for backward
compatibility with the 3.0.9 API signature. Its value is ignored.p_itemown_user - Array of user IDs to which Manage privilege is grantedp_itemmanage_user - Array of user IDs to which Edit privilege is grantedp_itemview_user - Array of user IDs to which View privilege is grantedp_itemown_group - Array of group IDs to which Manage privilege is grantedp_itemmanage_group - Array of group IDs to which Edit privilege is grantedp_itemview_group - Array of group IDs to which view privilege is grantedITEM_NOT_FOUND_ERROR - An item with the given master item ID and ID
does not existFOLDER_VERSIONING_IS_NONE - Attempted to add a new version
when page versioning is set to NONEFOLDER_VERSIONING_IS_AUDIT - Attempted to update the current version
when page versioning is set to AUDITILS_DISABLED - Attempted to set item level access privileges
when Item Level Security is not enabled for the pageQUOTA_EXCEEDED - Uploaded file exceeds the page group quotaINVALID_PUBLISH_DATE_FORMAT - Date format for publish date is invalidINVALID_PUBLISH_DATE_VALUE - Publish date must be today or later
and publish date must be later than the expire dateNULL_EXPIRE_NUMBER - If value for p_expire_mode is EXP_NUMBER,
then a value is required for p_expirationINVALID_EXPIRE_NUMBER - Invalid number passed for p_expiration
(only raised if p_expire_mode = EXP_NUMBER)NULL_EXPIRE_DATE - If value for p_expire_mode is EXP_DATE,
then a value is required for p_expirationINVALID_EXPIRE_DATE - An invalid expiration date was passed.
The expiration date must be later than the current date.INVALID_EXPIRE_DATE_FORMAT - Date format for expiry date is invalidITEM_UPDATE_ERROR - Some other error occurredUNKNOWN_ERROR - An unknown error occurred
function modify_item_post_upload(
p_master_item_id in number,
p_item_id in number,
p_caid in number,
p_folder_id in number,
p_display_name in varchar2,
p_region_id in number,
p_display_option in varchar2 default full_screen,
p_category_id in number default general_category,
p_category_caid in number default shared_objects,
p_perspectives in g_perspectiveidarray default g_perspectiveidemptyarray,
p_perspectives_caid in g_caid_array default g_empty_caid_array,
p_author in varchar2 default wwctx_api . get_user,
p_image_name in varchar2 default null,
p_image_alignment in varchar2 default align_left,
p_description in varchar2 default null,
p_keywords in varchar2 default null,
p_file_name in varchar2 default null,
p_text in varchar2 default null,
p_url in varchar2 default null,
p_plsql in varchar2 default null,
p_plsql_execute_mode in varchar2 default null,
p_plsql_execute_user in varchar2 default null,
p_folderlink_id in number default null,
p_folderlink_caid in number default null,
p_publish_date in varchar2 default null,
p_expire_mode in varchar2 default permanent,
p_expiration in varchar2 default null,
p_hide_in_browse in number default no,
p_checkable in number default no,
p_attribute_id in wwsbr_type.array default wwsbr_type . empty,
p_attribute_caid in wwsbr_type.array default wwsbr_type . empty,
p_attribute_data_type in wwsbr_type.array default wwsbr_type . empty,
p_attribute_value in wwsbr_type.array default wwsbr_type . empty,
p_addnewversion in boolean default false,
p_access_level in varchar2 default null,
p_userlist in wwsbr_type.array default wwsbr_type . empty,
p_grouplist in wwsbr_type.array default wwsbr_type . empty,
p_itemown_user in wwsbr_type.array default wwsbr_type . empty,
p_itemmanage_user in wwsbr_type.array default wwsbr_type . empty,
p_itemview_user in wwsbr_type.array default wwsbr_type . empty,
p_itemown_group in wwsbr_type.array default wwsbr_type . empty,
p_itemmanage_group in wwsbr_type.array default wwsbr_type . empty,
p_itemview_group in wwsbr_type.array default wwsbr_type . empty
) return numberDo not use this API to modify any item that does not have an ACTIVE value of 1. In this release, the API cannot be used to modify pending, rejected, or deleted items.
This API requires that all files and images have already been uploaded to the document table. using the methods described under add_item_post_upload().
Notes:
See also modify_item(), add_item_post_upload(), and upload_blob().
Example:
declare
l_blob blob;
l_blob_filename varchar2(250) := 'new doc through blob';
l_mime_type varchar2(100) := 'text/plain';
l_doc_name varchar2(500);
l_description varchar2(1000);
l_display_name varchar2(300);
l_item_masterthing_id number;
begin
-- your calling application must define the get_blob() function
l_blob := get_blob();
l_doc_name := wwsbr_api.upload_blob(
p_file_name => l_blob_filename,
p_blob => l_blob,
p_mime_type => l_mime_type
);
l_display_name := l_blob_filename;
l_description := 'BLOB API File Item internal doc name=' || l_doc_name;
--
-- use modify_item_post_upload() to associate the blob with an item.
--
l_item_masterthing_id := wwsbr_api.modify_item_post_upload(
p_master_item_id => 453,
p_item_id => 454,
p_caid => 33,
p_folder_id => 45,
p_display_name => l_display_name,
p_region_id => 5,
p_file_name => l_doc_name,
p_description => l_description
);
-- process cache invalidation messages
wwpro_api_invalidation.execute_cache_invalidation;
end;
p_master_item_id - Required to identify the item that is modified.
You can look up this value in the MASTERID column in the view WWSBR_ALL_ITEMS.p_item_id - Required to identify the version of the item that is modified.
This does not have to be the item's current version.p_caid - ID of the item's page group.p_folder_id - ID of the item's page.p_display_name - Display name (title) for the item.p_region_id - ID of the region in which the item resides.
This parameter cannot be used to move an item to a different region.
You must pass the ID of the region that currently contains the item.p_display_option - How the item should be displayed.
Used for file, text, url, and pl/sql item types, ignored for others.
Use the following constants:
p_category_id - ID of category for the item.
Default is the constant GENERAL_CATEGORY.p_category_caid - Page group ID of category for item.
Default is the constant SHARED_OBJECTS.p_perspectives - Array of perspective IDs.p_perspectives_caid - Array of page group IDs for the perspectives in
p_perspectives. The position of each element in this array must match the
position of the corresponding perspective ID in p_perspectives.p_author - Author of the item.p_image_name - Internal document name for the item's image, matching a document
in the document table. Pass the value returned from upload_blob() to this
parameter to reference the uploaded document as the image for this item.p_image_alignment - Rendering alignment for the item's image.
See the constants prefixed with "ALIGN_" for valid values.
Default is ALIGN_LEFT.p_description - Description of the item.p_keywords - Keywords for the item.p_file_name - Internal document name for a file type item, matching a document
in the document table. Pass the value returned from upload_blob() to this
parameter to reference the uploaded document as the file for this item.p_text - The text for a text item type.p_url - The url for a url item type.p_plsql - The plsql code for a plsql item type.p_plsql_execute_mode - Execute mode for a PL/SQL type item.
Use the following constants: p_plsql_execute_user - Database user name.
Required when DB_USER execute mode is used for a PL/SQL type item.p_folderlink_id - Page ID for a page link item type.p_folderlink_caid - Page group ID for a page link item type.
May be any valid page group.p_publish_date - Date on which the item is published.
Must be in the format 'dd-mon-yyyy HH12:MI PM'.
If no value is passed, the item is published immediately.p_expire_mode - Expiration mode for the item. Use the following constants:
p_expiration - Qualifier for p_expire_mode.
p_hide_in_browse - This parameter is DEPRECATED.
It has been retained for backward compatibility with the 3.0.9 API
signature. Its value is ignored.p_checkable - Flag that determines if the item can be checked out.
Valid constant values are YES and NO. Default is NO.p_attribute_id - Array of attribute IDs for the item.
Used for attributes for which no other parameter exists
(e.g. custom attributes). The attribute must exist in the item's type
definition, as shown in the view WWSBR_ITEM_TYPE_ATTRIBUTES.p_attribute_caid - Array of page group IDs for the attributes in
p_attribute_id. The position of each element in this array must match
the position of the corresponding attribute ID in p_attribute_id.
Must be the same as p_caid or the ID of the Shared Objects page group
(use the constant SHARED_OBJECTS).p_attribute_data_type - Array of attribute data types for the attributes
in p_attribute_id. The value for this parameter can be found in the
DATA_TYPE column in the view WWSBR_ATTRIBUTES,
for example 'url', 'boolean', 'text', etc.
The position of each element in this array must match the position of
the corresponding attribute ID in p_attribute_id.p_attribute_value - Array of attribute values for the attributes in
p_attribute_id. All values are passed as varchar2. The position of each
element in this array must match the position of the corresponding
attribute ID in p_attribute_id.p_addnewversion - Boolean flag.
If TRUE, adds a new version of the item.
If FALSE, updates the current version.
Default is FALSE.
Must be set to FALSE when the versioning property for the page is set to NONE.
Must be set to TRUE when the versioning property for the page is set to AUDIT.p_access_level - Determines the access control level for the item.
Use the following constant values:p_userlist - This parameter is DEPRECATED. It has been retained for backward
compatibility with the 3.0.9 API signature. Its value is ignored.p_grouplist - This parameter is DEPRECATED. It has been retained for backward
compatibility with the 3.0.9 API signature. Its value is ignored.p_itemown_user - Array of user IDs to which Manage privilege is grantedp_itemmanage_user - Array of user IDs to which Edit privilege is grantedp_itemview_user - Array of user IDs to which View privilege is grantedp_itemown_group - Array of group IDs to which Manage privilege is grantedp_itemmanage_group - Array of group IDs to which Edit privilege is grantedp_itemview_group - Array of group IDs to which view privilege is grantedITEM_NOT_FOUND_ERROR - An item with the given master item ID and ID
does not existFOLDER_VERSIONING_IS_NONE - Attempted to add a new version
when page versioning is set to NONEFOLDER_VERSIONING_IS_AUDIT - Attempted to update the current version
when page versioning is set to AUDITILS_DISABLED - Attempted to set item level access privileges
when Item Level Security is not enabled for the pageQUOTA_EXCEEDED - Uploaded file exceeds the page group quotaINVALID_PUBLISH_DATE_FORMAT - Date format for publish date is invalidINVALID_PUBLISH_DATE_VALUE - Publish date must be today or later
and publish date must be later than the expire dateNULL_EXPIRE_NUMBER - If value for p_expire_mode is EXP_NUMBER,
then a value is required for p_expirationINVALID_EXPIRE_NUMBER - Invalid number passed for p_expiration
(only raised if p_expire_mode = EXP_NUMBER)NULL_EXPIRE_DATE - If value for p_expire_mode is EXP_DATE,
then a value is required for p_expirationINVALID_EXPIRE_DATE - An invalid expiration date was passed.
The expiration date must be later than the current date.INVALID_EXPIRE_DATE_FORMAT - Date format for expiry date is invalidITEM_UPDATE_ERROR - Some other error occurredUNKNOWN_ERROR - An unknown error occurred
procedure move_folder(
p_folder_id in number,
p_dest_folder_id in number,
p_caid in number
)
procedure move_item(
p_master_item_id in number,
p_dest_page_id in number,
p_dest_region_id in number default null,
p_caid in number
)
function upload_blob(
p_file_name in varchar2,
p_blob in blob,
p_mime_type in varchar2
) return varchar2Uploads document content to the document table as an unclaimed document. This API returns a unique document name that can be used in file name and image name attributes in add_item_post_upload() and modify_item_post_upload().
To use this function, your calling application must declare a blob and assign it to an object compatible with the database blob data type (see the Application Developer's Guide - Large Objects (LOBS) in the Oracle9i Database documentation set). The object can then be passed to the p_blob parameter of this function.
Document content can also be loaded through the add_item() and modify_item() APIs. However, these functions require that the document reside on the same server as the database. This limitation does not apply to the upload_blob() function.
See also add_item_post_upload(), modify_item_post_upload().
Example:
declare
l_blob blob;
l_blob_filename varchar2(250) := 'new doc through blob';
l_mime_type varchar2(100) := 'text/plain';
l_doc_name varchar2(500);
l_display_name varchar2(300);
l_region_id number := 605;
l_file_name varchar2(100);
l_image_name varchar2(100);
l_site_id number := 33;
l_page_id number := 1;
l_item_type_id number := wwsbr_api.ITEM_TYPE_FILE;
l_item_type_siteid number := wwsbr_api.SHARED_OBJECTS;
l_region_id number := 605;
l_description varchar2(1000);
l_display_name varchar2(300);
l_item_masterthing_id number;
begin
-- your calling application must define the get_blob() function
l_blob := get_blob();
l_doc_name := wwsbr_api.upload_blob(
p_file_name => l_blob_filename,
p_blob => l_blob,
p_mime_type => l_mime_type
);
l_display_name := l_blob_filename;
if l_item_type_id = wwsbr_api.ITEM_TYPE_FILE then
l_image_name := null;
l_file_name := l_doc_name;
l_description := 'BLOB API File Item internal doc name=' || l_doc_name;
elsif l_item_type_id = wwsbr_api.ITEM_TYPE_IMAGE then
l_image_name := l_doc_name;
l_file_name := null;
l_description := 'BLOB API Image Item internal doc name=' || l_doc_name;
end if;
--
-- use add_item_post_upload() to add the item to portal.
--
l_item_masterthing_id := wwsbr_api.add_item_post_upload(
p_caid => l_site_id,
p_folder_id => l_page_id,
p_display_name => l_display_name,
p_file_name => l_file_name,
p_image_name => l_image_name,
p_type_id => l_item_type_id,
p_type_caid => l_item_type_siteid,
p_region_id => l_region_id,
p_description => l_description
);
-- process cache invalidation messages
wwpro_api_invalidation.execute_cache_invalidation;
p_file_name - File name to be assigned to the blob. This is not the value
returned by this function. Normally, this value is the file name by which
the document is known on the source file system
(e.g. "index.htm", "Expense Report.xls", etc.).p_blob - The blob containing the content.p_mime_type - The mime_type for the blob.CANNOT_INSERT_DOCUMENT - The blob could not be inserted in the document table
| Oracle Application Server Portal PL/SQL API Reference - 904 | |||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | |||||||
| SUMMARY: EXCEPTION | TYPE | CONSTANT | VARIABLE | FUNCTION/PROCEDURE | DETAIL: EXCEPTION | TYPE | CONSTANT | VARIABLE | FUNCTION/PROCEDURE | |||||||