Beispiel #1
0
  public void setUserInfo(String responseXML) throws Exception {
    // log.info("PM response message: /n"+responseXML);
    UserInfoBean.pmResponse(responseXML);

    JAXBUtil jaxbUtil =
        new JAXBUtil(
            new String[] {
              "edu.harvard.i2b2.pm.datavo.pm", //$NON-NLS-1$
              "edu.harvard.i2b2.pm.datavo.i2b2message" //$NON-NLS-1$
            });
    JAXBElement jaxbElement = jaxbUtil.unMashallFromString(responseXML);
    ResponseMessageType responseMessageType = (ResponseMessageType) jaxbElement.getValue();

    String procStatus =
        responseMessageType.getResponseHeader().getResultStatus().getStatus().getType();
    String procMessage =
        responseMessageType.getResponseHeader().getResultStatus().getStatus().getValue();

    // String serverVersion = responseMessageType.getMessageHeader()
    // .getSendingApplication().getApplicationVersion();
    // System.setProperty("serverVersion", serverVersion);

    if (procStatus.equals("ERROR")) { // $NON-NLS-1$
      setMsg(procMessage);
    } else if (procStatus.equals("WARNING")) { // $NON-NLS-1$
      setMsg(procMessage);
    } else {
      BodyType bodyType = responseMessageType.getMessageBody();
      JAXBUnWrapHelper helper = new JAXBUnWrapHelper();
      ConfigureType response =
          (ConfigureType) helper.getObjectByClass(bodyType.getAny(), ConfigureType.class);

      userInfoBean.setEnvironment(response.getEnvironment());
      userInfoBean.setUserName(response.getUser().getUserName());
      userInfoBean.setUserFullName(response.getUser().getFullName());
      // userInfoBean.setUserPassword(response.getUser().getPassword());
      userInfoBean.setUserKey(response.getUser().getKey());
      userInfoBean.setUserDomain(response.getUser().getDomain());
      userInfoBean.setHelpURL(response.getHelpURL());

      // Save Global variables in properties
      if (response.getGlobalData() != null) {
        for (ParamType param : response.getGlobalData().getParam())
          userInfoBean.setGlobals(param.getName(), param.getValue());
      }
      // Save projects
      if (response.getUser().getProject() != null)
        // userInfoBean.setProjects( response.getUser().getProject());

        // Save Cell
        if (response.getCellDatas() != null) {}
      // userInfoBean.setCellDatas(response.getCellDatas());
    }
  }
Beispiel #2
0
 public FoldersType doReadFolders() {
   FoldersType folders = null;
   try {
     BodyType bodyType = respMessageType.getMessageBody();
     JAXBUnWrapHelper helper = new JAXBUnWrapHelper();
     if (bodyType != null)
       folders = (FoldersType) helper.getObjectByClass(bodyType.getAny(), FoldersType.class);
   } catch (JAXBUtilException e) {
     log.error(e.getMessage());
     ;
   }
   return folders;
 }
Beispiel #3
0
  public StatusType processResult(String response) {
    StatusType status = null;
    try {
      JAXBElement jaxbElement = PatientSetJAXBUtil.getJAXBUtil().unMashallFromString(response);
      respMessageType = (ResponseMessageType) jaxbElement.getValue();

      // Get response message status
      ResponseHeaderType responseHeader = respMessageType.getResponseHeader();
      status = responseHeader.getResultStatus().getStatus();
      String procStatus = status.getType();
      String procMessage = status.getValue();

      if (procStatus.equals("ERROR")) {
        log.error("Error reported by Workplace web Service " + procMessage);
      } else if (procStatus.equals("WARNING")) {
        log.error("Warning reported by Workplace web Service" + procMessage);
      }

    } catch (JAXBUtilException e) {
      log.error(e.getMessage());
    }
    return status;
  }
Beispiel #4
0
  @SuppressWarnings("unchecked")
  public void redrawPanelFromXml(String xmlstr) {
    try {
      JAXBUtil jaxbUtil = PreviousQueryJAXBUtil.getJAXBUtil();
      JAXBElement jaxbElement = jaxbUtil.unMashallFromString(xmlstr);
      ResponseMessageType messageType = (ResponseMessageType) jaxbElement.getValue();
      BodyType bt = messageType.getMessageBody();
      MasterResponseType masterResponseType =
          (MasterResponseType)
              new JAXBUnWrapHelper().getObjectByClass(bt.getAny(), MasterResponseType.class);
      RequestXmlType requestXmlType = masterResponseType.getQueryMaster().get(0).getRequestXml();
      String strRequest = (String) requestXmlType.getContent().get(0);

      jaxbElement = jaxbUtil.unMashallFromString(strRequest);
      RequestMessageType requestMessageType = (RequestMessageType) jaxbElement.getValue();
      bt = requestMessageType.getMessageBody();
      QueryDefinitionRequestType queryDefinitionRequestType =
          (QueryDefinitionRequestType)
              new JAXBUnWrapHelper()
                  .getObjectByClass(bt.getAny(), QueryDefinitionRequestType.class);
      QueryDefinitionType queryDefinitionType = queryDefinitionRequestType.getQueryDefinition();

      int numOfPanels = queryDefinitionType.getPanel().size();
      if (numOfPanels > 3) {
        for (int i = 0; i < (numOfPanels - 3); i++) {
          topPanel.addPanel();
        }
      }

      for (int i = 0; i < numOfPanels; i++) {
        PanelType panelType = queryDefinitionType.getPanel().get(i);
        final ConceptTreePanel panel = getTreePanel(i);
        ConceptTreeData panelData = new ConceptTreeData();
        panelData.setOccurrenceTimes(panelType.getTotalItemOccurrences().getValue());
        if (panelType.getInvert() == 0) {
          panelData.exclude(false);
        } else if (panelType.getInvert() == 1) {
          panelData.exclude(true);
        }

        for (int j = 0; j < panelType.getItem().size(); j++) {
          ItemType itemType = panelType.getItem().get(j);
          QueryConceptTreeNodeData nodedata = new QueryConceptTreeNodeData();

          nodedata.name(itemType.getItemName());
          nodedata.visualAttribute("FA");
          nodedata.tooltip(itemType.getTooltip());
          nodedata.fullname(itemType.getItemKey());
          // mm removed
          // nodedata.lookuptable(itemType.getItemTable());
          nodedata.hlevel(new Integer(itemType.getHlevel()).toString());
          nodedata.lookupdb("metadata");
          // nodedata.selectservice(System.getProperty("selectservice")
          // );
          // get the xml content from select service then set it as
          // node data
          nodedata.setXmlContent();

          panelData.getItems().add(nodedata);
        }

        final ConceptTreeData fpanelData = panelData;
        final String name = queryDefinitionType.getQueryName();
        java.awt.EventQueue.invokeLater(
            new Runnable() {
              public void run() {
                topPanel.setQueryName(name);
                panel.redraw(fpanelData);
              }
            });
      }
    } catch (Exception e) {
      e.printStackTrace();
    }
  }