public List < Integer > getIdsOfPagesThatEverContainedTemplateFragments ( List < String > templateFragments ) throws WikiApiException { if ( revApi == null ) { revApi = new RevisionApi ( wiki . getDatabaseConfiguration ( ) ) ; } Set < Integer > pageIdSet = new HashSet < Integer > ( ) ; //TODO instead of getting rev ids and then getting page ids, do one query and make the join in the db directly List < Integer > revsWithTemplate = getRevisionIdsContainingTemplateFragments ( templateFragments ) ; for ( int revId : revsWithTemplate ) { pageIdSet . add ( revApi . getPageIdForRevisionId ( revId ) ) ; } List < Integer > pageIds = new LinkedList < Integer > ( ) ; pageIds . addAll ( pageIdSet ) ; return pageIds ; }
Returns the ids of all pages that ever contained any template that started with any of the given template fragments