Unix Technical Forum

package htp

This is a discussion on package htp within the Oracle Database forums, part of the Database Server Software category; --> I know this isn't going to be popular, but here goes. Looking at the HTP package, if I had ...


Go Back   Unix Technical Forum > Database Server Software > Oracle Database

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-26-2008, 07:46 AM
Jake
 
Posts: n/a
Default package htp


I know this isn't going to be popular, but here goes.

Looking at the HTP package, if I had to make a lot of web pages using
that, it looks like it would be, well, painful, compared to other
languages like PHP, Ruby, ASP, JSP for instance.

Is this commonly used to create web pages using PL/SQL, or is there
another preferred method?

Does PL/SQL have any templating mechanism where you can create a text
html template and just "fill in the blanks" procedurally?


thanks.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-26-2008, 07:46 AM
Shakespeare
 
Posts: n/a
Default Re: package htp


"Jake" <jgarfield@earthlink.net> schreef in bericht
news:1194280640.737187.57230@q5g2000prf.googlegrou ps.com...
>
> I know this isn't going to be popular, but here goes.
>
> Looking at the HTP package, if I had to make a lot of web pages using
> that, it looks like it would be, well, painful, compared to other
> languages like PHP, Ruby, ASP, JSP for instance.
>
> Is this commonly used to create web pages using PL/SQL, or is there
> another preferred method?
>
> Does PL/SQL have any templating mechanism where you can create a text
> html template and just "fill in the blanks" procedurally?
>
>
> thanks.
>


Actually there is, or used to be (not sure about it): pl/sql server pages
(psp).
Search for psp oracle on google.

I haven't seen anyone use it ever, but it worked......

Shakespeare


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-26-2008, 07:46 AM
Frank van Bortel
 
Posts: n/a
Default Re: package htp

Jake wrote:
> I know this isn't going to be popular, but here goes.
>
> Looking at the HTP package, if I had to make a lot of web pages using
> that, it looks like it would be, well, painful, compared to other
> languages like PHP, Ruby, ASP, JSP for instance.
>
> Is this commonly used to create web pages using PL/SQL, or is there
> another preferred method?
>
> Does PL/SQL have any templating mechanism where you can create a text
> html template and just "fill in the blanks" procedurally?
>
>
> thanks.
>

What could be "painful"?
Just run the page through a html to plsql converter, load it,
and done - if you deliver the page, I'll stream it from the database
10 seconds later.

And - if you plan on doing things from with the database, some
form of wrapping might be handy. Application Express and Portal
are two examples of Oracle products doing just that.

If you want a bit more control, take a look at
http://vanbortel.blogspot.com/2006/0...-modplsql.html
or this:
http://vanbortel.blogspot.com/2006/0...parameter.html

Comes with a wrapper, too

--
Regards,
Frank van Bortel

Top-posting is one way to shut me up...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-26-2008, 07:46 AM
Shakespeare
 
Posts: n/a
Default Re: package htp


"Shakespeare" <whatsin@xs4all.nl> schreef in bericht
news:472f4cba$0$241$e4fe514c@news.xs4all.nl...
>
> "Jake" <jgarfield@earthlink.net> schreef in bericht
> news:1194280640.737187.57230@q5g2000prf.googlegrou ps.com...
>>
>> I know this isn't going to be popular, but here goes.
>>
>> Looking at the HTP package, if I had to make a lot of web pages using
>> that, it looks like it would be, well, painful, compared to other
>> languages like PHP, Ruby, ASP, JSP for instance.
>>
>> Is this commonly used to create web pages using PL/SQL, or is there
>> another preferred method?
>>
>> Does PL/SQL have any templating mechanism where you can create a text
>> html template and just "fill in the blanks" procedurally?
>>
>>
>> thanks.
>>

>
> Actually there is, or used to be (not sure about it): pl/sql server pages
> (psp).
> Search for psp oracle on google.
>
> I haven't seen anyone use it ever, but it worked......
>
> Shakespeare
>


Checked it out for AS 10G: it's still there (and it appears Oracle's Yapa
was written in psp).

Shakespeare


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-26-2008, 07:46 AM
Shakespeare
 
Posts: n/a
Default Re: package htp


