Package com.commander4j.db

Examples of com.commander4j.db.JDBQMTest


    testList = test.getTests(inspectionid,activityid);
   
    int sel = -1;
    for (int j = 0; j < testList.size(); j++)
    {
      JDBQMTest t = (JDBQMTest) testList.get(j);
      DefComboBoxMod.addElement(t);
      if (t.getTestID().equals(testid))
      {
        sel = j;
      }
    }
    if (sel==-1) sel=0;
View Full Code Here


    testList = test.getTests(inspectionid,activityid);
   
    int sel = -1;
    for (int j = 0; j < testList.size(); j++)
    {
      JDBQMTest t = (JDBQMTest) testList.get(j);
      DefComboBoxMod.addElement(t);
      if (t.getTestID().equals(testid))
      {
        sel = j;
      }
    }
    if (sel==-1) sel=0;
View Full Code Here

    int created = 0;
    int errors = 0;

    JDBQMResult res = new JDBQMResult(getHostID(), getSessionID());
    JDBQMSample samp = new JDBQMSample(getHostID(), getSessionID());
    JDBQMTest test = new JDBQMTest(getHostID(), getSessionID());

    String sampleIDs = "1";
    Long sampleID = 1L;
    int sampleOccur = 1;

    String inspectionID;
    String activityID;

    while (sampleIDs.length() > 0)
    {
      sampleIDs = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/sample[" + String.valueOf(sampleOccur) + "]/id").trim());

      try
      {
        sampleID = Long.valueOf(sampleIDs);
      } catch (Exception ex)
      {
        sampleID = 0L;
      }

      if (sampleID > 0)
      {

        if (samp.isValidSample(sampleID))
        {
          samp.getProperties();
          inspectionID = samp.getInspectionID();
          activityID = samp.getActivityID();

          String testId = "1";
          int testOccur = 1;

          while (testId.length() > 0)
          {
            testId = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/sample[" + String.valueOf(sampleOccur) + "]/test[" + String.valueOf(testOccur) + "]/id").trim());

            if (testId.length() > 0)
            {

              if (test.isValid(inspectionID, activityID, testId))
              {

                String resultData = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/sample[" + String.valueOf(sampleOccur) + "]/test[" + String.valueOf(testOccur) + "]/data").trim());
                if (res.isValidResult(sampleID, testId) == true)
                {
View Full Code Here

    super();
    setHost(hostid);
    setSession(sessionid);

    tableMode = mode;
    test = new JDBQMTest(getHost(), getSession());
    new JDBQMDictionary(getHost(), getSession());
    selectlist = new JDBQMSelectList(getHost(), getSession());

    testPropertiesList = test.getTestsPropertiesList(inspectionid, activityid);
View Full Code Here

    super();
    setHost(hostid);
    setSession(sessionid);
    JDBQMDictionary tempDict;
    sample = new JDBQMSample(hostid, sessionid);
    test = new JDBQMTest(hostid, sessionid);

    res = new JDBQMResult(hostid, sessionid);
    select = new JDBQMSelectList(hostid, sessionid);
    testPropertiesList = test.getTestsPropertiesList(inspectionid, activityid);
View Full Code Here

    Boolean result = false;

    JDBQMInspection qmInspection = new JDBQMInspection(getHostID(), getSessionID());
    JDBQMExtension qmExtension = new JDBQMExtension(getHostID(), getSessionID());
    JDBQMActivity qmActivity = new JDBQMActivity(getHostID(), getSessionID());
    JDBQMTest qmTest = new JDBQMTest(getHostID(), getSessionID());
    JDBQMDictionary qmDictionary = new JDBQMDictionary(getHostID(), getSessionID());
    JDBInterface inter = new JDBInterface(getHostID(), getSessionID());
    JDBProcessOrder po = new JDBProcessOrder(getHostID(),getSessionID());

    inter.getInterfaceProperties("QM Inspection Request", "Input");

    // INSPECTION //
    // Decode the Inspection Top Level ID //
   
    inspectionID = gmh.getXMLDocument().findXPath("//message/messageData/inspectionDefinition/ID").trim();
    inspectionDescription = gmh.getXMLDocument().findXPath("//message/messageData/inspectionDefinition/description").trim();
    processOrder = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/inspectionDefinition/processOrder").trim());
   
   
    if (processOrder.equals("")==false)
    {
      processOrder = processOrder.replaceAll("^0+", "");
        po.setProcessOrder(processOrder);
        if (po.isValidProcessOrder())
        {
          po.getProcessOrderProperties();
          po.setInspectionID(inspectionID);
          po.update();
        }
    }

    qmInspection.setInspectionID(inspectionID);

    // Create or update the Inspection record.
    if (qmInspection.isValid()==false)
    {
      // New inspection record to be created.
      qmInspection.create(inspectionID, inspectionDescription);
    }
    else
    {
      // Amend existing inspection record.
      qmInspection.getProperties();
      qmInspection.setDescription(inspectionDescription);
      qmInspection.update();
    }

    Long inspectionExtensionID = (long) 0;
    inspectionExtensionID=qmInspection.getExtensionID();
   
    // INSPECTION - extended data //
    // Scan through XML to process any 'extension' data which needs be stored against the top level Inspection record.
    String extensionName = " ";
    String extensionValue = "";
    int extensionOccurence = 1;
    while (extensionName.length() > 0)

    {
      extensionName = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/inspectionDefinition/extendedData/item[" + String.valueOf(extensionOccurence) + "]/name").trim());

      if (extensionName.length() > 0)
      {
        extensionValue = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/inspectionDefinition/extendedData/item[" + String.valueOf(extensionOccurence) + "]/value").trim());

        qmExtension.setExtensionID(inspectionExtensionID);
        qmExtension.setFieldName(extensionName);
        qmExtension.setTableName("APP_QM_INSPECTION");
        if (qmExtension.isValid())
        {
          qmExtension.getProperties();
          qmExtension.setValue(extensionValue);
          qmExtension.update();
        }
        else
        {
          qmExtension.create(inspectionExtensionID,"APP_QM_INSPECTION", extensionName, extensionValue);
        }
 
      }
      extensionOccurence++;
    }
   
    // ACTIVITY //
    // Scan through XML to process any 'activity' records which needs be stored against the top level Inspection record.   
    String activityID = " ";
    String activityDescription = "";

    Long activityExtensionID = (long) 0;
    int ActivityOccurence = 1;
    while (activityID.length() > 0)
    {
      activityID = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/inspectionDefinition/activity[" + String.valueOf(ActivityOccurence) + "]/ID").trim());
     
      if (activityID.length() > 0)
      { 
        activityDescription = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/inspectionDefinition/activity[" + String.valueOf(ActivityOccurence) + "]/description").trim());

        qmActivity.setInspectionID(inspectionID);
        qmActivity.setActivityID(activityID);

       
        if(qmActivity.isValid()==false)
        {
          // Create new Activity Record.
          qmActivity.create(inspectionID, activityID, activityDescription);
        }
        else
        {
          // Update Activity Record.
          qmActivity.getProperties();
          qmActivity.setDescription(activityDescription);
          qmActivity.update();
        }
        activityExtensionID = qmActivity.getExtensionID();

      }
       
      // ACTIVITY - extended data //
      // Scan through XML to process any 'extension' data which needs be stored against the activity record.
      extensionName = " ";
      extensionValue = "";
      extensionOccurence = 1;
      while (extensionName.length() > 0)

      {

        extensionName = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/inspectionDefinition/activity[" + String.valueOf(ActivityOccurence) + "]/extendedData/item[" + String.valueOf(extensionOccurence) + "]/name").trim());

        if (extensionName.length() > 0)
        {
          extensionValue = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/inspectionDefinition/activity[" + String.valueOf(ActivityOccurence) + "]/extendedData/item[" + String.valueOf(extensionOccurence) + "]/value").trim());

          qmExtension.setExtensionID(activityExtensionID);
          qmExtension.setFieldName(extensionName);
          qmExtension.setTableName("APP_QM_ACTIVITY");
          if (qmExtension.isValid())
          {
            qmExtension.getProperties();
            qmExtension.setValue(extensionValue);
            qmExtension.update();
          }
          else
          {
            qmExtension.create(activityExtensionID,"APP_QM_ACTIVITY", extensionName, extensionValue);
          }
         
        }
        extensionOccurence++;
      }
     
      //////////////   TESTS     
     
      // TEST //
      // Scan through XML to process any 'test' records which needs be stored against the  Activity record.   
      Long testSequence = (long) 0;
      String testID = " ";
      String testDescription = "";
      @SuppressWarnings("unused")
      String testFrequency = "";
      @SuppressWarnings("unused")
      String singleResultIndicator = "";
      String testDataType = "";
      String testSelectListID = "";
      String testRequired = "";
      String testVisible = "";
      String testUOM = "";
     
      int testOccurence = 1;
      while (testID.length() > 0)
      {
        testID = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/inspectionDefinition/activity[" + String.valueOf(ActivityOccurence) + "]/test[" + String.valueOf(testOccurence) + "]/ID").trim());

       
        if (testID.length() > 0)
        { 
          testSequence = Long.parseLong(JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/inspectionDefinition/activity[" + String.valueOf(ActivityOccurence) + "]/test[" + String.valueOf(testOccurence) + "]/sequence").trim()));
          testDescription = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/inspectionDefinition/activity[" + String.valueOf(ActivityOccurence) + "]/test[" + String.valueOf(testOccurence) + "]/description").trim());
          singleResultIndicator = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/inspectionDefinition/activity[" + String.valueOf(ActivityOccurence) + "]/test[" + String.valueOf(testOccurence) + "]/singleResultIndicator").trim());
          testFrequency = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/inspectionDefinition/activity[" + String.valueOf(ActivityOccurence) + "]/test[" + String.valueOf(testOccurence) + "]/frequency").trim());
          testDataType = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/inspectionDefinition/activity[" + String.valueOf(ActivityOccurence) + "]/test[" + String.valueOf(testOccurence) + "]/dataType").trim());
          testSelectListID = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/inspectionDefinition/activity[" + String.valueOf(ActivityOccurence) + "]/test[" + String.valueOf(testOccurence) + "]/selectListID").trim());
          testRequired = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/inspectionDefinition/activity[" + String.valueOf(ActivityOccurence) + "]/test[" + String.valueOf(testOccurence) + "]/required").trim());
          testVisible = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/inspectionDefinition/activity[" + String.valueOf(ActivityOccurence) + "]/test[" + String.valueOf(testOccurence) + "]/visible").trim());
          testUOM = JUtility.replaceNullStringwithBlank(gmh.getXMLDocument().findXPath("//message/messageData/inspectionDefinition/activity[" + String.valueOf(ActivityOccurence) + "]/test[" + String.valueOf(testOccurence) + "]/uom").trim());
         
          // DICTIONARY //

   
          qmDictionary.setTestID(testID);
          if (qmDictionary.isValid()==false)
          {
            qmDictionary.create(testID, JLabel.LEADING, testDataType, testUOM, testRequired, testDescription, testVisible,50);
           
          }
          else
          {
            qmDictionary.getProperties();
            qmDictionary.setDataType(testDataType);
            qmDictionary.setDescription(testDescription);
            qmDictionary.setRequired(testRequired);
            qmDictionary.setSelectListID(testSelectListID);
            qmDictionary.setUOM(testUOM);
            qmDictionary.setVisible(testVisible);
            qmDictionary.update();
          }
         
                   
          //////
                 
          qmTest.setInspectionID(inspectionID);
          qmTest.setActivityID(activityID);
          qmTest.setSequence(testSequence);
          qmTest.setTestID(testID);
         
          if(qmTest.isValidTest()==false)
          {
            // Create new Test Record.
            qmTest.create(inspectionID, activityID, testID,testSequence);

          }
          else
          {
            // Update Test Record.
            qmTest.getProperties();
            qmTest.setSequence(testSequence);
            qmTest.update();
           
          }
         
          // TEST EXTENSION //
          Long testExtensionID = (long) 0;
          testExtensionID = qmTest.getExtensionID();
         
          extensionName = " ";
          extensionValue = "";
          extensionOccurence = 1;
          while (extensionName.length() > 0)
View Full Code Here

    super();
    setHost(hostid);
    setSession(sessionid);

    tableMode = mode;
    test = new JDBQMTest(getHost(), getSession());
    new JDBQMDictionary(getHost(), getSession());
    selectlist = new JDBQMSelectList(getHost(), getSession());

    testPropertiesList = test.getTestsPropertiesList(inspectionid, activityid);
View Full Code Here

TOP

Related Classes of com.commander4j.db.JDBQMTest

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.