Hayles, Steven | 17 May 13:56
Picon
Picon

[Product-Developers] [Plone-developers] Plone 4.2rc1 soft-released

Pages are not correctly styled in production mode (CSS entries are not included in the HTML head), but are in
debug mode if the optional "Session refresh support" add-on is NOT activated. 

This is under Debian Squeeze

Steven
Jean-Michel FRANCOIS | 16 May 15:38
Picon
Gravatar

[Product-Developers] ckeditor on github, please validate ?

Hi,


I have migrate the svn to github.

Any objection before I fork it on github collective ?


Regards / Cordialement,
JeanMichel FRANCOIS


_______________________________________________
Product-Developers mailing list
Product-Developers@...
https://lists.plone.org/mailman/listinfo/plone-product-developers
Kees Hink | 14 May 16:20
Picon
Gravatar

[Product-Developers] zope.testbrowser: browser.open with content-type gives error

Looking at the zope.testbrowser doc [1], it seems i can send an XML file 
in this manner: browser.post(url, data, content_type)

I've tried this in a script [2], but get "TypeError: must be string or 
buffer, not dict" [3]. With python 2.6 it's no different.

Am i missing something?

Kees

[1] 
http://pypi.python.org/pypi/zope.testbrowser#submitting-a-posts-body-directly

[2] upload_script.py
# Run from a virtualenv that has zope.testbrowser installed.

import argparse

from zope.testbrowser.browser import Browser

parser = argparse.ArgumentParser(description='Upload a K4-XML-export 
document to a running server')
parser.add_argument('filename', help='The XML file to send')
args = parser.parse_args()

def main():
     browser = Browser()
     import_url = 'http://localhost:8080/website/ <at>  <at> k4import'
     xmlfile = open(args.filename)
     xmldata = xmlfile.read()
     browser.post(import_url, xmldata, 'application/xml')

if __name__ == '__main__':
     main()

[3]
stacktrace:
(zope.testbrowser)kees <at> francis:~/development/zope/src/freitag.k4import/freitag/k4import/k4$ 
python upload_script.py dtd_valid.xml
Traceback (most recent call last):
   File "upload_script.py", line 19, in <module>
     main()
   File "upload_script.py", line 16, in main
     browser.post(import_url, xmldata, 'application/xml')
   File

"/home/kees/.virtualenvs/zope.testbrowser/local/lib/python2.7/site-packages/zope.testbrowser-4.0.2-py2.7.egg/zope/testbrowser/browser.py", 
line 277, in post
     return self.open(url, data)
   File

"/home/kees/.virtualenvs/zope.testbrowser/local/lib/python2.7/site-packages/zope.testbrowser-4.0.2-py2.7.egg/zope/testbrowser/browser.py", 
line 253, in open
     self.mech_browser.open(url, data)
   File

"/home/kees/.virtualenvs/zope.testbrowser/local/lib/python2.7/site-packages/mechanize-0.2.5-py2.7.egg/mechanize/_mechanize.py", 
line 203, in open
     return self._mech_open(url, data, timeout=timeout)
   File

"/home/kees/.virtualenvs/zope.testbrowser/local/lib/python2.7/site-packages/mechanize-0.2.5-py2.7.egg/mechanize/_mechanize.py", 
line 230, in _mech_open
     response = UserAgentBase.open(self, request, data)
   File

"/home/kees/.virtualenvs/zope.testbrowser/local/lib/python2.7/site-packages/mechanize-0.2.5-py2.7.egg/mechanize/_opener.py", 
line 193, in open
     response = urlopen(self, req, data)
   File

"/home/kees/.virtualenvs/zope.testbrowser/local/lib/python2.7/site-packages/mechanize-0.2.5-py2.7.egg/mechanize/_urllib2_fork.py", 
line 344, in _open
     '_open', req)
   File

"/home/kees/.virtualenvs/zope.testbrowser/local/lib/python2.7/site-packages/mechanize-0.2.5-py2.7.egg/mechanize/_urllib2_fork.py", 
line 332, in _call_chain
     result = func(*args)
   File

"/home/kees/.virtualenvs/zope.testbrowser/local/lib/python2.7/site-packages/mechanize-0.2.5-py2.7.egg/mechanize/_urllib2_fork.py", 
line 1142, in http_open
     return self.do_open(httplib.HTTPConnection, req)
   File

"/home/kees/.virtualenvs/zope.testbrowser/local/lib/python2.7/site-packages/mechanize-0.2.5-py2.7.egg/mechanize/_urllib2_fork.py", 
line 1115, in do_open
     h.request(req.get_method(), req.get_selector(), req.data, headers)
   File "/usr/lib/python2.7/httplib.py", line 958, in request
     self._send_request(method, url, body, headers)
   File "/usr/lib/python2.7/httplib.py", line 992, in _send_request
     self.endheaders(body)
   File "/usr/lib/python2.7/httplib.py", line 954, in endheaders
     self._send_output(message_body)
   File "/usr/lib/python2.7/httplib.py", line 818, in _send_output
     self.send(message_body)
   File "/usr/lib/python2.7/httplib.py", line 790, in send
     self.sock.sendall(data)
   File "/usr/lib/python2.7/socket.py", line 224, in meth
     return getattr(self._sock,name)(*args)
TypeError: must be string or buffer, not dict
Dylan Jay | 14 May 00:19
Favicon

Re: [Product-Developers] How to search and sort content based on owner last login time?

On 14/05/2012, at 4:14 AM, Andreas Jung <lists@...> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Sorry but you don't know what you are doing. You retrieve the last_login
> time *once* and pass the value to a date range query.
> That's it - nothing more, nothing less.
>

He wants to 'sort' on 'owners' last login. Why is a nuts idea and not simple.
To do this you could create a new index in the zcatalog but to keep it
up to date you'd need to reindex that index everytime anyone logged in
which would create a lot of writes.
Zcatalog is a denormslised query system. You can't do a join.

> - -aj
>
> zjs2k wrote:
>> Sorry I didn't make it clear. I want to list and sort contents based
>> on their owner's last login time. But I do not want to update the
>> content every time its owner login. I worry that it will involve too
>> many objects. So my question is where should I put the user last
>> login time info so I can easily sort on it?
>>
>> -- View this message in context:
>> http://plone.293351.n2.nabble.com/How-to-search-and-sort-content-based-on-owner-last-login-time-tp7554312p7555083.html
>>
>>
> Sent from the Product Developers mailing list archive at Nabble.com.
>> _______________________________________________ Product-Developers
>> mailing list Product-Developers@...
>> https://lists.plone.org/mailman/listinfo/plone-product-developers
>
> - --
> ZOPYX Limited         | Python | Zope | Plone | MongoDB
> Charlottenstr. 37/1   | Consulting & Development
> D-72070 Tübingen      | Electronic Publishing Solutions
> www.zopyx.com         | Scalable Web Solutions
> - --------------------------------------------------
> Produce & Publish - www.produce-and-publish.com
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.11 (Darwin)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iQGUBAEBAgAGBQJPr/nrAAoJEADcfz7u4AZj908LwOZbmbODOYoQx9hlZZLiJvQR
> YCu84ZHv+h35FnMMDQcnQiV+e9xAVTYapNYrxih0nz4xRlqpVZheUf0hwYM5WpiG
> HrQVWCxMFAokEsnzlGfjPzdcmmr5v0pVYMB4HrBTj91pCWbU9I/OWhj1b5pV4k23
> KvNM66+f/SYk8hGuP7VVHCHgHwn8qc98au07G+e3iPSrw5xXdgj4Iw0RyjRZhXWw
> 1pevV9lt3dDe7cmY7CR9q08EZFd0mU12TYCtO6jupM3nZol7dYNJYgPMH1fFQqog
> iLvdnCpKlGxHmSXWJoJF/qddb5md8FUdE+105CDRUC5zbX5nyG/YB1p+87t6UZdO
> g1xDc0r4Plxuohadp1VLeMFYoqYWNRE3XU++X893/kOijZCyBVcBtfe7z5SkJ2pR
> ci1b82goT/ZwuOhdX+evpWIDeDwv/gE7Ny1HFbrgId6yostqfzDFGH2FWcgS2BTR
> Xkqm2HOrK1mrQU1sywTyGC4TXx8mGSU    yD
> -----END PGP SIGNATURE-----
> <lists.vcf>
> _______________________________________________
> Product-Developers mailing list
> Product-Developers@...
> https://lists.plone.org/mailman/listinfo/plone-product-developers
zjs2k | 13 May 03:08
Picon
Favicon

[Product-Developers] How to search and sort content based on owner last login time?

I would like to hear any suggestion and comment on how to do this. First, I
will create a property/field somewhere to update the user login time
(probably a property on user metadata). They I want to present contents
sorted on user's last login time. So the contents made by the most recently
login user will be listed first. (then, I would sort contents from the same
user by modification date. I think AdvancedQuery can do multiple index
sort.)

Is this possible with zcatalog? Or do I have to go with relational database?
For mysql, I can see "join" table search working for this purpose. But how
do I do it with Plone/zodb? I don't want to update all contents by a user
every time he logs in. It could mean updating thousands of objects for just
one user, who could login multiple times a day. Any thoughts?

--
View this message in context: http://plone.293351.n2.nabble.com/How-to-search-and-sort-content-based-on-owner-last-login-time-tp7554312.html
Sent from the Product Developers mailing list archive at Nabble.com.
Kees Hink | 11 May 14:58
Picon
Gravatar

[Product-Developers] plone.testing: how to create a POST request containing a file

The doc for zope.testbrowser suggests [1] you can generate a POST like this:
    >>> browser.post(import_view, '<?xml version=1.0?>',
content_type='application/xml')
Is there something similar in plone.testing?

When i just use the browser.open method as described [2], i get: 
"TypeError: cannot concatenate
'str' and 'dict' objects" [3]
A pdb shows that in testbrowser/testing.py", line 75, "body" is
actually a dictionary:
(Pdb) body
{'body': '<?xml version=1.0?>', 'content-type': 'application/xml'}

Can i create a post request with xml data in plone.testing?

The background is that i want to create a view that accepts HTTP 
requests with XML data, from which content is to be created. Maybe 
there's an easier way for that?

I'll now look into the tests for Plone's File content type, probably 
that has some useful pointers as well.

Kees

[1] 
http://pypi.python.org/pypi/zope.testbrowser#submitting-a-posts-body-directly

[2] Plone 4.2b2, zope.testbrowser 3.11.1, plone.testing 4.0.3, 
plone.app.testing 4.0.2

[3]
Failed example:
     browser.post(import_view, data)
Exception raised:
     Traceback (most recent call last):
       File "/usr/lib/python2.6/doctest.py", line 1253, in __run
         compileflags, 1) in test.globs
       File "<doctest functional_k4import.txt[21]>", line 1, in <module>
         browser.post(import_view, data)
       File 
"/home/kees/.buildout/eggs/zope.testbrowser-3.11.1-py2.6.egg/zope/testbrowser/browser.py", 
line 264, in post
         return self.open(url, data)
       File 
"/home/kees/.buildout/eggs/zope.testbrowser-3.11.1-py2.6.egg/zope/testbrowser/browser.py", 
line 240, in open
         self.mech_browser.open(url, data)
       File 
"/home/kees/.buildout/eggs/mechanize-0.2.5-py2.6.egg/mechanize/_mechanize.py", 
line 203, in open
         return self._mech_open(url, data, timeout=timeout)
       File 
"/home/kees/.buildout/eggs/mechanize-0.2.5-py2.6.egg/mechanize/_mechanize.py", 
line 230, in _mech_open
         response = UserAgentBase.open(self, request, data)
       File 
"/home/kees/.buildout/eggs/mechanize-0.2.5-py2.6.egg/mechanize/_opener.py", 
line 193, in open
         response = urlopen(self, req, data)
       File 
"/home/kees/.buildout/eggs/mechanize-0.2.5-py2.6.egg/mechanize/_urllib2_fork.py", 
line 344, in _open
         '_open', req)
       File 
"/home/kees/.buildout/eggs/mechanize-0.2.5-py2.6.egg/mechanize/_urllib2_fork.py", 
line 332, in _call_chain
         result = func(*args)
       File

"/home/kees/.buildout/eggs/plone.testing-4.0.3-py2.6.egg/plone/testing/_z2_testbrowser.py", 
line 64, in http_open
         return self.do_open(connectionFactory, req)
       File "/usr/lib/python2.6/urllib2.py", line 1156, in do_open
         h.request(req.get_method(), req.get_selector(), req.data, headers)
       File 
"/home/kees/.buildout/eggs/zope.testbrowser-3.11.1-py2.6.egg/zope/testbrowser/testing.py", 
line 75, in request
         + headers + '\n' + body)
     TypeError: cannot concatenate 'str' and 'dict' objects
Sean Upton | 10 May 18:24
Picon
Gravatar

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

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')?

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.

Thoughts?

Sean
Luca Fabbri | 9 May 09:27
Picon
Gravatar

Re: [Product-Developers] [Plone-developers] LinguaPlone github status

So: seems a migration problem!

Unluckily right now we don't have anymore a place to commit fixes for
old branch of LinguaPlone. Also in the IRC I get no tips about this.

Proposition:
 * we make a form of LP on github
 * we create add a new branch
 * we populate the new branch exporting the old SVN 3.x branch
 * we make a pull request to the original LP project, for adding a new branch

We will lose the history, but I think this is better that losing all
the 3.x code.

Can this be ok for you? Better propositions?

--

-- 
-- luca

