Package org.jallinone.production.billsofmaterial.java

Examples of org.jallinone.production.billsofmaterial.java.ComponentVO


  /**
   * Callback method invoked when the user has clicked on the insert button
   * @param valueObject empty value object just created: the user can manage it to fill some attribute values
   */
  public void createValueObject(ValueObject valueObject) throws Exception {
    ComponentVO vo = (ComponentVO)valueObject;
    DetailItemVO itemVO = (DetailItemVO)panel.getFrame().getFormPanel().getVOModel().getValueObject();
    vo.setCompanyCodeSys01ITM03(itemVO.getCompanyCodeSys01ITM01());
    vo.setRevisionITM03(new BigDecimal(1));
    vo.setVersionITM03(new BigDecimal(1));
    vo.setSequenceITM03(new BigDecimal(panel.getComponentsGrid().getVOListTableModel().getRowCount()));
    vo.setStartDateITM03(new java.sql.Date(System.currentTimeMillis()));
    vo.setQtyITM03(new BigDecimal(1));
  }
View Full Code Here


   * @param rowNumbers row indexes related to the new rows to save
   * @param newValueObjects list of new value objects to save
   * @return an ErrorResponse value object in case of errors, VOListResponse if the operation is successfully completed
   */
  public Response insertRecords(int[] rowNumbers, ArrayList newValueObjects) throws Exception {
    ComponentVO vo = null;
    Response response = null;
    DetailItemVO itemVO = (DetailItemVO)panel.getFrame().getFormPanel().getVOModel().getValueObject();

    for(int i=0;i<newValueObjects.size();i++) {
      vo = (ComponentVO)newValueObjects.get(i);
      response = validateComponent(vo);
      if (response.isError())
        return response;

      vo.setCompanyCodeSys01ITM03(itemVO.getCompanyCodeSys01ITM01());
      vo.setParentItemCodeItm01ITM03(itemVO.getItemCodeITM01());
    }

    response = ClientUtils.getData("insertComponents",newValueObjects);
    if (!response.isError()) {
      panel.getExplosionPanel().reloadTree();
View Full Code Here

   * @param persistentObjects value objects relatied to the changed rows
   * @return an ErrorResponse value object in case of errors, VOListResponse if the operation is successfully completed
   */
  public Response updateRecords(int[] rowNumbers,ArrayList oldPersistentObjects,ArrayList persistentObjects) throws Exception {
    Response response = null;
    ComponentVO vo = null;
    for(int i=0;i<persistentObjects.size();i++) {
      vo = (ComponentVO)persistentObjects.get(i);
      response = validateComponent(vo);
      if (response.isError())
        return response;
View Full Code Here

            JOptionPane.showMessageDialog(
              MDIFrame.getInstance(),
              ClientSettings.getInstance().getResources().getResource("the selected item requires serial number definition: this kind of item is not allowed"),
              ClientSettings.getInstance().getResources().getResource("Attention"),
              JOptionPane.WARNING_MESSAGE);
            ComponentVO compVO = (ComponentVO)parentVO;
            compVO.setItemCodeItm01ITM03(null);
            compVO.setDescriptionSYS10(null);
          }
        }

        public void beforeLookupAction(ValueObject parentVO) {
          ComponentVO vo = (ComponentVO)parentVO;
          DetailItemVO itemVO = (DetailItemVO)ProductPanel.this.frame.getFormPanel().getVOModel().getValueObject();
          colItemCodeDataLocator.getLookupFrameParams().put(ApplicationConsts.PROGRESSIVE_HIE02,vo.getProgressiveHIE02());
          colItemCodeDataLocator.getLookupValidationParameters().put(ApplicationConsts.PROGRESSIVE_HIE02,vo.getProgressiveHIE02());
          colItemCodeDataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,itemVO.getCompanyCodeSys01ITM01());
          colItemCodeDataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,itemVO.getCompanyCodeSys01ITM01());
          colTreeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.PROGRESSIVE_HIE02, vo.getProgressiveHIE02());
          colTreeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.PROGRESSIVE_HIE02, vo.getProgressiveHIE02());
          colItemCodeDataLocator.getLookupFrameParams().put(ApplicationConsts.PROGRESSIVE_HIE02,vo.getProgressiveHIE02());
          colItemCodeDataLocator.getLookupValidationParameters().put(ApplicationConsts.PROGRESSIVE_HIE02,vo.getProgressiveHIE02());
          colTreeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.COMPANY_CODE_SYS01, itemVO.getCompanyCodeSys01ITM01());
          colTreeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.COMPANY_CODE_SYS01, itemVO.getCompanyCodeSys01ITM01());
          colItemCodeDataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,itemVO.getCompanyCodeSys01ITM01());
          colItemCodeDataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,itemVO.getCompanyCodeSys01ITM01());
        }

        public void forceValidate() {}

      });


      // alternative item code lookup for the alternative components grid...
      colItemCode2DataLocator.setGridMethodName("loadItems");
      colItemCode2DataLocator.setValidationMethodName("validateItemCode");
      colItemCode2DataLocator.getLookupFrameParams().put(ApplicationConsts.COMPONENTS_ONLY,Boolean.TRUE);
      colItemCode2DataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPONENTS_ONLY,Boolean.TRUE);
      colAltItemCode.setLookupController(colItemCode2Controller);
      colItemCode2Controller.setLookupDataLocator(colItemCode2DataLocator);
      colItemCode2Controller.setFrameTitle("components");

      colItemCode2Controller.setCodeSelectionWindow(colItemCodeController.TREE_GRID_FRAME);
      colTreeLevel2DataLocator.setServerMethodName("loadCompanyHierarchy");
      colItemCode2DataLocator.setTreeDataLocator(colTreeLevel2DataLocator);
      colItemCode2DataLocator.setNodeNameAttribute("descriptionSYS10");

      colItemCode2Controller.setLookupValueObjectClassName("org.jallinone.items.java.GridItemVO");
      colItemCode2Controller.addLookup2ParentLink("companyCodeSys01ITM01", "companyCodeSys01ITM04");
      colItemCode2Controller.addLookup2ParentLink("itemCodeITM01", "itemCodeItm01ITM04");
      colItemCode2Controller.addLookup2ParentLink("descriptionSYS10", "descriptionSYS10");

      colItemCode2Controller.setAllColumnVisible(false);
      colItemCode2Controller.setVisibleColumn("companyCodeSys01ITM01", true);
      colItemCode2Controller.setVisibleColumn("itemCodeITM01", true);
      colItemCode2Controller.setVisibleColumn("descriptionSYS10", true);
      colItemCode2Controller.setPreferredWidthColumn("descriptionSYS10", 200);
      colItemCode2Controller.setFramePreferedSize(new Dimension(650,500));
      colItemCode2Controller.addLookupListener(new LookupListener() {

        public void codeValidated(boolean validated) {}

        public void codeChanged(ValueObject parentVO,Collection parentChangedAttributes) {
          GridItemVO vo = (GridItemVO)colItemCode2Controller.getLookupVO();
          DetailItemVO itemVO = (DetailItemVO)ProductPanel.this.frame.getFormPanel().getVOModel().getValueObject();
          if (vo.getItemCodeITM01()!=null && vo.getItemCodeITM01().equals(itemVO.getItemCodeITM01())) {
            JOptionPane.showMessageDialog(
              MDIFrame.getInstance(),
              ClientSettings.getInstance().getResources().getResource("you cannot set the current item as alternative component"),
              ClientSettings.getInstance().getResources().getResource("Attention"),
              JOptionPane.WARNING_MESSAGE);
            AltComponentVO compVO = (AltComponentVO)parentVO;
            compVO.setItemCodeItm01ITM04(null);
            compVO.setDescriptionSYS10(null);
          }
        }

        public void beforeLookupAction(ValueObject parentVO) {
          DetailItemVO vo = (DetailItemVO)ProductPanel.this.frame.getFormPanel().getVOModel().getValueObject();
          colItemCode2DataLocator.getLookupFrameParams().put(ApplicationConsts.PROGRESSIVE_HIE02,vo.getProgressiveHie02ITM01());
          colItemCode2DataLocator.getLookupValidationParameters().put(ApplicationConsts.PROGRESSIVE_HIE02,vo.getProgressiveHie02ITM01());
          colItemCode2DataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01ITM01());
          colItemCode2DataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01ITM01());
          colTreeLevel2DataLocator.getTreeNodeParams().put(ApplicationConsts.PROGRESSIVE_HIE02, vo.getProgressiveHie02ITM01());
          colTreeLevel2DataLocator.getTreeNodeParams().put(ApplicationConsts.PROGRESSIVE_HIE02, vo.getProgressiveHie02ITM01());
          colItemCode2DataLocator.getLookupFrameParams().put(ApplicationConsts.PROGRESSIVE_HIE02,vo.getProgressiveHie02ITM01());
          colItemCode2DataLocator.getLookupValidationParameters().put(ApplicationConsts.PROGRESSIVE_HIE02,vo.getProgressiveHie02ITM01());
          colTreeLevel2DataLocator.getTreeNodeParams().put(ApplicationConsts.COMPANY_CODE_SYS01, vo.getCompanyCodeSys01ITM01());
          colTreeLevel2DataLocator.getTreeNodeParams().put(ApplicationConsts.COMPANY_CODE_SYS01, vo.getCompanyCodeSys01ITM01());
          colItemCode2DataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01ITM01());
          colItemCode2DataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01ITM01());
        }

        public void forceValidate() {}

      });


      // set explosion panel...
      explosionPanel.setLoadWhenVisibile(false);
      explosionPanel.setTreeController(new TreeController() {

        public void doubleClick(DefaultMutableTreeNode node) {
          MaterialVO vo = (MaterialVO)node.getUserObject();
          new ItemController(null,new ItemPK(vo.getCompanyCodeSys01ITM03(),vo.getItemCodeItm01ITM03()),false);
        }

        public void leftClick(DefaultMutableTreeNode node) {}

        public boolean rightClick(DefaultMutableTreeNode node) {
View Full Code Here

  private void init() {
    colItemType.setDomain(frame.getItemTypes());
    colItemType.addItemListener(new ItemListener() {
      public void itemStateChanged(ItemEvent e) {
        if (e.getStateChange() == e.SELECTED) {
          ComponentVO vo = (ComponentVO)componentsGrid.getVOListTableModel().getObjectForRow(componentsGrid.getSelectedRow());
          colTreeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.COMPANY_CODE_SYS01, vo.getCompanyCodeSys01ITM03());
          colTreeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.PROGRESSIVE_HIE02, vo.getProgressiveHIE02());
          colTreeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.PROGRESSIVE_HIE02, vo.getProgressiveHIE02());
          colItemCodeDataLocator.getLookupFrameParams().put(ApplicationConsts.PROGRESSIVE_HIE02,vo.getProgressiveHIE02());
          colItemCodeDataLocator.getLookupValidationParameters().put(ApplicationConsts.PROGRESSIVE_HIE02,vo.getProgressiveHIE02());

          colTreeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.COMPANY_CODE_SYS01, vo.getCompanyCodeSys01ITM03());
          colTreeLevelDataLocator.getTreeNodeParams().put(ApplicationConsts.COMPANY_CODE_SYS01, vo.getCompanyCodeSys01ITM03());
          colItemCodeDataLocator.getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01ITM03());
          colItemCodeDataLocator.getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanyCodeSys01ITM03());
        }
      }
    });

