For IntelliJ IDEA,
Android Studio or Eclipse



@Override public List<PostInfo> getPage() { List<PostInfo> posts = new ArrayList<PostInfo>(); for (NodeBackedEntity node : results.getPage()) { NodeRef nodeRef = node.getNodeRef(); String name = node.getName(); posts.add(buildPost(nodeRef, topic, name, null)); } return posts; }
public CollectionWithPagingInfo<Tag> getTags(StoreRef storeRef, Paging paging) { PagingResults<Pair<NodeRef, String>> results = taggingService.getTags(storeRef, Util.getPagingRequest(paging)); Integer totalItems = results.getTotalResultCount().getFirst(); List<Pair<NodeRef, String>> page = results.getPage(); List<Tag> tags = new ArrayList<Tag>(page.size()); for(Pair<NodeRef, String> pair : page) { tags.add(new Tag(pair.getFirst(), pair.getSecond())); } return CollectionWithPagingInfo.asPaged(paging, tags, results.hasMoreItems(), (totalItems == null ? null : totalItems.intValue())); }
/** * {@inheritDoc} */ // see getAuthorities (paged) public Set<String> getAllAuthorities(AuthorityType type) { List<String> auths = getAuthorities(type, null, null, false, false, new PagingRequest(0, Integer.MAX_VALUE, null)).getPage(); Set<String> authorities = new HashSet<String>(auths.size()); authorities.addAll(auths); return authorities; }
private List<NodeRef> filterByAssocTypeAndCheck(NodeRef parentNodeRef, Set<QName> assocTypeQNames, Set<QName> childTypeQNames) { PagingResults<NodeRef> results = list(parentNodeRef, -1, -1, 0, assocTypeQNames, childTypeQNames, null, null, null, null); assertTrue(results.getPage().size() > 0); List<NodeRef> childNodeRefs = results.getPage(); return childNodeRefs; }
/** * Returns information regarding the top level containers for site 'siteId'. * */ @Override @WebApiDescription(title = "A paged list of site containers.") public CollectionWithPagingInfo<SiteContainer> readAll(String siteId, Parameters parameters) { PagingResults<SiteContainer> siteContainers = sites.getSiteContainers(siteId, parameters.getPaging()); return CollectionWithPagingInfo.asPaged(parameters.getPaging(), siteContainers.getPage(), siteContainers.hasMoreItems(), siteContainers.getTotalResultCount().getFirst()); } }
public void testALF12758() { // test that the FileFolderService returns only cm:contains children PagingRequest pagingRequest = new PagingRequest(0, Integer.MAX_VALUE); PagingResults<FileInfo> pagingResults = fileFolderService.list(workingRootNodeRef1, true, true, null, null, null, pagingRequest); assertNotNull(pagingResults); assertNotNull(pagingResults.getPage()); assertEquals(1, pagingResults.getPage().size()); }
@Override public List<SiteContainer> doWork() throws Exception { PagingResults<FileInfo> results = siteService.listContainers(siteId, new PagingRequest(0, Integer.MAX_VALUE)); List<SiteContainer> ret = new ArrayList<SiteContainer>(results.getPage().size()); for(FileInfo fileInfo : results.getPage()) { SiteContainer siteContainer = new SiteContainer(siteId, fileInfo.getName(), fileInfo.getNodeRef().getId()); ret.add(siteContainer); } return ret; } }, runAs.getId(), getId());
public Set<String> getAllAuthoritiesInZone(String zoneName, AuthorityType type) { NodeRef zoneRef = getZone(zoneName); if (zoneRef == null) { return Collections.emptySet(); } return new HashSet<String>(getAuthoritiesImpl(type, zoneRef, null, null, false, new PagingRequest(0, Integer.MAX_VALUE, null), new PagingResultsString()).getPage()); }
protected List<FileInfo> getFolders(NodeRef parent, String pattern) { PagingResults<FileInfo> page = fileFolderService.list(parent, false, true, pattern, null, null, new PagingRequest(CannedQueryPageDetails.DEFAULT_PAGE_SIZE)); List<FileInfo> folders = page.getPage(); return folders; }
public void testSetup() throws Exception { NodeRef parentNodeRef = getOrCreateParentTestFolder("GetChildrenCannedQueryTest-"+TEST_RUN_ID); PagingResults<NodeRef> results = list(parentNodeRef, -1, -1, 0); assertTrue(results.getPage().size() > 3); }
protected Map<String, Object> renderTopics(PagingResults<TopicInfo> topics, PagingRequest paging, SiteInfo site) { return renderTopics(topics.getPage(), topics.getTotalResultCount(), paging, site); } /*
/** * Returns the list of authorities according the authority type and authority short name * @param type authority type * @param shortName authority short name * @return List of String authorities */ private List<String> getAuthorityByTypeAndShortName(AuthorityType type, String shortName) { return pubAuthorityService.getAuthorities(type, null, shortName, false, true, new PagingRequest(0, Integer.MAX_VALUE, null)).getPage(); }
protected List<FileInfo> getFiles(NodeRef parent, String pattern) { PagingResults<FileInfo> page = fileFolderService.list(parent, true, false, pattern, null, null, new PagingRequest(CannedQueryPageDetails.DEFAULT_PAGE_SIZE)); List<FileInfo> files = page.getPage(); return files; }
@Override public List<LinkInfo> getPage() { List<LinkInfo> links = new ArrayList<LinkInfo>(); for (NodeBackedEntity node : results.getPage()) { NodeRef nodeRef = node.getNodeRef(); String name = node.getName(); links.add(buildLink(nodeRef, container, name)); } return links; }
private List<String> getAllAuthorities(AuthorityType type) { return pubAuthorityService.getAuthorities(type, null, null, false, true, new PagingRequest(0, Integer.MAX_VALUE, null)).getPage(); } }