Create 200 Dummy Users

Last modified by Thomas Mortagne on 2013/10/09 08:12

cogCreates 200 dummy users in the wiki for test purposes
Developed by

Guillaume Lerouge

Rating
Rate!
0 Votes
LicenseGNU Lesser General Public License 2.1

Description

To use it, follow these steps :

  • Create a new wiki page with a user who has programming rights
  • Then paste the following script between those 2 tags
  • Save the page
  • You're done, the dummy users have been created !
{{groovy}}
def users = [
["Jean", "Valjean"],
["Georges", "Abitbol"],
["Adam","Harper"],
["Alan","Pfaff"],
["Alan","Vanwinkle"],
["Alana","Stutsman"],
["Albert","Osterman"],
["Alison","Sands"],
["Allan","Goris"],
["Allan","Razor"],
["Alma","Ratcliffe"],
["Alvaro","Cangemi"],
["Amanda","Basile"],
["Annabelle","Ducker"],
["Anthony","Granado"],
["Anthony","Mcdevitt"],
["Antonio","Starnes"],
["April","Kain"],
["Arlene","Stephen"],
["Armand","Stower"],
["Arthur","Ragsdale"],
["Ashlee","Hurtt"],
["Beata","Zar"],
["Bernice","Turnage"],
["Bertha","Schuck"],
["Billy","Sundberg"],
["Blanche","Page"],
["Bobby","Eaton"],
["Bobby","Winkelman"],
["Brandon","Dominick"],
["Brittanie","Noviello"],
["Bulah","Twombley"],
["Candace","Cote"],
["Carey","Balck"],
["Carey","Grishaber"],
["Carey","Twedell"],
["Chad","Guarino"],
["Chandra","Puffer"],
["Cheryl","Langley"],
["Chris","Creekmore"],
["Clare","Milum"],
["Clayton","Elbert"],
["Clinton","Dahmen"],
["Clinton","Ganley"],
["Clinton","Mcnaught"],
["Cody","Ridout"],
["Cody","Vigo"],
["Dale","Hernandes"],
["Dane","Hasychak"],
["Daniel","Colunga"],
["Darren","Tacey"],
["Darren","Vanaman"],
["Darryl","Buchta"],
["Debbie","Schlueter"],
["Doris","Adkins"],
["Eileen","Bard"],
["Elinor","Rita"],
["Elizabeth","Hendricks"],
["Elnora","Hornbuckle"],
["Elwood","Steketee"],
["Ericka","Hodgin"],
["Erik","Duley"],
["Ernest","Cowley"],
["Ernest","Frey"],
["Ernest","Helmick"],
["Esmeralda","Kardos"],
["Eve","Goodfellow"],
["Ewa","Villerreal"],
["Felicia","Manson"],
["Fernando","Outler"],
["Fidel","Jacoway"],
["Fidel","Paone"],
["Florence","Lillie"],
["Fred","Pyles"],
["Genna","Tranbarger"],
["George","Lamoureux"],
["Gerald","Graziano"],
["Gerald","Minnich"],
["Gina","Nickelson"],
["Gladys","Rothman"],
["Glenda","Wheat"],
["Gregory","Walls"],
["Guy","Gatton"],
["Hannah","Quijano"],
["Harold","Houser"],
["Harriet","Dreyer"],
["Howard","Sirois"],
["Hugh","Charland"],
["Hugh","Dipalma"],
["Hugh","Fuselier"],
["Hugh","Minaya"],
["Ida","Noe"],
["Inez","Marion"],
["James","Angell"],
["James","Cravens"],
["Jami","Gula"],
["Jamie","Brickhouse"],
["Jamie","Huot"],
["Jason","Willson"],
["Jeannette","Macaluso"],
["Jerri","Giesen"],
["Jerri","Houseknecht"],
["Jerri","Nickson"],
["Jessie","Olah"],
["Ji","Greenier"],
["Jonathan","Matos"],
["Joyce","Brian"],
["Julio","Sepeda"],
["Karina","Palka"],
["Katherine","Holzer"],
["Kathryn","Diaz"],
["Katie","Lloyd"],
["Keila","Brue"],
["Keith","Berner"],
["Kelly","Henegar"],
["Kenneth","Caraballo"],
["Kevin","Batchelder"],
["Kevin","Poindexter"],
["Kimberly","Cecil"],
["Kimberly","Hare"],
["Kristina","Kasper"],
["Lakisha","Trees"],
["Larita","Battisti"],
["Laura","Mcfadden"],
["Laurie","Carranza"],
["Lilia","Fouse"],
["Linda","Kavanaugh"],
["Linda","Power"],
["Lonnie","Sherrow"],
["Lori","Stjohn"],
["Lorrie","Lobdell"],
["Louis","Leggett"],
["Louis","Watterson"],
["Louisa","Galyean"],
["Louisa","Swingle"],
["Louise","Belanger"],
["Lynda","Knudsen"],
["Madelene","Robasciotti"],
["Mae","Brantley"],
["Maggie","Fernandez"],
["Maggie","Madore"],
["Mallory","Brodbeck"],
["Mallory","Sickels"],
["Manuel","Trotter"],
["Marcel","Avers"],
["Marcel","Cuffia"],
["Marcel","Merow"],
["Margaret","Amey"],
["Maricela","Bautch"],
["Marilyn","Shumpert"],
["Mark","Haynie"],
["Marlin","Gryniuk"],
["Martin","King"],
["Mathew","Mayton"],
["Max","Sprau"],
["Merrilee","Garelick"],
["Mildred","Colburn"],
["Ming","Negro"],
["Nathan","Shuster"],
["Neil","Helbert"],
["Nelson","Pinzon"],
["Nelson","Rayo"],
["Nicholas","Lowell"],
["Nicole","Tillman"],
["Norman","Thatcher"],
["Olivia","Bridgeman"],
["Peggy","Loggins"],
["Penelope","Maize"],
["Peter","Agee"],
["Peter","Valadez"],
["Priscilla","Katz"],
["Rachel","Marchand"],
["Randy","Frederickson"],
["Raphael","Dumaine"],
["Raymond","Nava"],
["Robyn","Duvall"],
["Rod","Schoneman"],
["Roger","Goldman"],
["Ronald","Looney"],
["Roy","Kushner"],
["Scott","Obryan"],
["Shawn","Ault"],
["Stanley","Cleaver"],
["Sylvia","Salazar"],
["Sylvia","Walther"],
["Tabatha","Goodsell"],
["Tari","Windish"],
["Tarra","Bellantuono"],
["Thomas","Coleman"],
["Tia","Drakeford"],
["Tina","Palomo"],
["Tony","Haight"],
["Tyrone","Crossett"],
["Tyrone","Golub"],
["Victor","Mcduffie"],
["Vincent","Nowak"],
["Viola","Mcnamee"],
["Wayne","Maye"],
["Wayne","Ulrich"],
["Yolanda","Hood"]
]

def allGroup = xwiki.getDocument('XWiki.XWikiAllGroup')

for(user in users){
 fullName = user.get(0) + user.get(1)
 udoc = xwiki.getDocument("XWiki."+fullName)
 uobj = udoc.getObject("XWiki.XWikiUsers", true)
 uobj.set("first_name", user.get(0))
 uobj.set("last_name" , user.get(1))
 print("* Registering *" + udoc.fullName + "*\n")
 udoc.save()
 gObj = allGroup.newObject('XWiki.XWikiGroups')
 gObj.set('member',udoc.fullName)
}

allGroup.save()
{{/groovy}}

Bonus: create 200 revisions from 200 users in a document

{{groovy}}
def users = [
["Jean", "Valjean"],
["Georges", "Abitbol"],
["Adam","Harper"],
["Alan","Pfaff"],
["Alan","Vanwinkle"],
["Alana","Stutsman"],
["Albert","Osterman"],
["Alison","Sands"],
["Allan","Goris"],
["Allan","Razor"],
["Alma","Ratcliffe"],
["Alvaro","Cangemi"],
["Amanda","Basile"],
["Annabelle","Ducker"],
["Anthony","Granado"],
["Anthony","Mcdevitt"],
["Antonio","Starnes"],
["April","Kain"],
["Arlene","Stephen"],
["Armand","Stower"],
["Arthur","Ragsdale"],
["Ashlee","Hurtt"],
["Beata","Zar"],
["Bernice","Turnage"],
["Bertha","Schuck"],
["Billy","Sundberg"],
["Blanche","Page"],
["Bobby","Eaton"],
["Bobby","Winkelman"],
["Brandon","Dominick"],
["Brittanie","Noviello"],
["Bulah","Twombley"],
["Candace","Cote"],
["Carey","Balck"],
["Carey","Grishaber"],
["Carey","Twedell"],
["Chad","Guarino"],
["Chandra","Puffer"],
["Cheryl","Langley"],
["Chris","Creekmore"],
["Clare","Milum"],
["Clayton","Elbert"],
["Clinton","Dahmen"],
["Clinton","Ganley"],
["Clinton","Mcnaught"],
["Cody","Ridout"],
["Cody","Vigo"],
["Dale","Hernandes"],
["Dane","Hasychak"],
["Daniel","Colunga"],
["Darren","Tacey"],
["Darren","Vanaman"],
["Darryl","Buchta"],
["Debbie","Schlueter"],
["Doris","Adkins"],
["Eileen","Bard"],
["Elinor","Rita"],
["Elizabeth","Hendricks"],
["Elnora","Hornbuckle"],
["Elwood","Steketee"],
["Ericka","Hodgin"],
["Erik","Duley"],
["Ernest","Cowley"],
["Ernest","Frey"],
["Ernest","Helmick"],
["Esmeralda","Kardos"],
["Eve","Goodfellow"],
["Ewa","Villerreal"],
["Felicia","Manson"],
["Fernando","Outler"],
["Fidel","Jacoway"],
["Fidel","Paone"],
["Florence","Lillie"],
["Fred","Pyles"],
["Genna","Tranbarger"],
["George","Lamoureux"],
["Gerald","Graziano"],
["Gerald","Minnich"],
["Gina","Nickelson"],
["Gladys","Rothman"],
["Glenda","Wheat"],
["Gregory","Walls"],
["Guy","Gatton"],
["Hannah","Quijano"],
["Harold","Houser"],
["Harriet","Dreyer"],
["Howard","Sirois"],
["Hugh","Charland"],
["Hugh","Dipalma"],
["Hugh","Fuselier"],
["Hugh","Minaya"],
["Ida","Noe"],
["Inez","Marion"],
["James","Angell"],
["James","Cravens"],
["Jami","Gula"],
["Jamie","Brickhouse"],
["Jamie","Huot"],
["Jason","Willson"],
["Jeannette","Macaluso"],
["Jerri","Giesen"],
["Jerri","Houseknecht"],
["Jerri","Nickson"],
["Jessie","Olah"],
["Ji","Greenier"],
["Jonathan","Matos"],
["Joyce","Brian"],
["Julio","Sepeda"],
["Karina","Palka"],
["Katherine","Holzer"],
["Kathryn","Diaz"],
["Katie","Lloyd"],
["Keila","Brue"],
["Keith","Berner"],
["Kelly","Henegar"],
["Kenneth","Caraballo"],
["Kevin","Batchelder"],
["Kevin","Poindexter"],
["Kimberly","Cecil"],
["Kimberly","Hare"],
["Kristina","Kasper"],
["Lakisha","Trees"],
["Larita","Battisti"],
["Laura","Mcfadden"],
["Laurie","Carranza"],
["Lilia","Fouse"],
["Linda","Kavanaugh"],
["Linda","Power"],
["Lonnie","Sherrow"],
["Lori","Stjohn"],
["Lorrie","Lobdell"],
["Louis","Leggett"],
["Louis","Watterson"],
["Louisa","Galyean"],
["Louisa","Swingle"],
["Louise","Belanger"],
["Lynda","Knudsen"],
["Madelene","Robasciotti"],
["Mae","Brantley"],
["Maggie","Fernandez"],
["Maggie","Madore"],
["Mallory","Brodbeck"],
["Mallory","Sickels"],
["Manuel","Trotter"],
["Marcel","Avers"],
["Marcel","Cuffia"],
["Marcel","Merow"],
["Margaret","Amey"],
["Maricela","Bautch"],
["Marilyn","Shumpert"],
["Mark","Haynie"],
["Marlin","Gryniuk"],
["Martin","King"],
["Mathew","Mayton"],
["Max","Sprau"],
["Merrilee","Garelick"],
["Mildred","Colburn"],
["Ming","Negro"],
["Nathan","Shuster"],
["Neil","Helbert"],
["Nelson","Pinzon"],
["Nelson","Rayo"],
["Nicholas","Lowell"],
["Nicole","Tillman"],
["Norman","Thatcher"],
["Olivia","Bridgeman"],
["Peggy","Loggins"],
["Penelope","Maize"],
["Peter","Agee"],
["Peter","Valadez"],
["Priscilla","Katz"],
["Rachel","Marchand"],
["Randy","Frederickson"],
["Raphael","Dumaine"],
["Raymond","Nava"],
["Robyn","Duvall"],
["Rod","Schoneman"],
["Roger","Goldman"],
["Ronald","Looney"],
["Roy","Kushner"],
["Scott","Obryan"],
["Shawn","Ault"],
["Stanley","Cleaver"],
["Sylvia","Salazar"],
["Sylvia","Walther"],
["Tabatha","Goodsell"],
["Tari","Windish"],
["Tarra","Bellantuono"],
["Thomas","Coleman"],
["Tia","Drakeford"],
["Tina","Palomo"],
["Tony","Haight"],
["Tyrone","Crossett"],
["Tyrone","Golub"],
["Victor","Mcduffie"],
["Vincent","Nowak"],
["Viola","Mcnamee"],
["Wayne","Maye"],
["Wayne","Ulrich"],
["Yolanda","Hood"]
]

for(user in users){
  username = user[0] + user[1]
  document = doc.getDocument()
  document.setAuthor(username)
  xwiki.getXWiki().saveDocument(document, context.context)
}

doc.setContent("")
doc.save()
{{/groovy}}

Prerequisites & Installation Instructions

Copy the code snippet to a page and save it.

Tags: groovy users
Created by Guillaume Lerouge on 2008/04/14 20:57
     

Get Connected