Things to Ponder with Alfresco (Part III: WCM – Improvements)
Now days using web content management systems (WCM) is trivial. You should continuously update the website content to maintain a fresh look. It increases returning customers and popularity. Almost every major website uses a CMS to achieve this. It might be an in-house developed or an off-the-shelf product. In any case, it helps organizations to separate the content authoring team from the application development cycles. This helps in quicker content updates without being dependent on release schedules. I am going to point out certain things about WCM feature of alfresco. You can also apply the same principles to your WCM if you are using existing one, or planning to develop a new one!
Content storage format - Alfresco provides a nice feature called "web-forms". There are two types of forms currently available i.e. WCM forms and ECM forms. Both of them capture the input data and store it as XML. You can also choose to apply content transformation using XSL. It helps to save final output as either HTML, Text or PDF etc. Not to forget, the content is actually captured and saved as XML. In my perception one of the strengths of Alfresco is its content repository. If XML is target format, it is saved in CR as a cm:content property and it defeats the whole purpose. If CR is not aware of the structure of the content, it defeats the purpose of content model definition? It is not very different from storing the content xml as plain string in database. Frankly I don't see any benefit of using CR over database in this method.
To avoid such inefficient use of alfresco, you can take some effort and write a custom form component. Use custom forms (develop forms in your application and then communicate with alfresco using API) to capture user data and store them in content repository in defined content model and schema.
This will help you in -
- Content repository now understands the structure of your content. This is really important and if you have any doubts, please post that in comments. I might write about it later in my blog.
- You can apply your custom content transformation logic so that content can be exported in XML / HTML / custom output format. Just generate this once every time you update the content. It improves the efficiency of content management system to deliver target content.
- You will have a flexibility of own input format, use JSP or rails forms, its your choice!
Deployment benefits - Alfresco has another great strength, Deployment Infrastructure. I think its also one of its weaknesses. Use it wisely to improve your release management. On the release date of web application usually you come across content sanity issues, or format differences. To avoid that, setup proper environments where alfresco can sync content and test it before you push it to live. This might save you a lot of frustration.
Although its a great feature, there is a caveat to that. Generally all the code for web application is stored in CVS systems. Alfresco code (web scripts, web form definitions etc.) is stored in alfresco. Keeping the versions of alfresco code and web application code is nightmare. Develop some automated web script deployment tool and every time you release, wipe out all the previous webscripts and deploy new ones from the CVS. This always makes you keep updated code in the CVS and versioning becomes much robust.
Ubuntu: Cisco VPN Client installation on Intrepid
Cisco VPN client for linux installation doesn't happen out-of-the-box. There is plugin of VPNC which gets integrated with NetworkManager of Ubuntu but I didn't focus on that. Maybe somebody would like to guide the steps for it. I investigated a little and found bunch of articles / blog post about VPN issue. Some of the articles are outdated or needs a update. Following steps will get VPN client working on Ubuntu Intrepid and use certificate based authentication to connect.
First get the distribution of VPNClient for linux. This distribution is valid for 32-bit as well 64-bit installations.
wget http://tuxx-home.at/vpn/Linux/vpnclient-linux-x86_64-4.8.01.0640-k9.tar.gz tar -xvzf vpnclient-linux-x86_64-4.8.01.0640-k9.tar.gz cd vpnclient sudo ./vpn_install
This command should result in similar output below:
Cisco Systems VPN Client Version 4.8.01 (0640) Linux Installer Copyright (C) 1998-2006 Cisco Systems, Inc. All Rights Reserved. By installing this product you agree that you have read the license.txt file (The VPN Client license) and will comply with its terms. Directory where binaries will be installed [/usr/local/bin] Automatically start the VPN service at boot time [yes] In order to build the VPN kernel module, you must have the kernel headers for the version of the kernel you are running. Directory containing linux kernel source code [/lib/modules/2.6.27-7-generic/build] * Binaries will be installed in "/usr/local/bin". * Modules will be installed in "/lib/modules/2.6.27-7-generic/CiscoVPN". * The VPN service will be started AUTOMATICALLY at boot time. * Kernel source from "/lib/modules/2.6.27-7-generic/build" will be used to build the module. Is the above correct [y] Making module make -C /lib/modules/2.6.27-7-generic/build SUBDIRS=/home/sachin/vpnsandbox/vpnclient modules make[1]: Entering directory `/usr/src/linux-headers-2.6.27-7-generic' CC [M] /home/sachin/vpnclient/linuxcniapi.o In file included from /home/sachin/vpnclient/Cniapi.h:15, from /home/sachin/vpnclient/linuxcniapi.c:31: /home/sachin/vpnclient/GenDefs.h:113: error: conflicting types for ‘uintptr_t’ include/linux/types.h:40: error: previous declaration of ‘uintptr_t’ was here make[2]: *** [/home/sachin/vpnclient/linuxcniapi.o] Error 1 make[1]: *** [_module_/home/sachin/vpnclient] Error 2 make[1]: Leaving directory `/usr/src/linux-headers-2.6.27-7-generic' make: *** [default] Error 2 Failed to make module "cisco_ipsec.ko".
To get around this error you need to patch couple of files in the existing source. Download the patch and apply it.
wget http://projects.tuxx-home.at/ciscovpn/patches/vpnclient-linux-2.6.24-final.diff patch < ./vpnclient-linux-2.6.24-final.diff
After successful patch of the files you can proceed to the install procedure again -
sudo ./vpn_install
You should be able to see all files getting compiled successfully. If it is successful you will see a message like below -
* You must run "/etc/init.d/vpnclient_init start" before using the client. * This script will be run AUTOMATICALLY every time you reboot your computer.
Now you can copy your vpn configuration files (*.pcf) in /etc/opt/cisco-vpnclient/Profiles folder and you can start connecting the the vpn network using command -
vpnclient connect <profile_name>
If you want to use certificate based authentication for the connection then following additional steps will be required.
sudo cisco_cert_mgr -U -op import
This will ask you for the certificate file location and password for the file if required. Enter the passwords for importing certificates if required and proceed with connection.
Region Locked DVDs and Mac Book Pro
Recently I got a MacBook Pro 2008 from my office. I love the machine but I was completely disappointed when I inserted Italian Job DVD. I was asked to change the region to 2/4 and I stay in region 5. I own the original copy of the DVD and unfortunately, there is no Region 5 copy available in India. It was never the issue for me because in Windows, VLC media player could easily bypass these region codes and ignore it conveniently.
DVD Regions Map
I own few more DVDs belonging to 2/3/4 regions. I own another DVD player (my PlayStation 3) and that is also region locked. Now I have two very expensive machines and lots of original DVD titles yet can't play any of them. I don't know who created this *stupid* protection system which prohibits user from playing legal copies!
I tried various things on my Mac -
- Using VLC media player for OS X
- Using utilities like MacTheRipper for decrypting the dvd
- RegionX for changing the region indefinite times
None of the above works. I have almost read thousand blog / forum posts related to DVD region issues with Mac but everything was completely failure. Apparently MacBooks have this "MATSHITA DVD-R UJ-867" super drive which has no way of getting around the protection. I don't want to replace the firmware to region free as it will void my company laptop warranty which makes me crazy.
Now what reward I got by paying for the legal versions of the DVDs? In India any English movie DVD will cost you around Rs. 399-699 which is considerably expensive. You pay Rs. 800-1000 for 1 month of the internet connection. Why I will not be tempted to download nicely ripped DivX movie from torrent instead of buying freaking expensive DVDs which don't play at all?
Now can I demand my money back for these movies? Can I illegaly download the DivX rip of the movie and play it on my laptop and still it will be legal? I really don't know but I will never buy legal DVDs for sure!
Things to ponder with Alfresco (Part-II: Workflow Design)
As I mentioned in my earlier post that I will be writing few more posts about the Alfresco. This is second installment in the series. If you are thinking to use Alfresco at the center of your application then it is hard that it will not have a workflow. If your business process is just more than simple workflows mentioned in Alfresco, then for sure you have to write your own business model definition.
If you are planning to do so, here are few lessons I have learned –
- Simplicity – We got lot of benefits just by keeping our process definition simple and neat. Don’t add unnecessary steps which will cause confusing steps for the end users.
- Right things at right place – Alfresco is very flexible in terms of business logic implementation. You will always have multiple options to accomplish same operation. Web Scripts, Java classes or Web Service and you will be tempted to use different things at times. Decide one approach and stick to it. Put as much as logic in the workflow and don’t spread across the workflow business logic outside the workflow.
- Loops can be evil – Loops in the workflow actions can be daunting at times. Rethink on the circular steps in the workflow and make sure you are not violating the “simplicity” rule. It might be difficult sometimes to achieve these steps.
- Blocking is good sometimes – Next bigger decision should be synchronous operations or asynchronous. All the operations which might result in inconsistent states should be synchronous i.e. transactional. Asynchronous operations are better in terms of responsiveness. Sending e-mails could be asynchronous tasks as you people can receive emails after couple of seconds, but if it is related to pushing records to a queue, let it be synchronous. You got the idea!
You are advised to check Alfresco wiki for more details. There is plenty of documentation available for the administration and authoring custom workflows.
Things to ponder with Alfresco (Part-I: Content Model)
For any content repository, content model definition is similar to the DDL (schema definition) for databases. It is expected in a big application to have evolutionary content model like databases. Updating the table structures or introducing new tables is common in any business application. In content repository, you should also keep in mind that your content model should be open to evolve. Define the content model which will be extensible. Most of the good practices of database design should be applicable here.
Few tips for better content models -
- Use aspects for specializing types instead of defining content types. There are few advantages of that, aspects can be applied or removed at run-time which gives you much more control over the dynamic nature of types.
- Aspects also helps in keeping the default set of properties over a content type to be small. Alfresco recommends you to prefer aspects over custom content types.
- Aspects helps you to logically group properties. This helps your data to be part of multiple groups at the same time. If you have aspects Publishable and Indexable; you can apply or revoke a nature at your will without much hassle.
- Indexing is very helpful for searchable content. It is useful but use it wisely. The cost of indexing in Alfresco is much higher than cost of index in Databases as this will be full-text search indexes. It will take up more disk space as well as time to index the data. Don't index the content which people are not expect to search! You can define this at the time of content model definition.
- Versioning is similar to indexing and use this wisely. The content which is versionable is handled separately by Alfresco. This might be affecting performance as your repository size grows. Don't mark content as versionable if you don't plan to maintain revisions for content.
I will continue this series with other experiences with Alfresco. Later.


