[Building Sakai] Adjusting links after a site duplication

Bryan Holladay holladay at longsight.com
Wed Sep 14 13:02:13 PDT 2011


>   Thanks for your reply.  Lemmie see if I understand what you're saying.
>  When
> you apply this change, all the old transferCopyEntities methods are changed
> such that they now return a map of the references (links?)

You will need to update all the tools that you want to implement the
TransferEntitiesRefMigrator API.  I've done a first round for a lot of
the common tools (and nothing too intricate).  Look at
http://source.sakaiproject.org/viewsvn?view=revision&revision=95924
for a reference.  I've also done MSGCNTR and Samigo as well.  If you
want to add another tool, extend both TransferEntities and
TransferEntitiesRefMigrator (and please contribute it back if it's not
a custom tool).

> Looking at SiteAction, there is now a
> updateEntityReferences
> that is called by importToolIntoSite.  Does this mean that after this change
> is applied,
> when you;re doing a normal site dup, the references are now updated to
> reflect the new
> site context ?  For example, lets say I had a syllabus that contained direct
> links
> to some assignments, resources, quizzes forum topics etc.  Woould all these
> links
> be updated when the site was dupped ?


It can only update references for tools you import.  This makes sense
because if you don't import the tool, there isn't a new link to
reference.  But correct, if you had a syllabus with all of those
tools, it will update all the links.  This is because of the order the
API works.  First it collects all the reference mappings from all the
imported tools, then it calls the update references to each of the new
tools with the mapping from all the tools.

Thanks
Bryan


On Wed, Sep 14, 2011 at 3:43 PM, George Pipkin <gpp8p at virginia.edu> wrote:
> Hi Bryan -
>
>   Thanks for your reply.  Lemmie see if I understand what you're saying.
>  When
> you apply this change, all the old transferCopyEntities methods are changed
> such that they now return a map of the references (links?) that might be
> contained
> within any of their content.  Looking at SiteAction, there is now a
> updateEntityReferences
> that is called by importToolIntoSite.  Does this mean that after this change
> is applied,
> when you;re doing a normal site dup, the references are now updated to
> reflect the new
> site context ?  For example, lets say I had a syllabus that contained direct
> links
> to some assignments, resources, quizzes forum topics etc.  Woould all these
> links
> be updated when the site was dupped ?
>
>                                                    - George Pipkin
>                                                        U.Va.
>
>
> On 9/14/11 1:27 PM, Bryan Holladay wrote:
>>
>> You seem to be confused on what SAK-16568 does.  It creates an API to
>> manage conversions in text.  It is an extension of EntityTransferrer
>> by extending the API to do two things:
>>
>> 1)  When the tool transfers entities (ie. copy from one site to the
>> other), it returns a Mapping of (fromContextRef ->  toContextRef).
>> This is collected and then passed into the 2nd step once everything is
>> collected from all tools being migrated.
>>
>> 2)  updateEntityReferences(String toContext, Map<String, String>
>>  transversalMap)
>> You can leave this blank or use the mapping to do a String.replace()
>> in any text you want to update in your tool.
>>
>>
>>> 1) In the case of Forums, Topics appear to move over properly as it is,
>>> but the forum
>>> as a draft ?  Do the modifications in SAK-16568 also move over postings
>>> ?  Are the forums
>>> themselves moved to non-draft status
>>
>> This Jira doesn't deal with converting anything to draft.  The default
>> for site import is to import everything as a draft.  There is a
>> property you can set in Sakai.Properties to make it so all imported
>> data is published.
>>
>> import.importAsDraft=false
>>
>> *(not tied to SAK-16568)
>>
>>> 2) Samigo - after a site dup, the old quizzes are non published in the
>>> new site. Does it
>>> publish the quizzes and then adjust the links ?
>>
>> Samigo doesn't import published sites over, just the working copies.
>>
>> *(Not tied to SAK-16568)
>>
>>> 3) Assignments - after a site dup, assignments in the new site are
>>> drafts.  Does the new
>>> code change this ?
>>
>> set import.importAsDraft=false
>> *(not tied to SAK-16568)
>>
>>> 4) As I understand it, this code is invoked from Entity Picker.  How
>>> does this work ?
>>
>> Nope, Entity picker is just a use case for the need for this jira.
>> You seem to have another use case and SAK-16568 will cover it.
>>
>>> Am I right
>>> in assuming the critical code in each tool is contained within method
>>> updateEntityReferences ?  Could
>>> this be called from another context - for instance a free-standing "copy
>>> site" tool ?
>>
>> If you want to use this API, just implement EntityTransferrer and
>> EntityTransferrerRefMigrator.  For good reason (there's a long
>> conversation in the list archive), this is broken into 2 API's, but
>> you will want to use EntityTransferrerRefMigrator function
>> transferCopyEntitiesRefMigrator if you want to return a mapping,
>> otherwise you just need to implement updateEntityReferences.
>>
>>
>> Thanks,
>> Bryan
>>
>>
>>
>>
>>
>>>                                        - 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