# yum install compat-plone compat-python24-setuptools compat-python24-devel # zopectl adduser admin secret # service zope start
Para verificar todo marcha bien visitar http://localhost:8080/ y agregar un Plone Site, por ejemplo "test", visitar http://localhost:8080/test/
Continuamos
# easy_install-2.4 ZopeSkel
Nos basamos en http://www.koansys.com/tech/create-plone-3-archetype-product-with-zopeskel-and-buildout para crear nuestro producto:
# paster create -t archetype Selected and implied templates: ZopeSkel#basic_namespace A project with a namespace package ZopeSkel#plone A Plone project ZopeSkel#archetype A Plone project that uses Archetypes Enter project name: guegue.alcaldias Variables: egg: gueguealcaldias package: gueguealcaldias project: guegue.alcaldias Enter title (The title of the project) ['Plone Example']: Sistema de Alcaldias de Guegue Enter namespace_package (Namespace package (like plone)) ['plone']: guegue Enter package (The package contained namespace package (like example)) ['example']: alcaldias Enter zope2product (Are you creating a Zope 2 Product?) [False]: True Enter version (Version) ['0.1']: Enter description (One-line description of the package) ['']: Tipos y agregados para sistema de alcaldias Enter long_description (Multi-line description (in reST)) ['']: Enter author (Author name) ['Plone Foundation']: Guegue Comunicaciones Enter author_email (Author email) ['plone-developers@lists.sourceforge.net']: info@guegue.com Enter keywords (Space-separated keywords/tags) ['']: Enter url (URL of homepage) ['http://svn.plone.org/svn/plone/plone.example']: http://www.guegue.com/ Enter license_name (License name) ['GPL']: Enter zip_safe (True/False: if the package can be distributed as a .zip file) [False]:
Ahora a crear uno o varios arquetipos, entramos primero al producto, y al paquete que acabamos de crear:
# cd guegue.alcaldias/guegue/alcaldias # paster addcontent contenttype Enter contenttype_name (Content type name ) ['Example Type']: Programa Enter contenttype_description (Content type description ) ['Description of the Example Type']: Programa con fecha, presupuesto, etc Enter folderish (True/False: Content type is Folderish ) [False]: Enter global_allow (True/False: Globally addable ) [True]: Enter allow_discussion (True/False: Allow discussion ) [False]: # paster addcontent contenttype Enter contenttype_name (Content type name ) ['Example Type']: Proyecto Enter contenttype_description (Content type description ) ['Description of the Example Type']: Proyecto con fecha, presupuesto, adjunto, etc Enter folderish (True/False: Content type is Folderish ) [False]: Enter global_allow (True/False: Globally addable ) [True]: Enter allow_discussion (True/False: Allow discussion ) [False]:
Finalmente se instala el huevo:
cd ../../../ easy_install-2.4 guegue.alcaldias
A menos que el el producto sea del namespace Product debe especificarse a Plone que lo cargue el paquete, creando un archivo -configure.zcml en etc/package-includes/
cd /var/lib/zope/etc/package-includes/ echo '<include package="guegue.alcaldias" file="configure.zcml" />' > alcaldias-configure.zcml service zope restart
Luego es ir al sitio de plone e instalar el producto desde prefs_install_products_form como de costumbre, y probar agregar un registro.
Para modificar el schema puede hacerlo editando por ejemplo: Alcaldias/guegue/alcaldias/content/proyecto.py
Para agregar un campo donde se pueda ingresar contenido con formato HTML, aqui lo llamamos body:
[...] ProyectoSchema = schemata.ATContentTypeSchema.copy() + atapi.Schema(( # -*- Your Archetypes field definitions here ... -*- atapi.TextField('body', searchable=1, required=0, primary=1, default_content_type='text/html', default_output_type='text/html', allowable_content_types=('text/plain','text/structured', 'text/html', 'text/restructured'), widget=atapi.RichWidget(label='Texto', label_msgid="label_entry_body", description_msgid="help_entry_body", i18n_domain="guegue.alcaldias", description="Puede entrar el texto del proyecto completo.")), )) [...]
Archivos ejemplo:
Please make sure that the server has write access to a folder named uploads.