Package com.centraview.valuelist

Examples of com.centraview.valuelist.ValueListParameters


   */
  private void addSortLink(StringBuffer buffer, FieldDescriptor field, String columnName)
  {
    String imageName = null;
    String imageText = null;
    ValueListParameters parameters = this.listObject.getParameters();
    String currentPageParameters = this.listObject.getCurrentPageParameters();
    buffer.append(ValueListConstants.ANCHOR_PART_OPEN);
    buffer.append("class=\"listHeader\" href=\"");
    buffer.append(this.request.getContextPath());
    buffer.append("/Sort.do?listType=");
    buffer.append(parameters.getValueListType());
    buffer.append("&page=");
    buffer.append(parameters.getCurrentPage());
    buffer.append("&rpp=");
    buffer.append(parameters.getRecordsPerPage());
    if (this.listObject.isLookup()) {
      buffer.append("&actionType=" + this.listObject.getLookupType());
    }
    if (this.pageContext.findAttribute("listFilter") != null) {
      buffer.append("&filter=");
      buffer.append(this.request.getAttribute("appliedSearch"));
    }

    // Special case for Activities
    if (this.pageContext.findAttribute("superScope") != null) {
      buffer.append("&superScope=");
      buffer.append(this.request.getAttribute("superScope"));
    }

    // Special case for Opportunities and Notes
    if (this.pageContext.findAttribute("listScope") != null) {
      buffer.append("&listScope=");
      buffer.append(this.request.getAttribute("listScope"));
    }

    // It will be used to maintain the accountID which we are processing for
    // rules
    if (this.pageContext.findAttribute("accountID") != null) {
      buffer.append("&accountID=");
      buffer.append(this.request.getAttribute("accountID"));
    }

    if (this.pageContext.findAttribute("folderID") != null) {
      buffer.append("&folderID=");
      buffer.append(this.request.getAttribute("folderID"));
    }
    // Special case for related info so sorting forwards back to the right
    // place.
    if (this.listObject.getDisplay().isRelatedInfo()) {
      buffer.append("&relatedInfo=true");
    }
    if (currentPageParameters != null) {
      buffer.append(currentPageParameters);
    }
    buffer.append("&sortColumn=");
    buffer.append(field.getQueryIndex());
    buffer.append("&sortDirection=");
    boolean isSortedColumn = (parameters.getSortColumn() == field.getQueryIndex());
    if (isSortedColumn && parameters.getSortDirection().equals("ASC")) {
      buffer.append("DESC");
      imageName = "icon_sort_descending.gif";
      imageText = "Sorted Descending";
    } else {
      buffer.append("ASC");
View Full Code Here


    this.openTagCSS(buffer, ValueListConstants.SPAN, "pagingText");
    buffer.append("Records/pg:");
    buffer.append(ValueListConstants.SPAN_CLOSE);
    buffer.append(ValueListConstants.COLUMN_CLOSE);
    this.openTagCSS(buffer, ValueListConstants.COLUMN, "pagingButtonTD");
    ValueListParameters parameters = this.listObject.getParameters();
    String currentPageParameters = this.listObject.getCurrentPageParameters();
    // calculate the URLs for the paging buttons
    StringBuffer pagingURLBuffer = new StringBuffer("");
    pagingURLBuffer.append("/Sort.do?listType=");
    pagingURLBuffer.append(parameters.getValueListType());
    pagingURLBuffer.append(ValueListConstants.AMP);
    pagingURLBuffer.append("page=");
    pagingURLBuffer.append(parameters.getCurrentPage());
    pagingURLBuffer.append(ValueListConstants.AMP);
    pagingURLBuffer.append("sortColumn=");
    pagingURLBuffer.append(parameters.getSortColumn());
    // Special case for Activities
    if (this.pageContext.findAttribute("superScope") != null) {
      pagingURLBuffer.append(ValueListConstants.AMP);
      pagingURLBuffer.append("superScope=");
      pagingURLBuffer.append(this.request.getAttribute("superScope"));
    }
    // Special case for Opportunities
    if (this.pageContext.findAttribute("listScope") != null) {
      pagingURLBuffer.append(ValueListConstants.AMP);
      pagingURLBuffer.append("listScope=");
      pagingURLBuffer.append(this.request.getAttribute("listScope"));
    }
    pagingURLBuffer.append(ValueListConstants.AMP);
    pagingURLBuffer.append("sortDirection=");
    pagingURLBuffer.append(parameters.getSortDirection());
    if (this.pageContext.findAttribute("listFilter") != null) {
      pagingURLBuffer.append(ValueListConstants.AMP);
      pagingURLBuffer.append("filter=");
      pagingURLBuffer.append(request.getAttribute("appliedSearch"));
    }
View Full Code Here

    buffer.append("</td>\n");
  }

  private void addPagingButtons(StringBuffer buffer)
  {
    ValueListParameters parameters = this.listObject.getParameters();
    String currentPageParameters = this.listObject.getCurrentPageParameters();

    int current = parameters.getCurrentPage();
    int rpp = parameters.getRecordsPerPage();
    int totalRecords = parameters.getTotalRecords();
    long totalPages = 0;
    if (rpp > 0) {
      totalPages = (long) Math.ceil((double) totalRecords / rpp);
    } else {
      totalPages = 1;
    }
    int tmp;
    // calculate the URLs for the paging buttons
    StringBuffer pagingURLBuffer = new StringBuffer("c_goTo('");
    pagingURLBuffer.append("/Sort.do?listType=");
    pagingURLBuffer.append(parameters.getValueListType());
    pagingURLBuffer.append(ValueListConstants.AMP);
    pagingURLBuffer.append("sortColumn=");
    pagingURLBuffer.append(parameters.getSortColumn());
    pagingURLBuffer.append(ValueListConstants.AMP);
    pagingURLBuffer.append("sortDirection=");
    pagingURLBuffer.append(parameters.getSortDirection());
    pagingURLBuffer.append(ValueListConstants.AMP);
    pagingURLBuffer.append("rpp=");
    pagingURLBuffer.append(rpp);
    // Special case for Activities
    if (this.pageContext.findAttribute("superScope") != null) {
View Full Code Here

      moduleList = (HashMap)globalMasterLists.get("moduleList");
   
    ListPreference listPreference = userObject.getListPreference("LiteratureFulfillment");
    ListView view = listPreference.getListView(String.valueOf(listPreference.getDefaultView()));
   
    ValueListParameters listParameters = null;
    ValueListParameters requestListParameters = (ValueListParameters)request.getAttribute("listParameters");
    if (requestListParameters == null) { // build up new Parameters
      listParameters = new ValueListParameters(ValueListConstants.LITERATUREFULFILLMENT_LIST_TYPE, listPreference.getRecordsPerPage(), 1);
    } else { // paging or sorting or something, use the parameters from the request.
      listParameters = requestListParameters;
    }
    if (listParameters.getSortColumn() == 0) {
      FieldDescriptor sortField = (FieldDescriptor)ValueListConstants.literatureFulfillmentViewMap.get(listPreference.getSortElement());
View Full Code Here

    buffer.append("</td>\n");
  }

  private String currentPageURL()
  {
    ValueListParameters parameters = this.listObject.getParameters();
    String currentPageParameters = this.listObject.getCurrentPageParameters();
    StringBuffer pagingURLBuffer = new StringBuffer();
    pagingURLBuffer.append("/Sort.do?listType=");
    pagingURLBuffer.append(parameters.getValueListType());
    pagingURLBuffer.append(ValueListConstants.AMP);
    pagingURLBuffer.append("sortColumn=");
    pagingURLBuffer.append(parameters.getSortColumn());
    // Special case for Activities
    if (this.pageContext.findAttribute("superScope") != null) {
      pagingURLBuffer.append(ValueListConstants.AMP);
      pagingURLBuffer.append("superScope=");
      pagingURLBuffer.append(this.request.getAttribute("superScope"));
    }
    // Special case for Opportunities
    if (this.pageContext.findAttribute("listScope") != null) {
      pagingURLBuffer.append(ValueListConstants.AMP);
      pagingURLBuffer.append("listScope=");
      pagingURLBuffer.append(this.request.getAttribute("listScope"));
    }
    pagingURLBuffer.append(ValueListConstants.AMP);
    pagingURLBuffer.append("sortDirection=");
    pagingURLBuffer.append(parameters.getSortDirection());
    pagingURLBuffer.append(ValueListConstants.AMP);
    pagingURLBuffer.append("rpp=");
    pagingURLBuffer.append(parameters.getRecordsPerPage());
    pagingURLBuffer.append(ValueListConstants.AMP);
    pagingURLBuffer.append("page=");
    pagingURLBuffer.append(parameters.getCurrentPage());
    if (this.listObject.isLookup()) {
      pagingURLBuffer.append(ValueListConstants.AMP);
      pagingURLBuffer.append("actionType=" + this.listObject.getLookupType());
    }
    if (this.pageContext.findAttribute("listFilter") != null) {
View Full Code Here

        + contactType + " AND contact = " + contactID;

    UserObject userObject = (UserObject)session.getAttribute("userobject");
    int individualId = userObject.getIndividualID();

    ValueListParameters listParameters = null;
    ValueListParameters requestListParameters = (ValueListParameters)request
        .getAttribute("listParameters");
    if (requestListParameters == null) // build up new Parameters
    {
      listParameters = new ValueListParameters(ValueListConstants.ADDRESSLOOKUP_LIST_TYPE, 100, 1);
    } else { // paging or sorting or something, use the parameters from the
              // request.
      listParameters = requestListParameters;
    }
View Full Code Here

    UserObject userObject = (UserObject)session.getAttribute("userobject");
    int individualId = userObject.getIndividualID();
    ListPreference listPreference = userObject.getListPreference("Vendor");
    ListView view = listPreference.getListView(String.valueOf(listPreference.getDefaultView()));
    ValueListParameters listParameters = null;
    ValueListParameters requestListParameters = (ValueListParameters)request.getAttribute("listParameters");
    if (requestListParameters == null) // build up new Parameters
    {
      listParameters = new ValueListParameters(ValueListConstants.VENDOR_LIST_TYPE, listPreference.getRecordsPerPage(), 1);
    } else { // paging or sorting or something, use the parameters from the
             // request.
      listParameters = requestListParameters;
    }
    if (listParameters.getSortColumn() == 0) {
View Full Code Here

    HttpSession session = request.getSession();
    UserObject userObject = (UserObject)session.getAttribute("userobject");
    int individualId = userObject.getIndividualID();    // logged in user

    // get the data from the session
    ValueListParameters listParameters = (ValueListParameters)session.getAttribute("ticketPieChartParams");

    // get the data from the EJB
    ChartHome chartHome = (ChartHome)CVUtility.getHomeObject("com.centraview.chart.ChartHome", "Chart");
    Chart chartRemote = null;
    try
View Full Code Here

      moduleList = (HashMap)globalMasterLists.get("moduleList");
   
    ListPreference listPreference = userObject.getListPreference("FAQ");
    ListView view = listPreference.getListView(String.valueOf(listPreference.getDefaultView()));
   
    ValueListParameters listParameters = null;
    ValueListParameters requestListParameters = (ValueListParameters)request.getAttribute("listParameters");
    if (requestListParameters == null) { // build up new Parameters
      listParameters = new ValueListParameters(ValueListConstants.FAQ_LIST_TYPE, listPreference.getRecordsPerPage(), 1);
    } else { // paging or sorting or something, use the parameters from the request.
      listParameters = requestListParameters;
    }
    if (listParameters.getSortColumn() == 0) {
      FieldDescriptor sortField = (FieldDescriptor)ValueListConstants.FAQViewMap.get(listPreference.getSortElement());
View Full Code Here

      if (superScope.equals("All"))
        all = true;
      request.setAttribute("superScope", superScope);
      request.setAttribute("subScope", subScope);
      ListPreference listPreference = null;
      ValueListParameters listParameters = null;
      String moduleId = null;
      String filterOnType = null;
      if (subScope.equals("Appointment")) {
        listPreference = userObject.getListPreference(subScope);
        listParameters = ActionUtil.valueListParametersSetUp(listPreference, request,
            ValueListConstants.APPOINTMENT_LIST_TYPE, ValueListConstants.appointmentViewMap, false);
        moduleId = (String)moduleList.get("Activities");
        if (all) {
          filterOnType = " Type = " + ActivityVO.AT_APPOINTMENT;
          final_Forward = ".view.activities.allappointmentslist";
        } else {
          filterOnType = " Type = " + ActivityVO.AT_APPOINTMENT + " AND Owner = " + individualId;
          final_Forward = ".view.activities.myappointmentslist";
        }
      } else if (subScope.equals("Call")) {
        listPreference = userObject.getListPreference(subScope);
        listParameters = ActionUtil.valueListParametersSetUp(listPreference, request,
            ValueListConstants.CALL_LIST_TYPE, ValueListConstants.callViewMap, false);
        moduleId = (String)moduleList.get("Activities");
        if (all) {
          final_Forward = ".view.activities.allcallslist";
          filterOnType = " Type = " + ActivityVO.AT_CALL;
        } else {
          final_Forward = ".view.activities.mycallslist";
          filterOnType = " Type = " + ActivityVO.AT_CALL + " AND Owner = " + individualId;

        }
      } else if (subScope.equals("ForecastSales")) {
        listPreference = userObject.getListPreference(subScope);
        listParameters = ActionUtil.valueListParametersSetUp(listPreference, request,
            ValueListConstants.FORECASTSALES_LIST_TYPE, ValueListConstants.forecastSalesViewMap,
            false);
        moduleId = (String)moduleList.get("Opportunities");
        if (all) {
          filterOnType = " activity.ActivityID= opportunity.ActivityID ";
          final_Forward = ".view.activities.allforecastsaleslist";
        } else {
          final_Forward = ".view.activities.myforecastsaleslist";
          filterOnType = " activity.ActivityID= opportunity.ActivityID AND opportunity.AccountManager = "
              + individualId;
        }
      } else if (subScope.equals("LiteratureFulfillment")) {
        listPreference = userObject.getListPreference("LiteratureFulfillment");
        listParameters = ActionUtil.valueListParametersSetUp(listPreference, request,
            ValueListConstants.LITERATUREREQUEST_LIST_TYPE,
            ValueListConstants.literatureRequestViewMap, false);
        moduleId = (String)moduleList.get("LiteratureFulfilment");
        if (all) {
          final_Forward = ".view.activities.allliteraturerequestslist";
        } else {
          filterOnType = " activity.Owner = " + individualId
              + " AND literaturerequest.ActivityID = activity.ActivityID";
          final_Forward = ".view.activities.myliteraturerequestslist";
        }
      } else if (subScope.equals("Meeting")) {
        listPreference = userObject.getListPreference(subScope);
        listParameters = ActionUtil.valueListParametersSetUp(listPreference, request,
            ValueListConstants.MEETING_LIST_TYPE, ValueListConstants.meetingViewMap, false);
        moduleId = (String)moduleList.get("Activities");
        if (all) {
          filterOnType = " Type = " + ActivityVO.AT_MEETING;
          final_Forward = ".view.activities.allmeetingslist";
        } else {
          filterOnType = " Type = " + ActivityVO.AT_MEETING + " AND Owner = " + individualId;
          final_Forward = ".view.activities.mymeetingslist";
        }
      } else if (subScope.equals("NextAction")) {
        listPreference = userObject.getListPreference(subScope);
        listParameters = ActionUtil.valueListParametersSetUp(listPreference, request,
            ValueListConstants.NEXTACTION_LIST_TYPE, ValueListConstants.nextActionViewMap, false);
        moduleId = (String)moduleList.get("Activities");
        if (all) {
          filterOnType = " Type = " + ActivityVO.AT_NEXTACTION;
          final_Forward = ".view.activities.allnextactionslist";
        } else {
          filterOnType = " Type = " + ActivityVO.AT_NEXTACTION + " AND Owner = " + individualId;
          final_Forward = ".view.activities.mynextactionslist";
        }

      } else if (subScope.equals("ToDo")) {
        listPreference = userObject.getListPreference(subScope);
        listParameters = ActionUtil.valueListParametersSetUp(listPreference, request,
            ValueListConstants.TODO_LIST_TYPE, ValueListConstants.todoViewMap, false);
        moduleId = (String)moduleList.get("Activities");
        if (all) {
          filterOnType = " Type = " + ActivityVO.AT_TODO;
          final_Forward = ".view.activities.alltodoslist";
        } else {
          filterOnType = " Type = " + ActivityVO.AT_TODO + " AND Owner = " + individualId;
          final_Forward = ".view.activities.mytodoslist";
        }

      } else if (subScope.equals("ActivityTask")) {
        listPreference = userObject.getListPreference(subScope);
        listParameters = ActionUtil.valueListParametersSetUp(listPreference, request,
            ValueListConstants.TASK_LIST_TYPE, ValueListConstants.taskViewMap, false);
        moduleId = (String)moduleList.get("Tasks");
        if (all) {
          filterOnType = " activity.Type = " + ActivityVO.AT_TASK;
          final_Forward = ".view.activities.alltaskslist";
        } else {
          filterOnType = " activity.Type = " + ActivityVO.AT_TASK + " AND activity.Owner = "
              + individualId;
          final_Forward = ".view.activities.mytaskslist";
        }
      } else {
        subScope = "MultiActivity";
        listPreference = userObject.getListPreference(subScope);
        listParameters = ActionUtil.valueListParametersSetUp(listPreference, request,
            ValueListConstants.ACTIVITY_LIST_TYPE, ValueListConstants.activityViewMap, false);
        moduleId = (String)moduleList.get("Activities");

        if (all) {
          final_Forward = ".view.activities.allactivitylist";
          filterOnType = " Type != 3 UNION ";
          String opportunityFilter = EJBUtil.buildListFilterQuery(individualId, 30, "opportunity",
              "OpportunityId", "activity.owner", "activityId");
          filterOnType += opportunityFilter;
        } else {
          // We have to eleminate the forcast sale type for my all Activities
          // We have to check wheather that opportunity is assigned to me
          // for that reason we have to build the query seperatly and clubb
          // it with normal query
          filterOnType = " Owner = " + individualId + " AND Type != 3 ";
          filterOnType += " UNION SELECT activity.ActivityId  FROM opportunity, activity WHERE "
              + " activity.ActivityID= opportunity.ActivityID AND opportunity.AccountManager = "
              + individualId;
        }
      }

      // Search handling
      String filter = null;
      String filterParameter = request.getParameter("filter");
      if (filterParameter != null) {
        filter = (String)session.getAttribute("listFilter");
        request.setAttribute("appliedSearch", filterParameter);
        if (filterOnType != null) {
          filter = filter + " AND " + filterOnType;
          // More ghettoness...
          // But there's a fine line between ghetto and genius...
          if (subScope.equals("ForecastSales") || subScope.equals("LiteratureFulfillment")
              || subScope.equals("ActivityTask"))
            filter = filter.replaceFirst("FROM ", "FROM activity, ");
        }
      } else {
        session.removeAttribute("listFilter");
        if (filterOnType != null) {
          if (subScope.equals("ForecastSales")) {
            filter = "SELECT OpportunityId FROM opportunity, activity WHERE" + filterOnType;
          } else if (subScope.equals("LiteratureFulfillment")) {
            filter = "SELECT literaturerequest.ActivityId FROM literaturerequest, activity WHERE";
            if (filterOnType != null) {
              filter += filterOnType;
            }
          } else {
            filter = "SELECT ActivityId FROM activity WHERE" + filterOnType;
          }
        }
      }
      listParameters.setFilter(filter);

      // Get the list!
      ValueListHome valueListHome = (ValueListHome)CVUtility.getHomeObject(
          "com.centraview.valuelist.ValueListHome", "ValueList");
      ValueList valueList = null;
View Full Code Here

TOP

Related Classes of com.centraview.valuelist.ValueListParameters

Copyright © 2018 www.massapicom. 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.