AMF-Perl

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

AMF::Perl::IO::InputStream
Improved the check in readDouble to append "0" to the string instead of skipping
the value. Otherwise the number 16 did not go through.
Added defined($thisByte) in readInt, otherwise the character "0" (say, in string length of 30)
did not go through.

Examples / Basic 
Added a button that triggers an exception, thrown in DataEcho.pm

Examples / Petmarket
Fixed catalogservice.pm to not break when search string is not found.


0.12 Thu Apr 29 17:20:07 EDT 2004
AMF::Perl - changed "use Apache2" to "require Apache2".

0.11 Sat Apr 24 21:02:55 EDT 2004
Renamed to AMF::Perl

0.01  Sun Apr  6 16:02:18 2003
	- original version; created by h2xs 1.22 with options

MANIFEST  view on Meta::CPAN

doc/examples/sql/park.fla
doc/examples/sql/park.html
doc/examples/sql/park.swf
doc/examples/sql/park.sql
doc/examples/sql/park.pl
doc/examples/sql/parkservices/ParkService.pm
doc/examples/petmarket/README.txt
doc/examples/petmarket/petmarket.pl
doc/examples/petmarket/petmarket.sql
doc/examples/petmarket/petmarket/api/cartservice.pm
doc/examples/petmarket/petmarket/api/catalogservice.pm
doc/examples/petmarket/petmarket/api/dbConn.pm
doc/examples/petmarket/petmarket/api/orderservice.pm
doc/examples/petmarket/petmarket/api/stringresourcesservice.pm
doc/examples/petmarket/petmarket/api/userservice.pm
doc/updates.html
META.yml                                 Module meta-data (added by MakeMaker)

doc/examples/petmarket/petmarket/api/catalogservice.pm  view on Meta::CPAN

package petmarket::api::catalogservice;


# Copyright (c) 2003 by Vsevolod (Simon) Ilyushchenko. All rights reserved.
# This program is free software; you can redistribute it and/or modify it
# under the same terms as Perl itself.

#This is server side for the Macromedia's Petmarket example.
#See http://www.simonf.com/amfperl for more information.

use warnings;

doc/examples/petmarket/petmarket/api/stringresourcesservice.pm  view on Meta::CPAN

        $strings{"NUMBER_SYMBOL_str"}="-";
        $strings{"DATE_SEPARATOR_str"}="/";
        $strings{"ADDRESS_LBL_str"}="Address:";
        $strings{"CITY_LBL_str"}="City:";
        $strings{"STATE_LBL_str"}="State:";
        $strings{"ZIP_LBL_str"}="Zip / Postal Code:";
        $strings{"EMAIL_LBL_str"}="E-mail:";
        $strings{"PHONE_LBL_str"}="Phone:";
        $strings{"CC_NUMBER_LBL_str"}="Credit Card Number:";
        $strings{"CC_EXPIRATION_DATE_LBL_str"}="Expiration Date:";
        $strings{"PROFILE_FLDS_HINT_str"}="If you're a new customer, please provide your email address and a password in order to create your account.  Returning customers, log in using your email address and password.";
        $strings{"PROFILE_FLDS_LOGOUT_1_HINT_str"}="You are currently logged in with the E-mail address: ";
        $strings{"PROFILE_FLDS_LOGOUT_2_HINT_str"}="If this is not correct, you may log in to your existing account or create a new one.";
        $strings{"PROFILE_FLDS_LOGOUT_EDIT_LBL_str"}="Edit";
        $strings{"PASSWORD_LBL_str"}="Password:";
        $strings{"PASSWORD_CONFIRM_LBL_str"}="Confirm Password:";
        $strings{"CREATE_ACCOUNT_BTN_LBL_str"}="Create Account";
        $strings{"LOGIN_BTN_LBL_str"}="Login";
        $strings{"CONTINUE_BTN_LBL_str"}="Continue";
        $strings{"NEW_CUSTOMER_TRUE_RB_LBL_str"}="New Customer";
        $strings{"NEW_CUSTOMER_FALSE_RB_LBL_str"}="Returning Customer";
        $strings{"BILLING_FLDS_HINT_str"}="Please enter your billing address.";
        $strings{"SHIPPING_FLDS_HINT_str"}="Please enter your shipping address.";

