Hi all, hi Caleb!
Clearly I'm not the only one thinking about replacing words with links!
:-) I've found the Replace Words With Links Snippet
(
http://tinyurl.com/37f79qu) and would like to know if it is worth to
get it adapted to a different bunch of requirements, if it could be
generalized or if I'm thinking about a different thing that
requires/deserves a different solution.
Having its origin in what I now consider wrong data model design
(
http://ftp.ebiotic.net/onPdr/pescaderiasDataModel.png), I now get pages
including an object of User class (representing a given provider), and
pages containing an object of Species class (representing a product
offered by one of several providers).
Doc1.User.species contents a text string like 'species 01, species 04,
species 05'
Doc2.Species.galicianName contents, for instance, 'species 04'
What I need to do is to replace 'species 04' when rendering
Doc1.User.species with a link to Doc2. And the same with the other
strings if it exist a document with a Doc2.Species.galicianName matching
one of the strings in Doc1.User.species.
I've not a clear idea yet about what must be the right implementation to
"assign items to providers, but I've to deal with what I have for now.
Please, is it worth to adapt the Replace Words With Links Snippet to
this use case? Could it be done in some other simpler way? Could you
point me to any other example that could apply to this case? Thanks!
I'm new to Velocity, to Groovy and in most of the senses to XWiki as well!
By the way: the replacement of strings with links must be done on the
fly. Doing it any other way will complicate the way users create new
pages. It could be not the most efficient and cheap way, but I'm forced
to do it this way until we time and resources to modify the whole model.
Thank you so much for your help!
Ricardo
--
Ricardo RodrÃguez
CTO
eBioTIC.
Life Sciences, Data Modeling and Information Management Systems