2011 xe camp 모듈제작가이드

66
XpressEngine Module 제작 가이드 작성자: 오봉근, 김예솔 소속팀 / 상위부서: XE개발팀 작성년월일: 2011.11.26 2010 NHN CORPORATION 2010 NHN CORPORATION

Upload: sol-kim

Post on 05-Dec-2014

3.283 views

Category:

Technology


0 download

DESCRIPTION

 

TRANSCRIPT

Page 1: 2011 XE Camp 모듈제작가이드

XpressEngine����������� ������������������  Module����������� ������������������  제작����������� ������������������  가이드����������� ������������������  

작성자:����������� ������������������  오봉근,����������� ������������������  김예솔����������� ������������������  

소속팀����������� ������������������  /����������� ������������������  상위부서:����������� ������������������  XE개발팀����������� ������������������  ����������� ������������������  ����������� ������������������  

작성년월일:����������� ������������������  2011.11.26����������� ������������������  

ⓒ 2010����������� ������������������  NHN����������� ������������������  CORPORATION ⓒ 2010����������� ������������������  NHN����������� ������������������  CORPORATION

Page 2: 2011 XE Camp 모듈제작가이드

1.����������� ������������������  XE����������� ������������������  동작����������� ������������������  구조����������� ������������������  

Page 3: 2011 XE Camp 모듈제작가이드

index.php����������� ������������������  

Page 4: 2011 XE Camp 모듈제작가이드

Context����������� ������������������  

Module����������� ������������������  Handler����������� ������������������  

ProcModule����������� ������������������  

Display����������� ������������������  Handler����������� ������������������  

HTML����������� ������������������  Response����������� ������������������  

Page 5: 2011 XE Camp 모듈제작가이드

Context����������� ������������������  

Module����������� ������������������  Handler����������� ������������������  

ProcModule����������� ������������������  

Display����������� ������������������  Handler����������� ������������������  

HTML����������� ������������������  Response����������� ������������������  

Page 6: 2011 XE Camp 모듈제작가이드

2.����������� ������������������  Memo����������� ������������������  모듈����������� ������������������  

Page 7: 2011 XE Camp 모듈제작가이드

Memo����������� ������������������  모듈����������� ������������������  기능����������� ������������������  

����������� ������������������  

1. 메모����������� ������������������  쓰기����������� ������������������  

2. 메모����������� ������������������  리스트����������� ������������������  보기����������� ������������������  

3. 메모����������� ������������������  내용����������� ������������������  보기����������� ������������������  

����������� ������������������  

Page 8: 2011 XE Camp 모듈제작가이드

기능을����������� ������������������  Action����������� ������������������  으로!����������� ������������������  

����������� ������������������  

1. 메모����������� ������������������  쓰기����������� ������������������  (화면)����������� ������������������  :����������� ������������������  dispMemoWrite����������� ������������������  

2. 메모����������� ������������������  쓰기����������� ������������������  (DB삽입)����������� ������������������  :����������� ������������������  procMemoInsert����������� ������������������  

3. 메모����������� ������������������  리스트����������� ������������������  보기����������� ������������������  (화면)����������� ������������������  :����������� ������������������  dispMemoList����������� ������������������  

4. 메모����������� ������������������  내용����������� ������������������  보기����������� ������������������  (화면)����������� ������������������  :����������� ������������������  dispMemoView����������� ������������������  

����������� ������������������  ����������� ������������������  

����������� ������������������  

Page 9: 2011 XE Camp 모듈제작가이드
Page 10: 2011 XE Camp 모듈제작가이드

3.����������� ������������������  Memo����������� ������������������  모듈����������� ������������������  ����������� ������������������  구조����������� ������������������  

Page 11: 2011 XE Camp 모듈제작가이드

conf����������� ������������������  lang����������� ������������������  queries����������� ������������������  rulesets����������� ������������������  schemas����������� ������������������  skins����������� ������������������  tpl����������� ������������������  ����������� ������������������  

memo.class.php����������� ������������������  memo.controller.php����������� ������������������  memo.model.php����������� ������������������  memo.view.php����������� ������������������  ����������� ������������������  

XE설치����������� ������������������  디렉토리����������� ������������������  /����������� ������������������  modules����������� ������������������  /����������� ������������������  memo����������� ������������������  /����������� ������������������  

Page 12: 2011 XE Camp 모듈제작가이드

memo.class.php����������� ������������������  ����������� ������������������  ����������� ������������������  =>����������� ������������������  memo����������� ������������������  모듈의����������� ������������������  최상위����������� ������������������  class����������� ������������������  ����������� ������������������  모듈����������� ������������������  설치시,����������� ������������������  모듈����������� ������������������  업데이트시����������� ������������������  

Page 13: 2011 XE Camp 모듈제작가이드

memo.controller.php����������� ������������������  ����������� ������������������  =>����������� ������������������  memoController����������� ������������������  Class����������� ������������������  ����������� ������������������  DB/File에����������� ������������������  데이터����������� ������������������  저장,����������� ������������������  수정,����������� ������������������  삭제����������� ������������������  

Page 14: 2011 XE Camp 모듈제작가이드

memo.model.php����������� ������������������  ����������� ������������������  =>����������� ������������������  memoModel����������� ������������������  Class����������� ������������������  ����������� ������������������  DB/File����������� ������������������  에서����������� ������������������  데이터����������� ������������������  읽기����������� ������������������  ����������� ������������������  

Page 15: 2011 XE Camp 모듈제작가이드

memo.view.php����������� ������������������  ����������� ������������������  =>����������� ������������������  memoView����������� ������������������  Class����������� ������������������  ����������� ������������������  템플릿과����������� ������������������  연결하여����������� ������������������  화면����������� ������������������  출력����������� ������������������  ����������� ������������������  

Page 16: 2011 XE Camp 모듈제작가이드

4.����������� ������������������  기본����������� ������������������  파일����������� ������������������  생성����������� ������������������  

Page 17: 2011 XE Camp 모듈제작가이드

./conf/info.xml����������� ������������������  ����������� ������������������  

����������� ������������������  ����������� ������������������  <module����������� ������������������  version="0.2">����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <title����������� ������������������  xml:lang="ko">메모</title>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <description����������� ������������������  xml:lang="ko">메모����������� ������������������  모듈입니다.</description>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <version>0.1</version>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <date>2011-10-14</date>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <category>content</category>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <author����������� ������������������  [email protected]����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  link="http://xpressengine.com/">����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <name����������� ������������������  xml:lang="ko">NHN</name>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <name����������� ������������������  xml:lang="jp">NHN</name>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <name����������� ������������������  xml:lang="en">NHN</name>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  </author>����������� ������������������  </module>����������� ������������������  

Page 18: 2011 XE Camp 모듈제작가이드

./conf/module.xml����������� ������������������  ����������� ������������������  ����������� ������������������  

����������� ������������������  

<module>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <grants����������� ������������������  />����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <permissions����������� ������������������  />����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <actions����������� ������������������  />����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <menus����������� ������������������  />����������� ������������������  </module>����������� ������������������  

http://code.google.com/p/xe-core/wiki/module_xml����������� ������������������  

Page 19: 2011 XE Camp 모듈제작가이드

memo.class.php����������� ������������������  ����������� ������������������  

����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  class����������� ������������������  memo����������� ������������������  extends����������� ������������������  ModuleObject����������� ������������������  {����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  function����������� ������������������  moduleInstall()����������� ������������������  {}����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  function����������� ������������������  moduleUninstall()����������� ������������������  {}����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  function����������� ������������������  checkUpdate()����������� ������������������  {}����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  function����������� ������������������  moduleUpdate()����������� ������������������  {}����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  function����������� ������������������  recompileCache()����������� ������������������  {}����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  }����������� ������������������  

Page 20: 2011 XE Camp 모듈제작가이드

5.����������� ������������������  본격적인����������� ������������������  개발����������� ������������������  

Page 21: 2011 XE Camp 모듈제작가이드

5-1.����������� ������������������  Memo����������� ������������������  쓰기����������� ������������������  화면����������� ������������������  

Page 22: 2011 XE Camp 모듈제작가이드
Page 23: 2011 XE Camp 모듈제작가이드

/index.php?module=memo&act=dispMemoWrite����������� ������������������  

Context����������� ������������������  

ModuleHandler����������� ������������������  

memo.view.php����������� ������������������  

dispMemoWrite()����������� ������������������  

memo_view.html����������� ������������������  

Page 24: 2011 XE Camp 모듈제작가이드

/index.php?module=memo&act=dispMemoWrite����������� ������������������  

Context����������� ������������������  

ModuleHandler����������� ������������������  

memo.view.php����������� ������������������  

dispMemoWrite()����������� ������������������  

memo_view.html����������� ������������������  

module.xml����������� ������������������  

Page 25: 2011 XE Camp 모듈제작가이드

./conf/module.xml����������� ������������������  ����������� ������������������  ����������� ������������������  