doc/examples/petmarket/petmarket/api/stringresourcesservice.pm  view on Meta::CPAN

        $strings{"CHARGE_SUMMARY_SHIPPING_LBL_str"}="Shipping Charges:";
        $strings{"CHARGE_SUMMARY_TAX_LBL_str"}="Taxes:";
        $strings{"CHARGE_SUMMARY_GRAND_TOTAL_LBL_str"}="Total Charges:";
        $strings{"VALIDATE_EMAIL_ERR_TITLE_str"}="E-mail not valid";
        $strings{"VALIDATE_EMAIL_ERR_MSG_str"}="E-mail entered is not valid.\nPlease try again.";
        $strings{"VALIDATE_PASS_ERR_TITLE_str"}="Password invalid";
        $strings{"VALIDATE_PASS_MISMATCH_ERR_MSG_str"}="Passwords do not match.\nPlease try again.";
        $strings{"VALIDATE_PASS_INVALID_ERR_MSG_str"}="Invalid password.\nPlease try again.";
        $strings{"VALIDATE_CREATE_USER_FAILED_TITLE_str"}="Failed to create user";
        $strings{"VALIDATE_CREATE_USER_FAILED_MSG_str"}="An account using this E-mail address already exists.";
        $strings{"VALIDATE_LOGIN_USER_FAILED_TITLE_str"}="Failed to log in";
        $strings{"VALIDATE_LOGIN_USER_FAILED_MSG_str"}="Unable to log in.\nPlease check the E-mail address and password and try again.";
        $strings{"VALIDATE_FIRST_NAME_ERROR_MSG_str"}="Please type in your first name.";
        $strings{"VALIDATE_FIRST_NAME_ERROR_TITLE_str"}="Invalid first name";
        $strings{"VALIDATE_LAST_NAME_ERROR_MSG_STR"}="Please type in your last name.";
        $strings{"VALIDATE_LAST_NAME_ERROR_TITLE_STR"}="Invalid last name";
        $strings{"VALIDATE_ADDRESS_ERROR_MSG_str"}="Please type in an address.";
        $strings{"VALIDATE_ADDRESS_ERROR_TITLE_str"}="Invalid address";
        $strings{"VALIDATE_CITY_ERROR_MSG_str"}="Please type in a city.";
        $strings{"VALIDATE_CITY_ERROR_TITLE_str"}="Invalid city";
        $strings{"VALIDATE_ZIPCODE_ERROR_MSG_str"}="Please enter a valid 5 digit Zip code.";
        $strings{"VALIDATE_ZIPCODE_ERROR_TITLE_str"}="Invalid Zip code";

doc/examples/petmarket/petmarket/api/stringresourcesservice.pm  view on Meta::CPAN

    
    return \%bundle;
}

sub getAboutUsStrings()
{
    my ($self) = @_;
    
    my %strings;
    $strings{"HEAD_str"} = "ABOUT US";
    $strings{"BODY_HTML_str"} = "The Pet Market application illustrates how Macromedia MX products work together, and integrate with standard server technologies, to deliver a rich, dynamic Internet application.\n\nWith a demo, code samples, developm...
    $strings{"logoFrameLabel"} = "macr";
    $strings{"url"} = "http://www.macromedia.com";
    
    return \%strings;
}

sub getLegalStrings()
{
    my ($self) = @_;
    my %strings;
    $strings{"HEAD_str"} = "LEGAL INFORMATION";
    $strings{"BODY_HTML_str"} = "Copyright © 2001-2002 Macromedia, Inc.  All rights reserved.  Macromedia, the Macromedia logo, and Flash are trademarks or registered trademarks of Macromedia, Inc.\n \nMany of the images used in this experience were ...
    $strings{"logoFrameLabel"} = "macr";
    $strings{"url"} = "http://www.macromedia.com";
    
    return \%strings;
}


sub getAffiliateStrings()
{
    my ($self) = @_;
    my %strings;
    $strings{"HEAD_str"} = "SITE DESIGN";
    $strings{"BODY_HTML_str"} = "We chose Popular Front to design the Pet Market shopping experience because of their demonstrated ability to enhance user experiences with our technologies. Popular Front has created numerous award-winning solutions t...
    $strings{"logoFrameLabel"} = "PopularFront";
    $strings{"url"} = "http://www.popularfront.com";
    
    return \%strings;
}



1;

doc/examples/sql/park.sql  view on Meta::CPAN

