Commit b32b42f6 authored by Rahadi Jalu's avatar Rahadi Jalu

Current Changes

parent 2ee4e7a9
Pipeline #145 canceled with stages
......@@ -53,18 +53,6 @@ Secara umum, pengembangan aplikasi lebih lanjut dapat dilakukan dengan langkah-l
7. Untuk melakukan run project, tekan tombol panah hijau di bagian atas dari Android Studio.
> Note: Penggunaan emulator mungkin dapat mengakibatkan aplikasi berjalan lambat. Oleh karena itu, disarankan untuk menggunakan device selama memungkinkan.
## Panduan & Dokumentasi
Berikut adalah *table of content* dari panduan yang tersedia:
1. Instalasi aplikasi
- Menggunakan APK
- Run project pada Android Studio
2. Penggunaan aplikasi
- Konfigurasi Server
- User Interface pemutakhiran
- Keterkaitan Kuesioner
## Credits
Banyak pihak yang telah dilibatkan dalam melakukan pengembangan aplikasi ini. Oleh karena itu, pengembang mengucapkan terima kasih kepada:
......
......@@ -313,7 +313,7 @@ public class CapiInstanceActivity extends AppCompatActivity
HashMap<String, String> informations = new HashMap<>();
File file = new File(instance.getInstanceFilePath());
InstanceValues values = XmlUtils.getInstanceValues(instance.getInstanceUuid(), file, labels);
InstanceValues values = XmlUtils.getInstanceValues(instance.getInstanceUuid(), file, labels, InstanceValues.STATE_NEUTRAL);
Set<String> parsedXpaths = values.getXPaths();
for(String parsed : parsedXpaths) {
if(parsed.equals(titleSelected)) {
......
package id.ac.stis.capi.lessthink.activities;
import android.content.ContentUris;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.SearchView;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import org.apache.commons.lang3.ArrayUtils;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import id.ac.stis.capi.R;
import id.ac.stis.capi.collectiva.preferences.Constants;
import id.ac.stis.capi.lessthink.binders.NodeViewFactory;
import id.ac.stis.capi.lessthink.fragments.FormEntryDialogFragment;
import id.ac.stis.capi.lessthink.fragments.InstancePreferenceFragment;
import id.ac.stis.capi.lessthink.listeners.InstanceDownloadListener;
import id.ac.stis.capi.lessthink.listeners.InstanceListDownloadListener;
import id.ac.stis.capi.lessthink.listeners.InstanceValueListener;
import id.ac.stis.capi.lessthink.listeners.OnEntrySavedListener;
import id.ac.stis.capi.lessthink.listeners.OnTableAddButtonClickListener;
import id.ac.stis.capi.lessthink.models.FormLabels;
import id.ac.stis.capi.lessthink.models.InstanceValues;
import id.ac.stis.capi.lessthink.models.ModeTreeNode;
import id.ac.stis.capi.lessthink.tasks.InstanceDownloadTask;
import id.ac.stis.capi.lessthink.tasks.InstanceListDownloadTask;
import id.ac.stis.capi.lessthink.tasks.InstanceValueTask;
import id.ac.stis.capi.lessthink.utils.XmlUtils;
import id.ac.stis.capi.lessthink.views.TableFooterView;
import id.ac.stis.capi.lessthink.views.TableHeaderView;
......@@ -43,15 +53,16 @@ import id.ac.stis.capi.odk.dto.Form;
import id.ac.stis.capi.odk.dto.Instance;
import id.ac.stis.capi.odk.listeners.DeleteInstancesListener;
import id.ac.stis.capi.odk.listeners.DiskSyncListener;
import id.ac.stis.capi.odk.provider.FormsProviderAPI;
import id.ac.stis.capi.odk.provider.InstanceProviderAPI;
import id.ac.stis.capi.odk.tasks.DeleteInstancesTask;
import id.ac.stis.capi.odk.tasks.InstanceSyncTask;
import id.ac.stis.capi.odk.utilities.ApplicationConstants;
import me.texy.treeview.TreeNode;
import me.texy.treeview.TreeView;
import timber.log.Timber;
public class InstanceActivity extends AppCompatActivity implements OnEntrySavedListener, SearchView.OnQueryTextListener,
DiskSyncListener, DeleteInstancesListener{
public class InstanceActivity extends AppCompatActivity implements OnEntrySavedListener,
SearchView.OnQueryTextListener, DiskSyncListener, DeleteInstancesListener,
InstanceListDownloadListener, InstanceDownloadListener, InstanceValueListener {
private static final String FORM_ID_KEY = "formid";
private static final String FORMNAME = "formname";
......@@ -65,6 +76,12 @@ public class InstanceActivity extends AppCompatActivity implements OnEntrySavedL
private InstanceSyncTask instanceSyncTask;
private DeleteInstancesTask deleteInstancesTask;
private LinearLayout progressBarHolder;
private FrameLayout downloadButton;
private InstanceListDownloadTask listDownloadTask;
private TextView initDataCountView;
private InstanceDownloadTask downloadTask;
private InstanceValueTask instanceValueTask;
private ProgressDialog dialog;
@Override
protected void onCreate(Bundle savedInstanceState) {
......@@ -77,6 +94,8 @@ public class InstanceActivity extends AppCompatActivity implements OnEntrySavedL
tableRowView = findViewById(R.id.row_view);
tableFooterView = findViewById(R.id.footer_view);
progressBarHolder = findViewById(R.id.loading_container);
downloadButton = findViewById(R.id.init_data_download);
initDataCountView = findViewById(R.id.init_data_count);
formId = getIntent().getStringExtra(FORM_ID_KEY);
formName = getIntent().getStringExtra(FORMNAME);
......@@ -86,9 +105,44 @@ public class InstanceActivity extends AppCompatActivity implements OnEntrySavedL
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
instanceSyncTask = new InstanceSyncTask();
instanceSyncTask.setDiskSyncListener(this);
instanceSyncTask.execute();
FormsDao formsDao = new FormsDao();
List<Form> forms = formsDao.getFormsFromCursor(formsDao.getFormsCursorForFormId(formId));
File file = new File(forms.get(0).getFormFilePath());
List<String> xPaths = XmlUtils.getInstanceXPathList(file, false);
labels = XmlUtils.getFormLabels(formId, file, xPaths);
tableHeaderView.setColumns(labels);
tableRowView.initView();
tableRowView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Toast.makeText(InstanceActivity.this, "Click : " + view.getTag(), Toast.LENGTH_LONG).show();
String instanceUuid = view.getTag().toString();
// entryDialogFragment = FormEntryDialogFragment.newInstance(instanceUuid,
// FormEntryDialogFragment.MODE_EDIT, false);
entryDialogFragment = FormEntryDialogFragment.newInstance(instanceUuid, formId);
entryDialogFragment.show(getSupportFragmentManager(), instanceUuid);
entryDialogFragment.setOnEntrySavedListener(InstanceActivity.this);
//
// Intent i =new Intent(InstanceActivity.this, ListingFormEntryActivity.class);
// i.putExtra("instanceUuid", view.getTag().toString());
// startActivity(i);
}
});
tableFooterView.setOnTableAddButtonClickListener(new OnTableAddButtonClickListener() {
@Override
public void onAddButtonClick(View v) {
fillBlankForm();
}
});
listDownloadTask = new InstanceListDownloadTask(formId);
listDownloadTask.setDownloaderListener(this);
listDownloadTask.execute();
onStartLoading();
}
......@@ -107,19 +161,24 @@ public class InstanceActivity extends AppCompatActivity implements OnEntrySavedL
@Override
protected void onResume() {
if (instanceSyncTask != null) {
instanceSyncTask.setDiskSyncListener(this);
onStartLoading();
}
super.onResume();
if (instanceSyncTask.getStatus() == AsyncTask.Status.FINISHED) {
// if (instanceSyncTask != null) {
// instanceSyncTask.setDiskSyncListener(this);
// onStartLoading();
// }
if (instanceSyncTask != null && instanceSyncTask.getStatus() == AsyncTask.Status.FINISHED) {
syncComplete(instanceSyncTask.getStatusMessage());
}
if (deleteInstancesTask != null
&& deleteInstancesTask.getStatus() == AsyncTask.Status.FINISHED) {
if (deleteInstancesTask != null && deleteInstancesTask.getStatus() == AsyncTask.Status.FINISHED) {
deleteComplete(deleteInstancesTask.getDeleteCount());
}
if (listDownloadTask != null && listDownloadTask.getStatus() == AsyncTask.Status.FINISHED) {
instanceListDownloadingComplete(listDownloadTask.getDownloadedUri());
}
}
@Override
......@@ -132,6 +191,10 @@ public class InstanceActivity extends AppCompatActivity implements OnEntrySavedL
deleteInstancesTask.setDeleteListener(null);
}
if (listDownloadTask != null) {
listDownloadTask.setDownloaderListener(null);
}
super.onPause();
}
......@@ -171,29 +234,10 @@ public class InstanceActivity extends AppCompatActivity implements OnEntrySavedL
}
private void refreshItem(boolean init) {
List<InstanceValues> instanceValues = new LinkedList<>();
String selection = InstanceProviderAPI.InstanceColumns.LATEST + " =? AND " +
InstanceProviderAPI.InstanceColumns.JR_FORM_ID + " =?";
String[] selectionArgs = new String[]{InstanceProviderAPI.LATEST_VERSION, formId};
InstancesDao instancesDao = new InstancesDao();
// TODO: 30/06/2018 Sorting order
Cursor data = instancesDao.getInstancesCursor(null, selection, selectionArgs, null);
List<Instance> instanceList = instancesDao.getInstancesFromCursor(data);
for (Instance instance : instanceList) {
File f = new File(instance.getInstanceFilePath());
InstanceValues values = XmlUtils.getInstanceValues(instance.getInstanceUuid(), f, labels);
instanceValues.add(values);
}
if (init) {
tableRowView.initView(instanceValues);
} else {
tableRowView.setRows(instanceValues);
}
private void refreshItem() {
instanceValueTask = new InstanceValueTask(labels);
instanceValueTask.setInstanceValueListener(this);
instanceValueTask.execute();
}
@Override
......@@ -212,7 +256,7 @@ public class InstanceActivity extends AppCompatActivity implements OnEntrySavedL
@Override
public void onEntrySaved() {
refreshItem(false);
refreshItem();
}
@Override
......@@ -226,44 +270,38 @@ public class InstanceActivity extends AppCompatActivity implements OnEntrySavedL
}
@Override
public void syncComplete(String result) {
onDoneLoading();
FormsDao formsDao = new FormsDao();
List<Form> forms = formsDao.getFormsFromCursor(formsDao.getFormsCursorForFormId(formId));
File file = new File(forms.get(0).getFormFilePath());
List<String> xPaths = XmlUtils.getInstanceXPathList(file);
labels = XmlUtils.getFormLabels(formId, file, xPaths);
tableHeaderView.setColumns(labels);
refreshItem(true);
tableRowView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
// Toast.makeText(InstanceActivity.this, "Click : " + view.getTag(), Toast.LENGTH_LONG).show();
public void instanceListDownloadingComplete(final Map<String, String> instances) {
if (instances.size() > 0) {
initDataCountView.setText("(" + instances.size() + ")");
downloadButton.setVisibility(View.VISIBLE);
downloadButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
dialog = new ProgressDialog(InstanceActivity.this);
dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
dialog.setCancelable(false);
dialog.setMessage(getString(R.string.please_wait));
dialog.show();
downloadTask = new InstanceDownloadTask(formId, instances);
downloadTask.setDownloaderListener(InstanceActivity.this);
downloadTask.execute();
}
});
} else {
downloadButton.setVisibility(View.GONE);
}
String instanceUuid = view.getTag().toString();
// entryDialogFragment = FormEntryDialogFragment.newInstance(instanceUuid,
// FormEntryDialogFragment.MODE_EDIT, false);
entryDialogFragment = FormEntryDialogFragment.newInstance(instanceUuid, formId);
entryDialogFragment.show(getSupportFragmentManager(), instanceUuid);
entryDialogFragment.setOnEntrySavedListener(InstanceActivity.this);
//
// Intent i =new Intent(InstanceActivity.this, ListingFormEntryActivity.class);
// i.putExtra("instanceUuid", view.getTag().toString());
// startActivity(i);
}
});
instanceSyncTask = new InstanceSyncTask();
instanceSyncTask.setDiskSyncListener(this);
instanceSyncTask.execute();
}
tableFooterView.setOnTableAddButtonClickListener(new OnTableAddButtonClickListener() {
@Override
public void onAddButtonClick(View v) {
fillBlankForm();
}
});
@Override
public void syncComplete(String result) {
refreshItem();
}
@Override
......@@ -273,9 +311,9 @@ public class InstanceActivity extends AppCompatActivity implements OnEntrySavedL
private void onStartLoading() {
progressBarHolder.setVisibility(View.VISIBLE);
tableHeaderView.setVisibility(View.GONE);
tableRowView.setVisibility(View.GONE);
tableFooterView.setVisibility(View.GONE);
// tableHeaderView.setVisibility(View.INVISIBLE);
tableRowView.setVisibility(View.INVISIBLE);
tableFooterView.setVisibility(View.INVISIBLE);
}
private void onErrorLoading(String message) {
......@@ -284,8 +322,61 @@ public class InstanceActivity extends AppCompatActivity implements OnEntrySavedL
private void onDoneLoading() {
progressBarHolder.setVisibility(View.GONE);
tableHeaderView.setVisibility(View.VISIBLE);
// tableHeaderView.setVisibility(View.VISIBLE);
tableRowView.setVisibility(View.VISIBLE);
tableFooterView.setVisibility(View.VISIBLE);
}
@Override
public void onInstanceDownloadProgressUpdate(int progress, int total, String current) {
dialog.setMessage(getString(R.string.fetching_file, current, "" + progress, "" + total));
}
@Override
public void onInstanceDownloadCompleted(HashMap<String, String> result) {
dialog.dismiss();
TreeNode rootTreeNode = TreeNode.root();
Set<String> keySet = result.keySet();
for(String key : keySet) {
String status = result.get(key);
TreeNode childNode;
if(status.equals(InstanceDownloadTask.STATUS_SUCCESS)) {
childNode = new ModeTreeNode(key, "Success", ModeTreeNode.DOWNLOADED);
} else {
childNode = new ModeTreeNode(key, "Failed", ModeTreeNode.FAILED);
}
childNode.setExpanded(true);
childNode.setItemClickEnable(false);
rootTreeNode.addChild(childNode);
}
View treeView = new TreeView(rootTreeNode, this, new NodeViewFactory()).getView();
AlertDialog dialog = new AlertDialog.Builder(this)
.setTitle("Downloads Details")
.setView(treeView)
.setCancelable(false)
.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
dialogInterface.dismiss();
instanceSyncTask = new InstanceSyncTask();
instanceSyncTask.setDiskSyncListener(InstanceActivity.this);
instanceSyncTask.execute();
}
})
.create();
dialog.show();
}
@Override
public void onValueParsed(List<InstanceValues> values) {
tableRowView.setRows(values);
onDoneLoading();
}
}
......@@ -40,26 +40,12 @@ public class HierarchyAdapter extends RecyclerView.Adapter<HierarchyAdapter.View
@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
Timber.d("Creating with type %s", viewType);
// BaseHierarchy hierarchy = hierarchies.get(viewType);
// if (hierarchy instanceof PromptHierarchy) {
// ((PromptHierarchy) hierarchy).setOnChangeListener(onChangeListener);
// return new PromptViewHolder(hierarchy.getView());
// } else if (hierarchy instanceof CaptionHierarchy) {
// return new CaptionViewHolder(hierarchy.getView());
// } else {
// // Should not be happening
// return new ViewHolder(hierarchy.getView());
// }
return new ViewHolder(new LinearLayout(parent.getContext()));
}
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
// if (holder instanceof PromptViewHolder) {
// PromptHierarchy hierarchy = (PromptHierarchy) hierarchies.get(position);
// }
holder.bind(hierarchies.get(position));
}
......
......@@ -60,6 +60,9 @@ public class NodeViewFactory extends BaseNodeViewFactory {
case ModeTreeNode.QUEUED:
imageStatus.setImageResource(R.drawable.ic_download);
break;
case ModeTreeNode.FAILED:
imageStatus.setImageResource(R.drawable.ic_cancel);
break;
}
} else {
secondaryText.setVisibility(View.GONE);
......
......@@ -29,7 +29,7 @@ import id.ac.stis.capi.odk.dto.Form;
public class InstancePreferenceFragment extends BasePreferenceFragment {
private PreferencesManager manager;
private ListPreference viewModePref, titlePref, constraintPref;
private ListPreference viewModePref, titlePref, constraintPref, filterPref;
private MultiSelectListPreference subtitlePref;
private String formId;
private FormLabels formLabels;
......@@ -53,7 +53,8 @@ public class InstancePreferenceFragment extends BasePreferenceFragment {
List<Form> forms = formsDao.getFormsFromCursor(formsDao.getFormsCursorForFormId(formId));
File file = new File(forms.get(0).getFormFilePath());
List<String> xPaths = XmlUtils.getInstanceXPathList(file);
List<String> xPaths = XmlUtils.getInstanceXPathList(file, false);
formLabels = XmlUtils.getFormLabels(formId, file, xPaths);
entries = new LinkedList<>();
......@@ -87,11 +88,14 @@ public class InstancePreferenceFragment extends BasePreferenceFragment {
}
if (titlePref != null) {
entries.addFirst("Default Title");
entryValues.addFirst(PreferencesAPI.TITLE_DEFAULT);
LinkedList<String> titleEntries = new LinkedList<>(entries);
titleEntries.addFirst("Default Title");
LinkedList<String> titleEntryValues = new LinkedList<>(entryValues);
titleEntryValues.addFirst(PreferencesAPI.TITLE_DEFAULT);
titlePref.setEntries(entries.toArray(new CharSequence[entries.size()]));
titlePref.setEntryValues(entryValues.toArray(new CharSequence[entryValues.size()]));
titlePref.setEntries(titleEntries.toArray(new CharSequence[titleEntries.size()]));
titlePref.setEntryValues(titleEntryValues.toArray(new CharSequence[titleEntryValues.size()]));
}
String value = (String) manager.getByFormId(PreferencesAPI.KEY_VIEW_MODE, formId);
......@@ -141,6 +145,22 @@ public class InstancePreferenceFragment extends BasePreferenceFragment {
break;
}
}
filterPref = (ListPreference) findPreference(PreferencesAPI.KEY_FILTER);
if (filterPref != null) {
LinkedList<String> filterEntries = new LinkedList<>(entries);
filterEntries.addFirst("None");
LinkedList<String> filterEntryValues = new LinkedList<>(entryValues);
filterEntryValues.addFirst(PreferencesAPI.FILTER_NONE);
filterPref.setEntries(filterEntries.toArray(new CharSequence[filterEntries.size()]));
filterPref.setEntryValues(filterEntryValues.toArray(new CharSequence[filterEntryValues.size()]));
String val = (String) manager.getByFormId(PreferencesAPI.KEY_FILTER, formId);
setSelectSummary(filterPref, val);
filterPref.setValue(val);
}
}
private void setListeners() {
......@@ -228,6 +248,19 @@ public class InstancePreferenceFragment extends BasePreferenceFragment {
}
});
}
if (filterPref != null) {
setSelectSummary(filterPref, (String) manager.getByFormId(PreferencesAPI.KEY_FILTER, formId));
filterPref.setKey(manager.getKey(filterPref.getKey(), formId));
filterPref.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
setSelectSummary(filterPref, newValue.toString());
return true;
}
});
}
}
private String getViewModeValue(String entryValue) {
......@@ -253,8 +286,13 @@ public class InstancePreferenceFragment extends BasePreferenceFragment {
}
private void setSelectSummary(ListPreference preference, String entryValue) {
if(entryValue.isEmpty() || entryValue.trim().length() == 0 || entryValue.equals(PreferencesAPI.TITLE_DEFAULT)) {
if (entryValue == null
|| entryValue.isEmpty()
|| entryValue.trim().length() == 0
|| entryValue.equals(PreferencesAPI.TITLE_DEFAULT)) {
preference.setSummary("Default Title");
} else if (entryValue.equals(PreferencesAPI.FILTER_NONE)) {
preference.setSummary("None");
} else {
preference.setSummary(formLabels.getFormLabel(entryValue));
}
......@@ -263,7 +301,7 @@ public class InstancePreferenceFragment extends BasePreferenceFragment {
private void setMultiSelectSummary(MultiSelectListPreference preference, HashSet<String> set) {
boolean first = true;
if(!set.isEmpty()) {
if (!set.isEmpty()) {
StringBuilder values = new StringBuilder();
for (String v : set) {
if (!first) {
......
......@@ -11,14 +11,23 @@ import java.util.Set;
*/
public class InstanceValues implements Serializable {
// TODO: parsing instance value dobel ning instance karo group activity
public static int STATE_NEUTRAL = 0;
public static int STATE_ACTIVE = 1;
public static int STATE_COMPLETED = 2;
private String instanceId;
private String formId;
private int state;
private Map<String, String> instanceValue;
public InstanceValues(String instanceId, String formId, Map<String, String> instanceValue) {
public InstanceValues(String instanceId, String formId, Map<String, String> instanceValue,
int state) {
this.instanceId = instanceId;
this.formId = formId;
this.instanceValue = instanceValue;
this.state = state;
}
public InstanceValues putInstanceValue(String xPath, String value) {
......@@ -46,4 +55,7 @@ public class InstanceValues implements Serializable {
return instanceValue.get(xPath);
}
public int getState() {
return state;
}
}
......@@ -11,6 +11,7 @@ public class ModeTreeNode extends TreeNode {
public static final int DOWNLOADED = 0;
public static final int QUEUED = 1;
public static final int FAILED = 2;
private int mode;
private String valueId;
......
......@@ -9,10 +9,6 @@ import java.util.HashSet;
* Company: Politeknik Statistika STIS
*/
public class PreferencesAPI {
public static final String KEY_CATEGORY_APPEARANCE = "appearance_category";
public static final String KEY_RESPONSE_APPEARANCE = "response_category";
public static final String KEY_CONSTRAINT_APPEARANCE = "constraint_category";
public static final String KEY_VIEW_MODE = "view_mode";
public static final String KEY_TITLE = "title";
......@@ -20,8 +16,12 @@ public class PreferencesAPI {
public static final String KEY_CONSTRAINT = "constraint";
public static final String KEY_FILTER = "filter";
public static final String TITLE_DEFAULT = "default";
public static final String FILTER_NONE = "none";
public static final String VIEW_MODE_ROSTER = "roster";
public static final String VIEW_MODE_CARDS = "cards";
......
......@@ -55,7 +55,7 @@ public class XmlUtils {
/**
* Set values of an xml file by a map with key of xpath(s).
*
* @param file the XML file
* @param file the XML file
* @param values the map of xpath and value
* @return true if the operation succeed
*/
......@@ -93,7 +93,7 @@ public class XmlUtils {
/**
* Get init value rules supplied in the "initvalue" attribute inside a bind tag in a file.
*
* @param file the XML file
* @param file the XML file
* @param rootElement the root element of the XML xpath
* @return Map of init value rule defined by the key of xpath from "nodeset" attribute
*/
......@@ -162,7 +162,7 @@ public class XmlUtils {
/**
* Get instance values map of a file.
*
* @param file the XML file
* @param file the XML file
* @param xPaths the xpath to be evaluated
* @return Map of instance value defined by the key of xpath
*/
......@@ -196,7 +196,7 @@ public class XmlUtils {
/**
* Get instance value of a file.
*
* @param file the XML file
* @param file the XML file
* @param xpath the xpath to be evaluated
* @return Instance value
*/
......@@ -229,7 +229,7 @@ public class XmlUtils {
* @param file the XML file
* @return list of xpaths
*/
public static List<String> getInstanceXPathList(File file) {
public static List<String> getInstanceXPathList(File file, boolean formatted) {
InputStream is;
try {
......@@ -251,14 +251,7 @@ public class XmlUtils {
try {
doc = XFormParser.getXMLDocument(isr);
} catch (IOException e) {
Timber.e(e, "Unable to parse XML document %s", file.getAbsolutePath());
throw new IllegalStateException("Unable to parse XML document", e);
} finally {
try {
isr.close();
} catch (IOException e) {
Timber.w("%s error closing from reader", file.getAbsolutePath());