Rename plugin to ExternalResources
Change-Id: Ieb7bee4929e4351316ad19d9bcd3752d466437da
diff --git a/README.md b/README.md
index b8b23a0..f33a4fe 100644
--- a/README.md
+++ b/README.md
@@ -1,12 +1,12 @@
-# Kalamar-Plugin-ExternalProvider
+# Kalamar-Plugin-Resources
## Description
-Kalamar-Plugin-ExternalProvider is a web service that integrates in the plugin framework of
+Kalamar-Plugin-ExternalResources is a web service that integrates in the plugin framework of
[Kalamar](https://github.com/KorAP/Kalamar), to allow linking texts by their text sigle
to external data providers, mainly for full text access.
-Kalamar-Plugin-ExternalProvider is meant to be a basic plugin and should
+Kalamar-Plugin-ExternalResources is meant to be a basic plugin and should
demonstrate and evaluate the plugin capabilities of Kalamar.
## Prerequisites
@@ -15,11 +15,11 @@
## Build
-To build the latest version of Kalamar-Plugin-ExternalProvider, do ...
+To build the latest version of Kalamar-Plugin-ExternalResources, do ...
```shell
-$ git clone https://github.com/KorAP/Kalamar-Plugin-ExternalProvider
-$ cd Kalamar-Plugin-ExternalProvider
+$ git clone https://github.com/KorAP/Kalamar-Plugin-ExternalResources
+$ cd Kalamar-Plugin-ExternalResources
$ go test .
$ go build .
```
@@ -45,7 +45,7 @@
Then run the indexation with:
```shell
-$ ./Kalamar-Plugin-ExternalProvider data.csv
+$ ./Kalamar-Plugin-Resources data.csv
```
## Customization
@@ -54,18 +54,18 @@
or via `.env` file.
- `KORAP_SERVER`: The server URL of the hosting service.
-- `KORAP_EXTERNAL_PROVIDER_PORT`: The port the service should be listen to.
-- `KORAP_EXTERNAL_PROVIDER`: The exposed URL the service is hosted.
+- `KORAP_EXTERNAL_RESOURCES_PORT`: The port the service should be listen to.
+- `KORAP_EXTERNAL_RESOURCES`: The exposed URL the service is hosted.
## License
Copyright (c) 2023, [IDS Mannheim](https://www.ids-mannheim.de/), Germany<br>
Author: [Nils Diewald](https://www.nils-diewald.de/)
-Kalamar-Plugin-ExternalProvider is developed as part of the
+Kalamar-Plugin-ExternalResources is developed as part of the
[KorAP](https://korap.ids-mannheim.de/) Corpus Analysis Platform
at the Leibniz Institute for the German Language
([IDS](https://www.ids-mannheim.de/)).
-Kalamar-Plugin-ExternalProvider is published under the
-[BSD-2 License](https://raw.githubusercontent.com/KorAP/Kalamar-Plugin-ExternalProvider/master/LICENSE).
+Kalamar-Plugin-Resources is published under the
+[BSD-2 License](https://raw.githubusercontent.com/KorAP/Kalamar-Plugin-ExternalResources/master/LICENSE).
diff --git a/go.mod b/go.mod
index 649e774..7260720 100644
--- a/go.mod
+++ b/go.mod
@@ -1,4 +1,4 @@
-module github.com/KorAP/Kalamar-Plugin-ExternalSale
+module github.com/KorAP/Kalamar-Plugin-ExternalResources
go 1.19
diff --git a/service.go b/service.go
index adfd228..55f312e 100644
--- a/service.go
+++ b/service.go
@@ -82,8 +82,8 @@
var pluginManifest map[string]any
json.Unmarshal([]byte(`{
- "name" : "External Provider",
- "desc" : "Buy content from an external provider",
+ "name" : "External Resources",
+ "desc" : "Retrieve content from an external provider",
"embed" : [{
"panel" : "match",
"title" : "Full Text",
@@ -100,11 +100,11 @@
}]
}`), &pluginManifest)
- externalProvider := os.Getenv("KORAP_EXTERNAL_PROVIDER")
- if externalProvider == "" {
- externalProvider = "https://korap.ids-mannheim.de/plugin/external/"
+ externalResources := os.Getenv("KORAP_EXTERNAL_RESOURCES")
+ if externalResources == "" {
+ externalResources = "https://korap.ids-mannheim.de/plugin/external/"
}
- jsonpointer.Set(pluginManifest, "/embed/0/onClick/template", externalProvider)
+ jsonpointer.Set(pluginManifest, "/embed/0/onClick/template", externalResources)
r.Use(func() gin.HandlerFunc {
return func(c *gin.Context) {
@@ -123,7 +123,7 @@
})
})
- // Return provider information
+ // Return resource information
r.HEAD("/:corpus_id/:doc_id/:text_id", CheckSaleUrl)
r.GET("/:corpus_id/:doc_id/:text_id", CheckSaleUrl)
@@ -187,7 +187,7 @@
}
r := setupRouter()
- port := os.Getenv("KORAP_EXTERNAL_PROVIDER_PORT")
+ port := os.Getenv("KORAP_EXTERNAL_RESOURCES_PORT")
if port == "" {
port = "5722"
}
diff --git a/service_test.go b/service_test.go
index e32b821..34e58b2 100644
--- a/service_test.go
+++ b/service_test.go
@@ -59,7 +59,7 @@
assert.Equal(t, w.Header().Get("Access-Control-Allow-Credentials"), "null")
assert.Equal(t, w.Header().Get("Vary"), "Origin")
assert.Contains(t, w.Body.String(), "data-server=\"https://korap.ids-mannheim.de\"")
- assert.Contains(t, w.Body.String(), "<title>External Provider</title>")
+ assert.Contains(t, w.Body.String(), "<title>External Resources</title>")
os.Setenv("KORAP_SERVER", "https://korap.ids-mannheim.de/instance/test")
@@ -72,7 +72,7 @@
assert.Equal(t, http.StatusOK, w.Code)
assert.Contains(t, w.Body.String(), "data-server=\"https://korap.ids-mannheim.de/instance/test\"")
- assert.Contains(t, w.Body.String(), "<title>External Provider</title>")
+ assert.Contains(t, w.Body.String(), "<title>External Resources</title>")
}
func TestManifestRoute(t *testing.T) {
@@ -89,7 +89,7 @@
assert.Contains(t, w.Body.String(), "permissions")
assert.Contains(t, w.Body.String(), "/plugin/external")
- os.Setenv("KORAP_EXTERNAL_PROVIDER", "https://korap.ids-mannheim.de/plugin/fun")
+ os.Setenv("KORAP_EXTERNAL_RESOURCES", "https://korap.ids-mannheim.de/plugin/fun")
router = setupRouter()
diff --git a/templates/main.html b/templates/main.html
index 6c7028b..4ed9f6f 100644
--- a/templates/main.html
+++ b/templates/main.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
- <title>External Provider</title>
+ <title>External Resources</title>
<link href="https://korap.ids-mannheim.de/instance/test/css/kalamar-plugin-latest.css" type="text/css" rel="stylesheet" />
<script data-server="{{ .korapServer }}" src="https://korap.ids-mannheim.de/instance/test/js/korap-plugin-latest.js"></script>
</head>