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

Class ilSCORM2004PageNode. More...

+ Inheritance diagram for ilSCORM2004PageNode:
+ Collaboration diagram for ilSCORM2004PageNode:

Public Member Functions

 ilSCORM2004PageNode ($a_slm_object, $a_id=0)
 Constructor public.
 __descruct ()
 Destructor.
 read ()
 Read data from database.
 create ($a_upload=false, $a_layout_id=0)
 Create Scorm Page.
 delete ($a_delete_meta_data=true)
 Delete Scorm Page.
 copy ($a_target_slm)
 copy page node
copyToOtherContObject (&$a_cont_obj)
 copy a page to another content object (learning module / dlib book)
 _splitPage ($a_page_id, $a_pg_parent_type, $a_hier_id)
 split page at hierarchical id
 assignPageObject (&$a_page_obj)
 split page to next page at hierarchical id
getPageObject ()
 Get assigned page object.
 setId ($a_id)
 Set id.
 getId ()
 Get id.
 setAlias ($a_is_alias)
 Set wether page object is an alias.
 isAlias ()
 setOriginID ($a_id)
 getOriginID ()
 getMediaObjectIds ()
 static
 getFileItemIds ()
 get ids of all file items within the page
- Public Member Functions inherited from ilSCORM2004Node
 ilSCORM2004Node ($a_slm_object, $a_id=0)
 setTitle ($a_title)
 Set title.
 getTitle ()
 Get title.
 setDescription ($a_description)
 Set description.
 getDescription ()
 Get description.
 setType ($a_type)
 Set type.
 getType ()
 Get type.
 setSLMId ($a_slm_id)
 Set ID of parent Scorm Learning Module Object.
 getSLMId ()
 Get ID of parent Scorm Learning Module Object.
 setSLMObject ($a_slm_obj)
 Set Scorm Learning Module Object.
 getSLMObject ()
 Get scorm learning module object.
 getContentObject ()
 Get Scorm Learning Module Object.
 getImportId ()
 Set Import ID.
 setImportId ($a_id)
 Get Import ID.
 MDUpdateListener ($a_element)
 Meta data update listener.
 createMetaData ()
 create meta data entry
 updateMetaData ()
 update meta data entry
 deleteMetaData ()
 delete meta data entry
 setDataRecord ($a_record)
 this method should only be called by class ilSCORM2004NodeFactory
 create ($a_upload=false)
 Create Node.
 update ()
 Update Node.
 delete ()
 Delete Node.
 _getIdForImportId ($a_import_id)
 Get Node ID for import ID (static)
 _exists ($a_id)
 Checks wether a node exists.
 _deleteAllSLMNodes ($a_slm_object)
 Delete all nodes of Scorm Learning Module.
 _lookupSLMID ($a_id)
 Lookup Scorm Learning Module ID for node id.
 clipboardCut ($a_slm_obj_id, $a_ids)
 Cut and copy a set of chapters/pages into the clipboard.
 insertChapterClip ($a_slm_obj, $a_as_sub=false)
 Insert Chapter from clipboard.
 getObjectives ()
 deleteSeqInfo ()
 parentHasSeqTemplate ()
 exportAsScorm12 ()
 exportAsScorm13 ()

Data Fields

 $id
 $page_object
- Data Fields inherited from ilSCORM2004Node
 $slm_id
 $type
 $id
 $slm_object

Additional Inherited Members

- Static Public Member Functions inherited from ilSCORM2004Node
static _lookupTitle ($a_obj_id)
 Lookup Title.
static _lookupType ($a_obj_id)
 Lookup Type.
static _writeTitle ($a_obj_id, $a_title)
 Write Title.
static _writeImportId ($a_id, $a_import_id)
 Write import ID.
static putInTree ($a_obj, $a_parent_id="", $a_target_node_id="")
 put this object into content object tree
static getTree ($a_slm_obj_id)
 Get scorm module editing tree.
static clipboardCopy ($a_slm_obj_id, $a_ids)
 Copy a set of chapters/pages/scos into the clipboard.
static uniqueTypesCheck ($a_items)
 Check for unique types (all pages or all chapters or all scos)
static insertPageClip ($a_slm_obj)
 Insert pages from clipboard.
static insertScoClip ($a_slm_obj)
 Insert scos from clipboard.
static pasteTree ($a_target_slm, $a_item_id, $a_parent_id, $a_target, $a_insert_time, &$a_copied_nodes, $a_as_copy=false)
 Paste item (tree) from clipboard to current scorm learning module.

Detailed Description

Class ilSCORM2004PageNode.

Handles Pages for SCORM 2004 Editing

Note: This class has a member variable that contains an instance of class ilPageObject (Services/COPage) and provides the method getPageObject() to access this instance. ilPageObject handles page objects and their content. Page objects can be assigned to different container like ILIAS learning modules, glossaries definitions. This class, ilSCORM2004PageNode, provides additional methods for the handling of page objects in the SCORM 2004 Editor.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 50 of file class.ilSCORM2004PageNode.php.

Member Function Documentation

ilSCORM2004PageNode::__descruct ( )

