Skip to content. | Skip to navigation

Personal tools
Sections
You are here: Home Topics Plone
Navigation
 

Plone

Mar 01, 2010

Integration of PloneGazette with plone.app.discussion

by Federica D'Elia — last modified Mar 01, 2010 11:25 AM
Filed Under:

The new product collective.discussionintegration.plonegazette provides the integration of PloneGazette and plone.app.discussion.

The product plone.app.discussion is becoming the standard way to add comments in Plone. If both products plone.app.discussion and Products.PloneGazette are installed the creation of any PloneGazette content type fails, because PloneGazette content types not provide the adapter for "IConversation":

Traceback (innermost last):
  ...
  Module plone.app.discussion.catalog, line 29, in total_comments
TypeError: ('Could not adapt', <NewsletterTheme at /ausl/newslettertheme.2010-01-26.2440135204>, <InterfaceClass plone.app.discussion.interfaces.IConversation>)

 

 

To solve the problem we set an adapter for the types defined in Products.PloneGazette. This adapter provides the interface "IConversation" of plone.app.discussion. The adapter provides the attribute "total_comments" and the method "enabled", which returns False (means that the commeting is disable).

<adapter
      for="Products.PloneGazette.interfaces.INewsletterTheme"
      factory=".newsletter.NewsletterConversation"
      provides="plone.app.discussion.interfaces.IConversation"
      />

 

So you can create objects Newsletter without any problem.

Unfortunately PloneGazette does not define an interface for each content types, so through zcml we say that these content type implements a particular interfaces.Then we give the adapter for those interfaces.


The new product collective.discussionintegration.plonegazette makes possible the creation of the PloneGazette content types if there is an installation of plone.app.discussion in your instance.

http://svn.plone.org/svn/collective/collective.discussionintegration.plonegazette/

 

 

Feb 15, 2010

Do not use "print". Again plone_log is your friend

by Luca Fabbri — last modified Feb 15, 2010 10:11 AM
Filed Under:

An unexpected behaviour I found when writing test for a product. Use "print" command for logging is bad if you want to perform functional tests.

In early days on Plone I always used this API for logging:

context.plone_log("That's a log message")

This will give you a log message like this:

2010-02-15 09:56:32 INFO Plone Debug: 
That's a log message

I don't know or remember if the Python print command always worked on Plone, but right now you can use it freely.

