Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

jifty::manual::tutorialrest(3pm) [debian man page]

Jifty::Manual::TutorialRest(3pm)			User Contributed Perl Documentation			  Jifty::Manual::TutorialRest(3pm)

NAME
Jifty::Manual::TutorialRest - Web Services DESCRIPTION
This builds on Jifty::Manual::Tutorial, so make sure you have a running jifty that roughly resembles the step-by-step from there. SETUP
You must add this to your site_config.yml framework: Plugins: - REST: {} See Jifty::Plugin::REST. The commands assume that you have LWP installed with the GET alias. If not, you'll need to use the longhand lwp-request -m GET, or curl, or your browser. help Make sure it is working: $ GET http://localhost:8888/=/help Accessing resources: ... You should see some text describing the services, not html (that's longhand for 404.) Check the config and restart the server. GET
Just list the models. $ GET http://localhost:8888/=/model.yml --- - MyWeblog.Model.Post List the Post schema. $ GET http://localhost:8888/=/model/Post.yml --- body: label: Content name: body readable: 1 sort_order: 1 type: text writable: 1 id: mandatory: 1 name: id readable: 1 type: serial writable: 0 title: default: Untitled post label: Title name: title readable: 1 sort_order: 0 type: text writable: 1 You did make some posts, right? $ GET http://localhost:8888/=/model/Post/id.yml --- - 1 - 2 Dump the data: $ GET http://localhost:8888/=/model/Post/id/1.yml --- body: 'This is my post, the content of which is this, which is mine.' id: 1 title: my first post $ GET http://localhost:8888/=/model/Post/id/2.yml --- body: "Content of another post. Got to go, the cat's on fire." id: 2 title: post deux POST
TODO not working Actually, it looks like it is not supposed to work this way. Why not? $ echo '--- body: "A post via web services" id: 3 title: "posting from the command-line" ' | lwp-request -m POST http://localhost:8888/=/model/Post.yml POST http://localhost:8888/=/model/Post/id/3.yml --> 404 Not Found PUT
TODO not working $ echo '--- title: "posting from the cli" ' | lwp-request -m PUT http://localhost:8888/=/model/Post/3.yml 500 Can't read entity body: Connection reset by peer DELETE
$ lwp-request -m DELETE http://localhost:8888/=/model/Post/id/3.yml --- content: {} error: ~ field_errors: {} field_warnings: {} message: Deleted success: 1 perl v5.14.2 2010-09-25 Jifty::Manual::TutorialRest(3pm)

Check Out this Related Man Page

Jifty::Plugin::Chart::Renderer(3pm)			User Contributed Perl Documentation		       Jifty::Plugin::Chart::Renderer(3pm)

NAME
Jifty::Plugin::Chart::Renderer - Base class for chart rendering classes SYNOPSIS
In your config.yml: Plugins: - Chart: DefaultRenderer: MyApp::Renderer In lib/MyApp/Renderer.pm: package MyApp::Renderer; use base qw/ Jifty::Plugin::Chart::Renderer /; sub init { my $self = shift; # Handle any required initialization, like required CSS, JS, etc. } sub render { my $self = shift; my %args = @_; # Output your chart Jifty->web->out( #{ Output your chart here... } ); # You could also return it as a string... return; } METHODS
Your renderer implementation must subclass this package and implement the following methods: new This is the constructor. Don't override this directly. Instead implement "init". init $renderer->init(); This is called by "new" immediately after constructing the object. It is passed a param hash from the config file. Subclasses should implement this method to do any required initialization such as letting Jifty know about required CSS files, JS files, etc. render Jifty->web->out($renderer->render(%args)); See Jifty::Plugin::Chart::Web for the arguments. It must (at least) accept the arguments given to the "chart" in Jifty::Plugin::Chart::Web method. The "render" method may either return it's output or print it out using Jifty::Web::out. SEE ALSO
Jifty::Plugin::Chart::Web, Jifty::Plugin::Chart::Renderer::Chart AUTHOR
Andrew Sterling Hanenkamp "<andrew.hanenkamp@boomer.com>" COPYRIGHT AND LICENSE
Copyright 2007 Boomer Consulting, Inc. This is free software and may be modified and distributed under the same terms as Perl itself. perl v5.12.4 2009-03-09 Jifty::Plugin::Chart::Renderer(3pm)
Man Page