Exemple #1
0
  /**
   * @param args
   * @throws Exception
   */
  public static void main(String[] args) throws Exception {
    if (Check.isEmpty(System.getProperty("PropertyFile"), true)) {
      throw new AdempiereException("Please set the PropertyFile");
    }

    final String outputFolder = System.getProperty("OutputFolder");
    if (Check.isEmpty(outputFolder, true)) {
      throw new AdempiereException("Please set the OutputFolder");
    }

    final String entityType = System.getProperty("EntityType");
    if (Check.isEmpty(entityType, true)) {
      throw new AdempiereException("Please set the EntityType");
    }

    CLogMgt.initialize(true); // just to make sure we are using the client side settings

    AdempiereToolsHelper.getInstance().startupMinimal();

    final ProcessInfo pi = new ProcessInfo("GenerateCanonicalXSD", -1, 0, 0);
    pi.setParameter(
        new ProcessInfoParameter[] {
          new ProcessInfoParameter("Target_Directory", outputFolder, null, null, null),
          new ProcessInfoParameter("EntityType", entityType, null, null, null),
        });
    pi.setAD_Client_ID(Env.getAD_Client_ID(Env.getCtx()));

    final GenerateCanonicalXSD process = new GenerateCanonicalXSD();
    process.p_FilterBy_AD_Client_ID = false;

    CLogMgt.setLevel(Level.INFO);
    process.startProcess(Env.getCtx(), pi, ITrx.TRX_None);

    //
    // CanonicalXSDGenerator.validateXML(new File("d:/tmp/C_BPartner.xml"), proc.getSchemaFile());
    // CanonicalXSDGenerator.validateXML(new File("d:/tmp/clientPartners.xml"),
    // proc.getSchemaFile());
  }