"Frank van Bortel" <frank.van.bortel@gmail.com> schreef in bericht
news:fgnov0$emu$1@news5.zwoll1.ov.home.nl...
> Jake wrote:
>> I know this isn't going to be popular, but here goes.
>>
>> Looking at the HTP package, if I had to make a lot of web pages using
>> that, it looks like it would be, well, painful, compared to other
>> languages like PHP, Ruby, ASP, JSP for instance.
>>
>> Is this commonly used to create web pages using PL/SQL, or is there
>> another preferred method?
>>
>> Does PL/SQL have any templating mechanism where you can create a text
>> html template and just "fill in the blanks" procedurally?
>>
>>
>> thanks.
>>

> What could be "painful"?
> Just run the page through a html to plsql converter, load it,
> and done - if you deliver the page, I'll stream it from the database
> 10 seconds later.
>
> And - if you plan on doing things from with the database, some
> form of wrapping might be handy. Application Express and Portal
> are two examples of Oracle products doing just that.
>
> If you want a bit more control, take a look at
> http://vanbortel.blogspot.com/2006/0...-modplsql.html
> or this:
> http://vanbortel.blogspot.com/2006/0...parameter.html
>
> Comes with a wrapper, too
>
> --
> Regards,
> Frank van Bortel
>
> Top-posting is one way to shut me up...


I think psp is in fact little more than a plsql converter... with the option
to put pl/sql or sql in tags. The actual converter is loadpsp.exe.

Shakepseare


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-26-2008, 07:46 AM
Jake
 
Posts: n/a
Default Re: package htp

On Nov 5, 1:55 pm, Frank van Bortel <frank.van.bor...@gmail.com>
wrote:
> Jake wrote:
> > I know this isn't going to be popular, but here goes.

>
> > Looking at the HTP package, if I had to make a lot of web pages using
> > that, it looks like it would be, well, painful, compared to other
> > languages like PHP, Ruby, ASP, JSP for instance.

>
> > Is this commonly used to create web pages using PL/SQL, or is there
> > another preferred method?

>
> > Does PL/SQL have any templating mechanism where you can create a text
> > html template and just "fill in the blanks" procedurally?

>
> > thanks.

>
> What could be "painful"?
> Just run the page through a html to plsql converter, load it,
> and done - if you deliver the page, I'll stream it from the database
> 10 seconds later.
>
> And - if you plan on doing things from with the database, some
> form of wrapping might be handy. Application Express and Portal
> are two examples of Oracle products doing just that.
>
> If you want a bit more control, take a look athttp://vanbortel.blogspot.com/2006/07/authentication-in-modplsql.html
> or this:http://vanbortel.blogspot.com/2006/0...ible-parameter...
>
> Comes with a wrapper, too
>
> --
> Regards,
> Frank van Bortel
>
> Top-posting is one way to shut me up...- Hide quoted text -
>
> - Show quoted text -



By "painful" I was refering to all the frame() formOpen()
framesSetOpen() noframesClose() functions/procedures in the htp
package just to make a web page. I'll have to check out the other
ways of doing it though.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-26-2008, 07:46 AM
Frank van Bortel
 
Posts: n/a
Default Re: package htp

Shakespeare wrote:
> "Frank van Bortel" <frank.van.bortel@gmail.com> schreef in bericht
> news:fgnov0$emu$1@news5.zwoll1.ov.home.nl...
>> Jake wrote:
>>> I know this isn't going to be popular, but here goes.
>>>
>>> Looking at the HTP package, if I had to make a lot of web pages using
>>> that, it looks like it would be, well, painful, compared to other
>>> languages like PHP, Ruby, ASP, JSP for instance.
>>>
>>> Is this commonly used to create web pages using PL/SQL, or is there
>>> another preferred method?
>>>
>>> Does PL/SQL have any templating mechanism where you can create a text
>>> html template and just "fill in the blanks" procedurally?
>>>
>>>
>>> thanks.
>>>

>> What could be "painful"?
>> Just run the page through a html to plsql converter, load it,
>> and done - if you deliver the page, I'll stream it from the database
>> 10 seconds later.
>>
>> And - if you plan on doing things from with the database, some
>> form of wrapping might be handy. Application Express and Portal
>> are two examples of Oracle products doing just that.
>>
>> If you want a bit more control, take a look at
>> http://vanbortel.blogspot.com/2006/0...-modplsql.html
>> or this:
>> http://vanbortel.blogspot.com/2006/0...parameter.html
>>
>> Comes with a wrapper, too
>>
>> --
>> Regards,
>> Frank van Bortel
>>
>> Top-posting is one way to shut me up...

