Re: [Product-Developers] do Dexterity objects provide IContentType?

2014-05-16 Thread David Glick (Plone)
It should work as long as your object provides some interface that 
provides IContentType. Dexterity does this automatically for 
auto-generated schemas. If you're using your own schema in Python you 
have to do alsoProvides(schema, IContentType) yourself.



On 5/16/14, 1:21 PM, Héctor Velarde wrote:

just curious why this fails, obj is a Dexterity based content type:

(Pdb) from zope.app.content import queryContentType
(Pdb) queryContentType(obj)
(Pdb) obj
MyType at /Plone/test/foo

comments?


___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] Archetypes Event-derived type without content actions menu

2014-04-02 Thread David Glick (Plone)

On 4/1/14, 2:02 AM, ajung wrote:

Hi there,

we have legacy system (not out code) running on Plone 4.2.6. It contains a
custom AT-based
event type. This type shows up with an empty div.contentActions while all
other types show the standard Plone menu bar.

The empty div is generated through this viewlet definition in
plone.app.layout

 browser:viewlet
 name=plone.contentactions
 for=*
 manager=.interfaces.IContentViews
 template=contentactions_blank.pt
 permission=zope2.View
 /

while  the standard menu is generated through this viewlet definition

 browser:viewlet
 name=plone.contentactions
 for=*
 view=plone.app.layout.globals.interfaces.IViewView
 manager=.interfaces.IContentViews
 class=.common.ContentActionsViewlet
 permission=zope2.View
 /

I really wander why the second viewlet definition does not work in our case
- not even for
the standard base_view.

Almost all of the code had been autogenerated through Zopeskel and the
minimum customization appear fine. I fact I have never heard of IViewView.
What could be the reason that even base_view would show up without content
actions menus?

IViewView should be automatically applied to the default view of any 
item (this happens in 
plone.app.layout.globals.layout:LayoutPolicy.mark_view, which is called 
from main_template). It sounds like that's not happening; I don't know 
why not but that's one place you can debug.

David
___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] #sprint topic name

2014-02-08 Thread David Glick (Plone)

Done :)

On 2/8/14, 9:04 AM, Roel Bruggink wrote:

Can we get the #sprint channel's topic to

The Plone sprinting channel . http://plone.org/events/sprints

so it works for all sprints?


--
Roel Bruggink
http://www.fourdigits.nl/mensen/roel-bruggink

Four Digits BV
http://www.fourdigits.nl http://www.fourdigits.nl/tel: +31(0)26 4422700


___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] How to group fields in dexterity? Nested fieldsets possible?

2014-01-31 Thread David Glick (Plone)

On 1/31/14, 11:30 AM, Maik Derstappen wrote:

Hi,

i'm looking for a way, to group some fields in a dexterity model.
What i can do is, using a fieldset with plone.autoform, but this results
in tabs in the edit form, which is ok.
But what i whant is, inside one tab (fieldset) i will have some smaler
fieldsets to group fields together which are belong together like
date_from and date_to or some thing like this.

z3c.form support nested groups (fieldsets) is there a way to do this in
Plone with dexterity?
Or how should i group fields in the dexterity edit form?

thx for any hint

If you put enable_form_tabbing = False on the form class, Plone won't 
turn the fieldsets into tabs.


But if you want tabs *and* fieldsets within the tabs, I think you'll 
need to write your own form template. The autoform fieldsets and the 
default template in plone.app.z3cform only handle one level of fieldsets.

___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] status of newsletter packages

2013-10-30 Thread David Glick (Plone)

On 10/30/13, 1:44 AM, Mikko Ohtamaa wrote:



on the other side, are there any other packages to solve the
newsletter use case?

what are you using nowadays?


http://kb.mailchimp.com/article/how-to-code-html-emails

Developing newsletters? Never again.

Not even once.
___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] conventions on version numbering

2013-10-30 Thread David Glick (Plone)

On 10/30/13, 12:17 PM, Héctor Velarde wrote:
according to our versioning scheme conventions, we should do the 
following:


Given a version number MAJOR.MINOR.PATCH, increment the:

* MAJOR version when you make incompatible API changes,
* MINOR version when you add functionality in a backwards-compatible 
manner, and

* PATCH version when you make backwards-compatible bug fixes.

http://semver.org/

how do you handle the inclussion of a new translation on a package? do 
you release as a patch or as a minor version number change?



patch

___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] anyone interested in moving PloneGetPaid to git?

2013-06-11 Thread David Glick (Plone)

On 6/9/13 1:55 PM, Paul J Stevens wrote:

On 06/07/2013 06:34 PM, David Glick wrote:


The censored packages have effectively been forked, so yes, that
makes sense so that special find-links are not needed to install the
packages. If you tell me your gmail account and pypi user I'll make
sure you have access. Thanks for volunteering!

David,

Sorry to be dense, but what do you mean by 'censored packages'.


That was a bad autocomplete, I meant the packages you mentioned. :)
___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] anyone interested in moving PloneGetPaid to git?

2013-06-07 Thread David Glick
The censored packages have effectively been forked, so yes, that makes sense so 
that special find-links are not needed to install the packages. If you tell me 
your gmail account and pypi user I'll make sure you have access. Thanks for 
volunteering!

David Glick
(mobile)

On Jun 7, 2013, at 6:34 AM, Paul J Stevens p...@nfg.nl wrote:

 On 04/01/2013 11:33 PM, Nathan Van Gheem wrote:
 Hi Eric,
 
 I'm not sure who is maintaining that any longer. I think it'd be great
 for to move it and it's complimentary packages over to the collective.
 
 I believe a lot of people still use it so someone giving the package
 some love could help out a lot of people.
 
 I'm volunteering.
 
 Since this is a whole suite of packages, I think it warrants it's own
 namespace. So no need to rename them all to collective.getpaid.*
 
 Most packages already are in the getpaid.* namespace, except for
 Products.PloneGetPaid and the vendor packages. Only those latter ones
 should be renamed I expect:
 
 hurry.workflow - getpaid.hurry.workflow
 ore.viewlet - getpaid.ore.viewlet
 yoma.batching - getpaid.yoma.batching
 
 The rest (Products.PloneGetPaid and all the getpaid.* packages) can
 simply land in the collective.
 
 agreed?
 
 
 -- 
 
 Paul J Stevenspjstevns @ gmail, twitter, skype, linkedin
 
  * Premium Hosting Services and Web Application Consultancy *
 
   www.nfg.nl/i...@nfg.nl/+31.85.877.99.97
 
 ___
 Product-Developers mailing list
 product-develop...@lists.plone.org
 https://lists.plone.org/mailman/listinfo/plone-product-developers
___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] Plone 4.3 compatibility for plone.org products (was Plone 4.2 compatibility for plone.org products)

2013-06-04 Thread David Glick (Plone)

On 6/1/13 8:12 AM, Luca Fabbri wrote:

On Mon, Jan 14, 2013 at 9:32 PM, Jon Stahl jonst...@gmail.com wrote:

---


On Mon, Jan 14, 2013 at 10:56 AM, Nathan Van Gheem vangh...@gmail.com wrote:

IMO, the query just needs to change to show all 4.x compatible products
right now. Not all authors update their products to show they're compatible
with every version. The list of products is then pretty sparse compared to
what is actually available.

Yes, please!  +1000



Hi,

I want to revive this old discussion because Plone 4.3 now is the
current version; I know that some guys talked about how to change the
products section
(http://www.coactivate.org/projects/plog2013/products-party) so
probably try to improve the current one is a waste of time.

But looking at the present state the products page is still displaying
only Plone 4.2 compatibility and we have not way to mark releases as
Plone 4.3 compliant... :\
The Nathan's suggestion of removing the version filter (or unify under
Plone 4.x all Plone 4 releases) is probably the better choice. If we
simply add Plone 4.3 release we'll see again an empty plone.org
products page for some weeks.



I'm in the process of taking care of this.

/products now has an option of Plone 4.x for the version. This is the 
default query, and it will include products tagged as compatible with 
Plone 4, Plone 4.1, Plone 4.2, or Plone 4.3 (which I added as an 
available option). (If you don't see this yet, it's cached and should be 
there soon.)


I am working on adding the 'Plone 4.3' compatibility tag to all existing 
releases that are tagged as compatible with 4.2 and mention 4.3 
compatibility in their long_description, or that I have personally used 
on 4.3.


Product developers, if your package is 4.3 compatible and *doesn't* 
mention that in the long_description, please update your release 
metadata on plone.org. Keep in mind that /products is cached (for an 
hour, IIRC?) so the change may take a bit to appear.


I'm also willing to update the tags for other packages if you tell me 
ones that you can confirm are compatible with 4.3.


best,
David
___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] pissed Generating the Dexterity boilerplate for Plone 4.3/pissed

2013-05-28 Thread David Glick (Plone)

On 5/27/13 11:46 PM, ajung wrote:

David Glick (Plone) wrote

Thanks for pointing out some specific places where the Dexterity
documentation is out of date. Steve McMahon and I are working on fixing
this. Additional specific suggestions for improvements, as opposed to
general griping, would be appreciated.

I am reading a subliminal allegation that integrators (perhaps
I take this to personal) do nothing for the community and only live
from others peoples work - without contributing anything back.
Not participating as core developer does not mean that I/we don't
contribute on various level (ask me for a long list if you want to see
one).

I think you're misreading what I said then. I appreciate your 
contributions and was in fact trying to thank you for this one.


Reading your criticisms of Dexterity was hard for me because I've put a 
lot of time and effort into trying to maintain it over the past couple 
years. Much of the criticism is valid, so it reminds me of some of the 
ways in which I've failed. My comments about the need for the whole 
community to be responsible were not meant as judgment on anyone's 
contributions or lack thereof, but more of a plea for help since I don't 
feel capable of fixing the problems on my own.

___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] Plone 4.3: AttributeError: 'FileChunk' object has no attribute 'read'

2013-05-26 Thread David Glick (Plone)
The FileChunk error was fixed in 
https://github.com/plone/plone.namedfile/commit/c0de399d826a19eba7d58f8501432c8ca8ecd381, 
released in plone.namedfile 2.0.3, and will be part of the next Plone 
4.3.x release.

David

On 5/26/13 10:26 AM, Andreas Jung wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Next upgrade fun with Plone 4.3:

2013-05-26 19:24:47 ERROR root could not scale
plone.namedfile.file.NamedImage object at 0x18f5c5f0 of
'http://zopyx.com:8089/Plone/de/rotator-1'
Traceback (most recent call last):
   File
/home/plone/.buildout/eggs/plone.namedfile-2.0.1-py2.7.egg/plone/namedfile/scaling.py,
line 196, in create
 result = scaleImage(orig_data, direction=direction, height=height,
width=width, **parameters)
   File build/bdist.linux-x86_64/egg/plone/scale/scale.py, line 31, in
scaleImage
 image = PIL.Image.open(image)
   File
/home/plone/.buildout/eggs/Pillow-1.7.8-py2.7-linux-x86_64.egg/PIL/Image.py,
line 1953, in open
 prefix = fp.read(16)
AttributeError: 'FileChunk' object has no attribute 'read'
2013-05-26 19:24:47 ERROR Zope.SiteErrorLog 1369589087.310.780236486296
http://zopyx.com:8089/Plone/de/folder_listing
Traceback (innermost last):
   Module ZPublisher.Publish, line 126, in publish
   Module ZPublisher.mapply, line 77, in mapply
   Module ZPublisher.Publish, line 46, in call_object
   Module Shared.DC.Scripts.Bindings, line 322, in __call__
   Module Shared.DC.Scripts.Bindings, line 359, in _bindAndExec
   Module Products.CMFCore.FSPageTemplate, line 237, in _exec
   Module Products.CMFCore.FSPageTemplate, line 177, in pt_render
   Module Products.PageTemplates.PageTemplate, line 79, in pt_render
   Module zope.pagetemplate.pagetemplate, line 132, in pt_render
   Module zope.pagetemplate.pagetemplate, line 240, in __call__
   Module zope.tal.talinterpreter, line 271, in __call__
   Module zope.tal.talinterpreter, line 343, in interpret
   Module zope.tal.talinterpreter, line 888, in do_useMacro
   Module zope.tal.talinterpreter, line 343, in interpret
   Module zope.tal.talinterpreter, line 533, in do_optTag_tal
   Module zope.tal.talinterpreter, line 518, in do_optTag
   Module zope.tal.talinterpreter, line 513, in no_tag
   Module zope.tal.talinterpreter, line 343, in interpret
   Module zope.tal.talinterpreter, line 852, in do_condition
   Module zope.tal.talinterpreter, line 343, in interpret
   Module zope.tal.talinterpreter, line 821, in do_loop_tal
   Module zope.tal.talinterpreter, line 343, in interpret
   Module zope.tal.talinterpreter, line 531, in do_optTag_tal
   Module zope.tal.talinterpreter, line 513, in no_tag
   Module zope.tal.talinterpreter, line 343, in interpret
   Module zope.tal.talinterpreter, line 742, in do_insertStructure_tal
   Module Products.PageTemplates.Expressions, line 218, in evaluateStructure
   Module zope.tales.tales, line 696, in evaluate
- URL:
file:/home/plone/zopyx.com-relaunch-plone-43/src/zopyx.com.theme/zopyx/com/theme/skins/zopyx_theme_custom_templates/main_template.pt
- Line 122, Column 27
- Expression: PythonExpr scale.scale('image', width=360,
height=230).tag()
- Names:
   {'container': ATFolder at /Plone/de,
'context': ATFolder at /Plone/de,
'default': object object at 0x2b768fadeb80,
'here': ATFolder at /Plone/de,
'loop': {u'img': Products.PageTemplates.Expressions.PathIterator
object at 0x18587f50},
'nothing': None,
'options': {'args': ()},
'repeat': Products.PageTemplates.Expressions.SafeMapping object
at 0x18921c58,
'request': HTTPRequest,
URL=http://zopyx.com:8089/Plone/de/folder_listing,
'root': Application at ,
'template': FSPageTemplate at /Plone/de/folder_listing,
'traverse_subpath': [],
'user': PropertiedUser 'ajung'}
   Module Products.PageTemplates.ZRPythonExpr, line 48, in __call__
- __traceback_info__: scale.scale('image', width=360, height=230).tag()
   Module PythonExpr, line 1, in expression
   Module AccessControl.ImplPython, line 675, in guarded_getattr
AttributeError: 'NoneType' object has no attribute 'tag'

- -aj
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQGUBAEBAgAGBQJRokXKAAoJEADcfz7u4AZjJ8MLv0wLXKfInJcr1DNm526h8Ej0
QyAphDtkOTqquJjLb0SSPuHI89162YefFzvXVyTf2vS3D1pjYItFGGgxgHzTrvUQ
jcfCBE086lMfIUmUWtrrI6RAUgXiUUPyjq+vfbmUkJH8RgfXOmF9wPi1pOlaVFac
FW5alNnodw/SUTY1X6p+nfuaqJiZ7ABIGWLC/KS6uC60Ebka6DXXonGvToGsDPga
HB7YHHG9SRzT5IoMrCO8/speQ10d7ByiI9yTW2Ub50At4kaCBFGPsnaK8mXCRohC
abqXpcLuJIkyyvTILwAE9/n3FrJlWtcbQtCDgLxd1zrJe8tQ4GGjbVzjp2ConLvz
fDo8cb3hi1KwUEjbacbfCHr1WYfAKPnQR5P8HVE8gTNaofOk0Wn696OM2bbDvmUB
rWEtuuhdrjzX8QwDQbc9FulmNRXYfVFsHIQ6Hn2Yo+jADX4i1oLxzNZheiGdwgHE
swdOa+MfHBgM6UXuw/5egfB9W8HQo4w=
=Cbj0
-END PGP SIGNATURE-


___
Product-Developers mailing list
product-develop...@lists.plone.org

Re: [Product-Developers] pissed Generating the Dexterity boilerplate for Plone 4.3/pissed

2013-05-25 Thread David Glick (Plone)

On 5/25/13 6:55 AM, ajung wrote:

After reversing engineering: the problem here is in GenericSetup. The
configuration for

property name=schema.../property

is completely ignored. It is correctly exported through portal_setup after
setting it manually through the ZMI but the standard types tool import step
ignores this property.

This is working for me for some Dexterity content types in Plone 4.3. 
Are you sure you specified Dexterity FTI as the meta_type?

David
___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] pissed Generating the Dexterity boilerplate for Plone 4.3/pissed

2013-05-25 Thread David Glick (Plone)

On 5/25/13 4:40 AM, ajung wrote:

Rant continuing

Even the Dexterity documentation is outdated for Plone 4.3

http://dexterity-developer-manual.readthedocs.org/en/latest/schema-driven-types.html

Please use the copy of the manual at 
http://developer.plone.org/reference_manuals/external/plone.app.dexterity/ 
rather than the one at 
http://dexterity-developer-manual.readthedocs.org/  ... the latter has 
not been getting updated when changes are made in 
plone.app.dexterity/docs, and I've asked Giacomo to take it down.


It's still true that some things need to be updated for Plone 4.3.

David
___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] KSS removal / workflow menu

2013-05-17 Thread David Glick (Plone)

On 5/17/13 9:32 AM, Sean Upton wrote:

So KSS changeWorflowState and its wicked assumptions have broken [1,2]
two add-ons I have developed, enough so that I feel highly motivated
to get my packages updated to work on Plone 4.3 (on 4.2.x now).

Does 4.3 implement an XMLHTTPRequest-based state-change mechanism for
the workflow menu actions, or does this merely use simple page loads?

Sean

[1] Do not use worklists with KSS installed.
 https://dev.plone.org/ticket/13510

[2]  assert setSite(NON_SITE) === 'evil'
 https://teamspace.upiq.org/trac/ticket/410

As far as I can recall we didn't try to replicate the feature of 
changing the workflow state without reloading the page. It's probably 
not hard to do in jQuery if you need it.

___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] multi version CI: extending from Dexterity KGS in buildout.plonetest?

2013-03-27 Thread David Glick (Plone)

On 3/27/13 7:33 AM, Héctor Velarde wrote:
yesterday I successfully started testing various add ons against 
different versions of Plone and Python using Travis CI and our good 
old testing configurations in buildout.plonetest.


you can see some nice examples in:

https://travis-ci.org/collective/collective.prettydate
https://travis-ci.org/collective/plone.app.imagecropping

ideas were shamelessly stolen from plone.api and everything is 
documented in:


https://github.com/collective/buildout.plonetest#testing-in-travis-ci-with-multiple-versions-of-plone 



now I'm facing a new problem that could be interesting for others: I 
want to test some Dexterity-based content types on Plone 4.1 but I 
would need to add the KGS to the plone-4.1.x.cfg configuration:


[buildout]
extends =
http://dist.plone.org/release/4.1-latest/versions.cfg
https://good-py.appspot.com/release/dexterity/1.2.1  -- this one!
...

anybody against this?

I would probably make a separate plonetest configuration for Plone 4.1 + 
Dexterity. Plone 4.1 didn't officially include Dexterity, and pretending 
it did could cause someone to draw the wrong conclusions from their test 
runs.


