I have a data model that follow this page structure:
Detectors
-> Detector1
-> Detector1History1
-> Detector1History2
-> Detector2
(Implemented with my DetectorClass and DetectorHistoryClass)
The Detectors is like a dashboard for Detectors and their history. It's mostly
working. My issue is that my Velocity code on that top dashboard page is looking pretty
ugly. It has nested loops and I don't know how to do any encapsulation. If I could
do things like detector1.getNewestHistory() that would be very helpful. But my Detector
Object Class is limited to what I can define in XWiki. To my knowledge, XWiki's
"user defined" classes aren't able to encapsulate code. Am I wrong?
It seems like defining my Velocity macros would help, but my understanding is a macro
can't return anything, just evaluates to output.
If I'm wrong-headed, please correct me.
Thanks,
Scott