>
> I think psp is in fact little more than a plsql converter... with the option
> to put pl/sql or sql in tags. The actual converter is loadpsp.exe.
>
> Shakepseare
>
>

Correct - I was referring to the "mod pl/sql packages" - not psp.
The executable is called html2plsql, and can be found here:
http://www.vesterli.com/webapps101/outdated.html#tools
there's a java counterpart as well.

I can still recommend the book, Sten wrote.

--
Regards,
Frank van Bortel

Top-posting is one way to shut me up...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 02-26-2008, 07:46 AM
Frank van Bortel
 
Posts: n/a
Default Re: package htp

Jake wrote:

>
> By "painful" I was refering to all the frame() formOpen()
> framesSetOpen() noframesClose() functions/procedures in the htp
> package just to make a web page. I'll have to check out the other
> ways of doing it though.
>


What I meant with "wrapper".
How's this for a page from pl/sql:

PROCEDURE LOGOUT (p_str IN VARCHAR2 DEFAULT 'Session ended')
IS
BEGIN
BEGIN
g_cookie := owa_cookie.get ('MySecretCookie');
EXCEPTION
WHEN OTHERS
THEN
NULL;
END;

IF g_cookie.num_vals > 0
THEN
BEGIN
DELETE FROM session_table
WHERE session_id = g_cookie.vals (1);

OWA_UTIL.mime_header ('text/html', FALSE);
owa_cookie.remove (NAME => 'MySecretCookie', val =>
g_cookie.vals (1));
OWA_UTIL.http_header_close;
EXCEPTION
WHEN OTHERS
THEN
HTP.p (format.errorpage (SQLERRM));
END;
END IF;

HTP.p (format.infopage (p_info => p_str));
END LOGOUT;

Mind you - it's a lot of processing - the page is
actually built in one statement:
HTP.p (format.infopage (p_info => p_str));

If an error occurs, the error page is built with this:
HTP.p (format.errorpage (SQLERRM));

Other examples:
Hyperlink, with alternative text, link and pop-up description:
HTP.p (format.hyperlink (p_text => 'Home',
p_destination => 'myapp.bpage1',
p_title => 'Back to start page' ));

Build a HTML table, based on an oracle database table, with
flexible where clause - no row limit:
HTP.p (htmlform.selecttable
(label => 'Profile:',
NAME => 'p_profiel',
tablename => 'myapppr.profiles',
textcol => 'profile',
valuecol => 'id',
orderby => 'id',
wherecondition => 'profile not in
(''ADMINISTRATOR'',''MAINTENANCE'')',
p_default => r_sel_pd.profiel_id ));

Etc, etc, etc.

So - where's the pain?
--
Regards,
Frank van Bortel

Top-posting is one way to shut me up...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 02-26-2008, 07:46 AM
Matthias Hoys
 
Posts: n/a
Default Re: package htp


"Jake" <jgarfield@earthlink.net> wrote in message
news:1194280640.737187.57230@q5g2000prf.googlegrou ps.com...
>
> I know this isn't going to be popular, but here goes.
>
> Looking at the HTP package, if I had to make a lot of web pages using
> that, it looks like it would be, well, painful, compared to other
> languages like PHP, Ruby, ASP, JSP for instance.
>
> Is this commonly used to create web pages using PL/SQL, or is there
> another preferred method?
>
> Does PL/SQL have any templating mechanism where you can create a text
> html template and just "fill in the blanks" procedurally?
>
>
> thanks.
>


You could use Application Express. It's free and pretty easy to work with.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 02-26-2008, 07:46 AM
Connor McDonald
 
Posts: n/a
Default Re: package htp

Jake wrote:
>
> I know this isn't going to be popular, but here goes.
>
> Looking at the HTP package, if I had to make a lot of web pages using
> that, it looks like it would be, well, painful, compared to other
> languages like PHP, Ruby, ASP, JSP for instance.
>
> Is this commonly used to create web pages using PL/SQL, or is there
> another preferred method?
>
> Does PL/SQL have any templating mechanism where you can create a text
> html template and just "fill in the blanks" procedurally?
>
> thanks.


WebAlchemy.... a blast from the past
--
Connor McDonald
Co-author: "Mastering Oracle PL/SQL - Practical Solutions"
Co-author: "Oracle Insight - Tales of the OakTable"

web: http://www.oracledba.co.uk
web: http://www.oaktable.net
email: connor_mcdonald@yahoo.com


"Semper in excremento, sole profundum qui variat."

------------------------------------------------------------
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:32 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com