Package org.pathways.openciss.model

Examples of org.pathways.openciss.model.ProgramProfileInfo


  @Produces(MediaType.TEXT_PLAIN)
  @Path("/total/dec")
  public String decTotal(@QueryParam("id") String id) {
    String result = null;
    if (id != null) {
      ProgramProfileInfo ppiToPersist = new ProgramProfileInfo();
      ppiToPersist.setAgencyKey(Integer.valueOf(id));
      ProgramProfileInfo ppiPersisted = ppis.getProgramProfileInfo(Integer.valueOf(id));
      int totalUnits = ppiPersisted.getUnitsTotal();
      totalUnits = totalUnits - 1;
      ppiToPersist.setUnitsTotal(totalUnits);
      // also recalculate available units
      int availUnits = ppiPersisted.getUnitsAvailable();
      int occUnits = ppiPersisted.getUnitsOccupied();
      availUnits = totalUnits - occUnits;
      ppiToPersist.setUnitsAvailable(availUnits);
      ppiToPersist.setUnitsOccupied(occUnits);
      ppis.updateProgramProfileInfo_Occupany(ppiToPersist);
      result = String.valueOf(totalUnits);
View Full Code Here


        Document doc = db.parse(in);
        doc.getDocumentElement().normalize();
        System.out.println("Root element " + doc.getDocumentElement().getNodeName());
        NodeList shelterNodeList = doc.getElementsByTagName("shelter");
        for (int s = 0; s < shelterNodeList.getLength(); s++) {//s < 5; s++) {
          ProgramProfileInfo ppiToPersist = new ProgramProfileInfo();
          Node shelterNode = shelterNodeList.item(s);
            if (shelterNode.getNodeType() == Node.ELEMENT_NODE) {
                 Element shelter = (Element) shelterNode;
                 for (String tagName : ELEMENT_NAMES) {
                   //System.out.println("adding " + tagName);
                   addElement(shelter, tagName, ppiToPersist);
                 }
             ppiToPersist.setFeedSource(2);
             ppiToPersist.setUpdateTimeStamp(new Timestamp(System.currentTimeMillis()));
                 //System.out.println("Done with one shelter record, now persisting");
                 ppis.updateProgramProfileInfo_Shelter(ppiToPersist);
            }
        }
        System.out.println("Read poll data loop ended");
View Full Code Here

  @Produces(MediaType.APPLICATION_JSON)
   public String getRecord(@QueryParam("id") String id) {
    int program_key = Integer.valueOf(id);
    try {
          // ... do stuff with em ...
      ProgramProfileInfo ppi = em.find(ProgramProfileInfo.class, program_key);
      String result = ppi.getProgramName();
      System.out.println(result);
      return result;
      } finally {
          em.close();
      }
View Full Code Here

TOP

Related Classes of org.pathways.openciss.model.ProgramProfileInfo

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.