@@ -29,47 +29,47 @@ |
||
29 | 29 | */ |
30 | 30 | interface IShareable extends INode { |
31 | 31 | |
32 | - /** |
|
33 | - * Updates the list of shares. |
|
34 | - * |
|
35 | - * The first array is a list of people that are to be added to the |
|
36 | - * resource. |
|
37 | - * |
|
38 | - * Every element in the add array has the following properties: |
|
39 | - * * href - A url. Usually a mailto: address |
|
40 | - * * commonName - Usually a first and last name, or false |
|
41 | - * * summary - A description of the share, can also be false |
|
42 | - * * readOnly - A boolean value |
|
43 | - * |
|
44 | - * Every element in the remove array is just the address string. |
|
45 | - * |
|
46 | - * @param array $add |
|
47 | - * @param array $remove |
|
48 | - * @return void |
|
49 | - */ |
|
50 | - public function updateShares(array $add, array $remove); |
|
32 | + /** |
|
33 | + * Updates the list of shares. |
|
34 | + * |
|
35 | + * The first array is a list of people that are to be added to the |
|
36 | + * resource. |
|
37 | + * |
|
38 | + * Every element in the add array has the following properties: |
|
39 | + * * href - A url. Usually a mailto: address |
|
40 | + * * commonName - Usually a first and last name, or false |
|
41 | + * * summary - A description of the share, can also be false |
|
42 | + * * readOnly - A boolean value |
|
43 | + * |
|
44 | + * Every element in the remove array is just the address string. |
|
45 | + * |
|
46 | + * @param array $add |
|
47 | + * @param array $remove |
|
48 | + * @return void |
|
49 | + */ |
|
50 | + public function updateShares(array $add, array $remove); |
|
51 | 51 | |
52 | - /** |
|
53 | - * Returns the list of people whom this resource is shared with. |
|
54 | - * |
|
55 | - * Every element in this array should have the following properties: |
|
56 | - * * href - Often a mailto: address |
|
57 | - * * commonName - Optional, for example a first + last name |
|
58 | - * * status - See the Sabre\CalDAV\SharingPlugin::STATUS_ constants. |
|
59 | - * * readOnly - boolean |
|
60 | - * * summary - Optional, a description for the share |
|
61 | - * |
|
62 | - * @return array |
|
63 | - */ |
|
64 | - public function getShares(); |
|
52 | + /** |
|
53 | + * Returns the list of people whom this resource is shared with. |
|
54 | + * |
|
55 | + * Every element in this array should have the following properties: |
|
56 | + * * href - Often a mailto: address |
|
57 | + * * commonName - Optional, for example a first + last name |
|
58 | + * * status - See the Sabre\CalDAV\SharingPlugin::STATUS_ constants. |
|
59 | + * * readOnly - boolean |
|
60 | + * * summary - Optional, a description for the share |
|
61 | + * |
|
62 | + * @return array |
|
63 | + */ |
|
64 | + public function getShares(); |
|
65 | 65 | |
66 | - /** |
|
67 | - * @return int |
|
68 | - */ |
|
69 | - public function getResourceId(); |
|
66 | + /** |
|
67 | + * @return int |
|
68 | + */ |
|
69 | + public function getResourceId(); |
|
70 | 70 | |
71 | - /** |
|
72 | - * @return string |
|
73 | - */ |
|
74 | - public function getOwner(); |
|
71 | + /** |
|
72 | + * @return string |
|
73 | + */ |
|
74 | + public function getOwner(); |
|
75 | 75 | } |
@@ -41,120 +41,120 @@ |
||
41 | 41 | */ |
42 | 42 | class Invite implements XmlSerializable { |
43 | 43 | |
44 | - /** |
|
45 | - * The list of users a calendar has been shared to. |
|
46 | - * |
|
47 | - * @var array |
|
48 | - */ |
|
49 | - protected $users; |
|
44 | + /** |
|
45 | + * The list of users a calendar has been shared to. |
|
46 | + * |
|
47 | + * @var array |
|
48 | + */ |
|
49 | + protected $users; |
|
50 | 50 | |
51 | - /** |
|
52 | - * The organizer contains information about the person who shared the |
|
53 | - * object. |
|
54 | - * |
|
55 | - * @var array|null |
|
56 | - */ |
|
57 | - protected $organizer; |
|
51 | + /** |
|
52 | + * The organizer contains information about the person who shared the |
|
53 | + * object. |
|
54 | + * |
|
55 | + * @var array|null |
|
56 | + */ |
|
57 | + protected $organizer; |
|
58 | 58 | |
59 | - /** |
|
60 | - * Creates the property. |
|
61 | - * |
|
62 | - * Users is an array. Each element of the array has the following |
|
63 | - * properties: |
|
64 | - * |
|
65 | - * * href - Often a mailto: address |
|
66 | - * * commonName - Optional, for example a first and lastname for a user. |
|
67 | - * * status - One of the SharingPlugin::STATUS_* constants. |
|
68 | - * * readOnly - true or false |
|
69 | - * * summary - Optional, description of the share |
|
70 | - * |
|
71 | - * The organizer key is optional to specify. It's only useful when a |
|
72 | - * 'sharee' requests the sharing information. |
|
73 | - * |
|
74 | - * The organizer may have the following properties: |
|
75 | - * * href - Often a mailto: address. |
|
76 | - * * commonName - Optional human-readable name. |
|
77 | - * * firstName - Optional first name. |
|
78 | - * * lastName - Optional last name. |
|
79 | - * |
|
80 | - * If you wonder why these two structures are so different, I guess a |
|
81 | - * valid answer is that the current spec is still a draft. |
|
82 | - * |
|
83 | - * @param array $users |
|
84 | - */ |
|
85 | - public function __construct(array $users, array $organizer = null) { |
|
86 | - $this->users = $users; |
|
87 | - $this->organizer = $organizer; |
|
88 | - } |
|
59 | + /** |
|
60 | + * Creates the property. |
|
61 | + * |
|
62 | + * Users is an array. Each element of the array has the following |
|
63 | + * properties: |
|
64 | + * |
|
65 | + * * href - Often a mailto: address |
|
66 | + * * commonName - Optional, for example a first and lastname for a user. |
|
67 | + * * status - One of the SharingPlugin::STATUS_* constants. |
|
68 | + * * readOnly - true or false |
|
69 | + * * summary - Optional, description of the share |
|
70 | + * |
|
71 | + * The organizer key is optional to specify. It's only useful when a |
|
72 | + * 'sharee' requests the sharing information. |
|
73 | + * |
|
74 | + * The organizer may have the following properties: |
|
75 | + * * href - Often a mailto: address. |
|
76 | + * * commonName - Optional human-readable name. |
|
77 | + * * firstName - Optional first name. |
|
78 | + * * lastName - Optional last name. |
|
79 | + * |
|
80 | + * If you wonder why these two structures are so different, I guess a |
|
81 | + * valid answer is that the current spec is still a draft. |
|
82 | + * |
|
83 | + * @param array $users |
|
84 | + */ |
|
85 | + public function __construct(array $users, array $organizer = null) { |
|
86 | + $this->users = $users; |
|
87 | + $this->organizer = $organizer; |
|
88 | + } |
|
89 | 89 | |
90 | - /** |
|
91 | - * Returns the list of users, as it was passed to the constructor. |
|
92 | - * |
|
93 | - * @return array |
|
94 | - */ |
|
95 | - public function getValue() { |
|
96 | - return $this->users; |
|
97 | - } |
|
90 | + /** |
|
91 | + * Returns the list of users, as it was passed to the constructor. |
|
92 | + * |
|
93 | + * @return array |
|
94 | + */ |
|
95 | + public function getValue() { |
|
96 | + return $this->users; |
|
97 | + } |
|
98 | 98 | |
99 | - /** |
|
100 | - * The xmlSerialize metod is called during xml writing. |
|
101 | - * |
|
102 | - * Use the $writer argument to write its own xml serialization. |
|
103 | - * |
|
104 | - * An important note: do _not_ create a parent element. Any element |
|
105 | - * implementing XmlSerializble should only ever write what's considered |
|
106 | - * its 'inner xml'. |
|
107 | - * |
|
108 | - * The parent of the current element is responsible for writing a |
|
109 | - * containing element. |
|
110 | - * |
|
111 | - * This allows serializers to be re-used for different element names. |
|
112 | - * |
|
113 | - * If you are opening new elements, you must also close them again. |
|
114 | - * |
|
115 | - * @param Writer $writer |
|
116 | - * @return void |
|
117 | - */ |
|
118 | - public function xmlSerialize(Writer $writer) { |
|
119 | - $cs = '{' . Plugin::NS_OWNCLOUD . '}'; |
|
99 | + /** |
|
100 | + * The xmlSerialize metod is called during xml writing. |
|
101 | + * |
|
102 | + * Use the $writer argument to write its own xml serialization. |
|
103 | + * |
|
104 | + * An important note: do _not_ create a parent element. Any element |
|
105 | + * implementing XmlSerializble should only ever write what's considered |
|
106 | + * its 'inner xml'. |
|
107 | + * |
|
108 | + * The parent of the current element is responsible for writing a |
|
109 | + * containing element. |
|
110 | + * |
|
111 | + * This allows serializers to be re-used for different element names. |
|
112 | + * |
|
113 | + * If you are opening new elements, you must also close them again. |
|
114 | + * |
|
115 | + * @param Writer $writer |
|
116 | + * @return void |
|
117 | + */ |
|
118 | + public function xmlSerialize(Writer $writer) { |
|
119 | + $cs = '{' . Plugin::NS_OWNCLOUD . '}'; |
|
120 | 120 | |
121 | - if (!is_null($this->organizer)) { |
|
122 | - $writer->startElement($cs . 'organizer'); |
|
123 | - $writer->writeElement('{DAV:}href', $this->organizer['href']); |
|
121 | + if (!is_null($this->organizer)) { |
|
122 | + $writer->startElement($cs . 'organizer'); |
|
123 | + $writer->writeElement('{DAV:}href', $this->organizer['href']); |
|
124 | 124 | |
125 | - if (isset($this->organizer['commonName']) && $this->organizer['commonName']) { |
|
126 | - $writer->writeElement($cs . 'common-name', $this->organizer['commonName']); |
|
127 | - } |
|
128 | - if (isset($this->organizer['firstName']) && $this->organizer['firstName']) { |
|
129 | - $writer->writeElement($cs . 'first-name', $this->organizer['firstName']); |
|
130 | - } |
|
131 | - if (isset($this->organizer['lastName']) && $this->organizer['lastName']) { |
|
132 | - $writer->writeElement($cs . 'last-name', $this->organizer['lastName']); |
|
133 | - } |
|
134 | - $writer->endElement(); // organizer |
|
135 | - } |
|
125 | + if (isset($this->organizer['commonName']) && $this->organizer['commonName']) { |
|
126 | + $writer->writeElement($cs . 'common-name', $this->organizer['commonName']); |
|
127 | + } |
|
128 | + if (isset($this->organizer['firstName']) && $this->organizer['firstName']) { |
|
129 | + $writer->writeElement($cs . 'first-name', $this->organizer['firstName']); |
|
130 | + } |
|
131 | + if (isset($this->organizer['lastName']) && $this->organizer['lastName']) { |
|
132 | + $writer->writeElement($cs . 'last-name', $this->organizer['lastName']); |
|
133 | + } |
|
134 | + $writer->endElement(); // organizer |
|
135 | + } |
|
136 | 136 | |
137 | - foreach ($this->users as $user) { |
|
138 | - $writer->startElement($cs . 'user'); |
|
139 | - $writer->writeElement('{DAV:}href', $user['href']); |
|
140 | - if (isset($user['commonName']) && $user['commonName']) { |
|
141 | - $writer->writeElement($cs . 'common-name', $user['commonName']); |
|
142 | - } |
|
143 | - $writer->writeElement($cs . 'invite-accepted'); |
|
137 | + foreach ($this->users as $user) { |
|
138 | + $writer->startElement($cs . 'user'); |
|
139 | + $writer->writeElement('{DAV:}href', $user['href']); |
|
140 | + if (isset($user['commonName']) && $user['commonName']) { |
|
141 | + $writer->writeElement($cs . 'common-name', $user['commonName']); |
|
142 | + } |
|
143 | + $writer->writeElement($cs . 'invite-accepted'); |
|
144 | 144 | |
145 | - $writer->startElement($cs . 'access'); |
|
146 | - if ($user['readOnly']) { |
|
147 | - $writer->writeElement($cs . 'read'); |
|
148 | - } else { |
|
149 | - $writer->writeElement($cs . 'read-write'); |
|
150 | - } |
|
151 | - $writer->endElement(); // access |
|
145 | + $writer->startElement($cs . 'access'); |
|
146 | + if ($user['readOnly']) { |
|
147 | + $writer->writeElement($cs . 'read'); |
|
148 | + } else { |
|
149 | + $writer->writeElement($cs . 'read-write'); |
|
150 | + } |
|
151 | + $writer->endElement(); // access |
|
152 | 152 | |
153 | - if (isset($user['summary']) && $user['summary']) { |
|
154 | - $writer->writeElement($cs . 'summary', $user['summary']); |
|
155 | - } |
|
153 | + if (isset($user['summary']) && $user['summary']) { |
|
154 | + $writer->writeElement($cs . 'summary', $user['summary']); |
|
155 | + } |
|
156 | 156 | |
157 | - $writer->endElement(); //user |
|
158 | - } |
|
159 | - } |
|
157 | + $writer->endElement(); //user |
|
158 | + } |
|
159 | + } |
|
160 | 160 | } |
@@ -29,19 +29,19 @@ |
||
29 | 29 | use Exception; |
30 | 30 | |
31 | 31 | class FileLocked extends \Sabre\DAV\Exception { |
32 | - public function __construct($message = "", $code = 0, Exception $previous = null) { |
|
33 | - if ($previous instanceof \OCP\Files\LockNotAcquiredException) { |
|
34 | - $message = sprintf('Target file %s is locked by another process.', $previous->path); |
|
35 | - } |
|
36 | - parent::__construct($message, $code, $previous); |
|
37 | - } |
|
32 | + public function __construct($message = "", $code = 0, Exception $previous = null) { |
|
33 | + if ($previous instanceof \OCP\Files\LockNotAcquiredException) { |
|
34 | + $message = sprintf('Target file %s is locked by another process.', $previous->path); |
|
35 | + } |
|
36 | + parent::__construct($message, $code, $previous); |
|
37 | + } |
|
38 | 38 | |
39 | - /** |
|
40 | - * Returns the HTTP status code for this exception |
|
41 | - * |
|
42 | - * @return int |
|
43 | - */ |
|
44 | - public function getHTTPCode() { |
|
45 | - return 423; |
|
46 | - } |
|
39 | + /** |
|
40 | + * Returns the HTTP status code for this exception |
|
41 | + * |
|
42 | + * @return int |
|
43 | + */ |
|
44 | + public function getHTTPCode() { |
|
45 | + return 423; |
|
46 | + } |
|
47 | 47 | } |
@@ -31,12 +31,12 @@ |
||
31 | 31 | */ |
32 | 32 | class UnsupportedMediaType extends \Sabre\DAV\Exception { |
33 | 33 | |
34 | - /** |
|
35 | - * Returns the HTTP status code for this exception |
|
36 | - * |
|
37 | - * @return int |
|
38 | - */ |
|
39 | - public function getHTTPCode() { |
|
40 | - return 415; |
|
41 | - } |
|
34 | + /** |
|
35 | + * Returns the HTTP status code for this exception |
|
36 | + * |
|
37 | + * @return int |
|
38 | + */ |
|
39 | + public function getHTTPCode() { |
|
40 | + return 415; |
|
41 | + } |
|
42 | 42 | } |
@@ -31,12 +31,12 @@ |
||
31 | 31 | */ |
32 | 32 | class EntityTooLarge extends \Sabre\DAV\Exception { |
33 | 33 | |
34 | - /** |
|
35 | - * Returns the HTTP status code for this exception |
|
36 | - * |
|
37 | - * @return int |
|
38 | - */ |
|
39 | - public function getHTTPCode() { |
|
40 | - return 413; |
|
41 | - } |
|
34 | + /** |
|
35 | + * Returns the HTTP status code for this exception |
|
36 | + * |
|
37 | + * @return int |
|
38 | + */ |
|
39 | + public function getHTTPCode() { |
|
40 | + return 413; |
|
41 | + } |
|
42 | 42 | } |
@@ -25,58 +25,58 @@ |
||
25 | 25 | |
26 | 26 | class Publisher implements XmlSerializable { |
27 | 27 | |
28 | - /** |
|
29 | - * @var string $publishUrl |
|
30 | - */ |
|
31 | - protected $publishUrl; |
|
28 | + /** |
|
29 | + * @var string $publishUrl |
|
30 | + */ |
|
31 | + protected $publishUrl; |
|
32 | 32 | |
33 | - /** |
|
34 | - * @var boolean $isPublished |
|
35 | - */ |
|
36 | - protected $isPublished; |
|
33 | + /** |
|
34 | + * @var boolean $isPublished |
|
35 | + */ |
|
36 | + protected $isPublished; |
|
37 | 37 | |
38 | - /** |
|
39 | - * @param string $publishUrl |
|
40 | - * @param boolean $isPublished |
|
41 | - */ |
|
42 | - public function __construct($publishUrl, $isPublished) { |
|
43 | - $this->publishUrl = $publishUrl; |
|
44 | - $this->isPublished = $isPublished; |
|
45 | - } |
|
38 | + /** |
|
39 | + * @param string $publishUrl |
|
40 | + * @param boolean $isPublished |
|
41 | + */ |
|
42 | + public function __construct($publishUrl, $isPublished) { |
|
43 | + $this->publishUrl = $publishUrl; |
|
44 | + $this->isPublished = $isPublished; |
|
45 | + } |
|
46 | 46 | |
47 | - /** |
|
48 | - * @return string |
|
49 | - */ |
|
50 | - public function getValue() { |
|
51 | - return $this->publishUrl; |
|
52 | - } |
|
47 | + /** |
|
48 | + * @return string |
|
49 | + */ |
|
50 | + public function getValue() { |
|
51 | + return $this->publishUrl; |
|
52 | + } |
|
53 | 53 | |
54 | - /** |
|
55 | - * The xmlSerialize metod is called during xml writing. |
|
56 | - * |
|
57 | - * Use the $writer argument to write its own xml serialization. |
|
58 | - * |
|
59 | - * An important note: do _not_ create a parent element. Any element |
|
60 | - * implementing XmlSerializble should only ever write what's considered |
|
61 | - * its 'inner xml'. |
|
62 | - * |
|
63 | - * The parent of the current element is responsible for writing a |
|
64 | - * containing element. |
|
65 | - * |
|
66 | - * This allows serializers to be re-used for different element names. |
|
67 | - * |
|
68 | - * If you are opening new elements, you must also close them again. |
|
69 | - * |
|
70 | - * @param Writer $writer |
|
71 | - * @return void |
|
72 | - */ |
|
73 | - public function xmlSerialize(Writer $writer) { |
|
74 | - if (!$this->isPublished) { |
|
75 | - // for pre-publish-url |
|
76 | - $writer->write($this->publishUrl); |
|
77 | - } else { |
|
78 | - // for publish-url |
|
79 | - $writer->writeElement('{DAV:}href', $this->publishUrl); |
|
80 | - } |
|
81 | - } |
|
54 | + /** |
|
55 | + * The xmlSerialize metod is called during xml writing. |
|
56 | + * |
|
57 | + * Use the $writer argument to write its own xml serialization. |
|
58 | + * |
|
59 | + * An important note: do _not_ create a parent element. Any element |
|
60 | + * implementing XmlSerializble should only ever write what's considered |
|
61 | + * its 'inner xml'. |
|
62 | + * |
|
63 | + * The parent of the current element is responsible for writing a |
|
64 | + * containing element. |
|
65 | + * |
|
66 | + * This allows serializers to be re-used for different element names. |
|
67 | + * |
|
68 | + * If you are opening new elements, you must also close them again. |
|
69 | + * |
|
70 | + * @param Writer $writer |
|
71 | + * @return void |
|
72 | + */ |
|
73 | + public function xmlSerialize(Writer $writer) { |
|
74 | + if (!$this->isPublished) { |
|
75 | + // for pre-publish-url |
|
76 | + $writer->write($this->publishUrl); |
|
77 | + } else { |
|
78 | + // for publish-url |
|
79 | + $writer->writeElement('{DAV:}href', $this->publishUrl); |
|
80 | + } |
|
81 | + } |
|
82 | 82 | } |
@@ -23,11 +23,11 @@ |
||
23 | 23 | |
24 | 24 | class PublicCalendarObject extends CalendarObject { |
25 | 25 | |
26 | - /** |
|
27 | - * public calendars are always shared |
|
28 | - * @return bool |
|
29 | - */ |
|
30 | - protected function isShared() { |
|
31 | - return true; |
|
32 | - } |
|
26 | + /** |
|
27 | + * public calendars are always shared |
|
28 | + * @return bool |
|
29 | + */ |
|
30 | + protected function isShared() { |
|
31 | + return true; |
|
32 | + } |
|
33 | 33 | } |
@@ -27,21 +27,21 @@ |
||
27 | 27 | |
28 | 28 | class CompFilter implements XmlDeserializable { |
29 | 29 | |
30 | - /** |
|
31 | - * @param Reader $reader |
|
32 | - * @throws BadRequest |
|
33 | - * @return string |
|
34 | - */ |
|
35 | - public static function xmlDeserialize(Reader $reader) { |
|
36 | - $att = $reader->parseAttributes(); |
|
37 | - $componentName = $att['name']; |
|
30 | + /** |
|
31 | + * @param Reader $reader |
|
32 | + * @throws BadRequest |
|
33 | + * @return string |
|
34 | + */ |
|
35 | + public static function xmlDeserialize(Reader $reader) { |
|
36 | + $att = $reader->parseAttributes(); |
|
37 | + $componentName = $att['name']; |
|
38 | 38 | |
39 | - $reader->parseInnerTree(); |
|
39 | + $reader->parseInnerTree(); |
|
40 | 40 | |
41 | - if (!is_string($componentName)) { |
|
42 | - throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}comp-filter requires a valid name attribute'); |
|
43 | - } |
|
41 | + if (!is_string($componentName)) { |
|
42 | + throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}comp-filter requires a valid name attribute'); |
|
43 | + } |
|
44 | 44 | |
45 | - return $componentName; |
|
46 | - } |
|
45 | + return $componentName; |
|
46 | + } |
|
47 | 47 | } |
@@ -27,17 +27,17 @@ |
||
27 | 27 | |
28 | 28 | class SearchTermFilter implements XmlDeserializable { |
29 | 29 | |
30 | - /** |
|
31 | - * @param Reader $reader |
|
32 | - * @throws BadRequest |
|
33 | - * @return string |
|
34 | - */ |
|
35 | - public static function xmlDeserialize(Reader $reader) { |
|
36 | - $value = $reader->parseInnerTree(); |
|
37 | - if (!is_string($value)) { |
|
38 | - throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}search-term has illegal value'); |
|
39 | - } |
|
30 | + /** |
|
31 | + * @param Reader $reader |
|
32 | + * @throws BadRequest |
|
33 | + * @return string |
|
34 | + */ |
|
35 | + public static function xmlDeserialize(Reader $reader) { |
|
36 | + $value = $reader->parseInnerTree(); |
|
37 | + if (!is_string($value)) { |
|
38 | + throw new BadRequest('The {' . SearchPlugin::NS_Nextcloud . '}search-term has illegal value'); |
|
39 | + } |
|
40 | 40 | |
41 | - return $value; |
|
42 | - } |
|
41 | + return $value; |
|
42 | + } |
|
43 | 43 | } |