-
Notifications
You must be signed in to change notification settings - Fork 5
Home
This is a description for the iSENSE.java wrapper for the iSENSE java API.
Functions
- void iSENSE(int projectID, String userName, String passWord, String name )
This is a constructor for the iSENSE class. It takes a project ID to know which project is being worked with, a username and password to log a user in, and a name to call the data set.
- void iSENSE(int projectID, String contribKey, String name)
This is the second constructor for the iSENSE class. It works the same as the first, however instead of taking a username and password it takes a contributor key. This is incase the user does not have an iSENSE account but still wants to upload data to a project.
- void init(int projectID, String name)
This is a private function that both constructors call. It initializes all the member data that both constructors have in common. It also creates an instance of the API and sets useDev to true currently. Next, it grabs the fields from the selected project on iSENSE and stores them in the member variable m_fields. It then stores the field name and ID number into hash maps so they can be accessed separately later.
- void uploadDataSet(String dataSetName)
This function uploads the data set. It takes a single string which is the name of the data set. It calls the API function of the same name which uses the member variables projectID, JSONObject colData, and the data set name. It then clears the JSONObject data so more data can then be put in it as the user pleases.
- void uploadConKey( String dataSetName )
This function does the same as the previous one, except it uses a contributor key to upload the data. The API function uploadDataSet will take the member variable contribKey on top of the other parameters in this case.
- ArrayList getFields()
This function will get the fields from the designated project and store them in an ArrayList. This would allow the user to see which fields the project has and in what order to upload the data so it matches with the proper field.
- void putData (ArrayList fields, ArrayList<?> userData)
This function "puts" or stores the data in a JSONObject so it can be properly uploaded to the website. It takes an ArrayList fields, which is the fields taken from the selected project. Also, it takes an ArrayList of any type which is the user's data. This way the user can upload various types of data.
- JSONObject getDataSet(int dsID)
This function pulls down a specified data set from a project from the website. It takes an int dsID which specifies which data set to pull down. It stores the data in a JSONObject and can be printed out as "Field name" : "Data".