Search in sources :

Example 21 with FormStatus

use of org.opendatakit.briefcase.model.FormStatus in project briefcase by opendatakit.

the class ExportForms method appendStatus.

public void appendStatus(IFormDefinition formDefinition, String statusUpdate, boolean successful) {
    FormStatus form = getForm(formDefinition);
    form.setStatusString(statusUpdate, successful);
    if (successful) {
        LocalDateTime exportDate = LocalDateTime.now();
        String formId = getFormId(form);
        lastExportDateTimes.put(formId, exportDate);
        onSuccessfulExportCallbacks.forEach(callback -> callback.accept(formId, exportDate));
    }
}
Also used : LocalDateTime(java.time.LocalDateTime) FormStatus(org.opendatakit.briefcase.model.FormStatus)

Example 22 with FormStatus

use of org.opendatakit.briefcase.model.FormStatus in project briefcase by opendatakit.

the class FormsTableViewModel method setValueAt.

@Override
// Suppressing next ParameterName checkstyle error becasue 'aValue' param triggers it by mistake
@SuppressWarnings("checkstyle:ParameterName")
public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
    FormStatus form = forms.get(rowIndex);
    switch(columnIndex) {
        case FormsTableView.SELECTED_CHECKBOX_COL:
            Boolean isSelected = (Boolean) aValue;
            form.setSelected(isSelected);
            triggerChange();
            break;
        case FormsTableView.EXPORT_STATUS_COL:
            form.setStatusString((String) aValue, true);
            break;
        default:
            throw new IllegalStateException("unexpected column choice");
    }
    fireTableCellUpdated(rowIndex, columnIndex);
}
Also used : FormStatus(org.opendatakit.briefcase.model.FormStatus)

Aggregations

FormStatus (org.opendatakit.briefcase.model.FormStatus)22 Test (org.junit.Test)9 FormStatusBuilder.buildFormStatus (org.opendatakit.briefcase.model.FormStatusBuilder.buildFormStatus)7 BriefcaseFormDefinition (org.opendatakit.briefcase.model.BriefcaseFormDefinition)6 File (java.io.File)4 ExportForms (org.opendatakit.briefcase.export.ExportForms)4 BriefcasePreferences (org.opendatakit.briefcase.model.BriefcasePreferences)4 TerminationFuture (org.opendatakit.briefcase.model.TerminationFuture)4 SQLException (java.sql.SQLException)3 LocalDateTime (java.time.LocalDateTime)3 FileSystemException (org.opendatakit.briefcase.model.FileSystemException)3 FormStatusEvent (org.opendatakit.briefcase.model.FormStatusEvent)3 ServerConnectionInfo (org.opendatakit.briefcase.model.ServerConnectionInfo)3 IOException (java.io.IOException)2 ArrayList (java.util.ArrayList)2 Arrays (java.util.Arrays)2 List (java.util.List)2 Optional (java.util.Optional)2 Collectors.toList (java.util.stream.Collectors.toList)2 ExportConfiguration (org.opendatakit.briefcase.export.ExportConfiguration)2