[Zope] Help create filesystem skin with product

2006-10-11 Thread yary

I'm having a problem which must have been solved many times before-
trying to make a product that ships with a skin. I'm new to Zope
development, been stumbling for a couple months with it.

Ideally, the end user will unpack my product Q into a Products
directory. They will be able to add a Q object to an existing CMF
site, or create a QSite at their Zope2 root. If they create a QSite,
my product should give it a QSkin during instantiation. I'm developing
the QSkin (and the entire Q product) on the filesystem.

Background:
The product includes a subclass of CMFSite called a QSite. If the user
creates a QSite, I'd like it to include a QSkin which the user can
select from the portal_skins tool.

The product is running on Zope 2.9.4, Five 1.4, CMF 2.0. It needs to
work on Windows and Linux. (Would like to use Zope 2.10, Five 1.5 when
someone compiles the win32 installer, so I don't have to worry about
five:traversable directives! Already posted a request for that.)

Customer requires that the product have no Plone dependencies. Product
will require workflow, so it can have a CMF dependency. Could possibly
implement on Zope 3, though I could not figure out basic workflow
management on that platform, and would rather not re-implement
something available on Zope2.

Hurdles I've had so far in creating a skin:
Using Five- seems to be the way to go. Started by trying
browser:page  browser:defaultView with QSite/IQSite- really
didn't know what I was doing, and a helpful sould pointed out, that is
what skins are for.

Tried using zcml skin directive, broswer:layer, and browser:defaultSkin.

I can create a skin in zcml, and adding /++skin++QSkin to the end of
any URL causes the page to load. However it does not look like a
QSkin- apparently acquisition finds items in portal_skins before it
finds resources added by five. So if I use zcml to add a Logo.gif, it
won't override a Logo.gif already on the CMF site, to see it I have to
also add /++resource++Logo.gif

I cannot use defaultSkin with CMF, because CMF already declares a
defaultSkin. Its better if the user picks the skin from the
portal_skins management interface, but skins and layers declared in
zcml don't show up there.

As for the old/tried-and-true way, can't use the
ExampleFileSystemSkin or MinimalPloneSkin as a starting point, perhaps
they use parts of Plone: cannot import name ContentFactoryMetadata.
http://plonebook.packtpub.com/chapter6_preview.htm looks promising.


Hurdles I've had so far installing the skin:
Tried using container events (subscriber zcml) to call a hook when a
QSite is created, presuming that I'd work skin magic on the new site
object from within the event handler. Alas that is not the intended
purpose of subscriber and while it may work in the future, events
don't fire on CMFSite objects yet.

Am I supposed to create a manage_afterAdd method in my QSite object,
even though it's depreciated? Hmm, just tried creating that as a
method of QSite and it doesn't get called either- what's the right
way?

Thanks for reading my rambling.
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Help create filesystem skin with product

2006-10-11 Thread Jens Vagelpohl

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


On 11 Oct 2006, at 18:37, yary wrote:


I'm having a problem which must have been solved many times before-
trying to make a product that ships with a skin. I'm new to Zope
development, been stumbling for a couple months with it.


Take a look at CMFCalendar as included in the CMF 2.0 you're working  
with. It registers a skin folder and even adds it to the skins path  
automatically, using a GenericSetup profile. That's a good example to  
look at.


jens



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFFLXc5RAx5nvEhZLIRAmRuAJ9yn69WUwiAJLKmi/2jVDJ7YoTI3wCfbGtP
XMdrIbhMWwLOuciLBJACtUU=
=t4JR
-END PGP SIGNATURE-
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )