From acaade1022ad4a3b83f9ad8cf56d23018f9e409e Mon Sep 17 00:00:00 2001 From: Teo Sarca Date: Fri, 5 May 2017 22:32:27 +0300 Subject: [PATCH] deprecate JSONDocumentLayout.type => use windowId https://github.com/metasfresh/metasfresh-webui-api/issues/348 --- .../window/datatypes/json/JSONDocumentLayout.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main/java/de/metas/ui/web/window/datatypes/json/JSONDocumentLayout.java b/src/main/java/de/metas/ui/web/window/datatypes/json/JSONDocumentLayout.java index 8514c003e..f00aaf4fc 100644 --- a/src/main/java/de/metas/ui/web/window/datatypes/json/JSONDocumentLayout.java +++ b/src/main/java/de/metas/ui/web/window/datatypes/json/JSONDocumentLayout.java @@ -57,9 +57,13 @@ public static final JSONDocumentLayout ofDetailTab(final DocumentLayoutDetailDes { return new JSONDocumentLayout(detailLayout, jsonOpts); } + + @JsonProperty("windowId") + private final String windowId; /** i.e. AD_Window_ID */ @JsonProperty("type") + @Deprecated private final String type; @JsonProperty("tabid") @@ -114,7 +118,8 @@ public static final JSONDocumentLayout ofDetailTab(final DocumentLayoutDetailDes */ private JSONDocumentLayout(final DocumentLayoutDescriptor layout, final JSONOptions jsonOpts) { - type = String.valueOf(layout.getAD_Window_ID()); + windowId = String.valueOf(layout.getAD_Window_ID()); + type = windowId; tabid = null; caption = layout.getCaption(jsonOpts.getAD_Language()); @@ -166,7 +171,8 @@ private JSONDocumentLayout(final DocumentLayoutDetailDescriptor detailLayout, fi { final String adLanguage = jsonOpts.getAD_Language(); - type = String.valueOf(detailLayout.getAD_Window_ID()); + windowId = String.valueOf(detailLayout.getAD_Window_ID()); + type = windowId; final DetailId detailId = detailLayout.getDetailId(); tabid = DetailId.toJson(detailId); @@ -192,7 +198,7 @@ private JSONDocumentLayout(final DocumentLayoutDetailDescriptor detailLayout, fi @JsonCreator private JSONDocumentLayout( - @JsonProperty("type") final String type// + @JsonProperty("windowId") final String windowId// , @JsonProperty("tabid") final String tabId // , @JsonProperty("caption") final String caption // , @JsonProperty("documentSummaryElement") final JSONDocumentLayoutElement documentSummaryElement // @@ -205,7 +211,8 @@ private JSONDocumentLayout( ) { - this.type = type; + this.windowId = windowId; + type = windowId; tabid = Strings.emptyToNull(tabId); this.caption = caption;