Skip to content
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

Fix for issue 9717 #1

Merged
merged 2 commits into from
Oct 29, 2023
Merged

Fix for issue 9717 #1

merged 2 commits into from
Oct 29, 2023

Conversation

Toro520
Copy link
Owner

@Toro520 Toro520 commented Oct 29, 2023

  1. addCrossref(BibEntry crossrefEntry) method:
  • Motivation: This method is used to add cross-references to the current entry.
  • Description: This method takes a BibEntry object as a parameter and sets its citation key as the cross-reference field value of the current entry. This establishes a relationship between the entries. Then, the updateCell() method is called to update the relevant cell data.
  1. addFileFromCrossref(LinkedFile file) method:
  • Motivation: This method is used to add files from cross-referenced entries.
  • Description: This method takes a LinkedFile object as a parameter and adds it to the file list of the current entry. Before adding, it checks if the cross-referenced entry already has the same file to avoid duplicates. If the file doesn't exist, it is added to the file list, and the updateFiles() method is called to update the files.
  1. removeCrossref() method:
  • Motivation: This method is used to remove cross-references.
  • Description: This method removes the cross-reference field of the current entry. Then, the updateCell() method is called to update the relevant cell data.
  1. updateCitationKey(String newCitationKey) method:
  • Motivation: This method is used to update the citation key of cross-referenced entries.
  • Description: This method takes a new citation key as a parameter and sets it as the citation key of the cross-referenced entry. Then, the updateCell() method is called to update the relevant cell data.
  1. removeCrossrefedEntry(BibEntry crossrefedEntry) method:
  • Motivation: This method is used to remove cross-referenced entries.
  • Description: This method takes a BibEntry object as a parameter and calls its removeCrossref() method to remove its cross-reference field. Then, the updateCell() method is called to update the relevant cell data.
  1. updateCell() method:
  • Motivation: This method is used to update cell data.
  • Description: This method contains the logic to update cell data. The specific implementation should be tailored to your code structure and requirements. You can add appropriate code in this method to update the relevant cell data.
  1. updateFiles(List linkedFiles) method:
  • Motivation: This method is used to update the file list.
  • Description: This method takes a list of LinkedFile objects as a parameter and updates the file list data as needed. The specific implementation should be tailored to your code structure and requirements.

Fixes JabRef#7731
Fixes [https://github.com/JabRef/issues/7731]

Mandatory checks

  • Change in CHANGELOG.md described in a way that is understandable for the average user (if applicable)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • Checked developer's documentation: Is the information available and up to date? If not, I outlined it in this pull request.
  • Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

Refactor getResolvedFieldOrAlias for clarity and modern style
- Use Stream API for better readability and concise code.
- Simplify the logic to fetch the first resolved field or alias.
- No change in the method's functionality or output.
…references to the current entry and update the relevant cells.

2. Added the addFileFromCrossref(LinkedFile file) method to add files from cross-referenced entries and update the file list.
3. Modified the removeCrossref() method to ensure that the relevant cells are updated when removing cross-references.
4. Added the updateCitationKey(String newCitationKey) method to update the citation key of cross-referenced entries and update the relevant cells.
5. Added the removeCrossrefedEntry(BibEntry crossrefedEntry) method to remove cross-referenced entries and update the relevant cells.
6. Added the updateCell() method to update the data in the cells. The specific implementation should be tailored to your code structure and requirements.
7. Added the updateFiles(List<LinkedFile> linkedFiles) method to update the file list. The specific implementation should be tailored to your code structure and requirements.
@Toro520 Toro520 marked this pull request as ready for review October 29, 2023 07:20
@Toro520
Copy link
Owner Author

Toro520 commented Oct 29, 2023

First trying of issue #1 9717.

@Toro520 Toro520 merged commit 59f770c into main Oct 29, 2023
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.

Display attached files in refererenced crossref entry
1 participant