Examples of OCCatalogSelection


Examples of com.ipc.oce.objects.OCCatalogSelection

  public static void main(String[] args) throws IOException, ConfigurationException, JIException {
    OCApp app = getConnection();
    OCCatalogManager manager = app.getCatalogManager("Банки");
    OCCatalogRef ref = manager.findByDescription("Г МОСКВА");
    OCCatalogSelection selection = manager.selectHierarchically(ref);
    while (selection.next()) {
      int level = selection.getLevelInSelection();
      if (level==0) {
        System.out.println(selection.getCode()+" "+selection.getDescription());
      }
    }
  }
View Full Code Here

Examples of com.ipc.oce.objects.OCCatalogSelection

public class CatalogParent extends BasicTest {

  @Test
  public void getCatalogSuperParent() throws JIException {
    OCCatalogManager manager = app.getCatalogManager("Валюты");
    OCCatalogSelection selection = manager.select();
    selection.next();
    OCCatalogRef ref = selection.getRef();
   
    assertTrue(!ref.isEmpty());
   
    OCCatalogRef parRef = ref.getParent();
    assertTrue(parRef.isEmpty());
View Full Code Here

Examples of com.ipc.oce.objects.OCCatalogSelection

  }

  @Test(expected = IllegalStateException.class)
  public void ocobject2int() throws JIException {
    OCCatalogManager manager = app.getCatalogManager("Валюты");
    OCCatalogSelection selection = manager.select();
    selection.next();
    OCCatalogRef ref = selection.getRef();
    OCVariant var = new OCVariant(ref);

    Integer ocObj = var.value(Integer.class);
  }
View Full Code Here

Examples of com.ipc.oce.objects.OCCatalogSelection

  }

  @Test
  public void ocobject2ocrefAndViceversa() throws JIException {
    OCCatalogManager manager = app.getCatalogManager("Валюты");
    OCCatalogSelection selection = manager.select();
    selection.next();
    OCCatalogRef ref = selection.getRef();
    OCVariant var = new OCVariant(ref);
    OCCatalogObject ocObj = var.value(OCCatalogObject.class);
    assertTrue(ocObj instanceof OCCatalogObject);
View Full Code Here

Examples of com.ipc.oce.objects.OCCatalogSelection

    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
    query.setParameter("НачалоПериода", new OCVariant(sdf.parse("2009-01-01")));
    query.setParameter("КонецПериода", new OCVariant(sdf.parse("2010-01-01")));
   
    OCCatalogManager catMan = app.getCatalogManager("Организации");
    OCCatalogSelection catSel = catMan.select();
    catSel.next();
    OCCatalogRef orgRef = catSel.getRef();
   
    query.setParameter("Организация", new OCVariant(orgRef));
   
    OCQueryResult result = query.execute();
    OCValueTable table = result.unload();
View Full Code Here

Examples of com.ipc.oce.objects.OCCatalogSelection

      manager = app.getCatalogManager(catalogName);
    } catch (JIException e) {
      // TODO тут нужно как-то обрабатывать
      throw e;
    }
    OCCatalogSelection selection = manager.select();
    StringBuffer sb = new StringBuffer(4096);
    OCXDTOSerializer serializer = app.getXDTOSerializer();
    while(selection.next()) {
      OCCatalogObject object = selection.getObject();
      sb.append(serializer.writeXML(object));
    }
    surroundContainersTag(sb);
    return sb.toString();
  }
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.