apex_util.prepare_url outside the ApEx

Hello

I'm trying to create a weekly task that sends an HTML email with links to the user session state protection application. However when I try to generate the URL with apex_util.prepare_url the checksum is not added to the chain. wwv_flow_api.set_security_group_id seems to have no effect.

Any ideas?

Kind regards
Dan

http://danielmcghan.us
http://sourceforge.NET/projects/tapigen

Dan,

Unfortunately, you have to jump through hoops to do it. I posted recently a method that defines a session programmatically context, that is, from outside the simple HTTP request for an application. What follows is an adaptation that allows prepare_url to do its thing. You can connect to SQL * more like your application schema and check it out:

set serveroutput on

DECLARE  l_cgivar_name owa.vc_arr;  l_cgivar_val owa.vc_arr;  --  l_workspace_id number;  l_application_id number := 132; /* change this to your application ID */  l_user varchar2(30) := 'USERUSER'; /* change this to the username to be associated with the session */BEGIN

     -- set up cgi environment  htp.init;  l_cgivar_name(1) := 'REQUEST_PROTOCOL';  l_cgivar_val(1) := 'HTTP';  owa.init_cgi_env(num_params => 1,param_name => l_cgivar_name,param_val  => l_cgivar_val);

  -- find workspace ID of application  for c1 in (select workspace_id from apex_applications where application_id = l_application_id) loop    l_workspace_id := c1.workspace_id;  end loop;

  -- set security group ID, session ID, app ID globals  wwv_flow_api.set_security_group_id(l_workspace_id);  apex_application.g_instance := wwv_flow_custom_auth.get_next_session_id;  apex_application.g_flow_id := l_application_id;

  -- create authenticated session for l_user  wwv_flow_custom_auth_std.post_login(    p_uname => l_user,    p_session_id => null,    p_flow_page => apex_application.g_flow_id||':'||1);

  dbms_output.put_line('workspace:'||v('WORKSPACE_ID')||', session:'||apex_application.g_instance||', user:'||apex_application.g_user);

  -- call wwv_flow.show so that the correct parsing schema and other globals are established for the application  wwv_flow.show (    p_flow_id => apex_application.g_flow_id,    p_instance => apex_application.g_instance,    p_request => 'FSP_SHOW_POPUPLOV'    );

  -- set array of protected page IDs for session state protection  wwv_flow.g_protected_page_ids(1) := '1';    -- this establishes page 1 as an SSP-protected page

  -- generate link with checksum using prepare_url  dbms_output.put_line(apex_util.prepare_url('f?p=' || v('APP_ID') || ':1::dummyrequest','utf-8','2')); -- the request references page 1, designated as a protected pageEND;/

Note, the username parameter and the call to wwv_flow_custom_auth_std.post_login is necessary only if you want to generate a checksum of user (type '2') level. Links using this type of checksum may be used only by the same authenticated user which was set up during the generation of the checksum. For links that can be used by any authenticated user, a checksum of the application (type 1) level can be requested from prepare_url and for this, the user name parameter and the call to wwv_flow_custom_auth_std.post_login are useless.

The second argument to prepare the url must match the implementation REQUEST_IANA_CHARSET of your DAD and the third argument is the type of checksum (3 = level of the session and is not appropriate here, 2 = user-level and requires you to make the configuration of the username first, 1 = application-level).

Scott

Tags: Database

