Package org.jallinone.commons.client

Examples of org.jallinone.commons.client.ClientApplet


      return;

    if (firstTime) {
      firstTime = false;

      ClientApplet applet = ( (ApplicationClientFacade) MDIFrame.getInstance().getClientFacade()).getMainClass();

      if (functionId==null ||
          (companyCode==null && applet.getAuthorizations().getBa().isInsertEnabled(functionId)) ||
          (companyCode!=null && applet.getAuthorizations().getCompanyBa().isInsertEnabled(functionId,companyCode))
      )
        super.addPopupMenuItem(
          "newlevel.text",
          ClientSettings.getInstance().getResources().getResource("newlevel.mnemonic").charAt(0),
          true,
          new ActionListener() {
            public void actionPerformed(ActionEvent e) {
              DefaultMutableTreeNode selNode = getSelectedNode();
              if (selNode != null) {
                String value = JOptionPane.showInputDialog(
                  ClientUtils.getParentFrame(HierarTreePanel.this),
                  ClientSettings.getInstance().getResources().getResource("level description: "),
                  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();
                   }
                   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 level."),
                    ClientSettings.getInstance().getResources().getResource("change level description"),
                    JOptionPane.WARNING_MESSAGE
                  );
              }
            }
          }
        );

      if (functionId==null ||
          (companyCode==null && applet.getAuthorizations().getBa().isDeleteEnabled(functionId)) ||
          (companyCode!=null && applet.getAuthorizations().getCompanyBa().isDeleteEnabled(functionId,companyCode))
      )
        super.addPopupMenuItem(
          "removelevel.text",
          ClientSettings.getInstance().getResources().getResource("removelevel.mnemonic").charAt(0),
          true,
View Full Code Here


      jbInit();
      setSize(750,300);
      setMinimumSize(new Dimension(750,300));

      // set domain in combo box...
      ClientApplet applet = ( (ApplicationClientFacade) MDIFrame.getInstance().getClientFacade()).getMainClass();
      ButtonCompanyAuthorizations bca = applet.getAuthorizations().getCompanyBa();
      ArrayList companiesList = bca.getCompaniesList("ACC04");
      Domain domain = new Domain("DOMAIN_ACC04");
      for (int i = 0; i < companiesList.size(); i++) {
        if (applet.getAuthorizations().getCompanyBa().isInsertEnabled(
            "ACC04",companiesList.get(i).toString()
        ))
          domain.addDomainPair(companiesList.get(i),companiesList.get(i).toString());
      }
      controlCompaniesCombo.setDomain(domain);
View Full Code Here

  public VatEndorseFilterFrame() {
    try {
      jbInit();

      // set domain in combo box...
      ClientApplet applet = ( (ApplicationClientFacade) MDIFrame.getInstance().getClientFacade()).getMainClass();
      ButtonCompanyAuthorizations bca = applet.getAuthorizations().getCompanyBa();
      ArrayList companiesList = bca.getCompaniesList("ACC04_VAT_ENDORSE");
      Domain domain = new Domain("DOMAIN_ACC04_VAT_ENDORSE");
      for (int i = 0; i < companiesList.size(); i++) {
        if (applet.getAuthorizations().getCompanyBa().isInsertEnabled(
            "ACC04_VAT_ENDORSE",companiesList.get(i).toString()
        ))
          domain.addDomainPair(companiesList.get(i),companiesList.get(i).toString());
      }
      controlCompaniesCombo.setDomain(domain);
View Full Code Here

   * The method can pre-set some v.o. attributes, so that some input controls will have a predefined value associated.
   * @param persistentObject new value object
   */
  public void createPersistentObject(ValueObject PersistentObject) throws Exception {
    DetailSupplierVO vo = (DetailSupplierVO)PersistentObject;
    ClientApplet applet = ( (ApplicationClientFacade) MDIFrame.getInstance().getClientFacade()).getMainClass();
    if (applet.getAuthorizations().isOneCompany()) {
      ButtonCompanyAuthorizations bca = applet.getAuthorizations().getCompanyBa();
      ArrayList companiesList = bca.getCompaniesList("PUR01");
      vo.setCompanyCodeSys01REG04( companiesList.get(0).toString() );
    }

    // set default values...
View Full Code Here

    vo.setDocDateDOC01(new java.sql.Date(System.currentTimeMillis()));
    vo.setDocTypeDOC01(ApplicationConsts.SALE_ORDER_DOC_TYPE);
    vo.setDocStateDOC01(ApplicationConsts.OPENED);

    // pre-set warehouse code if previously defined (stored in SYS19 table...)
    ClientApplet applet = ( (ApplicationClientFacade) MDIFrame.getInstance().getClientFacade()).getMainClass();
    ButtonCompanyAuthorizations bca = applet.getAuthorizations().getCompanyBa();
    final ArrayList companiesList = bca.getCompaniesList("DOC01_ORDERS");
    if (companiesList.size()>0) {
      // retrieve default warehouse...
      HashMap map = new HashMap();
      map.put(ApplicationConsts.COMPANY_CODE_SYS01,companiesList.get(0));
View Full Code Here

      ((Subject) PersistentObject).setSubjectTypeREG04(ApplicationConsts.SUBJECT_ORGANIZATION_CUSTOMER);
    } else {
      ((Subject) PersistentObject).setSubjectTypeREG04(ApplicationConsts.SUBJECT_PEOPLE_CUSTOMER);
    }

    ClientApplet applet = ( (ApplicationClientFacade) MDIFrame.getClientFacade()).getMainClass();
    String companyCode = null;
    if (applet.getAuthorizations().isOneCompany()) {
      ButtonCompanyAuthorizations bca = applet.getAuthorizations().getCompanyBa();
      ArrayList companiesList = bca.getCompaniesList("SAL07");
      companyCode = companiesList.get(0).toString();
    }
    // set default values...
    HashMap map = new HashMap();
View Full Code Here

   * Callback method called by the Form panel when the Form is set to INSERT mode.
   * The method can pre-set some v.o. attributes, so that some input controls will have a predefined value associated.
   * @param persistentObject new value object
   */
  public void createPersistentObject(ValueObject persistentObject) throws Exception {
    ClientApplet applet = ( (ApplicationClientFacade) MDIFrame.getInstance().getClientFacade()).getMainClass();
    if (applet.getAuthorizations().isOneCompany()) {
      ButtonCompanyAuthorizations bca = applet.getAuthorizations().getCompanyBa();
      ArrayList companiesList = bca.getCompaniesList("REG04_CONTACTS");
      ((Subject)persistentObject).setCompanyCodeSys01REG04( companiesList.get(0).toString() );
    }
  }
View Full Code Here

    // warehouse row is erasable ONLY if the user has the "warehouse role" (progressiveSys04WAR01)...
    WarehouseVO vo = (WarehouseVO)grid.getVOListTableModel().getObjectForRow(grid.getSelectedRow());
    if (vo.getProgressiveSys04WAR01()==null)
      return true;
    ClientApplet applet = ( (ApplicationClientFacade) MDIFrame.getInstance().getClientFacade()).getMainClass();
    if (!applet.getAuthorizations().getUserRoles().containsKey(vo.getProgressiveSys04WAR01())) {
      JOptionPane.showMessageDialog(
        ClientUtils.getParentFrame(grid),
        ClientSettings.getInstance().getResources().getResource(
        "You are not allowed to delete data."),
        ClientSettings.getInstance().getResources().getResource(
View Full Code Here

      jbInit();

      controlCompaniesCombo.setFunctionCode("DOC01_POS");

      // check if there exists exactly one company binded to current user...
      ClientApplet applet = ( (ApplicationClientFacade) MDIFrame.getInstance().getClientFacade()).getMainClass();
      ButtonCompanyAuthorizations bca = applet.getAuthorizations().getCompanyBa();
      ArrayList companiesList = bca.getCompaniesList(controlCompaniesCombo.getFunctionCode());
      if (companiesList.size()==1) {
        checkValues((String)companiesList.get(0));
        this.dispose();
        return;
View Full Code Here

   * @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 {
    ChargeVO vo = null;
    Response res = null;
    ClientApplet applet = ( (ApplicationClientFacade) MDIFrame.getInstance().getClientFacade()).getMainClass();
    ButtonCompanyAuthorizations bca = applet.getAuthorizations().getCompanyBa();
    ArrayList companiesList = bca.getCompaniesList("SAL06");

    for(int i=0;i<newValueObjects.size();i++) {
      vo = (ChargeVO)newValueObjects.get(i);
      res = validateCharge(vo);
View Full Code Here

TOP

Related Classes of org.jallinone.commons.client.ClientApplet

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.