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

Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfOverkill Security
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 

Recently uploaded (20)

Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 

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 )