"Fossies" - the Fresh Open Source Software Archive

Member "ILIAS-5.4.9/Services/Object/README.md" (24 Jan 2020, 3291 Bytes) of package /linux/www/ILIAS-5.4.9.tar.gz:

As a special service "Fossies" has tried to format the requested source page into HTML format (assuming markdown format). Alternatively you can here view or download the uninterpreted source code file. A member file download can also be achieved by clicking within a package contents listing on the according byte size field. See also the last Fossies "Diffs" side-by-side code changes report for "README.md": 5.4.5_vs_5.4.6.

Object Component

This component provides features for handling ILIAS objects like repository objects or other objects being derived from ilObject.


Export Entities

The object component “Services/Object” provides the following entities, which should be added as tail dependency, if the corresponding features are used. All of them need the general object IDs to be passed.

Object Service

The object service can be obtained using the DIC:

$obj_service = $DIC->object();

For convenience the base class ilObjectGUI provides a method to obtain the object service.

// in classes that derive from ilObjectGUI you may use:
$obj_service = $this->getObjectService();

Common Settings

The object service provides methods to include common settings into your settings forms and save them.

In ILIAS 5.4 all settings forms are still legacy forms. The following examples show how to modify these forms and save the returned values. In upcoming versions a similar procedure for UI framework forms should be provided.

Custom Icons

Custom icons used in almost all views that represent repository objects, e.g. lists or explorer trees.

Adding the setting to a form (SHOULD be placed in Presentation section):

$obj_service->commonSettings()->legacyForm($form, $this->object)->addIcon();

Saving the setting:

$obj_service->commonSettings()->legacyForm($form, $this->object)->saveIcon();

Tile images

Tile images are used in tile views of containers (starting with ILIAS 5.4).

Adding the setting to a form (SHOULD be placed in Presentation section):

$obj_service->commonSettings()->legacyForm($form, $this->object)->addTileImage();

Saving the setting:

$obj_service->commonSettings()->legacyForm($form, $this->object)->saveTileImage();

Get ilObjectTileImage instance for an object id:

$tile_image = $DIC->object()->commonSettings()->tileImage()->getByObjId($obj_id);

Copying / Import / Export

If objects are copied in the repository, the common settings including e.g. tile images and custom icons will be copied automatically.

For including these in your export you need to ensure to include the common entity of the object service as a tail dependency in your exporter:

public function getXmlExportTailDependencies($a_entity, $a_target_release, $a_ids)
    if ($a_entity == "your_main_entity_type") {
        $res = [];
        $res[] = array(
            "component" => "Services/Object",
            "entity" => "common",
            "ids" => $a_ids);
        return $res;

JF Decisions

8 Oct 2018