Archive for the ‘Web development’ Category

Webstickies for Umbraco

After attending the Umbraco Codegarden 09 Conference I decided to write my own plugin, which is now available on the new community website of Umbraco: Webstickies for Umbraco.

The package provides a toolbar to editors who are logged in to add sticky-notes to any page in a website. It provides a way to communicate about changes and remarks on a page.

As many other Umbracians, I have several bookmarks that help me debug Umbraco web-pages. I thought if I add them to this package, I will have them available at all time, no matter on which PC I am working. The toolbar has buttons to debug the page, and to provide the list of data available in the XML cache.

Credit where credit is due: please have a look at the service ProtoNotes, as the idea of the design for having notes or comments on the page is coming from that services. No code has been copied, but the interface is somehow based on the ProtoNotes service.

See how it works

Screencast showing how to install and use Webstickies for Umbraco

Try it

If you don’t know how to install a package, the community website has a small how to.

Files to download

XSLT library for Umbraco: update

Some 2 years ago I published an xslt library extension for Umbraco. I added several methods to the class that proved to be useful for me, maybe they are useful for you too.

The code is provided as is, no garanty, blabla … though should not harm anyone.

You can download the dll and adjust your xslt configuration settings in Umbraco or download the full VS2008 project [1.5 MB] and have a look at the code.
Just for the reference, below is a list of methods available in the class with a short description

XPathNodeIterator QueryDatabase(string conn, string query )
Query the umbraco database or any other database that you need.
string createMemberGroup(string memberGroupName)
Create a member group
string isMemberOfGroup(string memberGroupName, string memberId)
Check if the member supplied belongs to the group supplied
XPathNodeIterator GetAccessingGroups(int documentId)
Not working, will be removed …
XPathNodeIterator getAllMembersFromGroup(string groupId)
REturn all the members that are in a group
string getMemberGroups()
Returns the list of groups the current memner belongs to
XPathNodeIterator getAccesXml()
Returns the full xml document that contains the list of protected pags and groups.
string getMemberFromFirstLetter(char letter)
Well, get member from the first letter
XPathNodeIterator getMemberFromFirstLetterXml(char letter)
Well, same, but then in xml.
string addMemberToGroup(string memberGroupName, int memberId)
Add a given member to a give group
string addPageToGroup(int currentPage, int groupId, int loginPage, int errorPage )
Protect a page with a membergroup
bool updateProperty(int DocumentId, string propName, string propValue)
Update any property (not the umbraco properties) for any given document.

Download

FireQx 3.0 treats snow as rain

Joel Spolsky wrote an article and again I feel like he is right all the way: web standards are a means to an end, not the end goal, sigh.

They (as in your wife) don’t give a flicking flick about your stupid religious enthusiasm for making web browsers which conform to some mythical, platonic “standard” that is not actually implemented anywhere. They don’t want to hear your stories about messy hacks. They want web browsers that work with actual web sites.
Martian Headsets | Joel Spolsky

And besides he has a point, he is also a very funny writer:

FireQx 3.0 treats snow as rain, because you need windshield wipers in the snow, Qxyzrhjjjjukltk 5.0 does not, because the programmer who worked on that feature lives in a warm part of Mars without snow and doesn’t have a driver’s license anyway. Yes, they have driver’s licenses on Mars.Martian Headsets | Joel Spolsky

If the last quote doesn’t make any sense to you, go and read the article: Martian Headsets by Joel Spolsky.

Excel for project managers

OPPM book cover

I recently bought 2 books on project management (PM), a thin and concise one, and a large volume with all the bells and whistles that come with project management.

The last one didn’t arrive yet, but the one that was delivered was “The One Page Project Manager” (OPPM). You can read it in 2 hours: it’s short, to the point, and it seems to work for me.

The book is not a study about Project Management but a story about a project manager that came up with a great format (spreadsheet) for communicating project status to anyone who is involved or just want to know what is going on with the project. The author is not focusing on planning, it’s about communication, making sure people are involved and helping these people getting things done, on time.

The excel sheet, because that’s what it’s all about, is structured around 5 main areas: how / objectives / timeline / cost / owners. The tasks are each connected to an objective. That way, objectives are done when all takss in that row are finished, simple and effective

The sheets really give a good overview of the how (tasks), the objectives (goals, what to achieve?) and on who owns the tasks, something I think is crucial. Less attention is given to the timeline, and the cost which is measurable and therefore better communicated in a different way. The timeline is still there, but the focus is on getting closer to the objective of the project.

Sounds great, doesn’t it?
Well, the book is great and so are the excel sheets. Unfortunatly I am not using the excel sheets, because it is a generic approach, it works for every project, true, but not for every manager.
Some people need different info, and that is why I am not using the sheets at the moment, though I am connecting the 3 areas (how, objectives, owners) to make sure everyone knows what need to be done, when and why.

Getting IDs in html attribute IDs

Prefix your numeric id’s (int) with a letter if you plan to use them as html id attributes, because you should.
ID’s are not supposed to start with a number.

ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens (“-”), underscores (“_”), colons (“:”), and periods (“.”).

W3 HTML 4.01 Specs

The web that wasn’t

The Web that wasn’t, a presentation about the concept and the history of the internet as we know it, is really one to watch. The Google Tech Talks go beyond the subject of the internet, but some of them are really interesting.


The web that wasn’t

Alex Wright goes through several names that wrote about concepts like a keyboard, networks, terminals even before a computer was even thinkable.
If you need more stuff, here is a list of some names and their corresponding Wikipage:

XSLT and PHP on a Mac, Part 2

Now that I installed MySQL, got the apache server running and Wordpress installed, I am facing another problem.

The version of PHP included in Mac OS X seems to be an old one (that’s fine) without XSL transformations support (not ok) as it is not compiled into the module.

The one programming language I continuously use during the day is XSLT combined with a lot of XML documents and webservices. I need XSL, really, and I cannot live without XSL support, no way.

I could download the source code, find all the libraries, find the commands to compile and fix everything manually. But it is just easier to download the PHP package from Marc Liyanaga.

First you should disable the PHP4 module in the Apache config file, because if you install on top of that it will give you some strange errors. It will not remove the Apple module, but Apache will try to load both modules and that is something to avoid.

Download the package [PHP 5.2.4 for Apache 1.3], install and try the phpinfo file you created before, and you will see that you have a running version of PHP5.
I checked the configuration and it seems to have XSL support.

None of the code I wrote before ran without problems, everything resulted in a fatal error. After some time I figured out that the XSL module has changed extensively
As a result of that none of the code I wrote before will work, ever again.

At the moment I have PHP4 without XLST support installed, and a PHP5 version with XSLT support.

I tried Fink with the Finkcommander but they only have PHP modules for Apache 2, so no luck with that either.

This might not be a big problem for you, but I want to make sure the plugin I am writing, works on as many platforms as possible. and that includes PHP4.
I could not find any statistics on how many hosts have switched to PHP4, I think not they are many.

The PHP website mentions that PHP4 will no longer be supported from January 2008, so I guess I am going to develop for PHP5 and hope for the better.

PHP development on a Mac, Part 1

At the moment I have an updated version of Mac OS 10.4 running on my MacBook and as you probably know,
Apache and PHP are preinstalled.

I started developing on a Mac along time ago,
and never needed any PHP upgrade as I never did any extensive development on my local machine.
But now I really needed a development environment with the latest Wordpress running on my Mac
and this required MySQL.

I ran into several problems and it seems that installing everything you need is the main culprit.

Starting your webserver on a Mac is easy.
This is integrated in the System Preferences under Internet and network > Sharing > Services > activate the option Personal Web Sharing or start up terminal and type:

sudo apachectl -graceful


Yes you need root permissions to do this

MySQL is needed too: download the universal package from the MySQL download page, and install. The installer will ask you for your administrator password, but everything should install without any problem.

The dmg package includes an item for the System Preferences that will allow you to stop and start the MySQL server exactly as you can stop/start the webserver. Command line does the trick too, but I try to stay out of terminal for these things so you better install that one too.

After that, download the MySQL tools: MySQL Administrator andMySQL Query browser

Once you installed the database server, you can download Wordpress, unzip the files and copy these to the webserver directory: /library/webserver/documents

The installation of Wordpress requires you to create a new database: use the MySQL administrator to create a new database and update the Wordpress config file.

Now when you install MySQL by default and try to use the PHP module preinstalled to connect to this database
you will notice … nothing. You cannot connect because the default directory for MySQL and PHP MySQL support, point to different directories.

So you have to change that.

You can read all about it on developer.apple.com
but if you follow the list below:

  • open up terminal
  • type: locate php.ini
  • open the file that was found, probably: /private/etc/php.ini
  • change the lines
    • mysql.default_socket = /var/mysql/mysql.sock
      into
    • mysql.default_socket = “/tmp/mysql.sock”
  • restart Apache

And try to reconnect to your database.

Everything should be ok now, at least up to here, because I have some more problems and I will be posting more on this topic as it is not that easy to get everything running once you start to fiddle with terminal and unix stuff.

Categories

About

My name is Len Dierickx and this is my personal blog. I studied Musicology at the UG, long time ago but got more and more into webdevelopment. I started this blog because the EuroIA summit in Brussels (Belgium, Oct 2005), was such an inspiration. And I was thinking about a blog on IA a while now, so that was the extra kick I needed to get it actually done.

Powered by WordPress