WIP associations parameter
This commit is contained in:
+11
-3
@@ -107,9 +107,9 @@ public class ApiJSONFormattingServiceImpl implements ApiJSONFormattingService {
|
|||||||
return fieldList;
|
return fieldList;
|
||||||
}
|
}
|
||||||
|
|
||||||
//No template query param provided
|
// No template query param provided
|
||||||
if (filterType.equals("E")) {
|
if (filterType.equals("E")) {
|
||||||
fieldList = allowedFieldList; //exclude
|
fieldList = allowedFieldList; // exclude
|
||||||
}
|
}
|
||||||
|
|
||||||
return fieldList;
|
return fieldList;
|
||||||
@@ -122,12 +122,16 @@ public class ApiJSONFormattingServiceImpl implements ApiJSONFormattingService {
|
|||||||
if (isPassed(param)) {
|
if (isPassed(param)) {
|
||||||
logger.info("is associations");
|
logger.info("is associations");
|
||||||
if (param.equalsIgnoreCase("ALL")) {
|
if (param.equalsIgnoreCase("ALL")) {
|
||||||
|
logger.info("is ALL");
|
||||||
if (filterType.equals("I")) {
|
if (filterType.equals("I")) {
|
||||||
|
logger.info("is Include");
|
||||||
return fieldList + "," + associationFields;
|
return fieldList + "," + associationFields;
|
||||||
}
|
}
|
||||||
|
logger.info("is Exclude");
|
||||||
return fieldList;
|
return fieldList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
logger.info("Not ALL");
|
||||||
Set<String> fullAssociationsSet = createSetFromString(associationFields);
|
Set<String> fullAssociationsSet = createSetFromString(associationFields);
|
||||||
Set<String> paramAssociationsSet = createSetFromString(param);
|
Set<String> paramAssociationsSet = createSetFromString(param);
|
||||||
|
|
||||||
@@ -135,11 +139,15 @@ public class ApiJSONFormattingServiceImpl implements ApiJSONFormattingService {
|
|||||||
|
|
||||||
String selectedAssociationFields = createIncludedInStringList(
|
String selectedAssociationFields = createIncludedInStringList(
|
||||||
paramAssociationsSet, fullAssociationsSet);
|
paramAssociationsSet, fullAssociationsSet);
|
||||||
|
logger.info("is Include - selected fields are :"
|
||||||
|
+ selectedAssociationFields);
|
||||||
return fieldList + "," + selectedAssociationFields;
|
return fieldList + "," + selectedAssociationFields;
|
||||||
}
|
}
|
||||||
|
|
||||||
String unSelectedAssociationFields = createNotIncludedInStringList(
|
String unSelectedAssociationFields = createNotIncludedInStringList(
|
||||||
paramAssociationsSet, fullAssociationsSet);
|
fullAssociationsSet, paramAssociationsSet);
|
||||||
|
logger.info("is Exclude - unselected fields are :"
|
||||||
|
+ unSelectedAssociationFields);
|
||||||
|
|
||||||
if (fieldList.equals("")) {
|
if (fieldList.equals("")) {
|
||||||
return unSelectedAssociationFields;
|
return unSelectedAssociationFields;
|
||||||
|
|||||||
Reference in New Issue
Block a user