Skip to content
Permalink
Browse files

Update legacy services mapping

Since introduction of the new concept of portals instead of node (PR #3475) some
old services stopped to work. This commit updates the @RequestMapping annotation
to match the new format of the URL for portals, adding an additional `/{portal}`
segment to the RequestMapping URLs.
  • Loading branch information
juanluisrp authored and fxprunayre committed Oct 15, 2019
1 parent dddbf16 commit d0ed154be2697e4cf425a06ff2a493547c66ee44
Showing with 45 additions and 45 deletions.
  1. +1 −1 core/src/main/java/org/fao/geonet/services/thumbnail/Set.java
  2. +2 −2 healthmonitor/src/main/java/org/fao/geonet/monitor/service/LogConfig.java
  3. +4 −4 services/src/main/java/org/fao/geonet/api/records/formatters/FormatterApi.java
  4. +1 −1 services/src/main/java/org/fao/geonet/api/records/formatters/ListFormatters.java
  5. +1 −1 services/src/main/java/org/fao/geonet/api/records/formatters/Register.java
  6. +1 −1 services/src/main/java/org/fao/geonet/api/records/formatters/Resource.java
  7. +1 −1 services/src/main/java/org/fao/geonet/guiservices/csw/virtual/Delete.java
  8. +1 −1 services/src/main/java/org/fao/geonet/guiservices/csw/virtual/Get.java
  9. +1 −1 services/src/main/java/org/fao/geonet/guiservices/csw/virtual/List.java
  10. +1 −1 services/src/main/java/org/fao/geonet/guiservices/csw/virtual/Update.java
  11. +1 −1 services/src/main/java/org/fao/geonet/guiservices/metadata/GetRelated.java
  12. +1 −1 services/src/main/java/org/fao/geonet/services/category/Remove.java
  13. +1 −1 services/src/main/java/org/fao/geonet/services/category/Update.java
  14. +1 −1 services/src/main/java/org/fao/geonet/services/category/XmlUpdate.java
  15. +1 −1 services/src/main/java/org/fao/geonet/services/log/List.java
  16. +2 −2 services/src/main/java/org/fao/geonet/services/logo/Add.java
  17. +3 −3 services/src/main/java/org/fao/geonet/services/main/Select.java
  18. +1 −1 services/src/main/java/org/fao/geonet/services/metadata/BatchNewOwner.java
  19. +1 −1 services/src/main/java/org/fao/geonet/services/metadata/ExtractServicesLayers.java
  20. +3 −3 services/src/main/java/org/fao/geonet/services/metadata/MetadataIdentifierTemplatesController.java
  21. +2 −2 services/src/main/java/org/fao/geonet/services/metadata/Publish.java
  22. +2 −2 services/src/main/java/org/fao/geonet/services/metadata/ValidationService.java
  23. +1 −1 services/src/main/java/org/fao/geonet/services/metadata/XslProcessing.java
  24. +1 −1 services/src/main/java/org/fao/geonet/services/metadata/XslProcessingReportGet.java
  25. +1 −1 services/src/main/java/org/fao/geonet/services/region/List.java
  26. +1 −1 services/src/main/java/org/fao/geonet/services/resources/Download.java
  27. +1 −1 services/src/main/java/org/fao/geonet/services/resources/RemoveAndProcess.java
  28. +1 −1 services/src/main/java/org/fao/geonet/services/resources/UploadAndProcess.java
  29. +1 −1 services/src/main/java/org/fao/geonet/services/sources/SourcesController.java
  30. +1 −1 services/src/main/java/org/fao/geonet/services/system/UpdateSystemInfo.java
  31. +1 −1 services/src/main/java/org/fao/geonet/services/user/List.java
  32. +1 −1 services/src/main/java/org/fao/geonet/services/user/Remove.java
  33. +2 −2 services/src/main/java/org/fao/geonet/services/user/Update.java
@@ -82,7 +82,7 @@ public boolean imageUpdate(Image img, int infoflags, int x, int y, int width, in
private static final String FNAME_PARAM = "fname=";


@RequestMapping(value = {"/{lang}/md.thumbnail.upload"}, produces = {
@RequestMapping(value = {"/{portal}/{lang}/md.thumbnail.upload"}, produces = {
MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE})
@ResponseBody
public Response serviceSpecificExec(HttpServletRequest request,
@@ -98,7 +98,7 @@ boolean isAppenderLogFileLoaded() {
/**
* Download the log file in a ZIP.
*/
@RequestMapping(value = "/{lang}/log/file", produces = {
@RequestMapping(value = "/{portal}/{lang}/log/file", produces = {
MediaType.APPLICATION_OCTET_STREAM_VALUE})
@ResponseBody
public void getLog(HttpServletResponse response) throws IOException {
@@ -144,7 +144,7 @@ public void getLog(HttpServletResponse response) throws IOException {
*
* @param lines Number of lines to return. Default 2000. Max number of lines returned 20000.
*/
@RequestMapping(value = "/{lang}/log/activity", produces = {
@RequestMapping(value = "/{portal}/{lang}/log/activity", produces = {
MediaType.TEXT_PLAIN_VALUE})
@ResponseBody
public String activity(@RequestParam(value = "lines",
@@ -287,7 +287,7 @@ public void getRecordFormattedBy(
formatType,
request.getNativeRequest(HttpServletRequest.class));
AbstractMetadata metadata = ApiUtils.canViewRecord(metadataUuid, servletRequest);

if(approved) {
metadata = context.getBean(MetadataRepository.class).findOneByUuid(metadataUuid);
}
@@ -354,7 +354,7 @@ public void getRecordFormattedBy(
* @param mdPath (optional) the xpath to the metadata node if it's not the root node of the
* XML
*/
@RequestMapping(value = "/{lang}/xml.format.{type}")
@RequestMapping(value = "/{portal}/{lang}/xml.format.{type}")
@ResponseBody
@Deprecated
public void execXml(
@@ -406,7 +406,7 @@ public void execXml(
* This is a service to use if there is process to keep the cache at least periodically
* up-to-date and if maximum performance is required.
*/
@RequestMapping(value = "/{lang}/md.format.public.{type}")
@RequestMapping(value = "/{portal}/{lang}/md.format.public.{type}")
public HttpEntity<byte[]> getCachedPublicMetadata(
@PathVariable final String lang,
@PathVariable final String type,
@@ -442,7 +442,7 @@ public void execXml(
* enum values: {@link org.fao.geonet.api.records.formatters.FormatterWidth}
* The default is _100 (100% of the screen)
*/
@RequestMapping(value = "/{lang}/md.format.{type}")
@RequestMapping(value = "/{portal}/{lang}/md.format.{type}")
@ResponseBody
public void exec(
@PathVariable final String lang,
@@ -103,7 +103,7 @@ private void addFormatters(String schema, FormatterDataResponse response, Path r
}
}

@RequestMapping(value = "/{lang}/md.formatter.list", produces = {
@RequestMapping(value = "/{portal}/{lang}/md.formatter.list", produces = {
MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE})
@ResponseBody
public FormatterDataResponse exec(
@@ -75,7 +75,7 @@
public class Register extends AbstractFormatService {


@RequestMapping(value = {"/{lang}/md.formatter.register"}, produces = {MediaType.APPLICATION_JSON_VALUE})
@RequestMapping(value = {"/{portal}/{lang}/md.formatter.register"}, produces = {MediaType.APPLICATION_JSON_VALUE})
@ResponseBody
public JSONObject serviceSpecificExec(HttpServletRequest request,
@PathVariable String lang,
@@ -50,7 +50,7 @@
@Controller("md.formatter.resource")
public class Resource extends AbstractFormatService {

@RequestMapping(value = "/{lang}/md.formatter.resource")
@RequestMapping(value = "/{portal}/{lang}/md.formatter.resource")
public void exec(
@RequestParam(Params.ID) String xslid,
@RequestParam(Params.FNAME) String fileName,
@@ -38,7 +38,7 @@
@Deprecated
public class Delete {

@RequestMapping(value = "/{lang}/admin.config.virtualcsw.remove", produces = {
@RequestMapping(value = "/{portal}/{lang}/admin.config.virtualcsw.remove", produces = {
MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE})
public
@ResponseBody
@@ -40,7 +40,7 @@
@Deprecated
public class Get {

@RequestMapping(value = "/{lang}/admin.config.virtualcsw.get", produces = {
@RequestMapping(value = "/{portal}/{lang}/admin.config.virtualcsw.get", produces = {
MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE})
public
@ResponseBody
@@ -36,7 +36,7 @@
@Controller("admin.config.virtualcsw.list")
@Deprecated
public class List {
@RequestMapping(value = "/{lang}/admin.config.virtualcsw.list", produces = {
@RequestMapping(value = "/{portal}/{lang}/admin.config.virtualcsw.list", produces = {
MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE})
public
@ResponseBody
@@ -63,7 +63,7 @@
"_content_type"
};

@RequestMapping(value = "/{lang}/admin.config.virtualcsw.update", produces = {
@RequestMapping(value = "/{portal}/{lang}/admin.config.virtualcsw.update", produces = {
MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE})
public
@ResponseBody
@@ -142,7 +142,7 @@ public void init(Path appPath, ServiceConfig config) throws Exception {
/**
* @param type List of comma or "|" separated types
*/
@RequestMapping(value = "/{lang}/xml.relation")
@RequestMapping(value = "/{portal}/{lang}/xml.relation")
public HttpEntity<byte[]> exec(@PathVariable String lang,
@RequestParam(required = false) Integer id,
@RequestParam(required = false) String uuid,
@@ -50,7 +50,7 @@
@ReadWriteController
@Deprecated
public class Remove {
@RequestMapping(value = "/{lang}/admin.category.remove", produces = {
@RequestMapping(value = "/{portal}/{lang}/admin.category.remove", produces = {
MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE})
@ResponseBody
public CategoryUpdateResponse exec(
@@ -49,7 +49,7 @@
@Deprecated
public class Update {

@RequestMapping(value = "/{lang}/admin.category.update", produces = {
@RequestMapping(value = "/{portal}/{lang}/admin.category.update", produces = {
MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE})
@ResponseBody
public CategoryUpdateResponse exec(
@@ -50,7 +50,7 @@
@Deprecated
public class XmlUpdate {

@RequestMapping(value = "/{lang}/admin.category.update.labels", produces = {
@RequestMapping(value = "/{portal}/{lang}/admin.category.update.labels", produces = {
MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE})
@ResponseBody
public OkResponse serviceSpecificExec(@RequestBody String request) throws Exception {
@@ -67,7 +67,7 @@ public void init(String appPath, ServiceConfig params) throws Exception {
// ---
// --------------------------------------------------------------------------

@RequestMapping(value = "/{lang}/admin.logfile.list", produces = {
@RequestMapping(value = "/{portal}/{lang}/admin.logfile.list", produces = {
MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE})
@ResponseBody
ListLogFilesResponse exec() throws Exception {
@@ -54,7 +54,7 @@ public synchronized void setApplicationContext(ApplicationContext context) {
this.context = context;
}

@RequestMapping(value = "/{lang}/admin.logo.upload",
@RequestMapping(value = "/{portal}/{lang}/admin.logo.upload",
consumes = {MediaType.ALL_VALUE},
produces = {MediaType.APPLICATION_JSON_VALUE})
public
@@ -64,7 +64,7 @@ StatusResponse execJSON(@RequestParam("fname") MultipartFile fname)
return exec(fname);
}

@RequestMapping(value = "/{lang}/admin.logo.upload", produces = {
@RequestMapping(value = "/{portal}/{lang}/admin.logo.upload", produces = {
MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE})
public
@ResponseBody
@@ -64,7 +64,7 @@ public synchronized void setApplicationContext(ApplicationContext context) {
* @param type Only metadata can be selected. Unused for now. Leave blank
* @return The number of select records
*/
@RequestMapping(value = {"/{lang}/metadata.select", "/{lang}/md.select"},
@RequestMapping(value = {"/{portal}/{lang}/metadata.select", "/{portal}/{lang}/md.select"},
produces = {MediaType.APPLICATION_JSON_VALUE})
public
@ResponseBody
@@ -88,7 +88,7 @@ public synchronized void setApplicationContext(ApplicationContext context) {
* @return
* @throws Exception
*/
@RequestMapping(value = "/{lang}/md.selected",
@RequestMapping(value = "/{portal}/{lang}/md.selected",
produces = {MediaType.APPLICATION_JSON_VALUE})
public
@ResponseBody
@@ -108,7 +108,7 @@ public synchronized void setApplicationContext(ApplicationContext context) {
/**
* @deprecated Use the service with JSON format as output
*/
@RequestMapping(value = "/{lang}/metadata.select",
@RequestMapping(value = "/{portal}/{lang}/metadata.select",
produces = {MediaType.APPLICATION_XML_VALUE})
public
@ResponseBody
@@ -64,7 +64,7 @@
@Deprecated
public class BatchNewOwner {

@RequestMapping(value = "/{lang}/metadata.batch.newowner", produces = {
@RequestMapping(value = "/{portal}/{lang}/metadata.batch.newowner", produces = {
MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE})
@ResponseBody
public NewOwnerResult exec(
@@ -58,7 +58,7 @@
@Controller
public class ExtractServicesLayers {

@RequestMapping(value = "/{lang}/selection.layers")
@RequestMapping(value = "/{portal}/{lang}/selection.layers")
@ResponseBody
public JSONObject getLayersFromSelectedMetadatas(
@PathVariable String lang,
@@ -45,7 +45,7 @@
@Deprecated
@Controller("metadataIdentifierTemplates")
public class MetadataIdentifierTemplatesController {
@RequestMapping(value = "/{lang}/metadataIdentifierTemplates", method = RequestMethod.POST)
@RequestMapping(value = "/{portal}/{lang}/metadataIdentifierTemplates", method = RequestMethod.POST)
@ResponseBody
public OkResponse updateUrnTemplate(
@RequestParam final Integer id,
@@ -78,7 +78,7 @@ public void apply(@Nonnull MetadataIdentifierTemplate entity) {
return new OkResponse();
}

@RequestMapping(value = "/{lang}/metadataIdentifierTemplates",
@RequestMapping(value = "/{portal}/{lang}/metadataIdentifierTemplates",
method = RequestMethod.DELETE)
@ResponseBody
public OkResponse deleteMetadataURNTemplate(@RequestParam final Integer id) {
@@ -91,7 +91,7 @@ public OkResponse deleteMetadataURNTemplate(@RequestParam final Integer id) {
return new OkResponse();
}

@RequestMapping(value = "/{lang}/metadataIdentifierTemplates",
@RequestMapping(value = "/{portal}/{lang}/metadataIdentifierTemplates",
method = RequestMethod.GET, produces = {
MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE})
@ResponseBody
@@ -92,7 +92,7 @@
boolean testing = false;


@RequestMapping(value = "/{lang}/md.publish", produces = {
@RequestMapping(value = "/{portal}/{lang}/md.publish", produces = {
MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE})
@ResponseBody
public PublishReport publish(
@@ -108,7 +108,7 @@ public PublishReport publish(
}


@RequestMapping(value = "/{lang}/md.unpublish", produces = {
@RequestMapping(value = "/{portal}/{lang}/md.unpublish", produces = {
MediaType.APPLICATION_JSON_VALUE, MediaType.APPLICATION_XML_VALUE})
@ResponseBody
public PublishReport unpublish(
@@ -74,7 +74,7 @@ public synchronized void setApplicationContext(ApplicationContext context) {
*
* @param uuid One or more UUIDs to validate
*/
@RequestMapping(value = "/{lang}/md.validation",
@RequestMapping(value = "/{portal}/{lang}/md.validation",
produces = {
MediaType.APPLICATION_XML_VALUE,
MediaType.APPLICATION_JSON_VALUE})
@@ -133,7 +133,7 @@ private void validateRecords(ServiceContext serviceContext,
this.report.get("validRecords").add(record.getId());
}
this.report.get("records").add(record.getId());

}
}
}
@@ -75,7 +75,7 @@
@Deprecated
public class XslProcessing {

@RequestMapping(value = {"/{lang}/md.processing", "/{lang}/xml.metadata.processing", "/{lang}/metadata.processing.new"}, produces = {
@RequestMapping(value = {"/{portal}/{lang}/md.processing", "/{portal}/{lang}/xml.metadata.processing", "/{portal}/{lang}/metadata.processing.new"}, produces = {
MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE})
@ResponseBody
public XsltMetadataProcessingReport xmlProcessing(@RequestParam(value = Params.PROCESS) String process,
@@ -89,7 +89,7 @@
public void init(String appPath, ServiceConfig config) throws Exception {
}

@RequestMapping(value = "/{lang}/md.processing.batch.report", produces = {
@RequestMapping(value = "/{portal}/{lang}/md.processing.batch.report", produces = {
MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE})
public
@ResponseBody
@@ -142,7 +142,7 @@ public void init(Path appPath, ServiceConfig params) throws Exception {
* @param maxRecords limit the number of results returned - optional
*/

@RequestMapping(value = "/{lang}/regions.list", produces = {
@RequestMapping(value = "/{portal}/{lang}/regions.list", produces = {
MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE})
@ResponseBody
public ListRegionsResponse exec(@PathVariable String lang,
@@ -70,7 +70,7 @@
@Autowired
private ServiceManager serviceManager;

@RequestMapping(value = "/{lang}/resources.get")
@RequestMapping(value = "/{portal}/{lang}/resources.get")
public HttpEntity<byte[]> exec(@PathVariable String lang,
@RequestParam(value = Params.ID, required = false) String idParam,
@RequestParam(value = Params.UUID, required = false) String uuidParam,
@@ -68,7 +68,7 @@
@Autowired
private ServiceManager serviceManager;

@RequestMapping(value = {"/{lang}/resource.del.and.detach"}, produces = {
@RequestMapping(value = {"/{portal}/{lang}/resource.del.and.detach"}, produces = {
MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE})
public
@ResponseBody
@@ -69,7 +69,7 @@
@Autowired
private ServiceManager serviceManager;

@RequestMapping(value = {"/{lang}/resource.upload.and.link", "/{lang}/resource-onlinesrc-upload"}, produces = {
@RequestMapping(value = {"/{portal}/{lang}/resource.upload.and.link", "/{portal}/{lang}/resource-onlinesrc-upload"}, produces = {
MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE})
@ResponseBody
public IdResponse exec(HttpServletRequest request,
@@ -72,7 +72,7 @@
@Autowired
private HarvesterSettingRepository harvesterSettingRepository;

@RequestMapping("/{lang}/source/{uuid}")
@RequestMapping("/{portal}/{lang}/source/{uuid}")
@ResponseBody
public OkResponse updateTranslations(
@PathVariable String lang,
@@ -45,7 +45,7 @@
@Autowired
private SystemInfo info;

@RequestMapping(value = "/{lang}/systeminfo/staging", produces = {
@RequestMapping(value = "/{portal}/{lang}/systeminfo/staging", produces = {
MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE})
@ResponseBody
public OkResponse update(@RequestParam(required = true) String newProfile) {
@@ -71,7 +71,7 @@
public void init(String appPath, ServiceConfig params) throws Exception {
}

@RequestMapping(value = "/{lang}/admin.user.list", produces = {
@RequestMapping(value = "/{portal}/{lang}/admin.user.list", produces = {
MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE})
public
@ResponseBody
@@ -57,7 +57,7 @@
public class Remove {


@RequestMapping(value = "/{lang}/admin.user.remove", produces = {
@RequestMapping(value = "/{portal}/{lang}/admin.user.remove", produces = {
MediaType.APPLICATION_XML_VALUE, MediaType.APPLICATION_JSON_VALUE})
public
@ResponseBody

0 comments on commit d0ed154

Please sign in to comment.
You can’t perform that action at this time.