Java or Groovy CMS - java

I'm considering developing a school information system using the Grails web framework. Before a school can use the system, they will need to setup the following data
School data
Students
Teachers
Subjects
Classes
etc.
I'm considering using a CMS in order to get the ability to CRUD these entities "for free". The CMS may also provide other features out-of-the-box that I could use.
Ideally the CMS should be implemented in Java or Groovy, does anyone know of something suitable? I looked at the Weceem CMS plugin for Grails, but it's missing some core concepts I need, e.g. the ability to add users to groups.
Thanks,
Don

Java is good for rock-solid, high-performance, secure Enterprise apps. Java is considerably less good for getting a relatively simple Web project out the door in a short time.
Therefore, were I in your position, my personal gut feeling would be to go with something Grails based. I'm not very aware of any projects that already partially implement what you want, but if you can find one (Google?) then grab it! That will leave you more time for polishing and adding bells and whistles.

If you're not tied to Java, I'd recommend looking at Drupal for PHP as your CMS. Many sites, even sites of major Java organizations such as SpringSource, have used Drupal as their CMS because it offers so much out of the box.

Magnolia CMS 1 in version 4.3 has full-blown Groovy support. After 7 years of active development, a CMS like Magnolia provides you with a ton of stuff you need to run a website. I wouldn't even think about starting from scratch no matter what framework you use. Understanding the problem you are trying to solve and finding a solution to it is usually taking more time than actually implementing said solution. Even if you believe you know what you need now, rest assured your requirements will overrun you before you know it.

I know it's not Grails related, I would use the DaisyCMS, as it's java based you can add an extra Java Web applications to the Jetty and add extra functionality to the CMS using Grails for your other functinality. I hav enot tried this, it's just a suggestion.

Use Grails scaffolds to get simple CRUD functionallity.

Do you really want to build it from scratch? There are already open-source CMS. In your case I would evaluate open-source CMSs and if necessary would contribute code.
Does it need to be Java/Grails? There are good ones written in PHP or Python (django, joomla).
I tried Grails 1 year ago. It is very straightforward as long as you align with the concepts and standards (e.g. simple CRUD scaffolding). But if there a special requirements you get to similar efforts as with a Java framework like Spring MVC (though grails is also based on Spring MVC).

Related

JVM Frameworks, which one?

I don't have much experience in frameworks or languages, so i need your help.
Here's what i've done so far so you can understand where i'm coming from.
I've developed a web app using Java/Spring MVC/Hibernate. on the front end i've got some jquery datatables doing ajax calls to a db, another pages executes a stored prod and thats about it.
Now i got fed up with all the configuration, beans, hibernate mapppings, spring mappings, apache tiles, and the list goes on.
I had a play with Groovy/Grails and that seems so much easier, but that means i need to learn groovy and i've heard about it's performance weakness.
So i ran into Play Framework, can someone tell me if Play would make my life easier with the above scenario or should i just go into Groovy/Grails or even scala/lift.
I don't have too much time on my hands to pick up another language so if i can stay with core Java and use Play that would be great.
So is my described headache the reason why there's RoR/python-django, grails ect,ect? or is it something else?
thanks,
glenn.
I can tell you from the perspective of a 10 year J2EE developer who went from JSP/servlet to Grails to Play. 6 years ago I discovered groovy and I liked it very much, I've been using groovy and it's GSP templates in my other projects for code generation. I really love groovy syntax. Because you can do a lot in a single line of code ;) Because of groovy I tried Grails. But, besides the use of the language to code something in perhaps some 20% of the project time, you are 80% dealing with Grails conventions. How do they map this and that and to the persistence layer (which is JPA underneath the surface). So you're browsing the docs most of the time.
Then I found play. It really felt natural. Everything is so quick with it. Everything is direct, it is 80% undisturbed, productive coding, only 20% reading the docs. The code completion of any Java IDE is literally sufficient support. In Grails you either need a Grails IDE or you find yourself frequently browsing the docs.
The biggest attractor of Play to me is the hot code swap feature, which nearly completely eliminates the build phase. Play's class enhancers give you enough comfort to get over the loss of those dynamic finders in Grails. In the meantime, I even write my own enhancers to get even more comfort.
In a real project, the strongly typed Java language is a huge benefit to all developers. You just can't break it so easily as you can with groovy.
Also, if you look at the Play package, you always get reasonable defaults. Things that all developers like. jQuery based CRUD, beautiful code samples, good visual experience. And it's all as minimalistic as possible. Which means, you can always go to the play framework source itself and read the code to understand play's behavior.
So to sum up, after 10 year of Java and J2EE frustration and almost giving up on Java I switched back to it as implemented by Play, because in Play it is so much fun and I now love it again. I recommended play to 2 other developer friends and they love it too. It feels like the Java that it should have been in the first place. Fast, clean, secure & a lot of fun. I will never use something else based on Java, not even for a simple main() ;)
Play!
After 6 or 7 years of Spring/Hibernate, a couple of more with JSP/EJB I was done with the Java world, looking for other alternatives like Scala, Node.js, Rails, etc. Play Framework has made me fall in love with Java all over again, even though I do recommend Scala.
I have lots of information about Play on my blog http://geeks.aretotally.in and http://playframework.info.
It's super easy to pick up, it's crazy productive and you will have lots of fun!
If you ask a Play framework guy, he will tell you to use Play. If you ask a Scala/Lift guy, he will tell you to use Scala/Lift.
Ideally you'd like to find someone who has used Groovy/Grails, Scala/Lift, and Play, but unfortunately there are not too many of those around.
FWIW, I use Groovy and Grails, and like it a lot. If you already know Java, Spring, and Hibernate you already know most of what you need to be productive with Groovy/Grails.
If you don't want to spend a lot of time learning a new language, I'd stay away from Scala, as it's a very different language to Java, whereas Groovy is almost a superset of Java, and with a familiar syntax.
I know virtually nothing about Play, but I'd be concerned about the size of the community - check the number of Play and Grails questions on stackoverflow for a rough comparison.
Grails 2.0 performance will be pretty much on par with the static typed languages out there.
Based on your current architecture, Grails would be the most natural fit - you can re-use all existing classes and code without an issue, and have it directly picked up. You can freely use #Autowired and other Spring annotations, java code, and Grails picks it up - because Grails is Spring under the covers. The only part that might need a little tweaking are JSPs, but I was able to get existing JSPs and custom taglibs working without an issue. Grails uses SiteMesh to compose it's Groovy Server Pages (think JSP groovy-ized, and removing some of the JSP restriction gotchas).
Nothing against Play, Lift, Clojure's web framework, SEAM, or any of the other frameworks out there -- but if you want a simple transition from what you have to something a little more productive, then Grails would be the closest fit.
Of course these days, just about every one of those frameworks supports polyglot programming - you use Scala for something, Groovy for something else, and Java all around - compilers, build environments, and tools are all addressing polyglot development.
Long story short, it comes down to requirements and risk management - do you need functional programming, dynamic typing, re-use of your Spring controllers, or just some simplification and productivity boosts?
Even a simple Spring 3.1 upgrade may eliminate some of your XML files for annotations and solve most of your problems.
Happy Hunting!

Web framework for an application utilizing existing database?

