本文整理汇总了Java中org.alfresco.query.PagingResults类的典型用法代码示例。如果您正苦于以下问题:Java PagingResults类的具体用法?Java PagingResults怎么用?Java PagingResults使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PagingResults类属于org.alfresco.query包,在下文中一共展示了PagingResults类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: listHotTopics
import org.alfresco.query.PagingResults; //导入依赖的package包/类
@Override
public PagingResults<Pair<TopicInfo, Integer>> listHotTopics(
NodeRef nodeRef, Date since, PagingRequest paging)
{
// Do the query
GetDiscussionTopcisWithPostsCannedQueryFactory getCQFactory =
(GetDiscussionTopcisWithPostsCannedQueryFactory)cannedQueryRegistry.getNamedObject(CANNED_QUERY_GET_TOPICS_WITH_POSTS);
GetDiscussionTopcisWithPostsCannedQuery cq = (GetDiscussionTopcisWithPostsCannedQuery)getCQFactory.getCannedQuery(
nodeRef, null, since, true, null, paging);
// Execute the canned query
CannedQueryResults<NodeWithChildrenEntity> results = cq.execute();
// Wrap and return
return wrapWithCount(results, nodeRef);
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:17,代码来源:DiscussionServiceImpl.java
示例2: getFavouriteSites
import org.alfresco.query.PagingResults; //导入依赖的package包/类
public CollectionWithPagingInfo<FavouriteSite> getFavouriteSites(String personId, Parameters parameters)
{
personId = people.validatePerson(personId);
Paging paging = parameters.getPaging();
BeanPropertiesFilter filter = parameters.getFilter();
PagingResults<SiteInfo> favouriteSites = getFavouriteSites(personId, Util.getPagingRequest(paging));
List<FavouriteSite> favourites = new ArrayList<FavouriteSite>(favouriteSites.getPage().size());
for(SiteInfo favouriteSite : favouriteSites.getPage())
{
String role = null;
if(filter.isAllowed(Site.ROLE))
{
role = getSiteRole(favouriteSite.getShortName(), personId);
}
FavouriteSite favourite = new FavouriteSite(favouriteSite, role);
favourites.add(favourite);
}
return CollectionWithPagingInfo.asPaged(paging, favourites, favouriteSites.hasMoreItems(), favouriteSites.getTotalResultCount().getFirst());
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:23,代码来源:SitesImpl.java
示例3: testMaxItems
import org.alfresco.query.PagingResults; //导入依赖的package包/类
public void testMaxItems() throws Exception
{
NodeRef parentNodeRef = getOrCreateParentTestFolder("GetChildrenCannedQueryTest-"+TEST_RUN_ID);
PagingResults<NodeRef> results = list(parentNodeRef, -1, -1, 0);
assertFalse(results.hasMoreItems());
int totalCnt = results.getPage().size();
assertTrue(totalCnt > 3);
for (int i = 1; i <= totalCnt; i++)
{
results = list(parentNodeRef, 0, i, 0);
assertEquals(results.getPage().size(), i);
boolean hasMore = results.hasMoreItems();
assertTrue(hasMore == (i != totalCnt));
if (logger.isInfoEnabled())
{
logger.info("testSimpleMaxItems: [itemCnt="+i+",hasMore="+hasMore+"]");
}
}
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:25,代码来源:GetChildrenCannedQueryTest.java
示例4: list
import org.alfresco.query.PagingResults; //导入依赖的package包/类
@Auditable(parameters = {"contextNodeRef", "files", "folders", "ignoreQNames", "sortProps", "pagingRequest"})
@Override
@Extend(traitAPI = FileFolderServiceTrait.class, extensionAPI = FileFolderServiceExtension.class)
public PagingResults<FileInfo> list(NodeRef contextNodeRef,
boolean files,
boolean folders,
Set<QName> ignoreQNames,
List<Pair<QName, Boolean>> sortProps,
PagingRequest pagingRequest)
{
ParameterCheck.mandatory("contextNodeRef", contextNodeRef);
ParameterCheck.mandatory("pagingRequest", pagingRequest);
Pair<Set<QName>,Set<QName>> pair = buildSearchTypesAndIgnoreAspects(files, folders, ignoreQNames);
Set<QName> searchTypeQNames = pair.getFirst();
Set<QName> ignoreAspectQNames = pair.getSecond();
// execute query
final CannedQueryResults<NodeRef> results = listImpl(contextNodeRef, null, searchTypeQNames, ignoreAspectQNames, sortProps, pagingRequest);
return getPagingResults(pagingRequest, results);
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:22,代码来源:FileFolderServiceImpl.java
示例5: getCustomModels
import org.alfresco.query.PagingResults; //导入依赖的package包/类
@Override
public CollectionWithPagingInfo<CustomModel> getCustomModels(Parameters parameters)
{
Paging paging = parameters.getPaging();
PagingRequest pagingRequest = Util.getPagingRequest(paging);
PagingResults<CustomModelDefinition> results = customModelService.getCustomModels(pagingRequest);
Integer totalItems = results.getTotalResultCount().getFirst();
List<CustomModelDefinition> page = results.getPage();
List<CustomModel> models = new ArrayList<>(page.size());
for (CustomModelDefinition modelDefinition : page)
{
models.add(new CustomModel(modelDefinition));
}
return CollectionWithPagingInfo.asPaged(paging, models, results.hasMoreItems(), (totalItems == null ? null : totalItems.intValue()));
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:19,代码来源:CustomModelsImpl.java
示例6: getAuthoritiesInfo
import org.alfresco.query.PagingResults; //导入依赖的package包/类
private PagingResults<AuthorityInfo> getAuthoritiesInfo(AuthorityType authorityType, String groupId, Pair<String, Boolean> sortProp, Paging paging)
{
Set<String> authorities;
try
{
authorities = authorityService.findAuthorities(authorityType, groupId, true, null, null);
}
catch (UnknownAuthorityException e)
{
authorities = Collections.emptySet();
}
List<AuthorityInfo> authorityInfoList = new ArrayList<>(authorities.size());
authorityInfoList.addAll(authorities.stream().map(this::getAuthorityInfo).collect(Collectors.toList()));
// Post process sorting - this should be moved to service
// layer. It is done here because sorting is not supported at
// service layer.
AuthorityInfoComparator authorityComparator = new AuthorityInfoComparator(sortProp.getFirst(), sortProp.getSecond());
Collections.sort(authorityInfoList, authorityComparator);
// Post process paging - this should be moved to service layer.
return Util.wrapPagingResults(paging, authorityInfoList);
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:25,代码来源:GroupsImpl.java
示例7: getFavouriteSites
import org.alfresco.query.PagingResults; //导入依赖的package包/类
public List<FavouriteSite> getFavouriteSites(TestPerson user)
{
List<FavouriteSite> favouriteSites = new ArrayList<FavouriteSite>();
PagingResults<SiteInfo> pagingResults = getFavouriteSites(user.getId(), new PagingRequest(0, Integer.MAX_VALUE));
for(SiteInfo siteInfo : pagingResults.getPage())
{
String siteId = siteInfo.getShortName();
String siteGuid = siteInfo.getNodeRef().getId();
TestSite site = user.getDefaultAccount().getSite(siteId);
FavouriteSite favouriteSite = null;
if(site.isMember(user.getId()))
{
favouriteSite = new FavouriteSite(site);
}
else
{
favouriteSite = new FavouriteSite(null, siteId, siteGuid, null, null, null, null, null);
}
favouriteSites.add(favouriteSite);
}
return favouriteSites;
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:26,代码来源:RepoService.java
示例8: list
import org.alfresco.query.PagingResults; //导入依赖的package包/类
@Override
public PagingResults<Reference> list(Reference ref, boolean actual, boolean virtual, boolean files,
boolean folders, String pattern, Set<QName> ignoreTypeQNames, Set<QName> ignoreAspectQNames,
List<Pair<QName, Boolean>> sortProps, PagingRequest pagingRequest) throws VirtualizationException
{
return list(ref,
actual,
virtual,
files,
folders,
pattern,
Collections.<QName> emptySet(),
ignoreTypeQNames,
ignoreAspectQNames,
sortProps,
pagingRequest);
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:18,代码来源:VirtualStoreImpl.java
示例9: listLinks
import org.alfresco.query.PagingResults; //导入依赖的package包/类
private PagingResults<LinkInfo> listLinks(String siteShortName, String user,
Date from, Date to, PagingRequest paging)
{
NodeRef container = getSiteLinksContainer(siteShortName, false);
if (container == null)
{
// No events
return new EmptyPagingResults<LinkInfo>();
}
// Run the canned query
GetChildrenAuditableCannedQueryFactory getChildrenCannedQueryFactory =
(GetChildrenAuditableCannedQueryFactory)cannedQueryRegistry.getNamedObject(CANNED_QUERY_GET_CHILDREN);
GetChildrenAuditableCannedQuery cq = (GetChildrenAuditableCannedQuery)getChildrenCannedQueryFactory.getCannedQuery(
container, LinksModel.TYPE_LINK, user, from, to, null, null, null,
getChildrenCannedQueryFactory.createDateDescendingCQSortDetails(), paging);
// Execute the canned query
CannedQueryResults<NodeBackedEntity> results = cq.execute();
// Convert to Link objects
return wrap(results, container);
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:24,代码来源:LinksServiceImpl.java
示例10: getCopies
import org.alfresco.query.PagingResults; //导入依赖的package包/类
@Override
public List<NodeRef> getCopies(NodeRef nodeRef)
{
PagingRequest pagingRequest = new PagingRequest(1000);
PagingResults<CopyInfo> page = getCopies(nodeRef, pagingRequest);
if (page.hasMoreItems())
{
logger.warn("Trimmed page size for deprecated getCopies() call.");
}
List<CopyInfo> pageResults = page.getPage();
List<NodeRef> results = new ArrayList<NodeRef>(pageResults.size());
for (CopyInfo copyInfo : pageResults)
{
results.add(copyInfo.getNodeRef());
}
return results;
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:18,代码来源:CopyServiceImpl.java
示例11: getCustomModels
import org.alfresco.query.PagingResults; //导入依赖的package包/类
@Override
public PagingResults<CustomModelDefinition> getCustomModels(PagingRequest pagingRequest)
{
ParameterCheck.mandatory("pagingRequest", pagingRequest);
List<CustomModelDefinition> result = getAllCustomModels();
return result.isEmpty() ? new EmptyPagingResults<CustomModelDefinition>() : wrapResult(pagingRequest, result);
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:9,代码来源:CustomModelServiceImpl.java
示例12: assertCollate
import org.alfresco.query.PagingResults; //导入依赖的package包/类
public void assertCollate(List<Integer> results, Integer[] source, int skip, int pageSize, boolean boundsError)
throws Exception
{
Arrays.sort(source);
Collections.sort(results);
int[] expected = createMergedPage(skip,
pageSize,
results,
source);
PagingResults<Integer> actualResults = new PageCollator<Integer>().collate(results,
new ArrayPageSource(source),
new PagingRequest(skip,
pageSize),
new ComparableComparator<Integer>());
List<Integer> actualPage = actualResults.getPage();
final String message = "[" + results + " + " + Arrays.toString(source) + " ] -> " + Arrays.toString(expected)
+ " != " + actualPage;
assertEqualPages(message,
expected,
actualPage);
assertEquals("Invalid moreItems info!",
(pageSize != 0) && (skip + pageSize < results.size() + source.length),
actualResults.hasMoreItems());
assertTrue(message,
(pageSize == 0) || actualPage.size() <= pageSize);
final int expectedTotal = source.length + results.size();
if (boundsError && !new Pair<Integer, Integer>(null,
null).equals(actualResults.getTotalResultCount()))
{
assertEquals("Invalid total info",
new Pair<Integer, Integer>(expectedTotal,
expectedTotal),
actualResults.getTotalResultCount());
}
logger.info(actualPage);
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:38,代码来源:PageCollatorTest.java
示例13: getAuthorities
import org.alfresco.query.PagingResults; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public PagingResults<String> getAuthorities(AuthorityType type, String zoneName, String displayNameFilter, boolean sortByDisplayName, boolean sortAscending, PagingRequest pagingRequest)
{
ParameterCheck.mandatory("pagingRequest", pagingRequest);
if ((type == null) && (zoneName == null))
{
throw new IllegalArgumentException("Type and/or zoneName required - both cannot be null");
}
if (type != null)
{
switch (type)
{
case USER:
case GROUP:
case ROLE:
return authorityDAO.getAuthorities(type, zoneName, displayNameFilter, sortByDisplayName, sortAscending, pagingRequest);
case ADMIN:
case EVERYONE:
case GUEST:
case OWNER:
default:
// others
return getOtherAuthorities(type); // either singletons or empty - hence ignore zone/filter/sort/paging
}
}
// type is null
return authorityDAO.getAuthorities(type, zoneName, displayNameFilter, sortByDisplayName, sortAscending, pagingRequest);
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:33,代码来源:AuthorityServiceImpl.java
示例14: list
import org.alfresco.query.PagingResults; //导入依赖的package包/类
private PagingResults<NodeRef> list(NodeRef parentNodeRef, final int skipCount, final int maxItems, final int requestTotalCountMax, String pattern, List<Pair<QName, Boolean>> sortProps)
{
PagingRequest pagingRequest = new PagingRequest(skipCount, maxItems, null);
pagingRequest.setRequestTotalCountMax(requestTotalCountMax);
// get canned query
GetChildrenCannedQueryFactory getChildrenCannedQueryFactory = (GetChildrenCannedQueryFactory)cannedQueryRegistry.getNamedObject(CQ_FACTORY_NAME);
final GetChildrenCannedQuery cq = (GetChildrenCannedQuery)getChildrenCannedQueryFactory.getCannedQuery(parentNodeRef, pattern, null, null, null, null, null, sortProps, pagingRequest);
// execute canned query
RetryingTransactionCallback<CannedQueryResults<NodeRef>> callback = new RetryingTransactionCallback<CannedQueryResults<NodeRef>>()
{
@Override
public CannedQueryResults<NodeRef> execute() throws Throwable
{
return cq.execute();
}
};
CannedQueryResults<NodeRef> results = transactionService.getRetryingTransactionHelper().doInTransaction(callback, true);
List<NodeRef> nodeRefs = results.getPages().get(0);
Integer totalCount = null;
if (requestTotalCountMax > 0)
{
totalCount = results.getTotalResultCount().getFirst();
}
return new PagingNodeRefResultsImpl(nodeRefs, results.hasMoreItems(), totalCount, false);
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:31,代码来源:GetChildrenCannedQueryTest.java
示例15: testListWithIgnores
import org.alfresco.query.PagingResults; //导入依赖的package包/类
@Test
public void testListWithIgnores() throws Exception
{
NodeRef vf = createVirtualizedFolder(testRootFolder.getNodeRef(),
"TestVirtualFileFolderService_testVirtualFolderVirtualChild",
TEST_TEMPLATE_3_JSON_SYS_PATH);
NodeRef node2 = nodeService.getChildByName(vf,
ContentModel.ASSOC_CHILDREN,
"Node2");
final String contentName = "ContentVirtualChild";
NodeRef contentNodeRef = createContent(node2,
contentName).getChildRef();
CheckOutCheckInService checkOutCheckInService = ctx.getBean("checkOutCheckInService",
CheckOutCheckInService.class);
checkOutCheckInService.checkout(contentNodeRef);
Set<QName> searchTypeQNames = Collections.emptySet();
Set<QName> ignoreAspectQNames = Collections.singleton(ContentModel.ASPECT_CHECKED_OUT);
List<Pair<QName, Boolean>> sortProps = Collections.<Pair<QName, Boolean>> emptyList();
PagingRequest pagingRequest = new PagingRequest(100);
PagingResults<FileInfo> node2List = fileAndFolderService.list(node2,
searchTypeQNames,
ignoreAspectQNames,
sortProps,
pagingRequest);
assertEquals(1,
node2List.getPage().size());
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:34,代码来源:VirtualFileFolderServiceExtensionTest.java
示例16: testPagedTags
import org.alfresco.query.PagingResults; //导入依赖的package包/类
@Test
@Category({RedundantTests.class,LuceneTests.class})
public void testPagedTags() throws UnsupportedEncodingException
{
authenticationComponent.setSystemUserAsCurrentUser();
Pair<List<String>, Integer> tags = taggingService.getPagedTags(storeRef, 1, 10);
assertNotNull(tags);
PagingResults<Pair<NodeRef, String>> res = taggingService.getTags(storeRef, new PagingRequest(10));
assertNotNull(res);
String guid = GUID.generate();
// Create a node
Map<QName, Serializable> docProps = new HashMap<QName, Serializable>(1);
String docName = "testDocument" + guid + ".txt";
docProps.put(ContentModel.PROP_NAME, docName);
NodeRef myDoc = nodeService.createNode(
folder,
ContentModel.ASSOC_CONTAINS,
QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, docName),
ContentModel.TYPE_CONTENT,
docProps).getChildRef();
taggingService.addTag(myDoc,"dog");
res = taggingService.getTags(myDoc, new PagingRequest(10));
assertNotNull(res);
assertTrue(res.getTotalResultCount().getFirst() == 1);
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:29,代码来源:TaggingServiceImplTest.java
示例17: executeImpl
import org.alfresco.query.PagingResults; //导入依赖的package包/类
@Override
protected Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache)
{
String currentUser = AuthenticationUtil.getFullyAuthenticatedUser();
// check the current user access rights
if (!siteService.isSiteAdmin(currentUser))
{
// Note: security, no message to indicate why
throw new WebScriptException(HttpServletResponse.SC_NOT_FOUND, "Resource not found.");
}
// Create paging
final ScriptPagingDetails paging = new ScriptPagingDetails(getIntParameter(req, MAX_ITEMS,
DEFAULT_MAX_ITEMS_PER_PAGE), getIntParameter(req, SKIP_COUNT, 0));
// request a total count of found items
paging.setRequestTotalCountMax(Integer.MAX_VALUE);
final List<FilterProp> filterProp = getFilterProperties(req.getParameter(NAME_FILTER));
final List<Pair<QName, Boolean>> sortProps = new ArrayList<Pair<QName, Boolean>>();
sortProps.add(new Pair<QName, Boolean>(ContentModel.PROP_NAME, true));
PagingResults<SiteInfo> pagingResults = AuthenticationUtil.runAs(
new AuthenticationUtil.RunAsWork<PagingResults<SiteInfo>>()
{
public PagingResults<SiteInfo> doWork() throws Exception
{
return siteService.listSites(filterProp, sortProps, paging);
}
}, AuthenticationUtil.getAdminUserName());
List<SiteInfo> result = pagingResults.getPage();
List<SiteState> sites = new ArrayList<SiteState>(result.size());
for (SiteInfo info : result)
{
sites.add(SiteState.create(info,
siteService.listMembers(info.getShortName(), null, SiteModel.SITE_MANAGER, 0), currentUser,
nodeService, personService));
}
Map<String, Object> sitesData = new HashMap<String, Object>(6);
// Site data
sitesData.put("items", sites);
// Paging data
sitesData.put("count", result.size());
sitesData.put("hasMoreItems", pagingResults.hasMoreItems());
sitesData.put("totalItems", (pagingResults.getTotalResultCount() == null ? -1 : pagingResults.getTotalResultCount().getFirst()));
sitesData.put("skipCount", paging.getSkipCount());
sitesData.put("maxItems", paging.getMaxItems());
// Create the model from the site and pagination data
Map<String, Object> model = new HashMap<String, Object>(1);
model.put("data", sitesData);
return model;
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:59,代码来源:SiteAdminSitesGet.java
示例18: listAllCredentials
import org.alfresco.query.PagingResults; //导入依赖的package包/类
@Override
public PagingResults<? extends BaseCredentialsInfo> listAllCredentials(String remoteSystem, QName credentialsType,
PagingRequest paging)
{
NodeRef personContainer = getPersonContainer(remoteSystem, false);
NodeRef systemContainer = getSharedContainer(remoteSystem, false);
if (personContainer == null && systemContainer == null)
{
return new EmptyPagingResults<BaseCredentialsInfo>();
}
return listCredentials(new NodeRef[] {personContainer, systemContainer}, remoteSystem, credentialsType, paging);
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:13,代码来源:RemoteCredentialsServiceImpl.java
示例19: listCalendarEntries
import org.alfresco.query.PagingResults; //导入依赖的package包/类
@Override
public PagingResults<CalendarEntry> listCalendarEntries(
String siteShortName, PagingRequest paging)
{
NodeRef container = getSiteCalendarContainer(siteShortName, false);
if (container == null)
{
// No events
return new EmptyPagingResults<CalendarEntry>();
}
// Build our sorting, by date
// Sort by start date, then end date, then created at for two events with matching times
List<Pair<QName,Boolean>> sort = new ArrayList<Pair<QName, Boolean>>();
sort.add(new Pair<QName, Boolean>(CalendarModel.PROP_FROM_DATE, true));
sort.add(new Pair<QName, Boolean>(CalendarModel.PROP_TO_DATE, true));
sort.add(new Pair<QName, Boolean>(ContentModel.PROP_CREATED, true));
// We only want calendar entries
Set<QName> types = new HashSet<QName>();
types.add(CalendarModel.TYPE_EVENT);
// Run the canned query
GetChildrenCannedQueryFactory getChildrenCannedQueryFactory = (GetChildrenCannedQueryFactory)cannedQueryRegistry.getNamedObject(CANNED_QUERY_GET_CHILDREN);
GetChildrenCannedQuery cq = (GetChildrenCannedQuery)getChildrenCannedQueryFactory.getCannedQuery(
container, null, null, types, null, sort, paging);
// Execute the canned query
CannedQueryResults<NodeRef> results = cq.execute();
return wrap(results, container);
}
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:32,代码来源:CalendarServiceImpl.java
示例20: getBlogResultsImpl
import org.alfresco.query.PagingResults; //导入依赖的package包/类
@Override
protected PagingResults<BlogPostInfo> getBlogResultsImpl(
SiteInfo site, NodeRef node, Date fromDate, Date toDate, PagingRequest pagingReq)
{
if(site != null)
{
return blogService.getPublished(site.getShortName(), fromDate, toDate, null, pagingReq);
}
else
{
return blogService.getPublished(node, fromDate, toDate, null, pagingReq);
}
}
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:14,代码来源:BlogPostsNewGet.java
注:本文中的org.alfresco.query.PagingResults类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论