Skip to content

Commit

Permalink
deprecate JSONDocumentLayout.type => use windowId
Browse files Browse the repository at this point in the history
  • Loading branch information
teosarca committed May 5, 2017
1 parent 05df4cc commit acaade1
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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);
Expand All @@ -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 //
Expand All @@ -205,7 +211,8 @@ private JSONDocumentLayout(

)
{
this.type = type;
this.windowId = windowId;
type = windowId;
tabid = Strings.emptyToNull(tabId);

this.caption = caption;
Expand Down

0 comments on commit acaade1

Please sign in to comment.