ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilWebDAVObjFactory Class Reference
+ Collaboration diagram for ilWebDAVObjFactory:

Public Member Functions

 __construct (ilWebDAVRepositoryHelper $repository_helper, ilObjUser $current_user, Services $resource_storage, RequestInterface $request, ilLanguage $language, string $client_id, bool $versioning_enabled)
 
 retrieveDAVObjectByRefID (int $ref_id)
 
 createDAVObject (ilObject $ilias_object, int $parent_ref_id)
 
 getProblemInfoFile (int $container_ref_id)
 
 getMountPoint ()
 
 getClientNode (string $name)
 

Protected Member Functions

 checkReadAndVisibleAccessForObj (int $child_ref)
 

Protected Attributes

ilWebDAVRepositoryHelper $repository_helper
 
ilObjUser $current_user
 
Services $resource_storage
 
RequestInterface $request
 
ilLanguage $language
 
string $client_id
 
bool $versioning_enabled
 

Private Attributes

array $davable_object_types
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilWebDAVObjFactory::__construct ( ilWebDAVRepositoryHelper  $repository_helper,
ilObjUser  $current_user,
Services  $resource_storage,
RequestInterface  $request,
ilLanguage  $language,
string  $client_id,
bool  $versioning_enabled 
)

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

References $client_id, $current_user, $language, $repository_helper, $request, $resource_storage, $versioning_enabled, and ILIAS\UI\examples\Symbol\Glyph\Language\language().

61  {
62  $this->repository_helper = $repository_helper;
63  $this->current_user = $current_user;
64  $this->resource_storage = $resource_storage;
65  $this->request = $request;
66  $this->language = $language;
67  $this->client_id = $client_id;
68  $this->versioning_enabled = $versioning_enabled;
69  }
ilWebDAVRepositoryHelper $repository_helper
+ Here is the call graph for this function:

Member Function Documentation

◆ checkReadAndVisibleAccessForObj()

ilWebDAVObjFactory::checkReadAndVisibleAccessForObj ( int  $child_ref)
protected

Definition at line 173 of file class.ilWebDAVObjFactory.php.

Referenced by retrieveDAVObjectByRefID().

173  : bool
174  {
175  return $this->repository_helper->checkAccess("visible", $child_ref) && $this->repository_helper->checkAccess("read", $child_ref);
176  }
+ Here is the caller graph for this function:

◆ createDAVObject()

ilWebDAVObjFactory::createDAVObject ( ilObject  $ilias_object,
int  $parent_ref_id 
)

Definition at line 117 of file class.ilWebDAVObjFactory.php.

References ilObject\create(), ilObject\createReference(), ilObject\getTitle(), ilObject\getType(), ilWebDAVNotDavableException\OBJECT_TITLE_NOT_DAVABLE, ilObject\putInTree(), and ilObject\setPermissions().

117  : INode
118  {
119  if (!$this->isDAVableObjTitle($ilias_object->getTitle())) {
121  }
122 
123  if ($ilias_object->getType() === 'file' &&
124  !$this->hasValidFileExtension($ilias_object->getTitle())) {
126  }
127 
128  $ilias_object->create();
129 
130  $ilias_object->createReference();
131  $ilias_object->putInTree($parent_ref_id);
132  $ilias_object->setPermissions($parent_ref_id);
133 
134  if ($ilias_object->getType() === 'file') {
135  return new ilDAVFile(
136  $ilias_object,
137  $this->repository_helper,
138  $this->resource_storage,
139  $this->request,
140  $this,
141  $this->versioning_enabled
142  );
143  }
144 
145  return new ilDAVContainer(
146  $ilias_object,
147  $this->current_user,
148  $this->request,
149  $this,
150  $this->repository_helper
151  );
152  }
setPermissions(int $parent_ref_id)
createReference()
creates reference for object
create()
note: title, description and type should be set when this function is called
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
putInTree(int $parent_ref_id)
maybe this method should be in tree object!?
+ Here is the call graph for this function:

◆ getClientNode()

ilWebDAVObjFactory::getClientNode ( string  $name)

Definition at line 164 of file class.ilWebDAVObjFactory.php.

165  {
166  if ($name !== $this->client_id) {
167  throw new NotFound();
168  }
169 
170  return new ilDAVClientNode($this->client_id, $this, $this->repository_helper);
171  }
if($format !==null) $name
Definition: metadata.php:247

◆ getMountPoint()

ilWebDAVObjFactory::getMountPoint ( )

Definition at line 159 of file class.ilWebDAVObjFactory.php.

160  {
161  return new ilDAVMountPoint($this->client_id, $this, $this->repository_helper, $this->current_user);
162  }
This class represents the absolut Root-Node on a WebDAV request.

◆ getProblemInfoFile()

ilWebDAVObjFactory::getProblemInfoFile ( int  $container_ref_id)

Definition at line 154 of file class.ilWebDAVObjFactory.php.

References ILIAS\UI\examples\Symbol\Glyph\Language\language().

155  {
156  return new ilDAVProblemInfoFile($container_ref_id, $this->repository_helper, $this, $this->language);
157  }
+ Here is the call graph for this function:

◆ retrieveDAVObjectByRefID()

ilWebDAVObjFactory::retrieveDAVObjectByRefID ( int  $ref_id)

Definition at line 71 of file class.ilWebDAVObjFactory.php.

References checkReadAndVisibleAccessForObj(), ilObjectFactory\getInstanceByRefId(), ilWebDAVNotDavableException\OBJECT_HIDDEN, ilWebDAVNotDavableException\OBJECT_TITLE_NOT_DAVABLE, and ilWebDAVNotDavableException\OBJECT_TYPE_NOT_DAVABLE.

71  : INode
72  {
74  throw new Forbidden("No read permission for object with reference ID $ref_id");
75  }
76 
78 
79  if (!$ilias_object) {
80  throw new NotFound();
81  }
82 
83  $ilias_object_type = $ilias_object->getType();
84 
85  if (!in_array($ilias_object_type, $this->davable_object_types)) {
87  }
88 
89  if ($this->isHiddenFile($ilias_object->getTitle())) {
91  }
92 
93  if ($this->hasTitleForbiddenChars($ilias_object->getTitle())) {
95  }
96 
97  if ($ilias_object_type === 'file') {
98  return new ilDAVFile(
99  $ilias_object,
100  $this->repository_helper,
101  $this->resource_storage,
102  $this->request,
103  $this,
104  $this->versioning_enabled
105  );
106  }
107 
108  return new ilDAVContainer(
109  $ilias_object,
110  $this->current_user,
111  $this->request,
112  $this,
113  $this->repository_helper
114  );
115  }
$ref_id
Definition: ltiauth.php:67
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
checkReadAndVisibleAccessForObj(int $child_ref)
+ Here is the call graph for this function:

Field Documentation

◆ $client_id

string ilWebDAVObjFactory::$client_id
protected

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

Referenced by __construct().

◆ $current_user

ilObjUser ilWebDAVObjFactory::$current_user
protected

Definition at line 46 of file class.ilWebDAVObjFactory.php.

Referenced by __construct().

◆ $davable_object_types

array ilWebDAVObjFactory::$davable_object_types
private
Initial value:
= [
'cat',
'crs',
'fold',
'file',
'grp'
]

Definition at line 37 of file class.ilWebDAVObjFactory.php.

◆ $language

ilLanguage ilWebDAVObjFactory::$language
protected

Definition at line 49 of file class.ilWebDAVObjFactory.php.

Referenced by __construct().

◆ $repository_helper

ilWebDAVRepositoryHelper ilWebDAVObjFactory::$repository_helper
protected

Definition at line 45 of file class.ilWebDAVObjFactory.php.

Referenced by __construct().

◆ $request

RequestInterface ilWebDAVObjFactory::$request
protected

Definition at line 48 of file class.ilWebDAVObjFactory.php.

Referenced by __construct().

◆ $resource_storage

Services ilWebDAVObjFactory::$resource_storage
protected

Definition at line 47 of file class.ilWebDAVObjFactory.php.

Referenced by __construct().

◆ $versioning_enabled

bool ilWebDAVObjFactory::$versioning_enabled
protected

Definition at line 51 of file class.ilWebDAVObjFactory.php.

Referenced by __construct().


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