We were watching Apache Rave for a long time, and used it for a few production environments. And while the project is not in stable status it was enough for us. Now it’s time to go action. This is a blog about our adventures…
The first task to do was to clone the repository. I did it some time ago so I just decided to copy the data to a new directory inside Eclipse so I can go in. I used the angular branch because I think is more advanced than trunk. For me, Apache Rave is overbloated and medium weight application so the first task I will do is remove everything that’s broken. But first it must compile and run.
So I created a branch and started to import to Eclipse. I only got the basic needs to run a small copy.
[PUT IMPORT IMAGE]
The first thing I’ve found is that JPA Entity management relies in an enhacer that will not automagically run under eclipse. While this is okay we need to work around since it’s just needed in runtime to do all transaction management stuff. I must say I hate this feature of JPA and OpenJPA. You can take a look here and here.
It seems that Eclipse will not deploy it if you close the project. Even if the dependency exists!!! So I had to work around. In the rave-portal I just created [level2-rave/rave-portal/src/main/webapp/WEB-INF/lib] a directory with the compiled binary inside. And closed the project.
NOTE: If you don’t import this dependency in eclipse but just compile it with maven from the command line, you don’t need this step.
When it tries to start it fails because there’s no jndi resources for the database connection. I just took a look to the war created by cargo:run and added another file called context.xml under rave-portal-resources/src/main/webapp/META-INF. So it will create the resources when deployed.
<?xml version="1.0" encoding="UTF-8"?> <Context> <Resource name="jdbc/raveShindigDB" type="javax.sql.DataSource" auth="Container" driverClassName="org.h2.Driver" factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory" password="local" url="jdbc:h2:/tmp/rave_db;AUTO_SERVER=TRUE" username="sa"/> <Resource name="jdbc/ravePortalDB" type="javax.sql.DataSource" auth="Container" driverClassName="org.h2.Driver" factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory" password="local" url="jdbc:h2:/tmp/rave_db;AUTO_SERVER=TRUE" username="sa"/> </Context>
The last change was to set it in debug mode in log. Changing the file rave-portal-resources/src/main/resources/log4j.xml
Now it seems it runs…
IT RUNS BUT DON’T REALLY WORKS
The first problem I found is that you will be unable to log in with Firefox. I don’t know why but it seems something related to spring-security. The second thing is that if you try with chrome you will log in but it will fail.
org.springframework.web.client.HttpClientErrorException: 404 Not Found at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:88) at org.springframework.web.client.RestTemplate.handleResponseError(RestTemplate.java:537) at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:493) at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:452) at org.springframework.web.client.RestTemplate.postForObject(RestTemplate.java:302)
I know this is because shindig is not run. So I have to fix it because is not a mandatory dependency for now. So time to hack.
TIME TO HACK
Apache Rave looks promising for me. I love the LDAP and Open ID stuff (but I will not enable it on start as is now), the portal architecture but my really needed features are w3c widget support and the portal itself. But there are things that I hate. The portal is built against JSP and Tiles. A very old technology that makes it hard to hack. More if you work with graphic artists and web developers.
While it’s modular you cannot enable or disable a module without touching all configuration files, and sometimes you don’t really know where to look at.
Fix the error when shindig is not started. I need to remove the need of shindig to be started because the first thing I learnt with rave is that shindig MUST be deployed in context ROOT. And this is a pain in some contexts. So I will try to make it to play fair like wookie does.
UPDATE: I sent a patch, waiting for approval
SECOND AND MAIN TASK
I will rewrite the interface with Apache Wicket and I will do it to look as a module that you can enable or disable. This way you will be able to run main portal but for people that want to hack it will be a lot easier. But not only that I want:
- Support bootstrap
- Support themes
- Support Dojo
- Separate html and web development. I use to set the pages in plain HTML over the webapp directory so everyone will find it. (NOTE: wicket set it in the resources so they are packaged with the solution).
- Better window placement inside portal.
Time to work!