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...

Similar Messages

  • 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

  • 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.

  • 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.

  • How could I ADD ITEM by using API

    Hi,
    I have Portal 9.0.3 installed.
    I want to call wwsbr_api from a javascript code (HTML portlet) to add a text item to a region, but I have some problem using this API:
    1; I don't know how could I get the p_caid, the p_folder_id and the region_id
    I found out that p_caid can be find WWSBR_SITES.ID. Is this correct?
    2; when I've tried to call this API from address line I've got a 404 ERROR (but it might have been casued by the wrong attribute values)
    So I need to know:
    - How could I find out the correct IDs?
    - How could I call wwsbr_api.add_item function from a javascript?
    Thanks for your help!
    THE BOOGIE IS OVER

    WWSBR_API is currently not supported in Portal Release 2 (902). Support for this API will return in the next version (9.0.2.6, planned for early 2003).
    Regards,
    Portal Product Manager

  • Import existing content

    Hello,
    I have an existing web site (~4000 documents) and I would like import this content in a Portal Page Group. The file formats are Microsoft file (Word, Excel...), PDF and HTML. Moreover I must import their names and descriptions.
    Is there a script or procedure for doing this?
    Thanks for any assistance.

    hi christian,
    I have some problems with the method add_item
    I have this error when running the below code:
    ++++++++++++++++++++++++++++++++++++++++
    Executing PL/SQL: CALL PORTAL."JDEV_TMP_PROC_2"()
    ORA-06510: PL/SQL : unhandled user-defined exception
    ORA-06512: à "PORTAL.WWSBR_API", line 591
    ORA-06510: PL/SQL : unhandled user-defined exceptionnon traitée
    ORA-06512: à "PORTAL.TESTIMPORT", line 16
    ORA-06512: à "PORTAL.JDEV_TMP_PROC_2", line 3
    ++++++++++++++++++++++++++++++++++++++++
    PROCEDURE TESTIMPORT AS
    BEGIN
    declare
    l_new_item_master_id number;
    l_caid number := 33;
    l_folder_id number := 34322;
    begin
    dbms_output.put_line('debut');
    l_new_item_master_id := portal.WWSBR_API.add_item(
    p_caid => l_caid,
    p_folder_id => l_folder_id,
    p_display_name => 'testimport.doc',
    p_type_id => portal.WWSBR_API.ITEM_TYPE_FILE,
    p_type_caid => portal.WWSBR_API.SHARED_OBJECTS,
    p_display_option => portal.WWSBR_API.IN_PLACE,
    p_post_upload => false,
    p_description => 'test description',
         p_file_filename => '/home/devportail/testimport.doc');
    commit;
    exception
    when wwsbr_api.MISSING_ITEM_TYPE then
    dbms_output.put_line('MISSING_ITEM_TYPE');
    rollback;
    when wwsbr_api.QUOTA_EXCEEDED then
    dbms_output.put_line('QUOTA_EXCEEDED');
    rollback;
    when wwsbr_api.INVALID_PUBLISH_DATE_FORMAT then
    dbms_output.put_line('INVALID_PUBLISH_DATE_FORMAT');
    rollback;
    when wwsbr_api.INVALID_PUBLISH_DATE_VALUE then
    dbms_output.put_line('INVALID_PUBLISH_DATE_VALUE');
    rollback;
    when wwsbr_api.NULL_EXPIRE_NUMBER then
    dbms_output.put_line('NULL_EXPIRE_NUMBER');
    rollback;
    when wwsbr_api.INVALID_EXPIRE_NUMBER then
    dbms_output.put_line('INVALID_EXPIRE_NUMBER');
    rollback;
    when wwsbr_api.NULL_EXPIRE_DATE then
    dbms_output.put_line('NULL_EXPIRE_DATE');
    rollback;
    when wwsbr_api.INVALID_EXPIRE_DATE then
    dbms_output.put_line('INVALID_EXPIRE_DATE');
    rollback;
    when wwsbr_api.INVALID_EXPIRE_DATE_FORMAT then
    dbms_output.put_line('INVALID_EXPIRE_DATE_FORMAT');
    rollback;
    when wwsbr_api.REQD_ATTR_MISSING then
    dbms_output.put_line('REQD_ATTR_MISSING');
    rollback;
    when wwsbr_api.ITEM_CREATION_ERROR then
    dbms_output.put_line('ITEM_CREATION_ERROR');
    rollback;
    -- process cache invalidation messages
    wwpro_api_invalidation.execute_cache_invalidation;
    end;
    END;
    regards,
    xavier

  • Creating pages,item WITH approval.

    Hi,
    I found out how to create a page and add an item to that page automatically. But now I need to find out how to use this with approval.
    1) I noticed that approval only exists on the item level and not the page level. Is this correct?
    2) How can I make that the page/item I create automatically, has to be approved? The approval will be done in a normal way, through the existing approval portlet. Normally one should enable approval control on the page, create a user and give this user the 'manage items with approval' rights, all items published by this user, will not be published before approval.
    Can someone provide an example, on how to mark an item for approval programmatically?
    The function add_item contains a parameter 'p_author - Author of the item.'. Can this be used, as I enable the author to 'manage items with approval'?
    Cheers
    B.
    Message was edited by:
    Ratjeuh

    Even If I bypass the public user problem and do the following:
    -- create new page
        l_new_page_id := wwsbr_api.add_folder(  p_caid             => l_caid,
                                                p_name             => l_uppertext,
                                                p_display_name     => l_text,
                                                p_type_id          => wwsbr_api.FOLDER_TYPE_CONTAINER,
                                                p_type_caid        => wwsbr_api.SHARED_OBJECTS
        -- Process cache invalidation messages.
        wwpro_api_invalidation.execute_cache_invalidation;
        portal.wwctx_api_private.set_context( p_user_name => 'NEEDAPP', p_password => 'dummy');
        -- create new item
        l_text_item := 'This is a new item on the new page';
        l_new_item_master_id := wwsbr_api.add_item( p_caid              =>  l_caid,
                                                    p_folder_id         => l_new_page_id,
                                                    p_display_name      => 'This is the display name',
                                                    p_type_id           => wwsbr_api.ITEM_TYPE_TEXT,
                                                    p_type_caid         => wwsbr_api.SHARED_OBJECTS,
                                                    p_region_id         => 0,
                                                    p_text              => l_text_item
        -- Process cache invalidation messages.
        wwpro_api_invalidation.execute_cache_invalidation;
        wwctx_api.clear_context;
        owa_util.redirect_url(curl => l_back_url || '&' || l_reference_path || '.p_text=' || l_text);So, I change the context in my code to make sure that the item is created by the user NEEDAPP. This works, the page is created first (by the user who invoked the portlet) and an item is placed on the page. I can even see the item showing up in my 'PENDING ITEMS LIST' for approval.
    BUT
    After the procedure I am NOT redirected to the page where I submitted the form bu instead I get an error:
    Fout: De listener heeft het volgende bericht geretourneerd: 503 Service Unavailable
    What is the problem?

  • How to upload file located on the network

    I used following API successfully upload file located on
    database machine. I
    got error when upload file located on network. I run this
    as "Portal30" user
    which has DBA priviledges.
    I used code like this.
    result:=wwsbr_api.add_item(p_caid=>53,
    p_folder_id =>4487,
    p_display_name => 'Test',
    p_type_id => wwsbr_api.ITEM_TYPE_FILE,
    p_type_caid => wwsbr_api.SHARED_OBJECTS,
    p_region_id =>5,
    -- these are not working
    p_file_filename=>'//nt2/vol2/common/test.pdf'
    p_file_filename=>'///nt2/vol2/common/test.pdf'
    p_file_filename=>'S:/common/test.pdf'
    -- this works
    p_file_filename=>'c:/test.pdf'
    Errors:
    ORA-29532: Java call terminated by uncaught Java exception:
    java.lang.NullPointer Exception
    ORA-06512: at "PORTAL30.WWSBR_API",line 24
    ORA-06512: at "PORTAL30.WWSBR_API",line 277
    PS: we tries run Oracle as a privileged user other than System
    user. it won't help. Am I missing something here. I am new on
    the network problem. How I can verify the privileged user access
    the network.
    we have portal 3.0.9.8.1 running on Windows 2000

    Thanks for the direction. I can upload same file through Oracle
    Portal "Add Item" user Interface. So I assume file is visible to
    the database. Notice the Portal uses wwv_additem.additem and
    wwv_add_wizard.edititem to upload file. Do they eventually use
    wwsbr_api.add_item and wwsbr_api.add_item_post_upload? What is
    syntax of reference file on remote drive?
    Thanks
    Linda

  • File download from back end syetem to the user system

    Hi,
    This is very urgent requirement for me, can anybody help me regarding this:
    I have back end on one system and the front end on a different system. The use has login from third system.
    There is file on the back end system. User want to download that file using FTP to the local system. The Ftp download class is available at the back end system. Can anybody help me in sending the request from JSP to the back end to download the file from back end to the user's local system. FYI, I have to use core JSP/Servlet - support jre 1.4.2
    Thanks and Regards,
    braj

    hi,
    i tested this for you and the following code works fine. tested it on my 10.1.2 instance.
    declare
    l_new_item_master_id number;
    l_caid number := 33;
    l_folder_id number := 34373;
    begin
    portal.wwctx_api.SET_CONTEXT('portal','manager1','');
    portal.wwctx_api.set_nls_language(P_NLS_LANGUAGE => 'e');
    l_new_item_master_id := wwsbr_api.add_item(
    p_caid => l_caid,
    p_folder_id => l_folder_id,
    p_display_name => 'portal.doc',
    p_type_id => wwsbr_api.ITEM_TYPE_FILE,
    p_type_caid => wwsbr_api.SHARED_OBJECTS,
    p_description => 'This is the text of the review.',
    p_file_filename => '/home/oracle/test/portal.doc');
    wwpro_api_invalidation.execute_cache_invalidation;
    end;
    regards,
    christian

  • Insert or copying a Item with PL/SQL

    When I insert a item in one page, I need copy off this Item in another page.
    Someone can help me?

    Programmatically you can use the wwsbr_api.add_item method
    refer the api here.
    </br>
    Regards,
    Krishna

  • Adding items to regions dinamically

    Hi,
    I create the following PL/SQL item in a region:
    DECLARE
    item_id NUMBER;
    BEGIN
    item_id := WWSBR_API.add_item(
    p_caid => 34,
    p_folder_id => 34293,
    p_display_name => 'Display name add_item',
    p_type_id => wwsbr_api.ITEM_TYPE_TEXT,
    p_type_caid => wwsbr_api.SHARED_OBJECTS,
    p_region_id => 3668,
    p_category_id => wwsbr_api.GENERAL_CATEGORY,
    p_category_caid => wwsbr_api.SHARED_OBJECTS,
    p_image_filename => '1905.GIF',
    p_image_alignment => wwsbr_api.ALIGN_LEFT,
    p_description => 'Description add_item',
    p_publish_date => '04-APR-03',
    p_expire_mode => wwsbr_api.PERMANENT
    END;
    The code should dynamically create an item. But I have the following error executing it:
    Error 30584: DBMS_SQL has raised an unhandled exception. ORA-29532: Java call terminated by uncaught Java exception: java.lang.NullPointerException
    Any suggestion?
    Thank you,
    Alessandro

    try 'p_type_id => wwsbr_api.ITEM_TYPE_FILE'.

  • Adding files to the portal

    Hi
    I have an HTML form which has an <input> of type "file." I want to enter a file into the portal, into a specific folder within a specific content area. Supposedly, all I need to do is use the wwsbr_api.add_item function. I've created a PL/SQL procedure which I call from my HTML that what it does is get the parameters from the HTML form (the file name), and then apply the add_item function.
    (I do know the folder's and the content area's id).
    It's not working. I'm getting an ORA-29532 Error. (some Java security exception)
    So, how do I enter a file directly into the Portal?
    (A code example would be great!!!)
    Thanks,
    Dan
    p.s
    I've seen in some example where they use a wwv_.....saveitem function (cant remember the package name -- I could look it up if anybody is interested). This function is not documented anywhere, and so I'm afraid to use it because I dont understand all the parameters, and who knows what changed they'll do to it in the next version and I wont be able to use it anymore....

    Dan,
    You have two options.
    If you want to upload the document via a browser - then use the add_item_post_upload function (vs the add_item function).
    This function assumes that the document is already uploaded and that the p_file_name being passed is the actual document 'NAME' returned when the document is uploaded.
    The other option is to use the add_item procedure and put the document somewhere on the same machine as the database
    -- then the value for p_file_filename is expected to be "The full directory and filename for the file to be uploaded for this file item. The file path must be visible from the
    database machine." If this method is used then the document will be uploaded from the directory into the database as part of the add_item function.
    Hope this helps.
    Mohana

  • Create/Edit Smart Lists using DIM

    Hi!
    Is it possible to create or edit a smart list for a classic Planning 9.3.1 app using DIM?
    I already have a smart list in planning 9.3.1 which has a couple of entries (drop down members) but when I try to use DIM to add more smart list entries, I cannot even see the smart list listed as a dimension in DIM. i.e. when I import a Hyperion Planning Adapter and connect to a Planning application, all the dimensions show up in the target list but none of the smart lists show up. Is there another setting that I have to change for the classic world?
    In BMPA this would be a smart list dimension but what about a classic application?
    Any pointers will be greatly appreciated.
    Thanks!

    You need to make a call similar to this:
       l_new_item_master_id := wwsbr_api.add_item(
          p_caid                => l_pg_id,
          p_folder_id           => l_nav_pageid,
          p_display_name        => 'Edit',
          p_region_id           => l_region_list(2).id,
          p_type_caid           => wwsbr_api.SHARED_OBJECTS,
          p_type_id             => wwsbr_api.ITEM_TYPE_SMART_LINK,
          p_attribute_id        => l_attribute_id,
          p_attribute_caid      => l_attribute_caid,
          p_attribute_data_type => l_attribute_data_type,
          p_attribute_value     => l_attribute_value
          );Peter

Maybe you are looking for

  • Need original BIOS for G530A

    Hello, I tried to connect my laptop to a tv for the first time but unfortunately there is a problem with the laptop's HDMI output. I purchased Lenovo G530A about 2 years ago. I updated its BIOS via a setup I downloaded through Lenovo web site. But re

  • Messages stuck in the queue... how do I make them to be processed again?

    Hi, I'm new to SAP PI and kinda confused with queues. I have file -> bpm -> file scenario and there was an error in mapping within bpm process. When I went to qRFC Monitor (smq2), I see that in XBQO$PE_WS90000002 queue, there's an error, 'Permanent e

  • How to see all the tables in ABAP

    how to see all the tables in ABAP i need to see all the tables present in tcode se16.

  • HT1725 Movie rent download problem

    Hi i rent a movie to my ipad and its keep telling me waiting and its not downloading .... And it tooks allmost 3 hours waiting !!

  • Calling report from asset query - sq01

    hi experts, I've created an asset query using ADA logical database (Tcode SQ01).  I assign the asset balance report (program RABEST_ALV01) which works as drill down for asset query.  When I execute the query for current year the Report date defaults