@cuby-ui/ar 0.0.16 → 0.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
Binary file
|
|
@@ -151,29 +151,29 @@ public class NativeBridge extends Plugin {
|
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
@PluginMethod
|
|
154
|
-
public void
|
|
155
|
-
String
|
|
156
|
-
if (
|
|
157
|
-
call.reject("Missing '
|
|
154
|
+
public void setJsonData(PluginCall call) {
|
|
155
|
+
String data = call.getString("data");
|
|
156
|
+
if (data == null) {
|
|
157
|
+
call.reject("Missing 'data' parameter");
|
|
158
158
|
return;
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
try {
|
|
162
|
-
ModelData.setJsonFile(
|
|
162
|
+
ModelData.setJsonFile(data);
|
|
163
163
|
JSObject ret = new JSObject();
|
|
164
164
|
ret.put("status", "jsonFileSet");
|
|
165
165
|
call.resolve(ret);
|
|
166
166
|
} catch (Exception e) {
|
|
167
|
-
call.reject("Failed to set JSON file
|
|
167
|
+
call.reject("Failed to set JSON file data", e);
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
|
|
171
171
|
@PluginMethod
|
|
172
|
-
public void
|
|
172
|
+
public void getJsonData(PluginCall call) {
|
|
173
173
|
try {
|
|
174
|
-
String
|
|
174
|
+
String data = ModelData.getJsonFile();
|
|
175
175
|
JSObject ret = new JSObject();
|
|
176
|
-
ret.put("
|
|
176
|
+
ret.put("jsonData", data);
|
|
177
177
|
call.resolve(ret);
|
|
178
178
|
} catch (Exception e) {
|
|
179
179
|
call.reject("Failed to get JSON file path", e);
|