Package com.centraview.view

Examples of com.centraview.view.View


          selectedColumn.add(ddSelectedColumn);
        }
      }
      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("ADD"))
      {
        viewId = remote.addView(userId, viewVO);
        viewForm.setViewId(viewId + "");
        request.setAttribute("TYPEOFOPERATION", "EDIT");
      } else if (request.getParameter("TYPEOFOPERATION").equals("EDIT")) {
        remote.updateView(userId, viewVO);
      }
      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]);
        }
      }
      listPreference.addListView(listView);
      Vector vecColumn = remote.getAllColumns(listType);
      Vector sortMemberVec = new Vector(vecColumn);
      viewForm.setSortMemberVec(sortMemberVec);
      int sizeOfAvailableList = vecColumn.size();
      int sizeOfSelectedList = selectedColumn.size();
      int i = 0;
View Full Code Here


      if (request.getParameter("listType") != null)
      {
        listType = request.getParameter("listType");
      }
      ViewHome viewHome = (ViewHome)CVUtility.getHomeObject("com.centraview.view.ViewHome", "View");
      View remote = viewHome.create();
      remote.setDataSource(dataSource);
      Vector vecColumn = remote.getAllColumns(listType);
      ViewForm viewform = (ViewForm)form;
      viewform.setAvailableColumnVec(vecColumn);
      viewform.setSortMemberVec(vecColumn);
      viewform = ViewForm.clearForm(viewform);
      request.setAttribute("viewform", form);
View Full Code Here

      boolean sortOrder = true;
      String sortType = "A";
      String searchId = "0";

      ViewHome viewHome = (ViewHome)CVUtility.getHomeObject("com.centraview.view.ViewHome","View");
      View remote = viewHome.create();
      remote.setDataSource(dataSource);
      Vector viewInfoVec = remote.getViewInfo(IndividualId, viewId);

      if (viewInfoVec != null && viewInfoVec.size() > 0)
      {
        sortType = viewInfoVec.get(0).toString();
        if (sortType.equals("A"))
        {
          sortOrder = true;
        } //end of if statement (sortType.equals("A"))
        else
        {
          sortOrder = false;
        } //end of if statement (sortType.equals("A"))
        sortElement = viewInfoVec.get(1).toString();
        recordPerPage = Integer.parseInt(viewInfoVec.get(2).toString());
        searchId = viewInfoVec.get(3).toString();
      } //end of if statement (viewInfoVec != null && viewInfoVec.size() > 0)

      // update in database tables - listPreferences
      remote.updateUserDefaultView(viewId, IndividualId, sortType, sortElement, recordPerPage, listType);

      // change the user preference
      listPreference.setDefaultView(viewId);
      listPreference.setRecordsPerPage(recordPerPage);
      listPreference.setSortElement(sortElement);
View Full Code Here

        UserObject user = (UserObject) session.getAttribute("userobject");
        int individualId = user.getIndividualID();
        // get data from database
        ViewHome viewHome = (ViewHome) CVUtility.getHomeObject("com.centraview.view.ViewHome",
            "View");
        View remote = viewHome.create();
        remote.setDataSource(dataSource);
        ViewVO viewVO = remote.getView(individualId, selectedViewId);
        ViewForm viewForm = (ViewForm) form;
        if (viewVO != null) {
          viewForm.setViewId("" + viewVO.getViewId());
          viewForm.setViewName(viewVO.getViewName());
          viewForm.setSortMember(viewVO.getSortMember());
          viewForm.setSortType(viewVO.getSortType());
          viewForm.setNoOfRecord("" + viewVO.getNoOfRecord());
          viewForm.setSearchId("" + viewVO.getSearchId());
          viewForm.setSearchType(viewVO.getSearchType());
          viewForm.setSelectedColumnVec(viewVO.getViewColumnVO());
          viewForm.setSearchIdName(viewVO.getSearchIdName());
          viewForm.setDefaultSystemView(viewVO.getDefaultView());
        } // end of if statement (viewVO != null)

        Vector vecColumn = remote.getAllColumns(listType);
        Vector selectedColumn = new Vector();
        if (viewForm.getSelectedColumnVec() != null) {
          selectedColumn = viewForm.getSelectedColumnVec();
        }
