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

georss - adding a simple endpoint accessible with a GET request #72

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,37 @@ public void search(
HttpEntity<String> httpEntity) throws Exception {
proxy.search(httpSession, request, response, body, bucket);
}

/**
* provides an API endpoint for a GeoRSS endpoint, also sorts the records
* by changeDate (descending), and limits the results to the first 10.
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

yes, but iirc this was developed before ogc-api-records was able to provide rss (eg around 4.0.x), and i wouldn't be sure it provides the same field mappings. @pmauduit ?

(i agree that those days a standalone rss service doesn't make sense with ogc-api-records doing that and much more)

Copy link
Author

Choose a reason for hiding this comment

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

for comparison, the service we still use with our 4.0.6 catalog returns this rss content: https://ids.craig.fr/geocat/srv/fre/rss.search

*
* @param bucket the bucket where to search
* @param httpSession the http session object
* @param request the HTTTP request object
* @param response the HTTP response object
* @param httpEntity the http entity object
* @throws Exception the exception being thrown.
*/
@RequestMapping(value = "/search/records/rss.search",
method = {
RequestMethod.GET
})
@Produces(value = "application/xml")
@ResponseStatus(value = HttpStatus.OK)
@ResponseBody
public void rssSearch(
@RequestParam(defaultValue = Constants.Selection.DEFAULT_SELECTION_METADATA_BUCKET)
String bucket,
HttpSession httpSession,
HttpServletRequest request,
HttpServletResponse response,
HttpEntity<String> httpEntity) throws Exception {
String body;
body = "{\"from\": 0, \"size\": 10,\"query\": {\"query_string\": {\"query\": \"+isTemplate:n\"}"
+ "}, \"sort\": [{ \"changeDate\": {\"order\": \"desc\", \"unmapped_type\" : \"date\" }}]}";
proxy.search(httpSession, request, response, body, bucket);
}


}