ODK-X : Improve the suitcase application

About Me

Hi everyone, myself Subham Raj. I am from India. I am pursuing B.Tech in C.S.E from IIIT agartala. I am a prefinal year student. This is my first project with GSoC.

About My Project

This project aims to improve the odk-x suitcase application. This includes adding option to select table id from drop down, option for multiple table download at once, saving user credentials, and improve error handling in the application. This Project also includes some other works to improve the user experience.

My Timezone

Indian Standard Time (UTC +5:30)

Weekly updates

I have coordinated with my mentors for this project. As mentioned in the timeline, during this week 17 may - 23 may I am going through the existing documentation of suitcase and noting down the shortcomings in it. Also the sync client library which is used by suitcase for http requests has to be modified in this project for error handling. For this I am going through the error responses thrown by sync client.

I will post the progress at the end of every week in this thread.

Getting in touch

GitHub: (Shubhamr837 (Subham raj) · GitHub)
LinkedIn: https://www.linkedin.com/in/subhamr837

Looking forward to work with the community!! :smiley:

Week 1 : 7 may -23 may
Hi everyone, during my first week I went through the codebase of suitcase application and the sync client library. I was already familiar with it as I had worked on it during application phase of Google summer of code. I also checked different error messages returned by sync endpoint server. All the error messages where clear from the status code itself.
I also coordinated with my mentors li lin and vyankatesh sir. We have decided to hold meetings every Monday starting from the coding phase.

Week 2 : 23 may - 30 may
During the second week I went through the documentation of suitcase and noted down what changes would be needed.
I ran a simple GUI test case using AssertJ to get familiar with it.
I also did some research on how to improve the UI. Using proper padding and background colors would be really helpful for UI. Apart from this buttons and error dialog would require some customization.

1 Like

Week 3 - 31 may -7 june
I went through the codebase of suitcase and did some experiments with the UI. Currently most of the panels are made using Gridlayout with specific number of columns and rows. To have more customizable UI I will use FlowLayout for some new components as it was easy to set size of each component.
I went through existing test cases in the application. Unit test for upload download and reset are there but for “refresh tables list” unit test is not there as this feature is added recently.
I will discuss this with mentors and work accordingly.

1 Like

Week 4 : 7 june - 14 june
As per the timeline I implemented table id dropdown in the application and multiple table download option.
I have also identified a bug after this implementation. The error message for multiple table id download needs to be modified so that the user can know which table id is causing the error.
I also made a simple UI change, ODK-X logo is now added to the login page of the application.
Thanks to my mentors I learnt new things about java. Best one among them was “try with resources” which is used in a try catch block to automatically close a stream which is opened.

1 Like

Week 5 : 14 june - 20 june
This week I worked to improve the UI of the application and correcting bugs from previous weeks.
I also created the first GUI test for the application using AssertJ.
To improve the UI I made some simple changes like changing the color of buttons and re-positioned some buttons. The buttons now have fixed size and it doesn’t increase after increasing the window size.
I also found a bug in the previously added feature “multiple table id download”. After the first table is downloaded the applications works as if the task is over and enables all the buttons and the download continues for next table id. This will be corrected by moving the entire logic of multiple table id download to the DownloadTask.

1 Like

Week 6 : 21 june-27 june
This week I worked on saving credentials in local storage.
Suitcase logs out user after the application is closed. So to make it easier for user to login again, the application would now fill the last username and server url entered and would login automatically if the user checks the option to save password during login.
A logout button is also implemented for the user to logout.
We also discussed to make another checkbox for the user to use the default app Id. App id is a field required during login and this field is same for most of the cases.

Week 7: 28 june - 4 july : This week I worked on error handling in the application. Suitcase uses sync client library for http requests and if sync client cannot complete a request it will only throw an exception. So Suitcase only gets the exception and not the error message.
So with little modification in the sync client we added the response with error as a message for the exception and Suitcase can now get message from the exception and parse the response to get the exact error message.
This error message is shown to the user with a dialog.

Week 8 : 5 july -12 july
This week I worked on writing the test cases. I wrote one unit test case for reset task and three gui testcases for download, upload and reset.
Apart from this I also started working on the documentation part. As the application is currently undergoing changes we will include the screenshots in documentation later. @Esther-Phebe has left left her comments in the docs which I will correct and send a PR for docs.

1 Like

Week 9-10 : 13 july - 25 july
In the buffer period from 13 july to 19 july I completed previous pull requests which had requested changes.

In the Login GUI Test previously we called the login
function and then waited for 15 seconds for it to complete. Now we are using Awaitility for checking when login completes. Awaitility also has a timeout of 15 seconds, means test would be declared failed if it is not completed by 15 seconds. But if login is successfully before that it will complete the test immediately unlike the previous implementation which waited for 15 seconds.

For making the GUI tests headless we have used an external library GitHub - CaciocavalloSilano/caciocavallo: headless Swing UI testing.

In the previous week I added a new tab in the application named “Modify”. Suitcase previously had two tabs download and upload. The new modify tab has two new options " update " and " delete ". Updare functionality was already implemented in the application but it was available only in CLI. Now using the same SwingWorker class for update we have implemented the GUI for it.
User needs to select the table Id to update from the dropdown and then select the path to csv and then the selected table can be updated.
Another option Delete was not already present in the CLI. So it had to be implemented from scratch. Sync Client already had two useful methods, one to delete the table definition and one to delete a file. So we simply fetched the table metadata deleted the files present in the metadata and then delete the table definition. The new DeleteTask needs just one parameter that is the table Id. Unit test for new delete task is also written.

1 Like

Week 11 : 26 July - 1 August:
This week I worked on improving the UI. This includes adding a menu to the top of the Suitcase application. The new menu contains the option to logout and to open the Documentation of the application. To implement logout we simply clear the credentials in java preferences API. For opening the documentation I added a Command to open a link in default browser. But this was not working. To implement this now we will use the Desktop class available in java. This will also ensure that it works for all operating systems.
Future tasks include writing a GUI test case for logout.
In the GUI test we would simply click the logout button and check if preferences still have the credentials or not.

Week 12: 2 August- 9 August:
This week I made changes to both the Graphical user interface of Suitcase and command line interface of suitcase.
The graphical user interface has a new clear tab. This new tab has the option to delete a table and to reset the server. Reset button was in the upload tab before this.
In the command line interface I implemented the new delete function. User has to specify the table id to delete along with login credentials to use this feature.
I also completed implementing a button that opens the documentation of suitcase in the default browser of the system. This button along with the logout button can be found in a menu in the top left.

Week 13 - 14 : 10 August- 22 August:
In the last two weeks we implemented the new colors in Suitcase to make it look like other ODKX applications.
The documentation opening option which was provided in the menu has two options now. One option is to straight away open the documentation in the default browser. Other option is for unsupported operating systems. It opens a dialog with a link to copy.

I also completed the documentation of suitcase. The new documentation has screenshots for all the tabs and login screen.
The new documentation also has the instructions for new features like update and delete in the GUI.

I completed my final report for GSOC and wrote a medium blog for this.
Link to blog : GSOC 2021 with ODK-X ( Sub Org of DIAL ) | by Subham Raj | Aug, 2021 | Medium
I look forward to keep contributing to ODKX and working with the community members after GSOC.