mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
[Task 68857] added javadoc to the Version functionality classes
This commit is contained in:
@@ -28,6 +28,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* This controller handles calls for the Version endpoint with a specific ID
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/versioning/versions/{id}")
|
||||
public class VersionRestController {
|
||||
@@ -41,6 +44,18 @@ public class VersionRestController {
|
||||
@Autowired
|
||||
private Utils utils;
|
||||
|
||||
/**
|
||||
* This method will retrieve a Version object based on the given ID paramater and t'll fetch the EPerson from that
|
||||
* Version object and created a Resource from it and return this EPersonResource
|
||||
* @param id The ID of the Version to be used
|
||||
* @param response The current response
|
||||
* @param request The current request
|
||||
* @param pageable The pageable if present
|
||||
* @param assembler The assembler
|
||||
* @return The EPersonResource object constructed from the EPerson that was attached to the Version
|
||||
* object which was found through the given ID
|
||||
* @throws SQLException If something goes wrong
|
||||
*/
|
||||
@RequestMapping(value = "/eperson", method = RequestMethod.GET)
|
||||
public EPersonResource retrieve(@PathVariable Integer id,
|
||||
HttpServletResponse response,
|
||||
|
@@ -39,6 +39,17 @@ public class EPersonVersionLinkRepository extends AbstractDSpaceRestRepository
|
||||
private ConfigurationService configurationService;
|
||||
|
||||
|
||||
/**
|
||||
* This method will return the EPersonRest object from the Version retrieved by the given versionId
|
||||
* @param request The current request
|
||||
* @param versionId The id for the Version from which we'll retrieve the EPerson
|
||||
* @param optionalPageable Pageable if present
|
||||
* @param projection Current Projection
|
||||
* @return The EPerson that is attached to the Version object that is associated with the given
|
||||
* versionId Integer
|
||||
* @throws SQLException If something goes wrong
|
||||
* @throws AuthorizeException If something goes wrong
|
||||
*/
|
||||
public EPersonRest getEPersonForVersion(@Nullable HttpServletRequest request,
|
||||
Integer versionId,
|
||||
@Nullable Pageable optionalPageable,
|
||||
|
@@ -38,6 +38,16 @@ public class ItemVersionLinkRepository extends AbstractDSpaceRestRepository
|
||||
@Autowired
|
||||
private ItemService itemService;
|
||||
|
||||
/**
|
||||
* This method will return the VersionRest object from the Item that is associated with the given itemUuid
|
||||
* @param request The current request
|
||||
* @param itemUuid The itemUuid used to find the Item for which we'll return the VersionRest object
|
||||
* @param optionalPageable Pageable if present
|
||||
* @param projection Current Projection
|
||||
* @return The VersionRest object constructed from the Version object for the Item that has the
|
||||
* itemUuid param as UUID
|
||||
* @throws SQLException If something goes wrong
|
||||
*/
|
||||
public VersionRest getItemVersion(@Nullable HttpServletRequest request,
|
||||
UUID itemUuid,
|
||||
@Nullable Pageable optionalPageable,
|
||||
|
@@ -34,6 +34,17 @@ public class VersionHistoryLinkRepository extends AbstractDSpaceRestRepository
|
||||
@Autowired
|
||||
private VersioningService versioningService;
|
||||
|
||||
/**
|
||||
* This method will retrieve the VersionHistoryRest object from the Version that is found by the associated
|
||||
* versionId parameter
|
||||
* @param request The current request
|
||||
* @param versionId The ID for the Version object
|
||||
* @param optionalPageable The pageable if present
|
||||
* @param projection The current Projection
|
||||
* @return The VersionHistoryRest object that is constructed from the VersionHistory object that
|
||||
* is linked to the Version found by the versionId parameter
|
||||
* @throws SQLException If something goes wrong
|
||||
*/
|
||||
public VersionHistoryRest getVersionHistory(@Nullable HttpServletRequest request,
|
||||
Integer versionId,
|
||||
@Nullable Pageable optionalPageable,
|
||||
|
@@ -34,6 +34,16 @@ public class VersionItemLinkRepository extends AbstractDSpaceRestRepository
|
||||
@Autowired
|
||||
private VersioningService versioningService;
|
||||
|
||||
/**
|
||||
* This method will return the ItemRest object constructed from the Item object which is found in the Version
|
||||
* that will be found through the versionId parameter
|
||||
* @param request The current request
|
||||
* @param versionId The ID for the Version to be used
|
||||
* @param optionalPageable The pageable if present
|
||||
* @param projection The current Projection
|
||||
* @return The ItemRest object that is relevant for the Version
|
||||
* @throws SQLException If something goes wrong
|
||||
*/
|
||||
public ItemRest getVersionItem(@Nullable HttpServletRequest request,
|
||||
Integer versionId,
|
||||
@Nullable Pageable optionalPageable,
|
||||
|
@@ -41,6 +41,16 @@ public class VersionsLinkRepository extends AbstractDSpaceRestRepository
|
||||
@Autowired
|
||||
private VersioningService versioningService;
|
||||
|
||||
/**
|
||||
* This method will return a page of VersionRest objects found through the VersionHistory object that is resolved
|
||||
* from the versionHistoryId parameter
|
||||
* @param request The current request
|
||||
* @param versionHistoryId The ID for the VersionHistory to be used
|
||||
* @param optionalPageable The pageable if present
|
||||
* @param projection The current Projection
|
||||
* @return The page containing relevant VersionRest objects
|
||||
* @throws SQLException If something goes wrong
|
||||
*/
|
||||
public Page<VersionRest> getVersions(@Nullable HttpServletRequest request,
|
||||
Integer versionHistoryId,
|
||||
@Nullable Pageable optionalPageable,
|
||||
|
@@ -302,6 +302,15 @@ public class WorkflowItemRestRepository extends DSpaceRestRepository<WorkflowIte
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This is a search method that will return the WorkflowItemRest object found through the UUID of an item. It'll
|
||||
* find the Item through the given UUID and try to resolve the WorkflowItem relevant for that item and return it.
|
||||
* It'll return a 401/403 if the current user isn't allowed to view the WorkflowItem.
|
||||
* It'll return a 204 if nothing was found
|
||||
* @param itemUuid The UUID for the Item to be used
|
||||
* @param pageable The pageable if present
|
||||
* @return The resulting WorkflowItemRest object
|
||||
*/
|
||||
@SearchRestMethod(name = "item")
|
||||
public WorkflowItemRest findByItemUuid(@Parameter(value = "uuid", required = true) UUID itemUuid,
|
||||
Pageable pageable) {
|
||||
|
@@ -503,6 +503,15 @@ public class WorkspaceItemRestRepository extends DSpaceRestRepository<WorkspaceI
|
||||
return converter.toRest(workspaceItem, Projection.DEFAULT);
|
||||
}
|
||||
|
||||
/**
|
||||
* This is a search method that will return the WorkspaceItemRest object found through the UUID of an item. It'll
|
||||
* find the Item through the given UUID and try to resolve the WorkspaceItem relevant for that item and return it.
|
||||
* It'll return a 401/403 if the current user isn't allowed to view the WorkspaceItem.
|
||||
* It'll return a 204 if nothing was found
|
||||
* @param itemUuid The UUID for the Item to be used
|
||||
* @param pageable The pageable if present
|
||||
* @return The resulting WorkspaceItem object
|
||||
*/
|
||||
@SearchRestMethod(name = "item")
|
||||
public WorkspaceItemRest findByItemUuid(@Parameter(value = "uuid", required = true) UUID itemUuid,
|
||||
Pageable pageable) {
|
||||
|
Reference in New Issue
Block a user