Index: kernel-impl/src/test/java/org/sakaiproject/site/impl/SiteServiceTest.java =================================================================== --- kernel-impl/src/test/java/org/sakaiproject/site/impl/SiteServiceTest.java (revision 130211) +++ kernel-impl/src/test/java/org/sakaiproject/site/impl/SiteServiceTest.java (revision 130212) @@ -21,6 +21,7 @@ package org.sakaiproject.site.impl; +import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Set; @@ -161,4 +162,11 @@ // TODO Auto-generated method stub return null; } + + @Override + public List getSiteIds(SelectionType type, Object ofType, String criteria, Map propertyCriteria, SortType sort, + PagingPosition page) { + return new ArrayList(0); + } + } \ No newline at end of file Index: kernel-impl/src/main/java/org/sakaiproject/site/impl/BaseSiteService.java =================================================================== --- kernel-impl/src/main/java/org/sakaiproject/site/impl/BaseSiteService.java (revision 130211) +++ kernel-impl/src/main/java/org/sakaiproject/site/impl/BaseSiteService.java (revision 130212) @@ -80,6 +80,8 @@ import org.sakaiproject.site.api.SitePage; import org.sakaiproject.site.api.SiteService; import org.sakaiproject.site.api.ToolConfiguration; +import org.sakaiproject.site.api.SiteService.SelectionType; +import org.sakaiproject.site.api.SiteService.SortType; import org.sakaiproject.thread_local.api.ThreadLocalManager; import org.sakaiproject.time.api.Time; import org.sakaiproject.time.api.TimeService; @@ -1924,6 +1926,13 @@ return storage().getSites(type, ofType, criteria, propertyCriteria, sort, page, requireDescription); } + /* (non-Javadoc) + * @see org.sakaiproject.site.api.SiteService#getSiteIds(org.sakaiproject.site.api.SiteService.SelectionType, java.lang.Object, java.lang.String, java.util.Map, org.sakaiproject.site.api.SiteService.SortType, org.sakaiproject.javax.PagingPosition) + */ + public List getSiteIds(SelectionType type, Object ofType, String criteria, Map propertyCriteria, SortType sort, PagingPosition page) { + return storage().getSiteIds(type, ofType, criteria, propertyCriteria, sort, page); + } + /** * @inheritDoc */ @@ -2720,6 +2729,28 @@ PagingPosition page, boolean requireDescription); /** + * Get the Site IDs for all sites matching criteria. + * This is useful when you only need the listing of site ids (for other operations) and do not need the actual Site objects. + * + * All parameters are the same as {@link #getSites(org.sakaiproject.site.api.SiteService.SelectionType, Object, String, Map, org.sakaiproject.site.api.SiteService.SortType, PagingPosition)} + * + * @param type + * The SelectionType specifying what sort of selection is intended. + * @param ofType + * Site type criteria: null for any type; a String to match a single type; A String[], List or Set to match any type in the collection. + * @param criteria + * Additional selection criteria: sites returned will match this string somewhere in their id, title, description, or skin. + * @param propertyCriteria + * Additional selection criteria: sites returned will have a property named to match each key in the map, whose values match (somewhere in their value) the value in the map (may be null or empty). + * @param sort + * A SortType indicating the desired sort. For no sort, set to SortType.NONE. + * @param page + * The PagePosition subset of items to return. + * @return a List of the Site IDs for the sites matching the criteria. + */ + List getSiteIds(SelectionType type, Object ofType, String criteria, Map propertyCriteria, SortType sort, PagingPosition page); + + /** * Count the Site objets that meet specified criteria. * * @param type Index: kernel-impl/src/main/java/org/sakaiproject/site/impl/DbSiteService.java =================================================================== --- kernel-impl/src/main/java/org/sakaiproject/site/impl/DbSiteService.java (revision 130211) +++ kernel-impl/src/main/java/org/sakaiproject/site/impl/DbSiteService.java (revision 130212) @@ -951,13 +951,9 @@ } /** - * Get the Site IDs for all sites matching criteria. - * - * All parameters are the same as {@link #getSites(org.sakaiproject.site.api.SiteService.SelectionType, Object, String, Map, org.sakaiproject.site.api.SiteService.SortType, PagingPosition)} - * @return a List of the Site IDs for the sites matching the criteria. + * {@inheritDoc} */ - @SuppressWarnings("unchecked") - protected List getSiteIds(SelectionType type, Object ofType, String criteria, Map propertyCriteria, SortType sort, PagingPosition page) + public List getSiteIds(SelectionType type, Object ofType, String criteria, Map propertyCriteria, SortType sort, PagingPosition page) { String join = getSitesJoin( type, sort ); String order = getSitesOrder( sort ); @@ -977,6 +973,7 @@ sql = getResourceSql(fieldList(m_siteIdFieldArray, null), where, order, values, join); } + @SuppressWarnings("unchecked") List siteIds = (List) sqlService().dbRead(sql, values, siteIdReader); return siteIds; } Index: api/src/main/java/org/sakaiproject/site/api/SiteService.java =================================================================== --- api/src/main/java/org/sakaiproject/site/api/SiteService.java (revision 130211) +++ api/src/main/java/org/sakaiproject/site/api/SiteService.java (revision 130212) @@ -840,6 +840,28 @@ List getSites(SelectionType type, Object ofType, String criteria, Map propertyCriteria, SortType sort, PagingPosition page, boolean requireDescription); /** + * Get the Site IDs for all sites matching criteria. + * This is useful when you only need the listing of site ids (for other operations) and do not need the actual Site objects. + * + * All parameters are the same as {@link #getSites(org.sakaiproject.site.api.SiteService.SelectionType, Object, String, Map, org.sakaiproject.site.api.SiteService.SortType, PagingPosition)} + * + * @param type + * The SelectionType specifying what sort of selection is intended. + * @param ofType + * Site type criteria: null for any type; a String to match a single type; A String[], List or Set to match any type in the collection. + * @param criteria + * Additional selection criteria: sites returned will match this string somewhere in their id, title, description, or skin. + * @param propertyCriteria + * Additional selection criteria: sites returned will have a property named to match each key in the map, whose values match (somewhere in their value) the value in the map (may be null or empty). + * @param sort + * A SortType indicating the desired sort. For no sort, set to SortType.NONE. + * @param page + * The PagePosition subset of items to return. + * @return a List of the Site IDs for the sites matching the criteria. + */ + List getSiteIds(SelectionType type, Object ofType, String criteria, Map propertyCriteria, SortType sort, PagingPosition page); + + /** * Get all sites that have been softly deleted * * @return List of Sites or empty list if none.