Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace XML link in the forms top nav #184

Merged
merged 3 commits into from
Nov 23, 2023
Merged

replace XML link in the forms top nav #184

merged 3 commits into from
Nov 23, 2023

Conversation

peterstadler
Copy link
Member

to point at the "raw" MEI file, not the filtered version, implementing #177.

This PR introduces a new parameter in filter/xsl/mermeid_configuration.xsl which can be read by the XForms as instance('parameters')/dcm:view_xml_url_base. The parameter is injected on the XQuery side by modules/transform.xq which is called by the controller at e.g.

<forward url="/{$exist:controller}/../modules/transform.xq" method="{request:get-method()}">

to point at the "raw" MEI file, not the filtered version
Copy link
Collaborator

@peterprovaznik peterprovaznik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have found changing @href in forms/include/topmenu.xml to be sufficient, please verify.

diff --git a/forms/includes/topmenu.xml b/forms/includes/topmenu.xml
index 895833c0..110af348 100644
--- a/forms/includes/topmenu.xml
+++ b/forms/includes/topmenu.xml
@@ -29,7 +29,7 @@
       class="xforms-trigger" 
       target="view_{instance('parameters')/dcm:xml_file}"><h:img 
         src="{instance('parameters')/dcm:server_name}/editor/images/html.gif" alt="HTML" title="View as HTML" border="0"/></h:a><h:a 
-      href="{instance('parameters')/dcm:server_name}{instance('parameters')/dcm:document_root}{instance('parameters')/dcm:xml_file}"
+      href="{instance('parameters')/dcm:server_name}{instance('parameters')/dcm:document_root}read?filename={instance('parameters')/dcm:xml_file}"
       class="xforms-trigger" 
       target="xml_{instance('parameters')/dcm:xml_file}"><h:img 
         src="{instance('parameters')/dcm:server_name}/editor/images/xml.gif" alt="XML" title="View XML data" border="0"/></h:a><xf:trigger appearance="minimal">

@peterstadler
Copy link
Member Author

Thanks for the hint @peterprovaznik , that looks promising and much simpler 👍

peterstadler and others added 2 commits November 17, 2023 23:23
implement solution provided by @peterprovaznik

Co-Authored-By: peterprovaznik <[email protected]>
@peterstadler
Copy link
Member Author

When eventually merging this PR please squash and merge to get rid of the first attempt and its reversion …

Copy link
Collaborator

@peterprovaznik peterprovaznik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have pulled the issue-177 image, and verified that the unfiltered XML is indeed shown.

(When trying this for one of the sample-files, I noticed two xml-model PIs; these disappeared after making changes, which is most likely is due to PIs not being considered in filter_{get,put}.xsl, so related to #90.)

@peterstadler
Copy link
Member Author

I have pulled the issue-177 image, and verified that the unfiltered XML is indeed shown.

(When trying this for one of the sample-files, I noticed two xml-model PIs; these disappeared after making changes, which is most likely is due to PIs not being considered in filter_{get,put}.xsl, so related to #90.)

Thanks for reviewing! I added the PIs to the list at #90 ;)

@daniel-jettka daniel-jettka merged commit da27438 into develop Nov 23, 2023
6 checks passed
@daniel-jettka daniel-jettka deleted the issue-177 branch November 23, 2023 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"View XML data" button on XForms should return unfiltered XML
3 participants