Skip to content

Commit

Permalink
Read auto_delete and auto_send from form
Browse files Browse the repository at this point in the history
  • Loading branch information
grzesiek2010 committed Jul 10, 2017
1 parent e608d45 commit afe421e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,9 @@ private ContentValues buildContentValues(File formDefFile) throws IllegalArgumen
if (base64RsaPublicKey != null) {
updateValues.put(FormsColumns.BASE64_RSA_PUBLIC_KEY, base64RsaPublicKey);
}
updateValues.put(FormsColumns.AUTO_DELETE, fields.get(FileUtils.AUTO_DELETE));
updateValues.put(FormsColumns.AUTO_SUBMIT, fields.get(FileUtils.AUTO_SUBMIT));

// Note, the path doesn't change here, but it needs to be included so the
// update will automatically update the .md5 and the cache path.
updateValues.put(FormsColumns.FORM_FILE_PATH, formDefFile.getAbsolutePath());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ public class FileUtils {
public static final String TITLE = "title";
public static final String SUBMISSIONURI = "submission";
public static final String BASE64_RSA_PUBLIC_KEY = "base64RsaPublicKey";
public static final String AUTO_DELETE = "autoDelete";
public static final String AUTO_SUBMIT = "autoSubmit";

public static String getMimeType(String fileUrl)
throws java.io.IOException {
Expand Down Expand Up @@ -374,7 +376,11 @@ public static HashMap<String, String> parseXML(File xmlFile) {
try {
Element submission = model.getElement(xforms, "submission");
String submissionUri = submission.getAttributeValue(null, "action");
fields.put(SUBMISSIONURI, (submissionUri == null) ? null : submissionUri);
String autoDelete = submission.getAttributeValue(null, "auto-delete");
String autoSubmit = submission.getAttributeValue(null, "auto-submit");
fields.put(SUBMISSIONURI, submissionUri);
fields.put(AUTO_DELETE, autoDelete);
fields.put(AUTO_SUBMIT, autoSubmit);
String base64RsaPublicKey = submission.getAttributeValue(null,
"base64RsaPublicKey");
fields.put(BASE64_RSA_PUBLIC_KEY,
Expand Down

0 comments on commit afe421e

Please sign in to comment.