Wwsbr_api.upload_blob

Hello,
Has anybody used this function successfully yet? I am trying to use it, unfortunately, I am not that experienced in working with blobs and I am getting lost.
I understand most of the code in the sample that comes with the package, however, I keep tripping on the get_blob() function. I have skimmed through the dbms_lob package but everything seems to be focused on inserting the blob into a table. How do I create a function like get_blob() that will download the file/document into a blob variable?
Can somebody please give some sample code or step by step instructions.
Thank you in advance for your help,
Steve

Hello,
Has anybody used this function successfully yet? I
am trying to use it, unfortunately, I am not that
experienced in working with blobs and I am getting
lost.
I understand most of the code in the sample that
comes with the package, however, I keep tripping on
the get_blob() function. I have skimmed through the
dbms_lob package but everything seems to be focused
on inserting the blob into a table. How do I create
a function like get_blob() that will download the
file/document into a blob variable?
Can somebody please give some sample code or step by
step instructions.
Thank you in advance for your help,
SteveWere you ever able to resolve this issue? I am having a similar issue now.

Similar Messages

  • Length of the p_file_name in wwsbr_api.upload_blob

    Hi,
    I am uploading blob file on portal 10 with
    wwsbr_api.upload_blob (
    p_file_name => p_doc_name,
    p_blob => l_doc_content.doc,
    p_mime_type => l_doc_content.mime_type)
    the problem i have is that if the length of the p_file_name exceed 60 char it is truncated, i don't know if there is a way to load the entire file name or it is a limit of the system.
    Can u help
    Thks in advance

    Hello,
    Has anybody used this function successfully yet? I
    am trying to use it, unfortunately, I am not that
    experienced in working with blobs and I am getting
    lost.
    I understand most of the code in the sample that
    comes with the package, however, I keep tripping on
    the get_blob() function. I have skimmed through the
    dbms_lob package but everything seems to be focused
    on inserting the blob into a table. How do I create
    a function like get_blob() that will download the
    file/document into a blob variable?
    Can somebody please give some sample code or step by
    step instructions.
    Thank you in advance for your help,
    SteveWere you ever able to resolve this issue? I am having a similar issue now.

  • Upload using upload_blob

    I want to upload a document in Portal from a custom form.
    I understand that I should use the function wwsbr_api.upload_blob and then use add_item_post_upload.
    However I do not understand how to use upload_blob from a client browser.
    The upload_blob receives a blob as parameter. My question is how can I load this blob from the http stream?
    I would like to define a PL/SQL procedure that will be the action of the "multipart/form-data" form. This procedure should load the BLOB from the HTTP stream before calling upload_blob procedure. I did not understand how to do this in PL/SQL.
    Does someone have an example or am I going in the wrong way ?
    The best explanation I found is there but if I understand something is missing: http://download-uk.oracle.com/docs/cd/B14099_15/portal.1014/b14135/pdg_cm_extend.htm#BEIEIIIA
    Thank you.

    I want to upload a document in Portal from a custom form.
    I understand that I should use the function wwsbr_api.upload_blob and then use add_item_post_upload.
    However I do not understand how to use upload_blob from a client browser.
    The upload_blob receives a blob as parameter. My question is how can I load this blob from the http stream?
    I would like to define a PL/SQL procedure that will be the action of the "multipart/form-data" form. This procedure should load the BLOB from the HTTP stream before calling upload_blob procedure. I did not understand how to do this in PL/SQL.
    Does someone have an example or am I going in the wrong way ?
    The best explanation I found is there but if I understand something is missing: http://download-uk.oracle.com/docs/cd/B14099_15/portal.1014/b14135/pdg_cm_extend.htm#BEIEIIIA
    Thank you.

  • File and boolean attribute on item

    Hi,
    I work with Oracle9iAS Portal PL/SQL API (9.0.2.6).
    I define an item type (CAID = 213/ ID = 37399) with several attributes. When I try to create/modify an item I have problems with boolean attributes and file attributes.
    In case of boolean attributes, I'm not able to set the value to true. I try with several values (IS_ON, True, 1) but the attribute is still set to false. Is there anything wrong with the value I assign to the attribute before creating the item ? When I try to create the item and then modifying the attribute, the value stay to false.
    For the file attributes, I use the upload_blob function inside wwsbr_api and the file appear in the wwdoc_document table. I set the file attribute value with the return value of the upload_blob function.
    When I call the add_item_post_upload, an error occurs (ORA-29532: Java call terminated by uncaught Java exception: java.lang.NullPointerException : -29532)
    Is this a bug or not ?
    Thanks Eddy.
    For help see my sample code below :
    (ID of attribute, page, region are correct. I also test each type of attribute separately)
    declare
    l_master NUMBER;
    l_store portal.wwsto_api_session;
    l_custom_attribute portal.wwsbr_type.array := portal.wwsbr_type.empty;
    l_custom_attribute_id portal.wwsbr_type.array := portal.wwsbr_type.empty;
    l_custom_attribute_caid portal.wwsbr_type.array := portal.wwsbr_type.empty;
    l_custom_attribute_data_type portal.wwsbr_type.array := portal.wwsbr_type.empty;
    l_str VARCHAR2(100);
    l_Blob BLOB;
    l_filename VARCHAR2(100);
    begin
    -- set context
    portal.wwctx_api.SET_CONTEXT('ctx','ctx01','');
    -- load a session (Allow use of set_Attribute ...)
    DBMS_OUTPUT.put_line('Load session');
    l_store := portal.wwsto_api_session.load_session('ctx','ctx');
    -- set parameters
    -- item type = 'Item_ed'
    l_store.set_attribute('ITEM_TYPE', 37399); -- Item type id
    l_store.set_attribute('ITEM_CAID', 213); -- Item type caid (page group owner of item type)
    l_store.set_attribute('PAGE_GROUP_ID', 213); -- Page group
    l_store.set_attribute('FOLDER_ID', 37179); -- Page within page group
    l_store.set_attribute('REGION_ID', 3216); -- Region id within page
    -- see wwv_user_corners to determine template of page
    -- see wwsbr_all_folder_regions for region display_name and region id (for template)
    -- Get date format to insert right date string
    SELECT DISTINCT value
    INTO l_str
    FROM v$nls_parameters
    WHERE parameter = 'NLS_DATE_FORMAT';
    dbms_output.put_line('date format ins : ' || l_str);
    -- define attributes (for example, id are hardcoded
    DBMS_OUTPUT.put_line('Define attributes');
    -- 1080 = PRODUCT_CODE
    l_custom_attribute(1) := 'MEHI';
    l_custom_attribute_id(1) := 1080;
    l_custom_attribute_caid(1) := portal.wwsbr_api.SHARED_OBJECTS; -- = 0
    l_custom_attribute_data_type(1) := 'text';
    -- 1081 = PRODUCT_AUTHOR
    l_custom_attribute(2) := 'ESTAT';
    l_custom_attribute_id(2) := 1081;
    l_custom_attribute_caid(2) := portal.wwsbr_api.SHARED_OBJECTS; -- = 0
    l_custom_attribute_data_type(2) := 'text';
    -- 1469 = LANGUAGE
    l_custom_attribute(3) := 'fr';
    l_custom_attribute_id(3) := 1469;
    l_custom_attribute_caid(3) := portal.wwsbr_api.SHARED_OBJECTS; -- = 0
    l_custom_attribute_data_type(3) := 'text';
    -- 3 = title
    l_custom_attribute(4) := 'title value';
    l_custom_attribute_id(4) := 3;
    l_custom_attribute_caid(4) := portal.wwsbr_api.SHARED_OBJECTS; -- = 0
    l_custom_attribute_data_type(4) := 'text';
    -- 50 = wwsbr_text_
    l_custom_attribute(5) := 'wwsbr_text_ value';
    l_custom_attribute_id(5) := 50;
    l_custom_attribute_caid(5) := portal.wwsbr_api.SHARED_OBJECTS; -- = 0
    l_custom_attribute_data_type(5) := 'text';
    -- 1464 = Release date
    l_custom_attribute(6) := TO_CHAR(TO_DATE('21-JAN-2004 10:00 AM', 'DD-MON-YYYY HH12:MI PM'),l_str);
    l_custom_attribute_id(6) := 1464;
    l_custom_attribute_caid(6) := portal.wwsbr_api.SHARED_OBJECTS; -- = 0
    l_custom_attribute_data_type(6) := 'date';
    -- 1108 = download
    l_custom_attribute(7) := 'http://www.oracle.com/';
    l_custom_attribute_id(7) := 1108;
    l_custom_attribute_caid(7) := portal.wwsbr_api.SHARED_OBJECTS; -- = 0
    l_custom_attribute_data_type(7) := 'url';
    -- 1485 = CDROM
    l_custom_attribute(8) := '1';
    l_custom_attribute_id(8) := 1485;
    l_custom_attribute_caid(8) := portal.wwsbr_api.SHARED_OBJECTS; -- = 0
    l_custom_attribute_data_type(8) := 'boolean';
    -- 1111 = PAGE_NB
    l_custom_attribute(8) := '1';
    l_custom_attribute_id(8) := 1111;
    l_custom_attribute_caid(8) := portal.wwsbr_api.SHARED_OBJECTS; -- = 0
    l_custom_attribute_data_type(8) := 'number';
    -- 1783 = COVER_IMAGE
    -- get image
    SELECT BANNER
    INTO l_Blob
    FROM metadata_tbl
    WHERE PRODUCT_CODE = 'caa10000';
    -- upload image in repository
    l_filename := portal.wwsbr_api.upload_blob('BANNERupload',l_Blob, 'image/pjpeg');
    DBMS_OUTPUT.put_line('filename : ' || l_filename);
    l_custom_attribute(9) := l_filename;
    l_custom_attribute_id(9) := 1783;
    l_custom_attribute_caid(9) := portal.wwsbr_api.SHARED_OBJECTS; -- = 0
    l_custom_attribute_data_type(9) := 'file';
    DBMS_OUTPUT.put_line('Insert item starts');
    l_master := portal.wwsbr_api.add_item_post_upload(
    p_caid => l_store.get_attribute_as_number('PAGE_GROUP_ID'),
    p_folder_id => l_store.get_attribute_as_number('FOLDER_ID'),
    p_display_name => 'Insert : MEHI',
    p_type_id => l_store.get_attribute_as_number('ITEM_TYPE'),
    p_type_caid => l_store.get_attribute_as_number('ITEM_CAID'),
    p_region_id => l_store.get_attribute_as_number('REGION_ID'), --to set or default
    p_display_option => portal.WWSBR_API.IN_PLACE,
    -- 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 => l_filename,
    -- p_image_alignment in varchar2 default align_left,
    -- p_description in varchar2 default null,
    -- p_keywords in varchar2 default null,
    -- p_file_name =>l_filename, --in varchar2 default null,
    p_text => 'text field',
    -- 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 => l_custom_attribute_id,
    p_attribute_caid => l_custom_attribute_caid,
    p_attribute_data_type => l_custom_attribute_data_type,
    p_attribute_value => l_custom_attribute
    DBMS_OUTPUT.put_line('Insert item ends. Item identifier : ' || l_master);
    -- Invalidate cache from SQLPLUS
    portal.wwpro_api_invalidation.execute_cache_invalidation;
    DBMS_OUTPUT.put_line('Cache invalidated');
    -- Drop session
    portal.wwsto_api_session.drop_session('ctx','ctx');
    -- Clean context
    portal.wwctx_api.clear_context;
    COMMIT;
    exception
    WHEN portal.wwctx_api.AUTHENTICATION_EXCEPTION THEN
    DBMS_OUTPUT.PUT_LINE('AUTHENTICATION_EXCEPTION : ' || sqlerrm);
    ROLLBACK;
    WHEN portal.wwsbr_api.CANNOT_INSERT_DOCUMENT THEN
    DBMS_OUTPUT.PUT_LINE('CANNOT INSERT DOCUMENT : ' || sqlerrm);
    ROLLBACK;
    WHEN portal.wwsbr_api.DUPLICATE_FOLDER THEN
    DBMS_OUTPUT.PUT_LINE('DUPLICATE_FOLDER : ' || sqlerrm);
    ROLLBACK;
    WHEN portal.wwsbr_api.DUPLICATE_ID THEN
    DBMS_OUTPUT.PUT_LINE('DUPLICATE_ID : ' || sqlerrm);
    ROLLBACK;
    WHEN portal.wwsbr_api.DUPLICATE_NAME THEN
    DBMS_OUTPUT.PUT_LINE('DUPLICATE_NAME : ' || sqlerrm);
    ROLLBACK;
    WHEN portal.wwsbr_api.FOLDER_VERSIONING_IS_AUDIT THEN
    DBMS_OUTPUT.PUT_LINE('FOLDER_VERSIONING_IS_AUDIT : ' || sqlerrm);
    ROLLBACK;
    WHEN portal.wwsbr_api.FOLDER_VERSIONING_IS_NONE THEN
    DBMS_OUTPUT.PUT_LINE('FOLDER_VERSIONING_IS_AUDIT : ' || sqlerrm);
    ROLLBACK;
    WHEN portal.wwsbr_api.ILS_DISABLED THEN
    DBMS_OUTPUT.PUT_LINE('ILS_DISABLED : ' || sqlerrm);
    ROLLBACK;
    WHEN portal.wwsbr_api.ILS_DISABLED_FOR_ITEM THEN
    DBMS_OUTPUT.PUT_LINE('ILS_DISABLED_FOR_ITEM : ' || sqlerrm);
    ROLLBACK;
    WHEN portal.wwsbr_api.INVALID_CAID THEN
    DBMS_OUTPUT.PUT_LINE('INVALID CAID : ' || sqlerrm);
    ROLLBACK;
    WHEN portal.wwsbr_api.INVALID_CATEGORY THEN
    DBMS_OUTPUT.PUT_LINE('INVALID CATEGORY : ' || sqlerrm);
    ROLLBACK;
    WHEN portal.wwsbr_api.INVALID_EXPIRE_DATE THEN
    DBMS_OUTPUT.PUT_LINE('INVALID_EXPIRE_DATE : ' || sqlerrm);
    ROLLBACK;
    WHEN portal.wwsbr_api.INVALID_EXPIRE_DATE_FORMAT THEN
    DBMS_OUTPUT.PUT_LINE('INVALID_EXPIRE_DATE_FORMAT : ' || sqlerrm);
    ROLLBACK;
    WHEN portal.wwsbr_api.INVALID_EXPIRE_NUMBER THEN
    DBMS_OUTPUT.PUT_LINE('INVALID_EXPIRE_NUMBER : ' || sqlerrm);
    ROLLBACK;
    WHEN portal.wwsbr_api.INVALID_FOLDER THEN
    DBMS_OUTPUT.PUT_LINE('INVALID_FOLDER : ' || sqlerrm);
    ROLLBACK;
    WHEN portal.wwsbr_api.INVALID_FOLDER_ID THEN
    DBMS_OUTPUT.PUT_LINE('INVALID FOLDER ID : ' || sqlerrm);
    ROLLBACK;
    WHEN portal.wwsbr_api.INVALID_ITEM_ID THEN
    DBMS_OUTPUT.PUT_LINE('INVALID ITEM ID : ' || sqlerrm);
    ROLLBACK;
    WHEN portal.wwsbr_api.INVALID_ITEMTYPE THEN
    DBMS_OUTPUT.PUT_LINE('INVALID ITEMTYPE : ' || sqlerrm);
    ROLLBACK;
    WHEN portal.wwsbr_api.INVALID_MOVE THEN
    DBMS_OUTPUT.PUT_LINE('INVALID MOVE : ' || sqlerrm);
    ROLLBACK;
    WHEN portal.wwsbr_api.INVALID_NAME THEN
    DBMS_OUTPUT.PUT_LINE('INVALID NAME : ' || sqlerrm);
    ROLLBACK;
    WHEN portal.wwsbr_api.INVALID_NUMBER THEN
    DBMS_OUTPUT.PUT_LINE('INVALID NUMBER : ' || sqlerrm);
    ROLLBACK;
    WHEN portal.wwsbr_api.INVALID_PERSPECTIVE THEN
    DBMS_OUTPUT.PUT_LINE('INVALID PERSPECTIVE : ' || sqlerrm);
    ROLLBACK;
    WHEN portal.wwsbr_api.INVALID_PLSQL_EXECUTE_USER THEN
    DBMS_OUTPUT.PUT_LINE('INVALID_PL/SQL_EXECUTE_USER : ' || sqlerrm);
    ROLLBACK;
    WHEN portal.wwsbr_api.INVALID_PUBLISH_DATE_FORMAT THEN
    DBMS_OUTPUT.PUT_LINE('INVALID_PUBLISH_DATE_FORMAT : ' || sqlerrm);
    ROLLBACK;
    WHEN portal.wwsbr_api.INVALID_PUBLISH_DATE_VALUE THEN
    DBMS_OUTPUT.PUT_LINE('INVALID_PUBLISH_DATE_VALUE : ' || sqlerrm);
    ROLLBACK;
    WHEN portal.wwsbr_api.INVALID_USERNAME THEN
    DBMS_OUTPUT.PUT_LINE('INVALID USERNAME : ' || sqlerrm);
    ROLLBACK;
    WHEN portal.wwsbr_api.ITEM_CREATION_ERROR THEN
    DBMS_OUTPUT.PUT_LINE('ITEM_CREATION ERROR : ' || sqlerrm);
    ROLLBACK;
    WHEN portal.wwsbr_api.ITEM_NOT_FOUND_ERROR THEN
    DBMS_OUTPUT.PUT_LINE('ITEM NOT FOUND ERROR : ' || sqlerrm);
    ROLLBACK;
    WHEN portal.wwsbr_api.ITEM_UPDATE_ERROR THEN
    DBMS_OUTPUT.PUT_LINE('ITEM_UPDATE_ERROR : ' || sqlerrm);
    ROLLBACK;
    WHEN portal.wwsbr_api.MISSING_DISPLAY_NAME THEN
    DBMS_OUTPUT.PUT_LINE('MISSING DISPLAY NAME : ' || sqlerrm);
    ROLLBACK;
    WHEN portal.wwsbr_api.MISSING_ITEM_TYPE THEN
    DBMS_OUTPUT.PUT_LINE('MISSING ITEM TYPE : ' || sqlerrm);
    ROLLBACK;
    WHEN portal.wwsbr_api.MISSING_NAME THEN
    DBMS_OUTPUT.PUT_LINE('MISSING NAME : ' || sqlerrm);
    ROLLBACK;
    WHEN portal.wwsbr_api.MISSING_PLSQL_EXECUTE_USER THEN
    DBMS_OUTPUT.PUT_LINE('MISSING plsql execute user : ' || sqlerrm);
    ROLLBACK;
    WHEN portal.wwsbr_api.NAME_TOO_LONG THEN
    DBMS_OUTPUT.PUT_LINE('name too long : ' || sqlerrm);
    ROLLBACK;
    WHEN portal.wwsbr_api.NO_ITEM_REGION THEN
    DBMS_OUTPUT.PUT_LINE('not item region : ' || sqlerrm);
    ROLLBACK;
    WHEN portal.wwsbr_api.NO_MASTER_ITEM_ID THEN
    DBMS_OUTPUT.PUT_LINE('no master item id : ' || sqlerrm);
    ROLLBACK;
    WHEN portal.wwsbr_api.NOT_ENOUGH_PRIVS THEN
    DBMS_OUTPUT.PUT_LINE('not enough privs : ' || sqlerrm);
    ROLLBACK;
    WHEN portal.wwsbr_api.NULL_EXPIRE_DATE THEN
    DBMS_OUTPUT.PUT_LINE('null expire date : ' || sqlerrm);
    ROLLBACK;
    WHEN portal.wwsbr_api.NULL_EXPIRE_NUMBER THEN
    DBMS_OUTPUT.PUT_LINE('null expire number : ' || sqlerrm);
    ROLLBACK;
    WHEN portal.wwsbr_api.PERMISSION_DENIED THEN
    DBMS_OUTPUT.PUT_LINE('permission denied : ' || sqlerrm);
    ROLLBACK;
    WHEN portal.wwsbr_api.PLSQL_REQUIRED THEN
    DBMS_OUTPUT.PUT_LINE('plsql required : ' || sqlerrm);
    ROLLBACK;
    WHEN portal.wwsbr_api.QUOTA_EXCEEDED THEN
    DBMS_OUTPUT.PUT_LINE('quota exceeded : ' || sqlerrm);
    ROLLBACK;
    WHEN portal.wwsbr_api.REQD_ATTR_MISSING THEN
    DBMS_OUTPUT.PUT_LINE('reqd attr missing : ' || sqlerrm);
    ROLLBACK;
    WHEN portal.wwsbr_api.UNKNOWN_ERROR THEN
    DBMS_OUTPUT.PUT_LINE('unknown error : ' || sqlerrm);
    ROLLBACK;
    WHEN portal.wwsbr_api.URL_REQUIRED THEN
    DBMS_OUTPUT.PUT_LINE('url required : ' || sqlerrm);
    ROLLBACK;
    when OTHERS then
    DBMS_OUTPUT.PUT_LINE('OTHERS : ' || sqlerrm || ' : ' || sqlcode);
    ROLLBACK;
    end;

    Hi Eddy:
    On Friday, we put in a TAR with Oracle support about the identical problem. When editing an item using the API, the boolean attributes always reset. The values of the boolean attributes aren't even being changed. The only reason we need to set them again is the limitation of the API where you have to feed all attributes back in.
    So far, Oracle has said it sounds like a bug and they want to know the exact sequence of steps to repeat it.
    Rgds/Mark M.
    Portal 9.0.2.6

  • Create new page using wwsbr_api.add_folder.

    Hi,
    When i try and create a new page and assign values to custom parameters using the API mentioned above i receive the following error:
    ORA-20100:
    ORA-06512: at "PORTAL.WWSBR_STDERR", line 45
    ORA-06512: at "PORTAL.WWPOB_API_PAGE", line 5818
    ORA-01403: no data found.
    This is the code that i am using:
    Pass in the following parameters to procedure:
    p_site_id in number,
         p_parent_id in number,
         p_f_type_id in number,
         p_f_type_caid in number,
         p_name in varchar2,
         p_title in varchar2
    declare
    folder_id NUMBER;
    l_attributes_ids Portal.wwsbr_type.array;
    l_attribute_caids Portal.wwsbr_type.array;
    l_attributes_data_type Portal.wwsbr_type.array;
    l_attributes_values Portal.wwsbr_type.array;
    BEGIN
    --build up the custom attributes arrays to assign to the page
    l_attributes_ids(1) := 1222;
    l_attribute_caids(1) := 36;
    l_attributes_data_type(1) := 'boolean';
    l_attributes_values(1) := '1';          
    l_attributes_ids(2) := 1031;
    l_attribute_caids(2) := 36;
    l_attributes_data_type(2) := 'text';
    l_attributes_values(2) := 'test';
    folder_id := wwsbr_api.add_folder(
              p_caid => p_site_id,
              p_parent_id => p_parent_id,
              p_name => p_name,
              p_display_name => p_title,
              p_type_id => p_f_type_id,
              p_type_caid => p_f_type_caid,
              p_attribute_id => l_attributes_ids,
              p_attribute_caid => l_attribute_caids,
              p_attribute_data_type => l_attributes_data_type,
              p_attribute_value => l_attributes_values
    RETURN folder_id;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
         dbms_output.put_line(substr(sqlerrm,1,500));
    return -1;
         when wwsbr_api.INVALID_NAME then
         dbms_output.put_line('INVALID_NAME');
         return -1;
         when wwsbr_api.DUPLICATE_NAME then
         dbms_output.put_line('duplicate name');
         return -1;
         when wwsbr_api.MISSING_NAME then
         dbms_output.put_line('MISSING_NAME');
         return -1;
         when wwsbr_api.MISSING_DISPLAY_NAME then
         dbms_output.put_line('MISSING_DISPLAY_NAME');
         return -1;
         when wwsbr_api.NAME_TOO_LONG then
         dbms_output.put_line('NAME_TOO_LONG');
         return -1;
         when wwsbr_api.URL_REQUIRED then
         dbms_output.put_line('URL_REQUIRED');
         return -1;
         when wwsbr_api.PLSQL_REQUIRED then
         dbms_output.put_line('PLSQL_REQUIRED');
         return -1;
         when wwsbr_api.INVALID_PLSQL_EXECUTE_USER then
         dbms_output.put_line('INVALID_PLSQL_EXECUTE_USER');
         return -1;
         when wwsbr_api.MISSING_PLSQL_EXECUTE_USER then
         dbms_output.put_line('MISSING_PLSQL_EXECUTE_USER');
         return -1;
         when wwsbr_api.INVALID_FOLDER then
         dbms_output.put_line('INVALID_FOLDER');
         return -1;
         WHEN OTHERS THEN
         dbms_output.put_line(substr(sqlerrm,1,500));
         return -1;
    Any help would be appriciated.

    Did you ever figure out your issue? I'm having the same issue after I try to set attributes.

  • Problem - Adding item using wwsbr_api.add_item

    Hi, I´m using portal 10.1.2.0.2 and when I try to add an file using wwsbr_api.add_item, it returns me the following error "ORA-29532: Java call terminated by uncaught Java exception: java.lang.NullPointerException"
    But It happens only when the file name has special caracter.
    Anybody has any idea how to solve it?

    You mentioned at the top of the thread that the region type had not been defined. I have not tried this in 10.1.4, but I know in previous versions if you programmatic ally added a item to an undefined region it didn't show up until that region was manually configured as an item region. The symptoms were as you describe -- nothing showed up in edit or view mode. As soon as the region was setup as a item region, the items appeared.
    Roche's suggestion will establish if the item is even being created at all.
    Rgds/Mark M.

  • ITEM_CREATION_ERROR when using wwsbr_api.add_item

    308 on Sun Solaris :
    Here is my simple code :
    New_Master_Item_Id := wwsbr_api.add_item
    ( p_caid => 118,
    p_folder_id => 14489,
    p_display_name => 'title',
    p_type_id => wwsbr_api.ITEM_TYPE_FILE,
    p_type_caid => wwsbr_api.SHARED_OBJECTS,
    p_region_id => 5,
    p_file_filename => '/array_dd/oracle-IAS/portal30/images/voltimum_map_france.gif')
    I'm getting the followgin exception :
    ITEM_CREATION_ERROR
    Note that my file resides on DB Unix machine. Read access is OK for all.
    Any idea ?

    Franck,
    ik have a similar problem. I tried to execute the following code:
    declare
    l_item_nr number;
    l_site_id number;
    l_corner_id number;
    l_type_id number;
    l_type_caid number;
    l_region_id number;
    begin
    l_site_id := 73;
    l_corner_id := 1;
    l_type_id := 2;
    l_type_caid := 0;
    l_region_id := 5;
    l_item_nr := wwsbr_api.add_item ( p_caid => l_site_id
    , p_folder_id => l_corner_id
    , p_display_name => 'my test item'
    , p_type_id => l_type_id
    , p_type_caid => l_type_caid
    , p_region_id => l_region_id
    , p_text => 'my own piece of text'
    commit;
    end;
    Unfortunately, i ran into the same exception as you did. The weird thing is that the exception is only being raised the first time that i execute this code during a session. If i execute the code multiple times, the text-item is indeed being inserted. You mentioned that you did something with the language of your content area. What exactly? And how does the language of the content area interfere with the creation of this text item?
    Thanks in advance!!
    Bindert Glazema

  • Using WWSBR_API.ADD_ITEM raises exception ITEM_CREATION_ERROR

    All,
    i create a very simple procedure in the schema of the portal owner:
    create or replace procedure test_insert_item is
    l_item_nr number;
    l_site_id number;
    l_corner_id number;
    l_type_id number;
    l_type_caid number;
    l_region_id number;
    begin
    l_site_id := 154;
    l_corner_id := 6989;
    l_type_id := 2;
    l_type_caid := 0;
    l_region_id := 5;
    l_item_nr := wwsbr_api.add_item (
    p_caid => l_site_id
    , p_folder_id => l_corner_id
    , p_display_name => 'my test item'
    , p_type_id => l_type_id
    , p_type_caid => l_type_caid
    , p_region_id => l_region_id
    , p_text => 'my own text'
    commit;
    end;
    If i run this procedure in SQL*Plus as the Portal-owner, then the first time during a session the procedure raises the exception
    WWSBR_API.ITEM_CREATION_ERROR. Each following time that i run the procedure it inserts the text item as expected.
    How come? I checked for invalid object etc., but there are none.
    Any ideas?
    Thanks in advance!
    Regards,
    Bindert Glazema

    I experimented a little bit further. If i change the procedure to:
    create or replace procedure test_insert_item is
    l_item_nr number;
    l_site_id number;
    l_corner_id number;
    l_type_id number;
    l_type_caid number;
    l_region_id number;
    begin
    l_site_id := 154;
    l_corner_id := 6989;
    l_type_id := 2;
    l_type_caid := 0;
    l_region_id := 5;
    l_item_nr := wwsbr_api.add_item (
    p_caid => l_site_id
    , p_folder_id => l_corner_id
    , p_display_name => 'my test item'
    , p_type_id => l_type_id
    , p_type_caid => l_type_caid
    , p_region_id => l_region_id
    , p_text => 'my own text'
    commit;
    exception
    when WWSBR_API.ITEM_CREATION_ERROR then
    l_item_nr := wwsbr_api.add_item (
    p_caid => l_site_id
    , p_folder_id => l_corner_id
    , p_display_name => 'my test item'
    , p_type_id => l_type_id
    , p_type_caid => l_type_caid
    , p_region_id => l_region_id
    , p_text => 'my own text'
    commit;
    end;
    then no exception will be raised when i run the procedure the first time during a SQL*Plus session and still the item is inserted. The weird thing is, that when i call this procedure from a dynamic page:
    <HTML>
    <BODY>
    <ORACLE>
    begin
    portal30.test_insert_item;
    exception
    when portal30.wwsbr_api.ITEM_CREATION_ERROR
    then
    htp.p('Item creation error');
    end;
    </ORACLE>
    </BODY>
    </HTML>
    then the item is not inserted when the page is run, but the page shows 'Item creation error' instead. Does anyone have an idea why this doesn't work?
    null

  • Content Area API in 9.0.2 (wwsbr_api) is there a workaround?

    The end goal is to have a button in a region that takes users to an add item form. I want to have the button right on the page, without having to go to edit mode.
    So, looking at the PDK I see wwsbr_api.add_item.
    http://portalstudio.oracle.com/pls/ops/docs/FOLDER/COMMUNITY/PDK/plsql/doc/sdk23ai.htm
    Unfortunately, 9.0.2.2.22 does not support this API. Additionally, this document references a view, WWSBR_ALL_FOLDER_REGIONS, that does not exist in this release of Portal.
    Does anyone have a suggestoin for how to do this in 9.0.2?

    11g XE is actually based on 11.2.0.2.0. It actually includes some fixes and changes in addition to that patchset.
    That means the problem either exists in all post-11.2.0.2 releases or is due to some XE-specific change. If you experience the problem in any post-11.2.0.2 or 12c release, let me know. I can file a bug and have the problem identified and fixed.
    With an XE bug, it can't be fixed until Oracle's next XE release, even if we identify it now. That will likely be around a year after Oracle releases DB 12c R2.

  • Change item level security using wwsbr_api.modify_item

    Hi.
    Im using wwsbr_api.modify_item for change item level security.
    Its code for change type access for item of my procedure
    l_masterid := portal30.wwsbr_api.modify_item(
    p_master_item_id => 7061,
    p_item_id => 7062,
    p_caid => 136,
    p_folder_id => 1,
    p_display_name => 'test',
    p_region_id => 5,
    p_access_level => portal30.wwsbr_api.item_access,
    p_text => 'test change item security',
    p_addnewversion => true, -- My content area have item versioning
    level is audit
    After execute my procedure access type = folder.
    I see in wwv_things table new record
    masterthingid = 7061,
    id = 7064,
    security = 'folder'
    How to change item level security programmatically?
    Thanks

    Jerry,
    Please forgive me for persisting with this, and thankyou for your continued patience, but let me try to explain the issue I'm having in another way...
    I have a function that calls wwsbr_api.modify_item to change, say, the description. In this case "description" is the one and only thing I want to change about the item. As you've described above, I am able to query most things associated with the item (via wwsbr_all_items, wwsec_api.grantee_list, etc) so that I can pass current values to the wwsbr_api.modify parameters. However, I haven't found a way to query the current level of access control for a given item (i.e. wether it is currently set to ITEM_ACCESS, FOLDER_ACCESS, or null). As documented, I can force the item to be ITEM_ACCESS or FOLDER_ACCESS. However, I don't want to force a value and as we have concluded, passing null will nullify the current state.
    So, in summary, an answer to this question will solve my problem:
    Is it possible to query the current access control level of an item (either directly via one of the published views or indirectly via one of the views)?
    If the answer is yes - great that solves my problem. How please?!?!?
    If the answer is no - this must be a bug is it would mean that it isn't possible to use wwsbr_api.modify_item without inadvertently altering the current access control level of the item.
    Again thanks for your patience...
    Mark

  • Force indexation after wwsbr_api.set_attribute

    Hi,
    I work on portal 10gr3.
    I use wwsbr_api.set_attribute to set custom attribute value. I do this for several language. After each set_attribute, I call the invalidate cache and commit changes.
    I expect that re-indexation job will take into account changes but this is not done. If I apply the changes manually through the web interface, these are taken into account.
    Is there a way to call explicitly the re-indexation or to specify that item impacted by changes must be taken into account for the next re-indexation process ?
    All help is welcome.
    Thank you eddy.

    Srinath,
    I talk about custom attribute I create on portal 10gr3.
    These attributes are defined on table wwsbr_attributes inside portal DB schema. Attribute value for an item is stored on wwv_thingattributes.
    In my case, when I use the api wwsbr_api.set_attribute to seta a value for a particular attribute/item, this change is not take into account when indexes are updated. When I use the web interface, the change is take into account.
    I've a lot of change to do and this is one-shoot.
    Regards, Eddy.

  • Wwsbr_api

    Is it possible to control access on a folder using the content area APIs? For example, I would like to restrict access to a new folder that I've created programmatically to members of a particular group.
    I notice that there is wwsbr_api.ADD_ITEM_ILS_PRIVILEGES for items, but I can't find an equivalent for folders.
    Regards,
    Mark

    With respect to my colleague Amitabh, you can use WWSEC_API to set privileges on any portal object; e.g.
    begin
      wwsec_api.set_group_acl(
          p_group_id         => wwsec_api.group_id('content_contributors'),
          p_object_type_name => wwsec_api.PAGE_OBJ,
          p_name             => '74/69226', -- page group id/page id
          p_privilege        => wwsec_api.PAGE_VIEW
      commit;
      end;Note that one thing you [currently] cannot do through the APIs is set the is_public attribute. You can grant view privilege to the user PUBLIC through WWSEC_API.SET_USER_ACL, but that's somewhat different (the is_public attribute is used to optimize certain searches and queries).
    Note, too, that in 9.0.2.6 and later new pages will inherit their parent page's attributes and privileges, if enabled to do so in the page group properties. You can also use page templates to set the default privileges (the template will be inherited from the parent page if a new page is created through the API or through WebDAV).
    Regards,
    Jerry
    PortalPM

  • Wwsbr_api.add_item problems

    Hi there,
    I'm trying to use wwsbr_api.add_item to add content to a content area folder from a PL/SQL procedure invoked from SQL*Plus.
    I'm having no luck...
    For text items I keep getting WWSBR_API.ITEM_CREATION_ERROR exceptions.
    I've also tried setting context of the PORTAL30 SSO user via WWCTX_API.SET_CONTEXT which seems to be working as it is not raising an exception.
    My Content Area id = 93 (wwsbr_all_content_areas)
    My test upload folder id = 3359 (wwsbr_all_folders)
    BEGIN
    wwctx_api.set_context(p_user_name => 'PORTAL30'
    ,p_password => 'PORTAL30');
    v_master_item_id := wwsbr_api.add_item
    (p_caid => 93
    ,p_folder_id => 3359
    ,p_display_name => 'TEST'
    ,p_type_id => 2
    ,p_type_caid => 0
    ,p_region_id => 5
    ,p_text => 'AUTOMATIC TEXT TESTING!'
    v_master_item_id := wwsbr_api.add_item
    (p_caid => 93
    ,p_folder_id => 3359
    ,p_display_name => 'TEST2'
    ,p_type_id => 1
    ,p_type_caid => 0
    ,p_region_id => 5
    ,p_file_filename => 'c:\temp\test.doc'
    COMMIT;
    EXCEPTION
    END;
    For Files I get file permission problems in SQL*Plus which I resolved for a specific file using
    call dbms_java.grant_permission ('PORTAL30','java.io.FilePermission','c:\temp\test.doc','read');
    commit;
    but then I get the same wwsbr_api exceptions as per the text file! Also how would I set the permissions globally for a whole directory?
    I've loaded the procedure into PORTAL30 and am running it as that user.
    John

    ok had a typo in my folder_id which didn't help - doh! Fixed that and text items would upload.
    to fix the file permission issues you can reference either individual files or folders with a wildcard in dbms_java.grant_permission, i.e.,
    call dbms_java.grant_permission ('PORTAL30','java.io.FilePermission','c:\temp\test.doc','read');
    call dbms_java.grant_permission ('PORTAL30','java.io.FilePermission','c:\temp\*','read');
    ...that fixed it! Excellent!
    Oh and if I'm executing the procedure from portal30 schema I don't need to use wwctx_api.set_context either...

  • Wwsbr_api.add_folder and grant access/

    I created a folder with the API
    wwsbr_api.add_folder, which worked fine.
    Now i want to grant VIEW access to a specific user for that folder, using an API. I used:
    wwsec_api.set_user_acl
    (p_person_id=>v_personid
    ,p_object_type_name=>'FOLDER'
    ,p_name => 'STOREMANAGER2'
    ,p_privilege=>'VIEW'
    But it didn't help. The user can still not see this folder? Any suggestions?
    Thanks,
    Anja
    null

    Jerry,
    sorry for replying so late, but i can read my email only at the hotel in the evening.
    Thanks for the script, but it didn't help.
    Here is more information:
    Running
    Declare
    c Varchar2(100);
    Begin
    c := wwsec_api.get_granted_user_privilege
    p_user_id =>10,
    p_object_type_name=>'FOLDER',
    p_name=>'2227'
    dbms_output.put_line(c);
    End;
    for my specific user, it returns VIEW:
    SQL> @getgranteduserpriv.sql
    VIEW
    PL/SQL procedure successfully completed.
    However, if i navigate through the UI with
    another user that has admin privileges:
    - i click Edit Folder
    - Administration
    - Folder (Edit Content Area)
    - Access tab
    Here i don't see my user "10" in the ACCESS list.
    I do see another user "7" which has VIEW privileges. That's what the UI shows.
    However, if i run wwsec_api.get_granted_user_privilege for user "7" i don't get anything back.
    Am i using the right API?
    Is wwsec_api.set_user_acl
    matching the UI's GRANT ACCESS/CHANGE ACCESS interface?
    Thanks for you help,
    Anja
    null

  • Questions about the wwsbr_api.add_item

    Hi,
    I want to add an item with customize item type by pdk. It looks like wwsbr_api.add_item can do it. However, I don't understand about the p_attribute_id , p_attribute_caid in wwsbr_api.add_item. I want to make sure whether the add_item function can add a custom type item. And how.
    Thanks a lot

    Yes, the api in question can publish the custom item type. Refer to the PLSQL API documentation here
    http://www.oracle.com/technology/products/ias/portal/html/plsqldoc/pldoc1014/index.html
    Note that a custom item may have custom attributes as well that can be defined separately. For example I can create a custom attribute named "Reviewee" which is of form text, in the shared pagegroup. Then I can create item type named "Analysis Report" which uses the "Reviewee". Now when I create an item of type "AnalysisReport" I may need to supply the value for the "Reviewee"
    The parameters you mentioned are the arrays of ids and pagegroup ids for these custom attributes . You can guess now that there would some parameters to supply the values for the custom attributes; and these are "p_attribute_data_type" and "p_attribute_value"
    The other parameter of interest to you are "p_type_id" and "p_type_caid" which are the identification parameters for the item type you'll be using.

Maybe you are looking for

  • Upgrade from PI 7.0 SP18 to PI 7.1 EHP1

    Hi all,                                                                                 I'm performing an Upgrade from Netweaver PI 7.0 SP18 to PI 7.1 EHP1. I've checked all the notes ragarding any known issuses about the process BUT.... Here's the p

  • IMac won't boot from/install Lion. Why?

    I have a 2006-model iMac (iMac5,1 with a 2GHz Core 2 Duo processor and 2.5GB RAM; this is one of Apple's supported configurations for Lion) which has been running quite nicely for several years now. About a year or so ago I moved it to 10.6 which wen

  • New Mac Book and Photoshop Elements

    My daughter just bought a new MacBook (Mac OS X 10.5.4 2.4 Ghz Intel Core 2 Duo 2 GB 667 MHz DDR2 SDRAM) and tried to install my Photoshop Elements software onto it. My Photoshop is kind of old (Elements 2.0), but I use it on my Mac all the time with

  • PSE6 Serial Number Help?

    I recieved a bamboo fun tablet about two years ago for Christmas, and installed the free PSE6 that came with it on my computer at my moms (my parents are divorced) However, I live with my dad, and recently my mom allowed me to bring my Tablet and the

  • Osb connecting to external webservice

    In an already existing developed use-case in our project There is one teststub -- proxy service in which an operational branch is added for that ws_processtransaction and ws_reprocesstransaction two fields are added as per wsdl. For both fields they