gradesystem / grade-glue

Ad-hoc Recipes for Grade Staging
0 stars 0 forks source link

Refactor to new Upload Service #8

Closed fabiosimeoni closed 9 years ago

fabiosimeoni commented 9 years ago

grade installations now expose an Upload Service for xml, csv, and json data.

we no longer need to pass through the API of a VR plugin, which wasn't intended for direct, programmatic publication and makes for awkward idioms.

furthermore, all future evolution to the ingestion logic in grade will pass through the Upload Service and the VR plugin will become outdated.

Refactor to the new Upload Service.

fabiosimeoni commented 9 years ago

first draft of a GradePublisher that offers an embedded DSL based on Java 8 lambdas over standard jax-rs facilities.

Tested with rfb:

drop("rfb.xml").with(xml).in(ami).as("rfb");

we can:

we still do not have a neat solution for csv, which requires additional parsing directives and a multipart request. working next on how to cover that special case along with the others.

fabiosimeoni commented 9 years ago

second draft of GradePublisher with support for csv uploads.

tested with AdminUnitGlue:


Csv csv = csv().delimitedBy(',').in("UTF-16");
drop("admin-units.txt").with(csv).in(ami).as("admin-units");

DSL is stabler now as follows:

drop( InputStream | String ).with(UploadInfo).in(Deployment).as(String);

Finally, xml and json uploads are compressed now.

fabiosimeoni commented 9 years ago

csv uploads also compressed now.