RE: [Catalyst] Extra characters inserted into PDF output

2008-12-02 Thread Supra, Morne
Hi all

I only saw this post now, so maybe what I am about to say has already
been said:

The 


So, maybe there is something commented out in the input?

Regards
Morne

-Original Message-
From: Hu Hailin [mailto:[EMAIL PROTECTED] 
Sent: 03 December 2008 09:01 AM
To: The elegant MVC web framework
Subject: Re: [Catalyst] Extra characters inserted into PDF output

maybe the problem is caused by

1. some plugin involved, like some kind of content rewriting.
2. process in the end method, maybe you missed checking it.

On Wed, Dec 3, 2008 at 12:41 PM, Dr. Jennifer Nussbaum
<[EMAIL PROTECTED]> wrote:
>
> --- On Tue, 12/2/08, Steve Sabljak <[EMAIL PROTECTED]> wrote:
>
>> From: Steve Sabljak <[EMAIL PROTECTED]>
>> Subject: Re: [Catalyst] Extra characters inserted into PDF output
>> To: "The elegant MVC web framework" 
>> Date: Tuesday, December 2, 2008, 6:30 PM
>> On Wed, Dec 3, 2008 at 5:25 AM, Dr. Jennifer Nussbaum
>> <[EMAIL PROTECTED]> wrote:
>> > --- On Tue, 12/2/08, Robin Berjon
>> <[EMAIL PROTECTED]> wrote:
>> >
>> >> From: Robin Berjon <[EMAIL PROTECTED]>
>> >> Subject: Re: [Catalyst] Extra characters inserted
>> into PDF output
>> >> To: [EMAIL PROTECTED], "The elegant MVC web
>> framework" 
>> >> Date: Tuesday, December 2, 2008, 8:57 AM
>> >> On Dec 2, 2008, at 17:02 , Dr. Jennifer Nussbaum
>> wrote:
>> >> > My PDF files are being uploaded and saved in
>> the
>> >> database apparently correctly. Then what seems to
>> be
>> >> happening is that somewhere in the binary stream
>> of PDF,
>> >> there is a (random) sequence of "> and
>> >> somewhere later there is a ">". And
>> something
>> >> is inserting a "--" before the
>> ">".
>> >> >
>> >> > My debugging statements show that Catalyst is
>> >> outputting the correct size of the file, which
>> suggests that
>> >> the insertion is happening elsewhere.
>> >>
>> >> The one thing you're not saying is under what
>> Catalyst
>> >> is running when it's producing that. Are you
>> running
>> >> FastCGI? Mod_perl? Stand-alone development server?
>> >
>> > This happens both under the standalone server and
>> under Apache/mod_perl.
>> >
>> >> If it happens in all of those then the bug is
>> probably in
>> >> your code (though after your debugging
>> statements).
>> >
>> > Ive shown all the code for the view, so you can see
>> anything that happens after the debugging
>> >
>> >> If the
>> >> insertion is indeed happening outside that pretty
>> much just
>> >> leaves the Web server, or perhaps a proxy. Wild
>> stab in the
>> >> dark: do you happen to have SSI turned on?
>> >
>> > Yes, but only on the actual server. My dev box running
>> the standalone server isnt doing any SSI's.
>> >
>> > This is baffling.
>> >
>> > Jen
>> >
>>
>> So, if you use (literally)
>>
>> $c->res->output('XX');
>>
>> does it output 'XX'?
>> (you might want to change the content-type to text/plain
>> for this test
>> if testing with a browser)
>
> I dont know if this was a rhetorical question designed to show how
stupid i am, or a real question, but the answer is "yes". Or, rather, if
I change my output routine to
>
> $c->res->output('XX');
$c->res->content_type('text/plain');
>
> Then what i get in my browser is:
>
> XX
>
> Where does this leave me? WHY is this happening?
>
> Jen
>
>
>
>
>
>
> ___
> 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/
>



-- 
islue

___
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/
To read FirstRand Bank's Disclaimer for this email click on the following 
address or copy into your Internet browser: 
https://www.fnb.co.za/disclaimer.html 

If you are unable to access the Disclaimer, send a blank e-mail to
[EMAIL PROTECTED] and we will send you a copy of the Disclaimer.

___
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] Pushing data to Catalyst powered web page

2008-09-18 Thread Supra, Morne
Hi all

I did the following to get data to push to the web page:

Scenario:
An RFID tag is read and processed by an ALE server. The ALE server then
sends the data to my Catalyst URL:
http://x.x.x.x:3000/ale/notifier?tagdata

The ale/notifier action then extracts the tag id from the variable and
then does a lookup in a database to get the data associated to the tag.
It then puts the tag data in a queue and the last action is to make a
socket connection, as a client, to a socket server running inside the
/assettracker/display_tagdata action. The following code is an extract
from the ale/notifier:

sub notify_tag_read {
use IO::Socket::INET;
my $MySocket=new
IO::Socket::INET->new(PeerPort=>26482,Proto=>'udp',PeerAddr=>'x.x.x.x');
my $msg = "";
$MySocket->send($msg);
}

When I access, via a browser, the url
http://x.x.x.x:3000/assettracker/display_tagdata
it loads a socket server and waits for a connection from a client. The
following is a snippet of the /assettracker/display_tagdata action:

