Introducing 

Prezi AI.

Your new presentation assistant.

Refine, enhance, and tailor your content, source relevant images, and edit visuals quicker than ever before.

Loading…
Transcript

ご清聴有り難うございました!

第5回CakePHP@tokyo

あのCMS「eZ Publish」をCakePHPのModelにしちゃう

Make a DataSource for eZ Publish

eZの開発をCakePHPに例えてみる

bennylee (@leebenny)

株式会社ミツエーリンクス所属

今はここ。

CakePHP 1.3.0

eZ Publish 4.3.0

Agenda

1分間

3分間

Webが好き!

1分間

  • eZ本体をDownload
  • Install
  • Cake本体をDownload
  • ファイル配置

雑談/自己紹介

eZ Publishの話

2分間

準備

eZの開発をCakePHPに例えてみる

DataSource for eZの仕組

3分間

Demo

Demo

エンタープライズCMS

eZ Publish講座やってます!

日本での実績

CakePHP

(webapp.php)

設計

(index.php)

eZ

  • DB Table 設計
  • Books

id

title

detail

  • SQLでデータ投入
  • Class 設計
  • Books

id

title

detail

  • 管理画面からデータ投入

一覧(paginate使用)

  • /webapp.php/books/

Class

詳細はこちらをご覧ください

新規

  • /webapp.php/books/add/

books

  • id
  • title
  • detail

編集

  • /webapp.php/books/edit/

ezurl(node達の配置場所)

http://www.mitsue.co.jp/product/ez_training/quick_start.html

eZ Publishの話

/mybooks/*

削除

  • /webapp.php/books/delete/(id)

http://www.shinshu-liveon.jp/

その他、大手出版社、デジタル系出版社、ネット系証券会社などなどの事例もございます。

データ

投入

SQLで投入

  • Nodeという概念
  • 親Nodeを選び
  • Classを選び
  • Nodeを作成

世界での実績

Class

(books)

すてべのデータは

nodeで表現する

(bookA)

(bookB)

Node1

Node2

ezurl: /mybooks/1

ezurl: /mybooks/2

nodeのパス、mybooksは親node

http://www.elle.fr/elle

データ管理専用

http://vpf.mit.edu/

http://vlada.hr/

see more in

http://ez.no/customers/case_studies

アーキテクチャ

設定ファイルを書く

siteaccess.ini.append.php

  • 独自extension設定

C

C

override.ini.append.php

  • urlからnoteとviewを特定

実装不要

CMSだけではない

M

v

eZのAPIがすごい!

M

V

eZ Template言語で実装

Smartyに似てる

  • 会員サイト機能

作業中心

Operator

BooksController

eZのAPIを利用

  • 外部連携をもっと簡単に

templateの拡張機能

CakePHPで言えばHelper

Operatorの実装もeZのAPIを使用

DataSource

for eZ

CakePHPで実装したOperator

public function index() {

$this->paginate = array(

'conditions'=>array('_ezurl'=>'mybooks'),

'limit'=>2,

'order'=>array('node_id',false),

);

$childs = $this->paginate();

$this->set('books',$childs);

}

public function view($id) {

$childs = $this->Book->find("all",array(

'conditions'=>array('_ezurl'=>'mybooks/'.$id),

'target'=>'self',

));

$this->set('book',$childs);

}

public function add() {

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

$save_data = $this->data;

$save_data['Book']['_ezurl'] = 'mybooks';

if ($this->Book->save($save_data)) {

$this->flash('Your post has been saved.','/books');

}

}

}

public function delete($id) {

$this->Book->eZdel('mybooks/'.$id);

$this->flash('The book with id: '.$id.' has been deleted.', '/books');

}

public function edit($id = null) {

if (empty($this->data)) {

$this->data = $this->Book->find("all",array(

'conditions'=>array('_ezurl'=>'mybooks/'.$id),

'target'=>'self',

));

} else {

if ($this->Book->eZupdate('mybooks/'.$id,$this->data['Book'])) {

$this->flash('Your book has been updated.','/books');

}

}

}

  • サービスをもっと自由に

Githubで公開中ver0.1

http://github.com/leebenny/CakePHP-DataSource-for-eZ-Publish

Learn more about creating dynamic, engaging presentations with Prezi