Skip to content

Commit

Permalink
[QueryDetail]
Browse files Browse the repository at this point in the history
-remove all columns only in case of execution, leave all columns in LOV testing view
  • Loading branch information
alecones committed Jun 20, 2016
1 parent 1572c3d commit 8ec25e2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,14 @@ public String toXML() {
* @see it.eng.spagobi.behaviouralmodel.lov.bo.ILovDetail#getLovResult( IEngUserProfile profile, List<ObjParuse> dependencies, ExecutionInstance
* executionInstance) throws Exception;
*/
@Override
public String getLovResult(IEngUserProfile profile, List<ObjParuse> dependencies, List<BIObjectParameter> BIObjectParameters, Locale locale)

@Override
public String getLovResult(IEngUserProfile profile, List<ObjParuse> dependencies, List<BIObjectParameter> bIObjectParameters, Locale locale)
throws Exception {
return getLovResult(profile, dependencies, bIObjectParameters, locale, false);
}

public String getLovResult(IEngUserProfile profile, List<ObjParuse> dependencies, List<BIObjectParameter> BIObjectParameters, Locale locale, boolean getAllColumns)
throws Exception {
logger.debug("IN");
Map<String, String> parameters = getParametersNameToValueMap(BIObjectParameters);
Expand All @@ -284,7 +290,7 @@ public String getLovResult(IEngUserProfile profile, List<ObjParuse> dependencies
statement = StringUtilities.substituteParametersInString(statement, parameters, types, false);
}
logger.info("User [" + ((UserProfile) profile).getUserId() + "] is executing sql: " + statement);
String result = getLovResult(profile, statement);
String result = getLovResult(profile, statement, getAllColumns);
logger.debug("OUT.result=" + result);
return result;
}
Expand Down Expand Up @@ -785,7 +791,7 @@ private BIObjectParameter getFatherParameter(ObjParuse dependency, List<BIObject
* @throws Exception
*/

private String getLovResult(IEngUserProfile profile, String statement) throws Exception {
private String getLovResult(IEngUserProfile profile, String statement, boolean getAllColumns) throws Exception {
String resStr = null;
DataConnection dataConnection = null;
SQLCommand sqlCommand = null;
Expand All @@ -802,7 +808,7 @@ private String getLovResult(IEngUserProfile profile, String statement) throws Ex
List<String> colNames = Arrays.asList(scrollableDataResult.getColumnNames());
List rows = result.getAttributeAsList(DataRow.ROW_TAG);
//insert all the columns name in the first row, so after all the columns will be present and returned to the client
if (rows.size() > 0){
if (getAllColumns && rows.size() > 0){
SourceBean rowBean = (SourceBean) rows.get(0);
for (int i = 0 ; i < colNames.size(); i++){
String col = colNames.get(i).toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public void doService() {
// statement = StringUtilities.substituteParametersInString(statement, paramFilled, null, false);
// // rowsSourceBean = (SourceBean) executeSelect(getRequestContainer(), getResponseContainer(), pool, statement, colNames);
// rowsSourceBean = (SourceBean) executeSelect(getRequestContainer(), getResponseContainer(), datasource, statement, colNames);
String result = qd.getLovResult(profile, null, toMockedBIObjectParameters(paramFilled), null);
String result = qd.getLovResult(profile, null, toMockedBIObjectParameters(paramFilled), null, true);
rowsSourceBean = SourceBean.fromXMLString(result);
colNames = findFirstRowAttributes(rowsSourceBean);
} catch (Exception e) {
Expand Down

0 comments on commit 8ec25e2

Please sign in to comment.