Example #1
0
 /**
  * @param queryDetailsObj queryDetailsObj
  * @param dagPanel dagPanel
  * @param entityList entityList
  * @param strToCreateQueryObjectList strToCreateQueryObjectList
  */
 private static void createQueryObject(
     QueryDetails queryDetailsObj,
     DAGPanel dagPanel,
     List<EntityInterface> entityList,
     List<String> strToCreateQueryObjectList) {
   for (int counter = 0; counter < entityList.size(); counter++) {
     dagPanel.createQueryObject(
         strToCreateQueryObjectList.get(counter),
         entityList.get(counter).getId().toString(),
         AQConstants.ADD,
         queryDetailsObj,
         null);
   }
 }
Example #2
0
 /**
  * Adds main protocol object (CS/CP) to the query clone if its not present.
  *
  * @param queryDetailsObj queryDetailsObj
  * @param mapEntity mapEntity
  * @param dagPanel dagPanel
  * @return queryClone Modified query
  */
 private static IQuery addMainProtocolObjInQuery(
     QueryDetails queryDetailsObj, EntityInterface mapEntity, DAGPanel dagPanel) {
   IQuery queryClone = new DyExtnObjectCloner().clone(queryDetailsObj.getQuery());
   queryDetailsObj.setQuery(queryClone);
   String mainEntityId = "";
   boolean isMainObjPresent = false;
   IQuery originalQuery = queryDetailsObj.getQuery();
   IConstraints constraints = originalQuery.getConstraints();
   Set<IQueryEntity> queryEntities = constraints.getQueryEntities();
   EntityInterface mainEntity = null;
   for (IQueryEntity queryEntity : queryEntities) {
     if (queryEntity.getDynamicExtensionsEntity().getName().equals(Variables.mainProtocolObject)) {
       mainEntity = queryEntity.getDynamicExtensionsEntity();
       mainEntityId = mainEntity.getId().toString();
       isMainObjPresent = true;
       break;
     }
   }
   if (isMainObjPresent && queryDetailsObj.getSessionData().isSecurityRequired()) {
     StringBuffer strToCreateObject = new StringBuffer();
     Map<RelationalOperator, List<String>> oprVsLstOfVals =
         new HashMap<RelationalOperator, List<String>>();
     callModifyRule(mainEntityId, strToCreateObject, constraints, oprVsLstOfVals);
     dagPanel.createQueryObject(
         strToCreateObject.toString(),
         mainEntity.getId().toString(),
         AQConstants.EDIT,
         queryDetailsObj,
         oprVsLstOfVals);
   } else {
     dagPanel.createQueryObject(
         null, mapEntity.getId().toString(), AQConstants.ADD, queryDetailsObj, null);
   }
   queryClone = queryDetailsObj.getQuery();
   queryDetailsObj.setQuery(originalQuery);
   return queryClone;
 }