SlideShare a Scribd company logo
1 of 110
Brand New API


Movable Type Developers & Designers Conference
              2010.2.5 in Tokyo

            Yuji Takayama,Six Apart
r y!
 u ng
H
Whatʼs brand new?
• Website
• Theme Framework
• Revision History Framework
• User Dashboard
• Everything is UTF-8
• Permission API
• Menu Structure
• Dynamic Publishing
• User Interface
• Custom Fields
What is “Website”?
Website is ...
The root object of the
  Movable Type 5
How can I use the
 website object
use MT::Website;

my $website_id = 1;
my $website =
    MT::Website-
>load($website_id)
    or die;
$website->name(‘New Website’);
$website->save or die;
itʼs easy
use MT::Blog;
use MT::Website;

my $website_id = 1;
my $website =
    MT::Website->load($website_id)
        or die;
my $blog = new MT::Blog;
$website->add_blog($blog);
my $blogs = $website->blogs;
All blogs belongs to
     the website
$website->site_url;
$website->site_path;
$website->name;
$website->description;
like a blog?

  Right.
• The website uses same table as the
  blog.

• The class of the website is “website”,
  also the class of the blog is “blog”.

• The blog has parent_id that means the
  belonging website.
mysql> select blog_id, blog_class, blog_parent_id
from mt_blog;

+---------+------------+----------------+
| blog_id | blog_class | blog_parent_id |
+---------+------------+----------------+
|       1 | website    |           NULL |
|       2 | blog       |              1 |
|       3 | blog       |              1 |
|       4 | blog       |              1 |
|       5 | website    |           NULL |
+---------+------------+----------------+
5 rows in set (0.01 sec)
new template tags
•   MTWebsites                •   MTWebsitePath

•   MTIfWebsite?              •   MTWebsiteTimezone

•   MTWebsiteIfCCLicense      •   MTWebsiteCCLicenseURL

•   MTWebsiteHasBlog          •   MTWebsiteCCLicenseImage

•   MTBlogParentWebsite       •   MTWebsiteFileExtension

•   MTWebsiteIfCommentsOpen   •   MTWebsiteHost

•   MTWebsiteID               •   MTWebsiteRelativeURL

•   MTWebsiteName             •   MTWebsiteThemeID

•   MTWebsiteDescription      •   MTWebsiteCommentCount

•   MTWebsiteLanguage         •   MTWebsitePingCount

•   MTWebsiteURL              •   MTWebsitePageCount
new template tags
•   MTWebsites                •   MTWebsitePath

•   MTIfWebsite?              •   MTWebsiteTimezone

•   MTWebsiteIfCCLicense      •   MTWebsiteCCLicenseURL

•   MTWebsiteHasBlog          •   MTWebsiteCCLicenseImage

•   MTBlogParentWebsite       •   MTWebsiteFileExtension

•   MTWebsiteIfCommentsOpen   •   MTWebsiteHost

•   MTWebsiteID               •   MTWebsiteRelativeURL

•   MTWebsiteName             •   MTWebsiteThemeID

•   MTWebsiteDescription      •   MTWebsiteCommentCount

•   MTWebsiteLanguage         •   MTWebsitePingCount

•   MTWebsiteURL              •   MTWebsitePageCount
Now, Movable Type
has a revision history
   management.
By default, only the entry
and the template use it.
But....
You can use it in your
      plug-in.
package MT::Object::MyModel
use base qw ( MT::Object
MT::Revisable );

__PACKAGE__->install_properties({
    ‘id’ => ‘integer not null
auto_increment’,
    ‘text’ => ‘string(255)
revisioned’
    # ...
});

1;
package MT::Object::MyModel
use base qw ( MT::Object
MT::Revisable );

__PACKAGE__->install_properties({
    ‘id’ => ‘integer not null
auto_increment’,
    ‘text’ => ‘string(255)
revisioned’
    # ...
});

1;
package MT::Object::MyModel
use base qw ( MT::Object
MT::Revisable );

__PACKAGE__->install_properties({
    ‘id’ => ‘integer not null
auto_increment’,
    ‘text’ => ‘string(255)
revisioned’
    # ...
});

1;
itʼs easy
Movable Type does
 save a revision
  automatically.
If your object related
    to other object
You must override
 ʻpack_revisionʼ and
  ʻunpack_revisionʼ
method on your object.
sub pack_revision {
    my $obj = shift;
    my $values = MT::Revisable::pack_revision( $obj );

    # add category placements and tag associations
    my ( @tags, @cats );
    if ( my $tags = $obj->get_tag_objects ) {
        @tags = map { $_->id } @$tags
            if @$tags;
    }
    # a revision may remove all the tags
    $values->{__rev_tags} = @tags;

    my $primary = $obj->category;
    if ( my $cats = $obj->categories ) {
        @cats = map { [
            $_->id,
            $_->id == $primary->id ? 1 : 0
        ] } @$cats
            if @$cats;
    }
    # a revision may remove all the categories
    $values->{__rev_cats} = @cats;

    $values;
}
}

sub unpack_revision {                             if ( my $rev_cats = delete $packed_obj-
    my $obj = shift;                          >{__rev_cats} ) {
    my ($packed_obj) = @_;                            $obj->clear_cache('category');
    MT::Revisable::unpack_revision( $obj,             $obj->clear_cache('categories');
@_ );
                                                      my ( $cat, @cats );
    # restore category placements and tag             if ( @$rev_cats ) {
associations                                              my ($primary) = grep { $_->[1] }
    if ( my $rev_tags = delete $packed_obj-   @$rev_cats;
>{__rev_tags} ) {                                         $cat = MT::Category-
        delete $obj->{__tags};                >lookup( $primary->[0] );
        delete $obj->{__tag_objects};                     my $cats = MT::Category-
        MT::Tag->clear_cache(datasource =>    >lookup_multi([ map { $_->[0] } @
$obj->datasource,                             $rev_cats ]);
             ($obj->blog_id ? (blog_id =>                 my @cats = sort { $a->label cmp
$obj->blog_id) : ()));                        $b->label } grep { defined } @$cats;
                                                          $obj->{__missing_cats_rev} = 1
        require MT::Memcached;                                 if scalar( @cats ) !=
        MT::Memcached->instance-              scalar( @$cats );
>delete( $obj->tag_cache_key );                       }
                                                      $obj->cache_property( 'category',
        if ( @$rev_tags ) {                   undef, $cat );
            my $lookups = MT::Tag-                    $obj->cache_property( 'categories',
>lookup_multi($rev_tags);                     undef, @cats );
            my @tags = grep { defined } @         }
$lookups;                                     }
            $obj->{__tags} = [ map { $_-
>name } @tags ];
            $obj->{__tag_objects} = @tags;
            $obj->{__missing_tags_rev} = 1
                 if scalar( @tags ) !=
scalar( @$lookups );
        }
        else {
            $obj->{__tags} = [];
            $obj->{__tag_objects} = [];
        }
See MT::Entry
perldoc MT::Revisable
Itʼs your Home to start
       all actions.
Also, you can add
your own widget here
widgets:
  FeedsWidget:
  label: Feed Aggregate
  template: tmpl/widget.tmpl
  handler:
$FeedWidget::Widget::hdlr_widget
  set: main
  singular: 1
  view: blog
widgets:
  FeedsWidget:
  label: Feed Aggregate
  template: tmpl/widget.tmpl
  handler:
$FeedWidget::Widget::hdlr_widget
  set: main
  singular: 1
  view: blog
widgets:
  FeedsWidget:
  label: Feed Aggregate
  template: tmpl/widget.tmpl
  handler:
$FeedWidget::Widget::hdlr_widget
  set: main
  singular: 1
  view: blog
widgets:
  FeedsWidget:
  label: Feed Aggregate
  template: tmpl/widget.tmpl
  handler:
$FeedWidget::Widget::hdlr_widget
  set: main
  singular: 1
  view: blog
widgets:
  FeedsWidget:
  label: Feed Aggregate
  template: tmpl/widget.tmpl
  handler:
$FeedWidget::Widget::hdlr_widget
  set: main
  singular: 1
  view: blog
Everything is UTF-8
Now, all strings in the
 Movable Type 5 is
   utf-8 flagged.
before
Movable Type 5
You must encode object
       by yourself
  if PublishCharset is
       not UTF-8.
sub _hdlr_my_tag {
    my ( $ctx, $args ) = @_;
    my $obj = MT::Entry->load(
        $args->{id});
    my $data = $obj->text;

    # do something...

    return MT::I18N::encode_text(
        $data, ‘utf-8’ );
}
sub _hdlr_my_tag {
    my ( $ctx, $args ) = @_;
    my $obj = MT::Entry->load(
        $args->{id});
    my $data = $obj->text;

    # do something...

    return MT::I18N::encode_text(
        $data, ‘utf-8’ );
}
from now,
You are freed from
obligation of Encode.
sub _hdlr_my_tag {
    my ( $ctx, $args ) = @_;
    my $obj = MT::Entry->load(
        $args->{id});
    my $data = $obj->text;

    # do something...

    return $data;
}
You must
encode/decode
 your own data
    when...
• Communicating with an external
  network.

• File input/output without MT::FileMgr.
• Saving valuesto columns declared in
  MT::Object blob format.
sub _hdlr_my_tag {
    my ( $ctx, $args ) = @_;
    my $data;

    # received from web service.

    return Encode::decode_utf8(
        $data );
}
sub _hdlr_my_tag {
    my ( $ctx, $args ) = @_;
    my $data;

    # received from web service.

    return Encode::decode_utf8(
        $data );
}
Weʼve aimed to...


• easy to understanding
An user who has ‘manage_pages’
permission. Which actions this
user can do?
Movable Type 4...
  $app->can_manage_pages();

Movable Type 5...
  $app->can_do(
‘remove_all_trackbacks_on_webpages’
  );

manage_pages:
 permitted_action:
  remove_all_trackbacks_on_webpages: 1
See MT::Core
load_core_permissions
Weʼve aimed to...


• easy to understanding
• Can be extensible
permissions:
   blog.your_permission:
       group: blog_admin
       label: Your New Permission
       order: 350
       permitted_action:
           your_action: 1
           your_other_action: 1
Specify the role group.


• blog_admin
• auth_pub           • sys_admin
• blog_upload          (only system
                       level)
• blog_comment
• blog_design
label
The display name of the permission.
order
Ordering the permission in its role group
permitted_action
Hash to define a list of actions permitted for hte
use who has this permission.
inherit_from
A list of inheritance origins for this permission.
Defined by references to the list.
Of course, you can
add your menu by
      plugin.
applications:
  cms:
    menus:
       tools:my_menu:
         label: Your Menu Label
         mode: your_mode
         order: 150
         view: blog
You can display your
   menu on any
     dashboard
applications:
  cms:
    menus:
       tools:my_menu:
         label: Your Menu Label
         mode: your_mode
         order: 150
         view: blog
applications:
  cms:
    menus:
       tools:my_menu:
         label: Your Menu Label
         mode: your_mode
         order: 150
         view: blog
You can restrict your
menu by permission.
permissions:
   blog.your_permission:
       permitted_action:
           your_action: 1
applications:
 cms:
  menus:
   tools:my_menu:
    label: Your Menu Label
    mode: your_mode
    order: 150
    view: blog
    permit_action: your_action
If your plugin still
supports MT4 and MT5
menus:
 create:my_object:
  condition: >
  sub {
    MT->product_version < 5; }
 entries:create:
  condition: >
  sub {
    MT->product_version >= 5; }
jquery
and... jquery-ui Ready.
CSS
More detail...

http://www.slideshare.net/
   swordbreaker/plugin
Thank you for listening.

More Related Content

What's hot

Desarrollo de módulos en Drupal e integración con dispositivos móviles
Desarrollo de módulos en Drupal e integración con dispositivos móvilesDesarrollo de módulos en Drupal e integración con dispositivos móviles
Desarrollo de módulos en Drupal e integración con dispositivos móvilesLuis Curo Salvatierra
 
The State of Lithium
The State of LithiumThe State of Lithium
The State of LithiumNate Abele
 
Lithium: The Framework for People Who Hate Frameworks, Tokyo Edition
Lithium: The Framework for People Who Hate Frameworks, Tokyo EditionLithium: The Framework for People Who Hate Frameworks, Tokyo Edition
Lithium: The Framework for People Who Hate Frameworks, Tokyo EditionNate Abele
 
Doctrine 2
Doctrine 2Doctrine 2
Doctrine 2zfconfua
 
Silex meets SOAP & REST
Silex meets SOAP & RESTSilex meets SOAP & REST
Silex meets SOAP & RESTHugo Hamon
 
50 Laravel Tricks in 50 Minutes
50 Laravel Tricks in 50 Minutes50 Laravel Tricks in 50 Minutes
50 Laravel Tricks in 50 MinutesAzim Kurt
 
Tips of CakePHP and MongoDB - Cakefest2011 ichikaway
Tips of CakePHP and MongoDB - Cakefest2011 ichikaway Tips of CakePHP and MongoDB - Cakefest2011 ichikaway
Tips of CakePHP and MongoDB - Cakefest2011 ichikaway ichikaway
 
Doctrine fixtures
Doctrine fixturesDoctrine fixtures
Doctrine fixturesBill Chang
 
The Query the Whole Query and Nothing but the Query
The Query the Whole Query and Nothing but the QueryThe Query the Whole Query and Nothing but the Query
The Query the Whole Query and Nothing but the QueryChris Olbekson
 
Doctrine For Beginners
Doctrine For BeginnersDoctrine For Beginners
Doctrine For BeginnersJonathan Wage
 
Rich domain model with symfony 2.5 and doctrine 2.5
Rich domain model with symfony 2.5 and doctrine 2.5Rich domain model with symfony 2.5 and doctrine 2.5
Rich domain model with symfony 2.5 and doctrine 2.5Leonardo Proietti
 
Symfony2, creare bundle e valore per il cliente
Symfony2, creare bundle e valore per il clienteSymfony2, creare bundle e valore per il cliente
Symfony2, creare bundle e valore per il clienteLeonardo Proietti
 
Internationalizing CakePHP Applications
Internationalizing CakePHP ApplicationsInternationalizing CakePHP Applications
Internationalizing CakePHP ApplicationsPierre MARTIN
 
Models and Service Layers, Hemoglobin and Hobgoblins
Models and Service Layers, Hemoglobin and HobgoblinsModels and Service Layers, Hemoglobin and Hobgoblins
Models and Service Layers, Hemoglobin and HobgoblinsRoss Tuck
 
Command Bus To Awesome Town
Command Bus To Awesome TownCommand Bus To Awesome Town
Command Bus To Awesome TownRoss Tuck
 
Intro programacion funcional
Intro programacion funcionalIntro programacion funcional
Intro programacion funcionalNSCoder Mexico
 
How else can you write the code in PHP?
How else can you write the code in PHP?How else can you write the code in PHP?
How else can you write the code in PHP?Maksym Hopei
 
Revisiting SOLID Principles
Revisiting  SOLID Principles Revisiting  SOLID Principles
Revisiting SOLID Principles Anis Ahmad
 

What's hot (20)

Desarrollo de módulos en Drupal e integración con dispositivos móviles
Desarrollo de módulos en Drupal e integración con dispositivos móvilesDesarrollo de módulos en Drupal e integración con dispositivos móviles
Desarrollo de módulos en Drupal e integración con dispositivos móviles
 
The State of Lithium
The State of LithiumThe State of Lithium
The State of Lithium
 
Lithium: The Framework for People Who Hate Frameworks, Tokyo Edition
Lithium: The Framework for People Who Hate Frameworks, Tokyo EditionLithium: The Framework for People Who Hate Frameworks, Tokyo Edition
Lithium: The Framework for People Who Hate Frameworks, Tokyo Edition
 
Doctrine 2
Doctrine 2Doctrine 2
Doctrine 2
 
Silex meets SOAP & REST
Silex meets SOAP & RESTSilex meets SOAP & REST
Silex meets SOAP & REST
 
50 Laravel Tricks in 50 Minutes
50 Laravel Tricks in 50 Minutes50 Laravel Tricks in 50 Minutes
50 Laravel Tricks in 50 Minutes
 
Tips of CakePHP and MongoDB - Cakefest2011 ichikaway
Tips of CakePHP and MongoDB - Cakefest2011 ichikaway Tips of CakePHP and MongoDB - Cakefest2011 ichikaway
Tips of CakePHP and MongoDB - Cakefest2011 ichikaway
 
Doctrine fixtures
Doctrine fixturesDoctrine fixtures
Doctrine fixtures
 
The Query the Whole Query and Nothing but the Query
The Query the Whole Query and Nothing but the QueryThe Query the Whole Query and Nothing but the Query
The Query the Whole Query and Nothing but the Query
 
Doctrine For Beginners
Doctrine For BeginnersDoctrine For Beginners
Doctrine For Beginners
 
Rich domain model with symfony 2.5 and doctrine 2.5
Rich domain model with symfony 2.5 and doctrine 2.5Rich domain model with symfony 2.5 and doctrine 2.5
Rich domain model with symfony 2.5 and doctrine 2.5
 
Symfony2, creare bundle e valore per il cliente
Symfony2, creare bundle e valore per il clienteSymfony2, creare bundle e valore per il cliente
Symfony2, creare bundle e valore per il cliente
 
Agile database access with CakePHP 3
Agile database access with CakePHP 3Agile database access with CakePHP 3
Agile database access with CakePHP 3
 
Internationalizing CakePHP Applications
Internationalizing CakePHP ApplicationsInternationalizing CakePHP Applications
Internationalizing CakePHP Applications
 
Models and Service Layers, Hemoglobin and Hobgoblins
Models and Service Layers, Hemoglobin and HobgoblinsModels and Service Layers, Hemoglobin and Hobgoblins
Models and Service Layers, Hemoglobin and Hobgoblins
 
Command Bus To Awesome Town
Command Bus To Awesome TownCommand Bus To Awesome Town
Command Bus To Awesome Town
 
Perl object ?
Perl object ?Perl object ?
Perl object ?
 
Intro programacion funcional
Intro programacion funcionalIntro programacion funcional
Intro programacion funcional
 
How else can you write the code in PHP?
How else can you write the code in PHP?How else can you write the code in PHP?
How else can you write the code in PHP?
 
Revisiting SOLID Principles
Revisiting  SOLID Principles Revisiting  SOLID Principles
Revisiting SOLID Principles
 

Viewers also liked

Novelties in Java EE 7: JAX-RS 2.0 + IPT REST HATEOAS Polling Demo @ BGOUG Co...
Novelties in Java EE 7: JAX-RS 2.0 + IPT REST HATEOAS Polling Demo @ BGOUG Co...Novelties in Java EE 7: JAX-RS 2.0 + IPT REST HATEOAS Polling Demo @ BGOUG Co...
Novelties in Java EE 7: JAX-RS 2.0 + IPT REST HATEOAS Polling Demo @ BGOUG Co...Trayan Iliev
 
Data API ことはじめ
Data API ことはじめData API ことはじめ
Data API ことはじめYuji Takayama
 
Fork/Join Framework。そしてLambdaへ。
Fork/Join Framework。そしてLambdaへ。Fork/Join Framework。そしてLambdaへ。
Fork/Join Framework。そしてLambdaへ。Yuichi Sakuraba
 
Introducing C# in AWS Lambda
Introducing C# in AWS LambdaIntroducing C# in AWS Lambda
Introducing C# in AWS LambdaAtsushi Fukui
 
Running Java Apps with Amazon EC2, AWS Elastic Beanstalk or Serverless
Running Java Apps with Amazon EC2, AWS Elastic Beanstalk or ServerlessRunning Java Apps with Amazon EC2, AWS Elastic Beanstalk or Serverless
Running Java Apps with Amazon EC2, AWS Elastic Beanstalk or ServerlessKeisuke Nishitani
 
20161111 java one2016-feedback
20161111 java one2016-feedback20161111 java one2016-feedback
20161111 java one2016-feedbackTakashi Ito
 
Going Serverless, Building Applications with No Servers
Going Serverless, Building Applications with No ServersGoing Serverless, Building Applications with No Servers
Going Serverless, Building Applications with No ServersKeisuke Nishitani
 
Awsで作るビッグデータ解析今とこれから
Awsで作るビッグデータ解析今とこれからAwsで作るビッグデータ解析今とこれから
Awsで作るビッグデータ解析今とこれからShohei Kobayashi
 
AWSのサーバレス関連アップデートを10分で紹介します
AWSのサーバレス関連アップデートを10分で紹介しますAWSのサーバレス関連アップデートを10分で紹介します
AWSのサーバレス関連アップデートを10分で紹介しますKeisuke Nishitani
 
デモから見るOpenWhisk - Docker Action -
デモから見るOpenWhisk - Docker Action - デモから見るOpenWhisk - Docker Action -
デモから見るOpenWhisk - Docker Action - Hideaki Tokida
 
Serverless meetup02 openwhisk
Serverless meetup02 openwhiskServerless meetup02 openwhisk
Serverless meetup02 openwhiskHideaki Tokida
 
The Internal of Serverless Plugins
The Internal of Serverless PluginsThe Internal of Serverless Plugins
The Internal of Serverless PluginsTerui Masashi
 
Building Serverless Backends with AWS Lambda and Amazon API Gateway
Building Serverless Backends with AWS Lambda and Amazon API GatewayBuilding Serverless Backends with AWS Lambda and Amazon API Gateway
Building Serverless Backends with AWS Lambda and Amazon API GatewayAmazon Web Services
 
Deep-Dive: Building Mobile Web Applications with AWS Mobile SDK
Deep-Dive: Building Mobile Web Applications with AWS Mobile SDKDeep-Dive: Building Mobile Web Applications with AWS Mobile SDK
Deep-Dive: Building Mobile Web Applications with AWS Mobile SDKAmazon Web Services
 
CRM分析サービス crm analyzer expressを 支えるサーバレスな色々
CRM分析サービス  crm analyzer expressを 支えるサーバレスな色々CRM分析サービス  crm analyzer expressを 支えるサーバレスな色々
CRM分析サービス crm analyzer expressを 支えるサーバレスな色々Kazuhiro Sasaki
 
Salesforce Einstein - SaaS企業のAI戦略とテクノロジ -
Salesforce Einstein - SaaS企業のAI戦略とテクノロジ - Salesforce Einstein - SaaS企業のAI戦略とテクノロジ -
Salesforce Einstein - SaaS企業のAI戦略とテクノロジ - Mitch Okamoto
 

Viewers also liked (20)

Novelties in Java EE 7: JAX-RS 2.0 + IPT REST HATEOAS Polling Demo @ BGOUG Co...
Novelties in Java EE 7: JAX-RS 2.0 + IPT REST HATEOAS Polling Demo @ BGOUG Co...Novelties in Java EE 7: JAX-RS 2.0 + IPT REST HATEOAS Polling Demo @ BGOUG Co...
Novelties in Java EE 7: JAX-RS 2.0 + IPT REST HATEOAS Polling Demo @ BGOUG Co...
 
Data API ことはじめ
Data API ことはじめData API ことはじめ
Data API ことはじめ
 
Fork/Join Framework。そしてLambdaへ。
Fork/Join Framework。そしてLambdaへ。Fork/Join Framework。そしてLambdaへ。
Fork/Join Framework。そしてLambdaへ。
 
Introducing C# in AWS Lambda
Introducing C# in AWS LambdaIntroducing C# in AWS Lambda
Introducing C# in AWS Lambda
 
Running Java Apps with Amazon EC2, AWS Elastic Beanstalk or Serverless
Running Java Apps with Amazon EC2, AWS Elastic Beanstalk or ServerlessRunning Java Apps with Amazon EC2, AWS Elastic Beanstalk or Serverless
Running Java Apps with Amazon EC2, AWS Elastic Beanstalk or Serverless
 
20161111 java one2016-feedback
20161111 java one2016-feedback20161111 java one2016-feedback
20161111 java one2016-feedback
 
Going Serverless, Building Applications with No Servers
Going Serverless, Building Applications with No ServersGoing Serverless, Building Applications with No Servers
Going Serverless, Building Applications with No Servers
 
Introduction to AWS X-Ray
Introduction to AWS X-RayIntroduction to AWS X-Ray
Introduction to AWS X-Ray
 
Awsで作るビッグデータ解析今とこれから
Awsで作るビッグデータ解析今とこれからAwsで作るビッグデータ解析今とこれから
Awsで作るビッグデータ解析今とこれから
 
AWSのサーバレス関連アップデートを10分で紹介します
AWSのサーバレス関連アップデートを10分で紹介しますAWSのサーバレス関連アップデートを10分で紹介します
AWSのサーバレス関連アップデートを10分で紹介します
 
デモから見るOpenWhisk - Docker Action -
デモから見るOpenWhisk - Docker Action - デモから見るOpenWhisk - Docker Action -
デモから見るOpenWhisk - Docker Action -
 
Serverless meetup02 openwhisk
Serverless meetup02 openwhiskServerless meetup02 openwhisk
Serverless meetup02 openwhisk
 
The Internal of Serverless Plugins
The Internal of Serverless PluginsThe Internal of Serverless Plugins
The Internal of Serverless Plugins
 
Building Serverless Backends with AWS Lambda and Amazon API Gateway
Building Serverless Backends with AWS Lambda and Amazon API GatewayBuilding Serverless Backends with AWS Lambda and Amazon API Gateway
Building Serverless Backends with AWS Lambda and Amazon API Gateway
 
What's new with Serverless
What's new with ServerlessWhat's new with Serverless
What's new with Serverless
 
Deep-Dive: Building Mobile Web Applications with AWS Mobile SDK
Deep-Dive: Building Mobile Web Applications with AWS Mobile SDKDeep-Dive: Building Mobile Web Applications with AWS Mobile SDK
Deep-Dive: Building Mobile Web Applications with AWS Mobile SDK
 
CRM分析サービス crm analyzer expressを 支えるサーバレスな色々
CRM分析サービス  crm analyzer expressを 支えるサーバレスな色々CRM分析サービス  crm analyzer expressを 支えるサーバレスな色々
CRM分析サービス crm analyzer expressを 支えるサーバレスな色々
 
Salesforce Einstein - SaaS企業のAI戦略とテクノロジ -
Salesforce Einstein - SaaS企業のAI戦略とテクノロジ - Salesforce Einstein - SaaS企業のAI戦略とテクノロジ -
Salesforce Einstein - SaaS企業のAI戦略とテクノロジ -
 
Serverless Revolution
Serverless RevolutionServerless Revolution
Serverless Revolution
 
Serverless for Developers
Serverless for DevelopersServerless for Developers
Serverless for Developers
 

Similar to MTDDC 2010.2.5 Tokyo - Brand new API

WordPress plugin #3
WordPress plugin #3WordPress plugin #3
WordPress plugin #3giwoolee
 
Dig Deeper into WordPress - WD Meetup Cairo
Dig Deeper into WordPress - WD Meetup CairoDig Deeper into WordPress - WD Meetup Cairo
Dig Deeper into WordPress - WD Meetup CairoMohamed Mosaad
 
Nickolay Shmalenuk.Render api eng.DrupalCamp Kyiv 2011
Nickolay Shmalenuk.Render api eng.DrupalCamp Kyiv 2011Nickolay Shmalenuk.Render api eng.DrupalCamp Kyiv 2011
Nickolay Shmalenuk.Render api eng.DrupalCamp Kyiv 2011camp_drupal_ua
 
Zend Framework Study@Tokyo #2
Zend Framework Study@Tokyo #2Zend Framework Study@Tokyo #2
Zend Framework Study@Tokyo #2Shinya Ohyanagi
 
Introduction To Moco
Introduction To MocoIntroduction To Moco
Introduction To MocoNaoya Ito
 
Extending Moose
Extending MooseExtending Moose
Extending Moosesartak
 
Php on the desktop and php gtk2
Php on the desktop and php gtk2Php on the desktop and php gtk2
Php on the desktop and php gtk2Elizabeth Smith
 
Bag Of Tricks From Iusethis
Bag Of Tricks From IusethisBag Of Tricks From Iusethis
Bag Of Tricks From IusethisMarcus Ramberg
 
DBIx::Skinnyと仲間たち
DBIx::Skinnyと仲間たちDBIx::Skinnyと仲間たち
DBIx::Skinnyと仲間たちRyo Miyake
 
Speed Things Up with Transients
Speed Things Up with TransientsSpeed Things Up with Transients
Speed Things Up with TransientsCliff Seal
 
Ruby on rails
Ruby on rails Ruby on rails
Ruby on rails Mohit Jain
 
Metaprogramovanie #1
Metaprogramovanie #1Metaprogramovanie #1
Metaprogramovanie #1Jano Suchal
 

Similar to MTDDC 2010.2.5 Tokyo - Brand new API (20)

Hacking Movable Type
Hacking Movable TypeHacking Movable Type
Hacking Movable Type
 
WordPress plugin #3
WordPress plugin #3WordPress plugin #3
WordPress plugin #3
 
Dig Deeper into WordPress - WD Meetup Cairo
Dig Deeper into WordPress - WD Meetup CairoDig Deeper into WordPress - WD Meetup Cairo
Dig Deeper into WordPress - WD Meetup Cairo
 
Nickolay Shmalenuk.Render api eng.DrupalCamp Kyiv 2011
Nickolay Shmalenuk.Render api eng.DrupalCamp Kyiv 2011Nickolay Shmalenuk.Render api eng.DrupalCamp Kyiv 2011
Nickolay Shmalenuk.Render api eng.DrupalCamp Kyiv 2011
 
Blog Hacks 2011
Blog Hacks 2011Blog Hacks 2011
Blog Hacks 2011
 
Twig tips and tricks
Twig tips and tricksTwig tips and tricks
Twig tips and tricks
 
Zend Framework Study@Tokyo #2
Zend Framework Study@Tokyo #2Zend Framework Study@Tokyo #2
Zend Framework Study@Tokyo #2
 
Introduction To Moco
Introduction To MocoIntroduction To Moco
Introduction To Moco
 
Extending Moose
Extending MooseExtending Moose
Extending Moose
 
Php on the desktop and php gtk2
Php on the desktop and php gtk2Php on the desktop and php gtk2
Php on the desktop and php gtk2
 
Bag Of Tricks From Iusethis
Bag Of Tricks From IusethisBag Of Tricks From Iusethis
Bag Of Tricks From Iusethis
 
DBIx::Skinnyと仲間たち
DBIx::Skinnyと仲間たちDBIx::Skinnyと仲間たち
DBIx::Skinnyと仲間たち
 
Speed Things Up with Transients
Speed Things Up with TransientsSpeed Things Up with Transients
Speed Things Up with Transients
 
Zend framework service
Zend framework serviceZend framework service
Zend framework service
 
Zend framework service
Zend framework serviceZend framework service
Zend framework service
 
About Data::ObjectDriver
About Data::ObjectDriverAbout Data::ObjectDriver
About Data::ObjectDriver
 
Ruby on rails
Ruby on rails Ruby on rails
Ruby on rails
 
Metaprogramovanie #1
Metaprogramovanie #1Metaprogramovanie #1
Metaprogramovanie #1
 
Add loop shortcode
Add loop shortcodeAdd loop shortcode
Add loop shortcode
 
php2.pptx
php2.pptxphp2.pptx
php2.pptx
 

More from Six Apart KK

Movable Type for AWS Starter Guide (en)
Movable Type for AWS Starter Guide (en)Movable Type for AWS Starter Guide (en)
Movable Type for AWS Starter Guide (en)Six Apart KK
 
ミニマムリソースでロング&ミドルリターンを目指す Six Apartブログ のお話
ミニマムリソースでロング&ミドルリターンを目指す Six Apartブログ のお話ミニマムリソースでロング&ミドルリターンを目指す Six Apartブログ のお話
ミニマムリソースでロング&ミドルリターンを目指す Six Apartブログ のお話Six Apart KK
 
書いてもらう広報の時代は終わった! オウンドメディアで攻める広報術
書いてもらう広報の時代は終わった! オウンドメディアで攻める広報術書いてもらう広報の時代は終わった! オウンドメディアで攻める広報術
書いてもらう広報の時代は終わった! オウンドメディアで攻める広報術Six Apart KK
 
Movable type for AWS Starter Guide
Movable type for AWS Starter GuideMovable type for AWS Starter Guide
Movable type for AWS Starter GuideSix Apart KK
 
始めよう! 新サービス MovableType.net の全て
始めよう! 新サービス MovableType.net の全て始めよう! 新サービス MovableType.net の全て
始めよう! 新サービス MovableType.net の全てSix Apart KK
 
元・記者の目から見た企業オウンドメディア運営の勘所
元・記者の目から見た企業オウンドメディア運営の勘所元・記者の目から見た企業オウンドメディア運営の勘所
元・記者の目から見た企業オウンドメディア運営の勘所Six Apart KK
 
米国の最新事情にみる 「オウンドメディア」の活用法
米国の最新事情にみる 「オウンドメディア」の活用法米国の最新事情にみる 「オウンドメディア」の活用法
米国の最新事情にみる 「オウンドメディア」の活用法Six Apart KK
 
シックス・アパート社のご紹介とオウンドメディアへの取り組み
シックス・アパート社のご紹介とオウンドメディアへの取り組みシックス・アパート社のご紹介とオウンドメディアへの取り組み
シックス・アパート社のご紹介とオウンドメディアへの取り組みSix Apart KK
 
Six Apart UniBaaS 解説書
Six Apart UniBaaS 解説書Six Apart UniBaaS 解説書
Six Apart UniBaaS 解説書Six Apart KK
 
Mtddc meetup kyushu_2013_keynote_2
Mtddc meetup kyushu_2013_keynote_2Mtddc meetup kyushu_2013_keynote_2
Mtddc meetup kyushu_2013_keynote_2Six Apart KK
 
