Examples of JDBControl


Examples of com.commander4j.db.JDBControl

              JLaunchMenu.runForm("FRM_ADMIN_MATERIAL_UOM", lmaterial, base);
            }
          });
        }
        {
          JDBControl ctrl = new JDBControl(Common.selectedHostID, Common.sessionID);
          String value = ctrl.getKeyValue("SSCC_LOCATION_VALIDATION");
          Boolean enabled = Boolean.valueOf(value);
          jButtonLocations = new JButton4j();
          jDesktopPane1.add(jButtonLocations);
          jButtonLocations.setText(lang.get("btn_Material_Locations"));
          jButtonLocations.setEnabled(enabled);
View Full Code Here

Examples of com.commander4j.db.JDBControl

          JUtility.initEANBarcode();
          JLaunchReport.init();
          Common.init();

          JDBUser user = new JDBUser(getHostID(), getSessionID());
          JDBControl ctrl = new JDBControl(getHostID(), getSessionID());
          JeMail mail = new JeMail(getHostID(), getSessionID());

          user.setUserId("INTERFACE");
          user.setPassword("INTERFACE");
          Common.userList.addUser(getSessionID(), user);

          enableEnterfaceStatusEmails = Boolean.parseBoolean(ctrl.getKeyValueWithDefault("INTERFACE EMAIL NOTIFY", "false", "Email startup and shutdown events :- true or false"));

          interfaceEmailAddresses = ctrl.getKeyValueWithDefault("INTERFACE ADMIN EMAIL", "someone@somewhere.com", "Email address for startup and shutdown events.");

          StringConverter stringConverter = new StringConverter();
          ArrayConverter arrayConverter = new ArrayConverter(String[].class, stringConverter);
          arrayConverter.setDelimiter(';');
          arrayConverter.setAllowedChars(new char[] { '@','_' });
          String[] emailList = (String[]) arrayConverter.convert(String[].class, interfaceEmailAddresses);
          siteName = Common.hostList.getHost(getHostID()).getSiteDescription();

          if (user.login())
          {

            if (enableEnterfaceStatusEmails == true)
            {
              try
              {
                String subject = "";
                if (houseKeeping == true)
                {
                //   subject = "Commander4j "+JVersion.getProgramVersion()+" Interface maintenance restart for [" + siteName + "] on "+JUtility.getClientName();
                //   mail.postMail(emailList, subject, "Interface service has started.", "", "");
                }
                else
                {
                  subject = "Commander4j "+JVersion.getProgramVersion()+" Interface startup for [" + siteName + "] on "+JUtility.getClientName();
                  mail.postMail(emailList, subject, "Interface service has started.", "", "");
                }
              }
              catch (Exception ex)
              {
                logger.error("InterfaceThread Unable to send emails");
              }
            }
           
            houseKeeping = false;
           
            logger.debug("Interface Logged on successfully");

            logger.debug("Starting Threads....");

            secondsBeforeHousekeeping = Integer.valueOf(ctrl.getKeyValueWithDefault("INTERFACE HOUSEKEEPING INTERVAL", "86400", "Frequency in seconds."));
            secondsRemaining = secondsBeforeHousekeeping;

            startupThreads();

            while ((shutdown == false) & (houseKeeping == false))
            {
              com.commander4j.util.JWait.milliSec(1000);
              secondsRemaining--;
              // logger.debug("Housekeeping scheduled in "+String.valueOf(secondsRemaining)+" seconds.");

              if (secondsRemaining == 0)
              {
                houseKeeping = true;

              }
            }

            logger.debug("Stopping Threads....");
            shutdownThreads();

            user.logout();
            logger.debug("Interface Logged out successfully");

            if (enableEnterfaceStatusEmails == true)
            {
              try
              {
                String subject = "";
                if (houseKeeping == true)
                {
                //   subject = "Commander4j "+JVersion.getProgramVersion()+" Interface maintenance shutdown for [" + siteName + "] on "+JUtility.getClientName();
                //   mail.postMail(emailList, subject, "Interface service has stopped.", "", "");
                }
                else
                {
                  subject = "Commander4j "+JVersion.getProgramVersion()+" Interface shutdown for [" + siteName + "] on "+JUtility.getClientName();
                  mail.postMail(emailList, subject, "Interface service has stopped.", "", "");
               
              }
              catch (Exception ex)
              {
                logger.error("InterfaceThread Unable to send emails");
              }
            }

          }
          else
          {
            logger.debug("Interface routine failed to logon to application using account INTERFACE");

          }
         
          try
          {
            backupMessageRetention =Integer.valueOf(ctrl.getKeyValueWithDefault("INTERFACE BACKUP RETENTION","30","NUMBER OF DAYS TO KEEP BACKUP MESSAGES"));
          }
          catch (Exception ex)
          {
            backupMessageRetention = 30;
          }
View Full Code Here

Examples of com.commander4j.db.JDBControl

  public parseFunction(String host, String session) {
    setHostID(host);
    setSessionID(session);

    ctrl = new JDBControl(getHostID(), getSessionID());

    expiryDateMode = ctrl.getKeyValue("EXPIRY DATE MODE");
  }
View Full Code Here

Examples of com.commander4j.db.JDBControl

 
  public JDBAutoLabellerTableModel(String host,String session)
  {
    setHostID(host);
    setSessionID(session);
    ctrl = new JDBControl(getHostID(),getSessionID());
    labdata = new JDBLabelData(getHostID(),getSessionID());
    ssccPrefix = ctrl.getKeyValue("SSCC PREFIX");
  }
View Full Code Here

Examples of com.commander4j.db.JDBControl

        public void actionPerformed(ActionEvent evt)
        {

          String schemaFrom = "";
          String schemaTo = "";
          JDBControl ctrl;

          // Source & Destination must be different Hosts//
          setStatusBarText("Validating selected hosts");
          if (hostIDFrom.equals(hostIDTo) == false)
          {

            // Check we can connect to Source //
            setStatusBarText("Connecting to source...");
            if (hstFrom.connect(sessionFrom, hostIDFrom))
            {
             
              // Check we can connect to Destination //
              setStatusBarText("Connecting to destination...");
              if (hstTo.connect(sessionTo, hostIDTo))
              {

                // Check Application Schema Versions are the
                // same in Source and Destination //
                setStatusBarText("Checking schema versions...");
                ctrl = new JDBControl(hostIDFrom, sessionFrom);
                schemaFrom = ctrl.getKeyValue("SCHEMA VERSION");
                ctrl = new JDBControl(hostIDTo, sessionTo);
                schemaTo = ctrl.getKeyValue("SCHEMA VERSION");

                if (schemaFrom.equals(schemaTo))
                {
                  // OK //
                  setStatusBarText("Getting source table names...");
View Full Code Here

Examples of com.commander4j.db.JDBControl

    if (rowCount >= 0)
    {
      int[] rows = jTable1.getSelectedRows();

      JDBPallet temp = new JDBPallet(Common.selectedHostID, Common.sessionID);
      JDBControl ctrl = new JDBControl(Common.selectedHostID, Common.sessionID);
      JDBMHNDecisions decis = new JDBMHNDecisions(Common.selectedHostID, Common.sessionID);

      int n = JOptionPane.showConfirmDialog(Common.mainForm, "Assign selected SSCC's to Master Hold Notice [" + mhnnumber + "  ?", "Confirm", JOptionPane.YES_NO_OPTION, 0, Common.icon_confirm);
      if (n == 0)
      {

        String initalDecision = ctrl.getKeyValueWithDefault("MHN INITIAL DECISION", "Pending", "Decision for pallets added to MHN");
        String initialStatus = "";
        if (decis.getDecisionProperties(initalDecision) == true)
        {
          initialStatus = decis.getStatus();
        }
View Full Code Here

Examples of com.commander4j.db.JDBControl

    uomList.addAll(uom.getInternalUoms());

    initGUI();
    final JHelp help = new JHelp();
    help.enableHelpOnButton(jButtonHelp, JUtility.getHelpSetIDforModule("FRM_ADMIN_MATERIAL_EDIT"));
    JDBControl ctrl = new JDBControl(Common.selectedHostID, Common.sessionID);
    expiryMode = ctrl.getKeyValue("EXPIRY DATE MODE");
    SwingUtilities.invokeLater(new Runnable() {
      public void run() {
        jTextFieldProcessOrder.requestFocus();
        jTextFieldProcessOrder.setCaretPosition(jTextFieldProcessOrder.getText().length());
View Full Code Here

Examples of com.commander4j.db.JDBControl

    {
      jButtonExcel = new JButton4j(Common.icon_XLS);
      jButtonExcel.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
          JDBControl control = new JDBControl(Common.selectedHostID, Common.sessionID);

          JExcel export = new JExcel();
          buildSQL();
          export.saveAs("control.xls", control.getControlDataResultSet(listStatement), Common.mainForm);
        }
      });
      jButtonExcel.setText(lang.get("btn_Excel"));
      jButtonExcel.setMnemonic(lang.getMnemonicChar());
      jButtonExcel.setBounds(331, 275, 106, 30);
View Full Code Here

Examples of com.commander4j.db.JDBControl

    listStatement = query.getPreparedStatement();
  }

  private void populateList(String defaultitem) {

    JDBControl ctrl = new JDBControl(Common.selectedHostID, Common.sessionID);
    buildSQL();
    JDBControlTableModel controltable = new JDBControlTableModel(ctrl.getControlDataResultSet(listStatement));
    TableRowSorter<JDBControlTableModel> sorter = new TableRowSorter<JDBControlTableModel>(controltable);

    jTable1.setRowSorter(sorter);
    jTable1.setModel(controltable);
View Full Code Here

Examples of com.commander4j.db.JDBControl

        jButtonAdd.setBounds(7, 275, 106, 30);
        jButtonAdd.setMnemonic(lang.getMnemonicChar());
        jButtonAdd.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_SYSTEM_KEYS_ADD"));
        jButtonAdd.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent evt) {
            JDBControl ctl = new JDBControl(Common.selectedHostID, Common.sessionID);

            systemKey = JOptionPane.showInputDialog(Common.mainForm, "Enter new System Key");
            if (systemKey != null)
            {
              if (systemKey.equals("") == false)
              {
                systemKey = systemKey.toUpperCase();
                if (ctl.create(systemKey, "", "") == false)
                {
                  JUtility.errorBeep();
                  JOptionPane.showMessageDialog(Common.mainForm, ctl.getErrorMessage(), "Error", JOptionPane.ERROR_MESSAGE);
                }
                else
                {

                  populateList("");
                  JLaunchMenu.runDialog("FRM_ADMIN_CONTROL_EDIT", systemKey);
                  populateList("");
                }
              }
            }

          }
        });
      }
      {
        jButtonDelete = new JButton4j(Common.icon_delete);
        this.getContentPane().add(jButtonDelete);
        jButtonDelete.setText(lang.get("btn_Delete"));
        jButtonDelete.setBounds(223, 275, 106, 30);
        jButtonDelete.setMnemonic(lang.getMnemonicChar());
        jButtonDelete.setEnabled(Common.userList.getUser(Common.sessionID).isModuleAllowed("FRM_SYSTEM_KEYS_DELETE"));
        jButtonDelete.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent evt) {
            int row = jTable1.getSelectedRow();
            if (row >= 0)
            {

              systemKey = jTable1.getValueAt(row, 0).toString();

              int n = JOptionPane.showConfirmDialog(Common.mainForm, "Delete System Key " + systemKey + " ?", "Confirm", JOptionPane.YES_NO_OPTION);
              if (n == 0)
              {
                JDBControl c = new JDBControl(Common.selectedHostID, Common.sessionID);
                c.setSystemKey(systemKey);
                c.delete();
                populateList("");
              }
            }
          }
        });
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.