Also, that's not the right way to extend Dexterity versions; you should do:
extends =
https://good-py.appspot.com/release/dexterity/1.2.1?plone=4.1.6

That's because the Dexterity 1.2.1 KGS contains a couple different 
versions of five.grok for compatibility with different versions of 
Zope2. If you specify the plone version as a parameter like this it has 
enough info to constrain it to the correct version; without it it'll 
just include the latest one that's in the KGS which might not be correct.

David
___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] Ask for release of LinguaPlone

2013-01-17 Thread David Glick (Plone)

You should have access now.
cheers,
David

On 1/17/13 5:39 AM, Jean-Michel FRANCOIS wrote:

Hi !

I need a new release for LinguaPlone. There is one year of changes 
inside !


I'm ready to assume the release if you give me rights (user toutpt 
on both plone.org http://plone.org  pypi).



Regards / Cordialement,
JeanMichel FRANCOIS
Find me on Twitter http://twitter.com/toutpt / Retrouvez moi sur 
Twitter http://twitter.com/toutpt_nantes




___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] Plone 4.3 compatibility for plone.org products (was Plone 4.2 compatibility for plone.org products)

2013-01-14 Thread David Glick (Plone)

On 1/14/13 4:16 AM, Luca Fabbri wrote:

On Tue, Jan 8, 2013 at 9:28 PM, Alex Clark acl...@aclark.net wrote:

On 2013-01-06 20:13:46 +, Jean Jordaan said:


Hi Luca,


Where is the code of the PSC used by plone.org?


If you start from https://github.com/plone/Products.PloneOrg
you should find it.


Yes you can help, please help! :-)


I started watching at this in the W.E: I'm not 100% sure I'm using the
right branch.
In this template
(https://github.com/plone/Products.PloneOrg/blob/master/src/Products/PloneOrg/skins/ploneorg/psc_view_ploneorg.pt)
I get errors for the old-style usage of toLocalizedTime.

Anyone can confirm this?


I just checked in portal_skins on plone.org, and it's actually using the 
copy of psc_view_ploneorg from PloneSoftwareCenter, not the one in PloneOrg.



Meanwhile: can I also try to implement my old suggestion from the
discussion Releases on plone.org/products page (in two word:
changing the plone.org/products page dropdown default to most rated
to recently updated)?

+0. The downside to that is that is makes it easier to game the system 
to make your product show up more, by making frequent releases.

___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] Dexterity: make a list field required

2012-12-05 Thread David Glick (Plone)
I think you can also say min_length=1 ... but the error message in case 
the list is too short might be cryptic, IIRC.

David

On 12/5/12 10:57 AM, Christian Ledermann wrote:

OK figured out a workaround:

def isnotempty(value):
 return bool(value)


layers = schema.List(
 title=_(uLayers),
 description=_(uWMS Layers),
 required=True,
 constraint=isnotempty,
 value_type=schema.Choice(
  source=layers_vocab,
  required=True,
  ),
 )

On Wed, Dec 5, 2012 at 9:50 PM, Christian Ledermann
christian.lederm...@gmail.com wrote:

I try to make a list filed required for a dexterity type:


 layers = schema.List(
 title=_(uLayers),
 description=_(uWMS Layers),
 required=True,
 value_type=schema.Choice(
  source=layers_vocab,
  required=True,
  ),

but when I save the edit form it does not complain wether
the list field is filled or not

--
Best Regards,

Christian Ledermann

Nairobi - Kenya
Mobile : +254 702978914

*))){

If you save the living environment, the biodiversity that we have left,
you will also automatically save the physical environment, too. But If
you only save the physical environment, you will ultimately lose both.

1) Don’t drive species to extinction

2) Don’t destroy a habitat that species rely on.

3) Don’t change the climate in ways that will result in the above.

}(((*





___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] please release collective.portlet.actions

2012-10-13 Thread David Glick (Plone)

On 10/12/12 7:57 PM, Alex Clark wrote:

On 2012-10-12 14:32:44 +, Tom Gross said:


There is no automated way. But adding a buildout based on one of these

http://svn.plone.org/svn/collective/buildout/plonetest/

(any reason to not have these on github?)


I am interested in moving them to github (and leaving the old ones in 
place with a note) but IIRC davisagli and I didn't agree on what to 
call them. I don't like plonetest because that is meaningless AFAICT 
(or at least, I don't understand what it means. Buildouts for… testing?)


They are in fact buildouts that were created for the purpose of testing 
Plone add-ons. Please just leave the name alone; even if it's not a 
particularly verbose name, renaming things tends to cause confusion.

David
___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] Plone Keyword Manager

2012-09-17 Thread David Glick (Plone)

On 9/17/12 2:39 PM, jimterangi wrote:

I've noticed name discrepancies alot with things getting moved on to git hub.
It is definitely not very good for community driven development, such as
Plone.


On the contrary, I think github's tools for tracking issues and doing 
peer review of pull requests are really excellent tools for 
community-driven development. What do you think is problematic?

___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] Plone Keyword Manager

2012-09-16 Thread David Glick (Plone)

On 9/16/12 6:24 AM, Héctor Velarde wrote:

hi there!

who is the current maintainer of Products.PloneKeywordManager?

Looks like no one had done any work on it until you for the past year. 
The owners on PyPI are dunlapm, jessesnyder, saily, tdesvenain. By the 
way, I notice that it got moved to github as Products.KeywordManager 
... that should probably get renamed to match the name of the product.

David
___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] release archetypes.querywidget

2012-09-08 Thread David Glick (Plone)

On 9/3/12 2:50 AM, Jens W. Klein wrote:

Hi,

after fixing bug https://dev.plone.org/ticket/13144 it would be nice 
to have a release, is this possible?
This would help anybody using new collections together  with add ons 
which are modifing the raw query, i.e. Solgema.fullcalender is a 
prominent one.


All you have to do is add it to checkouts.cfg in the appropriate branch 
of buildout.coredev, and Eric will make sure it gets released along with 
the next Plone release from that branch. I just added it for 4.2 and 4.3.


If you want it sooner than that, give me your pypi username and I'll add 
you as an owner so you can release it.

David
___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] Plone Community and Development – Things of note (2012-08-23)

2012-08-26 Thread David Glick (GW)


On Aug 26, 2012, at 8:40 AM, Karl Johan Kleist kle...@postkiosk.de wrote:

 Hi all,

 After having added Products.TinyMCE = 1.3.b2 to [versions], and verified
 the existence of eggs/Products.TinyMCE-1.3b2-py2.7.egg after running
 buildout, no traces of a visual editor is to be seen.

 All I get is this:

 textarea id=text class=mce_editable name=text rows=25
 cols=40/textarea

 and below that the usual link Edit without visual editor.

 Do I have to turn more knobs in order to activate 1.3b2 ?



There is an upgrade step you must run. After doing that, if it still doesn't 
work, check for JavaScript errors.


 -
 http://du-alter-schwede.de
 --
 View this message in context: 
 http://plone.293351.n2.nabble.com/Plone-Community-and-Development-Things-of-note-2012-08-23-tp7558215p7558282.html
 Sent from the Product Developers mailing list archive at Nabble.com.
 ___
 Product-Developers mailing list
 product-develop...@lists.plone.org
 https://lists.plone.org/mailman/listinfo/plone-product-developers


--
David Glick
 Web Developer
 davidgl...@groundwire.org
 206.286.1235x32

Groundwire is now hiring a Web Developer

http://groundwire.org/about/jobs/web-developer


___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] Thinking about CMF site fixture/layer for plone.testing

2012-05-12 Thread David Glick

On 5/10/12 9:24 AM, Sean Upton wrote:

I'm using a homegrown CMF site fixture/layer with plone.testing for
testing add-ons that require CMF but not Plone (and possibly also are
non-GPL e.g. MIT/BSD/ZPL type licenses).  What I have done thus far is
minimal -- just the tiny bits I need to test: create a site class
subclassing Products.CMFCore.PortalObject.PoralObjectBase, and add a
portal_catalog to that site, and this runs inside a layer based on
plone.testing.z2.STARTUP.

This seems useful to me because it gives me a way of resolving items
in a site via a catalog, and it gives me a persistent component
registry to test against.  It also is much faster to set up and tear
down than a fully-blown Plone site, which is advantageous for packages
that have minimal coupling with Plone.

Is this something that might (eventually) be useful to others as an
added layer in plone.testing itself (assuming another optional extra
called 'cmf', and a layer resource called 'site')?
Why not 'portal', since that's what's used in the Plone fixture, 
CMFTestCase, and PortalTestCase in Zope2's Testing package?

If so, what OOTB CMF tools and fixtures would you want in a CMF site
fixture for testing?

Also, is there any point in using / requiring CMFDefault if a fixture
based on CMFCore will suffice?  My goal would be only adding extra
dependency on CMFCore only.


+1 for not requiring CMFDefault, and for the proposal in general.

David


--  
David Glick
Web Developer
davidgl...@groundwire.org
206.286.1235x32

Are you engaging? Find out! Use our free engagement benchmarking tool.

http://groundwire.org/labs/engagement-strategy/diy-benchmarking-survey


___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] [plone.app.iterate] Why is working copy support tied to versioning?

2012-04-25 Thread David Glick (GW)

On Apr 24, 2012, at 11:53 PM, Andreas Jung wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Hi there,

 I wonder why the working copy support of Plone is only
 working for content-types with versioning enabled?
 Is there any particular reason because I consider both features
 (working copy support and versioning) independent of each other.


I'm not sure. I just glanced through plone.app.iterate and didn't see anything 
that would obviously make it require versioning. In what way does it fail 
without versioning?
David



--
David Glick
 Web Developer
 davidgl...@groundwire.org
 206.286.1235x32

GiveBIG is coming! Mark your calendar for May 2 and get ready to give big to 
Groundwire
on this community-wide day of giving.

http://www.seattlefoundation.org/npos/Pages/Groundwire.aspx


___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] plone.app.theming and password reset

2012-04-25 Thread David Glick (GW)
On Apr 25, 2012, at 1:04 AM, Christian Ledermann wrote:

 Hello,


 some diazo themes have a problem with the password reset.
 I tested this with my development server and on ploud.com
 the results were the same:

 theme:   ploud:   devel:

 sunrain OK  OK

 Burned  error   error

 Motion  error   error

 Wood Experience OK  OK

 Red Music   OK  OK

 Coda Press  OK  OK

 Discovery   OK  OK

 Banana Leaf OK  OK

 Leaves Dew  error   error

 Pollination OK  OK

 iwaters error   error

 Earthling Two   OK  OK



 /portal_registration/passwordreset/pwreset_form displays:

 Error setting password
 Sorry, this appears to be an invalid request. Please make sure you
 copied the URL exactly as it appears in your email and that you
 entered your user name correctly.

 there are no errors in the error log (with no 'Ignored exception types')


 So it seems to be an error in the rules.xml I suppose,
 can somebody point me into the right direction to debug this?



Maybe an issue with a relative link and the Diazo theme not copying the BASE 
tag properly? Just a guess.
David


--
David Glick
 Web Developer
 davidgl...@groundwire.org
 206.286.1235x32

GiveBIG is coming! Mark your calendar for May 2 and get ready to give big to 
Groundwire
on this community-wide day of giving.

http://www.seattlefoundation.org/npos/Pages/Groundwire.aspx


___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] Introducing collective.grok

2012-04-17 Thread David Glick

On 4/16/12 11:41 PM, Martin Aspeli wrote:

On 17 April 2012 02:44, Érico Andreier...@simplesconsultoria.com.br  wrote:

Hello guys,

I would like to present you collective.grok, a package bringing Grok and
Martian to Generic Setup and i18n registrations in Plone.

Cool ;)

Could we please find a better name? This is hugely confusing when
there is 'grok' and 'five.grok' already, and this covers only a very
specific (but two unrelated?) use cases.

We have been using plone.directives.* as a namespace before. Could that work?



Right now the package is in version 1.0a2 (released on Pypi) and the code
and issue tracker are available at GitHub
(https://github.com/collective/collective.grok)

So, a tipical zcml file to handle profiles registration like this:

configure
 xmlns=http://namespaces.zope.org/zope;
 xmlns:genericsetup=http://namespaces.zope.org/genericsetup;
 xmlns:i18n=http://namespaces.zope.org/i18n;
 i18n_domain=collective.person

 genericsetup:registerProfile
 name=default
 title=collective.person: Install
 directory=profiles/default
 description=collective.person
 provides=Products.GenericSetup.interfaces.EXTENSION
 i18n:attributes=title; description
 /

 genericsetup:registerProfile
 name=uninstall
 title=Uninstall collective.person
 directory=profiles/uninstall
 description=Uninstall collective.person
 provides=Products.GenericSetup.interfaces.EXTENSION
 i18n:attributes=title; description
 /


 genericsetup:importStep
 name=collective.person-upgrades
 title=collective.person: Upgrades
 description=Run available upgrades for this package.
 handler=collective.person.setuphandlers.run_upgrades
 /genericsetup:importStep

 include package=.upgrades /

 genericsetup:importStep
name=collective.person
title=Person Catalog Import Step
description=
handler=collective.person.exportimport.catalog.importPersonCatalog
depends name=toolset/
 /genericsetup:importStep

 genericsetup:exportStep
name=collective.person
title=Person Catalog Export Step
description=
handler=collective.person.exportimport.catalog.exportPersonCatalog
  /

/configure


Would be replaced by functions and decorators in Python files:

from collective.grok import gs

gs.profile(name=u'default',
title=u'collective.person: Install',
description=u'collective.person',
directory='profiles/default')

# Uninstall Profile
gs.profile(name=u'uninstall',
title=u'Uninstall collective.person',
description=u'collective.person',
directory='profiles/uninstall')

@gs.importstep(name=u'collective.person-upgrades',
title='collective.person: Upgrades',
description='Run available upgrades for this package.',
dependencies=[])
def run_upgrades(context):
pass

@gs.importstep(name=u'collective.person',
title='Person Catalog Import Step',
description='',
dependencies=['toolset', ])
def importPersonCatalog(context):
pass


@gs.exportstep(name=u'collective.person',
 title='Person Catalog Export Step',
 description='',)
def exportPersonCatalog(context):
pass


In the near future, collective.grok is planned to  support also:

* Portlets registration

* Transmogrifier

* Dexterity Behaviors (I'm not sure about this one, should be somewhere
else...)

I'm against trying to create these types of 'mega packages' that cover
lots of functionality. What do we do if (when) we deprecate portlets,
for instance? And is everyone going to want transmogrifier as a
dependency? Better to have specific packages, like
plone.directives.form and plone.directives.dexterity.


I wouldn't worry about it too much. We should avoid hard dependencies on 
things that some people aren't going to want, but managing a gazillion 
packages is a pain.

David


--  
David Glick
Web Developer
davidgl...@groundwire.org
206.286.1235x32

GiveBIG is coming! Mark your calendar for May 2 and get ready to give big to 
Groundwire
on this community-wide day of giving.

http://www.seattlefoundation.org/npos/Pages/Groundwire.aspx


___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] Automatically generating CHANGELOG.txt from Github commits

2012-04-11 Thread David Glick (GW)

On Apr 11, 2012, at 12:09 PM, Mikko Ohtamaa wrote:

 Hi,

 Do you know any method of automatically

 * Extracting Git(hub) history

 * Making CHANGELOG.txt entry like 1.0.2 - 1.0.3

 * Including text from history entries which are tagged like [release
 notes] and putting them to the changelog

 This would make Python egg release process even better and more automatic
 with jarn.mkrelease and buddies.


Only if everyone remembers to add the [release notes] tag when committing. Good 
luck with that.



--
David Glick
 Web Developer
 davidgl...@groundwire.org
 206.286.1235x32

GiveBIG is coming! Mark your calendar for May 2 and get ready to give big to 
Groundwire
on this community-wide day of giving.

http://www.seattlefoundation.org/npos/Pages/Groundwire.aspx


___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] RichTextWidget wysiwyg editor not displaying actual value after action

2012-04-04 Thread David Glick

On 3/19/12 12:11 AM, Régis Rouet wrote:

Hi,

I try to have a reset button on a customized dexterity.EditForm
to set a RichText field with a computed value while staying on the edit
form.

For example :

class EditForm(dexterity.EditForm):
 grok.context(IScreening)
 z3cform.extends(dexterity.EditForm)

 def updateWidgets(self):
 super(EditForm, self).updateWidgets()

 @button.buttonAndHandler(u'Reset', name='reset')
 def handle_reset(self, action):
 data, errors = self.extractData()
 data['user_text'] = u'reset' + '   ' + datetime.now().isoformat()
 self.applyChanges(data)
 self.updateWidgets()

The problem is that the wysiwyg editor keep displaying the old value.
If I click on the edit without wysiwyg editor link, I then get the actual
value.

I'm new to z3c.form and not sure to have a correct code.

Any opinion ?

I use Plone 4.1.4 and dexterity 1.2.

It's not working because RichText fields need to store a 
plone.app.textfield.value.RichTextValue object, not a unicode string.


But if you don't need to actually store the new value on the object, you 
can do it this way (since widgets use the value in the request in 
preference to obtaining a value from the form's content item):


@button.buttonAndHandler(u'Reset', name='reset')
def handle_reset(self, action):
data, errors = self.extractData()
self.request.set('form.widgets.body', u'reset' + '   ' + 
datetime.now().isoformat())

self.updateWidgets()

David


--  
David Glick
Web Developer
davidgl...@groundwire.org
206.286.1235x32

The Engagement Party 2012. So much more fun than the wedding reception.

http://www.npoengagementparty.com


___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] tinycme.xml resource types

2012-04-04 Thread David Glick

On 3/21/12 12:58 PM, Sean Upton wrote:

Okay, so I'm just moving my rant from #plone here, but here goes: is
any one else frustrated that we have to define a tinymce.xml just to
get resource (linkable, container) types listed for hyperlinks?

Does it not seem that this could/should be better done on each type's
respective FTI (e.g. a behavior for Dexterity types that is included
in all the docs/boilerplate defaults -- one that opted the type into
being linkable, and if a container, listed as such in the final
resources considered by Products.TInyMCE)?

ITinyMCEResourceTypes is an awfully crude interface anyway -- I don't
want to get rid of it, but there needs to be some better way to get
this config to TinyMCE without all the boilerplate of tinymce.xml.  Or
maybe we just need linkable-by-default convention-over-configuration
and the ability to blacklist types instead of whitelist types as
linkable, containsobjects in control-panel?

What can be done to make this better for add-on developers -- less
boilerplate and such?  Ideas to make this less tedious welcome.  I bet
there is a backward-compatible way to make things easier, too.  Maybe
if some consensus emerges, I will try to implement something in
experimental forks of Products.TinyMCE and pitch it over on
plone-developers.

Seems to me that linkability should ideally be a boolean property of an 
FTI rather than a list on the TinyMCE utility. Though the latter is 
probably faster to look up, and I don't personally experience enough 
pain here to put forth effort to fix it.

