Package java.util

Examples of java.util.HashMap


   * @param xml String QB XML.
   * @return HashMap {modulename,qbxmlname,listvo}
   */
  public HashMap getVOListFromQBXML(String xml, String path)
  {
    HashMap listVOAndModuleName = new HashMap();

    try
    {
      filePath = path;
      ArrayList objectsCV = new ArrayList();
      Document qbXML = getDocumentFromString(xml);
      String nameQBXML = getQBXMLName(qbXML);
      Node node = qbXML.getElementsByTagName(nameQBXML).item(0);

      Document configForQBXML = getDocumentFromString(getDocumentFromString(FILE_CONFIG).getElementsByTagName(nameQBXML).item(0).toString());

      listVOAndModuleName = new HashMap();
      NodeList listQB = qbXML.getElementsByTagName(getValueOfNodeByTagName(configForQBXML, TAG_SEPARATOR) + "Ret");
      Node config = configForQBXML.getFirstChild();

      String moduleName = getValueOfNodeByTagName(config, TAG_MODULE_NAME);
      String className = getValueOfNodeByTagName(config, TAG_VONAME);

      Object cvObj = null;

      int length = listQB.getLength();
      if (node.getAttributes().getNamedItem(ATTR_STATUS_CODE).getNodeValue().equals("0"))
      {
        for (int i = 0; i < length; i++)
        {
          cvObj = getVOfromQBXML(listQB.item(i), config);
          setCVID(cvObj, moduleName, className);
          objectsCV.add(cvObj);
        }
      } else
      {
        System.out.println("*** Message from QB:  " + node.getAttributes().getNamedItem(ATTR_STATUS_MESSAGE).getNodeValue());
      }
      listVOAndModuleName.put("qbxmlname", nameQBXML);
      listVOAndModuleName.put(ATTR_LISTVO, objectsCV);
      listVOAndModuleName.put(TAG_MODULE_NAME, moduleName);
    } catch (Exception e)
    {
      logger.error("[getVOListFromQBXML] Exception thrown.", e);
    }

View Full Code Here


      DynaActionForm dynaForm = (DynaActionForm)form;
      EmailFacadeHome cfh = (EmailFacadeHome)CVUtility.getHomeObject("com.centraview.email.emailfacade.EmailFacadeHome", "EmailFacade");
      EmailFacade remote = (EmailFacade)cfh.create();
      remote.setDataSource(dataSource);

      HashMap hmFolder = new HashMap();
      String str = (String)dynaForm.get("accountid");
      String folderid = (String)dynaForm.get("folderid");
      String foldername = (String)dynaForm.get("foldername");
      String parentid = (String)dynaForm.get("parentid");

      hmFolder.put("AccountID", new Integer(Integer.parseInt(str)));
      hmFolder.put("parentid", new Integer(Integer.parseInt(parentid)));
      hmFolder.put("foldername", foldername);
      hmFolder.put("folderid", new Integer(Integer.parseInt(folderid)));

      int i = remote.editFolder(individualId, hmFolder);
      // TODO do something with this return value?
      dynaForm.initialize(mapping);
    }
