Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-292

Core should allow formentry modules to store view and resource metadata for a form



    • Type: Bug
    • Status: Closed
    • Priority: Should
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: OpenMRS 1.9.0
    • Component/s: None
    • Labels:
    • Complexity:


      Every module that does form entry needs to store a 'view' and/or 'attributes' and/or 'resources' for forms. E.g. the formentry module has the formentry_xsn table (and the template and xslt columns in the form table), and the htmlformentry module has the htmlformentry_html_form table.

      It would be better if core provided a way for modules to attach and retrieve binary or xml data on the Form object.

      Do something like:

      create table form_resource ( -- Burke doesn't want to call these resources. I don't want to call them attributes. Need to find a better name
          id integer primary key,
          form_id integer references form
          owner varchar(100), -- e.g. 'formentry'
          resource_name varchar(100), -- e.g. 'xslt'
          mime_type varchar(100),
          binary_data blob,
          text_data mediumtext -- usually xml

      (Maybe also allow resources to point to a file on the filesystem.)

      I don't think these resources need to be accessible directly from the Form object (since they're large), rather you need to do something like

      interface FormService \{
          Map<name, mimeType> getResourceTypes(String owner, Form form)
          String getResourceAsText(String owner, Form form, String resourceName)
          byte[] getResourceAsBytes(String owner, Form form, String resourceName)

      Also, the 'form' table has two legacy columns that are specific to infopath formentry (template and xslt). These columns should be removed, in a way that doesn't lose data for users of the infopath formentry module.

      The form entry portlet will need to be revised to

      [ticket replaces TRAC-1652 which was intended as a possible quick-fix, but is not the long-term solution.|This]

        Gliffy Diagrams


          1. TRUNK-292.patch
            79 kB
          2. TRUNK-292-resources.patch
            78 kB
          3. TRUNK-292-second.patch
            59 kB

            Issue Links



                jeremy Jeremy Keiper
                darius Darius Jazayeri
                1 Vote for this issue
                9 Start watching this issue