GetCalendarEntriesCannedQueryFactory cqFactory = (GetCalendarEntriesCannedQueryFactory)cannedQueryRegistry.getNamedObject(CANNED_QUERY_GET_ENTRIES); GetCalendarEntriesCannedQuery cq = (GetCalendarEntriesCannedQuery)cqFactory.getCannedQuery( containers, from, to, paging);
/** * Constructor that takes care of {@link #setStorageType(Class)}. * * @see #setStorageType(Class) */ public NamedObjectRegistry(Class<T> type) { this(); setStorageType(type); }
/** * Registers the instance */ public void afterPropertiesSet() throws Exception { PropertyCheck.mandatory(this, "name", name); PropertyCheck.mandatory(this, "registry", registry); registry.register(name, this); }
@SuppressWarnings({ "rawtypes", "unchecked" }) @Override public void setUp() throws Exception { // Create the registry namedQueryFactoryRegistry = new NamedObjectRegistry<CannedQueryFactory>(); namedQueryFactoryRegistry.setStorageType(CannedQueryFactory.class); namedQueryFactoryRegistry.setNamePattern("test\\.query\\..*"); // Registry the query factories // ONE TestCannedQueryFactory<String> namedQueryFactoryOne = new TestCannedQueryFactory(RESULTS_ONE); namedQueryFactoryOne.setBeanName(QUERY_TEST_ONE); namedQueryFactoryOne.setRegistry(namedQueryFactoryRegistry); namedQueryFactoryOne.afterPropertiesSet(); // TWO TestCannedQueryFactory<Long> namedQueryFactoryTwo = new TestCannedQueryFactory(RESULTS_TWO); namedQueryFactoryTwo.setBeanName(QUERY_TEST_TWO); namedQueryFactoryTwo.setRegistry(namedQueryFactoryRegistry); namedQueryFactoryTwo.afterPropertiesSet(); }
tenantService = (TenantService) ctx.getBean("tenantService"); cannedQueryRegistry = new NamedObjectRegistry<CannedQueryFactory>(); cannedQueryRegistry.setStorageType(CannedQueryFactory.class);
@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); }
/** * Registers the instance */ public void afterPropertiesSet() throws Exception { PropertyCheck.mandatory(this, "name", name); PropertyCheck.mandatory(this, "registry", registry); registry.register(name, this); }
/** * Constructor that takes care of {@link #setStorageType(Class)}. * * @see #setStorageType(Class) */ public NamedObjectRegistry(Class<T> type) { this(); setStorageType(type); }
@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); }
/** * Registers the instance */ public void afterPropertiesSet() throws Exception { PropertyCheck.mandatory(this, "name", name); PropertyCheck.mandatory(this, "registry", registry); registry.register(name, this); }
GetCalendarEntriesCannedQueryFactory cqFactory = (GetCalendarEntriesCannedQueryFactory)cannedQueryRegistry.getNamedObject(CANNED_QUERY_GET_ENTRIES); GetCalendarEntriesCannedQuery cq = (GetCalendarEntriesCannedQuery)cqFactory.getCannedQuery( containers, from, to, paging);
/** * Registers the instance */ public void afterPropertiesSet() throws Exception { PropertyCheck.mandatory(this, "name", name); PropertyCheck.mandatory(this, "registry", registry); registry.register(name, this); }
/** * Get all the downloads created before before. */ public List<List<DownloadEntity>> getDownloadsCreatedBefore(Date before) { NodeRef container = getContainer(); if (container == null) { return Collections.emptyList(); } // Grab the factory GetDownloadsCannedQueryFactory getDownloadCannedQueryFactory = (GetDownloadsCannedQueryFactory)queryRegistry.getNamedObject("downloadGetDownloadsCannedQueryFactory"); // Run the canned query GetDownloadsCannedQuery cq = (GetDownloadsCannedQuery)getDownloadCannedQueryFactory.getDownloadsCannedQuery(container, before); // Execute the canned query CannedQueryResults<DownloadEntity> results = cq.execute(); return results.getPages(); }
/** * Registers the instance */ public void afterPropertiesSet() throws Exception { PropertyCheck.mandatory(this, "name", name); PropertyCheck.mandatory(this, "registry", registry); registry.register(name, this); }
GetAuthoritiesCannedQueryFactory getAuthoritiesCannedQueryFactory = (GetAuthoritiesCannedQueryFactory)cannedQueryRegistry.getNamedObject(CANNED_QUERY_AUTHS_LIST); CannedQuery<AuthorityInfo> cq = getAuthoritiesCannedQueryFactory.getCannedQuery(type, containerRef, displayNameFilter, sortBy, sortAscending, pagingRequest);
/** * Registers the instance */ public void afterPropertiesSet() throws Exception { PropertyCheck.mandatory(this, "name", name); PropertyCheck.mandatory(this, "registry", registry); registry.register(name, this); }
/** * Get all the downloads created before before. */ public List<List<DownloadEntity>> getDownloadsCreatedBefore(Date before) { NodeRef container = getContainer(); if (container == null) { return Collections.emptyList(); } // Grab the factory GetDownloadsCannedQueryFactory getDownloadCannedQueryFactory = (GetDownloadsCannedQueryFactory)queryRegistry.getNamedObject("downloadGetDownloadsCannedQueryFactory"); // Run the canned query GetDownloadsCannedQuery cq = (GetDownloadsCannedQuery)getDownloadCannedQueryFactory.getDownloadsCannedQuery(container, before); // Execute the canned query CannedQueryResults<DownloadEntity> results = cq.execute(); return results.getPages(); }
GetChildrenCannedQueryFactory getChildrenCannedQueryFactory = (GetChildrenCannedQueryFactory)cannedQueryRegistry.getNamedObject(CANNED_QUERY_GET_CHILDREN); GetChildrenCannedQuery cq = (GetChildrenCannedQuery)getChildrenCannedQueryFactory.getCannedQuery( container, null, null, types, null, sort, paging);
GetAuthoritiesCannedQueryFactory getAuthoritiesCannedQueryFactory = (GetAuthoritiesCannedQueryFactory)cannedQueryRegistry.getNamedObject(CANNED_QUERY_AUTHS_LIST); CannedQuery<AuthorityInfo> cq = getAuthoritiesCannedQueryFactory.getCannedQuery(type, containerRef, displayNameFilter, sortBy, sortAscending, pagingRequest);
GetChildrenCannedQueryFactory getChildrenCannedQueryFactory = (GetChildrenCannedQueryFactory)cannedQueryRegistry.getNamedObject(CANNED_QUERY_GET_CHILDREN); GetChildrenCannedQuery cq = (GetChildrenCannedQuery)getChildrenCannedQueryFactory.getCannedQuery( container, null, null, types, null, sort, paging);