View Full Code Here

      // get the listtype
      String listType = displayList.getListType();
      // get listpreference associated with the user for required listtype
      ListPreference listPreference = userObject.getListPreference(listType);
      ViewHome viewHome = (ViewHome)CVUtility.getHomeObject("com.centraview.view.ViewHome", "View");
      View remote = viewHome.create();
      remote.setDataSource(dataSource);
      // We will get the current View Id which is Selected for the Individual
      // who is logged in.
      String userDefaultId = "" + listPreference.getDefaultView();
      int userDefaultViewId = 0;
      if (userDefaultId != null && !userDefaultId.equals("")) {
        userDefaultViewId = Integer.parseInt(userDefaultId);
      }

      // Delete the ViewId
      remote.deleteView(viewId);

      // set system default view as user default view if user deletes view which
      // he as set right now.
      int recordPerPage = 0;
      String sortElement = "";
      boolean sortOrder = true;
      String sortType = "A";

      //Remove the View for the List Type
      //So that we can add the View Back
      HashMap listViewHM = listPreference.getViewHashMap();
      listViewHM.remove(String.valueOf(viewId));

      // We will check wheather the removed view was the user Defaulted view.
      // If true then set the default view for the user to System's Default
      // View..
      if (userDefaultViewId == viewId) {
        // Get the System default View Id for the User.
        int systemDefaultViewId = remote.getSystemDefaultView(listType);
        if (systemDefaultViewId != 0) {
          viewId = systemDefaultViewId;
          Vector viewInfoVec = remote.getViewInfo(IndividualId, viewId);
          if (viewInfoVec != null && viewInfoVec.size() > 0) {
            sortType = viewInfoVec.get(0).toString();
            if (sortType.equals("A"))
              sortOrder = true;
            else
              sortOrder = false;

            sortElement = viewInfoVec.get(1).toString();
            recordPerPage = Integer.parseInt(viewInfoVec.get(2).toString());
          }// end of if (systemDefaultViewId != 0)

          // update in database tables - listPreferences
          remote.updateUserDefaultView(viewId, IndividualId, sortType, sortElement, recordPerPage, listType);

          // change the user preference
          listPreference.setDefaultView(viewId);
          listPreference.setRecordsPerPage(recordPerPage);
          listPreference.setSortElement(sortElement);
View Full Code Here

        HttpSession session = request.getSession();
        int individualID = ((UserObject)session.getAttribute("userobject")).getIndividualID();

        // get data from database
        ViewHome viewHome = (ViewHome)CVUtility.getHomeObject("com.centraview.view.ViewHome", "View");
        View remote = (View)viewHome.create();
        remote.setDataSource(dataSource);

        String listType = (String)request.getParameter("listType");

        Vector selectedColumn = new Vector();
        if (this.getSelectedColumn() != null) {
          String[] selectedCol = this.getSelectedColumn();
          for (int i = 0; i < selectedCol.length; i++) {
            DDNameValue ddSelectedCol = new DDNameValue(selectedCol[i], selectedCol[i]);
            selectedColumn.add(ddSelectedCol);
          }
        }
        this.setSelectedColumnVec(selectedColumn);

        Vector vecColumn = (Vector)remote.getAllColumns(listType);

        Vector sortMemberVec = new Vector(vecColumn);
        this.setSortMemberVec(sortMemberVec);

        int sizeOfAvailableList = vecColumn.size();
        int sizeOfSelectedList = selectedColumn.size();
        int i = 0;
        int j = 0;
        String idOfAvailableList = "";
        String idOfSelectedList = "";
        DDNameValue ddAvailableListInfo = null;
        DDNameValue ddSelectedListInfo = null;
        boolean removed = false;
        while (i < sizeOfAvailableList) {
          removed = false;
          ddAvailableListInfo = (DDNameValue)vecColumn.get(i);
          idOfAvailableList = ddAvailableListInfo.getStrid();
          while (j < sizeOfSelectedList) {
            ddSelectedListInfo = (DDNameValue)selectedColumn.get(j);
            idOfSelectedList = ddSelectedListInfo.getStrid();
            if (idOfAvailableList.equals(idOfSelectedList)) {
              vecColumn.remove(i);
              removed = true;
              sizeOfAvailableList--;
              break;
            } else {
              j++;
            }
            ddSelectedListInfo = null;
          }
          j = 0;
          if (!removed)
            i++;
          ddAvailableListInfo = null;
          removed = false;
        }
        this.setAvailableColumnVec(vecColumn);
        Vector searchVector = (Vector)remote.getOwnerSearch(individualID, request.getParameter("listType").toString());
        this.setSearchIdName(searchVector);
        request.setAttribute("listId", request.getParameter("listId"));
        request.setAttribute("viewform", this);
        request.setAttribute("TYPEOFOPERATION", request.getParameter("TYPEOFOPERATION"));
        request.setAttribute("primaryTableName", request.getParameter("primarytablename"));
View Full Code Here

      }

      // Set the New set of view according to the Module which we selected.
      if (defaultViews != null && defaultViews.size() != 0){
        ViewHome viewHome = (ViewHome)CVUtility.getHomeObject("com.centraview.view.ViewHome","View");
        View remote =(View)viewHome.create();
        remote.setDataSource(dataSource);
        // Set the view
        remote.setDefaultView(defaultViews);
      }

      if (button.equals("save")) {
        returnStatus = "save";
        request.setAttribute("typeofsubmodule",submodule);
View Full Code Here

    ListPreference listPreference = user.getListPreference(listType);
    int rpp = 0;
    String sortElement = "";
    boolean sortOrder = true;
    ViewHome viewHome = (ViewHome)CVUtility.getHomeObject("com.centraview.view.ViewHome","View");
    View remote = null;
    try
    {
      remote = viewHome.create();
    } catch (CreateException e) {
      logger.error("[execute] Exception thrown.", e);
      throw new ServletException(e);
    }
    remote.setDataSource(dataSource);
    Vector viewInfo = remote.getViewInfo(individualId, viewId);
    if (viewInfo != null && viewInfo.size() > 0)
    {
      String sortType = viewInfo.get(0).toString();
      if (sortType.equals("A"))
      {
View Full Code Here

  public void  deleteElement( int indvID, String key ) throws CommunicationException,NamingException
  {
    int elementID = Integer.parseInt(key);
    ViewHome viewHome=(ViewHome)CVUtility.getHomeObject("com.centraview.view.ViewHome","View");//call to ViewEJB
    try {
      View view = viewHome.create();
      view.setDataSource(this.dataSource);
      view.deleteView(elementID);
      // TODO individualID should be passed to deleteView.  User rights is fubar here.
    }
    catch(Exception e) {
      logger.error("[Exception] CustomViewList.deleteElement( int indvID, String key ) ", e);
    }
View Full Code Here

    ArrayList resultDeleteLog = new ArrayList();
    ViewHome viewHome=(ViewHome)CVUtility.getHomeObject("com.centraview.view.ViewHome","View");
    try
    {
      //call to EJB server
      View remote = viewHome.create();
      remote.setDataSource(this.dataSource);
      for (int i=0; i<recordID.length; i++)
      {
        if(recordID[i] != null && !recordID[i].equals("")){
          int elementID = Integer.parseInt(recordID[i]);
          remote.deleteView(elementID);
          //TODO individualID should be passed to deleteView.  User rights is fubar here.
        }//end of if(recordID[i] != null && !recordID[i].equals(""))
      }//end of for (int i=0; i<recordID.length; i++)
    }//end of try block
    catch( CreateException e )
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.