Skip to content

story/VSPC-189#364

Open
Girik1105 wants to merge 32 commits intodevelopfrom
story/VSPC-189
Open

story/VSPC-189#364
Girik1105 wants to merge 32 commits intodevelopfrom
story/VSPC-189

Conversation

@Girik1105
Copy link
Contributor

@Girik1105 Girik1105 commented Sep 18, 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

It should be possible to pull in bibliography entries from citesphere

Description
Instead of entering bibliography entries by hand, the user would select entries from Citesphere and those would then be imported. Since Citesphere doesn't have a search endpoint yet, the user would when adding a bibliography block, browse their groups in citesphere and select entries to import. So:

  1. user adds bibliography block on a slide
  2. instead of adding a reference by hand, they log in to Citesphere (oauth authorization flow)
  3. they see all groups they are part of
  4. they select a group and then one or multiple references from that group
  5. The selected references will be imported into VSpace
    For now, this would be a one time import. We'll worry about updating references from Citesphere later.
    The code that pull data from Citesphere should be its own plugin (have Julia create the basic plugin).

VSPC-189

Anything else the reviewer needs to know?

... describe here ...

@diging-jenkins
Copy link

Can one of the admins verify this patch?

1 similar comment
@diging-jenkins
Copy link

Can one of the admins verify this patch?

@jdamerow
Copy link
Member

Resolve conflicts please

Copy link
Member

@jdamerow jdamerow left a comment

Choose a reason for hiding this comment

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

gotta run, but I'll leave it with this for now.

private String accessToken;
private String refreshToken;
private String username;
private String password;
Copy link
Member

Choose a reason for hiding this comment

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

there should be no password needed here.

Copy link
Member

Choose a reason for hiding this comment

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

Those entries should probably not be removed


if (!"oauth".equals(authTokenObject.getAuthType()) &&
!"basic".equals(authTokenObject.getAuthType())) {
throw new IllegalArgumentException("authType should be either oauth or basic");
Copy link
Member

Choose a reason for hiding this comment

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

there should be no basic authentication with citesphere.


try (Response response = client.newCall(request).execute()) {
// Check for unauthorized or forbidden responses
if (response.code() == 401 || response.code() == 403) {
Copy link
Member

Choose a reason for hiding this comment

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

the http codes are defined in constants (not sure what the class is called, it depends on the included library, maybe maybe HttpStatus or something along those lines?)

}
} catch (CitesphereTokenException e) {
throw e; // Re-throw token exceptions
} catch (Exception e) {
Copy link
Member

Choose a reason for hiding this comment

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

what is throwing Exception (specific exceptions should be caught)? If it's not thrown anywhere, then this should be removed/replace with specific exceptions and the catch block above catching CitesphereTokenException would also not be necessary.

}

@Override
public Map<String, Object> checkTest() {
Copy link
Member

Choose a reason for hiding this comment

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

what is this for?

}

@Override
public Map<String, Object> checkAccess(String documentId) {
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this is needed, is it?

errorMap.put("token_expired", e.isTokenExpired());
return errorMap;
}
}
Copy link
Member

Choose a reason for hiding this comment

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

many of these methods look almost identical (except the line that builds the url), so there should be one method with this call and the other methods would just build the url and call that method.

.build();

try (Response response = client.newCall(request).execute()) {
if (response.code() == 401 || response.code() == 403) {
Copy link
Member

Choose a reason for hiding this comment

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

see above

}
} catch (CitesphereTokenException e) {
throw e;
} catch (Exception e) {
Copy link
Member

Choose a reason for hiding this comment

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

see above

@jdamerow jdamerow closed this Jan 13, 2026
…ation, replaced HTTP status numbers with status constants, removed file upload code, and reverted gitignore to orignal
@Girik1105 Girik1105 reopened this Jan 16, 2026
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.

4 participants