19 declare(strict_types=1);
47 return $this->consumer_factory->download($this->resource_builder->get($identification));
52 return $this->consumer_factory->inline($this->resource_builder->get($identification));
57 return $this->consumer_factory->fileStream($this->resource_builder->get($identification));
62 return $this->consumer_factory->src($this->resource_builder->get($identification), $this->src_builder);
66 ResourceCollectionIdentification $identification,
67 ?
string $zip_filename =
null 70 iterator_to_array($this->collection_builder->getResourceIds($identification)),
76 array $identifications,
77 ?
string $zip_filename =
null 80 foreach ($identifications as $rid) {
82 throw new \InvalidArgumentException(
'Expected ResourceIdentification');
84 $resources[] = $this->resource_builder->get($rid);
87 return $this->consumer_factory->downloadMultiple(
95 return $this->consumer_factory->flavourUrl($flavour, $this->src_builder);
103 $resource = $this->resource_builder->get($identification);
105 throw new \InvalidArgumentException(
'Expected StorableContainerResource');
108 return $this->consumer_factory->containerZIP(
115 string $start_file =
'index.html',
116 float $valid_for_at_least_minutes = 60.0
118 $resource = $this->resource_builder->get($identification);
120 throw new \InvalidArgumentException(
'Expected StorableContainerResource');
122 return $this->consumer_factory->containerURI(
125 ltrim($start_file,
'/'),
126 $valid_for_at_least_minutes
flavourUrls(Flavour $flavour)
downloadCollection(ResourceCollectionIdentification $identification, ?string $zip_filename=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
downloadResources(array $identifications, ?string $zip_filename=null)
containerURI(ResourceIdentification $identification, string $start_file='index.html', float $valid_for_at_least_minutes=60.0)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
stream(ResourceIdentification $identification)
containerZIP(ResourceIdentification $identification)
This consumer can be used to obtain a StorageContainerResource as a ZIP.
Class ResourceIdentification.
src(ResourceIdentification $identification)
download(ResourceIdentification $identification)
__construct(private ConsumerFactory $consumer_factory, private ResourceBuilder $resource_builder, private CollectionBuilder $collection_builder, private SrcBuilder $src_builder=new InlineSrcBuilder())
Consumers constructor.