Help on Javascript call APEX on demand process

Hi, Guys:
I have a problem needs help: I need to add session protection with checksum for one of my page (page 2); but I have another page (page 1) which displays a Gogle map with a marker with infowindow, in this infowindow there should be a link that leads to my page 2. The problem is: my link needs checksum on demand. So I did the following thing:
#1 add session protection with checksum on page 2.
#2 add two application items requires checksum: CURRENT_URL, URL_WITH_CHECKSUM
#3 add a on demand application process URL_Checksum as follows:
DECLARE
l_url varchar2(2000);
BEGIN
select APEX_UTIL.PREPARE_URL(
p_url => :CURRENT_URL,
p_checksum_type => 'SESSION') into l_url from dual;
:URL_WITH_CHECKSUM:= nvl(l_url,:CURRENT_URL);
htp.prn(:URL_WITH_CHECKSUM);
END;#4 rewrite javascript as follows:
<img src="#WORKSPACE_IMAGES#1938.JPG"\><script type="text/javascript"       src="http://maps.googleapis.com/maps/api/js?sensor=false">     </script>    
<script type="text/javascript">      
function initialize() { 
var myOptions = { zoom: 18, mapTypeId: google.maps.MapTypeId.ROADMAP};  
var map = new google.maps.Map(document.getElementById("map"), myOptions);
var markerBounds = new google.maps.LatLngBounds();
var point=new google.maps.LatLng(&P1_H_MARK_GEOCODING.);
markerBounds.extend(point); 
map.fitBounds(markerBounds);
var listener = google.maps.event.addListener(map, "idle", function() { 
  map.setZoom(map.getZoom()-4); 
  google.maps.event.removeListener(listener); 
var marker;
marker = new google.maps.Marker({ position: new google.maps.LatLng(&P1_H_MARK_GEOCODING.), map: map });
var infowindow = new google.maps.InfoWindow({    content: "&P1_TF_OFFENDER_ID."});
var test_prefix = "http://apex.oracle.com/pls/apex/f?p=";
var current_parameter ="&APP_ID.:2:&SESSION.::NO::P2_H_OFFENDER_ID:"+"&P1_TF_OFFENDER_ID.";
var my_URL=test_prefix +encodeURIComponent(current_parameter);
//alert(my_URL);
//var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=URL_Checksum',PAGE);
//get.add('CURRENT_URL',my_URL);
//gReturn = get.get();
//get = null;
//alert(gReturn);
infowindow.setContent('<a href='+my_URL+'>&P1_TF_OFFENDER_ID.</a>');
google.maps.event.addListener(marker, 'click', function() {  infowindow.open(map,marker);});
</script> Note: I comment the part related to AJAX call and use variable my_URL, as there is a problem: infowindow is no longer available after I uncomment this part and uses gReturn as URL in the infowindow. Could anyone help me on this?
My application on apex.oracle.com:
workspace: LIAPEXTEST
acc: [email protected]
pwd: lxus2000
application ID: 55785 - test AJAX
Thanks a lot!
Sam

Hi, Jari:
I am required to set session protection with checksum required level for one page (offender detail) in my project, as this page displays sensitive information. Ths page will show content depending on offender_id. However, some of offender_ID is NOT open to public. Right now people can easily manuplate URL by changing offender_Id value in URL, so they can see information that is not open to them. That is the reason that I need to add session protection for that page.
However, on the other side, I need to provide Google map for radius search offenders. The infowindow of markers should include link which leads to offender detail page as well. Therefore, I have add checksum for URL in infowindow to let users access offender detail page through link in the infowindow. Otherwise, the link in infowindow won't work.
I thouht about generating URL with checksum on page loading. But there are hundreds of markers that need URL with checksum, I do not know how to pass it into javascript.
Could you give me a suggestion about it?
Thanks for your time.
Sam
Edited by: lxiscas on Aug 26, 2012 12:35 PM

Similar Messages

  • Calling an On Demand Process in PL/SQL Region without using AJAX

    Hi!
    I am trying to find a way to call an On demand Process in a PL/SQL Reports Region. The reason is that i need Reportings for about 20 Pages that look like the same but have different parameters. I already have some Processes that return SQL Statements and it works fine. But these Reportings are more complex and it's not possible to return it wirh a SQL Statement.
    I have seen some solutions in this forum that used AJAX to call such a process. The problem is, that I'm not allowed to use AJAX because activeX is diabled. I tried it and it works but i need another way to solve this process call.
    Thanks in advance
    Philipp

    At the moment I cannot say if your link can help. Right now the call of the On demand Process looks like this:
    Inside annonymous PL/SQL Region:
    <script type="text/javascript">
    get = new htmldb_Get(null,'||:APP_ID||'.,'APPLICATION_PROCESS=F_REPORT_NAME',0);
    gReturn = get.get();
    document.write(gReturn);
    </script>

  • Calling an On Demand Process

    Dear HTML DB Team,
    In my application, I have defined two PL/SQL Anonymous Block "on demand" application processes. Is there a line of code that I can include in application process A to call application process B?
    Process B is called by several pages, but also needs to be included as part of Process A.
    Thanks,
    Chaunaci

    Chaunaci,
    No, this cannot be done.
    Scott

  • Calling ON DEMAND process for outside APEX

    Hi All,
    I would like to call an ON DEMAND process from outside APEX (using HttpClient java class). I think i have to use wwv_flow.accept but i'm bit lost on how to specify that i'm calling a process on demand.
    Has someone already tried this ? samples or advices would be more then welcome ... The goal behind the scene , would be to have an Apex page acting like a servlet (HTTPClient send a xml request and receive an XML response from the apex page).
    Thks.
    Thierry

    Thierry,
    You need to set up the HTTP request as you would if invoking your application+process from a URL, e.g.,
    ..f?p=100:0:9876543210123456789:APPLICATION_PROCESS=<name of process>
    ..in which request header the authentication cookie is provided, and in which request the correct session ID is provided. You could alternatively do a POST to wwv_flow.show, bypassing the f procedure, but I don't know if that will save you any steps.
    Scott

  • Error while using ajax addParam function in on demand process

    Hi ,
    I am calling an on demand process from a javascript that inserts value from a modal from into a table.
    function f_insert_transaction()
    var ajaxRequest = new htmldb_Get(null, $v('pFlowId'), 'APPLICATION_PROCESS=insert_manual_transaction',73);
              ajaxRequest.addParam('x01', $v('P73_ARRANGEMENT_ID'));
              ajaxRequest.addParam('x02', $v('P73_TRANSACTION_DIALOGID'));
              ajaxRequest.addParam('x03', $v('P73_CUSTOMER_NAME'));
              ajaxRequest.addParam('x04', $v('P73_CUSTOMER_NUMBER'));
    ajaxRequest.addParam('x05', $v('P73_SALES_ORDER'));
    ajaxRequest.addParam('x06', $v('P73_SO_LINE'));
    ajaxRequest.addParam('x07', $v('P73_INVOICE'));
    ajaxRequest.addParam('x08', $v('P73_INVOICE_LINE'));
    ajaxRequest.addParam('x09', $v('P73_ITEM'));
    ajaxRequest.addParam('x10', $v('P73_ITEM_DESC'));
    var ajaxResult = ajaxRequest.get();
    alert(ajaxResult);
    ajaxRequest = null;
    }The insert works fine as long as item names range from x01 - x10.
    When I add the below
    ajaxRequest.addParam('x11', $v('P73_QUANTITY')); The insert stops working, and the alert displays the following error message :
    <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
    <HTML><HEAD>
    <TITLE>404 Not Found</TITLE>
    </HEAD><BODY>
    <H1>Not Found</H1>
    The requested URL /pls/dev1/wwv_flow.show was not found on this server.<P>
    <HR>
    <ADDRESS>Oracle-Application-Server-10g/10.1.2.0.0 Oracle-HTTP-Server Server at </ADDRESS>
    </BODY></HTML>
    Appreciate any help in debugging this
    Thanks,
    Dippy
    Edited by: Dippy on Aug 2, 2010 10:14 AM

    Hello:
    You could concatenate the page-item values into a single string where the values are separated from each other by a suitable delimiter ( a colon for example) and set, x01, to this concatenated value. You could then decompose this concatenated string in the ODP used in the AJAX call to obtain the individual values.
    varad

  • On demand process: addtional params

    Hello,
    I'm calling a on demand process just with the url.
    http://localhost:8080/apex/f?p=200:0:0:APPLICATION_PROCESS=test
    how is it possible to add additional GET parameters without writting them into a page-item/application-item?
    thank you
    Damien

    Hi,
    You can set in url items value. like
    http://localhost:8080/apex/f?p=200:0:0:APPLICATION_PROCESS=test:::Px_MY_ITEM:value1Check URL syntax
    http://download.oracle.com/docs/cd/E17556_01/doc/user.40/e15517/concept.htm#sthref114
    Regards,
    Jari

  • On Demand Process Javascript

    I have a javascript to invoke an on demand process pass_menu_flag_to_db.
    function set_reminder1(pValue, pNumber){
              var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=pass_menu_flag_to_db',0);
              get.addParam('x01', pValue);
              get.addParam('x02', pNumber);
              gReturn = get.get();
    The ODP is
    declare
    v_number number;
    v_flag char;
    begin
    v_number = wwv_flow.g_x01;
    v_flag = wwv_flow.g_x02;
    pkg_t_ul.update_ul_menu_flag(:APP_USER, v_number, v_flag);
    end;
    I am calling the JS function in an on click event. However, I couldn't find the ODP is excuted and hence the values are not passed to the database. I need this to be done without the page submit also.
    Is there any issue with my code?
    Advance thanks,
    Natarajan
    Edited by: Nattu on Mar 18, 2011 6:02 AM

    Thanks Jari,
    As I am new to use firebug, I couldn't find the xmlhttprequest in the firebug console, however looking at console, helped me that I made mistake in the plsql block in on demand process. Fixed the issue, now it is working without page submit.
    I appreciate your timely help. Thanks.
    Natarajan

  • How to call an "ON DEMAND" application process

    Dear HTML DB Team,
    With HTML DB you can define "on demand" application processes. ("On Demand: Run this application process when requested by a page process.") These should be callable from page processes.
    How should a call in a page process to such an "on demand process" be written?
    Tried several options, no success. Please help.
    Could not find any information in this forum or html.pdf and help.
    Regards, Erik

    when you create an application-level process in htmldb, you have the option of creating it with a "Point" of "On Demand: Run this application process when requested by a page process". after doing that, you can then add processes to your htmldb application pages with a "Type" of "On Demand - Run an 'on-demand' application process". the next screen after indicating that Type lets you choose the On Demand process you'd like to use.
    hope this helps,
    raj

  • Definng and calling javascript on apex 4.2 (New on Apex)

    Hi.
    can anyone tell me where do i create a javascript on apex 4.2 ? so i can call it from various pages.
    thanks

    I suggest create a javascript (.js) file with all your functions and upload it through the shared components > static files and refer the javascript in javascript URL reference in page attributes. The code will be something like <script language="javascript" src="#APP_IMAGES#javascript file" /> or #WORKSPACE_IMAGES#.

  • On demand process linked to a POP UP LOV - help

    Hi,
    I am trying to set an application item to the return value of a pop up lov that has a display value and a return value. The display value is a text item and the return value is a number id. I need the id for an on demand process.
    When I look at the session state for the application item and the page item for the pop up it shows the display value and not the numeric id.
    thanks.
    Edited by: DragonLady on May 19, 2010 9:23 PM

    Anyone?

  • Help with htmldb_Get calling an on_demand application proccess

    Hi,
    I wonder if anyone can help with a problem I have. I have a button (coded in Javascript) that uses htmldb_Get to call an on_demand application process that should be updating the database. Unfortunately it does not, and I cannot see what I've done wrong! Perhaps some fresh eyes can help?
    Call to htmldb_get / application process
    var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=applicationProcessSaveToDB',0);
    get.add('STO_ID',myStoId)
    get.add('DTE_ID',myDteId)
    get.add('ADJ',myAdj)
    var gReturn = get.get();
    alert( 'gReturn <'+gReturn+'>' ) ;
    On_demand process code
    DECLARE
    l_msg VARCHAR2 (2000);
    BEGIN
    SELECT :ADJ || CHR(10) || :STO_ID || CHR(10) || :DTE_ID
    INTO l_msg
    FROM dual;
    UPDATE fid_live.tffd_cash_sls
    SET local_est_manl_adj = :ADJ
    , est_manl_adj = pk$_sa_exchange.f$_get_ukp_value
    TO_NUMBER( pk$_sa_sel.f$_sel_sto_no( :STO_ID ) ),
    :ADJ,
    pk$_sa_sel.f$_sel_calendar_dte( :DTE_ID )
    WHERE sto_id = :STO_ID
    AND dte_id = :DTE_ID;
    -- COMMIT;
    HTP.prn (l_msg);
    EXCEPTION WHEN OTHERS THEN
    l_msg:='Exception has occurred '||SQLERRM||', '||SQLCODE;
    HTP.prn (l_msg);
    END;
    I was expecting to see (a) the database updated (it is not) and (b) the text string l_msg echoed back via the alert(gReturn) - it does not (but does if I comment out the UPDATE statement, which makes me wonder if the SQL is being rejected, but then I'd hope that the exception block would return an error message).
    Can anyone help?
    Many thanks,
    MarkB...

    Hi Mark,
    for the future in case you have again a problem with an on-demand process. The following posting which I have written some time ago should help you to test it.
    http://inside-apex.blogspot.com/2006/12/how-to-test-on-demand-process.html
    Testing without the javascript call and seeing the actual result values is much easier then the through javascript.
    Greetings
    Patrick
    My APEX Blog: http://inside-apex.blogspot.com
    The ApexLib Framework: http://apexlib.sourceforge.net
    The APEX Builder Plugin: http://sourceforge.net/projects/apexplugin/

  • Retrieve data/files fro HTTP POST request in On-Demand process

    Hello,
    I would like to integrate https://github.com/blueimp/jQuery-File-Upload to my APEX 4.2 application inside XE11g. I would like to use this kind of jQuery component, multiple file upload, use Drag & Drop, image resize, size limit, filter extensions etc...
    This jQuery component and also others javascript uploaders sends data files to some defined URL. Developer need to build some servlet, php script or something on server side that will read files from HTTP request and stores it somewhere.
    Do you know how to do it in APEX? How can I read data from HTTP POST request in PL/SQL? Now I can only call my On-Demand application process from javascript, but I am not able to read any data from HTTP POST in it.
    Can I do it in APEX, or using MOD_PLSQL?
    I would like to implement this:
    1) some javascript uploader will call some URL of my application and sends HTTP POST with data files
    2) I will read data files from HTTP POST and store them into database
    3) I will create some HTTP response for javascript uploader
    Thank you for some tips

    I know about that existing plugin " Item Plugin - Multiple File Upload"
    But I doesn't work in IE and has only basic features. Licence for commercial use is also needed. I would like to use some existing jQuery plugin. There are many of these plugins with nice features. And only one problem is that I need to create some server side process/servlet/script.. that can recieve HTTP request, get files from it and stores them into DB.

  • JavaScript help Including JavaScript in a .js File Referenced by the Page

    I need help with JavaScript. I have been doing the Advanced Tutorial, and still don't feel that understand how to make it work.
    The example in "Oracle Database Application Express User's Guide" shows this line:
    <script src="http://myserver.myport/my_images/custom.js" type="text/javascript"></script>
    I understand that "my_images" is hypothetical, but where is the real equivalent to this?
    Is there a working example/tutorial of Including JavaScript?
    <li />Also how does one create AJAX functionality?
    If I want to do something like this http://www.w3schools.com/ajax/ajax_server.asp
    in APEX, where do I place the "time.asp" script?
    <li />Can we assume that the HTML and ASP file are in the same directory?
    Please any assistance with these topics are greatly appreciated.

    Hello,
    >> what is the directory structure you would use for /my_images/custom.js? Where does one load these .js files? where is it in the local machine?
    C:\oracle\product\10.2.0\db\Apache ?
    The documentation only gives you a possible example (and I might agree that it’s not the best one). You should put your external JS files (on the server OS file system) wherever it will be most accessible and maintainable for you. The best place, IMHO, is under the /images/javascript/ directory. The reason is very simple. You can use the alias /i/, which defined in your DAD file, to gain a very simple path to the file. In this case, the loading statement will look similar to the following:
    <script src="/i/javascript/custom.js" type="text/javascript"></script>
    >> Do you mean "Oracle Database PL/SQL Packages/Types and htp packages?"
    I’m assuming you are talking about the on-demand process. This is a regular PL/SQL anonymous block, which will be fired only upon specific request - http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10499/bldr.htm#BABEAIIE . This is the mechanism for handling the server side of AJAX.
    >>Anythig else available for us to levarage?
    Denes examples site can also be a valuable resource - http://htmldb.oracle.com/pls/otn/f?p=31517:1 .
    Regards,
    Arie.

  • Possible to download file using ajax on demand process?

    In the past I've used procedures with the wpg_docload.download_file function to download files by granting public to the procedure and executing the download from a report link (such as http://localhost:8080/apex/schema_name.download_blob?file_in=xxx)
    I'd like to move to the download to a link that's called from an ajax called on demand process. Is this possible? I have got the report link calling a javascript function passing the rowid in and running the same download_blob procedure via the on demand process but, whilst the code runs OK it does not return the prompt box for the user to open/save the file. I guess this might be because it's not returning it to the javascript in the proper way but I'm v flaky wrt to ajax.
    var ajaxRequest = new htmldb_Get( null , &APP_ID. , 'APPLICATION_PROCESS=download_blob' , 0);
    var ajaxResult = ajaxRequest.get();
    Thanks
    Simon

    To be honest, it's not a big deal, I wanted to do it this way as we have data stored as BFILES and some of the downloads are so big they take a while to load into a temp_blob and thus I wanted to call it from java script so I could call a loading "div" 1st, so the user does not see the screen hanging. However I've changed the code to load the BFILE into an actual blob 1st (through an ajax process) and then return a link to the screen pointing to an app process which opens the blob.

  • On-demand process in page processing - possible bug?

    Hi
    Came across a possible bug today, certainly not a big one and unlike to affect many people but...
    1. Create an on-demand application process
    2. Create an on-demand page process that calls the application process
    3. Delete the application process.
    Now at this point, the page process is still available for editing/deleting etc.
    4. Copy the application.
    In the new version of the application, the page process shows as plain text in the application builder with no link to edit or delete it and when the page is run, it predictably fails at the processing point of the page process when it tries to find the application process (the id from wwv_flow_processing is shown in the error for the old application process).
    The only way to get rid of the page process is to select 'Edit All' and then select and delete it - then everything is hunky dory again.
    A minor issue I know, but maybe someone will have the same issue one day and stumble across this thread :)
    Cheers
    Ben

    At the moment I cannot say if your link can help. Right now the call of the On demand Process looks like this:
    Inside annonymous PL/SQL Region:
    <script type="text/javascript">
    get = new htmldb_Get(null,'||:APP_ID||'.,'APPLICATION_PROCESS=F_REPORT_NAME',0);
    gReturn = get.get();
    document.write(gReturn);
    </script>

Maybe you are looking for