SlideShare a Scribd company logo
1 of 46
FileMaker          CakePHP


            Apple BU, Jan 2010

                 Takashi Nojima
             ELASTIC Consultants Inc.
•

•   FileMaker

•   CakePHP

•   FMCakeMix

•   Web

    •   CakePHP

    •   FMCakeMix

    •

•
•   WEB Developer / PHP / CakePHP / HTML / CSS / jQuery / PostgreSQL / MySQL / iPhone /
       /   /     /     /        /              /              / no more

•   BLOG: http://php-tips.com/
•   TWITTER: @nojimage
•   WEB Developer / PHP / CakePHP / HTML / CSS / jQuery / PostgreSQL / MySQL / iPhone /
       /   /     /     /        /              /              / no more

•   BLOG: http://php-tips.com/
•   TWITTER: @nojimage



                                 FileMaker
FileMaker
FileMaker
Manage people, projects, assets and more - the easy way!

                    •


                    •

                    •   Mac, Windows

                    •                  PDF

                    •
FileMaker
Manage people, projects, assets and more - the easy way!

                      FileMaker Pro 10

                      FileMaker Pro 10 Advanced
                      •
                      •               FileMaker Pro




                      FileMaker Server 10
                      •                               Web


                      FileMaker Server 10 Advanced
                      •   ODBC/JDBC
                      •
CakePHP
CakePHP
CakePHP enables PHP users at all levels to rapidly develop robust
                     web applications.

CakePHP PHP


                                         MVC       ORM


                                   CakePHP
CakePHP
CakePHP enables PHP users at all levels to rapidly develop robust
                     web applications.



                     ‣
                     ‣            Scaffolding

                     ‣   Bake

                     ‣   HTML                   AJAX Javascript XML RSS

                     ‣                          ACL

                     ‣
                     ‣   URL                          Router

                     ‣
                     ‣
CakePHP
CakePHP enables PHP users at all levels to rapidly develop robust
                     web applications.



                     ‣                     gettext


                     ‣                                              bake, schema, acl, i18 extractor,
                         api

                     ‣                                  CSRF

                     ‣                               HTTP

                     ‣                     memcache, apc, xcache,


                     ‣   Configure                                       App
                               importing
×

FMCakeMix
FMCakeMix

•   FileMaker               CakePHP
                        (DataSource)
    http://www.beezwax.net/solutions/FMCakeMix

•                                   FX.php
FMCakeMix

 FileMaker                       CakePHP
   Server                                  output
                           Web

             XML          FMCake
                   FX.php
                            Mix
                                           input
FMCakeMix
Web
•   FileMaker Server 10

•   Apache HTTPD

•   PHP5

•   PHP
     vim, emacs, Eclipse PDT, NetBeans, etc...


•
CakePHP

•   http://cakephp.jp/
    2010.01.20                    1.2.5   zip, bzip2, tar.gz, dmg

•
        Mac      /Users/Hoge/Sites/

•   Apache
    {            }/app/webroot/
•                                                                   .htaccess RewriteBase
FMCakeMix

•   http://github.com/beezwax/FMCakeMix
    git          git clone

•                                         dbo_fmcakemix.php
    app/models/datasources/dbo/
FX.php

•   http://www.iviking.org/FX.php/
    Download FX.zip (zipped version)

•                                       FX.php, FX_Error.php,
    FX_Constants.php, image_proxy.php   vendors/
FX.php

•                                FX.php
                   (via http://msyk.net/fmp/fx_ja/)

•   http://msyk.net/fmp/fx_ja/                        FX.php


    http://msyk.net/fmp/fx_ja/FX_patched091010.zip
FMCakeMix

                       FMCakeMix
                                       encoding




http://github.com/nojimage/FMCakeMix
•     Starter Solution
      ToDo


•



    [fmapp] fmxml
FMS

•   FMS


•   XML
Web

•   Web




•

            Web
CakePHP

•   app/core/database.php

    <?php
    class DATABASE_CONFIG {

        public $default = array(
            'driver' => 'fmcakemix',         // datasouce
             'persistent' => false,          //
             'dataSourceType' => 'FMPro7',   // FileMaker
             'scheme' => 'http',             // FMS
             'port' => 16080,                // FMS         (                   )
             'host' => '127.0.0.1',          // FMS             (                   )
             'login' => 'Admin',             // DB                      (               )
             'password' => 'admin',          // DB                          (               )
             'database' => 'To Do      ',    // DB    (             )
             'prefix' => '',                 //
             'encoding' => 'UTF-8'           //
        );

    }
Bake

•   “cake bake”          DB


•   FMCakeMix
- Model

•

•
<?php




Todo
                        class Todo extends AppModel {

                            /**
                             *
                             * @var string
                             */




Model
                            public $name = 'Todo';

                            /**
                             *
                             * @var string
                             */
                            public $primaryKey = '-recid';

                            // -- FMCakeMix
                            /**
                            *


•   $defaultLayout          * @var string
                            */
                            public $defaultLayout = 'WebLayout';

                            /**
                             *



    $fmDatabaseName
                             * @var string

•                            */
                            public $fmDatabaseName = 'To Do        ';


                            /**
                             *                  true



    $returnValueLists
                             * @var boolean

•                            */
                            public $returnValueLists = true;

                            /**
                             * call behavior
                             * @var array
                             */
                            public $actsAs = array('FmValueList');

                            /**
                             *
                             * @var array
                             */
                            public $validate = array('         ' => 'notempty');


                            /**
                             *
                             * @var array
                             */
                            public $valueLists = array();
                        }
- Controller

•

•   CakePHP
    http://example.com/{controller }/{action }

•                URI
        action
Todos
               <?php
               class TodosController extends AppController {

                   public $name = 'Todos';

                   public $uses = array('Todo');




Controller         /**
                    *
                    * @var Todo
                    */
                   public $Todo;

                   /**
                    *
                    */
                  public function index()
•   index()       {
                       $this->set('todos', $this->paginate());
                  }

                   /**
                    *
                    */
•   view()        public function view($id = null)
                  {
                       if (!$id) {
                           $this->Session->setFlash(__('       ID    ', true));
                             $this->redirect(array('action'=>'index'));
                         }

•   add()         }
                         $this->set('todo', $this->Todo->read(null, $id));



                   /**
                    *
                    */

    edit()
                  public function add()
•                 {
                       //
                         $this->set('valueLists', $this->Todo->valueLists);

                         if (!empty($this->data)) {
                             // POST

•   delete()                 $this->Todo->create();

                             if ($this->Todo->save($this->data)) {
                                 $this->Session->setFlash(__('TODO            ', true));
                                 $this->redirect(array('action'=>'index'));
                             } else {
                                 $this->Session->setFlash(__('TODO                ', true));
                             }
                         }
                  }

                   /**
                    *
- View

•

•

•
Todos
               <?php

               $this->pageTitle = __('TODO     ', true);


               $javascript->codeBlock("
               ", array('inline' => false));




View (Index)
               ?>
               <h2><?php echo $this->pageTitle; ?></h2>

               <div class="todos index content">

               <?php if (empty($todos)) : ?>
               <p><?php __('            TODO             ') ?></p>
               <?php else: ?>
               <p class="pagination-count"><?php echo $paginator->counter(array('format' => __('          %count%     ,


               <table class="data-table">


•   Todo
               <tr>
                    <th><?php echo $paginator->sort('         ', '         ');?></th>
                   <th><?php echo $paginator->sort('        ', '        ');?></th>
                   <th><?php echo $paginator->sort('       ', '      ');?></th>
                   <th><?php echo $paginator->sort('          ', '         ');?></th>
                   <th><?php echo $paginator->sort('          ', '         ');?></th>
                   <th><?php echo $paginator->sort('       ', '      ');?></th>
                   <th><?php echo $paginator->sort('       ', '      ');?></th>
                   <th><?php echo $paginator->sort('        ', '        ');?></th>
                   <th class="actions"><?php __('       ');?></th>
               </tr>
               <?php
               $i = 0;
               foreach ($todos as $todo): $i++;
               ?>
                   <tr<?php echo ($i % 2 == 0) ? ' class="altrow"' : '';?>>
                       <td><?php echo $html->link($todo['Todo']['      '], array('action' => 'view',         $todo['
                       <td><?php echo $todo['Todo']['        '] ? $time->format('Y-m-d', $todo['Todo']['            '])
                       <td><?php echo $todo['Todo']['       '] ? $time->format('Y-m-d', $todo['Todo']['       ']) : '
                       <td><?php echo $todo['Todo']['             '] ?></td>
                       <td><?php echo $todo['Todo']['             '] ?></td>
                       <td><?php echo $todo['Todo']['       '] ?></td>
                       <td><?php echo $todo['Todo']['       '] ? $todo['Todo']['        '] : '' ?></td>
                       <td><?php echo $todo['Todo']['        '] ? $time->format('Y-m-d', $todo['Todo']['            '])
                       <td class="actions">
                           <?php echo $html->link(__('       ', true), array('action' => 'edit', $todo['Todo']['-
                           <?php echo $html->link(__('       ', true), array('action' => 'delete', $todo['Todo'][
                        </td>
                   </tr>
               <?php endforeach; ?>
               </table>

               <div class="paging">
                   <?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'dis
                   <?php echo $paginator->numbers();?>
                   <?php echo $paginator->next(__('next', true).' >>', array(), null, array('class' => 'disab
Todos
              <div class="ads view">
              <h2><?php __('Todo');?></h2>
              <dl>
              <?php $i = 0; $class = ' class="altrow"';?>
                   <dt <?php if ($i % 2 == 0) echo $class;?>><?php __('      '); ?></dt>
                  <dd <?php if ($i++ % 2 == 0) echo $class;?>><?php echo $todo['Todo']['         ']; ?>




View (view)
                  &nbsp;</dd>
                  <dt <?php if ($i % 2 == 0) echo $class;?>><?php __('    '); ?></dt>
                  <dd <?php if ($i++ % 2 == 0) echo $class;?>><?php echo $todo['Todo']['    ']; ?>
                  &nbsp;</dd>
                  <dt <?php if ($i % 2 == 0) echo $class;?>><?php __('     '); ?></dt>
                  <dd <?php if ($i++ % 2 == 0) echo $class;?>><?php echo $todo['Todo']['     '] ? $time->for
                  &nbsp;</dd>
                  <dt <?php if ($i % 2 == 0) echo $class;?>><?php __('    '); ?></dt>
                  <dd <?php if ($i++ % 2 == 0) echo $class;?>><?php echo $todo['Todo']['    '] ? $time->forma


•   Todo          &nbsp;</dd>
                  <dt <?php if ($i % 2 == 0) echo $class;?>><?php __('       '); ?></dt>
                  <dd <?php if ($i++ % 2 == 0) echo $class;?>><?php echo $todo['Todo']['         ']; ?>
                  &nbsp;</dd>
                  <dt <?php if ($i % 2 == 0) echo $class;?>><?php __('       '); ?></dt>
                  <dd <?php if ($i++ % 2 == 0) echo $class;?>><?php echo $todo['Todo']['         ']; ?>
                  &nbsp;</dd>
                  <dt <?php if ($i % 2 == 0) echo $class;?>><?php __('    '); ?></dt>
                  <dd <?php if ($i++ % 2 == 0) echo $class;?>><?php echo nl2br($todo['Todo']['       ']); ?>
                  &nbsp;</dd>
                  <dt <?php if ($i % 2 == 0) echo $class;?>><?php __('     '); ?></dt>
                  <dd <?php if ($i++ % 2 == 0) echo $class;?>><?php echo $todo['Todo']['     '] ? $time->for
                  &nbsp;</dd>
                  <dt <?php if ($i % 2 == 0) echo $class;?>><?php __('    '); ?></dt>
                  <dd <?php if ($i++ % 2 == 0) echo $class;?>><?php echo $todo['Todo']['    '] ? '○' : '' ?>
                   &nbsp;</dd>
              </dl>
              </div>
              <div class="actions">
              <ul>
                   <li><?php echo $html->link(__('   ', true), array('action' => 'edit', $todo['Todo']['-reci
                  <li><?php echo $html->link(__('    ', true), array('action' => 'delete', $form->value('Todo
                  <li><?php echo $html->link(__('TODO     ', true), array('action' => 'index')); ?></li>
              </ul>
              </div>
Todos
             <?php
             $this->pageTitle = __('TODO       ', true);


             $fields = array(
                 '      ' => array('label' => __('           ', true)),




View (Add)
                  '       ' => array('label' => __('         ', true), 'options' => $valueList
                  '       ' => array('label' => __('         ', true), 'options' => $valueList
                  '   ' => array('label' => __('       ', true), 'options' => $valueLists['
                  '      ' => array('label' => __('       ', true), 'dateFormat' => 'YMD', 'mo
                  '   ' => array('label' => __('       ', true), 'dateFormat' => 'YMD', 'monthN
                  '   ' => array('label' => __('       ', true), 'type' => 'textarea'),
             );
•   Todo     $javascript->codeBlock("
             ", array('inline' => false));

             ?>
             <h2><?php echo $this->pageTitle; ?></h2>
             <?php echo $form->create(); ?>
             <?php echo $form->inputs($fields); ?>
             <?php echo $form->end(__('   ', true)); ?>


             <div class="actions">
                 <ul>
                      <li><?php echo $html->link(__('TODO        ', true), array('action' => '
                 </ul>
             </div>
Todos
              <?php
              $this->pageTitle = __('TODO       ', true);


              $fields = array(
                  '      ' => array('label' => __('           ', true)),




View (Edit)
                   '       ' => array('label' => __('         ', true), 'options' => $valueList
                   '       ' => array('label' => __('         ', true), 'options' => $valueList
                   '   ' => array('label' => __('       ', true), 'options' => $valueLists['
                   '      ' => array('label' => __('       ', true), 'dateFormat' => 'YMD', 'mo
                   '   ' => array('label' => __('       ', true), 'dateFormat' => 'YMD', 'monthN
                   '   ' => array('label' => __('       ', true), 'type' => 'textarea'),
                   '      ' => array('label' => __('       ', true), 'type' => 'text', 'value'
•   Todo           ')) : '')),
                   '   ' => array('label' => __('       ', true), 'type' => 'checkbox'),
              );

              $javascript->codeBlock("
              ", array('inline' => false));

              ?>
              <h2><?php echo $this->pageTitle; ?></h2>
              <?php echo $form->create(); ?>
              <?php echo $form->hidden('Todo.-recid'); ?>
              <?php echo $form->inputs($fields); ?>
              <?php echo $form->end(__('   ', true)); ?>


              <div class="actions">
                  <ul>
                       <li><?php echo $html->link(__('      ', true), array('action' => 'delete
              true)); ?></li>
                      <li><?php echo $html->link(__('TODO         ', true), array('action' => '
                  </ul>
              </div>
FMCakeMix

•         FileMaker DB            WEB
    WEB

•



•   Web                  (Ajax)

•             iPhone
FMCakeMix
•   FileMaker
    •   Container Fields : container fields will supply a url string to the resource or a copy of the resource made by filemaker,
        but files can not be uploaded into container fields. (                                                              )


•   CakePHP Model
    •   Attributes
         •   hasOne : currently no support for this relationship type (hasOne                                        )

         •   hasAndBelongsToMany : currently no support for this relationship type Methods (HABTM                                                  )


    •   Methods
         •   deleteAll : only takes the condition that the -recid equals the recid of the record to delete and therefore does not support deleting many records at a
             time. Also, you must pass a boolean false as the second parameter of this request so that it does not attempt recursive deletion of related records (
                                                               )

         •   save : the fields parameter, or white list of fields to save, does not work. ($fieldList                             )
20100120 AppleBU - FileMakerとCakePHPでつくる簡単Webアプリケーション

More Related Content

Recently uploaded

Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Julian Hyde
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsStefano
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty SecureFemke de Vroome
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfFIDO Alliance
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceSamy Fodil
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomCzechDreamin
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessUXDXConf
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftshyamraj55
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyJohn Staveley
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?Mark Billinghurst
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...FIDO Alliance
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfFIDO Alliance
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...CzechDreamin
 
The UX of Automation by AJ King, Senior UX Researcher, Ocado
The UX of Automation by AJ King, Senior UX Researcher, OcadoThe UX of Automation by AJ King, Senior UX Researcher, Ocado
The UX of Automation by AJ King, Senior UX Researcher, OcadoUXDXConf
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutesconfluent
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlPeter Udo Diehl
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIES VE
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024Stephanie Beckett
 
Connecting the Dots in Product Design at KAYAK
Connecting the Dots in Product Design at KAYAKConnecting the Dots in Product Design at KAYAK
Connecting the Dots in Product Design at KAYAKUXDXConf
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераMark Opanasiuk
 

Recently uploaded (20)

Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty Secure
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoft
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
The UX of Automation by AJ King, Senior UX Researcher, Ocado
The UX of Automation by AJ King, Senior UX Researcher, OcadoThe UX of Automation by AJ King, Senior UX Researcher, Ocado
The UX of Automation by AJ King, Senior UX Researcher, Ocado
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo DiehlFuture Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
Future Visions: Predictions to Guide and Time Tech Innovation, Peter Udo Diehl
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 
Connecting the Dots in Product Design at KAYAK
Connecting the Dots in Product Design at KAYAKConnecting the Dots in Product Design at KAYAK
Connecting the Dots in Product Design at KAYAK
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

20100120 AppleBU - FileMakerとCakePHPでつくる簡単Webアプリケーション

  • 1. FileMaker CakePHP Apple BU, Jan 2010 Takashi Nojima ELASTIC Consultants Inc.
  • 2. • • FileMaker • CakePHP • FMCakeMix • Web • CakePHP • FMCakeMix • •
  • 3. WEB Developer / PHP / CakePHP / HTML / CSS / jQuery / PostgreSQL / MySQL / iPhone / / / / / / / / no more • BLOG: http://php-tips.com/ • TWITTER: @nojimage
  • 4. WEB Developer / PHP / CakePHP / HTML / CSS / jQuery / PostgreSQL / MySQL / iPhone / / / / / / / / no more • BLOG: http://php-tips.com/ • TWITTER: @nojimage FileMaker
  • 6. FileMaker Manage people, projects, assets and more - the easy way! • • • Mac, Windows • PDF •
  • 7. FileMaker Manage people, projects, assets and more - the easy way! FileMaker Pro 10 FileMaker Pro 10 Advanced • • FileMaker Pro FileMaker Server 10 • Web FileMaker Server 10 Advanced • ODBC/JDBC •
  • 9. CakePHP CakePHP enables PHP users at all levels to rapidly develop robust web applications. CakePHP PHP MVC ORM CakePHP
  • 10. CakePHP CakePHP enables PHP users at all levels to rapidly develop robust web applications. ‣ ‣ Scaffolding ‣ Bake ‣ HTML AJAX Javascript XML RSS ‣ ACL ‣ ‣ URL Router ‣ ‣
  • 11. CakePHP CakePHP enables PHP users at all levels to rapidly develop robust web applications. ‣ gettext ‣ bake, schema, acl, i18 extractor, api ‣ CSRF ‣ HTTP ‣ memcache, apc, xcache, ‣ Configure App importing
  • 13. FMCakeMix • FileMaker CakePHP (DataSource) http://www.beezwax.net/solutions/FMCakeMix • FX.php
  • 14. FMCakeMix FileMaker CakePHP Server output Web XML FMCake FX.php Mix input
  • 16. FileMaker Server 10 • Apache HTTPD • PHP5 • PHP vim, emacs, Eclipse PDT, NetBeans, etc... •
  • 17. CakePHP • http://cakephp.jp/ 2010.01.20 1.2.5 zip, bzip2, tar.gz, dmg • Mac /Users/Hoge/Sites/ • Apache { }/app/webroot/ • .htaccess RewriteBase
  • 18.
  • 19.
  • 20. FMCakeMix • http://github.com/beezwax/FMCakeMix git git clone • dbo_fmcakemix.php app/models/datasources/dbo/
  • 21.
  • 22.
  • 23.
  • 24. FX.php • http://www.iviking.org/FX.php/ Download FX.zip (zipped version) • FX.php, FX_Error.php, FX_Constants.php, image_proxy.php vendors/
  • 25.
  • 26. FX.php • FX.php (via http://msyk.net/fmp/fx_ja/) • http://msyk.net/fmp/fx_ja/ FX.php http://msyk.net/fmp/fx_ja/FX_patched091010.zip
  • 27. FMCakeMix FMCakeMix encoding http://github.com/nojimage/FMCakeMix
  • 28. Starter Solution ToDo • [fmapp] fmxml
  • 29. FMS • FMS • XML
  • 30. Web • Web • Web
  • 31. CakePHP • app/core/database.php <?php class DATABASE_CONFIG { public $default = array( 'driver' => 'fmcakemix', // datasouce 'persistent' => false, // 'dataSourceType' => 'FMPro7', // FileMaker 'scheme' => 'http', // FMS 'port' => 16080, // FMS ( ) 'host' => '127.0.0.1', // FMS ( ) 'login' => 'Admin', // DB ( ) 'password' => 'admin', // DB ( ) 'database' => 'To Do ', // DB ( ) 'prefix' => '', // 'encoding' => 'UTF-8' // ); }
  • 32. Bake • “cake bake” DB • FMCakeMix
  • 34. <?php Todo class Todo extends AppModel { /** * * @var string */ Model public $name = 'Todo'; /** * * @var string */ public $primaryKey = '-recid'; // -- FMCakeMix /** * • $defaultLayout * @var string */ public $defaultLayout = 'WebLayout'; /** * $fmDatabaseName * @var string • */ public $fmDatabaseName = 'To Do '; /** * true $returnValueLists * @var boolean • */ public $returnValueLists = true; /** * call behavior * @var array */ public $actsAs = array('FmValueList'); /** * * @var array */ public $validate = array(' ' => 'notempty'); /** * * @var array */ public $valueLists = array(); }
  • 35. - Controller • • CakePHP http://example.com/{controller }/{action } • URI action
  • 36. Todos <?php class TodosController extends AppController { public $name = 'Todos'; public $uses = array('Todo'); Controller /** * * @var Todo */ public $Todo; /** * */ public function index() • index() { $this->set('todos', $this->paginate()); } /** * */ • view() public function view($id = null) { if (!$id) { $this->Session->setFlash(__(' ID ', true)); $this->redirect(array('action'=>'index')); } • add() } $this->set('todo', $this->Todo->read(null, $id)); /** * */ edit() public function add() • { // $this->set('valueLists', $this->Todo->valueLists); if (!empty($this->data)) { // POST • delete() $this->Todo->create(); if ($this->Todo->save($this->data)) { $this->Session->setFlash(__('TODO ', true)); $this->redirect(array('action'=>'index')); } else { $this->Session->setFlash(__('TODO ', true)); } } } /** *
  • 38. Todos <?php $this->pageTitle = __('TODO ', true); $javascript->codeBlock(" ", array('inline' => false)); View (Index) ?> <h2><?php echo $this->pageTitle; ?></h2> <div class="todos index content"> <?php if (empty($todos)) : ?> <p><?php __(' TODO ') ?></p> <?php else: ?> <p class="pagination-count"><?php echo $paginator->counter(array('format' => __(' %count% , <table class="data-table"> • Todo <tr> <th><?php echo $paginator->sort(' ', ' ');?></th> <th><?php echo $paginator->sort(' ', ' ');?></th> <th><?php echo $paginator->sort(' ', ' ');?></th> <th><?php echo $paginator->sort(' ', ' ');?></th> <th><?php echo $paginator->sort(' ', ' ');?></th> <th><?php echo $paginator->sort(' ', ' ');?></th> <th><?php echo $paginator->sort(' ', ' ');?></th> <th><?php echo $paginator->sort(' ', ' ');?></th> <th class="actions"><?php __(' ');?></th> </tr> <?php $i = 0; foreach ($todos as $todo): $i++; ?> <tr<?php echo ($i % 2 == 0) ? ' class="altrow"' : '';?>> <td><?php echo $html->link($todo['Todo'][' '], array('action' => 'view', $todo[' <td><?php echo $todo['Todo'][' '] ? $time->format('Y-m-d', $todo['Todo'][' ']) <td><?php echo $todo['Todo'][' '] ? $time->format('Y-m-d', $todo['Todo'][' ']) : ' <td><?php echo $todo['Todo'][' '] ?></td> <td><?php echo $todo['Todo'][' '] ?></td> <td><?php echo $todo['Todo'][' '] ?></td> <td><?php echo $todo['Todo'][' '] ? $todo['Todo'][' '] : '' ?></td> <td><?php echo $todo['Todo'][' '] ? $time->format('Y-m-d', $todo['Todo'][' ']) <td class="actions"> <?php echo $html->link(__(' ', true), array('action' => 'edit', $todo['Todo']['- <?php echo $html->link(__(' ', true), array('action' => 'delete', $todo['Todo'][ </td> </tr> <?php endforeach; ?> </table> <div class="paging"> <?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'dis <?php echo $paginator->numbers();?> <?php echo $paginator->next(__('next', true).' >>', array(), null, array('class' => 'disab
  • 39. Todos <div class="ads view"> <h2><?php __('Todo');?></h2> <dl> <?php $i = 0; $class = ' class="altrow"';?> <dt <?php if ($i % 2 == 0) echo $class;?>><?php __(' '); ?></dt> <dd <?php if ($i++ % 2 == 0) echo $class;?>><?php echo $todo['Todo'][' ']; ?> View (view) &nbsp;</dd> <dt <?php if ($i % 2 == 0) echo $class;?>><?php __(' '); ?></dt> <dd <?php if ($i++ % 2 == 0) echo $class;?>><?php echo $todo['Todo'][' ']; ?> &nbsp;</dd> <dt <?php if ($i % 2 == 0) echo $class;?>><?php __(' '); ?></dt> <dd <?php if ($i++ % 2 == 0) echo $class;?>><?php echo $todo['Todo'][' '] ? $time->for &nbsp;</dd> <dt <?php if ($i % 2 == 0) echo $class;?>><?php __(' '); ?></dt> <dd <?php if ($i++ % 2 == 0) echo $class;?>><?php echo $todo['Todo'][' '] ? $time->forma • Todo &nbsp;</dd> <dt <?php if ($i % 2 == 0) echo $class;?>><?php __(' '); ?></dt> <dd <?php if ($i++ % 2 == 0) echo $class;?>><?php echo $todo['Todo'][' ']; ?> &nbsp;</dd> <dt <?php if ($i % 2 == 0) echo $class;?>><?php __(' '); ?></dt> <dd <?php if ($i++ % 2 == 0) echo $class;?>><?php echo $todo['Todo'][' ']; ?> &nbsp;</dd> <dt <?php if ($i % 2 == 0) echo $class;?>><?php __(' '); ?></dt> <dd <?php if ($i++ % 2 == 0) echo $class;?>><?php echo nl2br($todo['Todo'][' ']); ?> &nbsp;</dd> <dt <?php if ($i % 2 == 0) echo $class;?>><?php __(' '); ?></dt> <dd <?php if ($i++ % 2 == 0) echo $class;?>><?php echo $todo['Todo'][' '] ? $time->for &nbsp;</dd> <dt <?php if ($i % 2 == 0) echo $class;?>><?php __(' '); ?></dt> <dd <?php if ($i++ % 2 == 0) echo $class;?>><?php echo $todo['Todo'][' '] ? '○' : '' ?> &nbsp;</dd> </dl> </div> <div class="actions"> <ul> <li><?php echo $html->link(__(' ', true), array('action' => 'edit', $todo['Todo']['-reci <li><?php echo $html->link(__(' ', true), array('action' => 'delete', $form->value('Todo <li><?php echo $html->link(__('TODO ', true), array('action' => 'index')); ?></li> </ul> </div>
  • 40. Todos <?php $this->pageTitle = __('TODO ', true); $fields = array( ' ' => array('label' => __(' ', true)), View (Add) ' ' => array('label' => __(' ', true), 'options' => $valueList ' ' => array('label' => __(' ', true), 'options' => $valueList ' ' => array('label' => __(' ', true), 'options' => $valueLists[' ' ' => array('label' => __(' ', true), 'dateFormat' => 'YMD', 'mo ' ' => array('label' => __(' ', true), 'dateFormat' => 'YMD', 'monthN ' ' => array('label' => __(' ', true), 'type' => 'textarea'), ); • Todo $javascript->codeBlock(" ", array('inline' => false)); ?> <h2><?php echo $this->pageTitle; ?></h2> <?php echo $form->create(); ?> <?php echo $form->inputs($fields); ?> <?php echo $form->end(__(' ', true)); ?> <div class="actions"> <ul> <li><?php echo $html->link(__('TODO ', true), array('action' => ' </ul> </div>
  • 41. Todos <?php $this->pageTitle = __('TODO ', true); $fields = array( ' ' => array('label' => __(' ', true)), View (Edit) ' ' => array('label' => __(' ', true), 'options' => $valueList ' ' => array('label' => __(' ', true), 'options' => $valueList ' ' => array('label' => __(' ', true), 'options' => $valueLists[' ' ' => array('label' => __(' ', true), 'dateFormat' => 'YMD', 'mo ' ' => array('label' => __(' ', true), 'dateFormat' => 'YMD', 'monthN ' ' => array('label' => __(' ', true), 'type' => 'textarea'), ' ' => array('label' => __(' ', true), 'type' => 'text', 'value' • Todo ')) : '')), ' ' => array('label' => __(' ', true), 'type' => 'checkbox'), ); $javascript->codeBlock(" ", array('inline' => false)); ?> <h2><?php echo $this->pageTitle; ?></h2> <?php echo $form->create(); ?> <?php echo $form->hidden('Todo.-recid'); ?> <?php echo $form->inputs($fields); ?> <?php echo $form->end(__(' ', true)); ?> <div class="actions"> <ul> <li><?php echo $html->link(__(' ', true), array('action' => 'delete true)); ?></li> <li><?php echo $html->link(__('TODO ', true), array('action' => ' </ul> </div>
  • 42.
  • 43.
  • 44. FMCakeMix • FileMaker DB WEB WEB • • Web (Ajax) • iPhone
  • 45. FMCakeMix • FileMaker • Container Fields : container fields will supply a url string to the resource or a copy of the resource made by filemaker, but files can not be uploaded into container fields. ( ) • CakePHP Model • Attributes • hasOne : currently no support for this relationship type (hasOne ) • hasAndBelongsToMany : currently no support for this relationship type Methods (HABTM ) • Methods • deleteAll : only takes the condition that the -recid equals the recid of the record to delete and therefore does not support deleting many records at a time. Also, you must pass a boolean false as the second parameter of this request so that it does not attempt recursive deletion of related records ( ) • save : the fields parameter, or white list of fields to save, does not work. ($fieldList )