Older blog entries for zanee (starting at number 204)

DublinCore Metadata

So, most of us have heard of DublinCore before, which is why I'm not going to into a long spiel introducing it. What I want to talk about is the lack of use it gets. Realistically, no one is using DublinCore in an exposed useful manner . Meaning, when my developer cap is on I can easily pull DublinCore associated data from an object. When my administrative or user cap is on it becomes near impossible. Exposing this metadata set is important! As a user I want to know what the rights are, or who created a specific object/resource/page whatever. As a developer I'd like to pull this data and mash it up with my own development.

Yes, I know what you just said. The meaning for the terms in the element set are so obtuse that it can be interpreted almost in any fashion. Thinking about the possibilities becomes almost mind numbing. .oO "Simply the standard is broken by not being specific enough Mr. Christopher, blah blah, lets hit this beach". "Whatever dude, who cares.. no one. that's who. No one gives a shit, pardon me while I drink this beer..."  It need not be so however. Instead of recreating ones own metadata set which is doing the same exact thing. We should be looking towards exposing this data and then ADVERTISING that it's available. It's also easy to simply generate the required data for most of the 15 resources with ease.

How does this help? Well, at the very least people who respect each others Copyrights/Rights and would like to give attribution will know exactly who or what institution to give it to. As well as helping to nail down where data originates etc. It's not perfect by any means and the holy grail solution most likely exist in a W3C standard that gets accepted by the major browsers.

In the meantime maybe it's high time the DCMI community came up with some badges that simply state "This site or resource is DubliCore aware" or "These resources have DublinCore metadata attached" or just a graphic that highlights that we can indeed review or pull the metadata. There is a nice plugin for Firefox called Dublin Core Viewer that does this. Also exposing the data as naturally as possible ie: "Creator" == name of user or some such is also generally good behavior. "Goddd, you're still yapping about this?? Ronnie, pass me another beer.. i'm gonna leave if you keep talking this clickety-click bullshit".

ok.. I'm done... for now.

Share/Bookmark

Syndicated 2010-07-09 14:41:36 from Christopher Warner » Advogato

1 Jul 2010 (updated 1 Jul 2010 at 03:17 UTC) »

Temporarily granting manager permissions with Plone

Recently I had to "sudo" with Plone while updating @@personal- information/member data. However, as a authenticated user you can't do this even if it's for your own member data. It's been like this forever but it always gets me because there is no error. It just silently fails. The only way around this is to essentially grant permission to the contexted user through USER.manage_permission. Where USER is whatever context you're in. So you could do something like the below which grants the Manager and Authenticated roles temporarily to a user and then removes them.

USER.manage_permission("Manage users", roles=['Manager', 'Authenticated'], acquire = 1) #ON
member = membertool.getAuthenticatedMember()
member.setMemberProperties(mapping={"CVReference": uri})
USER.manage_permission("Manage users", role=['Manager', 'Authenticated'], acquire = 0) #OFF

Yes, it is a little ugly but it's better than having to do some script trash if you can traverse and get membertool. Also, it's safe unless something goes terribly wrong with membertool in which case we could probably wrap that up in a try/except clause and run acquire = 0 at the exception.

Share/Bookmark

Syndicated 2010-07-01 03:10:04 from Christopher Warner » Advogato

29 Jun 2010 (updated 29 Jun 2010 at 04:50 UTC) »

PyCurl update

So I haven't worked on PyCurl for a couple of weeks and received some email thanking me about all of the fixes to cvs head but why I haven't made a release. The issue is that the PyCurl releases were aligned specifically with libcurl and there is a need to keep that congruency. If I update to 7.19.2, then I have to add the abi/api changes that went in for 7.19.1.

Obviously, if I'm going to make a release I may as well target the latest version of libcurl with all of the updated changes that have occurred in that space of time. Also, even though ISAW (Institute for the Study of the Ancient World) is gracious with my time on opensource projects. There is a lot going on right now priority wise so I haven't had work time to spend with it. Needless to say if you have a patch that fixes a bug; or you have found a bug you would like me to diagnose. I'll do so, so long as it's for the current code base. For those of you having problems the fixes are most likely in CVS- HEAD. You can grab that code from my Github repo or from the Sourceforge repo

Share/Bookmark

Syndicated 2010-06-29 03:56:57 from Christopher Warner » Advogato

Zotero is a walled garden.

I've been pretty busy lately, as most of you know I haven't been doing much of anything with linux and have essentially been quiet about my content management activities with few exceptions with Plone here and there (the 27th draws near). Really i've been busy with life, laying low, getting ready for another leg of study, playing pool, trying to get these street signs changed, etc. However I would like to take a moment to talk about some of the tools that have crossed my path and some of what I am working on. I will try my best to keep this as short as possible, primarily because I want to go on my run and it's already late. First up, Zotero, and let me state my employer does not condone anything that comes out of my mouth on my blog and in general may fully disagree. At work I myself may extoll Zotero as a virtue of progress or some such but I'll preface that with a "I wouldn't use it myself"

Zotero is a powerful, easy-to-use research tool that helps you gather, organize, and analyze sources and then share the results of your research.

Yes, the above is true, except for the "share the results of your research piece". You see, Zotero is a walled garden. The inherent problem is that Zotero simply doesn't have an API that allows anything other than Zotero to utilize the data that is put there. I'll give you a simple example. Remember the Compact Disc Data Base aka Gracenote? For sites opensource/frees software sites in syndication this will ring a bell immediately but remember when they said to all of us young ripe teenagers, with all of our cd's and our xmms players in the upper right of the screen, that if we put all of our info into the CDDB and use their tools that we would make it so much easier to share with each other what exactly we were listening to? Do you remember what Gracenote did?  They simply took all of our data and then sold it back to us via licenses. To this day all of us pay a small license to CDDB via our music players (hardware and/or software) to Gracenote for the privilege of the data we provided them; and people STILL provide this data unknowingly! Don't believe me? Click About in iTunes or whatever music player you are using and most likely you'll see Gracenote scroll by. Luckily Freedb came to fruition but it still lags behind Gracenote at this point and so, commercial institutions just purchase the license from Gracenote and pass the cost onto us.

Of course you see, fool me once......*BLINK*  can't be fooled again! Joking aside, it is obvious the data and uses for it, especially bibliography information becomes important. Regardless of just citing an author or work in specific, sharing cited material in any fashion you deem necessary can be a very, very, powerful thing. The use cases become impressive. For instance, being able to cite an author or a list of works from an author and displaying only citations that reference certain type of material. Or drawing a graph based on works that maybe related. With the goal of helping and aiding you in your research. Or even seeing what authors you may have the most in common with based upon works you've cited. Ideas like that become just the tip of the iceberg, for which one needs a powerful, robust and completely open engine. If i'm going to use a tool that I have to input data into I want access to that data in any fashion deemed necessary when I want it and obviously I do not want to have to pay for the privilege.

So, while i'm laying low, getting ready to start another leg of study. Tools like this have crossed my path and they have been championed to me. After taking a look at Zotero, and needing a solution in the interim to scratch my own itch it became clear that something would have to be done. To be honest I wasn't even interested in the tool and could have cared less as I'm not writing any immediate papers. It only became an issue when I had to interoperate with Zotero. Initially I sent email asking for access to the API in which I was told that it was imminent in it's release and that I could try essentially web scraping. Part of me thought it was a joke or maybe my question was misunderstood but the response I received was untenable, unacceptable and generally I wasn't a big fan of the tone in that regard. Also, searching the Zotero website didn't bolster any confidence in me. It seems everyone likes the tag "Open" nowadays but doesn't really like to be Open. We in the free software community are quite familiar with this type of shenanigan and frankly I get tired of it. It's rather funny because in research for this post I came across a quote from George Mason University from whence Zotero was born "anything created by users of Zotero belongs to those users, and that it should be as easy as possible for Zotero users to move to and from the software as they wish, without friction." This in a response to Thomson Reuters who sued GMU in regards to what they feel as Zotero developers reverse engineering EndNote and violating their EULA agreement. Unfortunately, at this time, and from what I have seen that statement is not factual. Maybe applied to EndNote in specific but obviously I want my data as I want it and specifically I want it available to me on the web.

