[Building Sakai] fixing up references in copy

Charles Hedrick hedrick at rutgers.edu
Mon Jun 18 07:15:11 PDT 2012


There are many ways to copy content in Sakai: In site info, duplicate site, import content from site, using a site as template when creating a new one, and archive / restore.

When a  tool (I'm thinking specifically of Lessons) refers to instances of another tool, those references need to be updated to refer to the copies in the new site. Duplicate site calls each tool twice. The first time it copies itself. The second time is updateEntityReferences. This causes the tool to update any references to other tools. It is called as part of a second pass, after all tools have copied themselves.

Unfortunately updateEntityReferences is only called by the duplicate site code. None of the other import or restore mechanisms use it. Furthermore, it passes a map of old to new references, which only a few tools build.

Currently Lessons depends upon updateEntityReferences to update references. I use an approach that makes use of the map where there are entries, but uses another approach where there are not. But still, this only works for Duplciate Site. It was quite clear at the Conference that users want it to work for all the cases.

I'd like to see updateEntityReferences called for all types of content copy / import. But it appears that I'm going to need to do a hack, since people want this code to work in 2.8 and earlier.



More information about the sakai-dev mailing list