David


--  
David Glick
Web Developer
davidgl...@groundwire.org
206.286.1235x32

The Engagement Party 2012. So much more fun than the wedding reception.

http://www.npoengagementparty.com


___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] How to display borg.localrole in Sharing tab

2012-03-23 Thread David Glick

On 3/23/12 2:11 PM, Marcos Romero wrote:

Thanks Jon

I think I didn't explain it right.

I'm adding principals (users and groups) to existing roles
programatically via borg.localrole. I'd like those principals to be
shown under Can read, Can edit, Can review columns in the
Sharing tab.

I don't wont to add new roles there, just to see people who
effectively have those roles, but not in the native way but via my
custom adapter.

I hope this is more clear.


I think the lack of this is a shortcoming in the existing sharing tab, 
and a patch to improve it would be welcome!



--  
David Glick
Web Developer
davidgl...@groundwire.org
206.286.1235x32

The Engagement Party 2012. So much more fun than the wedding reception.

http://www.npoengagementparty.com


___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] archetypes.uploadreferencewidget release

2012-03-22 Thread David Glick

On 3/22/12 10:47 AM, Radim Novotny wrote:

Hi,

the archetypes.uploadreferencewidget package on PyPI is owned by 'deo'
only.
With all respect to Dorneles and his Plone work we would need to change
ownership of this package to someone else. Does anyone know if there is
any chance to add another package owners even if deo can't do that?



Ask on the catalog-sig mailing list.
David


--  
David Glick
Web Developer
davidgl...@groundwire.org
206.286.1235x32

The Engagement Party 2012. So much more fun than the wedding reception.

http://www.npoengagementparty.com


___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] ANN: plone-devstart (please help test)

2012-03-13 Thread David Glick (GW)

On Mar 13, 2012, at 10:00 AM, Alex Clark wrote:

On 3/10/12 5:15 PM, Martin Aspeli wrote:
Hi,

Somewhat inspired by the goals of the ``plone.api`` initiative and based
on the experience of seeing many, many people struggle to get a safe
Plone development up and running due to problems with polluted system
Python interpreters, missing libraries and confusing buildouts, I have
created a script called ``plone-devstart.py``.


+0

In the interest of stop energy (kidding)… but seriously: can we not go
in this direction, if at all possible? Or at least think out loud a bit
more before first.

My thoughts:

We've spent years getting Plone situated in a nice place within the
Python community. To address the concerns of the ``plone.api`` folks and
anyone that has trouble installing or developing add-ons for Plone, I
would strongly recommend that we adhere very closely to Python best
practices[1].

Now, I completely understand Martin's motivation here and may personally
be interested in trying plone-devstart.py to see what he has come up
with. But I don't think, at least my gut reaction tells me, that a
project-specific script is not what we need or want more of here[2].

Think about it this way: the Plone project has very ambitious goals with
regard to CMS functionality, and a limited set of developers to
accomplish those goals. We don't want those resources spent on Python
module installation problems, if we can help it. Better to offload that
problem to the worldwide community of Python folks IMHO for free support.


Alex


[1] Support: pip install -r 4.2.x.txt Plone ASAP. Failures with this
process become general Python failures not Plone specific failures.
Don't have PIL? pip install Pillow and so on. Let requirements.txt
equal versions.cfg in effect, and let's figure out how to build out a
bunch of zcml slugs without buildout. (Actually, with Pillow, it's
probably now safe to depend on it in the way we depend on Zope2.
Installation problems have been practically eliminated for all major
OSes. The only gotcha is C extensions, but Zope2 has those too. Oh and
PIL's deps, but the Unified Installer includes those for its purposes
and anyone that can type pip install Plone can probably type
{aptitude,brew,etc} install libjpeg-dev and so on.)

[2] One exception may be if pip install plone-devstart were supported.


I'm all in favor of moving toward supporting a more standard Python 
installation approach, but I think something along the lines of Martin's 
plone-devstart script would be useful even then. I'd rather run a script which 
checks to make sure everything is installed and installs the missing things 
than have to remember all the steps myself. If we can build those checks into 
Plone's setup.py though, so much the better -- so I'd much rather consider 
Martin's script as very useful research toward that end rather than as a wrong 
direction.

David



David Glick
Web Developer
davidgl...@groundwire.org
206.286.1235x32


[http://gw-logo.s3.amazonaws.com/gw-email-signature.png]


The NPO Engagement Party 2012.http://www.npoengagementparty.com So much more 
fun than the wedding reception.


___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] ANN: plone-devstart (please help test)

2012-03-12 Thread David Glick (GW)

On Mar 12, 2012, at 3:05 PM, Martin Aspeli wrote:



On 12 March 2012 21:56, Héctor Velarde 
hector.vela...@gmail.commailto:hector.vela...@gmail.com wrote:
On 12/03/12 17:40, Martin Aspeli wrote:
Buildout does in version 1.5.2. That is not the version Plone 4.1.4 (see
http://download.zope.org/zopetoolkit/index/1.0.5/ztk-versions.cfg).

HV amazing!


If and when we have a reliable way to do this with standard Plone
versions, let's do it. I'd strongly welcome a PLIP to upgrade Plone's
buildout version, but until that's commonplace, we need this type of
isolation.

HV are there any risks involved on this, or is just to include zc.buildout = 
1.5.2 in Plone's KGS to override the one in ztk?

this can be accomplished easily :-)

Agreed. Thought not for existing/legacy versions of Plone of course.

I don't know if there are risks/problems. I guess it needs a PLIP champion and 
some testing. Probably still an option for 4.3, less sure about 4.2.



We do need to proceed cautiously.

The mechanism by which zc.buildout 1.5.x isolates itself is by passing -S to 
the Python interpreter, which makes Python not load site.py.

That means that upgrading to zc.buildout 1.5.x will break installations that 
used both a virtualenv and a buildout, and installed some eggs into the 
virtualenv. (Because a customized site.py is how virtualenv sets up a sys.path 
which includes the virtualenv's site-packages dir.)

I think it will also interfere with installations that are using 
sitecustomize.py, such as to change the default encoding.

David



David Glick
Web Developer
davidgl...@groundwire.org
206.286.1235x32


[http://gw-logo.s3.amazonaws.com/gw-email-signature.png]


The NPO Engagement Party 2012.http://www.npoengagementparty.com So much more 
fun than the wedding reception.


___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] ANN: plone-devstart (please help test)

2012-03-11 Thread David Glick

On 3/11/12 12:46 AM, Martin Aspeli wrote:


On 11 March 2012 06:58, Mikko Ohtamaa 
mikko+pl...@redinnovation.commailto:mikko%2bpl...@redinnovation.com wrote:


   Last night while talking to Clayton and Liz about the whole 
ZopeSkel/Paster/Templer/Crushinator situation it became clear that the story 
for new developers is a complete mess.

   This is bad, and having a new shinny thing that eases Plone development just made the 
situation even worse -- as long as someone must use it and then zopeskel create  paster 
addcontent.

   Time to kill most of the available options, focus on **just one** and have a 
compelling story to tell to newcomers.


+1 for cleaning up the old stuff before inventing new stuff

A good step would be making buildout just work, as it is indented

Yay for stop energy. :-/

I want a solution that works now to a very specific problem: people expect to 
be able to use an OS-managed/system Python to develop with Plone. And when they 
try, their environment breaks in all kinds of hard-to-debug ways.

I don't want a framework or something with a million things that can go wrong. 
plone-devstart is a dirt simple script using nothing but the Python standard 
library. And, crucially, it scans the environment looking for known/common 
problems.

I'm more concerned about the overlap with the installers, though that's a 
slightly different discussion again.

The point is that *once you have a stable/clean environment*, you can have all kinds of 
good tools. But if you can't get those tools to install or run, you're screwed. Even if 
buildout should just work you still need to install it. And you still need to 
worry about whether you have the right Python version. And you may still be missing PIL C 
library dependencies, or have a poisonous libxml2 killing lxml dead in your global 
library, or be missing Python headers or a C compiler. None of those are within 
Buildout's scope, and they are causing real problems for real people *today*.

Thanks for working on this, Martin. It sounds like a great tool and I'm looking 
forward to giving it a try.

We do also really need to fix the ZopeSkel situation. Right now a ton of 
tutorials give instructions for it that just don't work with the new version, 
which is a huge huge barrier for newbies. But having ZopeSkel implementation 
and docs in sync is a different problem than getting a working development set 
up, so I don't understand the stop energy from people. plone-devstart and 
ZopeSkel are complementary tools.

David



David Glick
Web Developer
davidgl...@groundwire.org
206.286.1235x32


[http://gw-logo.s3.amazonaws.com/gw-email-signature.png]


The NPO Engagement Party 2012.http://www.npoengagementparty.com So much more 
fun than the wedding reception.


___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] [Dexterity] How to register a browser:page?

2012-02-12 Thread David Glick

On 2/9/12 10:12 AM, Andreas Jung wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

browser:page  ZCML registrations require a class or an interface.

But how to I register a browser:page for a dexterity type that has
been defined through the web?

It seems to be possible to catch all Dexterity instance using
a registration for plone.dexterity.interfaces.IDexterityContent
however that's pretty unspecific.

What's the pattern here?


Lots of options...

1. There is actually an automatically generated interface you could use. 
To use it you need to know its full dotted path, of course. It is in a 
dynamic module (a la plone.alterego) called 
plone.dexterity.schema.generated. You can look up the name of the schema 
within that module this way:

from plone.dexterity.utils import portalTypeToSchemaName
schema_name = portalTypeToSchemaName(portal_type, u'', portal_id)

(Or look at the code in plone.dexterity.utils...it is a pretty simple 
concatenation and encoding of those 3 arguments). I think it ends up 
something like plone.dexterity.schema.generated.myportal_0_myportaltype_0_


2. Export your schema as supermodel XML (using the button in the 
Dexterity types control panel). Put it in a file, and then load that 
file into your custom interface that you name yourself, like this:


from plone.directives import form, Schema

class IMyContent(Schema):
model('path/to/model.xml')

Then register the browser view for IMyContent.

(The downside to this one is that you can no longer modify the schema 
through the web.)


3. Write a behavior which adds a marker interface; then turn on that 
behavior for your content type and register your view for the marker 
interface.


4. Do it like in archetypes...create a view named mytype_view that's 
technically available for all Dexterity content, but only list it as an 
available layout in the FTI for your type. (Probably my least favorite 
of the options.)


David


--  
David Glick
Web Developer
davidgl...@groundwire.org
206.286.1235x32

Engagement technology for social and environmental change.

http://www.groundwire.org


___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] invariant validator for add form has no context?

2012-01-19 Thread David Glick (GW)

On Jan 19, 2012, at 5:38 AM, zjs2k wrote:

 Thanks for the quick reply and the explanation on getSite. I know it works
 but didn't know how it works.

 For my purpose, I actually need the container and to confirm their is no
 same content within that container. It is OK to have the same ones
 elsewhere. So the container context of an add form will work.

 The method z3c.form.field.FieldWidgets.validate set context to None before
 getting the validator. I wonder if it will harm anything to remove
 content=None. All I can see is that the validator will need to
 discriminate the context as container in an add form, instead of getting
 None as context.

If nothing else, you can use the approach described under Validating in action 
handlers at 
http://plone.org/products/dexterity/documentation/manual/schema-driven-forms/customising-form-behaviour/validation
 (this ties the validation more to the form than to the schema, but it sounds 
like this add form is a special case anyway).

You can also try aq_parent(request['PUBLISHED']) as a way to get the parent of 
the published object, which should be the container that the form is a view of 
in this case.

David


--
David Glick
 Web Developer
 davidgl...@groundwireconsulting.com
 206.286.1235x32

Groundwire Consulting is here.

http://groundwire.org/about/FAQ-gw-consulting


___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] Named vocabularies, dexterity, autocompletewidget...

2012-01-18 Thread David Glick (GW)

On Jan 18, 2012, at 3:56 AM, Paul Roeland wrote:

 for future reference, and to help others:

 - autocompletewidget requires an IQuerySource-providing object
 - that needs to have a 'search()' method
 - and then needs to be bound like this:

 class myfancySourceBinder(object):
implements(IContextSourceBinder)

def __call__(self, context):
return myfancySource(context)

 - then, use myfancySourceBinder() as the source for your
 AutocompleteFieldWidget or  AutocompleteMultiFieldWidget


 Providing a search() method on an IVocabularyFactory object directly
 does not work, or at least I found it impossible using grok.implements

It would need to be on the vocabulary returned by the vocabulary factory, not 
on the factory. I think.
David


--
David Glick
 Web Developer
 davidgl...@groundwireconsulting.com
 206.286.1235x32

Groundwire Consulting is here.

http://groundwire.org/about/FAQ-gw-consulting


___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] invariant validator for add form has no context?

2012-01-18 Thread David Glick

On 1/18/12 5:41 PM, zjs2k wrote:
I had the impression that one of the advantages of z3c.form.validators is the
access to context. That's true for SimpleFieldValidator, as demonstrated in
Martin Aspeli's Plone 4 book. So I assumed the same for InvariantsValidator.

But the dexterity add form sets ignoreContext to true. So when the form
trying to get the validator MultiAdapter, the context is set to None (see
z3c.form.field.FieldWidgets.validate). Is this the expected behavior?

What's the best way for full-form validation with access to context? One use
case is using First Name and Last Name fields. I would like to search
catalog to confirm no one has the same first/last name.

Should I override the save action handler of dexterity? Or write an event
handler for some form event like ObjectCreatedEvent? No idea about the edit
form event since ObjectModifiedEvent is after object modified.

Any suggestion will be greatly appreciated.

There is no context yet with an add form...it validates the schema before 
creating the item. But I suppose you just want the context in order to get to 
the catalog so you can do your search, right? In that case you can get it this 
way even though the invariant is not passed a 'context' variable:

from zope.site.hooks import getSite
from Products.CMFCore.utils import getToolByName

# later, in your validator...
catalog = getToolByName(getSite(), 'portal_catalog')

This approach depends on the fact that getSite() gives access to the portal as 
stored in a thread-local variable during traversal. So it will work as long as 
you're using it in code accessed via the web (i.e. most of the time) but not if 
you use it from a script run via bin/instance run...unless you take care to set 
up that thread-local yourself.

David



David Glick
Web Developer
davidgl...@groundwireconsulting.com
206.286.1235x32


http://groundwire.org/?utm_source=Groundwire.org%2BEmailutm_medium=Emailutm_campaign=Logo[https://s3.amazonaws.com/gw-logo/gwconsulting-logo-270-noclear.png]


Groundwire Consulting is here. Learn how and 
whyhttp://groundwire.org/about/FAQ-gw-consulting we are deepening our mission.


___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] GenericSetup: Upgrade dependencies?

2012-01-16 Thread David Glick

On 1/15/12 5:42 PM, Noe Nieto wrote:
I have a policy product which defines some dependencies. One of them 
is dexterity.


How do I fire up dexterity's upgrade steps from my own policy upgrade 
steps?
There unfortunately isn't any built-in support for that, as far as I 
know, but it's not too hard to do with a Python upgrade step. See the 
upgrade_product function in Megaphone's upgrade steps for an example: 
http://svn.plone.org/svn/collective/collective.megaphone/trunk/src/collective/megaphone/upgrades/__init__.py


David


--  
David Glick
Web Developer
davidgl...@groundwireconsulting.com
206.286.1235x32

Groundwire Consulting is here.

http://groundwire.org/about/FAQ-gw-consulting


___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] collective.z3cform.datagridfield + plone.app.relation.RelationList

2011-12-01 Thread David Glick

On 12/1/11 8:44 AM, Roel Bruggink wrote:
I'm using a datagridfield in which I have a schema with a RelationList 
[1].
When this form is saved the referenced objects are stored instead of a 
RelationValue.


Does anyone have an idea on how to fix this?


[1] http://pastie.org/2950299



Maybe related to http://code.google.com/p/dexterity/issues/detail?id=180 ?

If that helps we can merge Asko's patch, but I'd like to have some tests 
for it.


David


--  
David Glick
Web Developer
davidgl...@groundwireconsulting.com
206.286.1235x32

Groundwire Consulting is here.

http://groundwire.org/about/FAQ-gw-consulting


___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] Dexterity - hide content created by logged in user

2011-11-25 Thread David Glick

On 11/25/11 1:34 PM, Imran Azad wrote:

Hi,

I am using Dexterity and I would like to know how I can stop the users form
viewing or editing their own content. I was thinking if I can some how
customise the views for the view page and edit form I could redirect the
users to another page.

The best way is to give your content type a workflow that does not 
assign the Modify portal content permission to the Owner role.

David


--  
David Glick
Web Developer
davidgl...@groundwireconsulting.com
206.286.1235x32

Groundwire Consulting is here.

http://groundwire.org/about/FAQ-gw-consulting


___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] dexterity [newbie] : how to disable a Field widget

2011-11-13 Thread David Glick

On 11/12/11 2:49 PM, Asko Soukka wrote:

T. Kim Nguyen wrote:

Hi David - we've had that particular use case a few times here: we want to 
populate a student ID field but don't want the student to be able to change it, 
while a staff member filling out the object on behalf of the student might need 
to change it.

Hi,

can't this be achieved by using write_permission and read_permission
-form schema hints from plone.directives.form?

class MySchema(form.Schema):
form.write_permission(field1='some.staffonlypermission')
field1 = ...

That is also an option, but doesn't quite meet the use case that was 
described (if the user lacks the write permission and the form is in 
input mode, then the field will not show up at all, rather than showing 
up disabled).


Most of the z3c.form widgets appear to support a 'disabled' property; we 
just don't have a way to set it from a Dexterity model at this point. So 
one could do in a custom form:


def updateWidgets(self):
self.widgets['field1'].disabled = True

David


--  
David Glick
Web Developer
davidgl...@groundwireconsulting.com
206.286.1235x32

Groundwire Consulting is here.

http://groundwire.org/about/FAQ-gw-consulting


___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] dexterity [newbie] : how to disable a Field widget

2011-11-13 Thread David Glick

On 11/13/11 8:14 PM, Karl Johan Kleist wrote:

David Glick-3 wrote:

That is also an option, but doesn't quite meet the use case that was
described (if the user lacks the write permission and the form is in
input mode, then the field will not show up at all, rather than showing
up disabled).


Also if the user has read permission to the field? That's sort of silly
behavior, isn't it?

The write permission is checked if the field is in input mode, and the 
read permission is checked if the field is in display mode. Making it 
use the read permission and switch the mode to display if the write 
permission check fails might be reasonable.



--  
David Glick
Web Developer
davidgl...@groundwireconsulting.com
206.286.1235x32

Groundwire Consulting is here.

http://groundwire.org/about/FAQ-gw-consulting


___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] c.r.omelette release

2011-09-12 Thread David Glick

On 9/12/11 3:21 AM, Maurits van Rees wrote:

Op 08-09-11 17:08, Tom Gross schreef:

Hi David

I checked in a small fix for c.r.omelette

