use of org.alfresco.rm.rest.api.model.FilePlan in project records-management by Alfresco.
the class ApiNodesModelFactory method createFilePlan.
/**
* Creates an object of type FilePlan
*
* @param info info of the file plan
* @param propertyFilter
* @param includeParam
* @param mapUserInfo
* @param isMinimalInfo
* @return FilePlan object
*/
public FilePlan createFilePlan(FileInfo info, Parameters parameters, Map<String, UserInfo> mapUserInfo, boolean isMinimalInfo) {
FilePlan filePlan = new FilePlan();
mapBasicInfo(filePlan, info, parameters.getFilter(), mapUserInfo, isMinimalInfo);
mapOptionalInfo(filePlan, info, parameters.getInclude(), isMinimalInfo);
return filePlan;
}
use of org.alfresco.rm.rest.api.model.FilePlan in project records-management by Alfresco.
the class FilePlanChildrenRelation method readAll.
@Override
@WebApiDescription(title = "Return a paged list of file plan children (record categories) for the container identified by 'filePlanId'")
public CollectionWithPagingInfo<RecordCategory> readAll(String filePlanId, Parameters parameters) {
// validate parameters
checkNotBlank("filePlanId", filePlanId);
mandatory("parameters", parameters);
QName filePlanType = apiUtils.getFilePlanType();
if (// rm site not created
filePlanType == null) {
throw new EntityNotFoundException(filePlanId);
}
NodeRef parentNodeRef = apiUtils.lookupAndValidateNodeType(filePlanId, filePlanType);
// list record categories
Set<QName> searchTypeQNames = searchTypesFactory.buildSearchTypesForFilePlanEndpoint();
// FIXME this param null
List<FilterProp> filterProps = apiUtils.getListChildrenFilterProps(parameters, null);
final PagingResults<FileInfo> pagingResults = fileFolderService.list(parentNodeRef, null, searchTypeQNames, null, apiUtils.getSortProperties(parameters), filterProps, Util.getPagingRequest(parameters.getPaging()));
final List<FileInfo> page = pagingResults.getPage();
Map<String, UserInfo> mapUserInfo = new HashMap<>();
List<RecordCategory> nodes = new AbstractList<RecordCategory>() {
@Override
public RecordCategory get(int index) {
FileInfo info = page.get(index);
return nodesModelFactory.createRecordCategory(info, parameters, mapUserInfo, true);
}
@Override
public int size() {
return page.size();
}
};
FilePlan sourceEntity = null;
if (parameters.includeSource()) {
FileInfo info = fileFolderService.getFileInfo(parentNodeRef);
sourceEntity = nodesModelFactory.createFilePlan(info, parameters, mapUserInfo, true);
}
return CollectionWithPagingInfo.asPaged(parameters.getPaging(), nodes, pagingResults.hasMoreItems(), pagingResults.getTotalResultCount().getFirst(), sourceEntity);
}
Aggregations