ILIAS  trunk Revision v11.0_alpha-1723-g8e69f309bab
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
Services.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
28 use ILIAS\MetaData\Paths\Services\Services as PathServices;
29 use ILIAS\MetaData\Structure\Services\Services as StructureServices;
34 use ILIAS\MetaData\Manipulator\Services\Services as ManipulatorServices;
37 use ILIAS\MetaData\Copyright\Services\Services as CopyrightServices;
41 use ILIAS\Export\ExportHandler\Factory as ExportService;
43 
44 class Services
45 {
46  protected GlobalContainer $dic;
50 
51  protected PathServices $path_services;
52  protected StructureServices $structure_services;
53  protected ManipulatorServices $manipulator_services;
54  protected CopyrightServices $copyright_services;
55 
56  public function __construct(
57  GlobalContainer $dic,
58  PathServices $path_services,
59  StructureServices $structure_services,
60  ManipulatorServices $manipulator_services,
61  CopyrightServices $copyright_services
62  ) {
63  $this->dic = $dic;
64  $this->path_services = $path_services;
65  $this->structure_services = $structure_services;
66  $this->manipulator_services = $manipulator_services;
67  $this->copyright_services = $copyright_services;
68  }
69 
70  public function standardWriter(): WriterInterface
71  {
72  if (isset($this->standard_writer)) {
74  }
75  $dictionary = (new LOMDictionaryInitiator(
76  new TagFactory(),
77  $this->path_services->pathFactory(),
78  $this->path_services->navigatorFactory(),
79  $this->structure_services->structure()
80  ))->get();
81  return $this->standard_writer = new StandardWriter(
82  $dictionary,
83  new CopyrightHandler(
84  $this->copyright_services->repository(),
85  $this->copyright_services->identifiersHandler(),
87  ),
88  $this->path_services->pathFactory(),
89  $this->manipulator_services->manipulator()
90  );
91  }
92 
93  public function standardReader(): ReaderInterface
94  {
95  if (isset($this->standard_reader)) {
97  }
98  $dictionary = (new LOMDictionaryInitiator(
99  new TagFactory(),
100  $this->path_services->pathFactory(),
101  $this->path_services->navigatorFactory(),
102  $this->structure_services->structure()
103  ))->get();
104  $marker_factory = new MarkerFactory();
105  $copyright_handler = new CopyrightHandler(
106  $this->copyright_services->repository(),
107  $this->copyright_services->identifiersHandler(),
109  );
110  return $this->standard_reader = new StandardReader(
112  $marker_factory,
113  $this->manipulator_services->scaffoldProvider(),
114  $dictionary,
115  $copyright_handler
116  ),
117  new Legacy(
118  $marker_factory,
119  $this->manipulator_services->scaffoldProvider(),
120  $copyright_handler
121  )
122  );
123  }
124 
126  {
127  if (isset($this->simple_dc_writer)) {
129  }
130 
131  /*
132  * This should be replaced by a proper export API
133  * when it is available.
134  */
135  $export_service = new ExportService();
136  $data_factory = new DataFactory();
137 
138  return $this->simple_dc_writer = new SimpleDC(
139  $this->path_services->pathFactory(),
140  $this->path_services->navigatorFactory(),
141  $data_factory,
142  new CopyrightHandler(
143  $this->copyright_services->repository(),
144  $this->copyright_services->identifiersHandler(),
146  ),
147  new LinkGenerator(
148  $this->dic['static_url'],
149  $export_service,
150  $data_factory
151  )
152  );
153  }
154 }
__construct(GlobalContainer $dic, PathServices $path_services, StructureServices $structure_services, ManipulatorServices $manipulator_services, CopyrightServices $copyright_services)
Definition: Services.php:56
ManipulatorServices $manipulator_services
Definition: Services.php:53
CopyrightServices $copyright_services
Definition: Services.php:54
StructureServices $structure_services
Definition: Services.php:52
SimpleDCInterface $simple_dc_writer
Definition: Services.php:49
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...