MODE_SHOW_EDIT_DEFAULTS

Hi,
Is there any good example of a simple portlet written in PLSQL that makes use of the MODE_SHOW_EDIT_DEFAULTS mode?
The only link i could find on portalcenter was an invalid one called "Guidelines for Portlets in Edit Defaults Mode"
http://portalstudio.oracle.com/pls/ops/docs/FOLDER/COMMUNITY/PDK/articles/guidelines.portlets.edit.defaults.mode.html
thx

Are you having issues creating the edit defaults mode for a PL/SQL portlet?
Its very similar to any other show mode. In the show procedure you test for the mode. If the portlet needs to be rendered in edit defaults mode, call a procedure that renders the portlet content for that mode. You need to read and write system-level values to/from the preference store.
Peter

Similar Messages

  • Pl/sql portlet development; MODE_SHOW_EDIT_DEFAULTS

    Hiya, I've got my cool portlet up and running (provider and all), now I need to make it customizable.
    I'm having a hard time understanding the preference-stuff and how to utilize it.
    I understand to the point where we either show the portlet contents (MODE_SHOW) or one of the other options. specifically MODE_SHOW_EDIT_DEFAULTS.
    * How do I render the input form for updating the prefs? The input and the buttons for instance. What should be the target for the form?
    * where exactly are preferences stored and how? ok, I think I've got this bit. The preference path and name. Both have to be "initialized" in the register procedure of the portlet (and deleted in the deregister procedure). But at what point/what procedure do we save them after updating the defaults? How to define the default values, are they automatically overwritten when we save the form values?
    * when user clicks a button (apply) what to do then?
    I'm looking for a simple tutorial(s) or explanation of the basics, so I can get started. Portlet development guide examples went over my head (not very easy to understand), nor are they very plentiful.
    I looked at the example files (site_index_portlet), and had a hard time understanding those too... bit too complicated for a beginner.
    Thanks,
    Edited by: Baguette on 26-Apr-2009 23:48

    You could take a look at this, here you should find all the information you need to make your portlet customizable :
    http://download-uk.oracle.com/docs/cd/B14099_15/portal.1014/b14135/pdg_pdk_plsql.htm#CHDFDCFJ

  • Sample  PL/SQL Portlet Source Code for Oracle Portal 9ias

    Hi, I'm a newbie of Oracle Portal technology, and I have a problem:
    I would create a PL/SQL portlet that realizes the following functions:
    1) Retrieve the username of the portal user logged from WWCTX_API.GET_USER function.
    2) Insert into an oracle db table two values about two hidden fields in the HTML FORM of the portlet.
    3) Realize the insert commit through the click on the submit button on the Html form of the portlet. I would redirect by the same button to an other page url also.
    I've never developed in Portal, and may be useful if someone could post me the source code of the SHOW MODE SECTION in the PROCEDURE SHOW of a SAMPLE PL/SQL PORTLET that realizes the upper functions.
    Thanks a lot....

    Hi
    Here's the code from Helloworld_Portlet example:
    procedure show
    p_portlet_record wwpro_api_provider.portlet_runtime_record
    is
    l_portlet wwpro_api_provider.portlet_record;
    begin
    if (not is_runnable(
    p_provider_id => p_portlet_record.provider_id
    ,p_reference_path => p_portlet_record.reference_path)
    ) then
    raise wwpro_api_provider.PORTLET_SECURITY_EXCEPTION;
    end if;
    Retrieve the portlet information.
    l_portlet := get_portlet_info(
    p_provider_id => p_portlet_record.provider_id
    ,p_language => p_portlet_record.language
    if (p_portlet_record.exec_mode = wwpro_api_provider.MODE_SHOW) then
    if (p_portlet_record.has_title_region) then
    Draw the portlet header and specify what links are available
    from that header (i.e. details, customize, help, and about).
    The has_title property is set at the page region level.
    wwui_api_portlet.draw_portlet_header
    p_provider_id => p_portlet_record.provider_id
    ,p_portlet_id => p_portlet_record.portlet_id
    ,p_title => l_portlet.title
    ,p_has_details => true
    ,p_has_edit => true
    ,p_has_help => true
    ,p_has_about => true
    ,p_referencepath => p_portlet_record.reference_path
    ,p_back_url => p_portlet_record.page_url
    end if;
    Draw the portlet borders.
    The has_border property is set at the page region level.
    wwui_api_portlet.open_portlet(p_portlet_record.has_border);
    Display the content of the portlet in the show mode.
    Use the wwui_api_portlet.portlet_text() API when
    generating the content of the portlet so that the
    output uses the portlet CSS.
    htp.p(wwui_api_portlet.portlet_text(
    p_string => 'Hello World - Mode Show'
    ,p_level => 1
    if (p_portlet_record.has_border) then
    wwui_api_portlet.close_portlet;
    end if;
    elsif (p_portlet_record.exec_mode = wwpro_api_provider.MODE_SHOW_ABOUT) then
    Display the about page for the portlet.
    htp.p('Hello World - Mode Show About');
    elsif (p_portlet_record.exec_mode = wwpro_api_provider.MODE_SHOW_EDIT) then
    Display the edit page for the portlet.
    htp.p('Hello World - Mode Show Edit');
    elsif (p_portlet_record.exec_mode = wwpro_api_provider.MODE_SHOW_HELP) then
    Display the help page for the portlet.
    htp.p('Hello World - Mode Show Help');
    elsif (p_portlet_record.exec_mode = wwpro_api_provider.MODE_SHOW_EDIT_DEFAULTS) then
    Display the edit defaults page for the portlet.
    htp.p('Hello World - Mode Edit Defaults');
    elsif (p_portlet_record.exec_mode = wwpro_api_provider.MODE_SHOW_DETAILS) then
    Display the details page for the portlet.
    htp.p('Hello World - Mode Show Details');
    elsif (p_portlet_record.exec_mode = wwpro_api_provider.MODE_PREVIEW) then
    Display the preview page for the portlet.
    htp.p('Hello World - Mode Show Preview');
    end if;
    end show;
    I think you need to add this:
    You can get the values of your html-form with this command:
    v_hidden_1 varchar2(256);
    v_hidden_2 varchar2(256);
    v_hidden_1 := wwpro_api_parameters.get_value('name_of_hidden_1_in_html_form','p');
    v_hidden_2 := wwpro_api_parameters.get_value('name_of_hidden_2_in_html_form','p');
    You can get the actual URL with this command:
    v_url := p_portlet_record.page_url;
    Hope that helps.
    Regards,
    Mark

  • PL/SQL Portlet with edit defaults. HOW ???

    Hi !
    I created a pl/sql portlet that renders html. Now I want a customization option on the "Edit Defaults" page of the portlet. How do I do this ??
    In the code of the portlet I set "l_portlet.has_show_edit_defaults" to true. So the Edit Defaults page is show, but it's empty.
    On that page I want a variable where you can choose between 3 options. In the procedure where I render the html, I want to read this variable so I can render 3 different things.
    Can someone please help me ?

    I suggest you look at the database services provider in the PDK which is an example provider showing how to do the basic things within a provider/portlet - like customise and edit defaults.
    You could also generate a provider using the pl/sql generator - that will produce code that you can use as a starting point for your development.
    Basically you have to add code to the show procedure of the portlet to render a different page if the mode is 'MODE_SHOW_EDIT_DEFAULTS'. Look in the samples - it should be clear.
    Hope this helps.

Maybe you are looking for