ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilWebDAVObjFactory Class Reference
+ Collaboration diagram for ilWebDAVObjFactory:

Public Member Functions

 __construct (protected ilWebDAVRepositoryHelper $repository_helper, protected ilObjUser $current_user, protected Services $resource_storage, protected RequestInterface $request, protected ilLanguage $language, protected string $client_id, protected 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

array $_cache = []
 

Private Attributes

array $davable_object_types
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

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

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

55  {
56  }

Member Function Documentation

◆ checkReadAndVisibleAccessForObj()

ilWebDAVObjFactory::checkReadAndVisibleAccessForObj ( int  $child_ref)
protected

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

Referenced by retrieveDAVObjectByRefID().

167  : bool
168  {
169  return $this->repository_helper->checkAccess("visible", $child_ref) && $this->repository_helper->checkAccess(
170  "read",
171  $child_ref
172  );
173  }
+ Here is the caller graph for this function:

◆ createDAVObject()

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

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

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

108  : INode
109  {
110  if (!$this->isDAVableObjTitle($ilias_object->getTitle())) {
112  }
113 
114  if ($ilias_object->getType() === 'file' &&
115  !$this->hasValidFileExtension($ilias_object->getTitle())) {
117  }
118 
119  if ($ilias_object->getRefId() === 0) {
120  $ilias_object->create();
121  $ilias_object->createReference();
122  $ilias_object->putInTree($parent_ref_id);
123  $ilias_object->setPermissions($parent_ref_id);
124  }
125 
126  $ref_id = $ilias_object->getRefId();
127 
128  if ($ilias_object->getType() === 'file') {
129  return $this->_cache[$ref_id] = new ilDAVFile(
130  $ilias_object,
131  $this->repository_helper,
132  $this->resource_storage,
133  $this->request,
134  $this,
135  $this->versioning_enabled
136  );
137  }
138 
139  return $this->_cache[$ref_id] = new ilDAVContainer(
140  $ilias_object,
141  $this->current_user,
142  $this->request,
143  $this,
144  $this->repository_helper
145  );
146  }
setPermissions(int $parent_ref_id)
createReference()
creates reference for object
$ref_id
Definition: ltiauth.php:65
create()
note: title, description and type should be set when this function is called
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 158 of file class.ilWebDAVObjFactory.php.

159  {
160  if ($name !== $this->client_id) {
161  throw new NotFound();
162  }
163 
164  return new ilDAVClientNode($this->client_id, $this, $this->repository_helper);
165  }

◆ getMountPoint()

ilWebDAVObjFactory::getMountPoint ( )

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

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

◆ getProblemInfoFile()

ilWebDAVObjFactory::getProblemInfoFile ( int  $container_ref_id)

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

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

149  {
150  return new ilDAVProblemInfoFile($container_ref_id, $this->repository_helper, $this, $this->language);
151  }
language()
description: > Example for rendring a language glyph.
Definition: language.php:41
+ Here is the call graph for this function:

◆ retrieveDAVObjectByRefID()

ilWebDAVObjFactory::retrieveDAVObjectByRefID ( int  $ref_id)

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

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

58  : INode
59  {
61  throw new Forbidden("No read permission for object with reference ID $ref_id");
62  }
63 
64  if (isset($this->_cache[$ref_id])) {
65  return $this->_cache[$ref_id];
66  }
67 
68  $ilias_object = ilObjectFactory::getInstanceByRefId($ref_id);
69 
70  if ($ilias_object === null) {
71  throw new NotFound();
72  }
73 
74  $ilias_object_type = $ilias_object->getType();
75 
76  if (!in_array($ilias_object_type, $this->davable_object_types)) {
78  }
79 
80  if ($this->isHiddenFile($ilias_object->getTitle())) {
82  }
83 
84  if ($this->hasTitleForbiddenChars($ilias_object->getTitle())) {
86  }
87 
88  if ($ilias_object_type === 'file') {
89  return $this->_cache[$ref_id] = new ilDAVFile(
90  $ilias_object,
91  $this->repository_helper,
92  $this->resource_storage,
93  $this->request,
94  $this,
95  $this->versioning_enabled
96  );
97  }
98 
99  return $this->_cache[$ref_id] = new ilDAVContainer(
100  $ilias_object,
101  $this->current_user,
102  $this->request,
103  $this,
104  $this->repository_helper
105  );
106  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
$ref_id
Definition: ltiauth.php:65
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

◆ $_cache

array ilWebDAVObjFactory::$_cache = []
protected

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

◆ $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.


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