sub display_tagdata : Local {
my ( $self, $c ) = @_;
my $text;
my @args;
$c->stash->{template} = 'sockettest.tt2';

use IO::Socket::INET;

my $MySocket=new
IO::Socket::INET->new(LocalPort=>26482,Proto=>'udp',Reuse=>1);

$MySocket->recv($text,128);
@args = [$text];
$c->forward('get_tagdata',[EMAIL PROTECTED]);

}

This action will then forward to /assettracker/get_data to retrieve the
data from the queue and display it in the browser.

I know that the code is not great, but it works. Thank you for all the
assistance that I received.

Regards
Morne

-Original Message-
From: Bill Moseley [mailto:[EMAIL PROTECTED] 
Sent: 12 September 2008 09:46 PM
To: The elegant MVC web framework
Subject: Re: [Catalyst] Pushing data to Catalyst powered web page

On Fri, Sep 12, 2008 at 02:15:23PM +0200, Supra, Morne wrote:
> 
> The problem that I have is that I have no idea how to push the data to
a
> web page instead of pulling.

Pull with an AJAX update, perhaps.

-- 
Bill Moseley
[EMAIL PROTECTED]
Sent from my iMutt


___
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/
To read FirstRand Bank's Disclaimer for this email click on the following 
address or copy into your Internet browser: 
https://www.fnb.co.za/disclaimer.html 

If you are unable to access the Disclaimer, send a blank e-mail to
[EMAIL PROTECTED] and we will send you a copy of the Disclaimer.

___
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] Pushing data to Catalyst powered web page

2008-09-14 Thread Supra, Morne
Morning to everybody that has assisted so far.

I have not been able to resolve the problem yet, most likely because I
did not explain my issue correctly.

I think that I require some kind of publish and subscribe solution for
this. I really want to use Catalyst as far as possible, as it has really
been useful in other projects.

I need my "view tag data" page to subscribe to a publisher. When the
publisher receives new tag data it should push it to the subscriber so
the subscriber can then show it on its page automagically.

Regards
Morne

-Original Message-
From: cranky [mailto:[EMAIL PROTECTED] 
Sent: 12 September 2008 02:41 PM
To: catalyst@lists.scsys.co.uk
Subject: Re: [Catalyst] Pushing data to Catalyst powered web page




Supra, Morne wrote:
> 
> 
> sub notifier : Private {
>   my ( $self, $c ) = @_;
>   
>   #$c->stash->{template} = 'notifier.tt2';
>   $c->stash->{tagdata} = $c->request->params->{tagdata};
>   open (TagData, '>C:\Eclipse Projects\Asset
> Tracker\AssetTracker\lib\AssetTracker\tagdata.txt');
>   print TagData $c->request->params->{tagdata};
>   close TagData;
>   
> }
> 
> As you can see I do not get the associated tag data yet, I am just
> trying to display the tag data received from the ALE server.
> 
> I can see that the data is coming through correctly by monitoring the
> console debug and checking the tagdata.txt file.
> 
> The problem that I have is that I have no idea how to push the data to
a
> web page instead of pulling.
> 
> I have tried using catalyst redirect, forward and subrequest with no
> luck.
> 
> I am not a hard core developer, so any assistance will be greatly
> appreciated.
> 
> Regards
> Morne Supra 
> 
> 

If you want an upload of your data (i.e., tagdata.txt) to a web page,
then I
think its nothing to do with catalyst. Use the LWP module where you can
POST
file to a web page. This link might help->
http://lwp.interglacial.com/ch05_07.htm

-- 
View this message in context:
http://www.nabble.com/Pushing-data-to-Catalyst-powered-web-page-tp194547
67p19454995.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/
To read FirstRand Bank's Disclaimer for this email click on the following 
address or copy into your Internet browser: 
https://www.fnb.co.za/disclaimer.html 

If you are unable to access the Disclaimer, send a blank e-mail to
[EMAIL PROTECTED] and we will send you a copy of the Disclaimer.

___
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] Pushing data to Catalyst powered web page

2008-09-12 Thread Supra, Morne
Good afternoon all

I am busy with a project where I need to read an RFID tag, get the data
associated with the tag and then push the data to a web page for a
security person to monitor.

I can successfully read the tag by using LogicAlloy's ALE server. It
then calls my Catalyst application at http://localhost/ale/notifier :

sub notifier : Private {
my ( $self, $c ) = @_;

#$c->stash->{template} = 'notifier.tt2';
$c->stash->{tagdata} = $c->request->params->{tagdata};
open (TagData, '>C:\Eclipse Projects\Asset
Tracker\AssetTracker\lib\AssetTracker\tagdata.txt');
print TagData $c->request->params->{tagdata};
close TagData;

}

As you can see I do not get the associated tag data yet, I am just
trying to display the tag data received from the ALE server.

I can see that the data is coming through correctly by monitoring the
console debug and checking the tagdata.txt file.

The problem that I have is that I have no idea how to push the data to a
web page instead of pulling.

I have tried using catalyst redirect, forward and subrequest with no
luck.

I am not a hard core developer, so any assistance will be greatly
appreciated.

Regards
Morne Supra 

To read FirstRand Bank's Disclaimer for this email click on the following 
address or copy into your Internet browser: 
https://www.fnb.co.za/disclaimer.html 

If you are unable to access the Disclaimer, send a blank e-mail to
[EMAIL PROTECTED] and we will send you a copy of the Disclaimer.

___
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/