Package com.centraview.view

Examples of com.centraview.view.View


      return(mapping.findForward(forward));
    }
   
    // get data from database
    ViewHome viewHome = (ViewHome)CVUtility.getHomeObject("com.centraview.view.ViewHome","View");
    View remote = null;
    try {
      remote = (View)viewHome.create();
    } catch (CreateException e) {
      System.out.println("[execute] Exception thrown: " + e);
      throw new ServletException(e);
    }
    remote.setDataSource(dataSource);
   
    ViewVO viewVO = remote.getView(individualId, viewId.intValue());

    if (viewVO != null) {
      viewForm.set("viewName", viewVO.getViewName());
      viewForm.set("moduleName", "");
      viewForm.set("recordType", viewVO.getListType());
      viewForm.set("sortColumn", viewVO.getSortMember());
      viewForm.set("sortDirection", viewVO.getSortType());
      try {
        viewForm.set("defaultSearch", new Integer(viewVO.getSearchId()));
      } catch (NumberFormatException nfe) {
        viewForm.set("defaultSearch", new Integer(0));
      }
      try {
        viewForm.set("recordsPerPage", new Integer(viewVO.getNoOfRecord()));
      } catch (NumberFormatException nfe) {
        viewForm.set("recordsPerPage", new Integer(10));
      }
      viewForm.set("defaultSystemView", viewVO.getDefaultView());

      try {
        viewForm.set("defaultSearch", new Integer(viewVO.getSearchId()));
      } catch (NumberFormatException nfe) {
        viewForm.set("defaultSearch", new Integer(0));
      }
    }

    String listType = viewVO.getListType();

                                              // holds fields that should not appear
    ArrayList unionFields = new ArrayList()// in available fields list because they
                                              // already appear in selected fields list

    // selectedFields - the list of fields selected for this view
    ArrayList selectedFields = new ArrayList();
    Vector selectedFieldsDb = (Vector)viewVO.getViewColumnVO();
    Iterator sfIter = selectedFieldsDb.iterator();
    while (sfIter.hasNext()) {
      DDNameValue field = (DDNameValue)sfIter.next();
      HashMap fieldMap = new HashMap();
      // someone made a decision long before me, that both the value
      // and display name properties for the HTML select widget should
      // be the name of the field. So I'm not changing it. -MK 12/29/2004
      String fieldName = (String)field.getName();
      fieldMap.put("fieldId", fieldName);
      fieldMap.put("fieldName", fieldName);
      selectedFields.add(fieldMap);
      unionFields.add(fieldName);
    }
    viewForm.set("selectedFields", selectedFields);

    // availableFields - the list of fields available in this module
    ArrayList availableFields = new ArrayList();    // collection we send to JSP via form bean
    ArrayList allFields = new ArrayList();    // collection of all available fields
    Vector availableFieldsDb = (Vector)remote.getAllColumns(listType);    // collection from DB
    Iterator afIter = availableFieldsDb.iterator();
    while (afIter.hasNext()) {
      DDNameValue field = (DDNameValue)afIter.next();
      HashMap fieldMap = new HashMap();
      // someone made a decision long before me, that both the value
View Full Code Here


      ArrayList listTypeTable = new ArrayList();
      DynaActionForm dynaform = (DynaActionForm) form;

      ViewHome viewHome = (ViewHome) CVUtility.getHomeObject("com.centraview.view.ViewHome", "View");
      View remote = (View) viewHome.create();
      remote.setDataSource(dataSource);

      if (submodule.equals("Contacts")) {
        listTypeTable.add("Entity");
        listTypeTable.add("Individual");

        HashMap viewTypeList = remote.getDefaultViews(listTypeTable);

        //Set Entity
        HashMap entityMap = (HashMap) viewTypeList.get("Entity");
        String entityViewID = (String) entityMap.get("DefaultViewID");
        Vector entityVec = (Vector) entityMap.get("ViewList");
        dynaform.set("contactsEntityList",entityViewID);
        dynaform.set("entityListVec",entityVec);

        //Set Individual
        HashMap individualMap = (HashMap) viewTypeList.get("Individual");
        String individualViewID = (String) individualMap.get("DefaultViewID");
        Vector individualVec = (Vector) individualMap.get("ViewList");
        dynaform.set("contactsIndividualList",individualViewID);
        dynaform.set("individualListVec",individualVec);

      } else if(submodule.equals("Activities")) {

        listTypeTable.add("MultiActivity");
        listTypeTable.add("Appointment");
        listTypeTable.add("Call");
        listTypeTable.add("Meeting");
        listTypeTable.add("NextAction");
        listTypeTable.add("ToDo");

        HashMap viewTypeList = remote.getDefaultViews(listTypeTable);

        // set MultiActivity
        HashMap multiActivityMap = (HashMap) viewTypeList.get("MultiActivity");
        String multiActivityViewID = (String) multiActivityMap.get("DefaultViewID");
        Vector multiActivityVec = (Vector) multiActivityMap.get("ViewList");
        dynaform.set("activitiesAllActivity",multiActivityViewID);
        dynaform.set("multiActivityVec",multiActivityVec);

        // set Appointment
        HashMap appointmentMap = (HashMap) viewTypeList.get("Appointment");
        String appointmentViewID = (String) appointmentMap.get("DefaultViewID");
        Vector appointmentVec = (Vector) appointmentMap.get("ViewList");
        dynaform.set("activitiesAppointment",appointmentViewID);
        dynaform.set("appointmentVec",appointmentVec);

        // set Call
        HashMap callMap = (HashMap) viewTypeList.get("Call");
        String callViewID = (String) callMap.get("DefaultViewID");
        Vector callsVec = (Vector) callMap.get("ViewList");
        dynaform.set("activitiesCalls",callViewID);
        dynaform.set("callsVec",callsVec);

        // set Meeting
        HashMap meetingMap = (HashMap) viewTypeList.get("Meeting");
        String meetingViewID = (String) meetingMap.get("DefaultViewID");
        Vector meetingsVec = (Vector) meetingMap.get("ViewList");
        dynaform.set("activitiesMeetings",meetingViewID);
        dynaform.set("meetingsVec",meetingsVec);

        // set ToDo
        HashMap toDoMap = (HashMap) viewTypeList.get("ToDo");
        String toDoViewID = (String) toDoMap.get("DefaultViewID");
        Vector toDosVec = (Vector) toDoMap.get("ViewList");
        dynaform.set("activitiesToDos",toDoViewID);
        dynaform.set("toDosVec",toDosVec);

        // set NextAction
        HashMap nextActionMap = (HashMap) viewTypeList.get("NextAction");
        String nextActionViewID = (String) nextActionMap.get("DefaultViewID");
        Vector nextActionsVec = (Vector) nextActionMap.get("ViewList");
        dynaform.set("activitiesNextActions",nextActionViewID);
        dynaform.set("nextActionsVec",nextActionsVec);

      } else if(submodule.equals("Notes")) {

        listTypeTable.add("Note");

        HashMap viewTypeList = remote.getDefaultViews(listTypeTable);

        // Set Note
        HashMap notesMap = (HashMap) viewTypeList.get("Note");
        String notesViewID = (String) notesMap.get("DefaultViewID");
        Vector notesVec = (Vector) notesMap.get("ViewList");
        dynaform.set("notes",notesViewID);
        dynaform.set("notesVec",notesVec);

      } else if(submodule.equals("File")) {
        listTypeTable.add("File");

        HashMap viewTypeList = remote.getDefaultViews(listTypeTable);

        // Set File
        HashMap filesMap = (HashMap) viewTypeList.get("File");
        String filesViewID = (String) filesMap.get("DefaultViewID");
        Vector filesVec = (Vector) filesMap.get("ViewList");
        dynaform.set("files",filesViewID);
        dynaform.set("filesVec",filesVec);

      } else if(submodule.equals("Sales")) {

        listTypeTable.add("Opportunity");
        listTypeTable.add("Proposal");

        HashMap viewTypeList = remote.getDefaultViews(listTypeTable);

        //Set Opportunity
        HashMap opportunityMap = (HashMap) viewTypeList.get("Opportunity");
        String opportunityViewID = (String) opportunityMap.get("DefaultViewID");
        Vector opportunityVec = (Vector) opportunityMap.get("ViewList");
        dynaform.set("salesOpportunity",opportunityViewID);
        dynaform.set("opportunityVec",opportunityVec);

        //Set Proposal
        HashMap proposalMap = (HashMap) viewTypeList.get("Proposal");
        String proposalViewID = (String) proposalMap.get("DefaultViewID");
        Vector proposalVec = (Vector) proposalMap.get("ViewList");
        dynaform.set("salesProposal",proposalViewID);
        dynaform.set("proposalVec",proposalVec);

      } else if(submodule.equals("Marketing")) {

        listTypeTable.add("Marketing");
        listTypeTable.add("Promotion");
        listTypeTable.add("LiteratureFulfillment");
        listTypeTable.add("Event");

        HashMap viewTypeList = remote.getDefaultViews(listTypeTable);

        // set Marketing
        HashMap marketingMap = (HashMap) viewTypeList.get("Marketing");
        String marketingViewID = (String) marketingMap.get("DefaultViewID");
        Vector marketingVec = (Vector) marketingMap.get("ViewList");
        dynaform.set("marketings",marketingViewID);
        dynaform.set("marketingsVec",marketingVec);

        // set Promotion
        HashMap promotionMap = (HashMap) viewTypeList.get("Promotion");
        String promotionViewID = (String) promotionMap.get("DefaultViewID");
        Vector promotionVec = (Vector) promotionMap.get("ViewList");
        dynaform.set("marketingsPromotions",promotionViewID);
        dynaform.set("promotionsVec",promotionVec);

        // set LiteratureFulfillment
        HashMap literatureFullillmentMap = (HashMap) viewTypeList.get("LiteratureFulfillment");
        String literatureFullillmentViewID = (String) literatureFullillmentMap.get("DefaultViewID");
        Vector literatureFullillmentsVec = (Vector) literatureFullillmentMap.get("ViewList");
        dynaform.set("marketingsLiteraturefulfillment",literatureFullillmentViewID);
        dynaform.set("literaturefulfillmentVec",literatureFullillmentsVec);

        // set Event
        HashMap eventMap = (HashMap) viewTypeList.get("Event");
        String eventViewID = (String) eventMap.get("DefaultViewID");
        Vector eventsVec = (Vector) eventMap.get("ViewList");
        dynaform.set("marketingsEvents",eventViewID);
        dynaform.set("eventsVec",eventsVec);

      } else if(submodule.equals("Projects")) {

        listTypeTable.add("Project");
        listTypeTable.add("Appointment");
        listTypeTable.add("Call");

        HashMap viewTypeList = remote.getDefaultViews(listTypeTable);

        // set Project
        HashMap projectMap = (HashMap) viewTypeList.get("Project");
        String projectViewID = (String) projectMap.get("DefaultViewID");
        Vector projectVec = (Vector) projectMap.get("ViewList");
        dynaform.set("projectsProject",projectViewID);
        dynaform.set("projectVec",projectVec);

        // set Tasks
        HashMap taskMap = (HashMap) viewTypeList.get("Tasks");
        String taskViewID = (String) taskMap.get("DefaultViewID");
        Vector taskVec = (Vector) taskMap.get("ViewList");
        dynaform.set("projectsTask",taskViewID);
        dynaform.set("taskVec",taskVec);

        // set Timeslip
        HashMap timeslipMap = (HashMap) viewTypeList.get("Timeslip");
        String timeslipViewID = (String) timeslipMap.get("DefaultViewID");
        Vector timeslipsVec = (Vector) timeslipMap.get("ViewList");
        dynaform.set("projectsTimeSlips",timeslipViewID);
        dynaform.set("timeSlipsVec",timeslipsVec);

      } else if(submodule.equals("Support")) {

        listTypeTable.add("Ticket");
        listTypeTable.add("FAQ");
        listTypeTable.add("KnowledgeBase");

        HashMap viewTypeList = remote.getDefaultViews(listTypeTable);

        // set Ticket
        HashMap ticketMap = (HashMap) viewTypeList.get("Ticket");
        String ticketViewID = (String) ticketMap.get("DefaultViewID");
        Vector ticketVec = (Vector) ticketMap.get("ViewList");
        dynaform.set("supportTicket",ticketViewID);
        dynaform.set("ticketVec",ticketVec);

        // set FAQ
        HashMap faqMap = (HashMap) viewTypeList.get("FAQ");
        String faqViewID = (String) faqMap.get("DefaultViewID");
        Vector faqVec = (Vector) faqMap.get("ViewList");
        dynaform.set("supportFaq",faqViewID);
        dynaform.set("faqVec",faqVec);

        // set KnowledgeBase
        HashMap knowledgebaseMap = (HashMap) viewTypeList.get("KnowledgeBase");
        String knowledgebaseViewID = (String) knowledgebaseMap.get("DefaultViewID");
        Vector knowledgebasesVec = (Vector) knowledgebaseMap.get("ViewList");
        dynaform.set("supportKnowledgebase",knowledgebaseViewID);
        dynaform.set("knowledgebaseVec",knowledgebasesVec);

      } else if(submodule.equals("Accounting")) {

        listTypeTable.add("Order");
        listTypeTable.add("InvoiceHistory");
        listTypeTable.add("Payment");
        listTypeTable.add("Expense");
        listTypeTable.add("PurchaseOrder");
        listTypeTable.add("Item");
        listTypeTable.add("GLAccount");
        listTypeTable.add("Inventory");
        listTypeTable.add("Vendor");

        HashMap viewTypeList = remote.getDefaultViews(listTypeTable);

        // set Order
        HashMap orderMap = (HashMap) viewTypeList.get("Order");
        String orderViewID = (String) orderMap.get("DefaultViewID");
        Vector orderVec = (Vector) orderMap.get("ViewList");
        dynaform.set("accountingsOrderHistory",orderViewID);
        dynaform.set("orderHistoryVec",orderVec);

        // set InvoiceHistory
        HashMap invoiceMap = (HashMap) viewTypeList.get("InvoiceHistory");
        String invoiceViewID = (String) invoiceMap.get("DefaultViewID");
        Vector invoiceVec = (Vector) invoiceMap.get("ViewList");
        dynaform.set("accountingsInvoiceHistory",invoiceViewID);
        dynaform.set("invoiceHistoryVec",invoiceVec);

        // set Payment
        HashMap paymentMap = (HashMap) viewTypeList.get("Payment");
        String paymentViewID = (String) paymentMap.get("DefaultViewID");
        Vector paymentsVec = (Vector) paymentMap.get("ViewList");
        dynaform.set("accountingsPayments",paymentViewID);
        dynaform.set("paymentsVec",paymentsVec);

        // set Expense
        HashMap expenseMap = (HashMap) viewTypeList.get("Expense");
        String expenseViewID = (String) expenseMap.get("DefaultViewID");
        Vector expensesVec = (Vector) expenseMap.get("ViewList");
        dynaform.set("accountingsExpenses",expenseViewID);
        dynaform.set("expensesVec",expensesVec);

        // set PurchaseOrder
        HashMap purchaseOrderMap = (HashMap) viewTypeList.get("PurchaseOrder");
        String purchaseOrderViewID = (String) purchaseOrderMap.get("DefaultViewID");
        Vector purchaseOrdersVec = (Vector) purchaseOrderMap.get("ViewList");
        dynaform.set("accountingsPurchaseOrder",purchaseOrderViewID);
        dynaform.set("purchaseOrderVec",purchaseOrdersVec);

        // set Item
        HashMap itemMap = (HashMap) viewTypeList.get("Item");
        String itemViewID = (String) itemMap.get("DefaultViewID");
        Vector itemsVec = (Vector) itemMap.get("ViewList");
        dynaform.set("accountingsItems",itemViewID);
        dynaform.set("itemsVec",itemsVec);

        // set GLAccount
        HashMap glAccountMap = (HashMap) viewTypeList.get("GLAccount");
        String glAccountViewID = (String) glAccountMap.get("DefaultViewID");
        Vector glAccountsVec = (Vector) glAccountMap.get("ViewList");
        dynaform.set("accountingsGLAccounting",glAccountViewID);
        dynaform.set("gLAccountingVec",glAccountsVec);

        // set Inventory
        HashMap inventoryMap = (HashMap) viewTypeList.get("Inventory");
        String inventoryViewID = (String) inventoryMap.get("DefaultViewID");
        Vector inventorysVec = (Vector) inventoryMap.get("ViewList");
        dynaform.set("accountingsInventory",inventoryViewID);
        dynaform.set("inventoryVec",inventorysVec);

        // set Vendor
        HashMap vendorMap = (HashMap) viewTypeList.get("Vendor");
        String vendorViewID = (String) vendorMap.get("DefaultViewID");
        Vector vendorsVec = (Vector) vendorMap.get("ViewList");
        dynaform.set("accountingsVendors",vendorViewID);
        dynaform.set("vendorsVec",vendorsVec);

      } else if(submodule.equals("HR")) {

        listTypeTable.add("Expenses");
        listTypeTable.add("TimeSheet");
        listTypeTable.add("EmployeeHandbook");
        listTypeTable.add("Employee");

        HashMap viewTypeList = remote.getDefaultViews(listTypeTable);

        // set Expenses
        HashMap expensesMap = (HashMap) viewTypeList.get("Expenses");
        String expensesViewID = (String) expensesMap.get("DefaultViewID");
        Vector expensesVec = (Vector) expensesMap.get("ViewList");
View Full Code Here

      } //end of if statement (viewForm.getSelectedColumn() != null)

      viewVO.setViewColumnVO(columnInfo);

      ViewHome viewHome = (ViewHome)CVUtility.getHomeObject("com.centraview.view.ViewHome","View");
      View remote =viewHome.create();
      remote.setDataSource(dataSource);

      if (request.getParameter("TYPEOFOPERATION").equals("new"))   
      {
        viewId = remote.addView(IndividualId, viewVO);
        viewForm.setViewId(viewId+"");
        request.setAttribute("TYPEOFOPERATION", "edit");
      } //end of if statement (request.getParameter("TYPEOFOPERATION").equals("ADD"))
      else if (request.getParameter("TYPEOFOPERATION").equals("edit")) 
      {
        remote.updateView(IndividualId, viewVO);
      } //end of else if statement (request.getParameter("TYPEOFOPERATION").equals("EDIT"))

      ListView listView = new ListView(viewId);
      listView.setListType(listType);
      listView.setViewName(viewVO.getViewName());
      listView.setViewID(viewId);
      listView.setSearchID(viewVO.getSearchId());
      if (viewForm.getSelectedColumn() != null)
      {
        int sizeOfSelectedColumn = viewForm.getSelectedColumn().length;
        String[] selectedColumnArray = viewForm.getSelectedColumn();
        for (int i = 0; i < sizeOfSelectedColumn; i++
        {
          listView.addColumnName(selectedColumnArray[i]);       
        } //end of for loop (int i = 0; i < sizeOfSelectedColumn; i++)
      } //end of if statement (viewForm.getSelectedColumn() != null)
      listPreference.addListView(listView);

      Vector vecColumn = remote.getAllColumns(listType);
      Vector sortMemberVec = new Vector(vecColumn);
      viewForm.setSortMemberVec(sortMemberVec);

      int sizeOfAvailableList = vecColumn.size();
      int sizeOfSelectedList = selectedColumn.size();
View Full Code Here

TOP

Related Classes of com.centraview.view.View

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.