Details

    • Complexity:
      High

      Description

      We should create a new interface for datatype handlers that allow web downloads of their custom value.

      Option A:

      interface DownloadableDatatypeHandler extends CustomDatatypeHandler {
          /**
           * Gets the mime type of downloading the given custom value.
           * Must not return null.
           */
          String getMimeType(CustomDatatype dt, String valueReference);
      
          /**
           * Gets the filename downloading the given custom value.
           * May return null, in which case the framework will choose a meaningless filename.
           */
          String getFilename(CustomDatatype dt, String valueReference);
      
          /**
           * Writes the custom value to os.
           * Implementations should assume that getMimeType and getFilename have been called and applied.
           * Implementations should assume that os is some sort of BufferedOutputStream
           */
          void writeToStream(OutputStream os);
      }
      

      Option B:

      // I'm not sure why we'd need to give such low-level control to implementations
      interface DownloadableDatatypeHandler extends CustomDatatypeHandler {
          /**
           *
           */
          void writeResponse(HttpServletResponse);
      }
      
      abstract class BaseDownloadableDatatypeHandler implements CustomDatatypeHandler {
          abstract String getMimeType(CustomDatatype dt, String valueReference);
          abstract String getFilename(CustomDatatype dt, String valueReference);
          abstract void writeToStream(OutputStream os);
      }
      

        Attachments

          Activity

            People

            Assignee:
            darius Darius Jazayeri [X] (Inactive)
            Reporter:
            darius Darius Jazayeri [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: