openmichigan / OERbit

OERbit is a Drupal-based publishing platform for publicly licensed learning resources (OER/OCW)
http://open.umich.edu/wiki/OERbit
GNU General Public License v2.0
14 stars 5 forks source link

Zip file of all materials should have course/resource name #3

Closed kwcoffman closed 12 years ago

kwcoffman commented 13 years ago

From: Kathleen Ludewig Omollo Was: https://www.umms.med.umich.edu/it.jira/browse/OERDRUPAL-52

When you click the "Download All Materials" link, the default name for ALL zip files is Archive.zip. In educommons, whenever you downloaded a course, it would have the same name as the course, e.g. "Download this course" for https://open.umich.edu/education/si/si550-winter2010 yielded a file called si550-winter2010.zip.

From: Kevin Coffman

I tested a simple fix of using the $node->title as the default archive name.

There are few potential drawbacks: 1) This can lead to very long names and ... 2) will have to be filtered to change "/" and possibly other characters to valid filename characters. 3) The name will not include the semester information.

An example might be "SI 532 / SI 732 - Digital Government 1: Information Technology and Democratic Politics.zip" which would need to be changed to "SI 532 _ SI 732 - Digital Government 1: Information Technology and Democratic Politics.zip"

Would that be acceptable?

kwcoffman commented 13 years ago

From: Pieter Kleymeer

Instead of the node title, you might try to use the code/url and append the term and academic year.

Content: Code/URL (field_code) Content: Academic Term (field_course_term) Content: Academic Year (field_course_year)

example: si502-winter2009.zip

The url will always exist for a course/resource and if either or both of the term/year are null, you can just go with the url.

kwcoffman commented 13 years ago

From: Bob Riddle

I made a change to the openmichigan/zip_download.module where it will use the "path" name for the file name. This means that the file name will be consistent with the "CleanURL" used to locate the Course on the server. thus, if someone has problems with the downloaded content, it is clear where it came from.

Material downloaded from: https://open-bob.umms.med.umich.edu/education/si/si508/fall2008 will be downloaded in a file named: education-si-si508-fall2008.zip

Here's a diff showing the changes to the zip_download.module:

112a113,114 
> $zname = (str_replace("/", "-", $node->path).'.zip'); 
> 
116c118 
< '#default_value' => 'Archive.zip', 
--- 
> '#default_value' => $zname, 
294a297 
> $filename = (str_replace("/", "-", $node->path).'.zip'); 
pkleymee commented 13 years ago

A couple of considerations: 1) this means that every zip file will start with "education-" 2) if the zip file is nested within a number of levels in a hierarchy, the file name could get really long (e.g., "education-engin-cheme-courses-undergrad-firstyear-processes-che125-fall2011.zip")

bdr commented 13 years ago

This allows us to "find" the content on the web site, even if one embeds the "download zip file" in a page that is not under the "education" path. This means you don't need special knowledge to locate the source of the zip file if there is a problem with the zip file.

It seems a user friendly file name to me, descriptive. Feel free to specify a preferred algorithum to parse the path name to produce a file name if this is not appropriate. I'm happy to implement whatever you prefer.

from my Android phone On May 27, 2011 1:41 PM, "pkleymee" < reply@reply.github.com> wrote:

A couple of considerations: 1) this means that every zip file will start with "education-" 2) if the zip file is nested within a number of levels in a hierarchy, the file name could get really long (e.g., "education-engin-cheme-courses-undergrad-firstyear-processes-che125-fall2011.zip")

Reply to this email directly or view it on GitHub: https://github.com/openmichigan/OERbit/issues/3#comment_1250457

pkleymee commented 13 years ago

I think this will work.

On Fri, May 27, 2011 at 2:14 PM, bdr < reply@reply.github.com>wrote:

This allows us to "find" the content on the web site, even if one embeds the "download zip file" in a page that is not under the "education" path. This means you don't need special knowledge to locate the source of the zip file if there is a problem with the zip file.

It seems a user friendly file name to me, descriptive. Feel free to specify a preferred algorithum to parse the path name to produce a file name if this is not appropriate. I'm happy to implement whatever you prefer.

from my Android phone On May 27, 2011 1:41 PM, "pkleymee" < reply@reply.github.com> wrote:

A couple of considerations: 1) this means that every zip file will start with "education-" 2) if the zip file is nested within a number of levels in a hierarchy, the file name could get really long (e.g.,

"education-engin-cheme-courses-undergrad-firstyear-processes-che125-fall2011.zip")

Reply to this email directly or view it on GitHub: https://github.com/openmichigan/OERbit/issues/3#comment_1250457

Reply to this email directly or view it on GitHub: https://github.com/openmichigan/OERbit/issues/3#comment_1250671

kwcoffman commented 12 years ago

Merged this change to 1.0-stable.

bdr commented 12 years ago

Super!

from my Android phone On Jun 9, 2011 1:16 PM, "kwcoffman" < reply@reply.github.com> wrote:

Merged this change to 1.0-stable.

Reply to this email directly or view it on GitHub: https://github.com/openmichigan/OERbit/issues/3#comment_1336114