plonewars.com

August 6th, 2007

Ian Bicking: Tempita

I mentioned a templating language I put into Paste a while ago, but since then I extracted it into a separate package called Tempita. I think the documentation is fairly complete (it’s a small language), but I’ll describe it shortly here.

I wanted a text-substitution language, because I wanted something to be used to generate Python files, config files, etc. I also didn’t want a complex API, with search paths and components or something that interacts with import machinery, or any of that. string.Template is almost good enough, but not quite.

I started with the idea of something vaguely like Django Templates, though since I didn’t care about more advanced templating features like blocks that didn’t apply to my use cases. You do variable substitution with {{var|filter}}, and there’s no escape character, and that’s about where the similarity ends.

I realized there was no real reason to use anything but {{…}}, so it’s just {{if expr}}, {{endif}}, etc. There’s an escape for arbitrary Python, similar to how Kid does it — you can have blocks of Python code, but the Python code can only prepare variables and functions, it can’t write anything. I think this gives a nice escape for complex logic (for times when you can’t put the logic in a .py file), without the jumbled mish-mash of languages like PHP where you can trully mix functions and output.

Because it allows Python expressions everywhere, special tags don’t seem so necessary. Instead you can just provide functions to do whatever you need. I wrote a couple little ones as a start. There’s a few things that are awkward still, because there’s no way to define a block of template as a function, or pass the output of a block to a function. I haven’t actually needed these yet, but I can imagine needing this (e.g., when creating nested structures).

I wouldn’t suggest using this templating language in a web application, but I think it can be quite helpful for all the cases where you have to generate text and you aren’t writing a web application (e.g., a Framework Component). In my experience the web templating languages tend to be complex to invoke and understand in these contexts (and Buffet unfortunately doesn’t help in my mind, as it’s loading system is so vague).

Ian Bicking: Tempita

Originally from Planet Plone by Ian Bicking


from Yoda http://plonewars.com/2007/08/06/ian-bicking-tempita/







August 6th, 2007

Security overview of Plone — Plone CMS: Open Source Content Management

Security overview of Plone — Plone CMS: Open Source Content Management

Originally from del.icio.us/tag/plone by josadeluca


from Yoda http://plonewars.com/2007/08/06/security-overview-of-plone-%e2%80%94-plone-cms-open-source-content-management-2/







August 6th, 2007

Tom Lazar: Bitten by the Twitterbug…

Ok, I too, have finally succumbed to the ‘twitterbug’ and have created my own account (the id ‘tomster’ was taken already, guess I really was too late for that one…)

To complete my conversion I’ve created a quick-and-dirty portlet that display my latest entries… uhm… ‘twitters’… Just create a ‘Page Template’ named ‘portlet_twitter’ in your ‘plone_skin/custom’ folder and paste this into the ZMI:

<!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01//EN”>
<html xmlns:tal=”http://xml.zope.org/namespaces/tal” xmlns:metal=”http://xml.zope.org/namespaces/metal” i18n:domain=”plone”>
<body>
    <dl metal:define-macro=”portlet” class=”portlet” id=”twitter_div”>
        <dt class=”portletHeader”><a class=”twitter-title” href=”http://twitter.com/TWITTERID/”>Twitter updates</a></dt>

        <dd class=”portletItem”>
            <ul style=”margin-left: 0; list-style-type: none; list-style-image: none;” id=”twitter_update_list”></ul><script type=”text/javascript” src=”http://twitter.com/javascripts/blogger.js”>
</script> <script text=”text/javascript” src=”http://twitter.com/statuses/user_timeline/TWITTERID.json?callback=twitterCallback2&amp;count=5″ type=”text/javascript”>
</script>
        </dd>
    </dl>
</body>
</html>

You will (obviously) need to replace TWITTERID with your actual twitter id, of course. You can then refer to it with the expression ‘here/portlet_twitter/macros/portlet’ in the root properties of your site. This will work up to Plone 2.5.x.

A nice side effect of it using Javascript is that I won’t even have to touch my caching setup in order to have live updates on my site.

I’ll see where this will take me. I’m viewing it primarily as lowering the threshold to posting tiny little bits that I find interesting. (So expect lots of stuff around Python, Zope and Plone…)

Tom Lazar: Bitten by the Twitterbug…

Originally from Planet Plone by Tom Lazar


from Yoda http://plonewars.com/2007/08/06/tom-lazar-bitten-by-the-twitterbug/







August 6th, 2007

Busman’s Holiday

Busman’s Holiday

