public Map < Integer , List < Integer > > getUserRevisionIds ( int userid ) throws WikiApiException { Map < Integer , List < Integer > > revIds = new HashMap < Integer , List < Integer > > ( ) ; try { if ( userid < 1 ) { throw new IllegalArgumentException ( ) ; } if ( ! indexExists ( "revisions" , "userids" ) ) { System . err . println ( "You should create and index for the field ContributorID: create index userids ON revisions(ContributorId(15));" ) ; } PreparedStatement statement = null ; ResultSet result = null ; try { statement = connection . prepareStatement ( "SELECT ArticleID, RevisionID " + "FROM revisions WHERE ContributorId=?" ) ; statement . setInt ( 1 , userid ) ; result = statement . executeQuery ( ) ; // Make the query if ( result == null ) { throw new WikiPageNotFoundException ( "No revisions for user " + userid ) ; } while ( result . next ( ) ) { int artId = result . getInt ( 1 ) ; int revId = result . getInt ( 2 ) ; if ( revIds . containsKey ( artId ) ) { revIds . get ( artId ) . add ( revId ) ; } else { List < Integer > revList = new ArrayList < Integer > ( ) ; revList . add ( revId ) ; revIds . put ( artId , revList ) ; } } } finally { if ( statement != null ) { statement . close ( ) ; } if ( result != null ) { result . close ( ) ; } } return revIds ; } catch ( WikiApiException e ) { throw e ; } catch ( Exception e ) { throw new WikiApiException ( e ) ; } }
Returns the revisionids of all revisions created by given user