I found that sometimes I used print, just because is simpler (and I don't need any context as plone_log).

Now the problem... use plone_log (or every other use of python logging system) is safe when writing functional doctests.

The print command isn't! If you are testing code that use print, you must be aware of its output writing test. For example:

This is a fake doctest.
Let's say that calling the button below will run some code that use Python "print" command.
For example for write "Hello".

    >>> browser.getControl('button').click()
    'Hello'

I don't like this... this is not a useful test!

This is very annoying!

So? It's better to not use print for logging messages, but rely on other logging APIs.

Jan 13, 2010

Install Plone 4 on OSX Leopard e Snow Leopard (from scratch)

by Stefano Marchetti — last modified Jan 13, 2010 08:30 AM

Install Plone 4 without Unified Installer is easy.

Trying Plone 4 is easy.
The following steps are tested with OSX 10.6 Snow Leopard and OSX 10.5 Leopard.
The first step is to obtain the compiler to build Python from source.
On OSX, to install the gcc compiler, download the Xcode package from http://connect.apple.com/. You’ll need to register for an Apple Developer Connection account. Once you’ve registered, login and click Download Software and then Developer Tools. Find the Download link
Xcode 3.2.1 Developer DVD (Disk Image)
Be careful: Xcode 3.2.1 is for OSX 10.6 Snow Leopard and Xcode 3.1.4 is for OSX 10.5 Leopard.

First: create a temp folder:

mkdir -p /Users/stefano/Devel/tmp
cd  /Users/stefano/Devel/tmp


Plone 4 needs Python 2.6; it is easy build Python from source. The great advantage is that, in this way, all files will be in a folder leaving your OS "clean".

Download the latest version 2.6 release from http://www.python.org/download/releases/2.6.4/

Move the file (Gzipped source tar ball) Python-2.6.4.tgz in the "temp" folder and uncompress it:

tar zxf Python-2.6.4.tgz
cd Python-2.6.4


Create the Python destination folder:

mkdir -p /Users/stefano/Devel/python/2.6/
cd /Users/stefano/Devel/tmp/Python-2.6.4


before you can build your Python first you must configure it.

From the folder /Users/stefano/Devel/tmp/Python-2.6.4 type the command:

./configure --prefix=/Users/stefano/Devel/python/2.6/

 
Then to build your Python type:

make


To install the Python binary, library modules, shared library modules, include files, configuration files, and the manual page, just type:

make install


Download the Python Imaging Library (the "all platform" version) from
http://www.pythonware.com/products/pil/
Move the downloaded file in /Users/stefano/Devel/tmp/

tar zxf Imaging-1.1.6.tgz

cd /Users/stefano/Devel/tmp/Imaging-1.1.6

 
Install Python Imaging Library in your Python environment:

/Users/stefano/Devel/python/2.6/bin/python2.6 setup.py install
cd /Users/stefano/Devel/

 
Then download the Plone source:

svn co http://svn.plone.org/svn/plone/buildouts/plone-coredev/branches/4.0/ plone4

cd plone4 

Then bootstrap Plone:

/Users/stefano/Devel/python/2.6/bin/python2.6 ./bootstrap.py


Then run the buildout:

./bin/buildout

 
Start Plone:

./bin/instance fg


Then type this URL in your browser:

http://localhost:8080


Enjoy your new Plone 4!

If you want to test new experimental functionality you can use configuration files in the folder "exeperimental" in the plone folder (Users/stefano/Devel/plone4)
For example to try Deco relaunch the buildout:

./bin/buildout -c experimental/deco.cfg

 
For more information read the instructions at the beginning of the configuration file "experimental/deco.cfg".

Dec 18, 2009

"./bin/buildout" senza "-N" su Plone 3.1? Ahi!

by Luca Fabbri — last modified Dec 18, 2009 12:52 PM

Vediamo di spiegare quello che succede a tantissimi quando provano ad aggiornare il loro vecchio Plone 3.1

Prima di tutto: "-N" è vostro amico!

I problemi li vediamo sotto, ma ricordate che l'opzione -N su un vecchio Plone come può essere la versione 3.1 è un parametro vivamente consigliato!

Volete installare un nuovo prodotto?
Ricordate che "-N" sta per non-updating, quindi solo gli egg già scaricati non vengono aggiornati, ma se la vostra modifica all'istallazione richiede la presenza di un nuovo modulo, questo viene normalmente prelevato (...e speriamo che la versione scaricata sia compatibile... in caso contrario, cercatene una che lo sia! vedere sotto...).

Di chi è la colpa?

I problemi sono iniziati con qualche prodotto rilasciato nell'era Plone 3.3, ma la cosa è diventata particolarmente sensibile (e fastidiosa) col rilascio delle prime versioni egghizzate di Plone 4.

Plone 3.1 non aveva le versioni degli egg fissate dai file versions (e.g: http://dist.plone.org/release/3.3.1/versions.cfg per Plone 3.3.1).

Per di piu "Plone" e "Zope2" sono diventati "veri" egg da poco.

Iniziano quindi ad essere disponibili molti egg che (giustamente) richiedono dipendenze da questi moduli software...

...peccato che a loro volta questi abbiano dipendenze verso altri egg che sono troppo aggiornati per la vecchia versione di Plone 3.1.

NB: l'idea non è sbagliata di per se! In un mondo perfetto se un utente che non sa nulla di Zope & Plone naviga la rete e trova il riferimento ad un prodotto che si chiama Ploneboard e che fornisce un forum, potrebbe volerlo provare. Se tenta di installarlo con easy_install, perché questo non dovrebbe a sua volta scaricarmi un ambiente Plone completo?

Vediamo di risolvere

Diciamo che state leggendo questo perché vi siete dimenticati di tenere l'opzione "-N", oppure un nuovo prodotto che dovete per forza installare ha delle dipendenze pericolose, o siete masochisti...

Ad ogni modo (i gusti son gusti) eccovi un esempio di un buildout di un Plone 3.1 che di recente mi ha dato problemi.

[buildout]
parts =
    plone
    zope2
    instance
    zopepy
    fss

# Add additional egg download sources here. dist.plone.org contains archives
# of Plone packages.
find-links =
    http://dist.plone.org
    http://download.zope.org/ppix/
    http://download.zope.org/distribution/
    http://effbot.org/downloads

# Add additional eggs here
# elementtree is required by Plone
eggs =
    elementtree
    iw.fss>=2.7.5,<2.7.6dev
    iw.recipe.fss
    Products.DocFinderTab
    
# Reference any eggs you are developing here, one per line
# e.g.: develop = src/my.package
develop =
    ...

[plone]
recipe = plone.recipe.plone

[zope2]
recipe = plone.recipe.zope2install
url = ${plone:zope2-url}

[instance]
recipe = plone.recipe.zope2instance
zope2-location = ${zope2:location}
user = admin:admin
http-address = 7084
#debug-mode = on
#verbose-security = on
effective-user = plone

eggs =
    ${buildout:eggs}
    ${plone:eggs}
    ...

# If you want to register ZCML slugs for any packages, list them here.
# e.g. zcml = my.package my.other.package
zcml = 
    iw.fss
    iw.fss-meta
    ...

products =
    ${buildout:directory}/products
    ${plone:products}

[zopepy]
recipe = zc.recipe.egg
eggs = ${instance:eggs}
interpreter = zopepy
extra-paths = ${zope2:location}/lib/python
scripts = zopepy

[fss]
recipe = iw.recipe.fss
storages =
    ...

Trovate degli omissis per alcune parti generiche e non interessanti.

Qual'è l'effetto di lanciare un buildout con questo .cfg, tenendo conto delle recenti dipendenze degli egg con Plone e Zope2?
Una frittata... e non particolarmente piacevole.

Ecco cosa potreste leggere a console (usate l'opzione "-v" per individuare gli errori):

...
Installing 'plone.recipe.zope2instance'.
We have the best distribution that satisfies 'plone.recipe.zope2instance'.
Picked: plone.recipe.zope2instance = 4.0a2
Getting required 'Zope2>=2.12.1'
  required by plone.recipe.zope2instance 4.0a2.
We have no distributions for Zope2 that satisfies 'Zope2>=2.12.1'.
...

In pratica, l'aggiornamento prova a scarica l'ultima versione di plone.recipe.zope2instance, ma dall'uscita di Plone 4 l'ultima versione risulta essere la 4.0a2. Questo va già male di per se, ma come accennato sopra un altro grosso problema è che questo è dipendente dall'egg Zope2 versione 2.12.1.
Inutile proseguire oltre; a sua volta questo egg ha un'infinità di altre dipendenze... vediamo dove porta tutto questo:

Getting distribution for 'Zope2>=2.12.1'.
Running easy_install:
/opt/local/bin/python "-c" "from setuptools.command.easy_install import main; main()" "-mUNxd" "/Users/luca/Library/Buildout/eggs/tmpFz8U_N" "-q" "/Users/luca/Library/Buildout/downloads/dist/Zope2-2.12.1.tar.gz"
path=/Users/luca/Library/Buildout/eggs/setuptools-0.6c11-py2.4.egg

src/initgroups/_initgroups.c: In function ‘initgroups_initgroups’:
src/initgroups/_initgroups.c:34: warning: implicit declaration of function ‘initgroups’
  File "build/bdist.macosx-10.6-i386/egg/Zope2/Startup/zopectl.py", line 313
    finally:
          ^
SyntaxError: invalid syntax
  File "/Users/luca/Library/Buildout/eggs/tmpFz8U_N/Zope2-2.12.1-py2.4-macosx-10.6-i386.egg/Zope2/Startup/zopectl.py", line 313
    finally:
          ^
SyntaxError: invalid syntax
While:
  Installing.
  Getting section instance.
  Initializing section instance.
  Installing recipe plone.recipe.zope2instance.
  Getting distribution for 'Zope2>=2.12.1'.
Error: Couldn't install: Zope2 2.12.1

Questo non è l'unico errore possibile, ma spieghiamolo: Plone 4 userà Python 2.6 e la sintassi non è completamente compatibile con Python 2.4 usato fino alla versione 3.3.

In altri casi invece il problema è un conflitto di dipendenze: ad esempio Plone 3.1 ha già un egg Zope2, la cui versione è la 0.0.

Questo perché nei buildout di Plone vengono usati (e possono essere usati anche per i vostri scopi) i fake-eggs. Un fake egg non è un vero e proprio egg ma il buildout crede di averlo disponibile alla versione (di solito) 0.0.

In un modo o nell'altro, il buildout non arriva a conclusione...

Come risolvere

La prima regola è analizzare gli errori; lanciare quindi il buildout con l'opzione "-v" per avere messaggi dettagliati, poi risalire la catena delle dipendenze nella console e trovare chi tra questi egg sta scaricando "Zope2>2.12.1" (oppure altri egg non appropriati perché rilasciati per Plone 4).

Nell'esempio sopra il problema era plone.recipe.zope2instance. Ci possono essere altri egg maledetti (ne vediamo almeno un altro più avanti) a seconda dei prodotti usati nel vostro buildout.

La soluzione è fissare le versioni:

[buildout]
parts =
    plone
    zope2
    instance
    zopepy
    fss

versions=versions

# Add additional egg download sources here. dist.plone.org contains archives
# of Plone packages.
find-links =
    http://dist.plone.org
    http://download.zope.org/ppix/
    http://download.zope.org/distribution/
    http://effbot.org/downloads

# Add additional eggs here
# elementtree is required by Plone
eggs =
    elementtree
    iw.fss>=2.7.5,<2.7.6dev
    iw.recipe.fss
    Products.DocFinderTab
    
# Reference any eggs you are developing here, one per line
# e.g.: develop = src/my.package
develop =
    ...

[versions]
plone.recipe.zope2instance = 3.6
...

La nuova parte versions, usata esplicitamente nella parte buildout, fissa plone.recipe.zope2instance alla "vecchia" versione 3.6.
Non ho una regola per trovare la versione giusta... andare alla pagina del Cheeseshop e guardare la sezione CHANGES di questo egg è stato sufficiente. La 3.6 è la main release precedente alla 4.0.

Questo potrebbe essere sufficiente... in presenza di altri egg velenosi si può ricorrere all'uso esplicito degli additional-fake-eggs.

Alcuni egg ad esempio hanno una dipendenza da "Plone" (la cui vita come egg, ricordo, è iniziata con la versione 3.2).

Ecco come modificare la parte zope2 per sistemare la dipendenza a Plone:

[zope2]
recipe = plone.recipe.zope2install
url = ${plone:zope2-url}
fake-zope-eggs = true
additional-fake-eggs =
    Plone

In questo modo il nostro buildout avrà già disponibile un egg "Plone" alla versione 0.0.

I problemi rimangono in vari casi. Cosa succedere ad esempio se voglio usare une prodotto che ha una dipendenza ad una versione precisa di un egg che ho nella sezione fake-eggs? Ad esempio: Ploneboard versione 2.1beta2 ha una sezione di dipendenze così fatta (preso dal suo setup.py):

      install_requires=[
        'setuptools',
        'Products.SimpleAttachment',
        'plone.app.controlpanel',
        'plone.app.portlets',
        'plone.portlets',
        'plone.memoize',
        'plone.i18n',
        'python-dateutil',
        'Plone >= 3.3',
      ],

Anche lanciando il nostro buildout con opzione "-N" e con la presenza del fake-egg "Plone", buildout prova giustamente ad ottenere una versione di "Plone>= 3.3". La versione 0.0 ovviamente non va bene.

La sezione fake-eggs ha una potenzialità maggiore; potrei cambiare il buildout così:

[zope2]
recipe = plone.recipe.zope2install
url = ${plone:zope2-url}
fake-zope-eggs = true
additional-fake-eggs =
    Plone=3.3

Questo significa che il nostro fake-egg "Plone" non sarà più a versione 0.0

NB: ovviamente non è detto (e non ho testato) che provare questa versione di Ploneboard, fatta per Plone 3.3 su un Plone 3.1, porti a qualche risultato funzionante... spero che passi il concetto generale dell'esempio!

Un ulteriore esempio

Ora voglio anche usare in questo vecchio buildout un file .cfg per lo sviluppatore, magari copiato da altri buildout. Questo aggiunge alcuni egg molto utili per lo sviluppo in locale:

[buildout]
extends = buildout.cfg

parts+=
    omelette

[instance]
http-address = 8080
eggs +=
    plone.reload==1.1

zcml +=
    plone.reload

[omelette]
recipe = collective.recipe.omelette
eggs =
    ${instance:eggs}

products =
    ${instance:products}

Se lancio il buildout senza l'opzione "-N" torno ad avere problemi:

./bin/buildout -vc sviluppo.cfg

Ottengo questo:

While:
  Installing instance.
Error: There is a version conflict.
We already have: Zope2 0.0
but Products.CMFCore 2.2.0-beta requires 'Zope2>=2.12.0b4dev'.

Come abbiamo già fatto: chi è che sta provando a scaricare Products.CMFCore 2.2.0-beta (anche CMF non era egghizzato fino a poco tempo fa)?

Analizzando indietro il trace, troviamo che il cattivo è plone.reload:

Getting required 'Products.CMFCore'
  required by plone.reload 1.1.
We have the best distribution that satisfies 'Products.CMFCore'.
Picked: Products.CMFCore = 2.2.0-beta

Possiamo di nuovo superare la cosa tramite fake-eggs, oppure fissando la versione di plore.reload ad una versione più vecchia, compatibile con Plone 3.1.

Nel primo caso modifico buildout.cfg di nuovo, come segue:

additional-fake-eggs =
    Products.CMFCore 
    Plone=3.3

Anche in questo caso forse sto barando... ma non è detto (vedere sotto).

Il modo canonico è come sempre trovare una versione compatibile; rimuovo il fake-egg "Products.CMFCore" e questa volta modifico sviluppo.cfg:

[instance]
http-address = 8080
eggs +=
    plone.reload<1.1dev

E con questo abbiamo finito!

Quale modo è il migliore?

In generale, fissare le versioni è la giusta soluzione, e con l'uso di versions si sta facendo quello che le release successive di Plone hanno fatto.

L'uso dei fake-eggs è comunque una scappatoia da non dimenticare... Magari Ploneboard 2.1 funziona anche con Plone 3.1... solo che nessuno lo ha mai testato (e potreste volerlo fare voi).

Lo stesso per plone.reload. La versione successiva (la 1.2) ha rimosso la dipendenza all'egg Products.CMFCore. Magari anche la 1.1 funziona correttamente con il nostro vecchio Plone e gli sviluppatori si sono accorti di come questa dipendenza creasse più problemi che altro.

Dec 14, 2009

collective.flowplayer_toolbar: adding accessibility in an unobtrusive way

by Luca Fabbri — last modified Dec 14, 2009 09:43 AM

The way I used to make Flowplayer use inside Plone a little more accessible, this time without branching the collective.flowplayer product!

First of all: some terms

After finishing this article I understand that people not familiar with this argument and software can be confused, so:

  • Flowplayer (in capitalized form) is a Flash player for audio/video files, indipendent from the Plone technology.
  • collective.flowplayer is a Plone products that use Flowplayer and give this player well integrated in Plone CMS
  • collective.flowplayer 1.x is an old release family, that use Flowplayer 2.x
  • collective.flowplayer 3.x is the last release family, that use Flowplayer 3

Introduction to main characters

Flowplayer is one of the most promising Flash audio/video player available right now, and we can use it in a simple way inside Plone site thanks the collective.flowplayer, a well know product that replaced the use of p4a.video in recent Plone experiences.

Flowplayer is good, and open source, but not the most accessible available player. Our work with collective.flowplayer accessibility begin when the available release was the 1.0.x version.

As noted above, Flowplayer version used in this old release was the old 2.x, so many of the most recent and cool features were missing; on the other hand, the current 3.x family is heavily integrated with jQuery Javascript framework.
Not less important, the Flowplayer team is the one who released the jQuery Tools, the javascript addon for jQuery recently integrated in Plone 4 thanks to plone.app.jquery.

Fixing collective.flowplayer 1.x

The main accessibility problem of Flowplayer is its flash controlbar. Practical tests show that is not easy to handle video controls using the keyboard.

Our customer, the same that ask for accessible videos in Plone and also like Flowplayer very much, provide us a static HTML example of Flowplayer that use Javascript controlbar, simply usable with keyboard. The problem was that this example supports Flowplayer 3.2, the current version of the Flash player, but not the version used in the Plone addon.
Also the example provide a patched version of the controlbar plugin for Flowplayer. This custom version add some missing HTML attributes and WAI-ARIA support.

After looking on the web we found that even if Flowplayer 2 was backward compared to the new branch, it provides some limited APIs, usable through Javascript.

Our target was to replicate all the feature seen in the Flowplayer 3 demo in the Flowplayer 2 environment... of course this was not so easy! However after some work we find a way to provide those features:

  • a play/pause button
  • a stop button (not required, but was simple to do)
  • a timer display

The collective.flowplayer branchThe only feature "impossible" to obtain (directly) was the progressbar... to be honest, some additional Javascript could also realize this (we have the duration of the video, we have the current execution time, we know how to perform arithmetic division... why not draw ourself? :-) but was enough.

What we really don't like was this: we found no (simple) way to write a Plone addon that work with collective.flowplayer 1.0, adding to it our new features.

We don't waste more time: we made a branch of the original collective.flowplayer 1.x, providing our new feature.

Thank you! Thank you! We have collective.flowplayer 3.x!

After a few weeks collective.flowplayer 3.x was released (I think that the developers team skipped the 2.x version for aligning the Plone product's version to the Flowplayer one).
So we came back to the original example give to us (the customer project was happy finished using our branch) just for test the new feature available and to understand is in future a new, better approach is possible.

The API's of the latest Flowplayer versions are more complete and powerful, heavily filled with the jQuery power.

This time we were able to develop something that could live and enhance the original collective.flowplayer, releasing only a new product: collective.flowplayer_toolbar.

The final result really better than the old approach; without embarrassment I can say that we did a few line of codes! The most part of the work of our new controlbar came from Flowplayer features and one more time from the great jQuery library.

You want see the "core" of this product?

/**
 * Javascript code for adding accessible toolbar to flowplayer players in the page 
 */

jq(document).ready(function(event) {
	$f("*").each(function() {
		this.onLoad(function(event) {
			this.getPlugin("controls").hide();
			var p = jq(this.getParent());
			var p_width = p.width();
			var time_width = (p_width<400?99:129);
			var hulu_id = "hulu-"+ (jq(".hulu").length+1);
			p.after('<div id="'+hulu_id+'" style="width:'+p_width+'px" class="hulu">\n'
				+'<a class="play" href="javascript:;" role="button">Play</a>\n'
				+'<div class="track" style="width:'+(p_width-46-46-time_width)+'px">\n'
				+'    <div class="buffer"></div>\n'
				+'    <div class="progress"></div>\n'
				+'    <div class="playhead"></div>\n'
				+'</div>\n'
				+'<div class="time" style="width:'+time_width+'px"></div>\n'
				+'<a class="mute" href="javascript:;" role="button">Mute</a>\n'
				+'</div>\n');
			this.controls(hulu_id);
			// Now I'll fix all other positions of the new toolbar
			jq("#"+hulu_id+" a.mute").css('left', p_width-46);
			jq("#"+hulu_id+" div.time").css('left', p_width-46-time_width);
		});
	});
});

The rest of the egg simply use a limited version of the original CSS of the demo page in Flowplayer site, the patched controlbar plugin (but you can use the original one without problems)... nothing more!

The jQuery presence make real the injection our new feature on existings Flowplayer instance in the page (for example, this is also working properly for our redturtle.video product). No need to patch/branch collective.flowplayer, also no need to override some views or resource of it.

Conclusion

This work can be also a proof-of-concept for future Flowplayer integration with additional features. The player supports many additional plugins (Yuri point my attention to the Caption Flash plugin...).

Dec 03, 2009

2010 Content Technology Vendor Map

by Fabio Pignatti — last modified Dec 03, 2009 06:42 PM
Filed Under:

cms vendor map

Full report available here

Nov 27, 2009

Plone is Cool!

by Irene Capatti — last modified Nov 27, 2009 07:00 AM

Ecco la maglietta sfoggiata alla Conference di Budapest... in versione open source.

Maglietta Plone Conference 2009 (fronte)Maglietta Plone Conference 2009 (retro)Alla recente Plone Conference ci siamo presentati in gruppo con una maglietta creata ad-hoc per l'occasione. Il tema è "Plone is Cool": l'immagine anteriore è costante, ma sulla schiena sono stati stampati 5 diversi frammenti di codice (python e jQuery) che portano tutti ad un risultato molto simile :-)

Grande successo soprattutto per il "lancio delle magliette" ai portatori sani di domande intelligenti al termine dei talk di Massimo e Andrew! Nei giorni successivi, infatti, non sono mancati gli incontri casuali con plonisti che diffondevano il Verbo del CMS più cool.

Sul sito di RedTurtle trovate i file sorgenti con loghi e codice pronti per la stampa.

Di seguito riporto il codice.

>>> import CMS
>>> all_cms = CMS.queryAllKnowCMS()
>>> all_cms.sort(lambda x, y: cmp(x.coolValue,
...                               y.coolValue))
>>> print all_cms[-1]
'Plone'

 

>>> import CMS
>>> plone = CMS.getCmsByName('Plone')
>>> CMS.getCoolerCmsThan(plone)
Traceback (most recent call last):
...
NotFoundError: can't find a cooler CMS than 'Plone'

 

>>> @memoize
>>> def ploneIsCool(self):
...    return True

 

>>> var title = jq(".documentFirstHeading > span");
>>> var old_title = title.text().strip();
>>> title.text(old_title.split(" ")[2] + " is Cool!");
>>> title.text();
"Plone is Cool!"

 

>>> import CMS
>>> coolestCMS = IFullyFeatured(CMS)
>>> coolestCMS.downloadURL() 
'http://plone.org/products/plone'

 

 

Nov 25, 2009

A cloud of colors in Plone

by Irene Capatti — last modified Nov 25, 2009 07:00 AM
Filed Under:

A small customization to Vaporisation's template, an excellent product for viewing tagcloud.

TagCloudVaporisation (also available as an egg) can display on your site a portlet with the cloud of the keywords used in the site.
If you are not satisfied with the standard monochrome display, you can quickly customize the template to add the CSS classes that give more color.

Copy the original template cloud.pt in your browser folder on your Plone theme (the classic theme created with paster).

Go to the configure.zcml file in the same folder and add these few lines: 

...
<include package="vaporisation"/>

<!-- Portlet tagclouds -->
  <plone:portletRenderer
         portlet="vaporisation.interfaces.IVaporizedCloud"
         template="cloud.pt"       
         layer=".interfaces.IThemeSpecific"
         />
...


Save and Close.
Now open your file cloud.pt. First, you could add to portlet a specific  css class:

<dl class="portlet portlet-tagcloud"
    i18n:domain="vaporisation"
    tal:attributes="id string:portlet-${context/getId}"
...


Moved a bit lower down, where tags are defined:

<a href=""
   tal:content="tag/name"
   tal:attributes="style string:font-size: ${tag/size}%;;;
                   href string:${link}${tag/name};
                   title string:${tag/name} (${tag/weight});" />


Add to the attributes list the CSS class:

<a href=""
   tal:content="tag/name"
   tal:attributes="style string:font-size: ${tag/size}%;
                   class python:'size_'+str(tag['size'])[:2];
                   href string:${link}${tag/name};
                   title string:${tag/name} (${tag/weight});" />


There is no need to change much, nor to extend the original python class.
In this way each different tag size will be associated with a CSS class like "size_10", "size_11" , ...,  that you can assign a color: 

...
.vaporized-tag a.size_13 {
    color: #006600;
}
.vaporized-tag a.size_14 {
    color: #008080;
}
.vaporized-tag a.size_15,
.vaporized-tag a.size_16 {
    color: #761911;
}
...


The end result will not be very different from this ... look at the bottom of the page :)

Nov 23, 2009

Un italiano a Budapest

by Massimo Azzolini — last modified Nov 23, 2009 10:30 AM

Non vi racconterò di talk, di tecnologie, di nuove feature. Non vi racconterò nemmeno dell'ultima e della prossima release di plone. La mia gita alla plone conference è stata un viaggio emozionante tra persone e idee.

E non uso "passione" a caso. Lo so è stato utilizzato spesso e a sproposito, ma è l'unico che può descrivere pienamente una ploneconference. passione, passione vera.

Non so esattamente quale sia la percezione dall'esterno, ma ogni anno la conference rappresenta, per me, la possibilità di ritrovare vecchi amici che hanno una passione in comune.

Si parte!

Già alla cena pre-conference l'accoglienza è stata incredibile.
Aaron aveva un posto buono a fianco a lui e subito i gruppi si sono mescolati: italiani, americani, polacchi, francesi, tedeschi, olandesi.

Tutti li' a parlare di tutto. C'era quello mi chiedeva di amberjack, quello che si ricordava di un piatto italiano e voleva la ricetta, quello che ti racconta che si è finalmente preso una spider e ne è così orgoglioso.

Tutto come se fossimo vecchi compagni di scuola che hanno condiviso qualcosa di particolare e prezioso.

Spesso si dice:

plone il cms, plone il framework, ma soprattutto plone la comunità

La solita retorica, trita retorica, dell'open source, vero? beh, magari no.

Se ne sei fuori, o meglio se ne vuoi stare fuori, sei libero di vederla così, ma così non è. Frequento e ho frequentato in passato altre comunità (i partner ibm, i lug, l'xpug) e nonostante abbia incotnrato alti livelli di eccellenza, questa community è quella più coinvolgente, appassionante, e professionalmente energizzante.

ZEA

Il gruppo ZEA si è riunito dopo diverso tempo in una riunione live. Ho potuto conoscere di persona e di scambiare opinioni con Matt, Russ, Kit e Jean Paul, che conoscevo solo in modo marginale, ma anche di rivedere vecchi amici come Xavier e Godefroid. E' stato utile, credo che il gruppo sia oggi più compatto e propositivo.

Plone Italia

Il riaggregarsi del gruppo italiano è stato allo stesso modo entusiasmante.

Le cose non sono state liscie e tranquille. Quando va tutto liscio e non ci sono "discussione e confronto" significa che ci si omologa al pensiero comune oppure che non si riesce a dare un contributo reale.

Ognuno aveva la sua idea, il suo modo di vedere le cose. E si è discusso, preso in considerazione le varie tesi.

Quello che ne è venuto fuori lo potete o lo avete letto sulla ML, ma il punto interessante, ancora una volta, non è stato solo il risultato finale.

Il confronto, il discutere, il mettere in dubbio quello che è il tuo piccolo mondo di fronte agli altri è un modo estremamente appagante di crescere. E ti rendi conto che dopo 12 anni di lavoro e non so quanti di informatica, non sei ancora arrivato. C'è sempre qualcuno che ha qualcosa di nuovo da raccontarti un punto di vista diverso, e cresci.

collective.amberjack

Poi c'è stata la mia personalissima ciliegina sulla torta: collective.amberjack.

E' un sistema per la gestione di tutorial in plone che ho portato avanti un po' alla volta, con l'aiuto di altri allegri personaggi, da un anno a questa parte. Si mormora che entrerà in una delle prossime versioni minori di plone.

Ho potuto presentarlo in un talk ufficiale, ho "guidato" uno sprint e raccontato a tutti gli sprinter gli avanzamenti del lavoro fatto.
Messa giù così ha un che di vagamente autocelebrativo e presuntuoso. E sicuramente una parte di me è decisamente soddisfatta dell'interesse che ne è uscito. Il punto però è un altro.

Perdersi nella comunità

Ho sempre visto tutti coloro che contribuivano come una specie di esseri con capacità tecniche, qualità personali di livello superiore.

Il che in parte è anche vero. Quello che è, però, ancora più vero non sono le capacità tecniche, ma la voglia di proporsi e di perseverare.

In fondo quello che è cambiato in me rispetto alle precedenti conference è stato il voler mettere sul piatto quello che so fare, tanto o poco non importa. La comunità ha apprezzato ed evidenziato. Poi, magari, amberjack sarà stata anche un buona idea, ma in ogni caso è stato l'impegno che ha fatto la differenza.

E' la differenza che passa tra lo stare nell'ombra e sfruttare l'open source, come molti purtroppo fanno, e il fondersi nella comunità: più dai, più ti impegni, più avrai in cambio in termini di credibilità, riconoscenza, amicizia!

Ritorno a casa

Puoi scegliere se guardare o giocare. Io ho detto "c'è la squadra!" e mi hanno fatto giocare.

Alla fine del viaggio la lezione imparata è che tutta la retorica dell'open source, del fatto che tutti possono contribuire, che è la community che segna la strada è niente di più che la realtà.

Non ci si può, però, limitare a raccontarla (alle conferenze, ai linux day, in post sui blog), occorre declinarla in azioni, in codice, in attività, in quello che sai fare.

Allora? che pensi di proporre alla prossima ploneconf?

Nov 18, 2009

Deliverance, tips and tricks

by Irene Capatti — last modified Nov 18, 2009 08:00 AM

When to use regular expressions and "abort".

The attempt to use Deliverance on a Plone site which must also provide users all the functionality of the backend could be more difficult than expected.
Should be evaluated each case involving the opening of a popup or overlay javascript, because without the appropriate rules of match would get a beautiful Internal Server Error or a very nice "zoom effect" (in the popup will be reloaded the entire site) .

How to solve the problem?

Putting on top of our file rules.xml the match for all addresses that should not be filtered by Deliverance.

For the popup Related Items:

<match path="regex:^(.*/VirtualHostRoot|)/.*referencebrowser_popup$" abort="1" /> <match path="regex:^(.*/VirtualHostRoot|)/.*referencebrowser_popup$" abort="1" />


To view in a news  the image in original size:

<match path="regex:^(.*/VirtualHostRoot|)/.+/image_view_fullscreen" abort="1" /> <match path="regex:^(.*/VirtualHostRoot|)/.+/image_view_fullscreen" abort="1" />


For some of the basic tools of TinyMCE, including uploading files and images:

<match path="regex:^(.*/VirtualHostRoot|)/tinymce-upload$" abort="1" />

<match path="regex:^(.*/VirtualHostRoot|)/.+/plone(image|link)\.htm$" abort="1" />

<match path="regex:^(.*/VirtualHostRoot|)/.*/plugins/table/(table|row|cell|merge_cells)\.htm$" abort="1" />

<match path="regex:^(.*/VirtualHostRoot|)/.+/advanced/(source_editor|anchor)\.htm$" abort="1" />


Every time a new TinyMCE tool is enabled not forget to make sure it works properly ;)

Understood the principle, is easy to customize and improve the regular expression to fit our needs!

Nov 17, 2009

Da Budapest... con stile

by Irene Capatti — last modified Nov 17, 2009 07:00 AM

Un breve report dalla Plone Conference 2009.

Per una panoramica dei principali talk che hanno animato la settima Plone Conference (Budapest, 2009) vi rimando alle precise recensioni di Maurizio e Luca.

In queste poche righe, invece, vorrei sintetizzare promesse e aspettative che rivoluzioneranno la vita di un plone skinner: grandi poteri saranno concessi alla nostra stirpe di fate madrine, che da qualche lembo di stoffa sono chiamate a creare un lussuoso abito da cerimonia ;)
Non è un caso se  Steve McMahon ha concluso il suo talk "Overlays, Accordians and Tabs, Oh My" con la celebre massima dello zio Ben ("With great power comes great responsability").

Ma andiamo con ordine.

Il nuovo tema Deco-oriented.

Non c'era presentazione che non lo mostrasse. Limi gli ha dedicato un intero talk ("Complex CSS layout made easy"). Che dire... finalmente quello che tutti aspettavamo: un layout completamente table-less!

L'aspetto generale, da un punto di vista puramente grafico, non stravolge la struttura lineare e pulita che ha sempre caratterizzato Plone: anzi, lo svecchia e gli conferisce un tocco di professionalità in più (personalmente non sopportavo l'azzurrino pallido e il verdino acido dell'interfaccia base ;) ).
Niente tabelle, quindi: l'impostazione è già proiettata verso Deco, con una griglia di blocchi posizionati sapientemente a suon di CSS, con la garanzia di poca spesa e ottima resa sia per layout fissi che liquidi. Come spiega chiaramente Limi nella PLIP, saranno mantenuti i vecchi ID, spariranno le base_properties, saranno semplificati e alleggeriti i fogli di stile... e altre novità che attutiranno un po' l'impatto con il futuro (prossimo?) Plone 5.

Deliverance e XDV

Hanno destato la curiosità di molti, sia neofiti che già avvezzi a rules e XPath.

Si insiste ancora sul concetto che Deliverance, e ancor più XDV, permetterà a chiunque di creare fantabulose skin per Plone senza doverne conoscere nemmeno il nome. Non sono d'accordo, ma non è questa la sede per discuterne. Di sicuro con Plone 5 si farà il grande salto e per allora dovremo essere pronti con il paracadute sulle spalle.

XDV è il fratellino semplificato di Deliverance, che ha il grande vantaggio di essere installabile come egg in pochi passaggi ma, proprio per questa sua estrema semplificazione, non offre tutti i vantaggi del fratello maggiore. Dopo la Conference potrei ricredermi: durante un open-space con Nate Aune e Denys Mishunov si è parlato dei continui miglioramenti fatti proprio per avvicinare XDV a Deliverance, non ultimo l'integrazione delle espressioni condizionali.

Haran... Banjo?

Questa davvero non me l'aspettavo e mi ha colto di sorpresa. Nate Aune ha presentato, sia in un talk che agli sprint, questo nuovo progetto Deliverance-oriented. Banjo è pensato per creare velocemente e interattivamente (TTW) le rules di posizionamento dal sito padre al tema Deliverance. Qualche clic e via! Attendo curiosa e fiduciosa gli sviluppi di questo tool: non credo che potrà eliminare completamente l'intervento sul codice ma aiuterebbe e semplificherebbe la vita agli skinner di primo pelo.

JQueryTools

Già da Plone 4 vedremo parecchi effetti speciali: tutto è pensato nell'ottica di ridurre al massimo il numero di clic necessari per le operazioni più semplici (login, impostazione di un oggetto come vista predefinita et similia). Ne ha parlato ampiamente Eric Steele al suo talk "A Look at Plone 4". Si potrà fare uso (e abuso?) di effetti come overlays, tabs, accordions: vi rimando alla presentazione di Steve McMahon per approfondire l'argomento. Quanto impatterà tutto ciò nell'applicazione di una grafica uniforme al nostro sito Plone? E quanto, soprattutto, si potranno applicare questi effetti senza perdere accessibilità (nel senso stretto del termine, quello ben noto a chi deve fare i conti con la legge Stanca)? Lo scopriremo solo vivendo :)

Conclusioni

Questa è stata solo la mia seconda Conference, ma rispetto alla precedente (Washington D.C., 2008) ho notato un interesse molto più forte verso il lavoro dello skinner: i talk e gli open-space dedicati erano tanti e piuttosto affollati, capitava spesso di essere presentati a guru ploneschi che elargivano complimenti e pacche sulle spalle. Qualcuno ha persino azzardato l'ipotesi di creare un CSS Zen Garden per Plone :)
Adesso non resta che portare un po' di questa sferzata d'energia anche nella comunità italiana... si potrebbe forse iniziare da un bel restyling di Plone.it? ;)

Nov 16, 2009

A Tiny step for more accessibility in Plone

by Luca Fabbri — last modified Nov 16, 2009 09:41 AM

In last months I'm keeping updated a branch of TinyMCE that can be very interesting for Italian users of Plone (but not only...)

For a preamble for all who didn't know nothing about it, lets me say some words on the Italian law for accessibility: the so called Stanca Act.

The Italian Legislation on Accessibility force all newly created public websites to keep 22 requirements, mainly taken from the WCAG 1.0.

For how Plone is designed (trying to fulfil the WCAG at AA level) a lot of required work is just done (I really like when this happen)!

There are only 2 requirements that keep our head busy every time we develop a new site for an Italian public agency:

Requirement 1
The (X)HTML must follow the Strict DTD.
Requirement 10
"[...] associate data cells and header cells in data tables that have two or more logical levels of row or column headers."

For us the requirement 1 is a fight against the Transitional DTD of Plone (see also the #4379). Of course, this mean we are always forced to fix manually some Plone templates, but at the end after 4 year this become a well know job!

The real problem is the XHTML code that users put inside the WYSIWYG editor... this must provide us XHTML Strict code someway!

When Kupu was the Plone choice this was a difficult... sometimes our choice was to put a layer between the editor work and the end user, fixing the code using the uTidylib!

In the perfect world the WYSIWYG editor itself must return us the XHTML Strict code...

Again: the requirement 10 is also a WYSIWYG editor problem. Kupu is not helping us to add additional cell info on created tables.

Welcome TinyMCE

The future (but already available) WYSIWYG editor for Plone 4 is TinyMCE.

The output code of TinyMCE is "more strict" than the Kupu ones... only some minimal fixes are needed. If facts the only validation error found right now if the use of the type attribute for ordered and unordered list (not available in XHTML Strict).

We are keeping updated a TinyMCE branch you can download and test from the collective; it fix the 2 problems described.

First of all: it's not using the type attribute again, but instead it applies a CSS class. An additional small stylesheet make the rest. For details see changes.

The other missing feature is to help the editor to add more attribute to table cells and headers. The simpler solution from the W3C is to provide the scope attribute.

When I started this task I was sure that this was going to steal me a lot of time... but again TinyMCE was a nice surprise!

The patch applied is simple; for some reason TinyMCE support the scope natively but it's disabled (probably only in the Plone version?). As you can see in changes done, my work was very quick (and again: I like when this happen)!

And now?

Keeping updated the code is a quite simple task, but I don't like the idea to branches forever. Also note that:
  • The first fix above is also valid for XHTML Transitional pages
  • The new scope attribute feature can be useful also outside a Stanca Law environment.

So?

We proposed to merge those changes in the TinyMCE core!

Keep one eye on #115 and #131!

Nov 13, 2009

How to write funkload test in few minutes

by Andrew Mleczko — last modified Nov 13, 2009 04:50 PM

After PloneConf2009 I noticed interesting changes in collective.recipe.funkload. Right now writing a simple test for funkload is just few steps.

After Plone Conference 2009 I noticed interesting changes in collective.recipe.funkload and in collective.funkload itself. Right now writing a simple stress test for funkload is much easier - you can do it in few steps.

Let's start with creating a simple package called mytest:

$ ls ./mytest
boostrap.py buildout.cfg setup.py src

$ ls ./mytest/src/mytest
__init__.py tests

$ ls ./mytest/src/mytest/tests
__init__.py test_Simple.py Simple.conf

 

buildout.cfg is also simple:

[buildout]
develop = .
parts = funkload    

[funkload]
recipe = collective.recipe.funkload
url = http://www.plone.org
eggs = mytest


where www.plone.org is the url to the site you want to test (it doesn't need to be on you localhost)

Now the funkload test configuration file (Simple.conf):

[main]
title=Simple
label=Simple test for blog.redturtle.it
description=Simple test scenario

[test_Simple]
description=Simple test scenario

[ftest]
log_to = console file
log_path = Simple-test.log
result_path = Simple-test.xml

[bench]
cycles =  5:15:30
duration = 100
startup_delay = 2
sleep_time = 2
cycle_time = 2
log_to = file
log_path = Simple-bench.log
result_path = Simple-bench.xml
sleep_time_min = 2
sleep_time_max = 2


In this example most important bench configurations:

  • cycles = 5:15:30  - contains 3 cycles: for 5, 15 and 30 concurrent users
  • duration = 100 - duration of one cycle in seconds
  • startup_delay = 2 - time to wait between starting-up threads in seconds
  • sleep_time = 2 - time to wait between test in seconds
  • cycle_time = 2 - time to wait between cycle in seconds

And the funkload test scenario (test_Simple.py)

import unittest
from collective.funkload import testcase

class Simple(testcase.FLTestCase):
    """Simple load test scenario."""

    def setUp(self):
        """Setting up test."""
        self.logd("setUp")
        self.label = 'Simple test'
        self.server_url = self.conf_get('main', 'url')

    def test_ReadOnly(self):

        self.get(self.server_url + "/",
             description="Get /")

        self.get(self.server_url + "/login_form",
             description="Get /login_form")

        self.post(self.server_url + "/login_form", params=[
            ['came_from', self.server_url],
            ['form.submitted', '1'],
            ['js_enabled', '0'],
            ['cookies_enabled', ''],
            ['login_name', ''],
            ['pwd_empty', '0'],
            ['__ac_name', 'admin'],
            ['__ac_password', 'admin'],
            ['submit', 'Login']],
            description="Post for login a user /login_form")

        self.get(self.server_url + "/folder/document1",
            description="Get /folder/document1")

        self.get(self.server_url + "/logout",
            description="Get /logout")

    def tearDown(self):
        """Setting up test."""
        self.logd("tearDown.\n")

def test_suite():
    return unittest.makeSuite(Simple)

additional_tests = test_suite

if __name__ == '__main__':
    unittest.main(defaultTest='test_suite')

 

It's a very simple scenario in which we are:

  • opening plone site (get /)
  • opening login_form (get /login_form)
  • sending a post with login credentials (post /login_form)
  • opening a document (get /folder/document1)
  • logout (get /logout).

Now you need to bootstrap the buildout:

$ cd mytest
$ python bootstrap.py


lunch the buildout:

$ ./bin/buildout


and lunch the bench:

$ ./bin/funkload bench -t mytest.tests.test_Simple


final report you can find in your buildout directory:

$ ls ./var/funkload/reports/2009-11-11-19-40-20
test_Simple-20091111T194020

$ ls ./var/funkload/reports/2009-11-11-19-40-20/test_Simple-20091111T194020
funkload.css  index.html  index.rst  tests.data  tests.gplot  tests.png


For more information please check:

Nov 12, 2009

Plone nuovamente premiato agli Open Source CMS Awards

by Cesare Brizio — last modified Nov 12, 2009 02:10 PM
Filed Under:

Dopo il secondo posto del 2007 e il primo posto nel 2008, Plone si conferma la miglior scelta nella categoria "other open souirce CMS"

Packt Publishing, uno dei leader nell'editoria relativa al software libero, organizza ogni anno il premio "Best open source CMS".CMS Award 2009

A partire dallo scorso Giugno, dopo che un panel di esperti ha selezionato i "top five" della categoria "Other open source CMS", i voti del pubblico sono affluiti fino alla fine di Ottobre, decretando il successo di Plone, come già nel 2008.

Per noi che conosciamo Plone e ci lavoriamo quotidianamente, questo risultato non è certo una sorpresa: per chi non lo conosce ancora, può essere un importante elemento di valutazione.

C'è da dire che, di anno in anno, gli organismi di terza parte che valutano i CMS con griglie molto severe, come il CMS watch, collocano regolarmente Plone ai livelli più alti come prestazioni complessive. E' importante diffondere il concetto che Plone è davvero un sistema completo e di classe enterprise, e interessa a tutti (a noi come ai Clienti) che riconoscimenti come questi stiano a dimostrarlo.

Plone Conference 2009 - un'esperienza da ricordare

by Cesare Brizio — last modified Nov 12, 2009 12:45 PM

Budapest, vecchi e nuovi amici, e molte cose interessanti come in tutte le Conference di Plone. Pare che anche RedTurtle sia piaciuta.

Due parole in più rispetto al precedente post di Massimo. 

Tra gli elementi di soddisfazione, oltre al solito clima costruttivo che la comunità sa offrire, è stata l'impressione che RedTurtle si sia costruita un suo spazio e una sua credibilità anche al di fuori dei confini nazionali: se ci aveva fatto piacere veder accettare due talk su tre proposti, ce ne ha fatto ancora di più vedere con quanto interesse siano stati accolte le nostre presentazioni.

Ci pare di capire che Carneade (presentazione, video youtube, e talk ustream) è piaciuto perchè è un'idea, trasversale rispetto agli scenari di impiego, per rappresentare in Plone le strutture organizzative reali in tutta la loro complessità,  e quindi ha un ampio ventaglio di applicazione sia nelle realtà pubbliche (il nostro tipico target), sia in quelle private.

Amberjack (presentazione, video youtube, e talk ustream), sebbene un po' meno "astratto", comunque risponde a un'esigenza diffusa, e sarà interessante vedere come la comunità lo farà crescere: l'idea di rendere i siti Plone sempre più autoesplicativi, trasformando un percorso guidato in un tutorial sulla tecnologia, sembra promettente.

La modestia è d'obbligo, quando si ha a che fare con chi ha creato una tecnologia e ne governa la roadmap, e quando ci si confronta con colleghi di aziende di tutto il mondo. Direi che, dopo Budapest, noi RedTurtle, sempre consapevoli dei nostri limiti, possiamo essere più tranquilli sulla nostra capacità di lavorare allo stesso livello degli altri sviluppatori mondiali Plone.

Nov 09, 2009

Ploneconf2009: un breve sommario

by Luca Fabbri — last modified Nov 09, 2009 09:41 AM

Archetypes è morto: lunga vita ad Archetypes

Trovo finalmente il tempo di riassumere i punti salienti della Ploneconf 2009 di Bupadest.

La grande verità

Per la prima volta dai tempi di Plone 2.0 sono davvero convinto che il nostro amato e ben conosciuto Archetypes venga lentamente mandato a morte. La sua sarà una lenta e non facile caduta e molto probabilmente i suoi pezzi vivranno fino ai tempi di Plone 5, ma a differenza di tutte le altre volte l'alternativa che si sta disegnando è reale e soprattutto da qualcosa che Archetypes non aveva.

Sto ovviamente parlando di Dexterity. Questo nuovo framework promette maggiore velocità (il talk di David Glick intitolato "Building Content Types with Dexterity" ha anche mostrato qualche cifra, ma nulla di eccezionale a dire il vero, un particolare confermato anche da Wichert Akkerman nel suo intervento di cui parlo sotto), si integra in modo completo con la ZCA e l'uso delle interfacce... ma non sono questi i particolari che credo determineranno il suo successo.

Per la prima volta non si sta semplicemente fornendo una modo alternativo, ideologicamente più bello ma nella pratica più limitato, per ottenere esattamente quello che Archetypes già fornisce (ho visto vari di questi tentativi in passato, e anche Rok Garbas ci ha riprovato nel suo talk intitolato "Complex Forms with z3c.form"). Dexterity offre una grande nuova funzionalità che è la generazione dei contenuti via Web!

Per chi di voi ha già usato prodotti come ATSchemaEditorNG e derivati, questo potrebbe non sembrare niente di veramente nuovo, ma questa volta la differenza sta nel fatto che questi contenuti saranno esportabili come codice perfettamente funzionante e modificabile.

L'utente Plone potrebbe quindi generare autonomamente i propri modelli dati e richiedere interventi di sviluppo sono per ottenere risultati che l'interfaccia Web non offre... eccezionale!

Le slide e gli esempi sono da analizzare (forse un tantino esagerata anche l'inclusione opzionale dei componenti Grok... ma lo perdoniamo).

Il prodotto attualmente presenta alcuni limiti e mancate funzionalità che non lo fa consigliare per la produzione, ma sono tutte cose che verranno facilmente superate nel breve. Probabilmente Dexterity diventerà lo standard dello sviluppo in Plone 4, convivendo (forse non troppo pacificamente) con Archetypes, per diventare l'unico ospite in Plone 5.

De-cosa?

Era dappertutto e se ne parlava dappertutto... Deco!
Confesso che non mi sono assolutamente interessato all'argomento fino alla conferenza e anche durante la stessa ho schivato tutti i talk a riguardo, poi mi sono ritrovato ad uno degli incontri nella terza giornata (dedicata agli Open Space) in cui l'argomento era "pagine composte" e l'intervento di Limi ha portato l'attenzione su questo nuovo giocattolo.

Deco si dovrebbe occupare solo del layout. Tutti noi potremmo continuare ad utilizzare l'approccio di oggi (creo un contenuto, genero la sua vista) oppure basarci sul layout Deco che permetterà il movimento dei componenti della pagina (tiles) tramite drag & drop.

A sentire Limi l'accessibilità della pagina (intesa come validazione del codice) rimane garantita se si parte da un buon XHTML. Vedremo!

A ruota libera

Essendo finiti gli argomenti principali, finisco con una breve panoramica su alcuni interventi minori che ho trovato per qualche motivo interessanti.

Euphorie: combining grok, dexterity sql content in a single application - Wichert Akkerman.
Wichert ci ha offerto un interessante talk su come usare Plone senza usare Plone. La descrizione di un progetto dove Plone veniva completamente privato di ogni suo componente (sharing, versioning, ...) e dove i dati venivano presi da database relazionale...
...forse conveniva non usare Plone? :-)

plone.app.discussion - Timo
Un veloce incontro negli openspace su un vecchio argomento mai completamente risolto (speriamo sia la volta buona) un nuovo prodotto, speriamo il nuovo prodotto, per gestire i commenti ai contenuti in Plone. Sarà compatibile con Plone 3.3 e diventerà parte del sistema in Plone 4.1.
plone.app.discussion promette la moderazione dei commenti e un workflow per questi, ovviamente personalizzabile. Era ora!

Very frequently asked questions answered for the last time :-) - Andreas Jung
Come potevo non partecipare? Chi di voi non è mai stato ripreso da A.J. almeno una volta?
La persona più "diretta" della mailing list plone-users che ripeteva per l'ennesima volta, nel modo più gentile possibile, alle domande che troppo spesso si è sentito fare (lo so... non erano davvero dirette a lui...).
Non mi sono stupito del suo intervento dopo la lunga discussione che è sfociata nel flaming poche settimane prima della conferenza...
Ho trovato divertente vedere come il giorno dopo qualcuno abbia comunque fatto domande troppo banali nella lista... e con lo stesso approccio di sempre abbia ricevuto in regalo le risposte di A. Jung!

Nov 07, 2009

RuPy conference

by Andrew Mleczko — last modified Nov 07, 2009 06:12 PM

Short summary about RuPy - strongly dynamic conference. The philosophy of RuPy is to put togheter Python & Ruby experts with young programmers and to support a good communication channel for East-West exchange of prospective ideas.

I have been delegated as a RedTurtle member to join RuPy conference that has been held in Poznan, my hometown city.

The idea behind the conference is to try to animate central- and east-european Python and Ruby communities. By inviting experts we want to broaden our knowledge and undersanding of presented concepts. The conference is meant to serve the exchange of ideas on the scientific ground, that is use of mentioned languages for certain scientific problems like, for example, text parsing, and on the buisness ground, like use of Django or Rails for creating web applications.

http://rupy.eu/about/


The state of Plone

short talk presented by Maciej Dziergwa about current Plone situation - based on Matt Hamilton's PloneConf2009 talk. After the talk we had a short discussion about current situation of Polish Plone Community. Plone is still not popular in Poland as it is in Italy...

Compiled Websites with Plone, Django and SSI

very interesting talk by Łukasz Langa and Wojciech Lichota about Plone, Django and SSI deployment. Using stxnext.staticdeployment you can deploy Plone site to static files. You can add dynamic stuff (like commenting) using Django. Finally you can glue everything together using Apache SSI mod_include. If you need search engine you can use and integrate, everything what I've mentioned before, with Xapian (or Solr).
You can find slides here.

Caching techniques in Python

some interesting caching techniques explained by Michał Domański and Michał Chruszcz. In Plone world we already know plone.memoize - a decorator for caching the values of functions and methods. You can use it of course outside Zope/Plone environment. If you need something more - check out i.e. pylibmc. At the end they've covered also reverse proxy with Varnish.

 

Oct 30, 2009

redturtle@ploneconf2009

by Massimo Azzolini — last modified Oct 30, 2009 09:50 AM

alcuni riferimenti ai talk che abbiamo tenuto alla plone conference in corso in questo momento

I talk presentati sono stati 2:

  1. Carneade, dar vita alle relazioni del mondo reale: Plone come gestore di organizzazioni
  2. collective.amberjack: Plone come piattaforma per i tutorial

Tutto il materiale è già in linea.

Carneade

  • La presentazione (su slideshare)
  • un video di presentazione del sistema (su youtube)
  • l'intero talk in streaming video (su ustream)

collective.amberjack

  • La presentazione (su slideshare)
  • un video di presentazione del sistema (su youtube)
  • l'intero talk in streaming video (su ustream)

Oct 16, 2009

Fast content import

by Andrew Mleczko — last modified Oct 16, 2009 08:19 PM

For one of our customers we have implemented a prototype for fast importing data to Plone. Instead of creating thousands of Archetype-based objects - we are creating only brains. Real objects will be created manually by users. The difference is huge.

The task was simple - import to Plone 36.000 documents (with all children it gives the total of 120.000 objects). Simply creating it using invokeFactory will take too much time (aprox. 14 hours). Why not create just brains and let users decide which document fully migrate? This is what we did.

We started with import script which creates brains in portal_catalog using directly catalog_object method:

pc = getToolByName(self.context, 'portal_catalog')
pc.catalog_object(dummy_object, dummy_object.path)

 

dummy_object is a simple python object with all metadata that we need later for portal_catalog query:

>>> pp dummy_object.__dict__
{'title': u'dummy title',
'id': u'simple_id',
'review_state': 'private',
'path': '/plone/importfolder/ToBeMigrated_simple_id'}

 

After lunching the script (it took 19 minutes) we had all the brains (36.000) in portal_catalog with proper metadata/index updated. Now we need to allow users to see them. So we created traverser for our importfolder:

def __bobo_traverse__(self, REQUEST, name):
    if name.startswith('ToBeMigrated'):
       view = getMultiAdapter((self, self.REQUEST), name='to_be_migrated')
       view.setBrainId(name)
       return view
    return super(ImportFolder, self).__bobo_traverse__(REQUEST, name)
 

which returns a simple BrowserView with the brain.id. The view has a template which informs end-user that this document need to be migrated. If he decided to import it - system will start import process for selected brain.id.
The rest is pure Plone folder_contents view which lists my 'dummy' brains in import_folder (cause the path in the brain is correct). Simple and much faster ;-)

 

 

Oct 14, 2009

New version of redturtle.video

by Federica D'Elia — last modified Oct 14, 2009 12:15 PM
Filed Under:

Released version 0.2.0beta of redturtle.video

A new version of redturtle.video was released on pypi:

http://pypi.python.org/pypi/redturtle.video/0.2.0beta

The package redturtle.video is a video support for Plone, based on collective.flowplayer.
In the new version of redturle.video two new fields are added to content types Video files and Video link. These new fields are "Year" and "Duration".

The information on the lenght of video is achieved through the use of packages: 'hachoir_core', 'hachoir_metadata' and 'hachoir_parser'.

The "Video Gallery" portlet shows content image fields taken from videos. In the new version "Video Gallery" portlet shows also the new informations on the year and duration of the video and also the title of the video.