History - Update history of contents for CGI. |
use Whatnew; use History;
my($html_root); $html_root = '/home/foo/public_html'; my(%config) = ( 'link' => 'rel', 'html_root' => "$html_root=http://www.any.com/~foo", 'path' => "$html_root", 'template' => "history=$html_root/work/histmpl.html;index=$html_root/work/idxtmpl.html", 'records' => "$html_root/work/whatnew.tmp", 'index' => "$html_root/work/history.idx=$html_root/history.html", ); my($form) = new History; $form->ParseQuery(); $form->SetParameter(\%config); $form->OutResponse();
This is for CGI program, but may be used only by author. This will create update history from temporary file of Whatnew.pm. I think the Whatnew.pm has enough capability. But the Whatnew.pm forget expired old informations. This is for keep that information to permanent file. That permanent file is as HTML file. Also, if you require, you can modify saved file. This ability will give flexibility to your contents.
This module will be used for CGI program. Like as...
http://www.any.com/~foo/cgi-bin/sample.cgi?config=test;func=history
or
http://www.any.com/~foo/cgi-bin/sample.cgi?config=test;func=index
That value is used for hint of selecting from parameter set. I hope to use with Params.pm.
new([$cgi_object])
my($form) = new History;
or
my($q) = new CGI; my($form) = new History($q);
Like as... sample.cgi
use Whatnew; use History;
my($html_root) = '/home/foo/public_html'; my($CONFIG_FILE) = "$html_root/work/sample.par"; my($form) = new History;
$form->ParseQuery(); $main::configname = $form->config(); $form->SetParameter($CONFIG_FILE); $form->OutResponse();
sample.par
########################################### # History sample paramter file # #define HTML_ROOT /home/foo/public_html #define WORKPATH %HTML_ROOT%/work #if $main::configname eq 'test' # define CONFIG_NAME test #endif ########################################### # common define %CONFIG_NAME% link{ rel; }; %CONFIG_NAME% html_root{ %HTML_ROOT%=http://www.any.com/~foo };
%CONFIG_NAME% path{ %HTML_ROOT%; }; %CONFIG_NAME% template{ history=%WORKPATH%/histmpl.html; index=%WORKPATH%/idxtmpl.html; }; ########################################### test records{ %WORKPATH%/whatnew.tmp; }; test index{ %WORKPATH%/history.idx=%HTML_ROOT%/history.html; };
SetParameter($rh_para)
my($html_root); $html_root = '/home/foo/public_html'; my(%config) = ( 'link' => 'rel', 'html_root' => "$html_root=http://www.any.com/~foo", 'path' => "$html_root", 'template' => "history=$html_root/work/histmpl.html;index=$html_root/work/idxtmpl.html", 'records' => "$html_root/work/whatnew.tmp", 'index' => "$html_root/work/history.idx=$html_root/history.html", ); my($form) = new History; $form->ParseQuery(); $form->SetParameter(\%config);
or
my($CONFIG_FILE) = "$html_root/work/sample.par"; my($form) = new History;
$form->ParseQuery(); $main::configname = $form->config(); $form->SetParameter($CONFIG_FILE);
`history=histmpl.html;index=idxtmpl.html'
The `histmpl.html' is for history file, and the `idxtmpl.html' is for index file.
You can easily customize template. Sample is following.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <HTML> <HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=Shift_JIS"> <TITLE>Update history index</TITLE> <!-- Update history sample template --> </HEAD> <BODY> <H1>Update history</H1> <HR> <TABLE summary="Update history"> <!-- Following comment statement will be replaced to new documents information. You can customize that. These keywords will be handled about associated document. Like as...
%mtime% : Modified time %URL% : URL %title% : Title in head block of that document %x-meta-updateinfo% : Update information It's described in head block of that document. If you want to use this field, you must append it along specified format when you update document. --> <!-- NEW items 0 0 <TR> <TD VALIGN="top">%mtime%</TD><TD VALIGN="top">:</TD><TD><P><A HREF="%URL%">%title%</A></P><PRE>%x-meta-updateinfo%</PRE></TD> </TR> NEW items to above --> </TABLE> <HR> </BODY> </HTML>
You can use URLs, if you use merge function in the Whatnew. For example...
http://www.another.com/~foo/cgi-bin/whatnew.cgi&config=another;func=get
func
'.
Whatnew.pm, Params.pm, Timestr.pm, CGI.pm, URI.pm
Tetsuya Shigetome, <t_shigetome@muf.biglobe.ne.jp>.
o Sort order is not numerically.
o Foever loop in UpdateHistory.
Compliant
Whatnew.pm and Params.pm
First release of History.pm
History - Update history of contents for CGI. |