Home » Fusion Middleware & Colab Suite » Weblogic & Application Server » PL/SQL web pages using dynamic ssi functionality..possible?
PL/SQL web pages using dynamic ssi functionality..possible? [message #76499] Thu, 26 September 2002 12:51 Go to next message
Kurt Ehrler
Messages: 2
Registered: December 2000
Junior Member
I'm trying to reference static html pages from my pl/sql generated web pages (using the mod_plsql module for Apache) without using frames. I can't seem to come up with any way to do this.
I'm not sure if the html I've included in my examples will diplay correctly here so you may have to view source.

Database is Oracle 8i.
Server is the Apache http server Oracle provides, but not the full blown iAS version.

Here's what I'm trying to essentially to do.

filename below can be any static html page I wish to reference.
************************************************
PROCEDURE onDemand
(filename in varchar2) IS

BEGIN
PageStart;
PageHeadbar;
PageNavbar;

htp.p('
');
htp.p('
- ');

htp.p('

When This is working, the contents of the file '||filename || ' will be included.
');

htp.p(' -
');
htp.p('
');

PageEnd;
END onDemand;

********************************************************
This looks like it should be fairly straight forward but I keep running into obstacles.

The options I CAN'T use are:
1. Using utl_file to grab the contents of the file from that directory (dba won't allow changing of ini file).
2. XML url referencing. DBA hasn't installed XML components yet.

I thought maybe I could use the server side include option, but I don't see how I can integrate ssi with the mod_plsql output. I know I can compile a static html file as part of a psp compilation, but then it's completely embedded in the resulting procedure and I won't have any dynamic options.

One solution that may work but my client is trying to avoid, is to load all the existing html files into tables and just pull them out at the time the procedure is called. Still, we'd like to avoid this and use the existing html files in the directories that they are in.

Here's one possible option I was considering but am not sure how to make it work or if it's even possible.
I was thinking I could make my procedure that I'm calling part of a package and name the procedure .shtml. When I call the procedure it produces the web page which will have a server side include command in it that would reference the file I need. If I can get the apache server to then run the results of the mod_plsql through the mod_include module, it would hopefully then pull in the file I was trying to include. My naming the procedure .shtml was to try to trick the server into thinking that it's actually a file, not pl/sql generated output. Is there any way that this might work? Here's the package body of what I'm trying with this option.

create or replace package body ssi as

procedure shtml (filename in varchar2)
is
begin

PageStart;
PageHeadbar;
PageNavbar;

htp.p('
');
htp.p('
- ');

htp.p('

When This is working, the contents of the file '||filename || ' will be included.
');
htp.p('<!--#include virtual="../html/en/'||filename||'" -->');

htp.p(' -
');
htp.p('
');

PageEnd;

end shtml;

end ssi;

If it would work, I'd call ssi.shtml?filename=example.html, the procedure creates the web page to be generated via the mod_plsql module, but then the mod_include module parses the page and pulls in the example.html.... is this possible? What would be the necessary configuration of the apache server to do this?

There has to be a better way. Any ideas would be much appreciated. To recap: the answer I'm looking for would allow a blending of pls/sql generated pages with dynamically chosen static html web pages WITHOUT using frames.

Kurt
kehrler@opbu.xerox.com
Re: PL/SQL web pages using dynamic ssi functionality..possible? [message #76513 is a reply to message #76499] Fri, 04 October 2002 17:00 Go to previous messageGo to next message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
Sounds like it's a good idea to pursue. I can't see what your DBA's objection would be - developers and DBA's etc are all jointly responsible for ensuring the integrity and security of your system. Even if he didn't want write access for apps to the filesystem, you could simply make the directory owned by someone other than Oracle and give Oracle read only access. Constantly reading the files using UTL_FILE will be slow though, so from that poit of view it could be a bad idea. Storing in a table would definitely be better. A dbms_job could refresh the table at intervals by loading the files from disk. saving the files into CLOB or BLOB fields would be better as you wouldn't have to load them using ULT_FILE line by line.

create table demo
( id int primary key,
theBlob blob
)
/

create or replace directory my_files as
'C:/oracle/admin/bintest/public_html';

declare
l_blob blob;
l_bfile bfile;
begin
insert into demo values ( 1, empty_blob() )
returning theBlob into l_blob;
l_bfile := bfilename( 'MY_FILES', 'U0020460.jpg' );
dbms_lob.fileopen( l_bfile );
dbms_lob.loadfromfile( l_blob, l_bfile,
dbms_lob.getlength( l_bfile ) );
dbms_lob.fileclose( l_bfile );
end;
/
commit;
unable to find proper documents on pl/sql pages [message #76953 is a reply to message #76499] Mon, 05 April 2004 02:39 Go to previous message
MOHIT
Messages: 6
Registered: November 2001
Junior Member
hello to all,
I am searching the net from last 3-4 hrs. for the pl/sql pages.But i am unable to find any proper material regarding that.If anyone is aware of pl/sql pages please mail me ASAP.

regards,
Mohit
Previous Topic: Error while using oracle with dot net
Next Topic: Unable to find information on pl/sql pages
Goto Forum:
  


Current Time: Mon Nov 25 09:43:28 CST 2024