public class WorkTrackerQuery extends SqlQuery
SYNTAX: ca.bc.webarts.tools.WorkTrackerQuery [command] [commandOptions] Available Commands: --> sql {an sql statement} --> sqlFile sqlFile --> exportworkouts userId Example Usage: java ca.bc.webarts.tools.WorkTrackerQuery exportworkouts tgutwin
Modifier and Type | Field and Description |
---|---|
private int |
calories |
private String |
className_ |
private double |
distance_km |
private int |
duration_MIN |
private double |
elevation_M |
private String |
equipment |
private String |
exerciseSubType |
private String |
exerciseType |
private int |
heartRate_AVG |
private int |
heartRate_MAX |
private int |
heartRate_MIN |
private boolean |
indoorOutdoor |
private static Log |
log_
Gets a Log instance in case any calling classes are using it.
|
private String |
programType |
private String |
resultsFileName_
This is the filename that the main method uses to save results to
|
private boolean |
useProduction
Prod Or Test DB
|
private String |
userId |
private boolean |
wakeUp_
The Threaded Multi-Process Process Manager.
|
private String |
workoutDate |
calendar_, columnDelimitor, con, DB2_DB, db2DbDriverName, db2DbPort, dbConnectString, dbDriverName, dbIP, dbName, dbPassword, dbPort, dbType_, dbUser, debugOut, DEFAULT_COLUMN_DELIMITOR, DEFAULT_DB, DERBY_DB, derbyDbDriverName, derbyDbPort, dy_, HSQL_DB, hsqlDbDriverName, hsqlDbPort, MARIADB_DB, mariadbDbDriverName, mariadbDbPort, mo_, MYSQL_DB, mysqlDbDriverName, mysqlDbPort, ODBC_DB, odbcDbDriverName, ORACLE_DB, ORACLEDEDICATED_DB, oraDbDriverName, oraDbPort, oraDedicated_, OTHER_DB, pgDbDriverName, pgDbPort, POSTGRE_DB, proxoolDriverName, proxoolMaximumConnectionCount_, randLong, randStr, sqlFrom, sqlFrom2, sqlFrom3, sqlFrom4, sqlFrom5, sqlOrder, sqlSelect, sqlWhere, SYSTEM_FILE_SEPERATOR, SYSTEM_LINE_SEPERATOR, testDbConnectString, useProxoolPool_, yr_
Constructor and Description |
---|
WorkTrackerQuery()
Constructor for the SqlQuery object
|
WorkTrackerQuery(Log log)
Constructor for the SqlQuery object
|
Modifier and Type | Method and Description |
---|---|
void |
addWorkout()
Adds a workout entry to the DB based on the BEAN variables obtained from a web form.
|
int |
countXmlsInDir(String xmlDirectory)
Counts the XMLs in a given dir.
|
private static StringBuffer |
createHelpMessage() |
String |
exportWorkouts(String userid,
String dirName)
exports all workkout data to a xml file.
|
int |
getCalories()
Returns the value of calories.
|
String[][] |
getCaloriesGoogleData(String userid)
gets the calorie data [col][row] - one row has 3 entries - date, calories, running average
|
String |
getCaloriesGoogleDataStr(String userid)
gets the calories data in one long string that can be directly pt into a google data array.
|
String |
getCaloriesPieGoogleDataStr(String userid)
gets the calorie data in one long string that can be directly pt into a google data array.
|
String |
getDbFieldGoogleDataStr(String userid,
String dataField)
gets db field data in one long string that can be directly pt into a google data array.
|
String |
getDbIP()
Get Method for class field 'dbUser'.
|
String |
getDbName()
Get Method for class field 'dbName'.
|
String |
getDbPassword()
Get Method for class field 'dbPassword'.
|
String |
getDbUser()
Get Method for class field 'dbUser'.
|
double |
getDistance_km()
Returns the value of distance_km.
|
String[][] |
getDistanceKmGoogleData(String userid)
gets the calorie data [col][row] - one row has 3 entries - date, calories, running average
|
String |
getDistanceKmGoogleDataStr(String userid)
gets the distance_kn data in one long string that can be directly pt into a google data array.
|
String |
getDistanceKmPieGoogleDataStr(String userid)
gets the calorie data in one long string that can be directly pt into a google data array.
|
int |
getDuration_MIN()
Returns the value of duration_MIN.
|
double |
getElevation_M()
Returns the value of elevation_M.
|
String |
getEquipment()
Returns the value of equipment.
|
int |
getEquipmentTableRef(int exerId) |
int |
getEquipmentTableRef(String make,
String model) |
String |
getExerciseSubType()
Returns the value of exerciseSubType.
|
String |
getExerciseType()
Returns the value of exerciseType.
|
int |
getExercisetypeTableRef(String type,
String subType) |
int |
getHeartRate_AVG()
Returns the value of heartRate_AVG.
|
int |
getHeartRate_MAX()
Returns the value of heartRate_MAX.
|
int |
getHeartRate_MIN()
Returns the value of heartRate_MIN.
|
boolean |
getIndoorOutdoor()
Returns the value of indoorOutdoor.
|
int |
getNextEquipmentRef() |
int |
getNextEquipmentTypeRef() |
int |
getNextExerciseTypeRef() |
int |
getNextProgramTypeRef() |
int |
getNextTableRef(String tableName) |
int |
getNextUserGroupRef() |
int |
getNextUsersRef() |
int |
getNextUserWeightProfileRef() |
int |
getNextWorkoutRef() |
int |
getNumberOfExerciseTypes(String userid) |
String |
getProgramType()
Returns the value of programType.
|
String |
getResultsFileName()
Gets the resultsFileName_ var.
|
String |
getStackedDistanceKmGoogleDataStr(String userid)
gets the calorie data in one long string that can be directly pt into a google data array.
|
private String |
getTagValue(String sTag,
Element eElement) |
String |
getTimePieGoogleDataStr(String userid)
gets the exercise time data in one long string that can be directly pt into a google data array.
|
int |
getTotalCalories(String userid)
gets the calorie data [col][row] - one row has 3 entries - date, calories, running average
|
int |
getTotalCalories(String userid,
String exerciseType,
String exerciseSubType)
gets the calorie data [col][row] - one row has 3 entries - date, calories, running average
|
double |
getTotalKms(String userid)
gets the calorie data [col][row] - one row has 3 entries - date, calories, running average
|
double |
getTotalKms(String userid,
String exerciseType,
String exerciseSubType)
gets the calorie data [col][row] - one row has 3 entries - date, calories, running average
|
double |
getTotalMins(String userid)
gets the total minutes data.
|
double |
getTotalMins(String userid,
String exerciseType,
String exerciseSubType)
gets the total minutes for spec'd exer type
|
boolean |
getUseProduction()
Are we using the Prod or Test DB.
|
String |
getUserId()
Returns the value of userId.
|
int |
getUserTableRef(String userid) |
String |
getWorkoutDate()
Returns the value of workoutDate.
|
String |
getWTDbIP()
Get WT IP (host) for the db
|
String |
getWTDbName()
Get FDP IP (host) dor the db
|
String |
getWTDbPassword()
Returns the DB password
|
String |
getWtDbUser()
Returns the DB Userid
|
protected boolean |
isThisAWrkFile(File fileToCheck)
Checks if the passed File is a XML file (ie has a xml extension).
|
boolean |
loadFromDirectory(String workoutDirectory,
boolean recurse) |
boolean |
loadFromDOM(Document doc)
Reads a DOM object and puts the conained data into the DB.
|
boolean |
loadFromDOMfile(String fXmlFilename) |
static void |
main(String[] args)
Main Entry to query the WorkTracker from the commandline.
|
StringBuffer |
queryAddWorkout(String userid,
int yr,
int mo,
int dt,
int exer,
int equip,
int cal,
double km,
double elev_m,
double time_sec,
String prog)
Executes a SQL statement to add the data in the WorkoutFile to the DB.
|
StringBuffer |
queryAddWorkout(String userid,
int yr,
int mo,
int dt,
int exer,
int equip,
int cal,
double km,
double elev_m,
double time_sec,
String prog,
int hrAvg,
int hrMin,
int hrMax)
Executes a SQL statement to add the data in the WorkoutFile to the DB.
|
String |
queryEquipMake(int equipmentId) |
String |
queryEquipModel(int equipmentId) |
String |
queryExerSubType(int exerId) |
String |
queryExerType(int exerId) |
boolean |
requestHR()
Go to commandline and asks for heartRate_AVG, heartRate_MAX. heartRate_MIN.
|
void |
setCalories(int calories)
Sets the value of calories.
|
void |
setDistance_km(double distance_km)
Sets the value of distance_km.
|
void |
setDuration_MIN(int duration_MIN)
Sets the value of duration_SEC.
|
void |
setElevation_M(double elevation_M)
Sets the value of elevation_M.
|
void |
setEquipment(String equipment)
Sets the value of equipment.
|
void |
setExerciseSubType(String exerciseSubType)
Sets the value of exerciseSubType.
|
void |
setExerciseType(String exerciseType)
Sets the value of exerciseType.
|
void |
setHeartRate_AVG(int heartRate_AVG)
Sets the value of heartRate_AVG.
|
void |
setHeartRate_MAX(int heartRate_MAX)
Sets the value of heartRate_MAX.
|
void |
setHeartRate_MIN(int heartRate_MIN)
Sets the value of heartRate_MIN.
|
void |
setIndoorOutdoor(boolean indoorOutdoor)
Sets the value of indoorOutdoor.
|
void |
setIndoorOutdoor(String indoorOutdoor)
Sets the value of indoorOutdoor.
|
void |
setProgramType(String programType)
Sets the value of programType.
|
void |
setResultsFileName(String resultsFileName)
Sets the name to use for results files (if requested).
|
void |
setUseProduction(boolean useProduction)
Set true to use the Production WT DB.
|
void |
setUserId(String userId)
Sets the value of userId.
|
void |
setWorkoutDate(String workoutDate)
Sets the value of workoutDate.
|
boolean |
testConnection()
Test if we can connect.
|
canConnect, canConnect, convertSqlResultsToCSV, convertSqlResultsToXLS, copyIntoWorkbook, createCurrentTimeStamp, csvToJSON, generateCategoryBarChart, generatePieChart, getColumnDelimitor, getDbConnectString, getDbDriverName, getSqlFrom, getSqlFrom2, getSqlFrom3, getSqlFrom4, getSqlFrom5, getSqlOrder, getSqlSelect, getSqlWhere, getTimeDelta, query, query, resultSetToCSVFile, saveChartToSVG, sbIntoWorkbook, sbIntoWorkbook, sbToArray, sbToArray, sbToCsv, sbToDataArray, sbToDataArray, sbToDataRowArray, sbToDataRowArray, sbToFile, sbToJSON, sbToSheet, sbToWbk, sbToWorkbook, sbToWorksheet, sbToXLS, setCaseInsensitive, setCaseSensitive, setColumnDelimitor, setDbConnectString, setDbDriverName, setDbIP, setDbName, setDbPassword, setDbUser, setSqlFrom, setSqlFrom2, setSqlFrom3, setSqlFrom4, setSqlFrom5, setSqlOrder, setSqlSelect, setSqlWhere, setUseDb2DB, setUseDerbyDB, setUseHsqlDB, setUseMariadbDB, setUseMysqlDB, setUseOdbcDB, setUseOracleDB, setUseOracleDedicatedDB, setUsePostgreDB, testDbQuery
private String className_
private boolean useProduction
private boolean wakeUp_
private String resultsFileName_
private String workoutDate
private String exerciseType
private String exerciseSubType
private boolean indoorOutdoor
private double distance_km
private int calories
private int duration_MIN
private double elevation_M
private String programType
private int heartRate_AVG
private int heartRate_MAX
private int heartRate_MIN
public WorkTrackerQuery()
public WorkTrackerQuery(Log log)
public String getProgramType()
public void setProgramType(String programType)
programType
- The value to assign programType.public double getElevation_M()
public void setElevation_M(double elevation_M)
elevation_M
- The value to assign elevation_M.public int getDuration_MIN()
public void setDuration_MIN(int duration_MIN)
duration_MIN
- The value to assign duration_MIN.public int getHeartRate_AVG()
public void setHeartRate_AVG(int heartRate_AVG)
heartRate_AVG
- The value to assign heartRate_AVG.public int getHeartRate_MIN()
public void setHeartRate_MIN(int heartRate_MIN)
heartRate_MIN
- The value to assign heartRate_MIN.public int getHeartRate_MAX()
public void setHeartRate_MAX(int heartRate_MAX)
heartRate_MAX
- The value to assign heartRate_MAX.public int getCalories()
public void setCalories(int calories)
calories
- The value to assign calories.public double getDistance_km()
public void setDistance_km(double distance_km)
distance_km
- The value to assign distance_km.public String getEquipment()
public void setEquipment(String equipment)
equipment
- The value to assign equipment.public String getExerciseType()
public void setExerciseType(String exerciseType)
exerciseType
- The value to assign exerciseType.public String getExerciseSubType()
public void setExerciseSubType(String exerciseSubType)
exerciseSubType
- The value to assign exerciseSubType.public boolean getIndoorOutdoor()
public void setIndoorOutdoor(boolean indoorOutdoor)
indoorOutdoor
- The value to assign indoorOutdoor.public void setIndoorOutdoor(String indoorOutdoor)
indoorOutdoor
- The value to assign indoorOutdoor.public String getWorkoutDate()
public void setWorkoutDate(String workoutDate)
workoutDate
- The value to assign workoutDate.public void setUserId(String userId)
userId
- The value to assign userId.public String getResultsFileName()
public void setResultsFileName(String resultsFileName)
resultsFileName
- String - filenamepublic String getWtDbUser()
public String getDbPassword()
getDbPassword
in class SqlQuery
public String getWTDbPassword()
public String getWTDbIP()
public String getWTDbName()
public void setUseProduction(boolean useProduction)
useProduction
- true or false to use or not to use PRODpublic boolean getUseProduction()
public boolean testConnection()
public int getNextWorkoutRef()
public int getNextUsersRef()
public int getNextUserWeightProfileRef()
public int getNextEquipmentRef()
public int getNextProgramTypeRef()
public int getNextExerciseTypeRef()
public int getNextEquipmentTypeRef()
public int getNextUserGroupRef()
public int getNextTableRef(String tableName)
public int getUserTableRef(String userid)
public int getEquipmentTableRef(int exerId)
public int getEquipmentTableRef(String make, String model)
public int getExercisetypeTableRef(String type, String subType)
public int getNumberOfExerciseTypes(String userid)
public String queryEquipMake(int equipmentId)
public String queryEquipModel(int equipmentId)
public String queryExerType(int exerId)
public String queryExerSubType(int exerId)
public boolean loadFromDirectory(String workoutDirectory, boolean recurse)
public int countXmlsInDir(String xmlDirectory)
protected boolean isThisAWrkFile(File fileToCheck)
public int getTotalCalories(String userid)
public int getTotalCalories(String userid, String exerciseType, String exerciseSubType)
public double getTotalKms(String userid)
public double getTotalKms(String userid, String exerciseType, String exerciseSubType)
public double getTotalMins(String userid)
public double getTotalMins(String userid, String exerciseType, String exerciseSubType)
public String[][] getCaloriesGoogleData(String userid)
public String getStackedDistanceKmGoogleDataStr(String userid)
public String getCaloriesPieGoogleDataStr(String userid)
public String getTimePieGoogleDataStr(String userid)
public String getDistanceKmPieGoogleDataStr(String userid)
public String getCaloriesGoogleDataStr(String userid)
public String getDistanceKmGoogleDataStr(String userid)
public String getDbFieldGoogleDataStr(String userid, String dataField)
public String[][] getDistanceKmGoogleData(String userid)
public String exportWorkouts(String userid, String dirName)
public void addWorkout()
public StringBuffer queryAddWorkout(String userid, int yr, int mo, int dt, int exer, int equip, int cal, double km, double elev_m, double time_sec, String prog)
public StringBuffer queryAddWorkout(String userid, int yr, int mo, int dt, int exer, int equip, int cal, double km, double elev_m, double time_sec, String prog, int hrAvg, int hrMin, int hrMax)
private String getTagValue(String sTag, Element eElement)
public boolean loadFromDOMfile(String fXmlFilename)
public boolean loadFromDOM(Document doc)
doc
- is the Document holding the exercise data.public boolean requestHR()
private static StringBuffer createHelpMessage()
public static void main(String[] args)
SYNTAX: ca.bc.webarts.tools.WorkTrackerQuery [command] [commandOptions] Available Commands: --> sql {an sql statement} --> sqlFile sqlFile --> districts --> dtors fiscalYears fdr1 [fdr2] [fdr3] [fdr4] ... where fiscalYears is a comma seperated list of the years (NO SPACES) for example: 2006,2007,2008 where The fdr values *can* have spaces for example: 1260 NVR 1261 NVR would query for feeder_nms: '1260 NVR' and '1261 NVR' Example Usage: java ca.bc.webarts.tools.WorkTrackerQuery exercises userName
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses