Changeset 53

Show
Ignore:
Timestamp:
02/17/06 17:29:33 (3 years ago)
Author:
miya
Message:

modify default.tt and AtomClient.pm

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • atom_client/trunk/lib/AtomClient.pm

    r49 r53  
    44use warnings; 
    55use My::XML::Atom::Client; 
    6  
    7 
    8 # Set flags and add plugins for the application 
    9 
    10 #         -Debug: activates the debug mode for very useful log messages 
    11 # Static::Simple: will serve static files from the application's root  
    12 # directory 
    13 
    14 use Catalyst qw/-Debug ConfigLoader Static::Simple Prototype/; 
     6use Catalyst qw/ConfigLoader Static::Simple Prototype/; 
    157 
    168our $VERSION = '0.01'; 
    179 
    18 # 
    19 # Start the application 
    20 # 
    2110__PACKAGE__->setup; 
    22  
    2311__PACKAGE__->config->{static}->{dirs} = [ qw(css img) ]; 
    2412 
    25 =head1 NAME 
    26  
    27 AtomClient - Catalyst based application 
    28  
    29 =head1 SYNOPSIS 
    30  
    31     script/atomclient_server.pl 
    32  
    33 =head1 DESCRIPTION 
    34  
    35 Catalyst based application. 
    36  
    37 =head1 METHODS 
    38  
    39 =cut 
    40  
    41 =head2 default 
    42  
    43 =cut 
    44  
    45 # 
    46 # Output a friendly welcome message 
    47 # 
    4813sub default : Private { 
    4914    my ( $self, $c ) = @_; 
     
    5318    my ( $self, $c ) = @_; 
    5419 
    55     my $resource_uri = $c->req->param('resource_uri'); 
     20    my %method_map = ( 
     21                  GET  => 'getFeed', 
     22                  POST => 'createEntry', 
     23              ); 
    5624 
     25    my $method = $method_map{$c->req->param('request_method')}; 
    5726    my $api = My::XML::Atom::Client->new; 
    5827    $api->username($c->req->param('username')); 
    5928    $api->password($c->req->param('password')); 
    6029 
    61     my ($feed, $request, $response) = $api->getFeed($resource_uri); 
     30    my ($feed, $request, $response) = $api->$method($c->req->param('resource_uri')); 
    6231 
    6332    ## リク゚スト冠
     
    7847} 
    7948 
    80  
    8149sub end : Private { 
    8250    my ( $self, $c ) = @_; 
     
    8553} 
    8654 
    87 # 
    88 # Uncomment and modify this end action after adding a View component 
    89 # 
    90 #=head2 end 
    91 # 
    92 #=cut 
    93 # 
    94 #sub end : Private { 
    95 #    my ( $self, $c ) = @_; 
    96 # 
    97 #    # Forward to View unless response body is already defined 
    98 #    $c->forward( $c->view('') ) unless $c->response->body; 
    99 #} 
    100  
    101 =head1 AUTHOR 
    102  
    103 Catalyst developer 
    104  
    105 =head1 LICENSE 
    106  
    107 This library is free software, you can redistribute it and/or modify 
    108 it under the same terms as Perl itself. 
    109  
    110 =cut 
    111  
    112551; 
  • atom_client/trunk/root/default.tt

    r52 r53  
    2626 
    2727<label>Request Method: </label> 
    28 <select name="request_medhot"> 
     28<select name="request_method"> 
    2929<option>GET</option> 
    3030<option>POST</option>