@Override
 @SuppressWarnings(value = "unchecked")
 public RunImportData constructRunImportData() {
   // Instanciate the DOM document
   DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
   docFactory.setIgnoringComments(true);
   docFactory.setIgnoringElementContentWhitespace(true);
   docFactory.setValidating(false);
   DocumentBuilder docBuilder;
   Document xmlDoc = null;
   try {
     docBuilder = docFactory.newDocumentBuilder();
     xmlDoc = docBuilder.parse(new InputSource("./LC480.xml"));
   } catch (Exception ex) {
     Exceptions.printStackTrace(ex);
   }
   // Setup the objects need for the import
   // Setup the Run object
   //            Run run = new RunImpl();
   // Set the run name and date
   Run run = new RunImpl();
   // Retrieve the xml file
   // For development purposes, just use an example xml file
   //        File lcRdmlFile = IOUtilities.openXmlFile("Lightcycler XML Data Import");
   //        if (lcRdmlFile == null) {
   //            return null;
   //        }
   // Setup the profile arraylists
   ArrayList<SampleProfile> sampleProfileList = Lists.newArrayList();
   ArrayList<CalibrationProfile> calbnProfileList = Lists.newArrayList();
   // Determine the strandedness of the majority of the Targets...too bad that this is not provided
   // by the instrument
   TargetStrandedness targetStrandedness = RunImportUtilities.isTheTargetSingleStranded();
   // Get the all of the profile nodes
   NodeList profileNodeList = xmlDoc.getElementsByTagName("series");
   // Cycle through all of the profile nodes
   for (int i = 0; i < profileNodeList.getLength(); i++) {
     // TODO determine whether this profile is sample or calibration
     Profile profile = createProfileType(run);
     Element profileElement = (Element) profileNodeList.item(i);
     String wellLabel = profileElement.getAttribute("title");
     // TODO parse the well label, sample and amplicon name from the wellLabel
     NodeList cycleList = profileElement.getElementsByTagName("point");
     // Collect and set the Fc reading
     profile.setFcReadings(retrieveFcReadings(cycleList));
     if (CalibrationProfile.class.isAssignableFrom(profile.getClass())) {
       CalibrationProfile calProfile = (CalibrationProfile) profile;
       calbnProfileList.add(calProfile);
     } else {
       SampleProfile sampleProfile = (SampleProfile) profile;
       sampleProfileList.add(sampleProfile);
     }
   }
   return null;
 }
Esempio n. 2
0
 public boolean isCurrentUserOfTypeTeacherProfile() {
   return currentUser.getClass() == TeacherProfile.class;
 }
Esempio n. 3
0
 public boolean isCurrentUserOfTypeStudentProfile() {
   return currentUser.getClass() == StudentProfile.class;
 }