-
-
Notifications
You must be signed in to change notification settings - Fork 182
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
[BUG] Xmlrpc: XML documents without an .xml extension are stored as binary #5067
Comments
BackgroundAll our XML documents are named like The proposed fix works really well for us. |
If I am not mistaken, eXist-db 6.x.x, 5.x.x, and 4.x.x do not have a In eXist-db 7.x.x: final Class<? extends Resource> xmlResourceType = XMLResource.class;
collection.createResource(DOCUMENT_NAME, xmlResourceType) When a public LocalXMLResource(final Subject user, final BrokerPool brokerPool, final LocalCollection parent, final XmldbURI did) throws XMLDBException {
super(user, brokerPool, parent, did, MimeType.XML_TYPE.getName()); This is then used in final String strMimeType = res.getMimeType(broker, transaction);
final MimeType mimeType = strMimeType != null ? MimeTable.getInstance().getContentType(strMimeType) : null;
if (res.root != null) {
collection.storeDocument(transaction, broker, resURI, res.root, mimeType, res.datecreated, res.datemodified, null, null, null); or... when a public RemoteXMLResource(
final RemoteCollection parent,
final int handle,
final int pos,
final XmldbURI docId,
final Optional<String> id,
final Optional<String> type)
throws XMLDBException {
super(parent, docId, MimeType.XML_TYPE.getName()); In If we look in the final MimeType mime = MimeTable.getInstance().getContentTypeFor(docUri.lastSegment());
broker.storeDocument(transaction, docUri.lastSegment(), source, mime, created, modified, null, null, null, collection); So it looks like I would suggest the best solution would be to add an additional media type parameter to the XML-RPC API for |
node-exist which uses eXist-db's XML-RPC API allows to set, or override, the mime-type explicitly when calling But this might not be available when using |
That is not quite correct, before the update to the new XML::DB API the Method signature used The main problem or expectation is, that as long there was no change made to the mime time (in this case after reading an existing resource) it should also not "freshly calculated on the storage side. This is also the shown by the test itself. |
Regarding backport, please refer to my comment in the pull request: #5068 (comment) |
When an XML document without an explicit
.xml
extension is stored via xmlrpc, its mime type is converted to binary.Despite the fact that the provided resource type is
XMLResource.class
.Here is a sketch for a test:
The expected behaviour would be, that an XML document is stored as
XMLResource
if so requested.I will try to provide a pull request with a complete test and a possible solution.
The fix is needed for
develop
anddevelop-6.x.x
.On
develop-4.x.x
the issue does not manifest itself.The text was updated successfully, but these errors were encountered: