8000 add xlink type to content by bou3108 · Pull Request #223 · ansforge/SAMU-Hub-Modeles · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

add xlink type to content #223

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

Merged
merged 9 commits into from
Jan 10, 2025
Merged

Conversation

bou3108
Copy link
Collaborator
@bou3108 bou3108 commented Dec 30, 2024

No description provided.

@bou3108 bou3108 self-assigned this Dec 30, 2024
@bou3108 bou3108 requested a review from romainfd December 30, 2024 14:01 8000
Copy link
File Coverage [78.65%] 🍏
EdxlHandler.java 78.65% 🍏
Total Project Coverage 68.48% 🍏

Copy link
Collaborator
@romainfd romainfd left a comment

Choose a reason for hiding this comment

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

Efficace !!!!

@@ -70,6 +70,7 @@ public String serializeJsonEDXL(EdxlMessage edxlMessage) throws JsonProcessingEx
}

public String serializeXmlEDXL(EdxlMessage edxlMessage) throws JsonProcessingException {
return xmlMapper.writeValueAsString(edxlMessage);
String baseXml = xmlMapper.writeValueAsString(edxlMessage);
return baseXml.replace("<content>", "<content xlink:type=\"resource\">");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ca s'applique que sur le premier match ? Pas de risque avec des balises internes qui seraient aussi ?? Peut-être mettre un test dessus aussi avec un CustomContent ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Si, mais je ne vois qu'avec customContent que ça pourrait arriver - donc pas dans la cible donc - car en dessous les autres balises content éventuelles seraient forcément namespacées différemment.

Copy link
Collaborator
@romainfd romainfd left a comment

Choose a reason for hiding this comment

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

Ca avait pas commenté désolé

Comment on lines 22 to 23
<content xmlns:xlink="http://www.w3.org/1999/xlink" xlink:type="resource">
<jsonContent>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Bizarre ce "jsonContent" dans un XML non ?
Et pourquoi tous les fichiers exemples XML qui sont générés à partir des JSON ne sont pas modifiés ? Alors que ton test a l'air bien OK pourtant !

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Tous ces fichiers générés sont des "UseCase messages", donc un niveau en-dessous de la modif effectuée.

Le cas que tu décris est particulier : le RS-ERROR contient errorCode, errorCause et sourceMessage, et le type de sourceMessage est très libre (Map<String, Object>). Notre petit utilitaire de conversion n'a pas l'intelligence de se dire que dans le cas d'un RS-ERROR, il faudrait remplacer jsonContent par XMLContent, mais c'est un cas très particulier quand même.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Aligné mais pourquoi xmlns:xlink="http://www.w3.org/1999/xlink" ?

Copy link
File Coverage [57.33%]
EdxlHandler.java 78.65% 🍏
ContentWrapper.java 26.23%
Total Project Coverage 68.52% 🍏

Copy link
sonarqubecloud bot commented Jan 8, 2025

Copy link
github-actions bot commented Jan 8, 2025
File Coverage [57.33%]
EdxlHandler.java 78.65% 🍏
ContentWrapper.java 26.23%
Total Project Coverage 68.52% 🍏

@bou3108 bou3108 merged commit 74bee1a into auto/model_tracker Jan 10, 2025
4 checks passed
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.

2 participants
0