Skip to content

Commit

Permalink
Return ETags with browse() API method.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Aug 29, 2014
1 parent e8380e4 commit 5f22852
Show file tree
Hide file tree
Showing 15 changed files with 42 additions and 7 deletions.
1 change: 1 addition & 0 deletions ansel/docs/CHANGES
Expand Up @@ -2,6 +2,7 @@
v3.0.2-git
----------

[jan] Return ETags with browse() API method.
[mjr] Fix fatal divide by zero error due to incorrectly named variable.
[jan] Fix type of ansel_shares_users.user_uid column.
[jan] Fix watermark font size preference.
Expand Down
5 changes: 4 additions & 1 deletion ansel/lib/Api.php
Expand Up @@ -153,14 +153,17 @@ public function browse($path = '', array $properties = array())
$results[$retpath]['contenttype'] = $image['type'];
}
if (in_array('contentlength', $properties)) {
$results[$retpath]['contentlength'] = 0;
$results[$retpath]['contentlength'] = 1;
}
if (in_array('modified', $properties)) {
$results[$retpath]['modified'] = $image['uploaded'];
}
if (in_array('created', $properties)) {
$results[$retpath]['created'] = $image['uploaded'];
}
if (in_array('etag', $properties)) {
$results[$retpath]['etag'] = '"' . md5($imageId . '|' . $image['uploaded']) . '"';
}
}
return $results;

Expand Down
2 changes: 2 additions & 0 deletions ansel/package.xml
Expand Up @@ -33,6 +33,7 @@
</stability>
<license uri="http://www.horde.org/licenses/gpl">GPL-2.0</license>
<notes>
* [jan] Return ETags with browse() API method.
* [mjr] Fix fatal divide by zero error due to incorrectly named variable.
* [jan] Fix type of ansel_shares_users.user_uid column.
* [jan] Fix watermark font size preference.
Expand Down Expand Up @@ -1349,6 +1350,7 @@
<date>2014-02-24</date>
<license uri="http://www.horde.org/licenses/gpl">GPL-2.0</license>
<notes>
* [jan] Return ETags with browse() API method.
* [mjr] Fix fatal divide by zero error due to incorrectly named variable.
* [jan] Fix type of ansel_shares_users.user_uid column.
* [jan] Fix watermark font size preference.
Expand Down
1 change: 1 addition & 0 deletions kronolith/docs/CHANGES
Expand Up @@ -2,6 +2,7 @@
v4.3.0-git
----------

[jan] Return ETags with browse() API method.
[jan] Add importing of calendar data from a URL.


Expand Down
9 changes: 8 additions & 1 deletion kronolith/lib/Api.php
Expand Up @@ -184,6 +184,10 @@ public function browse($path = '', $properties = array())
foreach ($events as $dayevents) {
foreach ($dayevents as $event) {
$key = 'kronolith/' . $path . '/' . $event->id;
if (in_array('modified', $properties) ||
in_array('etag', $properties)) {
$modified = $this->modified($event->uid);
}
if (in_array('name', $properties)) {
$results[$key]['name'] = $event->getTitle();
}
Expand All @@ -207,11 +211,14 @@ public function browse($path = '', $properties = array())
$results[$key]['contentlength'] = 1;
}
if (in_array('modified', $properties)) {
$results[$key]['modified'] = $this->modified($event->uid);
$results[$key]['modified'] = $modified;
}
if (in_array('created', $properties)) {
$results[$key]['created'] = $this->getActionTimestamp($event->uid, 'add');
}
if (in_array('etag', $properties)) {
$results[$key]['etag'] = '"' . md5($event->id . '|' . $modified) . '"';
}
}
}
return $results;
Expand Down
2 changes: 2 additions & 0 deletions kronolith/package.xml
Expand Up @@ -33,6 +33,7 @@
</stability>
<license uri="http://www.horde.org/licenses/gpl">GPL-2.0</license>
<notes>
* [jan] Return ETags with browse() API method.
* [jan] Add importing of calendar data from a URL.
</notes>
<contents>
Expand Down Expand Up @@ -2441,6 +2442,7 @@
<date>2014-06-04</date>
<license uri="http://www.horde.org/licenses/gpl">GPL-2.0</license>
<notes>
* [jan] Return ETags with browse() API method.
* [jan] Add importing of calendar data from a URL.
</notes>
</release>
Expand Down
1 change: 1 addition & 0 deletions mnemo/docs/CHANGES
Expand Up @@ -2,6 +2,7 @@
v4.3.0-git
----------

[jan] Return ETags with browse() API method.
[jan] Add browse(), put(), and path_delete() methods to API to support WebDAV
access.

