SEBA-622 Implement filetransfer API;
Support gRPC Reflection;
Mark bookkeeping fields in xproto
Change-Id: Ia8e925a520b7821e72f7c3e9c018ce9cceb8a3ab
diff --git a/lib/xos-genx/xosgenx/jinja2_extensions/base.py b/lib/xos-genx/xosgenx/jinja2_extensions/base.py
index c8f5bfe..26564bb 100644
--- a/lib/xos-genx/xosgenx/jinja2_extensions/base.py
+++ b/lib/xos-genx/xosgenx/jinja2_extensions/base.py
@@ -425,6 +425,15 @@
if "max_length" in field["options"] and field["type"] == "string":
options.append("(val).maxLength = %s" % field["options"]["max_length"])
+ if field["options"].get("feedback_state"):
+ options.append("(feedbackState) = true")
+
+ if field["options"].get("gui_hidden"):
+ options.append("(guiHidden) = true")
+
+ if field["options"].get("bookkeeping_state"):
+ options.append("(bookkeepingState) = true")
+
try:
if field["options"]["null"] == "False":
options.append("(val).nonNull = true")
diff --git a/lib/xos-genx/xosgenx/targets/protoapi.xtarget b/lib/xos-genx/xosgenx/targets/protoapi.xtarget
index e87e7d8..0359c46 100644
--- a/lib/xos-genx/xosgenx/targets/protoapi.xtarget
+++ b/lib/xos-genx/xosgenx/targets/protoapi.xtarget
@@ -35,8 +35,8 @@
repeated int32 {{ ref.src_port }}_ids = {{ ref["id"] }} [(reverseForeignKey).modelName = "{{ ref.peer.name }}"];
{%- endif -%}
{%- endfor %}
- string class_names = 2046;
- string self_content_type_id = 2047;
+ string class_names = 2046 [(bookkeepingState) = true];
+ string self_content_type_id = 2047 [(bookkeepingState) = true];
}
message {{ xproto_pluralize(object) }} {
diff --git a/lib/xos-genx/xosgenx/validator.py b/lib/xos-genx/xosgenx/validator.py
index d95c5d7..48f0fb5 100644
--- a/lib/xos-genx/xosgenx/validator.py
+++ b/lib/xos-genx/xosgenx/validator.py
@@ -29,10 +29,11 @@
# Options that are always allowed
COMMON_OPTIONS = ["help_text", "gui_hidden", "tosca_key", "tosca_key_one_of",
- "feedback_state", "unique", "unique_with"]
+ "bookkeeping_state", "feedback_state", "unique", "unique_with"]
# Options that must be either "True" or "False"
-BOOLEAN_OPTIONS = ["blank", "db_index", "feedback_state", "gui_hidden", "null", "tosca_key", "unique", "text"]
+BOOLEAN_OPTIONS = ["blank", "db_index", "bookkeeping_state", "feedback_state", "gui_hidden", "null",
+ "tosca_key", "unique", "text"]
class XProtoValidator(object):