Exemplo n.º 1
0
 public void newRow() {
   System.err.println("here");
   Row newRow = this.createRow();
   newRow.setAttribute("State", Constants.PO_STATE_INITIAL);
   this.insertRow(newRow);
   this.setCurrentRow(newRow);
 }
Exemplo n.º 2
0
  public String searchParty() {
    System.out.println(
        "******************"
            + javax.faces.webapp.FacesServlet.class.getProtectionDomain().getCodeSource());

    PartyVOImpl party = util.getViewObject("PartyVO1Iterator");

    String name = (String) party.getCurrentRow().getAttribute("name");
    String branchName = (String) party.getCurrentRow().getAttribute("branchName");

    List<Party> parties = partyService.search(name, branchName);
    if (parties.isEmpty()) {
      showMessage(getName(), "No client found with this name");
      return null;
    }

    ViewObject address = util.getViewObject("PartyAddressIterator");
    Row addressRow = address.createRow();
    addressRow.setAttribute("streetName", "Blackberry Hill Road");
    addressRow.setAttribute("city", "Lexington");
    addressRow.setAttribute("state", "MA");
    addressRow.setAttribute("country", "USA");

    address.insertRow(addressRow);

    return "StayOnTheSamePage";
  }
Exemplo n.º 3
0
  public static List<SelectItem> getFilterSelectItems(
      String viewObject,
      String valueName,
      String captionName,
      boolean isEmptyRowExists,
      Object valueEmpty,
      String captionEmpty,
      String dataControlName) {

    // ApplicationModule mod = ADFUtils.getApplicationModuleForDataControl(dataControlName);
    AppModuleImpl mod = (AppModuleImpl) ADFUtils.getBindingApplicationModule();
    ViewObject vo = mod.findViewObject(viewObject);
    List<SelectItem> rc = new ArrayList<SelectItem>();
    vo.reset();
    if (isEmptyRowExists) {
      rc.add(new SelectItem(valueEmpty, captionEmpty));
    }
    while (vo.hasNext()) {
      Row rowItem = vo.next();
      Object valueItem = rowItem.getAttribute(valueName);
      String captionItem = (String) rowItem.getAttribute(captionName);
      rc.add(new SelectItem(valueItem, captionItem));
    }

    return rc;
  }
Exemplo n.º 4
0
 public void newRow(String userId) {
   System.err.println("Creating new PO. SubmitterId is: " + userId);
   Row newRow = this.createRow();
   newRow.setAttribute("State", Constants.PO_STATE_INITIAL);
   newRow.setAttribute("SubmitterId", userId);
   this.insertRow(newRow);
   this.setCurrentRow(newRow);
 }
 public void removePlateSearch(Number activityId) {
   XxntcCsCalendarActivitiesEOVOImpl activitesVo = getXxntcCsCalendarActivitiesEOVO1();
   Key key = new Key(new Object[] {activityId});
   Row rows[] = activitesVo.getRowSetIterator().findByKey(key, 1);
   if (rows.length > 0) {
     Row row = rows[0];
     row.setAttribute("TagStatus", row.getAttribute("AssignFlag"));
   }
   /*activitesVo.removeApplyViewCriteriaName("SearchPlateCriteria");
   activitesVo.executeQuery();*/
 }