View Full Code Here

  public VOListResponse updateComponents(ArrayList oldVOs,ArrayList newVOs,String serverLanguageId,String username) throws Throwable {
    Connection conn = null;
    try {
      if (this.conn==null) conn = getConn(); else conn = this.conn;

      ComponentVO oldVO = null;
      ComponentVO newVO = null;
      Response res = null;

      HashSet pkAttrs = new HashSet();
      pkAttrs.add("companyCodeSys01ITM03");
      pkAttrs.add("itemCodeItm01ITM03");
View Full Code Here

    Connection conn = null;
    try {
      if (this.conn==null) conn = getConn(); else conn = this.conn;
      stmt = conn.createStatement();

      ComponentVO vo = null;
      for(int i=0;i<list.size();i++) {
        // phisically delete records in ITM04...
        vo = (ComponentVO)list.get(i);
        stmt.execute(
            "delete from ITM03_COMPONENTS where "+
            "COMPANY_CODE_SYS01='"+vo.getCompanyCodeSys01ITM03()+"' and "+
            "ITEM_CODE_ITM01='"+vo.getItemCodeItm01ITM03()+"' and "+
            "PARENT_ITEM_CODE_ITM01='"+vo.getParentItemCodeItm01ITM03()+"'"
        );
      }

      return new VOResponse(new Boolean(true));
    }
View Full Code Here

      pstmt = conn.prepareStatement(
         "SELECT PARENT_ITEM_CODE_ITM01 FROM ITM03_COMPONENTS WHERE COMPANY_CODE_SYS01=? AND ITEM_CODE_ITM01=? AND ENABLED='Y'"
      );

      Response res = null;
      ComponentVO vo = null;
      String parentItemCode = null;
      for(int i=0;i<list.size();i++) {
        vo = (ComponentVO)list.get(i);

        // loops are not allowed: analyze all ancestors of the parent item code: if one of these is the
        // item to insert, then fire an error...
        parentItemCode = vo.getParentItemCodeItm01ITM03();
        do {
          pstmt.setString(1,vo.getCompanyCodeSys01ITM03());
          pstmt.setString(2,parentItemCode);
          rset = pstmt.executeQuery();
          if (rset.next())
            parentItemCode = rset.getString(1);
          else
            parentItemCode = null;
          rset.close();
          if (parentItemCode!=null && parentItemCode.equals(vo.getItemCodeItm01ITM03()))
            throw new Exception(vo.getItemCodeItm01ITM03()+" "+t1+" "+vo.getParentItemCodeItm01ITM03());
        }
        while(parentItemCode!=null);

        vo.setEnabledITM03("Y");

        // insert into ITM03...
        res = org.jallinone.commons.server.QueryUtilExtension.insertTable(
            conn,
            new UserSessionParameters(username),
View Full Code Here

TOP

Related Classes of org.jallinone.production.billsofmaterial.java.ComponentVO

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.