-
Notifications
You must be signed in to change notification settings - Fork 501
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
FEEDBACK on REQUEST ACCESS EXTERNAL TOOL #7219
Conversation
merge iqss develop into mdm develop
merge IQSS develop into mdmADA
…instance variable for the local variable returned by the method. : (
…et.xhtml (rendered as part of the filesFragment.xhtml UI component).
…the MultiRequestAccessButton is enabled.
… tool (there should be only 1 I believe).
…should be enabled
…er 'Request Access' if 'Request Access' has been turned off and there is a fileRequestAccessTool deployed.
…ton-fragment for consistency
…possibility of fileRequestAccessTools
…ng to turn off request access to achieve this
…set level Request Access tool enabled.
…ssTool to call from dataset.xhtml
also use the bullhorn glyphicon for the single request access button instead of text.
merge IQSS develop into mdm develop
merge dmd develop into mdm external_tool_request_access_type
…t_single_file_RA_tool External request access type attempt single file ra tool
…ssRequestTool but dataset is not Request Access enabled
…ssRequestTool but dataset is not Request Access enabled
merge develop into develop
merge develop into external_tool_request_access
…method isFileAccessRequestMultiButtonEnabled() doesn't work properly.
if (downloadButtonAllEnabled == null) { | ||
boolean downloadButtonAllEnabled = true; | ||
|
||
if (downloadButtonAllEnabled) { //check to see if it should be false |
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.
This is a bug in current code? Add it's what you meant by "
The multi-select 'Request Access' button is enabled all the time even if access has been requested for all the restricted data files. This would have to be fixed." in your comments?
ExternalToolHandler externalToolHandler = new ExternalToolHandler(externalTool, dataset, apiToken, session.getLocaleCode()); | ||
String toolUrl = externalToolHandler.getToolUrlWithQueryParams(); | ||
logger.fine("Exploring with " + toolUrl); | ||
PrimeFaces.current().executeScript("window.open('"+toolUrl + "', target='_blank');"); | ||
} | ||
|
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.
other than the original method being named 'explore', is there a reason multiple methods are needed? Unless I missed something, they all do the same thing. Perhaps explore() could be 'launchTool' or similar?
@@ -347,10 +347,28 @@ | |||
|
|||
<!-- Request Access Button --> | |||
<ui:fragment rendered="#{!fileMetadata.datasetVersion.deaccessioned and !fileDownloadHelper.canDownloadFile(fileMetadata) | |||
and fileMetadata.dataFile.owner.fileAccessRequest}"> | |||
<!-- FILE PG --> | |||
and (fileMetadata.dataFile.owner.fileAccessRequest or not empty fileRequestAccessTools)}"> |
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.
Why or? Is the internal selection of whether file access requests can be made being overridden? If so, should some/all of the UI for managing terms be removed if external RA is enabled?
return fileRequestAccessTools; | ||
} | ||
|
||
public ExternalTool getFileRequestAccessTool(){ |
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.
Looks like the singular version is only used in the .xhtml to be able to do a null check for rendering? If so, some of the xhtml files already just check whether the list is empty (versus the first element being null). Could do that everywhere and drop these methods?
Made some comments in the code - also have some about the notes above: re:
re:
|
re: having dataset and file-level tools:
re:
re: considering how to grant access to new files: |
re:
re:
|
Merge latest IQSS develop branch to mdmADA dataverse develop
…equest_access-develop
merge mdmADA develop into mdmADA external_tool_request_access branch
Closing in favor of this new PR: |
I am creating this pull request to ask for feedback on the experimenting I have done with the Dataverse code to see how ADA can launch a Request Access tool as an 'External Tool'. The idea is to replace the usual 'Request Access' buttons with 'Request Access' buttons that will call an external tool that will then manage the request access details, etc.
Danny has also indicated that the dataset and file pages are being redesigned so perhaps it is good timing in that it might be possible to incorporate this ExternalTool solution for Request Access in with the new code.
Note that my implemented code is not necessarily the 'ideal' code as a few of the methods are repeated between the Dataset-level code and the Page-level code just to get it working for demo purposes. These repeated methods would be better implemented in a single class (FileDownloadHelper? other?) but in the interest of time for demo purposes, I added them where they are now.
I have implemented and deployed this code on our test Dataverse installation: archive-deve.ada.edu.au. You can test it out with the following datasets although you will have to create an account to do so:
all restricted:
https://archive-dev.ada.edu.au/dataset.xhtml?persistentId=doi:10.80408/5Z2BAF
1/2 restricted, 1/2 unrestricted, with guestbook (guestbook at download works as expected):
https://archive-dev.ada.edu.au/dataset.xhtml?persistentId=doi:10.80408/R5LSJX
all unrestricted and with guestbook (guestbook at download works as expected):
https://archive-dev.ada.edu.au/dataset.xhtml?persistentId=doi:10.80408/DWUBPM
The code allows the following (assumption: user is logged in and does not have access to the restricted files and has not already requested access):
if there is a DatasetFileRequestAccessTool enabled in Dataverse, the Multi-select RequestAccess button (rendered by the filesFragment.xhtml component) is replaced by a 'Request Access' button that looks the same as the Regular 'Request Access' button but launches the external tool (currently represented by the ADA website with parameters passed as we haven't developed the actual external request access tool) when clicked
the external tool is passed the dataset_id, the user's APIkey (assumes they have enabled APIKey in their account), etc.
the external tool will use the Native API (or perhaps a straight database query) 'list dataset files' to pull all of the files associated with that dataset and that the user does not have access to, and will request the user to enter all the required details to request access
the external tool will have a 'Request Access' or 'Submit Request Details' button - when clicked this will call the Dataverse DataAccess API 'Request Access' endpoint to request access to the file(s) on behalf of the user with the API key passed to the tool by Dataverse.
[ADA will also develop functionality within our data management process that ADA request managers will be able to click buttons to call the Dataverse DataAccess API to grant/access/revoke access to a specific user].
for each individual file in the list of files (filesFragment.xhtml) that the user has not requested access to, nor already has access to, the 'Request Access' click will launch the file-level request access tool.
in the filesFragment.xhtml component, the page is identified as NOT a filePg
if there is a fileRequestAccessTool enabled for the dataverse installation, the 'Request Access' command link that is rendered launches the external request access tool (the ADA site) and passes the dataset_id, the file_id, the user's API key, etc.
how the request of a single file will be managed by the external tool will be determined later - most likely, the external ADA request access tool will see if the user has already requested access to other files in this dataset. If yes, add functionality to add the file to that request.
in the filesFragment.xhtml component, the page is identified as a filePg
as in 2. above, if there is a fileRequestAccessTool enabled for the dataverse installation, the 'Request Access' command link rendered launches the external request access tool (the ADA site) and passes the dataset_id, the file_id, the user's API key, etc.
To implement 1, 2, and 3 above, the following is required:
Note: 1, and only 1, of each of the file- and dataset-level buttons must exist. I didn't code anything to enforce these conditions and this enforcing may or may not be required and instead may depend on people configuring both levels of tools properly within the database.
Java source code modified:
.xhtml modified:
Additional Notes:
ISSUE:
When the external tool is used to request access, the Dataverse UI won't refresh automatically to show the user that they have requested access. The user would have to refresh the Dataverse Dataset and/or File page manually.
The multi-select 'Request Access' button is enabled all the time even if access has been requested for all the restricted data files. This would have to be fixed.