Reads and store cms tree in database.
More...
Public Member Functions |
| __construct ($server_id, $mid) |
| Constructor.
|
| read () |
| Read trees from ecs.
|
Protected Member Functions |
| storeTree ($tree_id, $a_nodes) |
Detailed Description
Reads and store cms tree in database.
- Author
- Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e $Id$
Definition at line 10 of file class.ilECSTreeReader.php.
Constructor & Destructor Documentation
ilECSTreeReader::__construct |
( |
|
$server_id, |
|
|
|
$mid |
|
) |
| |
Member Function Documentation
ilECSTreeReader::read |
( |
| ) |
|
Read trees from ecs.
- Exceptions
-
Definition at line 33 of file class.ilECSTreeReader.php.
References $GLOBALS, $result, ilECSSetting\getInstanceByServerId(), storeTree(), and ilECSCmsData\treeExists().
{
$GLOBALS[
'ilLog']->write(__METHOD__.
': Begin read');
try
{
include_once './Services/WebServices/ECS/classes/Tree/class.ilECSDirectoryTreeConnector.php';
);
$trees = $dir_reader->getDirectoryTrees();
$GLOBALS[
'ilLog']->write(__METHOD__.
' '.print_r($trees,
true));
{
foreach((array) $trees->getLinkIds() as $tree_id)
{
include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
{
$result = $dir_reader->getDirectoryTree($tree_id);
}
}
}
}
{
throw $e;
}
}
ilECSTreeReader::storeTree |
( |
|
$tree_id, |
|
|
|
$a_nodes |
|
) |
| |
|
protected |
Definition at line 65 of file class.ilECSTreeReader.php.
References $data, and ilECSCmsData\lookupObjId().
Referenced by read().
{
include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
$cms_tree = $a_nodes;
$data->setServerId($this->server_id);
$data->setMid($this->mid);
$data->setCmsId($cms_tree->rootID);
$data->setTreeId($tree_id);
$data->setTitle($node->directoryTitle);
$data->setTerm($node->term);
$tree->insertRootNode($tree_id,
$data->getObjId());
$tree->setRootId(
$data->getObjId());
foreach((array) $cms_tree->nodes as $node)
{
$data->setServerId($this->server_id);
$data->setMid($this->mid);
$data->setCmsId($node->id);
$data->setTreeId($tree_id);
$data->setTitle($node->title);
$data->setTerm($node->term);
if($node->parent->id)
{
$this->server_id,
$this->mid,
$tree_id,
(int) $node->parent->id
);
$tree->insertNode(
$data->getObjId(), $parent_id);
}
}
}
Field Documentation
ilECSTreeReader::$server_id |
|
private |
The documentation for this class was generated from the following file: