use of org.alfresco.rm.rest.api.model.TransferChild in project records-management by Alfresco.
the class TransferChildrenRelation method readAll.
@Override
@WebApiDescription(title = "Return a paged list of record folders or records for the transfer identified by 'transferId'")
public CollectionWithPagingInfo<TransferChild> readAll(String transferId, Parameters parameters) {
checkNotBlank("transferId", transferId);
mandatory("parameters", parameters);
NodeRef parentNodeRef = apiUtils.lookupAndValidateNodeType(transferId, RecordsManagementModel.TYPE_TRANSFER);
// list record folder, electronic record or non electronic record
final PagingResults<FileInfo> pagingResults = fileFolderService.list(parentNodeRef, null, null, null, apiUtils.getSortProperties(parameters), null, Util.getPagingRequest(parameters.getPaging()));
final List<FileInfo> page = pagingResults.getPage();
Map<String, UserInfo> mapUserInfo = new HashMap<>();
List<TransferChild> nodes = new AbstractList<TransferChild>() {
@Override
public TransferChild get(int index) {
FileInfo info = page.get(index);
return nodesModelFactory.createTransferChild(info, parameters, mapUserInfo, true);
}
@Override
public int size() {
return page.size();
}
};
Transfer sourceEntity = null;
if (parameters.includeSource()) {
FileInfo info = fileFolderService.getFileInfo(parentNodeRef);
sourceEntity = nodesModelFactory.createTransfer(info, parameters, mapUserInfo, true);
}
return CollectionWithPagingInfo.asPaged(parameters.getPaging(), nodes, pagingResults.hasMoreItems(), pagingResults.getTotalResultCount().getFirst(), sourceEntity);
}
use of org.alfresco.rm.rest.api.model.TransferChild in project records-management by Alfresco.
the class ApiNodesModelFactory method createTransferChild.
/**
* Creates an object of type TransferChild
*
* @param info
* @param propertyFilter
* @param includeParam
* @param mapUserInfo
* @param isMinimalInfo
* @return UnfiledContainer object
*/
public TransferChild createTransferChild(FileInfo info, Parameters parameters, Map<String, UserInfo> mapUserInfo, boolean isMinimalInfo) {
TransferChild transferChild = new TransferChild();
mapBasicInfo(transferChild, info, parameters.getFilter(), mapUserInfo, isMinimalInfo);
mapOptionalInfo(transferChild, info, parameters.getInclude(), isMinimalInfo);
mapTransferChildInfo(transferChild, info, parameters.getInclude(), isMinimalInfo);
return transferChild;
}
Aggregations