twitter: http://twitter.com/keul
linkedin: http://linkedin.com/in/lucafbb
blog: http://blog.keul.it/
Héctor Velarde | 7 May 19:08
Picon

[Product-Developers] user and content statistics in Plone

hi there!

we have a requirement from a couple of our customers on having some sort 
of reporting tool to get information on users and content created by users.

we were taking a look at http://plone.org/products/by-category/report in 
search of what the community has made available, and we found a couple 
of interesting packages that bring some functionality, but not exactly 
what we need.

we are thinking on different views with the first one showing something 
like this:

user    last login   number of logins    number of items created

another view will probably use some functionality from 
collective.googleanalytics and bring that information in the context of 
a user in something like a dashboard, in which we can show how many 
visitors does an user brought to the site and where do they came from.

this information will be generated from different periods like 
"yesterday", "last week", "last month", "specific period" and things 
like that.

we are thinking also on displaying visitor's feedback on content created 
by different users using information from plone.app.discussion and/or 
collective.disqus, in case it is available on the site.

we would like to ask if anybody else is looking/needing something like 
this just to exchange ideas and create a package that could be useful 
for more people.

please feel free to contact me in that case.

best regards
--

-- 
Héctor Velarde

Attachment (smime.p7s): application/pkcs7-signature, 4939 bytes
_______________________________________________
Product-Developers mailing list
Product-Developers@...
https://lists.plone.org/mailman/listinfo/plone-product-developers
Danilo Dellaquila | 5 May 09:56
Picon
Gravatar

[Product-Developers] Hiding Add-ons from Site Setup

Hi there,

I'd like to know if there is any product that can help me to hide an 
Add-on from the list of available Add-ons in "Site setup". Let me 
explain why.

I am in the situation of hosting multiple customers Plone sites running 
on the same Zope instance, each site is using a different Data.fs, and I 
have made a few packages for each customer customization, something like 
"Customer A Theme", Customer B Theme". Now, because they are on the same 
Zope instance, Customer A can see in its site Add-ons list that 
"Customer B Theme" is also available, which is what I'm trying to avoid.

Hiding products from the Add-ons list would be also useful in some other 
cases, for example a more skilled customer can have PloneFormGen 
installed, while regular customers don't.

I don't know if such a product exist and I'm willing to make one, if 
some of you can point me to the right direction.

Thank you,
  Danilo Dellaquila
Héctor Velarde | 4 May 22:14
Picon

[Product-Developers] [ANN] collective.z3cform.widgets 1.0a1 released!

sorry for the cross-posting...

I want to introduce collective.z3cform.widgets, a package currently 
containing 3 widgets we have developed for projects we are working on:

TaskWidget (which is an awful name that surely will be changed on next 
release) is a widget that lets you add a list of values to a field.

it was inspired by the widget used to add tasks to an user story in 
Pivotal Tracker (now you know where the name came from), so you can add, 
edit, delete and reorder the values entered easily; it uses the jQuery 
taskplease plugin written by quimera.

https://github.com/Quimera/tasksplease

this widget will be used in packages like collective.polls and 
collective.newsflash.

KeywordsWidget is a tokenizing autocomplete text entry that uses jQuery 
Tokeninput and will be used on subjects fields; you can see a demo here:

http://loopj.com/jquery-tokeninput/

RelatedContentWidget (which is an awful name also) is a widget to manage 
a list of relations dynamically created from an ObjPathSourceBinder's 
source; I think it uses plone.formwidget.autocomplete.

it's very useful on sites with tens of thousands of content items, like 
news sites, where you don't want to show a content tree because is 
simply not practical.

it works more or less this way: the user clicks the widget button to add 
related items; a modal window is shown; on the left we have the items 
already related and you can erase them from there; on the right we have 
a list of items available to be related; the widget looks for the 10 
most recently published items and show them in batches of 10 items with 
a small preview; the user can make a text search looking for items that 
contain certain words; the user can drag & drop objects to the list of 
related items.

we are planing a couple of additional widgets based probably on jQuery 
Chosen plugin:

http://harvesthq.github.com/chosen/

more info on collective.z3cform.widgets here:

http://pypi.python.org/pypi/collective.z3cform.widgets
https://github.com/collective/collective.z3cform.widgets

main developers were flecox and frapell.

the widgets work for Dexterity-based content types only (to my knowledge).

comments (and contributions) are welcome! ;-)
--

-- 
Héctor Velarde

Attachment (smime.p7s): application/pkcs7-signature, 4926 bytes
_______________________________________________
Product-Developers mailing list
Product-Developers@...
https://lists.plone.org/mailman/listinfo/plone-product-developers

Gmane