@
http://dev.plone.org/collective/changeset/244283/buildout/collective.recipe.omelette/trunk


The recipe didn't work, if used in a windows directory containing spaces.
Can you please cut a release.

David has meanwhile released 0.12.  Thanks!


And neglected to reply to list to say that I had done so, because I 
didn't notice that Tom's email had been addressed to a list. Sorry!

David


--  
David Glick
Web Developer
davidgl...@groundwire.org
206.286.1235x32

Online tools and strategies for the environmental movement. 


Sign up for our newsletter: http://www.groundwire.org/email-capture


___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] collective.recipe.backup: support for collective.recipe.filestorage checked in

2011-08-25 Thread David Glick

On 8/25/11 3:52 PM, Maurits van Rees wrote:

Hi,

Op 23-08-11 22:35, Karl Johan Kleist schreef:

It just occurred to me, that it's probably not very smart to use the get_fs()
helper function in restore_main(). We can probably not assume that the
filestorage file already exists. So I've restored the old code in
restore_main()

As you indicate here, this might need a bit more thinking, as now a
restore could place the filestorage in a wrong location.

Also, collective.recipe.filestorage offers more ways to name the
additional filestorages and I guess your current code only handles the
default location.  Fair enough, really, but I wonder if we can do better.

Also, it occured to me that these additional filestorages may come with
their own blobstorages (oh joy...).  That may need a bit of thinking too.

I haved moved your code to a new branch:
https://svn.plone.org/svn/collective/buildout/collective.recipe.backup/branches/kleist-recipe-filestorage

I have also reverted those changes on trunk.

Biggest reason is that this clears the way for merging back my long
overdue blobstorage backup support branch and do a release.  We can work
on collective.recipe.filestorage later.

Thanks for your contribution.

FWIW, the in-house backup script that we use with 
collective.recipe.filestorage reads zope.conf and/or zeo.conf to figure 
out what storages exist and where they are. It's pretty dumb about the 
parsing though; just some regexes.

David


--  
David Glick
Web Developer
davidgl...@groundwire.org
206.286.1235x32

Online tools and strategies for the environmental movement. 


Sign up for our newsletter: http://www.groundwire.org/email-capture


___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] location field on Dexterity based content types

2011-08-04 Thread David Glick

On 8/4/11 2:56 PM, Héctor Velarde wrote:

in Archetypes location is declared in ExtensibleMetadata.py as:

  # Location, also known as Coverage in the DC metadata standard,
but we
  # keep the term Location here for historical reasons.
  StringField(
  'location',
  # why no accessor? http://dev.plone.org/plone/ticket/6424
  searchable=True,
  widget = StringWidget(
  label = _(u'label_location', default=u'Location'),
  description=_(u'help_location_dc',
default=u'The geographical location
associated with the item, if applicable.'),
  ),
  ),

why this was not included in the standard IDublinCore behavior?

I honestly can't remember; it was probably an oversight. Do you think 
it's important to add it?


By the way, you might have more success asking Dexterity questions in 
the Dexterity google group: 
http://groups.google.com/group/dexterity-development


David


--  
David Glick
Web Developer
davidgl...@groundwire.org
206.286.1235x32

Online tools and strategies for the environmental movement. 


Sign up for our newsletter: http://www.groundwire.org/email-capture


___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] IObjectModifiedEvent, object modified or added?

2011-07-28 Thread David Glick

On 7/28/11 12:54 PM, Gilles Lenfant wrote:

Le 28 juil. 2011 à 16:15, imran.azad a écrit :


Hi,

How can I workout if an object has been 'modified' or whether it's a new
object within the IObjectModifiedEvent event? The issue is that
IObjectModifiedEvent is trigged even if an object is added. I need the code
below to execute only when an object is 'modified:

You could mark the creation in the request. I know this seems somehow overkill 
but, assuming the IObjectCreatedEvent comes first...

@grok.subscribe(IPerson, IObjectCreatedEvent)
def markCreationOnly(person, event):
 # Other stuffs ?
 request = person.REQUEST
 request.set('__created_person__', person.getPhysicalPath())


@grok.subscribe(IPerson, IObjectModifiedEvent)

def rename(person, event):

 request = person.REQUEST
created = request.get('__created_person__', False)
if created and person.getPhysicalPath() == created:
# Object created and modified
return


id = person.getId()
parent = person.aq_parent
parent.manage_renameObject(id, baseNormalize(person.title))

Thanks

Another possible approach would be to check if the item has a non-None 
_p_oid attribute. That should only be set if the object has been 
committed to the ZODB. (But test and make sure it works for your 
case...there may be other scenarios like if savepoints are used.)



--  
David Glick
Web Developer
davidgl...@groundwire.org
206.286.1235x32

Online tools and strategies for the environmental movement. 


Sign up for our newsletter: http://www.groundwire.org/email-capture


___
Product-Developers mailing list
product-develop...@lists.plone.org
https://lists.plone.org/mailman/listinfo/plone-product-developers


Re: [Product-Developers] Dexterity: ERROR Application Couldn't install Five

2011-04-18 Thread David Glick
Try in a clean virtualenv; the traceback involves some speech package from your 
global Python environment.

David Glick
Sent from my mobile
   In a time of inner rest
  Please forgive brevity

On Apr 17, 2011, at 11:50 PM, Héctor Velarde hector.vela...@gmail.com wrote:

 Ubuntu 10.10 and Plone 4.0.5; I'm trying to develop a Dexterity-based
 content type using:

 extends =
 http://dist.plone.org/release/4.0.5/versions.cfg
 http://good-py.appspot.com/release/dexterity/1.0b7?plone=4.0.5

 I get this error:

 2011-04-18T01:28:20 ERROR Application Couldn't install Five
 Traceback (most recent call last):
   File
 /usr/local/Plone/portalsg/eggs/Zope2-2.12.17-py2.6-linux-x86_64.egg/OFS/Application.py,
 line 671, in install_product
 initmethod(context)
   File
 /usr/local/Plone/portalsg/eggs/Zope2-2.12.17-py2.6-linux-x86_64.egg/Products/Five/__init__.py,
 line 31, in initialize
 zcml.load_site()
   File
 /usr/local/Plone/portalsg/eggs/Zope2-2.12.17-py2.6-linux-x86_64.egg/Products/Five/zcml.py,
 line 51, in load_site
 _context = xmlconfig.file(file)
   File
 /usr/local/Plone/portalsg/eggs/zope.configuration-3.6.0-py2.6.egg/zope/configuration/xmlconfig.py,
 line 647, in file
 include(context, name, package)
   File
 /usr/local/Plone/portalsg/eggs/zope.configuration-3.6.0-py2.6.egg/zope/configuration/xmlconfig.py,
 line 546, in include
 processxmlfile(f, context)
   File
 /usr/local/Plone/portalsg/eggs/zope.configuration-3.6.0-py2.6.egg/zope/configuration/xmlconfig.py,
 line 378, in processxmlfile
 parser.parse(src)
   File /usr/lib/python2.6/xml/sax/expatreader.py, line 107, in parse
 xmlreader.IncrementalParser.parse(self, source)
   File /usr/lib/python2.6/xml/sax/xmlreader.py, line 123, in parse
 self.feed(buffer)
   File /usr/lib/python2.6/xml/sax/expatreader.py, line 207, in feed
 self._parser.Parse(data, isFinal)
   File /usr/lib/python2.6/xml/sax/expatreader.py, line 349, in
 end_element_ns
 self._cont_handler.endElementNS(pair, None)
   File
 /usr/local/Plone/portalsg/eggs/zope.configuration-3.6.0-py2.6.egg/zope/configuration/xmlconfig.py,
 line 357, in endElementNS
 self.context.end()
   File
 /usr/local/Plone/portalsg/eggs/zope.configuration-3.6.0-py2.6.egg/zope/configuration/config.py,
 line 537, in end
 self.stack.pop().finish()
   File
 /usr/local/Plone/portalsg/eggs/zope.configuration-3.6.0-py2.6.egg/zope/configuration/config.py,
 line 685, in finish
 actions = self.handler(context, **args)
   File
 /usr/local/Plone/portalsg/eggs/Zope2-2.12.17-py2.6-linux-x86_64.egg/Products/Five/fiveconfigure.py,
 line 74, in loadProducts
 handleBrokenProduct(product)
   File
 /usr/local/Plone/portalsg/eggs/Zope2-2.12.17-py2.6-linux-x86_64.egg/Products/Five/fiveconfigure.py,
 line 72, in loadProducts
 xmlconfig.include(_context, zcml, package=product)
   File
 /usr/local/Plone/portalsg/eggs/zope.configuration-3.6.0-py2.6.egg/zope/configuration/xmlconfig.py,
 line 546, in include
 processxmlfile(f, context)
   File
 /usr/local/Plone/portalsg/eggs/zope.configuration-3.6.0-py2.6.egg/zope/configuration/xmlconfig.py,
 line 378, in processxmlfile
 parser.parse(src)
   File /usr/lib/python2.6/xml/sax/expatreader.py, line 107, in parse
 xmlreader.IncrementalParser.parse(self, source)
   File /usr/lib/python2.6/xml/sax/xmlreader.py, line 123, in parse
 self.feed(buffer)
   File /usr/lib/python2.6/xml/sax/expatreader.py, line 207, in feed
 self._parser.Parse(data, isFinal)
   File /usr/lib/python2.6/xml/sax/expatreader.py, line 349, in
 end_element_ns
 self._cont_handler.endElementNS(pair, None)
   File
 /usr/local/Plone/portalsg/eggs/zope.configuration-3.6.0-py2.6.egg/zope/configuration/xmlconfig.py,
 line 357, in endElementNS
 self.context.end()
   File
 /usr/local/Plone/portalsg/eggs/zope.configuration-3.6.0-py2.6.egg/zope/configuration/config.py,
 line 537, in end
 self.stack.pop().finish()
   File
 /usr/local/Plone/portalsg/eggs/zope.configuration-3.6.0-py2.6.egg/zope/configuration/config.py,
 line 685, in finish
 actions = self.handler(context, **args)
   File
 /usr/local/Plone/portalsg/eggs/z3c.autoinclude-0.3.4-py2.6.egg/z3c/autoinclude/zcml.py,
 line 104, in includePluginsDirective
 includeZCMLGroup(_context, info, filename)
   File
 /usr/local/Plone/portalsg/eggs/z3c.autoinclude-0.3.4-py2.6.egg/z3c/autoinclude/zcml.py,
 line 30, in includeZCMLGroup
 include(_context, filename, includable_package)
   File
 /usr/local/Plone/portalsg/eggs/zope.configuration-3.6.0-py2.6.egg/zope/configuration/xmlconfig.py,
 line 546, in include
 processxmlfile(f, context)
   File
 /usr/local/Plone/portalsg/eggs/zope.configuration-3.6.0-py2.6.egg/zope/configuration/xmlconfig.py,
 line 378, in processxmlfile
 parser.parse(src)
   File /usr/lib/python2.6/xml/sax/expatreader.py, line 107, in parse
 xmlreader.IncrementalParser.parse(self, source)
   File /usr/lib/python2.6/xml/sax/xmlreader.py, line 123, in parse

Re: [Product-Developers] Dexterity: ERROR Application Couldn't install Five

2011-04-18 Thread David Glick

On Apr 18, 2011, at 8:04 AM, Héctor Velarde hector.vela...@gmail.com wrote:

 I found this problem is fixed in zc.buildout version 1.5.2:
 https://bugs.launchpad.net/grok/+bug/603144

 is there any way to bootstrap Plone 4.0.x using this version or do I
 have to pin zc.buildout and upgrade it after bootstraping? it always
 downloads 1.4.4.

You must not be using an up-to-date bootstrap script.


--
David Glick
 Web Developer
 davidgl...@groundwire.org
 206.286.1235x32

Groundwire: You Are Connected
 http://groundwire.org

Online tools and strategies for the environmental movement.  Sign up for 
Groundwire News!
 http://groundwire.org/email-capture


___
Product-Developers mailing list
Product-Developers@lists.plone.org
https://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] setup.py releases (mkrelease), plone.org product listing and Plone 4 compatibility

2011-04-12 Thread David Glick

On 4/12/11 1:58 PM, Mikko Ohtamaa wrote:

Hi,

I found out that Web and Mobile does not appear in Download  Extend
listing.

http://plone.org/products/web-and-mobile

I suspect the reason is that

* The egg has been release using mkrelease

* The metadata for the release does not state Plone 4 compatibility, or
plone.org does not pick it up

All other packages say they are Plone 4 compatible. What do I need to in
order to announce Plone 4 compatibility with my package, but so that I can
still use automatic release tools?
I always make releases using jarn.mkrelease, then log into plone.org, 
edit the release and set the compatibility info. There isn't a way for 
this to get set automatically at this point.

David


--  
David Glick
Web Developer
davidgl...@groundwire.org
206.286.1235x32

Groundwire: You Are Connected   
http://groundwire.org   

Online tools and strategies for the environmental movement.  Sign up for 
Groundwire News!
http://groundwire.org/email-capture


___
Product-Developers mailing list
Product-Developers@lists.plone.org
https://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] Plone Crash Course

2011-03-16 Thread David Glick

On 3/16/11 10:31 AM, Alex Clark wrote:

On 3/14/11 8:09 PM, Dylan Jay wrote:

I think this whole thread raises a big documentation issue.
How is it that this question can still be asked? Where can we inject
documentation so there's no question that serious develop show be done
in the filesystem?

I know in the early days many developer friends being put off by
Plone/Zope being about unsource controlled, TTW code and I thought we'd
shaken that image :(


Although it kind of pains me to say this, I don't think we will be truly
rid of the problem (confusing TTW w/file system best practices) until we
have completely rid Plone of Zope2 (the good news is it will probably
happen within a few years; when I think it'll be at least reasonable to
expect moving Plone to the ZTK is possible).
Not sure what you mean about moving Plone to the ZTK. Plone 4.1 is 
already based on the ZTK. (And Plone 3 and 4 are based on its spiritual 
predecessor.)


If we really wanted to get rid of the ability to do TTW development, I 
think it would be fairly straightforward (but a fair amount of work) 
without moving away from Zope 2...just convert everything in 
portal_skins to browser views, and remove the portal_skins and 
portal_view_customizations tools.



--  
David Glick
Web Developer
davidgl...@groundwire.org
206.286.1235x32

Groundwire: You Are Connected   
http://groundwire.org   

Online tools and strategies for the environmental movement.  Sign up for 
Groundwire News!
http://groundwire.org/email-capture


___
Product-Developers mailing list
Product-Developers@lists.plone.org
https://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] IP auth

2011-01-05 Thread David Glick
On 1/5/11 8:20 AM, Alex Clark wrote:
 All,

 Happy New Year!

 This must be my lucky few months; I get to deploy every PAS plug-in ever 
 written in Time, it seems.

 I have a client that wants IP auth meaning that they want to allow 
 their clients to login to their Plone website via their IP address alone.

 Based on my experience with 
 http://pypi.python.org/pypi/Products.NoDuplicateLogin/1.0a1 (which is in 
 production but by all accounts a kludge) I'm thinking something that 
 uses: http://pypi.python.org/pypi/collective.beaker/1.0b2 this time around.

 Thoughts?
I don't understand why sessions need to be involved if you're
authenticating based on IP address.
David
--  
David Glick
 Web Developer
 davidgl...@groundwire.org
 206.286.1235x32

Groundwire: You Are Connected   
 http://groundwire.org  

Online tools and strategies for the environmental movement.  Sign up for 
Groundwire News!
 http://groundwire.org/email-capture

Check out our 2010 Website Benchmarks Report. How do you stack up?
 http://groundwire.org/resources/articles/2010-website-benchmarks-report

___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] Strange functional test error

2010-11-30 Thread David Glick
On 11/30/10 12:29 AM, Wichert Akkerman wrote:
 On 11/29/10 19:09 , David Glick wrote:
 On 11/29/10 4:59 AM, Wichert Akkerman wrote:
 In one project I am seeing a number of test failures that are very odd:

 Error in test runTest
 (euphorie.deployment.tests.functional.EuphorieFunctionalTestCase)
 Traceback (most recent call last):
 File
 /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/unittest.py,
 line 279, in run
   testMethod()
 TypeError: 'NoneType' object is not callable


 This appears to have once for every testmodule which imports my
 functional test base class. The class itself is really simple:

 class EuphorieFunctionalTestCase(PloneTestCase.FunctionalTestCase):
   layer = EuphorieLayer

   def adminBrowser(self):
   Return a browser logged in as the site owner.
   ...

 I'm afraid I have no idea why this happens. Has anyone seen this kind of
 behaviour before?
 Yes. This runTest method is added by
 Testing.ZopeTestCase.zopedoctest.functional.ZopeSuiteFactory's
 setup_test_class. So if you use a test class with one of the suites
 based on that (e.g. ZopeDocFileSuite, FunctionalDocFileSuite), and also
 try to use it with unittest autodiscovery, you'll get this error.  I
 worked around it by defining a separate test case class for my Zope
 doctest suites.
 Can you show us what your test case class looks like?
Nothing special about it; it just subclasses the main test case class
and passes --
http://svn.plone.org/svn/collective/collective.megaphone/trunk/src/collective/megaphone/tests/base.py
--  
David Glick
 Web Developer
 davidgl...@groundwire.org
 206.286.1235x32

Groundwire: You Are Connected   
 http://groundwire.org  

Online tools and strategies for the environmental movement.  Sign up for 
Groundwire News!
 http://groundwire.org/email-capture

Check out our 2010 Website Benchmarks Report. How do you stack up?
 http://groundwire.org/resources/articles/2010-website-benchmarks-report

___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] invokeFactory() failing on Plone 4 (PTC) but working on Plone 3

2010-11-22 Thread David Glick
On 11/22/10 2:44 AM, Eric Bréhault wrote:
 Thank you very much for this solution !!
 I spent hours trying to understand why my product was not setting up
 properly in my tests.
 Now I have moved installProduct call outside onsetup, it works fine.

 As it used to work when called from onsetup in Plone 3, it would
 probably a good thing to mention in the Plone 3 to Plone 4 upgrade
 guide.
Ah, interesting. I wonder if it could be made to not defer the call if
it is called from another deferred call. Please consider filing a Zope 2
bug at http://launchpad.net/zope2
David
--  
David Glick
 Web Developer
 davidgl...@groundwire.org
 206.286.1235x32

Groundwire: You Are Connected   
 http://groundwire.org  

Online tools and strategies for the environmental movement.  Sign up for 
Groundwire News!
 http://groundwire.org/email-capture

Check out our 2010 Website Benchmarks Report. How do you stack up?
 http://groundwire.org/resources/articles/2010-website-benchmarks-report

___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] invokeFactory() failing on Plone 4 (PTC) but working on Plone 3

