getodk / briefcase

ODK Briefcase is a Java application for fetching and pushing forms and their contents. It helps make billions of data points from ODK portable. Contribute and make the world a better place! ✨💼✨
https://docs.getodk.org/briefcase-intro
Other
60 stars 156 forks source link

Improve pushing forms behavior #442

Open ggalmazor opened 6 years ago

ggalmazor commented 6 years ago

This issue is related to #420

It is also related with work in progress PR #405 which will improve the UI components that let the user choose source/targets for their pull/push operations.

Software versions

Briefcase v1.10.0

Problem description

Pushing forms to Aggregate always sends a blank form, which can be a waste of time and bandwidth with forms with media file attachments.

Expected behavior

yanokwa commented 6 years ago

The expected behavior is clear for everything but the GUI. I'm not even sure we should enable this on the GUI, but I'd be interested to hear how you think it should work.

ggalmazor commented 6 years ago

I think we could add a new checkbox to enable "force-pushing" on the form to configure an Aggregate server as the push target with a text that explains that we won't send a blank form unless we don't find it there (we need to explain that anyway).

ggalmazor commented 6 years ago

I've updated the issue description to warn about its relation to the ongoing PR #405. It would be better to wait for that PR to be merged before starting to work on the UI part of this issue.

yanokwa commented 6 years ago

Oh, and to check if Aggregate has the form, you'll have to do something like this: curl --silent "X-OpenRosa-Version:1.0" https://opendatakit.appspot.com/formList 2>&1 | awk -F "=|\"" '{print $4}'

But you know, in Java.

dcbriccetti commented 6 years ago

What’s the command line syntax to do a push?

ggalmazor commented 6 years ago

The syntax would be --push_aggregate or -psha and some required and optional args:

Params for -psha operation:
  -id,--form_id <arg>                 Form ID
  -p,--odk_password <arg>             ODK Password
  -sd,--storage_directory <arg>       Briefcase storage directory
  -u,--odk_username <arg>             ODK Username
  -url,--aggregate_url <arg>          Aggregate server URL
Optional params for -psha operation:
  -fsb,--force_send_blank             Force sending the blank form to the Aggregate instance
dcbriccetti commented 6 years ago

--push_aggregate --form_id All%20widgets --storage_directory /tmp/ODK%20Briefcase%20Storage

2018-05-16 09:39:40,897 [main] ERROR o.o.a.p.BaseFormParserForJavaRosa - Launch Failed: Unrecognized option: --push_aggregate

ggalmazor commented 6 years ago

Hi Dave! It's running OK for me. Some thoughts:

I'm trying these args and they're working:

-sd /home/guillermo -url https://aggregatetest-184307.appspot.com -u administrator -p aggregate -id all-widgets --push_aggregate -fp

dcbriccetti commented 6 years ago

I got this working by passing the arguments via Gradle:

run {
    if (project.hasProperty("appArgs")) {
        args Eval.me(appArgs)
    }
}

-PappArgs="['--push_aggregate', '-id', 'all-widgets', '-sd', '/tmp', '-p', '', '-u', '', '-url', 'http://localhost:8080']"