Skip to content

Story/cite 163 - We need a bulk upload for files. #295

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

Open
wants to merge 25 commits into
base: develop
Choose a base branch
from

Conversation

PradnyaC11
Copy link
Contributor

@PradnyaC11 PradnyaC11 commented Feb 27, 2025

Guidelines for Pull Requests

If you haven't yet read our code review guidelines, please do so, You can find them here.

Please confirm the following by adding an x for each item (turn [ ] into [x]).

  • I have removed all code style changes that are not necessary (e.g. changing blanks across the whole file that don’t need to be changed, adding empty lines in parts other than your own code)
  • I am not making any changes to files that don’t have any effect (e.g. imports added that don’t need to be added)
  • I do not have any sysout statements in my code or commented out code that isn’t needed anymore
  • I am not reformatting any files in the wrong format or without cause.
  • I am not changing file encoding or line endings to something else than UTF-8, LF
  • My pull request does not show an insane amount of files being changed although my ticket only requires a few files being changed
  • I have added Javadoc/documentation where appropriate
  • I have added test cases where appropriate
  • I have explained any part of my code/implementation decisions that is not be self-explanatory

Please provide a brief description of your ticket

We need a bulk upload for files.

... Put ticket description here and add link to ticket ...
The user would create a BibText export that includes files via Zotero (Zotero -> export collection -> BibTex format with "include files" checked). They would then zip the folder that Zotero exports and upload it to Citesphere. Citesphere would send it to the Citesphere Importer component (via Kafka like the other imports) and the importer would then create references in the zotero group the user specifies for the import (like for the web of science import that has no files) and send the files to Giles for processing (similar to how Giles sends individual files to Giles for processing).

https://diging.atlassian.net/browse/CITE-163

Are there any other pull requests that this one depends on?

diging/spring-social-zotero#24
diging/citesphere-messages#13
diging/citesphere-model#57
diging/citesphere-importer#23

Anything else the reviewer needs to know?

... describe here ...

@diging-jenkins
Copy link

Can one of the admins verify this patch?

Copy link
Member

Choose a reason for hiding this comment

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

how is this different from the UploadJobManager? looks like a lot of duplicate code (almost all of it)?

@@ -81,4 +81,7 @@ CitationResults getCollectionItems(IUser user, String groupId, String collection
long getLatestGroupVersion(IUser user, String groupId);

Map<ItemDeletionResponse, List<String>> deleteMultipleItems(IUser user, String groupId, List<String> citationKeys, Long citationVersion) throws ZoteroConnectionException, ZoteroHttpStatusException;

ICitationCollection createCitationCollection(IUser user, String groupId, String collectionName, String parentCollection) throws ZoteroItemCreationFailedException, ZoteroConnectionException;
Copy link
Member

Choose a reason for hiding this comment

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

needs javadoc (including explanation of parentCollection: null if no parent collection?).

throw new ZoteroItemCreationFailedException(response);
}

// since we only submitted one item, there should only be one in the map
Copy link
Member

Choose a reason for hiding this comment

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

there was no item submitted, was there?

return "auth/import/collection";
}

@RequestMapping(value = "/auth/import/collection/getgroupcollections", method = RequestMethod.GET)
Copy link
Member

Choose a reason for hiding this comment

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

this method is just for getting all collections of a group, right? we probably can't use the api collections controller because of the way we authenticate (if we can, that should be used), but there should be a separate controller (maybe in an api package within web/user) that has a method to get the collections.


if (collectionId.equals("new")) {
try {
ICitationCollection collection = collectionManager.createCollection(user, group, files[0].getName(), null);
Copy link
Member

Choose a reason for hiding this comment

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

name should be entered by user

}
}

if (collectionId.equals("new")) {
Copy link
Member

Choose a reason for hiding this comment

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

a better approach would probably to leave the id empty if a new collection should be created.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When the collection ID is blank, it means the citations will be added to the group, not under some collection. I have added separate text input for the new collection name to solve this issue.

@jdamerow jdamerow closed this Apr 29, 2025
@PradnyaC11 PradnyaC11 reopened this May 9, 2025
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.

3 participants