<module>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <grants����������� ������������������  />����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <permissions����������� ������������������  />����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <actions>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <action����������� ������������������  name="dispMemoWrite"����������� ������������������  type="view"����������� ������������������  standalone="true"����������� ������������������  />����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  </actions>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <menus����������� ������������������  />����������� ������������������  </module>����������� ������������������  

Page 26: 2011 XE Camp 모듈제작가이드

/index.php?module=memo&act=dispMemoWrite����������� ������������������  

Context����������� ������������������  

ModuleHandler����������� ������������������  

memo.view.php����������� ������������������  

dispMemoWrite()����������� ������������������  

memo_write.html����������� ������������������  

Page 27: 2011 XE Camp 모듈제작가이드

memo.view.php����������� ������������������  ����������� ������������������  class����������� ������������������  MemoView����������� ������������������  extends����������� ������������������  memo����������� ������������������  {����������� ������������������  

function����������� ������������������  init()����������� ������������������  {����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  $template_path����������� ������������������  =����������� ������������������  sprintf("%sskins/%s/",$this->module_path,����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  $this->module_info->skin);����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  if(!is_dir($template_path)||!$this->module_info->skin)����������� ������������������  {����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  $this->module_info->skin����������� ������������������  =����������� ������������������  ‘xe_default';����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  $template_path����������� ������������������  =����������� ������������������  sprintf("%sskins/%s/",$this->module_path,����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  $this->module_info->skin);����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  }����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  $this->setTemplatePath($template_path);����������� ������������������  }����������� ������������������  

}����������� ������������������  

Page 28: 2011 XE Camp 모듈제작가이드

memo.view.php����������� ������������������  ����������� ������������������  ����������� ������������������  

class����������� ������������������  MemoView����������� ������������������  extends����������� ������������������  memo����������� ������������������  {����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  …⋯����������� ������������������  ����������� ������������������  

function����������� ������������������  dispMemoWrite()����������� ������������������  {����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  if(!Context::get('is_logged'))����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  return����������� ������������������  new����������� ������������������  Object(-1,����������� ������������������  'msg_invalid_request');����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  $logged_info����������� ������������������  =����������� ������������������  Context::get('logged_info');����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  $this->setTemplateFile('memo_write');����������� ������������������  }����������� ������������������  

}����������� ������������������  

Page 29: 2011 XE Camp 모듈제작가이드

/index.php?module=memo&act=dispMemoWrite����������� ������������������  

Context����������� ������������������  

ModuleHandler����������� ������������������  

memo.view.php����������� ������������������  

dispMemoWrite()����������� ������������������  

memo_write.html����������� ������������������  Template����������� ������������������  

Page 30: 2011 XE Camp 모듈제작가이드

./skins/xe_default/memo_write.html����������� ������������������  ����������� ������������������  

����������� ������������������  ����������� ������������������  ����������� ������������������  <form����������� ������������������  ruleset="insertMemo"����������� ������������������  name="memo_write"����������� ������������������  method="post"����������� ������������������  action="./">����������� ������������������  

<input����������� ������������������  type="hidden"����������� ������������������  name="module"����������� ������������������  value="memo"����������� ������������������  />����������� ������������������  <input����������� ������������������  type="hidden"����������� ������������������  name="act"����������� ������������������  value="procMemoInsert"����������� ������������������  />����������� ������������������  ����������� ������������������  <textarea����������� ������������������  name="content"����������� ������������������  cols="100"����������� ������������������  rows="15"></textarea>����������� ������������������  ����������� ������������������  <input����������� ������������������  type="submit"����������� ������������������  value="등록">����������� ������������������  

</form>����������� ������������������  

Page 31: 2011 XE Camp 모듈제작가이드

c����������� ������������������  

Page 32: 2011 XE Camp 모듈제작가이드

c����������� ������������������  

Page 33: 2011 XE Camp 모듈제작가이드

/index.php?module=memo&act=dispMemoWrite����������� ������������������  

Context����������� ������������������  

ModuleHandler����������� ������������������  

memo.view.php����������� ������������������  

dispMemoWrite()����������� ������������������  

memo_write.html����������� ������������������  

ruleset����������� ������������������   insertMemo.xml����������� ������������������  

Page 34: 2011 XE Camp 모듈제작가이드

./rulesets/insertMemo.xml����������� ������������������  ����������� ������������������  

����������� ������������������  <ruleset����������� ������������������  version="1.5.0">����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <customrules����������� ������������������  />����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <fields>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <field����������� ������������������  name="content"����������� ������������������  required="true"����������� ������������������  />����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  </fields>����������� ������������������  </ruleset>����������� ������������������  

http://code.google.com/p/xe-core/wiki/ValidateFormInput����������� ������������������  

Page 35: 2011 XE Camp 모듈제작가이드

./skins/xe_default/memo_write.html����������� ������������������  ����������� ������������������  

����������� ������������������  <div����������� ������������������  cond="$XE_VALIDATOR_MESSAGE"����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  class="message����������� ������������������  {$XE_VALIDATOR_MESSAGE_TYPE}">����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <p>{$XE_VALIDATOR_MESSAGE}</p>����������� ������������������  </div>����������� ������������������  ����������� ������������������  ����������� ������������������  <form����������� ������������������  ruleset="insertMemo"����������� ������������������  name="memo_write"����������� ������������������  method="post"����������� ������������������  action="./">����������� ������������������  

<input����������� ������������������  type="hidden"����������� ������������������  name="module"����������� ������������������  value="memo"����������� ������������������  />����������� ������������������  <input����������� ������������������  type="hidden"����������� ������������������  name="act"����������� ������������������  value="procMemoInsert"����������� ������������������  />����������� ������������������  ����������� ������������������  <textarea����������� ������������������  name="content"����������� ������������������  cols="100"����������� ������������������  rows="15"></textarea>����������� ������������������  <input����������� ������������������  type="submit"����������� ������������������  value="등록">����������� ������������������  

</form>����������� ������������������  

Page 36: 2011 XE Camp 모듈제작가이드

./skins/xe_default/memo_write.html����������� ������������������  ����������� ������������������  

����������� ������������������  <div����������� ������������������  cond="$XE_VALIDATOR_MESSAGE"����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  class="message����������� ������������������  {$XE_VALIDATOR_MESSAGE_TYPE}">����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <p>{$XE_VALIDATOR_MESSAGE}</p>����������� ������������������  </div>����������� ������������������  ����������� ������������������  ����������� ������������������  <form����������� ������������������  ruleset="insertMemo"����������� ������������������  name="memo_write"����������� ������������������  method="post"����������� ������������������  action="./">����������� ������������������  

<input����������� ������������������  type="hidden"����������� ������������������  name="module"����������� ������������������  value="memo"����������� ������������������  />����������� ������������������  <input����������� ������������������  type="hidden"����������� ������������������  name="act"����������� ������������������  value="procMemoInsert"����������� ������������������  />����������� ������������������  ����������� ������������������  <textarea����������� ������������������  name="content"����������� ������������������  cols="100"����������� ������������������  rows="15"></textarea>����������� ������������������  <input����������� ������������������  type="submit"����������� ������������������  value="등록">����������� ������������������  

</form>����������� ������������������  

Page 37: 2011 XE Camp 모듈제작가이드

5-2.����������� ������������������  Memo����������� ������������������  DB����������� ������������������  저장����������� ������������������  

Page 38: 2011 XE Camp 모듈제작가이드
Page 39: 2011 XE Camp 모듈제작가이드

메모����������� ������������������  등록!!����������� ������������������  

Context����������� ������������������  

ModuleHandler����������� ������������������  

memo.controller.php����������� ������������������  

procMemoInsert()����������� ������������������  

insertMemo.xml����������� ������������������  (xml����������� ������������������  query)����������� ������������������  

memo����������� ������������������  

Page 40: 2011 XE Camp 모듈제작가이드

./conf/module.xml����������� ������������������  ����������� ������������������  

����������� ������������������  

<module>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <grants����������� ������������������  />����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <permissions����������� ������������������  />����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <actions>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <action����������� ������������������  name="dispMemoWrite"����������� ������������������  type="view"����������� ������������������  standalone="true"����������� ������������������  />����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <action����������� ������������������  name="procMemoInsert"����������� ������������������  type="controller"����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  standalone="true"����������� ������������������  ruleset="insertMemo"����������� ������������������  />����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  </actions>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <menus����������� ������������������  />����������� ������������������  </module>����������� ������������������  

Page 41: 2011 XE Camp 모듈제작가이드

메모����������� ������������������  등록!!����������� ������������������  

Context����������� ������������������  

ModuleHandler����������� ������������������  

memo.controller.php����������� ������������������  

procMemoInsert()����������� ������������������  

insertMemo.xml����������� ������������������  (xml����������� ������������������  query)����������� ������������������  

memo����������� ������������������  

Page 42: 2011 XE Camp 모듈제작가이드

insertMemo.xml����������� ������������������  (XML����������� ������������������  Query)����������� ������������������  ����������� ������������������  ����������� ������������������  

<query����������� ������������������  id="insertMemo"����������� ������������������  action="insert">����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <tables>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <table����������� ������������������  name="memo"����������� ������������������  />����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  </tables>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <columns>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <column����������� ������������������  name="memo_srl"����������� ������������������  var="memoSrl“����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  notnull="notnull"����������� ������������������  filter="number"����������� ������������������  />����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <column����������� ������������������  name="member_srl"����������� ������������������  var="memberSrl“����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  notnull="notnull"����������� ������������������  filter="number"����������� ������������������  />����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <column����������� ������������������  name="content"����������� ������������������  var="content"����������� ������������������  />����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <column����������� ������������������  name="regdate"����������� ������������������  var="regdate"����������� ������������������  default="curdate()"����������� ������������������  />����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <column����������� ������������������  name="last_update"����������� ������������������  var="lastUpdate"����������� ������������������  default="curdate()"����������� ������������������  />����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <column����������� ������������������  name="ipaddress"����������� ������������������  var="ipaddress"����������� ������������������  default="ipaddress()"����������� ������������������  />����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  </columns>����������� ������������������  </query>����������� ������������������  

Page 43: 2011 XE Camp 모듈제작가이드

메모����������� ������������������  등록!!����������� ������������������  

Context����������� ������������������  

ModuleHandler����������� ������������������  

memo.controller.php����������� ������������������  

procMemoInsert()����������� ������������������  

insertMemo.xml����������� ������������������  (xml����������� ������������������  query)����������� ������������������  

memo����������� ������������������  

Page 44: 2011 XE Camp 모듈제작가이드

memo.����������� ������������������  controller.php����������� ������������������  ����������� ������������������  Class����������� ������������������  memoController����������� ������������������  extends����������� ������������������  memo����������� ������������������  {����������� ������������������  ����������� ������������������  

function����������� ������������������  procMemoInsert()����������� ������������������  {����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  if(!Context::get('is_logged'))����������� ������������������  return����������� ������������������  new����������� ������������������  Object(-1,����������� ������������������  'msg_invalid_request');����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  $logged_info����������� ������������������  =����������� ������������������  Context::get('logged_info');����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  $vars����������� ������������������  =����������� ������������������  Context::getRequestVars();����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  $args->memoSrl����������� ������������������  =����������� ������������������  getNextSequence();����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  $args->memberSrl����������� ������������������  =����������� ������������������  $logged_info->member_srl;����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  $args->content����������� ������������������  =����������� ������������������  htmlspecialchars($vars->content);����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  $output����������� ������������������  =����������� ������������������  executeQuery('memo.insertMemo',����������� ������������������  $args);����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  if(!$output->toBool())����������� ������������������  return����������� ������������������  new����������� ������������������  Object(-1,����������� ������������������  'msg_error');����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON')))����������� ������������������  {����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  $returnUrl����������� ������������������  =����������� ������������������  Context::get('success_return_url')����������� ������������������  ?����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  Context::get('success_return_url')����������� ������������������  :����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  getNotEncodedUrl('',����������� ������������������  'module',����������� ������������������  'memo',����������� ������������������  'act',����������� ������������������  'dispMemoList');����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  $this->setRedirectUrl($returnUrl);����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  return;����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  }����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  return����������� ������������������  $output;����������� ������������������  }����������� ������������������  ����������� ������������������  ����������� ������������������  

Page 45: 2011 XE Camp 모듈제작가이드

memo.����������� ������������������  controller.php����������� ������������������  ����������� ������������������  function����������� ������������������  procMemoInsert()����������� ������������������  {����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  if(!Context::get('is_logged'))����������� ������������������  return����������� ������������������  new����������� ������������������  Object(-1,����������� ������������������  'msg_invalid_request');����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  $logged_info����������� ������������������  =����������� ������������������  Context::get('logged_info');����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  $vars����������� ������������������  =����������� ������������������  Context::getRequestVars();����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  $args->memoSrl����������� ������������������  =����������� ������������������  getNextSequence();����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  $args->memberSrl����������� ������������������  =����������� ������������������  $logged_info->member_srl;����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  $args->content����������� ������������������  =����������� ������������������  htmlspecialchars($vars->content);����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  $output����������� ������������������  =����������� ������������������  executeQuery('memo.insertMemo',����������� ������������������  $args);����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  if(!$output->toBool())����������� ������������������  return����������� ������������������  new����������� ������������������  Object(-1,����������� ������������������  'msg_error');����������� ������������������  ����������� ������������������  

Page 46: 2011 XE Camp 모듈제작가이드

memo.controller.php����������� ������������������  ����������� ������������������  

����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  …⋯����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  if(!in_array(Context::getRequestMethod(),array('XMLRPC','JSON')))����������� ������������������  {����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  $returnUrl����������� ������������������  =����������� ������������������  Context::get('success_return_url')����������� ������������������  ?����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  Context::get('success_return_url')����������� ������������������  :����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  getNotEncodedUrl('',����������� ������������������  'module',����������� ������������������  'memo',����������� ������������������  'act',����������� ������������������  'dispMemoList');����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  $this->setRedirectUrl($returnUrl);����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  return;����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  }����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  return����������� ������������������  $output;����������� ������������������  }����������� ������������������  

Page 47: 2011 XE Camp 모듈제작가이드

5-3.����������� ������������������  Memo����������� ������������������  목록����������� ������������������  화면����������� ������������������  

Page 48: 2011 XE Camp 모듈제작가이드
Page 49: 2011 XE Camp 모듈제작가이드

/index.php?module=memo&act=dispMemoList����������� ������������������  

Context����������� ������������������  

ModuleHandler����������� ������������������  

memo.view.php����������� ������������������  

dispMemoList()����������� ������������������  

memo_list.html����������� ������������������  

Page 50: 2011 XE Camp 모듈제작가이드

./conf/module.xml����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  

<module>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <grants����������� ������������������  />����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <permissions����������� ������������������  />����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <actions>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <action����������� ������������������  name="dispMemoWrite"����������� ������������������  type="view"����������� ������������������  standalone="true"����������� ������������������  />����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <action����������� ������������������  name="procMemoInsert"����������� ������������������  type="controller“����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  standalone="true"����������� ������������������  ruleset="insertMemo"����������� ������������������  />����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <action����������� ������������������  name="dispMemoList"����������� ������������������  type="view"����������� ������������������  standalone="true"����������� ������������������  />����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  </actions>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <menus����������� ������������������  />����������� ������������������  </module>����������� ������������������  

Page 51: 2011 XE Camp 모듈제작가이드

memo.view.php����������� ������������������  

dispMemoList()����������� ������������������  

memo_list.html����������� ������������������  

memo.model.php����������� ������������������  

getMemoList()����������� ������������������  

getMemoList.xml����������� ������������������  

memo����������� ������������������  

Page 52: 2011 XE Camp 모듈제작가이드

memo.model.php����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  

class����������� ������������������  memoModel����������� ������������������  extends����������� ������������������  memo����������� ������������������  {����������� ������������������  

����������� ������������������  function����������� ������������������  getMemoList($member_srl,����������� ������������������  $page����������� ������������������  =����������� ������������������  1)����������� ������������������  {����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  $args->memberSrl����������� ������������������  =����������� ������������������  $member_srl;����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  $args->page����������� ������������������  =����������� ������������������  $page;����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  $output����������� ������������������  =����������� ������������������  executeQuery('memo.getMemoList',����������� ������������������  $args);����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  if(!$output->toBool())����������� ������������������  return����������� ������������������  new����������� ������������������  Object(-1,����������� ������������������  'msg_error');����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  return����������� ������������������  $output;����������� ������������������  }����������� ������������������  

Page 53: 2011 XE Camp 모듈제작가이드

./queries/getMemoList.xml����������� ������������������  ����������� ������������������  <query����������� ������������������  id="getMemoList"����������� ������������������  action="select">����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <tables>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <table����������� ������������������  name="memo"����������� ������������������  />����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  </tables>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <columns>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <column����������� ������������������  name="*"����������� ������������������  />����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  </columns>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <conditions>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <condition����������� ������������������  operation="equal"����������� ������������������  column="member_srl“����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  var="memberSrl"����������� ������������������  filter="number"����������� ������������������  notnull="notnull"����������� ������������������  />����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  </conditions>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <navigation>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <index����������� ������������������  var="list_order"����������� ������������������  default="memo_srl"����������� ������������������  order="desc"����������� ������������������  />����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <list_count����������� ������������������  var="list_count"����������� ������������������  default="5"����������� ������������������  />����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <page_count����������� ������������������  var="page_count"����������� ������������������  default="5"����������� ������������������  />����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <page����������� ������������������  var="page"����������� ������������������  default="1"����������� ������������������  />����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  </navigation>����������� ������������������  </query>����������� ������������������  

Page 54: 2011 XE Camp 모듈제작가이드

memo.view.php����������� ������������������  

dispMemoList()����������� ������������������  

memo_list.html����������� ������������������  

memo.model.php����������� ������������������  

getMemoList()����������� ������������������  

getMemoList.xml����������� ������������������  

memo����������� ������������������  

Page 55: 2011 XE Camp 모듈제작가이드

memo.view.php����������� ������������������  ����������� ������������������  class����������� ������������������  memoView����������� ������������������  extends����������� ������������������  memo����������� ������������������  {����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  …⋯����������� ������������������  

function����������� ������������������  dispMemoList()����������� ������������������  {����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  if(!Context::get('is_logged'))����������� ������������������  return����������� ������������������  new����������� ������������������  Object(-1,����������� ������������������  'msg_invalid_request');����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  $logged_info����������� ������������������  =����������� ������������������  Context::get('logged_info');����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  $oMemoModel����������� ������������������  =����������� ������������������  &getModel('memo');����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  $output����������� ������������������  =����������� ������������������  $oMemoModel->getMemoList(����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������   ����������� ������������������   ����������� ������������������  ����������� ������������������  $logged_info->member_srl,����������� ������������������  Context::get('page'));����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  Context::set('memo_list',����������� ������������������  $output->data);����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  Context::set('total_count',����������� ������������������  $output->total_count);����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  Context::set('total_page',����������� ������������������  $output->total_page);����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  Context::set('page',����������� ������������������  $output->page);����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  Context::set('page_navigation',����������� ������������������  $output->page_navigation);����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  $this->setTemplateFile('memo_list');����������� ������������������  }����������� ������������������  

Page 56: 2011 XE Camp 모듈제작가이드

memo.view.php����������� ������������������  ����������� ������������������  class����������� ������������������  memoView����������� ������������������  extends����������� ������������������  memo����������� ������������������  {����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  …⋯����������� ������������������  

function����������� ������������������  dispMemoList()����������� ������������������  {����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  if(!Context::get('is_logged'))����������� ������������������  return����������� ������������������  new����������� ������������������  Object(-1,����������� ������������������  'msg_invalid_request');����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  $logged_info����������� ������������������  =����������� ������������������  Context::get('logged_info');����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  $oMemoModel����������� ������������������  =����������� ������������������  &getModel('memo');����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  $output����������� ������������������  =����������� ������������������  $oMemoModel->getMemoList(����������� ������������������  

����������� ������������������   ����������� ������������������   ����������� ������������������  ����������� ������������������  $logged_info->member_srl,����������� ������������������  Context::get('page'));����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  Context::set('memo_list',����������� ������������������  $output->data);����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  Context::set('total_count',����������� ������������������  $output->total_count);����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  Context::set('total_page',����������� ������������������  $output->total_page);����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  Context::set('page',����������� ������������������  $output->page);����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  Context::set('page_navigation',����������� ������������������  $output->page_navigation);����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  $this->setTemplateFile('memo_list');����������� ������������������  }����������� ������������������  

Page 57: 2011 XE Camp 모듈제작가이드

memo.view.php����������� ������������������  

dispMemoList()����������� ������������������  

memo_list.html����������� ������������������  

memo.model.php����������� ������������������  

getMemoList()����������� ������������������  

getMemoList.xml����������� ������������������  

memo����������� ������������������  

Page 58: 2011 XE Camp 모듈제작가이드

memo_list.html����������� ������������������  ����������� ������������������  ����������� ������������������  <tbody>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <tr����������� ������������������  loop="$memo_list=>$key,$value">����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <td>{$value->memo_srl}</td>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <td>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <a����������� ������������������  href="{getUrl('',����������� ������������������  'module',����������� ������������������  'memo',����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  'act',����������� ������������������  'dispMemoView',����������� ������������������  'memo_srl',����������� ������������������  $value->memo_srl)}">����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  {$value->content}</a></td>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <td>{date('Y-m-d����������� ������������������  H:i:s',����������� ������������������  strtotime($value->regdate))}</td>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <td>{date('Y-m-d����������� ������������������  H:i:s',����������� ������������������  strtotime($value->last_update))}</td>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <td>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <a����������� ������������������  href="{getUrl('',����������� ������������������  'module',����������� ������������������  'memo',����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  'act',����������� ������������������  'procMemoDelete',����������� ������������������  'memo_srl',����������� ������������������  $value->memo_srl)}">����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  Delete</a></td>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  </tr>����������� ������������������  </tbody>����������� ������������������  

Page 59: 2011 XE Camp 모듈제작가이드

5-4.����������� ������������������  Memo����������� ������������������  보기����������� ������������������  

Page 60: 2011 XE Camp 모듈제작가이드

./conf/module.xml����������� ������������������  ����������� ������������������  ����������� ������������������  

<module>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <grants����������� ������������������  />����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <permissions����������� ������������������  />����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <actions>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <action����������� ������������������  name="dispMemoWrite"����������� ������������������  type="view"����������� ������������������  standalone="true"����������� ������������������  />����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <action����������� ������������������  name="procMemoInsert"����������� ������������������  type="controller“����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  standalone="true"����������� ������������������  ruleset="insertMemo"����������� ������������������  />����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <action����������� ������������������  name="dispMemoList"����������� ������������������  type="view"����������� ������������������  standalone="true"����������� ������������������  />����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <action����������� ������������������  name="dispMemoView"����������� ������������������  type="view"����������� ������������������  standalone="true"����������� ������������������  />����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  </actions>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <menus����������� ������������������  />����������� ������������������  </module>����������� ������������������  

Page 61: 2011 XE Camp 모듈제작가이드

memo.view.php����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  

class����������� ������������������  memoView����������� ������������������  extends����������� ������������������  memo����������� ������������������  {����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  …⋯����������� ������������������  

function����������� ������������������  dispMemoView()����������� ������������������  {����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  $memo_srl����������� ������������������  =����������� ������������������  Context::get('memo_srl');����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  $oMemoModel����������� ������������������  =����������� ������������������  &getModel('memo');����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  $output����������� ������������������  =����������� ������������������  $oMemoModel->getMemo($memo_srl);����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  Context::set('memo',����������� ������������������  $output->data);����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  $this->setTemplateFile('memo_view');����������� ������������������  }����������� ������������������  

Page 62: 2011 XE Camp 모듈제작가이드

memo.model.php����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  

class����������� ������������������  memoModel����������� ������������������  extends����������� ������������������  memo����������� ������������������  {����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  …⋯����������� ������������������  

function����������� ������������������  getMemo($memo_srl)����������� ������������������  {����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  $args->memoSrl����������� ������������������  =����������� ������������������  $memo_srl;����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  $output����������� ������������������  =����������� ������������������  executeQuery('memo.getMemo',����������� ������������������  $args);����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  if(!$output->toBool())����������� ������������������  return����������� ������������������  new����������� ������������������  Object(-1,����������� ������������������  'msg_error');����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  return����������� ������������������  $output;����������� ������������������  }����������� ������������������  

Page 63: 2011 XE Camp 모듈제작가이드

./skins/xe_default/memo_view.html����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  

<ul>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <li>memo_srl����������� ������������������  :����������� ������������������  {$memo->memo_srl}</li>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <li>member_srl����������� ������������������  :����������� ������������������  {$memo->member_srl}</li>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <li>content����������� ������������������  :����������� ������������������  {$memo->content}</li>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <li>regdate����������� ������������������  :����������� ������������������  {$memo->regdate}</li>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <li>last_update����������� ������������������  :����������� ������������������  {$memo->last_update}</li>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <li>ipaddress����������� ������������������  :����������� ������������������  {$memo->ipaddress}</li>����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  <li>other_column����������� ������������������  :����������� ������������������  {$memo->other_column}</li>����������� ������������������  </ul>����������� ������������������  <br����������� ������������������  />����������� ������������������  <a����������� ������������������  href="{getUrl('',����������� ������������������  'module',����������� ������������������  'memo',����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  ����������� ������������������  'act',����������� ������������������  'dispMemoModify',����������� ������������������  'memo_srl',����������� ������������������  $memo_srl)}">수정</a>����������� ������������������  

Page 64: 2011 XE Camp 모듈제작가이드

6.����������� ������������������  memo����������� ������������������  모듈����������� ������������������  정리����������� ������������������  

Page 65: 2011 XE Camp 모듈제작가이드

memo.view.php����������� ������������������  

memo.controller.php����������� ������������������  

memo.model.php����������� ������������������  

./conf/info.xml����������� ������������������  

./conf/module.xml����������� ������������������  

./ruleset/insertMemo.xml����������� ������������������  

./queries/insertMemo.xml����������� ������������������  

memo.class.php����������� ������������������  

./skins/xe_default/*.html����������� ������������������  

Page 66: 2011 XE Camp 모듈제작가이드

Thank����������� ������������������  you.����������� ������������������