INSERT INTO tblparks VALUES ('USS ARIZONA MEMORIAL','1 ARIZONA MEMORIAL PLACE','','','HONOLULU','HI','96818','808-422-2771','WESTERN REGION','Magee, Donald E.','','  /  /19','NATIONAL MEMORIAL');
INSERT INTO tblparks VALUES ('VALLEY FORGE NATIONAL HISTORICAL PARK','P.O. BOX 953','','','VALLEY FORGE','PA','19481-0953','215-783-1000','MID-ATLANTIC REGION','Beach, Warren D.','8:30 AM TO 5:00 PM','11/24/1982','NATIONAL HISTORICAL PARK');
INSERT INTO tblparks VALUES ('VANDERBILT MANSION NHS','249 ALBANY POST ROAD','','','HYDE PARK','NY','12538','914-229-9115','NORTH ATLANTIC REGION','Pearson, Duane R.','8:30 AM TO 5:00 PM','12/18/1940','NATIONAL HISTORICAL SITE');
INSERT INTO tblparks VALUES ('VICKSBURG NATIONAL MILITARY PARK','3201 CLAY STREET','','','VICKSBURG','MS','39180','601-636-0583','Southeast Region','Nichols, William O.','7:30 AM TO 4:30 PM','02-21-1899','National Military Park');
INSERT INTO tblparks VALUES ('VIRGIN ISLANDS NATIONAL PARK','6310 ESTATE NAZARETH #10','','','ST THOMAS','VI','00802-1102','809-775-6238','Southeast Region','PELTIER, FRANCIS A.','8:00 AM TO 5:00 PM','12/01/1956','National Park');
INSERT INTO tblparks VALUES ('VOYAGEURS NATIONAL PARK','3131 HIGHWAY 53','','','INTERNATIONAL FALLS','MN','56649-9701','218-283-9821','Midwest Region','SANDERS, JAMES A.','8:00 AM TO 4:30 PM','04/08/1975','National Park');
INSERT INTO tblparks VALUES ('WALNUT CANYON NATIONAL MONUMENT','WALNUT CANYON ROAD','','','FLAGSTAFF','AZ','86001','520-526-3367','Western Region','Henderson, Sam R.','8:00 AM TO 4:30 PM','11/30/1915','National Monument');
INSERT INTO tblparks VALUES ('WAR IN THE PACIFIC NHP','P.O. BOX FA','','','AGANA','GU','96910','671-477-9362','WESTERN REGION','WOOD, JR., EDWARD E.','7:00 AM TO 3:30 PM','08/18/1978','NATIONAL HISTORICAL PARK');
INSERT INTO tblparks VALUES ('WARREN G. HARDING MEMORIAL','C/O REGIONAL DIRECTOR','NATIONAL PARK SERVICE','1709 JACKSON STREET','OMAHA','NE','68102','','MIDWEST REGION','None','','  /  /19','MISCELLANEOUS');
INSERT INTO tblparks VALUES ('WEIR FARM NATIONAL HISTORIC SITE','NOD HILL ROAD','','','WILTON','CT','06897','','NORTH ATLANTIC REGION','OLSON, SARAH','','  /  /19',NULL);
INSERT INTO tblparks VALUES ('WESTERN ARCH & CONS CENTER','1415 N 6th AVENUE','','','TUCSON','AZ','85705-','520-670-6501','Western Region','MARTIN, CARLA','7:30 AM TO 4:30 PM','  /  /19','Service-Training-Archeological Ctr');
INSERT INTO tblparks VALUES ('WESTERN REGIONAL OFFICE','NATIONAL PARK SERVICE','600 HARRISON STREET','SUITE 600','SAN FRANCISCO','CA','94107-1372','415-744-3876','WESTERN REGION','Albright, Stanley T.','7:45 AM TO 4:15 PM','08/01/1937','REGIONAL OFFI...
INSERT INTO tblparks VALUES ('WHISKEYTOWN UNIT','','P.O. BOX 188','','WHISKEYTOWN','CA','96095','916-241-6584','WESTERN REGION','Foust, Ray C.','8:00 AM TO 4:30 PM','11/08/1965','NATIONAL RECREATION AREA');
INSERT INTO tblparks VALUES ('WHITE HOUSE','NATIONAL CAPITAL REGION','1100 OHIO DRIVE, S.W.','','WASHINGTON','DC','20242','202-485-9836','NATIONAL CAPITAL REGION','MC DANIEL, JAMES I.','7:45 AM TO 4:15 PM','08/10/1943','NATIONAL CAPITAL PARK');
INSERT INTO tblparks VALUES ('WHITE SANDS NATIONAL MONUMENT','P.O. BOX 458','','','ALAMOGORDO','NM','88310','505-479-6124','SOUTHWEST REGION','Ditmanson, Dennis L.','8:00 AM TO 4:30 PM','01/18/1933','NATIONAL MONUMENT');
INSERT INTO tblparks VALUES ('WHITMAN MISSION NATIONAL HISTORIC SITE','ROUTE 2, BOX 247','','','WALLA WALLA','WA','99362','509-522-6360','PACIFIC NORTHWEST REGION','DARBY, FRANCIS T.','8:00 AM TO 4:30 PM','01/20/1940','NATIONAL HISTORICAL SITE');
INSERT INTO tblparks VALUES ('WILLIAM HOWARD TAFT NHS','2038 AUBURN AVENUE','','','CINCINNATI','OH','45219','513-684-3262','Midwest Region','Kurt Topham','8:00 AM TO 4:30 PM','  /  /19','National Historical Site');
INSERT INTO tblparks VALUES ('WILLIAMSPORT PRES TRAINING CENTER','205 W. POTOMAC STREET','P.O. BOX 106','','WILLIAMSPORT','MD','21795','301-223-7872','HARPERS FERRY CENTER','MCGRATH, H. THOMAS, JR.','8:00 AM TO 4:30 PM','  /  /19','SERVICE/TRAINING/A...
INSERT INTO tblparks VALUES ('WILSON\'S CREEK NATIONAL BATTLEFIELD','6424 W. Farm Road 182','','','REPUBLIC','MO','65738-2662','417-732-2662','Midwest Region','BERG, MALCOLM J.','8:30 AM TO 5:00 PM','09/22/1972','National Battlefield');
INSERT INTO tblparks VALUES ('WIND CAVE NATIONAL PARK','RR #1, BOX 190 - WCNP','','','HOT SPRINGS','SD','57747-9430','605-745-4600','Rocky Mountain Region','Jimmy Taylor','8:00 AM TO 4:30 PM','01/09/1903','National Park');
INSERT INTO tblparks VALUES ('WOLF TRAP FARM PARK','FOR THE PERFORMING ARTS','1551 TRAP ROAD','','VIENNA','VA','22182-1643','703-255-1800','National Capital Region','WILT, RICHARD A.','8:30 AM TO 5:00 PM','  /  /19','Site for the Performing Arts');

doc/index.html  view on Meta::CPAN

of the server language. The client side uses ActionScript. <a
 href="code.html">This is what the code looks like.</a><br>
To build/export .swf files with Flash Remoting, you need to install
Flash Remoting MX Components for free at:<br>
http://www.macromedia.com/software/flashremoting/downloads/components/
<br>
This will install the scripts "NetServices.as" and "NetDebug.as" that are
used in the ActionScript.
      </p>
      <p>We think that it is very important for the Open Source
community to make this technology available in Perl and (why not?) in
Python as well. We set out to decode the protocol, but soon discovered
that <a href="http://amfphp.sourceforge.net/">PHP folks</a> beat us by a
month, so we simply rewrote their code in Perl.</p>
<p>We would like to hear the community feedback - the amount of time we
will put into this project will be proportional to the need for it.<br>
      <br>
<p>Please respond if you are interested either in using AMF::Perl or in
contributing to it.<br>
      <br>
      <br>

lib/AMF/Perl.pm  view on Meta::CPAN

=item Added modperl 1 support and (so far commented out) hypothetical modperl 2 support.

=back

=head2 Sun Mar  23 13:27:00 EST 2003

=over 4

=item Synching with AMF-PHP:

Added functions debugDir() and log() (debug() in PHP), added reading headers to service().
Added fromFile() to enable parsing traffic dumps.

=back
    
=cut

use Devel::StackTrace;
use Exception::Class ('AMFException');

# load the required system packagees

lib/AMF/Perl.pm  view on Meta::CPAN

    # open a handle to the file
    open (HANDLE, $filepath);
    # read the entire file contents
    my @contents = <HANDLE>;
    # close the file handle
    close HANDLE;
    # return the contents
    return join "", @contents;
}

sub log
{
    my ($self, $content) = @_;
    $self->_appendRawDataToFile ($self->debugDir."processing.txt",$content."\n");
}

1;
__END__



( run in 1.227 second using v1.01-cache-2.11-cpan-49f99fa48dc )