|
List Info
Thread: full url
|
|
| full url |

|
2007-05-09 10:58:06 |
Is there a way, from a template, to get the full url
(protocol, hostname,
etc.) of the story that is being burned?
I'm trying to send an email from a form on the server and
need a full path
for the images included in the email.
--
http://glassbrian.com
http://cooking.glassbri
an.com
|
|
| Re: full url |

|
2007-05-09 11:49:51 |
If there's a better way I'd like to know about it, but for
the time being
this works:
<%realtime>
my $uri = $m->cgi_object->self_url;
</%realtime>
On 5/9/07, Brian Glass <brian glassbrian.com> wrote:
>
> Is there a way, from a template, to get the full url
(protocol, hostname,
> etc.) of the story that is being burned?
>
> I'm trying to send an email from a form on the server
and need a full path
> for the images included in the email.
>
> --
> http://glassbrian.com
> http://cooking.glassbri
an.com
--
http://glassbrian.com
http://cooking.glassbri
an.com
|
|
| RE: full url |

|
2007-05-09 12:00:41 |
Can you accomplish the same thing with an alert?
If not, then you might be able to adapt the sub below - it's
part of a
mod to Business.pm I made that's not included in any Bric
release yet
and hasn't been thoroughly tested, but seems to work. This
particular
sub only shows links to LIVE content that has been
published, not to
content on the preview server.
############################################################
############
########
=item $boolean= $business->get_list_of_urls
Returns a hashref of name / value pairs for each combination
of output
channel and site that is valid for this asset where the name
is a mashup
of the o/c & site and the value is the url
=cut
sub get_list_of_urls {
my $self = shift;
my links;
my $status = $self->get_status_bits;
return if ! ($status & PUBLISHEDMASK) ;
return if ($status & EXPIREDMASK) ;
#warn $self->get_uri();
# loop through all output channels and all categories
for this asset
my ocs = $self->get_output_channels;
foreach my $oc ( ocs) {
my $ocid = $oc->get_id;
my $bat = Bric: ist::Ser
verType->list({
can_publish => 1,
active => 1,
output_channel_id => $ocid
});
foreach my $serverType ( $bat) {
my $servers = $serverType->get_servers;
my $server = $servers->[0];
if ($server) {
my $uri;
if ($self->key_name eq 'story') {
my $cat =
$self->get_primary_category;
$uri = $self->get_uri($cat,$oc) if
$cat;
}
else {
$uri = $self->get_uri($oc);
}
if ( $uri ) {
my $link = {
title => "View asset that is
currently published
to the output channel
'".$oc->get_name."'",
uri =>
$server->get_host_name.$uri,
label => $oc->get_name,
};
push links, $link;
}
}
}
}
return links;
}
-----Original Message-----
From: brianglass42 gmail.com [mailto:brianglass42 gmail.com] On Behalf
Of Brian Glass
Sent: Wednesday, May 09, 2007 11:58 AM
To: users lists.bricolage.cc
Subject: full url
Is there a way, from a template, to get the full url
(protocol,
hostname,
etc.) of the story that is being burned?
I'm trying to send an email from a form on the server and
need a full
path
for the images included in the email.
--
http://glassbrian.com
http://cooking.glassbri
an.com
|
|
| Re: full url |

