[ZPatterns] Re: ZPatterns howto and Extensions

Roché Compaan roche@upfrontsystems.co.za
Thu, 5 Dec 2002 08:05:09 +0200


This is a multi-part message in MIME format.

--Multipart_Thu__5_Dec_2002_08:05:09_+0200_08d8cfa0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit

Hi Itai,

Well I know why there is duplicate registration and I fixed that.
But now it seems that the PlugInContainer is not refreshing the list of
Attribute Providers compiled from the SkinScript.

Unfortunately my time ran out and I couldn't fix this. I'll try to look
into this tonight. I attached a patch for FSSkinScript.py - this will
give you an idea where the problem is and where to jump in with the
python debugger.

You'll also have to recreate your SkinnableSpecialist to get rid of the
duplicate stubs in the ZODB :-(

On Wed, 4 Dec 2002 18:53:17 +1100
Itai Tavor <itai@iinet.net.au> wrote:

> Hi Roché
> 
> Thanks... I hope you can find a solution soon... I might have been too 
> hasty, butFSSkinScript enabled me to finally move my whole application 
> to the filesystem, and that's just what I did as soon as I found your 
> extensions package. I would hate to have to move the SkinScripts back 
> to the ZODB - especially since I can't even delete those copies at the 
> moment :(
> 
> BTW... a couple of other comments: First, thanks for writing those 
> extensions, they are really useful (assuming they work :) )

Well as you discovered they do and they don't - but I don't think it
will take much to make them work. They rely mostly on existing classes
from CMFCore and ZPatterns itself. Great to know that you are trying
this out though.

> Second, I can't get SkinnableRack to work, the portal_skins tool in the 
> rack remains empty even when I have items in the filesystem directory 
> the tool is set to use.

This is strange ... Don't you even see 'custom' and 'default' under the
contents tab of the 'portal_skins' tool?

> 
> Third, at first, I used a single skins tool for the whole application 
> (and no skinnable specialists or racks - I just made the whole 
> application skinnable), and I had to use names like editEmployeeForm 
> instead of just editForm so each specialist/rack could have different 
> UI methods in the skins. SkinnableSpecialist and SkinnableRack allowed 
> me to change that, but I didn't want the skinned methods for the 
> specialist/rack mixing with the general application skins, so I am 
> storing the specialist skins on the filesystem in 
> zpatterns_skins/<specialist name> and the rack skins in 
> zpatterns_skins/<specialist name>_defaultRack. Also, to save the 
> trouble of having to manually change the skins path in each new 
> specialist and rack, I modified SkinnableSpecialist and SkinnableRack 
> to set the path by themselves to the paths above. What do you think 
> about this idea? (hope this description isn't too convoluted)

Mmm, but if I have different products that use SkinnableSpecialist
and SkinnableRack I want them to point to my specific product's skin
path. At the moment I modify the path of the "Directory View" to point
to the right path. One can also sublass SkinnableSpecialist and just
modify the default paths to the Directory View but I don't like this
approach. We could think of way that the SkinnableSpecialist get
configuration data like paths to Directory Views from its context.

-- 
Roché Compaan
Upfront Systems                 http://www.upfrontsystems.co.za

--Multipart_Thu__5_Dec_2002_08:05:09_+0200_08d8cfa0
Content-Type: application/octet-stream;
 name="FSSkinScript.py.patch"
Content-Disposition: attachment;
 filename="FSSkinScript.py.patch"
Content-Transfer-Encoding: base64

SW5kZXg6IEZTU2tpblNjcmlwdC5weQo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ClJDUyBmaWxlOiAvdXNyL2xvY2FsL3Vw
ZnJvbnQvcmVwb3NpdG9yeS96b3BlL1pQYXR0ZXJuc0V4dGVuc2lvbnMvRlNTa2luU2NyaXB0LnB5
LHYKcmV0cmlldmluZyByZXZpc2lvbiAxLjEKZGlmZiAtdSAtcjEuMSBGU1NraW5TY3JpcHQucHkK
LS0tIEZTU2tpblNjcmlwdC5weQkyMDAyLzA3LzI4IDEwOjM2OjA5CTEuMQorKysgRlNTa2luU2Ny
aXB0LnB5CTIwMDIvMTIvMDUgMDU6NDM6MDQKQEAgLTc0LDE4ICs3NCwxOCBAQAogICAgICAgICBw
cm92aWRlcnMgPSBzZWxmLl9wcm92aWRlcnMgPSBjb21waWxlKHNlbGYudGV4dCkKICAgICAgICAg
CiAgICAgICAgIGZvciBwIGluIHByb3ZpZGVyczoKLSAgICAgICAgICAgICNwLl9wcm94eV9yb2xl
cyA9IHNlbGYuX3Byb3h5X3JvbGVzCisgICAgICAgICAgICBwLl9wcm94eV9yb2xlcyA9IHNlbGYu
X3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isgICAgICAgICMgbXVsdGlw
bGUgdGltZXMgd2l0aCB0aGUgUGx1Z0luR3JvdXAuCisgICAgICAgICMKKyAgICAgICAgIyBIZXJl
IHdlIGNoZWNrIGlmIGFuIGlkIGlzIGluIHRoZSBsaXN0IHJhdGhlciB0aGFuIHRoZSBpbnN0YW5j
ZQorICAgICAgICBwbHVnaW4gPSBnZXRhdHRyKHNlbGYsICdhcV9iYXNlJywgc2VsZikKKyAgICAg
ICAga2luZCA9IHBsdWdpbi5fX3BsdWdpbl9raW5kX18KKworICAgICAgICBmb3IgZ3JvdXAgaW4g
cGx1Z2luX2NvbnRhaW5lci5fX3BsdWdpbl9ncm91cHNfXzoKKyAgICAgICAgICAgIGlmIGtpbmQg
aW4gZ3JvdXAua2luZHM6CisgICAgICAgICAgICAgICAgcGx1Z19pbnMgPSBnZXRhdHRyKHBsdWdp
bl9jb250YWluZXIsIGdyb3VwLmF0dHIsIE5vbmUpIG9yIFtdIAorICAgICAgICAgICAgICAgIHBs
dWdpbl9pZHMgPSBbcGx1Z19pbi5pZCBmb3IgcGx1Z19pbiBpbiBwbHVnX2luc10KKyAgICAgICAg
ICAgICAgICBpZiBub3Qgc2VsZi5pZCBpbiBwbHVnaW5faWRzOgorICAgICAgICAgICAgICAgICAg
ICBncm91cC5fYWRkUGx1Z0luKHBsdWdpbl9jb250YWluZXIsIHBsdWdpbikKKwogCiAgICAgZGVm
IHJlYWQoc2VsZik6CiAgICAgICAgIHNlbGYuX3VwZGF0ZUZyb21GUygpCg==

--Multipart_Thu__5_Dec_2002_08:05:09_+0200_08d8cfa0--