[KULRICE-4905] Display appropriate icon based on attachment type in Maintenance Documents Created: 26/Jan/11  Updated: 28/Sep/11  Resolved: 13/Jun/11

Status: Closed
Project: Kuali Rice Development
Component/s: Development
Affects Version/s: None
Fix Version/s:, 2.0
Security Level: Public (Public: Anyone can view)

Type: Task Priority: Major
Reporter: Chitra Chandran Assignee: William Balderamos (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 0 minutes
Time Spent: 2 days, 4 hours
Original Estimate: Not Specified

Attachments: JPEG File attachmentsAfter.JPG     JPEG File attachmentsBefore.JPG    
Issue Links:
cloned to KULRICE-5696 Display appropriate icon based on att... Closed
Rice Module:
Application Requirement:
KAI Review Status: Not Required
KTI Review Status: Not Required


While maintaining the attachment associated with a Maintainable BO, we need appropriate file icons to be displayed based on the MIME type.

Comment by William Balderamos (Inactive) [ 14/Apr/11 ]

Are the icons for this in KC already? And if so, may I grab those and use them with the maintenance documents?

Comment by Chitra Chandran [ 14/Apr/11 ]

Doug, can you pls attach those icons to this JIRA or provide the SVN link within KC project?

Comment by Douglas Pace [ 14/Apr/11 ]

Chitra and William -

They are in KC already. They are all in https://test.kuali.org/svn/kc_project/trunk/src/main/webapp/static/images/

and in there we have the following icons

xsl.gif (although we aren't using it since the mime type is xml)

Comment by William Balderamos (Inactive) [ 14/Apr/11 ]

Sweet, thanks Doug! Going to look at this now to see what all needs to change inside rice code.

Comment by William Balderamos (Inactive) [ 18/Apr/11 ]

Is there a standard way, library or class that handles associating file extensions to mime-type mappings? I looked at jmimemagic, but it looks to be a dead project. Also looked at MimetypesFileTypeMap or even putting it into a simple HashMap, but that requires maintaining the extension list ourselves.

Comment by Kristina Taylor (Inactive) [ 18/Apr/11 ]

I don't know of a super standard way, but mime-util (http://sourceforge.net/projects/mime-util/) looks a bit more updated than jmimemagic.

Comment by Douglas Pace [ 18/Apr/11 ]

For the work I did related to this for KC I just used the mimetype the client provides and that is available through the commons-fileupload. Are you looking for more advanced mime type detection?

Comment by William Balderamos (Inactive) [ 18/Apr/11 ]

See https://fisheye.kuali.org/cru/rice-45
There can be many mime types for a given file extension, at least that is what I am noticing after looking at http://www.iana.org/assignments/media-types/application/index.html but I am sure we can figure out all of them for the 5 unique icons that we have. There are times though during testing that I have noticed that the mime type can be wrong, or it defaults to "application/octet-stream" for which I have used the "clip.gif" as the standard unknown type. I am not so much worried about the mime type detection, more-so about how best we can maintain the association between a mime type to a file extension later on down the road. So far, I have delegated that bit to a utilities Map, but I am wondering if its better off inside of a properties file that we load during startup.

Comment by Douglas Pace [ 18/Apr/11 ]

Just so you are aware, Coeus also had a more advanced method of determining mime type but I was told KC did not need to do that and the client sent mime type was sufficient.

For the mime type to extension mapping I put the mappings into a spring map so it was modifiable, but I was wondering about the properties file idea as well.

Comment by William Balderamos (Inactive) [ 20/Apr/11 ]

See revision #16802.

Comment by Chitra Chandran [ 13/Jun/11 ]

The mimeTypeMapping for AttachmentService includes the directory structure (static/images).

notes.tag's rendering of 'download attachment' link uses this value on top of the regular images path and this adds upto an incorrect filepath.

<html:image property="methodToCall.downloadBOAttachment.attachment[$


]" src="$




" title="download attachment" alt="download attachment" style="padding:5px" onclick="excludeSubmitRestriction=true"/>

Comment by Chitra Chandran [ 13/Jun/11 ]

Have committed the fix for this. Attached are the images of filetype icon display on KC's Test Server showing the problem and same displayed with fix applied locally.

Comment by Rice-CI User (Inactive) [ 14/Jun/11 ]

Integrated in rice- #51 (See http://ci.rice.kuali.org/job/rice-
KULRICE-4905: Have modified the mimeTypeMapping for Attachment Service

Comment by Jessica Coltrin (Inactive) [ 09/Sep/11 ]

closing since is released.

Generated at Tue Jan 26 06:12:10 CST 2021 using JIRA 7.0.11#70121-sha1:19d24976997c1d95f06f3e327e087be0b71f28d4.