use of org.alfresco.rm.rest.api.model.RecordFolder in project records-management by Alfresco.
the class ApiNodesModelFactory method createRecordFolder.
/**
* Creates an object of type RecordCategory
*
* @param info
* @param propertyFilter
* @param includeParam
* @param mapUserInfo
* @param isMinimalInfo
* @return RecordCategory object
*/
public RecordFolder createRecordFolder(FileInfo info, Parameters parameters, Map<String, UserInfo> mapUserInfo, boolean isMinimalInfo) {
RecordFolder recordFolder = new RecordFolder();
mapBasicInfo(recordFolder, info, parameters.getFilter(), mapUserInfo, isMinimalInfo);
mapOptionalInfo(recordFolder, info, parameters.getInclude(), isMinimalInfo);
if (parameters.getInclude().contains(RMNode.PARAM_IS_CLOSED)) {
recordFolder.setIsClosed((Boolean) nodeService.getProperty(info.getNodeRef(), RecordsManagementModel.PROP_IS_CLOSED));
}
return recordFolder;
}
use of org.alfresco.rm.rest.api.model.RecordFolder in project records-management by Alfresco.
the class RecordFolderChildrenRelation method readAll.
@Override
@WebApiDescription(title = "Return a paged list of records for the record folder identified by 'recordFolderId'")
public CollectionWithPagingInfo<Record> readAll(String recordFolderId, Parameters parameters) {
checkNotBlank("recordFolderId", recordFolderId);
mandatory("parameters", parameters);
NodeRef parentNodeRef = apiUtils.lookupAndValidateNodeType(recordFolderId, RecordsManagementModel.TYPE_RECORD_FOLDER);
// list record folders
// FIXME searchParam
Set<QName> searchTypeQNames = searchTypesFactory.buildSearchTypesForUnfiledEndpoint(parameters, null);
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<Record> nodes = new AbstractList<Record>() {
@Override
public Record get(int index) {
FileInfo info = page.get(index);
return nodesModelFactory.createRecord(info, parameters, mapUserInfo, true);
}
@Override
public int size() {
return page.size();
}
};
RecordFolder sourceEntity = null;
if (parameters.includeSource()) {
FileInfo info = fileFolderService.getFileInfo(parentNodeRef);
sourceEntity = nodesModelFactory.createRecordFolder(info, parameters, mapUserInfo, true);
}
return CollectionWithPagingInfo.asPaged(parameters.getPaging(), nodes, pagingResults.hasMoreItems(), pagingResults.getTotalResultCount().getFirst(), sourceEntity);
}
Aggregations