Commits

Simone Marzola committed 42fd1ad Draft

developers reference docs

  • Participants
  • Parent commits 49948cd

Comments (0)

Files changed (4)

File docs/content.rst

 	this is cool :)
 	this is cool :)
 
-Cool, isn't it?
+ACRCms injects some useful variable in Genshi slice::
+
+	acr.slices_with_tag(tag): returns all the slices with the given tag
+	acr.page_from_urllist([urls]): given the url hierarchy, returns the page object
+	acr.preview_slice(page, slice): renders the preview of a slice
+	acr.render_slice(page, slice): renders a slice
+	acr.url(url, **params): returns the project relative encoded url
+
+	page.url: the url of the current page
+	page.i18n_title: the internationalized title of the current page
+	page.ancestors: iterable of the current page ancestors
+	page.children: iterable of the current page children
+
+	slice.tags: iterable of the tags associated with the current slice
+	slice.name: the name of the current slice
+
+You can also access all the :ref:`helpers <dev-helpers>` using the variable ``h``.
+
 
 Menu
 """"

File docs/helpers.rst

+.. _dev-helpers:
+
+Helpers
+=================
+
+.. function:: preview_slice(page, slice):
+
+   Renders the preview of the slice.
+
+.. function:: draw_slice(page, slicename):
+
+   Renders the slice selected by slicename.
+
+.. function:: draw_section(page, sect):
+
+   Renders a page section, selected by section name.

File docs/index.rst

 .. toctree::
    :maxdepth: 2
    
+   install
+   helpers
+
 
 Indices and tables
 ==================

File docs/install.rst

+ACRCms installation
+======================
+
+Preliminary steps
+-------------------
+
+System Packages Installation
+"""""""""""""""""""""""""""""
+
+For Ubuntu/Debian systems::
+
+	$ sudo apt-get install build-essential python-dev python-setuptools python-virtualenv
+
+For Fedora systems::
+
+	$ su -c 'yum install gcc sqlite-devel python-virtualenv'
+
+
+Standard installation
+------------------------
+
+The standard installation pattern provides a full ACRCms instance
+
+
+Environment setup
+"""""""""""""""""
+
+Install the environment::
+
+	$ virtualenv --no-site-packages acrenv
+	$ cd acrenv/
+	$ source bin/activate
+	(acrenv)$ easy_install -i http://tg.gy/215/index/ tg.devtools
+	(acrenv)$ hg clone ssh://hg@bitbucket.org/axant/acrcms
+	(acrenv)$ cd acrcms/acr_cms/
+	(acrenv)$ python setup.py develop
+	(acrenv)$ paster setup-app development.ini
+
+Serve the contents::
+
+	(acrenv)$ paster serve development.ini --reload
+
+
+Enable libacr functionalities in any TG project
+-----------------------------------------------
+
+Instead of creating a brand new project, you can add the cms funcionalities provided by libacr in any TurboGears2 project.
+
+Install libacr::
+
+	(yourenv)$ easy_install libacr
+
+Enable libacr in your project.
+
+Add this lines to ``yourproject/lib/helpers.py``::
+
+	import libacr
+	from libacr.helpers import *
+
+	icons = {}
+	icons.update(libacr.helpers.icons)
+
+Add this lines to ``yourproject/lib/base.py``::
+
+	from libacr.lib import *
+	
+	#[in the __call__ method]
+	full_acr_js.inject()
+        acr_css.inject()
+
+Add this lines to ``yourproject/config/app_cfg.py``::
+
+	try:
+    	    from tgext.pluggable import plug
+    	    base_config.acr_pluggable_enabled = True
+	except ImportError:
+    	    base_config.acr_pluggable_enabled = False
+
+	if base_config.acr_pluggable_enabled:
+	    try:
+	        plug(base_config, 'photos')
+	    except ImportError:
+	        pass
+
+	    try:
+	        plug(base_config, 'smallpress')
+	    except ImportError:
+	        pass	
+
+Add this line to ``yourproject/model/__init__.py``::
+
+	from libacr.model import init_acr_model
+	Content, ContentData, Tag, Page, Slice, View, Comment = init_acr_model(DBSession, DeclarativeBase, User, Group)
+
+Add this line to ``yourproject/controllers/root.py``::
+
+	from libacr.controllers.cms import AcrRootController
+
+	#[in the RootController class]
+	acr = AcrRootController()
+
+
+Deploy ACRCms on Red Hat's OpenShift PaaS
+---------------------------------------------
+
+Get up and running with a `ACRCms <http://www.acrcms.org/>`_  instance on OpenShift using acrcms-openshift-quickstart. 
+It automatically handles creating a Python virtualenv, populating a MySQL database,
+and deploying the cms to the cloud. 
+
+
+Features
+"""""""""
+
+* Completely free, thanks to Red Hat's OpenShift Express
+* MySQL database automatically setup
+* Dynamic database configuration at runtime. No passwords stored in your configs.
+* Automatic deployment upon git push
+* No need to think about servers, let alone apache/mod_wsgi configuration
+
+How To
+"""""""
+
+* Create an account at http://openshift.redhat.com/
+* Add a namespace to your account:
+
+::
+
+    rhc domain create -n <yournamespace> -l your@email.com
+
+* Deploy the cms:
+
+::
+
+    rhc app create -a ACRCms -t python-2.6 -l your@email.com
+    rhc app cartridge add -a ACRCms -c mysql-5.1 -l your@email.com
+    cd ACRCms
+    git remote add upstream -m master git@bitbucket.org:simock85/acrcms-openshift-quickstart.git
+    git pull -s recursive -X theirs upstream master
+    git push
+
+Monitoring your logs
+""""""""""""""""""""""
+
+::
+
+    rhc-tail-files -a ACRCms -l your@email.com