1
2
3
4
5 package gboat2.base.core.web;
6
7 import gboat2.base.bridge.debug.DefaultDebugHook;
8 import net.sf.json.JSONArray;
9 import net.sf.json.JSONObject;
10
11
12
13
14
15
16
17
18
19
20 public class MetadataEdit extends SplitMetadataStrategy {
21
22 private static SplitMetadataStrategy instance = new MetadataEdit();
23
24 public JSONObject decorateMetadata(JSONObject returned, String invokeMethod, BaseActionSupport action){
25 JSONArray operations = (JSONArray) returned.get("operations");
26
27 if (operations == null) {
28 operations = new JSONArray();
29 }
30
31 if (DefaultDebugHook.getInstance().devMode) {
32
33 operations.addAll(getSystemButtonsJSON(action, invokeMethod));
34 }
35
36 operations = filtMetaOperas(operations, action);
37 returned.put("operations", operations);
38
39 return returned;
40 }
41
42 public static SplitMetadataStrategy getInstance() {
43 return instance;
44 }
45 }