Accessing APP_USER and APP_SESSION via javascript

G'day All,
I've tried a couple of ways based on results from google this forum to access APP_USER and APP_SESSION with in javascript.
The answer must not be to just pass it in as a parameter as I'm overriding "showHide" function for the the "Show Hide region" to record if the region was shown or not so that when the page is refreshed the regions will open automatically.
I've tried to just simply try for example: alert('app_user: #APP_USER# app_session: #APP_SESSION#') but it does not work they way I ant it :(
Can any one help please.
Regards
Mark

Hello,
You should take a look at this
http://www.oracle.com/technology/products/database/application_express/packaged_apps/packaged_apps.html#STICKY
It is example code of doing exactly that. At the moment it is per session but it should be pretty easy to extend to save that into a user table. You won't need to access those variables on the client side but can do it in the OnDemand Process.
Carl

Similar Messages

  • Accessing a network resource via javascript

    Hello,
    we have been using Adobe Reader for linux provided by the yum repository for quite some time, without major issues. Currently, however, we are seeing a mysterious problem with a PDF form which is designed to exchange data with a local server, using javascript functionality, as far as I can see. On one of our machines (running CentOS 5.8 64-bit) this has stopped working recently, and I cannot figure out why. Clicking the respective field simply has no effect, there is no error message, neither in the Reader window, or on the console, both in normal mode and debug mode. Nothing in the system logs either. The function simply seems to be ignored!
    Some observations which might be helpful:
    1. Uninstalling and reinstalling the Reader package, after clearing all personal preferences, did not have any effect.
    2. Using a fresh version of the PDF form did not solve the problem.
    3. Firewall and SElinux are disabled anyway.
    4. With a "clean" account on the same machine, the same problem occurs.
    5. On a very similar machine (same OS, same Reader version) the operation is working properly!
    So it seems to be something specific to this machine, but not specific to a certain account. It is obviously neither a corrupted Reader installation, nor a problem with this specific reader version, nor a corrupted PDF form. Now I am running out of ideas...
    Any suggestions what else might be preventing network access (via javascript) from functioning properly? Javascript itself is (by default) enabled in the preferences.
    Thanks in advance
    Oliver

    Sorry for the double post, but help would be appreciated...

  • Access file applet function via javascript

    hi all
    when i want to have access to the method (which in fact read a file) of my applet class via javascript, a java error is raised: access denied
    BUT i have signed the related jar!
    when i want to access the method (which in fact read a file) of my applet class via the normal way (put a button into a frame and....) it works.
    are there more configurations to do or ....?
    Kind Regard Tom
    here is the code
    HTML file
         <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
         <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
         <head>
         <link type="text/css" rel="stylesheet" href="/css/style.css">
              <script type="text/javascript">
              function xclick() {
              alert( document.getElementById('applet').isFileOk());
              document.getElementById('fichier').value = document.getElementById('applet').isFileOk();
              //alert(document.portal.applet.isFileOk(path));
              function checkfile() {
                   //var fichiercacher = document.portal.fichier.value;
                   var fichiercacher = document.getElementById("fichier").value;
                   document.getElementById("fichiercacher").value = fichiercacher;
                   document.getElementById("fichiercacher").value = fichiercacher;
                   document.getElementById("chemin").value = fichiercacher;
                   alert("fichier cacher" + fichiercacher);
                   alert("chemin=" + document.getElementById("chemin").value);
              </script>
         </head>
         <body >
         <form name="portal" method="post" action="" >
    <p align="center" id="corps">
         <img border="0" src="ilias.bmp"><br>
         <applet id="applet2" code="NumberOfLine.class" archive="NumberOfLine.jar" width="150" height="109" >
              <param name="maxLines" value="50" />
              <param id="chemin" name="fichierparam" value="" />
              </applet>
              <applet id="applet" code="localfile.class" archive="localfile.jar" width="150" height="109" >
              <param name="maxLines" value="50" />
              <param id="chemin" name="fichierparam" value="" />
              </applet>
         <br>
                   <div id="divloading" ></div>
         <input type="hidden" name="fichiercacher" />
         <input type="file" name="fichier" onchange="checkfile()">
    <input type="button" value="click me" onClick=xclick() ; />
         </p>
         </form>
         </body>
         </html>
    Class NumberOfLine javascript way
    import java.applet.Applet;
    import java.awt.Button;
    import java.awt.Label;
    import java.io.*;
    public class NumberOfLine extends Applet {
    private boolean fileok = false;
    Label message = new Label("MAX line = 40 ");
    Button btnok = new Button("check file");
    int maxline = 40;
    public void init() {
         String sMaxLines = getParameter("maxLines");
         if ( sMaxLines != null ){
                   this.maxline = Integer.parseInt(sMaxLines);
                   System.out.println(this.maxline);
         public String isFileOk(String chemin) {
              File ffile = new File( chemin);
              try{
                   FileReader fr = new FileReader(ffile);
                   LineNumberReader ln = new LineNumberReader(fr);
              int count = 0;
              while (ln.readLine() != null) {
              count++;
              System.out.println("Total line no: " + count);
                   ln.close();
                   fileok = (count <= maxline);
              catch(IOException e){
                   e.printStackTrace();
                   System.out.println(e.toString());
              return fileok ? "ok" : "nok";
    CLass localfile Normal way
    import java.applet.*;
    import java.awt.*;
    import java.util.*;
    import java.lang.*;
    import java.text.*;
    import java.awt.event.*;
    import java.io.*;
    public class localfile extends Applet {
         public localfile() {
              Panel p = new Panel();
              Font f;
              String osname = System.getProperty("os.name","");
              if (!osname.startsWith("Windows")) {
                   f = new Font("Arial",Font.BOLD,10);
              } else {
                   f = new Font("Verdana",Font.BOLD,12);
              p.setFont(f);
              p.add(new Button("Open"));
              p.add(new Button("other"));
              p.setBackground(new Color(255, 255, 255));
         p.setSize(800, 800);
              add(p);
              setSize(800, 800);
              setVisible(true);
         public String isFileOk(){
                   System.out.println("OPEN CLICKED");
                   int arrlen = 10000;
                   byte[] infile = new byte[arrlen];
                   Frame parent = new Frame();
                   FileDialog fd = new FileDialog(parent, "Please choose a file:",
                   FileDialog.LOAD);
                   fd.show();
                   String selectedItem = fd.getFile();
                   if (selectedItem == null) {
                        // no file selected
                   } else {
                        if ((fd.getFile()).endsWith("txt") || (fd.getFile()).endsWith("text")){
                             File ffile = new File( fd.getDirectory() + File.separator +
                             fd.getFile());
                             // read the file
                             System.out.println("reading file " + fd.getDirectory() +
                             File.separator + fd.getFile() );
                             try {
                                  FileInputStream fis = new FileInputStream(ffile);
                                  BufferedInputStream bis = new BufferedInputStream(fis);
                                  DataInputStream dis = new DataInputStream(bis);
                                  try {
                                       int filelength = dis.read(infile);
                                       String filestring = new String(infile, 0,
                                       filelength);
                                       System.out.println("FILE LENGTH=" + filelength);
                                       System.out.println("FILE CONTENT=" + filestring);
                                  } catch(IOException iox) {
                                       System.out.println("File read error...");
                                       iox.printStackTrace();
                             } catch (FileNotFoundException fnf) {
                                  System.out.println("File not found...");
                                  fnf.printStackTrace();
                        } else {System.out.println("Error this is not a txt file"); }
              return "turc";
         public boolean action(Event evt, Object arg) {
              if (arg.equals("Open")) {
                   System.out.println("OPEN CLICKED");
                   int arrlen = 10000;
                   byte[] infile = new byte[arrlen];
                   Frame parent = new Frame();
                   FileDialog fd = new FileDialog(parent, "Please choose a file:",
                   FileDialog.LOAD);
                   fd.show();
                   String selectedItem = fd.getFile();
                   if (selectedItem == null) {
                        // no file selected
                   } else {
                        if ((fd.getFile()).endsWith("txt") || (fd.getFile()).endsWith("text")){
                             File ffile = new File( fd.getDirectory() + File.separator +
                             fd.getFile());
                             // read the file
                             System.out.println("reading file " + fd.getDirectory() +
                             File.separator + fd.getFile() );
                             try {
                                  FileInputStream fis = new FileInputStream(ffile);
                                  BufferedInputStream bis = new BufferedInputStream(fis);
                                  DataInputStream dis = new DataInputStream(bis);
                                  try {
                                       int filelength = dis.read(infile);
                                       String filestring = new String(infile, 0,
                                       filelength);
                                       System.out.println("FILE LENGTH=" + filelength);
                                       System.out.println("FILE CONTENT=" + filestring);
                                  } catch(IOException iox) {
                                       System.out.println("File read error...");
                                       iox.printStackTrace();
                             } catch (FileNotFoundException fnf) {
                                  System.out.println("File not found...");
                                  fnf.printStackTrace();
                        } else {System.out.println("Error this is not a txt file"); }
              } else return false;
              return true;
    }

    Thx you were a great due to my big lak of java skills.
    i found the solutions and for those who are interrested here is the code:
    public String isFileOk(final String filepath){
              System.out.println("OPEN file=" + filepath);
              int arrlen = 10000;
              byte[] infile = new byte[arrlen];
                        try {
                   FileInputStream fis = (FileInputStream) AccessController.doPrivileged(
                   new PrivilegedExceptionAction() {
                   public Object run() throws FileNotFoundException {
                   return new FileInputStream(filepath);
                             BufferedInputStream bis = new BufferedInputStream(fis);
                             DataInputStream dis = new DataInputStream(bis);
                             try {
                                  int filelength = dis.read(infile);
                                  String filestring = new String(infile, 0,
                                  filelength);
                                  System.out.println("FILE LENGTH=" + filelength);
                                  System.out.println("FILE CONTENT=" + filestring);
                             } catch(IOException iox) {
                                  System.out.println("File read error...");
                                  iox.printStackTrace();
                             } finally {
                                  try {
                                       fis.close();
                                  } catch(IOException ioe) {
                                       //oops
                   } catch (PrivilegedActionException e) {
                   // e.getException() should be an instance of FileNotFoundException,
                   // as only "checked" exceptions will be "wrapped" in a
                   // PrivilegedActionException.
                   //throw (FileNotFoundException) e.getException();
                        e.printStackTrace();
                        return "nok";
                   return "ok";
         }

  • Unable to access gateway and DNS via VPN (L2TP) with Snow Leopard Server

    Summary:
    After rebooting my VPN server, i am able to establish a VPN (L2TP) connection from outside my private network. I am able to connect (ping, SSH, …) the gateway only until the first client disconnects. Then i can perfectly access all the other computers of the private network, but i cannot access the private IP address of the gateway.
    Additionally, during my first VPN connection, my DNS server, which is on the same server, is not working properly with VPN. I can access it with the public IP address of my gateway. I can access it from inside my private network. A port scan indicates me that the port 53 is open, but a dig returns me a timeout.
    Configuration:
    Cluster of 19 Xserve3.1 - Snow Leopard Server 10.6.2
    Private network 192.168.1.0/255.255.255.0 -> domain name: cluster
    -> 1 controller, which act as a gateway for the cluster private network, with the following services activated:
    DHCP, DNS, firewall (allowing all incoming traffic for each groups for test purposes), NAT, VPN, OpenDirectory, web, software update, AFP, NFS and Xgrid controller.
    en0: fixed public IP address -> controller.example.com
    en1: 192.168.1.254 -> controller.cluster
    -> 18 agents with AFP and Xgrid agent activated:
    en1: 192.168.1.x -> nodex.cluster with x between 1 and 18
    VPN (L2TP) server distributes IP addresses between 192.168.1.201 and 192.168.1.210 (-> vpn1.cluster to vpn10.cluster). Client informations contain the private network DNS server informations (192.168.1.254, search domain: cluster).
    _*Detailed problem description:*_
    After rebooting the Xserve, my VPN server works fine except for the DNS. My client receives the correct informations:
    Configure IPv4: Using PPP
    IPv4 address: 192.168.1.201
    Subnet Mask:
    Router: 192.168.1.254
    DNS: 192.168.1.254
    Search domain: cluster
    From my VPN client, i can ping all the Xserve of my cluster (192.168.1.1 to 18 and 192.168.1.254). If i have a look in Server Admin > Settings > Network, i have three interfaces listed: en0, en1 and ppp0 of family IPv4 with address 192.168.1.254 and DNS name controller.cluster.
    The DNS server returns me timeouts when i try to do a dig from my VPN client even if i am able to access it directly from a computer inside or outside my private network.
    After i disconnect, i can see in Server Admin that the IP address of my ppp0 interface has switch to my public IP address.
    Then i can always establish a VPN (L2TP) connection, but the client receives the following informations:
    Configure IPv4: Using PPP
    IPv4 address: 192.168.1.202
    Subnet Mask:
    Router: (Public IP address of my VPN server)
    DNS: 192.168.1.254
    Search domain: cluster
    From my VPN client, i can access all the other computers of my network (192.168.1.1 to 192.168.1.18) but when i ping my gateway (192.168.1.254), it returns me timeouts.
    I have two "lazy" solutions to this problem: 1) Configure VPN and DNS servers on two differents Xserve, 2) Put the public IP address of my gateway as DNS server address, but none of these solutions are acceptable for me…
    Any help is welcome!!!

    I would suggest taking a look at:
    server admin:vpn:settings:client information:network route definitions.
    as I understand your setup it should be something like
    192.168.1.0 255.255.255.0 private.
    at least as a start. I just got done troubleshooting a similar issue but via two subnets:
    http://discussions.apple.com/thread.jspa?threadID=2292827&tstart=0

  • Cant access iCloud webmail and notes via web

    Hi,
    Although I have properly set up mail an notes on my iPhone I cant access mail and notes via webmail (icloud.com). All other features (calendar, contacts,..) work perfect. Any ideas please?
    Thanks

    Hello there, barbtom.
    The following Knowledge Base article offers up some great troubleshooting recommendations for the issue you're describing:
    iCloud: Troubleshooting iCloud Mail
    http://support.apple.com/kb/ts4002
    If you can't access iCloud Mail at iCloud.com
    Check the System Status page to find out whether any known issues are affecting iCloud Mail.
    Make sure that you're using a supported browser and that your browser is up to date: Choose Software Update from the Apple () menu and install any available Safari updates, as well as any security and OS X updates. Instructions for updating other browsers should be available from the built-in or online help for those browsers.
    If your iCloud Mail issue occurs only when using a particular browser, try clearing that browser's cache:
    Safari 6 or later: Choose Reset Safari from the Safari menu, then select the "Clear history" checkbox and click Reset. Or choose Develop > Empty Caches (if you don't have a Develop menu, choose Safari > Preferences, click the Advanced icon, then select the “Show Develop menu in menu bar” checkbox).
    Safari 5 and earlier: Choose Empty Cache from the Safari menu.
    Other browsers: instructions should be available from the built-in or online help for the browser.
    If you're having issues accessing iCloud Mail from one location or Internet connection but not another, contact your Internet Service Provider (ISP) or network administrator. Some Internet configurations intentionally or unintentionally prevent access to certain websites or services, such as iCloud Mail.
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • Accessing Properties of Individual Tool Buttons via JavaScript

    Hi all!
    I am new to both this forum and scripting Acrobat so please excuse me if the question sounds naive.
    I am trying to find a way to access the properties of individual tool buttons via JavaScript (if there is one). I could not find it yet in JS API Reference. If anybody can help me or direct me to the right way, I will greatly appreciate that.
    For example, in 'Comment & Markup' toolbar one can right-click and change the 'Tool Default Properties' of various markup tools like Highlighter, Line, Rectangle etc. Is it possible to access these properties through JavaScript so that buttons can be added for dynamically changing these? Hope this makes sense!
    Thanks in advance for your interest and help.
    John.

    Hi Andy, thanks for the answer. It was pretty simple - I just added an authorization scheme to the report column, wehre the javascript is executed. Christof

  • MS Access Freezes and Closes when I save a draft email via Outlook 2013

    I have Access 2013 Office 365.  When I email a report from access via Outlook 2013 I have problems.  Outlook opens fine. If I hit send everything is fine. However if I save the email as a draft Access freezes and then closes after a 10- 15 sec delay.
    The email is saved as a draft in Outlook but very annoying to have to reopen my Database .
    The message I get is : MS Access has stopped working. A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available
    I tried compact and repair but that didn't help. Also tried turned of add ons. That didn't work.
    Never had this problem with office 2010.  What can I do?
    I just discovered the same thing  is happening in Excel and Word.

    Hi all,
    Thanks for visiting our forum and sharing your experience here. It'll be benefited to our communicator.
    Have a good time.
    Regards,
    George Zhao
    TechNet Community Support

  • Can my wife use her iPad to get access to my music via iTunes Match and still retain her iTunes store user id?

    my wife has a new iPad and iPad Store user ID.  I have a seperate iTunes store user id and subscribe to iTunes Match.  All my music is now in the "cloud".  Can my wife get access to my music via match and still retain her iTunes store user id? 
    The only way I seem to be able to get Match to work on her iPad is if she uses both my iCloud user ID and my iStore user ID.

    Essentially I have the same problem.  My spouse and I have a shared music collection on 1 computer.  We've used different id's for our various devices for years.  Currently we both use iPad minis iPhones and AppleTV.  I have iTunes Match on my account.  Recently we haven't been able to access songs bought or downloaded by the other id.  iTunes says that the computer is associated with another id.  In fact we have 1 song that didn't finish downloading when an album was bought on my spouses account while the rest of the album is there.  My suspicion is that I will need to go down to a shared id when we buy our new MacBook Pro for Boxing Day.  But, if we do that are we able to have separate calendars and passbooks and other features?  Is there another option?  I'm willing to stop using iTunes Match if necessary.

  • I am having trouble accessing the iTunes store via iTunes.  It shows an error message "iTunes could not connect to the iTunes Store.  The network connection timed out..." There is nothing wrong with my connection and I also can't update apps in the app st

    I am cannot access the iTunes store via iTunes on my PC and also can not update to 10.6.3.  It keeps telling me that my connection has times out and/or check my settings.  There is nothing wrong with my setting.  I am also having trouble with the app store on my iPhone 4s and can not update apps.
    I have signed out of itunes and now cannot sign in again.

    I feel you pain i'm haveing the same problems here.
    iTunes could not connect to the iTunes Store. The
    network connection timed out.
    Make sure your network settings are correct and your network
    connection is active, then try again.
    does anyone plz have some insight for us.

  • Following a software update, I can no longer access/authorise music purchased via iTunes from my old Apple ID, which I have not used for 8  years, and no longer have password.  Any ideas how I can re-access/recover that music?

    Following a software update, I can no longer access/authorise music purchased via iTunes from my old Apple ID, which I have not used for 8  years, and no longer have password.  Any ideas how I can re-access/recover that music?

    Apple ID FAQs  >  http://support.apple.com/kb/HT5622

  • Reading terms and conditions page 3 of new account for iTunes Store before I  put in US$ voucher purchased in Zimbabwe. If I'm traveling world wide, willI still be able to access the US services via this same account?

    Reading terms and conditions page 3 of new account for iTunes Store before I  put in US$ voucher purchased in Zimbabwe. If I'm traveling world wide, willI I still be able to access the US services via this same account?

    You can only use the US store if you are in the US with a US billing address on your account - the US store's terms of use (and they will be similar for all countries) :
    The iTunes Service is available to you only in the United States, its territories, and possessions. You agree not to use or attempt to use the iTunes Service from outside these locations. Apple may use technologies to verify your compliance.

  • Which cable (original apple usb or bmw y) shall i use to connect my 4th gen iPod photo 60 gb to bmw f10 (with com box) is it going to work with the apple usb cable and how long does it take till I can access the 33gb content via the bmw display?

    Which cable (original apple usb or bmw y) shall I use to connect my 4th gen iPod photo 60 gb (old but still working ok) to bmw f10 (with com box), build december 2010 > is it going to work with the apple usb cable and if so, how long does it take till I should be able to access the 33gb content via the bmw display?
    Alternatively: How long does it take if I would have to use the bmw y cable till I can access the 33gb content via the bmw display?

    Which cable (original apple usb or bmw y) shall I use to connect my 4th gen iPod photo 60 gb (old but still working ok) to bmw f10 (with com box), build december 2010 > is it going to work with the apple usb cable and if so, how long does it take till I should be able to access the 33gb content via the bmw display?
    Alternatively: How long does it take if I would have to use the bmw y cable till I can access the 33gb content via the bmw display?

  • Apply watermark and then apply Flattener Preview via JavaScript

    Hello all,
    I have a bunch of PDF files which were generated from InDesign.
    Currently I am applying a watermark to all the PDFs in Acrobat XI and then a flattener preview to all of the PDFs manually one PDF at a time.
    I want to make a script which does all this.
    I also tried the Action panel, but it didn't automate the flattener preview part.
    I am comfortable with JavaScript and scripting in general.
    Any help or a pointer to resources will be appreciated.
    Thanks and regards.

    Thanks for replying.
    The flattener preview is located under "Print Production" panel. Where one can configure the text flattening options, among many other settings.
    I want to flatten the text (convert it to outlines) via JavaScript as you have suggested.
    Please suggest any sample code.
    Thanks and regards.

  • The status bar is blocking my content, is there a way to disable it via Javascript and the likes?

    I'm working on a site that requires a bottom footer in a fixed position, with a control button on the left hand side, my problem is, that the `new` status bar area covers this section for quite some time whilst it's requesting data, or waiting for the server, is there a way to disable it via JavaScript or some sort? It seems kind of silly for a status bar to cover your content (no offence), the old way was much nicer, sure it used more screen space, but atleast it didn't assume things. I just couldn't find a solution anywhere else, other than to move the button. :)

    You can use this extension to hide the pop-up that shows the URL of a link on hover and other data that previously appeared on the Status bar.
    *Status-4-Evar: https://addons.mozilla.org/en-US/firefox/addon/status-4-evar/
    Add code to userChrome.css below the @namespace line.
    *http://kb.mozillazine.org/userChrome.css
    *http://kb.mozillazine.org/Editing_configuration
    <br />
    <pre><nowiki>@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */
    #statusbar-display { display:none!important; }
    </nowiki></pre>

  • SaveAs and maintain "optimized for web view" via javascript???

    I am trying to do a SaveAs via javascript, but I need to maintain the linearized (optimized for web view) state of the PDF.
    I would get this via the SaveAs menu item, but I need to do it silently and rename the file (replace _H.pdf with .pdf).
    Is there anything that I can read that will help me do this? I have looked through the API reference, AcrobatUsers.com, web search, etc.
    Or, if it cannot be done, stop me now.
    Here is what I am doing currently wtih help from this forum.
    XXX_DoSaveLoRes = app.trustedFunction(function()
    app.beginPriv();
    this.saveAs(this.path.replace(/\_H.pdf$/i,"") + ".pdf");
    app.endPriv();
    Thanks,

    I don't think it can be done.

Maybe you are looking for