Skip to content

Instantly share code, notes, and snippets.

@hjast
Created March 16, 2012 18:51
Show Gist options
  • Save hjast/2051816 to your computer and use it in GitHub Desktop.
Save hjast/2051816 to your computer and use it in GitHub Desktop.
AImport.scala
/* Follow this to write other gym import scripts. Import scripts will be faster than a GUI */
object JccImportScript extends ImportScriptDSL
{
import com.sportaneous.dataimport.common.Labels._
import JPAScalaBridge._
val locationID = 370000l
implicit val loc = Model.find[Facility](locationID).get
val org = Organization("Fourtenth Street Y",loc)
val classDescription = classDescriptionWithOrg(org) _
val abBlast = classDescription("Ab Blast",
"15 minute, high intensity, ab workout.",
TopLevelLabel.GROUP_FITNESS,
fitness
)
val aerobics = classDescription("Aerobics with Weights",
"Improve your cardiovascular health as well as your strength and flexibility.",
TopLevelLabel.GROUP_FITNESS,
fitness
)
val alignmentYoga = classDescription("Alignment Yoga",
"Intermediate alignment based class designed to increase bone density, promote muscle tone, and joint mobility.",
TopLevelLabel.YOGA,
yoga
)
val bellyDance = classDescription("Belly Dance",
"Learn belly dance steps and choreography while developing excellent posture and body awareness.",
TopLevelLabel.DANCING,
dance,belly, fitness
)
val bootCamp = classDescription("Boot Camp",
"Heart pumping cardio drills, full body muscle conditioning, and calisthenics for functional movements. Get ready to work !",
TopLevelLabel.BOOT_CAMP,
bootcamp
)
val definitions = classDescription("Definitions",
"Work the whole body with functional exercises designed to improve strength, balance, flexibility, as well as muscle definition.",
TopLevelLabel.GROUP_FITNESS,
fitness
)
val definitionPilates = classDescription("Definition Pilates",
"Intermediate Pilates class designed improve strength, flexibility, and posture, while promoting mental awareness.",
TopLevelLabel.PILATES,
pilates
)
val grooveHoops = classDescription("Groove Hoops",
"Hula Hoop party atmosphere - a lot of dancing and fun followed by a cool down.",
TopLevelLabel.GROUP_FITNESS,
fitness
)
val hathaYoga = classDescription("Hatha Yoga",
"Gentle Yoga class designed to condition your body, improve your health, and calm your mind.",
TopLevelLabel.YOGA,
yoga
)
val kickboxBootcamp = classDescription("Kickbox Bootcamp",
"Cardio-kick and punching drills, along with plyometric/explosive movements…bootcamp style !",
TopLevelLabel.GROUP_FITNESS,
boxing,bootcamp
)
val kravMaga = classDescription("Krav Maga",
"Israeli self-defense system based on instinctive reactions and realistic attack scenarios.",
TopLevelLabel.MARTIAL_ARTS_MMA,
martialArts
)
val lowImpactStandingAerobics = classDescription("LOW IMPACT STANDING AEROBICS",
"Slightly more intense approach to low-impact aerobics (No jumps or high – impact moves.)",
TopLevelLabel.GROUP_FITNESS,
fitness
)
val lunchCrunch = classDescription("Lunch Crunch",
" PILATES Intense, 45 minute, Pilates mat-based class.",
TopLevelLabel.PILATES,
fitness,pilates
)
val mommyBabyYoga = classDescription("Mommy Baby Yoga",
"Gentle Yoga class designed for mom and baby (2 – 15 months).",
TopLevelLabel.YOGA,
yoga
)
val morningBoost = classDescription("MORNING BOOST",
"Wake up ! Cardio, strength training, and stretching exercises - improve your fitness level and have fun.",
TopLevelLabel.GROUP_FITNESS,
fitness
)
val guExercise = classDescription("Mr. Gu’s exercise",
"Based on Tai Chi, these gentle exercises can contribute to general health.",
TopLevelLabel.GROUP_FITNESS,
fitness
)
val newBodyNewBaby = classDescription("New Body / New Baby",
"Work out with your new baby with a unique combination of cardio and strength training exercises.",
TopLevelLabel.GROUP_FITNESS,
fitness
)
val nia = classDescription("Nia",
"Dance based cardiovascular program that uses whole-body expressive, grounded movement adaptable to every level of fitness and age.",
TopLevelLabel.GROUP_FITNESS,
dance,fitness
)
val pilatesFundamentals = classDescription("PILATES FUNDAMENTALS",
"Learn the basic concepts of Pilates. Work your core in a full range of exercises designed to strengthen and align\n your entire body.",
TopLevelLabel.PILATES,
pilates
)
val pilatesFlow = classDescription("Pilates Flow",
"Intermediate Pilates class focusing on core control, alignment, toning, and flexibility.",
TopLevelLabel.PILATES,
pilates
)
val powerSculpt = classDescription("Power Sculpt",
"Intense 30 minute sculpt class, using hand held weights.",
TopLevelLabel.GROUP_FITNESS,
fitness
)
val powerVinyasa = classDescription("Power Vinyasa",
"Faster paced class is designed and open to all students wishing to refine basic poses and move forward into\n " +
"progressively challenging asana practices",
TopLevelLabel.YOGA,
yoga,fitness,vinyasa
)
val prenatalYoga = classDescription("Prenatal Yoga",
"This class will help prepare your body and mind for the challenges of labor, delivery, and life with a new baby."
)
val punkRope = classDescription("Punk Rope",
"Fun, fast, loud, cardio workout that blends jump rope, conditioning drills, and core training."
)
val silverSneakers = classDescription("Silver Sneakers",
"Specifically designed for the Silver Sneaker Program, but all members are welcome.",
TopLevelLabel.GROUP_FITNESS,
fitness
)
val sitAndBeFit = classDescription("Sit And Be Fit",
"Full-body aerobic fitness class all done in a chair.",
TopLevelLabel.GROUP_FITNESS,
fitness
)
val stepSculpt = classDescription("STEP N’ SCULPT",
"Up-tempo step class incorporating dance moves with an intense upper and lower body workout." ,
TopLevelLabel.STEP,
fitness, step
)
val sweat = classDescription("S.W.E.A.T",
"Strength With Endurance And Toning – A total body workout, toning exercises, endurance drills, that will leave you soaked." ,
TopLevelLabel.GROUP_FITNESS,
fitness,highIntensity
)
val sundayPilates = classDescription("Sunday Pilates",
"Contemporary Pilates class designed to increase core strength, improve flexibility, and energize the body.",
TopLevelLabel.PILATES,
pilates
)
val taiChi = classDescription("Tai Chi",
"All levels welcome. Develop balance, body and breath control, strength, and posture.",
TopLevelLabel.GROUP_FITNESS,
fitness
)
val vinyasaYoga = classDescription("Vinyasa Yoga",
"Class for both beginner and intermediate level Yoga student.",
TopLevelLabel.YOGA,
yoga,vinyasa
)
val vinyasaOpenYoga = classDescription("Vinyasa Open Yoga",
"Class for the more advanced Yoga practitioner.",
TopLevelLabel.YOGA,
yoga,vinyasa
)
val wakeShakeAndPump = classDescription("Wake Shake and Pump",
"Both high + low impact aerobics, weights, and a stretch.",
TopLevelLabel.GROUP_FITNESS,
fitness
)
val yamunaBodyRolling = classDescription("Yamuna Body Rolling",
"Lying over a ball, stretching and elongating muscles, dislodging tension and discomfort, and increasing blood flow.",
TopLevelLabel.GROUP_FITNESS,
fitness
)
val ybrInfusedPilates = classDescription("Ybr Infused Pilates",
"Pilates mat class utilizing small balls of various sizes as props to help free up restrictions in the body.",
TopLevelLabel.PILATES,
pilates,fitness
)
val yogaBasics = classDescription("Yog Basics",
"Based in Viniyoga, this class focuses on postures and breath practices that are suitable for all levels and all bodies!",
TopLevelLabel.YOGA,
yoga,vin
)
val zumba = classDescription("Zumba",
"Latin rhythms, easy to follow moves, as well as resistance training, are all combined to tone and sculpt your body " +
"while burning fat.",
TopLevelLabel.DANCING,
com.sportaneous.dataimport.common.Labels.zumba,fitness,dance
)
activity(wakeShakeAndPump,(7,0)->(9,30), Monday)
activity(taiChi,(10,0)->(11,15),Tuesday)
activity(hathaYoga,(9,0)->(10,30),Wednesday)
//TODO This class could be wrong
//activity(pilatesFundamentals,)
activity(morningBoost,(7,0)->(9,0),Friday)
activity(powerVinyasa,(10,15)->(11,45),Saturday)
activity(definitions,(9,30)->(10,30),Monday)
//How long is this one(??)
activity(alignmentYoga,(10,30)->(11,15),Monday)
/*activity(taiChi,"Roberto",
'10:00AM,'11:15AM,Tuesday),
activity(hathaYoga, "Susan G", '9:00AM, '10:30AM)
*/
}
object Labels {
//This is not used in MINDOBODY
//Induvidual Labels and sub cateogries
val hiking = getLabel("Hiking", TopLevelLabel.HIKING, "HIKING", true)
val swimming = getLabel("Swimming", TopLevelLabel.SWIMMING, "SWIMMING", true)
val running = getLabel("Running", TopLevelLabel.RUNNING, "RUNNING", true)
val baseball = getLabel("Baseball", TopLevelLabel.BASEBALL, "BASEBALL", true)
val basketball = getLabel("Basketball", TopLevelLabel.BASKETBALL, "BASKETBALL", true)
val cricket = getLabel("Cricket", TopLevelLabel.CRICKET, "CRICKET", true)
val football = getLabel("Football", TopLevelLabel.TOUCH_FOOTBALL, "FOOTBALL", true)
val hockey = getLabel("Hockey", TopLevelLabel.HOCKEY, "HOCKEY", true)
val raquetball = getLabel("Raquetball", TopLevelLabel.RACKETBALL, "RAQUETBALL", true)
val rugby = getLabel("Rugby", TopLevelLabel.RUGBY, "RUGBY", true)
val soccer = getLabel("Soccer", TopLevelLabel.SOCCER, "SOCCER", true)
val softball = getLabel("Softball", TopLevelLabel.SOFTBALL, "SOFTBALL", true)
val squash = getLabel("Squash", TopLevelLabel.SQUASH, "SQUASH", true)
val tennis = getLabel("Tennis", TopLevelLabel.TENNIS, "TENNIS", true)
val ultimate = getLabel("Ultimate", TopLevelLabel.ULTIMATE, "ULTIMATE", true)
val volleyball = getLabel("Volleyball", TopLevelLabel.VOLLEYBALL, "VOLLEYBALL", true)
val quidditch = getLabel("Quidditch", TopLevelLabel.QUIDDITCH, "QUIDDITCH", true)
//This is the top level catch all label
val fitness = getLabel("fitness", TopLevelLabel.FITNESS, "FITNESS", true)
val bootcamp = getLabel("Boot Camp", TopLevelLabel.BOOT_CAMP, "BOOT_CAMP", true)
val cyclingSpinning = getLabel("Cycling/Spinning", TopLevelLabel.CYCLING, "CYCLING", true)
val pilates = getLabel("Pilates", TopLevelLabel.PILATES, "PILATES", true)
val barre = getLabel("Barre", TopLevelLabel.PILATES, "BARRE", false)
val step = getLabel("Step", TopLevelLabel.STEP, "STEP", true)
//Dance and subcategories
val dance = getLabel("Dance", TopLevelLabel.DANCING, "DANCE", true)
val zumba = getLabel("zumba", TopLevelLabel.DANCING, "ZUMBA", false)
val ballroom = getLabel("ballroom", TopLevelLabel.DANCING, "BALLROOM", false)
val salsa = getLabel("salsa", TopLevelLabel.DANCING, "SALSA", false)
val swing = getLabel("swing", TopLevelLabel.DANCING, "SWING", false)
val tap = getLabel("tap", TopLevelLabel.DANCING, "TAP", false)
val hiphop = getLabel("hip-hop", TopLevelLabel.DANCING, "HIPHOP", false)
val tango = getLabel("tango", TopLevelLabel.DANCING, "TANGO", false)
val jazz = getLabel("jazz", TopLevelLabel.DANCING, "JAZZ", false)
val ballet = getLabel("ballet", TopLevelLabel.DANCING, "BALLET", false)
val pole = getLabel("pole", TopLevelLabel.DANCING, "POLE", false)
val belly = getLabel("belly", TopLevelLabel.DANCING, "BELLY", false)
val latin = getLabel("latin", TopLevelLabel.DANCING, "LATIN", false)
val hustle = getLabel("Hustle", TopLevelLabel.DANCING, "HUSTLE", false)
//Yoga and subcategories
val yoga = getLabel("yoga", TopLevelLabel.YOGA, "YOGA", true)
val hatha = getLabel("hatha", TopLevelLabel.YOGA, "HATHA", false)
val vinyasa = getLabel("vinyasa", TopLevelLabel.YOGA, "VINYASA", false)
val ashtanga = getLabel("ashtanga", TopLevelLabel.YOGA, "ASHTANGA", false)
val power = getLabel("power", TopLevelLabel.YOGA, "POWER", false)
val iyengar = getLabel("iyengar", TopLevelLabel.YOGA, "IYENGAR", false)
val kundalini = getLabel("kundalini", TopLevelLabel.YOGA, "KUNDALINI", false)
val bikram = getLabel("bikram", TopLevelLabel.YOGA, "BIKRAM", false)
val hot = getLabel("got", TopLevelLabel.YOGA, "HOT", false)
val sirvanda = getLabel("sirvanda", TopLevelLabel.YOGA, "SIRVANDA", false)
val christian = getLabel("christian", TopLevelLabel.YOGA, "CHRISTIAN", false)
val prenatal = getLabel("pernatal", TopLevelLabel.YOGA, "PRENATAL", false)
val anusara = getLabel("ansara", TopLevelLabel.YOGA, "ANUSARA", false)
val juvamukti = getLabel("juvamukti", TopLevelLabel.YOGA, "JUBAMUKTI", false)
val forrest = getLabel("forrestyoga", TopLevelLabel.YOGA, "FORREST", false)
val laughter = getLabel("laughteryoga", TopLevelLabel.YOGA, "LAUGHTER", false)
val vin = getLabel("vinyoga", TopLevelLabel.YOGA, "VIN", false)
//All high intensity stuff
val crossfit = getLabel("crossfit", TopLevelLabel.HIGH_INTENSITY, "CROSSFIT", false)
val highIntensity = getLabel("highintensity", TopLevelLabel.HIGH_INTENSITY, "HIGH_INTENSITY", false)
val kettlebell = getLabel("kettlebell", TopLevelLabel.HIGH_INTENSITY, "KETTLEBELL", false)
val trx = getLabel("trx", TopLevelLabel.HIGH_INTENSITY, "TRX", false)
//Martial Arts
val martialArts = getLabel("Martial Arts", TopLevelLabel.MARTIAL_ARTS_MMA, "MARTIAL_ARTS", true)
val karate = getLabel("Karate", TopLevelLabel.MARTIAL_ARTS_MMA, "KARATE", false)
val takando = getLabel("Taekwondo", TopLevelLabel.MARTIAL_ARTS_MMA, "TAKANDO", false)
val juijusti = getLabel("jiu jitsu", TopLevelLabel.MARTIAL_ARTS_MMA, "JUIJUSTI", false)
val kravmaga = getLabel("krav maga", TopLevelLabel.MARTIAL_ARTS_MMA, "KRAVMAGA", false)
val judo = getLabel("judo", TopLevelLabel.MARTIAL_ARTS_MMA, "JUDO", false)
val wrestling = getLabel("Wrestling", TopLevelLabel.MARTIAL_ARTS_MMA, "WRESTLING", false)
//Boxing is a top level category (??)
val boxing = getLabel("Boxing", TopLevelLabel.BOXING, "BOXING", true)
val weightlifting = getLabel("Weightlifting", TopLevelLabel.GENERIC, "WEIGHTLIFTING", false)
val stretching = getLabel("stretching", TopLevelLabel.GROUP_FITNESS, "STRETCHING", false)
}
public enum TopLevelLabel
{
BASKETBALL,
BASEBALL,
BOOT_CAMP,
BOXING,
CAPOEIRA,
CRICKET,
CYCLING,
DANCING,
HIKING,
GENERIC,
GROUP_FITNESS,
HOCKEY,
KICKBALL,
MARTIAL_ARTS_MMA,
OTHER,
PILATES,
QUIDDITCH,
RACKETBALL,
ROCK_CLIMBING,
RUGBY,
RUNNING,
SOCCER,
SWIMMING,
SOFTBALL,
SQUASH,
TENNIS,
TOUCH_FOOTBALL,
ULTIMATE,
VOLLEYBALL,
YOGA,
FITNESS,
HIGH_INTENSITY,
STEP
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment