Index: /quintagroup.themetemplate/branches/experiment/MANIFEST.in
===================================================================
--- /quintagroup.themetemplate/branches/experiment/MANIFEST.in	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/MANIFEST.in	(revision 2714)
@@ -0,0 +1,4 @@
+recursive-include docs *.txt
+recursive-include ez_setup *.txt *.py
+recursive-include quintagroup/themetemplate/templates *
+recursive-include quintagroup/themetemplate/localcommands *
Index: /quintagroup.themetemplate/branches/experiment/docs/HISTORY.txt
===================================================================
--- /quintagroup.themetemplate/branches/experiment/docs/HISTORY.txt	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/docs/HISTORY.txt	(revision 2714)
@@ -0,0 +1,89 @@
+Changelog
+=========
+
+0.25 (2010-06-24)
+-----------------
+
+- Correct version of the pacakge
+  [mylan]
+- Fix incompatibility wity ZopeSkel>=2.15
+  [mylan]
+- Updated tests
+  [mylan]
+
+
+0.2.2 (unreleased)
+------------------
+
+- Updated import_zexps subtemplate - move this step into
+  separate genericsetup profile
+  [mylan]
+- Updated tests for changed import_zexps subtemplate
+  [mylan]
+
+0.2 (unreleased)
+----------------
+
+- Added new css_dtml_skin subtemplate
+  [mylan]
+- Added tests for css_dtml_skin subtemplate
+  [mylan]
+
+0.14 (unreleased)
+-----------------
+
+- Refactoring theme vars storage-now storing in separate
+  theme_vars.cfg file, without distutils writers [mylan]
+- Cleanup code [mylan]
+
+
+0.11 (2009-04-13)
+-----------------
+
+- Removed setup.cfg
+  [mylan]
+
+
+0.10 (2009-04-13)
+-----------------
+
+- Updated README
+  [olha]
+
+
+0.9 (2009-04-11)
+----------------
+
+- Changed package name/namespace to
+  quintagroup.themetemplate.
+  [mylan]
+
+
+0.8 (2009-04-10)
+----------------
+
+* Update tests, readme
+  [mylan]
+
+* Update viewlet-order subtemplate
+  [mylan]
+
+* Fix uninstall bug
+  [mylan]
+
+
+0.7 (unreleased)
+----------------
+
+* Add uninstall profile to fix skins tool after theme is uninstalled
+  [piv]
+
+
+0.1 (unreleased)
+----------------
+
+* Initial import Theme template with nested namespace.
+  Support ZopeSkel' "addcommad" local command for extend
+  Theme template, support extending with portlet, view local
+  templates.
+  [mylan]
Index: /quintagroup.themetemplate/branches/experiment/docs/README.txt
===================================================================
--- /quintagroup.themetemplate/branches/experiment/docs/README.txt	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/docs/README.txt	(revision 2714)
@@ -0,0 +1,4 @@
+Introduction
+============
+
+Look into quintagroup/themetemplate/README.txt
Index: /quintagroup.themetemplate/branches/experiment/docs/TODO.txt
===================================================================
--- /quintagroup.themetemplate/branches/experiment/docs/TODO.txt	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/docs/TODO.txt	(revision 2714)
@@ -0,0 +1,5 @@
+
+ * Write theme properties in setup.py
+
+ * Make vielets subtemplate easier to use,
+   maybe combine in one.
Index: /quintagroup.themetemplate/branches/experiment/quintagroup.themetemplate.egg-info/PKG-INFO
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup.themetemplate.egg-info/PKG-INFO	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup.themetemplate.egg-info/PKG-INFO	(revision 2714)
@@ -0,0 +1,848 @@
+Metadata-Version: 1.0
+Name: quintagroup.themetemplate
+Version: 0.23
+Summary: Quintagroup theme template for Plone 3 with nested namespace
+Home-page: http://svn.quintagroup.com/products/quintagroup.themetemplate
+Author: Andriy Mylenkyy
+Author-email: support@quintagroup.com
+License: GPL
+Description: qplone3 theme template
+        ======================
+        
+        quintagroup.themetemplate is an enhanced "Plone 3 Theme" template from Zopeskel,
+        that includes addcontent local command, which allows you to extend base Plone theme
+        by additional elements, such as: skin layers, portlets, viewlets, css and js resources,
+        and objects in zexp files. This package is an analogue of Archetype template in terms
+        of its functionality.
+        
+        quintagroup.themetemplate package is used for development of all Quintagroup themes
+        for Plone 3 (http://skins.quintagroup.com).
+        
+        Contents
+        --------
+        1. Overview
+        2. Creating theme package
+        3. Extending theme
+        4. Release notes
+        
+        Overview
+        ========
+        
+        This theme template allows you to create initial theme package skeleton,
+        i.e. create plone3 theme python package with nested namespace (this is different from
+        deafult plone3_theme template in Zopeskel)
+        
+        After that you can extend theme package by the following elements:
+        
+        - skin-layer(s)
+        - portlet(s)
+        - viewlet(s)
+        - css, js resource(s)
+        - objects in zexp files
+        
+        Creation of a package is performed with *paster create* PasteScript command.
+        Theme extending with other resources can be done with *paster addcontent*
+        local ZopeSkel command (extended in this product).
+        
+        Creating theme package
+        ======================
+        
+        Let's create plone-3 theme python package.
+        Use `paster create` command for that::
+        
+        >>> paster('create -t qplone3_theme quintagroup.theme.example --no-interactive --overwrite')
+        paster create -t qplone3_theme quintagroup.theme.example --no-interactive
+        ...
+        
+        You got standard python package content with
+        - *quintagroup* upper level namespace.
+        - *quintagroup.theme.example-configure.zcml* - zcml file
+        for adding into package-includes directory
+        
+        Check that::
+        
+        >>> package_dir = 'quintagroup.theme.example'
+        >>> objects = ['setup.py', 'quintagroup', 'quintagroup.theme.example-configure.zcml']
+        >>> objects.sort()
+        >>> [o for o in objects if o in os.listdir(package_dir)]
+        ['quintagroup', 'quintagroup.theme.example-configure.zcml', 'setup.py']
+        
+        
+        *qplone3_theme* template - creates theme with nested namespace.
+        
+        By default - theme is placed in
+        
+        quintagroup.theme.<3rd part of dotted package name> namespace
+        
+        in our case - quintagroup.theme.example
+        
+        So check namespaces::
+        
+        >>> theme_namespace = os.path.join(package_dir,'quintagroup','theme','example')
+        >>> os.path.isdir(theme_namespace)
+        True
+        
+        Theme holds 3 subdirectories (browser, profiles, skins)::
+        
+        >>> cd(theme_namespace)
+        >>> dirs = ('skins', 'browser', 'profiles')
+        >>> [True for d in dirs if d in os.listdir('.')]
+        [True, True, True]
+        
+        And initialization files (__init__.py, configure.zcml) ::
+        
+        >>> files = ('__init__.py', 'configure.zcml')
+        >>> [True for d in files if d in os.listdir('.')]
+        [True, True]
+        
+        
+        *browser* directory
+        -------------------
+        
+        Browser directory contains:
+        - 'templates' resource directory
+        - interfaces.py module with IThemeSpecific marker interface
+        - configure.zcml, with registered theme marker interface
+        
+        >>> ls('browser')
+        __init__.py
+        configure.zcml
+        interfaces.py
+        templates
+        
+        >>> cat('browser/interfaces.py')
+        from plone.theme.interfaces import IDefaultPloneLayer
+        <BLANKLINE>
+        class IThemeSpecific(IDefaultPloneLayer):
+        ...
+        
+        >>> cat('browser/configure.zcml')
+        <configure
+        ...
+        <interface
+        interface=".interfaces.IThemeSpecific"
+        type="zope.publisher.interfaces.browser.IBrowserSkinType"
+        name="Custom Theme"
+        />
+        ...
+        
+        As we see, default theme name is 'Custom Theme', but on theme
+        creation you can point out your own name. Check this ...
+        
+        First create configuration file with different skin name
+        >>> conf_data = """
+        ... [pastescript]
+        ... skinname=My Theme Name
+        ... """
+        >>> file('theme_config.conf','w').write(conf_data)
+        
+        Create the same theme with your own skin name and check this
+        >>> paster('create -t qplone3_theme quintagroup.theme.example --no-interactive --overwrite --config=theme_config.conf')
+        paster create ...
+        >>> cd(package_dir)
+        >>> cat('quintagroup/theme/example/browser/configure.zcml')
+        <configure
+        ...
+        <interface
+        interface=".interfaces.IThemeSpecific"
+        type="zope.publisher.interfaces.browser.IBrowserSkinType"
+        name="My Theme Name"
+        />
+        ...
+        
+        
+        *skins* directory
+        ------------------------
+        
+        It contains only README.txt file and NO SKIN LAYERS YET.
+        This is a job for localcommand ;)
+        
+        But check whether I am right ...
+        >>> cd('quintagroup/theme/example')
+        >>> ls('skins')
+        README.txt
+        
+        
+        *profiles* directory.
+        --------------------------------
+        There is 'default' and uninstall profiles inside
+        >>> 'default' in os.listdir('profiles')
+        True
+        >>> 'uninstall' in os.listdir('profiles')
+        True
+        
+        There are the following items in default profile:
+        - import_steps.xml - for any reason.
+        - skins.xml - for registering skins directory
+        
+        >>> cd('profiles/default')
+        >>> 'import_steps.xml' in os.listdir('.')
+        True
+        >>> 'skins.xml' in os.listdir('.')
+        True
+        
+        *skins.xml* profile makes your theme default on installation
+        and uses layers list from 'Plone Default' for our theme,
+        without any new layers (yet).
+        
+        >>> cat('skins.xml')
+        <?xml version="1.0"?>
+        ...
+        <object name="portal_skins" ...
+        default_skin="My Theme Name">
+        ...
+        <skin-path name="My Theme Name" based-on="Plone Default">
+        <!-- -*- extra layer stuff goes here -*- -->
+        <BLANKLINE>
+        </skin-path>
+        ...
+        
+        *import_steps.xml* - call _setupVarious_ function from
+        _setuphandlers.py_ module for additional installation steps.
+        
+        >>> cat('import_steps.xml')
+        <?xml version="1.0"?>
+        ...
+        <import-step id="quintagroup.theme.example.various"
+        ...
+        handler="quintagroup.theme.example.setuphandlers.setupVarious"
+        ...
+        </import-step>
+        ...
+        
+        Look at setuphandlers.py module
+        >>> cd('../..')
+        >>> cat('setuphandlers.py')
+        def setupVarious(context):
+        ...
+        
+        
+        Extending theme
+        ===============
+        
+        One of the best features, which ZopeSkel package brings, is *localcommand*.
+        
+        This part shows how you can extend a theme (generated with qplone3_theme
+        ZopeSkel template) with additional useful stuff:
+        
+        - skin layers
+        - views
+        - viewlets
+        - portlets
+        - css
+        - javascripts
+        - objects in zexp files
+        
+        So, in qplone3_theme generated package you can use *addcontent* ZopeSkel
+        local command.
+        
+        IMPORTANT TO NOTE: localcommand (addcontent in our case) should be
+        called in any subdirectory of the generated theme package. And it won't
+        work outside this package..
+        
+        >>> paster('addcontent -a')
+        paster addcontent -a
+        ...
+        css_dtml_skin:   A DTML file in skin layer with CSS registration
+        css_resource:    A Plone 3 CSS resource template
+        ...
+        import_zexps:    A template for importing zexp-objects into portal on installation
+        js_resource:     A Plone 3 JS resource template
+        N portlet:         A Plone 3 portlet
+        ...
+        skin_layer:      A Plone 3 Skin Layer
+        ...
+        N view:            A browser view skeleton
+        viewlet_hidden:  A Plone 3 Hidden Viewlet template
+        viewlet_order:   A Plone 3 Order Viewlet template
+        ...
+        
+        
+        We can see a list of extention subtemplates, which can be used for our theme.
+        'N' character tells us that these subtemplates are registered for other (archetype)
+        template, but it does not matter - they can correctly extend our theme.
+        
+        
+        Adding SKIN LAYER
+        =================
+        
+        For that case use *skin_layer* subtemplate with *addcontent* local command
+        
+        >>> paster('addcontent --no-interactive skin_layer')
+        paster addcontent --no-interactive skin_layer
+        Recursing into profiles
+        ...
+        
+        This command adds NEW 'skin_layer' (default name) directory to _skins_ directory,
+        with only CONTENT.txt file inside.
+        
+        >>> 'skin_layer' in os.listdir('skins')
+        True
+        >>> ls('skins/skin_layer')
+        CONTENT.txt
+        
+        *skins.xml* profile is also updated:
+        
+        >>> cat('profiles/default/skins.xml')
+        <?xml version="1.0"?>
+        ...
+        <object name="portal_skins" allow_any="False" cookie_persistence="False"
+        default_skin="My Theme Name">
+        ...
+        <object name="skin_layer"
+        meta_type="Filesystem Directory View"
+        directory="quintagroup.theme.example:skins/skin_layer"/>
+        ...
+        <skin-path name="My Theme Name" based-on="Plone Default">
+        ...
+        <layer name="skin_layer"
+        insert-after="custom"/>
+        <BLANKLINE>
+        </skin-path>
+        ...
+        
+        We can see, that:
+        - skin_layer directory was registered as Filesystem Directory View
+        - skin_layer Filesystem Directory View was added to our theme layers list
+        
+        
+        Adding PORTLET
+        ==========================
+        
+        Only initialization files are available in portlets directory before adding new portlet.
+        
+        >>> ls('portlets')
+        __init__.py
+        configure.zcml
+        
+        Add portlet with *portlet* subtemplate.
+        
+        >>> paster('addcontent --no-interactive portlet')
+        paster addcontent --no-interactive portlet
+        ...
+        Recursing into portlets
+        ...
+        
+        After executing this local command ...
+        
+        configure.zcml file in the theme root directory - includes portlets registry:
+        
+        >>> cat('configure.zcml')
+        <configure
+        ...
+        <include package=".portlets" />
+        ...
+        
+        exampleportlet.pt template and exampleportlet.py script added to portlets directory.
+        >>> files = ('exampleportlet.pt', 'exampleportlet.py')
+        >>> [True for d in files if d in os.listdir('portlets')]
+        [True, True]
+        
+        And portlets/configure.zcml - register new portlet
+        >>> cat('portlets/configure.zcml')
+        <configure
+        ...
+        <plone:portlet
+        name="quintagroup.theme.example.portlets.ExamplePortlet"
+        interface=".exampleportlet.IExamplePortlet"
+        assignment=".exampleportlet.Assignment"
+        view_permission="zope2.View"
+        edit_permission="cmf.ManagePortal"
+        renderer=".exampleportlet.Renderer"
+        addview=".exampleportlet.AddForm"
+        editview=".exampleportlet.EditForm"
+        />
+        ...
+        
+        Finally, new portlet type is registered in portlets.xml profile
+        
+        >>> cat('profiles/default/portlets.xml')
+        <?xml version="1.0"?>
+        ...
+        <portlet
+        addview="quintagroup.theme.example.portlets.ExamplePortlet"
+        title="Example portlet"
+        description=""
+        i18n:attributes="title; description"
+        />
+        ...
+        
+        Thanks to ZopeSkel developers for this subtempalte ;)
+        
+        
+        
+        Adding CSS resource
+        ===================
+        
+        Use *css_resource* subtemplate.
+        
+        >>> paster("addcontent --no-interactive css_resource")
+        paster addcontent --no-interactive css_resource
+        Recursing into browser
+        ...
+        Recursing into profiles
+        ...
+        
+        This template adds (if does not exist yet) _stylesheets_ directory in _browser_
+        directory
+        
+        >>> 'stylesheets' in os.listdir('browser')
+        True
+        
+        In _stylesheets_ resource directory empty main.css stylesheet
+        resource added
+        
+        >>> 'main.css' in os.listdir('browser/stylesheets')
+        True
+        >>> cat('browser/stylesheets/main.css')
+        <BLANKLINE>
+        
+        
+        New resource directory was registered in configure.zcml
+        
+        >>> cat('browser/configure.zcml')
+        <configure
+        ...
+        <browser:resourceDirectory
+        name="quintagroup.theme.example.stylesheets"
+        directory="stylesheets"
+        layer=".interfaces.IThemeSpecific"
+        />
+        ...
+        
+        
+        And cssregistry.xml profile was added into profiles/default directory with
+        registered main.css stylesheet
+        
+        >>> 'cssregistry.xml' in os.listdir('profiles/default')
+        True
+        >>> cat('profiles/default/cssregistry.xml')
+        <?xml version="1.0"?>
+        <object name="portal_css">
+        <BLANKLINE>
+        <stylesheet title=""
+        id="++resource++quintagroup.theme.example.stylesheets/main.css"
+        media="screen" rel="stylesheet" rendering="inline"
+        cacheable="True" compression="safe" cookable="True"
+        enabled="1" expression=""/>
+        ...
+        
+        
+        
+        Adding CSS resource as dtml-file into skins layer
+        =================================================
+        
+        This template actually absolutely same to the previouse one, but layer_name
+        variable added to point in which skin layer css dtml-file should be added to.
+        And, of course, css resource added into pointing *skins/<layer_name>/<css_reseource_name>.dtml* file.
+        
+        This subtemplate has several benefits before registering css as resource layer:
+        - in dtml file you can use power of dtml language
+        - this resource can be overriden by customer if he needs that
+        
+        IMPORTANT:
+        For add css resource in registered skin layer - you should use this subtemplate
+        in conjunction with *skin_layer* one.
+        
+        
+        Use *css_dtml_skin* subtemplate.
+        
+        >>> paster("addcontent --no-interactive css_dtml_skin")
+        paster addcontent --no-interactive css_dtml_skin
+        Recursing into profiles
+        ...
+        Recursing into skins
+        ...
+        
+        This template adds main.css.dtml file into skins/skin_layer folder
+        
+        >>> 'main.css.dtml' in os.listdir('skins/skin_layer')
+        True
+        
+        The main.css.dtml file already prepared to use as dtml-document
+        >>> cat('skins/skin_layer/main.css.dtml')
+        /*
+        ...
+        /* <dtml-with base_properties> (do not remove this :) */
+        ...
+        /* </dtml-with> */
+        <BLANKLINE>
+        
+        
+        And cssregistry.xml profile was added into profiles/default directory with
+        registered main.css stylesheet
+        
+        >>> 'cssregistry.xml' in os.listdir('profiles/default')
+        True
+        >>> cat('profiles/default/cssregistry.xml')
+        <?xml version="1.0"?>
+        <object name="portal_css">
+        <BLANKLINE>
+        <stylesheet title=""
+        id="++resource++quintagroup.theme.example.stylesheets/main.css"
+        media="screen" rel="stylesheet" rendering="inline"
+        cacheable="True" compression="safe" cookable="True"
+        enabled="1" expression=""/>
+        ...
+        
+        
+        Adding JAVASCRIPT resource
+        --------------------------
+        
+        Use *js_resource* subtemplate.
+        
+        >>> paster('addcontent --no-interactive js_resource')
+        paster addcontent --no-interactive js_resource
+        Recursing into browser
+        ...
+        Recursing into profiles
+        ...
+        
+        This template adds (if does not exist yet) _scripts_ directory in _browser_
+        directory
+        
+        >>> 'scripts' in os.listdir('browser')
+        True
+        
+        
+        Empty foo.js javascript file was added to _scripts_ directory
+        
+        >>> 'foo.js' in os.listdir('browser/scripts')
+        True
+        >>> cat('browser/scripts/foo.js')
+        <BLANKLINE>
+        
+        
+        New resource directory was registered in configure.zcml, if has not been registered yet.
+        
+        >>> cat('browser/configure.zcml')
+        <configure
+        ...
+        <browser:resourceDirectory
+        name="quintagroup.theme.example.scripts"
+        directory="scripts"
+        layer=".interfaces.IThemeSpecific"
+        />
+        ...
+        
+        
+        cssregistry.xml profile was added into profiles/default directory (if does not exist yet),
+        and register new foo.js javascript resource.
+        
+        >>> 'jsregistry.xml' in os.listdir('profiles/default')
+        True
+        >>> cat('profiles/default/jsregistry.xml')
+        <?xml version="1.0"?>
+        <object name="portal_javascripts">
+        ...
+        <javascript
+        id="++resource++quintagroup.theme.example.scripts/foo.js"
+        inline="False" cacheable="True" compression="safe"
+        cookable="True" enabled="1"
+        expression=""
+        />
+        ...
+        
+        
+        
+        Test viewlets subtemplates
+        ==========================
+        
+        There are 2 types of viewlet subtemplates:
+        - viewlet_order
+        - viewlet_hidden
+        
+        The first one is used for adding new viewlets and setting
+        viewlets order for the ViewletManager, the second one only hides
+        viewlet in pointed ViewletManager.
+        
+        Ordered NEW viewlet
+        -------------------
+        
+        Use *viewlet_order* subtemplate
+        
+        >>> paster('addcontent --no-interactive viewlet_order')
+        paster addcontent --no-interactive viewlet_order
+        Recursing into browser
+        ...
+        Recursing into templates
+        ...
+        Recursing into profiles
+        ...
+        
+        This template adds (if not exist ;)) _viewlets.py_ module in browser directory.
+        With added Example ViewletBase class, which is bound to templates/example_viewlet.pt
+        template
+        
+        >>> 'viewlets.py' in os.listdir('browser')
+        True
+        
+        >>> cat('browser/viewlets.py')
+        from Products.CMFCore.utils import getToolByName
+        from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
+        from plone.app.layout.viewlets import common
+        ...
+        class Example(common.ViewletBase):
+        render = ViewPageTemplateFile('templates/example_viewlet.pt')
+        <BLANKLINE>
+        
+        Check template file in templates directory.
+        
+        >>> 'example_viewlet.pt' in os.listdir('browser/templates')
+        True
+        >>> cat('browser/templates/example_viewlet.pt')
+        <BLANKLINE>
+        
+        New viewlet is registered in configure.zcml
+        
+        >>> cat('browser/configure.zcml')
+        <configure
+        ...
+        <browser:viewlet
+        name="quintagroup.theme.example.example"
+        manager="plone.app.layout.viewlets.interfaces.IPortalHeader"
+        class=".viewlets.Example"
+        layer=".interfaces.IThemeSpecific"
+        permission="zope2.View"
+        />
+        ...
+        
+        
+        viewlets.xml profile is added to profiles/default directory with new viewlet
+        registration, ordered for specified viewlet manager.
+        
+        >>> 'viewlets.xml' in os.listdir('profiles/default')
+        True
+        >>> cat('profiles/default/viewlets.xml')
+        <?xml version="1.0"?>
+        <object>
+        ...
+        <order manager="plone.portalheader"
+        based-on="Plone Default"
+        skinname="My Theme Name" >
+        ...
+        <viewlet name="quintagroup.theme.example.example" insert-after="*" />
+        <BLANKLINE>
+        </order>
+        <BLANKLINE>
+        </object>
+        
+        
+        
+        Hide EXISTING viewlet
+        ---------------------
+        
+        For that case you can use *viewlet_hidden* subtemplate
+        
+        >>> paster('addcontent --no-interactive viewlet_hidden')
+        paster addcontent --no-interactive viewlet_hidden
+        Recursing into profiles
+        ...
+        
+        As we see from upper log - there is stuff for adding/updating profiles only.
+        
+        
+        There is viewlet.xml profile in profiles/default directory
+        which hides viewlet for specified viewlet manager
+        
+        >>> 'viewlets.xml' in os.listdir('profiles/default')
+        True
+        >>> cat('profiles/default/viewlets.xml')
+        <?xml version="1.0"?>
+        <object>
+        ...
+        <hidden manager="plone.portalheader" skinname="My Theme Name">
+        ...
+        <viewlet name="example" />
+        <BLANKLINE>
+        </hidden>
+        ...
+        </object>
+        
+        
+        Adding ZEXPs importing
+        ======================
+        
+        Imagine situation, when you develop a theme, which uses some
+        extra portal objects (documents with text for some potlets)
+        Then customer of your theme can edit these objects according
+        to his need.
+        
+        For this situation *import_zexps* subtemplate exists.
+        
+        *import_zexps* subtemplate extends your theme with
+        mechanism for importing list of zexp formated files
+        into portal root on theme instllation.
+        
+        >>> paster('addcontent --no-interactive import_zexps')
+        paster addcontent --no-interactive import_zexps
+        ...
+        Recursing into import
+        ...
+        Recursing into profiles
+        ...
+        Inserting from profiles.zcml_insert ...
+        ...
+        Inserting from setuphandlers.py_insert into ...
+        ...
+        
+        As we see from the upper log:
+        - 'import' directory was added into root of the theme
+        - profiles stuff was updated
+        - profiles.zcml file is updated
+        - some stuff into setuphandlers.py module was inserted
+        
+        1. There was empty 'import' directory added, where you
+        will put zexp objects for install into portal root.
+        
+        >>> ls('import')
+        CONTENT.txt
+        
+        
+        2. import_steps.xml was added in profiles/import_zexps directory,
+        which contains additional *quintagroup.theme.example.import_zexps* step.
+        
+        >>> 'import_zexps' in os.listdir('profiles')
+        True
+        >>> 'import_steps.xml' in os.listdir('profiles/import_zexps')
+        True
+        
+        >>> cat('profiles/import_zexps/import_steps.xml')
+        <?xml version="1.0"?>
+        ...
+        <import-step id="quintagroup.theme.example.import_zexps"
+        version="..."
+        handler="quintagroup.theme.example.setuphandlers.importZEXPs"
+        title="My Theme Name: Import zexps objects">
+        Import zexp objects into portal on My Theme Name theme installation
+        </import-step>
+        <BLANKLINE>
+        ...
+        
+        3. profiles.zcml configuration updated with new genericsetup profile for zexps
+        importing.
+        
+        >>> cat('profiles.zcml')
+        <configure
+        ...
+        <genericsetup:registerProfile
+        name="import_zexps"
+        title="My Theme Name: Import ZEXPs"
+        directory="profiles/import_zexps"
+        description='Extension profile for importing objects of the "My Theme Name" Plone theme.'
+        provides="Products.GenericSetup.interfaces.EXTENSION"
+        />
+        <BLANKLINE>
+        ...
+        
+        4. Check setuphandlers.py module - there must be importZEXPs function defined
+        
+        >>> cat('setuphandlers.py')
+        def setupVarious(context):
+        ...
+        def importZEXPs(context):
+        ...
+        
+        Then simply prepare zexp objects and copy them to *import* directory.
+        
+        
+        RELEASE NOTES !
+        ===============
+        
+        Before releasing theme - I suggest to clean up setup.py script:
+        
+        - remove *theme_vars* argument (its value is useful only for
+        theme development)
+        
+        - remove *entry_points* argument (same reason).
+        It's useless in plone for now.
+        
+        - And remove *paster_plugins* argument too (it has sence
+        in conjunction with entry_points during theme developing)
+        
+        Steps mentioned above prevent possible problems with
+        theme distribution/deployment.
+        
+        Changelog
+        =========
+        
+        0.2.2 (unreleased)
+        ------------------
+        
+        - Updated import_zexps subtemplate - move this step into
+        separate genericsetup profile
+        [mylan]
+        - Updated tests for changed import_zexps subtemplate
+        [mylan]
+        
+        0.2 (unreleased)
+        ----------------
+        
+        - Added new css_dtml_skin subtemplate
+        [mylan]
+        - Added tests for css_dtml_skin subtemplate
+        [mylan]
+        
+        0.14 (unreleased)
+        -----------------
+        
+        - Refactoring theme vars storage-now storing in separate
+        theme_vars.cfg file, without distutils writers [mylan]
+        - Cleanup code [mylan]
+        
+        
+        0.11 (2009-04-13)
+        -----------------
+        
+        - Removed setup.cfg
+        [mylan]
+        
+        
+        0.10 (2009-04-13)
+        -----------------
+        
+        - Updated README
+        [olha]
+        
+        
+        0.9 (2009-04-11)
+        ----------------
+        
+        - Changed package name/namespace to
+        quintagroup.themetemplate.
+        [mylan]
+        
+        
+        0.8 (2009-04-10)
+        ----------------
+        
+        * Update tests, readme
+        [mylan]
+        
+        * Update viewlet-order subtemplate
+        [mylan]
+        
+        * Fix uninstall bug
+        [mylan]
+        
+        
+        Version 0.7
+        -----------
+        
+        * Add uninstall profile to fix skins tool after theme is uninstalled
+        [piv]
+        
+        
+        Version 0.1
+        -----------
+        
+        * Initial import Theme template with nested namespace.
+        Support ZopeSkel' "addcommad" local command for extend
+        Theme template, support extending with portlet, view local
+        templates.
+        [mylan]
+        
+Keywords: ZopeSkel theme template plone3 Quintagroup
+Platform: UNKNOWN
+Classifier: Programming Language :: Python
+Classifier: Topic :: Software Development :: Libraries :: Python Modules
Index: /quintagroup.themetemplate/branches/experiment/quintagroup.themetemplate.egg-info/SOURCES.txt
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup.themetemplate.egg-info/SOURCES.txt	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup.themetemplate.egg-info/SOURCES.txt	(revision 2714)
@@ -0,0 +1,78 @@
+MANIFEST.in
+setup.py
+docs/HISTORY.txt
+docs/README.txt
+docs/TODO.txt
+quintagroup/__init__.py
+quintagroup.themetemplate.egg-info/PKG-INFO
+quintagroup.themetemplate.egg-info/SOURCES.txt
+quintagroup.themetemplate.egg-info/dependency_links.txt
+quintagroup.themetemplate.egg-info/entry_points.txt
+quintagroup.themetemplate.egg-info/namespace_packages.txt
+quintagroup.themetemplate.egg-info/not-zip-safe
+quintagroup.themetemplate.egg-info/requires.txt
+quintagroup.themetemplate.egg-info/top_level.txt
+quintagroup/themetemplate/README.txt
+quintagroup/themetemplate/__init__.py
+quintagroup/themetemplate/qplone3_theme.py
+quintagroup/themetemplate/localcommands/__init__.py
+quintagroup/themetemplate/localcommands/__init__.pyc
+quintagroup/themetemplate/localcommands/subtemplates.py
+quintagroup/themetemplate/localcommands/subtemplates.pyc
+quintagroup/themetemplate/localcommands/templates/cssresource/browser/configure.zcml_insert
+quintagroup/themetemplate/localcommands/templates/cssresource/browser/stylesheets/+css_resource_name+_tmpl
+quintagroup/themetemplate/localcommands/templates/cssresource/browser/stylesheets/README.txt_tmpl
+quintagroup/themetemplate/localcommands/templates/cssresource/profiles/default/cssregistry.xml_insert
+quintagroup/themetemplate/localcommands/templates/cssskinresource/profiles/default/cssregistry.xml_insert
+quintagroup/themetemplate/localcommands/templates/cssskinresource/skins/+layer_name+/+css_resource_name+.dtml_tmpl
+quintagroup/themetemplate/localcommands/templates/importing/fixes.py_tmpl
+quintagroup/themetemplate/localcommands/templates/importing/profiles.zcml_insert
+quintagroup/themetemplate/localcommands/templates/importing/setuphandlers.py_insert
+quintagroup/themetemplate/localcommands/templates/importing/utils.py_tmpl
+quintagroup/themetemplate/localcommands/templates/importing/import/CONTENT.txt
+quintagroup/themetemplate/localcommands/templates/importing/profiles/import_zexps/import_steps.xml_insert
+quintagroup/themetemplate/localcommands/templates/jsresource/browser/configure.zcml_insert
+quintagroup/themetemplate/localcommands/templates/jsresource/browser/scripts/+js_resource_name+_tmpl
+quintagroup/themetemplate/localcommands/templates/jsresource/browser/scripts/README.txt_tmpl
+quintagroup/themetemplate/localcommands/templates/jsresource/profiles/default/jsregistry.xml_insert
+quintagroup/themetemplate/localcommands/templates/skinlayer/skins.zcml_insert
+quintagroup/themetemplate/localcommands/templates/skinlayer/profiles/default/skins.xml_insert
+quintagroup/themetemplate/localcommands/templates/skinlayer/skins/+layer_name+/CONTENT.txt_tmpl
+quintagroup/themetemplate/localcommands/templates/skinlayer_compo/layer4Skin/profiles/default/skins.xml_insert
+quintagroup/themetemplate/localcommands/templates/viewlet/browser/__init__.py
+quintagroup/themetemplate/localcommands/templates/viewlet/browser/configure.zcml_insert
+quintagroup/themetemplate/localcommands/templates/viewlet/browser/viewlets.py_insert
+quintagroup/themetemplate/localcommands/templates/viewlet/browser/templates/+viewlet_template_name+
+quintagroup/themetemplate/localcommands/templates/viewlet/profiles/default/viewlets.xml_insert
+quintagroup/themetemplate/localcommands/templates/viewlet_compo/viewlet_profiles/profiles/default/viewlets.xml_insert
+quintagroup/themetemplate/localcommands/templates/viewlet_hidden/profiles/default/viewlets.xml_insert
+quintagroup/themetemplate/localcommands/templates/viewlet_hidden_compo/viewlet_hidden_profiles/profiles/default/viewlets.xml_insert
+quintagroup/themetemplate/templates/qplone3_theme/+project+-configure.zcml_tmpl
+quintagroup/themetemplate/templates/qplone3_theme/MANIFEST.in_tmpl
+quintagroup/themetemplate/templates/qplone3_theme/setup.py_tmpl
+quintagroup/themetemplate/templates/qplone3_theme/theme_vars.cfg_tmpl
+quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/__init__.py_tmpl
+quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/configure.zcml_tmpl
+quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/profiles.zcml_tmpl
+quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/setuphandlers.py_tmpl
+quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/skins.zcml_tmpl
+quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/version.txt_tmpl
+quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/Extensions/Install.py_tmpl
+quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/Extensions/__init__.py
+quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/browser/__init__.py
+quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/browser/configure.zcml_tmpl
+quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/browser/interfaces.py_tmpl
+quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/browser/templates/README.txt
+quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/portlets/__init__.py
+quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/portlets/configure.zcml_tmpl
+quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/profiles/default/+namespace_package+.+namespace_package2+.+package+_various.txt_tmpl
+quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/profiles/default/import_steps.xml_tmpl
+quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/profiles/default/metadata.xml_tmpl
+quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/profiles/default/portlets.xml
+quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/profiles/default/skins.xml_tmpl
+quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/profiles/uninstall/+namespace_package+.+namespace_package2+.+package+_uninstall.txt_tmpl
+quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/profiles/uninstall/import_steps.xml_tmpl
+quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/profiles/uninstall/skins.xml_tmpl
+quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/skins/README.txt
+quintagroup/themetemplate/tests/__init__.py
+quintagroup/themetemplate/tests/test_qthemedoc.py
Index: /quintagroup.themetemplate/branches/experiment/quintagroup.themetemplate.egg-info/dependency_links.txt
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup.themetemplate.egg-info/dependency_links.txt	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup.themetemplate.egg-info/dependency_links.txt	(revision 2714)
@@ -0,0 +1,1 @@
+
Index: /quintagroup.themetemplate/branches/experiment/quintagroup.themetemplate.egg-info/entry_points.txt
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup.themetemplate.egg-info/entry_points.txt	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup.themetemplate.egg-info/entry_points.txt	(revision 2714)
@@ -0,0 +1,15 @@
+
+          [paste.paster_create_template]
+          qplone3_theme = quintagroup.themetemplate:qPlone3Theme
+
+          [zopeskel.zopeskel_sub_template]
+          skin_layer    = quintagroup.themetemplate.localcommands.subtemplates:SkinLayerSubTemplate
+          css_resource = quintagroup.themetemplate.localcommands.subtemplates:CSSSubTemplate
+          css_dtml_skin = quintagroup.themetemplate.localcommands.subtemplates:CSSSkinLayerSubTemplate
+          js_resource = quintagroup.themetemplate.localcommands.subtemplates:JSSubTemplate
+          viewlet_order = quintagroup.themetemplate.localcommands.subtemplates:ViewletOrderSubTemplate
+          viewlet_hidden = quintagroup.themetemplate.localcommands.subtemplates:ViewletHiddenSubTemplate
+          import_zexps = quintagroup.themetemplate.localcommands.subtemplates:ImportSubTemplate
+
+      # -*- Entry points: -*-
+      
Index: /quintagroup.themetemplate/branches/experiment/quintagroup.themetemplate.egg-info/namespace_packages.txt
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup.themetemplate.egg-info/namespace_packages.txt	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup.themetemplate.egg-info/namespace_packages.txt	(revision 2714)
@@ -0,0 +1,1 @@
+quintagroup
Index: /quintagroup.themetemplate/branches/experiment/quintagroup.themetemplate.egg-info/not-zip-safe
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup.themetemplate.egg-info/not-zip-safe	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup.themetemplate.egg-info/not-zip-safe	(revision 2714)
@@ -0,0 +1,1 @@
+
Index: /quintagroup.themetemplate/branches/experiment/quintagroup.themetemplate.egg-info/requires.txt
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup.themetemplate.egg-info/requires.txt	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup.themetemplate.egg-info/requires.txt	(revision 2714)
@@ -0,0 +1,5 @@
+ZopeSkel
+PasteScript>=1.6.3
+
+[tests]
+zope.testing
Index: /quintagroup.themetemplate/branches/experiment/quintagroup.themetemplate.egg-info/top_level.txt
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup.themetemplate.egg-info/top_level.txt	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup.themetemplate.egg-info/top_level.txt	(revision 2714)
@@ -0,0 +1,1 @@
+quintagroup
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/__init__.py
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/__init__.py	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/__init__.py	(revision 2714)
@@ -0,0 +1,6 @@
+# See http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages
+try:
+    __import__('pkg_resources').declare_namespace(__name__)
+except ImportError:
+    from pkgutil import extend_path
+    __path__ = extend_path(__path__, __name__)
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/README.txt
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/README.txt	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/README.txt	(revision 2714)
@@ -0,0 +1,771 @@
+qplone3 theme template
+======================
+
+quintagroup.themetemplate is an enhanced "Plone 3 Theme" template from Zopeskel, 
+that includes addcontent local command, which allows you to extend base Plone theme
+by additional elements, such as: skin layers, portlets, viewlets, css and js resources, 
+and objects in zexp files. This package is an analogue of Archetype template in terms 
+of its functionality.
+
+quintagroup.themetemplate package is used for development of all Quintagroup themes 
+for Plone 3 at http://skins.quintagroup.com.
+
+Contents
+--------
+1. Overview
+2. Creating theme package
+3. Extending theme
+4. Release notes
+
+Overview
+========
+
+This theme template allows you to create initial theme package skeleton,
+i.e. create plone3 theme python package with nested namespace (this is different from 
+deafult plone3_theme template in Zopeskel) 
+
+After that you can extend theme package by the following elements:
+
+- skin-layer(s)
+- portlet(s)
+- viewlet(s)
+- css, js resource(s)
+- objects in zexp files
+
+Creation of a package is performed with *paster create* PasteScript command.
+Theme extending with other resources can be done with *paster addcontent*
+local ZopeSkel command (extended in this product).
+
+Creating theme package
+======================
+
+Let's create plone-3 theme python package.
+Use `paster create` command for that::
+
+    >>> paster('create -t qplone3_theme quintagroup.theme.example --no-interactive --overwrite')
+    paster create -t qplone3_theme quintagroup.theme.example --no-interactive
+    ...
+
+You got standard python package content with
+
+- *quintagroup* upper level namespace.
+- *quintagroup.theme.example-configure.zcml* - zcml file for adding into package-includes directory
+
+Check that::
+
+    >>> package_dir = 'quintagroup.theme.example'
+    >>> objects = ['setup.py', 'quintagroup', 'quintagroup.theme.example-configure.zcml']
+    >>> objects.sort()
+    >>> [o for o in objects if o in os.listdir(package_dir)]
+    ['quintagroup', 'quintagroup.theme.example-configure.zcml', 'setup.py']
+
+
+*qplone3_theme* template - creates theme with nested namespace.
+
+By default - theme is placed in *quintagroup.theme.<3rd part of dotted package name> namespace*
+
+in our case - quintagroup.theme.example
+
+So check namespaces::
+
+    >>> theme_namespace = os.path.join(package_dir,'quintagroup','theme','example')
+    >>> os.path.isdir(theme_namespace)
+    True
+
+Theme holds 3 subdirectories (browser, profiles, skins)::
+
+    >>> cd(theme_namespace)
+    >>> dirs = ('skins', 'browser', 'profiles')
+    >>> [True for d in dirs if d in os.listdir('.')]
+    [True, True, True]
+
+And initialization files (__init__.py, configure.zcml) ::
+
+    >>> files = ('__init__.py', 'configure.zcml')
+    >>> [True for d in files if d in os.listdir('.')]
+    [True, True]
+    
+
+*browser* directory
+-------------------
+
+Browser directory contains:
+
+- 'templates' resource directory
+- interfaces.py module with IThemeSpecific marker interface
+- configure.zcml, with registered theme marker interface::
+
+    >>> ls('browser')
+    __init__.py
+    configure.zcml
+    interfaces.py
+    templates
+
+    >>> cat('browser/interfaces.py')
+    from plone.theme.interfaces import IDefaultPloneLayer
+    <BLANKLINE>
+    class IThemeSpecific(IDefaultPloneLayer):
+    ...
+
+    >>> cat('browser/configure.zcml')
+    <configure
+    ...
+        <interface
+            interface=".interfaces.IThemeSpecific"
+            type="zope.publisher.interfaces.browser.IBrowserSkinType"
+            name="Custom Theme"
+            />
+    ...
+
+As we see, default theme name is 'Custom Theme', but on theme
+creation you can point out your own name. Check this ...
+
+First create configuration file with different skin name::
+
+    >>> conf_data = """
+    ... [pastescript]
+    ... skinname=My Theme Name
+    ... """
+    >>> file('theme_config.conf','w').write(conf_data)
+
+Create the same theme with your own skin name and check this::
+
+    >>> paster('create -t qplone3_theme quintagroup.theme.example --no-interactive --overwrite --config=theme_config.conf')
+    paster create ...
+    >>> cd(package_dir)
+    >>> cat('quintagroup/theme/example/browser/configure.zcml')
+    <configure
+    ...
+        <interface
+            interface=".interfaces.IThemeSpecific"
+            type="zope.publisher.interfaces.browser.IBrowserSkinType"
+            name="My Theme Name"
+            />
+    ...
+
+
+*skins* directory
+-----------------
+
+It contains only README.txt file and NO SKIN LAYERS YET.
+This is a job for localcommand ;)
+
+But check whether I am right ...::
+
+    >>> cd('quintagroup/theme/example')
+    >>> ls('skins')
+    README.txt
+
+
+*profiles* directory
+--------------------
+
+There is 'default' and uninstall profiles inside::
+
+    >>> 'default' in os.listdir('profiles')
+    True
+    >>> 'uninstall' in os.listdir('profiles')
+    True
+
+There are the following items in default profile:
+
+- import_steps.xml - for any reason.
+- skins.xml - for registering skins directory::
+
+    >>> cd('profiles/default')
+    >>> 'import_steps.xml' in os.listdir('.')
+    True
+    >>> 'skins.xml' in os.listdir('.')
+    True
+
+*skins.xml* profile makes your theme default on installation
+and uses layers list from 'Plone Default' for our theme,
+without any new layers (yet)::
+
+    >>> cat('skins.xml')
+    <?xml version="1.0"?>
+    ...
+    <object name="portal_skins" ...
+            default_skin="My Theme Name">
+    ...
+    <skin-path name="My Theme Name" based-on="Plone Default">
+      <!-- -*- extra layer stuff goes here -*- -->
+    <BLANKLINE>
+    </skin-path>
+    ...
+
+*import_steps.xml* - call _setupVarious_ function from
+_setuphandlers.py_ module for additional installation steps::
+
+    >>> cat('import_steps.xml')
+    <?xml version="1.0"?>
+    ...
+    <import-step id="quintagroup.theme.example.various"
+    ...
+                 handler="quintagroup.theme.example.setuphandlers.setupVarious"
+    ...
+    </import-step>
+    ...
+
+Look at setuphandlers.py module::
+
+    >>> cd('../..')
+    >>> cat('setuphandlers.py')
+        def setupVarious(context):
+    ...
+
+
+Extending theme
+===============
+
+One of the best features, which ZopeSkel package brings, is *localcommand*.
+
+This part shows how you can extend a theme (generated with qplone3_theme
+ZopeSkel template) with additional useful stuff:
+
+- skin layers
+- views
+- viewlets
+- portlets
+- css
+- javascripts
+- objects in zexp files
+
+So, in qplone3_theme generated package you can use *addcontent* ZopeSkel
+local command.
+
+IMPORTANT TO NOTE: localcommand (addcontent in our case) should be
+called in any subdirectory of the generated theme package. And it won't
+work outside this package::
+
+    >>> paster('addcontent -a')
+    paster addcontent -a
+      ...
+        css_dtml_skin:   A DTML file in skin layer with CSS registration
+        css_resource:    A Plone 3 CSS resource template
+      ...
+        import_zexps:    A template for importing zexp-objects into portal on installation
+        js_resource:     A Plone 3 JS resource template
+      N portlet:         A Plone 3 portlet
+      ...
+        skin_layer:      A Plone 3 Skin Layer
+      ...
+      N view:            A browser view skeleton
+        viewlet_hidden:  A Plone 3 Hidden Viewlet template
+        viewlet_order:   A Plone 3 Order Viewlet template
+      ...
+
+
+We can see a list of extention subtemplates, which can be used for our theme.
+'N' character tells us that these subtemplates are registered for other (archetype)
+template, but it does not matter - they can correctly extend our theme.
+
+
+Adding SKIN LAYER
+=================
+
+For that case use *skin_layer* subtemplate with *addcontent* local command::
+
+    >>> paster('addcontent --no-interactive skin_layer')
+    paster addcontent --no-interactive skin_layer
+    Recursing into profiles
+    ...
+
+This command adds NEW 'skin_layer' (default name) directory to _skins_ directory,
+with only CONTENT.txt file inside::
+
+    >>> 'skin_layer' in os.listdir('skins')
+    True
+    >>> ls('skins/skin_layer')
+    CONTENT.txt
+
+*skins.xml* profile is also updated::
+
+    >>> cat('profiles/default/skins.xml')
+    <?xml version="1.0"?>
+    ...
+    <object name="portal_skins" allow_any="False" cookie_persistence="False"
+       default_skin="My Theme Name">
+    ...
+     <object name="skin_layer"
+        meta_type="Filesystem Directory View"
+        directory="quintagroup.theme.example:skins/skin_layer"/>
+    ...
+     <skin-path name="My Theme Name" based-on="Plone Default">
+    ...
+      <layer name="skin_layer"
+         insert-after="custom"/>
+    <BLANKLINE>
+     </skin-path>
+    ...
+
+We can see, that: 
+
+- skin_layer directory was registered as Filesystem Directory View
+- skin_layer Filesystem Directory View was added to our theme layers list
+
+
+Adding PORTLET
+==============
+
+Only initialization files are available in portlets directory before adding new portlet::
+
+    >>> ls('portlets')
+    __init__.py
+    configure.zcml
+
+Add portlet with *portlet* subtemplate::
+
+    >>> paster('addcontent --no-interactive portlet')
+    paster addcontent --no-interactive portlet
+    ...
+    Recursing into portlets
+    ...
+
+After executing this local command ...
+
+configure.zcml file in the theme root directory - includes portlets registry::
+
+    >>> cat('configure.zcml')
+    <configure
+    ...
+    <include package=".portlets" />
+    ...
+
+exampleportlet.pt template and exampleportlet.py script added to portlets directory::
+  
+  >>> files = ('exampleportlet.pt', 'exampleportlet.py')
+    >>> [True for d in files if d in os.listdir('portlets')]
+    [True, True]
+
+And portlets/configure.zcml - register new portlet::
+
+    >>> cat('portlets/configure.zcml')
+    <configure
+    ...
+         <plone:portlet
+             name="quintagroup.theme.example.portlets.ExamplePortlet"
+             interface=".exampleportlet.IExamplePortlet"
+             assignment=".exampleportlet.Assignment"
+             view_permission="zope2.View"
+             edit_permission="cmf.ManagePortal"
+             renderer=".exampleportlet.Renderer"
+             addview=".exampleportlet.AddForm"
+             editview=".exampleportlet.EditForm"
+             />
+    ...
+
+Finally, new portlet type is registered in portlets.xml profile::
+
+    >>> cat('profiles/default/portlets.xml')
+    <?xml version="1.0"?>
+    ...
+       <portlet
+         addview="quintagroup.theme.example.portlets.ExamplePortlet"
+         title="Example portlet"
+         description=""
+         i18n:attributes="title; description"
+	 />
+    ...
+
+Thanks to ZopeSkel developers for this subtempalte ;)
+
+
+Adding CSS resource
+===================
+
+Use *css_resource* subtemplate::
+
+    >>> paster("addcontent --no-interactive css_resource")
+    paster addcontent --no-interactive css_resource
+    Recursing into browser
+    ...
+    Recursing into profiles
+    ...
+
+This template adds (if does not exist yet) _stylesheets_ directory in _browser_
+directory::
+
+    >>> 'stylesheets' in os.listdir('browser')
+    True
+
+In _stylesheets_ resource directory empty main.css stylesheet
+resource added::
+
+    >>> 'main.css' in os.listdir('browser/stylesheets')
+    True
+    >>> cat('browser/stylesheets/main.css')
+    <BLANKLINE>
+
+
+New resource directory was registered in configure.zcml::
+
+    >>> cat('browser/configure.zcml')
+    <configure
+    ...
+        <browser:resourceDirectory
+            name="quintagroup.theme.example.stylesheets"
+            directory="stylesheets"
+            layer=".interfaces.IThemeSpecific"
+            />
+    ...
+    
+
+And cssregistry.xml profile was added into profiles/default directory with
+registered main.css stylesheet::
+
+    >>> 'cssregistry.xml' in os.listdir('profiles/default')
+    True
+    >>> cat('profiles/default/cssregistry.xml')
+    <?xml version="1.0"?>
+    <object name="portal_css">
+    <BLANKLINE>
+     <stylesheet title=""
+        id="++resource++quintagroup.theme.example.stylesheets/main.css"
+        media="screen" rel="stylesheet" rendering="inline"
+        cacheable="True" compression="safe" cookable="True"
+        enabled="1" expression=""/>
+    ...
+
+
+
+Adding CSS resource as dtml-file into skins layer
+=================================================
+
+This template actually absolutely same to the previouse one, but layer_name
+variable added to point in which skin layer css dtml-file should be added to.
+And, of course, css resource added into pointing *skins/<layer_name>/<css_reseource_name>.dtml* file.
+
+This subtemplate has several benefits before registering css as resource layer:
+
+- in dtml file you can use power of dtml language
+- this resource can be overriden by customer if he needs that
+
+IMPORTANT:
+For add css resource in registered skin layer - you should use this subtemplate
+in conjunction with *skin_layer* one.
+
+
+Use *css_dtml_skin* subtemplate::
+
+    >>> paster("addcontent --no-interactive css_dtml_skin")
+    paster addcontent --no-interactive css_dtml_skin
+    Recursing into profiles
+    ...
+    Recursing into skins
+    ...
+
+This template adds main.css.dtml file into skins/skin_layer folder::
+
+    >>> 'main.css.dtml' in os.listdir('skins/skin_layer')
+    True
+
+The main.css.dtml file already prepared to use as dtml-document::
+
+    >>> cat('skins/skin_layer/main.css.dtml')
+    /*
+    ...
+    /* <dtml-with base_properties> (do not remove this :) */
+    ...
+    /* </dtml-with> */
+    <BLANKLINE>
+  
+
+And cssregistry.xml profile was added into profiles/default directory with
+registered main.css stylesheet::
+
+    >>> 'cssregistry.xml' in os.listdir('profiles/default')
+    True
+    >>> cat('profiles/default/cssregistry.xml')
+    <?xml version="1.0"?>
+    <object name="portal_css">
+    <BLANKLINE>
+     <stylesheet title=""
+        id="++resource++quintagroup.theme.example.stylesheets/main.css"
+        media="screen" rel="stylesheet" rendering="inline"
+        cacheable="True" compression="safe" cookable="True"
+        enabled="1" expression=""/>
+    ...
+
+
+Adding JAVASCRIPT resource
+--------------------------
+
+Use *js_resource* subtemplate::
+
+    >>> paster('addcontent --no-interactive js_resource')
+    paster addcontent --no-interactive js_resource
+    Recursing into browser
+    ...
+    Recursing into profiles
+    ...
+
+This template adds (if does not exist yet) _scripts_ directory in _browser_
+directory::
+
+    >>> 'scripts' in os.listdir('browser')
+    True
+
+
+Empty foo.js javascript file was added to _scripts_ directory::
+
+    >>> 'foo.js' in os.listdir('browser/scripts')
+    True
+    >>> cat('browser/scripts/foo.js')
+    <BLANKLINE>
+
+
+New resource directory was registered in configure.zcml, if has not been registered yet::
+
+    >>> cat('browser/configure.zcml')
+    <configure
+    ...
+        <browser:resourceDirectory
+            name="quintagroup.theme.example.scripts"
+            directory="scripts"
+            layer=".interfaces.IThemeSpecific"
+            />
+    ...
+    
+
+cssregistry.xml profile was added into profiles/default directory (if does not exist yet),
+and register new foo.js javascript resource::
+
+    >>> 'jsregistry.xml' in os.listdir('profiles/default')
+    True
+    >>> cat('profiles/default/jsregistry.xml')
+    <?xml version="1.0"?>
+    <object name="portal_javascripts">
+    ...
+     <javascript
+        id="++resource++quintagroup.theme.example.scripts/foo.js"
+        inline="False" cacheable="True" compression="safe"
+        cookable="True" enabled="1"
+        expression=""
+        />
+    ...
+
+
+
+Test viewlets subtemplates
+==========================
+
+There are 2 types of viewlet subtemplates:
+
+- viewlet_order
+- viewlet_hidden
+
+The first one is used for adding new viewlets and setting 
+viewlets order for the ViewletManager, the second one only hides
+viewlet in pointed ViewletManager.
+
+Ordered NEW viewlet
+-------------------
+
+Use *viewlet_order* subtemplate::
+
+    >>> paster('addcontent --no-interactive viewlet_order')
+    paster addcontent --no-interactive viewlet_order
+    Recursing into browser
+    ...
+    Recursing into templates
+    ...
+    Recursing into profiles
+    ...
+
+This template adds (if not exist ;)) _viewlets.py_ module in browser directory.
+With added Example ViewletBase class, which is bound to templates/example_viewlet.pt
+template::
+
+    >>> 'viewlets.py' in os.listdir('browser')
+    True
+    
+    >>> cat('browser/viewlets.py')
+    from Products.CMFCore.utils import getToolByName
+    from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
+    from plone.app.layout.viewlets import common
+    ...
+    class Example(common.ViewletBase):
+        render = ViewPageTemplateFile('templates/example_viewlet.pt')
+    <BLANKLINE>
+
+Check template file in templates directory::
+
+    >>> 'example_viewlet.pt' in os.listdir('browser/templates')
+    True
+    >>> cat('browser/templates/example_viewlet.pt')
+    <BLANKLINE>
+
+New viewlet is registered in configure.zcml::
+
+    >>> cat('browser/configure.zcml')
+    <configure
+    ...
+       <browser:viewlet
+            name="quintagroup.theme.example.example"
+            manager="plone.app.layout.viewlets.interfaces.IPortalHeader"
+            class=".viewlets.Example"
+            layer=".interfaces.IThemeSpecific"
+            permission="zope2.View"
+            />
+    ...
+    
+
+viewlets.xml profile is added to profiles/default directory with new viewlet 
+registration, ordered for specified viewlet manager::
+
+    >>> 'viewlets.xml' in os.listdir('profiles/default')
+    True
+    >>> cat('profiles/default/viewlets.xml')
+    <?xml version="1.0"?>
+    <object>
+    ...
+     <order manager="plone.portalheader"
+             based-on="Plone Default"
+             skinname="My Theme Name" >
+    ...
+        <viewlet name="quintagroup.theme.example.example" insert-after="*" />
+    <BLANKLINE>
+      </order>
+    <BLANKLINE>
+    </object>
+
+
+
+Hide EXISTING viewlet
+---------------------
+
+For that case you can use *viewlet_hidden* subtemplate::
+
+    >>> paster('addcontent --no-interactive viewlet_hidden')
+    paster addcontent --no-interactive viewlet_hidden
+    Recursing into profiles
+    ...
+
+As we see from upper log - there is stuff for adding/updating profiles only.
+    
+
+There is viewlet.xml profile in profiles/default directory
+which hides viewlet for specified viewlet manager::
+
+    >>> 'viewlets.xml' in os.listdir('profiles/default')
+    True
+    >>> cat('profiles/default/viewlets.xml')
+    <?xml version="1.0"?>
+    <object>
+    ...
+      <hidden manager="plone.portalheader" skinname="My Theme Name">
+    ...
+        <viewlet name="example" />
+    <BLANKLINE>
+      </hidden>
+    ...
+    </object>
+
+
+Adding ZEXPs importing
+======================
+
+Imagine situation, when you develop a theme, which uses some 
+extra portal objects (documents with text for some potlets)
+Then customer of your theme can edit these objects according
+to his need.
+
+For this situation *import_zexps* subtemplate exists.
+
+*import_zexps* subtemplate extends your theme with
+mechanism for importing list of zexp formated files
+into portal root on theme instllation::
+
+    >>> paster('addcontent --no-interactive import_zexps')
+    paster addcontent --no-interactive import_zexps
+    ...
+    Recursing into import
+    ...
+    Recursing into profiles
+    ...
+    Inserting from profiles.zcml_insert ...
+    ...
+    Inserting from setuphandlers.py_insert into ...
+    ...
+
+As we see from the upper log
+
+- 'import' directory was added into root of the theme
+- profiles stuff was updated
+- profiles.zcml file is updated
+- some stuff into setuphandlers.py module was inserted
+    
+1. There was empty 'import' directory added, where you
+   will put zexp objects for install into portal root.::
+
+    >>> ls('import')
+    CONTENT.txt
+
+
+2. import_steps.xml was added in profiles/import_zexps directory,
+   which contains additional *quintagroup.theme.example.import_zexps* step::
+
+    >>> 'import_zexps' in os.listdir('profiles')
+    True
+    >>> 'import_steps.xml' in os.listdir('profiles/import_zexps')
+    True
+
+    >>> cat('profiles/import_zexps/import_steps.xml')
+    <?xml version="1.0"?>
+    ...
+      <import-step id="quintagroup.theme.example.import_zexps"
+                   version="..."
+                   handler="quintagroup.theme.example.setuphandlers.importZEXPs"
+                   title="My Theme Name: Import zexps objects">
+        Import zexp objects into portal on My Theme Name theme installation
+      </import-step>
+    <BLANKLINE>
+    ...
+
+3. profiles.zcml configuration updated with new genericsetup profile for zexps
+   importing::
+
+    >>> cat('profiles.zcml')
+    <configure
+    ...
+      <genericsetup:registerProfile
+        name="import_zexps"
+        title="My Theme Name: Import ZEXPs"
+        directory="profiles/import_zexps"
+        description='Extension profile for importing objects of the "My Theme Name" Plone theme.'
+        provides="Products.GenericSetup.interfaces.EXTENSION"
+        />
+    <BLANKLINE>
+    ...
+    
+4. Check setuphandlers.py module - there must be importZEXPs function defined::
+
+    >>> cat('setuphandlers.py')
+    def setupVarious(context):
+    ...
+    def importZEXPs(context):
+    ...
+
+Then simply prepare zexp objects and copy them to *import* directory.
+
+
+RELEASE NOTES !
+===============
+
+Before releasing theme - I suggest to clean up setup.py script:
+
+- remove *theme_vars* argument (its value is useful only for theme development)
+
+- remove *entry_points* argument (same reason). It's useless in plone for now.
+
+- And remove *paster_plugins* argument too (it has sence in conjunction with entry_points during theme developing)
+
+Steps mentioned above prevent possible problems with
+theme distribution/deployment.
+
+Notes:
+------
+
+* quintagroup.themetemplate v0.25 compatible with ZopeSkel >= 2.15
+
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/__init__.py
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/__init__.py	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/__init__.py	(revision 2714)
@@ -0,0 +1,33 @@
+#
+import os
+import warnings
+from paste.script import pluginlib
+
+from quintagroup.themetemplate.qplone3_theme import qPlone3Theme
+
+warned = False
+
+def getEggInfo(output_dir):
+    """ Return path to egg info directory, raise error if not found.
+    """
+    egg_info = pluginlib.find_egg_info_dir(output_dir)
+    assert egg_info is not None, "egg_info directory must present for the package"
+
+    return egg_info
+
+
+def getThemeVarsFP(egg_info):
+    """ Return file system path to theme vars configurations
+    """
+    global warned
+    old_path = os.path.join(egg_info, 'theme_vars.txt')
+    if os.path.exists(old_path):
+        if not warned:
+            warnings.warn(
+                "In 1.0 version theme variables from <the.theme.package>/theme_vars.cfg " \
+                "file only will be used. Currently " \
+                "<the.theme.package>/<the.theme.package>.egg_info/theme_vars.txt " \
+                "also supported." , DeprecationWarning, 2)
+            warned = True
+        return old_path
+    return os.path.join(egg_info, '..', 'theme_vars.cfg')
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/__init__.py
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/__init__.py	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/__init__.py	(revision 2714)
@@ -0,0 +1,122 @@
+"""
+Local templates for the qplone3_theme
+"""
+import os
+from ConfigParser import SafeConfigParser
+
+from zopeskel.base import var
+from zopeskel.localcommands import ZopeSkelLocalTemplate
+
+from quintagroup.themetemplate import getEggInfo
+from quintagroup.themetemplate import getThemeVarsFP
+
+class QThemeSubTemplate(ZopeSkelLocalTemplate):
+    use_cheetah = True
+    parent_templates = ['qplone3_theme']
+
+    # Flag for use template composition
+    compose = None
+    compodir_pref = "_compo"
+    # list of 2 item tuple -
+    # (compotemplate_name, compo marker), for ex.:
+    compo_template_markers = []
+    # list vars names to add in theme_vars egg_info file
+    shared_vars = []
+
+    def template_dir(self):
+        if self.compose:
+            # Prepare
+            self._template_dir = os.path.join( \
+                self._template_dir + self.compodir_pref, \
+                self.compose )
+
+        return super(QThemeSubTemplate, self).template_dir()
+
+    def pre(self, command, output_dir, vars):
+        """ Get all previous template vars
+        """
+        for k, v in self.get_template_vars(output_dir, vars).items():
+            if not k in vars.keys():
+                vars[k] = v
+        super(QThemeSubTemplate, self).pre(command, output_dir, vars)
+
+    def post(self, command, output_dir, vars):
+        """ Call write_files function for every subtemplate,
+             - change marker name for every subtemplate,
+             - set compose prop for change subtemplate path calculation
+        """
+        if self.compo_template_markers:
+            for cname, cmarker in self.compo_template_markers:
+                original_template_dir = self._template_dir
+                self.compose = cname
+                self.marker_name = cmarker
+                self.write_files(command, output_dir, vars)
+                self._template_dir = original_template_dir
+
+        self.add_template_vars(output_dir, vars)
+        super(QThemeSubTemplate, self).post(command, output_dir, vars)
+
+    def get_template_vars(self, output_dir, vars):
+
+        res = {}
+        egg_info = getEggInfo(output_dir)
+        theme_vars_fp = getThemeVarsFP(egg_info)
+
+        if os.path.exists(theme_vars_fp):
+            config = SafeConfigParser()
+            config.read(theme_vars_fp)
+            
+            for section in config.sections():
+                for option in config.options(section):
+                    key = section + '_' + option
+                    val = config.get(section, option)
+                    if section == 'multiple_templates':
+                        val = val.split(',')
+                    res[key] = val
+
+        return res
+
+    def add_template_vars(self, output_dir, vars):
+
+        egg_info = getEggInfo(output_dir)
+        theme_vars_fp = getThemeVarsFP(egg_info)
+
+        if os.path.exists(theme_vars_fp):
+            config = SafeConfigParser()
+            config.read(theme_vars_fp)
+
+            # Update qplone3_theme used_subtemplate option
+            sec, opt = 'qplone3_theme', 'used_subtemplates'
+            val = filter(None,[st.strip() \
+                         for st in config.get(sec,opt).split(',')])
+            val.append(self.name)
+            config.set(sec, opt, ','.join(set(val)))
+
+            # Add subtemplate vars
+            if self.shared_vars:
+                thesection = self.name
+                if config.has_section(thesection):
+                    msection = 'multiple_templates'
+                    moption = self.name
+
+                    if not config.has_section(msection):
+                        config.add_section(msection)
+
+                    val = []
+                    if config.has_option(msection, moption):
+                        val = config.get(msection, moption).split(',')
+                    else:
+                        val.append(moption)
+                    thesection = "%s_%d"%(moption,len(val))
+                    val.append(thesection)
+
+                    config.set(msection, moption, ','.join(val))
+
+                config.add_section(thesection)
+                for k in self.shared_vars:
+                    config.set(thesection, k, vars[k])
+
+            # Save theme_vars.txt file
+            theme_file = file(theme_vars_fp,'w')
+            config.write(theme_file)
+            theme_file.close()
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/subtemplates.py
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/subtemplates.py	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/subtemplates.py	(revision 2714)
@@ -0,0 +1,278 @@
+"""
+Local templates for the qplone3_theme
+"""
+import os, sys, re, datetime, copy
+from ConfigParser import SafeConfigParser
+from paste.script import pluginlib
+
+from zopeskel.base import var
+from zopeskel.localcommands import ZopeSkelLocalTemplate
+
+from quintagroup.themetemplate import getEggInfo
+from quintagroup.themetemplate import getThemeVarsFP
+from quintagroup.themetemplate.localcommands import QThemeSubTemplate
+
+RESP = re.compile("\s+")
+REBAN = re.compile("[\\\/\,\.\+\-\*\%\~\@\#\$\^\&\|\;\:\?\(\)\=\[\]\{\}\_]+")
+
+
+class SkinLayerSubTemplate(QThemeSubTemplate):
+    """
+    A Plone Skin layer skeleton
+    """
+    _template_dir = 'templates/skinlayer'
+    summary = "A Plone 3 Skin Layer"
+
+    compo_template_markers = [
+        ('layer4Skin',   'extra layer stuff goes here'),
+    ]
+
+    vars = [
+      var('layer_name', 'Skin Layer name (should not contain spaces)',
+           default="skin_layer"),
+      var('insert_type', 'Where insert the layer ("after" or "before")', default="after"),
+      var('insert_control_layer',
+          'Layer after or before which your layer will be inserted, "*" accepted, which mean all',
+          default='custom'),
+           ]
+
+
+class CSSSubTemplate(QThemeSubTemplate):
+    """
+    A Plone CSS resource skeleton
+    """
+    _template_dir = 'templates/cssresource'
+    summary = "A Plone 3 CSS resource template"
+    
+    vars = [
+      var('css_resource_name', 'Name of CSS resource',
+           default="main.css"),
+      var('css_file_path', 'Path to CSS file. If no path-empty file will be created.',
+           default=''),
+      var('cssreg_media', 'Optional.Possible values:screen,print,projection,handheld',
+           default="screen", ),
+      var('cssreg_rel', 'Optional', default="stylesheet"),
+      var('cssreg_rendering', 'Optional.Possible values:import,link,inline', default="inline"),
+      var('cssreg_cacheable', '', default="True"),
+      var('cssreg_compression', 'Compression type', default="safe"),
+      var('cssreg_cookable', 'Boolean, aka merging allowed', default="True"),
+      var('cssreg_enables', 'Optional.Boolean', default="1"),
+      var('cssreg_expression', 'Optional.A tal condition.', default=""),
+           ]
+
+    def pre(self, command, output_dir, vars):
+        """ Set 'css_resource_content' value from css_file_path
+        """
+        super(CSSSubTemplate, self).pre(command, output_dir, vars)
+
+        vars['css_resource_content'] = ''
+        if os.path.isfile(vars['css_file_path']):
+            vars['css_resource_content'] = file(vars['css_file_path'],'rb').read()
+
+
+class CSSSkinLayerSubTemplate(CSSSubTemplate):
+    """
+    A Plone CSS resource, placed as DTML-file in a skin layer
+    """
+    _template_dir = 'templates/cssskinresource'
+    summary = "A DTML file in skin layer with CSS registration"
+    
+    vars = [
+      var('layer_name', 'Layer name for css resource add to',
+          default="skin_layer"),
+    ] + copy.deepcopy(CSSSubTemplate.vars)
+
+    def pre(self, command, output_dir, vars):
+        """ Remove trailing spaces from layer name
+        """
+        super(CSSSkinLayerSubTemplate, self).pre(command, output_dir, vars)
+        vars['layer_name'] = vars['layer_name'].strip()
+
+
+class JSSubTemplate(QThemeSubTemplate):
+    """
+    A Plone JS resource skeleton
+    """
+    _template_dir = 'templates/jsresource'
+    summary = "A Plone 3 JS resource template"
+    
+    vars = [
+      var('js_resource_name', 'Name of JS resource', default="foo.js"),
+      var('js_file_path', 'Path to JS file. If no path - empty file will be created',
+          default=''),
+      var('jsreg_inline', 'Optional.Boolean', default="False"),
+      var('jsreg_cacheable', '', default="True"),
+      var('jsreg_compression', 'Compression type.Possible:none,safe,full,safe-encode,full-encode',
+          default="safe"),
+      var('jsreg_cookable', 'Boolean, aka merging allowed', default="True"),
+      var('jsreg_enables', 'Optional.Boolean', default="1"),
+      var('jsreg_expression', 'Optional.A tal condition.', default=""),
+           ]
+
+    def pre(self, command, output_dir, vars):
+        """ Set 'js_resource_content' value from js_file_path
+        """
+        super(JSSubTemplate, self).pre(command, output_dir, vars)
+        
+        vars['js_resource_content'] = ''
+        if os.path.isfile(vars['js_file_path']):
+            vars['js_resource_content'] = file(vars['js_file_path'],'rb').read()
+
+
+class ViewletOrderSubTemplate(QThemeSubTemplate):
+    """
+    A Plone Order Viewlet skeleton
+    """
+    _template_dir = 'templates/viewlet'
+    summary = "A Plone 3 Order Viewlet template"
+    
+    # list of 2 item tuple -
+    # (compotemplate_name, compo marker), for ex.:
+    compo_template_markers = []
+
+    shared_vars = ['viewlet_profile_marker',]
+
+    vars = [
+      var('viewlet_name', "Viewlet name", default='example'),
+      var('viewlet_manager_interface', "Viewlet manager interface",
+          default="plone.app.layout.viewlets.interfaces.IPortalHeader"),
+      var('viewlet_manager_name', "Viewlet manager name", default='plone.portalheader'),
+      var('viewlet_permission', "Viewlet permission", default="zope2.View"),
+
+
+      var('insert_type', 'Where insert the viewlet ("after" or "before")', default="after"),
+      var('insert_control_viewlet', 'Viewlet after or before which your viewlet will be inserted, ' \
+          '"*" accepted, which mean all', default='*'),
+
+      var('layer_interface', "Layer interface for registry this viewlet on", 
+          default=".interfaces.IThemeSpecific"),
+      var('layer_name', "Layer name for registry this viewlet on", default=""),
+      #var('skinname', "Skin name, for bind viewlet to, '*' - mean for all", default=""),
+      #var('skinbase', "Base skin, for get viewlets from", default=""),
+           ]
+
+    def pre(self, command, output_dir, vars):
+        """ Set 'css_resource_content' value from css_file_path
+        """
+        super(ViewletOrderSubTemplate, self).pre(command, output_dir, vars)
+
+        vn_lower_nospc = RESP.sub('',vars['viewlet_name']).lower()
+        vn_lower_under = RESP.sub('_',vars['viewlet_name']).lower()
+        VnCamel = ''.join([i.capitalize() for i in REBAN.sub(' ',vars['viewlet_name']).split()])
+        vars['viewlet_class_name'] = VnCamel
+        vars['viewlet_interface_name'] = "I"+VnCamel
+        vars['viewlet_template_name'] = vn_lower_nospc+'_viewlet.pt'
+
+        viewlet_profile_marker = "[order_%s] viewlet stuff goes here" % \
+            '.'.join([vars['viewlet_manager_name'], vars['qplone3_theme_skinname'], 
+                      vars['qplone3_theme_skinbase']])
+        
+        vars['add_order_tag'] = self.add_order_tag(output_dir, vars, viewlet_profile_marker)
+        vars['viewlet_profile_marker'] = viewlet_profile_marker
+        self.compo_template_markers.append(
+            ('viewlet_profiles',viewlet_profile_marker))
+
+
+    def add_order_tag(self, output_dir, vars, pmarker):
+        need_update = True
+        egg_info = getEggInfo(output_dir)
+        theme_vars_fp = getThemeVarsFP(egg_info)
+
+        if os.path.exists(theme_vars_fp):
+            config = SafeConfigParser()
+            config.read(theme_vars_fp)
+
+            sec, opt = 'qplone3_theme', 'used_subtemplates'
+            used_subtemplates = filter(None,[st.strip() \
+                         for st in config.get(sec,opt).split(',')])
+            
+            if self.name in used_subtemplates:
+                sections = [self.name,]
+                if config.has_section('multiple_templates') and \
+                  config.has_option('multiple_templates',self.name):
+                    ms_sections = config.get('multiple_templates',self.name)
+                    sections = [s.strip() for s in ms_sections.split(',')]
+
+                pmarkers = [config.get(sec, 'viewlet_profile_marker') \
+                            for sec in sections]
+                if pmarker in pmarkers:
+                    need_update = False
+
+        return need_update
+
+
+class ViewletHiddenSubTemplate(QThemeSubTemplate):
+    """
+    A Plone Hidden Viewlet skeleton
+    """
+    _template_dir = 'templates/viewlet_hidden'
+    summary = "A Plone 3 Hidden Viewlet template"
+
+    shared_vars = ['viewlet_profile_marker',]
+
+    compo_template_markers = []
+    
+    vars = [
+      var('viewlet_name', "Viewlet name", default='plone.global_sections'),
+      var('viewlet_manager_name', "Viewlet manager name", default='plone.portalheader'),
+      #var('skinname', "Skin name, for bind viewlet to, may be '*'", default=""),
+           ]
+
+    def pre(self, command, output_dir, vars):
+        """ Set 'css_resource_content' value from css_file_path
+        """
+        super(ViewletHiddenSubTemplate, self).pre(command, output_dir, vars)
+         
+        viewlet_profile_marker = "[hidden_%s] viewlet stuff goes here" % \
+            '.'.join([vars['viewlet_manager_name'], vars['qplone3_theme_skinname']])
+
+        vars['add_hidden_tag'] = self.add_hidden_tag(output_dir, vars, viewlet_profile_marker)
+        vars['viewlet_profile_marker'] = viewlet_profile_marker
+        self.compo_template_markers.append(
+            ('viewlet_hidden_profiles',viewlet_profile_marker))
+
+
+    def add_hidden_tag(self, output_dir, vars, pmarker):
+        add_hidden = True
+        egg_info = getEggInfo(output_dir)
+        theme_vars_fp = getThemeVarsFP(egg_info)
+
+        if os.path.exists(theme_vars_fp):
+            config = SafeConfigParser()
+            config.read(theme_vars_fp)
+
+            sec, opt = 'qplone3_theme', 'used_subtemplates'
+            used_subtemplates = filter(None,[st.strip() \
+                         for st in config.get(sec,opt).split(',')])
+            
+            if self.name in used_subtemplates:
+                sections = [self.name,]
+                if config.has_section('multiple_templates') and \
+                  config.has_option('multiple_templates',self.name):
+                    ms_sections = config.get('multiple_templates',self.name)
+                    sections = [s.strip() for s in ms_sections.split(',')]
+
+                pmarkers = [config.get(sec, 'viewlet_profile_marker') \
+                            for sec in sections]
+                if pmarker in pmarkers:
+                    add_hidden = False
+        return add_hidden
+
+class ImportSubTemplate(QThemeSubTemplate):
+    """
+    A skeleton for importing zexp objects into portal on theme installation
+    """
+    _template_dir = 'templates/importing'
+    summary = "A template for importing zexp-objects into portal on installation"
+    
+    def pre(self, command, output_dir, vars):
+        """ Set timestamp var for generate import_steps profile id
+        """
+        super(ImportSubTemplate, self).pre(command, output_dir, vars)
+
+        vars['timestamp'] = datetime.date.today().strftime("%Y%m%d")
+        vars['already_used'] = self.already_used(vars)
+
+    def already_used(self, vars):
+        used = vars.get('qplone3_theme_used_subtemplates','').split(',')
+        return self.name in filter(None,[st.strip() for st in used])
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/cssresource/browser/configure.zcml_insert
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/cssresource/browser/configure.zcml_insert	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/cssresource/browser/configure.zcml_insert	(revision 2714)
@@ -0,0 +1,8 @@
+#if not 'css_resource' in $qplone3_theme_used_subtemplates:
+    <!-- Resource directory for stylesheets -->
+    <browser:resourceDirectory
+        name="${namespace_package}.${namespace_package2}.${package}.stylesheets"
+        directory="stylesheets"
+        layer=".interfaces.IThemeSpecific"
+        />
+#end if
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/cssresource/browser/stylesheets/+css_resource_name+_tmpl
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/cssresource/browser/stylesheets/+css_resource_name+_tmpl	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/cssresource/browser/stylesheets/+css_resource_name+_tmpl	(revision 2714)
@@ -0,0 +1,1 @@
+${css_resource_content}
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/cssresource/browser/stylesheets/README.txt_tmpl
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/cssresource/browser/stylesheets/README.txt_tmpl	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/cssresource/browser/stylesheets/README.txt_tmpl	(revision 2714)
@@ -0,0 +1,61 @@
+README for the 'browser/stylesheets/' directory
+===============================================
+
+This folder is a Zope 3 Resource Directory acting as a repository for
+stylesheets.
+
+Its declaration is located in 'browser/configure.zcml':
+
+    <!-- Resource directory for stylesheets -->
+    <browser:resourceDirectory
+        name="${namespace_package}.${namespace_package2}.${package}.stylesheets"
+        directory="stylesheets"
+        layer=".interfaces.IThemeSpecific"
+        />
+
+A stylesheet placed in this directory (e.g. 'main.css') can be accessed from
+this relative URL:
+
+    "++resource++${namespace_package}.${namespace_package2}.${package}.stylesheets/main.css"
+
+Note that it might be better to register each of these resources separately if
+you want them to be overridable from zcml directives.
+
+The only way to override a resource in a resource directory is to override the
+entire directory (all elements have to be copied over).
+
+A Zope 3 browser resource declared like this in 'browser/configure.zcml':
+
+    <browser:resource
+        name="main.css"
+        file="stylesheets/main.css"
+        layer=".interfaces.IThemeSpecific"
+        />
+
+can be accessed from this relative URL:
+
+    "++resource++main.css"
+
+Notes
+-----
+
+* Stylesheets registered as Zope 3 resources might be flagged as not found in
+  the 'portal_css' tool if the layer they are registered for doesn't match the
+  default skin set in 'portal_skins'.
+  This can be confusing but it must be considered as a minor bug in the CSS
+  registry instead of a lack in the way Zope 3 resources are handled in
+  Zope 2.
+
+* There might be a way to interpret DTML from a Zope 3 resource view.
+  Although, if you need to use DTML for setting values in a stylesheet (the
+  same way as in default Plone stylesheets where values are read from
+  'base_properties'), it is much easier to store it in a directory that is
+  located in the 'skins/' folder of your package, registered as a File System
+  Directory View in the 'portal_skins' tool, and added to the layers of your
+  skin.
+
+* Customizing/overriding stylesheets that are originally accessed from the
+  'portal_skins' tool (e.g. Plone default stylesheets) can be done inside that
+  tool only. There is no known way to do it with Zope 3 browser resources.
+  Vice versa, there is no known way to override a Zope 3 browser resource from
+  a skin layer in 'portal_skins'.
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/cssresource/profiles/default/cssregistry.xml_insert
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/cssresource/profiles/default/cssregistry.xml_insert	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/cssresource/profiles/default/cssregistry.xml_insert	(revision 2714)
@@ -0,0 +1,13 @@
+#<?xml version="1.0"?>
+#<object name="portal_css">
+#
+
+ <stylesheet title=""
+    id="++resource++${namespace_package}.${namespace_package2}.${package}.stylesheets/${css_resource_name}"
+    media="${cssreg_media}" rel="${cssreg_rel}" rendering="${cssreg_rendering}"
+    cacheable="${cssreg_cacheable}" compression="${cssreg_compression}" cookable="${cssreg_cookable}"
+    enabled="${cssreg_enables}" expression="${cssreg_expression}"/>
+
+# <!-- -*- extra stuff goes here -*- -->
+#
+#</object>
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/cssskinresource/profiles/default/cssregistry.xml_insert
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/cssskinresource/profiles/default/cssregistry.xml_insert	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/cssskinresource/profiles/default/cssregistry.xml_insert	(revision 2714)
@@ -0,0 +1,13 @@
+#<?xml version="1.0"?>
+#<object name="portal_css">
+#
+
+ <stylesheet title=""
+    id="${css_resource_name}"
+    media="${cssreg_media}" rel="${cssreg_rel}" rendering="${cssreg_rendering}"
+    cacheable="${cssreg_cacheable}" compression="${cssreg_compression}" cookable="${cssreg_cookable}"
+    enabled="${cssreg_enables}" expression="${cssreg_expression}"/>
+
+# <!-- -*- extra stuff goes here -*- -->
+#
+#</object>
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/cssskinresource/skins/+layer_name+/+css_resource_name+.dtml_tmpl
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/cssskinresource/skins/+layer_name+/+css_resource_name+.dtml_tmpl	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/cssskinresource/skins/+layer_name+/+css_resource_name+.dtml_tmpl	(revision 2714)
@@ -0,0 +1,18 @@
+/*
+** Style sheet
+**
+** Style sheet documentation can be found at http://plone.org/documentation
+**
+** You should preferrably use ploneCustom.css to add your own CSS classes and to
+** customize your portal, as these are the base fundaments of Plone, and will
+** change and be refined in newer versions. Keeping your changes in
+** ploneCustom.css will make it easier to upgrade.
+**
+*/
+
+/* <dtml-with base_properties> (do not remove this :) */
+/* <dtml-call "REQUEST.set('portal_url', portal_url())"> (not this either :) */
+
+${css_resource_content}
+
+/* </dtml-with> */
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/importing/fixes.py_tmpl
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/importing/fixes.py_tmpl	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/importing/fixes.py_tmpl	(revision 2714)
@@ -0,0 +1,55 @@
+from Acquisition import aq_base
+from Products.CMFCore.utils import getToolByName
+from Products.ZCatalog.ProgressHandler import ZLogHandler
+from plone.app.linkintegrity.handlers import referencedRelationship as li_relation
+
+portal_catalog = None
+portal_repository = None
+uid_catalog = None
+reference_catalog = None
+
+def fix_archivest(ob):
+    """ Fix #7334 bug of CMFEdition.
+        Fixed in CMFEdition v1.1.5+.
+    """
+    if portal_repository.isVersionable(ob):
+        portal_repository.save(obj=ob, comment="")
+
+def fix_catalog(ob):
+    ob.reindexObject()
+
+def fix_linkintegrity(ob):
+    """Fix losed references."""
+    uobject = aq_base(ob)
+    if reference_catalog.isReferenceable(uobject):
+        ob_li_refs = reference_catalog.getReferences(ob, relationship=li_relation)
+        if ob_li_refs:
+            annotations = ob._getReferenceAnnotations()
+            uniqueUIDs = uid_catalog.uniqueValuesFor('UID')
+            # delete references to non-existent objects
+            [annotations._delObject(ref.id) for ref in ob_li_refs \
+             if not ref.targetUID in uniqueUIDs]
+        
+def fix_all(ob):
+    """ Recursive function for perform registered
+        actions for all internal objects.
+    """
+    [a(ob) for a in perobject_actions]
+
+    if getattr(ob, 'is_folderish', None):
+        [fix_all(o) for o in ob.objectValues()]
+
+perobject_actions = [fix_archivest, fix_catalog, fix_linkintegrity]
+
+def fix(context):
+    """ Main fix function: fix defects of importing:
+        imported objects - absence in catalogs, some other issues.
+    """
+    global portal_repository, portal_catalog
+    global uid_catalog, reference_catalog
+    portal_catalog = getToolByName(context,'portal_catalog')
+    portal_repository = getToolByName(context,'portal_repository')
+    uid_catalog = getToolByName(context,'uid_catalog')
+    reference_catalog = getToolByName(context,'reference_catalog')
+
+    fix_all(context)
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/importing/import/CONTENT.txt
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/importing/import/CONTENT.txt	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/importing/import/CONTENT.txt	(revision 2714)
@@ -0,0 +1,1 @@
+This is container for zexp files
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/importing/profiles.zcml_insert
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/importing/profiles.zcml_insert	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/importing/profiles.zcml_insert	(revision 2714)
@@ -0,0 +1,9 @@
+
+  <genericsetup:registerProfile
+      name="import_zexps"
+      title="${qplone3_theme_skinname}: Import ZEXPs"
+      directory="profiles/import_zexps"
+      description='Extension profile for importing objects of the "${qplone3_theme_skinname}" Plone theme.'
+      provides="Products.GenericSetup.interfaces.EXTENSION"
+      />
+
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/importing/profiles/import_zexps/import_steps.xml_insert
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/importing/profiles/import_zexps/import_steps.xml_insert	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/importing/profiles/import_zexps/import_steps.xml_insert	(revision 2714)
@@ -0,0 +1,12 @@
+#<?xml version="1.0"?>
+#<import-steps>
+#if not $already_used:
+  <import-step id="${namespace_package}.${namespace_package2}.${package}.import_zexps"
+               version="${timestamp}-01"
+               handler="${namespace_package}.${namespace_package2}.${package}.setuphandlers.importZEXPs"
+               title="${qplone3_theme_skinname}: Import zexps objects">
+    Import zexp objects into portal on ${qplone3_theme_skinname} theme installation
+  </import-step>
+#end if
+
+#</import-steps>
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/importing/setuphandlers.py_insert
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/importing/setuphandlers.py_insert	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/importing/setuphandlers.py_insert	(revision 2714)
@@ -0,0 +1,12 @@
+#if not $already_used:
+from ${namespace_package}.${namespace_package2}.${package}.utils import checkIfImport, performImportToPortal
+
+def importZEXPs(context):
+
+    if context.readDataFile("${namespace_package}.${namespace_package2}.${package}_various.txt") is None:
+        return
+
+    site = context.getSite()
+    if checkIfImport():
+        performImportToPortal(site)
+#end if
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/importing/utils.py_tmpl
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/importing/utils.py_tmpl	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/importing/utils.py_tmpl	(revision 2714)
@@ -0,0 +1,235 @@
+#
+import transaction
+import os, sys, re, string
+from sets import Set
+from StringIO import StringIO
+from time import gmtime, strftime
+from zLOG import LOG, INFO
+from zExceptions import BadRequest
+from App.config import getConfiguration
+from Products.CMFCore.utils import getToolByName
+from Products.CMFCore.DirectoryView import addDirectoryViews
+from Globals import package_home
+
+from fixes import fix
+from ${namespace_package}.${namespace_package2}.${package} import GLOBALS
+
+IMPORT_POLICY = "backup"
+
+######################################################################
+##                      IMPORTING UTILS                             ##
+######################################################################
+osp = os.path
+ALLOWED_IMPORT_POLICY = ["only_new", "backup", "overwrite"]
+INTRO_TO_INSTANCE = "< Started copying object files from Product import directory to Instance one."
+SUMMARY_TO_INSTANCE = "> Finished copying."
+INTRO_TO_ROOT = "< Started import %s file[s] with '%s' policy."
+SUMMARY_TO_ROOT = "> Finished importing."
+INTRO_CLEAN = "< Started cleaning Instance import directory."
+SUMMARY_CLEAN = "> Finished cleaning."
+CREXP_INVALID_ID = re.compile('^The id \"(.*?)\" is invalid - it is already in use.$', re.DOTALL|re.IGNORECASE|re.MULTILINE)
+CSS_BASE_IDS_QPSD053 = ['id','expression','enabled','cookable','media','rel','title','rendering']   # supporting qPSD-0.5.3 version
+################    CHECK IMPORTING    ################
+def checkIfImport():
+    """ Return if perform importing, based on checking 
+        *zexp files in <SkinProduct>/import directory.
+    """
+    instance_ipath, product_ipath = getImportedPathes()
+    product_ilist = [i for i in os.listdir(product_ipath) \
+                     if osp.isfile(osp.join(product_ipath,i)) and i.endswith('.zexp')]
+    if product_ilist:
+        return 1
+    return 0
+
+################    IMPORTING TO PLONE'S IMPORT DIR   ################
+def getImportedPathes():
+    """ Return Plone instance and Skin product import pathes."""
+    # Based on instance path, construct import pathes 
+    cfg = getConfiguration()
+    instance_ipath = osp.join(cfg.instancehome, "import")
+    product_ipath = osp.join(package_home(GLOBALS), "import")
+    # Check presence of Product import directory
+    if not osp.isdir(product_ipath):        
+        raise BadRequest, "Skin Product's import directory '%s' - does not exist or is'nt direcory" % product_ipath
+    # Check presence of Instance import directory
+    if not osp.isdir(instance_ipath):
+        raise BadRequest, "Instance import directory '%s' - does not exist or isn't direcory" % instance_ipath
+    return [instance_ipath, product_ipath]
+
+def copyFile(src_dir, dst_dir, f_name):
+    """ Copy file from src_dir to dst_dir under original name."""
+    try:
+        src_file = open(osp.join(src_dir, f_name),"rb")
+        dst_file = open(osp.join(dst_dir, f_name),"wb")
+        dst_file.write(src_file.read())
+        dst_file.close()
+        src_file.close()
+    except Exception, e:
+        msg = "!!! In copying files from < %s > dir to < %s > dir exception occur. Details: %s." % (src_dir,dst_dir, str(e))
+        print >> import_out, msg
+        LOG('performImportToPortal',INFO,'copyFile', msg)
+
+def moveToTemp(same_instance_files, instance_ipath, temp_dir_path):
+    """ Move samenamed files from Instanse's dir to temp dir."""
+    os.mkdir(temp_dir_path) # Create temp back_[date] dir
+    try:
+        [copyFile(instance_ipath, temp_dir_path, f_name) for f_name in same_instance_files]
+        [os.remove(osp.join(instance_ipath, f_name)) for f_name in same_instance_files]
+    except Exception, e:
+        msg = "!!! Exception occur during moving files from Instance's dir to temp dir. Detaile:%s." % str(e)
+        print >> import_out, msg
+        LOG('performImportToPortal',INFO,'moveToTemp', msg)
+    
+def copyToInstanceImport():
+    """ Perform copying imported files from <SkinProduct>/import dir
+        to Plone's instance import dir.
+    """
+    print >> import_out, INTRO_TO_INSTANCE
+    instance_ipath, product_ipath = getImportedPathes()
+    # Compose temp dir back_[date] dir path in Instance import directory
+    temp_dir_id = "back_%s" % strftime("%Y%m%d%H%M%S", gmtime())
+    temp_dir_path = osp.join(instance_ipath, temp_dir_id)
+    # Get *.zexp files from Skin Product's import dir and Plone's instance import dir files
+    product_ilist = [i for i in os.listdir(product_ipath) \
+                     if osp.isfile(osp.join(product_ipath,i)) and i.endswith('.zexp')]
+    instance_ilist = [i for i in os.listdir(instance_ipath) \
+                      if osp.isfile(osp.join(instance_ipath,i)) and i.endswith('.zexp')]
+    # Check for presence samenamed files in Instance and Product import directories.
+    same_instance_files = [f_name for f_name in instance_ilist if f_name in product_ilist]
+    if same_instance_files:
+        moveToTemp(same_instance_files, instance_ipath, temp_dir_path)
+    # Copy all *zexp files from Product's import dir to Instance's import dir
+    [copyFile(product_ipath, instance_ipath, f_name) for f_name in product_ilist]
+    print >> import_out, SUMMARY_TO_INSTANCE
+    return [instance_ipath, product_ipath, temp_dir_path, product_ilist]
+
+################    IMPORTING TO PORTAL   ################
+def importObject(portal, file_name):
+    """ Work around old Zope bug in importing."""
+    try:
+        portal.manage_importObject(file_name)
+    except:
+        portal._p_jar = portal.Destination()._p_jar
+        portal.manage_importObject(file_name)
+
+def makeBackUp(portal, portal_objects, temp_dir_path, obj_id):
+    """ Perfom backup same named portal objects in temp folder."""
+    # Get id of temp folder-object
+    durty_path,temp_id = osp.split(temp_dir_path)
+    if not temp_id:
+        durty_path,temp_id = osp.split(durty_path)
+    # Get temp folder-object
+    if temp_id not in portal_objects:
+        portal.invokeFactory('Large Plone Folder', id=temp_id)
+        print >> import_out, "! Created '%s' backup directory with same-ids " \
+                             "objects from portal root." % temp_id
+    temp_dir = getattr(portal, temp_id)
+    # Move object with same id to temp folder-object
+    #get_transaction().commit(1)
+    transaction.savepoint()
+    obj = portal.manage_cutObjects(ids=[obj_id])
+    temp_dir.manage_pasteObjects(obj)
+    print >> import_out, "! '%s' Object moved from portal root to '%s' backup directory." % (obj_id, temp_id)
+
+def performImport(portal, temp_dir_path, file_name):
+    """ Importing an object to portal."""
+    portal_objects = portal.objectIds()
+    try:
+        portal.manage_importObject(file_name)
+    except Exception, e:
+        msg = str(e)
+        is_invalid_id = CREXP_INVALID_ID.match(msg)
+        if is_invalid_id:
+            obj_id = is_invalid_id.group(1)
+            if IMPORT_POLICY == "only_new":
+                msg = "! Object with '%s' id was not importing because it's already exist " \
+                      "in portal root." % obj_id
+                print >> import_out, msg
+            elif IMPORT_POLICY == "backup":
+                makeBackUp(portal, portal_objects, temp_dir_path, obj_id)
+                importObject(portal, file_name)
+            elif IMPORT_POLICY == "overwrite":
+                portal.manage_delObjects(ids=[obj_id])
+                importObject(portal, file_name)
+        else:
+            # work around old Zope bug in importing
+            portal._p_jar = portal.Destination()._p_jar
+            portal.manage_importObject(file_name)
+
+def importToPortalRoot(portal, product_file_names, temp_dir_path):
+    """ Import all objects from *zexp files to portal root (based on IMPORT_POLICY)."""
+    if not IMPORT_POLICY in ALLOWED_IMPORT_POLICY:
+        raise Exception("%s - wrong import policy, must be one of the %s" \
+                        % (IMPORT_POLICY, ALLOWED_IMPORT_POLICY) )
+    print >> import_out, INTRO_TO_ROOT % (product_file_names, IMPORT_POLICY)
+    for file_name in product_file_names:
+        try:
+            # Temporary allow implicitly adding Large Plone Folder
+            types_tool = getToolByName(portal, 'portal_types')
+            lpf_fti = types_tool['Large Plone Folder']
+            lpf_global_setting = lpf_fti.global_allow
+            lpf_fti.global_allow = 1
+            try:
+                performImport(portal, temp_dir_path, file_name)
+            finally:
+                lpf_fti.global_allow = lpf_global_setting
+        except Exception, error:
+            msg = '!!! Under "%s" policy importing exception occur: %s.' % (IMPORT_POLICY, str(error))
+            print >> import_out, msg
+            LOG('performImportToPortal',INFO,'importToPortalRoot', msg)
+    print >> import_out, SUMMARY_TO_ROOT
+
+################    CLEANING PLONE'S IMPORT DIR   ################
+def cleanInstanceImport(instance_ipath, product_file_names, temp_dir_path):
+    """ Cleaning Plone's import dir."""
+    print >> import_out, INTRO_CLEAN
+    # Erase all copied *zexp files from Instance's import dir
+    for f_name in product_file_names:
+        f_path = osp.join(instance_ipath, f_name)
+        if osp.exists(f_path) and osp.isfile(f_path):
+            os.remove(f_path)
+        else:
+            msg = '! "%s" file was not deleted from "%s" import directory.' %\
+                   (f_name, osp.join(instance_ipath))
+            print >> import_out, msg
+            LOG('performImportToPortal',INFO,'cleanInstanceImport', msg)
+    # Move all files from temp back_[date] dir to Instance's import dir
+    if osp.exists(temp_dir_path) and osp.isdir(temp_dir_path):
+        f_names = os.listdir(temp_dir_path)
+        try:
+            [copyFile(temp_dir_path, instance_ipath, f_name) for f_name in f_names]
+            [os.remove(osp.join(temp_dir_path, f_name)) for f_name in f_names]
+            # Erase temp back_[date] dir
+            os.rmdir(temp_dir_path)
+        except Exception, e:
+            msg = "!!! In moving files from temp dir to Instance's import dir exception occur."
+            print >> import_out, msg
+            LOG('performImportToPortal',INFO,'moveFromTempToImport', msg)
+    print >> import_out, SUMMARY_CLEAN
+
+def fixImportingIssues(portal, beforeimporting_objects):
+    ''' Fix defects of importing process: reindexing, other'''
+    afterimporting_objects = portal.objectItems()
+    diff_objects = list(Set(afterimporting_objects)-Set(beforeimporting_objects))
+    for id, ob in diff_objects:
+        if id.startswith('back_'):
+            continue
+        fix(ob)
+
+################    MAIN    ################
+def performImportToPortal(portal):
+    """ Import objects from Skin Product to Portal root."""
+    globals()['import_out'] = StringIO()
+    instance_ipath, product_ipath, temp_dir_path, product_file_names = copyToInstanceImport()
+    if product_file_names:
+        beforeimporting_objects = portal.objectItems()
+        importToPortalRoot(portal, product_file_names, temp_dir_path)
+        fixImportingIssues(portal, beforeimporting_objects)
+        cleanInstanceImport(instance_ipath, product_file_names, temp_dir_path)
+    else:
+        print >> import_out, "!!! Failure importing: there is no file for importing to be found."
+    result = import_out.getvalue()
+    del globals()['import_out']
+    return result
+
+#
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/jsresource/browser/configure.zcml_insert
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/jsresource/browser/configure.zcml_insert	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/jsresource/browser/configure.zcml_insert	(revision 2714)
@@ -0,0 +1,8 @@
+#if not 'js_resource' in $qplone3_theme_used_subtemplates:
+    <!-- Resource directory for scripts -->
+    <browser:resourceDirectory
+        name="${namespace_package}.${namespace_package2}.${package}.scripts"
+        directory="scripts"
+        layer=".interfaces.IThemeSpecific"
+        />
+#end if
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/jsresource/browser/scripts/+js_resource_name+_tmpl
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/jsresource/browser/scripts/+js_resource_name+_tmpl	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/jsresource/browser/scripts/+js_resource_name+_tmpl	(revision 2714)
@@ -0,0 +1,1 @@
+${js_resource_content}
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/jsresource/browser/scripts/README.txt_tmpl
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/jsresource/browser/scripts/README.txt_tmpl	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/jsresource/browser/scripts/README.txt_tmpl	(revision 2714)
@@ -0,0 +1,61 @@
+README for the 'browser/scripts/' directory
+===============================================
+
+This folder is a Zope 3 Resource Directory acting as a repository for
+scripts.
+
+Its declaration is located in 'browser/configure.zcml':
+
+    <!-- Resource directory for scripts -->
+    <browser:resourceDirectory
+        name="${namespace_package}.${namespace_package2}.${package}.scripts"
+        directory="scripts"
+        layer=".interfaces.IThemeSpecific"
+        />
+
+A script placed in this directory (e.g. 'foo.js') can be accessed from
+this relative URL:
+
+    "++resource++${namespace_package}.${namespace_package2}.${package}.scripts/foo.js"
+
+Note that it might be better to register each of these resources separately if
+you want them to be overridable from zcml directives.
+
+The only way to override a resource in a resource directory is to override the
+entire directory (all elements have to be copied over).
+
+A Zope 3 browser resource declared like this in 'browser/configure.zcml':
+
+    <browser:resource
+        name="foo.js"
+        file="scripts/foo.js"
+        layer=".interfaces.IThemeSpecific"
+        />
+
+can be accessed from this relative URL:
+
+    "++resource++foo.js"
+
+Notes
+-----
+
+* Scripts registered as Zope 3 resources might be flagged as not found in
+  the 'portal_js' tool if the layer they are registered for doesn't match the
+  default skin set in 'portal_skins'.
+  This can be confusing but it must be considered as a minor bug in the JS
+  registry instead of a lack in the way Zope 3 resources are handled in
+  Zope 2.
+
+* There might be a way to interpret DTML from a Zope 3 resource view.
+  Although, if you need to use DTML for setting values in a script (the
+  same way as in default Plone scripts where values are read from
+  'base_properties'), it is much easier to store it in a directory that is
+  located in the 'skins/' folder of your package, registered as a File System
+  Directory View in the 'portal_skins' tool, and added to the layers of your
+  skin.
+
+* Customizing/overriding scripts that are originally accessed from the
+  'portal_skins' tool (e.g. Plone default scripts) can be done inside that
+  tool only. There is no known way to do it with Zope 3 browser resources.
+  Vice versa, there is no known way to override a Zope 3 browser resource from
+  a skin layer in 'portal_skins'.
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/jsresource/profiles/default/jsregistry.xml_insert
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/jsresource/profiles/default/jsregistry.xml_insert	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/jsresource/profiles/default/jsregistry.xml_insert	(revision 2714)
@@ -0,0 +1,13 @@
+#<?xml version="1.0"?>
+#<object name="portal_javascripts">
+#
+# <!-- -*- extra stuff goes here -*- -->
+#
+ <javascript
+    id="++resource++${namespace_package}.${namespace_package2}.${package}.scripts/${js_resource_name}"
+    inline="${jsreg_inline}" cacheable="${jsreg_cacheable}" compression="${jsreg_compression}"
+    cookable="${jsreg_cookable}" enabled="${jsreg_enables}"
+    expression="${jsreg_expression}"
+    />
+
+#</object>
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/skinlayer/profiles/default/skins.xml_insert
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/skinlayer/profiles/default/skins.xml_insert	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/skinlayer/profiles/default/skins.xml_insert	(revision 2714)
@@ -0,0 +1,5 @@
+
+ <object name="${layer_name}"
+    meta_type="Filesystem Directory View"
+    directory="${namespace_package}.${namespace_package2}.${package}:skins/${layer_name}"/>
+
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/skinlayer/skins.zcml_insert
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/skinlayer/skins.zcml_insert	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/skinlayer/skins.zcml_insert	(revision 2714)
@@ -0,0 +1,13 @@
+#<configure
+#    xmlns="http://namespaces.zope.org/zope"
+#    xmlns:cmf="http://namespaces.zope.org/cmf"
+#    i18n_domain="${namespace_package}.${namespace_package2}.${package}">
+#
+#   <!-- File System Directory Views registration -->
+#
+#   <!-- -*- extra stuff goes here -*- -->
+
+   <cmf:registerDirectory
+       name="${layer_name}"/>
+
+#</configure>
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/skinlayer/skins/+layer_name+/CONTENT.txt_tmpl
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/skinlayer/skins/+layer_name+/CONTENT.txt_tmpl	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/skinlayer/skins/+layer_name+/CONTENT.txt_tmpl	(revision 2714)
@@ -0,0 +1,1 @@
+They act as replacement for the default Plone (or 3rd party products) ones.
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/skinlayer_compo/layer4Skin/profiles/default/skins.xml_insert
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/skinlayer_compo/layer4Skin/profiles/default/skins.xml_insert	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/skinlayer_compo/layer4Skin/profiles/default/skins.xml_insert	(revision 2714)
@@ -0,0 +1,2 @@
+  <layer name="${layer_name}"
+     insert-${insert_type}="${insert_control_layer}"/>
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/viewlet/browser/__init__.py
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/viewlet/browser/__init__.py	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/viewlet/browser/__init__.py	(revision 2714)
@@ -0,0 +1,1 @@
+#
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/viewlet/browser/configure.zcml_insert
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/viewlet/browser/configure.zcml_insert	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/viewlet/browser/configure.zcml_insert	(revision 2714)
@@ -0,0 +1,10 @@
+   <browser:viewlet
+        name="${namespace_package}.${namespace_package2}.${package}.${viewlet_name}"
+        manager="${viewlet_manager_interface}"
+        class=".viewlets.${viewlet_class_name}"
+        #if $layer_interface:
+        layer="${layer_interface}"
+        #end if
+        permission="${viewlet_permission}"
+        />
+
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/viewlet/browser/templates/+viewlet_template_name+
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/viewlet/browser/templates/+viewlet_template_name+	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/viewlet/browser/templates/+viewlet_template_name+	(revision 2714)
@@ -0,0 +1,1 @@
+
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/viewlet/browser/viewlets.py_insert
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/viewlet/browser/viewlets.py_insert	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/viewlet/browser/viewlets.py_insert	(revision 2714)
@@ -0,0 +1,9 @@
+\#from Products.CMFCore.utils import getToolByName
+\#from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
+\#from plone.app.layout.viewlets import common
+
+\#\# -*- extra stuff goes here -*-
+
+class ${viewlet_class_name}(common.ViewletBase):
+    render = ViewPageTemplateFile('templates/${viewlet_template_name}')
+
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/viewlet/profiles/default/viewlets.xml_insert
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/viewlet/profiles/default/viewlets.xml_insert	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/viewlet/profiles/default/viewlets.xml_insert	(revision 2714)
@@ -0,0 +1,17 @@
+#<?xml version="1.0"?>
+#
+#<object>
+#
+#   <!-- -*- extra stuff goes here -*- -->
+
+#if $add_order_tag:
+  <order manager="${viewlet_manager_name}"
+         #if not $qplone3_theme_skinname=="*":
+         based-on="${qplone3_theme_skinbase}"
+         #end if
+         skinname="${qplone3_theme_skinname}" >
+   <!-- -*- $viewlet_profile_marker -*- -->
+  </order>
+#end if
+
+#</object>
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/viewlet_compo/viewlet_profiles/profiles/default/viewlets.xml_insert
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/viewlet_compo/viewlet_profiles/profiles/default/viewlets.xml_insert	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/viewlet_compo/viewlet_profiles/profiles/default/viewlets.xml_insert	(revision 2714)
@@ -0,0 +1,2 @@
+    <viewlet name="${namespace_package}.${namespace_package2}.${package}.${viewlet_name}" insert-${insert_type}="${insert_control_viewlet}" />
+
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/viewlet_hidden/profiles/default/viewlets.xml_insert
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/viewlet_hidden/profiles/default/viewlets.xml_insert	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/viewlet_hidden/profiles/default/viewlets.xml_insert	(revision 2714)
@@ -0,0 +1,13 @@
+#<?xml version="1.0"?>
+#
+#<object>
+#
+#   <!-- -*- extra stuff goes here -*- -->
+
+#if $add_hidden_tag
+  <hidden manager="${viewlet_manager_name}" skinname="${qplone3_theme_skinname}">
+   <!-- -*- $viewlet_profile_marker -*- -->
+  </hidden>
+#end if
+
+#</object>
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/viewlet_hidden_compo/viewlet_hidden_profiles/profiles/default/viewlets.xml_insert
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/viewlet_hidden_compo/viewlet_hidden_profiles/profiles/default/viewlets.xml_insert	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/localcommands/templates/viewlet_hidden_compo/viewlet_hidden_profiles/profiles/default/viewlets.xml_insert	(revision 2714)
@@ -0,0 +1,2 @@
+    <viewlet name="${viewlet_name}" />
+
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/qplone3_theme.py
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/qplone3_theme.py	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/qplone3_theme.py	(revision 2714)
@@ -0,0 +1,44 @@
+import os
+import copy
+import datetime
+
+from zopeskel.plone3_theme import Plone3Theme
+from zopeskel.base import get_var
+from zopeskel.base import var
+from zopeskel.vars import StringVar
+
+class qPlone3Theme(Plone3Theme):
+    _template_dir = 'templates/qplone3_theme'
+    summary = "A Quinta Group Theme for Plone 3.0 with nested namespace"
+    required_templates = ['plone_app']
+    use_cheetah = True
+    use_local_commands = True
+
+    vars = copy.deepcopy(Plone3Theme.vars)
+    get_var(vars, 'namespace_package').default = 'quintagroup'
+    get_var(vars, 'namespace_package').description = 'Namespace package (like quintagroup)'
+    get_var(vars, 'author').default = 'Quintagroup'
+    get_var(vars, 'author_email').default = 'skins.develop.group@quintagroup.com'
+    get_var(vars, 'keywords').default = get_var(vars, 'keywords').default + ' quintagroup'
+    get_var(vars, 'url').default = 'http://svn.quintagroup.com/skins'
+    get_var(vars, 'package').default = 'example'
+    get_var(vars, 'description').default = 'An installable Quintagroup theme for Plone 3'
+    get_var(vars, 'version').default = '0.1'
+    vars.insert(1, StringVar('namespace_package2',
+                        'Nested namespace package (like theme)',
+                        default='theme'))
+
+    def pre(self, command, output_dir, vars):
+        vars['timestamp'] = datetime.date.today().strftime("%Y%m%d")
+        super(qPlone3Theme, self).pre(command, output_dir, vars)
+
+    def post(self, command, output_dir, vars):
+        np2, np = vars['namespace_package2'], vars['namespace_package']
+        p = vars['package']
+        sdir = os.path.join(output_dir, np, np2, p, 'skins')
+
+        # Prevent overriding passed config file
+        # Result config will be written to same 
+        # name file with '.result' postfix
+        if command.options.config:
+            command.options.config += '.result'
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/Extensions/Install.py_tmpl
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/Extensions/Install.py_tmpl	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/Extensions/Install.py_tmpl	(revision 2714)
@@ -0,0 +1,16 @@
+import transaction
+from Products.CMFCore.utils import getToolByName
+
+UNINSTALL_PROFILES = [
+    '${namespace_package}.${namespace_package2}.${package}:uninstall'
+]
+
+def uninstall(self):
+    """This method is here to make uninstall GS profiles execution
+    on portal_quickinstaller's tool Uninstall action.
+    """
+    portal_setup = getToolByName(self, 'portal_setup')
+    for extension_id in UNINSTALL_PROFILES:
+        portal_setup.runAllImportStepsFromProfile('profile-%s' % extension_id)
+        product_name = extension_id.split(':')[0]
+        transaction.savepoint()
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/Extensions/__init__.py
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/Extensions/__init__.py	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/Extensions/__init__.py	(revision 2714)
@@ -0,0 +1,1 @@
+#
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/__init__.py_tmpl
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/__init__.py_tmpl	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/__init__.py_tmpl	(revision 2714)
@@ -0,0 +1,25 @@
+"""Main product initializer
+"""
+
+from zope.i18nmessageid import MessageFactory
+
+# Define a message factory for when this product is internationalised.
+# This will be imported with the special name "_" in most modules. Strings
+# like _(u"message") will then be extracted by i18n tools for translation.
+
+GLOBALS = globals()
+
+${package}MessageFactory = MessageFactory('${namespace_package}.${namespace_package2}.${package}')
+
+  # -*- extra stuff goes here -*- 
+
+#if str($zope2product) == 'True'
+
+def initialize(context):
+    """Initializer called when used as a Zope 2 product.
+
+    This is referenced from configure.zcml. Regstrations as a "Zope 2 product"
+    is necessary for GenericSetup profiles to work, for example.
+    """
+
+#end if
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/browser/__init__.py
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/browser/__init__.py	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/browser/__init__.py	(revision 2714)
@@ -0,0 +1,1 @@
+#
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/browser/configure.zcml_tmpl
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/browser/configure.zcml_tmpl	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/browser/configure.zcml_tmpl	(revision 2714)
@@ -0,0 +1,41 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope"
+    xmlns:browser="http://namespaces.zope.org/browser"
+    i18n_domain="${namespace_package}.${namespace_package2}.${package}">
+
+#if str($include_doc) == 'True'
+    <!-- '$skinname' Zope 3 browser layer
+      Register views, viewlets and resources for this layer to make sure
+      they only apply to the '${skinname}' theme.
+      You can also use this layer to override default Plone browser views
+      and viewlets only within the '${skinname}' theme.
+      -->
+#else
+    <!-- '$skinname' Zope 3 browser layer -->
+#end if
+    <interface
+        interface=".interfaces.IThemeSpecific"
+        type="zope.publisher.interfaces.browser.IBrowserSkinType"
+        name="$skinname"
+        />
+
+    <!-- Zope 3 browser resources -->
+
+#if str($include_doc) == 'True'
+    <!-- Resource directory for images
+      See ${namespace_package}/${namespace_package2}/${package}/browser/images/README.txt
+      for more information about registering images as Zope 3 browser
+      resources.
+      -->
+#else
+    <!-- Resource directory for templates -->
+#end if
+    <browser:resourceDirectory
+        name="${namespace_package}.${namespace_package2}.${package}.templates"
+        directory="templates"
+        layer=".interfaces.IThemeSpecific"
+        />
+
+    <!-- -*- extra stuff goes here -*- -->
+
+</configure>
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/browser/interfaces.py_tmpl
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/browser/interfaces.py_tmpl	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/browser/interfaces.py_tmpl	(revision 2714)
@@ -0,0 +1,10 @@
+from plone.theme.interfaces import IDefaultPloneLayer
+
+class IThemeSpecific(IDefaultPloneLayer):
+    """Marker interface that defines a Zope 3 browser layer.
+#if str($include_doc) == 'True'
+       If you need to register a viewlet only for the
+       "$skinname" theme, this interface must be its layer
+       (in $package/viewlets/configure.zcml).
+#end if
+    """
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/browser/templates/README.txt
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/browser/templates/README.txt	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/browser/templates/README.txt	(revision 2714)
@@ -0,0 +1,4 @@
+README for the 'browser/templates/' directory
+==========================================
+
+This folder is a Zope 3 Resource Directory acting as a repository for templates.
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/configure.zcml_tmpl
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/configure.zcml_tmpl	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/configure.zcml_tmpl	(revision 2714)
@@ -0,0 +1,19 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope"
+    xmlns:five="http://namespaces.zope.org/five"
+    xmlns:cmf="http://namespaces.zope.org/cmf"
+    i18n_domain="${namespace_package}.${namespace_package2}.${package}">
+
+#if str($zope2product) == 'True'
+   <five:registerPackage package="." initialize=".initialize" />
+
+#end if
+   <include package=".browser" />
+   <include package=".portlets" />
+
+   <include file="skins.zcml" />
+   <include file="profiles.zcml" />
+
+   <!-- -*- extra stuff goes here -*- -->
+
+</configure>
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/portlets/__init__.py
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/portlets/__init__.py	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/portlets/__init__.py	(revision 2714)
@@ -0,0 +1,1 @@
+#
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/portlets/configure.zcml_tmpl
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/portlets/configure.zcml_tmpl	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/portlets/configure.zcml_tmpl	(revision 2714)
@@ -0,0 +1,13 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope"
+    xmlns:plone="http://namespaces.plone.org/plone"
+    i18n_domain="${namespace_package}.${package}">
+
+    <!-- Ensure Plone's portlets ZCML has already been processed;
+         without this, we may get a permission lookup error
+      -->
+    <include package="plone.app.portlets" />
+
+	<!-- -*- extra stuff goes here -*- -->
+
+</configure>
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/profiles.zcml_tmpl
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/profiles.zcml_tmpl	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/profiles.zcml_tmpl	(revision 2714)
@@ -0,0 +1,25 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope"
+    xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
+    i18n_domain="${namespace_package}.${namespace_package2}.${package}">
+
+  <genericsetup:registerProfile
+      name="default"
+      title="$skinname"
+      directory="profiles/default"
+      description='Extension profile for the "${skinname}" Plone theme.'
+      provides="Products.GenericSetup.interfaces.EXTENSION"
+      />
+
+  <genericsetup:registerProfile
+      name="uninstall"
+      title="${skinname}: Uninstall"
+      directory="profiles/uninstall"
+      description='Uninstallation profile for the "${skinname}" Plone theme.'
+      provides="Products.GenericSetup.interfaces.EXTENSION"
+      />
+
+  <!-- Extra configurations -->
+  <!-- -*- extra stuff goes here -*- -->
+
+</configure>
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/profiles/default/+namespace_package+.+namespace_package2+.+package+_various.txt_tmpl
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/profiles/default/+namespace_package+.+namespace_package2+.+package+_various.txt_tmpl	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/profiles/default/+namespace_package+.+namespace_package2+.+package+_various.txt_tmpl	(revision 2714)
@@ -0,0 +1,1 @@
+This file is used as a marker in setuphandlers.py.
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/profiles/default/import_steps.xml_tmpl
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/profiles/default/import_steps.xml_tmpl	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/profiles/default/import_steps.xml_tmpl	(revision 2714)
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<import-steps>
+  <import-step id="${namespace_package}.${namespace_package2}.${package}.various"
+               version="${timestamp}-01"
+               handler="${namespace_package}.${namespace_package2}.${package}.setuphandlers.setupVarious"
+               title="${skinname}: miscellaneous import steps">
+    <dependency step="skins" />
+    Various import steps that are not handled by GS import/export
+    handlers.
+  </import-step>
+ <!-- -*- extra stuff goes here -*- -->
+</import-steps>
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/profiles/default/metadata.xml_tmpl
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/profiles/default/metadata.xml_tmpl	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/profiles/default/metadata.xml_tmpl	(revision 2714)
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<metadata>
+  <version>${version}</version>
+</metadata>
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/profiles/default/portlets.xml
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/profiles/default/portlets.xml	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/profiles/default/portlets.xml	(revision 2714)
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<!-- This file is used to register new types of portlets. It can also
+     be used to register completely new column types. See CMFPlone's version
+     of this file for more information.
+  -->
+<portlets>
+  <!-- -*- extra stuff goes here -*- -->
+</portlets>
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/profiles/default/skins.xml_tmpl
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/profiles/default/skins.xml_tmpl	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/profiles/default/skins.xml_tmpl	(revision 2714)
@@ -0,0 +1,48 @@
+<?xml version="1.0"?>
+#if str($include_doc) == 'True'
+<!-- This file holds the setup configuration for the portal_skins tool -->
+
+<!-- Change the value of these parameters to modify portal_skins behavior:
+     - allow_any: change it to True if you want users to be able to select the
+       skin to use from their personal preferences management page. In the
+       ZMI, this value is known as 'Skin flexibility'.
+     - cookie_persistence: change it to True if you want to make the skin cookie
+       persist indefinitely. In the ZMI, this value is known as 'Skin Cookie
+       persistence'.
+       -->
+#end if
+<object name="portal_skins" allow_any="False" cookie_persistence="False"
+   default_skin="$skinname">
+
+#if str($include_doc) == 'True'
+ <!-- This list registers the folders that are stored in the skins directory
+      of your product (on the filesystem) as Filesystem Directory Views within
+      the portal_skins tool, so that they become usable as skin layers.
+ <object name="${namespace_package}_${namespace_package2}_${package}_custom_images"
+    meta_type="Filesystem Directory View"
+    directory="${namespace_package}.${namespace_package2}.${package}:skins/${namespace_package}_${namespace_package2}_${package}_custom_images"/>
+      -->
+#end if
+
+   <!-- -*- extra stuff goes here -*- -->
+
+#if str($include_doc) == 'True'
+ <!-- A skin-path in this file corresponds to a Skin Selection in the
+     'Properties' tab of the portal_skins tool, in the ZMI.
+     You can define for each new skin path the layers that it holds. A new
+     skin can be based on another existing one by using the 'based-on'
+     attribute.
+     The definition of a layer accepts these parameters:
+       - name: quite self explanatory, the name of the layer.
+       - insert-before: name of the layer before which it must be added.
+       - insert-after: name of the layer after which it must be added.
+       Note: insert-before (and -after) accepts the value "*" which means
+       "all".
+       -->
+#end if
+ <skin-path name="$skinname" based-on="$skinbase">
+  <!-- -*- extra layer stuff goes here -*- -->
+
+ </skin-path>
+
+</object>
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/profiles/uninstall/+namespace_package+.+namespace_package2+.+package+_uninstall.txt_tmpl
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/profiles/uninstall/+namespace_package+.+namespace_package2+.+package+_uninstall.txt_tmpl	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/profiles/uninstall/+namespace_package+.+namespace_package2+.+package+_uninstall.txt_tmpl	(revision 2714)
@@ -0,0 +1,1 @@
+This file is used as an uninstall marker in setuphandlers.py.
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/profiles/uninstall/import_steps.xml_tmpl
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/profiles/uninstall/import_steps.xml_tmpl	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/profiles/uninstall/import_steps.xml_tmpl	(revision 2714)
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<import-steps>
+  <import-step id="${namespace_package}.${namespace_package2}.${package}.uninstall"
+               version="${timestamp}-02"
+               handler="${namespace_package}.${namespace_package2}.${package}.setuphandlers.uninstallVarious"
+               title="${skinname}: miscellaneous uninstall steps">
+    <dependency step="skins" />
+    Various uninstall steps that are not handled by GS import/export
+    handlers.
+  </import-step>
+ <!-- -*- extra stuff goes here -*- -->
+</import-steps>
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/profiles/uninstall/skins.xml_tmpl
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/profiles/uninstall/skins.xml_tmpl	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/profiles/uninstall/skins.xml_tmpl	(revision 2714)
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+#if str($include_doc) == 'True'
+<!-- This file holds the uninstall configuration for the portal_skins tool -->
+#end if
+<object name="portal_skins" default_skin="Plone Default">
+ <skin-path name="$skinname" remove="True">
+ </skin-path>
+</object>
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/setuphandlers.py_tmpl
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/setuphandlers.py_tmpl	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/setuphandlers.py_tmpl	(revision 2714)
@@ -0,0 +1,25 @@
+def setupVarious(context):
+
+    # Ordinarily, GenericSetup handlers check for the existence of XML files.
+    # Here, we are not parsing an XML file, but we use this text file as a
+    # flag to check that we actually meant for this import step to be run.
+    # The file is found in profiles/default.
+
+    if context.readDataFile('${namespace_package}.${namespace_package2}.${package}_various.txt') is None:
+        return
+
+    # Add additional setup code here
+
+def uninstallVarious(context):
+
+    # Ordinarily, GenericSetup handlers check for the existence of XML files.
+    # Here, we are not parsing an XML file, but we use this text file as a
+    # flag to check that we actually meant for this import step to be run.
+    # The file is found in profiles/uninstall.
+
+    if context.readDataFile('${namespace_package}.${namespace_package2}.${package}_uninstall.txt') is None:
+        return
+
+    # Add additional uninstall code here
+
+\#\# -*- extra stuff goes here -*-
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/skins.zcml_tmpl
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/skins.zcml_tmpl	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/skins.zcml_tmpl	(revision 2714)
@@ -0,0 +1,16 @@
+<configure
+    xmlns="http://namespaces.zope.org/zope"
+    xmlns:cmf="http://namespaces.zope.org/cmf"
+    i18n_domain="${namespace_package}.${namespace_package2}.${package}">
+
+   <!-- File System Directory Views registration -->
+   <!-- -*- extra stuff goes here -*- -->
+
+#if str($include_doc) == 'True'
+   <!-- Note: This could also be done for all folders at once
+        by replacing the previous lines with this one:
+   <cmf:registerDirectory name="skins" directory="skins" recursive="True" />
+   -->
+
+#end if
+</configure>
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/skins/README.txt
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/skins/README.txt	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/skins/README.txt	(revision 2714)
@@ -0,0 +1,4 @@
+README for the 'skins' directory
+==========================================
+
+This folder is skin-layer container.
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/version.txt_tmpl
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/version.txt_tmpl	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+namespace_package+/+namespace_package2+/+package+/version.txt_tmpl	(revision 2714)
@@ -0,0 +1,1 @@
+${version}
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+project+-configure.zcml_tmpl
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+project+-configure.zcml_tmpl	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/+project+-configure.zcml_tmpl	(revision 2714)
@@ -0,0 +1,1 @@
+<include package="${namespace_package}.${namespace_package2}.${package}" />
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/MANIFEST.in_tmpl
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/MANIFEST.in_tmpl	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/MANIFEST.in_tmpl	(revision 2714)
@@ -0,0 +1,3 @@
+include distwriters.py
+recursive-include ${namespace_package} *
+global-exclude *pyc
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/setup.py_tmpl
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/setup.py_tmpl	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/setup.py_tmpl	(revision 2714)
@@ -0,0 +1,50 @@
+# -*- coding: utf-8 -*-
+"""
+This module contains the tool of $project
+"""
+import os
+from setuptools import setup, find_packages
+
+def read(*rnames):
+    return open(os.path.join(os.path.dirname(__file__), *rnames)).read()
+
+version = ${repr($version) or "0.0.0"}
+
+tests_require=['zope.testing']
+
+setup(name=${repr($project)},
+      version=version,
+      description="${description or None}",
+      long_description=open("README.txt").read() + "\n" +
+                       open(os.path.join("docs", "HISTORY.txt")).read(),
+      # Get more strings from http://www.python.org/pypi?%3Aaction=list_classifiers
+      classifiers=[
+        'Framework :: Plone',
+        'Intended Audience :: Developers',
+        'Topic :: Software Development :: Libraries :: Python Modules',
+        #from zopeskel.base import LICENSE_CATEGORIES
+        #if $license_name.strip() in $LICENSE_CATEGORIES
+        $repr($LICENSE_CATEGORIES[$license_name.strip()]),
+        #end if
+        ],
+      keywords=${repr($keywords) or $empty},
+      author=${repr($author) or $empty},
+      author_email=${repr($author_email) or $empty},
+      url=${repr($url) or $empty},
+      license=${repr($license_name) or $empty},
+      packages=find_packages(exclude=['ez_setup']),
+      namespace_packages=['$namespace_package', '$namespace_package.$namespace_package2',],
+      include_package_data=True,
+      zip_safe=${repr(bool($zip_safe)) or False},
+      install_requires=['setuptools',
+                        # -*- Extra requirements: -*-
+                        ],
+      tests_require=tests_require,
+      extras_require=dict(tests=tests_require),
+      test_suite = '$namespace_package.$namespace_package2.${package}.tests',
+      entry_points="""
+      # -*- entry_points -*- #
+      """,
+      paster_plugins = ["ZopeSkel",],
+      setup_requires = ["setuptools",],
+      )
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/theme_vars.cfg_tmpl
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/theme_vars.cfg_tmpl	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/templates/qplone3_theme/theme_vars.cfg_tmpl	(revision 2714)
@@ -0,0 +1,7 @@
+[qplone3_theme]
+package : $package
+skinname: $skinname
+skinbase: $skinbase
+namespace_package: $namespace_package
+namespace_package2: $namespace_package2
+used_subtemplates:
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/tests/__init__.py
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/tests/__init__.py	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/tests/__init__.py	(revision 2714)
@@ -0,0 +1,2 @@
+# package
+
Index: /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/tests/test_qthemedoc.py
===================================================================
--- /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/tests/test_qthemedoc.py	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/quintagroup/themetemplate/tests/test_qthemedoc.py	(revision 2714)
@@ -0,0 +1,47 @@
+# -*- coding: utf-8 -*-
+"""
+Grabs the tests in doctest
+"""
+__docformat__ = 'restructuredtext'
+
+from zopeskel.tests.test_zopeskeldocs import *
+
+current_dir = os.path.abspath(os.path.dirname(__file__))
+
+def doc_suite(test_dir, setUp=testSetUp, tearDown=testTearDown, globs=None):
+    """Returns a test suite, based on doctests found in /doctest."""
+    suite = []
+    if globs is None:
+        globs = globals()
+
+    flags = (doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE |
+             doctest.REPORT_ONLY_FIRST_FAILURE)
+
+    package_dir = os.path.split(test_dir)[0]
+    if package_dir not in sys.path:
+        sys.path.append(package_dir)
+
+    doctest_dir = package_dir
+
+    # filtering files on extension
+    docs = [os.path.join(doctest_dir, doc) for doc in
+            os.listdir(doctest_dir) if doc.endswith('.txt')]
+
+    for test in docs:
+        suite.append(doctest.DocFileSuite(test, optionflags=flags, 
+                                          globs=globs, setUp=setUp, 
+                                          tearDown=tearDown,
+                                          module_relative=False))
+
+    return unittest.TestSuite(suite)
+
+
+def test_suite():
+    """returns the test suite"""
+    suite = doc_suite(current_dir)
+    suite.layer = ZopeSkelLayer
+    return suite
+
+if __name__ == '__main__':
+    unittest.main(defaultTest='test_suite')
+
Index: /quintagroup.themetemplate/branches/experiment/setup.py
===================================================================
--- /quintagroup.themetemplate/branches/experiment/setup.py	(revision 2714)
+++ /quintagroup.themetemplate/branches/experiment/setup.py	(revision 2714)
@@ -0,0 +1,54 @@
+from setuptools import setup, find_packages
+import os
+
+version = '0.25'
+
+tests_require=['zope.testing']
+
+def read(*rnames):
+    return open(os.path.join(os.path.dirname(os.path.abspath(__file__)), *rnames)).read()
+
+setup(name='quintagroup.themetemplate',
+      version=version,
+      description="Quintagroup theme template for Plone 3 with nested namespace",
+      long_description=read("quintagroup", "themetemplate", "README.txt") + "\n" +
+                       read("docs", "HISTORY.txt"),
+      # Get more strings from http://www.python.org/pypi?%3Aaction=list_classifiers
+      classifiers=[
+        "Programming Language :: Python",
+        "Topic :: Software Development :: Libraries :: Python Modules",
+        ],
+      keywords='ZopeSkel theme template plone3 Quintagroup',
+      author='Andriy Mylenkyy',
+      author_email='support@quintagroup.com',
+      url='http://svn.quintagroup.com/products/quintagroup.themetemplate',
+      license='GPL',
+      packages=find_packages(exclude=['ez_setup']),
+      namespace_packages=['quintagroup'],
+      include_package_data=True,
+      zip_safe=False,
+      install_requires=[
+          'ZopeSkel',
+          'PasteScript>=1.6.3',
+          # -*- Extra requirements: -*-
+      ],
+      tests_require=tests_require,
+      extras_require=dict(tests=tests_require),
+      test_suite = 'quintagroup.themetemplate.tests.test_qthemedoc.test_suite',
+      entry_points="""
+          [paste.paster_create_template]
+          qplone3_theme = quintagroup.themetemplate:qPlone3Theme
+
+          [zopeskel.zopeskel_sub_template]
+          skin_layer    = quintagroup.themetemplate.localcommands.subtemplates:SkinLayerSubTemplate
+          css_resource = quintagroup.themetemplate.localcommands.subtemplates:CSSSubTemplate
+          css_dtml_skin = quintagroup.themetemplate.localcommands.subtemplates:CSSSkinLayerSubTemplate
+          js_resource = quintagroup.themetemplate.localcommands.subtemplates:JSSubTemplate
+          viewlet_order = quintagroup.themetemplate.localcommands.subtemplates:ViewletOrderSubTemplate
+          viewlet_hidden = quintagroup.themetemplate.localcommands.subtemplates:ViewletHiddenSubTemplate
+          import_zexps = quintagroup.themetemplate.localcommands.subtemplates:ImportSubTemplate
+
+      # -*- Entry points: -*-
+      """,
+      setup_requires=['setuptools',],
+      )