All of the above is testament considering we are into lawsuit territory here, that a truly open and free API is needed for bibliographic data. I should note that Thomson Reuters also produces a tool called OpenCalais which I've spoken about numerous times here before and have used myself on numerous occasion for which one doesn't enter data and it is free and open. "There is no plan to someday "drop the other shoe" and charge folks for the basic service."

All of this leads up to the fact that I don't readily have much time but I am putting some stuff together and will most likely be releasing a prototype of my work. In which case I'd hope that a community of developers can build on it and make it greater etc etc. To my knowledge Zotero is planning to release some api/server kit which is good news. I'm not holding my breath.

That's one simple example of what I am doing now, and I can probably go on but suffice to say to the people that are reading this. My friends who are fellow grad students in teacher and lit programs, my lawyer friends and the list goes on. Please do not use Zotero. At least, not if you really care about accessing your data or sharing it.

It took too long to write this up and semi proof read so now I'll probably forego the run and just watch True Blood unless someone wants to volunteer as a run partner tonight. In which case, i'm down if you wanna do 3-5 miles.

Share/Bookmark

Syndicated 2010-06-23 03:48:31 from Christopher Warner » Advogato

If you are an OpenID Provider please publish your URI for endpoint discovery

If you are an OpenID provider and don't have a published domain or URI where others can search and begin discovery for an OpenID endpoint and services within that resource you aren't helping the adoption of OpenID.

On this list as of current is nearly every provider utilizing OpenID right now. Developers have to waste time searching the internet or obtuse and decaying documentation to figure out where we can start searching for an endpoint in your domain. How about making this information easily available and keeping it updated on a regular basis? At this point I want to just provide my own list but the onus shouldn't be placed on a third-party so I will refrain for now.

Share/Bookmark

Syndicated 2010-06-22 18:47:52 from Christopher Warner » Advogato

Twitter, kindly get your shit together

When is this going to stop? It's ok to tell the media or your users that it's because you're growing rapidly but to anyone in the know. This is unacceptable. I don't even use Twitter regularly and it's becoming an issue for me. I'm sick of seeing this idiot smiling whale and you don't support OpenID anymore? Come on.. get serious. You have to handle short byte messages at a rapid rate.. people are doing this everyday. Ask Google or for that matter any large media company to loan you one of their engineers for a day.

Share/Bookmark

Syndicated 2010-06-22 17:33:13 from Christopher Warner » Advogato

Plone vs. Django

There seems to be a reoccuring fad of some sort comparing Plone vs. Django in regards to frameworks and content management systems. I'm a little confused as to how this is even possible but i'm going to put this safely to rest so that we can all move on.

Plone and Django are not comparable because they are two different things. If you are talking to someone and they are comparing Plone and Django to each other in any fashion you may want to inquire how much experience this person has as a programmer/web consultant or whatever they are calling themselves.

Plone is a content management system through and through. An application built upon the Zope stack which for all intents and purposes you can compare to the familiar Lamp stack. It's the most mature fully functional and featured opensource content management system on planet Earth. It comes with cache, security, workflow, process management, revision control, one could go on. If you need to manage some content; whatever it maybe. That is what Plone is good for.

Django on the other hand is a web framework/toolkit that allows one to build a rapid application using Python. So as far as a content management system goes you'd have to program all of the above features yourself. There is a project called Django-CMS which does exactly that but even in cursory review of the website it doesn't have 5% of the features of Plone.

So can you compare Django and Plone? No. The two are completely different things. I guess you could compare Plone to Django-CMS but seeing as it's in its infantile stages that would not be fair. Anyway, in short, people comparing Plone vs. Django? Idiocy.

Share/Bookmark

Syndicated 2010-06-01 18:12:10 from Christopher Warner » Advogato

Steve is right.

Let me note. What you are about to see is unedited. I've collected the window but have a full picture available.  Note, nothing is running on this machine with the exception of some background processes. Chrome was fully quit. I came home to a machine that was chewing disk and slow. This is on a 2 x 2.8 GHz Quad-Core Intel Xeon Mac Pro with 6 GB of 800 MHz DDR2 ram. Steve is right. Anyone can say whatever they want to me at this point, my mind was already made up before Steve. The factual evidence continues..

Image of Flash failing

Flash failing

Share/Bookmark

Syndicated 2010-05-27 22:37:18 from Christopher Warner » Advogato

Writing good documentation and presenting your work.

I'm going to make this short. Writing good documentation is extremely difficult which is why it rarely happens. When it does happen you get a readable article, book or column that reaches you in its intended fashion. Whether it be to teach or inform it is a practice to satisfy the readers hunger for which they are reading said article, book or column in the first place. So imparting with knowledge in a sane and coherent fashion is an art that I feel has simply been lost to convoluted grand-standing and the feeling that one should not have to "dumb-down" a topic in order to reach the reader. There is the argument that there are levels of scope in which one needs to have a full understanding before they can begin to understand the terminology. It's valid in some corner case where one would expect that understanding to already exist but if the documentation doesn't take that into account. It is not accessible and needs to be written again.

This is a problem specifically with science but more-so in regards to technical manuals and such. Some of the smartest people still have problems writing ACCESSIBLE documentation. So here are some guidelines you can follow to make your documentation more accessible so that it satisfies the hunger of your reader.

  1. Outline and detail every step no matter how mundane in as precisely a way as you can. (this involves a lot of work you may deem pointless like typing out the command cd /directory)
  2. If a topic needs another piece of documentation, prevent straying away from the main course of the documentation. It's safe to note that the topic you are referencing or referring to needs an adjoining piece of documentation or has another piece of documentation that is referenced in biblio or towards the end of said documentation.
  3. Your reader maybe your peer and you may suspect this peer is as avid and learned on a topic as you yourself are. This is not always the case so NO acronyms if you can help it. For example, referring to HyperText Transfer Protocol in it's full expanded verbiage every other paragraph helps.
  4. Concepts of terse knowledge should be kept short and simple. There shouldn't be copious amounts of detail before another paragraph or chapter. I see this a lot.
  5. You may need more than one book; don't try to fit everything in one book. Let your reader take a break.
  6. There is no such thing as DUMB-DOWN. There is such a thing as copious amounts of detail. As a reader, I prefer the copious amounts of detail, again, as precise as possible. If I already know what I'm looking at I'm free to skip over it, please don't determine that for me. Obviously I'll note that you don't need commentary such as "please turn the page" as that is just you being stupid.
  7. Do not waste your readers time. If they can't follow your steps or create a picture with the words that you are writing. You are doing it wrong.
  8. DO NOT LOOK TO YOUR PEERS FOR REVIEW FIRST. Hand your book or topic to someone who has absolutely no idea what you are discussing. If they can understand or at least halfway follow some of the more terse conceptual pockets; THEN hand it to your peers for review. If they can also understand it, you've done a good job.

None of the above is simple but if you follow some of these guidelines it will help you. I can guarantee at the very least that I will most likely have very little to say in regards to your documentation, article, book etc. Well, at least in regards to readability.

Now onto presenting your work. Lately, over the course of the last year. I've consistently seen people work hard, work on papers, work on research with the understanding at some point that this data, research and such will be presented to an audience. They do all the hard work, and then arrive to present 5 minutes before hand confident in their work. Only to have all sorts of niggling issue with projectors, laptops, etc. This seems to be almost a fad, at my place of employment, at research facilities, at school, at the library. I see it, over and over and over. The only time where I've seen a truly affected issue is when a project bulb blew and this gentleman was so prepared he had a pico-projector and just continued on. Every other issue could have been solved if the person showed up an hour or so before their presentation.

Having your peers sit around like idiots while you try and fiddle with a projector is INSULTING. It is the difference between a brilliant presentation and a mediocre one. It also affects you as the presenter when you are trying to fiddle about with frustration, anxiety and heaven forbid the lack of presentation or rescheduling due to hardware failures. Here are some guidelines in order to look like a king and have rounds of ovation in your name.

  1. Once you feel you are ready to present. Present infront of a crowd of 0. Walk through your presentation several times with yourself.
  2. Avoid Powerpoint except to display visual images and bullet points. If you are reading directly from PowerPoint then why are we having a presentation? Just send the PowerPoint file to everyone and don't waste the time.
  3. TEST the presentation where ever you plan to host or present. Check the room or auditorium out, ask about web cameras, microphones (wireless,wired), lighting etc. ALL of it is important
  4. Do the above AGAIN. Walk through it all yourself if you have to
  5. Arrive EARLY to your presentation. I don't care who you plan to present to or for. Be there early.
  6. TEST AGAIN
  7. Treat your audience to a show of all your hard work. Bask in the glow of the ovation.. Answer 2-3 questions. Take off the suit tie and go home.

If you follow the above guidelines I can assure you that you will have a great presentation. Where things seemingly run smoothly to the audience. Little did they know you spent many a hour crafting your presentation specifically for them. At the very least I can guarantee that if you hold future presentations you won't look like an idiot infront of your audience; or at the very very least, you won't look like an idiot infront of me.

Share/Bookmark

Syndicated 2010-05-20 17:07:22 from Christopher Warner » Advogato

Creating a custom template for a Plone content type

So in the last example, Creating a Content Type for Plone 3.x, I provided steps for creating a content-type in Plone. The feedback has generally been positive and those steps can also be found on Plone.org (I try my best to keep both sync'd). What's the next step though? You've got your content-type and you've entered most of your data but now you want to display it in your own template. The number one thing I have heard from people is that they can't make Plone look like anything except Plone without extreme duress. Unfortunately, this is simply not true.

So, for example how do we get Plone from looking like this:

A Stock Plone install using Sunburst theme

To looking like this:

I stole this theme from oswd.org the author is Christopher Robinson

The answer is a concept known as Browser views. Now, there are two trains of thought here. One is that you want all of the default Plone interface to look a specific way. 9 times out of 10 that isn't the case. You probably don't want to theme your content management system the same way you don't go around changing the theme to wordpress/movabletype/drupal in edit mode. Some people do have a need for this but you probably aren't one of them.  The other train of thought is that you'd like for the content that you enter to be displayed in a certain visual context depending on where it is displayed. Lets be realistic, you will probably be displaying this primarily on a web browser but you may decide you need several different renditions depending on context and platform. So you may need a mobile version of the same content etc. Let us hop on this train of thought for a minute.

The first thing you'll want to do is change into the browser directory, so for example that would be something resembling:

/Applications/Plone4/zinstance/src/plone.dvd/plone/dvd/browser

We are going to create the file web.py because this view is for the web primarily. If we wanted to lets say create a mobile view or page we could make mobile.py or whatever we want to create a view for. In our case though we are just making an html page right now.

In it we are going to put the following:

A view of the Html Class

The HTML Browser View SubClass

This creates a class with methods that we can later access directly from our template should we wish to provide some custom functionality. It isn't explicitly required but unless your content-type is extremely simple or you can use default Plone methods for content-objects. You will most likely need it at some point. In the above example we simply return the string "Some people are still dreaming." when we call the still_dreaming method from the class Html which subclasses BrowserView.

That created and saved.  Let us now create our template. In this case I stole the following theme located on oswd at http://www.oswd.org/design/preview/id/3537. I unzip this into my directory and simply rename index.html to web.pt (where .pt stands for page template).

Here, a discussion on Zope Page Templates is required but I plan to save that for a larger document at some point and will replace this paragraph with that. In the meantime please visit this link.

So we want to take information from our content-type and display it on this template. Here is how we go about it:

Zope Page Template for our DVD Content Type

ZPT

Lets start with line number 7. It pulls in a stylesheet named dvd.css which houses all of the style for our html page including images that are related to the overall design. There are a couple of different ways to get Plone to recognize and use these type of files but we are going to go with the easiest way for now.

In your Plone site proceed to the ZMI (Zope Management Interface). In our example case it's going to be http://localhost:8080/cwarner/portal_skins/custom/manage and look like the following:

Plone Skins Custom Tool - Zope Mangement Interface

Plone Skins Custom Tool - Zope Mangement Interface

This is Plone's Skin Tool which will allow us to put our own Custom files/images etc. The only thing one should be cognizant of is that these files are available from anywhere in a Plone context. (There is another, more clinical way to do this via the filesystem that I will describe but in order to keep with the concept of Browser views alone I will disregard it for now and add it as a note later). Once here we select the type to add in this case I had the 3 images to add so I added them as images and two css files which I added as the file type: File.

At line 29 and 30 we have the title of our DVD Content type and the description. You'll see that I refer to these via context/title and context/description. The context paradigm is as you would expect. It will display the title of whatever specific context we happen to be in. In this case we are actually working with a dvd content type with the title 'The Pursuit of Happiness". So context/title displays whatever the title of the dvd is named. The same follows for lines 35-39 where we display the Publisher, Length, ISBN, Rating, and Color. Notice that the attributes are named exactly what we called them when we created our content type.

Now, lets take a look at line 42 which has the following "view/still_dreaming" as it's content descriptor.  When displayed in the final template we see that it indeed does work and returns the line "Some people are still dreaming" under the Comments section.

Next up! Let us plug this all together with some ZCML (Zope Component Markup Language) and try it out. Open the configure.zcml file located in your browser directory. We are going to add a section for our new template page and view and it should resemble something like the following:

configure.zcml setup for browserview

configure.zcml setup for browserview

Lets discuss some of these properties

  • Line 8, describes that our browser view is in-fact a page
  • Line 9, describe that our our view is applied to a specific interface, in this example we use the greedy operator so this will work with any interface.
  • Line 10, is the actual name of our view. In this case I picked a name that describes what our view type is but this can be anything
  • Line 11, describes where the view class is located. In our case it's in the web.py and in the class Html; hence .web.Html
  • Line 12, describes where the actual template is. Again, in our case it's web.pt where .pt stands for page template
  • Line 13, describes who has permission to see our view. In most cases this will be zope2.View

Once this is complete you can save the file and because we've wired everything up from our previous example you should be complete! If plone is started, restart it and you can test it with some dvd content that you've already created. In our case the url we would visit is: http://localhost:8080/cwarner/dvd/the-pursuit-of-happyness/@@html

Notice where we apply the double at (@@) before html. We could also just use the following uri http://localhost:8080/cwarner/dvd/the-pursuit-of-happyness/html. The double @@'s just explicitly tell Plone that we are requesting a view. Now that you are complete we could have Apache, Varnish or even Plone rewrite the url to something a little more pretty if we want. After this run you should be able to use a myriad of different templates and configurations to display your content on whatever device or platform you want!

Share/Bookmark

Syndicated 2010-05-12 21:10:02 from Christopher Warner » Advogato

195 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!