ギズモード・ジャパンのつくり方
ギズモード・ジャパンのつくり方ギズモード・ジャパンのつくり方
ギズモード・ジャパンのつくり方Six Apart KK
 
人に読まれて育てる企業オウンドメディアのはじめ方 ~運用7ヶ月を振り返って、現場担当者からのTIP集~
人に読まれて育てる企業オウンドメディアのはじめ方 ~運用7ヶ月を振り返って、現場担当者からのTIP集~人に読まれて育てる企業オウンドメディアのはじめ方 ~運用7ヶ月を振り返って、現場担当者からのTIP集~
人に読まれて育てる企業オウンドメディアのはじめ方 ~運用7ヶ月を振り返って、現場担当者からのTIP集~Six Apart KK
 
テキストだけでクリックはどのくらい変わるのか!? Zenback ADS 広告効果のご紹介
テキストだけでクリックはどのくらい変わるのか!? Zenback ADS 広告効果のご紹介テキストだけでクリックはどのくらい変わるのか!? Zenback ADS 広告効果のご紹介
テキストだけでクリックはどのくらい変わるのか!? Zenback ADS 広告効果のご紹介Six Apart KK
 
ソーシャルメディアキャンペーン施策のポイントと、Lekumo(ルクモ)の効果
ソーシャルメディアキャンペーン施策のポイントと、Lekumo(ルクモ)の効果ソーシャルメディアキャンペーン施策のポイントと、Lekumo(ルクモ)の効果
ソーシャルメディアキャンペーン施策のポイントと、Lekumo(ルクモ)の効果Six Apart KK
 
スカパー!が実践するソーシャルメディア連携施策とそのツール戦略
スカパー!が実践するソーシャルメディア連携施策とそのツール戦略スカパー!が実践するソーシャルメディア連携施策とそのツール戦略
スカパー!が実践するソーシャルメディア連携施策とそのツール戦略Six Apart KK
 
日本初ソーシャルメディア・リードとしてツールにもとめるもの
日本初ソーシャルメディア・リードとしてツールにもとめるもの日本初ソーシャルメディア・リードとしてツールにもとめるもの
日本初ソーシャルメディア・リードとしてツールにもとめるものSix Apart KK
 
Azure と MT のフシギな関係
Azure と MT のフシギな関係Azure と MT のフシギな関係
Azure と MT のフシギな関係Six Apart KK
 
VMインポート機能を使った簡単サーバ構築
VMインポート機能を使った簡単サーバ構築VMインポート機能を使った簡単サーバ構築
VMインポート機能を使った簡単サーバ構築Six Apart KK
 
Zenback BIZの活用事例とソーシャルメディア連携最適化 TIPS
Zenback BIZの活用事例とソーシャルメディア連携最適化 TIPSZenback BIZの活用事例とソーシャルメディア連携最適化 TIPS
Zenback BIZの活用事例とソーシャルメディア連携最適化 TIPSSix Apart KK
 

More from Six Apart KK (20)

Movable Type for AWS Starter Guide (en)
Movable Type for AWS Starter Guide (en)Movable Type for AWS Starter Guide (en)
Movable Type for AWS Starter Guide (en)
 
ミニマムリソースでロング&ミドルリターンを目指す Six Apartブログ のお話
ミニマムリソースでロング&ミドルリターンを目指す Six Apartブログ のお話ミニマムリソースでロング&ミドルリターンを目指す Six Apartブログ のお話
ミニマムリソースでロング&ミドルリターンを目指す Six Apartブログ のお話
 
書いてもらう広報の時代は終わった! オウンドメディアで攻める広報術
書いてもらう広報の時代は終わった! オウンドメディアで攻める広報術書いてもらう広報の時代は終わった! オウンドメディアで攻める広報術
書いてもらう広報の時代は終わった! オウンドメディアで攻める広報術
 
Movable type for AWS Starter Guide
Movable type for AWS Starter GuideMovable type for AWS Starter Guide
Movable type for AWS Starter Guide
 
始めよう! 新サービス MovableType.net の全て
始めよう! 新サービス MovableType.net の全て始めよう! 新サービス MovableType.net の全て
始めよう! 新サービス MovableType.net の全て
 
元・記者の目から見た企業オウンドメディア運営の勘所
元・記者の目から見た企業オウンドメディア運営の勘所元・記者の目から見た企業オウンドメディア運営の勘所
元・記者の目から見た企業オウンドメディア運営の勘所
 
米国の最新事情にみる 「オウンドメディア」の活用法
米国の最新事情にみる 「オウンドメディア」の活用法米国の最新事情にみる 「オウンドメディア」の活用法
米国の最新事情にみる 「オウンドメディア」の活用法
 
シックス・アパート社のご紹介とオウンドメディアへの取り組み
シックス・アパート社のご紹介とオウンドメディアへの取り組みシックス・アパート社のご紹介とオウンドメディアへの取り組み
シックス・アパート社のご紹介とオウンドメディアへの取り組み
 
Six Apart UniBaaS 解説書
Six Apart UniBaaS 解説書Six Apart UniBaaS 解説書
Six Apart UniBaaS 解説書
 
Mtddc meetup kyushu_2013_keynote_2
Mtddc meetup kyushu_2013_keynote_2Mtddc meetup kyushu_2013_keynote_2
Mtddc meetup kyushu_2013_keynote_2
 
ギズモード・ジャパンのつくり方
ギズモード・ジャパンのつくり方ギズモード・ジャパンのつくり方
ギズモード・ジャパンのつくり方
 
人に読まれて育てる企業オウンドメディアのはじめ方 ~運用7ヶ月を振り返って、現場担当者からのTIP集~
人に読まれて育てる企業オウンドメディアのはじめ方 ~運用7ヶ月を振り返って、現場担当者からのTIP集~人に読まれて育てる企業オウンドメディアのはじめ方 ~運用7ヶ月を振り返って、現場担当者からのTIP集~
人に読まれて育てる企業オウンドメディアのはじめ方 ~運用7ヶ月を振り返って、現場担当者からのTIP集~
 
テキストだけでクリックはどのくらい変わるのか!? Zenback ADS 広告効果のご紹介
テキストだけでクリックはどのくらい変わるのか!? Zenback ADS 広告効果のご紹介テキストだけでクリックはどのくらい変わるのか!? Zenback ADS 広告効果のご紹介
テキストだけでクリックはどのくらい変わるのか!? Zenback ADS 広告効果のご紹介
 
ソーシャルメディアキャンペーン施策のポイントと、Lekumo(ルクモ)の効果
ソーシャルメディアキャンペーン施策のポイントと、Lekumo(ルクモ)の効果ソーシャルメディアキャンペーン施策のポイントと、Lekumo(ルクモ)の効果
ソーシャルメディアキャンペーン施策のポイントと、Lekumo(ルクモ)の効果
 
