mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
66458: Use shared UUID regex instead of object's own one
This commit is contained in:
@@ -7,6 +7,8 @@
|
||||
*/
|
||||
package org.dspace.app.rest;
|
||||
|
||||
import static org.dspace.app.rest.utils.RegexUtils.REGEX_REQUESTMAPPING_IDENTIFIER_AS_UUID;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
import java.util.UUID;
|
||||
@@ -45,15 +47,9 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/" + CollectionRest.CATEGORY + "/" + CollectionRest.PLURAL_NAME
|
||||
+ CollectionItemtemplateController.REGEX_REQUESTMAPPING_IDENTIFIER_AS_UUID + "/itemtemplate")
|
||||
+ REGEX_REQUESTMAPPING_IDENTIFIER_AS_UUID + "/itemtemplate")
|
||||
public class CollectionItemtemplateController {
|
||||
|
||||
/**
|
||||
* Regular expression in the request mapping to accept UUID as identifier
|
||||
*/
|
||||
protected static final String REGEX_REQUESTMAPPING_IDENTIFIER_AS_UUID =
|
||||
"/{uuid:[0-9a-fxA-FX]{8}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{12}}";
|
||||
|
||||
@Autowired
|
||||
private Utils utils;
|
||||
|
||||
|
@@ -7,6 +7,8 @@
|
||||
*/
|
||||
package org.dspace.app.rest;
|
||||
|
||||
import static org.dspace.app.rest.utils.RegexUtils.REGEX_REQUESTMAPPING_IDENTIFIER_AS_UUID;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
import java.util.UUID;
|
||||
@@ -42,15 +44,9 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
* Contrary to CollectionItemtemplateController, this class will receive the UUID of an Item template
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/core/itemtemplates" + ItemtemplateRestController.REGEX_REQUESTMAPPING_IDENTIFIER_AS_UUID)
|
||||
@RequestMapping("/api/core/itemtemplates" + REGEX_REQUESTMAPPING_IDENTIFIER_AS_UUID)
|
||||
public class ItemtemplateRestController {
|
||||
|
||||
/**
|
||||
* Regular expression in the request mapping to accept UUID as identifier
|
||||
*/
|
||||
protected static final String REGEX_REQUESTMAPPING_IDENTIFIER_AS_UUID =
|
||||
"/{uuid:[0-9a-fxA-FX]{8}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{4}-[0-9a-fxA-FX]{12}}";
|
||||
|
||||
@Autowired
|
||||
private Utils utils;
|
||||
|
||||
|
Reference in New Issue
Block a user