[doc] Adds a short section on how to launch a blog based on the packages cubicweb and cubicweb-blog.
authorSandrine Ribeau <sandrine.ribeau@logilab.fr>
Wed, 01 Apr 2009 17:53:44 -0700
changeset 1210 47a3eb4bbe66
parent 1209 4ec80ee57b19
child 1211 90bb6e89e356
child 1223 3e3d84e8fb67
[doc] Adds a short section on how to launch a blog based on the packages cubicweb and cubicweb-blog. Needs review and renaming to follow convention if content is approved.
doc/book/en/A020-tutorial.en.txt
doc/book/en/Z013-blog-less-ten-minutes.en.txt
--- a/doc/book/en/A020-tutorial.en.txt	Wed Apr 01 17:52:00 2009 -0700
+++ b/doc/book/en/A020-tutorial.en.txt	Wed Apr 01 17:53:44 2009 -0700
@@ -20,6 +20,7 @@
 This tutorial will show how to create a `cube` and how to use it as an
 application to run an `instance`.
 
+.. include:: Z013-blog-less-ten-minutes.en.txt
 .. include:: A02a-create-cube.en.txt
 .. include:: A02b-components.en.txt
 .. include:: A02c-maintemplate.en.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/book/en/Z013-blog-less-ten-minutes.en.txt	Wed Apr 01 17:53:44 2009 -0700
@@ -0,0 +1,84 @@
+.. -*- coding: utf-8 -*-
+
+Have a blog ready in less than ten minutes!
+-------------------------------------------
+
+Installation
+~~~~~~~~~~~~
+
+You need to install the following packages::
+
+    cubicweb, cubicweb-blog
+
+The package `cubicweb` is installing the command `cubicweb-ctl` that
+will allow you to create new application.
+
+The package `cubicweb-blog` is installing the blogging support for the
+`CubicWeb` framework.
+
+Application creation
+~~~~~~~~~~~~~~~~~~~~
+
+Creation and initialization of your application by running::
+    
+    cubicweb-ctl create blog myblog
+
+*myblog* is the name of the application you are creating.
+
+*blog* is the name of the component on which your application
+is based. 
+
+Application launch
+~~~~~~~~~~~~~~~~~~
+
+Your application is now ready to go::
+
+    cubicweb-ctl start -D myblog
+
+This is it. Your blog is ready to you. Go to http://localhost:8080 and enjoy!!
+
+
+A little code snapshot from behind the scene
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The component `blog`, referred as a `cube` in the book 
+(see :ref:`TermsVocabulary` for a complete definition), defines
+a data model in ``/usr/share/cubicweb/cubes/blog/schema.py``. 
+Here is the corresponding Python code::
+
+    from cubicweb.schema import format_constraint
+
+    class Blog(EntityType):
+        title = String(maxsize=50, required=True)
+        description_format = String(meta=True, internationalizable=True, maxsize=50,
+                                    default='text/rest', constraints=[format_constraint])
+        description = String()
+        rss_url = String(maxsize=128, description=_('blog\'s rss url (useful for when using external site such as feedburner)'))
+
+
+    class BlogEntry(EntityType):
+        title = String(required=True, fulltextindexed=True, maxsize=256)
+        content_format = String(meta=True, internationalizable=True, maxsize=50,
+                                default='text/rest', constraints=[format_constraint])
+        content = String(required=True, fulltextindexed=True)
+        entry_of = SubjectRelation('Blog', cardinality='?*')
+
+Two types of entities are defined here: Blog and BlogEntry.
+
+A Blog is defined by a title, a description and its format and a
+RSS URL to provide RSS feed.
+
+A BlogEntry is defined by a title, a content and its format and
+a relation to a Blog, meaning a BlogEntry belongs to a Blog.
+
+
+Next step
+~~~~~~~~~
+
+This was a brief demonstration of the re-usability of cubes and a way
+to show how you can use `CubicWeb` straigth out of the box.
+
+As a developper, you'll want to know more about how to develop new
+cubes and cutomize the views and this is what we talk about now. 
+
+