Render HTML file within portal page

I have uploaded an html file into a content folder as a file item type. I have a portal page with tabs and other content. I added a tab for this html file. I would like the user to click on the tab and have the html file rendered within the associated region.
Any ideas on how to do this?
Mike Kleiman

G'day,
Heres a much cut down version of a package I built to do
just that, based on a posting by Jerry Silver some time ago.
(I used to do the URL thing but found it fidley and unstable --
it dies if you move folders around)
Enjoy
Kal.
-- Provides the following procedures for displaying portal content:
-- html_file(P_FILE_ITEM_ID): display HTML content of the file "in place".
-- The idea of these procedures is that they can be called by custom type items.
-- NB: create the following as portal30
create or replace package display is
procedure html_file (p_folder_id           in number,
                              p_file_itemid           in number,
                              p_site_id                in number,
                              p_deref_image_paths in number default 0);
end display;
create or replace package body display is
| procedure html_file (p_folder_id in number, |
| p_file_itemid in number, |
| p_site_id in number) |
| |
| Prints the contents of the file type item identified by |
| P_FILE_ITEMID, P_FOLDER_ID, and P_SITE_ID to the browser via |
| calls to the HTP package. |
`--------------------------------------------------------------------*/
procedure html_file (p_folder_id in number,
                                        p_file_itemid in number,
                                        p_site_id      in number) is
     source_html varchar2(32678);
     filename varchar2(100);
     blob_content blob;
     raw_content raw(32767);
     file_to_big exception;
begin
     -- get the unique file name (can't pass this from a "File" type item)
          select filename into filename
          from portal30.wwsbr_all_items
          where id = p_file_itemid;
     -- should we pass path id?
     blob_content := wwdoc_api.get_document_blob_content(p_name => filename);
     if (dbms_lob.getlength(blob_content) > SIZE_OF_CHUNK) then
          raise file_to_big;
     end if;
     raw_content := dbms_lob.substr (blob_content,32767);
     source_html := utl_raw.cast_to_varchar2 (raw_content);
     -- snip before opening BODY tag in first chunk
     source_html := util.snip_between(p_source => source_html,
                                             p_begin      => '<body',
                                             p_end      => null);
     -- closing '>' may be on another line
     source_html := util.snip_between(p_source      => source_html,
                                                       p_begin => '>',
                                                       p_end => null);
     -- snip after closing BODY tag in last chunk
     source_html := util.snip_between(p_source => source_html,
                                             p_begin      => null,
                                             p_end      => '</body>');
     htp.print(source_html); -- this requires varchar2 type
exception
     when file_to_big then
          htp.p('File size exceeds 32K and hence cannot be displayed.');
          htp.p('Consider spliting this file.');
     when NO_DATA_FOUND then
          htp.p('Document not found or access denied');
     when others then
          htp.p(sqlerrm);
end html_file;
end display;

Similar Messages

  • How can i render a dynamic html file in jsp page

    Hi everybody,
    i am trying to render a dynamic html file in jsp page with the result of querying a database.
    The response of the query is a xml document. And i have a stylesheet to transfer it to html.
    How can i render the html in a jsp file?

    I am using below code for HTML files
    private var appFile:String="index.html";
    if (StageWebView.isSupported)
                        currentState = "normal";
                        webView.stage = stage;
                        webView.viewPort = new Rectangle( 10, 130, (stage.stageWidth)-20, 750 );
                        var fPath:String = new File(new File("app:/assets/html/aboutus/"+ appFile).nativePath).url; 
                        webView.loadURL(fPath);
                        addEventListener(ViewNavigatorEvent.REMOVING,onRemove);
                    else {
                        currentState = "unsupported";
                        lblSupport.text = "StageWebView feature not supported";
    above code is working fine for me.

  • Controlling sound of separate html files within the same html page.

    I need to allow users to preview audio files for purchasing. I have CF pages that return records form a SQL database. Each record contains the same swf file however, each swf file points to a different mp3 for previews of different audio examples. So far, everything is working fine. My problem is that I need to be able to stop the sound from one  swf when I click to play a second swf.  The only solutions I see in Flash forums deal with loaded swf files. These are not loaded files they are separate files within a page. The question is: How do control one swf from another swf in the same page.  The following items have not worked:
    soundChannel.stop();,
    soundMixer.stopAll()
    I think my solution may be to use ExternalInterface but I am not sure where to begin with this. Any suggestion would be appreciated.

    you need to use the localconnection class to communicate between swfs open at the same time by the same client.

  • Can I embed a PDF file within a Pages document?

    I am working with Pages '09 and would like to embed a rather long PDF document file into my Pages text.  I want the reader to be able to click on the PDF file and have it open so that the reader can gather more information on the subject without making the actual Pages document text any longer.  I don't want the PDF file to be an external link that sends the reader away from the document -- I want to know if I can embed the PDF file WITHIN the pages document and have it open only when clicked.  I don't think I can do this.  Thanks.
    Small Town Gal.

    I found my answer within archived discussions - convert the file to a PDF and then embed the PDF file as an attachment.  Thanks.
    Barbara Smits

  • HTML Files in portal that access relative images

    We put html files on some of our pages. These open up and display their contents, which include images. These images we store on the same portal page (but hide them) so the html page has access to them in the same directory. So, we basically, use a portal page as a web server directory to put the html, css, images, etc.
    Is this going to break in a future version of portal?
    According to:
    http://download-west.oracle.com/docs/cd/B14099_19/portal.1014/b13809/apdxurls.htm
    "Following this release, path-based URLs that follow the following syntax will be obsolete"
    That sounds to me like my above scenario will break. Yes?
    Thanks.

    Why do you use html files exactly ? Because, we have legacy HTML documents that are from our pre-portal intranet days. We were able to just stick them into a portal page and they worked. And, the nice thing is that they can link to each other with relative links within the same directory/path. So, it's not just images. We really don't care that much about images, that was just an example that would be easy for people to understand. Using the /images folder does not solve most of problem. And, like I mentioned before, we also have PDFs with PDF-to-PDF web links where they all link to each other with relative links within the same directory. We also have some Flash (swf) files that take advantage of page-path URLs.
    It's not like our whole portal is made up of HTML documents. But, we used many of them instead of Word or PDF documents, because that's what we had from before. So, in most cases we can convert them to PDFs. But, there are some cases where we have mini websites made up of HTML files all stuck into a Portal page. These, and the PDF-to-PDF linked documents are a bigger problem.
    This is a major headache that we are not looking forward to.

  • Calling html file within web.show document as a report output

    /* this is blank html file included javascript for disabling mouse right click working fine*/
    WEB.SHOW_DOCUMENT ('http://prod.artisticmilliners.com:8000/files/file.html','_blank');
    /* this is oracle report output within model frame working fine*/
    WEB.SHOW_DOCUMENT ('javascript:void(window.open("'|| URL || '","","location=no,toolbar=no,menubar=no,status=no,"));self.close()','_self');
    I want to add show report output with right mouse click disable. Pleae guide how can i do it?

    Let me start by saying that disabling the right mouse will do nothing but frustrate users. It doesn't protect the page content from anything. There are various other ways to get the content from the page copied locally. And more importantly, this does not_ offer any kind of security.
    Ok, so you have decided to do it anyway ;)
    In order to make this happen, you would need to modify the report. I will assume that when you said "report" you meant Oracle Reports. Open the report file (.rdf) and edit the report's "Before Report Value".
    The default value is:
    <html>
    <head>
    <meta http-equiv="Content-Type"  content="text/html; charset=&Encoding">
    </head>
    <body dir=&Direction bgcolor="#ffffff">Change it to this:
    <html>
    <head>
    <meta http-equiv="Content-Type"  content="text/html; charset=&Encoding">
    </head>
    <script language="javascript">
    document.onmousedown=disableclick;
    status="Right Click Disabled";
    Function disableclick(e)
      if(event.button==2)
         alert(status);
         return false;   
    </script>
    <body oncontextmenu="return false" dir=&Direction bgcolor="#ffffff">Save the changes and retest.

  • How to render HTML files in Java?

    I've read a bit about rendering HTML files using JEditorPane, but been told it's quite limited, and doesn't handle many events other than Hyperlinks stuff...
    I heard that Java bean has a slight more advanced HTML renderer, is that right?
    The thing is that I'm hoping to create a simple (static) HTML editor using Java, but need something to render the HTML file...and I need more event handleling, e.g. mouse click on what element (text, image or table) of the rendered HTML file.
    Can someone please give me some ideas?

    If you just need to display the HTML page with link support, you can use the JEditorPane with the content type as text/html. Look up the Java Tutorial on this site (http://java.sun.com/docs/books/tutorial/uiswing/components/text.html) and the API docs for details on how to use it.

  • Old html files (done on Page Mill) do not open in latest Dreamweaver

    I have a large website with many html pages, all developed on the old Adobe Page Mill application.  When I try to open any of those html pages onto my new Dreamweaver CS5.5 on my new iMac, those html files are not recognized as "openable" (their titles appear in light gray, and clicking on them does not open them.  I can't even click and drag them into the Dreamweaver window.  How can I open those old html files in Dreamweaver?

    May I recommend you to read this article first to get the basics of "Defining a site" in DW.
    <http://www.adobe.com/devnet/dreamweaver/articles/first_website_pt1.html>
    This article will give you a head start in Working with DW.  Page Mill files are simple text file and they should open readily in DW but who knows what has gone with your system that nothing seems to work.
    Good luck.

  • Html file in web page composer

    hi expert,
    i have create one html file. the html file contain jsp script. the output is very well when i run it on my pc but when i put it in container of web page composer, the output is not display. why its happen?how can i use the html file that contain jsp script in web page composer?
    thanx in advance,
    faeza

    Hi
    You can create a new layout with width and height as per your requirements and use the layout in WPC.
    For creating new layouts, check the help link below
    http://help.sap.com/saphelp_nw70/helpdata/EN/45/d2970be57f4ebbe10000000a11466f/content.htm
    Regards,
    Yoga

  • Executing an HTML file within java program

    I want my java code to be able to open/execute an HTML file that I have. How do you do this?
    Thanks.

    You can display html in a java app, but it is not so simple to run a browser. What you want to look up is the WebBrowser class. Here is an excerpt from some code of mine that displays a url in the browser app in a panel, but there's some chaff in my code you would not be interested in (I'm using a card layout). You're better off loocing up org.jdesktop.jdic.browser which contains the WebBrowser class    /**
         * Reveal the container with the browser display. The browser display is
         * currently hidded using a CardLayout, so it is a simple matter to swap
         * displays; however, we put off actually loading the web page until the
         * first time the display is revealed.
         * @return true if the URL could be resolved and the given web page
         * displayed.
        public boolean showBrowser(
            java.net.URL pURL )
            // See if the web page component has not initialized.
            if ( pWebBrowser == null )
                pWebBrowser = new WebBrowser();
                pBrowserPane.setViewportView( pWebBrowser );
            if ( aLastURLVisited == null || ! aLastURLVisited.equals( pURL ) )
                pWebBrowser.refresh();
                pWebBrowser.setURL( pURL );
                aLastURLVisited = pURL;
            pDualLayout.show( pDualPanel, BROWSER_PANEL );
            return true;
        }

  • Email a file from portal page

    Hi,
    Can anyone advise how I could email a document (pdf) from the application server to a portal user. This would ideally be a link on a portal page that would email the docuement.
    Thanks in Advance,
    Brandon

    hi brandon,
    this functionality is not there out of the box. one idea i have is to attach a procedure to your item type that passes the item ID to the procedure. you can then look up the item in the content management views wwsbr_all_items. then look it up in the documents table and use a database function (i think there is one to mail) to mail the item.
    i am not aware of any easy way.
    hope this helps.
    regards,
    christian

  • How do i read a context of text file within Dynamic Page of portal ?

    Dear sir,
    I have a text file in client computer. I hope i can transfer the context words of this text file to oracle database. How do i coding this script in dynamic page of portal?
    Can Oaracle 9ias script read and draw the context of a document. Thank you ver much!
    Ghia Liu

    Great questions, Rik, and I understand how this might seem bizarre. Here's the story... these 2500 files were authored with a built-in authoring tool of our current knowledge management system. This KMS is about to be replaced with a new one and because the new KMS needs content within the <head> tag instead of where it was in the <body> tag and redefined as meta data, I repuposed the content in those files using Dreamweaver and regular expressions.  However, the one remaining <h3> and <p> content is in the middle of the newly tagged meta data and it must be moved from the <head> area and into the <body> area.
    Because these were authored in the built-in KMS authoring tool, there is no style sheet and no, we do not manage our content with a CMS.
    You are correct, if the <h3> and <p> were at the end of the data, I could simply move the </head> and <body> tags, but unfortunately that is not the case.  They are consistenly in the same place in all 2500 files, but in the middle of the data. Following is an example:
    <html>
    <head>
    <title>Title here</title>
    <meta name="XYZ" content="Something here...">
    <h3> Blah blah</h3> <p>More blah blah</p>
    <meta name="123" content="More somthing here">
    <meta name="456" content="More somthing here">
    </head>
    <body>
    </body>
    </html>
    Again, I can find the block using a regular expression <h3>(.*?)</p>, but dont know what to do after that.
    I've been told that perl or grep might do the needed task, but that requires outside resources and I have no budget for that.
    Any suggestions are greatly appreciated.
    thanks,
    Rick

  • How to load different html files in one page in order to load them without leaving the main stage?

    Hello,
    I'm new with edge animate, but i fell in love with it.
    I'd like to know, is it possible to load different html pages dynamically in the main stage in order to avoid the preloader to be load?
    I can figure out how to save all the pages of the site, but i can't merge them in a continuous animated browsing experience.
    As sample.
    I've got a index.html and home.html, how to switch form index to home without having a clear division between the two pages?
    I can place all the animations within a file and this will allow me to have a continuous surfing experience but it won't generate specific and google indexable pages within the site.
    Example, index.html will generate www.mysite.com, home will generate www.mysite.com/home. How ho switch dinamically between them and integrate them in a unique fading experience?
    Thanks in advance for any help. I'm a newby, but i would like to learn.
    Fea.

    Look into using the Loader class to load the swf files.  If you want to have it happen in different frames then you can put the code into the different frames.

  • How to create a portlet to upload/delete files into portal pages

    I wanted to know if it is possible to create a simple UI wherein a user could choose a file from his HDD and upload it to the page as an item.I know this can be done by editing the page,but when the user clicks on edit he would have to use the default portal interface to do the same, i want to avoid precisely that.
    If possible then how do I go about making it.This UI would also require that the user be able to select from a list of previously uploaded files and delete some of them.This i require so that any authenticated portal user could access/downloaded the uploaded files given the url to the same.

    You can use the WebDAV feature in Portal Release 2 to provide a simple interface for uploading and managing files. In addition, the content management APIs can be used to build custom interfaces. These APIs are available for Portal 3.0.9 and will soon be available for Release 2. There is no Delete API, but one is planned for an upcoming release.
    Regards,
    Jerry
    PortalPM

  • Can I create a subdirectory and custom html file within a domain?

    I'm preparing to migrate to a new weblogic server but recently realized that the new url address for users will be different from the original (current) url. Is there a way that I can simply create the root context of the original url within the new server?
    So, if the original url is http://aliasname/subdir/subdir/file.html ; and the new url is http://aliasname/domain
    ...can I manually create the subdir's within the root of the new server and create my own file.html that basically provides a message to the users that the current url has changed?
    That way, users who don't happen to update their bookmarks, will be updated and redirected to the new site. I'm new to weblogic and am coming from an MSFT IIS background where I could handle this simply by doing just what I described above in my question.
    Thanks in advance!

    The best is to have IIS handle that kind of work. Note that you use IIS as a front-end for WebLogic, such that requests meant
    for WebLogic are forwarded by using the IIS plug-in - http://docs.oracle.com/cd/E21764_01/web.1111/e14395/isapi.htm#BGBBCFID

Maybe you are looking for

  • I need to learn how to add a page at the end of my video to put credits?

    I am editing for the first time EVER and need to know how to add credits to the end of a video

  • In app purchase not appearing in game

    I have made an in app purchase of gold in Jewel Mania but although the money has been taken from my iTunes credit twice the gold has not appeared in the game after nearly 24 hours,any suggestions anyone?

  • Error starting server sp2

    Hello, I am trying to port application developed in weblogic platform 8.1 sp1 to wl Platform SP2. when i start the server i get following error.( i have updated all libraries). error stack: <Mar 26, 2004 7:42:25 PM GMT+08:30> <Error> <HTTP> <BEA-1010

  • No sound from new soundcard

    I have installed a new Diamond Xtreme Sound 7.1/ 24 bit sound card in my system. I get all of my regular computer sounds, and Windows Media Player works, but iTunes acts like it is working, but no sound is heard.

  • After A While, My Mac Stops Working

    I know that's vague, but that's what is happening. If I leave my system alone after a reboot, about 4 hours later, the system starts acting strange. If I attempt to eject the DVD drive, the system sort of hangs. It is responsive, but the eject menu i