You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(50) |
Jun
(69) |
Jul
(25) |
Aug
(27) |
Sep
(28) |
Oct
(52) |
Nov
(18) |
Dec
(18) |
2002 |
Jan
(18) |
Feb
(34) |
Mar
(21) |
Apr
(44) |
May
(8) |
Jun
(4) |
Jul
(19) |
Aug
(13) |
Sep
(11) |
Oct
(9) |
Nov
(5) |
Dec
(7) |
2003 |
Jan
(2) |
Feb
(1) |
Mar
(3) |
Apr
(2) |
May
(2) |
Jun
(2) |
Jul
(1) |
Aug
|
Sep
|
Oct
(8) |
Nov
(2) |
Dec
(9) |
2004 |
Jan
(1) |
Feb
(2) |
Mar
(8) |
Apr
(13) |
May
(16) |
Jun
|
Jul
(3) |
Aug
(2) |
Sep
(1) |
Oct
(6) |
Nov
(6) |
Dec
(1) |
2005 |
Jan
(2) |
Feb
|
Mar
(1) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Boris Z. <bo...@gm...> - 2002-07-28 20:58:24
|
Hi, with this patch it is possible to add a cookie postfix for your cookies. -- Boris |
From: Gabriel B. <gbu...@2b...> - 2002-07-27 21:20:11
|
I've noticed that encoding conversion is not done properly when the content is inside PKIT_ERRORSPAN. The file.tmpl shown below should have two identical lines. When the content is inside PKIT_ERRORSPAN, instead of a single s/S/t/T with a comma under, I get 2 characters (just like looking at UTF-8 text with a non-compliant viewer and seeing the 2bytes it takes to encode 1 character). It almost looks like the text is being converted twice. Outside the PKIT_ERRORSPAN, conversion works properly. file.xml -------------------------------------- <?xml version="1.0" encoding="utf-8"?> <content> <ro_char_set xml:lang="ro"> scedil ş Scedil Ş tcedil ţ Tcedil Ţ </ro_char_set> </content> file.tmpl --------------------------------------------------------------- <PKIT_ERRORSPAN NAME="some_name> <CONTENT_VAR NAME="document('file.xml')//ro_char_set"> </PKIT_ERRORSPAN> <p> <CONTENT_VAR NAME="document('file.xml')//ro_char_set"> Config.xml ---------- <GLOBAL ... default_input_charset = "UTF-8" default_output_charset = "UTF-8" /> Regards, Gabriel Burca -- gburca dash pkit at 2b dot 2y dot net |
From: Boris Z. <bo...@am...> - 2002-07-03 11:09:19
|
---------- Weitergeleitete Nachricht ---------- Subject: Re: [Pagekit-devel] ErrorReport header problem Date: Wed, 3 Jul 2002 11:51:04 +0200 From: Boris Zentner <bo...@am...> To: Ben Ausden <Ben...@na...> Hi Ben, I have a patch, that may do what you want, it is very old and i remember not all the details, but the drawback is that sometimes part of the page can be drawn already or maybe not. Headers may be send or not. My idea to make this a little more relaible was to send some headers, if there where no ones already. But then you did not see the rest of the page (if used together with pagekit). Also it depends on your browser (without the patch). Some ignore the error message (konqueror) and some show the message (netscape). Anyway i try to find the patch... Also note, that most errors can be catched and nice displayed with the pkit_on_error handler. Am Dienstag, 2. Juli 2002 11:47 schrieb Ben Ausden: > Hello, > > Apache::ErrorReport is printing its output before the HTTP headers have > been sent: > > <pre><font color="blue">WARN: [error call stack etc] > </font></pre><br>HTTP/1.1 200 OK > Date: Tue, 02 Jul 2002 09:29:32 GMT > Server: Apache/1.3.26 (Unix) mod_perl/1.27_01-dev > Connection: close > Content-Type: text/html > > <html> > <body> > Hello World > </body> > </html> > > > I've been trying to figure out how to delay printing the errors until the > headers have been output, but with no success so far. Anyone have any > ideas? > > PageKit 1.10 (cvs) > perl 5.6.1 > apache 1.26 > mod_perl 1.27 > > cheers, > ben > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Pagekit-devel mailing list > Pag...@li... > https://lists.sourceforge.net/lists/listinfo/pagekit-devel -- Boris ------------------------------------------------------- -- Boris |
From: Ben A. <Ben...@na...> - 2002-07-02 09:50:50
|
Hello, Apache::ErrorReport is printing its output before the HTTP headers have been sent: <pre><font color="blue">WARN: [error call stack etc] </font></pre><br>HTTP/1.1 200 OK Date: Tue, 02 Jul 2002 09:29:32 GMT Server: Apache/1.3.26 (Unix) mod_perl/1.27_01-dev Connection: close Content-Type: text/html <html> <body> Hello World </body> </html> I've been trying to figure out how to delay printing the errors until the headers have been output, but with no success so far. Anyone have any ideas? PageKit 1.10 (cvs) perl 5.6.1 apache 1.26 mod_perl 1.27 cheers, ben |
From: Boris Z. <bo...@am...> - 2002-07-01 08:36:25
|
Hi, this patch allows PageKit to startup even if a bug in some version of mod_perl prevents us to get vars with the Apache::Server->dir_config methode. (If you supply the PKIT_ROOT and PKIT_SERVER on startup ie: Apache::PageKit->startup('your_pkit_root', 'your_server'). Changed files: Apache-PageKit/Changes Apache-PageKit/lib/Apache/PageKit.pm Index: Apache-PageKit/Changes =================================================================== RCS file: /cvsroot/pagekit/Apache-PageKit/Changes,v retrieving revision 1.151 diff -u -r1.151 Changes --- Apache-PageKit/Changes 7 Jun 2002 16:17:34 -0000 1.151 +++ Apache-PageKit/Changes 26 Jun 2002 15:10:46 -0000 @@ -2,6 +2,9 @@ For more details on migration, see migration/README 1.10 + - Use parameters for Apache::PageKit->startup if we can not + find PKIT_ROOT and or PKIT_SERVER for + mod_perl >= 1.06 (Boris Zentner) - Fix: bug, where path relative components are not listed as an edit component. (Boris Zentner, Gabriel Burca) - Fix a errormessage is fixed, that report file is out of the root_dir even Index: Apache-PageKit/lib/Apache/PageKit.pm =================================================================== RCS file: /cvsroot/pagekit/Apache-PageKit/lib/Apache/PageKit.pm,v retrieving revision 1.194 diff -u -r1.194 PageKit.pm --- Apache-PageKit/lib/Apache/PageKit.pm 7 Jun 2002 16:10:12 -0000 1.194 +++ Apache-PageKit/lib/Apache/PageKit.pm 26 Jun 2002 15:10:53 -0000 @@ -48,8 +48,8 @@ my $s = Apache->server; if ( defined $mod_perl::VERSION && $mod_perl::VERSION >= 1.26 ) { - $pkit_root = $s->dir_config('PKIT_ROOT') || die "PKIT_ROOT is not defined! Put PerlSetVar PKIT_ROOT /your/root/path in your httpd.conf"; - $server = $s->dir_config('PKIT_SERVER') || die "PKIT_SERVER is not defined! Put PerlSetVar PKIT_SERVER servername in your httpd.conf"; + $pkit_root = $s->dir_config('PKIT_ROOT') || $pkit_root || die "PKIT_ROOT is not defined! Put PerlSetVar PKIT_ROOT /your/root/path in your httpd.conf"; + $server = $s->dir_config('PKIT_SERVER') || $server || die "PKIT_SERVER is not defined! Put PerlSetVar PKIT_SERVER servername in your httpd.conf"; } else { $pkit_root || die 'must specify $pkit_root variable in startup. Usage: Apache::PageKit->startup($pkit_root, $server)'; $server || die 'must specify $server variable in startup. Usage: Apache::PageKit->startup($pkit_root, $server)'; -- Boris |
From: Boris Z. <bo...@am...> - 2002-07-01 08:36:25
|
Hi, this patch prevents us to code the errorcolor in the .PO files for example. Changed files: Apache-PageKit/Changes Apache-PageKit/lib/Apache/PageKit.pm Apache-PageKit/lib/Apache/PageKit/Model.pm Index: Apache-PageKit/Changes =================================================================== RCS file: /cvsroot/pagekit/Apache-PageKit/Changes,v retrieving revision 1.155 diff -u -r1.155 Changes --- Apache-PageKit/Changes 26 Jun 2002 15:29:01 -0000 1.155 +++ Apache-PageKit/Changes 26 Jun 2002 15:31:53 -0000 @@ -2,6 +2,8 @@ For more details on migration, see migration/README 1.10 + - Fix replace <PKIT_ERRORSTR> even inside pkit_message strings. + (Boris Zentner) - Use parameters for Apache::PageKit->startup if we can not find PKIT_ROOT and or PKIT_SERVER for mod_perl >= 1.06 (Boris Zentner) Index: Apache-PageKit/lib/Apache/PageKit.pm =================================================================== RCS file: /cvsroot/pagekit/Apache-PageKit/lib/Apache/PageKit.pm,v retrieving revision 1.197 diff -u -r1.197 PageKit.pm --- Apache-PageKit/lib/Apache/PageKit.pm 26 Jun 2002 15:29:02 -0000 1.197 +++ Apache-PageKit/lib/Apache/PageKit.pm 26 Jun 2002 15:32:01 -0000 @@ -835,6 +835,7 @@ my $relaxed_parser = $config->get_global_attr('relaxed_parser') || 'no'; my $errorspan_begin_tag = $config->get_global_attr('errorspan_begin_tag') || q{<font color="<PKIT_ERRORSTR>">}; my $errorspan_end_tag = $config->get_global_attr('errorspan_end_tag') || q{</font>}; + my $default_errorstr = $config->get_global_attr('default_errorstr') || '#ff0000'; my $template_class = $config->get_global_attr('template_class') || 'HTML::Template'; $self->{view} = Apache::PageKit::View->new(view_dir => "$pkit_root/View", @@ -851,6 +852,7 @@ relaxed_parser => $relaxed_parser, errorspan_begin_tag => $errorspan_begin_tag, errorspan_end_tag => $errorspan_end_tag, + default_errorstr => $default_errorstr, template_class => $template_class, ); Index: Apache-PageKit/lib/Apache/PageKit/Model.pm =================================================================== RCS file: /cvsroot/pagekit/Apache-PageKit/lib/Apache/PageKit/Model.pm,v retrieving revision 1.79 diff -u -r1.79 Model.pm --- Apache-PageKit/lib/Apache/PageKit/Model.pm 26 Jun 2002 15:29:02 -0000 1.79 +++ Apache-PageKit/lib/Apache/PageKit/Model.pm 26 Jun 2002 15:32:03 -0000 @@ -205,6 +205,9 @@ $message = $converter->convert($message) || die "Can not convert page from $input_charset to $default_output_charset" if $message; } + my $default_error_str = $model->pkit_get_config_attr( GLOBAL => 'default_errorstr' ) || "#ff0000"; + $message =~ s/<(!--)?\s*PKIT_ERRORSTR\s*(?(1)--)>/$default_error_str/gi; + my $array_ref = $model->output('pkit_messages') || []; push @$array_ref, {pkit_message => $message, pkit_is_error => $options->{'is_error'}}; -- Boris |
From: Boris Z. <bo...@am...> - 2002-07-01 08:36:24
|
Hi, Changed files: Apache-PageKit/lib/Apache/PageKit.pm Index: Apache-PageKit/lib/Apache/PageKit.pm =================================================================== RCS file: /cvsroot/pagekit/Apache-PageKit/lib/Apache/PageKit.pm,v retrieving revision 1.195 diff -u -r1.195 PageKit.pm --- Apache-PageKit/lib/Apache/PageKit.pm 26 Jun 2002 15:11:51 -0000 1.195 +++ Apache-PageKit/lib/Apache/PageKit.pm 26 Jun 2002 15:21:22 -0000 @@ -1460,8 +1460,9 @@ John Moose Sheldon Hearn Vladimir Sekissov - Gabriel Burka + Gabriel Burca Tomasz Konefal + Michael Wojcikiewicz Also, thanks to Dan Von Kohorn for helping shape the initial architecture and for the invaluable support and advice. -- Boris |
From: Boris Z. <bo...@am...> - 2002-07-01 08:36:24
|
Hi, this patch let you use PKIT_ERRORSPAN and PKIT_ERRORFONT without a special NAME attr. Usefull if you like to color/mark somthing ever in a document. Changed files: Apache-PageKit/Changes Apache-PageKit/lib/Apache/PageKit/View.pm Index: Apache-PageKit/Changes =================================================================== RCS file: /cvsroot/pagekit/Apache-PageKit/Changes,v retrieving revision 1.153 diff -u -r1.153 Changes --- Apache-PageKit/Changes 26 Jun 2002 15:19:01 -0000 1.153 +++ Apache-PageKit/Changes 26 Jun 2002 15:24:43 -0000 @@ -5,6 +5,8 @@ - Use parameters for Apache::PageKit->startup if we can not find PKIT_ROOT and or PKIT_SERVER for mod_perl >= 1.06 (Boris Zentner) + - Add patch to use <PKIT_ERRORSPAN> and <PKIT_ERRORFONT> + without a name attribute. (Boris Zentner) - Fix: bug, where path relative components are not listed as an edit component. (Boris Zentner, Gabriel Burca) - Fix a errormessage is fixed, that report file is out of Index: Apache-PageKit/lib/Apache/PageKit/View.pm =================================================================== RCS file: /cvsroot/pagekit/Apache-PageKit/lib/Apache/PageKit/View.pm,v retrieving revision 1.98 diff -u -r1.98 View.pm --- Apache-PageKit/lib/Apache/PageKit/View.pm 26 Jun 2002 15:19:01 -0000 1.98 +++ Apache-PageKit/lib/Apache/PageKit/View.pm 26 Jun 2002 15:24:47 -0000 @@ -595,6 +595,17 @@ $$html_code_ref =~ s%<(!--)?\s*(?:MODEL|PKIT)_(VAR|LOOP|IF|ELSE|UNLESS)($key_value_pattern*)\s*/?(?(1)--)>%<TMPL_$2$3>%sig; $$html_code_ref =~ + s^<(!--)?\s*PKIT_ERROR(?:FONT|SPAN)$key_value_pattern?\s*(?(1)--)>(.*?)<(!--)?\s*/PKIT_ERROR(?:FONT|SPAN)\s*(?(8)--)>^ + my $name = $4 || $5 || $6 || $3; + if ( $name ) { + qq{<TMPL_VAR NAME="PKIT_ERRORSPAN_BEGIN_$name">$7<TMPL_VAR NAME="PKIT_ERRORSPAN_END_$name">}; + } else { + my $text = $7; + ( my $errorspan_begin_tag = $view->{errorspan_begin_tag} ) =~ s/<(!--)?\s*PKIT_ERRORSTR\s*(?(1)--)>/$view->{default_errorstr}/gi; + $errorspan_begin_tag . $text . $view->{errorspan_end_tag} + } ^seig; + + $$html_code_ref =~ s%<(!--)?\s*PKIT_SELFURL$key_value_pattern?\s*/?(?(1)--)>% &process_selfurl_tag($exclude_params_set, $4 || $5 || $6 || $3 ) %seig; $$html_code_ref =~ s%<(!--)?\s*/PKIT_(VIEW|IS_ERROR|NOT_ERROR|MESSAGES|HAVE_MESSAGES|HAVE_NOT_MESSAGES)\s*(?(1)--)>% $replace_end_tags{uc($2)} %seig; @@ -604,9 +615,7 @@ $$html_code_ref =~ s^<(!--)?\s*PKIT_VIEW$key_value_pattern\s*/?(?(1)--)>^ sprintf '<TMPL_IF NAME="PKIT_VIEW:%s">', $4 || $5 || $6 || $3; ^sieg; #" - $$html_code_ref =~ - s^<(!--)?\s*PKIT_ERROR(?:FONT|SPAN)$key_value_pattern(?(1)--)\s*>(.*?)<(!--)?\s*/PKIT_ERROR(?:FONT|SPAN)\s*(?(8)--)>^ my $font = $4 || $5 || $6 || $3; qq{<TMPL_VAR NAME="PKIT_ERRORSPAN_BEGIN_$font">$7<TMPL_VAR NAME="PKIT_ERRORSPAN_END_$font">}; ^seig; - } + } else { if ( $$html_code_ref =~ m%<PKIT_(?:VAR|LOOP|IF|UNLESS)(?:$key_value_pattern)*/?>%i ) { @@ -624,6 +633,17 @@ $$html_code_ref =~ s%<(?:MODEL|PKIT)_(VAR|LOOP|IF|ELSE|UNLESS)($key_value_pattern*)/?>%<TMPL_$1$2>%sig; $$html_code_ref =~ + s^<PKIT_ERROR(?:FONT|SPAN)$key_value_pattern?>(.*?)</PKIT_ERROR(?:FONT|SPAN)>^ + my $name = $3 || $4 || $5 || $2; + if ( $name ) { + qq{<TMPL_VAR NAME="PKIT_ERRORSPAN_BEGIN_$name">$6<TMPL_VAR NAME="PKIT_ERRORSPAN_END_$name">}; + } else { + my $text = $6; + ( my $errorspan_begin_tag = $view->{errorspan_begin_tag} ) =~ s/<PKIT_ERRORSTR>/$view->{default_errorstr}/gi; + $errorspan_begin_tag . $text . $view->{errorspan_end_tag} + } ^seig; + + $$html_code_ref =~ s%<PKIT_SELFURL$key_value_pattern?/?>% &process_selfurl_tag($exclude_params_set, $3 || $4 || $5 || $2 ) %seig; $$html_code_ref =~ s%</PKIT_(VIEW|IS_ERROR|NOT_ERROR|MESSAGES|HAVE_MESSAGES|HAVE_NOT_MESSAGES)>% $replace_end_tags{uc($1)} %seig; @@ -632,8 +652,6 @@ $$html_code_ref =~ s^<PKIT_VIEW$key_value_pattern/?>^ sprintf '<TMPL_IF NAME="PKIT_VIEW:%s">', $3 || $4 || $5 || $2; ^sieg; #" - $$html_code_ref =~ - s^<PKIT_ERROR(?:FONT|SPAN)$key_value_pattern>(.*?)</PKIT_ERROR(?:FONT|SPAN)>^ my $font = $3 || $4 || $5 || $2; qq{<TMPL_VAR NAME="PKIT_ERRORSPAN_BEGIN_$font">$6<TMPL_VAR NAME="PKIT_ERRORSPAN_END_$font">}; ^seig; } my @a = keys %$exclude_params_set; -- Boris |
From: Boris Z. <bo...@am...> - 2002-07-01 08:36:24
|
Hi, this patch fix the error, that Gabriel Burca reported ( in great detail so fixing was fun thanks ). His report can be read on the pkit-devel list search for the subject "Edit.pm - add_component_edit_stubs" Changed files: Apache-PageKit/Changes Apache-PageKit/lib/Apache/PageKit/Edit.pm Apache-PageKit/lib/Apache/PageKit/View.pm Index: Apache-PageKit/Changes =================================================================== RCS file: /cvsroot/pagekit/Apache-PageKit/Changes,v retrieving revision 1.152 diff -u -r1.152 Changes --- Apache-PageKit/Changes 26 Jun 2002 15:11:50 -0000 1.152 +++ Apache-PageKit/Changes 26 Jun 2002 15:17:34 -0000 @@ -5,10 +5,11 @@ - Use parameters for Apache::PageKit->startup if we can not find PKIT_ROOT and or PKIT_SERVER for mod_perl >= 1.06 (Boris Zentner) - - Fix: bug, where path relative components are not listed as an edit component. + - Fix: bug, where path relative components are not listed as + an edit component. (Boris Zentner, Gabriel Burca) + - Fix a errormessage is fixed, that report file is out of + the root_dir even if the file is not found. (Boris Zentner, Gabriel Burca) - - Fix a errormessage is fixed, that report file is out of the root_dir even - if the file is not found. (Boris Zentner, Gabriel Burca) - Fix: write the session data and destroy the db connection even if an error transpires (Boris Zentner) - Fix: defer delivery of static pages if parameters are attached to Index: Apache-PageKit/lib/Apache/PageKit/Edit.pm =================================================================== RCS file: /cvsroot/pagekit/Apache-PageKit/lib/Apache/PageKit/Edit.pm,v retrieving revision 1.10 diff -u -r1.10 Edit.pm --- Apache-PageKit/lib/Apache/PageKit/Edit.pm 7 Jun 2002 22:30:11 -0000 1.10 +++ Apache-PageKit/lib/Apache/PageKit/Edit.pm 26 Jun 2002 15:17:35 -0000 @@ -121,22 +121,22 @@ } sub add_component_edit_stubs { - my ( $view, $component_id, $html_code_ref, $pkit_view ) = @_; + my ( $view, $page_id, $html_code_ref, $pkit_view ) = @_; # insert edit stubs (PKIT_EDIT_COMPONENT), before each PKIT_COMPONENT tag, # for online editing tools to use if ( $view->{relaxed_parser} eq 'yes' ) { $$html_code_ref =~ - s%<(!--)?\s*PKIT_COMPONENT($key_value_pattern+)\s*/?(?(1)--)?>(?:<(!--)?\s*/PKIT_COMPONENT\s*(?(1)--)>)?%_build_component_edit_stub($view, $pkit_view, $component_id, $2)%eig; + s%<(!--)?\s*PKIT_COMPONENT($key_value_pattern+)\s*/?(?(1)--)?>(?:<(!--)?\s*/PKIT_COMPONENT\s*(?(1)--)>)?%_build_component_edit_stub($view, $pkit_view, $page_id, $2)%eig; } else { $$html_code_ref =~ - s%<\s*PKIT_COMPONENT($key_value_pattern+)\s*/?>(<\s*/PKIT_COMPONENT\s*>)?%_build_component_edit_stub($view, $pkit_view, $component_id, $1)%eig; + s%<\s*PKIT_COMPONENT($key_value_pattern+)\s*/?>(<\s*/PKIT_COMPONENT\s*>)?%_build_component_edit_stub($view, $pkit_view, $page_id, $1)%eig; } ###$$html_code_ref =~ s!(<[^>]*)?(<PKIT_COMPONENT $key_value_pattern>)!<font size="-1"><a href="/pkit_edit/open_file?file=$3">(edit $3)</a></font><br>$2!sig; sub _build_component_edit_stub { - my ( $view, $pkit_view, $component_id, $params ) = @_; + my ( $view, $pkit_view, $page_id, $params ) = @_; my %params; while ( $params =~ m!$key_value_pattern!g ) { @@ -149,9 +149,23 @@ $params{NAME} = $2; } } + $params{NAME} =~ s!^/+!!; - my $template_file = $view->_find_template( $pkit_view, $component_id ) - || die "$component_id not found"; + + my $template_file; + my $component_id; + + # search relative to the page_id path + if ( ( $component_id = $page_id ) =~ s!/([^/]+)$!/$params{NAME}! ) { + $template_file = $view->_find_template( $pkit_view, $component_id ); + } + + # if the template_dile is not found search as abs path + unless ( $template_file ) { + $component_id = $params{NAME}; + $template_file = $view->_find_template( $pkit_view, $component_id ) || die "$component_id not found"; + } + my $pkit_root = Apache->request->dir_config('PKIT_ROOT'); die "Filename ($template_file) points outside PKIT_ROOT ($pkit_root)" unless ( $template_file =~ s!^$pkit_root/!! ); return qq{<PKIT_EDIT_COMPONENT NAME="$component_id"><PKIT_COMPONENT $params>}; Index: Apache-PageKit/lib/Apache/PageKit/View.pm =================================================================== RCS file: /cvsroot/pagekit/Apache-PageKit/lib/Apache/PageKit/View.pm,v retrieving revision 1.97 diff -u -r1.97 View.pm --- Apache-PageKit/lib/Apache/PageKit/View.pm 7 Jun 2002 22:30:11 -0000 1.97 +++ Apache-PageKit/lib/Apache/PageKit/View.pm 26 Jun 2002 15:17:39 -0000 @@ -28,8 +28,9 @@ # * filename - filename of template source # * include_mtimes - a hash ref with file names as keys and mtimes as values # (contains all of the files included by the <PKIT_COMPONENT> tags -# * component_ids - an array ref containing component_ids that have -# code associated with them +# * component_ids - an array ref containing an array ref of component_ids and a hash ref +# with the parameters for the compoent, that may have +# code associated with them # * has_form - 1 if contains <form> tag, 0 otherwise. used to # determine whether to apply HTML::FillInForm module # the objects themselves are keyed by page_id, pkit_view and lang @@ -332,7 +333,6 @@ $$html_code_ref = ${$h->data()}; } -# returns the component_ids included sub _include_components { my ($view, $page_id, $html_code_ref, $pkit_view) = @_; @@ -341,6 +341,7 @@ } else { $$html_code_ref =~ s%<\s*PKIT_COMPONENT($key_value_pattern+)\s*/?>(<\s*/PKIT_COMPONENT\s*>)?%&get_component($page_id,$1,$view,$pkit_view)%eig; } + sub get_component { my ($page_id, $params, $view, $pkit_view) = @_; my %params = (); @@ -358,13 +359,18 @@ while ($component_id =~ s![^/]*/\.\./!!) {}; } + my $cid_key = join '', $component_id, sort %params; + unless ( $view->{component_ids_hash}->{$cid_key}++ ) { + push @{ $view->{component_ids} }, [ $component_id , \%params ]; + } + # check for recursive pkit_components - $view->{component_ids_hash}->{$component_id}++; - if($view->{component_ids_hash}->{$component_id} > 100){ + if($view->{component_ids_hash}->{$cid_key} > 100){ die "Likely recursive PKIT_COMPONENTS for component_id $component_id and giving up."; } my $template_ref = $view->_load_component($page_id, $component_id, $pkit_view, \%params); + push @{ $view->{component_ids_arrayref_with_params} }, [ $component_id => \%params ]; $$template_ref =~ s!<\s*PKIT_MACRO$key_value_pattern\s*/?>!$params{uc($+)}!egi if (keys %params); return $$template_ref; } @@ -437,7 +443,7 @@ } if($view->{can_edit} eq 'yes'){ - Apache::PageKit::Edit::add_component_edit_stubs($view, $component_id, $template_ref, $pkit_view); + Apache::PageKit::Edit::add_component_edit_stubs($view, $page_id, $template_ref, $pkit_view); } $view->_include_components($page_id,$template_ref,$pkit_view); @@ -495,7 +501,7 @@ if ( $converter ) { $$filtered_html = $converter->convert($$filtered_html) || die "Can not convert page from UTF-8 to $default_output_charset" if $$filtered_html; } - + my $exclude_params_set = $view->_preparse_model_tags($filtered_html); $view->_html_clean($filtered_html); @@ -513,14 +519,13 @@ if($@){ die "Can't load template (MODEL TAGS) for $page_id: $@" } - my @component_ids = keys %{$view->{component_ids_hash}}; my $record = { exclude_params_set => $exclude_params_set, filename => $template_file, html_template => $tmpl, include_mtimes => $view->{include_mtimes}, - component_ids => \@component_ids, - has_form => $has_form + component_ids => $view->{component_ids}, + has_form => $has_form, }; # make directories, if approriate -- Boris |
From: Boris Z. <bo...@am...> - 2002-07-01 08:36:23
|
Hi, this patch (and a little part inside another file) allows us to get access to the parameters inside the component_code. This looks very powerfull. in your template.tmpl <PKIT_COMPONENT NAME="xxx" headline="title" datasrc="select * from a_table"> <PKIT_COMPONENT NAME="xxx" headline="another_title" datasrc="select * from another_table"> <PKIT_COMPONENT NAME="xxx" headline="title" datasrc="select * from a_table"> and in your sub xxx { my $model = shift; my $fields = $model->pkit_component_params_hashref; my $select_statement = $fields->{DATASRC}; ... } note, that the name of the component is not in the hash. Also all keys are uppercase. If components are the same ( same name and same parameters) like the lines 1 and 3 in the example, then the call to the component code is done only once. if pkit_component_params_hashref is called outside a component, it returns undef. Glenn Morgan had some fine ideas, that lead in this new function. -- Boris Changed files: Apache-PageKit/Changes Apache-PageKit/lib/Apache/PageKit.pm Apache-PageKit/lib/Apache/PageKit/Model.pm Index: Apache-PageKit/Changes =================================================================== RCS file: /cvsroot/pagekit/Apache-PageKit/Changes,v retrieving revision 1.154 diff -u -r1.154 Changes --- Apache-PageKit/Changes 26 Jun 2002 15:25:42 -0000 1.154 +++ Apache-PageKit/Changes 26 Jun 2002 15:27:39 -0000 @@ -7,6 +7,10 @@ mod_perl >= 1.06 (Boris Zentner) - Add patch to use <PKIT_ERRORSPAN> and <PKIT_ERRORFONT> without a name attribute. (Boris Zentner) + - Add: component subs are called with component-parameters. + See pkit_component_params_hashref (Boris Zentner) + ! Component code is called inorder from top to the bottom + (Boris Zentner) - Fix: bug, where path relative components are not listed as an edit component. (Boris Zentner, Gabriel Burca) - Fix a errormessage is fixed, that report file is out of Index: Apache-PageKit/lib/Apache/PageKit.pm =================================================================== RCS file: /cvsroot/pagekit/Apache-PageKit/lib/Apache/PageKit.pm,v retrieving revision 1.196 diff -u -r1.196 PageKit.pm --- Apache-PageKit/lib/Apache/PageKit.pm 26 Jun 2002 15:22:00 -0000 1.196 +++ Apache-PageKit/lib/Apache/PageKit.pm 26 Jun 2002 15:27:46 -0000 @@ -152,8 +152,12 @@ if ($status_code eq OK && $use_template ne 'no'){ COMPONENT: { $pk->open_view; - for my $component_id (@{$view->{record}->{component_ids}}){ - $pk->component_code($component_id); +# for my $component_id (@{$view->{record}->{component_ids}}){ +# $pk->component_code($component_id); + local $pk->{component_params_hashref}; + for my $component_id_params_ref (@{$view->{record}->{component_ids}}){ + $pk->{component_params_hashref} = $component_id_params_ref->[1]; + $pk->component_code($component_id_params_ref->[0]); if ( defined $pk->{status_code} ) { $status_code = $pk->{status_code}; last COMPONENT; Index: Apache-PageKit/lib/Apache/PageKit/Model.pm =================================================================== RCS file: /cvsroot/pagekit/Apache-PageKit/lib/Apache/PageKit/Model.pm,v retrieving revision 1.78 diff -u -r1.78 Model.pm --- Apache-PageKit/lib/Apache/PageKit/Model.pm 28 May 2002 09:49:18 -0000 1.78 +++ Apache-PageKit/lib/Apache/PageKit/Model.pm 26 Jun 2002 15:27:48 -0000 @@ -170,6 +170,10 @@ } } +sub pkit_component_params_hashref { + return $_[0]->{pkit_pk}->{component_params_hashref}; +} + sub pkit_input_hashref { my $model = shift; return $model->{pkit_input_hashref} if |
From: Boris Z. <bo...@am...> - 2002-07-01 08:36:23
|
Some missing or new docs... Changed files: Apache-PageKit/docsrc/reference.xml Index: Apache-PageKit/docsrc/reference.xml =================================================================== RCS file: /cvsroot/pagekit/Apache-PageKit/docsrc/reference.xml,v retrieving revision 1.55 diff -u -r1.55 reference.xml --- Apache-PageKit/docsrc/reference.xml 16 May 2002 17:32:59 -0000 1.55 +++ Apache-PageKit/docsrc/reference.xml 26 Jun 2002 15:06:30 -0000 @@ -2267,6 +2267,7 @@ <refsynopsisdiv> <synopsis> <![CDATA[<PKIT_ERRORFONT NAME="lastname"> Last Name </PKIT_ERRORFONT> <input name="lastname"> ]]> + <![CDATA[<PKIT_ERRORFONT> new for PageKit 1.10 </PKIT_ERRORFONT> ]]> </synopsis> </refsynopsisdiv> <refsect1> @@ -2276,6 +2277,8 @@ </para> <para> This tag highlights fields in red that Model reported as being filled in incorrectly. + Or, since version 1.10 of pkit it is possible to suppress the NAME attribute. + Then the field is always colored or whatever you want. </para> </refsect1> </refentry> @@ -2289,16 +2292,74 @@ <refsynopsisdiv> <synopsis> <![CDATA[<PKIT_ERRORSPAN NAME="lastname"> Last Name </PKIT_ERRORSPAN> <input name="lastname"> ]]> + <![CDATA[<PKIT_ERRORSPAN> new for PageKit 1.10 </PKIT_ERRORSPAN> ]]> </synopsis> </refsynopsisdiv> <refsect1> <title>Description</title> <para> This tag highlights fields in red that Model reported as being filled in incorrectly. + Or, since version 1.10 of pkit it is possible to suppress the NAME attribute. + Then the field is always colored or whatever you want. </para> </refsect1> + </refentry> + + <refentry id="pkit.have_messages"> + <refnamediv> + <refname>PKIT_HAVE_MESSAGES</refname> + <refpurpose> + Include the block between <PKIT_HAVE_MESSAGES> and </PKIT_HAVE_MESSAGES> only, + if one or more messages are avail. + </refpurpose> + </refnamediv> + <refsynopsisdiv> + <synopsis> + <![CDATA[<PKIT_HAVE_MESSAGES> + Here are some messages for you: <p> + <PKIT_MESSAGES> + <PKIT_IS_ERROR><font color="<PKIT_ERRORSTR>"></PKIT_IS_ERROR> + <PKIT_MESSAGE> + <PKIT_IS_ERROR></font></PKIT_IS_ERROR> + <p> + </PKIT_MESSAGES> + </PKIT_HAVE_MESSAGES>]]> + </synopsis> + </refsynopsisdiv> + <refsect1> + <title>Description</title> + <para> + Include the block between <PKIT_HAVE_MESSAGES> and </PKIT_HAVE_MESSAGES> only, + if one or more messages are avail. + </para> + </refsect1> </refentry> + <refentry id="pkit.have_not_messages"> + <refnamediv> + <refname>PKIT_HAVE_NOT_MESSAGES</refname> + <refpurpose> + Include the block between <PKIT_HAVE_NOT_MESSAGES> and </PKIT_HAVE_NOT_MESSAGES> only, + if no messages are avail. + </refpurpose> + </refnamediv> + <refsynopsisdiv> + <synopsis> + <![CDATA[<PKIT_HAVE_NOT_MESSAGES> + No messages for you! <p> + </PKIT_HAVE_NOT_MESSAGES>]]> + + </synopsis> + </refsynopsisdiv> + <refsect1> + <title>Description</title> + <para> + Include the block between <PKIT_HAVE_NOT_MESSAGES> and </PKIT_HAVE_NOT_MESSAGES> only, + if no messages are avail. + </para> + </refsect1> + </refentry> + <refentry id="pkit.hostname"> <refnamediv> <refname>PKIT_HOSTNAME</refname> -- Boris |
From: Boris Z. <bo...@am...> - 2002-06-24 12:54:07
|
Hi, i have just uploaded a prerelease for PageKit. Please test it and report success or failure. You can find here in a short time. http://www.cpan.org/authors/id/B/BO/BORISZ/ thanks for all the bugreports and feedback. 1.10 - Fix replace <PKIT_ERRORSTR> even inside pkit_message strings. (Boris Zentner) - Use parameters for Apache::PageKit->startup if we can not find PKIT_ROOT and or PKIT_SERVER for mod_perl >= 1.06 (Boris Zentner) - Add patch to use <PKIT_ERRORSPAN> and <PKIT_ERRORFONT> without a name attribute. (Boris Zentner) - Add: component subs are called with component-parameters. See pkit_component_params_hashref (Boris Zentner) ! Component code is called inorder from top to the bottom (Boris Zentner) - Fix: bug, where path relative components are not listed as an edit component. (Boris Zentner, Gabriel Burca) - Fix a errormessage is fixed, that report file is out of the root_dir even if the file is not found. (Boris Zentner, Gabriel Burca) - Fix: write the session data and destroy the db connection even if an error transpires (Boris Zentner) - Fix: defer delivery of static pages if parameters are attached to the URI. This allows to login/logout even with a static default page (Boris Zentner) - Fix iconv conversion: it is perfect legal to convert an empty string '' to another charset (Boris Zentner) - Add new tags <PKIT_HAVE_MESSAGES> and <PKIT_HAVE_NOT_MESSAGES> (Boris Zentner, Sebastian Feuerstack) -- Boris |
From: Boris Z. <bo...@am...> - 2002-06-14 12:16:44
|
Hi Mike, Am Freitag, 14. Juni 2002 03:04 schrieb Michael Wojcikiewicz: > Im working on a site that creates some dynamic forms, and would like the > pkit_validate_input to report any errors on the form as well.. so i have > something like this in my template: > > <MODEL LOOP NAME="blah"> > <PKIT_ERRORSPAN NAME="<MODEL_VAR NAME="elementofblah"/>"> > <MODEL_VAR NAME="descriptionofblah"/> > </PKIT_ERRORSPAN> > </MODEL_LOOP> > this is not working, while the PKIT_ERRORSPAN must be replaced before the MODEL_VAR, but this is not possible. Maybe you can use CONTENT_VAR that should work, but replace all or nothing for your example. Another idea is to use something like <MODEL LOOP NAME="blah"> <MODEL_IF error_in_element_elementofblah> <PKIT_ERRORSPAN> <MODEL_VAR NAME="descriptionofblah"/> </PKIT_ERRORSPAN> <MODEL_ELSE> <MODEL_VAR NAME="descriptionofblah"/> </MODEL_IF> </MODEL_LOOP> alll untested... > but when i look at the source of the output HTML, the <PKIT_ERRORSPAN> > tags remain rather than being parsed by pagekit... is there a way to > report errors dynamically like that? -- Boris |
From: Rob S. <fa...@ra...> - 2002-06-14 08:43:33
|
I ran into a problem simular to this with CONTENT_VAR. (search the archives) Shooting from the hip, I'd say try something like : <MODEL LOOP NAME="blah"> <PKIT_ERRORSPAN NAME="<MODEL_VAR NAME='elementofblah'/>"> <MODEL_VAR NAME="descriptionofblah"/> </PKIT_ERRORSPAN> </MODEL_LOOP> *shrug* Let us know if that works. Rob ----- Original Message ----- From: "Michael Wojcikiewicz" <mi...@pe...> To: <pag...@so...> Sent: Thursday, June 13, 2002 6:04 PM Subject: [Pagekit-devel] using PKIT_ERRORSPAN dynamically with MODEL_VARs > Im working on a site that creates some dynamic forms, and would like the > pkit_validate_input to report any errors on the form as well.. so i have > something like this in my template: > > <MODEL LOOP NAME="blah"> > <PKIT_ERRORSPAN NAME="<MODEL_VAR NAME="elementofblah"/>"> > <MODEL_VAR NAME="descriptionofblah"/> > </PKIT_ERRORSPAN> > </MODEL_LOOP> > > but when i look at the source of the output HTML, the <PKIT_ERRORSPAN> > tags remain rather than being parsed by pagekit... is there a way to > report errors dynamically like that? > > [ Mike Wojcikiewicz mi...@pe... ] > [ Perl Developer - Perl Pimps http://www.perlpimps.com ] > > > > > _______________________________________________________________ > > Don't miss the 2002 Sprint PCS Application Developer's Conference > August 25-28 in Las Vegas - http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink > > _______________________________________________ > Pagekit-devel mailing list > Pag...@li... > https://lists.sourceforge.net/lists/listinfo/pagekit-devel > |
From: Michael W. <mi...@pe...> - 2002-06-14 01:04:48
|
Im working on a site that creates some dynamic forms, and would like the pkit_validate_input to report any errors on the form as well.. so i have something like this in my template: <MODEL LOOP NAME="blah"> <PKIT_ERRORSPAN NAME="<MODEL_VAR NAME="elementofblah"/>"> <MODEL_VAR NAME="descriptionofblah"/> </PKIT_ERRORSPAN> </MODEL_LOOP> but when i look at the source of the output HTML, the <PKIT_ERRORSPAN> tags remain rather than being parsed by pagekit... is there a way to report errors dynamically like that? [ Mike Wojcikiewicz mi...@pe... ] [ Perl Developer - Perl Pimps http://www.perlpimps.com ] |
From: Boris Z. <bo...@id...> - 2002-05-28 13:01:14
|
Hi, with a static index page it is hard to login etc. since the request ends before the parameters are checked. This patch fix this. -- Boris |
From: Gabriel B. <gbu...@2b...> - 2002-05-27 19:05:21
|
The add_component_edit_stubs sub in Edit.pm is unable to handle template files that are not in the "root" directory. Given 2 files such as: View/Default/some_dir/myfile.tmpl View/Default/some_dir/myfile2.tmpl If the first file contains a <PKIT_COMPONENET NAME="myfile2.tmpl">, the page_id that _find_template is called with is "myfile2", when instead it should be called with a page_id of "some_dir/myfile2". Since _find_template is unable to locate the file View/Default/myfile2.tmpl it returns undef to add_component_edit_stubs which then dies with the error that the file to be edited is outside PKIT_ROOT. Actually the error is also misleading. It should instead complain that the file was not found, not that it's outside PKIT_ROOT. I've added return "<PKIT_COMPONENT $params>" unless $template_file; right after the call to _find_template as a temporary fix. -- gburca dash pkit at 2b dot 2y dot net |
From: Boris Z. <bo...@id...> - 2002-05-22 17:28:43
|
Hi, it is valid to convert a empty string to another charset. This results in another empty string ;-) -- Boris |
From: Boris Z. <bo...@am...> - 2002-05-20 13:10:51
|
Hi All, this patch add two new tags as requested on the user list by Sebastian Feuerstack. <PKIT_HAVE_MESSAGES> and <PKIT_HAVE_NOT_MESSAGES> ie: <PKIT_HAVE_MESSAGES> Some messages for you: <p> <PKIT_MESSAGES> <PKIT_MESSAGE> <p> </PKIT_MESSAGES> </PKIT_HAVE_MESSAGES> -- Boris |
From: Boris Z. <bo...@am...> - 2002-05-20 13:10:48
|
Hi, this patch fix some minor typos in the file reference.xml. -- Boris |
From: Michael W. <mi...@id...> - 2002-05-03 19:37:34
|
I really love how powerful and easy MODEL_LOOP makes displaying.. but i = find most of the time i need to do some kind of conversion from my = objects to a hash in order display them using MODEL_LOOP... Id love to = see a MODEL_LOOP_OBJ tag (or something similar) that would take a list = of objects and call methods on them instead of accessing keys in a hash. = so: <MODEL_LOOP_OBJ NAME=3D"objects"> <MODEL_VAR NAME=3D"method1"/> <MODEL_VAR NAME=3D"method2"/> </MODEL_LOOP_OBJ> or perhaps you MODEL_LOOP will be able to tell if its dealing with = objects instead of hashes transparently. --mike |
From: Boris Z. <bo...@id...> - 2002-05-02 09:31:06
|
Hi Mike, Am Mittwoch, 1. Mai 2002 16:46 hast Du geschrieben: > It occurs to me a more robust way of having co-branding support would be to > be able to define the View path separately from just setting a pagekit > path(that contains all View/Model/Content). > > For example you could set a different View path for every virtual host that > needs co-branding inside apache, but leave the Model path the same because > its all the same code. This, if i understand it, is hard to do. Our cache is also in the View and has to be unique. Also the cache is erased if the server starts up. This will be done twice or more if you share the Model. Also your custom pkit_startup is called more as once. The next thing is that the View/Default it is the default where we store something that is the same for all views. maybe you can get your effect without change to PageKit with some magic in pkit_common_code or pkit_fixup_uri and the Apache directive NamedVirtualHost. > > just a wish, > > --mike -- cu boris Wie man sein Kind nicht nennen sollte: Klaus El |
From: Michael W. <mi...@id...> - 2002-05-01 14:46:32
|
It occurs to me a more robust way of having co-branding support would be = to be able to define the View path separately from just setting a = pagekit path(that contains all View/Model/Content).=20 For example you could set a different View path for every virtual host = that needs co-branding inside apache, but leave the Model path the same = because its all the same code. just a wish, --mike |
From: Boris Z. <bo...@id...> - 2002-04-30 10:19:35
|
Hi, now on CPAN or very soon. 1.09 - Fix: case where something.xml was added to the mtimes hash even if it does not exists (only if all your content came from another file via xpath document() function) this result in a slowdown for the page unless reload="no" (Boris Zentner) - Fix: die with the error from the fop command. So the errors show up in your browser or log (Boris Zentner) - Fix content_encoding header. If unsure, play save and send the page NOT gzipped (Boris Zentner) - Fix fop example pages (John Robinson) - Add new global option protect_static (Boris Zentner) - Remove some mystery chars (0xA0) (Boris Zentner) - Add new hook pkit_on_error to catch and maybe repair fatal errors (Boris Zentner) ! Simplified and more robust startup (Boris Zentner) - Clear missing server section on reload (Boris Zentner) - Die if a conversion from one charset to another is not possible. Maybe a char is not part of the target charset. (Boris Zentner, Gabriel Burka) ! Add protection of static pages with the require_login config attribute. (Boris Zentner) - Fix two cases where a filehandle can be used even if open failed (Boris Zentner) - Fix uri_prefix so that the url did not grow anymore (Boris Zentner) - Remove unused modules Data::Dumper and Carp from View.pm (Boris Zentner) - Fix to deliver static pages unzipped if desired (Anton Permyakov) - Fix case where wrong cached file is used for xsl files with reload="no" and first called without parameters in the URL (Boris Zentner, Ben Ausden) -- cu boris Das Gesetz des Druckerpapiers: Bei einem auszudruckenden Dokument der Länge n Seiten ist die zur Verfügung stehende Restmenge Druckerpapier n-1 Blatt. |
From: Boris Z. <bo...@id...> - 2002-04-24 22:40:12
|
Hi, this patch fix the content_encoding header. It was sometimes set, even if a page is not send encoded. -- Boris |