Welcome to

1 / 35
About This Presentation
Title:

Welcome to

Description:

Welcome to San Francisco Perl Mongers Sponsored by Wireless Network Info: SSID: melody No WEP, no keys, nada. Byrne Reese Manager, Platform Technology Six Apart, Ltd ... – PowerPoint PPT presentation

Number of Views:4
Avg rating:3.0/5.0
Slides: 36
Provided by: Byr98

less

Transcript and Presenter's Notes

Title: Welcome to


1
  • Welcome to
  • San Francisco Perl Mongers

Sponsored by
Wireless Network Info SSID melody No WEP, no
keys, nada.
2
Building on the
  • Byrne Reese
  • Manager, Platform Technology
  • Six Apart, Ltd.
  • October 20, 2005

3
overview
Introductions About Six Apart Why Movable
Type? Your First Plugin
4
me
Product Manager Open Source Hacker CPAN
Contributor (SOAPLite) Movable Type Plugin
Developer
5
six apart
10 million bloggers using our software to share
their lives, experiences and opinions with their
friends, their families and the world. plus, a
company of perl experts, hackers and enthusiasts
6
our modules
XMLFeed XMLFOAF WWWBlogMetadata XMLAtom
XMLAtomFilter SOAPLite NetOpenID LWPPara
noidAgent Perlbal SWFChart CryptOpenSSLDSA T
extTextile EmailFind MacMacBinary
plus over a hundred more
7
movabletype
highly extensible plugin architecture large
community of developers free! not a product
a platform
8
a platform
Plugins can range from the very simple to the
very complex.
9
a platform
Template Tags Text Filters
Examples IfEmpty ModifiedOn Textile Markdown Ajax
ify
10
a platform
  • StatWatch
  • Add one template tag and
  • Get hit stats for your blog.
  • One template tag
  • A one-page user interface

11
a platform
  • StyleCatcher
  • MT Template Plugin Action
  • Complex Javascript UI
  • Support for multiple template libraries

12
a platform
  • SpamLookup
  • Complex set of plugin actions for filtering
    incoming comments
  • Expert use of MTs plugin configuration framework

13
a platform
  • Media Manager
  • Third party integration
  • Dedicated User Interface
  • Alternative templates
  • Overloaded modes

14
a platform
  • Not to mention plugins for
  • Feedburner plugin
  • PayPal Firewalls
  • Editorial Workflow
  • Podcasting
  • you name it.

15
pronet
you are not alone hundreds of members
strong articles, docs and mailing lists plugin
directory a community of developers
16
pronet
and professionals gig leads promote
yourself deals on conferences free technical
support
17
your first plugin
18
creating your plugin
package MTPluginMyPlugin use MT use base
qw(MTPlugin) use vars qw(VERSION) sub BEGIN
VERSION '1.0' my plugin plugin
new MTPluginMyPlugin( name gt 'Photo
Gallery', version gt VERSION,
description gt A description.', doc_link gt
'', author_name gt 'Byrne Reese',
author_link gt 'http//www.majordojo.com/',
) MT-gtadd_plugin(plugin)
19
registering your plugin
place your plugin .pl file in the plugins
directory your plugin will appear among the
other plugins in MTs Plugins Control Panel
20
template tags
21
a simple tag
MTTemplateContext-gtadd_tag(HelloWorld gt
\helloworld) sub helloworld my (context,
args) _at__ my who args-gtwho
World if (who eq Byrne) return
context-gterror(Please dont feed the
animals) return Hello who
ltMTHelloWorld whoByrnegt
22
a container tag
MTTemplateContext-gtadd_container_tag(HelloWorl
d gt \helloworld) sub helloworld my
(context, args) _at__ my who args-gtwho
World my res my builder
ctx-gtstash('builder') my tokens
ctx-gtstash('tokens') foreach my p
(split(,,who) ctx-gtstash(who', p)
defined(my out builder-gtbuild(context,
tokens)) or return ctx-gterror(context-gter
rstr) res . out res
23
a container tag (continued)
MTTemplateContext-gtadd_tag(Who gt
\who) sub who my (context, args) _at__
my who context-gtstash(who) return
who ltMTHelloWorld whobyrne,ben,markgt
ltMTWhogt lt/MTHelloWorld
24
a conditional tag
MTTemplateContext-gtadd_conditional_tag(IfByrne
gt \ifbyrne) sub ifbyrne my
(context, args) _at__ my who
context-gtstash(who) return who
/Byrne/i ltMTHelloWorld whobyrne,ben,markgt
ltMTIfByrnegt Please dont feed the
animals. ltMTElsegt ltMTWhogt
lt/MTIfByrnegt lt/MTHelloWorld
25
text filters
26
a simple text filter
MT-gtadd_text_filter(bfil, label gt
"Byrnes Filter",
on_format gt filter,
docs gt url) sub filter my (str,
context) _at__ str sByrnelta
hrefhttp//majordojo.com/gt\1lt/agtgi return
str
27
building a UI of your own
28
MTApp
your plugin a tiny MT contains all of your
application logic
package MyPluginApp use strict use
MTApp _at_MyPluginAppISA qw( MTApp ) sub
init my app shift my param _at__
app-gtSUPERinit(param) or return
app-gtadd_methods(hello gt hello) return
app
sub hello my app shift
app-gtl10n_filter( hello world )
29
creating a cgi script
dispatches requests to your MTApp MTBootstrap

!/usr/bin/perl My Movable Type Plugin use
strict use lib "lib", (ENVMT_HOME ?
"ENVMT_HOME/lib" "../../lib") use
MTBootstrap App gt MyPluginApp' __END__
30
MTObject
abstracts developer away from SQL and database
package MediaManagerEntry use strict use
MTObject _at_MediaManagerEntryISA qw(
MTObject ) __PACKAGE__-gtinstall_properties(
column_defs gt 'id'
gt 'integer not null auto_increment',
'blog_id' gt 'integer not null',
'title' gt 'string(150) not null',
'catalog' gt 'string(50) not
null', 'isbn' gt
'string(50) not null', 'entry_id'
gt 'integer' , indexes gt
blog_id gt 1, , audit gt 1,
datasource gt 'mediamanager', primary_key gt
'id', )
31
MTObject methods
count exists
load and load_iter save remove
my constraints constraintsblog_id
blog_id constraintsstatus show if show
ne 'all' constraintscatalog catalog if
catalog ne 'all' my options optionssort
sort optionsdirection direction gt
acs ? 'ascend' 'descend' optionslimit
limit if limit ne 'none' optionsoffset
offset my iter MediaManagerEntry-gtload_i
ter( \constraints, \options )
32
etcetera
alt-templates junk filters callbacks advanced
plugin actions integrated plugin settings
interface BigPAPI
33
oh yeah
34
were hiring )
35
discussion
Write a Comment
User Comments (0)