Package com.ipc.oce.objects

Examples of com.ipc.oce.objects.OCDocumentObject


  }
 
  @Test
  public void createAndDelete() throws JIException {
    OCDocumentManager manager = app.getDocumentManager("СчетНаОплатуПокупателю");
    OCDocumentObject doc = manager.createDocument();
    System.out.println("isNew1: " + doc.isNew() + " [before write]");
    doc.setNumber("XXX-000-002");
    doc.setDate(new Date());
    doc.write();
    System.out.println("isNew2: " + doc.isNew() + " [after write]");
    OCUUID uuid = doc.getRef().getUUID();
    System.out.println(doc.getNumberAsString() + " created with " + uuid);
   
    OCDocumentRef ref = manager.getRef(uuid);
   
    String u = ref.getUUID().toString();
    ref.getObject().delete();
View Full Code Here


  @Test
  public void listAttrNames() throws JIException {
    OCDocumentManager manager = app.getDocumentManager("ПриемНаРаботуВОрганизацию");
    OCDocumentSelection selection = manager.select();
    selection.next();
    OCDocumentObject object = selection.getObject();
    System.out.println(object.getMetadata().getAttributesName());
    System.out.println(object.getMetadata().getTabularSectionsName());
  }
View Full Code Here

  }
 
  @Test
  public void showNewObjectsXML() throws JIException {
    OCDocumentManager manager = app.getDocumentManager("ПриемНаРаботуВОрганизацию");
    OCDocumentObject doc = manager.createDocument();
    OCXDTOSerializer serializer = app.getXDTOSerializer();
    OCXMLWriter writer = app.newXMLWriter();
    writer.setString();
    serializer.writeXML(writer, doc);
    System.out.println(writer.close());
View Full Code Here

  @Test
  public void deleteDoc() throws JIException, ParseException {
    OCDocumentManager manager = app.getDocumentManager("СчетНаОплатуПокупателю");
    OCDocumentRef ref = manager.findByNumber("XXX-000-001", (new SimpleDateFormat("yyyy")).parse("2011"));
    System.out.println("FOR DELTE " + ref.getUUID());
    OCDocumentObject docObj = ref.getObject();
    docObj.delete();
    System.out.println("DELETED");
  }
View Full Code Here

*/
public class SchemasDance extends BasicTest {

  @Test
  public void gettingSchema() throws JIException {
    OCDocumentObject documentObject = getRandomDocument("СчетНаОплатуПокупателю");
    OCXMLDataType dt = app.getXMLTypeOf(documentObject);
    System.out.println(dt.getTypeName());
   
    OCXDTOFactory factory = app.getXDTOFactory();
    OCXDTOPackageCollection pacCollection = factory.getPackages();
View Full Code Here

  }
 
  @Test
  public void dance2() throws JIException {
    System.out.println();
    OCDocumentObject document = getRandomDocument("СчетНаОплатуПокупателю");
    OCXMLDataType xmlType = document.getXMLType();
    OCType type = document.getOCType();
    System.out.println(xmlType.getTypeName() + " in {" +xmlType.getNamespaceURI() + "}");
    System.out.println(type);
   
    OCXDTOFactory factory = app.getXDTOFactory();
    String sSchema = "http://v8.1c.ru/8.1/data/enterprise/current-config";
View Full Code Here

  @Test
  public void object2xmlAndViceversa() throws JIException {
    OCDocumentManager manager = app.getDocumentManager("СчетНаОплатуПокупателю");
    OCDocumentSelection sel = manager.select();
    sel.next();
    OCDocumentObject documentObject = sel.getRef().getObject();
    String originalDocNum = documentObject.getNumberAsString();
    boolean originalIsNew = documentObject.isNew();
   
    OCXDTOSerializer serializer = app.getXDTOSerializer();
    OCXMLWriter writer = app.newXMLWriter();
    writer.setString("UTF-8");
   
    serializer.writeXML(writer, documentObject);
    String xml = writer.close();
    System.out.println("XML size: " + xml.length());
   
    OCXMLReader reader = app.newXMLReader();
    reader.setString(xml);
   
    OCDocumentObject reverseObject = new OCDocumentObject(serializer.readXML(reader));
   
    assertTrue(originalIsNew == reverseObject.isNew());
    assertTrue(originalDocNum.equals(reverseObject.getNumberAsString()));
  }
View Full Code Here

    OCDocumentManager manager1 = app
        .getDocumentManager("СчетНаОплатуПокупателю");
    OCDocumentSelection selection1 = manager1.select();
    selection1.next();
    OCDocumentRef ref1 = selection1.getRef();
    OCDocumentObject obj1 = ref1.getObject();
    variant = new OCVariant(obj1);
    o = variant.value();

    assertTrue("Not " + OCDocumentObject.class.getName() + " it is "
        + o.getClass().getName(), o instanceof OCDocumentObject);
View Full Code Here

TOP

Related Classes of com.ipc.oce.objects.OCDocumentObject

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.