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
Export jcr/xml without binary contents by setting the parameter skitBinary #410
Conversation
@@ -91,8 +93,14 @@ public void write(final OutputStream out) | |||
try { | |||
LOGGER.debug("Selecting from serializer map: {}", serializers); | |||
LOGGER.debug("Retrieved serializer for format: {}", format); | |||
serializer.serialize(objectService.getObject( | |||
session, path), out); | |||
if (format.equalsIgnoreCase(FedoraObjectSerializer.JCR_XML) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since there is only one implementation of the FedoraObjectSerializer interface, please update the interface method: getObject()
Then you can remove this logic of trying to determine which serializer is being used here.
with options noRecurse and skipBinary options; corrected codes as suggested.
With noRecurse option and taking F4 RDF/XML into account as a potential format that we may want with noRecurse serialization output too, I've added it to the original serialize() signature as general and added a new signature with the skipBinary option. I implement the skipBinary option for the JcrXmlSerializer specifically for now. See my latest commit above: lsitu@9e906b0. Please let me know if you have other thoughts. Thanks. |
@@ -72,7 +72,9 @@ | |||
@GET | |||
public Response exportObject( | |||
@PathParam("path") final List<PathSegment> pathList, | |||
@QueryParam("format") @DefaultValue("jcr/xml") final String format) { | |||
@QueryParam("format") @DefaultValue("jcr/xml") final String format, | |||
@QueryParam("noRecurse") @DefaultValue("false") final String noRecurse, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you change this parameter to "recursive" with the same default of "false" (i.e. we do not want to recurse by default). Double negatives are sometimes confusing.
Okay, done. See commit lsitu@10cb4e6 |
Resolved with: a5a17ac Addresses: https://www.pivotaltracker.com/story/show/74701156 |
https://www.pivotaltracker.com/s/projects/684825/stories/74701156
When append the parameter skipBinary=true to the original fcr:export url like http://localhost:8080/rest/file/fcr:export?skipBinary=true, we can get the jcr/xml output with no binary contents now.
I am manipulate to avoid adding another signature like serialize(final FedoraObject obj, final OutputStream out, boolean skipBinary) to the FedoraObjectSerializer interface for this special output at this time. But I think we can if this should be a more general support for other future formats that Fadora supports.