Destructor.

Definition at line 77 of file class.ilSCORM2004PageNode.php.

{
if(is_object($this->page_object))
{
unset($this->page_object);
}
}
ilSCORM2004PageNode::_splitPage (   $a_page_id,
  $a_pg_parent_type,
  $a_hier_id 
)

split page at hierarchical id

the main reason for this method being static is that a lm page object is not available within ilPageContentGUI where this method is called

Definition at line 197 of file class.ilSCORM2004PageNode.php.

{
// @todo: This has to be checked, maybe abandoned or generalized?
/*
// get content object (learning module / digilib book)
$lm_id = ilLMObject::_lookupContObjID($a_page_id);
$type = ilObject::_lookupType($lm_id, false);
switch ($type)
{
case "lm":
include_once ("./Modules/LearningModule/classes/class.ilObjLearningModule.php");
$cont_obj = new ilObjLearningModule($lm_id, false);
break;
case "dbk":
include_once ("./Modules/LearningModule/classes/class.ilObjDlBook.php");
$cont_obj = new ilObjDlBook($lm_id, false);
break;
}
$source_lm_page =& new ilLMPageObject($cont_obj, $a_page_id);
// create new page
$lm_page =& new ilLMPageObject($cont_obj);
$lm_page->setTitle($source_lm_page->getTitle());
$lm_page->setLMId($source_lm_page->getLMId());
$lm_page->setType($source_lm_page->getType());
$lm_page->setDescription($source_lm_page->getDescription());
$lm_page->create(true);
// copy meta data
include_once("Services/MetaData/classes/class.ilMD.php");
$md = new ilMD($source_lm_page->getLMId(), $a_page_id, $source_lm_page->getType());
$new_md =& $md->cloneMD($source_lm_page->getLMId(), $lm_page->getId(), $source_lm_page->getType());
// copy complete content of source page to new page
$source_page =& $source_lm_page->getPageObject();
$page =& $lm_page->getPageObject();
$page->setXMLContent($source_page->getXMLContent());
$page->buildDom();
// insert new page in tree (after original page)
$tree = new ilTree($cont_obj->getId());
$tree->setTableNames('lm_tree','lm_data');
$tree->setTreeTablePK("lm_id");
if ($tree->isInTree($source_lm_page->getId()))
{
$parent_node = $tree->getParentNodeData($source_lm_page->getId());
$tree->insertNode($lm_page->getId(), $parent_node["child"], $source_lm_page->getId());
}
// remove all nodes < hierarchical id from new page (incl. update)
$page->addHierIds();
$page->deleteContentBeforeHierId($a_hier_id);
// remove all nodes >= hierarchical id from source page
$source_page->buildDom();
$source_page->addHierIds();
$source_page->deleteContentFromHierId($a_hier_id);
return $lm_page;
*/
}
ilSCORM2004PageNode::assignPageObject ( $a_page_obj)

split page to next page at hierarchical id

the main reason for this method being static is that a lm page object is not available within ilPageContentGUI where this method is called Assign page object

Parameters
object$a_page_objpage object

Definition at line 320 of file class.ilSCORM2004PageNode.php.

{
$this->page_object =& $a_page_obj;
}
ilSCORM2004PageNode::copy (   $a_target_slm)

copy page node

Definition at line 135 of file class.ilSCORM2004PageNode.php.

References ilSCORM2004Node\getDescription(), getId(), ilSCORM2004Node\getSLMId(), ilSCORM2004Node\getTitle(), ilSCORM2004Node\getType(), and ilSCORM2004PageNode().

{
// copy page
$slm_page = new ilSCORM2004PageNode($a_target_slm);
$slm_page->setTitle($this->getTitle());
$slm_page->setSLMId($a_target_slm->getId());
$slm_page->setType($this->getType());
$slm_page->setDescription($this->getDescription());
$slm_page->setImportId("il__page_".$this->getId());
$slm_page->create(true); // setting "upload" flag to true prevents creating of meta data
// copy meta data
include_once("Services/MetaData/classes/class.ilMD.php");
$md = new ilMD($this->getSLMId(), $this->getId(), $this->getType());
$new_md = $md->cloneMD($a_target_slm->getId(), $slm_page->getId(), $this->getType());
// copy page content
$page = $slm_page->getPageObject();
$page->setXMLContent($this->page_object->copyXMLContent());
$page->buildDom();
$page->update();
return $slm_page;
}

+ Here is the call graph for this function:

& ilSCORM2004PageNode::copyToOtherContObject ( $a_cont_obj)

copy a page to another content object (learning module / dlib book)

Definition at line 163 of file class.ilSCORM2004PageNode.php.

