mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
handle lastUpdateTime for Wopi implementation
* get the last updated time from the stored object's storage * improve perf on loading content from stored object's storage: keep the response in cache
This commit is contained in:
@@ -147,8 +147,7 @@ final class ChillDocumentManager implements DocumentManagerInterface
|
||||
*/
|
||||
public function getLastModifiedDate(Document $document): DateTimeInterface
|
||||
{
|
||||
// TODO: Add column 'LastModifiedDate' in StoredObject entity
|
||||
return $document->getCreationDate();
|
||||
return $this->storedObjectManager->getLastModified($document);
|
||||
}
|
||||
|
||||
public function getLock(Document $document): string
|
||||
|
@@ -13,6 +13,7 @@ namespace Chill\WopiBundle\Service\Wopi;
|
||||
|
||||
use ChampsLibres\WopiLib\Contract\Service\DocumentManagerInterface;
|
||||
use ChampsLibres\WopiLib\Contract\Service\WopiInterface;
|
||||
use DateTimeInterface;
|
||||
use loophp\psr17\Psr17Interface;
|
||||
use Psr\Cache\CacheItemPoolInterface;
|
||||
use Psr\Http\Message\RequestInterface;
|
||||
@@ -88,11 +89,14 @@ final class ChillWopi implements WopiInterface
|
||||
'UserFriendlyName' => $userIdentifier,
|
||||
'SupportsUpdate' => true,
|
||||
'SupportsRename' => true,
|
||||
'SupportsFolder' => false,
|
||||
'DisablePrint' => false,
|
||||
'AllowExternalMarketplace' => true,
|
||||
'SupportedShareUrlTypes' => [
|
||||
'ReadOnly',
|
||||
],
|
||||
'LastModifiedTime' => $this->documentManager->getLastModifiedDate($document)
|
||||
->format(DateTimeInterface::ATOM),
|
||||
'SHA256' => $this->documentManager->getSha256($document),
|
||||
'UserInfo' => (string) $this->cache->getItem($userCacheKey)->get(),
|
||||
]
|
||||
|
Reference in New Issue
Block a user