use of org.javarosa.core.services.storage.IStorageUtility in project javarosa by opendatakit.
the class CompactInstanceWrapper method loadTemplateInstance.
/**
* load a template instance fresh from the original FormDef, retrieved from RMS
* @param formID
* @return
*/
public static FormInstance loadTemplateInstance(int formID) {
IStorageUtility forms = StorageManager.getStorage(FormDef.STORAGE_KEY);
FormDef f = (FormDef) forms.read(formID);
return (f != null ? f.getMainInstance() : null);
}
use of org.javarosa.core.services.storage.IStorageUtility in project javarosa by opendatakit.
the class ModelReferencePayload method memoize.
private void memoize() {
if (payload == null) {
IStorageUtility<FormInstance> instances = (IStorageUtility<FormInstance>) StorageManager.getStorage(FormInstance.STORAGE_KEY);
try {
FormInstance tree = instances.read(recordId);
payload = serializer.createSerializedPayload(tree);
} catch (IOException e) {
// Assertion, do not catch!
Std.printStack(e);
throw new RuntimeException("ModelReferencePayload failed to retrieve its model from rms [" + e.getMessage() + "]");
}
}
}
Aggregations