Skip to content

Commit

Permalink
Fixed value for isConflict in views with disabled response hierarchy
Browse files Browse the repository at this point in the history
  • Loading branch information
klehmann committed Mar 1, 2019
1 parent 65825c3 commit cdfbc6f
Showing 1 changed file with 22 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,17 @@ public boolean isConflict() {
//C API documentation regarding conflict flags in views
//VIEW_TABLE_FLAG_CONFLICT - Replication conflicts will be flagged. If TRUE, the '$Conflict' item must be SECOND-TO-LAST in the list of summary items for this view.
if (m_columnValues!=null) {
return m_columnValues.length>=2 && m_columnValues[m_columnValues.length-2] != null;
if (!m_parentCollection.isConflict()) {
return false;
}
else if (m_parentCollection.isHierarchical()) {
return m_columnValues.length>=2 && m_columnValues[m_columnValues.length-2] != null;
}
else {
//special case for views which have "show response hierarchy" = false:
//here the response column value is missing
return m_columnValues.length>=2 && m_columnValues[m_columnValues.length-1] != null;
}
}
else if (m_summaryData!=null) {
return m_summaryData.get("$Conflict") != null;
Expand All @@ -171,7 +181,13 @@ public boolean isResponse() {
//C API documentation regarding response flags in views
//VIEW_TABLE_FLAG_FLATINDEX - Do not index hierarchically If FALSE, the '$REF' item must be LAST in the list of summary items for this view.
if (m_columnValues!=null) {
return m_columnValues.length>=1 && m_columnValues[m_columnValues.length-1] != null;
if (m_parentCollection.isHierarchical()) {
return m_columnValues.length>=1 && m_columnValues[m_columnValues.length-1] != null;
}
else {
//fallback to isConflict as this is the only info we have
return isConflict();
}
}
else if (m_summaryData!=null) {
return m_summaryData.get("$Ref") != null;
Expand Down Expand Up @@ -488,6 +504,10 @@ public void setColumnValues(Object[] itemValues) {
m_columnValues = itemValues;
}

public Object[] getColumnValues() {
return m_columnValues;
}

/**
* Returns an iterator of all available columns for which we can read column values
* (e.g. does not return static column names).<br>
Expand Down

0 comments on commit cdfbc6f

Please sign in to comment.