ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjSCORMValidator Class Reference

Validation of SCORM-XML Files. More...

+ Collaboration diagram for ilObjSCORMValidator:

Public Member Functions

 validateXML ($file)
 searchDir ($dir)
 ilObjSCORMValidator ($directory)
 validate ()
 getSummary ()

Data Fields

 $dir
 $flag
 $summary

Detailed Description

Validation of SCORM-XML Files.

Author
Romeo Kienzler conta.nosp@m.ct@k.nosp@m.ienzl.nosp@m.er.b.nosp@m.iz 21 LearnLine AG info@.nosp@m.21ll.nosp@m..com

Definition at line 33 of file class.ilObjSCORMValidator.php.

Member Function Documentation

ilObjSCORMValidator::getSummary ( )

Definition at line 89 of file class.ilObjSCORMValidator.php.

References $summary.

{
$summary = "";
foreach ($this->summary as $line)
{
$summary .= $line."<br>";
}
return $summary;
}
ilObjSCORMValidator::ilObjSCORMValidator (   $directory)

Definition at line 71 of file class.ilObjSCORMValidator.php.

{
$this->dir = $directory.'/';
}
ilObjSCORMValidator::searchDir (   $dir)

Definition at line 51 of file class.ilObjSCORMValidator.php.

References $dir, $file, and validateXML().

Referenced by validate().

{
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
if (!eregi("^[\.]{1,2}",$file)) {
//2DO FIXME regex machen dass nur . und .. erkannt werden und nicht .lala. oder so
if (is_dir($dir.$file)) {
// This is commented because subdirecories of my scromexamples contain xml files which aren't valid!
//$this->searchDir($dir.$file."/");
}
if (eregi("(\.xml)$",$file)) {
$this->validateXML($dir.$file);
}
}
}
}
closedir($dh);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjSCORMValidator::validate ( )

Definition at line 75 of file class.ilObjSCORMValidator.php.

References searchDir().

{
$this->summary = array();
$this->searchDir($this->dir);
if(count($this->summary) == 0)
{
return true;
}
else
{
return false;
}
}

+ Here is the call graph for this function:

ilObjSCORMValidator::validateXML (   $file)

Definition at line 36 of file class.ilObjSCORMValidator.php.

References $file, ilUtil\escapeShellArg(), ilUtil\getJavaPath(), and ILIAS_ABSOLUTE_PATH.

Referenced by searchDir().

{
exec(ilUtil::getJavaPath()." -jar ".ilUtil::escapeShellArg(ILIAS_ABSOLUTE_PATH."/Modules/ScormAicc/validation/vali.jar")." ".ilUtil::escapeShellArg($file)." 2>&1", $error);
if (count($error) != 0)
{
$this->summary[] = "";
$this->summary[] = "<b>File: $file</b>";
foreach($error as $line)
{
$this->summary[] = $line;
//echo "<br><b>".$line."</b>";
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilObjSCORMValidator::$dir

Definition at line 34 of file class.ilObjSCORMValidator.php.

Referenced by searchDir().

ilObjSCORMValidator::$flag

Definition at line 34 of file class.ilObjSCORMValidator.php.

ilObjSCORMValidator::$summary

Definition at line 34 of file class.ilObjSCORMValidator.php.

Referenced by getSummary().


The documentation for this class was generated from the following file: