使用PL / PgSQL生成HTML [英] HTML generation with PL/PgSQL

查看:85
本文介绍了使用PL / PgSQL生成HTML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我对来自Oracle的PostgreSQL非常新鲜。

我想开发基于apache和postgresql的web应用程序。

是否有等价的OWA服务器(Oracle Web应用程序服务器)用于

postgresql。

很快,OWA提供了一个apache模块和一套存储的

生成html页面的程序/函数。


一个简单的例子可以是以下程序:


程序你好{

htp.htmlOpen;

htp.headOpen;

htp.title(" Simple test page");

htp.head关闭:

htp.bodyOpen

htp.print(htf.h2(htf.center("这是一个简单的测试页面) )));

htp.paragraph;

htp.print(" Postgresql中的动态问候语);

htp.bodyClose;

htp.html关闭;

}


这将生成以下HTML代码:


< html>

< head>

< title>简单的测试页< / title>

< / head>

< body>

< h2>< center>这是一个简单的测试页< / center>< / h2>

< p>< / p>

来自Postgresql的动态问候

< / body>

< / html>


是这样的产品存在(最好是开源)。

我准备去蟒蛇等,但我真的必须重新教育

我自己..... br />

提前致谢。

Bir

解决方案

On 2003年10月23日星期四11:38,Birahim FALL写道:

这样的产品是否存在(最好是开源)。
我准备好去蟒蛇等了,但是我真的必须重新教育
自己.....




Bir,

有很多方法使用Postgres的数据制作网页。


我' d建议你得到:


最新的Postgres

Apache2( http://httpd.apache.org

Mod_Python( http://www.modpython.org )获取最新的CVS版本(撰写本文时为3.1.2b)。

Python 2.3.2+( http://www.python.org

德拉科( http://draco.boskant.nl )0.99.4或(Quixote http://freshmeat.net/redir/quixote/1...mepage/quixote

和Psycopg( http://freshmeat.net/projects / psycopg

以及这些依赖项(mxDateTime浮现在脑海中)。


Ge一切的最新版本。这是制作任何你想要的东西的完整工具包。


Draco和Quixote采用了不同的方法将Python粘贴到网页上。两者都值得一看,只是为了理解他们的做事方式。

两者都不同于使用特殊编码打印每个HTML元素的相当不优雅的方式,Oracle看起来使用它。 />
Draco具有强大的逻辑/演示分离能力。 Quixote采用独特的方法,允许您在Py​​thon中嵌入HTML,而不是更常见的相反。

有很多其他软件包可以粘合。 HTML和数据库一起用Python。我不会看到Python以外的任何地方。

我发现Draco非常平易近人,设计精良,相当完整。 (你需要CVS版本3.1.2b的mod_python或更新才能使它正常工作)。


当然,每个人都不同意什么组合是正确的事情。这些是我最喜欢的。

我正在重新教育自己的Perl,程序编程和其他错误的东西(避免火焰)。

它是一座小山要爬,但我真的非常喜欢它,并且有一个大计划


,Postgres将开车。 :-)


Happy Trails,

Scott


----------- ----------------(广播结束)---------------------------

提示9:如果您的

加入列的数据类型不匹配,计划员将忽略您选择索引扫描的愿望


2003年10月24日星期五06:24,Scott Chapman写道:

2003年10月23日星期四11:38,Birahim FALL写道:

这样的产品是否存在(最好是开源)。
我准备好去蟒蛇等了,但我真的必须重新教育
自己......



Bir,
有很多方法可以制作包含Postgres数据的网页。

我建议你这样做:
最新的Postgres
Apache2( http://httpd.apache.org
Mod_Python( http://www.modpython.org )获取最新的CVS版本(撰写本文时为3.1.2b)。 Python 2.3.2+( http://www.python.org
Draco( http://draco.boskant.nl )0.99.4或(Quixote
http://freshmeat.net/redir/quixote/1。 ..mepage / quixote )和Psycopg
http:// freshmeat .net / projects / psycopg
以及这些依赖项(mxDateTime浮现在脑海中)。




Python非常受尊重,和Perl有模块可以做你想做的任何事情

和许多你不应该/不应该/不健康的事情。


你可能想看看PHP( http://www.php.net )语法是

非常接近于你你想要的。

一句警告 - 在PHP中混合代码和HTML非常容易。对于

除了最小的项目,你不想做这个。有很多

的模板选项,但很聪明( http:// smarty。 php.net )非常受欢迎

且灵活。


-

Richard Huxton

Archonet Ltd


---------------------------(播出结束) ---------------------------

提示3:如果通过Usenet发布/阅读,请发送相应的

subscribe-nomail命令 ma*******@postgresql.org 所以您的

消息可以干净地通过邮件列表


Hi,

I''m very fresh to PostgreSQL, coming from Oracle.
I want to developp web applications based on apache and postgresql.
Is there an equivalent of OWA server (Oracle Web Application server) for
postgresql.
Shortly, OWA provides an apache module and a set of stored
procedures/functions that generate html pages.

A simple example could be the following procedure :

procedure hello {
htp.htmlOpen;
htp.headOpen;
htp.title("Simple test page");
htp.headClose:
htp.bodyOpen
htp.print( htf.h2( htf.center( "This is a simple test page" ) ) );
htp.paragraph;
htp.print("Dynamic hello from Postgresql");
htp.bodyClose;
htp.htmlClose;
}

That would generate the following html code :

<html>
<head>
<title>Simple test page</title>
</head>
<body>
<h2><center>This is a simple test page</center></h2>
<p></p>
Dynamic hello from Postgresql
</body>
</html>

Is such a product exists (preferably opensource).
I''m ready to go for python etc, but I really wuld have to re-educate
myself.....

Thanks in advance.
Bir

解决方案

On Thursday 23 October 2003 11:38, Birahim FALL wrote:

Is such a product exists (preferably opensource).
I''m ready to go for python etc, but I really wuld have to re-educate
myself.....



Bir,
There are a LOT of ways to make web pages with data from Postgres.

I''d suggest you get:

The latest Postgres
Apache2 (http://httpd.apache.org)
Mod_Python (http://www.modpython.org) Get the latest CVS version (3.1.2b at this writing).
Python 2.3.2+ (http://www.python.org)
Draco (http://draco.boskant.nl) 0.99.4 or (Quixote http://freshmeat.net/redir/quixote/1...mepage/quixote)
and Psycopg (http://freshmeat.net/projects/psycopg)
and whatever few dependencies these have (mxDateTime comes to mind).

Get the latest versions of everything. That''s a complete kit to make Anything You Want.

Draco and Quixote take much different approaches to gluing Python to web pages. Both are worth a good look, just to understand their ways of doing things.
Both are different from the rather inelegant way of printing each HTML element using special coding, which Oracle looks like it uses.
Draco has strong logic/presentation seperation. Quixote takes the unique approach of allowing you to embed HTML in Python rather than the more common opposite.
There are LOTS of other packages to "glue" HTML and databases together in Python. I wouldn''t look anywhere beyond Python.
I''ve found Draco to be very approachable and well designed and fairly complete. (You will need the CVS version 3.1.2b of mod_python or newer to make it work right).

Everyone, of course, disagrees on what combination is be the Right Thing. These are my favorites, for now.
I''m re-educating myself out of Perl, Procedural Programming and other Wrong Things (ducking to avoid flames).
It''s a hill to climb but I''m really enjoying it and have Big Plan


that Postgres will be driving. :-)

Happy Trails,
Scott

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column''s datatypes do not match


On Friday 24 October 2003 06:24, Scott Chapman wrote:

On Thursday 23 October 2003 11:38, Birahim FALL wrote:

Is such a product exists (preferably opensource).
I''m ready to go for python etc, but I really wuld have to re-educate
myself.....



Bir,
There are a LOT of ways to make web pages with data from Postgres.

I''d suggest you get:

The latest Postgres
Apache2 (http://httpd.apache.org)
Mod_Python (http://www.modpython.org) Get the latest CVS version (3.1.2b at
this writing). Python 2.3.2+ (http://www.python.org)
Draco (http://draco.boskant.nl) 0.99.4 or (Quixote
http://freshmeat.net/redir/quixote/1...mepage/quixote) and Psycopg
(http://freshmeat.net/projects/psycopg)
and whatever few dependencies these have (mxDateTime comes to mind).



Python is very well respected, and Perl has modules to do anything you want
and many things you don''t/shouldn''t/are bad for your health.

You might want to look at PHP (http://www.php.net) which has a syntax which is
quite close to what you want.
A word of warning - it''s very easy in PHP to mix your code and HTML. For
anything but the smallest project you don''t want to do this. There are lots
of templating options, but smarty (http://smarty.php.net) is quite popular
and flexible.

--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly


这篇关于使用PL / PgSQL生成HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