示例#1
0
  /**
   * @param strRole
   * @param nDeveloperID
   * @param nPageType
   * @param nProjectStatus
   * @return
   */
  public StringMatrix getProjectComboList(
      String strRole, int intDeveloperID, int intProjectStatus) {
    ArrayList ProjectList = new ArrayList();
    ProjectComboEJBLocalHome ejbHome;
    ProjectComboEJBLocal ejbRemote;
    ProjectComboModel clmData;

    try {
      Context ic = new InitialContext();
      java.lang.Object objref = ic.lookup(JNDI.PROJECT_COMBO);
      //			ejbHome = (ProjectComboEJBLocalHome) PortableRemoteObject.narrow(objref,
      // ProjectComboHome.class);
      ejbHome = (ProjectComboEJBLocalHome) (objref);
      ejbRemote = ejbHome.create();
      Collection projectList = ejbRemote.getProjectList(strRole, intDeveloperID, intProjectStatus);
      Iterator it = projectList.iterator();
      while (it.hasNext()) {
        clmData = (ProjectComboModel) it.next();
        ProjectList.add(clmData);
      }
      // release resource
      ejbRemote = null;
    } catch (Exception re) {
      logger.error("Couldn't locate Definition, Exception is " + re.getMessage());
    }
    return ConvertToStrMatrix(ProjectList);
  }
示例#2
0
 /**
  * @param strRole
  * @param nDeveloperID
  * @return
  */
 public StringMatrix getProjectStatusComboList(String strRole, int nDeveloperID) {
   ArrayList ProjectStatusList = new ArrayList();
   ProjectComboEJBLocalHome ejbHome;
   ProjectComboEJBLocal ejbRemote;
   ProjectComboModel clmData;
   try {
     Context ic = new InitialContext();
     java.lang.Object objref = ic.lookup(JNDI.PROJECT_COMBO);
     //			ejbHome = (ProjectComboHome) PortableRemoteObject.narrow(objref, ProjectComboHome.class);
     ejbHome = (ProjectComboEJBLocalHome) (objref);
     ejbRemote = ejbHome.create();
     Collection projectList = ejbRemote.getProjectStatusList(strRole, nDeveloperID);
     Iterator it = projectList.iterator();
     while (it.hasNext()) {
       clmData = (ProjectComboModel) it.next();
       ProjectStatusList.add(clmData);
     }
     // release resource
     ejbRemote = null;
   } catch (Exception re) {
     re.printStackTrace();
   }
   return StatusListToStrMatrix(ProjectStatusList);
 }