A legacy web application written using PHP and utilizing MySql database needs to be rewritten completely. However, the existing database structure must not be changed at all.
I'm looking for suggestions on which framework would be most suitable for this task? Language candidates are Python, PHP, Ruby and Java.
According to many sources it might be challenging to utilize rails effectively with existing database. Also I have not found a way to automatically generate models out of the database.
With Django it's very easy to generate models automatically. However I'd appreciate first hand experience on its suitability to work with legacy DBs. The database in question contains all kinds of primary keys, including lots of composite keys.
Also I appreciate suggestions of other frameworks worth considering.
Use sqlalchemy. On any framework you choose. It can reflect your database as ORM.
I’m currently rebuilding a legacy PHP web application with a MySQL database my self.
The PHP code was kind of spaghetti and is now rewritten in Java as it type safe, promotes well-structured code, has excellent tooling and has superior unit testing capabilities. For database to Java mapping I use Hibernate/JPA.
The web application is incrementally delivered to production. Meaning we run both Java and large parts of the old PHP code together until the application is fully converted.
But in order to use hibernate effectively we needs the database to be logical correct (something MySQL MyIsam does not enforce). So with each production release I run an refactoring scripts for the database (also used to build the development environment and do unit testing) and update the PHP code with a new version that works with the schema changes.
As a web framework I use Stripes as it’s simple, elegant and easy to learn.
I have very good experience with Django. Every time I needed it was up to the task for interfacing with existing database.
Autogenerated models are the start, as MySQL is not the strictest with its schema. Not that it will not work only that usually some of the db restrictions are held in app itself.
My first thought would be to use Hibernate and Java, but I may be biased because that is what my experience is in. You generally map your Model classes via Hibernate after you create the database anyway, so it might not be a bad choice.
I'll let it explain itself to you: Hibernate's website
I suppose that any PHP Framework (I'm a PHP guy, so I will only talk about PHP) could be OK for you ; but you should use one that's well-supported, has a large community, ...
To make things short, I'm thinking about one off this list :
Symfony
Zend Framework
CakePHP
Kohana
Code Igniter
Now, if you're asking "which framework is the best", it's a question that doesn't really have an answer : it's mainly a matter of personnal preferences...
Still, here's a couple of questions+answers that could bring you some interesting informations :
Best PHP framework for an experienced PHP developer?
What PHP framework would you choose for a new application and why?
To use a PHP framework or not?
PHP Framework Decision - Analysis paralysis!
PHP - MVC framework?
Which PHP Framework is right for this project?
Also, note that choosing a Framework is an important decision -- which means you should take some time to evaluate each framework and how it'll answer your specific need.
Really : you should definitely not rush that decision.
You know, there's a whole Ruby web dev world away from Rails, e.g.:
Sinatra
Ramaze
Webby
With such a general question it's always a bit hard to help...
Try web2py, extremely easy to prototype any webapp, and IMO a bit easier to grasp (overall) than other similar web frameworks, HTH
There are no clear cut winners when picking a web framework. Each platform you mentioned has its benefits and drawbacks (cost of hardware, professional support, community support, etc.). Depending on your time table, project requirements, and available hardware resources you are probably going to need some different answers.Personally, I would start your investigation with a platform where you and your team are most experienced.
Like many of the other posters I can only speak to what I'm actively using now, and in my case it is Java. If Java seems to match your projects requirements, you probably want to go with one of the newer frameworks with an active community. Currently Spring Web MVC, Struts2, and Stripes seem to be fairly popular. These frameworks are mostly, if not totally, independent of the persistence layer, but all integrate well with technologies like hibernate and jpa; although you have to do most, if not all, of the wiring yourself.
If you want to take the Java road there are also pre-built application stacks that take care of most of wiring issues for you. For an example you might want to look at Matt Raible's AppFuse. He has built an extensible starter application with many permutations of popular java technologies.
If you are interested in the JVM as a platform, you may also want to look at complete stack solutions like Grails, or tools that help you build your stack quickly like Spring Roo.
Almost all of the full stack solutions I've seen allow for integration with a legacy database schema. As long as your database is well designed, you should be able to map your tables. The mention of composite keys kind of scares me, but depending on your persistence technology this may or may not be an issue. Hibernate in Java/.NET supports mapping to composite keys, as does GORM in grails (built on hibernate). In almost all cases these mappings are discouraged, but people who build persistence frameworks know you can't always scorch earth and completely recreate your model.

Need a simple CMS. Should I customise an existing CMS or build from scratch?

I'm building a VERY simple web hosting service that will cater to the ma and pa type small business.
Now my dilemma is whether I should built it from scratch or use an existing CMS. The CMS needs to be customisable, as I wish to build my own client. I only want the user to have to put a title and content. Everything else will be hidden from the end user.
Later on I want to be able to associate my own custom built web applications to a given page, so the CMS needs to be able to cater for that.
The other requirement is that it needs to be Java based (Groovy acceptable).
Any ideas?
Even a "simple" CMS is a fairly complicated application once you start doing things like user authentication, security, scalability, etc. There are many many things you can get wrong. The major CMSes out there suffer from lots of maintenance problems and security bugs and there are a fair number of talented people working on them. If you think your CMS will be different, I suggest that it will not be. You will need to update and maintain it constantly. If you use an off-the-shelf solution you should be able to benefit from the work those other developers are doing. If you want to write your own code, consider customizing an off-the-shelf CMS or contributing new features or bug fixes.
Own CMS:
Total control over the features
Low cost
Easy for you to understand
Only you understand it and can fix it
No bug fixes from other developers
Off-the-shelf CMS:
You can simply install it, then concentrate on adding value
Steeper learning curve
Lots of hosted solutions and online help
Lots of people can admin it if you're not around
Bug fixes and security updates are released by the vendor
More limited in terms of customization, etc
Someone needs to keep on top of the updates and install them, or else the customer might be victim to a worm such as the WordPress worms. With your own CMS it's less likely that someone will create a worm just for you. (But your customers are still at risk of other security problems).
Consider the typical security issues that face every website faces: XSS, CSRF, SQL Injection, configuration errors, loose security, session hijacking, parameter validation errors, race conditions, etc. You need to handle all those cases, but the CMS vendors are already doing that for you.
As for your Java requirement, the Resin web server ships with a PHP interpreter which might allow you to deploy a PHP app in Java should you choose a PHP CMS. It should also be possible to port the PHP engine to another servlet container in a few hours (I think it's GPL).
You should definitely learn an existing CMS. As much as creating one from scratch will fit your needs. An existing CMS with a live community (such as drupal or django) will have sold foundations, based on the accumulated experience of others.
Doing so will help skip the common mistakes of creating a CMS, and will allow you to focus on functionality and making your product, versus building a framework.
Check out Alfresco Community Edition, it's java based and it's the first one to be compliant with CMIS 1.0. You can build up a web client/application on it. It has ftp, webdav, cifs, http interface.
Liferay? You'll be up and running in less than 5 minutes.
Java based, Supports Groovy
If you want to diy, take a look at CMIS. (Forget it, don't diy)
I can't imagine there isn't an existing CMS that would fit those requirements. Won't do the research for you though ;-)
If you want to figure out some Java EE technology aspects or advantages/disadvantages it is better to write your own CMS just for practice.
But before you do this go through some of the existing CMS to create list of pros and cons.
All existing CMS/frameworks/whatever can't fit well your own problem but instead they are often too big to cover as many cases as the can.
One more thing to think about. Do you want your CMS to work great at Google App Engine?

How to rapidly build a Web Application?

To build a Web Application, what kind of open source web application frameworks / technologies are currently present that would be:
Faster to learn.
Ease of use.
Have widgets for rapid development(From a GUI perspective).
Database integration.
I would want this web app to communicate to a Java client.
I am not bound to Java on the server side and free to try out any good rapid application framework.
To summarize, I haven't done much work for the server side hence am not conversant with the tools and technologies for the same.
What would you suggest?
Any and every input would be welcome!...
There is no single "right" answer to this question. As a Java programmer of some 10+ years when asked this question my usual answer is... PHP. There are several reasons for this:
Low resource usage (Apache, nginx);
Cheaper hosting;
Really low barrier to entry;
It's really Web-oriented rather than being general purpose that can be used for Web (like Java);
The fact that PHP scripts aren't persistent (like Java servlets are) between requests makes them much more forgiving and less likely to cause memory leaks and other problems;
No deployment step (like Python, Perl, etc). I'd say this is about the best thing about dynamic scripted languages. Just save the file and click reload on your browser;
PHP might be inconsistent in syntax and several other things but it's also mature and used by some really large sites on the Web (eg Facebook, Yahoo, Flickr, Wikipedia);
PHP is by far the most popular Web development language.
Widgets can be done by any manner of Javascript frameworks like YUI, ExtJS, SmartClient, jQuery UI, etc;
PHP fits well with MySQL.
That being said, a lot of these apply to other languages too (eg Python/Django).
I don't think you necessarily need a framework for PHP but if you do I'd look at one or more of:
Kohana: it's like a more modern version of the more popular CodeIgniter;
Zend Framework: it's modular so you can use as much or as little of it as you like;
Smarty: it's a powerful templating system.
Django has a few notable 'rapid' items including automatically generated administrative interface, bundled ORM (lowers dev time by not having to write SQL and some other code), and a large community with several re-usable apps.
Where Django (or Ruby on Rails or any other MVC framework for that matter) isn't going to be rapid is the learning curve when you first come to developing on them. Django (and RoR) have quite a bit of seperation-of-concerns and if you're not used to that sort of environment, it takes a while to learn the framework. If you're using an ORM that's something to get used to as well, and then of course for any framework you go with there's the API to learn as well.
PHP on the other hand is a little more intuitive in terms of where you put the code and how pages make up your web app. It'll basically let you slap code wherever you want so in the beginning it will probably be faster. In the end it will be quicker but your final product will be sloppier and probably require re-factoring later on.
This comes down to a question of what's the use of the framework. If it's for a hobby site, just go with what's easy (php), otherwise you might want to consider a well-supported MVC framework.
As others have pointed out, jquery is probably the pick for pre-made GUI widgets.
Edit -- And apparently now Django (as of 1.1) has a very awesome set of unit testing tools it comes bundled with. Things like an extended TestCase specifically for Django, a test client (you can do test page request w/o an actual client or server), a tool to give you a % of test coverage you have of the project, and a bunch of other neat stuff.
You've already tagged your question with "java", "php", "python", and "ruby-on-rails", so researching and learning more about those tools would probably help to answer your question.
However, I believe that rapidly building an application is almost never actually the correct goal. Normally, what you want to do is build an application that can be rapidly maintained -- that is, maintained with the lowest possible overall development cost over time.
I would say part of the learning curve will go into understanding concepts. I have been learning about web-apps for some months now, and with my improved understanding of concepts right now, most frameworks show very much similarities. Here are my results so far:
PHP: Great to learn about concepts for doing forms, http-post-requests, http-get-requests. easy interaction with database layer, and it is possible to obtain a working basic application in couple of hours. Almost no hassle with build-systems and web-server configuration.
Ruby-on-Rails: Great to learn about REST and more complicated CRUD applications. Great to learn about the complexity behind MVC and especially simple and powerful interaction with the database layer by using ActiveRecord. Introduction of meta-programming (code-that-writes-code, code-scaffolding) is great. Nice opportunities for free cloud-deployment, e.g. heroku.com and there is a very active community
Java: Powerful interaction with web-server possible (Tomcat, JBoss, ...) MVC is rather complicated here, and in general many configuration-steps necessary (build systems, ORM layer, ...) Grails is a great simplifaction and introduces meta-programming for Java. Jboss Seam introduces REST for Java (but have not looked into this yet)
There are tons, which ones are "good" depend on what you need.
There's Ruby on Rails, which is pretty handy.
For python there's django.
For PHP (I spend a lot of time dealing with PHP), you can look at:
symfony
cakePHP
Solar
Zend Framework
Which are all good in certain situations, and annoying in others.
Speaking only in terms of speed of development, Ruby on Rails is the fastest one out there.
I would vote for Grails.
You can build an runnable Java Web application within 5 to 10 minutes by using the following online Java web application generator:
http://www.webappexpress.net

integrating Grails and GWT

GWT seems like a really nice technology for Java developers who don't like (or don't know) HTML/JS/CSS to build rich web interfaces. On the server-side Grails also looks really nice, it's often described as "Rails for Java developers". I've read that Grails' "convention over configuration" approach, together with the benefits of dynamic languages (Groovy) can really reduce the amount of (boilerplate) code that needs to be written, while still leveraging best-of-breed Java technologies such as Spring and Hibernate.
Anyway, I haven't read much about how well these technologies play together. How easy is it to integrate GWT with Grails on the server-side? I'd be interested to learn about experiences of anyone that has build an application with these technologies? Recommendations on resources (books/websites) for building a GWT-Grails website would also be very welcome.
Cheers,
Don
Grails already has a gwt plugin: check it out.
You did mention on the server side - GWT and grails actually doesn't integrate well on the serverside (not as well as you might expect given how well grails domain objects work). For RPC, the plugin it works really well.
The problem is that domain objects cannot be serialized and tranfered across the wire - after all, they groovy objects. You will need to custom make a data transfer object (DTO), and do the marshalling manually. It is possible to automate it, but there isnt any opensource code out there that does it atm - so rolling your own is the only solution.
Or see if you can get Hibernate4gwt to work with grails - but i doubt it will out of the box either.
Another approach: use Grails with SmartGWT. Instead of GWT-RPC (too complex, and as others have noted, doesn't play well with Grails) use REST-based integration, since Grails has great support for serializing to XML or JSON and SmartGWT has built-in REST support. Take a look at this blog showing sample source - it's ridiculously easy to build a reusable master-detail screen for any Grails object.
http://josip-dev.blogspot.com/2010/06/grails-smart-gwt.html
with the benefits of dynamic languages
(Groovy) can really reduce the amount
of (boilerplate) code that needs to be
written
That's what folks from RoR camp was preaching all the time. After some initial boom RoR projects got into inevitable trouble with bigger projects. The bigger projects the more work one should delegate to compiler, i.e. the more valuable are static languages. Currently, RoR boom is all but gone.
The amount of (extra) code you need to write now with JPA/Hibernate, for instance, is almost zero. Annotations only. It even finds the mapped beans itself, in runtime, via classpath! SpringFramework makes many other "boilerplate" codepieces obsolete too.
In my GWT project (one so far, have to admit) I use JPA (Hibernate), DAO layer, business delegate pattern and it's easy and robust.

Categories

Resources