Expand Down
3 changes: 3 additions & 0 deletions mnemo/lib/Api.php
Expand Up @@ -189,6 +189,9 @@ public function browse($path = '', $properties = array())
if (in_array('created', $properties)) {
$results[$key]['created'] = isset($memo['created']) ? $memo['created'] : 0;
}
if (in_array('etag', $properties)) {
$results[$key]['etag'] = '"' . md5($memo['memo_id'] . '|' . $this->_modified($memo)) . '"';
}
}
return $results;
} else {
Expand Down
2 changes: 2 additions & 0 deletions mnemo/package.xml
Expand Up @@ -27,6 +27,7 @@
</stability>
<license uri="http://www.horde.org/licenses/apache">ASL</license>
<notes>
* [jan] Return ETags with browse() API method.
* [jan] Add browse(), put(), and path_delete() methods to API to support WebDAV access.
</notes>
<contents>
Expand Down Expand Up @@ -1246,6 +1247,7 @@
<date>2014-05-06</date>
<license uri="http://www.horde.org/licenses/apache">ASL</license>
<notes>
* [jan] Return ETags with browse() API method.
* [jan] Add browse(), put(), and path_delete() methods to API to support WebDAV access.
</notes>
</release>
Expand Down
1 change: 1 addition & 0 deletions nag/docs/CHANGES
Expand Up @@ -2,6 +2,7 @@
v4.3.0-git
----------

[jan] Return ETags with browse() API method.

----------
v4.2.1
Expand Down
9 changes: 8 additions & 1 deletion nag/lib/Api.php
Expand Up @@ -376,6 +376,10 @@ public function browse($path = '', $properties = array())
$storage->tasks->reset();
while ($task = $storage->tasks->each()) {
$key = 'nag/' . $parts[0] . '/' . $parts[1] . '/' . $task->id;
if (in_array('modified', $properties) ||
in_array('etag', $properties)) {
$modified = $this->modified($task->uid, $parts[1]);
}
if (in_array('name', $properties)) {
$results[$key]['name'] = $task->name;
}
Expand All @@ -398,11 +402,14 @@ public function browse($path = '', $properties = array())
$results[$key]['contentlength'] = 1;
}
if (in_array('modified', $properties)) {
$results[$key]['modified'] = $this->modified($task->uid, $parts[1]);
$results[$key]['modified'] = $modified;
}
if (in_array('created', $properties)) {
$results[$key]['created'] = $this->getActionTimestamp($task->uid, 'add', $parts[1]);
}
if (in_array('etag', $properties)) {
$results[$key]['etag'] = '"' . md5($task->id . '|' . $modified) . '"';
}
}
return $results;
} else {
Expand Down
4 changes: 2 additions & 2 deletions nag/package.xml
Expand Up @@ -33,7 +33,7 @@
</stability>
<license uri="http://www.horde.org/licenses/gpl">GPL-2.0</license>
<notes>
*
* [jan] Return ETags with browse() API method.
</notes>
<contents>
<dir baseinstalldir="/" name="/">
Expand Down Expand Up @@ -1587,7 +1587,7 @@
<date>2014-06-04</date>
<license uri="http://www.horde.org/licenses/gpl">GPL-2.0</license>
<notes>
*
* [jan] Return ETags with browse() API method.
</notes>
</release>
</changelog>
Expand Down
1 change: 1 addition & 0 deletions turba/docs/CHANGES
Expand Up @@ -2,6 +2,7 @@
v4.3.0-git
----------

[jan] Return ETags with browse() API method.
[jan] Support multi-value RDNs in LDAP DN attributes (horde@iotti.biz, Request
#11889).

Expand Down
7 changes: 5 additions & 2 deletions turba/lib/Api.php
Expand Up @@ -188,7 +188,7 @@ public function getGalUid()
* @throws Horde_Exception_NotFound
*/
public function browse($path = '',
$properties = array('name', 'icon', 'browseable'))
$properties = array('name', 'icon', 'browseable'))
{
global $injector, $registry, $session;

Expand Down Expand Up @@ -360,11 +360,14 @@ public function browse($path = '',
$results[$key]['contentlength'] = strlen($data);
}
if (in_array('modified', $properties)) {
$results[$key]['modified'] = $this->_modified($contact->getValue('__uid'), $parts[1]);
$results[$key]['modified'] = $contact->lastModification();
}
if (in_array('created', $properties)) {
$results[$key]['created'] = $this->getActionTimestamp($contact->getValue('__uid'), 'add', $parts[1]);
}
if (in_array('etag', $properties)) {
$results[$key]['etag'] = '"' . md5($contact->getValue('__key') . '|' . $contact->lastModification()) . '"';
}
}

return $results;
Expand Down
1 change: 1 addition & 0 deletions turba/package.xml
Expand Up @@ -39,6 +39,7 @@
</stability>
<license uri="http://www.horde.org/licenses/apache">ASL</license>
<notes>
* [jan] Return ETags with browse() API method.
* [jan] Support multi-value RDNs in LDAP DN attributes (horde@iotti.biz, Request #11889).
</notes>
<contents>
Expand Down

0 comments on commit 5f22852

Please sign in to comment.