How do you harness URL external application in a JSP?

I have successfully deployed the Yahoo Finance sample URL External Application. However, I do not understand how to utilize the URL classes (in the pdkjava.jar) to harness the external application information once a user has authenticated. I am building a JSP portlet that displays and applet, however the applet requires a username and password. I need to get the Username and Password from external application, which it gets from the user via External Application. How do I get these values in my JSP (that is defined in my provider.xml)? I keep seeing documentation regarding the ExternalPrincipal object however I don't understand how to utilize this object in my JSP. I beleive the ExternalPrincipal object is what I need in my JSP, seeing that it has the methods for getting the user and password. Unless is there a better way of achieving this, can anyone shed some light on getting the ExternalPrincipal object for an External Application session?
Thanks,
Laith E.H.

Thanks for the example. I have a better understanding now, however I'm still having trying to comprehend the flow of executing in this portal model.
I have a problem with:
PortletRenderRequest pr = (PortletRenderRequest) request.getAttribute("oracle.portal.PortletRenderRequest");
ProviderUser prUser = pr.getUser();
ProviderSession pSession = prUser.getSession(true);
I get a NullPointerException on the second line when trying to getUser(). I'm not sure where the problem could be. In the provider.xml, my ExternalProviderInstance, or the JSP itself? I have another JSP portlet on the same page that calls the same method with success.
Thanks,
Laith E.H.
provider.xml:
<?xml version="1.0" encoding="UTF-8"?>
<?providerDefinition version="3.1"?>
<provider class="oracle.portal.provider.v2.http.URLProviderDefinition">
     <providerInstanceClass>com.cox.portal.provider.ExternalProviderInstance</providerInstanceClass>
     <session>true</session>
     <authentication class="oracle.portal.provider.v2.security.Authentication">
          <authType>ExternalApp</authType>
          <userFieldName>Username</userFieldName>
          <userPwdName>Password</userPwdName>
          <errorPageMessages>Invalid ID,Invalid Password</errorPageMessages>
     </authentication>
     <portlet class="oracle.portal.provider.v2.http.URLPortletDefinition">
     <id>1</id>
     <name>ExternalAnalyzer</name>
     <title>Main Analyzer</title>
     <description>This portlet logs into analyzer</description>
     <timeout>100</timeout>
     <timeoutMessage>analyzer timed out</timeoutMessage>
          <showEdit>false</showEdit>
          <showEditDefault>false</showEditDefault>
          <showPreview>false</showPreview>
          <showDetails>false</showDetails>
          <hasHelp>false</hasHelp>
          <hasAbout>false</hasAbout>
          <acceptContentType>text/html</acceptContentType>
          <registrationPortlet>false</registrationPortlet>
          <accessControl>registered</accessControl>
          <renderer class="oracle.portal.provider.v2.render.RenderManager">
               <showPage class="oracle.portal.provider.v2.render.http.URLRenderer">
                    <pageUrl>http://catl0dv31.corp.cox.com/bic/analyzerIFrame.jsp?ap_doc=analyzer&amp;ap_id=105</pageUrl>
                    <contentType>text/html</contentType>
               </showPage>
          </renderer>
          <securityManager class="oracle.portal.provider.v2.security.URLSecurityManager">
               <authorizType>registered</authorizType>
          </securityManager>
     </portlet>
