use of org.alfresco.repo.node.getchildren.FilterProp in project alfresco-remote-api by Alfresco.
the class SiteAdminSitesGet method getFilterProperties.
private List<FilterProp> getFilterProperties(String filter) {
if (filter == null || filter.isEmpty() || filter.equals("*")) {
return null;
}
List<FilterProp> filterProps = new ArrayList<FilterProp>();
filterProps.add(new FilterPropString(ContentModel.PROP_NAME, filter, FilterTypeString.STARTSWITH_IGNORECASE));
filterProps.add(new FilterPropString(ContentModel.PROP_TITLE, filter, FilterTypeString.STARTSWITH_IGNORECASE));
return filterProps;
}
use of org.alfresco.repo.node.getchildren.FilterProp 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