|
List Info
Thread: Strange template - trying to produce some XML - previews, doesn't publish...
|
|
| Strange template - trying to produce
some XML - previews, doesn't publish... |

|
2007-05-01 19:18:37 |
I have a template that takes a few stories that are related
to it and
pulls info from them and then writes it out as an xml file.
It works fine in preview, but when I attempt to publish I
get a crazy
error that doesn't even show the bric page with the error,
rather my
browser thinks it's looking at an XML file and so I get a
yellow page
that says this:
XML Parsing Error: not well-formed
Location: http://cms2.etonline.com/workflow/profile/story/47925
Line Number 111, Column 5:HTTP/1.1 302 Found
----^
I've pasted my template code at the end. Viewing the source
of that
page I find this:
<!-- DEBUGGING INFORMATION.
Error: Can't call method "get_id"
on an undefined value
at
/usr/local/bricolage/lib/Bric/App/Callback/ContainerProf.pm
line
757, <GEN33> line 68.
Fault Class: Bric::Util::Fault
Description: Bricolage Exception
Timestamp: 2007-05-01 16:45:51.000000
Package: Bric::App::Handler
Filename:
/usr/local/bricolage/lib/Bric/App/Handler.pm
Line: 386
Payload:
STACK:
Trace begun at /usr/local/bricolage/lib/Bric/App/Handler.pm
line 386
Bric::App::Handler::cb_exception_handler('Can't call method
"get_id"
on an undefined value at
/usr/local/bricolage/lib/Bric/App/Callback/ContainerProf.pm
line 757,
<GEN33> line 68.^J') called at
/usr/local/lib/perl5/site_perl/5.8.8/Params/CallbackRequest.
pm line
308
Params::CallbackRequest::request('Params::CallbackRequest=HA
SH(0xa259508)',
'HASH(0xb2039d0)', 'apache_req',
'Apache::Request=SCALAR(0xbd58b30)')
called at
/usr/local/lib/perl5/site_perl/5.8.8/MasonX/Interp/WithCallb
acks.pm
line 115
MasonX::Interp::WithCallbacks::make_request('MasonX::Interp:
:WithCallbacks=HASH(0xb722160)',
'comp', '/workflow/profile/story/47925', 'args',
'ARRAY(0xbd59a18)',
'ah', 'HTML::Mason::ApacheHandler=HASH(0xb722058)',
'apache_req',
'Apache::Request=SCALAR(0xbd58b30)') called at
/usr/local/lib/perl5/site_perl/5.8.8/HTML/Mason/ApacheHandle
r.pm line
869
eval {...} at
/usr/local/lib/perl5/site_perl/5.8.8/HTML/Mason/ApacheHandle
r.pm
line 868
HTML::Mason::ApacheHandler::prepare_request('HTML::Mason::Ap
acheHandler=HASH(0xb722058)',
'Apache=SCALAR(0xbd3add8)') called at
/usr/local/lib/perl5/site_perl/5.8.8/HTML/Mason/ApacheHandle
r.pm line
823
HTML::Mason::ApacheHandler::handle_request('HTML::Mason::Apa
cheHandler=HASH(0xb722058)',
'Apache=SCALAR(0xbd3add8)') called at
/usr/local/bricolage/lib/Bric/App/Handler.pm line 311
eval {...} at /usr/local/bricolage/lib/Bric/App/Handler.pm
line 300
Bric::App::Handler::handler('Apache=SCALAR(0xbd3add8)')
called at
/dev/null line 0
eval {...} at /dev/null line 0
END DEBUGGING INFORMATION -->
******************************
TEMPLATE CODE:
******************************
<%perl>
# use modules
use XML::Writer;
use MIME::Base64;
# grab links from the story and push them onto related_stories
my related_stories = ();
foreach my $e ($element->get_elements) {
if ($e->has_name("related_story")) {
push related_stories, $e->get_related_story;
}
}
# construct the feed tag writer
my $feed_writer = new XML::Writer(DATA_MODE => 1,
NEWLINES => 0,
ENCODING => 'ascii');
# make initial declarations
my $build_date = strftime( "%a, %d %b %Y %H:%M:%S
%Z", localtime() );
$feed_writer->xmlDecl('utf-8');
$feed_writer->startTag('affiliate_feed');
$feed_writer->dataElement('lastBuildDate', $build_date);
# walk through each link to story and print that story's
data into the feed
foreach my $item ( related_stories) {
my $item_uri = "http://www.etonline.com
" . $item->get_uri;
my $item_date = $item->get_cover_date("%a, %d %b %Y
%H:%M:%S %Z");
my $item_desc = $item->get_description;
my ($photo_uri, $video_uri, $photo_credit,
$photo_caption);
$feed_writer->startTag('item');
$feed_writer->dataElement('title',$item->get_title);
$feed_writer->dataElement('link',$item_uri);
$feed_writer->dataElement('pubDate',$item_date);
$feed_writer->dataElement('description',$item_desc);
foreach my $e ($item->get_elements) {
if($e->has_name("paragraph")) {
$feed_writer->dataElement('paragraph',$e->get_data)
;
}
elsif ($e->has_name("related_photoset")) {
$photo_uri =
$m->comp("/util/get_image_uri.mc",
related_photoset_subelement => $e, type =>
"lland");
$photo_credit =
$m->comp("/util/get_image_credit.mc",
related_photoset_subelement => $e, type =>
"lland");
$photo_caption = $e->get_data("caption");
$feed_writer->dataElement('photo_uri', $photo_uri);
$feed_writer->dataElement('photo_credit',
$photo_credit);
$feed_writer->dataElement('photo_caption',
$photo_caption);
}
elsif ($e->has_name("related_video")) {
$video_uri = $m->comp(".related_video",
related_video_subelement => $e);
$feed_writer->dataElement('video', $video_uri);
}
}
$feed_writer->endTag('item');
}
$feed_writer->endTag('affiliate_feed');
$feed_writer->end;
</%perl>
%
############################################################
##################
<%def .related_video>
<%args>
$related_video_subelement
</%args>
<%perl>
my $id =
$related_video_subelement->get_related_media->get_data
( "cbsid" );
my $title =
$related_video_subelement->get_related_media->get_titl
e;
$title =~ s/(["'/])/\$1/g;
$title = encode_base64($title);
my $title2 =
$related_video_subelement->get_related_media->get_titl
e;
my $description =
$related_video_subelement->get_related_media->get_desc
ription;
$description =~ s/(["'/])/\$1/g;
$description = encode_base64($description);
my $thumb =
$related_video_subelement->get_related_media->get_uri;
my $video_url = "<a
href="javascript:popVideo('/popups/videopla
yer.html?thumb=$thumb&id=$id&title=$title&descri
ption=$description')">$title2</a>
;";
return $video_url;
</%perl>
</%def>
%
############################################################
##################
|
|
| Re: Strange template - trying to produce
some XML - previews, doesn't publish... |

|
2007-05-02 06:05:51 |
What the....XML? (That part might be not directly related
to the error, but rather the error-handling in the UI.)
Could you more precisely describe
the part about "when I attempt to publish" ?
Like to be able to reproduce it, the exact sequence
of actions you took. Was there anything you deleted before,
then you selected Publish and clicked Publish - etc.
On Tue, 1 May 2007, John Durkin wrote:
> I have a template that takes a few stories that are
related to it and
> pulls info from them and then writes it out as an xml
file.
> It works fine in preview, but when I attempt to publish
I get a crazy
> error that doesn't even show the bric page with the
error, rather my
> browser thinks it's looking at an XML file and so I get
a yellow page
> that says this:
>
> XML Parsing Error: not well-formed
> Location: http://cms2.etonline.com/workflow/profile/story/47925
> Line Number 111, Column 5:HTTP/1.1 302 Found
> ----^
>
> I've pasted my template code at the end. Viewing the
source of that
> page I find this:
>
> <!-- DEBUGGING INFORMATION.
>
> Error: Can't call method
"get_id" on an undefined value
> at
/usr/local/bricolage/lib/Bric/App/Callback/ContainerProf.pm
line
> 757, <GEN33> line 68.
>
>
> Fault Class: Bric::Util::Fault
> Description: Bricolage Exception
> Timestamp: 2007-05-01 16:45:51.000000
> Package: Bric::App::Handler
> Filename:
/usr/local/bricolage/lib/Bric/App/Handler.pm
> Line: 386
> Payload:
>
> STACK:
>
> Trace begun at
/usr/local/bricolage/lib/Bric/App/Handler.pm line 386
> Bric::App::Handler::cb_exception_handler('Can't call
method "get_id"
> on an undefined value at
>
/usr/local/bricolage/lib/Bric/App/Callback/ContainerProf.pm
line 757,
> <GEN33> line 68.^J') called at
>
/usr/local/lib/perl5/site_perl/5.8.8/Params/CallbackRequest.
pm line
> 308
>
Params::CallbackRequest::request('Params::CallbackRequest=HA
SH(0xa259508)',
> 'HASH(0xb2039d0)', 'apache_req',
'Apache::Request=SCALAR(0xbd58b30)')
> called at
/usr/local/lib/perl5/site_perl/5.8.8/MasonX/Interp/WithCallb
acks.pm
> line 115
>
MasonX::Interp::WithCallbacks::make_request('MasonX::Interp:
:WithCallbacks=HASH(0xb722160)',
> 'comp', '/workflow/profile/story/47925', 'args',
'ARRAY(0xbd59a18)',
> 'ah', 'HTML::Mason::ApacheHandler=HASH(0xb722058)',
'apache_req',
> 'Apache::Request=SCALAR(0xbd58b30)') called at
>
/usr/local/lib/perl5/site_perl/5.8.8/HTML/Mason/ApacheHandle
r.pm line
> 869
> eval {...} at
>
/usr/local/lib/perl5/site_perl/5.8.8/HTML/Mason/ApacheHandle
r.pm
> line 868
>
HTML::Mason::ApacheHandler::prepare_request('HTML::Mason::Ap
acheHandler=HASH(0xb722058)',
> 'Apache=SCALAR(0xbd3add8)') called at
>
/usr/local/lib/perl5/site_perl/5.8.8/HTML/Mason/ApacheHandle
r.pm line
> 823
>
HTML::Mason::ApacheHandler::handle_request('HTML::Mason::Apa
cheHandler=HASH(0xb722058)',
> 'Apache=SCALAR(0xbd3add8)') called at
> /usr/local/bricolage/lib/Bric/App/Handler.pm line 311
> eval {...} at
/usr/local/bricolage/lib/Bric/App/Handler.pm line 300
> Bric::App::Handler::handler('Apache=SCALAR(0xbd3add8)')
called at
> /dev/null line 0
> eval {...} at /dev/null line 0
>
> END DEBUGGING INFORMATION -->
>
> ******************************
> TEMPLATE CODE:
> ******************************
> <%perl>
> # use modules
> use XML::Writer;
> use MIME::Base64;
>
> # grab links from the story and push them onto related_stories
>
> my related_stories = ();
>
> foreach my $e ($element->get_elements) {
> if ($e->has_name("related_story")) {
> push related_stories, $e->get_related_story;
> }
> }
>
> # construct the feed tag writer
> my $feed_writer = new XML::Writer(DATA_MODE => 1,
NEWLINES => 0,
> ENCODING => 'ascii');
>
> # make initial declarations
> my $build_date = strftime( "%a, %d %b %Y %H:%M:%S
%Z", localtime() );
> $feed_writer->xmlDecl('utf-8');
> $feed_writer->startTag('affiliate_feed');
> $feed_writer->dataElement('lastBuildDate',
$build_date);
>
> # walk through each link to story and print that
story's data into the feed
>
> foreach my $item ( related_stories) {
> my $item_uri = "http://www.etonline.com
" . $item->get_uri;
> my $item_date = $item->get_cover_date("%a, %d
%b %Y %H:%M:%S %Z");
> my $item_desc = $item->get_description;
> my ($photo_uri, $video_uri, $photo_credit,
$photo_caption);
> $feed_writer->startTag('item');
>
$feed_writer->dataElement('title',$item->get_title);
> $feed_writer->dataElement('link',$item_uri);
> $feed_writer->dataElement('pubDate',$item_date);
>
$feed_writer->dataElement('description',$item_desc);
> foreach my $e ($item->get_elements) {
> if($e->has_name("paragraph")) {
>
$feed_writer->dataElement('paragraph',$e->get_data)
;
> }
> elsif ($e->has_name("related_photoset"))
{
> $photo_uri =
$m->comp("/util/get_image_uri.mc",
> related_photoset_subelement => $e, type =>
"lland");
> $photo_credit =
$m->comp("/util/get_image_credit.mc",
> related_photoset_subelement => $e, type =>
"lland");
> $photo_caption =
$e->get_data("caption");
> $feed_writer->dataElement('photo_uri',
$photo_uri);
> $feed_writer->dataElement('photo_credit',
> $photo_credit);
> $feed_writer->dataElement('photo_caption',
> $photo_caption);
> }
> elsif ($e->has_name("related_video"))
{ $video_uri =
> $m->comp(".related_video",
related_video_subelement => $e);
> $feed_writer->dataElement('video', $video_uri);
> }
> }
> $feed_writer->endTag('item');
> }
> $feed_writer->endTag('affiliate_feed');
> $feed_writer->end;
> </%perl>
> %
>
############################################################
##################
> <%def .related_video>
> <%args>
> $related_video_subelement
> </%args>
> <%perl>
> my $id =
$related_video_subelement->get_related_media->get_data
( "cbsid" );
> my $title =
$related_video_subelement->get_related_media->get_titl
e;
> $title =~ s/(["'/])/\$1/g;
> $title = encode_base64($title);
> my $title2 =
$related_video_subelement->get_related_media->get_titl
e;
> my $description =
>
$related_video_subelement->get_related_media->get_desc
ription;
> $description =~ s/(["'/])/\$1/g;
> $description = encode_base64($description);
> my $thumb =
$related_video_subelement->get_related_media->get_uri;
> my $video_url = "<a
>
href="javascript:popVideo('/popups/videopla
yer.html?thumb=$thumb&id=$id&title=$title&descri
ption=$description')">$title2</a>
;";
> return $video_url;
> </%perl>
> </%def>
> %
>
############################################################
##################
|
|
| Re: Strange template - trying to produce
some XML - previews, doesn't publish... |

|
2007-05-03 03:26:20 |
[CCed back to user list]
Does it happen with any other stories?
On Wed, 2 May 2007, John Durkin wrote:
> well, I've done it every way I can think to try - I
have a story with 3
> related stories. I preview that story with the UI, and
I get the preview
> window filled with my XML. Works fine. Then, when I
hit "check in and
> publish" from the UI, I get an error page that is
so crazy it breaks the
> whole UI and I have to relogin. I think this is
because the error is
> happening *after* the document has started processing
so the browser thinks
> it is reading XML but then it gets an HTML error page.
>
> On 5/2/07, Scott Lanning <lannings who.int> wrote:
>>
>> What the....XML? (That part might be not directly
related
>> to the error, but rather the error-handling in the
UI.)
>>
>> Could you more precisely describe
>> the part about "when I attempt to
publish" ?
>> Like to be able to reproduce it, the exact
sequence
>> of actions you took. Was there anything you deleted
before,
>> then you selected Publish and clicked Publish -
etc.
>>
>>
>> On Tue, 1 May 2007, John Durkin wrote:
>> > I have a template that takes a few stories
that are related to it and
>> > pulls info from them and then writes it out as
an xml file.
>> > It works fine in preview, but when I attempt
to publish I get a crazy
>> > error that doesn't even show the bric page
with the error, rather my
>> > browser thinks it's looking at an XML file and
so I get a yellow page
>> > that says this:
>> >
>> > XML Parsing Error: not well-formed
>> > Location: http://cms2.etonline.com/workflow/profile/story/47925
>> > Line Number 111, Column 5:HTTP/1.1 302 Found
>> > ----^
>> >
>> > I've pasted my template code at the end.
Viewing the source of that
>> > page I find this:
>> >
>> > <!-- DEBUGGING INFORMATION.
>> >
>> > Error: Can't call method
"get_id" on an undefined value
>> > at
/usr/local/bricolage/lib/Bric/App/Callback/ContainerProf.pm
line
>> > 757, <GEN33> line 68.
>> >
>> >
>> > Fault Class: Bric::Util::Fault
>> > Description: Bricolage Exception
>> > Timestamp: 2007-05-01 16:45:51.000000
>> > Package: Bric::App::Handler
>> > Filename:
/usr/local/bricolage/lib/Bric/App/Handler.pm
>> > Line: 386
>> > Payload:
>> >
>> > STACK:
>> >
>> > Trace begun at
/usr/local/bricolage/lib/Bric/App/Handler.pm line 386
>> >
Bric::App::Handler::cb_exception_handler('Can't call method
"get_id"
>> > on an undefined value at
>> >
/usr/local/bricolage/lib/Bric/App/Callback/ContainerProf.pm
line 757,
>> > <GEN33> line 68.^J') called at
>> >
/usr/local/lib/perl5/site_perl/5.8.8/Params/CallbackRequest.
pm line
>> > 308
>> >
>>
Params::CallbackRequest::request('Params::CallbackRequest=HA
SH(0xa259508)',
>> > 'HASH(0xb2039d0)', 'apache_req',
'Apache::Request=SCALAR(0xbd58b30)')
>> > called at
>>
/usr/local/lib/perl5/site_perl/5.8.8/MasonX/Interp/WithCallb
acks.pm
>> > line 115
>> >
>>
MasonX::Interp::WithCallbacks::make_request('MasonX::Interp:
:WithCallbacks=HASH(0xb722160)',
>> > 'comp', '/workflow/profile/story/47925',
'args', 'ARRAY(0xbd59a18)',
>> > 'ah',
'HTML::Mason::ApacheHandler=HASH(0xb722058)', 'apache_req',
>> > 'Apache::Request=SCALAR(0xbd58b30)') called
at
>> >
/usr/local/lib/perl5/site_perl/5.8.8/HTML/Mason/ApacheHandle
r.pm line
>> > 869
>> > eval {...} at
>> >
/usr/local/lib/perl5/site_perl/5.8.8/HTML/Mason/ApacheHandle
r.pm
>> > line 868
>> >
>>
HTML::Mason::ApacheHandler::prepare_request('HTML::Mason::Ap
acheHandler=HASH(0xb722058)',
>> > 'Apache=SCALAR(0xbd3add8)') called at
>> >
/usr/local/lib/perl5/site_perl/5.8.8/HTML/Mason/ApacheHandle
r.pm line
>> > 823
>> >
>>
HTML::Mason::ApacheHandler::handle_request('HTML::Mason::Apa
cheHandler=HASH(0xb722058)',
>> > 'Apache=SCALAR(0xbd3add8)') called at
>> > /usr/local/bricolage/lib/Bric/App/Handler.pm
line 311
>> > eval {...} at
/usr/local/bricolage/lib/Bric/App/Handler.pm line 300
>> >
Bric::App::Handler::handler('Apache=SCALAR(0xbd3add8)')
called at
>> > /dev/null line 0
>> > eval {...} at /dev/null line 0
>> >
>> > END DEBUGGING INFORMATION -->
>> >
>> > ******************************
>> > TEMPLATE CODE:
>> > ******************************
>> > <%perl>
>> > # use modules
>> > use XML::Writer;
>> > use MIME::Base64;
>> >
>> > # grab links from the story and push them onto
related_stories
>> >
>> > my related_stories = ();
>> >
>> > foreach my $e ($element->get_elements) {
>> > if
($e->has_name("related_story")) {
>> > push related_stories,
$e->get_related_story;
>> > }
>> > }
>> >
>> > # construct the feed tag writer
>> > my $feed_writer = new XML::Writer(DATA_MODE
=> 1, NEWLINES => 0,
>> > ENCODING => 'ascii');
>> >
>> > # make initial declarations
>> > my $build_date = strftime( "%a, %d %b %Y
%H:%M:%S %Z", localtime() );
>> > $feed_writer->xmlDecl('utf-8');
>> > $feed_writer->startTag('affiliate_feed');
>> > $feed_writer->dataElement('lastBuildDate',
$build_date);
>> >
>> > # walk through each link to story and print
that story's data into the
>> feed
>> >
>> > foreach my $item ( related_stories) {
>> > my $item_uri = "http://www.etonline.com
" . $item->get_uri;
>> > my $item_date =
$item->get_cover_date("%a, %d %b %Y %H:%M:%S
%Z");
>> > my $item_desc =
$item->get_description;
>> > my ($photo_uri, $video_uri,
$photo_credit, $photo_caption);
>> > $feed_writer->startTag('item');
>> >
$feed_writer->dataElement('title',$item->get_title);
>> >
$feed_writer->dataElement('link',$item_uri);
>> >
$feed_writer->dataElement('pubDate',$item_date);
>> >
$feed_writer->dataElement('description',$item_desc);
>> > foreach my $e ($item->get_elements)
{
>> >
if($e->has_name("paragraph")) {
>> >
>>
$feed_writer->dataElement('paragraph',$e->get_data);
>> > }
>> > elsif
($e->has_name("related_photoset")) {
>> > $photo_uri =
$m->comp("/util/get_image_uri.mc",
>> > related_photoset_subelement => $e, type
=> "lland");
>> > $photo_credit =
>> $m->comp("/util/get_image_credit.mc",
>> > related_photoset_subelement => $e, type
=> "lland");
>> > $photo_caption =
$e->get_data("caption");
>> >
$feed_writer->dataElement('photo_uri',
>> $photo_uri);
>> >
$feed_writer->dataElement('photo_credit',
>> > $photo_credit);
>> >
$feed_writer->dataElement('photo_caption',
>> > $photo_caption);
>> > }
>> > elsif
($e->has_name("related_video")) {
$video_uri
>> =
>> > $m->comp(".related_video",
related_video_subelement => $e);
>> >
$feed_writer->dataElement('video', $video_uri);
>> > }
>> > }
>> > $feed_writer->endTag('item');
>> > }
>> > $feed_writer->endTag('affiliate_feed');
>> > $feed_writer->end;
>> > </%perl>
>> > %
>> >
>>
############################################################
##################
>> > <%def .related_video>
>> > <%args>
>> > $related_video_subelement
>> > </%args>
>> > <%perl>
>> > my $id =
$related_video_subelement->get_related_media->get_data
( "cbsid"
>> );
>> > my $title =
$related_video_subelement->get_related_media->get_titl
e;
>> > $title =~ s/(["'/])/\$1/g;
>> > $title = encode_base64($title);
>> > my $title2 =
$related_video_subelement->get_related_media->get_titl
e;
>> > my $description =
>> >
$related_video_subelement->get_related_media->get_desc
ription;
>> > $description =~ s/(["'/])/\$1/g;
>> > $description = encode_base64($description);
>> > my $thumb =
$related_video_subelement->get_related_media->get_uri;
>> > my $video_url = "<a
>> >
>>
href="javascript:popVideo('/popups/videopla
yer.html?thumb=$thumb&id=$id&title=$title&descri
ption=$description')">$title2</a>
;";
>> > return $video_url;
>> > </%perl>
>> > </%def>
>> > %
>> >
>>
############################################################
##################
>>
>
|
|
| Re: Strange template - trying to produce
some XML - previews, doesn't publish... |

|
2007-05-03 03:28:09 |
[CCed back to user list]
I haven't seen anything like that, but I haven't used 1.10
yet.
I assume it's 1.10.2?
On Wed, 2 May 2007, John Durkin wrote:
> Also - if I try to publish cmd line i get this:
>
> workflow publish: Calling Workflow->publish with
ids: story_id => 47925
> TRANSPORT ERROR: 200 Assumed OK
> Check the Apache error log for more information.
>
> The Apache error log says:
>
> NOTHING!!!!
>
> so - still confused...
>
> JD
>
> On 5/2/07, John Durkin <john.durkin gmail.com> wrote:
>>
>> well, I've done it every way I can think to try - I
have a story with 3
>> related stories. I preview that story with the UI,
and I get the preview
>> window filled with my XML. Works fine. Then, when
I hit "check in and
>> publish" from the UI, I get an error page that
is so crazy it breaks the
>> whole UI and I have to relogin. I think this is
because the error is
>> happening *after* the document has started
processing so the browser thinks
>> it is reading XML but then it gets an HTML error
page.
>>
>> On 5/2/07, Scott Lanning <lannings who.int> wrote:
>> >
>> > What the....XML? (That part might be not
directly related
>> > to the error, but rather the error-handling in
the UI.)
>> >
>> > Could you more precisely describe
>> > the part about "when I attempt to
publish" ?
>> > Like to be able to reproduce it, the exact
sequence
>> > of actions you took. Was there anything you
deleted before,
>> > then you selected Publish and clicked Publish
- etc.
>> >
>> >
>> > On Tue, 1 May 2007, John Durkin wrote:
>> > > I have a template that takes a few
stories that are related to it and
>> > > pulls info from them and then writes it
out as an xml file.
>> > > It works fine in preview, but when I
attempt to publish I get a crazy
>> > > error that doesn't even show the bric
page with the error, rather my
>> > > browser thinks it's looking at an XML
file and so I get a yellow page
>> > > that says this:
>> > >
>> > > XML Parsing Error: not well-formed
>> > > Location: http://cms2.etonline.com/workflow/profile/story/47925
>> > > Line Number 111, Column 5:HTTP/1.1 302
Found
>> > > ----^
>> > >
>> > > I've pasted my template code at the end.
Viewing the source of that
>> > > page I find this:
>> > >
>> > > <!-- DEBUGGING INFORMATION.
>> > >
>> > > Error: Can't call method
"get_id" on an undefined value
>> > > at
/usr/local/bricolage/lib/Bric/App/Callback/ContainerProf.pm
line
>> > > 757, <GEN33> line 68.
>> > >
>> > >
>> > > Fault Class: Bric::Util::Fault
>> > > Description: Bricolage Exception
>> > > Timestamp: 2007-05-01
16:45:51.000000
>> > > Package: Bric::App::Handler
>> > > Filename:
/usr/local/bricolage/lib/Bric/App/Handler.pm
>> > > Line: 386
>> > > Payload:
>> > >
>> > > STACK:
>> > >
>> > > Trace begun at
/usr/local/bricolage/lib/Bric/App/Handler.pm line 386
>> > >
Bric::App::Handler::cb_exception_handler('Can't call method
"get_id"
>> > > on an undefined value at
>> > >
/usr/local/bricolage/lib/Bric/App/Callback/ContainerProf.pm
line 757,
>> > > <GEN33> line 68.^J') called at
>> > >
/usr/local/lib/perl5/site_perl/5.8.8/Params/CallbackRequest.
pm line
>> > > 308
>> > >
>> >
>>
Params::CallbackRequest::request('Params::CallbackRequest=HA
SH(0xa259508)',
>> > > 'HASH(0xb2039d0)', 'apache_req',
'Apache::Request=SCALAR(0xbd58b30)')
>> > > called at
>> >
/usr/local/lib/perl5/site_perl/5.8.8/MasonX/Interp/WithCallb
acks.pm
>> > > line 115
>> > >
>> >
>>
MasonX::Interp::WithCallbacks::make_request('MasonX::Interp:
:WithCallbacks=HASH(0xb722160)',
>> > > 'comp', '/workflow/profile/story/47925',
'args', 'ARRAY(0xbd59a18)',
>> > > 'ah',
'HTML::Mason::ApacheHandler=HASH(0xb722058)', 'apache_req',
>> > > 'Apache::Request=SCALAR(0xbd58b30)')
called at
>> > >
/usr/local/lib/perl5/site_perl/5.8.8/HTML/Mason/ApacheHandle
r.pm line
>> > > 869
>> > > eval {...} at
>> > >
/usr/local/lib/perl5/site_perl/5.8.8/HTML/Mason/ApacheHandle
r.pm
>> > > line 868
>> > >
>> >
>>
HTML::Mason::ApacheHandler::prepare_request('HTML::Mason::Ap
acheHandler=HASH(0xb722058)',
>> >
>> > > 'Apache=SCALAR(0xbd3add8)') called at
>> > >
/usr/local/lib/perl5/site_perl/5.8.8/HTML/Mason/ApacheHandle
r.pm line
>> > > 823
>> > >
>> >
>>
HTML::Mason::ApacheHandler::handle_request('HTML::Mason::Apa
cheHandler=HASH(0xb722058)',
>> >
>> > > 'Apache=SCALAR(0xbd3add8)') called at
>> > >
/usr/local/bricolage/lib/Bric/App/Handler.pm line 311
>> > > eval {...} at
/usr/local/bricolage/lib/Bric/App/Handler.pm line 300
>> > >
Bric::App::Handler::handler('Apache=SCALAR(0xbd3add8)')
called at
>> > > /dev/null line 0
>> > > eval {...} at /dev/null line 0
>> > >
>> > > END DEBUGGING INFORMATION -->
>> > >
>> > > ******************************
>> > > TEMPLATE CODE:
>> > > ******************************
>> > > <%perl>
>> > > # use modules
>> > > use XML::Writer;
>> > > use MIME::Base64;
>> > >
>> > > # grab links from the story and push them
onto related_stories
>> > >
>> > > my related_stories = ();
>> > >
>> > > foreach my $e ($element->get_elements)
{
>> > > if
($e->has_name("related_story")) {
>> > > push related_stories,
$e->get_related_story;
>> > > }
>> > > }
>> > >
>> > > # construct the feed tag writer
>> > > my $feed_writer = new
XML::Writer(DATA_MODE => 1, NEWLINES => 0,
>> > > ENCODING => 'ascii');
>> > >
>> > > # make initial declarations
>> > > my $build_date = strftime( "%a, %d
%b %Y %H:%M:%S %Z", localtime() );
>> > > $feed_writer->xmlDecl('utf-8');
>> > >
$feed_writer->startTag('affiliate_feed');
>> > >
$feed_writer->dataElement('lastBuildDate', $build_date);
>> > >
>> > > # walk through each link to story and
print that story's data into the
>> > feed
>> > >
>> > > foreach my $item ( related_stories) {
>> > > my $item_uri = "http://www.etonline.com
" . $item->get_uri;
>> > > my $item_date =
$item->get_cover_date("%a, %d %b %Y %H:%M:%S
>> > %Z");
>> > > my $item_desc =
$item->get_description;
>> > > my ($photo_uri, $video_uri,
$photo_credit, $photo_caption);
>> > > $feed_writer->startTag('item');
>> > >
$feed_writer->dataElement('title',$item->get_title);
>> > >
$feed_writer->dataElement('link',$item_uri);
>> > >
$feed_writer->dataElement('pubDate',$item_date);
>> > >
$feed_writer->dataElement('description',$item_desc);
>> > > foreach my $e
($item->get_elements) {
>> > >
if($e->has_name("paragraph")) {
>> > >
>> >
$feed_writer->dataElement('paragraph',$e->get_data);
>> > > }
>> > > elsif
($e->has_name("related_photoset")) {
>> > > $photo_uri =
$m->comp("/util/get_image_uri.mc",
>> > > related_photoset_subelement => $e,
type => "lland");
>> > > $photo_credit =
>> >
$m->comp("/util/get_image_credit.mc",
>> > > related_photoset_subelement => $e,
type => "lland");
>> > > $photo_caption =
$e->get_data("caption");
>> > >
$feed_writer->dataElement('photo_uri',
>> > $photo_uri);
>> > >
$feed_writer->dataElement('photo_credit',
>> > > $photo_credit);
>> > >
$feed_writer->dataElement('photo_caption',
>> > > $photo_caption);
>> > > }
>> > > elsif
($e->has_name("related_video")) {
>> > $video_uri =
>> > > $m->comp(".related_video",
related_video_subelement => $e);
>> > >
$feed_writer->dataElement('video', $video_uri);
>> > > }
>> > > }
>> > > $feed_writer->endTag('item');
>> > > }
>> > >
$feed_writer->endTag('affiliate_feed');
>> > > $feed_writer->end;
>> > > </%perl>
>> > > %
>> > >
>> >
>>
############################################################
##################
>> > > <%def .related_video>
>> > > <%args>
>> > > $related_video_subelement
>> > > </%args>
>> > > <%perl>
>> > > my $id =
$related_video_subelement->get_related_media->get_data
(
>> > "cbsid" );
>> > > my $title =
$related_video_subelement->get_related_media->get_titl
e;
>> > > $title =~ s/(["'/])/\$1/g;
>> > > $title = encode_base64($title);
>> > > my $title2 =
$related_video_subelement->get_related_media->get_titl
e;
>> > > my $description =
>> > >
$related_video_subelement->get_related_media->get_desc
ription;
>> > > $description =~ s/(["'/])/\$1/g;
>> > > $description =
encode_base64($description);
>> > > my $thumb =
$related_video_subelement->get_related_media->get_uri;
>> > > my $video_url = "<a
>> > >
>> >
>>
href="javascript:popVideo('/popups/videopla
yer.html?thumb=$thumb&id=$id&title=$title&descri
ption=$description')">$title2</a>
;";
>> > > return $video_url;
>> > > </%perl>
>> > > </%def>
>> > > %
>> > >
>> >
>>
############################################################
##################
>> >
>>
>>
>
|
|
| RE: Strange template - trying to produce
some XML - previews, doesn't publish... |

|
2007-05-03 08:02:13 |
Your comment about the error occurring after processing has
started seems like a reasonable assumption given the
symptoms of the problem.
I'm assuming you have tried to redeploy your template? If
not, do that first.
Otherwise, I would start an iterative process aimed at
identifying the specific line of code in your template that
is leading to the exception:
1) Comment out some lines in your template
2) Redeploy template so it is active in publish mode
3) Verify that the error still occurs
>[CCed back to user list]
>I haven't seen anything like that, but I haven't used
1.10 yet.
>I assume it's 1.10.2?
On Wed, 2 May 2007, John Durkin wrote:
> Also - if I try to publish cmd line i get this:
>
> workflow publish: Calling Workflow->publish with
ids: story_id => 47925
> TRANSPORT ERROR: 200 Assumed OK
> Check the Apache error log for more information.
>
> The Apache error log says:
>
> NOTHING!!!!
>
> so - still confused...
>
> JD
>
> On 5/2/07, John Durkin <john.durkin gmail.com> wrote:
>>
>> well, I've done it every way I can think to try - I
have a story with 3
>> related stories. I preview that story with the UI,
and I get the preview
>> window filled with my XML. Works fine. Then, when
I hit "check in and
>> publish" from the UI, I get an error page that
is so crazy it breaks the
>> whole UI and I have to relogin. I think this is
because the error is
>> happening *after* the document has started
processing so the browser thinks
>> it is reading XML but then it gets an HTML error
page.
|
|
| Re: Strange template - trying to produce
some XML - previews, doesn't publish... |

|
2007-05-06 23:28:11 |
> On Wed, 2 May 2007, John Durkin wrote:
>> well, I've done it every way I can think to try - I
have a story
>> with 3
>> related stories. I preview that story with the UI,
and I get the
>> preview
>> window filled with my XML. Works fine. Then, when
I hit "check
>> in and
>> publish" from the UI, I get an error page that
is so crazy it
>> breaks the
>> whole UI and I have to relogin. I think this is
because the error is
>> happening *after* the document has started
processing so the
>> browser thinks
>> it is reading XML but then it gets an HTML error
page.
Do you have the XML Validation action on publish?
Best,
David
|
|
| Re: Strange template - trying to produce
some XML - previews, doesn't publish... |

|
2007-05-14 12:53:40 |
Hi David W. and David B.,
I'm not sure what you mean by "Do you have the XML
Validation action on
publish?"... I'm assuming that is a setting but I can't
find it in
bricolage.conf... Below are my XML::Writer settings from
bricolage.conf. I
took the declaration out of my template (use XML::Writer)
and I took all the
options out when creating the writer object so that it uses
the options set
by XML::Writer settings in bricolage.conf. Still having
same problem. I
comment out all the lines that use the xml writer to write
anything, and
then I get a normal check in and publish behaviour. It's
just if I use the
xml writer at all to write anything, it starts writing it
onto the page that
would normally be a bric interface page rather than writing
to the file I'm
trying to publish.
BURN_ROOT = /usr/local/bricolage/data/burn
INCLUDE_XML_WRITER = Yes
XML_WRITER_ARGS = NEWLINES => 1, UNSAFE => 1,
DATA_MODE => 1,
DATA_INDENT => 4
# MASON_INTERP_ARGS =
# TT_OPTIONS = PRE_CHOMP => 1, POST_CHOMP
=> 1, TRIM => 1
On 5/6/07, David E. Wheeler < david kineticode.com> wrote:
>
> > On Wed, 2 May 2007, John Durkin wrote:
> >> well, I've done it every way I can think to
try - I have a story
> >> with 3
> >> related stories. I preview that story with
the UI, and I get the
> >> preview
> >> window filled with my XML. Works fine. Then,
when I hit "check
> >> in and
> >> publish" from the UI, I get an error page
that is so crazy it
> >> breaks the
> >> whole UI and I have to relogin. I think this
is because the error is
> >> happening *after* the document has started
processing so the
> >> browser thinks
> >> it is reading XML but then it gets an HTML
error page.
>
> Do you have the XML Validation action on publish?
>
> Best,
>
> David
>
>
|
|
| Re: Strange template - trying to produce
some XML - previews, doesn't publish... |

|
2007-05-14 13:15:28 |
On May 14, 2007, at 10:53, John Durkin wrote:
> I'm not sure what you mean by "Do you have the XML
Validation
> action on
> publish?"... I'm assuming that is a setting but I
can't find it in
> bricolage.conf...
No, it's a distribution action. Look at the Action settings
for the
destination in the UI. There should be as least one,
"Move", but if
you also have "Validate XML" (or something like
that, don't remember
the exact name), it could be causing the problems. It will
throw an
exception if a file is not valid XML.
Best,
David
|
|
[1-8]
|
|