Exemplo n.º 6
0
  public Number preEditNewspaper(String mode, Number docId, String compCode) {
    this.getDBTransaction().getSession().getUserData().put("compCode", compCode);
    Number result = null;
    CmsNewspaperTVOImpl newspaperTVO = this.getCmsNewspaperTVO();
    if ("CREATE".equals(mode)) {
      CmsDocTVOImpl docVO = this.getCmsDocTVO();
      CmsDocTVORowImpl docNewRow = (CmsDocTVORowImpl) docVO.createRow();
      docNewRow.setStatus("TO_GATHER_NEWSPAPER");
      docNewRow.setLibCode("NEWSPAPER");
      docNewRow.setLibTypeCode("END_PROD_LIB");
      docNewRow.setCompCode(compCode);
      docVO.insertRow(docNewRow);

      CmsNewspaperTVORowImpl newRow = (CmsNewspaperTVORowImpl) newspaperTVO.createRow();

      // 初始化
      CmsNewspaperCategoryVOImpl newspaperCategoryVO = this.getCmsNewspaperCategoryVO();
      CmsNewspaperCategoryVORowImpl row =
          (CmsNewspaperCategoryVORowImpl) newspaperCategoryVO.first();
      if (row != null) {
        newRow.setNewspaperCategoryId(row.getNewspaperCategoryId());
        newRow.setDocId(docNewRow.getDocId());
        newRow.setPrice(row.getPrice());
        newRow.setNewspaperType(row.getNewspaperType());
        newRow.setNewspaperTypeMeaning(row.getNewspaperTypeMeaning());
        newRow.setIssn(row.getIssn());
        newRow.setCn(row.getCn());
        newRow.setLang(row.getLang());
        newRow.setLangMeaning(row.getLangMeaning());
        newRow.setChiefEditor(row.getChiefEditor());
        newRow.setBookSize(row.getBookSize());
        newRow.setBookSizeMeaning(row.getBookSizeMeaning());
        newRow.setProdSize(row.getProdSize());
        newRow.setProdSizeMeaning(row.getProdSizeMeaning());
        newRow.setReaderGroup(row.getReaderGroup());
        newRow.setReaderGroupMeaning(row.getReaderGroupMeaning());
        newspaperTVO.insertRow(newRow);
        preDocCategroupRel(mode, docNewRow.getDocId(), row.getNewspaperCategoryId());
      }

      result = newRow.getDocId();
    } else {
      result = docId;
      newspaperTVO.setbvDocId(docId);
      newspaperTVO.executeQuery();
      Row row = newspaperTVO.first();
      if (row != null) {
        row.setAttribute("LastUpdateDate", new Date());
        newspaperTVO.setCurrentRow(row);
      }
      preDocCategroupRel(mode, docId, null);
    }
    return result;
  }
 public boolean executeActivityRowLock() {
   boolean lock = true;
   ViewObjectImpl vo = this.getXxntcCsCalendarActivitiesEOVO2Update();
   Row row = vo.getCurrentRow();
   try {
     row.lock();
   } catch (Exception e) {
     lock = false;
     _logger.warning("Activity: " + row.getAttribute("ActivityId") + " record is locked");
   }
   return lock;
 }
Exemplo n.º 8
0
 public String getDel_label() {
   DCBindingContainer bd =
       (DCBindingContainer) BindingContext.getCurrent().getCurrentBindingsEntry();
   DCIteratorBinding it = bd.findIteratorBinding("KontragOtherView1Iterator");
   Row currRow = it.getCurrentRow();
   Integer Del = (Integer) currRow.getAttribute("Deleted");
   String RetStr = null;
   if (Del == 0) {
     RetStr = "Пометить на удаление";
   } else {
     RetStr = "Снять пометку на удаление";
   }
   return RetStr;
 }
Exemplo n.º 9
0
 public String getDel_style() {
   DCBindingContainer bd =
       (DCBindingContainer) BindingContext.getCurrent().getCurrentBindingsEntry();
   DCIteratorBinding it = bd.findIteratorBinding("KontragOtherView1Iterator");
   Row currRow = it.getCurrentRow();
   Integer Del = (Integer) currRow.getAttribute("Deleted");
   String RetStr = null;
   if (Del == 0) {
     RetStr = "font-size:large; Color : Red;";
   } else {
     RetStr = "font-size:large;";
   }
   return RetStr;
 }
