Skip to content

Commit df9b301

Browse files
committed
Item 6599: Java remote api Domain and ProtocolDescriptor object params for use with assay protocols
- assay-saveProtocol.api call expects the "URL" and "PHI" properties to be lowercase for some reason SVN r64862 |2019-12-17 22:23:34 +0000
1 parent e0fbb6a commit df9b301

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

java/src/org/labkey/remoteapi/domain/Domain.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ public Domain(JSONObject json)
4848
}
4949

5050
public JSONObject toJSONObject()
51+
{
52+
return toJSONObject(false);
53+
}
54+
55+
public JSONObject toJSONObject(boolean forProtocol)
5156
{
5257
JSONObject result = new JSONObject();
5358

@@ -63,7 +68,7 @@ public JSONObject toJSONObject()
6368
result.put("fields", fields);
6469
for (PropertyDescriptor field : _fields)
6570
{
66-
fields.add(field.toJSONObject());
71+
fields.add(field.toJSONObject(forProtocol));
6772
}
6873
return result;
6974
}

java/src/org/labkey/remoteapi/domain/PropertyDescriptor.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ public PropertyDescriptor(JSONObject json)
7878
}
7979

8080
public JSONObject toJSONObject()
81+
{
82+
return toJSONObject(false);
83+
}
84+
85+
public JSONObject toJSONObject(boolean forProtocol)
8186
{
8287
JSONObject result = new JSONObject();
8388

@@ -104,6 +109,15 @@ public JSONObject toJSONObject()
104109
result.put("lookupQuery", _lookupQuery);
105110
result.put("lookupContainer", _lookupContainer);
106111
}
112+
113+
if (forProtocol)
114+
{
115+
result.put("url", result.get("URL"));
116+
result.remove("URL");
117+
result.put("phi", result.get("PHI"));
118+
result.remove("PHI");
119+
}
120+
107121
return result;
108122
}
109123

0 commit comments

Comments
 (0)