/** 
  * function getXML
  *
  * Generates an XML document from the list of applicants.
  *
  * @param $isHeaderIncluded [BOOL] Determines if we include the '<?xml version="1.0"?>' header.
  * @param $rootNodeName [STRING] The XML root node name.
  *
  * @return [STRING] Returns an XML formatted string.
  */
 function getXML($isHeaderIncluded = true, $rootNodeName = LanguageList::XML_NODE_NAME)
 {
     $xmlObject = new XMLObject($rootNodeName);
     $this->resultSet->setFirst();
     while ($item = $this->resultSet->getNext(new RowManager_LanguageManager())) {
         $xmlObject->addXMLObject($item->getXMLObject());
     }
     // end while
     return $xmlObject->getXML($isHeaderIncluded);
 }
 /**
  * function getLabelXML
  * <pre>
  * Prepares all the currently held labels into an XML output.
  * </pre>
  * @return [STRING]
  */
 function getLabelXML()
 {
     $xmlList = new XMLObject(RowManager_MultilingualLabelManager::XML_NODE_NAME);
     $labelKey = RowManager_MultilingualLabelManager::XML_ELEMENT_NAME;
     foreach ($this->labels as $key => $value) {
         $label = $this->getLabel($key, $this->languageID);
         $xmlList->addElement($labelKey, $label, array('key' => $key));
     }
     //echo $xmlList->getXML();
     return $xmlList->getXML();
 }
 /** 
  * function getXML
  *
  * Generates an XML document from the list of applicants.
  *
  * @param $isHeaderIncluded [BOOL] Determines if we include the '<?xml version="1.0"?>' header.
  * @param $rootNodeName [STRING] The XML root node name.
  *
  * @return [STRING] Returns an XML formatted string.
  */
 function getXML($isHeaderIncluded = true, $rootNodeName = LanguageLabelList::XML_NODE_NAME)
 {
     $xmlObject = new XMLObject($rootNodeName);
     $this->resultSet->setFirst();
     while ($item = $this->resultSet->getNext(new RowLabelBridge_LanguageLabelManager(-1, $this->languageID, $this->multiLingualManager))) {
         $xmlObject->addXMLObject($item->getXMLObject());
     }
     // end while
     return $xmlObject->getXML($isHeaderIncluded);
 }
 /**
  * function getLabelXML
  * <pre>
  * Prepares all the currently held labels into an XML output.
  * </pre>
  * @return [STRING]
  */
 function getLabelXML()
 {
     $xmlList = new XMLObject(XMLObject_MultilingualManager::XML_NODE_LABELLIST);
     foreach ($this->labels as $key => $value) {
         $label = $this->getLabel($key, $this->languageID);
         $xmlList->addElement('label', $label, array('key' => $key));
     }
     return $xmlList->getXML();
 }
 /** 
  * function getXML
  *
  * Generates an XML document from the object's Values array.
  *
  * @param $isHeaderIncluded [BOOL] Determines if we include the '<?xml version="1.0"?>' header.
  * @param $rootNodeName [STRING] The XML root node name.
  *
  * @return [STRING] Returns an XML formatted string.
  */
 function getXML($isHeaderIncluded = true, $rootNodeName = '')
 {
     $this->addElement(XMLObject_AdminBox::XML_ELEMENT_EDITID, $this->editID);
     $this->addXmlObject($this->heading);
     $this->addXmlObject($this->data);
     $this->addXmlObject($this->form);
     $this->addXmlObject($this->linksForm);
     $this->addXmlObject($this->linksData);
     $this->addXmlObject($this->hiddenData);
     return parent::getXML($isHeaderIncluded, $rootNodeName);
 }
 /** 
  * function getXML
  *
  * Generates an XML document from the list of applicants.
  *
  * @param $isHeaderIncluded [BOOL] Determines if we include the '<?xml version="1.0"?>' header.
  * @param $rootNodeName [STRING] The XML root node name.
  *
  * @return [STRING] Returns an XML formatted string.
  */
 function getXML($isHeaderIncluded = true, $rootNodeName = '')
 {
     if ($rootNodeName == '') {
         $rootNodeName = $this->xmlNodeName;
     }
     $xmlObject = new XMLObject($rootNodeName);
     // if given datamanager is of type MultiTableManager then
     if (is_a($this->searchManager, 'MultiTableManager')) {
         // echo 'Is a MultiTableManager<br/>';
         $this->resultSet->setFirst();
         while ($this->resultSet->moveNext()) {
             //                   $row = $this->resultSet->getCurrentRow();
             //                  echo 'The row is<pre>'.print_r($row,true).'</pre>';
             $this->searchManager->loadFromArray($this->resultSet->getCurrentRow());
             $skipIndividualManagers = true;
             //                  $xml = $this->searchManager->getXMLObject(true,'',$skipIndividualManagers);
             //                  echo 'The XML is <pre>'.print_r($xml,true).'</pre>';
             $xmlObject->addXMLObject($this->searchManager->getXMLObject(true, '', $skipIndividualManagers));
         }
     } else {
         // echo 'Is not a MultiTableManager<br/>';
         // else
         $this->resultSet->setFirst();
         while ($item = $this->resultSet->getNext(new $this->searchClassName())) {
             $xmlObject->addXMLObject($item->getXMLObject());
         }
         // end while
     }
     // end if (is_a() )
     return $xmlObject->getXML($isHeaderIncluded);
 }
 /**
  * function getHTML
  * <pre>
  * This method returns the HTML data generated by this object.
  * </pre>
  * @return [STRING] HTML Display data.
  */
 function getHTML()
 {
     // Uncomment the following line if you want to create a template
     // tailored for this page:
     $path = $this->pathModuleRoot . 'templates/';
     // Otherwise use the standard Templates for the site:
     //$path = SITE_PATH_TEMPLATES;
     /*
      * Update any label tags ...
      */
     // example:
     // $name = $user->getName();
     // $this->labels->setLabelTag( '[Title]', '[userName]', $name);
     // do the join
     // campuses
     $campusManager = new RowManager_CampusManager();
     $campusManager->setSortOrder('campus_desc');
     $multiTableManager = new MultiTableManager();
     $multiTableManager->addRowManager($campusManager);
     // prcs
     $prcManager = new RowManager_PRCManager();
     $multiTableManager->addRowManager($prcManager, new JoinPair($campusManager->getJoinOnCampusID(), $prcManager->getJoinOnCampusID()));
     // semester
     $semesterManager = new RowManager_SemesterManager();
     // TODO update the semester
     $semesterManager->setSemesterID(1);
     $multiTableManager->addRowManager($semesterManager, new JoinPair($prcManager->getJoinOnSemesterID(), $prcManager->getJoinOnSemesterID()));
     // prc method
     $prcMethodManager = new RowManager_PrcMethodManager();
     $multiTableManager->addRowManager($prcMethodManager, new JoinPair($prcManager->getJoinOnPrcMethodID(), $prcMethodManager->getJoinOnPrcMethodID()));
     // get ready to make the xml
     $xmlObject = new XMLObject();
     // HEADER
     //$reportInfoXMLObject = new XMLObject('PRC_REPORT');
     //$xmlObject->addXMLObject( $reportInfoXMLObject );
     // END HEADER
     // BODY
     $bodyXMLObject = new XMLObject('PRC_FOR_SEMESTER');
     // construct the iterator
     $list = new ListIterator($multiTableManager);
     $list->setFirst();
     while ($list->moveNext()) {
         $itemXMLObject = $list->getCurrentRowXMLObject(false, 'IndividualPRC');
         // Finally add this row into the bigger picture
         $bodyXMLObject->addXMLObject($itemXMLObject);
     }
     // multiTableManager->moveNext()
     $xmlObject->addXMLObject($bodyXMLObject);
     $xmlDoc = new DOMDocument();
     $xmlDoc->loadXML($xmlObject->getXML(false, 'PRCReport'));
     $numBytesWritten = $xmlDoc->save($this->pathModuleRoot . 'prcReport.xml');
     // echo 'Written '.$numBytesWritten.' bytes';
     // save the xml data onto the server
     // return $xmlDoc->saveXML();
     // ------- PART 2 --------
     // WEEKLY STATS
     $multiTableManager = new MultiTableManager();
     $weeklyManager = new RowManager_WeeklyReportManager();
     $multiTableManager->addRowManager($weeklyManager);
     $campusManager = new RowManager_CampusManager();
     $campusManager->setSortOrder('campus_desc');
     $multiTableManager->addRowManager($campusManager, new JoinPair($campusManager->getJoinOnCampusID(), $weeklyManager->getJoinOnCampusID()));
     $weekManager = new RowManager_WeekManager();
     $multiTableManager->addRowManager($weekManager, new JoinPair($weekManager->getJoinOnWeekID(), $weeklyManager->getJoinOnWeekID()));
     $staffManager = new RowManager_StaffManager();
     $multiTableManager->addRowManager($staffManager, new JoinPair($weeklyManager->getJoinOnStaffID(), $staffManager->getJoinOnStaffID()));
     $personManager = new RowManager_PersonManager();
     $multiTableManager->addRowManager($personManager, new JoinPair($personManager->getJoinOnPersonID(), $staffManager->getJoinOnPersonID()));
     // get ready to make the xml
     $xmlObject = new XMLObject();
     // HEADER
     //$reportInfoXMLObject = new XMLObject('PRC_REPORT');
     //$xmlObject->addXMLObject( $reportInfoXMLObject );
     // END HEADER
     // BODY
     $bodyXMLObject = new XMLObject('WEEKLY_FOR_SEMESTER');
     // construct the iterator
     $list = new ListIterator($multiTableManager);
     $list->setFirst();
     while ($list->moveNext()) {
         $itemXMLObject = $list->getCurrentRowXMLObject(false, 'IndividualWeek');
         // Finally add this row into the bigger picture
         $bodyXMLObject->addXMLObject($itemXMLObject);
     }
     // multiTableManager->moveNext()
     $xmlObject->addXMLObject($bodyXMLObject);
     $xmlDoc = new DOMDocument();
     $xmlDoc->loadXML($xmlObject->getXML(false, 'Report'));
     $numBytesWritten = $xmlDoc->save($this->pathModuleRoot . 'weeklyReport.xml');
     // echo 'Written '.$numBytesWritten.' bytes';
     // save the xml data onto the server
     // return $xmlDoc->saveXML();
     // ------- PART 3 --------
     $multiTableManager = new MultiTableManager();
     $campusStatsManager = new RowManager_MoreStatsManager();
     $multiTableManager->addRowManager($campusStatsManager);
     $campusManager = new RowManager_CampusManager();
     $campusManager->setSortOrder('campus_desc');
     $multiTableManager->addRowManager($campusManager, new JoinPair($campusManager->getJoinOnCampusID(), $campusStatsManager->getJoinOnCampusID()));
     $weekManager = new RowManager_WeekManager();
     $multiTableManager->addRowManager($weekManager, new JoinPair($campusStatsManager->getJoinOnWeekID(), $weekManager->getJoinOnWeekID()));
     $expTypeManager = new RowManager_ExposureTypeManager();
     $multiTableManager->addRowManager($expTypeManager, new JoinPair($campusStatsManager->getJoinOnExpTypeID(), $expTypeManager->getJoinOnExpTypeID()));
     $count = 0;
     // get ready to make the xml
     $xmlObject = new XMLObject();
     // HEADER
     //$reportInfoXMLObject = new XMLObject('PRC_REPORT');
     //$xmlObject->addXMLObject( $reportInfoXMLObject );
     // END HEADER
     // BODY
     $bodyXMLObject = new XMLObject('CAMPUS_REPORT');
     // construct the iterator
     $list = new ListIterator($multiTableManager);
     $list->setFirst();
     while ($list->moveNext()) {
         $itemXMLObject = $list->getCurrentRowXMLObject(false, 'Activity');
         $count++;
         // Finally add this row into the bigger picture
         $bodyXMLObject->addXMLObject($itemXMLObject);
     }
     // multiTableManager->moveNext()
     echo 'the count is [' . $count . ']<br/>';
     $xmlObject->addXMLObject($bodyXMLObject);
     $xmlDoc = new DOMDocument();
     $xmlDoc->loadXML($xmlObject->getXML(false, 'Report'));
     $numBytesWritten = $xmlDoc->save($this->pathModuleRoot . 'campusReport.xml');
     // echo 'Written '.$numBytesWritten.' bytes';
     // save the xml data onto the server
     // return $xmlDoc->saveXML();
     // ---------------
     // OK DONE!
     // NOTE:  this parent method prepares the $this->template with the
     // common Display data.
     $this->prepareTemplate($path);
     // uncomment this line if you are creating a template for this page
     $templateName = 'page_Reports.php';
     // otherwise use the generic site template
     //$templateName = '';
     return $this->template->fetch($templateName);
 }
 /** 
  * function getXML
  * <pre>
  * Generates an XML document from the object's Values array.
  * </pre>
  * @param $isHeaderIncluded [BOOL] Determines if we include the 
  * '<?xml version="1.0"?>' header.
  * @param $rootNodeName [STRING] The XML root node name.
  * @return [STRING] Returns an XML formatted string.
  */
 function getXML($isHeaderIncluded = true, $rootNodeName = '')
 {
     // Prepare This object to generate it's XML output.
     // first store this objects values in a copy.
     $valuesCopy = $this->xmlValues;
     // include css list as an element
     $this->addXmlObject($this->cssList);
     // include script list as an element
     $this->addXmlObject($this->scriptList);
     // include navbar data as an element
     //	   $this->addXmlObject( $this->navBar );
     $cacheData = $this->navBar->getCache();
     $cacheData = str_replace($this->navBar->getPathToRootTag(), $this->pathToRoot, $cacheData);
     $this->addElement(XMLObject_PageContent::NODE_NAVBAR, $cacheData);
     // include body list as an element
     $this->addXmlObject($this->bodyList);
     // include Menu as an element
     $this->addXmlObject($this->pageMenu);
     // set the page's path to Root
     $this->addElement(XMLObject_PageContent::ELEMENT_PATH_ROOT, $this->pathToRoot);
     // set the page's title
     $this->addElement(XMLObject_PageContent::NODE_PAGE_TITLE, $this->pageTitle);
     // set the page's title
     $this->addElement(XMLObject_PageContent::NODE_WINDOW_TITLE, $this->windowTitle);
     // set the page's Header Image
     $this->addElement(XMLObject_PageContent::NODE_HEADER_IMAGE, $this->pageHeaderImage);
     // set the page's pageCallBack value
     $this->addElement(XMLObject_PageContent::NODE_PAGE_CALLBACK, $this->pageCallBack);
     // Now call the parent getXML to return the XML
     $returnValue = parent::getXML($isHeaderIncluded, $rootNodeName);
     // Now restore the values array to their original values.
     $this->xmlValues = $valuesCopy;
     return $returnValue;
 }
 function prepareDisplayData()
 {
     // set the page's Template to the Login Template
     $this->setPageTemplate(PAGE_TEMPLATE_LOGIN);
     // Compile Login Form Data as XML
     $formData = new XMLObject('PageContent');
     $formData->addElement('formAction', $this->getCallBack(moduleLogin::MODE_SUBMIT));
     $formData->addElement('pathToRoot', $this->moduleRootPath);
     $formData->addElement('errorMessage', $this->errorMessages);
     $formData->addElement('form_username', moduleLogin::FORM_USERID);
     $formData->addElement('form_password', moduleLogin::FORM_PASSWORD);
     $formData->addElement('username', $this->userID);
     $formData->addElement('password', $this->passWord);
     $xmlData = $formData->getXML();
     $template = new Template($this->moduleRootPath . 'templates/');
     $template->setXML('pageContent', $xmlData);
     $content = $template->fetch(PAGE_LOGIN_TEMPLATE);
     // Finally store HTML content as this page's content Item
     $this->addElement(XMLObject_PageContent::NODE_CONTENT, $content);
 }