<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Ah, right, I need a HTTP request to get base.&nbsp; I wasn&#8217;t
thinking straight about that.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>I think storing links in the database is what I&#8217;ll do,
because that leaves the responsibility of generating URIs solely with the
catalyst app.&nbsp; If I refactor code or move things around I don&#8217;t want
to have to update my daemon at all.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Thanks for your feedback, Robert.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Byron</span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Robert Krimen
[mailto:robertkrimen@gmail.com] <br>
<b>Sent:</b> Thursday, May 01, 2008 3:34 PM<br>
<b>To:</b> The elegant MVC web framework<br>
<b>Subject:</b> Re: [Catalyst] Using URIs for my app in another program<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal style='margin-bottom:12.0pt'>The most straightforward method
I can think of is to factor out the URIs to a common config file.<br>
<br>
You can have your daemon read in the config file and generate URIs from that.
Your Catalyst application can either continue to use<br>
base to generate URIs or you can generate some special URIs from the config
file as well. <br>
<br>
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<br>
given a HTTP request. No HTTP request, no base URI.<br>
<br>
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).<br>
<br>
Rob<o:p></o:p></p>

<div>

<p class=MsoNormal>On Thu, May 1, 2008 at 2:27 PM, Byron Young &lt;<a
href="mailto:Byron.Young@riverbed.com">Byron.Young@riverbed.com</a>&gt; wrote:<o:p></o:p></p>

<p class=MsoNormal>Hi all<br>
<br>
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.<br>
<br>
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. &nbsp;They
are totally separate applications that talk to one another via database.
&nbsp;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.<br>
<br>
So, what I would like is to be able to call $c-&gt;uri_for() from my daemon.
&nbsp;Is there any 'sanctioned' way of doing that? &nbsp;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.<br>
<br>
Another option is to use the database to pass URIs around. &nbsp;Maybe a URI
table that maps finished tasks to URIs. &nbsp;However, I would rather just be
able to arbitrarily call $c-&gt;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.<br>
<br>
Any suggestions? &nbsp;Maybe I'm just going about it all wrong?<br>
<br>
Thanks!<br>
<br>
Byron<br>
<br>
_______________________________________________<br>
List: <a href="mailto:Catalyst@lists.scsys.co.uk">Catalyst@lists.scsys.co.uk</a><br>
Listinfo: <a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst"
target="_blank">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst</a><br>
Searchable archive: <a
href="http://www.mail-archive.com/catalyst@lists.scsys.co.uk/" target="_blank">http://www.mail-archive.com/catalyst@lists.scsys.co.uk/</a><br>
Dev site: <a href="http://dev.catalyst.perl.org/" target="_blank">http://dev.catalyst.perl.org/</a><o:p></o:p></p>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

</div>

</body>

</html>