Re: [Catalyst] Using URIs for my app in another program

2008-05-01 Thread J. Shirley
On Thu, May 1, 2008 at 4:53 PM, Byron Young <[EMAIL PROTECTED]> wrote:
>  Hey J.  Yes, that could work too, but it requires making a call to the 
> catalyst app, which means at least one hard-coded url will be in the daemon.  
> I considered having a page on my app that would just serve up a requested 
> url, which is similar to your proposal, but I'd rather avoid hard-coding any 
> urls in the daemon.
>
>  Thanks for the suggestion.


Not necessarily hard-coded; you can store that either A) in the daemon
config, B) with the jobs that are sent in or C) in the DB somewhere.

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


RE: [Catalyst] Using URIs for my app in another program

2008-05-01 Thread Byron Young
J. Shirley wrote on 2008-05-01:
> On Thu, May 1, 2008 at 4:00 PM, Byron Young
> <[EMAIL PROTECTED]> wrote:
>>
>>
>>
>>
>> Ah, right, I need a HTTP request to get base.  I wasn't thinking
>> straight about that.
>>
>>
>>
>> I think storing links in the database is what I'll do, because that
>> leaves the responsibility of generating URIs solely with the catalyst
>> app.  If I refactor code or move things around I don't want to have to
>> update my daemon at all.
>>
>>
>>
>> Thanks for your feedback, Robert.
>>
>  Another option is to use a distributed cache system like memcached.
> Pretty easy to setup, and then you can have a "warm cache" action that
> populates the configured URIs in the cache.  So, your daemon queries
> cache, if it comes up empty then make a call out to the app to generate
> the URLs and stuff them in cache.
>
> -J

Hey J.  Yes, that could work too, but it requires making a call to the catalyst 
app, which means at least one hard-coded url will be in the daemon.  I 
considered having a page on my app that would just serve up a requested url, 
which is similar to your proposal, but I'd rather avoid hard-coding any urls in 
the daemon.

Thanks for the suggestion.

byron

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Using URIs for my app in another program

2008-05-01 Thread J. Shirley
On Thu, May 1, 2008 at 4:00 PM, Byron Young <[EMAIL PROTECTED]> wrote:
>
>
>
>
> Ah, right, I need a HTTP request to get base.  I wasn't thinking straight
> about that.
>
>
>
> I think storing links in the database is what I'll do, because that leaves
> the responsibility of generating URIs solely with the catalyst app.  If I
> refactor code or move things around I don't want to have to update my daemon
> at all.
>
>
>
> Thanks for your feedback, Robert.
>

Another option is to use a distributed cache system like memcached.
Pretty easy to setup, and then you can have a "warm cache" action that
populates the configured URIs in the cache.  So, your daemon queries
cache, if it comes up empty then make a call out to the app to
generate the URLs and stuff them in cache.

-J

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


RE: [Catalyst] Using URIs for my app in another program

2008-05-01 Thread Byron Young
Ah, right, I need a HTTP request to get base.  I wasn't thinking straight about 
that.

I think storing links in the database is what I'll do, because that leaves the 
responsibility of generating URIs solely with the catalyst app.  If I refactor 
code or move things around I don't want to have to update my daemon at all.

Thanks for your feedback, Robert.

Byron

From: Robert Krimen [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 01, 2008 3:34 PM
To: The elegant MVC web framework
Subject: Re: [Catalyst] Using URIs for my app in another program

The most straightforward method I can think of is to factor out the URIs to a 
common config file.

You can have your daemon read in the config file and generate URIs from that. 
Your Catalyst application can either continue to use
base to generate URIs or you can generate some special URIs from the config 
file as well.

The problem with having your daemon load up Catalyst to generate a URI is that 
I'm not sure how that would work. Catalyst generates URIs
given a HTTP request. No HTTP request, no base URI.

Another safety measure is that you can have your Catalyst appl do a sanity 
check against the URI config file to make sure it doesn't become out of date 
(maybe a startup test request).

Rob
On Thu, May 1, 2008 at 2:27 PM, Byron Young <[EMAIL PROTECTED]> wrote:
Hi all

I've run into a situation that I can't find a good solution to and am hoping to 
solicit some ideas from people on the list here.

An app I've been working on consists of two main parts - a Catalyst-based web 
app which provides the UI, and a daemon that does the heavy lifting.  They are 
totally separate applications that talk to one another via database.  The 
daemon will sometimes send emails to users when it finishes certain tasks that 
the users are interested in, and I want to include links in the emails that 
would bring the user to a Results page on the web app where they can get more 
information about the result of the task.

So, what I would like is to be able to call $c->uri_for() from my daemon.  Is 
there any 'sanctioned' way of doing that?  If possible, I'd like to avoid 
loading my whole catalyst app and somehow tricking it into believing its 
running under the same environment as my real app.

Another option is to use the database to pass URIs around.  Maybe a URI table 
that maps finished tasks to URIs.  However, I would rather just be able to 
arbitrarily call $c->uri_for() whenever I decide I need to include a URI in my 
daemon instead of having to create a table or column whenever I decide I want 
to send a link to a new type of resource.

Any suggestions?  Maybe I'm just going about it all wrong?

Thanks!

Byron

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Tutorial

2008-05-01 Thread Ali M.
Considere reading the mailist thread about the possibilities for a new book
here is the link http://www.gossamer-threads.com/lists/catalyst/users/18157

it will give you a better idea about the state of catalyst
documentation and how to find answer

Good luck


On Thu, May 1, 2008 at 9:17 PM, gaurav001 <[EMAIL PROTECTED]> wrote:
>
> Hello gurus,
> I am newb for Catalyst so forgive me if I ask stupid questions.
> I have Rockway's book. I followed it. All went good so far (ignore
> FormBuilder stuff ). Now i want to customize application. Lets say
> FormBuilder.render gives me submit button automatically (no idea how). But
> what if I want One Registration button and another Cancel Button.
> Also Controller file (.PM) file, how can i write my business logic. I know
> its perl but as I include Catalyst::Controller::FormBuilder...Anychange
> gives me error. Where to find tutorial for extra METHODS. CGI::FormBuilder
> has some really nice tutorial online. But how can I do that kind of coding
> in Catalyst.
>
> What should I go through now? Template-Toolkit.org and Formbuilder.org ...
> Then what extra steps do I need to make Navigating Site with complex
> Business logic.
> --
> View this message in context: 
> http://www.nabble.com/Tutorial-tp16994039p16994039.html
> Sent from the Catalyst Web Framework mailing list archive at Nabble.com.
>
>
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Using URIs for my app in another program

2008-05-01 Thread Robert Krimen
The most straightforward method I can think of is to factor out the URIs to
a common config file.

You can have your daemon read in the config file and generate URIs from
that. Your Catalyst application can either continue to use
base to generate URIs or you can generate some special URIs from the config
file as well.

The problem with having your daemon load up Catalyst to generate a URI is
that I'm not sure how that would work. Catalyst generates URIs
given a HTTP request. No HTTP request, no base URI.

Another safety measure is that you can have your Catalyst appl do a sanity
check against the URI config file to make sure it doesn't become out of date
(maybe a startup test request).

Rob

On Thu, May 1, 2008 at 2:27 PM, Byron Young <[EMAIL PROTECTED]>
wrote:

> Hi all
>
> I've run into a situation that I can't find a good solution to and am
> hoping to solicit some ideas from people on the list here.
>
> An app I've been working on consists of two main parts - a Catalyst-based
> web app which provides the UI, and a daemon that does the heavy lifting.
>  They are totally separate applications that talk to one another via
> database.  The daemon will sometimes send emails to users when it finishes
> certain tasks that the users are interested in, and I want to include links
> in the emails that would bring the user to a Results page on the web app
> where they can get more information about the result of the task.
>
> So, what I would like is to be able to call $c->uri_for() from my daemon.
>  Is there any 'sanctioned' way of doing that?  If possible, I'd like to
> avoid loading my whole catalyst app and somehow tricking it into believing
> its running under the same environment as my real app.
>
> Another option is to use the database to pass URIs around.  Maybe a URI
> table that maps finished tasks to URIs.  However, I would rather just be
> able to arbitrarily call $c->uri_for() whenever I decide I need to include a
> URI in my daemon instead of having to create a table or column whenever I
> decide I want to send a link to a new type of resource.
>
> Any suggestions?  Maybe I'm just going about it all wrong?
>
> Thanks!
>
> Byron
>
> ___
> List: Catalyst@lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Using URIs for my app in another program

2008-05-01 Thread Byron Young
Hi all

I've run into a situation that I can't find a good solution to and am hoping to 
solicit some ideas from people on the list here.

An app I've been working on consists of two main parts - a Catalyst-based web 
app which provides the UI, and a daemon that does the heavy lifting.  They are 
totally separate applications that talk to one another via database.  The 
daemon will sometimes send emails to users when it finishes certain tasks that 
the users are interested in, and I want to include links in the emails that 
would bring the user to a Results page on the web app where they can get more 
information about the result of the task.

So, what I would like is to be able to call $c->uri_for() from my daemon.  Is 
there any 'sanctioned' way of doing that?  If possible, I'd like to avoid 
loading my whole catalyst app and somehow tricking it into believing its 
running under the same environment as my real app.

Another option is to use the database to pass URIs around.  Maybe a URI table 
that maps finished tasks to URIs.  However, I would rather just be able to 
arbitrarily call $c->uri_for() whenever I decide I need to include a URI in my 
daemon instead of having to create a table or column whenever I decide I want 
to send a link to a new type of resource.

Any suggestions?  Maybe I'm just going about it all wrong?

Thanks!

Byron

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Tutorial

2008-05-01 Thread gaurav001

Hello gurus,
I am newb for Catalyst so forgive me if I ask stupid questions.
I have Rockway's book. I followed it. All went good so far (ignore
FormBuilder stuff ). Now i want to customize application. Lets say
FormBuilder.render gives me submit button automatically (no idea how). But
what if I want One Registration button and another Cancel Button.
Also Controller file (.PM) file, how can i write my business logic. I know
its perl but as I include Catalyst::Controller::FormBuilder...Anychange
gives me error. Where to find tutorial for extra METHODS. CGI::FormBuilder
has some really nice tutorial online. But how can I do that kind of coding
in Catalyst. 

What should I go through now? Template-Toolkit.org and Formbuilder.org ...
Then what extra steps do I need to make Navigating Site with complex
Business logic.
-- 
View this message in context: 
http://www.nabble.com/Tutorial-tp16994039p16994039.html
Sent from the Catalyst Web Framework mailing list archive at Nabble.com.


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Re: $row->copy causing exit from controller(!)

2008-05-01 Thread Aristotle Pagaltzis
Hi Paul,

* Paul Makepeace <[EMAIL PROTECTED]> [2008-05-01 17:00]:
> How does one use perl -d in the context of a FastCGI instance?
> Any other debugging tips?

does your problem happen only with the FastCGI engine or can you
reproduce it with others?

If you can, well, there you go.

Regards,
-- 
Aristotle Pagaltzis // 

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] $row->copy causing exit from controller(!)

2008-05-01 Thread Paul Makepeace
On Thu, May 1, 2008 at 1:25 PM, Jonathan Rockway <[EMAIL PROTECTED]> wrote:
> * On Thu, May 01 2008, Paul Makepeace wrote:
>  > I'm seeing something exceedingly odd: copying data causing a premature
>  > return from the controller, like a detach(),
>  >
>  > foreach my $table (@chart_related_tables) {
>  >   my $rs = $ds->resultset($table);
>  >   warn "copying $table for ", $new_chart->uid;
>  >   for my $row ($rs->search({web_chart_spec_uid => $chart->uid})) {
>  > warn "..row ", $row->web_chart_spec_uid, $row;
>  > $row->copy({web_chart_spec_uid => $new_chart->uid});  # XXX
>  >   }
>  >   #$_->copy({web_chart_spec_uid => $new_chart->uid})
>  >   #for $rs->search({web_chart_spec_uid => $chart->uid});
>  >   die "cloned", $new_chart->uid;
>  > }
>  >
>
>  Is copy throwing an exception?  Are you using an old version of
>  stacktrace?

There's no exception. Imagine a "return;" and that's what is happening AFAICT.

How does one use perl -d in the context of a FastCGI instance? Any
other debugging tips?

P

>
>  If yes and yes: upgrade StackTrace (it eats exceptions)
>  If no and no: something is horribly wrong (perl -d may help)
>  If yes and no: see above.
>
>  I have a feeling it's the first one.  Another possibility is that "copy"
>  is last-ing out of itself.
>
>  Regards,
>  Jonathan Rockway
>
>  --
>  print just => another => perl => hacker => if $,=$"
>
>  ___
>  List: Catalyst@lists.scsys.co.uk
>  Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
>  Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
>  Dev site: http://dev.catalyst.perl.org/
>

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] $row->copy causing exit from controller(!)

2008-05-01 Thread Ash Berlin


On 1 May 2008, at 13:33, Ash Berlin wrote:



On 1 May 2008, at 13:25, Jonathan Rockway wrote:


* On Thu, May 01 2008, Paul Makepeace wrote:
I'm seeing something exceedingly odd: copying data causing a  
premature

return from the controller, like a detach(),

  foreach my $table (@chart_related_tables) {
my $rs = $ds->resultset($table);
warn "copying $table for ", $new_chart->uid;
for my $row ($rs->search({web_chart_spec_uid => $chart- 
>uid})) {

  warn "..row ", $row->web_chart_spec_uid, $row;
  $row->copy({web_chart_spec_uid => $new_chart->uid});  #  
XXX

}
#$_->copy({web_chart_spec_uid => $new_chart->uid})
#for $rs->search({web_chart_spec_uid => $chart->uid});
die "cloned", $new_chart->uid;
  }



Is copy throwing an exception?  Are you using an old version of
stacktrace?

If yes and yes: upgrade StackTrace (it eats exceptions)
If no and no: something is horribly wrong (perl -d may help)
If yes and no: see above.

I have a feeling it's the first one.  Another possibility is that  
"copy"

is last-ing out of itself.


If also occasionally seen exceptions disappear without stack trace  
one. Its a right pain to track down what causes it (lots of source  
diving and perl -d)


er... 'I've also  stack trace plugin'

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] $row->copy causing exit from controller(!)

2008-05-01 Thread Ash Berlin


On 1 May 2008, at 13:25, Jonathan Rockway wrote:


* On Thu, May 01 2008, Paul Makepeace wrote:
I'm seeing something exceedingly odd: copying data causing a  
premature

return from the controller, like a detach(),

   foreach my $table (@chart_related_tables) {
 my $rs = $ds->resultset($table);
 warn "copying $table for ", $new_chart->uid;
 for my $row ($rs->search({web_chart_spec_uid => $chart- 
>uid})) {

   warn "..row ", $row->web_chart_spec_uid, $row;
   $row->copy({web_chart_spec_uid => $new_chart->uid});  #  
XXX

 }
 #$_->copy({web_chart_spec_uid => $new_chart->uid})
 #for $rs->search({web_chart_spec_uid => $chart->uid});
 die "cloned", $new_chart->uid;
   }



Is copy throwing an exception?  Are you using an old version of
stacktrace?

If yes and yes: upgrade StackTrace (it eats exceptions)
If no and no: something is horribly wrong (perl -d may help)
If yes and no: see above.

I have a feeling it's the first one.  Another possibility is that  
"copy"

is last-ing out of itself.


If also occasionally seen exceptions disappear without stack trace  
one. Its a right pain to track down what causes it (lots of source  
diving and perl -d)


-ash

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] $row->copy causing exit from controller(!)

2008-05-01 Thread Jonathan Rockway
* On Thu, May 01 2008, Paul Makepeace wrote:
> I'm seeing something exceedingly odd: copying data causing a premature
> return from the controller, like a detach(),
>
> foreach my $table (@chart_related_tables) {
>   my $rs = $ds->resultset($table);
>   warn "copying $table for ", $new_chart->uid;
>   for my $row ($rs->search({web_chart_spec_uid => $chart->uid})) {
> warn "..row ", $row->web_chart_spec_uid, $row;
> $row->copy({web_chart_spec_uid => $new_chart->uid});  # XXX
>   }
>   #$_->copy({web_chart_spec_uid => $new_chart->uid})
>   #for $rs->search({web_chart_spec_uid => $chart->uid});
>   die "cloned", $new_chart->uid;
> }
>

Is copy throwing an exception?  Are you using an old version of
stacktrace?

If yes and yes: upgrade StackTrace (it eats exceptions)
If no and no: something is horribly wrong (perl -d may help)
If yes and no: see above.

I have a feeling it's the first one.  Another possibility is that "copy"
is last-ing out of itself.

Regards,
Jonathan Rockway