スカパー!が実践するソーシャルメディア連携施策とそのツール戦略
スカパー!が実践するソーシャルメディア連携施策とそのツール戦略スカパー!が実践するソーシャルメディア連携施策とそのツール戦略
スカパー!が実践するソーシャルメディア連携施策とそのツール戦略
 
日本初ソーシャルメディア・リードとしてツールにもとめるもの
日本初ソーシャルメディア・リードとしてツールにもとめるもの日本初ソーシャルメディア・リードとしてツールにもとめるもの
日本初ソーシャルメディア・リードとしてツールにもとめるもの
 
Azure と MT のフシギな関係
Azure と MT のフシギな関係Azure と MT のフシギな関係
Azure と MT のフシギな関係
 
MTDDC Tokyo 2012
MTDDC Tokyo 2012MTDDC Tokyo 2012
MTDDC Tokyo 2012
 
VMインポート機能を使った簡単サーバ構築
VMインポート機能を使った簡単サーバ構築VMインポート機能を使った簡単サーバ構築
VMインポート機能を使った簡単サーバ構築
 
Zenback BIZの活用事例とソーシャルメディア連携最適化 TIPS
Zenback BIZの活用事例とソーシャルメディア連携最適化 TIPSZenback BIZの活用事例とソーシャルメディア連携最適化 TIPS
Zenback BIZの活用事例とソーシャルメディア連携最適化 TIPS
 