2010-11-20 Thread David Glick
On 11/19/10 10:57 PM, Ross Patterson wrote:
 Andreas Jung li...@zopyx.com writes:

 Ross Patterson wrote:

 Your ZCML doesn't incldue five:registerPackage 
 Does not help after adding registerPackage:

 http://svn.plone.org/svn/collective/Products.EasyNewsletter/trunk/Products/EasyNewsletter/configure.zcml

 nor does your test setup
 call installProduct.
 installProduct() is of course called in the setup of the layer
 (see base.py).
 My bad, missed the installProduct.
installProduct is a deferred call just like setupPloneSite and your
setup_registration.  So when you call it from within setup_registration,
it adds the deferred function too late.  I think it'll work if you put
the installProduct line outside of setup_registration.

As for the five:registerPackage, you shouldn't need that since this
package is in the Products namespace.
--  
David Glick
 Web Developer
 davidgl...@groundwire.org
 206.286.1235x32

Groundwire: You Are Connected   
 http://groundwire.org  

Online tools and strategies for the environmental movement.  Sign up for 
Groundwire News!
 http://groundwire.org/email-capture

Check out our 2010 Website Benchmarks Report. How do you stack up?
 http://groundwire.org/resources/articles/2010-website-benchmarks-report

___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] invokeFactory() failing on Plone 4 (PTC) but working on Plone 3

2010-11-20 Thread David Glick
On 11/20/10 9:21 PM, product-developers@lists.plone.org wrote:
 David Glick wrote:
  On 11/19/10 10:57 PM, Ross Patterson wrote:
  Andreas Jung li...@zopyx.com writes:
 
  Ross Patterson wrote:
 
  Your ZCML doesn't incldue five:registerPackage
  Does not help after adding registerPackage:
 
 
 http://svn.plone.org/svn/collective/Products.EasyNewsletter/trunk/Products/EasyNewsletter/configure.zcml
 
  nor does your test setup
  call installProduct.
  installProduct() is of course called in the setup of the layer
  (see base.py).
  My bad, missed the installProduct.
  installProduct is a deferred call just like setupPloneSite and your
  setup_registration.  So when you call it from within setup_registration,
  it adds the deferred function too late.  I think it'll work if you put
  the installProduct line outside of setup_registration.

 Right - this works.

 Then this documentation is wrong - as it states to call installPackage()
 or installProduct() inside setup_registration().

 http://plone.org/documentation/manual/developer-manual/testing/writing-a-plonetestcase-unit-integration-test
It demonstrates calling installProduct outside of the @onsetup function,
and installPackage inside. That is correct.
David
--  
David Glick
 Web Developer
 davidgl...@groundwire.org
 206.286.1235x32

Groundwire: You Are Connected   
 http://groundwire.org  

Online tools and strategies for the environmental movement.  Sign up for 
Groundwire News!
 http://groundwire.org/email-capture

Check out our 2010 Website Benchmarks Report. How do you stack up?
 http://groundwire.org/resources/articles/2010-website-benchmarks-report

___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] invokeFactory() failing on Plone 4 (PTC) but working on Plone 3

2010-11-19 Thread David Glick
On 11/19/10 6:47 AM, Andreas Jung wrote:
 I have the following code for testing EasyNewsletter:

 http://svn.plone.org/svn/collective/Products.EasyNewsletter/trunk/Products/EasyNewsletter/tests/test_enl.py


 The invokeFactory('EasyNewsletter') call works on Plone 3
 but fails on Plone 4 with Unauthorized (although I am Manager):

 self.portal.invokeFactory('EasyNewsletter', id='newsletter')
   File
 /home/ajung/.buildout/eggs/Products.CMFCore-2.2.2-py2.6.egg/Products/CMFCore/PortalFolder.py,
 line 295, in invokeFactory
 return pt.constructContent(type_name, self, id, RESPONSE, *args, **kw)
   File
 /home/ajung/.buildout/eggs/Products.CMFCore-2.2.2-py2.6.egg/Products/CMFCore/TypesTool.py,
 line 836, in constructContent
 ob = info.constructInstance(container, id, *args, **kw)
   File
 /home/ajung/.buildout/eggs/Products.CMFCore-2.2.2-py2.6.egg/Products/CMFCore/TypesTool.py,
 line 312, in constructInstance
 raise AccessControl_Unauthorized('Cannot create %s' % self.getId())
 Unauthorized: Cannot create EasyNewsletter


 Digging deeper using pdb:


 /home/ajung/.buildout/eggs/Products.CMFCore-2.2.2-py2.6.egg/Products/CMFCore/TypesTool.py(472)_queryFactoryMethod()
 - def _queryFactoryMethod(self, container, default=None):
 (Pdb) n

 /home/ajung/.buildout/eggs/Products.CMFCore-2.2.2-py2.6.egg/Products/CMFCore/TypesTool.py(474)_queryFactoryMethod()
 - if not self.product or not self.factory or container is None:
 (Pdb)

 /home/ajung/.buildout/eggs/Products.CMFCore-2.2.2-py2.6.egg/Products/CMFCore/TypesTool.py(478)_queryFactoryMethod()
 - dispatcher = getattr(container, 'manage_addProduct', None)
 (Pdb)

 /home/ajung/.buildout/eggs/Products.CMFCore-2.2.2-py2.6.egg/Products/CMFCore/TypesTool.py(480)_queryFactoryMethod()
 - if dispatcher is None:
 (Pdb)

 /home/ajung/.buildout/eggs/Products.CMFCore-2.2.2-py2.6.egg/Products/CMFCore/TypesTool.py(483)_queryFactoryMethod()
 - try:
 (Pdb)

 /home/ajung/.buildout/eggs/Products.CMFCore-2.2.2-py2.6.egg/Products/CMFCore/TypesTool.py(484)_queryFactoryMethod()
 - p = dispatcher[self.product]
 (Pdb)

 /home/ajung/.buildout/eggs/Products.CMFCore-2.2.2-py2.6.egg/Products/CMFCore/TypesTool.py(489)_queryFactoryMethod()
 - m = getattr(p, self.factory, None)
 (Pdb) print dispatcher
 App.FactoryDispatcher.ProductDispatcher object at 0x196f190
 (Pdb) print self.factory
 addEasyNewsletter
 (Pdb) n

 /home/ajung/.buildout/eggs/Products.CMFCore-2.2.2-py2.6.egg/Products/CMFCore/TypesTool.py(491)_queryFactoryMethod()
 - if m:
 (Pdb) print m
 None

 Why does this fail on Plone 4?
Not sure why, but I would guess EasyNewsletter's initialize method isn't
getting called in your test setup for some reason.
David
--  
David Glick
 Web Developer
 davidgl...@groundwire.org
 206.286.1235x32

Groundwire: You Are Connected   
 http://groundwire.org  

Online tools and strategies for the environmental movement.  Sign up for 
Groundwire News!
 http://groundwire.org/email-capture

Check out our 2010 Website Benchmarks Report. How do you stack up?
 http://groundwire.org/resources/articles/2010-website-benchmarks-report

___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] Dexterity and Images

2010-11-15 Thread David Glick
Uh, no. plone.app.imaging contains an image scale view for Archetypes content.  
The one for Dexterity content is in plone.namedfile.  Both are used similarly 
(via the @@images view) and are based on plone.scale.

On 11/15/10 10:09 AM, Noe Misael Nieto Arroyo wrote:
Just for the record:

All the image functionality is being moved to plone.app.imaging.

---
Noe

2010/11/3 Héctor Velarde 
hector.vela...@gmail.commailto:hector.vela...@gmail.com
take a look at this, Noe: http://code.google.com/p/dexterity/issues/detail?id=72

best regards


___
Product-Developers mailing list
Product-Developers@lists.plone.orgmailto:Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers




David Glick
Web Developer
davidgl...@groundwire.org
206.286.1235x32


[http://gw-logo.s3.amazonaws.com/groundwire-logo-270-noclear.png]http://groundwire.org/?utm_source=Groundwire.org%2BEmailutm_medium=Emailutm_campaign=Logo


Online tools and strategies for the environmental movement.  Sign up for 
Groundwire 
Newshttp://groundwire.org/email-capture?utm_source=Groundwire.org-emailutm_medium=Emailutm_content=news-signuputm_campaign=email-signature!

Check out our 2010 Website Benchmarks 
Reporthttp://groundwire.org/resources/articles/2010-website-benchmarks-report?utm_source=groundwire.org-emailutm_medium=emailutm_content=2010-webstats-reportutm_campaign=2010-webstats-report
  Real-world website stats from 43 environmental organizations.  How do you 
stack up?


___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] Dexterity and Images

2010-11-15 Thread David Glick
On 11/15/10 10:38 AM, Noe Misael Nieto Arroyo wrote:

 Oh, that's right.

 I was wondering... does plone.scale scale images on the fly or it
 stores some scaled copy on ZODB ?
Well, plone.scale is just a library for performing scaling; it doesn't
care how the scales are stored.  plone.app.imaging and plone.namedfile
both use it to generate scales on demand, and then store them in an
annotation in the ZODB.
--  
David Glick
 Web Developer
 davidgl...@groundwire.org
 206.286.1235x32

Groundwire: You Are Connected   
 http://groundwire.org  

Online tools and stratgies for the environmental movement.  Sign up for 
Groundwire News!
 http://groundwire.org/email-capture

Check out our 2010 Website Benchmarks Report. How do you stack up?
 http://groundwire.org/resources/articles/2010-website-benchmarks-report

___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] plone3_theme template and Plone 4.0.1

2010-11-12 Thread David Glick
On 11/12/10 11:37 AM, Gilles Lenfant wrote:
 Hi,

 I have the latest ZopeSkel and making a minimal theme for Plone 4.0.1 does 
 not work. Means that the css registry provides empty style sheets on URLs 
 like http://my-site/portal_css/My%20Theme/base.css and all other 
 stylesheets .

 Is something missing or is the issue in my tired brain.

 PS : I'm not a theming guru, speak slowly
You probably need to update the skin-path node in skins.xml to say
based-on=Plone Classic Theme or based-on=Sunburst Theme so that it
uses the CSS layer from one of those themes.  The ZopeSkel template
bases on Plone Default by default, which has empty CSS files in Plone 4
(intended to be useful when applying a theme using xdv).

http://plone.org/documentation/manual/upgrade-guide/version/upgrading-plone-3-x-to-4.0/updating-add-on-products-for-plone-4.0/updating-plone-3-themes-for-plone-4
has some more info which may be useful.

David
--  
David Glick
 Web Developer
 davidgl...@groundwire.org
 206.286.1235x32

Groundwire: You Are Connected   
 http://groundwire.org  

Online tools and stratgies for the environmental movement.  Sign up for 
Groundwire News!
 http://groundwire.org/email-capture

Check out our 2010 Website Benchmarks Report. How do you stack up?
 http://groundwire.org/resources/articles/2010-website-benchmarks-report

___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] Plone 4 and Products.PloneHelpCenter-3.0b3

2010-10-11 Thread David Glick
On 10/11/10 10:46 AM, Noe Misael Nieto Arroyo wrote:
Hi all,

I wanted to update the old python.org.mxhttp://python.org.mx to plone4 (right 
now is offline , sorry).

We used PloneHelpCenter for some documentation so I wanted to see if it would 
work with Plone 4, but I've got no easy success.

There is no PHC release compatible with Plone 4 yet.  plone.org is using a 
checkout from trunk for the time being.
David
David Glick
Web Developer
davidgl...@groundwire.org
206.286.1235x32

[http://gw-logo.s3.amazonaws.com/groundwire-logo-270-noclear.png]http://groundwire.org/?utm_source=Groundwire.org%2BEmailutm_medium=Emailutm_campaign=Logo

We're celebrating 15 years!  Come to our big 
partyhttp://groundwire.org/events/groundwires-15th-anniversary-party?utm_source=Groundwire.org-emailutm_medium=Emailutm_content=15th-anniversary-partyutm_campaign=email-signature.


___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] Plone 4 Data.fs Corruption: Error Value: type object 'IRegistry' has no attribute '__iro__'

2010-10-08 Thread David Glick
 On 10/8/10 2:10 PM, AnttiS wrote:
 Hi, 

 I am having severe problems with trying to restore my database on my Plone 4
 buildout. I have restored Data.fs AND blobstorage. 

 The error message is the following:

   File
 /home/develop/v_test/buildout/eggs/zope.interface-3.5.3-py2.6-linux-i686.egg/zope/interface/adapter.py,
 line 470, in add_extendor
 for i in provided.__iro__:
 AttributeError: type object 'IRegistry' has no attribute '__iro__'
 2010-10-08 15:01:12 ERROR Zope.SiteErrorLog 1286571672.40.38014754817
 http://localhost:8080/test
 Traceback (innermost last):
   Module ZPublisher.Publish, line 116, in publish
   Module ZPublisher.BaseRequest, line 434, in traverse
   Module ZPublisher.BeforeTraverse, line 99, in __call__
   Module Products.CMFCore.PortalObject, line 78, in
 __before_publishing_traverse__
   Module zope.event, line 23, in notify
   Module zope.component.event, line 26, in dispatch
   Module zope.component._api, line 138, in subscribers
   Module zope.component.registry, line 323, in subscribers
   Module zope.interface.adapter, line 575, in subscribers
   Module zope.component.event, line 33, in objectEventNotify
   Module zope.component._api, line 138, in subscribers
   Module zope.component.registry, line 323, in subscribers
   Module zope.interface.adapter, line 575, in subscribers
   Module plone.browserlayer.layer, line 10, in mark_layer
   Module zope.component._api, line 181, in getAllUtilitiesRegisteredFor
   Module zope.component.registry, line 178, in getAllUtilitiesRegisteredFor
   Module ZODB.Connection, line 838, in setstate
   Module ZODB.Connection, line 906, in _setstate
   Module ZODB.serialize, line 630, in setGhostState
   Module zope.component.persistentregistry, line 42, in __setstate__
   Module zope.interface.adapter, line 85, in _createLookup
   Module zope.interface.adapter, line 429, in __init__
   Module zope.interface.adapter, line 466, in init_extendors
   Module zope.interface.adapter, line 470, in add_extendor
 AttributeError: type object 'IRegistry' has no attribute '__iro__'
Sounds like you had plone.app.registry installed at one point (maybe as
a dependency of something else), but not currently.  But you still have
something registered for one of its interfaces in your database.  I
would guess that reinstalling plone.app.registry might help.

In general, you can't restore a Plone backup if it has references to
Python code that is no longer present on disk because of removing products.

David
--  
David Glick
 Web Developer
 davidgl...@groundwire.org
 206.286.1235x32

Groundwire: You Are Connected   
 http://groundwire.org  

We're celebrating 15 years! Come to our big party.
 http://groundwire.org/events/groundwires-15th-anniversary-party
___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] is it okay to create a new product in the collective.megaphone namespace?

2010-09-20 Thread David Glick


On Sep 20, 2010, at 4:01 AM, Raphael Ritz r.r...@biologie.hu-berlin.de wrote:

 Kees Hink wrote:
 In order to use Products.sqlpfgadapter [1] with collective.megaphone, some
 additional (zcml) setup is needed that i'd like to keep in a separate 
 product.

 I'd like to use the collective.megaphone namespace [2],
 collective.megaphone.sqlstorage seems a good name for the product. Would 
 you
 agree?

 As far as I understand http://www.python.org/dev/peps/pep-0382/
 and setuptools and friends you cannot do that since
 collective.megaphone is already defined as non-namespace package.

As far as setuptools goes you can do it as long as all of the packages only 
have the namespace initialization boilerplate in their __init__.py. But I tried 
to set up collective.megaphone like this (for another add-on), and was running 
into problems loading the ZCML from the correct place. So I don't think it will 
work reliably.

I ended up naming my package/distribution collective.megaphonecicerolookup


 As others suggested before consider something like
 collective.megaphonesql


+1


--
David Glick
 Web Developer
  davidgl...@groundwire.org
  206.286.1235x32

Groundwire: You Are Connected
 http://groundwire.org
___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] plan for easy MySQL storage for collective.megaphone

2010-09-01 Thread David Glick
 On 9/1/10 12:00 AM, Dylan Jay wrote:


 We recently had to create a PFG action adapter that could store large
 numbers of records in the ZODB and retrieve efficiently using
 different indexes. We might rewrite it and release it so it could be a
 drop in replacement for any PFG form.


That sounds useful. Did you use collective.soup or something custom for
storage/indexing?


 We might rewrite it and release it so it could be a drop in
 replacement for any PFG form. If so we'd love it this SQL PFG action
 adapter was SQL agnostic in its api so we and others could use these
 two adapters interchangeably.


Is there a more specific interface that needs to be implemented to
ensure this, beyond the basic PFG action adapter contract (provide an
onSuccess method that does something with form fields) ?


David Glick
Web Developer
davidgl...@groundwire.org
206.286.1235x32

[http://gw-logo.s3.amazonaws.com/groundwire-logo-270-noclear.png]http://groundwire.org/?utm_source=Groundwire.org%2BEmailutm_medium=Emailutm_campaign=Logo

Sign up for Groundwire 
News!http://groundwire.org/email-capture?utm_source=Groundwire.org-emailutm_medium=Emailutm_content=Sign-up-for-groundwire-newsutm_campaign=email-signature


___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] plan for easy MySQL storage for collective.megaphone

2010-08-31 Thread David Glick
 On 8/31/10 2:24 AM, Kees Hink wrote:
 A question for collective.megaphone developers:

 A client of ours wants to store collective.megaphone data in a MySQL database.
 One could do this by following the steps at
 http://plone.org/products/ploneformgen/documentation/tutorial/sql-crud/tutorial-all-pages.
 That's a lot of manual work, and it requires some ZMI/MySQL knowledge [1]. It
 would be nice to enable editors to create an Action Letter with a MySQL
 extension using the wizard.

 I'd like to create either some kind of extension to collective.megaphone 
 itself
 or a separate add-on product, which will do the following:
 * on installation/activation, a create Z MySQl database connection is 
 created
   - host, username, database are supplied by admin user at this moment
 * When an Action Letter is created, the user can checks the box that says 
 Save
 also to MySQL database. If checked, this happens:
   - a table is created (name derived from the Action Letter's id)
 + add columns for all form fields are added
 + maybe later allow users to select which fields are added
 + maybe later allow updates when fields have changed
   - a Z MySQL Method for storing is added
 + maybe later add other Z MySQL Methods
   - this method will be called after saving the form
 + for example, an after-validation script calling this method
 * each time an Action letter is deleted, its table is deleted

 What i'd like to know:
 * Are there currently solutions available that i may have missed?
Not that I'm aware of (but I haven't looked).  Massimo Azzolini from Red
Turtle also recently expressed interest in something like this.
 * Is it feasible to do this in collective.megaphone? If I created a branch,
 would someone be willing to merge it if the quality is good?
 * Or is this out of scope, and/or are there reasons why a separate package is
 better suited for this than collective.megaphone?