-- 
print just => another => perl => hacker => if $,=$"

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] Re: How to print/display some data in an end action

2008-05-01 Thread Aristotle Pagaltzis
* Andreas Marienborg <[EMAIL PROTECTED]> [2008-05-01 10:50]:
> No point in forwarding to end, since that is done automaticly.

In which case it would run twice, actually. But maybe he has a
more specific `end` action and so forwarding to ::C::Root::end
is actually a useful thing to do in his app. As I said, we have
seen too little of the code to make any meaningful suggestions.

Regards,
-- 
Aristotle Pagaltzis // 

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] $row->copy causing exit from controller(!)

2008-05-01 Thread Paul Makepeace
I'm seeing something exceedingly odd: copying data causing a premature
return from the controller, like a detach(),

foreach my $table (@chart_related_tables) {
  my $rs = $ds->resultset($table);
  warn "copying $table for ", $new_chart->uid;
  for my $row ($rs->search({web_chart_spec_uid => $chart->uid})) {
warn "..row ", $row->web_chart_spec_uid, $row;
$row->copy({web_chart_spec_uid => $new_chart->uid});  # XXX
  }
  #$_->copy({web_chart_spec_uid => $new_chart->uid})
  #for $rs->search({web_chart_spec_uid => $chart->uid});
  die "cloned", $new_chart->uid;
}

There's no further execution past the line marked XXX: the template is
rendered from that point on. The die is never called.

I have a feeling it's something to do with has_many

Chart:
__PACKAGE__->has_many(chartview_company => 'IDL::Schema::ChartCompany'
=> 'web_chart_spec_uid', {cascade_delete => 0});

If I exclude from @chart_related_tables ChartCompany it works.

**

I realize there's scads of debug I could provide but wanted to check
first this wasn't something someone had run into before. If not, what
kind of debug can I provide?

DBIC $VERSION = '0.08009';
Catalyst 5.7012

Paul

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Re: How to print/display some data in an end action

2008-05-01 Thread Andreas Marienborg


On Apr 30, 2008, at 4:16 PM, Emmanuel Quevillon wrote:


Aristotle Pagaltzis wrote:

* Emmanuel Quevillon <[EMAIL PROTECTED]> [2008-04-30 15:05]:

Catalyst always try to wrap the action result 'display' into a
template.

No, it doesn’t. If that happens in your app, then you have set it
up to happen like that. But the code you pasted does not include
that portion, so no one will be able tell you what to do instead.
Regards,



Thanks Aristotle,


Maybe I can clarify the situation.

In controller Foo I have 2 methods:

sub bar : LocalRegex ('^(\d+)$') {

   my($self, $c) = @_;

   my $id = $c->req->captures->[0];
   $c->detach(qw/Root _softwareError/,
  ["An id is required to get related genes."])
 unless $id;

   $c->stash()->{url}  = $c->uri_for("/admin/rg/$id");
   $c->stash()->{template} = 'admin/relatedgenes.tt2';
   $c->detach('View::TT');

}

sub rg : Local : Args(1) {


   my($self, $c) = @_;

   my $id = $c->req->args->[0];
   $c->detach(qw/Root _softwareError/,
  ["An id is required to get related genes."])
 unless $id;

   my $gr = GeneRelations->new(
   %{$c->config()->{dbinfos}},
   org  => $c->session()->{org}->{id_org},
  );

   my $t = $gr->display_graph(type => 'id_gene', value => $id);
   $c->res->write($t);
   $c->forward('Root', 'end');

}


Template 'admin/relatedgenes.tt2' contains an  tag as :



with [% url %] value coming from 'Foo::bar'
here: http:///rg/">

I know that  tag can contain an url to be call on load, and  
that's what I want to do with My app to avoid storing svg files. If  
I put url for a svg image it works fine. But I don't want to store  
temp files.


I hope the situation will be clearer like this and someone will be  
able to give clues or solutions.



Most likely your Root's end action forwards to a view. If you use the  
RenderView action-class, it shouldn't do that if the body is set.


I would change the rg actions last few lines to something like this:


$c->res->body($t);
$c->res->content_type('your/content-type');
}

No point in forwarding to end, since that is done automaticly.

If you don't use RenderView, you need to post your roots end action if  
we are to help you figure out whats up there.


- andreas


___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/