[Building Sakai] updating links to other tools when copying Lessons from site to site

Charles Hedrick hedrick at rutgers.edu
Thu Jun 21 13:30:15 PDT 2012


Yes. I implement this. But as far as I can tell, the site archive / merge code doesn't call updateEntityReferences. For this new interface to work:
* the code in site manage or archive must call updateEntityRefences
* all of the tools must implement the new interface

Current duplicate site calls updateEntityReferences, and at least some of the import content does, but not archiving. While Rutgers doesn't use archiving, it's important to some sites.

The way my code currently works is that the XML produced during copy includes the title of all assignments, tests and forum topics referred to. In a copy operation, if the code calls updateEntityReferences, and if an object is in the map, then I use the map to find the corresponding object in the new site. If it's not in the map (i.e. the tool doesn't implement this interface), I look through all assignments, quizzes, or topics to find one with the correct title. If the copy operation doesn't call updateEntityReferences, then the first time someone tries to look at that Lessons page, the UI code calls it. A site property is used to flag sites that have had data imported but haven't run updateEntityReferences yet.


On Jun 21, 2012, at 8:42 AM, Bryan Holladay <holladay at longsight.com> wrote:

>> It would be nice if there
>> was a standard api in the archive/merge code for updating entity
>> references, as there is in site copy.
> 
> There is since 2.8.1: https://jira.sakaiproject.org/browse/SAK-16568
> 
> The API is https://source.sakaiproject.org/svn//kernel/trunk/api/src/main/java/org/sakaiproject/entity/api/EntityTransferrerRefMigrator.java
> 
> There are already a handful of tools that implements this.
> Essentially, each tool is responsible for reporting which ID's need to
> be transfered, then once all tools are migrated, each tool gets a
> notification of all ID's that have been transfered and is up to the
> tool to make the changes.
> 
> You can look at the example of the Assignments tool:
> https://source.sakaiproject.org/svn//assignment/trunk/assignment-impl/impl/src/java/org/sakaiproject/assignment/impl/BaseAssignmentService.java
> 
> 
> -Bryan
> 
> 
> On Wed, Jun 20, 2012 at 5:35 PM, Bruce Cota <bcota at unicon.net> wrote:
>> I'm working on a project that uses archive/restore heavily.   We had to
>> hack around this issue with for samigo and assignments in lessonbuilder
>> (by modifying both tools and lessonbuilder).  I think we had a similar
>> issue with announcements and assignments.   It would be nice if there
>> was a standard api in the archive/merge code for updating entity
>> references, as there is in site copy.
>> 
>> On 06/20/2012 05:28 PM, Hedrick Charles wrote:
>>> The biggest hole seems to be archive / restore. Some sites apparently care about it. It does't save all the tools (Samigo and Assignments 2 being our big ones) and doesn't run the update links method when restoring.
>>> 
>>> My patch will the update links method, but if tools don't implement archive/restore I don't currently deal with that.
>>> 
>>> On Jun 20, 2012, at 4:44:15 PM, Adam Marshall wrote:
>>> 
>>>> I think we have a few bug reports and some patches for the site copy process. Matthew Buckett will, if he has not already, create jiras with patches.
>>>> 
>>>> In the main site copy works well although I'm not sure about SAMIGO as we dont use that.
>>>> 
>>>> adam
>>>> 
>>>> ________________________________________
>>>> From: sakai-dev-bounces at collab.sakaiproject.org [sakai-dev-bounces at collab.sakaiproject.org] on behalf of Charles Hedrick [hedrick at rutgers.edu]
>>>> Sent: 20 June 2012 20:14
>>>> To: sakai-dev at collab.sakaiproject.org Developers
>>>> Subject: [Building Sakai] updating links to other tools when copying Lessons    from site to site
>>>> 
>>>> The most common request at the conference was to make sure when you copy content from one site to another, links to other tools are always fixed up. I've just checked in code do that. However there are some limitations. The way it works depends upon whether the copy mechanism uses updateEntityReferences. "Duplicate site" and some other things do. But importing an archive file does not.
>>>> 
>>>> My code now sets a site property when importing a Lesson into a site. The update link code clears the property. If updateEntityReferences is not called by the kernel, the first time you display any Lesson from the site, my code will call it.
>>>> 
>>>> Samigo has extra complexities:
>>>> 
>>>> 1) site archive doesn't save Samigo tests, so an archive restore won't restore them. If you have fixed this in your code, things ought to work.
>>>> 
>>>> 2) Even in site duplicate, which does copy Samigo, it copies only "core assessments" not published assessments. Lessons must, of course, point to published assessments. What I do is leave behind a fixup pointing to the core assessment. As soon as the user publishes the assessment, Lessons will notice it and fix up the reference to point to the newly published assessment.
>>>> 
>>>> 3) Until the assessment is published, the Lessons link will be grayed out.
>>>> 
>>>> 4) If an assessment is published, Lessons links to it, and the core assessment is deleted, this process won't work, since the new site won't have anything for that assessment at all. This is not a problem I can fix.
>>>> 
>>>> The result is normally usable, but odd cases can certainly occur where there are reference that don't work. A clear note is placed on the page explaining.
>>>> 
>>>> _______________________________________________
>>>> sakai-dev mailing list
>>>> sakai-dev at collab.sakaiproject.org
>>>> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>>>> 
>>>> TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of "unsubscribe"
>>> _______________________________________________
>>> sakai-dev mailing list
>>> sakai-dev at collab.sakaiproject.org
>>> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>>> 
>>> TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of "unsubscribe"
>>> 
>> _______________________________________________
>> sakai-dev mailing list
>> sakai-dev at collab.sakaiproject.org
>> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>> 
>> TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of "unsubscribe"
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
> 
> TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of "unsubscribe"



More information about the sakai-dev mailing list