Examples of QueryInfo


Examples of com.facebook.presto.execution.QueryInfo

        private synchronized Iterable<List<Object>> getData(Duration maxWait)
                throws InterruptedException
        {
            // wait for query to start
            QueryInfo queryInfo = queryManager.getQueryInfo(queryId);
            while (maxWait.toMillis() > 1 && !isQueryStarted(queryInfo)) {
                maxWait = queryManager.waitForStateChange(queryId, queryInfo.getState(), maxWait);
                queryInfo = queryManager.getQueryInfo(queryId);
            }

            // if query did not finish starting or does not have output, just return
            if (!isQueryStarted(queryInfo) || queryInfo.getOutputStage() == null) {
                return null;
            }

            if (columns == null) {
                columns = createColumnsList(queryInfo);
            }

            updateExchangeClient(queryInfo.getOutputStage());

            ImmutableList.Builder<RowIterable> pages = ImmutableList.builder();
            // wait up to max wait for data to arrive; then try to return at least DESIRED_RESULT_BYTES
            int bytes = 0;
            while (bytes < DESIRED_RESULT_BYTES) {
View Full Code Here

Examples of com.facebook.presto.execution.QueryInfo

            throws Exception
    {
        URI location = client.execute(preparePost().setUri(uriFor("/v1/query")).setBodyGenerator(createStaticBodyGenerator("query", UTF_8)).build(), new CreatedResponseHandler());
        assertQueryStatus(location, QueryState.RUNNING);

        QueryInfo queryInfo = client.execute(prepareGet().setUri(location).build(), createJsonResponseHandler(jsonCodec(QueryInfo.class)));
        TaskInfo taskInfo = queryInfo.getOutputStage().getTasks().get(0);
        URI outputLocation = uriFor("/v1/task/" + taskInfo.getTaskId() + "/results/out");

        long sequenceId = 0;
        PagesResponse response = client.execute(
                prepareGet().setUri(uriBuilderFrom(outputLocation).appendPath(String.valueOf(sequenceId)).build()).build(),
View Full Code Here

Examples of com.facebook.presto.execution.QueryInfo

        JsonResponse<QueryInfo> response = client.execute(prepareGet().setUri(statusUri).build(), createFullJsonResponseHandler(jsonCodec(QueryInfo.class)));
        if (expectedQueryState == QueryState.FINISHED && response.getStatusCode() == HttpStatus.GONE.code()) {
            // when query finishes the server may delete it
            return;
        }
        QueryInfo queryInfo = response.getValue();
        assertEquals(queryInfo.getState(), expectedQueryState);
    }
View Full Code Here

Examples of com.sourcetap.sfa.util.QueryInfo

          uiScreenSection.getEntityParamVector());
         
      String primaryEntityName = uiScreenSection.getUiScreenSectionEntity(0).getUiEntity().getEntityName();
      // Specify how the primary entity will be retrieved.
      ArrayList orderBy = new ArrayList();
      QueryInfo queryInfo = new QueryInfo(delegator, primaryEntityName);
      Enumeration params = null;
      String searchAttribValue = "";
      String searchEntityName = "";
      String searchAttribName = "";
      String queryName = "";
View Full Code Here

Examples of com.sourcetap.sfa.util.QueryInfo

    public static List findByAnd(String entity, List entityExpressions,
        List orderBy, UserInfo userInfo, SecurityLinkInfo securityInfo,
        GenericDelegator delegator, String securityType) throws GenericEntityException {
        HashMap equalsMap = new HashMap();
        EntityExpr entityExpr = null;
        QueryInfo queryInfo = new QueryInfo( delegator, entity);

        //convert existing expressions into AND clauses.
        for (int i = 0; i < entityExpressions.size(); i++) {
            entityExpr = (EntityExpr) entityExpressions.get(i);

            Object lhs = (Object) entityExpr.getLhs();
            Object rhs = (Object) entityExpr.getRhs();
      EntityComparisonOperator op = (EntityComparisonOperator) entityExpr.getOperator();

            if (lhs instanceof EntityAttribute &&
                    rhs instanceof EntityAttribute) {
                lhs = (EntityAttribute) lhs;
                rhs = (EntityAttribute) rhs;
               
                String firstEntity = ((EntityAttribute) lhs).getEntity();
                String secondEntity = ((EntityAttribute) rhs).getEntity();
                if ( !firstEntity.equals(secondEntity) )
                {
          if ( !op.equals( EntityOperator.EQUALS ))
            throw new IllegalArgumentException("Join operator must be EQUALS");
           
                  queryInfo.addJoin(firstEntity, secondEntity, Boolean.FALSE, ((EntityAttribute) lhs).getField(),
                        ((EntityAttribute) rhs).getField());
        }
        else
        {
          queryInfo.addCondition( firstEntity, ((EntityAttribute) lhs).getField(), op, ((EntityAttribute) rhs).getField());
        }
            } else {
                if (lhs instanceof EntityAttribute) {
                  queryInfo.addCondition( ((EntityAttribute) lhs).getEntity(), ((EntityAttribute) lhs).getField(), op, rhs);
                } else {
          queryInfo.addCondition( entity, (String) lhs, op, rhs);
                }
            }
        }

        buildSecurityInfo(queryInfo, userInfo, securityInfo, entity, delegator, securityType);

    queryInfo.setOrderBy( orderBy );
    return queryInfo.executeQuery();
    }
View Full Code Here

Examples of com.sourcetap.sfa.util.QueryInfo

    public static List findByClause(String entity, List entityExpressions,
        List orderBy, UserInfo userInfo, SecurityLinkInfo securityInfo,
        GenericDelegator delegator, boolean old_not_used_anymore) throws GenericEntityException {

        Debug.logVerbose("[findByClause] userInfo: " + userInfo.toString(), module);
    QueryInfo queryInfo = new QueryInfo( delegator, entity)

        ArrayList newExpressions = new ArrayList(entityExpressions);
        HashMap equalsMap = new HashMap();
        buildSecurityInfo(queryInfo, userInfo, securityInfo, entity, delegator, "TEAM");
View Full Code Here

Examples of com.sourcetap.sfa.util.QueryInfo

  public static List findByCondition(String entity, EntityCondition condition,
    List orderBy, UserInfo userInfo, SecurityLinkInfo securityInfo,
    GenericDelegator delegator) throws GenericEntityException {

    Debug.logVerbose("[findByCondition] userInfo: " + userInfo.toString(), module);
    QueryInfo queryInfo = new QueryInfo( delegator, entity );
    queryInfo.addCondition( condition );
    return findByCondition( entity, queryInfo, orderBy, userInfo, securityInfo, delegator );
  }
View Full Code Here

Examples of com.sourcetap.sfa.util.QueryInfo

  public static EntityListIterator findListIteratorByCondition(String entity, EntityCondition condition,
    List orderBy, UserInfo userInfo, SecurityLinkInfo securityInfo,
    GenericDelegator delegator) throws GenericEntityException {

    Debug.logVerbose("[findListIteratorByCondition] userInfo: " + userInfo.toString(), module);
    QueryInfo queryInfo = new QueryInfo( delegator, entity );
    queryInfo.addCondition( condition );
    return findListIteratorByCondition( entity, queryInfo, orderBy, userInfo, securityInfo, delegator );
  }
View Full Code Here

Examples of com.sourcetap.sfa.util.QueryInfo

  public static List findByLike(String entity,
    List entityExpressions, List orderBy, UserInfo userInfo,
    SecurityLinkInfo securityInfo, GenericDelegator delegator, String securityType)
    throws GenericEntityException
  {
    QueryInfo queryInfo = new QueryInfo( delegator, entity);
    EntityExpr entityExpr = null;

    //convert existing expressions into LIKE clauses.
    for (int i = 0; i < entityExpressions.size(); i++) {
      entityExpr = (EntityExpr) entityExpressions.get(i);

      Object lhs = entityExpr.getLhs();
      Object rhs = entityExpr.getRhs();
      EntityComparisonOperator op = (EntityComparisonOperator) entityExpr.getOperator();
      if ( !op.equals(EntityOperator.LIKE) && !op.equals(EntityOperator.EQUALS))
        throw new IllegalArgumentException("Join Operator must be LIKE or EQUALS");

      if (lhs instanceof EntityAttribute &&
          rhs instanceof EntityAttribute) {
        lhs = (EntityAttribute) lhs;
        rhs = (EntityAttribute) rhs;
               
        String firstEntity = ((EntityAttribute) lhs).getEntity();
        String secondEntity = ((EntityAttribute) rhs).getEntity();
        if ( !firstEntity.equals(secondEntity) )
        {
          if ( !op.equals( EntityOperator.EQUALS ))
            throw new IllegalArgumentException("Join operator must be EQUALS");
           
          queryInfo.addJoin(firstEntity, secondEntity, Boolean.FALSE, ((EntityAttribute) lhs).getField(),
                  ((EntityAttribute) rhs).getField());
        }
        else
        {
          queryInfo.addCondition( firstEntity, ((EntityAttribute) lhs).getField(), op, ((EntityAttribute) rhs).getField());
        }
      } else {
        if (lhs instanceof EntityAttribute) {
          queryInfo.addCondition( ((EntityAttribute) lhs).getEntity(), ((EntityAttribute) lhs).getField(), op, rhs);
        } else {
          queryInfo.addCondition( entity, (String) lhs, op, rhs);
        }
      }
    }

    buildSecurityInfo(queryInfo, userInfo, securityInfo, entity, delegator, securityType);

    queryInfo.setOrderBy( orderBy );
    return queryInfo.executeQuery();
  }
View Full Code Here

Examples of com.sourcetap.sfa.util.QueryInfo

                                                     .getPrimaryKeyFieldNames();

        // Specify how the primary entity will be retrieved.
        HashMap fields = new HashMap();
        ArrayList orderBy = new ArrayList();
        QueryInfo queryInfo = new QueryInfo(delegator, primaryEntityName);
        Enumeration params = null;
        String searchAttribValue = "";
        String searchEntityName = "";
        String searchAttribName = "";
        String queryName = "";
        String listName = "";
        EntityComparisonOperator entityOperator = null;
        List relatedSearchClauses = new LinkedList();
        List selectFields = new ArrayList();
       
        // Note that we only care about primary entity fields in the select at the moment.
        // TODO:  change the queries so that all related data is retrieved as part of the main retrieve
        //        which it is, but the original code was written before dynamicViewEntities were added
    int selectFieldListSize = uiWebScreenSection.getUiFieldList().size();
    for (int fieldNbr = 0; fieldNbr < selectFieldListSize; fieldNbr++) { 
      UIFieldInfo fieldInfo = uiWebScreenSection.getUiField(fieldNbr);
      String fieldName = fieldInfo.getUiAttribute().getAttributeName();
      String entityName = fieldInfo.getUiAttribute().getUiEntity().getEntityName();
      if ( entityName.equals(primaryEntityName) )
        selectFields.add(fieldName);

/*      if ( fieldInfo.getIsVisible() )
      {
        String fieldName = fieldInfo.getUiAttribute().getAttributeName();
        String entityName = fieldInfo.getUiAttribute().getUiEntity().getEntityName();
        String aliasName = fieldName;
        if ( ! entityName.equals(primaryEntityName))
          aliasName = entityName + "." + fieldName;
        selectFields.add(aliasName);
      }
*/
    }
    queryInfo.setSelectFields(selectFields);

        if (request.getParameter("queryName") != null) {
            queryName = request.getParameter("queryName");
        }

        if (request.getParameter("listName") != null) {
            listName = request.getParameter("listName");
            if ( queryName.length() < 1)
                queryName = listName;
        }

       
        //    HashMap querySaveMap = new HashMap();
        UIQuery uiQuery = null;


    // Specify how associated entities will be retrieved.
    Iterator uiScreenSectionEntityI = uiWebScreenSection.getUiScreenSectionEntityList()
                              .iterator();
    uiScreenSectionEntityI.next(); // Pass up the primary entity.

    while (uiScreenSectionEntityI.hasNext()) {
      UIScreenSectionEntity uiScreenSectionEntity = (UIScreenSectionEntity) uiScreenSectionEntityI.next();
     
      relatedSearchClauses.add(uiScreenSectionEntity);
    }

    uiScreenSectionEntityI = null; // Reset the iterator.




        switch (retrieveMethod) {
        case GenericEventProcessor.RETRIEVE_METHOD_ALL:

            // Find all entities of this type.
            // Don't need to populate the fields map.
            break;

        case GenericEventProcessor.RETRIEVE_METHOD_AND:

            // Find the main entity(ies) by building a WHERE clause using "=" and AND.
            throw new GenericEntityException(
                "RETRIEVE_METHOD_AND not implemented yet.");

        case GenericEventProcessor.RETRIEVE_METHOD_CLAUSE:

            if (TIMER) {
                timer.timerString(1,
                    "[GenericWebEventProcessor.processRetrieve] Start RETRIEVE_METHOD_CLAUSE");
            }

      HashMap joinedEntities = new HashMap();
     
      joinedEntities.put(primaryEntityName, "Y");
     
            // Find the main entity(ies) by building a WHERE clause using LIKE and AND, with one or more tables in the FROM clause.
            // First join all secondary screen section entities in the WHERE and FROM clauses in case
            // we are going to use query values from them.
            Iterator relatedClauseI = relatedSearchClauses.iterator();

            while (relatedClauseI.hasNext()) {
                UIScreenSectionEntity uiScreenSectionEntity = (UIScreenSectionEntity) relatedClauseI.next();
                String relationTitle = uiScreenSectionEntity.getRelationTitle();
                String relatedEntityName = uiScreenSectionEntity.getUiEntity().getEntityName();
        boolean isOuterJoin = uiScreenSectionEntity.getIsOuterJoined();
        String relatedAndFields = uiScreenSectionEntity.getRelationByAndFields();

                Debug.logVerbose("Adding relation clauses for " +
                        relationTitle + "/" + relatedEntityName, module);

                eventProcessor.addOneRelationClause(delegator, relationTitle, relatedAndFields,
                    relatedEntityName, primaryEntityName, primaryME, isOuterJoin,
                    queryInfo);
                   
                joinedEntities.put(relatedEntityName, "Y");
            }

            Debug.logVerbose(
                    "queryId at beginning of RETRIEVE_METHOD_CLAUSE section: " +
                    queryId, module);

            if (queryId.equalsIgnoreCase("NONE")) {
                // Don't retrieve any data. The calling link specified to use the last query, but there wasn't one.
                return STATUS_CONTINUE;
            } else if (!queryId.equals("")) {
                // User selected a saved query.  Get it from the data base.
                uiQuery = new UIQuery(queryId, delegator);

                if (!uiQuery.getQueryId().equals("")) {
                    // Query was found.
                    uiQuery.appendEntityClauses(delegator, queryInfo);

                    //            // Store the attribute ID and value in the query save map.
                    //            querySaveMap.put(attributeId, searchAttribValue);
                }

                // add extra clauses from the hidden query parameters in case this is a detail screen
                addUseQueryParameterClauses(uiWebScreenSection, queryInfo,
                    relatedSearchClauses, primaryEntityName, request);
            } else {
                // Brand new query. Process all the parameters coming in through the request object to get the values to search by.
                uiQuery = new UIQuery();

        String queryListMaxRows = request.getParameter("queryListMaxRows");
        // if queryListMaxRows is set, then we are using advanced query mode
        if ( (queryListMaxRows != null ) && ( queryListMaxRows.length() > 0) )
        {
          int maxRows = Integer.valueOf(queryListMaxRows).intValue();
          for ( int i=1; i <= maxRows; i++ )
          {
            String qlFieldInfo = request.getParameter("queryListField" + i);
            if ( ( qlFieldInfo != null ) && ( qlFieldInfo.length() > 0 ) )
            {
              StringTokenizer tokSemi = new StringTokenizer(qlFieldInfo,";");
              String qlFieldName = "";
              String qlAttributeId = "";
              String qlDisplayObjectId = "";
              String qlDisplayTypeId = "";
             
              if (tokSemi.countTokens() == 4) {
                  qlFieldName = tokSemi.nextToken();
                  qlAttributeId = tokSemi.nextToken();
                  qlDisplayTypeId = tokSemi.nextToken();
                  qlDisplayObjectId = tokSemi.nextToken();
              }
              else
              {
                qlFieldName = qlFieldInfo;
              }

              String qlOperator  = request.getParameter("queryListOperator" + i);
              String qlValue     = request.getParameter("queryListValue" + i);
             
              if ( qlOperator.equals("like"))
                qlValue =  "%" + qlValue.replace('*','%') + "%";
              else if ( qlOperator.equals("startsWith"))
              {
                qlValue =  qlValue.replace('*','%') + "%";
                qlOperator = "like";
              }
              else if ( qlOperator.equals("endsWith"))
              {
                qlValue =  "%" + qlValue.replace('*','%');
                qlOperator = "like";
              }

              searchEntityName = UIWebUtility.getEntityFromParamName(qlFieldName);
 
              String hasJoin = (String) joinedEntities.get(searchEntityName);
             
              if ( ( hasJoin == null ) || ( !hasJoin.equals("Y")) )
              {
                eventProcessor.addOneRelationClause(delegator, "", "",searchEntityName, primaryEntityName, primaryME, false, queryInfo);

                joinedEntities.put(searchEntityName, "Y");
              }
             
              if ((searchEntityName == null) ||
                  searchEntityName.equals("")) {
                searchEntityName = primaryEntityName;
              }
 
              searchAttribName = UIWebUtility.getAttribFromParamName(qlFieldName);
              entityOperator = EntityOperator.lookupComparison(qlOperator);
              Object searchValue = qlValue;
             
              // If this is a set operator, convert the String param into a comma separated List
              if ( (entityOperator.equals(EntityOperator.IN)) || (entityOperator.equals(EntityOperator.NOT_IN)) || (entityOperator.equals(EntityOperator.BETWEEN)))
              {
                List valueList = new ArrayList();
                StringTokenizer tokComma = new StringTokenizer(qlValue, ",");

                while (tokComma.hasMoreTokens()) {
                  String valueItem = tokComma.nextToken();
                  valueList.add(valueItem);
                }
                searchValue = valueList;
              }
             
              try {
                // Figure out the attribute ID for the UiAttribute this parameter corresponds to so we can
                // save the query.
                String attributeId = UIWebUtility.getAttributeId(delegator,
                    searchAttribName, searchEntityName);
 
                // Generate an entry in the WHERE clause for this attribute.  The entityOperator
                // is returned in case appendEntityClause changes it.
                // NOTE:  changes here must also be applied to UIQuery.appendEntityClauses() to work with saved queries
                //
                if ( qlDisplayTypeId.equals(UIDisplayObject.DISPLAY_TYPE_SELECT) || qlDisplayTypeId.equals(UIDisplayObject.DISPLAY_TYPE_SEARCH_TEXT))
                {
                  String aliasName = searchEntityName + searchAttribName + "srch";
                  UIUtility.addSelectSearch( queryInfo, qlDisplayObjectId, searchEntityName, searchAttribName, aliasName, entityOperator, searchValue );
                }
                else
                {
                  if ( searchValue instanceof String )
                  {
                  entityOperator = EventUtility.appendEntityClause(searchEntityName,
                      searchAttribName, (String) searchValue,
                    entityOperator, queryInfo);
                }
                  else if ( searchValue instanceof Collection)
                  {
                    entityOperator = EventUtility.appendEntityClause(searchEntityName,
                      searchAttribName, (Collection) searchValue,
                      entityOperator, queryInfo);
                  }
                  else
                    throw new IllegalArgumentException("Query Param must be String or Collection");
                }

                // Store the attribute ID and value in the query save map.
                //                  querySaveMap.put(attributeId, searchAttribValue);
                uiQuery.addUiQueryValue(attributeId, entityOperator, qlValue, qlDisplayTypeId, qlDisplayObjectId, delegator);
              } catch (GenericEntityException e) {
                //this parameter was not associated with a column in a table, so skip it
                Debug.logVerbose("skipping parameter which is not an entity attribute: " + qlFieldName, module);
              }

            }
          }
        }
        else
        {

                params = request.getParameterNames();

                while (params.hasMoreElements()) {
                    String paramName = (String) params.nextElement();

                    //            boolean useSentQueryParameter =
                    //              !action.equals(uiWebScreenSection.ACTION_QUERY_UPDATE &&
                    //              !action.equals(uiWebScreenSection.ACTION_QUERY &&
                    //              uiWebScreenSection.getUseQueryParameterMap().containsValue(paramName);
                    Debug.logVerbose("paramName: " + paramName, module);
                    Debug.logVerbose("action: " + action, module);
                    Debug.logVerbose(
                            "uiWebScreenSection.getUseQueryParameterMap().containsValue(paramName): " +
                            String.valueOf(uiWebScreenSection.getUseQueryParameterMap()
                                                             .containsValue(paramName)), module);

                    if (UIWebUtility.checkReservedParameterName(paramName)) {
                        //                (  action.equals(uiWebScreenSection.ACTION_QUERY_UPDATE) || action.equals(uiWebScreenSection.ACTION_QUERY))
                        //              ) {
                        // This is a value being passed in from the prior screen in query mode.  Use it to search.
                        if (paramName.equals("nameToSearch")) {
                            // Alpha search using alphabet buttons.
                            HashMap alphaSearchValues = EventUtility.getAlphaSearchValues(delegator,
                                    uiWebScreenSection,
                                    request.getParameter("nameToSearch"));
                            searchEntityName = (String) alphaSearchValues.get(
                                    "searchEntityName");
                            searchAttribName = (String) alphaSearchValues.get(
                                    "searchAttribName");
                            searchAttribValue = (String) alphaSearchValues.get(
                                    "searchAttribValue");
                            entityOperator = null;
                        } else {
                            // Regular search attribute in query mode.
                            searchEntityName = UIWebUtility.getEntityFromParamName(paramName);

                            if ((searchEntityName == null) ||
                                    searchEntityName.equals("")) {
                                searchEntityName = primaryEntityName;
                            }

                            searchAttribName = UIWebUtility.getAttribFromParamName(paramName);

                            String[] searchAttribValueArray = request.getParameterValues(paramName);

                            Debug.logVerbose(
                                    "Number of values for query attribute " +
                                    paramName + ": " +
                                    String.valueOf(
                                        searchAttribValueArray.length), module);

                            searchAttribValue = getRequestParameterValue(paramName,
                                    searchAttribValueArray);

                            //  Determine the entity search operator to use.  If multiple, use IN
                            if ((null != searchAttribValue) &&
                                    (searchAttribValueArray.length > 1)) {
                                entityOperator = EntityOperator.IN;
                            } else {
                                entityOperator = null;
                            }

                            Debug.logVerbose("searchEntityName: " + searchEntityName, module);
                            Debug.logVerbose("searchAttribName: " + searchAttribName, module);
                            Debug.logVerbose("searchAttribValue: " + searchAttribValue, module);
                        }

                        if ((searchAttribValue != null) &&
                                !searchAttribValue.equals("")) {
                            try {
                                // Figure out the attribute ID for the UiAttribute this parameter corresponds to so we can
                                // save the query.
                                String attributeId = UIWebUtility.getAttributeId(delegator,
                                        searchAttribName, searchEntityName);

                                // Generate an entry in the WHERE clause for this attribute.  The entityOperator
                                // is returned in case appendEntityClause changes it.
                                entityOperator = EventUtility.appendEntityClause(searchEntityName,
                                        searchAttribName, searchAttribValue,
                                        entityOperator, queryInfo);

                                // Store the attribute ID and value in the query save map.
                                //                  querySaveMap.put(attributeId, searchAttribValue);
                                  uiQuery.addUiQueryValue(attributeId, entityOperator, searchAttribValue, "", "", delegator);
                            } catch (GenericEntityException e) {
                                //this parameter was not associated with a column in a table, so skip it
                                Debug.logVerbose("skipping parameter which is not an entity attribute: " + paramName, module);
                            }
                        }
                    }
                }
              }
                // add extra clauses from the hidden query parameters in case this is a detail screen
                addUseQueryParameterClauses(uiWebScreenSection, queryInfo,
                    relatedSearchClauses, primaryEntityName, request);
            }

            // Save the Query
            if (!queryName.equals("")) {
                // User entered a name for the query. Save it with the given name.
                // Change the party ID to the current user's party ID, and the section ID to the current section ID
                // in case either of these was -1 (wildcard).
                uiQuery.setSectionId(uiWebScreenSection.getSectionId());
                uiQuery.setPartyId(userInfo.getPartyId());
                uiQuery.setQueryName(queryName);
                queryId = uiQuery.save(delegator);

                //      queryId = UIQuery.saveUiQuery(delegator, userInfo.getPartyId(), sectionId, queryName, querySaveMap);
                Debug.logVerbose("queryId after saving query \"" + queryName + "\": " + queryId, module);

                if (TIMER) {
                    timer.timerString(1,
                        "[GenericWebEventProcessor.processRetrieve] Saved query");
                }
            }

            if ( listName.length() > 0)
            {
          // save the UiList info
                List uiListGVL = delegator.findByAnd("UiList", UtilMisc.toMap("listName", listName, "partyId", userInfo.getAccountId()), null);
                GenericValue uiListGV = null;
                if ( uiListGVL.size() > 0)
                {
                    uiListGV = (GenericValue) uiListGVL.get(0);
                    delegator.removeByAnd("UiListItem", UtilMisc.toMap("listId", uiListGV.getString("listId")));
                }
                else
                {
                    uiListGV = new GenericValue(delegator.getModelEntity("UiList"));
              String listId = GenericReplicator.getNextSeqId("UiList", delegator);
              uiListGV.set("listId", listId);
                }
                String listId = uiListGV.getString("listId");
          uiListGV.setDelegator(delegator);
         
          uiListGV.set("listName", listName);
          uiListGV.set("partyId", userInfo.getAccountId());
          uiListGV.set("queryId", queryId);
          uiListGV.set("sectionId", sectionId);
          uiListGV.set("listType", primaryEntityName);
         
          delegator.createOrStore(uiListGV);

                queryInfo.setSaveResultListId(listId);
            }

            // Save the query as the last query.  First make a new UIQuery using the same values as the original query.
            // Change the party ID to the current user's party ID, and the section ID to the current section ID
            // in case either of these was -1 (wildcard).
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.