Examples of OCDocumentMetadataObject


Examples of com.ipc.oce.metadata.objects.OCDocumentMetadataObject

    return OCApp.getInstance(getAssociatedSessionID()).getMetadata().getDocuments().find(managerName);
  }

  @Override
  public OCDocumentMetadataObject getMetadata() throws JIException {
    return new OCDocumentMetadataObject(super.getMetadata());
  }
View Full Code Here

Examples of com.ipc.oce.metadata.objects.OCDocumentMetadataObject

   * Предоставляет доступ к объекту описания метаданных документа. Другой путь получения того же значения - через свойство глобального контекста Метаданные (OCConfigurationMetadataObject).
   * @return
   * @throws JIException
   */
  public OCDocumentMetadataObject getMetadata() throws JIException {
    return new OCDocumentMetadataObject(super.getMetadata());
  }
View Full Code Here

Examples of com.ipc.oce.metadata.objects.OCDocumentMetadataObject

  }

  public Document applyRender() throws ParserConfigurationException, JIException {
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    String ns = XMLConstants.IPC_NS;
    OCDocumentMetadataObject metadata = documentObject.getMetadata();

    DocumentBuilder db = dbf.newDocumentBuilder();

    // create an instance of DOM
    Document doc = db.newDocument();
   
    // create root element
    String docTypeName = metadata.getName();
    Element root = doc.createElementNS(ns, XMLConstants.DOC_OBJ_PREF);
    root.setAttribute("name", docTypeName);
   
    if (showRootGUID) {
      root.setAttribute("guid", documentObject.getRef()
          .getUUID().toString());
    }
 
   
    // create number element
    Element number = doc.createElementNS(ns, "Number");
    number.setTextContent(documentObject.getNumberAsString());
    root.appendChild(number);
   
    // create date element
    Element date = doc.createElementNS(ns, "Date");
    date.setTextContent(sdFormat.format(documentObject.getDate()));
    root.appendChild(date);
   
    // create isPosted
    Element isPosted = doc.createElementNS(ns, "Posted");
    isPosted.setTextContent(String.valueOf(documentObject.isPosted()));
    root.appendChild(isPosted);
   
    // create isDeleted
    Element isDeleted = doc.createElementNS(ns, "DeletionMark");
    isDeleted.setTextContent(String.valueOf(documentObject.isDeletionMark()));
    root.appendChild(isDeleted);
   
    // create attribute elements
    Element attrElement = doc.createElementNS(ns, "Attributes");
    root.appendChild(attrElement);
    OCMetadataAttributeCollection attributeMetaCollection = metadata.getAttributes();
    OCAttributeMetadataObject amoTmp = null;
    int amcSZ = attributeMetaCollection.size();
    for (int z = 0; z < amcSZ; z++) {
      amoTmp = attributeMetaCollection.get(z);
      String oName = amoTmp.getName();
      //String tName = transliterate(oName);
      Element elem = doc.createElementNS(ns, "Attribute");
      elem.setAttribute("name", oName);
     
      OCVariant var = documentObject.getAttributeValue(oName);
      Object varValue = var.value();
      int typeCode = var.getTypeCode();
      boolean isRef = (typeCode > 99);
     
      Object attrVal = documentObject.getAttributeValue(oName).value();
     
      //handle different type of types
      if (attrVal instanceof Date) {
        attrVal = sdFormat.format(attrVal);
      }
     
      elem.setTextContent(attrVal.toString());
     
      if (showIsRefAttribute) {
        elem.setAttribute("isRef", String.valueOf(isRef));
      }
     
      if (isRef) {
        if (showRefType && varValue instanceof _OCCommonRef) {
          elem.setAttribute("refType", ((_OCCommonRef) varValue).getMetadata().getFullName());
        } else
        if (showRefType && varValue instanceof OCEnumRef ) {
          elem.setAttribute("refType", ((OCEnumRef) varValue).getMetadata().getFullName());
        }
        if (showRefGUID && varValue instanceof _OCCommonRef) {
          elem.setAttribute("guid", ((_OCCommonRef) varValue).getUUID().toString());
        }
      }
      attrElement.appendChild(elem);
    }
   
    // create table section
    Element tabSections = doc.createElementNS(ns, "TabularSections");
    root.appendChild(tabSections);
    OCMetadataTabularSectionCollection tabSecCollection = metadata.getTabularSections();
    int tabSecColSZ = tabSecCollection.size();
    for (int z = 0; z < tabSecColSZ; z++) {
      OCTabularSectionMetadataObject tsmO = tabSecCollection.get(z);
      OCMetadataAttributeCollection tsAttrMetadata = tsmO.getAttributes();
      String tabSecName = tsmO.getName();
View Full Code Here

Examples of com.ipc.oce.metadata.objects.OCDocumentMetadataObject

        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

Examples of com.ipc.oce.metadata.objects.OCDocumentMetadataObject

    super(aDispatch);
  }

  @Override
  public OCDocumentMetadataObject get(int i) throws JIException {
    return new OCDocumentMetadataObject(super.get(i));
  }
View Full Code Here

Examples of com.ipc.oce.metadata.objects.OCDocumentMetadataObject

 
  @Override
  public OCDocumentMetadataObject find(String objectName) throws JIException {
    OCObject object = super.find(objectName);
    if (object != null) {
      return new OCDocumentMetadataObject(object);
    } else {
      return null;
    }
  }
View Full Code Here

Examples of com.ipc.oce.metadata.objects.OCDocumentMetadataObject

    EnumVARIANT<OCDocumentMetadataObject> enumV = new EnumVARIANT<OCDocumentMetadataObject>(this) {
     
      @Override
      protected OCDocumentMetadataObject castToGeneric(JIVariant variant) {
        try {
          OCDocumentMetadataObject meta = new OCDocumentMetadataObject(variant);
          return meta;
        } catch (JIException e) {
          throw new RuntimeException(e);
        }
      }
View Full Code Here

Examples of com.ipc.oce.metadata.objects.OCDocumentMetadataObject

  }
 
  @Test
  public void getMetadataViaManager() throws JIException {
    OCDocumentManager manager = app.getDocumentManager("СчетНаОплатуПокупателю");
    OCDocumentMetadataObject meta = manager.getMetadata();
    System.out.println("getFullName: " + meta.getFullName());
    System.out.println("getComment: " + meta.getComment());
    System.out.println("getNumberLength: " + meta.getNumberLength());
    System.out.println("getPresentation: " + meta.getPresentation());
    System.out.println("checkUnique: " + meta.checkUnique());
    System.out.println("getSynonym : " + meta.getSynonym());
    System.out.println("getAttributes: " + meta.getAttributes());
    System.out.println("getBasedOn: " + meta.getBasedOn());
    System.out.println("getDataLockControlMode: " + meta.getDataLockControlMode());
    System.out.println("getNumberType: " + meta.getNumberType());
    System.out.println("getNumberPeriodicity: " + meta.getNumberPeriodicity());
    System.out.println("getNumerator: " + meta.getNumerator());
    System.out.println("getParent: " + meta.getParent());
    System.out.println("getPosting: " + meta.getPosting());
    System.out.println("getRealTimePosting: " + meta.getRealTimePosting());
    System.out.println("getTabularSections: " + meta.getTabularSections());
    System.out.println("isAutoNumbering: " + meta.isAutoNumbering());
    System.out.println(meta.toString());
  }
View Full Code Here

Examples of com.ipc.oce.metadata.objects.OCDocumentMetadataObject

        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();
View Full Code Here

Examples of com.ipc.oce.metadata.objects.OCDocumentMetadataObject

    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
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.