|
2007-05-09 12:22:27 |
Actually, I'm doing this as an e-invite type of thing on the
public server.
The person fills in a form and an email gets sent to the
person being
invited. I don't think an alert would solve that problem.
On 5/9/07, Beaudet, David P. <D-Beaudet nga.gov> wrote:
>
>
> Can you accomplish the same thing with an alert?
>
>
> If not, then you might be able to adapt the sub below -
it's part of a
> mod to Business.pm I made that's not included in any
Bric release yet
> and hasn't been thoroughly tested, but seems to work.
This particular
> sub only shows links to LIVE content that has been
published, not to
> content on the preview server.
>
>
############################################################
############
> ########
>
> =item $boolean= $business->get_list_of_urls
>
> Returns a hashref of name / value pairs for each
combination of output
> channel and site that is valid for this asset where the
name is a mashup
> of the o/c & site and the value is the url
>
> =cut
> sub get_list_of_urls {
> my $self = shift;
> my links;
>
> my $status = $self->get_status_bits;
> return if ! ($status & PUBLISHEDMASK) ;
> return if ($status & EXPIREDMASK) ;
>
> #warn $self->get_uri();
> # loop through all output channels and all
categories for this asset
> my ocs = $self->get_output_channels;
> foreach my $oc ( ocs) {
> my $ocid = $oc->get_id;
> my $bat = Bric: ist::Ser
verType->list({
> can_publish => 1,
> active => 1,
> output_channel_id => $ocid
> });
> foreach my $serverType ( $bat) {
> my $servers = $serverType->get_servers;
> my $server = $servers->[0];
> if ($server) {
> my $uri;
> if ($self->key_name eq 'story') {
> my $cat =
$self->get_primary_category;
> $uri = $self->get_uri($cat,$oc)
if $cat;
> }
> else {
> $uri = $self->get_uri($oc);
> }
> if ( $uri ) {
> my $link = {
> title => "View asset
that is currently published
> to the output channel
'".$oc->get_name."'",
> uri =>
$server->get_host_name.$uri,
> label => $oc->get_name,
> };
> push links, $link;
> }
> }
> }
> }
> return links;
> }
>
> -----Original Message-----
> From: brianglass42 gmail.com [mailto:brianglass42 gmail.com] On Behalf
> Of Brian Glass
> Sent: Wednesday, May 09, 2007 11:58 AM
> To: users lists.bricolage.cc
> Subject: full url
>
> Is there a way, from a template, to get the full url
(protocol,
> hostname,
> etc.) of the story that is being burned?
>
> I'm trying to send an email from a form on the server
and need a full
> path
> for the images included in the email.
>
> --
> http://glassbrian.com
> http://cooking.glassbri
an.com
>
--
http://glassbrian.com
http://cooking.glassbri
an.com
|
|
| Re: full url |

|
2007-05-09 12:44:42 |
On May 9, 2007, at 1:22 PM, Brian Glass wrote:
> Actually, I'm doing this as an e-invite type of thing
on the public
> server.
> The person fills in a form and an email gets sent to
the person being
> invited. I don't think an alert would solve that
problem.
How are you doing that through Bricolage? That seems like
something
better handled on the public server via PHP.
--
Marshall Roch
|
|
| Re: full url |

|
2007-05-09 13:55:16 |
Right, but I'm using an image in the email that is deposited
on the server
by Bricolage. I just want the full url for that image so I
can embed it in
my email.
Yes, my current solution uses scripting on the front end
(Mason rather than
PHP) to determine the full url.
On 5/9/07, Marshall Roch <marshall exclupen.com> wrote:
>
> On May 9, 2007, at 1:22 PM, Brian Glass wrote:
>
> > Actually, I'm doing this as an e-invite type of
thing on the public
> > server.
> > The person fills in a form and an email gets sent
to the person being
> > invited. I don't think an alert would solve that
problem.
>
> How are you doing that through Bricolage? That seems
like something
> better handled on the public server via PHP.
>
> --
> Marshall Roch
>
>
--
http://glassbrian.com
http://cooking.glassbri
an.com
|
|
| Re: full url |

|
2007-05-10 04:47:46 |
I think something like what you have is about as good as
you'll get
(i.e. not relying on the Bricolage itself to furnish the
URL).
In general from Bricolage's perspective (which we'd have to
account
for in a method), there can be several destination servers,
and the output doesn't have to correspond to web pages,
so "the full url" doesn't really have any
meaning,
as there might not even be any URL. (In the destination,
you can specify the hostname and document root,
but that won't generally correspond to any particular URL.)
On Wed, 9 May 2007, Brian Glass wrote:
> If there's a better way I'd like to know about it, but
for the time being
> this works:
>
> <%realtime>
> my $uri = $m->cgi_object->self_url;
> </%realtime>
>
>
> On 5/9/07, Brian Glass <brian glassbrian.com> wrote:
>>
>> Is there a way, from a template, to get the full
url (protocol, hostname,
>> etc.) of the story that is being burned?
>>
>> I'm trying to send an email from a form on the
server and need a full path
>> for the images included in the email.
>>
>> --
>> http://glassbrian.com
>> http://cooking.glassbri
an.com
|
|
| Re: full url |

|
2007-05-11 17:26:45 |
On May 9, 2007, at 11:58, Brian Glass wrote:
> Is there a way, from a template, to get the full url
(protocol,
> hostname,
> etc.) of the story that is being burned?
$oc = $burner->get_oc;
my $site = Bric::Biz::Site->lookup({ id =>
$story->get_site_id });
$url = $oc->get_protocol . $site->get_domain_name
. $story->get_uri(undef, $oc)
See also Bric::Util::Burner->best_uri().
Best,
David
|
|
[1-8]
|
|