Here I was, sitting in front of Eclipse, with nothing better to do than
hack on Inectis while drinking a cup of hot strawberry tea. After
getting a little tired to work in its administrative interface (which
is, unfortunately, not going to be released as OpenSource, so I'm only
working in it for the money, and am not really motivated to work hard
on it), I decided to give JavaScript a try again.
I created a run task for the JavaScript interpreter shell in Eclipse,
and set its working directory in the same place I run my Tomcat
instance from, so I'd get all the persistent objects conveniently
located in _txLogs (the default directory where AspectWerkz stores
Prevayler transaction logs).
Voila! I had a command-line interface for Inectis. I don't need no
steenkin' UIs anymore after this. I can have all the freedom in the
world to change, move, rename or delete my objects. Don't believe it?
Take a look at this sample, then:
js> ep = Packages.inectis.plugins.core.entities.EntryPoint(); inectis.plugins.core.entities.EntryPoint@1e893df
js> home = ep.getHomePage(); inectis.plugins.core.entities.HomePage@1de17f4
js> home.name = "Inectis: CMS revolution, one aspect at a time"; Inectis: CMS revolution, one aspect at a time
js> information = ep.createFolder("General Information"); inectis.plugins.core.entities.Folder@476128
js> homeContent.html = 'Inectis is a Content Management System entirely built with Aspect-Oriented Programming concepts...'; Inectis is a Content Management System entirely built with Aspect-Oriented Programming concepts...
js> home.addContent(homeContent);
js> quit();
This can't be that easy, I think - something's gonna blow up when I
start Tomcat and reload the page. It can't be that easy. In had a total
of zero lines of code in the system regarding persistence, this just
can't be this easy. But yeah, fellas, it's that easy. Zero lines of
code, zero lines of XML definition for persistence, and here it is:
Tomcat starts, and everything shows up exactly as (un)expected. Life is
good. Smile :)