[sakai-core-team] directurl in site duplicate; URL shortener question

Charles Hedrick hedrick at rutgers.edu
Tue Jan 13 10:19:09 PST 2015


I’ve just created (but not approved) a pull request for a patch that handles mapping direct URL’s. It does the formats generated in the UI, long and short. It will work for short URL’s unless you configure to use bitly.

If you end up contributing your patch I’ll look to see whether it would allow me to remove the short URL handling in mine. I’ll add a notation to your jira that anyone fixing it should look at mine as well. 


> On Jan 13, 2015, at 12:58 PM, Adam Marshall <adam.marshall at it.ox.ac.uk> wrote:
> 
> We've done a lot of work in translating short URLs during the site copy process. We only translate absolute URLs and haven’t yet tackled relative ones but we do translet URLs displayed on screen, ie, where somebody has used the URL as 'text' on a web page.
> 
> We need to contribute the code back (I know I know): https://jira.sakaiproject.org/browse/SAK-25447. When we are less snowed under with mega urgent tasks I'll try to get Matthew or Nick to attach a patch to the aforementioned Jira.
> 
> Adam
> --
> 
> ** Note change of email address to adam.marshall at it.ox.ac.uk **
> 
> Dr A C Marshall, WebLearn Service Manager, University of Oxford.
> IT Services, 13 Banbury Rd, Oxford. OX2 6NN. 
> 
> 
> 
> -----Original Message-----
> From: sakai-core-team-bounces at collab.sakaiproject.org [mailto:sakai-core-team-bounces at collab.sakaiproject.org] On Behalf Of Charles Hedrick
> Sent: 13 January 2015 14:46
> To: sakai-core-team
> Subject: [sakai-core-team] directurl in site duplicate; URL shortener question
> 
> I’m concerned that in 2.9 or so we added a feature to produce a “direct URL”, but didn’t make sure site duplicate would handle those URL’s. I have a fairly simple patch to site-manage that will do it, except for short URL’s.
> 
> The simplest way to handle direct URL’s is to add them to the map, so that the existing kernel code will pick them up when it updates HTML blocks. That’s pretty easy. But if the URL shortened is in use (which it is by default) this presents an issue. i can easily call the shortener to get the short URL for all the direct URL’s, but this presents a possible issue:
> 
> * for randomized URL’s (which seem to be the default, even though the code seems to default to no-op), this will make a database entry. This may not be terrible, but in the end a lot of sites are copied, so we have to be prepared to get shortener database entries for every tool in Sakai eventually
> * for bitly URL’s, this could significantly increase the rate at which requests are made. For large sites it might be impractical.
> 
> The randomized implementation has a function to see whether a short URL has been created. That would allow us to put only URLs that have been created in the map, and avoid increasing the size of the database. But I’m not sure how to do that with the bitly implementation, or whether it’s even possible.
> 
> PROPOSAL:
> For the moment, I suggest adding a method shouldCopy(String url) to the shorten API, which returns true for randomized URLs that have been generated and false for both no-op and bitly URL’s. This would make the default case work correctly, and leave the bitly case up to someone who understands bitly.
> 
> I really wish someone had caught these issues when the direct URL feature was added. When adding UI features we need to think how they interact with site duplication.
> 
> _______________________________________________
> sakai-core-team mailing list
> sakai-core-team at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-core-team



More information about the sakai-core-team mailing list