Package com.commander4j.db

Examples of com.commander4j.db.JDBQMActivity


    lblStatusBar.setText("");
  }
 
  private void populateActivityList(String inspectionid) {
    DefaultComboBoxModel defComboBoxMod = new DefaultComboBoxModel();
    defComboBoxMod.addElement(new JDBQMActivity(Common.selectedHostID, Common.sessionID));
    LinkedList<JDBQMActivity> tempActivityList = activity.getActivities(inspectionid);
   
    for (int j = 0; j < tempActivityList.size(); j++)
    {
      defComboBoxMod.addElement(tempActivityList.get(j));
View Full Code Here


    activityList = activity.getActivities(inspectionid);
   
    int sel = -1;
    for (int j = 0; j < activityList.size(); j++)
    {
      JDBQMActivity t = (JDBQMActivity) activityList.get(j);
      DefComboBoxMod.addElement(t);
      if (t.getActivityID().equals(activityid))
      {
        sel = j;
      }
    }
    if (sel==-1) sel=0;
View Full Code Here

    activityList = activity.getActivities(inspectionid);
   
    int sel = -1;
    for (int j = 0; j < activityList.size(); j++)
    {
      JDBQMActivity t = (JDBQMActivity) activityList.get(j);
      DefComboBoxMod.addElement(t);
      if (t.getActivityID().equals(activityid))
      {
        sel = j;
      }
    }
    if (sel==-1) sel=0;
View Full Code Here

  public Boolean processMessage(GenericMessageHeader gmh) {
    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.
View Full Code Here

    lblStatusBar.setText("");
  }
 
  private void populateActivityList(String inspectionid) {
    DefaultComboBoxModel<JDBQMActivity> defComboBoxMod = new DefaultComboBoxModel<JDBQMActivity>();
    defComboBoxMod.addElement(new JDBQMActivity(Common.selectedHostID, Common.sessionID));
    LinkedList<JDBQMActivity> tempActivityList = activity.getActivities(inspectionid);
   
    for (int j = 0; j < tempActivityList.size(); j++)
    {
      defComboBoxMod.addElement(tempActivityList.get(j));
View Full Code Here

TOP

Related Classes of com.commander4j.db.JDBQMActivity

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.