Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.

Introducing the JotSpot Data Model and API

2.770 visualizaciones

Publicado el

This preso introduces the benefits of adding structure to wikis and introduces how this is done in JotSpot wikis. It also provides a quick fly-over of the JotSpot API.

Publicado en: Tecnología
  • Inicia sesión para ver los comentarios

Introducing the JotSpot Data Model and API

  1. 1. JotSpot Developer Tutorial Introducing the JotSpot Wiki Storage Model and API DRAFT
  2. 2. Tutorial Overview <ul><li>Benefits of Structure in a Wiki </li></ul><ul><li>JotSpot Storage Model Overview </li></ul><ul><li>JotSpot API Sneak Peak </li></ul>
  3. 3. Why Add Structure to a Wiki?
  4. 4. Why Structure in a Wiki? <ul><li>Wikis are amazing for free-form text collaboration </li></ul><ul><li>But not all content in your wiki works well as free-form text… </li></ul><ul><li>Free-form text is simply not a good way to organize lists or view relationships </li></ul>
  5. 5. Ask Your Wiki for More… <ul><li>We track project milestones in our wiki… </li></ul><ul><li>Can I see milestone roll ups across all projects? </li></ul><ul><li>We track feature requests & requirements… </li></ul><ul><li>How do I sort requirements by customer? By priority? </li></ul><ul><li>We create lots of similar looking pages, e.g. meeting agendas… </li></ul><ul><li>Can we make page templates so it’s easy to create consistent looking pages? </li></ul>
  6. 6. Summary: Benefits of Structure <ul><li>Centralize : Store more types of info in a single place place </li></ul><ul><li>Simplify : Easier to organize and find “the good stuff” </li></ul><ul><li>Room to Grow : the more you use, the more you’ll need </li></ul>
  7. 7. Introducing Structure in JotSpot Wikis
  8. 8. What You’ll Learn <ul><li>Everything is a Page in JotSpot (“Look ma, no database!”) </li></ul><ul><li>Pages contain properties </li></ul><ul><li>Properties defined by forms </li></ul><ul><li>In the end, pages stored as XML </li></ul>
  9. 9. Todo List Page: Free-form Text
  10. 10. Todo List Page: A Little Structure
  11. 11. Todo List Page: A Little Structure + some Ajax
  12. 12. Structure Under the Hood: Forms & Properties
  13. 13. In JotSpot, Everything is a Page <ul><li>My Todos – 13 lines of code: </li></ul><ul><li>1 to add new todo pages </li></ul><ul><li>6 to render rollup table </li></ul><ul><li>6 to structure todo pages </li></ul><ul><li>Each todo a separate child page with 3 properties: </li></ul><ul><li>description </li></ul><ul><li>priority </li></ul><ul><li>when </li></ul>
  14. 14. BTW, here’s the code
  15. 15. Rows in a database Pages in JotSpot There is no database; Everything is a Page … … … … Daily Hi Walk the dog Today Lo Get Milk When Priority Description
  16. 16. RDBMS Vs.Page-based Model Storage Concept Relational DB JotSpot JotSpot form page Table schema Unique items defined by… Property in a page Column in a row Individual value in… JotSpot page DB Row Unique item stored in… Set of JotSpot pages DB Table Application data stored in…
  17. 17. But, How To Add and Edit Page Properties? (Hint: use Forms)
  18. 18. JotSpot Forms: Just Wiki Pages with JotScript
  19. 19. Create & Edit Pages w/Forms Edit Mode: ?edit=1&form=TodoForm
  20. 20. Forms Define Views Too
  21. 21. In the End, Pages stored as XML Page “x-ray”: ?xml=esc
  22. 22. Did I Mention Forms Define Properties?
  23. 23. Summary: What You Learned <ul><li>Everything is a Page </li></ul><ul><li>Pages contain properties </li></ul><ul><li>Properties defined by forms </li></ul><ul><li>In the end, pages stored as XML </li></ul>
  24. 24. There’s More to Using a JotSpot Form than Meets the Eye
  25. 25. What You’ll Learn <ul><li>Edit Different Properties of a Page Using Different Forms </li></ul><ul><li>Display Different Views of a Page Using Different Forms </li></ul>
  26. 26. Edit “Get Milk” w/TodoForm… &form=TodoForm
  27. 27. Edit “Get Milk” w/PermissionsForm <ul><li> &form=PermissionForm </li></ul>
  28. 28. Each Form Edits Different Properties ?xml=esc
  29. 29. Summary: What You Learned <ul><li>Can Edit Pages w/Different Forms </li></ul><ul><li>Can View Pages w/Different Forms </li></ul>
  30. 30. Manipulating Pages & Properties: API Sneak Peak
  31. 31. What You’ll Learn <ul><li>One Core Library (JotLib), 4 APIs </li></ul><ul><ul><li>“ Tags” (aka JotScript) </li></ul></ul><ul><ul><li>Server-side Javascript </li></ul></ul><ul><ul><li>REST </li></ul></ul><ul><ul><li>XML-RPC </li></ul></ul><ul><li>JotSpot API is Full-featured </li></ul>
  32. 32. 3 Main API Syntaxes <ul><li>JotScript (aka “tags”) <jot:search forFormName=“TodoForm” set=“results” /> </li></ul><ul><li>Server-side Javascript (aka “ssjs”) var results ={forFormName: ‘TodoForm'}); </li></ul><ul><li>REST (aka “web service”) format=xml&filter=util:isDefined(it/TodoForm) </li></ul>
  33. 33. Example: Display a Todo Page’s Properties Code to Display This Here
  34. 34. Code in JotScript <ul><li><jot:pageinfo href=“wiki:GetMilk” name=“pgVar” /> </li></ul><ul><li>Desc: ${pgVar/TodoForm/description} </li></ul><ul><li>Do when?: ${pgVar/TodoForm/when} </li></ul><ul><li>Created: ${pgVar/createTime} </li></ul>
  35. 35. Code in Server-side Javascript <ul><li><jot:script> </li></ul><ul><li>var pgVar=jot.pages[“/GetMilk”]; </li></ul><ul><li>jot.out.write(“Desc:”+pgVar.TodoForm.description); </li></ul><ul><li>jot.out.write(“Do when?:”+pgVar[“TodoForm/when”]); </li></ul><ul><li>jot.out.write(“Created:”+pgVar.createTime); </li></ul><ul><li></jot:script> </li></ul>
  36. 36. Tags vs. SSJS: You Choose <ul><li>var pgVar=jot.pages[“/GetMilk”]; </li></ul><ul><li>jot.out.write(“Desc:”+pgVar.TodoForm.description); </li></ul><ul><li>jot.out.write(“Do when?:”+pgVar[“TodoForm/when”]); </li></ul><ul><li>jot.out.write(“Created:”+pgVar.createTime); </li></ul><jot:pageinfo href=“wiki:GetMilk” name=“pgVar”/> Desc.: ${pgVar/TodoForm/description} Do when?: ${pgVar/TodoForm/when} Created: ${pgVar/createTime} VS.
  37. 37. Lots More JotLib API: jot.lib.attach() jot.lib.diff() jot.lib.image.newChart() jot.lib.mail() jot.lib.parseRows() jot.lib.removePage() jot.lib.rename() jot.lib.savePage() jot.lib.tree() admin.importZip() admin.log() admin.lookupEmail() …
  38. 38. Summary: What You Learned <ul><li>One Library, Four Syntaxes </li></ul><ul><li>JotSpot API is Full-featured </li></ul>
  39. 39. Tutorial Summary: <ul><li>JotSpot Wikis Support Structured Information </li></ul><ul><li>Allows your Wiki to Grow With You </li></ul><ul><li>Structure uses Page & Property Model </li></ul><ul><li>Rich API to Put Pages & Properties to Work </li></ul>
  40. 40. More Information: <ul><li>More Developer Tutorials </li></ul><ul><ul><li> </li></ul></ul><ul><li>Reference Documentation </li></ul><ul><ul><li>http:// /Reference </li></ul></ul><ul><li>Questions or Comments? </li></ul><ul><ul><li>leave comment on tutorial wiki page: </li></ul></ul><ul><ul><li>email me: </li></ul></ul>