Exemplo n.º 10
0
 public List getList() {
   List list1 = new ArrayList();
   DCBindingContainer bc = (DCBindingContainer) getBindings();
   DCIteratorBinding ir = (DCIteratorBinding) bc.findIteratorBinding("DayWeekVO1Iterator");
   Row row = ir.getCurrentRow();
   if (row != null) {
     Iterator itr = daysOfWeek.iterator();
     while (itr.hasNext()) {
       String day = (String) itr.next();
       if ("Y".equalsIgnoreCase((String) row.getAttribute(day))) list1.add(day);
     }
   }
   return list1;
 }
Exemplo n.º 11
0
 public void onDeleteDialog(DialogEvent dialogEvent) {
   if (dialogEvent.getOutcome().name().equals("ok")) {
     DCBindingContainer bd =
         (DCBindingContainer) BindingContext.getCurrent().getCurrentBindingsEntry();
     DCIteratorBinding it = bd.findIteratorBinding("KontragOtherView1Iterator");
     Row currRow = it.getCurrentRow();
     Integer Del = (Integer) currRow.getAttribute("Deleted");
     if (Del == 0) {
       BindingContainer binding = BindingContext.getCurrent().getCurrentBindingsEntry();
       OperationBinding ob = binding.getOperationBinding("Delete1");
       ob.execute();
     } else {
       currRow.setAttribute("Deleted", 0);
     }
     commitChange();
   }
 }
 public Map<String, String> updateTask(String taskStatus) {
   Map<String, String> resultMap = new HashMap<String, String>();
   String status = "E";
   String message = null;
   XxntcCsCalendarActivitiesEOVOImpl vo = getXxntcCsCalendarActivitiesEOVO2Update();
   Row row = vo.getCurrentRow();
   Date startTime = (Date) row.getAttribute("StartTime");
   Date endTime = (Date) row.getAttribute("EndTime");
   Number incidentId = (Number) row.getAttribute("IncidentId");
   Number resourceId = (Number) row.getAttribute("ResourceId");
   _logger.warning("Before Calling API");
   _logger.warning("taskStatus:" + taskStatus.toString());
   _logger.warning("startTime:" + startTime.toString());
   _logger.warning("endTime:" + endTime.toString());
   _logger.warning("incidentId:" + incidentId.toString());
   _logger.warning("resourceId:" + resourceId.toString());
   CallableStatement cs = null;
   String statement = "BEGIN XXNTC_CALENDAR_PKG.SCHEDULE_SR_PRC(?, ?, ?, ?, ?, ?, ?); END;";
   try {
     cs = getDBTransaction().createCallableStatement(statement, 0);
     cs.registerOutParameter(6, Types.VARCHAR);
     cs.registerOutParameter(7, Types.VARCHAR);
     cs.setString(1, taskStatus);
     cs.setDate(2, startTime.dateValue());
     cs.setDate(3, endTime.dateValue());
     cs.setInt(4, incidentId.intValue());
     cs.setLong(5, resourceId.longValue());
     cs.executeUpdate();
     status = cs.getString(6);
     message = cs.getString(7);
   } catch (SQLException e) {
     _logger.severe("Sql Exception during statement call", e);
   } finally {
     try {
       if (cs != null) cs.close();
     } catch (SQLException e) {
       _logger.severe("Sql Exception While Closing Callable Statement", e);
     }
   }
   resultMap.put("x_status", status);
   resultMap.put("x_error_message", message);
   _logger.warning("After API is called");
   _logger.warning("x_status:" + status);
   _logger.warning("x_error_message:" + message);
   return resultMap;
 }
Exemplo n.º 13
0
  public void onPaySettChange(ValueChangeEvent valueChangeEvent) {
    valueChangeEvent.getComponent().processUpdates(FacesContext.getCurrentInstance());
    // System.out.println(vce.getNewValue());
    String pId = getValueFrmExpression("#{row.bindings.PayId.attributeValue}");
    System.out.println(pId);
    DCBindingContainer bd =
        (DCBindingContainer) BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding it = bd.findIteratorBinding("KontragSettingsView1Iterator");
    Row currRow = it.getCurrentRow();
    currRow.setAttribute("Summa", null);

    BindingContainer binding = BindingContext.getCurrent().getCurrentBindingsEntry();
    OperationBinding ob = binding.getOperationBinding("retrieveSumm");

    if (ob != null) {
      ob.getParamsMap().put("pId", pId);
      BigDecimal summa = (BigDecimal) ob.execute();
      System.out.println(summa);
      currRow.setAttribute("Summa", summa);
    }
  }
