Import existing photo album as external resources

The goal After migrating my website to plone I found it difficult to also import the ~ 1G of photos organized into JAlbum photo albums. The first approach was to create a separate mapping for the photo albums using: ProxyPass /photo ! ProxyPassReverse /photo ! in the apache configuration. This approach is not ok for the following reasons: photos are not managed into the CMS thus I will have the same problems as before for adding comments and modifying albums there is a different layout for the photo and other part of the site One initial approach I thought about is to just dump all the photos in CMS but this also presents another problems:...

December 8, 2006 · len

Please wait, tapestry component

This is the description of a tapestry component which can be used to display a please wait message for pages which take some time to load. The concept is simple. You have 2 pages. The one from which you go and the one which is supposed to follow which is rather slow. The first page contains a hidden div which gets visible when the user submits the form. This div is the one which you see with the animated gif and some explanatory text....

December 7, 2006 · len

Webapp logging

Applies to: JBoss 4.0.5 GA Everything started with a web application which worked perfectly inside a Tomcat 5 container and had to be migrated to JBoss. At the first deployment got this error: 14:45:56,496 ERROR [STDERR] log4j:ERROR The class "org.apache.log4j.spi.ErrorHandler" was loaded by 14:45:56,496 ERROR [STDERR] log4j:ERROR [WebappClassLoader delegate: false repositories: /WEB-INF/classes/----------> Parent Classloader:java.net.FactoryURLClassLoader@172bab9] whereas object of type 14:45:56,497 ERROR [STDERR] log4j:ERROR "org.jboss.logging.util.OnlyOnceErrorHandler" was loaded by [org.jboss.system.server.NoAnnotationURLClassLoader@19616c7].14:45:56,542 ERROR [STDERR] log4j:ERROR Could not create an Appender....

December 3, 2006 · len

CD/DVD writing

Notice If you are searching for nice looking menus and buttons, the windoze way, you will not find this here. It’s only about command line options, what the buttons and menus hide. Count your files du -ch --max-depth=1 /data/ --exclude=poze Create the .iso file Everything starts with an .iso file which represents the image of the CD/DVD to be written: mkisofs -r -l -allow-leading-dots -J -hide-rr-moved -x /data/poze -o /tmp/data.iso /data This creates a /tmp/data....

December 3, 2006 · len

Limit recent portlet entries

This is a very short modification to the portlet_recent.pt template in order to limit the number of displayed entries from 5 to 3. The original template: ...<br></br><tal:recentlist tal:define="view context/@@recent_view;<br></br> results view/results;"><br></br><dl class="portlet" id="portlet-recent"><br></br><br></br> <dt class="portletHeader"><br></br> <span class="portletTopLeft"></span><br></br> <a href="http://www.len.ro/work/cms/limit-recent-portlet-entries" <br></br> tal:attributes="href string:${portal_url}/recently_modified"<br></br> i18n:translate="box_recent_changes">Recent Changes</a><br></br> <span class="portletTopRight"></span><br></br> </dt><br></br> <tal:items tal:repeat="obj results"><br></br> <dd class="portletItem"<br></br>...<br></br> The modified template: ...<br></br><tal:recentlist tal:define="view context/@@recent_view;<br></br> results view/results;<br></br> subresults python:results[:3]"><br></br><dl class="portlet" id="portlet-recent"><br></br><br></br> <dt class="portletHeader"><br></br> <span class="portletTopLeft"></span><br></br> <a href="http://www.len.ro/work/cms/limit-recent-portlet-entries" <br></br> tal:attributes="href string:${portal_url}/recently_modified"<br></br> i18n:translate="box_recent_changes">Recent Changes</a><br></br> <span class="portletTopRight"></span><br></br> </dt><br></br> <tal:items tal:repeat="obj subresults"><br></br> <dd class="portletItem"<br></br>....

December 1, 2006 · len

JMX invocation with secured console

Applies to: JBoss 4.0.5 GA As I am working on a rather complex application with a lot of dependancy bounded MBeans I found it necessary to have a small application, in a different JVM, invoke a MBean method for administrative purposes. Even if this sounded easy at the begining it seemed that I had to face 2 problems: JBoss JMX implementation JAAS access to the secured console Since I both googled and searched JBoss forums without much help I decided, upon succeding, to write this article as it might help someone futher....

December 1, 2006 · len

Tapestry Ajax application

As I have been working with Tapestry for more than a few years now it only seemed natural to choose it for this new project I started working on. At it requires a lot of partial rendering and GUI like behaviour I also decided to switch from some custom ajax components to the tacos ones which have an impressing demo. This short article only shows a simple example which has as purpose to use Tapestry 4 and Tacos components for simple task: a page with parts refreshing periodically to update status information....

November 24, 2006 · len

xmlIndent.py

<pre class="python"><span style="color: #008000;">#!/usr/bin/python </span> <span style="color: #c00000;">import</span> <span style="color: #000000;">sys</span><span style="color: #0000c0;">,</span> <span style="color: #000000;">re</span> <span style="color: #000000;">iE</span> <span style="color: #0000c0;">=</span> <span style="color: #004080;">' '</span> <span style="color: #000000;">pStart</span> <span style="color: #0000c0;">=</span> <span style="color: #000000;">re</span><span style="color: #0000c0;">.</span><span style="color: #000000;">compile</span><span style="color: #0000c0;">(</span><span style="color: #004080;">'<[a-z]+'</span><span style="color: #0000c0;">,</span><span style="color: #000000;">re</span><span style="color: #0000c0;">.</span><span style="color: #000000;">IGNORECASE</span><span style="color: #0000c0;">)</span> <span style="color: #000000;">pEnd</span> <span style="color: #0000c0;">=</span> <span style="color: #000000;">re</span><span style="color: #0000c0;">.</span><span style="color: #000000;">compile</span><span style="color: #0000c0;">(</span><span style="color: #004080;">'(/>)|(</[a-z]+)'</span><span style="color: #0000c0;">,</span> <span style="color: #000000;">re</span><span style="color: #0000c0;">....

November 23, 2006 · len

Create links with a script

This shows a very simple example on how to create content dynamicaly. The problem: automatically populate a folder with a list of links The solution: 1. create a script object in that folder (using the zope interface) 2. edit this script to create the links using data from a source (in my case I just wrote an external script which generated the array but in your case you might read the list from different other sources...

November 22, 2006 · len

The novice steps from www.plone.org to mysite running plone

As I start working on my 3’rd plone based site I realize how hard everything was at the beginning and for this reason I will try here to put together some small pointers and links to resources in the order I would have needed them at the beginning thus avoiding the first days of confusion. The sites I have worked on are small sites and maybe plone is not the best solution yet I came to like this handy tool enough to use it even for my personal site....

November 22, 2006 · len