tcpd / surf

Surf - an entity mapping and resolution system for Indian names
5 stars 5 forks source link

Provide a way for users to upload and download their own CSV files #6

Open hangal opened 7 years ago

hangal commented 7 years ago

This will avoid mucking with paths on the server, etc and make Surf easier to use. There should be a screen where users can upload a CSV or a gzipped CSV file.

That file gets stored in some work directory and can be loaded into the available datasets. The work directory needs to be persistent in some way so the user can get back to it even if the server restarts.

Along with save, there can be a download button for the user to get the dataset back with the mapped_ids and comments.

@sudesh-ashoka

hangal commented 7 years ago

It should be easy to modify surf to accommodate other datasets, such as (say) Lok Sabha.

The dependency on any specific dataset should be minimal, and captured in some configuration variables in Config.java (this is set to some default, will be settable from surf.properties and may even be settable by the user at run time).

e.g. e.g. in Config.java, we have added:

public static String[] columnsToDisplay = new String[]{"Name", "Sex", "Year", "Constituency", "Party", "State", "Position", "Votes"}; public static String mappedIdColumn = "pid"; // name of column into which output id's will be written public static String primaryColumn = "Name"; // name of primary column that is being merged public static String secondaryColumn = "AC_no"; // name of secondary column by which fields can be grouped (may or may not be visible on screen) public static String filterColumn = "Position"; // name of column on which filter can be set. (should be expandable to accommodate multiple columns) public static String[] filterColumnValues = new String[]{"1", "2", "3"}; // allowed values for filterColumn when set The rest of the code should be driven only by these variables instead of being hard-coded to certain column names. HTML code, CSS selectors, etc. should also not reflect hard-coded fields, to the extent possible.

The name "incumbency" need not appear anywhere. It can simply be called Merge.