Kuali Rice Development
  1. Kuali Rice Development
  2. KULRICE-4905

Display appropriate icon based on attachment type in Maintenance Documents

    Details

    • Type: Task Task
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.3.2, 2.0
    • Component/s: Development
    • Security Level: Public (Public: Anyone can view)
    • Labels:
      None
    • Similar issues:
      KULRICE-5696Display appropriate icon based on attachment type for Persistable Attachments in Maintenance Documents
      KULRICE-5106Maintenance Document does not display attached file
      KULRICE-5363Inquiry - Support for displaying bo attachments and downloading
      KULRICE-6890make the note/attachment framework available for maintenance documents
      KULRICE-5809ComponentMaintenanceDocument document type missing
      KULRICE-1782Build Group Type
      KULRICE-5130Sample Maintenance Document for testing attachments
      KULRICE-7051The "Queue Document" button on the Document Operation screen may not be forwarding back to the appropriate application properly
      KULRICE-5118Old attachments in Maintenance Documents not showing except on a document reload
      KULRICE-2915When clicking on the lookup icon for "Parent Document Type" on the Document Type lookup, we need to change the label in the header of the page to read "Parent Document Type"
    • Rice Module:
      KNS
    • Application Requirement:
      KC
    • KAI Review Status:
      Not Required
    • KTI Review Status:
      Not Required

      Description

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

        Issue Links

          Activity

          Chitra Chandran made changes -
          Field Original Value New Value
          Link This issue is relied upon by KCINFR-102 [ KCINFR-102 ]
          Chitra Chandran made changes -
          Summary Display appropriate icon based on attachment type Display appropriate icon based on attachment type in Maintenance Documents
          Chitra Chandran made changes -
          Link This issue is relied upon by KCINFR-102 [ KCINFR-102 ]
          Chitra Chandran made changes -
          Link This issue relates to KCINFR-102 [ KCINFR-102 ]
          Jessica Coltrin (Inactive) made changes -
          Fix Version/s 1.0.4? [ 16014 ]
          Jessica Coltrin (Inactive) made changes -
          Fix Version/s 1.0.3.2 [ 16232 ]
          Fix Version/s 1.0.4? [ 16014 ]
          Jessica Coltrin (Inactive) made changes -
          Assignee William Balderamos [ wbalderamos ]
          William Balderamos (Inactive) made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Hide
          William Balderamos (Inactive) added a comment -

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

          Show
          William Balderamos (Inactive) added a comment - Are the icons for this in KC already? And if so, may I grab those and use them with the maintenance documents?
          Hide
          Chitra Chandran added a comment -

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

          Show
          Chitra Chandran added a comment - Doug, can you pls attach those icons to this JIRA or provide the SVN link within KC project?
          Hide
          Douglas Pace added a comment -

          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

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

          Show
          Douglas Pace added a comment - 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 word.gif xls.gif epdf.gif xml.gif xsl.gif (although we aren't using it since the mime type is xml)
          Jessica Coltrin (Inactive) made changes -
          Fix Version/s 2.0 [ 14190 ]
          Jessica Coltrin (Inactive) made changes -
          Start Date
          Fix Date 2011-08-01 [ set to sprint end date ]
          Hide
          William Balderamos (Inactive) added a comment -

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

          Show
          William Balderamos (Inactive) added a comment - Sweet, thanks Doug! Going to look at this now to see what all needs to change inside rice code.
          Hide
          William Balderamos (Inactive) added a comment -

          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.

          Show
          William Balderamos (Inactive) added a comment - 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.
          Hide
          Kristina Taylor (Inactive) added a comment -

          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.

          Show
          Kristina Taylor (Inactive) added a comment - 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.
          Hide
          Douglas Pace added a comment -

          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?

          Show
          Douglas Pace added a comment - 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?
          Hide
          William Balderamos (Inactive) added a comment -

          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.

          Show
          William Balderamos (Inactive) added a comment - 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.
          William Balderamos (Inactive) logged work - 18/Apr/11 4:48 PM
          • Time Spent:
            1 day, 4 hours
             
            Implemented what might be a solution to this problem.
          William Balderamos (Inactive) made changes -
          Remaining Estimate 0 minutes [ 0 ]
          Time Spent 1 day, 4 hours [ 43200 ]
          Worklog Id 74255 [ 74255 ]
          Hide
          Douglas Pace added a comment -

          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.

          Show
          Douglas Pace added a comment - 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.
          William Balderamos (Inactive) logged work - 20/Apr/11 11:29 AM
          • Time Spent:
            1 day
             
            Refactoring code to make mappings modifiable. Testing.
          William Balderamos (Inactive) made changes -
          Time Spent 1 day, 4 hours [ 43200 ] 2 days, 4 hours [ 72000 ]
          Worklog Id 74270 [ 74270 ]
          Hide
          William Balderamos (Inactive) added a comment -

          See revision #16802.

          Show
          William Balderamos (Inactive) added a comment - See revision #16802.
          William Balderamos (Inactive) made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Scott Gibson (Inactive) made changes -
          Security User [ 10014 ] Public [ 10015 ]
          Hide
          Chitra Chandran added a comment - - edited

          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[$

          {status.index}

          ]" src="$

          {ConfigProperties.kr.externalizable.images.url}

          $

          {note.attachment.attachmentIconPathByMimeType}

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

          Show
          Chitra Chandran added a comment - - edited 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[$ {status.index} ]" src="$ {ConfigProperties.kr.externalizable.images.url} $ {note.attachment.attachmentIconPathByMimeType} " title="download attachment" alt="download attachment" style="padding:5px" onclick="excludeSubmitRestriction=true"/>
          Chitra Chandran made changes -
          Resolution Fixed [ 1 ]
          Status Resolved [ 5 ] Reopened [ 4 ]
          Hide
          Chitra Chandran added a comment -

          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.

          Show
          Chitra Chandran added a comment - 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.
          Chitra Chandran made changes -
          Attachment attachmentsBefore.JPG [ 49310 ]
          Attachment attachmentsAfter.JPG [ 49311 ]
          Chitra Chandran made changes -
          Status Reopened [ 4 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Hide
          Rice-CI User (Inactive) added a comment -

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

          Show
          Rice-CI User (Inactive) added a comment - Integrated in rice-1.0.3.2-nightly #51 (See http://ci.rice.kuali.org/job/rice-1.0.3.2-nightly/51/ ) KULRICE-4905 : Have modified the mimeTypeMapping for Attachment Service
          Hide
          Jessica Coltrin (Inactive) added a comment -

          closing since 1.0.3.2 is released.

          Show
          Jessica Coltrin (Inactive) added a comment - closing since 1.0.3.2 is released.
          Jessica Coltrin (Inactive) made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Chitra Chandran made changes -
          Link This issue cloned to KULRICE-5696 [ KULRICE-5696 ]
          Shem Patterson (Inactive) made changes -
          Workflow custom [ 89978 ] Copy of custom for rice [ 212516 ]
          Shem Patterson (Inactive) made changes -
          Workflow Copy of custom for rice [ 212516 ] custom [ 222264 ]
          Shem Patterson (Inactive) made changes -
          Workflow custom [ 222264 ] Rice Workflow [ 232012 ]

            People

            • Assignee:
              William Balderamos (Inactive)
              Reporter:
              Chitra Chandran
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 2 days, 4 hours
                2d 4h

                  Structure Helper Panel