code: public List<Integer> getIdsOfPagesThatEverContainedTemplateNames(List<String> templateNames) 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 = getRevisionIdsContainingTemplateNames(templateNames);
      	for(int revId:revsWithTemplate){
      		pageIdSet.add(revApi.getPageIdForRevisionId(revId));
      	}
  
      	List<Integer> pageIds = new LinkedList<Integer>();
      	pageIds.addAll(pageIdSet);
  
      	return pageIds;
      }
docs: Returns the ids of all pages that ever contained any of the given template names in the history of their existence.
  
  @param templateNames template names to look for
  @return list of page ids of the pages that once contained any of the given template names
  @throws WikiApiException If there was any error retrieving the page object (most
  likely if the template templates are corrupted)