Re: templating system opinions (axkit?)

2003-07-21 Thread Daisuke Maki

Anyone on this list use AxKit? I'm curious how it pans out.
I used it for http://www.nikki-site.com (sorry, Japanese-only site). 
This site uses exactly 4 pure-mod_perl handlers, and everything else 
eventually goes through AxKit  (excuse the site design, as far as 
development goes that is a one-man show, and I'm a programmer, not a 
designer ;)

I was keen on leveraging XSLT precisely because I knew that I'd be 
transforming a data source through mod_perl + in a cron job, AND I 
wanted to avoid using Perl on the cronjobs because of the resource 
constraints (puny server).

When a user requests data, AxKit uses a stylesheet to transform it to 
HTML. Meanwhile the same data source is preprocessed a couple of times 
behind the scenes to create derivative data, which is later available 
for users to fetch from Apache. The preprocessing is done using the 
same stylesheet as the one that AxKit, but it is run via multiple calls 
to xsltproc instead of going though Perl. So I get the speed of a 
C-based app using the same stylesheet as mod_perl. I like that ;)

(note for nit-pickers: I admit I didn't do an extensive comparison of 
how it would have faired to use optimized Perl, but the previous 
incarnation of www.nikki-site.com used to take about 3 minutes 
processing the same data -- xsltproc does it in about 13 seconds)

I also like the way AxKit applies transformation. I conceptually think 
of it as a set of filters, and that just fits my mental model. YMMV.

XSP is also very convenient, but I must admit I haven't harnessed its 
entire functionality.

On the other hand I must say that debugging problems on AxKit is pretty 
harsh on beginners. I went in with the mindset that if it was broken I 
was going to make it work, so I didn't have much problem, but that may 
or may not work for you.

Overall I find AxKit to be god-sent for my particular application. 
Things became much easier for me to add to the site, but if you're not 
already familiar with the workings of XML/XSLT, you may need a little 
patience.

--d



Does Indexes work with mod_perl?

2003-03-19 Thread Daisuke Maki

Hi,

I'm having a hard time making mod_perl(1.27) enabled Apache treat
requests to directories so that the directory listing is shown (like the
default behavior when there is not DirectoryIndex file).

I pretty much just threw away all of my mod_perl specific configuration
from my httpd.conf, and the only thing I changed from the default was

   DocumentRoot /path/to/mydocroot
   Directory /path/to/mydocroot
  Options Indexes
   /Directory

And yet, all I get is a 404 not found.

I found a similar posting on the list archives (e.g.
http://www.mail-archive.com/[EMAIL PROTECTED]/msg30237.html), but
didn't see any responses...

Is there anyway to fix this?

--d



Re: SOAP and web services

2002-05-02 Thread Daisuke Maki

Stable enough? you'll have to ask someone else, but I think it should work well 
enough.

I've been using SOAP::Lite + Apache for a bunch of my newer projects
with moderate load, and so far I've had no problems... ;)

--d


Any known gotchas with sending cookies?

2002-04-29 Thread Daisuke Maki

I'm really lost with this...

I'm trying to set a session cookie from PerlAccessHandler. I'm basically
doing (simplified code):

  my $cookie_jar = Apache::Cookie-fetch
  my $session_id = $cookie_jar-{ session }-value;

  if( !session_active( $session_id ) ) {
  my $session_obj = create_session_obj(); ## create and store new
session
  my $cookie  = Apache::Cookie-new(
  $r,
  -name= 'session',
  -value   = $session_obj-id,
  -path= '/',
  -domain  = 'my.domain.com',
  -expires = '+30m'
  );

  $r-headers_out-add( "Set-Cookie" = $cookie-as_string );
  }
  return DECLINED;

This works fine for the first access. Subsequently, I wipe out the
backend database to see if a new session is correctly created. A new
session is created as expected, but the problem is that the new cookie
does not seem to stick to the browser. I've verified that this doesn't
seem to be a browser issue, as I have problems with all browsers that I
have ( IE5.5, IE6, Mozilla 1.0rc)

Is there any known gotchas for this type of thing? Or am I missing
something?

TIA,
--d


Re: Any known gotchas with sending cookies?

2002-04-29 Thread Daisuke Maki
hmm, I still can't get it to work, but it somehow works under LWP. the
following code actually gets the cookie correctly, and no bogus sessions
are created in my server. any ideas??

use strict;
use LWP::UserAgent;

my $ua = LWP::UserAgent-new();
$ua-cookie_jar({ file = "$ENV{ HOME }/cookies.txt", autosave = 1 });
my $req = HTTP::Request-new( GET = 'http://foobar.com' );
my $res = $ua-request( $req );

print $res-as_string;

print $ua-cookie_jar-as_string, "\n";

--d

Daisuke Maki wrote:
 I'm really lost with this...
 
 I'm trying to set a session cookie from PerlAccessHandler. I'm basically
 doing (simplified code):
 
   my $cookie_jar = Apache::Cookie-fetch
   my $session_id = $cookie_jar-{ session }-value;
 
   if( !session_active( $session_id ) ) {
   my $session_obj = create_session_obj(); ## create and store new
 session
   my $cookie  = Apache::Cookie-new(
   $r,
   -name= 'session',
   -value   = $session_obj-id,
   -path= '/',
   -domain  = 'my.domain.com',
   -expires = '+30m'
   );
 
   $r-headers_out-add( "Set-Cookie" = $cookie-as_string );
   }
   return DECLINED;
 
 This works fine for the first access. Subsequently, I wipe out the
 backend database to see if a new session is correctly created. A new
 session is created as expected, but the problem is that the new cookie
 does not seem to stick to the browser. I've verified that this doesn't
 seem to be a browser issue, as I have problems with all browsers that I
 have ( IE5.5, IE6, Mozilla 1.0rc)
 
 Is there any known gotchas for this type of thing? Or am I missing
 something?
 
 TIA,
 --d