</provider>
ExternalProviderInstance:
package com.cox.portal.provider;
import oracle.portal.provider.v2.*;
import oracle.portal.provider.v2.http.*;
import oracle.portal.provider.v2.externalApp.*;
public class ExternalProviderInstance extends URLProviderInstance
public static final String EXTERNAL_APP = "externalapp.object.key";
ProviderSession pSession = null;
public Object[] initSession(ProviderUser user, ExternalPrincipal externalApp)
throws ProviderException {
//UrlServicesUtils.logMessage("BasicURLProvider : Entering initSession.", getDebugLevel());
//Create/Retrieve provider user session.
if (mProviderDefinition.getHasSession()) {
// Create the session if it doesn't already exist.
pSession = user.getSession(true);
// Store external app in provider session so that other modules
// can extract it later.
if (pSession != null) {
pSession.setAttribute(EXTERNAL_APP, externalApp);
// Get javax.servlet.http.Cookie[] from user
javax.servlet.http.Cookie[] cookies = ((ServletProviderUser)user).getCookies();
if(cookies != null)
return cookies;
else
return null;

Similar Messages

  • How do I register Multiple External Application IDs

    How do I register Multiple External Application ID's in a single WEBCLIPPING provider....

    Hi Java,
    You cannot have multiple External Application associated with a single Provider , you need to register diffrent providers with respective External Applications
    Thanks
    Vineet

  • How do you "pause" an open application, like Mac automatically does when the memory is full?

    How do you "pause" an open application, like Mac automatically does when the memory is full?
    I would like to do so proactively when I am not using a certain program but need to keep it open, and I want to free up computer resources.
    In other words, I want to keep a given program open, but stop it from "thinking".

    There is an application that I can only open a set number of times before it expires.  Every time the program closes, you get one less use out of it.  I want to use it as long as possible, so I thought I would just keep it open all the time.  However, it consistently turns on the fan on the computer, so I imagine it uses a lot of resources.  I got the idea after the Force Quit program "paused" it once after getting overloaded with all the apps I had open.  It stopped the fan, and I was able to open it and run it again later with no problems.  The tricky thing with trying to intentionally overload the system is that it's a hit or miss on which open program the OS will pause (to my knowledge).

  • How do you clear system and application logs in a server?

    Hello all,
    How do you clear system and application logs in a server?
    thanks,
    mike

    go to start button,all programs,assosories, System tools T event viewer. now select application & rt click & clear & do not save.similarly do for sytem too.

  • I have lost my external drive on desk top.  How do you remount the external drive

    I have lost my external drive from iMac desk top.  How do you remount the external drive?
    WindyCityNorth

    Kappy Thanks for help..  I had already tried the Disk Utility but external drive did not show.  What worked was to shut down every thing and shut off power to all.  Disconnect power to the external drive.  Connected power to computer and then restarted the computer.  After the computer was up and running, I reconnected power to external drive and then turn it on.  At this point the external drive returned to my desk top

  • HT201250 How do you add an external Hard drive to time machine and share on network?

    How do you add an external Hard drive to time capsule and share it on local network?
    Lee

    Ensure it's formatted as Mac OS Extended, FAT16, or FAT32, connect it to a self-powered hub, and plug it into the Time Capsule's USB port. If the drive is Ethernet and not USB, ignore everything else and just plug it in.
    (71787)

  • How do you find out what application is generating a plist file in your preference folder?

    I have had two similar warnings come up in Drive Genius 3, a program that I use to manage my drives.  The warnings occur during a daily verification of preferences on my main drive, a 256GB SSD. 
    They state:
    "The preference file at '/Users/me/Library/Preferences/com.analogsolutions.Football.plist' may be corrupted."
    "The preference file at '/Users/me/Library/Preferences/org.machinedevelop.National.plist' may be corrupted."
    Per Drive Genius' advisement, "Corrupted files can cause appplication crashes and should be moved to the Trash." I delete the files, however they are regenerated each day. 
    Q: How do you figure out what application is generating a preference file?  And is there a way to tell if this is a OS generated preference file? 
    I have searched online and cannot find any information about either Analog Solutions or Machine Develop nor am I able to discern what these particular .plist files are for... 
    Q: Are these two .plist files truly potentially harmful?
    Thanks for the Help!
    iMac
    model iMac12,2
    3.4 GHz Intel Core i7
    8 GB 1333 MHz DDR3

    Hi Everyone, sorry for the late response.  I have been monitoring my Preferences Folder; every moment I am on my computer trying to catch what application/process generates these files.  I was hoping to try your suggestions, but oddly enough the offensive .plist files have not returned since the last time I deleted them about a week ago.... strange...
    In any case, I have responded to some of your suggestions and questions that I have information on:
    X423424X wrote: Ok, can you double click the .plist file?  If so it should attempt to launch the Property List Editor (in your Utilities folder).  That way you can look at stuff in the plist.  Maybe (hopefully) there's something in there that can shed some light on who is creating it.   If Property List Editor cannot open the file (some apps create files that have the .plist extension but don't actually create the proper XML format -- probably what ProSoft was alluding to) then try opening it with a text editor.
    The .plist file when opened in text editor contains a string of (what to me seems to be) an arbitrary list of numbers.
    Linc Davis wrote: Those files have been given obfuscated names so you won't know what created them. They must contain encrypted registration data for some third-party commercial software that you use.
    Yes, seems likely...
    Linc Davis wrote: It should be fairly easy to find out what application is creating them, if you really care. Move the files to the Desktop, then log out. Log back in while holding the shift key as you click the "Log In" button. That will prevent your login items from loading, among other things. Open your account preferences and launch the login items one at a time by double-clicking them in the list. After each one, check to see whether the files have been recreated.
    Ran through login, one by one, no luck in identifying the application(s). 
    X423424X wrote: Another thought, lock the plists on the hope that whatever is using them will "choke" and complain about it (no guarantee that will work but worth a try).
    Thanks, the lock idea is the one I will try next if they ever reappear...
    X423424X wrote: Also, I don't recall if I asked this but if those plists are deleted while logged in will they be recreated during that same login session.  Or do they only appear after you deleted them and then and then logged out and back in?  Or do you have to reboot to recreate them?
    Unfortunately I do not know for certain.  Though from all my login/startup/reboot tests I believe that they are not directly linked to starting up the machine or loging in either.
    I'm not really certain why the .plist have not returned.  I haven't uninstalled any programs, though I did run a couple updates for some widgets within the last week; however that was about 3 days after I deleted the last set of .plist files and usually they reappered everyday.  In any case, given that they have not been regenerated I guess my problem is solved per se, at least I am no longer getting that annoying warning everyday.   Still, it's a bit of a mystery  
    Thanks again for all the help!

  • For the iPad, using OS  7.02, how do you now close an application?

    For the iPad, using OS  7.02, how do you now close an application?  When I double click, go to the task bar and touch on the icon, it no longer gives me the option to close the application.  Do you no longer need to quite an application?

    Double tap the home button and swipe upwards on the preview of the App (not the App Icon)

  • How do you detect url redirects when connecting to a URL

    how do you detect url redirects when connecting to a URL?
    Thanks in advance
    stev

    Hai
    (i) If it a jsp we can get the URL by request object.
    Like
    String url = request.getHeader("Referer");
    u can do it in Servlet aslo by request object variable.
    If this explanation is not ok, Explain ur doubt in more briefed Manner

  • How do you unblock an untrusted application?

    How do you unblock an untrusted application?

    Open the Java pane in System Preferences. A separate application will launch. In the Security tab, check the box marked
    Enable Java content in the browser
    If necessary, adjust the Security Level slider, but if you must reduce the level, do so only temporarily and only if you are absolutely sure of what you're doing. Don't do this to play a game or because a stranger on the Internet asked you to. Java can be dangerous.
    If your browser is Safari, you may also need to make changes to the plugin settings in the Security tab of its preferences window.

  • How do you Backup to external drive

    How do you backup to an external usb drive?

    There are a couple of ways.
    1)Time Machine
    2) Clone
    3) Third-party backup App.
    I prefer a mix of method 1 & 2.
    This gives a brief rundown of the use of Time Machine.
    http://support.apple.com/kb/HT1427
    Start with an external disc, formatted Mac OS, extended, Journaled. Then follow the instructions on the above document to create a routine backup that captures your changing files in their version state at each sync. Here's a place with detailed inner workings of Time Machine. Really good stuff.
    A clone is a virtual copy of the entire internal drive that is placed on an external disk. In doing so, you can perform a simple restoration by "cloning" back the drive at any time, if it becomes necessary by drive failure or massive corruption. You typically use a third party application like Carbon Copy Cloner, or anotehr product like SuperDuper. I use Carbon Copy Cloner. It's free, and it works fantastic.

  • How can I shutdown the external application?

    Hi
    I excuted an external application with "Runtime.getRuntime.exec".
    How can I shutdown the external applicaiton(calc.exe..) which is called by me?
    Younghwan

    That's down to the web site. If "Contact Us" links to a page with details, fine, but as you say, some sites make the link a mailto: link, which automatically opens your default Mail app.
    I don't think there's a setting to change this, but TinkerTool (free) allows you to change some "under the hood" settings, and might help

  • How do you get the web application path from the servlet?

    I have created a web application which is installed in
    /webapps/myApplication
    /webapps/myApplication/data/users.xml
    /webapps/myApplication/WEB-INF/classes/myServlet
    How can you get the path to the "users.xml" file from the "myServlet" file?
    The code below doen's seem to return the xml file. anybody knows why?
    public class myServlet extends HttpServlet {
    public void doGet( HttpServletRequest req, HttpServletResponse res ) throws ServletException, IOException
    File myXmlFile = new File("/data/users.xml");

    Try this..
    String FileName = getServletContext().getRealPath("\\data\\users.xml");
    File myXmlFile = new File(FileName);
    hope this helps..

  • How do you dump a external hard drive from PC to mac

    How do i dump my external hard drive from a PC to my Mac

    If you don't see the external HD when you connect it to the Mac, then you need to use Disk Utility to format the XHD to a FAT32 drive. Once done it will read on the Mac and PC without any problems.

  • How do you try out an application and keep $HOME clean afterwards

    As a new Gnome user, naturally I turned to evolution for an email client well integrated with Gnome. As it turned out, I couldn't find any love for it, so I removed the package. But the problem was that it left behind in several places stuff I no longer wanted.
    I had prepared for just that. During the try-out of evolution, I had inotify monitor the files it laid its hands on:
    $ inotifywait -mr -e CREATE -e MODIFY -e DELETE ~
    The list I got from this:
    create ~/.pki/nssdb/{cert9.db,key4.db,pkcs11.txu}
    create ~/.config/evolution/*
    create ~/.local/share/evolution/*
    modify ~/.config/dconf/user
    modify ~/.local/share/gvfs-metadata/home*
    add password to ~/.local/share/keyrings/login.keyring (gnome-keyring)
    download mails etc. to ~/.cache/evolution/
    Obviously the cleanup was not as easy as simply removing files/folders, I had to:
    clean up dconf database:
    $ dconf reset -f /org/gnome/evolution/
    $ dconf read /org/gnome/desktop/notifications/application-children
    ['gnome-network-panel', 'nautilus', 'evolution']
    $ dconf write /org/gnome/desktop/notifications/application-children "['gnome-network-panel', 'nautilus']"
    $ dconf reset -f /org/gnome/desktop/notifications/application/evolution/
    clean up login password stored in gnome-keyring: install and run `seahorse', delete the entry "Evolution Data Source XXXXXXXXXX.XXXX.XX@hostname".
    clean up data and config:
    $ rm -rf ~/.cache/evolution/ ~/.local/share/evolution/ ~/.config/evolution/
    I don't know about the NSS stuff, but since no other applications seem to use it (IIRC NSS is used by Chromium, which I don't use), I simply remove it all:
    $ rm -rf ~/.pki/
    gvfs metadata stuff I really don't know about; ignoring.
    As you can see, It takes some long hard work to simply try out an application like evolution while keeping my $HOME intact.
    I imagine I could have tried it out under another user (correctly named "tester"), or maybe used some kind of filesystem snapshot (which ext4 lacks afaik), or some kind of sandbox. Too much hassle maybe?
    My question to you is how do you do a throw-away trace-free test-run of an application?
    Last edited by lolilolicon (2013-07-10 04:48:20)

    lolilolicon wrote:@firecat53, I'm not sure I understand (I don't have an idea of the tools you just mentioned), but I feel that virtual machines seem to be overkill/over-complicating? For trying out they may be very suitable, but for daily use they don't seem to be very convenient.
    Heh, to me having to mess with dconf databases and moving $HOME seem way more complicated!
    So if you just do a quick Arch install into a virtual machine (you can expedite it by mounting a shared directory and sharing/copying your /var/cache/pacman/pkg directory to avoid re-downloading all your installed packages). Configure it as you wish. Now create a shapshot of the virtual machine as it now exists. This is almost a one-click operation in Virtualbox. Now you have a 'saved state'. Boot up the VM, install the package you want to test...change things, break things, whatever. When you're done, shutdown the VM and select the option to 'Discard current state' or some such. Now the VM reverts back exactly to how you set it up originally. Keep it updated just like your regular system (or in whatever state you need for testing) and snapshot it after an update. You can discard old snapshots when you're comfortable with your current update.
    The other other tools I mentioned are just tools that can deploy and configure  multiple virtual machines (for example for developers to be able  work collaboratively in identical environments). Probably overkill for what you need.
    I think you will spend less time getting a suitable test VM configured then you will trying to worry about filesystem snapshots and monkeying with environment variables. Just my two cents
    Scott
    Last edited by firecat53 (2013-07-10 20:52:16)

Maybe you are looking for

  • How do I set the imac to go to sleep after 5 min of in activity?

    how do I set the imac to go to sleep after 5 min of in activity?

  • Can not start BI server automatically or manually

    The BI server can not get started either way most of the time, but sometimes it can start. I've reinstalled the server and the same problem still happens. The error I got is: Cannot start the Oracle BI Service on local machine Error 1053: The service

  • REP-1247 in drill-down report

    Hello, everybody! I'll be very thankful to anyone who can help me to solve this problem. The environment is Oracle Reports 6.0.8.10.1 on Oracle Server 8.1.7.0.0. My report (rdf) in before form trigger takes the value of the first record's field of so

  • Item category is not defined

    hi,   when i am trying to sell raw materials i am geting an error message during PGI .item category is not defined and when i enter valution type manually in delivery doc. it goes through. batch mgmt is activated for finished goods(no batch for raw m

  • Cannot load query "ZBM_M020_Q001" (data provider "DP_1": {2})

    I'm getting this error message when I try to run any of my bookmarks in this new bi system My url looks like: http://<myserver>:<myport>/irj/servlet/prt/portal/prtroot/pcd!3aportal_content!2fcom.sap.pct!2fplatform_add_ons!2fcom.sap.ip.bi!2fiViews!2fc