[Building Sakai] transferCopyEntitiesRefMigrator - how does it work ??

Bryan Holladay holladay at longsight.com
Mon Nov 21 05:05:24 PST 2011


All the behind the scenes magic is happening in the SiteAction class
in the site-manage tool.  Essentially it calls all the
entitytransferrables and stores the returned map of oldRef->newRefs.
Then it calls each entities "updateEntityReferences" method with the
complete map of transfered entities.  There are 3 methods you have to
implement to make an entity transferable:

-public Map<String, String> transferCopyEntitiesRefMigrator(String
fromContext, String toContext, List resourceIds):

This method is exactly the same as transferCopyEntities, where it just
copies the entities from the "fromContext" in the "toContext" except
that it also requires you to return a map of: OldRef->NewRef

-public Map<String, String> transferCopyEntitiesRefMigrator(String
fromContext, String toContext, List ids, boolean cleanup):

Same as above.

-public void updateEntityReferences(String toContext, Map<String,
String> transversalMap)

This is the method that does the updating references.  It is called
after every entity has been transfered and it passess in the map of
OldRef->NewRef.


The samigo tool has already been implemented and committed into trunk
at https://jira.sakaiproject.org/browse/SAM-1299.


Thanks,
Bryan

On Fri, Nov 18, 2011 at 3:50 PM, George Pipkin <gpp8p at virginia.edu> wrote:
>
> Hi -
>
>    I have been playing around with the SAK-16568 patches that allow the
> Import from Site feature
> to change links from an old site to entities contained in a new site,
> particularly as it relates
> to links contained within a syllabus.  I have patched this int
> sakai_2-7-x, and overall the thing
> works, except for links to samigo entities.  So I am trying to
> understand how it works where it
> does work, and I focused on forums links which are also /direct links.
> I have traced the program execution
> through a method called transferCopyEntitiesRefMigrator, which was added
> to SyllabusServiceImpl.java
> by the SAK-16568 patches.  I looked at the URL for this link, and for
> the life of me I can't
> see where it is being changed, but somehow it is.  All through this
> method, the link is:
>
> href="/direct/forum_topic/109?p=1"
>
> yet somehow when it is all done, the link in the new syllabus is:
>
> http://localhost:8080/direct/forum_topic/114?p=1
>
> I would love it is somebody could explain to me where and how this
> miracle takes place, since I would like to conjure up a similar
> miracle for samigo.
>
>                                     - George Pipkin
>                                         U.Va.
> _______________________________________________
> 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