use of org.alfresco.rm.rest.api.model.UnfiledRecordFolder in project records-management by Alfresco.
the class ApiNodesModelFactory method createUnfiledRecordFolder.
/**
* Creates an object of type UnfiledRecordFolder
*
* @param info
* @param parameters
* @param mapUserInfo
* @param isMinimalInfo
* @return UnfiledRecordFolder object
*/
public UnfiledRecordFolder createUnfiledRecordFolder(FileInfo info, Parameters parameters, Map<String, UserInfo> mapUserInfo, boolean isMinimalInfo) {
UnfiledRecordFolder unfiledChild = new UnfiledRecordFolder();
mapBasicInfo(unfiledChild, info, parameters.getFilter(), mapUserInfo, isMinimalInfo);
mapOptionalInfo(unfiledChild, info, parameters.getInclude(), isMinimalInfo);
return unfiledChild;
}
use of org.alfresco.rm.rest.api.model.UnfiledRecordFolder in project records-management by Alfresco.
the class UnfiledRecordFolderChildrenRelation method readAll.
@Override
@WebApiDescription(title = "Return a paged list of unfiled container children for the container identified by 'unfiledContainerId'")
public CollectionWithPagingInfo<UnfiledRecordFolderChild> readAll(String unfileRecordFolderId, Parameters parameters) {
checkNotBlank("unfileRecordFolderId", unfileRecordFolderId);
mandatory("parameters", parameters);
String relativePath = parameters.getParameter(Nodes.PARAM_RELATIVE_PATH);
NodeRef parentNodeRef = apiUtils.lookupAndValidateNodeType(unfileRecordFolderId, RecordsManagementModel.TYPE_UNFILED_RECORD_FOLDER, relativePath, true);
// list unfiled record folders and records
Set<QName> searchTypeQNames = searchTypesFactory.buildSearchTypesForUnfiledEndpoint(parameters, LIST_UNFILED_RECORD_FOLDER_CHILDREN_EQUALS_QUERY_PROPERTIES);
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<UnfiledRecordFolderChild> nodes = new AbstractList<UnfiledRecordFolderChild>() {
@Override
public UnfiledRecordFolderChild get(int index) {
FileInfo info = page.get(index);
return nodesModelFactory.createUnfiledRecordFolderChild(info, parameters, mapUserInfo, true);
}
@Override
public int size() {
return page.size();
}
};
UnfiledRecordFolder sourceEntity = null;
if (parameters.includeSource()) {
FileInfo info = fileFolderService.getFileInfo(parentNodeRef);
sourceEntity = nodesModelFactory.createUnfiledRecordFolder(info, parameters, mapUserInfo, true);
}
return CollectionWithPagingInfo.asPaged(parameters.getPaging(), nodes, pagingResults.hasMoreItems(), pagingResults.getTotalResultCount().getFirst(), sourceEntity);
}
Aggregations