View Full Code Here

        // we need to generate a DisplayList object to pass
        // to the List View code (List.jsp)
        Iterator iter = sqlResults.iterator();

        while (iter.hasNext()) {
          HashMap sqlRow = (HashMap)iter.next();
          String indvName = (String)sqlRow.get("Name");
          int indvID = ((Number)sqlRow.get("IndividualID")).intValue();
          attendeeVec.addElement(new DDNameValue("" + indvID + "#" + indvName, indvName));
        }
      } else if (dbName != null && dbName.equals("individual")) {
        gal = AttendeeList.getAttendeeList(individualID, "individual", Integer.parseInt(dbID),
            dataSource);
View Full Code Here

        String path = null;
        String file = null;
        try {

            // loop through all initialization parameter pairs
            HashMap map = new HashMap();
            Enumeration pnum = servlet.getInitParameterNames();
            ServletContext serv = servlet.getServletContext();
            while (pnum.hasMoreElements()) {

                // parameter name is path and value is service definition file
                path = (String) pnum.nextElement();
                file = "/WEB-INF/" + servlet.getInitParameter(path);
                InputStream is = null;
                try {
                    is = serv.getResourceAsStream(file);
                    if (is == null) {
                        logger.error("Service definition not found for service " + path + " at " + file);
                        throw new UnavailableException("Service definition not found for service " + path + " at "
                            + file + ". Check configuration of servlet " + servlet.getServletName()
                            + " in WEB-INF/web.xml.");
                    }
                    ServiceDefinition sdef = (ServiceDefinition) ctx.unmarshalDocument(is, null);
                    if (!path.startsWith("/")) {
                        path = "/" + path;
                    }
                    map.put(path, sdef);

                } finally {
                    if (is != null) {
                        try {
                            is.close();
View Full Code Here

  private static Logger logger = Logger.getLogger(MarketingList.class);

  // constructor
  public  MarketingList()
  {
    columnMap = new HashMap();
    columnMap.put( "title" , new Integer(100) );
    columnMap.put( "description" , new Integer(120) );
    columnMap.put( "Records" , new Integer(120) ) ;
    columnMap.put( "Opportunities" , new Integer(100) );
    columnMap.put( "OpportunityValue" , new Float(120) );
View Full Code Here


    HttpSession session = ((HttpServletRequest)(pageContext.getRequest())).getSession();

        ModuleFieldRightMatrix mfrmx = ((UserObject)session.getAttribute("userobject")).getUserPref().getModuleAuthorizationMatrix();
    HashMap hm = mfrmx.getFieldRights(getModulename());

    if (hm != null && hm.containsKey(getFieldname()))
    {
      fieldRight =  ((Integer)hm.get(getFieldname())).intValue();
    }


        // Acquire the select tag we are associated with
        CVSelectTag selectTag = (CVSelectTag) pageContext.getAttribute(Constants.SELECT_KEY);
View Full Code Here

    // Check wheather the actionType is it Lookup or not
    String actionType = request.getParameter("actionType");

    GlobalMasterLists globalMasterLists = GlobalMasterLists.getGlobalMasterLists(dataSource);
    HashMap moduleList = new HashMap();
    if (globalMasterLists.get("moduleList") != null) {
      moduleList = (HashMap) globalMasterLists.get("moduleList");
    }

    ListPreference listPreference = userObject.getListPreference("File");
    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.FILE_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.fileViewMap.get(listPreference.getSortElement());
      listParameters.setSortColumn(sortField.getQueryIndex());
      if (listPreference.getsortOrder())
        listParameters.setSortDirection("ASC");
      else
        listParameters.setSortDirection("DESC");
    }

    int defaultFolder = userObject.getUserPref().getDefaultFolderID();
    int folderID = defaultFolder;
    String param = request.getParameter("folderId");
    if (param != null) {
      if (param.indexOf("*") == -1) {
        folderID = Integer.parseInt(param);
      } else {
        folderID = Integer.parseInt(param.substring(0, param.indexOf("*")));
      }
    }
    listParameters.setFolderID(folderID);
    request.setAttribute("folderId", String.valueOf(folderID));

    String scope = request.getParameter(FileConstantKeys.TYPEOFFILELIST);
    if (scope != null && !scope.equals("")) {
      request.setAttribute("fileTypeRequest", scope);
      request.setAttribute(FileConstantKeys.TYPEOFFILELIST, scope);
    } else {
      scope = "MY";
      request.setAttribute("fileTypeRequest", "MY");
      request.setAttribute(FileConstantKeys.TYPEOFFILELIST, "MY");
    }

    // Search handling
    String filter = null;
    String filterParameter = request.getParameter("filter");
    if (filterParameter != null) {
      filter = (String) session.getAttribute("listFilter");
      if (scope.equals("MY")) {
        filter += " AND Owner = " + individualId;
        session.setAttribute("listFilter", filter);
      }
      request.setAttribute("appliedSearch", filterParameter);
    } else {
      // TODO Need to handle folder access too.
      if (scope.equals("MY"))
        filter = "SELECT FileID FROM cvfile WHERE Owner = " + individualId;
      session.removeAttribute("listFilter");
    }
    listParameters.setFilter(filter);

    // Build up the breadcrumbs on the folder bar.
    // the crumbs will be the complete FolderRootPath except in the
    // cases where you are looking at ALL, MY or PUBLIC then we will manually get rid of
    // the leading things.
    try {
      Vector vec = null;
      int rootId = 0;
      ArrayList remove = new ArrayList();
      CvFileFacade fileFacade = new CvFileFacade();
      vec = fileFacade.getFolderRootPath(individualId, folderID, dataSource);
      if (vec != null) {
        Collections.reverse(vec);
        if (scope.equals("ALL")) {
          Iterator iter = vec.iterator();
          while (iter.hasNext()) {
            DDNameValue current = (DDNameValue) iter.next();
            if (current.getName().equals("CV_ROOT")) {
              remove.add(current);
            } else if (current.getName().equals("CVFS_ROOT")) {
              rootId = current.getId();
              remove.add(current);
            }
          }
          iter = remove.iterator();
          while (iter.hasNext()) {
            vec.remove(iter.next());
          }
          vec.add(0, new DDNameValue(rootId, "All Files"));
        } else if (scope.equals("MY")) {
          Iterator iter = vec.iterator();
          while (iter.hasNext()) {
            DDNameValue current = (DDNameValue) iter.next();
            if (current.getName().equals("CV_ROOT")) {
              remove.add(current);
            } else if (current.getName().equals("CVFS_ROOT")) {
              remove.add(current);
            } else if (current.getName().equals("CVFS_USER")) {
              remove.add(current);
            } else if (current.getName().equals(userObject.getLoginName())) {
              rootId = current.getId();
              remove.add(current);
            }
          }
          iter = remove.iterator();
          while (iter.hasNext()) {
            vec.remove(iter.next());
          }
          vec.add(0, new DDNameValue(rootId, "My Files"));
        } else if (scope.equals("PUBLIC")) {
          Iterator iter = vec.iterator();
          while (iter.hasNext()) {
            DDNameValue current = (DDNameValue) iter.next();
            if (current.getName().equals("CV_ROOT")) {
              remove.add(current);
            } else if (current.getName().equals("CVFS_ROOT")) {
              remove.add(current);
            } else if (current.getName().equals("Public Folders")) {
              rootId = current.getId();
              remove.add(current);
            }
          }
          iter = remove.iterator();
          while (iter.hasNext()) {
            vec.remove(iter.next());
          }
          vec.add(0, new DDNameValue(rootId, "Public Folders"));
        }
        request.setAttribute("breadCrumbs", vec);
      }
    } catch (Exception e) {
      logger.error("[execute]: Exception", e);
    }

    Vector viewColumns = view.getColumns();
    ArrayList columns = new ArrayList();
    // We the Action Type is Entity's Lookup then we must have
    // to set the columns which we are going to look
    if (actionType != null && actionType.equals("lookup")) {
      Vector lookupViewColumns = new Vector();
      lookupViewColumns.add("Name");
      ActionUtil.mapOldView(columns, lookupViewColumns, ValueListConstants.FILE_LIST_TYPE);
      listParameters.setRecordsPerPage(100);
      finalForward = ".view.files.filelookup";
    } else {
      ActionUtil.mapOldView(columns, viewColumns, ValueListConstants.FILE_LIST_TYPE);
    }
    listParameters.setColumns(columns);

    // Get the list!
    ValueListHome valueListHome = (ValueListHome) CVUtility.getHomeObject("com.centraview.valuelist.ValueListHome", "ValueList");
    ValueList valueList = null;
    try {
      valueList = valueListHome.create();
    } catch (CreateException e) {
      logger.error("[execute] Exception thrown.", e);
      throw new ServletException(e);
    }
    valueList.setDataSource(dataSource);
    ValueListVO listObject = valueList.getValueList(individualId, listParameters);
    ArrayList buttonList = new ArrayList();
    ValueListDisplay displayParameters = null;

    if (actionType != null && actionType.equals("lookup")) {
      // When we select the lookup then we should add the Select button to the
      // valueList
      buttonList.add(new Button("Select", "select", "lu_selectList('File');", false));
      displayParameters = new ValueListDisplay(buttonList, false, false);
      displayParameters.setRadio(true);
      listObject.setLookup(true);
      listObject.setLookupType(actionType);
      request.setAttribute("dynamicTitle", "File");
      request.setAttribute("lookupType", "File");
    } else {
      buttonList.add(new Button("View", "view", "vl_viewList();", false));
      buttonList.add(new Button("Delete", "delete", "vl_deleteList();", false));
      buttonList.add(new Button("Duplicate", "duplicate", "vl_duplicateList();", false));
      displayParameters = new ValueListDisplay(buttonList, true, true);
    }
    displayParameters.setSortable(true);
    displayParameters.setPagingBar(true);
    displayParameters.setLink(true);
    // Add the download file column
    displayParameters.setDownloadIcon(true);
    listObject.setDisplay(displayParameters);
    request.setAttribute("valueList", listObject);

    // For the searchBar
    String moduleID = (String) moduleList.get("File");
    request.setAttribute("moduleId", moduleID);
    request.setAttribute("listType", "File");

    return mapping.findForward(finalForward);
  }
View Full Code Here

        count++;
      }

      // call ejb to insert record
      // initialize hashmap
      HashMap mapEvent = new HashMap();

      mapEvent.put("EventId", strEventid);
      mapEvent.put("Accepted", "NO");
      mapEvent.put("IndividualId", strIndividuals);

      // call to marketing facade
      MarketingFacadeHome mfh = (MarketingFacadeHome)
        CVUtility.getHomeObject("com.centraview.marketing.marketingfacade.MarketingFacadeHome", "MarketingFacade");
      MarketingFacade remote = (MarketingFacade) mfh.create();
View Full Code Here

    public int doStartTag() throws JspException
  {
    HttpSession session = ((HttpServletRequest)(pageContext.getRequest())).getSession();
   
        ModuleFieldRightMatrix mfrmx = ((UserObject)session.getAttribute("userobject")).getUserPref().getModuleAuthorizationMatrix();
    HashMap hm = mfrmx.getFieldRights(getModulename());
   
    if (hm != null && hm.containsKey(getFieldname()))
    {
      fieldRight =  ((Integer)hm.get(getFieldname())).intValue();
    }
   
        // Create an appropriate "input" element based on our parameters
   
        StringBuffer results = new StringBuffer("<input type=\"");
View Full Code Here

      ThreadList threadList = remote.getThreadList(individualId, tVO.getId());
      threadList = setLinksfunction(threadList);

      ListGenerator lg1 = ListGenerator.getListGenerator(dataSource);
      HashMap hmDispLists = lg1.getDisplayLists();

      if (hmDispLists != null) {
        hmDispLists.put(new Long(threadList.getListID()), threadList);
      }

      Vector timeSlipColumns = new Vector();

      timeSlipColumns.addElement("Description");
View Full Code Here

TOP

Related Classes of java.util.HashMap

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.