Package com.ipc.oce.objects

Examples of com.ipc.oce.objects._OCCommonSelection


      _OCCommonMetadataObject[] metadataObjectsBnd = null;
      if (metadataObjects != null && metadataObjects.length > 0) {
      metadataObjectsBnd = new _OCCommonMetadataObject[metadataObjects.length];
      int index = 0;
      for (String metaFullName : metadataObjects) {
          _OCAbstractManager abstractManager = appInstance.findManager(metaFullName);
          _OCCommonMetadataObject commonMetadataObject = abstractManager.getMetadata();
          metadataObjectsBnd[index++] = commonMetadataObject;
      }
      }
     
      return getEventLog(startDate, endDate, eEventLevels, eventTypes, metadataObjectsBnd);
View Full Code Here


    if (eventType.equals("NULL")) {
      eventType = EventManager.EVENT_ALL;
    }
    try {
      OCApp app = getApplication();
      _OCAbstractManager abstractManager = app.findManager(metaType);
      _OCCommonMetadataObject commonMetadataObject = abstractManager.getMetadata();
     
      EventManager manager = getEventManager();
     
      Date sDate = null;
      if (startDate != null) {
View Full Code Here

            case SELECTION_REF2OBJECT:{
              String res = null;
              Object obj = selection.getValue(colName).value();
          if (obj instanceof _OCCommonRef
              && !((_OCCommonRef) obj).isEmpty()) {
                _OCCommonObject doObj = ((_OCCommonRef) obj).getObject();
               
                String refType = null;
                if (objectMetadata.containsKey(colName)) {
                  refType = objectMetadata.get(colName);
                } else {
View Full Code Here

    ResultSet locRs = executeQuery(selectStat);
    try {
      while (locRs.next()) {
        _OCCommonRef obj = (_OCCommonRef) locRs.getObject(1);
        _OCCommonObject commonObject = obj.getObject();
        boolean objectChanged = false;
        if (commonObject instanceof AttributeBean) {
          AttributeBean aBean = (AttributeBean) commonObject;
          Iterator<String> iter = mappedSet.keySet().iterator();
          while (iter.hasNext()) {
            String key = iter.next();
            Object value = mappedSet.get(key);
            //System.out.println(key + " => " + value);
            aBean.setAttributeValue(key, new OCVariant(value));
           
            if (!objectChanged) {
              objectChanged = true;
            }
          }
         
        }
        if (objectChanged) {
          commonObject.write();
          res++;
        }
      }
    } catch (JIException jie) {
      throw new SQLException(jie);
View Full Code Here

    UnmarshalHelper unmarshalHelper = new UnmarshalHelper(appInstance);
   
    String payload = paramExchange.getIn().getBody(String.class);
    OCObject ocObject = unmarshalHelper.xml2object(payload, true);
   
    _OCCommonObject co = new _OCCommonObject(ocObject);

    co.write();
    LOG.info("Object '" + co.toString() + "' written to db");
    ExchangePattern exchangePattern = paramExchange.getPattern();
   
    if (exchangePattern == ExchangePattern.InOnly) {
      paramExchange.setOut(paramExchange.getIn());
    } else if (exchangePattern == ExchangePattern.InOut) {
      co.read(); // повторно считываем сохраненный объект из базы
      //LOG.info("After read "+co.toString());
      MarshalHelper marshalHelper = new MarshalHelper(appInstance);
      String payload2 = marshalHelper.object2xml(co, "UTF-8");
      Message messageOut = paramExchange.getOut();
      messageOut.setBody(payload2);
View Full Code Here

      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()) {
       
         * The request could not be understood by the server due to
         * malformed syntax. The client SHOULD NOT repeat the request
         * without modifications.
        
        return Response.status(Status.BAD_REQUEST).build();
      }*/
      commonObject.write();
      System.out.println("Object writed " + commonObject);
      return Response.status(Status.OK).build();
    } catch (Exception e) {
      throw new WebApplicationException(e);
    }
View Full Code Here

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

  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();
      }
      commonObject.read(); // exactly same object
      commonObject.delete();
     
      return Response.ok().build();
    } catch (Exception e) {
      throw new WebApplicationException(e);
    }
View Full Code Here

        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();
        bytes = r1.getBytes();
    } catch (JIException e) {
      throw new SQLException(e);
View Full Code Here

            }
            case SELECTION_REF2UUID:{
              String res = null;
              Object obj = selection.getValue(colName).value();
              if (obj instanceof _OCCommonRef) {
                _OCCommonRef ref = (_OCCommonRef) obj;
               
                // detect ref type -----------
                String refType = null;
                if (objectMetadata.containsKey(colName)) {
                  refType = objectMetadata.get(colName);
                } else {
                  refType = ref.getMetadata().getFullName();
                  objectMetadata.put(colName, refType);
                }
               
                res = ref.getUUID().toString();
                rowsBuffer.append("<").append(colName).append(" type=\"").append(refType).append("\">");
                rowsBuffer.append(res);
              } else {
                rowsBuffer.append("<").append(colName).append(">");
                res = (obj != null ? obj.toString() : "");
View Full Code Here

TOP

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

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.