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

Implement remote storage sync #642

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
Draft

Implement remote storage sync #642

wants to merge 12 commits into from

Conversation

koppor
Copy link
Member

@koppor koppor commented Apr 22, 2023

Follow-up to JabRef#9748. While JabRef#9748 is for a plain http server, this one implements the JabRef sync to an online service. Details on sync at https://github.com/koppor/jabref/blob/sync-mwe/docs/code-howtos/remote-storage-jabdrive.md.

This is WIP. Missing at least

Compulsory checks

Preview Give feedback

koppor added 8 commits April 9, 2023 01:09
- Resources
  - /libraries
  - /libraries/{id} (both (embedded) BibTeX as string and CSL data)
- Documentation / code style
  - Refined BibEntry class (JavaDoc, builder)
  - Comments to InternalField
  - move StyleTester to "test" module - package ...testutils/interactive...
- Makes use of Jersey, Grizzly
- Makes use of HK2 as dependency injection framework
- Introduces "application/x-bibtex-library-csl+json" mimetype
- Preparation for client/server sync (BibEntryDTO)
- Minor
  - Made class "JabRefItemDataProvider" more visible
  - Encoding of a .bib file can now be asked for externally
  - Resorts modle-info.java
  - Fixes typo in NetworkTabViewModel
- Installs SLF4J logging router: If a tool uses java commons logging, tinylog now also handles these logs
# Conflicts:
#	src/main/java/module-info.java

