I chose Magnolia (www.magnolia.info) again for my third Content Management Solution. And, I still like it. Though Magnolia is capable of much more, following are the reasons I prefer it.
1. administrator managed public viewing site
Magnolia comes with role based security. It is extendable as its security is based on JAAS (Java Authentication and Authorization Service). Branches of the site can be secured based on role and roles can be configured with read/write access rightes. Roles and permissions can easily be managed and modified.
2. wsywyg editing
Magnolia adds its own javascript based controls for editing the pages. The controls apprear in edit mode and are hidden in preview mode. They do not exist in published pages. I would not call it 100% wsywyg editing, as Magnolia does not allow you 'inline' editing of the pages, but it allows you form based editing in popup forms. It still qualifies for wyswyg as the preview mode of the page is exactly how a published page would look like.
3. complete control over look & feel of the site
Since you as a developer create templates for the page layouts, and templates for the paragraphs, you have 100% control over how the site looks and behaves. I think this is the 'most' important asset of Magnolia. I've seen many other CMS solutions that allow you to create a page and paragraph layout with web based tools, but with any web based tool, there come certain limitations. With Magnolia, since a developer codes the templates, there is no such limitation. (Yes, the newer versions of Magnolia have some online template builder tool (Sitedesigner), but I have not used it, so I cannot comment on it. Also, it is part of 'enterprise' build)
4. database independent implementation
Magnolia stores its data using jackrabbit Content Repository. And, since you as a developer create dialogs (to capture data) and paragraphs (to display data) and you use magnolia's tag libraries to access data for publishing, there is not much jackrabbit know-how necessary to create a magnolia solution. But the fact that you do not have to configure a database as part of implementation is a plus. One less thing to worry about while deploying your magnolia solution.
5. a simple workflow, create - preview - publish
The workflow is simple. A content manager creates a page, previews it and if satisfied publishes the page. I think, for a vast majority of CMS solutions this simple workflow works and suffices. As a developer you can stack multiple installations of magnolia to create more elaborate workflows, like create - preview - review - confirm - publish, but I have not implemented such a system. I have read it is possible, but I'm not sure what baggage it comes with. I would still recommened a good understanding of Magnolia and its capabilities in expanding the workflow before you 'reject' it for any other tool, if a more complex workflow is required.
What else?
Now, is there something that I would like to see in Magnolia that it does not provide? Of course yes. No tool is perfect and no tool gives you 100% of what you want. The reason a tool is a 'good' tool depends on how easily it 'allows' you to reach your 100% beyond the 'X'% it gives you.
So, I would like that Magnolia provide a good 'eclipse' project, so that developing templates is much easier. (No, I'm not saying an 'eclipse' project to work on magnolia code itself.. I'm talking about an 'eclipse' project for creating and managing templates and other code artifacts (such as docroot artifacts))
I would also like that it is more seamless to adding custom code, like servlets and jsp's. Yes, it does allow, but it should be more seamless. And good integration of jsp's that read managed header/footer from magnolia templates.
I would also like more pre-built modules, like a blog or a message board. Though I'm not sure if that really adds value to Magnolia. But it sure will make it more competitive, as its competitors 'boast' of such 'out of box' features.
So, in short, Magnolia is a good tool to create highly customized and managed public domain websites.
Monday, July 28, 2008
Monday, June 9, 2008
ORM Models : Hibernate with Annotations and Cayenne
Before I used Hibernate (*1), I played around with Cayenne (*2). I liked its Visual Modeler. It allows you to create models, and map them to database fields. It also generates Java Code and sql scripts. All packaged up. I liked it. Untill I worked with Hibernate.
I must admit, I tend to not like things that get too much hype, and sometimes the hype is much deserved. So, in such cases I kind of 'miss the boat'. Hibernate falls in that category.. But, in the end, having a better grasp at competing technologies never hurts.. Let me explain, and I will limit the discussion to few items, which I feel are a 'make or break', at least for me, and please take it for what its worth.
Lets take Cayenne first. Lets take a look at its generated model. Or should I say 'models', as it creates two files.
public class Blog extends _Blog {
...
}
pretty small.. Wait till you see the _Blog
public class _Blog extends org.apache.cayenne.CayenneDataObject {
public static final String BLOG_DESCRIPTION_PROPERTY = "blogDescription";
public static final String BLOG_TITLE_PROPERTY = "blogTitle";
public static final String DATE_CREATED_PROPERTY = "dateCreated";
public static final String DATE_MODIFIED_PROPERTY = "dateModified";
public static final String BLOG_ID_PK_COLUMN = "BLOG_ID";
public void setBlogDescription(String blogDescription) {
writeProperty("blogDescription", blogDescription);
}
public String getBlogDescription() {
return (String)readProperty("blogDescription");
}
public void setBlogTitle(String blogTitle) {
writeProperty("blogTitle", blogTitle);
}
public String getBlogTitle() {
return (String)readProperty("blogTitle");
}
public void setDateCreated(java.util.Date dateCreated) {
writeProperty("dateCreated", dateCreated);
}
public java.util.Date getDateCreated() {
return (java.util.Date)readProperty("dateCreated");
}
public void setDateModified(java.util.Date dateModified) {
writeProperty("dateModified", dateModified);
}
public java.util.Date getDateModified() {
return (java.util.Date)readProperty("dateModified");
}
}
So, what is the issue..
Firstly, Cayenne creates a model, which is for you to extend and customize, which extends another class (_Blog.java).
The _ in _Blog.java means, 'do not touch'. Cayenne reserves the full right to over-write it. This is a problem, in at least one of these ways:
Thirdly, Can you find getBlogId() or setBlogId(...) in the _Blog.java ? Neither do I. Cayenne documentation says, "Normally it is not advisable to map primary and foreign key columns (PK and FK) as Java class properties (ObjAttributes)." (*3) But they do not explain the wisdom in it. So, you have to write an elaborate custom method to get the id from the model itself (see the referenced link). But to set an id, that is still a no-no. Of course, you may agree with the methodology of not allowing access to Id from model, but I tend to like ot have it.
So, to keep it short, I'll just limit my discussion to these three points. And no, I'm not skipping Hibernate. Here I'll just relate Hibernate with these three points.
Lets see a Hibernate Model class.
@Entity
@Table(name="CLIENT")
public class Client implements Serializable {
@Id
@Column(name="id", nullable=false)
@GeneratedValue(strategy=GenerationType.AUTO)
private Long id;
@Column(name="name", nullable=false, length=255, unique=true)
private String name;
@Column(name="account_manager",nullable=true, length=255)
private String accountManager;
@Column(name="account_owner",nullable=true, length=255)
private String accountOwner;
public Client() {
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAccountManager() {
return accountManager;
}
public void setAccountManager(String accountManager) {
this.accountManager = accountManager;
}
public String getAccountOwner() {
return accountOwner;
}
public void setAccountOwner(String accountOwner) {
this.accountOwner = accountOwner;
}
}
This example of the Model class uses Annotations, though all of this can be accomplished using an XML file. But I prefer Annotations, and using Annotations has its benefits, which I won't mention here, as I'm discussing Model classes.
So, First issue : I generate the Class. Even if there exists tools that generate the Model classes, there is nothing stopping me from writing or modifying it.
Secondly, the Client.java extends Serializable, which qualifies it for a POJO. I know, I know, this class has javax.persistence.Entity, javax.persistence.Id and similar annotations, but, there is nothing that prevents me from instantiating a Client Class, and setting all the properties and have it then persist..
Thirdly, getId() and setId(...). Ahh. Dosen't that make you breathe easier.
In any case, I would use Hibernate just for these reasons, even though there are other equally compelling reasons to use it. Like, javax.persistence/EJB3 supported annnotations, the Hibernate model above could be used with JPA without changing a single line of code. (Of course, a Hibernate DAO will differ from JPA DAO), extensive Maven support for Hibernate and other 'nice to haves'.
(*1) http://www.hibernate.org/
(*2) http://cayenne.apache.org/
(*3) http://cayenne.apache.org/doc20/accessing-pk-and-fk-values.html
I must admit, I tend to not like things that get too much hype, and sometimes the hype is much deserved. So, in such cases I kind of 'miss the boat'. Hibernate falls in that category.. But, in the end, having a better grasp at competing technologies never hurts.. Let me explain, and I will limit the discussion to few items, which I feel are a 'make or break', at least for me, and please take it for what its worth.
Lets take Cayenne first. Lets take a look at its generated model. Or should I say 'models', as it creates two files.
public class Blog extends _Blog {
...
}
pretty small.. Wait till you see the _Blog
public class _Blog extends org.apache.cayenne.CayenneDataObject {
public static final String BLOG_DESCRIPTION_PROPERTY = "blogDescription";
public static final String BLOG_TITLE_PROPERTY = "blogTitle";
public static final String DATE_CREATED_PROPERTY = "dateCreated";
public static final String DATE_MODIFIED_PROPERTY = "dateModified";
public static final String BLOG_ID_PK_COLUMN = "BLOG_ID";
public void setBlogDescription(String blogDescription) {
writeProperty("blogDescription", blogDescription);
}
public String getBlogDescription() {
return (String)readProperty("blogDescription");
}
public void setBlogTitle(String blogTitle) {
writeProperty("blogTitle", blogTitle);
}
public String getBlogTitle() {
return (String)readProperty("blogTitle");
}
public void setDateCreated(java.util.Date dateCreated) {
writeProperty("dateCreated", dateCreated);
}
public java.util.Date getDateCreated() {
return (java.util.Date)readProperty("dateCreated");
}
public void setDateModified(java.util.Date dateModified) {
writeProperty("dateModified", dateModified);
}
public java.util.Date getDateModified() {
return (java.util.Date)readProperty("dateModified");
}
}
So, what is the issue..
Firstly, Cayenne creates a model, which is for you to extend and customize, which extends another class (_Blog.java).
The _ in _Blog.java means, 'do not touch'. Cayenne reserves the full right to over-write it. This is a problem, in at least one of these ways:
- If I have to modify the model, I have to use the 'Modeler' and then 're-generate' the code.
- I am tied to Cayenne for the model class, and the proof? _Blog.java itself extends org.apache.cayenne.CayenneDataObject
Thirdly, Can you find getBlogId() or setBlogId(...) in the _Blog.java ? Neither do I. Cayenne documentation says, "Normally it is not advisable to map primary and foreign key columns (PK and FK) as Java class properties (ObjAttributes)." (*3) But they do not explain the wisdom in it. So, you have to write an elaborate custom method to get the id from the model itself (see the referenced link). But to set an id, that is still a no-no. Of course, you may agree with the methodology of not allowing access to Id from model, but I tend to like ot have it.
So, to keep it short, I'll just limit my discussion to these three points. And no, I'm not skipping Hibernate. Here I'll just relate Hibernate with these three points.
Lets see a Hibernate Model class.
@Entity
@Table(name="CLIENT")
public class Client implements Serializable {
@Id
@Column(name="id", nullable=false)
@GeneratedValue(strategy=GenerationType.AUTO)
private Long id;
@Column(name="name", nullable=false, length=255, unique=true)
private String name;
@Column(name="account_manager",nullable=true, length=255)
private String accountManager;
@Column(name="account_owner",nullable=true, length=255)
private String accountOwner;
public Client() {
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAccountManager() {
return accountManager;
}
public void setAccountManager(String accountManager) {
this.accountManager = accountManager;
}
public String getAccountOwner() {
return accountOwner;
}
public void setAccountOwner(String accountOwner) {
this.accountOwner = accountOwner;
}
}
This example of the Model class uses Annotations, though all of this can be accomplished using an XML file. But I prefer Annotations, and using Annotations has its benefits, which I won't mention here, as I'm discussing Model classes.
So, First issue : I generate the Class. Even if there exists tools that generate the Model classes, there is nothing stopping me from writing or modifying it.
Secondly, the Client.java extends Serializable, which qualifies it for a POJO. I know, I know, this class has javax.persistence.Entity, javax.persistence.Id and similar annotations, but, there is nothing that prevents me from instantiating a Client Class, and setting all the properties and have it then persist..
Thirdly, getId() and setId(...). Ahh. Dosen't that make you breathe easier.
In any case, I would use Hibernate just for these reasons, even though there are other equally compelling reasons to use it. Like, javax.persistence/EJB3 supported annnotations, the Hibernate model above could be used with JPA without changing a single line of code. (Of course, a Hibernate DAO will differ from JPA DAO), extensive Maven support for Hibernate and other 'nice to haves'.
(*1) http://www.hibernate.org/
(*2) http://cayenne.apache.org/
(*3) http://cayenne.apache.org/doc20/accessing-pk-and-fk-values.html
Tuesday, May 6, 2008
What makes a Web 2.0
I recently heard that a business wanted a Web 2.0 Content Management System (CMS) with all the video and other media as publishable content. I asked, well, if its Web 2.0, what/who is the user-base. And, the answer was, that the content managers would publish content for public viewing.
That triggered my question, so what's Web 2.0 about it? Does the availablity of music / video / pictures make a site Web 2.0 or is it some set of standards that one has to meet?
Obviously, the term Web 2.0 has been around for a few years now. And there are many definitions of what make a site Web 2.0. So, one must ask, when a definition of Web 2.0 is desired, is it the original definition of what was intened by Web 2.0 or is it what is accepted as a norm (if there is any) now ?
A quick look on internet will show you that the term was first floated in the O'Reilly Media Web 2.0 conference in 2004. Tim O'Reilly defines Web 2.0 as
"Web 2.0 is the business revolution in the computer industry caused by the move to the internet as platform, and an attempt to understand the rules for success on that new platform. Chief among those rules is this: Build applications that harness network effects to get better the more people use them. (This is what I've elsewhere called "harnessing collective intelligence.")"(*1)
This is a pretty general definition, and it leaves room for some variance. Which I think is good, for something that is still in development or formation. Web 2.0 is still forming and changing as we speak, so to have a defintion that touches the essence but leaves the details out is a good thing.
But the its side-effect is that it is difficult for some to exactly pinpoint what makes a site Web 2.0.
I say, 'an' answer is in the original definition, "Chief among those rules is this: Build applications that harness network effects.."
Which I would like to interpret (and Yes, I can be wrong), as applications where the content / service is produced / used (read harnessed) by the user base (read the network).
So, lets take some examples.
These sites are commonly given as examples of Web 2.0 sites. But what makes them a Web 2.0 site and not others, like
The question that should be asked is, Who generates the content and uses the services in these sites. And the answer is : People. They post stuff to sell on eBay, they post profiles in faceBook and MySpace, they post articles on Wikipedia, they upload pictures on Flickr, they mark bookmarks on Del.icio.us and they post videos on Youtube.. and the common purpose is to network and share, and use internet as a 'platform' to achieve that goal. The former set of sites are examples of Web 2.0 sites. And the 'harnessing of network effects' is what is common amongst all of them.
(*1) http://radar.oreilly.com/archives/2006/12/web-20-compact-definition-tryi.html
That triggered my question, so what's Web 2.0 about it? Does the availablity of music / video / pictures make a site Web 2.0 or is it some set of standards that one has to meet?
Obviously, the term Web 2.0 has been around for a few years now. And there are many definitions of what make a site Web 2.0. So, one must ask, when a definition of Web 2.0 is desired, is it the original definition of what was intened by Web 2.0 or is it what is accepted as a norm (if there is any) now ?
A quick look on internet will show you that the term was first floated in the O'Reilly Media Web 2.0 conference in 2004. Tim O'Reilly defines Web 2.0 as
"Web 2.0 is the business revolution in the computer industry caused by the move to the internet as platform, and an attempt to understand the rules for success on that new platform. Chief among those rules is this: Build applications that harness network effects to get better the more people use them. (This is what I've elsewhere called "harnessing collective intelligence.")"(*1)
This is a pretty general definition, and it leaves room for some variance. Which I think is good, for something that is still in development or formation. Web 2.0 is still forming and changing as we speak, so to have a defintion that touches the essence but leaves the details out is a good thing.
But the its side-effect is that it is difficult for some to exactly pinpoint what makes a site Web 2.0.
I say, 'an' answer is in the original definition, "Chief among those rules is this: Build applications that harness network effects.."
Which I would like to interpret (and Yes, I can be wrong), as applications where the content / service is produced / used (read harnessed) by the user base (read the network).
So, lets take some examples.
- eBay
- myspace
- wikipedia
- flickr
- del.icio.us
- youtube
These sites are commonly given as examples of Web 2.0 sites. But what makes them a Web 2.0 site and not others, like
- NYTimes
- CNN
- Amazon
The question that should be asked is, Who generates the content and uses the services in these sites. And the answer is : People. They post stuff to sell on eBay, they post profiles in faceBook and MySpace, they post articles on Wikipedia, they upload pictures on Flickr, they mark bookmarks on Del.icio.us and they post videos on Youtube.. and the common purpose is to network and share, and use internet as a 'platform' to achieve that goal. The former set of sites are examples of Web 2.0 sites. And the 'harnessing of network effects' is what is common amongst all of them.
(*1) http://radar.oreilly.com/archives/2006/12/web-20-compact-definition-tryi.html
Subscribe to:
Posts (Atom)