Package com.ipc.oce

Examples of com.ipc.oce.OCApp


  @GET
  @Produces("text/xml")
  @Path("doc")
  public Response findDocumentByNumberAndDate(@QueryParam("name")String docName, @QueryParam("num") String number, @QueryParam("date") String sDate, @QueryParam("dateformat") @DefaultValue("dd.MM.yyyy HH:mm:ss") String pattern) throws ParseException, JIException, IOException, ConfigurationException {
    Date date = (new SimpleDateFormat(pattern)).parse(sDate);
    OCApp app = getApplication();
    OCDocumentManager manager = app.getDocumentManager(docName);
    OCDocumentRef ref = manager.findByNumber(number, date);
    if (ref.isEmpty()) {
      return Response.status(Status.NOT_FOUND).build();
    } else {
      OCXDTOSerializer serializer = app.getXDTOSerializer();
     
      return Response.ok(serializer.writeXML(ref.getObject())
          ).build();
    }
  }
View Full Code Here


  }
 
  @POST
  public Response updateDataObject(String body) {
    try {
      OCApp app = getApplication();
      OCXDTOSerializer serializer = app.getXDTOSerializer();
      OCXMLReader reader = app.newXMLReader();
      reader.setString(body);
      OCObject object = serializer.readXML(reader);
      _OCCommonObject commonObject = new _OCCommonObject(object);
      /*if (commonObject.isNew()) {
       
View Full Code Here

  }
 
  @PUT
  public Response createDataObject(String body) {
    try {
      OCApp app = getApplication();
      OCXDTOSerializer serializer = app.getXDTOSerializer();
      OCXMLReader reader = app.newXMLReader();
      reader.setString(body);
      OCObject object = serializer.readXML(reader);
      _OCCommonObject commonObject = new _OCCommonObject(object);
      commonObject.write();
     
      OCXMLWriter writer = app.newXMLWriter();
      writer.setString("UTF-8");
      serializer.writeXML(writer, commonObject);
      String xmlResp = writer.close();
     
      return Response.ok(xmlResp).build();
View Full Code Here

  }
 
  @DELETE
  public Response deleteDataObject(String body) {
    try {
      OCApp app = getApplication();
      OCXDTOSerializer serializer = app.getXDTOSerializer();
      OCObject object = serializer.readXML(body);
      _OCCommonObject commonObject = new _OCCommonObject(object);
      if (commonObject.isNew()) {
        return Response.status(Status.BAD_REQUEST).build();
      }
View Full Code Here

    if (ref == null) {
      return bytes;
    }
   
    try {
        OCApp app = ((OCEConnection) getStatement().getConnection()).getApplication();
       
        OCXDTOSerializer serializer = app.getXDTOSerializer();
       
        OCXMLWriter writer = app.newXMLWriter();
        writer.setString("UTF-8");
       
        _OCCommonObject commonObject = (_OCCommonObject) ref.getObject();
        serializer.writeXML(writer, commonObject);
        String r1 = writer.close();
View Full Code Here

   * Получение xml-типа объекта.
   * @return
   * @throws JIException
   */
  public OCXMLDataType getXMLType() throws JIException {
    OCApp app = OCApp.getInstance(getAssociatedSessionID());
    return app.getXMLTypeOf(this);
  }
View Full Code Here

   * Получение типа объекта
   * @return OCType
   * @throws JIException
   */
  public OCType getOCType() throws JIException {
    OCApp app = OCApp.getInstance(getAssociatedSessionID());
    return app.fromXMLType(getXMLType());
  }
View Full Code Here

   * Пока реализованы только Document и(или) Catalog
   */
  public ResultSet getTables(String catalog, String schemaPattern,
      String tableNamePattern, String[] types) throws SQLException {

    OCApp app = connection.getApplication();
    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();
View Full Code Here

  }

  public ResultSet getColumns(String catalog, String schemaPattern,
      String tableNamePattern, String columnNamePattern)
      throws SQLException {
    OCApp app = connection.getApplication();
    // LOG.info("catalog: "+catalog);
    // LOG.info("schemaPattern: "+schemaPattern);
    // LOG.info("tableNamePattern : "+tableNamePattern);
    // LOG.info("columnNamePattern: "+columnNamePattern);
    LocalResultSet lrs = LocalResultSet.createEmptyResultSet(new String[] {
        "TABLE_CAT",
        "TABLE_SCHEM",
        "TABLE_NAME",
        "COLUMN_NAME",
        "DATA_TYPE", // java.sql.Types
        "TYPE_NAME", "COLUMN_SIZE", "BUFFER_LENGTH", "DECIMAL_DIGITS",
        "NUM_PREC_RADIX",
        "NULLABLE",
        "REMARKS",
        "COLUMN_DEF",
        "SQL_DATA_TYPE", // unused
        "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);
View Full Code Here

      throws SQLException {
    List<String> schemas = new ArrayList<String>();
    if (schema != null) {
      schemas.add(schema);
    } else {
      OCApp app = connection.getApplication();
      OCConfigurationMetadataObject configMetadata = null;
      try {
        configMetadata = app.getMetadata();
        OCObject metaObject = null;

        // findByFullName(SCHEMA_CATALOG+"."+table);
        metaObject = configMetadata.getCatalogs().find(table);
        if (metaObject != null) {
View Full Code Here

TOP

Related Classes of com.ipc.oce.OCApp

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.