I would rather see this as a separate package which provides an
additional wizard step for Megaphone.  In Megaphone = 2.0b1 (e.g.
current trunk), the MegaphoneActionWizard class has a dynamic 'steps'
property which returns the list of steps to be included in the wizard. 
We should modify this to do an adapter lookup to a new
IMegaphoneWizardStep interface we define, so that a separate package can
supply an additional step.  I would be happy to merge a branch
implementing that adapter lookup in order to make it possible to create
the MySQL integration as a separate add-on.
 [1] Also, I'm currently pondering about a way to use _two_ after-validation
 scripts: collective.megaphone has one already filled in
 (here/@@recipient_multiplexer), which i currently replace with my Z MySQL 
 Method.
You should probably instead create a PloneFormGen action adapter, and
call your Z MySQL method from its onSuccess method.  If you do this, the
recipient multiplexer will ensure that it is called once for each
selected recipient (with different values in the request form each time):
- mark the action adapter with
collective.megaphone.recipient_multiplexer.IMultiplexedActionAdapter
- *don't* enable the action adapter as one normally does in PloneFormGen
(then it will get run directly by PFG instead of via the recipient
multiplexer)
- set the execCondition of the adapter to python:True (this is how the
multiplexer tells whether it is enabled or not)

David
--  
David Glick
 Web Developer
 davidgl...@groundwire.org
 206.286.1235x32

Groundwire: You Are Connected   
 http://groundwire.org  
___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] plone.app.registry and Plone 4 rc1

2010-08-23 Thread David Glick
On 8/23/10 6:11 PM, Noe Misael Nieto Arroyo wrote:
 Hi all,

 I was trying to add a control panel for a custom theme using
 plone.app.registry and this nice
 guide: 
 http://plone.org/documentation/kb/how-to-create-a-plone-control-panel-with-plone.app.registry

 But I get a get a version conflict error during buildout:

 tzic...@hormiga-negra:~/Documentos/programar/iservices/vdubmx$
 bin/buildout 
 mr.developer: Queued 'p4a.videoembed' for checkout.
 mr.developer: Skipped checkout of existing package 'p4a.videoembed'.
 Develop:
 '/home/tzicatl/Documentos/programar/iservices/vdubmx/src/p4a.videoembed'
 install_dir
 /home/tzicatl/Documentos/programar/iservices/vdubmx/develop-eggs/tmpfj0WiMbuild
 Develop:
 '/home/tzicatl/Documentos/programar/iservices/vdubmx/src/iservicestheme.vdubmx'
 install_dir
 /home/tzicatl/Documentos/programar/iservices/vdubmx/develop-eggs/tmpKngfmubuild
 Develop:
 '/home/tzicatl/Documentos/programar/iservices/vdubmx/src/nmd.plonelinkasvideoembed-0.5.1'
 install_dir
 /home/tzicatl/Documentos/programar/iservices/vdubmx/develop-eggs/tmpwdL0avbuild
 Updating _mr.developer.
 Updating instance.
 While:
   Updating instance.
 Error: There is a version conflict.
 We already have: zope.schema 3.5.4
 but z3c.form 2.4.1 requires 'zope.schema=3.6.0'.

 Is there a way to use plone.app.registry with the default versions
 provided by stock Plone-4rc1 versions.cfg?
You must extend the plone.app.registry Known Good Set as constrained by
the Plone 4.0rc1 platform on good-py:

[buildout]
extends =
http://good-py.appspot.com/release/plone.app.registry/1.0b2?plone=4.0rc1

David
--  
David Glick
 Web Developer
 davidgl...@groundwire.org
 206.286.1235x32

Groundwire: You Are Connected   
 http://groundwire.org  
___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] A better PloneFormGen save data adapter

2010-07-23 Thread David Glick
On 7/23/10 9:20 AM, Nathan Van Gheem wrote:
Hello All,

I'm interested in writing a save data adapter for ploneformgen that saves the 
data to an actual content type. It'd just take the fields from the ploneformgen 
form for it's schema. I find that in some cases, a user just wants a persistent 
form and it seems foolish to write a packaged content type for each one.

The advantages being:

 *   can use collections to query results if some of the dublin core meta data 
is available
 *   can apply placeful workflows to content type
 *   users can comment on form
 *   easier to manage data after

One possible snag is if a user removes a field or renames it, there might be 
data loss.

I'm posting this here because I'm interested in hearing what others think of 
the idea, if it's already done, or if I'm just being foolish before I write a 
product for it.
A dexterity content type, you mean?

I've wanted to do something like this for a long time, but haven't found time 
to work on it.  Probably partly because I've been envisioning doing it by 
creating a next-generation PloneFormGen that's built around the Dexterity 
schema editor, so that we don't have to translate from one type of schema to 
another.

David
David Glick
Web Developer
davidgl...@groundwire.org
206.286.1235x32

[http://gw-logo.s3.amazonaws.com/groundwire-logo-270-noclear.png]http://groundwire.org/?utm_source=Groundwire.org%2BEmailutm_medium=Emailutm_campaign=Logo

Sign up for Groundwire 
News!http://groundwire.org/email-capture?utm_source=Groundwire.org-emailutm_medium=Emailutm_content=Sign-up-for-groundwire-newsutm_campaign=email-signature
  Tips, tools and news delivered directly to your inbox.  
http://groundwire.org/email-capture?utm_source=Groundwire.org-emailutm_medium=Emailutm_content=Sign-up-for-groundwire-newsutm_campaign=email-signature


___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] Catalog a calculated metadata

2010-06-23 Thread David Glick
On Jun 23, 2010, at 8:07 AM, Luciano Pacheco wrote:

On Wed, Jun 23, 2010 at 11:26 AM, David Glick 
davidgl...@groundwire.orgmailto:davidgl...@groundwire.org wrote:
On Jun 23, 2010, at 5:14 AM, Luciano Pacheco wrote:

 Hi all,

 Since February out from Plone community, last month I came back work with 
 Plone to Brazilian government.

 I did a new catalog for some expensive values and I want to catalog as a 
 metadata a set of calculated values.

 The main question is: I want to code a function that can operates on the 
 object, like which I can do with the registerIndexableAttribute to indexes.

 The dumb way is add at runtime a new method to the desired content type 
 (PloneArticle in my case).

 Any ideas ?

In Plone 3.3+ you can use a custom indexer adapter (see plone.indexer)
David

David,

But I need the metadata, not a index.

I'm at a Plone 3.1.7

I read:
http://plonemanual.twinapex.fi/searching_and_indexing/catalog.html
http://plonemanual.twinapex.fi/searching_and_indexing/indexing.html#custom-index-methods

I believe index values and metadata values are both obtained the same way, via 
a wrapper that takes into account the indexers (or methods registered via 
registerIndexableAttribute in Plone  3.3).  Did you try it?
David
David Glick
Web Developer
davidgl...@groundwire.org
206.286.1235x32

[http://gw-logo.s3.amazonaws.com/groundwire-logo-270-noclear.png]http://groundwire.org/?utm_source=Groundwire.org%2BEmailutm_medium=Emailutm_campaign=Logo

Sign up for Groundwire 
News!http://groundwire.org/email-capture?utm_source=Groundwire.org-emailutm_medium=Emailutm_content=Sign-up-for-groundwire-newsutm_campaign=email-signature
  Tips, tools and news delivered directly to your inbox.  
http://groundwire.org/email-capture?utm_source=Groundwire.org-emailutm_medium=Emailutm_content=Sign-up-for-groundwire-newsutm_campaign=email-signature


___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


[Product-Developers] translating plural forms

2010-06-23 Thread David Glick
zope.i18n still doesn't have any good way of handling translations for plural 
forms, does it? (e.g. 1 person vs. 2 people where the number is variable)
David
--
David Glick
 Web Developer
  davidgl...@groundwire.org
  206.286.1235x32

Groundwire: You Are Connected
 http://groundwire.org
___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] how to remove viewlets in uninstall profile?

2010-06-10 Thread David Glick
On 6/10/10 7:29 AM, Kees Hink wrote:
 i would think that this profiles/default/viewlets.xml:
 ?xml version=1.0?
 object
   order
   manager=plone.portalfooter
   skinname=*
   
 viewlet
 name=doormat.footer
 remove=True
 /
   /order
 /object

 would do the job. No such luck, however. I've tried some variations, like 
 using
 purge instead of remove, appending it to other XML nodes as well, but it
 still doesn't remove the viewlet.
   
Remember that viewlets.xml doesn't actually control whether a viewlet is
registered or not; it only adjusts the order and can hide/unhide
viewlets.  But registration happens in ZCML.  If you want your viewlet
to only show up when your product is installed, register it for a
browser layer that is installed by your product and removed when it it
is uninstalled.
David

--
David Glick
Web Developer
Groundwire
206.286.1235x32
davidgl...@groundwire.org
http://groundwire.org

Sign up for Groundwire News!  
 Tips, tools and news delivered directly to your inbox.
 http://groundwire.org/news-signup


___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] Email confirmation support in PloneFormGen?

2010-04-22 Thread David Glick
There's also a little nonce manager I coded up at
http://svn.plone.org/svn/collective/collective.salesforce.profilemanager/trunk/collective/salesforce/profilemanager/nonce.py
(in a package which is otherwise a throwaway experiment to provide some
helper methods for doing something like what Maurits was proposing)
which uses a copy of the function PasswordResetTool uses to generate
nonces. (These days we should probably use uuid.uuid4() though,
instead.) Example usage in interfaces.py.

On 4/22/10 8:23 AM, Steve McMahon wrote:
 And, if we're looking for places to poach code, Listen has e-mail
 confirmation built in. Perhaps it could be generalized to be useful
 for anything that needs a double opt-in.

 On Thu, Apr 22, 2010 at 5:28 AM, David Hostetler
 negative...@gmail.com mailto:negative...@gmail.com wrote:

 PlonePoPoll tracks user participation in order to ensure one vote
 per user.

 And PloneSurvey similarly manages information per user, as
 persistent data (allowing for multiple form 'saves' prior to
 submission).

 Obviously that's not the email side of the equation, but they may
 have some pieces worth poaching.


 regards,

 -David



 On Wed, Apr 21, 2010 at 17:55, Maurits van Rees
 m.van.r...@zestsoftware.nl mailto:m.van.r...@zestsoftware.nl
 wrote:

 Hi,

 I've got an idea for an addition to PloneFormGen (in a separate
 package).  To avoid reinventing the wheel I wonder if the
 following has
 been done already.  Summary: can you do email confirmation,
 also known
 as double-opt-in, in PloneFormGen?

 The idea would be like this:

 - You create a form where you subscribe with your email
 address to a
 news letter.  Or the form allows you to for example fill in a
 poll, and
 you want to allow only one entry per person (simplified as one
 entry per
 email address).

 -  PloneFormGen should then store this address (plus possibly
 other
 fields) *provisionally*, probably just by setting a server
 side field
 pending=True or confirmed=False.

 - Any code that wants to get the list of subscribers or of
 valid poll
 entries can filter out the not yet confirmed ones by checking
 the value
 of that pending or confirmed field.

 - PFG should create and store a secret comparable to what the
 PasswordResetTool does; possibly we can simply use the id that
 is used
 to store the data in the BTree.

 - We send out an email to the given address, with the
 generated secret
 and a link that allows the user to confirm his subscription or
 confirm
 his entry in the poll.

 - The link probably points to the same form; a few conditions
 on fields
 can work nicely here.  But possibly we need a separate form
 here that
 knows how to get and set the saved data in the other form,
 though that
 sounds like a bad idea.


 Most of this can be done with standard PloneFormGen.  And I
 have some
 ideas for the missing pieces.  But has anyone done something
 similar?
 And is that available as package on pypi or plone.org
 http://plone.org?

 Thanks,

 Maurits van Rees
 (who should come up with a proper email signature again after
 having
 switched to Mac, probably pointing to http://zestsoftware.nl/ and
 possibly saying something profound and/or funny, so I guess
 this fits
 the bill...)

 ___
 Product-Developers mailing list
 Product-Developers@lists.plone.org
 mailto:Product-Developers@lists.plone.org
 http://lists.plone.org/mailman/listinfo/product-developers



 ___
 Product-Developers mailing list
 Product-Developers@lists.plone.org
 mailto:Product-Developers@lists.plone.org
 http://lists.plone.org/mailman/listinfo/product-developers



 ___
 Product-Developers mailing list
 Product-Developers@lists.plone.org
 http://lists.plone.org/mailman/listinfo/product-developers
   


--
David Glick
Web Developer
Groundwire
206.286.1235x32
davidgl...@groundwire.org
http://groundwire.org

Sign up for Groundwire News!  
 Tips, tools and tricks delivered directly to your inbox.
 http://groundwire.org/news-signup


___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] plone.app.jquerytools and overlays for forms not using AJAX

2010-04-11 Thread David Glick
On 4/11/10 6:29 PM, Martin Aspeli wrote:
 Hi,

 We want to use a p.a.jquerytools-like overlay for a confirm screen
 on a complex form. The user configures a product to buy on a bespoke
 form, and then clicks Buy. At this point, we need to overlay a
 confirm dialogue. This needs to show a few bits of dynamic information
 (which can be calculated in JavaScript) and give a few options (e.g.
 would you also like to buy type recommendations), before clicking OK
 or Cancel. Cancel would close the overlay. OK would submit the
 underlying form where the user has configured the product they are
 purchasing.

 The crucial thing here is that the form is not a standalone view. It's
 client-side only.

 Are there any examples/docs for doing this kind of thing?
   
Sure, plone.app.jquerytools is just using the JQuery Tools overlay,
which can do things other than load via AJAX, and which has a decent API
documented at http://flowplayer.org/tools/overlay.html   I think you
could create a dummy target node on page load, and then use the
overlay's onBeforeLoad callback to populate that node with what you need
in the overlay.
David

--
David Glick
Web Developer
Groundwire
206.286.1235x32
davidgl...@groundwire.org
http://groundwire.org

ONE/Northwest is now Groundwire!

___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] Re: z3c.form widget traversal and validation

2010-03-05 Thread David Glick
On 3/4/10 11:40 PM, Laurent Mignon wrote:
 I've the same kind of issue in my application. The 'workaround' used
 is to specifically mark the request during traversal request and play
 with security iin the update method only if  the request is not marked
 as used into the traversal conext:
Thanks, but in my case the problem is not simply that security checks
are happening that I want to bypass in widget traversal.  My problem is
that I need to know the current user in order to determine what data is
being edited by the form.

David

--
David Glick
Web Developer
Groundwire
206.286.1235x32
davidgl...@groundwire.org
http://groundwire.org

ONE/Northwest is now Groundwire!

___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


[Product-Developers] z3c.form widget traversal and validation

2010-03-04 Thread David Glick
I have a z3c.form form that overrides its getContent method based on a
property of the current authenticated member.  That is, the data being
edited by the form depends on which user is logged in.

This form also has a NamedImage field (from plone.namedfile), which
displays a preview of the current image by traversing to ++widget++logo
on the form (logo is the name of the field).

But this doesn't work in this case, because in order to traverse to a
widget, the code that handles this traversal (in
plone.z3cform.traversal) must call the form's update method, which in
turn calls updateWidgets.  But update also relies on being able to get
the form's data, so it calls getContent, which fails because there is no
authenticated member yet, since authentication happens after traversal.

Any ideas about how I can get out of this pickle?

thanks,
David

--
David Glick
Web Developer
Groundwire
206.286.1235x32
davidgl...@groundwire.org
http://groundwire.org

ONE/Northwest is now Groundwire!

___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] Re: Correct way to use paster with buildout?

2010-02-11 Thread David Glick

Alex Clark wrote:

On 2010-02-11, Mikko Ohtamaa mikko+pl...@redinnovation.com wrote:
  

Hi,

What's the correct way to use paster with buildout (not universal installer
based)?



Good question, isn't it just:

  setup_requires=[PasteScript],
  paster_plugins=[ZopeSkel],

?

I'm not sure what install_requires has to do with it
  
I have always had trouble with this ZopeSkel paster_plugin when I add 
dependencies to my product using install_requires -- buildout ends up 
trying to install the dependencies within my development egg, rather 
than where they're supposed to go, and ends up getting confused.  So I 
always just delete the ZopeSkel paster_plugin. I'm not sure what it's 
there for.

David

--
David Glick
Web Developer
Groundwire
206.286.1235x32
davidgl...@groundwire.org
http://groundwire.org

ONE/Northwest is now Groundwire!

___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] MemberData.getPassword() not working in Plone3?

2010-02-02 Thread David Glick

Guido A.J. Stevens wrote:

Hi all,

I'm looking for a way to export password (hashes) from Plone 3.

From Googling this and reading the sources, the entry point for this 
would appear to be MemberData.getPassword() in 
Products.CMFCore.MemberDataTool.


However, adding member.getPassword() to working export scripts does 
not return anything. Nor does stepping into a debugger and calling

mtool.getAuthenticatedMember().getPassword().

I lose the trail diving into PAS.

Can somebody maybe clue me in?

See http://blog.kagesenshi.org/2008/05/exporting-plone30-memberdata-and.html
David

--
David Glick
Web Developer
Groundwire
206.286.1235x32
davidgl...@groundwire.org
http://groundwire.org

ONE/Northwest is now Groundwire!

___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] Re: Setting a mime-type on a Zope 3 browser view

2010-01-23 Thread David Glick

Martin Aspeli wrote:


Is it possible to explicitly invoke the TAL XML parser in the 
self.index()

call above, rather than the HTML parser?  I guess it must be...


I'm sure it is, but that's not what controls the Content-Type header 
that is sent back to the browser. That header is set by setBody() in 
ZPublisher.HTTPResponse::


I didn't read Derek's original question carefully enough. He was 
actually asking about how to make the TAL parser behave differently (and 
deal with mixed-case tags properly), rather than about how to change the 
output content type.  Unfortunately I don't know the answer to the 
former question.


David

--
David Glick
Web Developer
Groundwire
206.286.1235x32
davidgl...@groundwire.org
http://groundwire.org

ONE/Northwest is now Groundwire!

___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] Setting a mime-type on a Zope 3 browser view

2010-01-22 Thread David Glick

Derek Broughton wrote:
I have a couple of browser views that are trying to render XML and getting 
bitten by the bug of https://bugs.launchpad.net/zope2/+bug/142801


I realize this isn't really a bug, but how DOES one set a mime-type on a 
browser view?  There doesn't seem to be anything in the ZCML view 
definition.  Because the ISO 19139 xml tags I'm trying to use are mixed 
case, but the template is being processed as text/html, the mixed-case tags 
below are being rendered in lowercase - and then my xsl stylesheet doesn't 
work.  If I put the ?xml-stylesheet? tag into the viewlet, it would 
probably actually look like it worked, but the raw XML would still be wrong, 
since those tags really are mixed-case.


My view template is simply:
  ?xml version=1.0 encoding=iso-8859-1 ?
  ?xml-stylesheet type=text/xsl href=++resource++ISO2text.xsl ?
div tal:replace=structure provider:MetadataViewlets 
  xmlns:tal=http://xml.zope.org/namespaces/tal;

/

