-
Notifications
You must be signed in to change notification settings - Fork 25
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
Adds request-direct-access-url file name option #197
base: master
Are you sure you want to change the base?
Adds request-direct-access-url file name option #197
Conversation
@@ -10683,6 +10701,9 @@ definitions: | |||
attachment: | |||
type: boolean | |||
description: URL type (embedded/attachment). | |||
fileName: |
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.
I think we'd usually have the items from the "Create" entity in the response too - i.e. DirectAccessUrl
below. I don't think this is explicitly called out in the v1 API guidelines though.
I've added our architect team to review too, since they usually review additions to the v1 API.
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.
I could add it to the DirectAccessUrl
class in alfresco-community-repo, but it looks like the current object structure is fed in from the content store itself. Not exactly sure where that code is or how dangerous it is to alter.
I could make a DirectAccessUrlResponse
class for the purposes of extending and adding on the additional field.
It's not hard to return the field, I just want to keep things in line with your expectations for the code base as a whole.
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.
@tpage-alfresco is correct, please make sure to add the file name to the response too.
In terms of implementation, you have already modified the ContentServiceImpl
class, so adding an attribute to DirectAccessUrl
(part of our Java public API) is not a problem.
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.
@jamalkm The issue is the call to the content store serialized directly into DirectAccessUrl
. While the serialization might still work with an extra field added, I worry it might start to diverge from representing the data object actually returned from the database vs. what we are returning from the API.
DirectAccessUrl directAccessUrl = null;
if (store.isContentDirectUrlEnabled())
{
try
{
// referencing this
directAccessUrl = store.requestContentDirectUrl(contentUrl, attachment, fileName, contentMimetype, validFor);
}
catch (UnsupportedOperationException ex)
{
// expected exception
}
}
return directAccessUrl;
I can still open a PR on it though
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.
Alfresco/alfresco-community-repo#2081
Let me know if this is what you were looking for.
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.
The PR looks good, just filename needs to be added to the response too.
@@ -10683,6 +10701,9 @@ definitions: | |||
attachment: | |||
type: boolean | |||
description: URL type (embedded/attachment). | |||
fileName: |
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.
@tpage-alfresco is correct, please make sure to add the file name to the response too.
In terms of implementation, you have already modified the ContentServiceImpl
class, so adding an attribute to DirectAccessUrl
(part of our Java public API) is not a problem.
Argh - sorry. I thought this had already been approved. I merged the main PR earlier today. Shall I revert the main PR back to a branch, or is everyone happy to update the response in a second PR? |
I'm in favour of a second PR. |
Second PR to add file name to the response object Alfresco/alfresco-community-repo#2081 |
@jamalkm I added fileName to the response object in the api specs and noticed that |
…s-url-file-name-option
…' of https://github.com/canpan14/rest-api-explorer into feature/2064-request-direct-access-url-file-name-option
In support of this pull request Alfresco/alfresco-community-repo#2065