This patch addresses several things:
- automatic ID generation for fragments
- update to latest Cstor version (1.1.1)
- performance improvements for Castor filesystem page manager
The automatic ID generation was solved by specifying the ID field as a constructor argument for the FragmentImpl class in the Castor page mapping file. If the ID is null or empty, a new ID is generated, in a similar way as the JetspeedIDGenerator generates IDs.
To be able to use constructor arguments, I had to switch to the latest version of Castor (1.1.1). The only change I had to make to make the new version work is remove the jetspeed namespaces when parsing PSML pages. This is ok, because previously namespaces were also ignored. On a side note , it might be "cleaner" to just support the namespaces, because the namespaces are specified in most / all PSML files within Jetspeed, but I was afraid it might break customer implementations if we make the namespace mandatory.
About the performance improvements, unmarshalling / marshalling PSML pages should be a lot faster than before. I tested it on my local machine by creating 1000 pages first and then reading them in again, in between resetting the test environment. Unmarshalling took 1.3 seconds, with the old version it took about 2.4 seconds.
What I did basically was applying some performance best practices from the Castor website, and remove some deprecated code ( replacing old SAX 1 DocumentHandlers with SAX 2 ContentHandlers)