mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
ACS-2391: ACS-2391: StorageObjectProps - add version content specific endpoints (#881)
- fix blatant typo - thanks MP for detailed verification and feedback - Note: e2e API sanity check will be added as part of ACS-2406
This commit is contained in:
@@ -86,17 +86,11 @@ public class NodeVersionsStorageInfoRelation implements RelationshipResourceActi
|
|||||||
{
|
{
|
||||||
String contentPropQNameId = parameters.getRelationship2Id();
|
String contentPropQNameId = parameters.getRelationship2Id();
|
||||||
|
|
||||||
Version version = nodeVersions.findVersion(nodeId, versionId);
|
NodeRef versionNodeRef = findVersionNodeRef(nodeId, versionId);
|
||||||
|
|
||||||
if (version != null)
|
|
||||||
{
|
|
||||||
NodeRef versionNodeRef = version.getFrozenStateNodeRef();
|
|
||||||
return storageInformation.getStorageInfo(versionNodeRef, contentPropQNameId, parameters);
|
return storageInformation.getStorageInfo(versionNodeRef, contentPropQNameId, parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new EntityNotFoundException(nodeId+"-"+versionId);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Experimental
|
@Experimental
|
||||||
@Operation("archive")
|
@Operation("archive")
|
||||||
@WebApiParam(name = "archiveContentRequest", title = "Request for archive version content",
|
@WebApiParam(name = "archiveContentRequest", title = "Request for archive version content",
|
||||||
@@ -109,11 +103,8 @@ public class NodeVersionsStorageInfoRelation implements RelationshipResourceActi
|
|||||||
{
|
{
|
||||||
String contentPropQNameId = parameters.getRelationship2Id();
|
String contentPropQNameId = parameters.getRelationship2Id();
|
||||||
|
|
||||||
Version version = nodeVersions.findVersion(nodeId, versionId);
|
NodeRef versionNodeRef = findVersionNodeRef(nodeId, versionId);
|
||||||
|
|
||||||
if (version != null)
|
|
||||||
{
|
|
||||||
NodeRef versionNodeRef = version.getFrozenStateNodeRef();
|
|
||||||
final boolean result = storageInformation.requestArchiveContent(versionNodeRef, contentPropQNameId, archiveContentRequest);
|
final boolean result = storageInformation.requestArchiveContent(versionNodeRef, contentPropQNameId, archiveContentRequest);
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
@@ -125,9 +116,6 @@ public class NodeVersionsStorageInfoRelation implements RelationshipResourceActi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new EntityNotFoundException(nodeId+"-"+versionId);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Experimental
|
@Experimental
|
||||||
@Operation("archive-restore")
|
@Operation("archive-restore")
|
||||||
@WebApiParam(name = "restoreArchivedContentRequest", title = "Request for restore version content from archive",
|
@WebApiParam(name = "restoreArchivedContentRequest", title = "Request for restore version content from archive",
|
||||||
@@ -140,11 +128,8 @@ public class NodeVersionsStorageInfoRelation implements RelationshipResourceActi
|
|||||||
{
|
{
|
||||||
String contentPropQNameId = parameters.getRelationship2Id();
|
String contentPropQNameId = parameters.getRelationship2Id();
|
||||||
|
|
||||||
Version version = nodeVersions.findVersion(nodeId, versionId);
|
NodeRef versionNodeRef = findVersionNodeRef(nodeId, versionId);
|
||||||
|
|
||||||
if (version != null)
|
|
||||||
{
|
|
||||||
NodeRef versionNodeRef = version.getFrozenStateNodeRef();
|
|
||||||
final boolean result = storageInformation.requestRestoreContentFromArchive(versionNodeRef, contentPropQNameId, restoreArchivedContentRequest);
|
final boolean result = storageInformation.requestRestoreContentFromArchive(versionNodeRef, contentPropQNameId, restoreArchivedContentRequest);
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
@@ -156,6 +141,13 @@ public class NodeVersionsStorageInfoRelation implements RelationshipResourceActi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private NodeRef findVersionNodeRef(String nodeId, String versionId)
|
||||||
|
{
|
||||||
|
Version version = nodeVersions.findVersion(nodeId, versionId);
|
||||||
|
if (version == null)
|
||||||
|
{
|
||||||
throw new EntityNotFoundException(nodeId+"-"+versionId);
|
throw new EntityNotFoundException(nodeId+"-"+versionId);
|
||||||
}
|
}
|
||||||
|
return version.getFrozenStateNodeRef();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user