Originally from del.icio.us/tag/plone by gustavorahal


from Yoda http://plonewars.com/2007/08/06/busmans-holiday-2/







August 6th, 2007

Intranet Portal - Intranets, Portais Corporativos e Gestão do Conhecimento

Portais Corporativos, Intranets e Gestão do Conhecimento

Intranet Portal - Intranets, Portais Corporativos e Gestão do Conhecimento

Originally from del.icio.us/tag/plone by andrax


from Yoda http://plonewars.com/2007/08/06/intranet-portal-intranets-portais-corporativos-e-gestao-do-conhecimento/







August 6th, 2007

Java PC Virus downloader on my MAC???!!!

Java PC Virus downloader on my MAC???!!! sarmomemt Software, Apple, Mac Read on I ( … into with this site I plan on using a CMS (content management system) - I chose to use Plone.  It has all of the features I want unlike Drupal or Mambo and I don’t have to spend 20k on an enterprise CMS.  Plone is used

Java PC Virus downloader on my MAC???!!!

Originally from [Technorati] Tag results for plone


from Yoda http://plonewars.com/2007/08/06/java-pc-virus-downloader-on-my-mac/







August 6th, 2007

Fast CGI that isn’t FastCGI | Ian Bicking: a blog

Fast CGI that isn’t FastCGI | Ian Bicking: a blog

Originally from del.icio.us/tag/plone by hauser


from Yoda http://plonewars.com/2007/08/06/fast-cgi-that-isnt-fastcgi-ian-bicking-a-blog/







August 6th, 2007

Ian Bicking: Atompub & OpenID

One of the thinmgs I would like to do is to interact with Atompub (aka Atom Publishing Protocol) stores in Javascript through the browser. Since this effectively the browser itself interacting with the Atompub server, browser-like authentication methods would be nice. But services like Atompub don’t work nicely with the kinds of authentication methods that normal websites use. One of these is OpenID, which is particularly browser-focused.

From the perspective of a client, OpenID basically works like this:

  • You need to login. You tell the original server what your OpenID URL is, somehow.
  • The original server does some redirects, maybe some popups, etc.
  • Your OpenID server (attached to your OpenID URL) authenticates you in some fashion, and then tells the original server.
  • The original server probably sets a signed cookie so that in subsequent requests you stay logged in. You cannot do this little redirection dance for every request, since it’s actually quite intrusive.

So what happens when I have an XMLHttpRequest that needs to be authenticated? Neither the XMLHttpRequest nor Javascript generally can do the authentication. Only the browser can, with the user’s interaction.

One thought I have is a 401 Unauthorized response, with a header like:

WWW-Authenticate: Cookie location="http://original.server/login.html"

Which means I need to open up http://original.server/login.html and have the user log in, and the final result is that a cookie will be set. XMLHttpRequest sends cookies automatically I believe, so once the browser has the cookie then all the Javascript requests get the same cookie and hence authentication.

One problem, though, is that you have to wait around for a while for the login to succede, then continue on your way. A typical situation is that you have to return to the original page you were requesting, and people often do something like /login?redirect_to=original_url. In this case we might want something like /login?opener_call=reattempt_request, where when the login process is over we call window.opener.reattempt_request() in Javascript.

Maybe it would make sense for that location variable to be a URI Template, with some predefined variables, like opener, back, etc.

For general backward compatibility, would it be reasonable to send 307 Temporary Redirect plus WWW-Authenticate, and let XMLHttpRequests or other service clients sort it out, while normal browser requests do the normal login redirect?

Ian Bicking: Atompub & OpenID

Originally from Planet Plone by Ian Bicking


from Yoda http://plonewars.com/2007/08/06/ian-bicking-atompub-openid/







August 6th, 2007

Thumbs Up for Plone

Here’s a really refreshing take on the GPL license from the Plone CMS, as quoted from their License FAQ: You suck! The GPL sucks! The contract is unacceptable! Everything should be license X! Et cetera. Blind ideological wars are tiresome and will simply damage Plone. We have chosen the GPL as our license, and are sticking with that for now

Thumbs Up for Plone

Originally from [Technorati] Tag results for plone


from Yoda http://plonewars.com/2007/08/06/thumbs-up-for-plone/







August 6th, 2007

Nabble - Plone for organizing chairs and research institutes

Nabble - Plone for organizing chairs and research institutes

Originally from del.icio.us/tag/plone by cjohansen


from Yoda http://plonewars.com/2007/08/06/nabble-plone-for-organizing-chairs-and-research-institutes/