Similar Questions

  • apex_util.prepare_url with the translated applications

    I have two questions about the use of apex_util.prepare_url with the translated applications:

    1. Why is-checksum in a different translated application of checksum in the original application?
    2. Is there a way to control the apex_url.prepare_url checksum function calculates?

    I have no application in both languages English (en) and Slovenian (sl). Link with English checksum would work if I put the Application primary language to English and the link with the Slovenian checksum would work if I set the main language Application to Slovenian. Application language is derived from the main language Application.

    Sometimes, the real problem for me is I have 'English' version of checksum when apex_url.prepare_url is called from the "Slovene" to application version.  As I mentioned before 'English checksum' does not work if the Application language is set to Slovenian.

    I have reproduced this behavior (with the exception of the problem described in the previous paragraph) on http://apex.oracle.com/pls/apex/f?p=15120. An application illustrates an another unanswered question/bug related to translated app: https://forums.oracle.com/message/11229437#11229437

    Is this Bug to Oracle APEX? Can anyone provide any advice or workaround?

    Hello

    bookmarkable (amounts of application or user level control) control totals depend on a salt value that is stored in the application. If the salt is null, there is a fallback to the alias of the application. If you update the salt by clicking "Expire bookmarks" on request > security attributes and re - publish the application, salt must be synchronized between the applications. Control totals should be the same, then.

    Kind regards

    Christian

  • apex_util.prepare_url - by the way a comma between the item values

    Hello

    I created an application to illustrate a problem I'm having with the help of apex_util.prepare_url: http://apex.oracle.com/pls/otn/f?p=test_prep_url

    ' Tab ' without prep. url "displays a chart linking from this page (1) 2 using the usual f? syntax of p in the link, through two values, one for p2_schema_name and one for the p2_job_name values hidden on page 2. It works fine and the page 2 table displays data based on these past in values.
    The link is set up as: ' f? p =' || : APP_ID | ':2:' || : APP_SESSION. ": NO:2:P2_schema_name, P2_JOB_NAME:' |" schema_name | ',' || JOB_NAME

    ' Tab ' with prep. url "displays a chart which links from this page (3) on page 4 use apex_util.prepare_url to prepare the connection, passing two values, one for p4_schema_name and one for the p4_job_name in the values hidden on page 4. However, the decimal point is rendered in the browser '% 252C' url and p4_schema_name has the value "SCHEMA_A % 2CJOB_3" and p4_job_name is null (instead of = "JOB_3"). Of course, no data is found.
    The link is set up as: APEX_UTIL. PREPARE_URL ('f? p =' |: APP_ID |) ':4:' || : APP_SESSION. ": NO:4:P4_schema_name, P4_JOB_NAME:' |" schema_name | ',' || JOB_NAME)

    So I say to myself that I send you the value of point across properly, but I don't know what I would do differently. I hope the demo app described my problem enough so that someone can point out my blunder.

    The reason why I use APEX_UTIL. PREPARE_URL is that I would like to use session state protection and through the amount of control, but until I can get the sorted comma, I can't turn on session state protection.

    Thank you for your help.

    Alan

    Update: it is not prepare_url that does. Prepare_url encodes the comma in the list of item as % 2 c values. Then when the table XML gets converted to a blob for output, the % sign is encoded again. We will have to figure out what to do about this. In the meantime, only one element value can appear in the f? p link in a flash (fixed SVG chart) chart.

    Scott

  • State protection of session and browsing to URLs outside the apex

    Hello
    I'm working an application, in which basis on a unique key for each customer, and I show you her address on map (google.api) I used the apex util to prepare the url and activate checksumprotection on that element for success.
    I have another page that is the customer also details on this unique base, which works great as its peak in only
    what I notice is that, when I browse to url (maps.google.com) external session is different from what I had originally, posing problem when I want to navigate from card (java script Info window) to access details by using the same unique key of the client.
    I read that it was a bug in 4.1, but I use 4.1.1 assuming that the bug has been fixed.

    DB 11G
    Oc4j
    Linux

    Kindly help

    Hello Red Bull,

    Following article will help you to google maps api integration through web services:

    [url http://www.oracle.com/technetwork/developer-tools/apex/application-express/integration-086636.html#GOOGLE] Request Express integration with Google Maps

    OR

    You can try just of plugins available on http://apex-plugin.com.
    One of them which can be your help is:

    [url http://apex-plugin.com/oracle-apex-plugins/item-plugin/location-map-image_97.html] View the location on a Google map

    by @Peter Raganitsch including the blog post is:

    http://www.Oracle-and-apex.com/plugin-location-map-image/

    I hope that helps!
    Kind regards
    Kiran

  • From the APEX Collections out APEX?

    We have a system developed in the APEX that generates reports using plsql returning a query. These query parameters are passed using the APEX collection infrastructure. This allows you to run various reports and add them to the system by simply inserting the code in a table.

    Anyway, it was suggested that we might be able to schedule the report to run using the Oracle Applications and a concurrent request. What we'd probably do would be to a txt file using "immediate execution" of the spool and print it out. The next issue is of course to get the parameters set up with their respective values.
    I have tried this in the code and get an error:
    BEGIN
      wwv_flow_api.set_security_group_id(apex_util.find_security_group_id('OUR_WORKSPACE_NAME'));
      apex_collection.create_collection('XXTEST');
      apex_collection.add_members('XXTEST', p_c001 => apex_application.g_f01);
    END;
    This returns the error:
    ORA-01400: cannot insert NULL into ("FLOWS_030100"."WWV_FLOW_COLLECTIONS$"."SESSION_ID")
    ORA-06512: at "FLOWS_030100.WWV_FLOW_COLLECTION", line 288
    ORA-06512: at line 3
    Then... Is it possible, we can use the framework of collections of APEX to outside the APEX?


    Thank you
    John

    Yes,

    I was testing. Like, after you have created the session I chose v double ('APP_SESSION'), and he returned very well, so there is obviously more behind the scenes of transformation that takes place in APEX, so that the session available in the table of $ wwv_flow_sessions.

    Maybe you could just piggy back on a session that is new enough to be always available, but old enough that it is no longer used (through one of the points of view APEX).

    Van
    Trent

  • Duration of the apex - can we have access to the "Public Services" link Avaialbe in IDE

    Currently using Apex 3.2-11 GR 2

    The Production Server has only "Apex RUNTIME". All developer access is not allowed.

    But the requirement is a Manager to open a session in the IDE of the Apex and click "Utilities" and click reports Apex in the only case of "Apex runtime" on production. This is necessary for the Manager to see and monitor due to security requirements.

    The "Utilities" option is available during the installation of the apex is "runtime" only mode? Whatever it is dynamically switchable to a specific user connection to allow them to access these reports of object? Other suggestions on how these reports are available directly outside the Apex would also help.

    Thank you!

    citing the book Oracle Application Express 3.2

    When the APEX is first installed, we can choose whether to install the APEX or APEX Runtime Environment complete development environment. This can be changed later by running the SQL scripts provided with the installation of the APEX. We can convert from a development environment complete APEX for an APEX runtime environment by running script SQL apxdevrm.sql that helps the user SYS with SYSDBA role. We can also convert a runtime environment to a full development environment by running SQL apxdvins.sqlscript. Conversion of the environment leave our unchanged applications, and they can be run using the same exact URL.

    Thank you

    Tony Miller

    Software LuvMuffin

  • Trigger the error but only in the Apex

    I have a trigger with the following insert statement:

    insert into oe_headers_iface_all (order_source_id, orig_sys_document_ref, order_type_id, created_by, creation_date, last_updated_by, last_update_date, sold_from_org_id, sold_to_org_id, operation_code, booked_flag)
    values (1023, 'TEST', 1116, sysdate, 0, 0, sysdate, 225,65372, 'INSERT', ' don't);

    This trigger works well outside the Apex; It is not a mistake and inserts values into this table. But when I insert a record in my table by Apex, I get the following error:


    ORA-01722: invalid number ORA-06512: at the 'APPS '. RMA_TRACKER_T1', line 144 ORA-04088: error during execution of trigger ' APPS. RMA_TRACKER_T1'

    If I comment that insert statement it runs in the Apex and does not error.

    Any idea about what could be done Apex so angry with this insert statement? It says "invalid number" but I checked the fields again and again, and like I said if I just run this statement myself or insert a record in my table manually it works and does not work error, so Apex seems to be lying to me. In addition, the Apex version is 4.0.1.00.03.

    Published by: Cydonia on May 25, 2011 15:54

    Hello

    Oracle order management interface have a few important columns requiring registrant in the tables of the interface,

    OE_HEADERS_IFACE_ALL:
    ORIG_SYS_DOCUMENT_REF
    ORDER_SOURCE
    CONVERSION_RATE
    ORG_ID
    ORDER_TYPE_ID
    PRICE_LIST
    SOLD_FROM_ORG_ID
    SOLD_TO_ORG_ID
    SHIP_TO_ORG_ID
    SHIP_FROM_ORG_ID
    CLIENT_NAME
    INVOICE_TO_ORG_ID
    OPERATION_CODE

    I have this Inserts instructions and work very well for me...

    Insert in Ontario. OE_HEADERS_IFACE_ALL
    (
    CREATION_DATE, CREATED_BY, LAST_UPDATE_DATE, LAST_UPDATED_BY.
    ORIG_SYS_DOCUMENT_REF, ORDER_SOURCE_ID, ORDER_CATEGORY, ORDERED_DATE.
    ORG_ID, sold_from_org_id, ORDER_TYPE_ID, SALESREP_ID, CUSTOMER_PO_NUMBER,
    CUSTOMER_id, sold_to_org_id, BOOKED_FLAG)
    Values
    (Sysdate, Sysdate, P_USER_ID P_USER_ID, vReq_num, SOURCE_OM, 'ORDER', Sysdate,
    P_Org_ID, P_Org_ID, 1027, vSales, vPo_num, ii. CUSTOMER_ID, i.CUSTOMER_ID,
    'N' );
    ----

    It is to command lines
    ---
    Insert into Ontario. OE_LINES_IFACE_ALL
    (ORDER_SOURCE_ID, ORIG_SYS_DOCUMENT_REF, ORIG_SYS_LINE_REF, ORG_ID, LINE_NUMBER, INVENTORY_ITEM, ORDERED_QUANTITY, UNIT_SELLING_PRICE, UNIT_LIST_PRICE, PAYMENT_TERM_ID,
    CREATION_DATE, LAST_UPDATED_BY, LAST_UPDATE_DATE, ORDER_QUANTITY_UOM, CREATED_BY
    ATTRIBUT1, ATTRIBUT2, ATTRIBUT3, CALCULATE_PRICE_FLAG, SCHEDULE_SHIP_DATE)
    Values
    (SOURCE_OM, vReq_num, vlinea, p_Org_ID, vlinea, j.upc, j.ORDER_FORM, ((j.costo / 0.95), 2),)
    Tower of ((j.costo / 0.95), 2), 1003, P_USER_ID, P_USER_ID, Sysdate, Sysdate, one ', j.costo, 5% ', j.costo,
    ' N ", j.NEED_BY_DATE);

    Mortus-

  • Question of Apex_Util.Prepare_URL due to the Apex Util advise msg

    Hello

    I have the following code in a SQL statement in an IRR:

    APEX_UTIL. PREPARE_URL (p_url = > ' f? p =' | v ('APP_ID') |) ': 398 :'|| v ('APP_SESSION'): ':NO:398:P398_IDOBJ. VIMG_SEARCH. IDOBJ:', p_checksum_type = > 'SESSION') FullImg,.

    And it works as expected. However when I run the Util Apex advise I get the following:
    Region Source attribute (identifies the source of the region, region Type of reference Source)
    Check the V function used in SQL statements
    Performance category
    Message contains V/NV/DV function call in the SQL statement (can be a performance issue).

    Do I need to worry about this? or should I change the syntaxt in the APEX_UTIL. PREPARE_URL settings?

    Thank you
    Daniel

    In SQL (PL/SQL within the APEX blocks) the notation of the bind variable must be used:

    APEX_UTIL.PREPARE_URL( p_url => 'f?p=' || :APP_ID || ':398:'||:APP_SESSION||'::NO:398:P398_IDOBJ:||VIMG_SEARCH.IDOBJ:', p_checksum_type => 'SESSION') FullImg,
    

    V (...) notation is intended for program units PL/SQL database called from APEX.

  • To access the tables/views outside of the APEX

    According to the request of Andrew as a separate and somewhat more extensive thread here:

    We have several tables/views created under some schemes; all equipped with grants and public synonyms.

    These tables is visible and accessible by all users-ORACLE (via forms and States - as it has recently used)

    Now, I started with APEX a few days ago - OK, seems to work - but with objects such only created inside of this APEX workspace.

    This kind of things outside OF THE SUMMIT is not visible.

    Why? What is missing? It was one of my questions 1.

    How do these objects visible in the APEX? Of course, we do not want all that stuff again, and existing in bulk.

    I guess that as a very common problem.

    (One solution I found already: creating views inside the APEX to access objects outside.) "It is not comfortable).

    Thank you

    Wolfgang

    Object browser is rudimentary, but behaves in the same way that developer SQL will report on these objects.

    Notice the 'Plan' selection list at the top right.

    If you have tried ' select * from abcxyz "SQL commands, you should have success - in the same way, you should have success in the creation of form/report on abcxyz via the synonym.

    Scott

    .

  • Access outside the firewall APEX

    We have APEX 4.0 on Glassfish and the listener of the APEX. We would like to be able to access the APICES of the outside of the firewall. Can you tell me a few steps on this operation. I found a mention on the APEX site that would be inside the firewall and not external APEX earpiece but that's all.

    You say that you run the listener of the APEX on Glassfish, so yes, APEX listener goes everywhere go to Glassfish.

    Suggestion of Udo is a little different from my second option and could be better. In your current configuration, you have two components - the listener of the APEX running on Glassfish application server and the database that runs your APEX applications. Udo adds a third component, a HTTP server, such as Apache, which is your portal to the applications.

    If you can do:

    the user's browser HTTP > Apache AJP or HTTP >-->APEX Listener on Glassfish Oracle Net firewall > Oracle database (Udo suggestion)
    OR
    the user's browser HTTP > APEX Listener on Glassfish Oracle Net > firewall --> Oracle database (my option 2)
    OR
    the user's browser HTTP >--> APEX Listener on Glassfish Oracle Net firewall > Oracle database (my option 1)

    The key is that the firewall must be configured to allow traffic that will pass through it.

    The advantage of my option 2 or Udo suggestion is that you only allow traffic from a particular server outside the firewall in a protocol specific to a server inside the firewall. Udo suggestion makes this server information less vulnerable on what is inside the firewall and can be more easily used to simple HTML pages. It also makes changes less to your current configuration.

  • A table updated outside of the Apex are visible in the Apex?

    Hi all

    I want to insert into a table from the command line prompt, is it possible to see the update on the same table in my APEX application?

    I tried, but it doesn't look like I have, is there something wrong or some tweak I need to do?

    If the table is updated within the APEX, I could see it from the CMD.  But not the other way around.

    My system:

    Windows 7

    Apex 5

    Oracle 12 c 12.1.0.2.0

    Thank you.

    948287 wrote:

    Please update your forum profile with a recognizable username instead of "948287": Video tutorial how to change username available

    I want to insert into a table from the command line prompt, is it possible to see the update on the same table in my APEX application?

    I tried, but it doesn't look like I have, is there something wrong or some tweak I need to do?

    If the table is updated within the APEX, I could see it from the CMD.  But not the other way around.

    Of course. You are commit ting external transactions before trying to view it in APEX? Explicit commits should not by their SUMMIT as at least a validation will be performed internally for each cycle to view/submit page.

  • Is it possible to connect to the APEX of the outside world?

    I have a requirement to connect to the application out APEX (a java program). Is there a way to do this, maybe a web service? The basic requirement is to display some data to DB APEX by a scheduled task.

    I had a way to publish the APEX application data. Found that it supported is for the RESTful web service. It worked for me.

  • apex_util.prepare_url

    Hello!

    I use
    htp.p('<a href = "link"  >title</a>'); 
    in the region of PL/SQL to create dynamic links to pages in my application.
    How can I write apex URL in the href tag to just go on the page of the application, let's say 21?

    I tried with apex_util.prepare_url:
     htp.p('<a hrefff = "' || apex_util.prepare_url('f?p=&APP_ID.:21:&APP_SESSION.::::') ||'">link name</a>');
    But it generates "f?" ' p = 0:12: "link

    Spooky says:
    Hello!

    I use

    htp.p('title'); 
    

    in the region of PL/SQL to create dynamic links to pages in my application.
    How can I write apex URL in the href tag to just go on the page of the application, let's say 21?

    I tried with apex_util.prepare_url:

    htp.p('link name');
    

    But it generates "f?" ' p = 0:12: "link

    This is the expected behavior. Take a look at the examples in the documentation - note the description for the main "p_url" setting (my accent is "BOLD"):
    >
    p_url f? p relative URL with all resolved substitutions
    >

    This means that you must replace the values in the code itself, rather than passing references (if you want to use prepare_url, in other words).

  • AEX 4.1: error checksum with apex_util.prepare_url and PUBLIC_BOOKMARK

    Hello

    I'm on APEX 4.1. Before 4.1 APEX, I was able to generate a link with apex_util.prepare_url and use it as a public link with parameters in the url and a checksum to avoid that the values of the parameters are updated by users.
    With APEX 4.1, I have the following error:
    "No amount of control has been provided to show the treatment for a page that requires a checksum when one or more application, clear the cache or argument values are passed as parameters."

    My page has authentication value "Page is public" and value «Arguments must have Checksum» Page Access Protection
    Fields of text on the page have the Protection of the State from Session value "Required Checksum - Level Application".
    To generate the link I use the code:
    () apex_util.prepare_url
    p_url = > ' f? p = 33926:2:P2_I, P2_C:123, 456',
    p_checksum_type = > 'PUBLIC_BOOKMARK')

    I created test on apex.oracle.com pages to display the error message.
    1 page the link generated by the prepare_url function.
    Simply copy and paste this link in the browser to access the page (Page 2) which must show the fields with the values passed in the url.

    workspace: sdo1974
    username: [email protected]
    password: sdo1974

    Thanks for your help

    SEB

    Hi Seb,

    hit you bug # 12931249 described in the list of issues known to the http://www.oracle.com/technetwork/developer-tools/apex/application-express/41-known-issues-485406.html
    The good news is that a single patch is available to fix this bug.

    Concerning
    Patrick
    -----------
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • Built at the point for the apex group

    We use: APP_USER to retrieve the name of the current user of the APEX.

    Similarly, is it built in variable to retrieve the name of the Group of the user?

    FOR INFO:

    I use for authentication and authorization Apex users and groups.

    I use 5 APEX

    Mazelin wrote:

    We use: APP_USER to retrieve the name of the current user of the APEX.

    Similarly, is it built in variable to retrieve the name of the Group of the user?

    N ° users can be assigned to multiple groups. Use the APEX_UTIL. GET_GROUPS_USER_BELONGS_TO method of the API.

Maybe you are looking for