MTDDC 2010.2.5 Tokyo - Brand new API

  • 1.
  • 2. Brand New API Movable Type Developers & Designers Conference 2010.2.5 in Tokyo Yuji Takayama,Six Apart
  • 3. r y! u ng H
  • 5. • Website • Theme Framework • Revision History Framework • User Dashboard
  • 6. • Everything is UTF-8 • Permission API • Menu Structure • Dynamic Publishing • User Interface • Custom Fields
  • 7.
  • 10. The root object of the Movable Type 5
  • 11. How can I use the website object
  • 12. use MT::Website; my $website_id = 1; my $website = MT::Website- >load($website_id) or die; $website->name(‘New Website’); $website->save or die;
  • 14. use MT::Blog; use MT::Website; my $website_id = 1; my $website = MT::Website->load($website_id) or die; my $blog = new MT::Blog; $website->add_blog($blog); my $blogs = $website->blogs;
  • 15. All blogs belongs to the website
  • 17. like a blog? Right.
  • 18. • The website uses same table as the blog. • The class of the website is “website”, also the class of the blog is “blog”. • The blog has parent_id that means the belonging website.
  • 19. mysql> select blog_id, blog_class, blog_parent_id from mt_blog; +---------+------------+----------------+ | blog_id | blog_class | blog_parent_id | +---------+------------+----------------+ | 1 | website | NULL | | 2 | blog | 1 | | 3 | blog | 1 | | 4 | blog | 1 | | 5 | website | NULL | +---------+------------+----------------+ 5 rows in set (0.01 sec)
  • 20. new template tags • MTWebsites • MTWebsitePath • MTIfWebsite? • MTWebsiteTimezone • MTWebsiteIfCCLicense • MTWebsiteCCLicenseURL • MTWebsiteHasBlog • MTWebsiteCCLicenseImage • MTBlogParentWebsite • MTWebsiteFileExtension • MTWebsiteIfCommentsOpen • MTWebsiteHost • MTWebsiteID • MTWebsiteRelativeURL • MTWebsiteName • MTWebsiteThemeID • MTWebsiteDescription • MTWebsiteCommentCount • MTWebsiteLanguage • MTWebsitePingCount • MTWebsiteURL • MTWebsitePageCount
  • 21. new template tags • MTWebsites • MTWebsitePath • MTIfWebsite? • MTWebsiteTimezone • MTWebsiteIfCCLicense • MTWebsiteCCLicenseURL • MTWebsiteHasBlog • MTWebsiteCCLicenseImage • MTBlogParentWebsite • MTWebsiteFileExtension • MTWebsiteIfCommentsOpen • MTWebsiteHost • MTWebsiteID • MTWebsiteRelativeURL • MTWebsiteName • MTWebsiteThemeID • MTWebsiteDescription • MTWebsiteCommentCount • MTWebsiteLanguage • MTWebsitePingCount • MTWebsiteURL • MTWebsitePageCount
  • 22.
  • 23.
  • 24.
  • 25. Now, Movable Type has a revision history management.
  • 26. By default, only the entry and the template use it.
  • 28. You can use it in your plug-in.
  • 29. package MT::Object::MyModel use base qw ( MT::Object MT::Revisable ); __PACKAGE__->install_properties({ ‘id’ => ‘integer not null auto_increment’, ‘text’ => ‘string(255) revisioned’ # ... }); 1;
  • 30. package MT::Object::MyModel use base qw ( MT::Object MT::Revisable ); __PACKAGE__->install_properties({ ‘id’ => ‘integer not null auto_increment’, ‘text’ => ‘string(255) revisioned’ # ... }); 1;
  • 31. package MT::Object::MyModel use base qw ( MT::Object MT::Revisable ); __PACKAGE__->install_properties({ ‘id’ => ‘integer not null auto_increment’, ‘text’ => ‘string(255) revisioned’ # ... }); 1;
  • 33. Movable Type does save a revision automatically.
  • 34. If your object related to other object
  • 35. You must override ʻpack_revisionʼ and ʻunpack_revisionʼ method on your object.
  • 36. sub pack_revision { my $obj = shift; my $values = MT::Revisable::pack_revision( $obj ); # add category placements and tag associations my ( @tags, @cats ); if ( my $tags = $obj->get_tag_objects ) { @tags = map { $_->id } @$tags if @$tags; } # a revision may remove all the tags $values->{__rev_tags} = @tags; my $primary = $obj->category; if ( my $cats = $obj->categories ) { @cats = map { [ $_->id, $_->id == $primary->id ? 1 : 0 ] } @$cats if @$cats; } # a revision may remove all the categories $values->{__rev_cats} = @cats; $values; }
  • 37. } sub unpack_revision { if ( my $rev_cats = delete $packed_obj- my $obj = shift; >{__rev_cats} ) { my ($packed_obj) = @_; $obj->clear_cache('category'); MT::Revisable::unpack_revision( $obj, $obj->clear_cache('categories'); @_ ); my ( $cat, @cats ); # restore category placements and tag if ( @$rev_cats ) { associations my ($primary) = grep { $_->[1] } if ( my $rev_tags = delete $packed_obj- @$rev_cats; >{__rev_tags} ) { $cat = MT::Category- delete $obj->{__tags}; >lookup( $primary->[0] ); delete $obj->{__tag_objects}; my $cats = MT::Category- MT::Tag->clear_cache(datasource => >lookup_multi([ map { $_->[0] } @ $obj->datasource, $rev_cats ]); ($obj->blog_id ? (blog_id => my @cats = sort { $a->label cmp $obj->blog_id) : ())); $b->label } grep { defined } @$cats; $obj->{__missing_cats_rev} = 1 require MT::Memcached; if scalar( @cats ) != MT::Memcached->instance- scalar( @$cats ); >delete( $obj->tag_cache_key ); } $obj->cache_property( 'category', if ( @$rev_tags ) { undef, $cat ); my $lookups = MT::Tag- $obj->cache_property( 'categories', >lookup_multi($rev_tags); undef, @cats ); my @tags = grep { defined } @ } $lookups; } $obj->{__tags} = [ map { $_- >name } @tags ]; $obj->{__tag_objects} = @tags; $obj->{__missing_tags_rev} = 1 if scalar( @tags ) != scalar( @$lookups ); } else { $obj->{__tags} = []; $obj->{__tag_objects} = []; }
  • 39.
  • 41.
  • 42.
  • 43. Itʼs your Home to start all actions.
  • 44. Also, you can add your own widget here
  • 45. widgets: FeedsWidget: label: Feed Aggregate template: tmpl/widget.tmpl handler: $FeedWidget::Widget::hdlr_widget set: main singular: 1 view: blog
  • 46. widgets: FeedsWidget: label: Feed Aggregate template: tmpl/widget.tmpl handler: $FeedWidget::Widget::hdlr_widget set: main singular: 1 view: blog
  • 47. widgets: FeedsWidget: label: Feed Aggregate template: tmpl/widget.tmpl handler: $FeedWidget::Widget::hdlr_widget set: main singular: 1 view: blog
  • 48. widgets: FeedsWidget: label: Feed Aggregate template: tmpl/widget.tmpl handler: $FeedWidget::Widget::hdlr_widget set: main singular: 1 view: blog
  • 49. widgets: FeedsWidget: label: Feed Aggregate template: tmpl/widget.tmpl handler: $FeedWidget::Widget::hdlr_widget set: main singular: 1 view: blog
  • 50.
  • 51.
  • 52.
  • 54. Now, all strings in the Movable Type 5 is utf-8 flagged.
  • 56. You must encode object by yourself if PublishCharset is not UTF-8.
  • 57. sub _hdlr_my_tag { my ( $ctx, $args ) = @_; my $obj = MT::Entry->load( $args->{id}); my $data = $obj->text; # do something... return MT::I18N::encode_text( $data, ‘utf-8’ ); }
  • 58. sub _hdlr_my_tag { my ( $ctx, $args ) = @_; my $obj = MT::Entry->load( $args->{id}); my $data = $obj->text; # do something... return MT::I18N::encode_text( $data, ‘utf-8’ ); }
  • 60. You are freed from obligation of Encode.
  • 61. sub _hdlr_my_tag { my ( $ctx, $args ) = @_; my $obj = MT::Entry->load( $args->{id}); my $data = $obj->text; # do something... return $data; }
  • 62. You must encode/decode your own data when...
  • 63. • Communicating with an external network. • File input/output without MT::FileMgr. • Saving valuesto columns declared in MT::Object blob format.
  • 64. sub _hdlr_my_tag { my ( $ctx, $args ) = @_; my $data; # received from web service. return Encode::decode_utf8( $data ); }
  • 65. sub _hdlr_my_tag { my ( $ctx, $args ) = @_; my $data; # received from web service. return Encode::decode_utf8( $data ); }
  • 66.
  • 67. Weʼve aimed to... • easy to understanding
  • 68. An user who has ‘manage_pages’ permission. Which actions this user can do?
  • 69. Movable Type 4... $app->can_manage_pages(); Movable Type 5... $app->can_do( ‘remove_all_trackbacks_on_webpages’ ); manage_pages: permitted_action: remove_all_trackbacks_on_webpages: 1
  • 70.
  • 72. Weʼve aimed to... • easy to understanding • Can be extensible
  • 73. permissions: blog.your_permission: group: blog_admin label: Your New Permission order: 350 permitted_action: your_action: 1 your_other_action: 1
  • 74.
  • 75. Specify the role group. • blog_admin • auth_pub • sys_admin • blog_upload (only system level) • blog_comment • blog_design
  • 76. label The display name of the permission.
  • 77. order Ordering the permission in its role group
  • 78. permitted_action Hash to define a list of actions permitted for hte use who has this permission.
  • 79. inherit_from A list of inheritance origins for this permission. Defined by references to the list.
  • 80.
  • 81.
  • 82.
  • 83.
  • 84. Of course, you can add your menu by plugin.
  • 85. applications: cms: menus: tools:my_menu: label: Your Menu Label mode: your_mode order: 150 view: blog
  • 86. You can display your menu on any dashboard
  • 87. applications: cms: menus: tools:my_menu: label: Your Menu Label mode: your_mode order: 150 view: blog
  • 88. applications: cms: menus: tools:my_menu: label: Your Menu Label mode: your_mode order: 150 view: blog
  • 89.
  • 90. You can restrict your menu by permission.
  • 91. permissions: blog.your_permission: permitted_action: your_action: 1 applications: cms: menus: tools:my_menu: label: Your Menu Label mode: your_mode order: 150 view: blog permit_action: your_action
  • 92. If your plugin still supports MT4 and MT5
  • 93. menus: create:my_object:   condition: >   sub { MT->product_version < 5; }  entries:create:   condition: >   sub { MT->product_version >= 5; }
  • 94.
  • 96.
  • 97.
  • 98.
  • 99.
  • 101. CSS
  • 102.
  • 103.
  • 104.
  • 105.
  • 106.
  • 107.
  • 108.
  • 110. Thank you for listening.

Editor's Notes

  1. &amp;#x30A6;&amp;#x30A7;&amp;#x30D6;&amp;#x30B5;&amp;#x30A4;&amp;#x30C8;&amp;#x95A2;&amp;#x4FC2;&amp;#x3060;&amp;#x3051;&amp;#x3067;&amp;#x3053;&amp;#x308C;&amp;#x3060;&amp;#x3051;&amp;#x306E;&amp;#x30BF;&amp;#x30B0;&amp;#x304C;&amp;#x8FFD;&amp;#x52A0;&amp;#x3055;&amp;#x308C;&amp;#x3066;&amp;#x3044;&amp;#x307E;&amp;#x3059;&amp;#x304C;&amp;#x3001;&amp;#x30B5;&amp;#x30A4;&amp;#x30C8;&amp;#x3092;&amp;#x898B;&amp;#x3066;&amp;#x3044;&amp;#x305F;&amp;#x3060;&amp;#x3044;&amp;#x305F;&amp;#x65B9;&amp;#x304C;&amp;#x65E9;&amp;#x3044;&amp;#x304B;&amp;#x3068;&amp;#x601D;&amp;#x3044;&amp;#x307E;&amp;#x3059;
  2. &amp;#x5272;&amp;#x611B;&amp;#x3057;&amp;#x307E;&amp;#x3059;