Exemplo n.º 14
0
 public void onValueChange(ValueChangeEvent valueChangeEvent) {
   // Add event code here...
   ArrayList selectedList = null;
   if (valueChangeEvent.getOldValue().equals(valueChangeEvent.getNewValue())) return;
   selectedList = (ArrayList) valueChangeEvent.getNewValue();
   DCBindingContainer bc = (DCBindingContainer) getBindings();
   DCIteratorBinding ir = (DCIteratorBinding) bc.findIteratorBinding("DayWeekVO1Iterator");
   Row row = ir.getCurrentRow();
   List unselectedDays = new ArrayList();
   unselectedDays.addAll(daysOfWeek);
   if (selectedList != null) {
     Iterator itr = selectedList.iterator();
     while (itr.hasNext()) {
       row.setAttribute(itr.next().toString(), "Y");
     }
     unselectedDays.removeAll(selectedList);
   }
   Iterator itr = unselectedDays.iterator();
   while (itr.hasNext()) {
     row.setAttribute((String) itr.next(), "N");
   }
 }
Exemplo n.º 15
0
  public String getCDEId() {
    Number cdeId = null;

    try {
      oracle.jbo.ViewObject cdeIdView =
          getViewObject().getApplicationModule().findViewObject("DeCdeIdView");

      cdeIdView.setWhereClause("AC_IDSEQ='" + getDeIdseq() + "'");

      Row row = cdeIdView.first();

      if (row != null) {
        cdeId = (Number) row.getAttribute("MinCdeId");
      }

      return cdeId.toString();
    } // end try
    catch (Exception e) {
      log.error("Error in getCDEId(): ", e);

      return null;
    }
  }
Exemplo n.º 16
0
  public String getRegistrationStatus() {
    String rgStatus = null;

    try {
      oracle.jbo.ViewObject rView =
          getViewObject().getApplicationModule().findViewObject("AcRegistrationsView");

      rView.setWhereClause("AC_IDSEQ='" + getDeIdseq() + "'");

      Row row = rView.first();

      if (row != null) {
        rgStatus = (String) row.getAttribute("RegistrationStatus");
      }

      // String longCDEName = row
    } // end try
    catch (Exception e) {
      log.error("Error in getRegistrationStatus(): ", e);
    }

    return rgStatus;
  }
Exemplo n.º 17
0
  public String getLongCDEName() {
    String longCDEName = null;

    try {
      oracle.jbo.ViewObject rdView =
          getViewObject().getApplicationModule().findViewObject("ReferenceDocumentsView");

      rdView.setWhereClause(
          "AC_IDSEQ='" + getDeIdseq() + "' AND DCTL_NAME = 'Preferred Question Text'");

      Row row = rdView.first();

      if (row != null) {
        longCDEName = (String) row.getAttribute("DocText");
      }

      // String longCDEName = row
    } // end try
    catch (Exception e) {
      log.error("Error in getLongCDEName(): ", e);
    }

    return longCDEName;
  }
 public void addSupplierPopupCancel(ActionEvent actionEvent) {
   Row r = JSFUtils.getCurrentRow("InqSupplierInquiryView2Iterator");
   if (r != null) r.remove();
   JSFUtils.closePopup("pt1:pc1:add_supplier");
 }
 private Number getResourceId() {
   XxntcCsCalendarProvidersVOImpl providersVo = getXxntcCsCalendarProvidersVO1();
   Row currentRow = providersVo.getCurrentRow();
   return (Number) currentRow.getAttribute("ResourceId");
 }