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

feat(api-v1): Change API v1 file uploads to work like API v2 #1233

Merged
merged 110 commits into from
Jun 29, 2020

Conversation

benjamingeer
Copy link

@benjamingeer benjamingeer commented Feb 28, 2019

This PR changes API v1 so that Knora and Sipi no longer need to share a filesystem (#535).

  • Change API v1 to use the same Sipi scripts as API v2.
  • Remove the API v1 Sipi scripts.
  • Change salsah1 to use upload.lua, sending it a JWT token.
  • Once Implement upload of text files in API v2 #1532 is done, fix KnoraSipiIntegrationV1ITSpec to use API v2 to create the XSLTransformation resource.
  • Update other API v1 tests.
  • Update API v1 docs.
  • Update release notes.

Needs #1532.
Resolves #535.

@tobiasschweizer
Copy link
Contributor

@benjamingeer I think for this PR the Python load test script has to be adapted.

Could you please instruct me how I have to adapt my import scripts for the v1 non GUI case?

@benjamingeer
Copy link
Author

Could you please instruct me how I have to adapt my import scripts for the v1 non GUI case?

You’ll have to use v2. When this PR is done, there will be documentation. But I still have a lot of work left to do on it.

@tobiasschweizer
Copy link
Contributor

Ok, can we coodinate that next week? Also with @SepidehAlassi. This will affect the BEOL import process. Also I won‘t work in the week of carnival.

@tobiasschweizer
Copy link
Contributor

@benjamingeer Could I start using v2 next week? Then I could already adapt my import scripts (image file values, XSL transformations stored in Sipi).

@benjamingeer
Copy link
Author

@tobiasschweizer This PR may take some time because it depends on PR #1206, which depends on work that Lukas is doing in Sipi. But you can switch to v2 now. The documentation on creating file values in v2 is here:

https://docs.knora.org/paradox/03-apis/api-v2/editing-values.html#creating-file-values

@tobiasschweizer
Copy link
Contributor

@benjamingeer Ok, I will have a look at it next week. Thanks.

@tobiasschweizer
Copy link
Contributor

tobiasschweizer commented Mar 1, 2019

Yes, the IRI of an XSL transformation representation can be referenced from a mapping as a default transformation. The XSLT file is stored in Sipi when creating the representation in Knora (v1).

@benjamingeer benjamingeer changed the title Don't require Knora and Sipi to share a filesystem Change API v1 file uploads to work like API v2 Mar 6, 2019
@benjamingeer
Copy link
Author

@tobiasschweizer It would be great if you could review this sometime in the next week. I can't finish it until #1206 is done, but in the meantime, you could try changing your import script to use new API v1 image upload procedure (no need to switch to v2 if you don't want to). I've updated the API v1 docs to explain how this works now.

@benjamingeer benjamingeer added the breaking any breaking change label Mar 6, 2019
@tobiasschweizer
Copy link
Contributor

@benjamingeer I wanted to look at this PR this week but now I realize that I won't manage. I will look at it it when I am back to the office on Monday, March 18 (after carnival).


- MAJOR: Change API v1 file uploads to work like API v2 (@github[#1233](#1233)). To enable
Knora and Sipi tow work without sharing a filesystem, the procedure
for uploading files in API v1 has changed; see
Copy link

@gfoo gfoo Mar 8, 2019

Choose a reason for hiding this comment

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

tow work -> to work typo master has said :)

@tobiasschweizer
Copy link
Contributor

@benjamingeer I can confirm that the new API v1 image upload procedure works.

Once it also supports XML files, I will try that too.

@subotic
Copy link
Collaborator

subotic commented Jun 24, 2020

@benjamingeer I'm preparing a PR which should contain the necessary fix. If everything works out. I will publish a release candidate of SIPI today.

@benjamingeer
Copy link
Author

@subotic Great news, thanks!

Benjamin Geer and others added 2 commits June 24, 2020 18:24
# Conflicts:
#	webapi/src/it/scala/org/knora/webapi/ITKnoraLiveSpec.scala
#	webapi/src/main/scala/org/knora/webapi/routing/v1/ValuesRouteV1.scala
#	webapi/src/main/scala/org/knora/webapi/store/iiif/SipiConnector.scala
#	webapi/src/main/scala/org/knora/webapi/util/StringFormatter.scala
#	webapi/src/test/scala/org/knora/webapi/store/iiif/MockSipiConnector.scala
@subotic
Copy link
Collaborator

subotic commented Jun 25, 2020

@benjamingeer I've bumped the SIpi version in this branch to the latest RC. Let me know if you need help.

@subotic
Copy link
Collaborator

subotic commented Jun 25, 2020

@benjamingeer I've missed something when I changed the Sipi version. I will let you know when its done.

@benjamingeer
Copy link
Author

benjamingeer commented Jun 25, 2020

@subotic Before I can work on this PR again, I need to do a new PR for https://dasch.myjetbrains.com/youtrack/issue/DSP-44.

subotic and others added 3 commits June 25, 2020 10:39
# Conflicts:
#	sipi/scripts/convert_from_file.lua
#	vars.mk
#	webapi/src/it/scala/org/knora/webapi/e2e/v1/KnoraSipiIntegrationV1ITSpec.scala
#	webapi/src/it/scala/org/knora/webapi/e2e/v1/KnoraSipiScriptsV1ITSpec.scala
#	webapi/src/it/scala/org/knora/webapi/e2e/v2/KnoraSipiIntegrationV2ITSpec.scala
#	webapi/src/it/scala/org/knora/webapi/other/v1/DrawingsGodsV1ITSpec.scala
# Conflicts:
#	docker/knora-sipi.template.dockerfile
#	project/Dependencies.scala
#	sipi/docker-compose.yml
#	sipi/scripts/make_thumbnail.lua
#	vars.mk
#	webapi/src/it/scala/org/knora/webapi/e2e/v1/KnoraSipiScriptsV1ITSpec.scala
#	webapi/src/it/scala/org/knora/webapi/e2e/v2/KnoraSipiIntegrationV2ITSpec.scala
#	webapi/src/main/scala/org/knora/webapi/responders/v1/ValueUtilV1.scala
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't require Knora and Sipi to share a directory for image upload
4 participants