Re: howto create a Python script in the root by portal_setup

Georges Racinet <[email protected]>
Newsgroups gmane.comp.web.zope.cps.devel
Message-ID <[email protected]>
On Sep 18, 2006, at 1:26 PM, Joachim Schmitz wrote:

> I want to create the pythonscript .cpsskins_theme, which sets the  
> theme for display, by importing the profile.
>
> I tried :
>
>  <script script_id=".cpsskins_theme"
>          type="Script (Python)"
>          filename="roots/.cpsskins_theme.py"
>          />
>
> in roots.xml, the import finishes without error, but the script is  
> not created.

The XMLRootsAdapted treats <object> tags only (see below). It's there  
to initialize first level folder documents (e.g., sections,  
workspaces, members)
That being said:
  - if you want to use a site wide .cpsskins_theme script, just put  
it in the skins (the skins are always looked up at the end of  
acquisition, hence it's still overridable
  - if you want to put one in a particular root, use the <object> tag  
(as in most of these xml files) with the meta_type of scripts (Python)

Note also that since a recent improvent  by Olivier, the  
RootXMLAdapter can actually create a whole hierarchy (it's now  
recursive), so you should be able to put local themes everywhere :-)
Unfortunately, it doesn't load properties, so that you have to use  
scripts, even for static theme pages overrides.

class RootsXMLAdapter(XMLAdapterBase):
     _LOGGER_ID = 'roots'
     name = 'roots'

     (...)

     def _initRoots(self, node):
         site = self.context
         for child in node.childNodes:
             if child.nodeName != 'object':
                 continue

     (...)


>
>
> -- 
> Gruß Joachim
>
>
>
> _______________________________________________
> cps-devel mailing list
> http://lists.nuxeo.com/mailman/listinfo/cps-devel

---------
Georges Racinet                        Nuxeo SAS
[email protected]                http://nuxeo.com
Tel: +33 (0) 1 40 33 71 73


_______________________________________________
cps-devel mailing list
http://lists.nuxeo.com/mailman/listinfo/cps-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.