use of org.alfresco.rm.rest.api.model.TransferContainer in project records-management by Alfresco.
the class ApiNodesModelFactory method createTransferContainer.
/**
* Creates an object of type TransferContainer
*
* @param info
* @param propertyFilter
* @param includeParam
* @param mapUserInfo
* @param isMinimalInfo
* @return UnfiledContainer object
*/
public TransferContainer createTransferContainer(FileInfo info, Parameters parameters, Map<String, UserInfo> mapUserInfo, boolean isMinimalInfo) {
TransferContainer transferContainer = new TransferContainer();
mapTransferContainerInfo(transferContainer, info, mapUserInfo, parameters.getFilter(), parameters.getInclude(), isMinimalInfo);
return transferContainer;
}
use of org.alfresco.rm.rest.api.model.TransferContainer in project records-management by Alfresco.
the class TransferContainerChildrenRelation method readAll.
@Override
@WebApiDescription(title = "Return a paged list of transfers for the transfer container identified by 'transferContainerId'")
public CollectionWithPagingInfo<Transfer> readAll(String transferContainerId, Parameters parameters) {
checkNotBlank("transferContainerId", transferContainerId);
mandatory("parameters", parameters);
NodeRef parentNodeRef = apiUtils.lookupAndValidateNodeType(transferContainerId, RecordsManagementModel.TYPE_TRANSFER_CONTAINER);
// list transfers
Set<QName> searchTypeQNames = searchTypesFactory.buildSearchTypesForTransferContainersEndpoint();
final PagingResults<FileInfo> pagingResults = fileFolderService.list(parentNodeRef, null, searchTypeQNames, null, apiUtils.getSortProperties(parameters), null, Util.getPagingRequest(parameters.getPaging()));
final List<FileInfo> page = pagingResults.getPage();
Map<String, UserInfo> mapUserInfo = new HashMap<>();
List<Transfer> nodes = new AbstractList<Transfer>() {
@Override
public Transfer get(int index) {
FileInfo info = page.get(index);
return nodesModelFactory.createTransfer(info, parameters, mapUserInfo, true);
}
@Override
public int size() {
return page.size();
}
};
TransferContainer sourceEntity = null;
if (parameters.includeSource()) {
FileInfo info = fileFolderService.getFileInfo(parentNodeRef);
sourceEntity = nodesModelFactory.createTransferContainer(info, parameters, mapUserInfo, true);
}
return CollectionWithPagingInfo.asPaged(parameters.getPaging(), nodes, pagingResults.hasMoreItems(), pagingResults.getTotalResultCount().getFirst(), sourceEntity);
}
Aggregations