Package org.jallinone.hierarchies.java

Examples of org.jallinone.hierarchies.java.CompanyHierarchyLevelVO


    return "companyInsertLevel";
  }


  public final Response executeCommand(Object inputPar,UserSessionParameters userSessionPars,HttpServletRequest request, HttpServletResponse response,HttpSession userSession,ServletContext context) {
    CompanyHierarchyLevelVO vo = (CompanyHierarchyLevelVO)inputPar;
    try {
      CompanyHierarchies bean = (CompanyHierarchies)JAIOBeanFactory.getInstance().getBean(CompanyHierarchies.class);
      String defCompanyCodeSys01SYS03 = ((JAIOUserSessionParameters)userSessionPars).getDefCompanyCodeSys01SYS03();
      Response answer = bean.insertLevel(vo,((JAIOUserSessionParameters)userSessionPars).getServerLanguageId(),userSessionPars.getUsername(),defCompanyCodeSys01SYS03);
View Full Code Here


    vo.setStartDateITM01(new java.sql.Date(System.currentTimeMillis()));
    vo.setVersionITM01(new BigDecimal(1));
    vo.setRevisionITM01(new BigDecimal(1));

    if (parentFrame != null) {
      CompanyHierarchyLevelVO levelVO = (CompanyHierarchyLevelVO)parentFrame.getHierarTreePanel().getSelectedNode().getUserObject();
      vo.setProgressiveHie01ITM01(levelVO.getProgressiveHIE01());
      vo.setProgressiveHie02ITM01(levelVO.getProgressiveHie02HIE01());
      vo.setLevelDescriptionSYS10(levelVO.getDescriptionSYS10());
      vo.setProgressiveHie01HIE02(levelVO.getProgressiveHie01HIE02());
      vo.setCompanyCodeSys01ITM01(parentFrame.getSelectedItemType().getCompanyCodeSys01ITM02());
    }


    frame.setVariants(vo.getCompanyCodeSys01ITM01());
View Full Code Here

   * Index tree nodes, using as key the combination of levels descriptions.
   * @param node DefaultMutableTreeNode
   * @param map collection of pairs <leveldescr1 levelsSeparator leveldescr2 levelsSeparator ...,progressiveHIE01>
   */
  private void indexingTree(DefaultMutableTreeNode node,HashMap map,String levelsSeparator,String parentDesc) {
    CompanyHierarchyLevelVO vo = (CompanyHierarchyLevelVO)node.getUserObject();
    DefaultMutableTreeNode childNode = null;

    map.put(parentDesc+vo.getDescriptionSYS10(),vo.getProgressiveHIE01());

    for(int i=0;i<node.getChildCount();i++) {
      childNode = (DefaultMutableTreeNode)node.getChildAt(i);
      vo = (CompanyHierarchyLevelVO)node.getUserObject();
      indexingTree(childNode,map,levelsSeparator,parentDesc+vo.getDescriptionSYS10()+levelsSeparator);
    }
  }
View Full Code Here

      splittedLevelsDesc[i] = levelsDesc[i].split(sep);
    String aux[] = new String[langsVO.size()];
    for(int i=0;i<langsVO.size();i++)
      aux[i] = "";
    Response res = null;
    CompanyHierarchyLevelVO vo = null;

    langVO = (LanguageVO)langsVO.get(0);
    for(int j=0;j<splittedLevelsDesc[0].length;j++) {
      for(int i=0;i<langsVO.size();i++) {
        if (j > 0)
          aux[i] += levelsSeparator;
        aux[i] += splittedLevelsDesc[i][j];
      }
      progressiveHIE01 = (BigDecimal)treeIndexes[0].get(aux[0]);
      if (progressiveHIE01==null) {
        // level to insert, for each language...
        vo = new CompanyHierarchyLevelVO();
        vo.setCompanySys01HIE01(defCompanyCodeSys01SYS03);
        vo.setDescriptionSYS10(splittedLevelsDesc[0][j]);
        vo.setLevelHIE01(new BigDecimal(j));
        vo.setProgressiveHie02HIE01(progressiveHIE02);
        vo.setProgressiveHie01HIE01(parentProgressiveHIE01);
        res = bean.insertLevel(vo,serverLanguageId,username,defCompanyCodeSys01SYS03);
        if (!res.isError()) {
          vo = (CompanyHierarchyLevelVO)((VOResponse)res).getVo();
          progressiveHIE01 = vo.getProgressiveHIE01();
          treeIndexes[0].put(aux[0],progressiveHIE01);

          for(int i=0;i<langsVO.size();i++) {
            langVO = (LanguageVO)langsVO.get(i);
            CompanyTranslationUtils.updateTranslation(vo.getCompanySys01HIE01(),splittedLevelsDesc[0][j],splittedLevelsDesc[i][j],progressiveHIE01,langVO.getLanguageCodeSYS09(),username,conn);
            treeIndexes[i].put(aux[i],progressiveHIE01);
          }
        }
        else
          throw new Exception(res.getErrorMessage());
View Full Code Here

                  ClientSettings.getInstance().getResources().getResource("new level"),
                  JOptionPane.QUESTION_MESSAGE
                );
                if (value!=null) {
                  try {
                    CompanyHierarchyLevelVO newVO = (CompanyHierarchyLevelVO)((CompanyHierarchyLevelVO)selNode.getUserObject()).clone();
                    newVO.setProgressiveHie01HIE01(newVO.getProgressiveHIE01());
                    newVO.setLevelHIE01(newVO.getLevelHIE01().add(new BigDecimal(1)));
                    newVO.setDescriptionSYS10(value);
                    DefaultMutableTreeNode newNode = new OpenSwingTreeNode(newVO);
                    Response response = ClientUtils.getData("companyInsertLevel",newVO);
                    if (!response.isError()) {
                      newNode.setUserObject(((VOResponse)response).getVo());
                      selNode.add(newNode);
                      repaintTree();
                   }
                   else
                     JOptionPane.showMessageDialog(
                       ClientUtils.getParentFrame(HierarTreePanel.this),
                       response.getErrorMessage(),
                       ClientSettings.getInstance().getResources().getResource("Error"),
                       JOptionPane.ERROR_MESSAGE
                     );
                  } catch (CloneNotSupportedException ex) {
                    ex.printStackTrace();
                  }
                }
                else
                  JOptionPane.showMessageDialog(
                    ClientUtils.getParentFrame(HierarTreePanel.this),
                    ClientSettings.getInstance().getResources().getResource("You must specify a description for the new level."),
                    ClientSettings.getInstance().getResources().getResource("new level"),
                    JOptionPane.WARNING_MESSAGE
                  );
              }
            }
          }
        );

      if (functionId==null ||
          (companyCode==null && applet.getAuthorizations().getBa().isEditEnabled(functionId)) ||
          (companyCode!=null && applet.getAuthorizations().getCompanyBa().isEditEnabled(functionId,companyCode))
      )
        super.addPopupMenuItem(
          "updatelevel.text",
          ClientSettings.getInstance().getResources().getResource("updatelevel.mnemonic").charAt(0),
          true,
          new ActionListener() {
            public void actionPerformed(ActionEvent e) {
              DefaultMutableTreeNode selNode = getSelectedNode();
              if (selNode != null) {
                CompanyHierarchyLevelVO newVO = (CompanyHierarchyLevelVO)selNode.getUserObject();
                String value = JOptionPane.showInputDialog(
                  ClientUtils.getParentFrame(HierarTreePanel.this),
                  ClientSettings.getInstance().getResources().getResource("level description: "),
                  newVO.getDescriptionSYS10()
                );
                if (value!=null) {
                  try {
                    CompanyHierarchyLevelVO oldVO = (CompanyHierarchyLevelVO)((CompanyHierarchyLevelVO)selNode.getUserObject()).clone();
                    newVO.setDescriptionSYS10(value);
                    Response response = ClientUtils.getData("updateCompanyLevel",new CompanyHierarchyLevelVO[] {oldVO,newVO});
                    if (!response.isError()) {
                      selNode.setUserObject(newVO);
                      repaintTree();
View Full Code Here

        Hashtable currentLevelNodes = new Hashtable();
        Hashtable newLevelNodes = new Hashtable();
        int currentLevel = -1;
        DefaultMutableTreeNode currentNode = null;
        DefaultMutableTreeNode parentNode = null;
        CompanyHierarchyLevelVO vo = null;
        while(rset.next()) {
          if (currentLevel!=rset.getInt(3)) {
            // next level...
            currentLevel = rset.getInt(3);
            currentLevelNodes = newLevelNodes;
            newLevelNodes = new Hashtable();
          }

          if (currentLevel==0) {
            // prepare a tree model with the root node...
            vo = new CompanyHierarchyLevelVO();
            vo.setCompanySys01HIE01(companyCodeSys01);
            vo.setEnabledHIE01("Y");
            vo.setLevelHIE01(rset.getBigDecimal(3));
            vo.setProgressiveHIE01(rset.getBigDecimal(1));
            vo.setProgressiveHie01HIE01(rset.getBigDecimal(2));
            vo.setProgressiveHie02HIE01(progressiveHIE02);
            vo.setDescriptionSYS10(rset.getString(4));
            vo.setProgressiveHie01HIE02(rset.getBigDecimal(5));
            currentNode = new OpenSwingTreeNode(vo);
            model = new DefaultTreeModel(currentNode);
          }
          else {
            vo = new CompanyHierarchyLevelVO();
            vo.setCompanySys01HIE01(companyCodeSys01);
            vo.setEnabledHIE01("Y");
            vo.setLevelHIE01(rset.getBigDecimal(3));
            vo.setProgressiveHIE01(rset.getBigDecimal(1));
            vo.setProgressiveHie01HIE01(rset.getBigDecimal(2));
            vo.setProgressiveHie02HIE01(progressiveHIE02);
            vo.setDescriptionSYS10(rset.getString(4));
            vo.setProgressiveHie01HIE02(rset.getBigDecimal(5));
            currentNode = new OpenSwingTreeNode(vo);

            parentNode = (DefaultMutableTreeNode)currentLevelNodes.get(new Integer(rset.getInt(2)));
            parentNode.add(currentNode);
          }
View Full Code Here

  /**
   * Callback method invoked when the user has clicked the left mouse button.
   * @param node selected node
   */
  public void leftClick(DefaultMutableTreeNode node) {
    CompanyHierarchyLevelVO vo = (CompanyHierarchyLevelVO)node.getUserObject();
    CompanyHierarchyLevelVO root = (CompanyHierarchyLevelVO)((DefaultMutableTreeNode)node.getRoot()).getUserObject();
    frame.getGrid().getOtherGridParams().put(ApplicationConsts.COMPANY_CODE_SYS01,vo.getCompanySys01HIE01());
    frame.getGrid().getOtherGridParams().put(ApplicationConsts.PROGRESSIVE_HIE02,vo.getProgressiveHie02HIE01());
    frame.getGrid().getOtherGridParams().put(ApplicationConsts.PROGRESSIVE_HIE01,vo.getProgressiveHIE01());
    frame.getGrid().getOtherGridParams().put(ApplicationConsts.ROOT_PROGRESSIVE_HIE01,root.getProgressiveHIE01());
    frame.getGrid().reloadData();
  }
View Full Code Here

    return "updateCompanyLevel";
  }


  public final Response executeCommand(Object inputPar,UserSessionParameters userSessionPars,HttpServletRequest request, HttpServletResponse response,HttpSession userSession,ServletContext context) {
    CompanyHierarchyLevelVO oldVO = ((CompanyHierarchyLevelVO[])inputPar)[0];
    CompanyHierarchyLevelVO newVO = ((CompanyHierarchyLevelVO[])inputPar)[1];
    try {

      CompanyHierarchies bean = (CompanyHierarchies)JAIOBeanFactory.getInstance().getBean(CompanyHierarchies.class);
      Response answer = bean.updateLevel(((CompanyHierarchyLevelVO[])inputPar)[0],((CompanyHierarchyLevelVO[])inputPar)[1],((JAIOUserSessionParameters)userSessionPars).getServerLanguageId(),userSessionPars.getUsername());
View Full Code Here

    return "companyDeleteLevel";
  }


  public final Response executeCommand(Object inputPar,UserSessionParameters userSessionPars,HttpServletRequest request, HttpServletResponse response,HttpSession userSession,ServletContext context) {
    CompanyHierarchyLevelVO vo = (CompanyHierarchyLevelVO)inputPar;
    try {

      CompanyHierarchies bean = (CompanyHierarchies)JAIOBeanFactory.getInstance().getBean(CompanyHierarchies.class);
      Response answer = bean.deleteLevel(vo,((JAIOUserSessionParameters)userSessionPars).getServerLanguageId(),userSessionPars.getUsername());
View Full Code Here

   * Callback method invoked when the user has clicked the left mouse button.
   * @param node selected node
   */
  public void leftClick(DefaultMutableTreeNode node) {
    try {
      CompanyHierarchyLevelVO vo = (CompanyHierarchyLevelVO)node.getUserObject();
      CompanyHierarchyLevelVO root = (CompanyHierarchyLevelVO)((DefaultMutableTreeNode)node.getRoot()).getUserObject();
      detailFrame.getItemsGrid().getOtherGridParams().put(ApplicationConsts.PROGRESSIVE_HIE02,vo.getProgressiveHie02HIE01());
      detailFrame.getItemsGrid().getOtherGridParams().put(ApplicationConsts.PROGRESSIVE_HIE01,vo.getProgressiveHIE01());
      detailFrame.getItemsGrid().getOtherGridParams().put(ApplicationConsts.ROOT_PROGRESSIVE_HIE01,root.getProgressiveHIE01());
      detailFrame.getItemsGrid().getOtherGridParams().put(ApplicationConsts.PROGRESSIVE_REG04,pk.getProgressiveREG04());
      detailFrame.getItemsGrid().getOtherGridParams().put(ApplicationConsts.COMPANY_CODE_SYS01,pk.getCompanyCodeSys01REG04());


      detailFrame.getItemDataLocator().getLookupValidationParameters().put(ApplicationConsts.COMPANY_CODE_SYS01,pk.getCompanyCodeSys01REG04());
      detailFrame.getItemDataLocator().getLookupValidationParameters().put(ApplicationConsts.PROGRESSIVE_HIE02,vo.getProgressiveHie02HIE01());
      detailFrame.getItemDataLocator().getLookupValidationParameters().put(ApplicationConsts.PROGRESSIVE_HIE01,vo.getProgressiveHIE01());
      detailFrame.getItemDataLocator().getLookupValidationParameters().put(ApplicationConsts.ROOT_PROGRESSIVE_HIE01,root.getProgressiveHIE01());
      detailFrame.getItemDataLocator().getLookupFrameParams().put(ApplicationConsts.COMPANY_CODE_SYS01,pk.getCompanyCodeSys01REG04());
      detailFrame.getItemDataLocator().getLookupFrameParams().put(ApplicationConsts.PROGRESSIVE_HIE02,vo.getProgressiveHie02HIE01());
      detailFrame.getItemDataLocator().getLookupFrameParams().put(ApplicationConsts.PROGRESSIVE_HIE01,vo.getProgressiveHIE01());
      detailFrame.getItemDataLocator().getLookupFrameParams().put(ApplicationConsts.ROOT_PROGRESSIVE_HIE01,root.getProgressiveHIE01());


      detailFrame.getItemsGrid().reloadData();
    }
    catch (Exception ex) {
View Full Code Here

TOP

Related Classes of org.jallinone.hierarchies.java.CompanyHierarchyLevelVO

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.