[
{
"sharingMetadata": {

Choose a reason for hiding this comment

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

🚫 [reviewdog] <com.puppycrawl.tools.checkstyle.checks.whitespace.FileTabCharacterCheck> reported by reviewdog 🐶
File contains tab characters (this is the first instance).


import org.jabref.http.dto.GsonFactory;
import org.jabref.logic.bibtex.FieldContentFormatterPreferences;
import org.jabref.logic.bibtex.FieldWriterPreferences;

Choose a reason for hiding this comment

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

🚫 [reviewdog] <com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck> reported by reviewdog 🐶
Unused import - org.jabref.logic.bibtex.FieldWriterPreferences.

import java.util.List;

import org.jabref.model.entry.BibEntry;
import org.jabref.http.dto.BibEntryDTO;

Choose a reason for hiding this comment

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

🚫 [reviewdog] <com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck> reported by reviewdog 🐶
Wrong order for 'org.jabref.http.dto.BibEntryDTO' import.

import org.glassfish.hk2.api.ServiceLocator;
import org.glassfish.hk2.utilities.ServiceLocatorUtilities;

import io.swagger.v3.jaxrs2.Reader;

Choose a reason for hiding this comment

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

🚫 [reviewdog] <com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck> reported by reviewdog 🐶
Extra separation in import group before 'io.swagger.v3.jaxrs2.Reader'

import org.glassfish.hk2.api.ServiceLocator;
import org.glassfish.hk2.utilities.ServiceLocatorUtilities;

import io.swagger.v3.jaxrs2.Reader;

Choose a reason for hiding this comment

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

🚫 [reviewdog] <com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck> reported by reviewdog 🐶
Wrong order for 'io.swagger.v3.jaxrs2.Reader' import.

import java.util.List;

import org.jabref.model.database.BibDatabaseContext;
import org.jabref.http.dto.BibEntryDTO;

Choose a reason for hiding this comment

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

🚫 [reviewdog] <com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck> reported by reviewdog 🐶
Wrong order for 'org.jabref.http.dto.BibEntryDTO' import.

import java.util.Set;
import java.util.stream.Collectors;

import org.jabref.gui.Globals;

Choose a reason for hiding this comment

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

🚫 [reviewdog] <com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck> reported by reviewdog 🐶
Unused import - org.jabref.gui.Globals.

import java.util.stream.Collectors;

import org.jabref.gui.Globals;
import org.jabref.http.server.ServerPreferences;

Choose a reason for hiding this comment

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

🚫 [reviewdog] <com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck> reported by reviewdog 🐶
Unused import - org.jabref.http.server.ServerPreferences.


import org.jabref.gui.Globals;
import org.jabref.http.server.ServerPreferences;
import org.jabref.model.database.BibDatabaseMode;

Choose a reason for hiding this comment

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

🚫 [reviewdog] <com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck> reported by reviewdog 🐶
Unused import - org.jabref.model.database.BibDatabaseMode.

import org.jabref.http.server.ServerPreferences;
import org.jabref.model.database.BibDatabaseMode;
import org.jabref.model.entry.BibEntry;
import org.jabref.http.dto.BibEntryDTO;

Choose a reason for hiding this comment

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

🚫 [reviewdog] <com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck> reported by reviewdog 🐶
Wrong order for 'org.jabref.http.dto.BibEntryDTO' import.

@@ -7,6 +7,7 @@
import com.tngtech.archunit.junit.ArchIgnore;
import com.tngtech.archunit.junit.ArchTest;
import com.tngtech.archunit.library.GeneralCodingRules;
import org.jabref.http.sync.state.SyncState;

Choose a reason for hiding this comment

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

🚫 [reviewdog] <com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck> reported by reviewdog 🐶
Wrong order for 'org.jabref.http.sync.state.SyncState' import.

package org.jabref.http.server;

import org.glassfish.jersey.server.ResourceConfig;
import org.jabref.http.sync.state.SyncState;

Choose a reason for hiding this comment

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

🚫 [reviewdog] <com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck> reported by reviewdog 🐶
Wrong order for 'org.jabref.http.sync.state.SyncState' import.

import org.glassfish.jersey.server.ResourceConfig;
import org.jabref.http.sync.state.SyncState;
import org.jabref.model.entry.BibEntry;
import org.junit.jupiter.api.BeforeEach;

Choose a reason for hiding this comment

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

🚫 [reviewdog] <com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck> reported by reviewdog 🐶
'org.junit.jupiter.api.BeforeEach' should be separated from previous imports.

package org.jabref.http.dto;

import com.google.gson.Gson;
import org.jabref.gui.Globals;

Choose a reason for hiding this comment

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

🚫 [reviewdog] <com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck> reported by reviewdog 🐶
Wrong order for 'org.jabref.gui.Globals' import.

import org.jabref.model.database.BibDatabaseMode;
import org.jabref.model.entry.BibEntry;
import org.jabref.model.entry.field.StandardField;
import org.junit.jupiter.params.ParameterizedTest;

Choose a reason for hiding this comment

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

🚫 [reviewdog] <com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck> reported by reviewdog 🐶
'org.junit.jupiter.params.ParameterizedTest' should be separated from previous imports.

import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;

import java.util.stream.Stream;

Choose a reason for hiding this comment

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

🚫 [reviewdog] <com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck> reported by reviewdog 🐶
Wrong order for 'java.util.stream.Stream' import.


import java.util.stream.Stream;

import static org.junit.jupiter.api.Assertions.*;

Choose a reason for hiding this comment

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

🚫 [reviewdog] <com.puppycrawl.tools.checkstyle.checks.imports.AvoidStarImportCheck> reported by reviewdog 🐶
Using the '.' form of import should be avoided - org.junit.jupiter.api.Assertions..

@@ -748,6 +748,16 @@ public void setChanged(boolean changed) {
this.changed = changed;
}


/**

Choose a reason for hiding this comment

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

🚫 [reviewdog] <com.puppycrawl.tools.checkstyle.checks.whitespace.EmptyLineSeparatorCheck> reported by reviewdog 🐶
'/*' has more than 1 empty lines before.


import javafx.collections.ObservableList;

import org.jabref.architecture.AllowedToUseStandardStreams;

Choose a reason for hiding this comment

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

🚫 [reviewdog] <com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck> reported by reviewdog 🐶
Unused import - org.jabref.architecture.AllowedToUseStandardStreams.

import org.jabref.model.entry.BibEntry;
import org.jabref.model.metadata.MetaData;

import org.junit.jupiter.api.BeforeEach;

Choose a reason for hiding this comment

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

🚫 [reviewdog] <com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck> reported by reviewdog 🐶
Unused import - org.junit.jupiter.api.BeforeEach.


private final String path = "/li<axSXSXXSSSSAAbraries/" + TestBibFile.GENERAL_SERVER_TEST.id + "/updates";

BibDatabaseContext bibDatabaseContext = new BibDatabaseContext(new BibDatabase(), new MetaData());

Choose a reason for hiding this comment

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

🚫 [reviewdog] <com.puppycrawl.tools.checkstyle.checks.coding.DeclarationOrderCheck> reported by reviewdog 🐶
Variable access definition in wrong order.

@@ -0,0 +1,42 @@
package org.jabref.http.sync.state;

import java.util.ArrayList;

Choose a reason for hiding this comment

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

🚫 [reviewdog] <com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck> reported by reviewdog 🐶
Unused import - java.util.ArrayList.

import java.util.ArrayList;
import java.util.List;

import org.jabref.gui.importer.ImportEntriesViewModel;

Choose a reason for hiding this comment

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

🚫 [reviewdog] <com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck> reported by reviewdog 🐶
Unused import - org.jabref.gui.importer.ImportEntriesViewModel.


import org.jabref.http.dto.BibEntryDTO;

import java.util.List;

Choose a reason for hiding this comment

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

🚫 [reviewdog] <com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck> reported by reviewdog 🐶
Wrong order for 'java.util.List' import.

package org.jabref.http.sync.state;

import com.google.common.base.Strings;
import org.jabref.model.entry.BibEntry;

Choose a reason for hiding this comment

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

🚫 [reviewdog] <com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck> reported by reviewdog 🐶
Wrong order for 'org.jabref.model.entry.BibEntry' import.

import com.google.common.base.Strings;
import org.jabref.model.entry.BibEntry;
import org.jabref.model.entry.SharedBibEntryData;
import org.jabref.model.strings.StringUtil;

Choose a reason for hiding this comment

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

🚫 [reviewdog] <com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck> reported by reviewdog 🐶
Unused import - org.jabref.model.strings.StringUtil.

@tobiasdiez
Copy link
Member

this one implements the JabRef sync to an online service.

What's the relation with JabRef#7832?

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.

2 participants