while the code included by the viewlet manager starts:

  mcp:MD_Metadata 
  xmlns:ns1=http://www.opengis.net/gml/; 
  xmlns:tal=http://xml.zope.org/namespaces/tal;
  xmlns:xlink=http://www.w3.org/1999/xlink; 
  xmlns:mcp=http://bluenet3.antcrc.utas.edu.au/mcp; 
  xmlns:gco=http://www.isotc211.org/2005/gco; 
  xmlns:gmd=http://www.isotc211.org/2005/gmd; 
  xmlns:srv=http://www.isotc211.org/2005/srv; 
  xmlns:gts=http://www.isotc211.org/2005/gts; 
	gco:isoType=gmd:MD_Metadata

gmd:fileIdentifier
gco:CharacterString tal:content=context/id /
/gmd:fileIdentifier
...
  
You probably need to set the Content-Type HTTP header in the 
response...here's an example from 
http://svn.plone.org/svn/plone/Plone/branches/3.3/Products/CMFPlone/skins/plone_templates/rss_template.pt 
--


metal:block tal:define=dummy 
python:request.RESPONSE.setHeader('Content-Type', 
'text/xml;;charset='+context.plone_utils.getSiteEncoding()) /


David

--
David Glick
Web Developer
Groundwire
206.286.1235x32
davidgl...@groundwire.org
http://groundwire.org

ONE/Northwest is now Groundwire!

___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] Re: collective.contentlicensing 2.2.0 compatibility with Plone 4.0a3

2010-01-11 Thread David Glick

Raphael Ritz wrote:

jmf wrote:

Le vendredi 08 janvier 2010 11:11:34 AM, Graham Perrin a écrit :

Graham Perrin wrote:

Please: any suggestions on how to make collective.contentlicensing
compatible with Plone 4?



Hi folks,

looking at

  http://dev.plone.org/collective/browser/collective.contentlicensing

it seems like people are working on it.

Since this product is on my watch list anyway, I just gave it a try.
Starting from

http://svn.plone.org/svn/collective/collective.contentlicensing/branches/davisagli-sanity-and-modernization 



I got it up and running on Plone 4 (a3) after the following changes:

snip

I'm hesitant to check that in as it breaks backwards compatibility
(depending on how far back you go) so I thought I better ask:

Should I do such changes on

1. trunk (that would need more changes even)
2. the modernization branch mentioned above
3. a new branch (branching off from where?)

What do people prefer?

Last but not least I'll note that while the product's functionality
is in place after the changes mentioned above the presentation layer
is still broken as the templates need to be adjusted for the new
translation engine.
Note that my branch was a pretty significant change in the 
implementation (I switched to using a schema extender, in part to 
support the use of the product with LinguaPlone). I didn't have the time 
or energy to push for it to be merged to trunk, so I'm not sure if the 
package maintainers were aware of my branch, and I believe some 
diverging work has been done on trunk since I made the branch...but I 
haven't really paid close attention and don't know the current 
status...sorry.

David

--
David Glick
Web Developer
Groundwire
206.286.1235x32
davidgl...@groundwire.org
http://groundwire.org

ONE/Northwest is now Groundwire!

___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] Plone 4.0 trunk: buildout error installing PIL

2009-12-29 Thread David Glick

Mirto Silvio Busico wrote:
Seems that the system installed PIL is not good for the buildout and 
it tries to override the system wide installation.
The error appeared probably this week (not sure when I built last time 
without errors).


What can I do?
Hanno recently updated a bunch of packages to make sure they accurately 
list all their dependencies in setup.py -- including PIL.


Hanno, we might want to rethink the inclusion of PIL, since we know 
installing PIL via distribute/setuptools doesn't work for various platforms.


In the meantime, Mirto, you can probably work around this by creating a 
fake egg for PIL.


David

--
David Glick
Web Developer
Groundwire
206.286.1235x32
davidgl...@groundwire.org
http://groundwire.org

ONE/Northwest is now Groundwire!

___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] @property strips acquisition context

2009-08-31 Thread David Glick

On Aug 31, 2009, at 8:15 AM, Hedley Roos wrote:


Hi

I have a Dexterity custom class. I decorate a method foo with  
@property

but inside the method 'self' is not acquisition wrapped anymore. I'm
sure the object is wrapped before my attempt to access ob.foo

I'm sure it is not related to Dexterity but I mention it in case.

So the question is: should I be surprised that it is not working?



This is a known side effect of the @property decorator.  Not sure what  
the best workaround is.  Anyone?



David Glick
Web Developer
ONE/Northwest

New tools and strategies for engaging people in protecting the  
environment


http://www.onenw.org
davidgl...@onenw.org
work: (206) 286-1235 x32
mobile: (206) 679-3833

Subscribe to ONEList, our email newsletter!
Practical advice for effective online engagement
http://www.onenw.org/full_signup





___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] Re: PIL error when using effective-user on Ubuntu Hardy

2009-08-31 Thread David Glick

On Aug 31, 2009, at 5:25 PM, Derek Broughton wrote:
Good guess, because www-data, by design, has very limited access to  
anything
on an Ubuntu system.  I would think you need to chown much more than  
just
parts and var (my systems all have the entire buildout tree owned by  
the

effective-user).



Having the entire buildout tree owned by Zope's effective user is not  
a good idea from a security perspective.  It means that if someone  
exploited a security hole in Zope, they could write to Zope's  
codespace.  See Steve McMahon's and Erik Rose's great talk on this  
topic from Plone Conference 2008 for more info on this issue and steps  
to take to avoid it: http://plone.org/events/conferences/2008-washington-dc/agenda/securing-zope-and-plone-against-the-big-bad-internet



David Glick
Web Developer
ONE/Northwest

New tools and strategies for engaging people in protecting the  
environment


http://www.onenw.org
davidgl...@onenw.org
work: (206) 286-1235 x32
mobile: (206) 679-3833

Subscribe to ONEList, our email newsletter!
Practical advice for effective online engagement
http://www.onenw.org/full_signup





___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] Should setText(), title and description be utf-8 or unicode?

2009-08-11 Thread David Glick

On Aug 11, 2009, at 5:40 AM, Wichert Akkerman wrote:


On 8/11/09 10:43 , Martijn Pieters wrote:
Archetypes is very much wrong doing this; encoding and decoding  
should

happen at the I/O boundaries. The number of times I have to
special-case Archetypes because it returns UTF-8 is ridiculous.


It returns site encoding, which might not be UTF-8.


The
reason Archetypes does this is purely historical, technically there  
is

no reason anymore (other than backwards compatibility) to not return
unicode.


Aside from expectations by a probably surprisingly large amount of  
code. Everything that tries to pass data to external processes such  
as portal transforms and various newsletter products are build  
around a lot of assumptions that might no longer hold if we change  
this.


Having said that I would love to see this change in a major Plone  
release.



Hanno already made this change on AT trunk, I believe.  We decided not  
to include it for Plone 4 due to the product compatibility concerns.



David Glick
Web Developer
ONE/Northwest

New tools and strategies for engaging people in protecting the  
environment


http://www.onenw.org
davidgl...@onenw.org
work: (206) 286-1235 x32
mobile: (206) 679-3833

Subscribe to ONEList, our email newsletter!
Practical advice for effective online engagement
http://www.onenw.org/full_signup





___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] Re: CMFFormController - allow change of browser URL in traverse_to action

2009-07-06 Thread David Glick

On Jul 6, 2009, at 6:48 AM, Jon Stahl wrote:

An alternative approach would be to use David Glick's
collective.z3cform.wizard along with z3c.forms.

http://plone.org/products/collective.z3cform.wizard



This doesn't meet Radim's use case of needing a separate URL for each  
page of the wizard, though.  collective.z3cform.wizard has one URL for  
the entire wizard, and the position is tracked in a session variable.


I believe that with Google analytics you can manually record a hit to  
a particular URL with some Javascript call, so that might be an  
approach to look at.



David Glick
Web Developer
ONE/Northwest

New tools and strategies for engaging people in protecting the  
environment


http://www.onenw.org
davidgl...@onenw.org
work: (206) 286-1235 x32
mobile: (206) 679-3833

Subscribe to ONEList, our email newsletter!
Practical advice for effective online engagement
http://www.onenw.org/full_signup





___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] Problem with PTC test setup/now 'roadrunner issue

2009-06-14 Thread David Glick


On Jun 14, 2009, at 5:41 AM, Andreas Jung wrote:

The current test code looks like this:

PloneTestCase.installProduct('vs.event')
PloneTestCase.setupPloneSite(extension_profiles=('vs.event:default',))

@onsetup
def setup_package():

 ZopeTestCase.installPackage('vs.event')
 zcml.load_config('configure.zcml', vs.event)

setup_package()

class TestBase(PloneTestCase.FunctionalTestCase):

   def afterSetUp(self):
   ZopeTestCase.utils.setupCoreSessions(self.app)
#zcml.load_config('configure.zcml', vs.event)
   self.membership = self.portal.portal_membership
   self.membership.addMember('god', 'secret', ['Manager'], [])

class VSEventTest(TestBase):

   def testCalendarToolCheck(self):
   pc = self.portal.portal_calendar
   self.assertEqual(pc.meta_type, 'Chronos Calendar Tool')



You need to move your installProduct/setupPloneSite calls to be after  
the setup_package() call; otherwise your product's ZCML hasn't  
loaded.  You might also need to move the ztc.installPackage call below  
the zcml.load_config call.


I always refer to Martin's example test setup in PPD; it has worked  
consistently for me when using roadrunner.


David Glick
Web Developer
ONE/Northwest

New tools and strategies for engaging people in protecting the  
environment


http://www.onenw.org
davidgl...@onenw.org
work: (206) 286-1235 x32
mobile: (206) 679-3833

Subscribe to ONEList, our email newsletter!
Practical advice for effective online engagement
http://www.onenw.org/full_signup





___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


[Product-Developers] Re: making collective.flowplayer less invasive

2009-03-17 Thread David Glick


On Mar 16, 2009, at 7:20 PM, Martin Aspeli wrote:


Hi David,

I've just been reviewing the collective.flowplayer code as part of  
the  process for approving it for use on our Plone sites.  It looks  
great,  with one exception: we host many Plone sites in one Zope  
instance, and  want to selectively install collective.flowplayer to  
only some of  those sites.  Based on inspection of the code, it  
looks like there are  two ways in which collective.flowplayer will  
pollute the other sites:
1. It registers various browser views without specifying a browser   
layer.


I don't generally have a problem with this, if nothing is linking to  
those views without the product installed. I think that's pretty  
common practice.


It's obviously a different story for viewlets.


I'm generally against having all views in the same namespace; you can  
end up with collisions if you forget to think about it.  However, in  
the case of collective.flowplayer they have reasonable names and I  
have opted not to introduce the plone.browserlayer dependency, in  
hopes of keeping compatibility with Plone 3.0 a little longer.


2. It subtypes objects in response to object events without  
checking  to make sure that the object is within a site that has   
collective.flowplayer installed.


That would be a good thing to fix, definitely.


I just checked in a fix so that the event handlers check for a marker  
utility in the local site manager (instead of a marker interface,  
since local utilities gets removed for us by the quick installer for  
free).



David Glick
Web Developer
ONE/Northwest

New tools and strategies for engaging people in protecting the  
environment


http://www.onenw.org
davidgl...@onenw.org
work: (206) 286-1235 x32
mobile: (206) 679-3833

Subscribe to ONEList, our email newsletter!
Practical advice for effective online engagement
http://www.onenw.org/full_signup





___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] Re: making collective.flowplayer less invasive

2009-03-16 Thread David Glick


On Mar 16, 2009, at 12:35 PM, Ross Patterson wrote:


David Glick davidgl...@onenw.org writes:

I've just been reviewing the collective.flowplayer code as part of  
the

process for approving it for use on our Plone sites.  It looks great,
with one exception: we host many Plone sites in one Zope instance,  
and

want to selectively install collective.flowplayer to only some of
those sites.  Based on inspection of the code, it looks like there  
are

two ways in which collective.flowplayer will pollute the other sites:

1. It registers various browser views without specifying a browser
layer.


As long as this doesn't change the install it and it just works  
story

and it doesn't require integrators who want to override those views to
do something special, I'm all for doing this if it's better practice.
Can you point me to how this is done for something like the
folder_contents view in Plone?  Would it change *anything* for
integrators overriding the views?


It shouldn't change the install experience or require anything special  
for overriding the view.  If integrators are overriding the views they  
should be doing so by copying the view registration and specifying a  
theme-specific browser layers (from plone.theme), which takes  
precedence over the additive browser layers from plone.browserlayer.


Overriding folder_contents is different because it's a skin layer item  
rather than a Zope 3 view.  So you override using a new CMF skin layer  
with higher precedence.  This isn't relevant to collective.flowplayer  
though.



2. It subtypes objects in response to object events without checking
to make sure that the object is within a site that has
collective.flowplayer installed.


I'm not sure what you're talking about here.  Can you please specify  
all

the places this happens?


configure.zcml registers the following event handlers:

   subscriber
for=Products.ATContentTypes.interface.IATFile
 Products.Archetypes.interfaces.IObjectInitializedEvent
handler=.events.ChangeFileView
/
subscriber
for=Products.ATContentTypes.interface.IATFile
 Products.Archetypes.interfaces.IObjectEditedEvent
handler=.events.ChangeFileView
/

subscriber
for=Products.ATContentTypes.interface.IATLink
 Products.Archetypes.interfaces.IObjectInitializedEvent
handler=.events.ChangeLinkView
/
subscriber
for=Products.ATContentTypes.interface.IATLink
 Products.Archetypes.interfaces.IObjectEditedEvent
handler=.events.ChangeLinkView
/

These are global registrations.  But the ChangeXXXView classes don't  
do any checks to make sure that the object is in a site with  
collective.flowplayer installed, so they will run even for objects in  
other sites.


The simplest way to fix this is to add a check like:

from zope.app.component.hooks import getSite
request = getSite().REQUEST
if not IMyProductsBrowserLayer.providedBy(request):
pass

at the top of each event handler.

(I think it is possible to register local event handlers in the ZCA,  
which would be more elegant, but there's no GS support for this at  
present.)



Both of these should be pretty easy to fix...Can we do that?


Once discussion is finished, you're welcome to commit the changes to
trunk.  :)

Ross


David Glick
Web Developer
ONE/Northwest

New tools and strategies for engaging people in protecting the  
environment


http://www.onenw.org
davidgl...@onenw.org
work: (206) 286-1235 x32
mobile: (206) 679-3833

Subscribe to ONEList, our email newsletter!
Practical advice for effective online engagement
http://www.onenw.org/full_signup





___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] Re: The most efficient way to store 270 AT fields?

2009-01-07 Thread David Glick

On Jan 7, 2009, at 3:24 PM, Martin Aspeli wrote:
Also, Dexterity works fine on Plone 3.x (in fact, it doesn't  
currently work on trunk due to a z3c.form vs chameleon issue).



It should work on Plone trunk if you don't use chameleon.cfg...unless  
I forgot to commit something, which is always a posibility. :-/


David Glick
Web Developer
ONE/Northwest

New tools and strategies for engaging people in protecting the  
environment


http://www.onenw.org
davidgl...@onenw.org
work: (206) 286-1235 x32
mobile: (206) 679-3833

Subscribe to ONEList, our email newsletter!
Practical advice for effective online engagement
http://www.onenw.org/full_signup





___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


[Product-Developers] collective.captcha and collective.recaptcha

2008-12-04 Thread David Glick
Hi Martijn.  Today as part of the mini PloneFormGen sprint we are  
having with SteveM in Seattle I implemented a proof of concept for a  
wrapper for the recaptcha-client python library that implements the  
same interface as collective.captcha.  (See collective.recaptcha) Our  
plan is to make this ship with PloneFormGen so that you can enable  
captcha on a form simply by checking a checkbox on the form folder.


Alex suggested that I check in with you to make sure that we figure  
out a good way to make sure that these two packages play well  
together.  So I want to do that before I work on the package further.   
As I see it our constraints are:
1. A package like PloneFormGen should be able to declare a dependency  
on captcha without having to worry about which implementation is used,  
but also without automatically pulling in the dependencies of all of  
the different implementations.

2. If no implementation is specified, a sane default should be used.
3. It should be possible to swap out the default for an alternate  
implementation with minimal effort.


I think the simplest way to achieve this is to include both  
implementations in the collective.captcha package and require the use  
of extras to enable a non-default implementation.  But I'm certainly  
willing to consider alternate proposals that address the above concerns.


I'm personally pretty indifferent to which implementation is the  
default, though I know recaptcha is preferred by Alex (due to UI  
concerns, I think) and Steve (due to being lighter weight and not  
depending on graphics libs).  (Apologies if I'm incorrectly putting  
words into your mouths, Alex and Steve.)


peace,

David Glick
Web Developer
ONE/Northwest

New tools and strategies for engaging people in protecting the  
environment


http://www.onenw.org
[EMAIL PROTECTED]
work: (206) 286-1235 x32
mobile: (206) 679-3833

Subscribe to ONEList, our email newsletter!
Practical advice for effective online engagement
http://www.onenw.org/full_signup




___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


[Product-Developers] Re: improving Collage customization, round 2

2008-08-13 Thread David Glick

On Aug 13, 2008, at 2:31 PM, Malthe Borch wrote:


2008/8/13 David Glick [EMAIL PROTECTED]:


I'm writing seeking your opinion on some recent work I've done on  
making
Collage views easier to customize.  Malthe and Paul, you know that  
I tried

to do this once earlier, but didn't come up with a workable solution.
Gilles, this may be new to you, but it looks like you've been doing  
some
good work on maintaining Collage lately, so I wanted to make sure  
you're

part of this conversation.


Yes, we definitely want to keep everybody in the loop; thanks for  
this, David.


In the interests of this I'm adding plone-developers to the cc here.


My changes are in the davisagli-layer-overrides branch in svn
(https://svn.plone.org/svn/collective/Collage/branches/davisagli-layer-overrides 
).
Basically what I did is make sure that Collage *adds*  
ICollageBrowserLayer
to the request, instead of replacing any other marker interfaces.   
This
makes it possible to register Collage views on other browser  
layers.  But

how do we tell which views are meant for Collage then?  I added an
ICollageView interface which the custom view classes can  
implement.  I've
also written the view lookup so as to maintain backwards  
compatibility --
e.g. views registered to the ICollageBrowserLayer but not  
implementing

ICollageView will still be found.


I think I've written earlier, that we should try and look at what
Plone is contemplating on this matter; I seem to recall that there's a
general notion of an ``ITile`` interface which describes a view or
viewlet that renders a content item in a tile.

Perhaps it would make sense to register collage tiles like so:

 browser:viewlet
  name=default
  for=ATDocument
  template=document_tile.pt
  permission=zope2.View
  manager=ICollage /

Of course, Collage would be a strange viewlet manager, but the concept
is a bit familiar; we would manually look up these viewlets.


This looks like a fairly decent suggestion.  It takes care of the  
customization problem, and I like that it re-uses a concept (viewlets)  
that is already quite familiar to plone 3 themers.


The downside over my branch is that my branch adds some measure of  
customizability without breaking any backwards compatibility.  I  
should probably have clarified that the goal of my branch was not to  
come up with the final, long-term solution for this problem, but to  
make it possible for us to use Collage with themed sites for clients  
in the short term.  (We tend to run ~15 sites per zope instance, so  
registering things to a particular layer is essential.)


The only downside is that collage views registered on a layer other  
than
ICollageBrowserLayer may be traversed to directly, not just within  
the
Collage (because these layers are probably applied globally by  
plone.theme
or plone.browserlayer).  I don't think this is a huge problem  
though as long
as you take care to pick a view name which doesn't conflict with  
something
else.  Paul, this was an issue for you with my last attempt, but I  
think the
backwards compatibility discussed above will allow you to keep  
doing what

you're doing.


I think this is problematic. These views should require a special
request, not a browser layer request. Of course, if they're viewlets,
as sketched out above, then this problem goes away entirely.





Thoughts?  I'd be happy to merge this to trunk.


I think we should issue Collage 1.2 (I've tried a couple of times, but
was let down by plone.org) and then move to these more drastic changes
(e.g. 2.0).


I think my vote for 1) releasing Collage 1.2 as it stands, and 2)  
switching to viewlets on trunk, and pushing out an alpha or beta  
release of this fairly quickly.


Separate topic: Are there plans to turn Collage into an egg?  This  
should be

pretty simple, and I'm willing to take care of it if there are no
objections.  I would do it in the Products namespace as seems to be  
the

custom, so that it's still possible to release an old-style tarball.


+10.


I'll do this as soon as you tag the 1.2 release.




\malthe


peace,

David Glick
Project Associate
ONE/Northwest

New tools and strategies for engaging people in protecting the  
environment


http://www.onenw.org
[EMAIL PROTECTED]
(206) 286-1235 x32

Subscribe to ONEList, our email newsletter!
Practical advice for effective online engagement
http://www.onenw.org/full_signup




___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] schemaextender and adapter registration

2008-08-11 Thread David Glick

On Aug 11, 2008, at 3:10 PM, Hedley Roos wrote:


Hi all

A brief example...

Class Triangle subclasses Shape.

In my zcml I have

adapter
 factory=.shape.ShapeExtender
 for=Products.MyProduct.content.shape.Shape
 name=shape-extender/
adapter
 factory=.triangle.TriangleExtender
 for=Products.MyProduct.content.triangle.Triangle
 name=triangle-extender/

I find that schemaextender tries to call the extender for Shape even
when I am looking (eg. base_edit'ing) at a Triangle instance. This
causes problems with the getOrder method since Shape is not supposed
to know about Triangle's fields.

In extender.py method instanceSchemaFactory we have extenders =
list(getAdapters((context,), ISchemaModifier)) and that returns both
extenders. Is it supposed to do that? And if so is there a zcml
directive which can solve my problem?

My current horrid workaround is to abuse the resolution order and name
the triangle adapter atriangle-extender.


Why don't you just name both adapters shape-adapter?  Then the  
adapter lookup will only find the shape-adapter registered for the  
most specific interface that your content type implements.  (I'm not  
sure whether or not this will work when registering the adapters for  
classes, but it will certainly work if you register them for an IShape  
interface and an ITriangle interface, which are implemented by the  
Shape and Triangle classes respectively, and where ITriangle extends  
IShape.)


David Glick
Project Associate
ONE/Northwest

New tools and strategies for engaging people in protecting the  
environment


http://www.onenw.org
[EMAIL PROTECTED]
(206) 286-1235 x32

Subscribe to ONEList, our email newsletter!
Practical advice for effective online engagement
http://www.onenw.org/full_signup




___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] Limiting schema extenders to one Plone site?

2008-06-12 Thread David Glick
You can either use IBrowserLayerAwareExtender and a browser layer  
that's registered by your product, or else register the extender as a  
local adapter (e.g. using componentregistry.xml)

David

On Jun 12, 2008, at 1:22 PM, Andreas Jung wrote:

Schema extender implementing ISchemaExtender or  
IOrderableSchemaExtender extend the schema of a particular content- 
type for all Plone instances within a Zope site. Is there a way to  
restrict the extender to one site only (based on some conditions)?  
One possiblity would be to hack something into getFields()..would  
IBrowserLayerAwareExtender do the job by using a particular layer  
only available within the related sites? Or any better ideas?


Andreas___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


David Glick
Project Associate
ONE/Northwest

New tools and strategies for engaging people in protecting the  
environment


http://www.onenw.org
[EMAIL PROTECTED]
(206) 286-1235 x32

Subscribe to ONEList, our email newsletter!
Practical advice for effective online engagement
http://www.onenw.org/full_signup




___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] Re: debugging overriding skin templates with browser views

2008-06-05 Thread David Glick


On Jun 5, 2008, at 9:12 PM, Dylan Jay wrote:


Dylan Jay wrote:

David Glick wrote:
Stick a pdb in the traversePathElement method in zope.traversing/ 
adapters.py

David
Didn't it the break point :( Which is weird. I'll try and  
understand zope.traversing

Looks like zope.traversing is a plone 3.1 thing. What was used before?



I guess I should throw in the caveat that I don't really know what I'm  
talking about. :)  Looks like zope.traversing is there in plone 3.0  
also.  For plone 2.5, try Products.Five/traversable.py


David Glick
Project Associate
ONE/Northwest

New tools and strategies for engaging people in protecting the  
environment


http://www.onenw.org
[EMAIL PROTECTED]
(206) 286-1235 x32

Subscribe to ONEList, our email newsletter!
Practical advice for effective online engagement
http://www.onenw.org/full_signup




___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] Re: Where does it hurt?

2008-05-18 Thread David Glick


On May 18, 2008, at 6:24 AM, Martin Aspeli wrote:

* Skinning
Zope 2 vs. Zope 3 technologies


Yes - this is probably the top of my list to unify (and also very  
hard).


I think the following efforts would take us 80% of the way in regard  
to staunching some of the pain that new techniques have brought for  
skinners (probably targetting plone 4?):
- Add browser layer support to z3c.jbot and promote it as the  
recommended way to do filesystem customization of resources registered  
through ZCML (for those not familiar with jbot, this may sound like  
yet another technology, but really it's a simplification.  It allows  
customization of things like viewlet and portlet templates just by  
placing a ZPT in the correct filesystem directory, so that it feels  
more like a skin layer.)
- Devise a UI for through-the-web customization that unifies the skin  
layer (portal_skins) and customerize (portal_view_customizations)  
approaches.  (An entry-level skinner should not need to know *how* the  
template they are customizing is registered; just where to find it.)  
Ideally I think this would appear in the Plone control panel as  
opposed to the ZMI, to be more approachable (I'm thinking of  
Wordpress' theme editor.)  It's probably also a good idea to provide  
in-context links to customize, (the proverbial Introspector, which I  
think Eric Steele has modeled nicely in his branch of viewletmanager),  
but I think a centralized place to see what customizations are active  
fulfills a separate but important need.

- Make it easier to export TTW customizations to the filesystem.

If I'm reading Martin's 'Pete and Andy Try Plone 4' post correctly,  
this is basically the scenario he's promoting there, so I don't know  
that I'm adding a whole lot. :)  But I do think this is important,  
based on my experience trying to teach 2 quite bright non-programmers  
how to skin Plone 3.  Eyes do seem to glaze over if you mention ZCML,  
Generic Setup, or (heaven forbid) the Zope Component Architecture...


David Glick
Project Associate
ONE/Northwest

New tools and strategies for engaging people in protecting the  
environment


http://www.onenw.org
[EMAIL PROTECTED]
(206) 286-1235 x32

Subscribe to ONEList, our email newsletter!
Practical advice for effective online engagement
http://www.onenw.org/full_signup


___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] Re: Where does it hurt?

2008-05-18 Thread David Glick


On May 18, 2008, at 5:56 PM, Dylan Jay wrote:


Martin Aspeli wrote:

Hi guys,
Following a long discussion with Dylan Jay (buried in another  
thread on Devilstick terminology), I thought I'd conduct an  
informal poll.
== As a customiser of Plone, or as someone wanting to build  
bespoke components that extend Plone, what do you find most  
confusing?

I think this could fall into a few categories:
- Areas where there's insufficient/poor documentation, but once you  
learn how to do something, it's clear how to proceed.
- Areas where there appears to be more than one approach, and it's  
not clear which one to choose

- Areas where Plone doesn't appear to have a good way to do something


I think it hurts the most when something goes wrong. I write  
something that I think should work, it doesn't, suddenly I'm faced  
with understand everything I'm relying on.
Debugging is a nightmare. Perhaps I'm not using the right tools. but  
generally I try to read the code, which with the amount of  
indirection these days is pretty hard to read. The fact thats its  
not obvious where the definition the code I'm after is makes it  
harder. For instance I was trying to find the schema definitions fot  
ATCT the other day... and thats just z2. Trying to work out how to  
the standard templates got connected in in plone.z3cform was even  
harder.

I'm not 100% sure how to fix this. A tutorial on how to read code?
The slow startup time makes this worse of course because one way to  
try and fix things is to try different stuff and see what happens.


FWIW, here are some cases from my experience that have seemed  
particularly hard to debug.  (Not trying to whinge here; just trying  
to catalog some possible areas for improvement)...
- Python scripts, since you can't see where you're at in pdb and it's  
hard to avoid stepping through z2 security stuff.  (Why do we still  
have these in the age of utilities and browser views, anyway?)
- Anything in a Quick Installer handler, since it seems to swallow  
exceptions
- When working with utilities and adapters, figuring out why you're  
failing to look up something that you *thought* you had registered  
properly.  (but I can't think of a good generalizable way to make this  
easier)
- Any code that has an outrageous inheritance tree (e.g. Archetypes/ 
ATContentTypes stuff in particular).  I think this is the least of our  
worries though, since after a few months I had a decent sense of where  
I might look for things, and z3 techniques will make this less of an  
issue.
- This last one is more about documentation than debugging, but it's  
related.  For my first couple months of working with Plone, I tried to  
rely on api.plone.org way too much.  Then I realized that I was much  
more productive working with the actual source code and pdb.  This is  
probably not terribly surprising, nor an unreasonable expectation for  
a serious product developer.  But for someone who's just getting  
started, would it be too much to ask to have some auto-generated API  
docs that don't leave out pieces of the puzzle?  (For starters, you  
could augment the existing api.plone.org by having class docs include  
docstrings from the z3 interfaces the class is known to be  
implementing, link in doctests for a module, etc.)


I'm sure there are other places for improvement too :)  just my two  
cents.


David Glick
Project Associate
ONE/Northwest

New tools and strategies for engaging people in protecting the  
environment


http://www.onenw.org
[EMAIL PROTECTED]
(206) 286-1235 x32

Subscribe to ONEList, our email newsletter!
Practical advice for effective online engagement
http://www.onenw.org/full_signup




___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


Re: [Product-Developers] Integration of Captchas with existing content-types?

2008-05-03 Thread David Glick
It should be pretty simple to make a custom AT widget which uses  
collective.captcha.  See the PFGCaptchaField product in collective for  
an example (though this one is for use with PloneFormGen).

peace,
David

On May 3, 2008, at 10:29 AM, Andreas Jung wrote:


Hi,

what is the recommended way nowadays to extend the functionality of  
Plone 3.0/3.1 compatible content-types with a captcha?  
collective.captcha seems to be the best implementation but it seems  
to be bound to formlib and I see no direct way for integrating it  
with Archetypes (using at.schemaextender).


Andreas

--
ZOPYX Ltd.  Co. KG - Charlottenstr. 37/1 - 72070 Tübingen - Germany
Web: www.zopyx.com - Email: [EMAIL PROTECTED] - Phone +49 - 7071 - 793376
Registergericht: Amtsgericht Stuttgart, Handelsregister A 381535
Geschäftsführer/Gesellschafter: ZOPYX Limited, Birmingham, UK

E-Publishing, Python, Zope  Plone development, Consulting
___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


David Glick
Project Associate
ONE/Northwest

New tools and strategies for engaging people in protecting the  
environment


http://www.onenw.org
[EMAIL PROTECTED]
(206) 286-1235 x32

Subscribe to ONEList, our email newsletter!
Practical advice for effective online engagement
http://www.onenw.org/full_signup




___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


[Product-Developers] advice re read more marker product

2008-02-01 Thread David Glick

Hello, folks.

In conjunction with a current project I've written code that does the 
following:
1. Adds an 'excerpt' field to a content type, which is basically used 
like Description (in listings) but is rich-text.  This field is 
invisible on the edit screen.
2. Adds a button to kupu which can be used to mark a cutoff point in the 
primary text field.  (This appears as a graphical marker in wysiwyg 
mode, and as !--more-- in the HTML -- pretty much identical to 
Wordpress' UI for this.)
3. Overrides the content type's setText mutator to grab everything from 
before the cutoff marker and put it into the 'excerpt' field.


Is this something others would find useful?  It seems to be a pretty 
common pattern for blogs, and I've seen it requested a couple times 
recently on IRC.


Being a relatively new Plone / product developer, I'm not quite sure 
what the best way to proceed is, so I'd appreciate some advice.  
Assuming this is something the community wants, I can see three possible 
directions:


1. Try to get my code included in Plone and kupu.  We need both the new 
field to store things in on the Plone side, and the new button for 
inserting the marker on the kupu side, so I'm not sure which would need 
to happen first.  Based on what I've seen, I think I would create 
branches of the relevant products in svn, put them together into a 
review bundle and then attach that to a new PLIP?
2. Turn my code into an add-on product.  The thing that's stopping me 
from doing this is that I would have to override some fairly large 
chunks of kupu in a new skin layer, which seems like it could become a 
maintenance nightmare as new versions of kupu are released.
3. Write a tutorial for plone.org explaining how to make the necessary 
changes (which really aren't that involved).


Any thoughts on which approach would be best?

thanks,
David

___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


Re: using collective.captcha from a CMFFormController validator

2007-11-20 Thread David Glick

Martijn Pieters wrote:

On Nov 20, 2007 12:07 AM, David Glick [EMAIL PROTECTED] wrote:
  

Hey Martijn, I've been trying out the collective.captcha tool, which I
noticed via the collective-checkins list, and it is pretty slick!
However, I have a couple questions about using it from a
CMFFormController validator.

#1) I have the following in my validator:

from collective.captcha.browser.captcha import Captcha
captcha_view = Captcha(context, req)
if not captcha_view.verify(captcha):
state.setError('captcha', qpcMF(u'You must correctly enter the
word.'), 'captcha')

In order to have the privilege to call this view, I added the following
in my product's __init__.py:

from AccessControl import allow_module, allow_class
allow_module('collective.captcha.browser.captcha')
from collective.captcha.browser.captcha import Captcha
allow_class(Captcha)

Is this the preferred way to use a browser view from restricted python,
or is there a better way?



You could traverse to it, with context.restrictedTraverse('@@captcha') perhaps?

  

I'll give that a try.

#2) I noticed that the captcha cookie is getting deleted whenever
verify() is called, even if the verification failed.  This seems like a
bug, because it makes it hard to redisplay a new captcha if the
verification fails.



This is intentional! You don't want to give spambots multiple tries at
solving the captcha. Just look at any captcha online, failure to read
it will give you another, different captcha. This actually helps
people to deal with the occasional unreadable captcha
Yes, I understand that we want to offer a new, different captcha on 
failure.  This is how it is working with my patch.  Before, it was 
displaying NO image after a failure, because for some reason a new 
cookie wasn't getting set (in latest Firefox).  I suppose that may be 
the real problem that we should look into.


Aha, I see it.  Because verify() calls expireCookie, the cookie's 
expiration date is in the past even after the new cookie gets set (b/c 
setCookie just updates a dictionary of cookie parameters, one of which 
is the expiration date).  So if you explicitly put in a new expiration 
date when you call setCookie in _generate_session(), that should fix 
things as well.


--
--
David Glick
Project Associate
ONE/Northwest

New tools and strategies for engaging people in protecting the environment

http://www.onenw.org
[EMAIL PROTECTED]
(206) 286-1235 x32

Subscribe to ONEList, our email newsletter!
Practical advice for effective online engagement
http://www.onenw.org/full_signup


___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


using collective.captcha from a CMFFormController validator

2007-11-19 Thread David Glick
Hey Martijn, I've been trying out the collective.captcha tool, which I 
noticed via the collective-checkins list, and it is pretty slick!  
However, I have a couple questions about using it from a 
CMFFormController validator.


#1) I have the following in my validator:

from collective.captcha.browser.captcha import Captcha
captcha_view = Captcha(context, req)
if not captcha_view.verify(captcha):
   state.setError('captcha', qpcMF(u'You must correctly enter the 
word.'), 'captcha')


In order to have the privilege to call this view, I added the following 
in my product's __init__.py:


from AccessControl import allow_module, allow_class
allow_module('collective.captcha.browser.captcha')
from collective.captcha.browser.captcha import Captcha
allow_class(Captcha)

Is this the preferred way to use a browser view from restricted python, 
or is there a better way?


#2) I noticed that the captcha cookie is getting deleted whenever 
verify() is called, even if the verification failed.  This seems like a 
bug, because it makes it hard to redisplay a new captcha if the 
verification fails.  My fix for this is as follows:


Index: collective/captcha/browser/captcha.txt
===
--- collective/captcha/browser/captcha.txt  (revision 54159)
+++ collective/captcha/browser/captcha.txt  (working copy)
@@ -64,7 +64,18 @@
   del request2.cookies[COOKIE_ID]
   view.verify('np7EF-B')
  False
+ 
+If verification fails, the cookie session ID will *not* be expired,

+so that a new captcha can be displayed.

+   request2 = DummyRequest()
+   request2.setCookie(COOKIE_ID, 
'6552fec8867ee2a85a44784dda007e49efcf50ef')

+   view = Captcha(context, request2)
+   view.verify('incorrect')
+  False
+   COOKIE_ID in request2.expiredcookies
+  False
+
Displaying
--

Index: collective/captcha/browser/captcha.py
===
--- collective/captcha/browser/captcha.py   (revision 54159)
+++ collective/captcha/browser/captcha.py   (working copy)
@@ -89,9 +89,10 @@
result = False
try:
for word in self._generate_words():
-result = result or input.upper() == word.upper()
-# Delete the session key, we are done with this captcha
-self.request.response.expireCookie(COOKIE_ID, path='/')
+if input.upper() == word.upper():
+result = True
+# Delete the session key, we are done with this captcha
+self.request.response.expireCookie(COOKIE_ID, path='/')
except KeyError:
pass # No cookie



I'd be glad to check that change in if it makes sense to you.

peace,
--
David Glick
Project Associate
ONE/Northwest

New tools and strategies for engaging people in protecting the environment

http://www.onenw.org
[EMAIL PROTECTED]
(206) 286-1235 x32

Subscribe to ONEList, our email newsletter!
Practical advice for effective online engagement
http://www.onenw.org/full_signup

___
Product-Developers mailing list
Product-Developers@lists.plone.org
http://lists.plone.org/mailman/listinfo/product-developers


  1   2   >