Did not find a how-to for your problem?

Ask me to write the how-to post by writing to the mailing-list at cps-devel [@] lists [.] nuxeo [.] com or writing to me to joseluisdelarosa+cpshowto [@] gmail [.] com. Note: I'll keep all conversations on the official mailing list.

Tuesday, June 5, 2007

How to implement a new product with Eclipse and Subversion.

My folk Joselu has described the way to implement a new product. This is a general aproach to do it, with a terminal, for instance.

Now, I'm going to explain you the collaborative way to do it, with Eclipse, Subversion and PyDev.
We need to tune Eclipse, installing subversive or subversion plugin and pydev plugin.

You can follow these steps:

1. If you're the repository administrator and if the project isn't still created, you can create the project structure, you know... tags, branches and trunk.

2. Then, we can checkout the project repository to our local Zope instance's Products folder.

3. Once we've done it, we must to follow Joseluis post's steps to create our product.

Now, we have the next snapshot (snapshot).

Joseluis' advices are so important to develop correctly: To code in ZMI interface is a laborious job... and is not the right way.

I want to write code only with Eclipse. Out of ZMI interface. And I want to write code in a collaborative way... as I say in the title. To do it, I have to declare where I'm going to write my code. Do it this way:

1. Create few folders in skins one to contains our code.
We usually create the next ones for a product called xxxx:

- xxxx_custom: it will contain customized cps code.
- xxxx_default: it will contain our own code.
- xxxx_icons: it will contain our icons.
- xxxx_images: it will contain our images.
- xxxx_styles: it will contain out style sheets.



2. We must to tell to zope where is our new code and the layer order. To do so, we need to add/modify a pair of xml profiles.

- The first one, import_steps.xml: here we declare that we're going to define s skin profile:



<?xml version="1.0"?>
<import-steps>

<import-step id="skins" version="20040630-01"
handler="Products.CMFCore.exportimport.skins.importSkinsTool"
title="Skins Tool">
<dependency step="toolset"/>

Import skins tool's filesystem directory views and skin path definitions.

</import-step>

</import-steps>



- The second one, skins.xml: here we declare where are my product code (red text) and
the layer order where my code is in (green text):



<?xml version="1.0"?>
<object name="portal_skins" meta_type="CMF Skins Tool" allow_any="False"
cookie_persistence="False" default_skin="CPSSkins"
request_varname="portal_skin">

<object name="splash_custom" meta_type="Filesystem Directory View"
directory="SplashERP/skins/splash_custom"/>
<object name="splash_default" meta_type="Filesystem Directory View"
directory="SplashERP/skins/splash_default"/>
<object name="splash_icons" meta_type="Filesystem Directory View"
directory="SplashERP/skins/splash_icons"/>
<object name="splash_images" meta_type="Filesystem Directory View"
directory="SplashERP/skins/splash_images"/>
<object name="splash_styles" meta_type="Filesystem Directory View"
directory="SplashERP/skins/splash_styles"/>


<skin-path name="CPSSkins">
<layer name="custom"/>
<layer name="cps_dashboards"/>

<layer name="splash_styles"/>
<layer name="splash_icons"/>
<layer name="splash_images"/>
<layer name="splash_default"/>
<layer name="splash_custom"/>

<layer name="cpsportlets_widgets"/>
<layer name="cpsportlets_default"/>
<layer name="CPSSkins"/>
<layer name="cpsskins_icons"/>
<layer name="cpsskins_cps3"/>
<layer name="cpsskins_cmf"/>
<layer name="cpsnavigation_images"/>
<layer name="cpsnavigation_default"/>
<layer name="cpsnavigation_devel"/>
<layer name="cps_directory"/>
<layer name="mimetypes_icons"/>
<layer name="cps_jscalendar"/>
<layer name="cps_schemas"/>
<layer name="cps_document"/>
<layer name="cps_document_js"/>
<layer name="cps_document_images"/>
<layer name="fckeditor"/>
<layer name="scriptaculous"/>
<layer name="cps_javascript"/>
<layer name="cps_default"/>
<layer name="cps_wiki"/>
<layer name="cps_subscriptions_installer"/>
<layer name="cps_subscriptions"/>
<layer name="cps_forum"/>
<layer name="cpsblog"/>
<layer name="cps_images"/>
<layer name="cmf_calendar"/>
<layer name="cps_styles"/>
<layer name="cps_nuxeo_style"/>
<layer name="cmf_zpt_calendar"/>
<layer name="cps_devel"/>
<layer name="zpt_topic"/>
<layer name="zpt_content"/>
<layer name="zpt_generic"/>
<layer name="zpt_control"/>
<layer name="Images"/>
</skin-path>
<skin-path name="CPSSkins-macroless">
<layer name="custom"/>
<layer name="cps_dashboards"/>

<layer name="splash_styles"/>
<layer name="splash_icons"/>
<layer name="splash_images"/>
<layer name="splash_default"/>
<layer name="splash_custom"/>

<layer name="cpsportlets_types"/>
<layer name="cpsportlets_default"/>
<layer name="cpsportlets_widgets"/>
<layer name="cpsportlets_layouts"/>
<layer name="cpsportlets_vocabularies"/>
<layer name="cpsportlets_schemas"/>
<layer name="CPSSkins"/>
<layer name="cpsskins_icons"/>
<layer name="cpsskins_cps3_macroless"/>
<layer name="cpsskins_cps3"/>
<layer name="cpsskins_cmf"/>
<layer name="cpsnavigation_images"/>
<layer name="cpsnavigation_default"/>
<layer name="cpsnavigation_devel"/>
<layer name="cps_directory"/>
<layer name="mimetypes_icons"/>
<layer name="cps_jscalendar"/>
<layer name="cps_schemas"/>
<layer name="cps_document"/>
<layer name="cps_document_js"/>
<layer name="cps_document_images"/>
<layer name="fckeditor"/>
<layer name="scriptaculous"/>
<layer name="cps_javascript"/>
<layer name="cps_default"/>
<layer name="cps_wiki"/>
<layer name="cps_subscriptions_installer"/>
<layer name="cps_subscriptions"/>
<layer name="cps_forum"/>
<layer name="cpsblog"/>
<layer name="cps_images"/>
<layer name="cmf_calendar"/>
<layer name="cps_styles"/>
<layer name="cps_nuxeo_style"/>
<layer name="cmf_zpt_calendar"/>
<layer name="cps_devel"/>
<layer name="zpt_topic"/>
<layer name="zpt_content"/>
<layer name="zpt_generic"/>
<layer name="zpt_control"/>
<layer name="Images"/>
</skin-path>
</object>



Now, you can go to code. I think that's all, folks...

No comments: