Exemplo n.º 1
0
  public void loadProperty() {

    try {

      File file = new File(confFileName);

      log.debug("file=" + file.getAbsolutePath());

      confProperties = new Properties();
      confProperties.loadFromXML(new FileInputStream(file));

      bonitaApiHost = confProperties.getProperty("bonita.api.host");
      bonitaApiUsername = confProperties.getProperty("bonita.api.username");
      bonitaApiPassword = confProperties.getProperty("bonita.api.password");
      bonitaApiHttpUsername = confProperties.getProperty("bonita.api.http.username");
      bonitaApiHttpPassword = confProperties.getProperty("bonita.api.http.password");
      bonitaApiPath = confProperties.getProperty("bonita.api.path");

      rallyApiHost = confProperties.getProperty("rally.api.host");
      rallyApiHttpUsername = confProperties.getProperty("rally.api.http.username");
      rallyApiHttpPassword = confProperties.getProperty("rally.api.http.password");
      rallyProjectIds = confProperties.getProperty("rally.project.ids");

      // bonitaProcessId=properties.getProperty("bonita.process.xp_code.id");

      workflowServiceUrl = confProperties.getProperty("service.url");

    } catch (Exception e) {
      log.error("", e);
    }
  }
Exemplo n.º 2
0
  public void readValues(DataRead dr) throws BasicException {
    m_sId = dr.getString(1);
    tickettype = dr.getInt(2).intValue();
    m_iTicketId = dr.getInt(3).intValue();
    m_dDate = dr.getTimestamp(4);
    m_sActiveCash = dr.getString(5);
    try {
      byte[] img = dr.getBytes(6);
      if (img != null) {
        attributes.loadFromXML(new ByteArrayInputStream(img));
      }
    } catch (IOException e) {
    }
    m_User = new UserInfo(dr.getString(7), dr.getString(8));
    m_Customer = new CustomerInfoExt(dr.getString(9));
    m_iTicketNCF = dr.getInt(10).intValue(); // NCF
    m_aLines = new ArrayList<TicketLineInfo>();

    payments = new ArrayList<PaymentInfo>();
    taxes = null;
  }
  public DesktopAgentProperties(boolean createDefaultPropertiesEverytime) {
    properties = new Properties();
    propertiesFile = new File(propertiesFileName);

    try {
      if (!propertiesFile.exists() || createDefaultPropertiesEverytime) {
        Main.logger.warning(Main.DEFAULT, "Properties file does not exist");
        Main.logger.info(Main.DEFAULT, "Creating default properties file");
        propertiesFile = createDesktopAgentPropertiesFile(propertiesFileName);
        Main.logger.info(Main.DEFAULT, "Writing default properties file");
        properties = writeDefaultDesktopAgentPropertiesFile(propertiesFile);
      } else {
        properties.loadFromXML(new FileInputStream(propertiesFile));
        Main.logger.info(Main.DEFAULT, "Successfully loaded properties file");
      }
    } catch (InvalidPropertiesFormatException ipfe) {
      Main.logger.severe(Main.DEFAULT, ipfe.getMessage());
    } catch (IOException ioe) {
      Main.logger.severe(Main.DEFAULT, ioe.getMessage());
    }
  }
Exemplo n.º 4
0
  @Override
  void openFontDialog(String langCode) {
    FontDialog dlg = new FontDialog(this);
    dlg.setAttributes(font);

    Properties prop = new Properties();

    try {
      File xmlFile = new File(baseDir, "data/pangram.xml");
      prop.loadFromXML(new FileInputStream(xmlFile));
      dlg.setPreviewText(prop.getProperty(langCode));
    } catch (IOException ioe) {
      JOptionPane.showMessageDialog(null, ioe.getMessage(), APP_NAME, JOptionPane.ERROR_MESSAGE);
      ioe.printStackTrace();
    } catch (Exception exc) {
      exc.printStackTrace();
    }

    dlg.setVisible(true);
    if (dlg.succeeded()) {
      jTextArea1.setFont(font = dlg.getFont());
      jTextArea1.validate();
    }
  }