Package com.ipc.oce.metadata

Examples of com.ipc.oce.metadata.OCConfigurationMetadataObject


   * @throws JIException
   *             - ошибка работы в DCOM
   */
  public final OCConfigurationMetadataObject getMetadata()
  throws JIException {
    return new OCConfigurationMetadataObject(get("Metadata"));
  }
View Full Code Here


    return app;
  }

  public static void main(String[] args) throws IOException, ConfigurationException, JIException {
    OCApp app = getConnection();
    OCConfigurationMetadataObject configurationMetadata = app.getMetadata();
    OCMetadataDocumentCollection documentCollection = configurationMetadata.getDocuments();
    System.out.println(
        configurationMetadata.getName()
        + " "
        + configurationMetadata.getVersion());
    int sz = documentCollection.size();
    for (int z = 0; z < sz; z++) {
      OCDocumentMetadataObject metadataObject = documentCollection.get(z);
      System.out.println(metadataObject.getFullName());
    }
View Full Code Here

   * @see com.ipc.oce.ShellTool#doWork()
   */
  @Override
  protected void doWork() throws JIException {
    OCApp app = getApplication();
    OCConfigurationMetadataObject metadata = app.getMetadata();
   
    // get cfg name
    try {
      String cfgName = metadata.getName();
      System.out.println("\t" + MSG_1C_CONF_NAME + cfgName);
    } catch (JIException ee) {
      prMes(MSG_1C_CONF_NAME, false);
    }
   
    // get cfg version
    try {
      String cfgVer = metadata.getVersion();
      System.out.println("\t" + MSG_1C_CONF_VERSION + " " + cfgVer);
    } catch (JIException ee) {
      prMes(MSG_1C_CONF_VERSION, false);
    }
   
View Full Code Here

   * @throws JIException
   */
  public synchronized String[] getDocumentNames() throws JIException {
    if (documentsName == null) {
      OCApp app = OCApp.getInstance(getAssociatedSessionID());
      OCConfigurationMetadataObject metadata = app.getMetadata();
      OCMetadataDocumentCollection docCollection = metadata
          .getDocuments();
      int docTypeCount = docCollection.size();
      List<String> dcNames = new ArrayList<String>();
      for (int z = 0; z < docTypeCount; z++) {
        dcNames.add(docCollection.get(z).getName());
View Full Code Here

*/
public class TryToGetOwner extends BasicTest {

  @Test
  public void getChartOfCharacteristic() throws JIException {
    OCConfigurationMetadataObject cfgMeta = app.getMetadata();
    OCMetadataChartOfCharacteristicTypeCollection typeCollection = cfgMeta.getChartsOfCharacteristicTypes();
    for (OCChartOfCharacteristicTypeMetadataObject mo : typeCollection) {
      System.out.println(mo.toString());
    }
   
    OCChartOfCharacteristicTypesManager manager = app.getChartOfCharacteristicTypesManager("НастройкиПользователей");
View Full Code Here

*/
public class JUEnumMetadata extends BasicTest {

  @Test
  public void showEnumMetadata() throws JIException {
    OCConfigurationMetadataObject cfg = app.getMetadata();
    OCMetadataEnumCollection enumCollection = cfg.getEnums();
    for (OCEnumMetadataObject metaEnum : enumCollection) {
      String name = metaEnum.getName();
      name = metaEnum.getFullName();
      System.out.println(name);
      OCMetadataEnumValueCollection enumValCollection = metaEnum.getEnumValues();
View Full Code Here

*/
public class TryToGetExchangePlan extends BasicTest {

  @Test
  public void doTest() throws JIException {
    OCConfigurationMetadataObject cfgMeta = app.getMetadata();
    OCMetadataExchangePlanCollection planCollection = cfgMeta.getExchangePlans();
    for (OCExchangePlanMetadataObject mo : planCollection) {
      System.out.println(mo.toString());
    }
    OCExchangePlanManager manager = app.getExchangePlanManager("ОбменРозницаБухгалтерия");
    OCExchangePlanSelection selection = manager.select();
View Full Code Here

*/
public class JUCMO extends BasicTest {

  @Test
  public void findByFullName() throws JIException {
    OCConfigurationMetadataObject cmo = app.getMetadata();
    long s = System.currentTimeMillis();
    OCMetadataCatalogCollection cc = cmo.getCatalogs();
    int counter = 0;
    OCCatalogMetadataObject last = null;
    for (OCCatalogMetadataObject meta : cc) {
      counter++;
      last = meta;
    }
    System.out.println("Catalogs [" + counter + "] enum time: " + (System.currentTimeMillis() - s) + "ms");
   
    s = System.currentTimeMillis();
    _OCCommonMetadataObject oco = cmo.findByFullName(last.getFullName());
   
    System.out.println("Catalog [only one] find time: " + (System.currentTimeMillis() - s) + "ms");
   
   
  }
View Full Code Here

    LocalResultSet lrs = LocalResultSet.createEmptyResultSet(new String[] {
        "TABLE_CAT", "TABLE_SCHEM", "TABLE_NAME", "TABLE_TYPE",
        "REMARKS", "TYPE_CAT", "TYPE_SCHEM", "TYPE_NAME",
        "SELF_REFERENCING_COL_NAME", "REF_GENERATION" }, connection);
    try {
      OCConfigurationMetadataObject metadata = app.getMetadata();

      if (schemaPattern == null || schemaPattern.equals(SCHEMA_DOCUMENT)) {
        OCMetadataDocumentCollection documentCollection = metadata
            .getDocuments();
        int colSZ = documentCollection.size();

        for (int z = 0; z < colSZ; z++) {
          OCDocumentMetadataObject dmo = documentCollection.get(z);
          lrs.createRowAndSetValues(new Object[] { null,
              SCHEMA_DOCUMENT, dmo.getName(), "TABLE",
              dmo.getComment(), null, null, null, null, null });
        }
      }
      if (schemaPattern == null || schemaPattern.equals(SCHEMA_CATALOG)) {
        OCMetadataCatalogCollection catalogCollection = metadata
            .getCatalogs();
        int colSZ = catalogCollection.size();

        for (int z = 0; z < colSZ; z++) {
          OCCatalogMetadataObject cmo = catalogCollection.get(z);
View Full Code Here

        "SQL_DATETIME_SUB", // unused
        "CHAR_OCTET_LENGTH", "ORDINAL_POSITION", "IS_NULLABLE",
        "SCOPE_CATLOG", "SCOPE_SCHEMA", "SCOPE_TABLE",
        "SOURCE_DATA_TYPE", "IS_AUTOINCREMENT" }, connection);
    try {
      OCConfigurationMetadataObject metadata = app.getMetadata();
      if (schemaPattern == null || schemaPattern.equals(SCHEMA_DOCUMENT)) {
        OCMetadataDocumentCollection documentCollection = metadata
            .getDocuments();
        OCDocumentMetadataObject dmo = documentCollection
            .find(tableNamePattern);
        if (dmo != null) { // а вдруг если схема не задана объект ей не
                  // принадлежит

          OCMetadataAttributeCollection attributeCollection = dmo
              .getAttributes();
          attribute2resultSet(attributeCollection, lrs,
              SCHEMA_DOCUMENT, tableNamePattern);

          int colSZ = attributeCollection.size();

          // Add NUMBER
          lrs.createRowAndSetValues(new Object[] { null, // TABLE_CAT
              SCHEMA_DOCUMENT, // TABLE_SCHEM
              tableNamePattern, // TABLE_NAME
              "Number", // COLUMN_NAME
              Types.VARCHAR, // DATA_TYPE
              "VARCHAR", // TYPE_NAME
              Integer.valueOf(dmo.getNumberLength()), // COLUMN_SIZE
              null, // BUFFER_LENGTH
              null, // DECIMAL_DIGITS
              Integer.valueOf(10), // NUM_PREC_RADIX
              Integer.valueOf(columnNullableUnknown), // NULLABLE
              null, // REMARKS
              null, // COLUMN_DEF
              null, // SQL_DATA_TYPE
              null, // SQL_DATETIME_SUB
              Integer.valueOf(dmo.getNumberLength()), // CHAR_OCTET_LENGTH
              colSZ + 1, // ORDINAL_POSITION
              "", // IS_NULLABLE
              null, // SCOPE_CATLOG
              null, // SCOPE_SCHEMA
              null, // SCOPE_TABLE
              null, // SOURCE_DATA_TYPE
              "YES" // IS_AUTOINCREMENT
          });

          // Add DATE
          lrs.createRowAndSetValues(new Object[] { null, // TABLE_CAT
              SCHEMA_DOCUMENT, // TABLE_SCHEM
              tableNamePattern, // TABLE_NAME
              "Date", // COLUMN_NAME
              Types.TIMESTAMP, // DATA_TYPE
              "TIMESTAMP", // TYPE_NAME
              null, // COLUMN_SIZE
              null, // BUFFER_LENGTH
              null, // DECIMAL_DIGITS
              Integer.valueOf(10), // NUM_PREC_RADIX
              Integer.valueOf(columnNullableUnknown), // NULLABLE
              null, // REMARKS
              null, // COLUMN_DEF
              null, // SQL_DATA_TYPE
              null, // SQL_DATETIME_SUB
              null, // CHAR_OCTET_LENGTH
              colSZ + 2, // ORDINAL_POSITION
              "", // IS_NULLABLE
              null, // SCOPE_CATLOG
              null, // SCOPE_SCHEMA
              null, // SCOPE_TABLE
              null, // SOURCE_DATA_TYPE
              "NO" // IS_AUTOINCREMENT
          });

          // Add Posted
          lrs.createRowAndSetValues(new Object[] { null, // TABLE_CAT
              SCHEMA_DOCUMENT, // TABLE_SCHEM
              tableNamePattern, // TABLE_NAME
              "Posted", // COLUMN_NAME
              Types.SMALLINT, // DATA_TYPE
              "SMALLINT", // TYPE_NAME
              null, // COLUMN_SIZE
              null, // BUFFER_LENGTH
              null, // DECIMAL_DIGITS
              Integer.valueOf(10), // NUM_PREC_RADIX
              Integer.valueOf(columnNullableUnknown), // NULLABLE
              null, // REMARKS
              null, // COLUMN_DEF
              null, // SQL_DATA_TYPE
              null, // SQL_DATETIME_SUB
              null, // CHAR_OCTET_LENGTH
              colSZ + 3, // ORDINAL_POSITION
              "", // IS_NULLABLE
              null, // SCOPE_CATLOG
              null, // SCOPE_SCHEMA
              null, // SCOPE_TABLE
              null, // SOURCE_DATA_TYPE
              "NO" // IS_AUTOINCREMENT
          });

          // Add DeletionMark
          lrs.createRowAndSetValues(new Object[] { null, // TABLE_CAT
              SCHEMA_DOCUMENT, // TABLE_SCHEM
              tableNamePattern, // TABLE_NAME
              "DeletionMark", // COLUMN_NAME
              Types.SMALLINT, // DATA_TYPE
              "SMALLINT", // TYPE_NAME
              null, // COLUMN_SIZE
              null, // BUFFER_LENGTH
              null, // DECIMAL_DIGITS
              Integer.valueOf(10), // NUM_PREC_RADIX
              Integer.valueOf(columnNullableUnknown), // NULLABLE
              null, // REMARKS
              null, // COLUMN_DEF
              null, // SQL_DATA_TYPE
              null, // SQL_DATETIME_SUB
              null, // CHAR_OCTET_LENGTH
              colSZ + 4, // ORDINAL_POSITION
              "", // IS_NULLABLE
              null, // SCOPE_CATLOG
              null, // SCOPE_SCHEMA
              null, // SCOPE_TABLE
              null, // SOURCE_DATA_TYPE
              "NO" // IS_AUTOINCREMENT
          });
        }
      }
      if (schemaPattern == null || schemaPattern.equals(SCHEMA_CATALOG)) {
        OCMetadataCatalogCollection catalogCollection = metadata
            .getCatalogs();
        OCCatalogMetadataObject cmo = catalogCollection
            .find(tableNamePattern);
        if (cmo != null) {
View Full Code Here

TOP

Related Classes of com.ipc.oce.metadata.OCConfigurationMetadataObject

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.