{
// @todo
/*
// copy page
$lm_page =& new ilLMPageObject($a_cont_obj);
$lm_page->setTitle($this->getTitle());
$lm_page->setLMId($a_cont_obj->getId());
$lm_page->setType($this->getType());
$lm_page->setDescription($this->getDescription());
$lm_page->create(true); // setting "upload" flag to true prevents creating of meta data
// copy meta data
include_once("Services/MetaData/classes/class.ilMD.php");
$md = new ilMD($this->getLMId(), $this->getId(), $this->getType());
$new_md =& $md->cloneMD($a_cont_obj->getId(), $lm_page->getId(), $this->getType());
// copy page content
$page =& $lm_page->getPageObject();
$page->setXMLContent($this->page_object->getXMLContent());
$page->buildDom();
$page->update();
return $lm_page;
*/
}
ilSCORM2004PageNode::create (   $a_upload = false,
  $a_layout_id = 0 
)

Create Scorm Page.

Parameters
booleanUpload Mode

Definition at line 101 of file class.ilSCORM2004PageNode.php.

References getId(), ilSCORM2004Node\getSLMId(), and ilPageObject\setId().

{
parent::create($a_upload);
// create scorm2004 page
include_once("./Modules/Scorm2004/classes/class.ilSCORM2004Page.php");
if(!is_object($this->page_object))
{
$this->page_object =& new ilSCORM2004Page($this->slm_object->getType());
}
$this->page_object->setId($this->getId());
$this->page_object->setParentId($this->getSLMId());
if ($a_layout_id == 0) {
$this->page_object->create($a_upload);
} else{
$this->page_object->createWithLayoutId($a_layout_id);
}
}

+ Here is the call graph for this function:

ilSCORM2004PageNode::delete (   $a_delete_meta_data = true)

Delete Scorm Page.

Parameters
booleanDelete also metadata.

Definition at line 125 of file class.ilSCORM2004PageNode.php.

References ilSCORM2004Node\delete().

{
parent::delete($a_delete_meta_data);
$this->page_object->delete();
}

+ Here is the call graph for this function:

ilSCORM2004PageNode::getFileItemIds ( )

get ids of all file items within the page

note: this method must be called afer exportXMLPageContent

Definition at line 482 of file class.ilSCORM2004PageNode.php.

{
return $this->files_contained;
}
ilSCORM2004PageNode::getId ( )

Get id.

Returns
int Page ID

Reimplemented from ilSCORM2004Node.

Definition at line 352 of file class.ilSCORM2004PageNode.php.

References $id.

Referenced by copy(), and create().

{
return $this->id;
}

+ Here is the caller graph for this function:

ilSCORM2004PageNode::getMediaObjectIds ( )

static

presentation title doesn't have to be page title, it may be chapter title + page title or chapter title only, depending on settings

Parameters
string$a_modeIL_CHAPTER_TITLE | IL_PAGE_TITLE | IL_NO_HEADER get ids of all media objects within the page

note: this method must be called afer exportXMLPageContent

Definition at line 472 of file class.ilSCORM2004PageNode.php.

{
return $this->mobs_contained;
}
ilSCORM2004PageNode::getOriginID ( )

Definition at line 377 of file class.ilSCORM2004PageNode.php.

{
return $this->origin_id;
}
& ilSCORM2004PageNode::getPageObject ( )

Get assigned page object.

Returns
object page object

Definition at line 331 of file class.ilSCORM2004PageNode.php.

References $page_object.

{
}
ilSCORM2004PageNode::ilSCORM2004PageNode (   $a_slm_object,
  $a_id = 0 
)

Constructor public.

Definition at line 59 of file class.ilSCORM2004PageNode.php.

References ilSCORM2004Node\ilSCORM2004Node(), read(), and ilSCORM2004Node\setType().

Referenced by copy().

{
parent::ilSCORM2004Node($a_slm_object, $a_id);
$this->setType("page");
$this->id = $a_id;
$this->mobs_contained = array();
$this->files_contained = array();
if($a_id != 0)
{
$this->read();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilSCORM2004PageNode::isAlias ( )

Definition at line 365 of file class.ilSCORM2004PageNode.php.

{
return $this->is_alias;
}
ilSCORM2004PageNode::read ( )

Read data from database.

Reimplemented from ilSCORM2004Node.

Definition at line 88 of file class.ilSCORM2004PageNode.php.

References $id.

Referenced by ilSCORM2004PageNode().

{
$this->page_object = new ilPageObject($this->slm_object->getType(),
$this->id, 0, false);
}

+ Here is the caller graph for this function:

ilSCORM2004PageNode::setAlias (   $a_is_alias)

Set wether page object is an alias.

Definition at line 360 of file class.ilSCORM2004PageNode.php.

{
$this->is_alias = $a_is_alias;
}
ilSCORM2004PageNode::setId (   $a_id)

Set id.

Parameters
intPage ID

Reimplemented from ilSCORM2004Node.

Definition at line 342 of file class.ilSCORM2004PageNode.php.

{
$this->id = $a_id;
}
ilSCORM2004PageNode::setOriginID (   $a_id)

Definition at line 371 of file class.ilSCORM2004PageNode.php.

{
return $this->origin_id = $a_id;
}

Field Documentation

ilSCORM2004PageNode::$id

Definition at line 52 of file class.ilSCORM2004PageNode.php.

Referenced by getId(), and read().

ilSCORM2004PageNode::$page_object

Definition at line 53 of file class.ilSCORM2004PageNode.php.

Referenced by getPageObject().


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