Status: Code Review (Post-Commit)
Affects Version/s: None
Fix Version/s: Core 2.4.0
Fix the DTD file for the config.xml in version 1.6 and upload it to the resources of org/openmrs/module/dtd so its also are under version control, can easily be found, edited and uploaded back to resource.openmrs.org.
Fix the DTDs since its currently invalid:
- the element module was redeclared when introducing the conditionalResources element in the following variant:
This is not possible since module is already our root element with a totally different structure (allowed children elements, ...). We can thus not create a DTD for the above since its not valid XML.
We agreed on the naming the module element thats a child of conditionalResource to loadIfModulesPresent which looks like
The other variant of loading conditional resources remains unchanged
NOTE: the openmrsVersion element has an "alias" element named openmrsPlatformVersion although the wiki doesnt mention this, this is how openmrs-core has implemented it (ModuleFileParser treats it the same as openmrsVersion and takes either or to set the fieldfield openmrsPlatformVersion of object ModuleConditionalResource), although usage on github shows no use of openmrsPlatformVersion instead openmrsVersion is used exclusively. I decided to keep both elements to not break any existing code.
Furthermore, the DTD for version 1.6 was never uploaded to http://resources.openmrs.org/doctype/config-1.6.dtd. Once the DTD is in the core repo it will automatically be uploaded to the URL as implemented in https://talk.openmrs.org/t/update-http-resources-openmrs-org-doctype-config-dtd-files-1-0-1-5/18017/4?u=teleivo
I fixed DTDs according to descriptions here https://wiki.openmrs.org/display/docs/Module+Config+File and by searching github.com to double check on how modules define their config.xml.
changes as discussed here https://talk.openmrs.org/t/fix-config-xml-dtd-file-version-1-6/17505/6
- add optional element conditionalResources which needs a minimum of 1 conditionalResource if added to config.xml
- conditionalResource requires a path element, and either openmrsVersion or openmrsPlatformVersion or loadIfModulesPresent
- loadIfModulesPresent requires at least 1 openmrsModule with required moduleId and version child elements
follows the Config.dtd Version History: