Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dcat-catalog-proxy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Open-Data
dcat-catalog-proxy
Commits
929a83c0
Commit
929a83c0
authored
3 years ago
by
Jesper Zedlitz
Browse files
Options
Downloads
Patches
Plain Diff
Parameter q, fq und modified_since durchreichen
parent
3dd230ff
No related branches found
No related tags found
1 merge request
!3
Resolve "Suchanfragen weiterleiten"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/de/landsh/opendata/catalogproxy/FilterController.java
+24
-2
24 additions, 2 deletions
...ava/de/landsh/opendata/catalogproxy/FilterController.java
with
24 additions
and
2 deletions
src/main/java/de/landsh/opendata/catalogproxy/FilterController.java
+
24
−
2
View file @
929a83c0
package
de.landsh.opendata.catalogproxy
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.jena.rdf.model.Model
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -14,6 +15,7 @@ import java.io.IOException;
import
java.io.InputStream
;
import
java.io.Writer
;
import
java.net.URL
;
import
java.net.URLEncoder
;
@Controller
public
class
FilterController
{
...
...
@@ -26,13 +28,33 @@ public class FilterController {
private
CatalogFilter
catalogFilter
;
@RequestMapping
(
value
=
"/catalog.xml"
,
produces
=
"application/rdf+xml"
)
public
void
catalog
(
@RequestParam
(
required
=
false
)
Integer
page
,
HttpServletResponse
response
)
throws
IOException
{
public
void
catalog
(
@RequestParam
(
required
=
false
)
Integer
page
,
@RequestParam
(
required
=
false
)
String
q
,
@RequestParam
(
required
=
false
)
String
fq
,
@RequestParam
(
required
=
false
,
name
=
"modified_since"
)
String
modifiedSince
,
HttpServletResponse
response
)
throws
IOException
{
if
(
page
==
null
)
page
=
1
;
log
.
debug
(
"catalog.xml?page={}"
,
page
);
final
InputStream
is
=
new
URL
(
remoteURL
+
"catalog.xml?page="
+
page
).
openStream
();
final
StringBuilder
url
=
new
StringBuilder
(
remoteURL
);
url
.
append
(
"catalog.xml?page="
);
url
.
append
(
page
);
if
(
StringUtils
.
isNotBlank
(
modifiedSince
))
{
url
.
append
(
"&modified_since="
);
url
.
append
(
URLEncoder
.
encode
(
modifiedSince
,
"utf-8"
));
}
if
(
StringUtils
.
isNotBlank
(
q
))
{
url
.
append
(
"&q="
);
url
.
append
(
URLEncoder
.
encode
(
q
,
"utf-8"
));
}
if
(
StringUtils
.
isNotBlank
(
fq
))
{
url
.
append
(
"&fq="
);
url
.
append
(
URLEncoder
.
encode
(
fq
,
"utf-8"
));
}
final
InputStream
is
=
new
URL
(
url
.
toString
()).
openStream
();
final
Model
model
=
catalogFilter
.
work
(
is
);
is
.
close
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment