mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
Clean
This commit is contained in:
@@ -14,7 +14,7 @@ namespace Alchemy\Phrasea\Model\Entities;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
|
||||
/**
|
||||
* Record entity that represents data from elastic search data
|
||||
* Record entity from elastic search
|
||||
*/
|
||||
class RecordES implements RecordInterface
|
||||
{
|
||||
@@ -29,174 +29,153 @@ class RecordES implements RecordInterface
|
||||
private $created;
|
||||
private $sha256;
|
||||
private $uuid;
|
||||
private $position;
|
||||
private $type;
|
||||
private $status;
|
||||
private $isStory;
|
||||
/** @var ArrayCollection */
|
||||
private $caption;
|
||||
/** @var ArrayCollection */
|
||||
private $exif;
|
||||
/** @var ArrayCollection */
|
||||
private $subdefs;
|
||||
|
||||
/** {@inheritdoc} */
|
||||
public function getId()
|
||||
{
|
||||
return sprintf('%s_%s', $this->getDataboxId(), $this->getRecordId());
|
||||
}
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
|
||||
/** {@inheritdoc} */
|
||||
public function getBaseId()
|
||||
{
|
||||
return $this->baseId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $baseId
|
||||
*/
|
||||
/** {@inheritdoc} */
|
||||
public function setBaseId($baseId)
|
||||
{
|
||||
$this->baseId = $baseId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
/** {@inheritdoc} */
|
||||
public function getCollectionId()
|
||||
{
|
||||
return $this->collectionId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $collectionId
|
||||
*/
|
||||
/** {@inheritdoc} */
|
||||
public function setCollectionId($collectionId)
|
||||
{
|
||||
$this->collectionId = $collectionId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
/** {@inheritdoc} */
|
||||
public function getCreated()
|
||||
{
|
||||
return $this->created;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $created
|
||||
*/
|
||||
public function setCreated($created)
|
||||
/** {@inheritdoc} */
|
||||
public function setCreated(\DateTime $created)
|
||||
{
|
||||
$this->created = $created;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
/** {@inheritdoc} */
|
||||
public function getDataboxId()
|
||||
{
|
||||
return $this->databoxId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $databoxId
|
||||
*/
|
||||
/** {@inheritdoc} */
|
||||
public function setDataboxId($databoxId)
|
||||
{
|
||||
$this->databoxId = $databoxId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
/** {@inheritdoc} */
|
||||
public function isStory()
|
||||
{
|
||||
return $this->isStory;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $isStory
|
||||
*/
|
||||
/** {@inheritdoc} */
|
||||
public function setIsStory($isStory)
|
||||
{
|
||||
$this->isStory = $isStory;
|
||||
$this->isStory = (bool) $isStory;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
/** {@inheritdoc} */
|
||||
public function getMimeType()
|
||||
{
|
||||
return $this->mimeType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $mimeType
|
||||
*/
|
||||
/** {@inheritdoc} */
|
||||
public function setMimeType($mimeType)
|
||||
{
|
||||
$this->mimeType = $mimeType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
/** {@inheritdoc} */
|
||||
public function getOriginalName()
|
||||
{
|
||||
return $this->originalName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $originalName
|
||||
*/
|
||||
/** {@inheritdoc} */
|
||||
public function setOriginalName($originalName)
|
||||
{
|
||||
$this->originalName = $originalName;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
/** {@inheritdoc} */
|
||||
public function getRecordId()
|
||||
{
|
||||
return $this->recordId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $recordId
|
||||
*/
|
||||
/** {@inheritdoc} */
|
||||
public function setRecordId($recordId)
|
||||
{
|
||||
$this->recordId = $recordId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
/** {@inheritdoc} */
|
||||
public function getSha256()
|
||||
{
|
||||
return $this->sha256;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $sha256
|
||||
*/
|
||||
/** {@inheritdoc} */
|
||||
public function setSha256($sha256)
|
||||
{
|
||||
$this->sha256 = $sha256;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
* @param null $locale
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTitle($locale = null)
|
||||
{
|
||||
if ($locale && $this->title->containsKey($locale)) {
|
||||
return $this->title->get($locale);
|
||||
}
|
||||
return $this->title->get('default');
|
||||
|
||||
if ($this->title->containsKey('default')) {
|
||||
return $this->title->get('default');
|
||||
}
|
||||
|
||||
return $this->getOriginalName();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $title
|
||||
* Sets a collection of titles
|
||||
*
|
||||
* @param ArrayCollection $titles
|
||||
*/
|
||||
public function setTitles(ArrayCollection $titles)
|
||||
{
|
||||
@@ -204,72 +183,51 @@ class RecordES implements RecordInterface
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
* Available types are ['document', 'audio', 'video', 'image', 'flash', 'map', 'unknown']
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $type
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
$this->type = $type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
/** @return \DateTime */
|
||||
public function getUpdated()
|
||||
{
|
||||
return $this->updated;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $updated
|
||||
*/
|
||||
public function setUpdated($updated)
|
||||
{
|
||||
$this->updated = $updated;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getUuid()
|
||||
{
|
||||
return $this->uuid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $uuid
|
||||
*/
|
||||
public function setUuid($uuid)
|
||||
{
|
||||
$this->uuid = $uuid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
/** @return ArrayCollection */
|
||||
public function getCaption()
|
||||
{
|
||||
return $this->caption;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $caption
|
||||
*/
|
||||
public function setCaption(ArrayCollection $caption)
|
||||
{
|
||||
$this->caption = $caption;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
/** @return ArrayCollection */
|
||||
public function getExif()
|
||||
{
|
||||
return $this->exif;
|
||||
@@ -283,35 +241,45 @@ class RecordES implements RecordInterface
|
||||
$this->exif = $exif;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
/** @return ArrayCollection */
|
||||
public function getSubdefs()
|
||||
{
|
||||
return $this->subdefs;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $subdefs
|
||||
*/
|
||||
/** @return ArrayCollection */
|
||||
public function setSubdefs(ArrayCollection $subdefs)
|
||||
{
|
||||
$this->subdefs = $subdefs;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $status
|
||||
*/
|
||||
public function setStatus($status)
|
||||
{
|
||||
$this->status = $status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
* Get status of current current as 32 bits binary string
|
||||
*
|
||||
* Eg: 00000000001011100000000000011111
|
||||
*
|
||||
* Where the
|
||||
*/
|
||||
public function getStatus()
|
||||
{
|
||||
return $this->status;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the position of the record in the result set
|
||||
*/
|
||||
public function getPosition()
|
||||
{
|
||||
return $this->position;
|
||||
}
|
||||
|
||||
public function setPosition($position)
|
||||
{
|
||||
$this->position = $position;
|
||||
}
|
||||
}
|
||||
|
@@ -2,139 +2,184 @@
|
||||
|
||||
namespace Alchemy\Phrasea\Model\Entities;
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
|
||||
/**
|
||||
* Interface RecordInterface
|
||||
*
|
||||
*
|
||||
* +---------------------+ +---------------------+
|
||||
* | Application Box XXX | | Application Box YYY |
|
||||
* +---------------------+ +---------------------+
|
||||
* | Users | | Users |
|
||||
* | ~~~~~~~~~~~~~~~~~~~ | | ~~~~~~~~~~~~~~~~~~~ |
|
||||
* | Rights (ACL) | | Rights (ACL) |
|
||||
* | ~~~~~~~~~~~~~~~~~~~ | | ~~~~~~~~~~~~~~~~~~~ |
|
||||
* | Baskets, Feeds, | | Baskets, Feeds, |
|
||||
* | Publications etc... | | Publications etc... |
|
||||
* +---------------------+ +---------------------+
|
||||
* / \ /
|
||||
* / \ /
|
||||
* / \ /
|
||||
* / \ /
|
||||
* / \ /
|
||||
* +--------------------+ +--------------------+
|
||||
* | Data Box AAA | | Data Box BBB |
|
||||
* +--------------------+ +--------------------+
|
||||
* | Collection (1) | | Collection (1) |
|
||||
* | Collection (2) | | Collection (2) |
|
||||
* | ... | | ... |
|
||||
* | Collection (n) | | Collection (n) |
|
||||
* | ~~~~~~~~~~~~~~~~~ | | ~~~~~~~~~~~~~~~~~ |
|
||||
* | Record (1) | | Record (1) |
|
||||
* | Record (2) | | Record (2) |
|
||||
* | ... | | ... |
|
||||
* | Record (n) | | Record (n) |
|
||||
* +--------------------+ +--------------------+
|
||||
*
|
||||
*
|
||||
* An appbox (which is a database) is the heart of the application as it contains information
|
||||
* about users, rights (ACL), publications, tasks and so on ...
|
||||
*
|
||||
* A databox (which is also a database) contains information about records and their documentary
|
||||
* structure (metadata). It also contains collections which is a subset that allows to organize
|
||||
* the records inside the databox.
|
||||
*
|
||||
* We could assimilate a databox to a wardrobe where collections would be the shelves and everything
|
||||
* you put inside would be a record.
|
||||
*
|
||||
* A databox can be mounted or unmounted to an appbox .
|
||||
*
|
||||
* An appbox can reference "n" databox.
|
||||
* A databox can be mounted on "n" appbox.
|
||||
*
|
||||
* This allows Phraseanet to share data between "n" instances of Phraseanet.
|
||||
*
|
||||
* The "databox_id" is the id of the databox from the appbox point of view, it is given when a new
|
||||
* databox is mounted on the appbox.
|
||||
*
|
||||
* A databox contains a set of records.
|
||||
* The "record_id" is the is of the record from the databox point of view.
|
||||
*
|
||||
* This "record_id" is no more unique from the appbox if two databox that have both records with the
|
||||
* same ids.
|
||||
*
|
||||
* Thus the unique id of a record from an application point of view is the concatenation of the
|
||||
* "databox_id' and the "record_id".
|
||||
*
|
||||
* A databox contains a set of collection. Each records belongs to one and only one collection.
|
||||
* The "collection_id" is the id of the collection from the databox point of view.
|
||||
*
|
||||
* This "collection_id" is no more unique from the appbox point of view if two databox
|
||||
* that have both a collection with the same id are mounted to the same appbox.
|
||||
*
|
||||
* The unique id of a collection from an application point of view could be the concatenation of
|
||||
* the "databox_id" and "the collection_id" but when a databox is mounted on an appbox.
|
||||
* A unique id is created foreach collection referenced in the mounted databox.
|
||||
* This unique id id is called "base_id"
|
||||
*
|
||||
*/
|
||||
interface RecordInterface
|
||||
{
|
||||
/**
|
||||
* The record id is the concatenation of the databox_id where the record belongs
|
||||
* And its record_id separated by an underscore.
|
||||
*
|
||||
* Eg: "1_256" for a record with an id of 256 in databox 1
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getId();
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
* The unique id of the collection where belong the record.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getBaseId();
|
||||
|
||||
/**
|
||||
* @param mixed $baseId
|
||||
*/
|
||||
/** @param integer $baseId */
|
||||
public function setBaseId($baseId);
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
* The id of the collection where belong the record.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getCollectionId();
|
||||
|
||||
/**
|
||||
* @param mixed $collectionId
|
||||
*/
|
||||
/** @param integer $collectionId */
|
||||
public function setCollectionId($collectionId);
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
/** @return \DateTime */
|
||||
public function getCreated();
|
||||
|
||||
/**
|
||||
* @param mixed $created
|
||||
*/
|
||||
public function setCreated($created);
|
||||
/** @param \DateTime $created */
|
||||
public function setCreated(\DateTime $created);
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
* The id of the databox where belong the record.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getDataboxId();
|
||||
|
||||
/**
|
||||
* @param mixed $databoxId
|
||||
*/
|
||||
/** @param integer $databoxId */
|
||||
public function setDataboxId($databoxId);
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
/** @return boolean */
|
||||
public function isStory();
|
||||
|
||||
/**
|
||||
* @param mixed $isStory
|
||||
*/
|
||||
/** @param boolean $isStory */
|
||||
public function setIsStory($isStory);
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
/** @return string */
|
||||
public function getMimeType();
|
||||
|
||||
/**
|
||||
* @param mixed $mimeType
|
||||
*/
|
||||
/** @param string $mimeType */
|
||||
public function setMimeType($mimeType);
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
/** @return string */
|
||||
public function getOriginalName();
|
||||
|
||||
/**
|
||||
* @param mixed $originalName
|
||||
*/
|
||||
/** @param string $originalName */
|
||||
public function setOriginalName($originalName);
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
* The record id of the record.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getRecordId();
|
||||
|
||||
/**
|
||||
* @param mixed $recordId
|
||||
*/
|
||||
/** @param integer $recordId */
|
||||
public function setRecordId($recordId);
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
/** @return string */
|
||||
public function getSha256();
|
||||
|
||||
/**
|
||||
* @param mixed $sha256
|
||||
*/
|
||||
/** @param string $sha256 */
|
||||
public function setSha256($sha256);
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
/** @return string */
|
||||
public function getType();
|
||||
|
||||
/**
|
||||
* @param mixed $type
|
||||
*/
|
||||
/** @param string $type */
|
||||
public function setType($type);
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
/** @return \DateTime */
|
||||
public function getUpdated();
|
||||
|
||||
/**
|
||||
* @param mixed $updated
|
||||
*/
|
||||
public function setUpdated($updated);
|
||||
/** @param \DateTime $updated */
|
||||
public function setUpdated(\DateTime $updated);
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
/** @return string */
|
||||
public function getUuid();
|
||||
|
||||
/**
|
||||
* @param mixed $uuid
|
||||
*/
|
||||
/** @param string $uuid */
|
||||
public function setUuid($uuid);
|
||||
|
||||
/**
|
||||
* @param $status
|
||||
*/
|
||||
/** @param string $status */
|
||||
public function setStatus($status);
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
/** @return string */
|
||||
public function getStatus();
|
||||
}
|
||||
}
|
||||
|
@@ -16,9 +16,11 @@ use Doctrine\Common\Collections\ArrayCollection;
|
||||
|
||||
class ESRecordHydrator
|
||||
{
|
||||
public static function hydrate(array $data)
|
||||
public static function hydrate(array $data, $position)
|
||||
{
|
||||
$record = new RecordES();
|
||||
|
||||
$record->setPosition($position);
|
||||
$record->setBaseId(isset($data['base_id']) ? $data['base_id'] : null);
|
||||
$record->setCollectionId(isset($data['collection_id']) ? $data['collection_id'] : null);
|
||||
$record->setCreated(isset($data['created_on']) ? new \DateTime($data['created_on']) : null);
|
||||
@@ -32,7 +34,7 @@ class ESRecordHydrator
|
||||
$record->setUpdated(isset($data['updated_on']) ? new \DateTime($data['updated_on']) : null);
|
||||
$record->setUuid(isset($data['uuid']) ? $data['uuid'] : null);
|
||||
$record->setStatus(isset($data['bin_status']) ? $data['bin_status'] : null);
|
||||
$record->setTitles(new ArrayCollection(isset($data['title']) ? (array) $data['title'] : ['default' => $record->getOriginalName()]));
|
||||
$record->setTitles(new ArrayCollection(isset($data['title']) ? (array) $data['title'] : []));
|
||||
$record->setCaption(new ArrayCollection(isset($data['caption']) ? (array) $data['caption'] : []));
|
||||
$record->setExif(new ArrayCollection(isset($data['exif']) ? (array) $data['exif'] : []));
|
||||
$record->setSubdefs(new ArrayCollection(isset($data['subdefs']) ? (array) $data['subdefs'] : []));
|
||||
|
@@ -370,8 +370,9 @@ class ElasticSearchEngine implements SearchEngineInterface
|
||||
$results = new ArrayCollection();
|
||||
$suggestions = new ArrayCollection();
|
||||
|
||||
$n = 0;
|
||||
foreach ($res['hits']['hits'] as $hit) {
|
||||
$results[] = ESRecordHydrator::hydrate($hit['_source']);
|
||||
$results[] = ESRecordHydrator::hydrate($hit['_source'], $n++);
|
||||
}
|
||||
|
||||
$query['_ast'] = $searchQuery->dump();
|
||||
|
@@ -158,12 +158,14 @@ class RecordIndexer
|
||||
->addRawVersion()
|
||||
;
|
||||
|
||||
// Index title
|
||||
$titleMapping = new Mapping();
|
||||
$titleMapping->add('default', 'string')->notAnalyzed()->notIndexed();
|
||||
foreach ($this->locales as $locale) {
|
||||
$titleMapping->add($locale, 'string')->notAnalyzed()->notIndexed();
|
||||
}
|
||||
$mapping->add('title', $titleMapping);
|
||||
|
||||
// Minimal subdefs mapping info for display purpose
|
||||
$subdefMapping = new Mapping();
|
||||
$subdefMapping->add('path', 'string')->notAnalyzed()->notIndexed();
|
||||
|
@@ -1842,153 +1842,115 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
/** {@inheritdoc} */
|
||||
public function getBaseId()
|
||||
{
|
||||
return $this->get_base_id();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $baseId
|
||||
*/
|
||||
/** {@inheritdoc} */
|
||||
public function setBaseId($baseId)
|
||||
{
|
||||
$this->base_id = $baseId;
|
||||
throw new \BadMethodCallException(sprintf('Method %s::%s is not implemented', __CLASS__, __METHOD__));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
/** {@inheritdoc} */
|
||||
public function getCollectionId()
|
||||
{
|
||||
return $this->get_collection()->get_coll_id();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $collectionId
|
||||
*/
|
||||
/** {@inheritdoc} */
|
||||
public function setCollectionId($collectionId)
|
||||
{
|
||||
// TODO: Implement setCollectionId() method.
|
||||
throw new \BadMethodCallException(sprintf('Method %s::%s is not implemented', __CLASS__, __METHOD__));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
/** {@inheritdoc} */
|
||||
public function getCreated()
|
||||
{
|
||||
return $this->get_creation_date();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $created
|
||||
*/
|
||||
public function setCreated($created)
|
||||
/** {@inheritdoc} */
|
||||
public function setCreated(\DateTime $created)
|
||||
{
|
||||
$this->creation_date = $created;
|
||||
throw new \BadMethodCallException(sprintf('Method %s::%s is not implemented', __CLASS__, __METHOD__));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
/** {@inheritdoc} */
|
||||
public function getDataboxId()
|
||||
{
|
||||
$this->get_databox()->get_sbas_id();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $databoxId
|
||||
*/
|
||||
/** {@inheritdoc} */
|
||||
public function setDataboxId($databoxId)
|
||||
{
|
||||
// TODO: Implement setDataboxId() method.
|
||||
throw new \BadMethodCallException(sprintf('Method %s::%s is not implemented', __CLASS__, __METHOD__));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
/** {@inheritdoc} */
|
||||
public function isStory()
|
||||
{
|
||||
return $this->is_grouping();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $isStory
|
||||
*/
|
||||
/** {@inheritdoc} */
|
||||
public function setIsStory($isStory)
|
||||
{
|
||||
$this->grouping = (Boolean) $isStory;
|
||||
throw new \BadMethodCallException(sprintf('Method %s::%s is not implemented', __CLASS__, __METHOD__));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
/** {@inheritdoc} */
|
||||
public function getMimeType()
|
||||
{
|
||||
return $this->get_mime();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $mimeType
|
||||
*/
|
||||
/** {@inheritdoc} */
|
||||
public function setMimeType($mimeType)
|
||||
{
|
||||
// TODO: Implement setMimeType() method.
|
||||
throw new \BadMethodCallException(sprintf('Method %s::%s is not implemented', __CLASS__, __METHOD__));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
/** {@inheritdoc} */
|
||||
public function getOriginalName()
|
||||
{
|
||||
return $this->get_original_name();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $originalName
|
||||
*/
|
||||
/** {@inheritdoc} */
|
||||
public function setOriginalName($originalName)
|
||||
{
|
||||
// TODO: Implement setOriginalName() method.
|
||||
$this->set_original_name($originalName);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
/** {@inheritdoc} */
|
||||
public function getRecordId()
|
||||
{
|
||||
return $this->get_record_id();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $recordId
|
||||
*/
|
||||
/** {@inheritdoc} */
|
||||
public function setRecordId($recordId)
|
||||
{
|
||||
// TODO: Implement setRecordId() method.
|
||||
throw new \BadMethodCallException(sprintf('Method %s::%s is not implemented', __CLASS__, __METHOD__));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
/** {@inheritdoc} */
|
||||
public function getSha256()
|
||||
{
|
||||
return $this->get_sha256();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $sha256
|
||||
*/
|
||||
/** {@inheritdoc} */
|
||||
public function setSha256($sha256)
|
||||
{
|
||||
// TODO: Implement setSha256() method.
|
||||
throw new \BadMethodCallException(sprintf('Method %s::%s is not implemented', __CLASS__, __METHOD__));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
/** {@inheritdoc} */
|
||||
public function getType()
|
||||
{
|
||||
return $this->get_type();
|
||||
@@ -1999,108 +1961,46 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
// TODO: Implement setType() method.
|
||||
throw new \BadMethodCallException(sprintf('Method %s::%s is not implemented', __CLASS__, __METHOD__));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
/** {@inheritdoc} */
|
||||
public function getUpdated()
|
||||
{
|
||||
return $this->get_modification_date();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $updated
|
||||
*/
|
||||
public function setUpdated($updated)
|
||||
/** {@inheritdoc} */
|
||||
public function setUpdated(\DateTime $updated)
|
||||
{
|
||||
// TODO: Implement setUpdated() method.
|
||||
throw new \BadMethodCallException(sprintf('Method %s::%s is not implemented', __CLASS__, __METHOD__));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
/** {@inheritdoc} */
|
||||
public function getUuid()
|
||||
{
|
||||
return $this->get_uuid();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $uuid
|
||||
*/
|
||||
/** {@inheritdoc} */
|
||||
public function setUuid($uuid)
|
||||
{
|
||||
// TODO: Implement setUuid() method.
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getExif()
|
||||
{
|
||||
return new ArrayCollection($this->get_technical_infos());
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $exif
|
||||
*/
|
||||
public function setExif(\Doctrine\Common\Collections\ArrayCollection $exif)
|
||||
{
|
||||
// TODO: Implement setExif() method.
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getCaption()
|
||||
{
|
||||
$caption = array();
|
||||
|
||||
foreach ($this->get_caption()->get_fields() as $field) {
|
||||
$fieldValues = $field->get_values();
|
||||
|
||||
if (0 === count($fieldValues)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($field->is_multi()) {
|
||||
$caption[$field->get_name()] = array_map(function($fieldValue) {
|
||||
return $fieldValue->getValue();
|
||||
}, $fieldValues);
|
||||
continue;
|
||||
}
|
||||
|
||||
$caption[$field->get_name()] = current($fieldValues)->getValue();
|
||||
}
|
||||
|
||||
return new ArrayCollection($caption);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $caption
|
||||
*/
|
||||
public function setCaption(\Doctrine\Common\Collections\ArrayCollection $caption)
|
||||
{
|
||||
// TODO: Implement setCaption() method.
|
||||
throw new \BadMethodCallException(sprintf('Method %s::%s is not implemented', __CLASS__, __METHOD__));
|
||||
}
|
||||
|
||||
/** {@inheritdoc} */
|
||||
public function getId()
|
||||
{
|
||||
return $this->get_serialize_key();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $status
|
||||
*/
|
||||
/** {@inheritdoc} */
|
||||
public function setStatus($status)
|
||||
{
|
||||
$this->set_binary_status($status);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
/** {@inheritdoc} */
|
||||
public function getStatus()
|
||||
{
|
||||
return $this->get_status();
|
||||
|
3
resources/vagrant/vms/phraseanet-php54-nginx/puphpet/files/dot/ssh/.gitignore
vendored
Normal file
3
resources/vagrant/vms/phraseanet-php54-nginx/puphpet/files/dot/ssh/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
*
|
||||
!.gitignore
|
||||
!insecure_private_key
|
@@ -109,7 +109,7 @@
|
||||
<b>{{ name }}</b> : {{ value is iterable ? value|join('; ') : value }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% if technical_data|default(true) and app['authentication'].getUser() is not none and app['settings'].getUserSetting(app['authentication'].getUser(), 'technical_display') == 'group' %}
|
||||
{% if technical_data|default(true) and app['authentication'].user is not none and app['settings'].getUserSetting(app['authentication'].user, 'technical_display') == 'group' %}
|
||||
<hr/>
|
||||
{% include 'common/technical_datas.html.twig' %}
|
||||
{% endif %}
|
||||
|
@@ -1,16 +1,16 @@
|
||||
{% if record.isStory() %}
|
||||
{{ 'Story_id' | trans }} : {{ record.recordId() }}<br/>
|
||||
{% if record.isStory %}
|
||||
{{ 'Story_id' | trans }} : {{ record.recordId }}<br/>
|
||||
{% else %}
|
||||
{{ 'Record_id' | trans }} : {{ record.recordId() }}<br/>
|
||||
{{ 'Record_id' | trans }} : {{ record.recordId }}<br/>
|
||||
{% endif %}
|
||||
|
||||
{% if not record.isStory() %}
|
||||
{% if not record.isStory %}
|
||||
{% block td_original_name %}
|
||||
{{ 'Nom Original' | trans }} : {{ record.getOriginalName() }}
|
||||
{{ 'Nom Original' | trans }} : {{ record.getOriginalName }}
|
||||
{% endblock %}
|
||||
|
||||
{% block td_mime %}
|
||||
{{ record.getMimeType() }}
|
||||
{{ record.getMimeType }}
|
||||
{% endblock %}
|
||||
|
||||
{% block td_weight %}
|
||||
|
@@ -2,16 +2,13 @@
|
||||
{% import 'common/thumbnail.html.twig' as thumbnail_macro %}
|
||||
{% import 'common/doctype_icons.html.twig' as doctype_icons %}
|
||||
{% import 'common/drop_down_options.html.twig' as drop_down %}
|
||||
{% set th_size = app['settings'].getUserSetting(app['authentication'].getUser(), 'images_size')%}
|
||||
|
||||
{# @todo retrieve current position of record in result set #}
|
||||
{% set number = 1 %}
|
||||
{% set th_size = app['settings'].getUserSetting(app['authentication'].user, 'images_size')%}
|
||||
|
||||
{% if entry_id %}
|
||||
<div style="width:{{th_size+30}}px;" sbas="{{record.databoxId}}"
|
||||
id="{{ prefix|default('IMGT') }}_{{record.databoxId}}_{{record.recordId}}"
|
||||
class="IMGT diapo type-{{record.type}}"
|
||||
onDblClick="openPreview('FEED',{{number}},{{entry_id}});">
|
||||
onDblClick="openPreview('FEED',{{record.position}},{{entry_id}});">
|
||||
{% elseif record.story %}
|
||||
<div style="width:{{th_size+30}}px;" sbas="{{record.databoxId}}"
|
||||
id="{{ prefix|default('IMGT') }}_{{record.databoxId}}_{{record.recordId}}"
|
||||
@@ -21,12 +18,13 @@
|
||||
<div style="width:{{th_size+30}}px;" sbas="{{record.databoxId}}"
|
||||
id="{{ prefix|default('IMGT') }}_{{record.databoxId}}_{{record.recordId}}"
|
||||
class="IMGT diapo type-{{record.type}}"
|
||||
onDblClick="openPreview('RESULT',{{ number }});">
|
||||
onDblClick="openPreview('RESULT',{{record.position}});">
|
||||
{% endif %}
|
||||
<div style="padding: 4px;">
|
||||
<div style="height:40px; position: relative; z-index: 95;margin-bottom:0;border-bottom:none;">
|
||||
<div class="title" style="max-height:100%" title="{{ record.title|default(record.originalName) }}">
|
||||
{{ record.title|default(record.originalName) }}
|
||||
{# @todo title should be localized #}
|
||||
<div class="title" style="max-height:100%" title="{{ record.title }}">
|
||||
{{ record.title }}
|
||||
</div>
|
||||
<div class="status">
|
||||
{# @todo find a proper way to map lifted flag to status icon img path #}
|
||||
@@ -37,23 +35,23 @@
|
||||
{% set preview = record.subdefs.containsKey('preview') ? record.subdefs.get('preview') : null %}
|
||||
{% set rollover_thumbnail = record.subdefs.containsKey('thumbnailgif') ? record.subdefs.get('thumbnailgif') : null %}
|
||||
|
||||
{% set user_technical_display = app['settings'].getUserSetting(app['authentication'].getUser(), 'technical_display') %}
|
||||
{% set user_rollover_thumbnail = app['settings'].getUserSetting(app['authentication'].getUser(), 'rollover_thumbnail') %}
|
||||
{% set user_technical_display = app['settings'].getUserSetting(app['authentication'].user, 'technical_display') %}
|
||||
{% set user_rollover_thumbnail = app['settings'].getUserSetting(app['authentication'].user, 'rollover_thumbnail') %}
|
||||
|
||||
{% set extraclass = '' %}
|
||||
{% if user_rollover_thumbnail == 'caption' and searchEngine is not null %}
|
||||
{% set extraclass = extraclass ~ ' captionTips' %}
|
||||
{% set tooltipsrc = path('prod_tooltip_caption', { 'sbas_id' : record.databoxId, 'record_id' : record.recordId, 'context' : 'answer', 'number' : number }) %}
|
||||
{% set tooltip = path('prod_tooltip_caption', { 'sbas_id' : record.databoxId, 'record_id' : record.recordId, 'context' : 'answer', 'number' : record.position }) %}
|
||||
{% elseif user_rollover_thumbnail == 'caption' and searchEngine is null %}
|
||||
{% set extraclass = extraclass ~ ' captionTips' %}
|
||||
{% set tooltipsrc = path('prod_tooltip_caption', { 'sbas_id' : record.databoxId, 'record_id' : record.recordId, 'context' : 'publi' }) %}
|
||||
{% set tooltip = path('prod_tooltip_caption', { 'sbas_id' : record.databoxId, 'record_id' : record.recordId, 'context' : 'publi' }) %}
|
||||
{% elseif user_rollover_thumbnail == 'preview' %}
|
||||
{% set extraclass = extraclass ~ ' captionTips' %}
|
||||
{% set tooltipsrc = path('prod_tooltip_preview', { 'sbas_id' : record.databoxId, 'record_id' : record.recordId }) %}
|
||||
{% set tooltip = path('prod_tooltip_preview', { 'sbas_id' : record.databoxId, 'record_id' : record.recordId }) %}
|
||||
{% endif %}
|
||||
<div class="thumb {{extraclass}} " tooltipsrc="{{tooltipsrc}}" style="height:{{th_size}}px; z-index:90;">
|
||||
<div class="thumb {{extraclass}} " tooltipsrc="{{tooltip}}" style="height:{{th_size}}px; z-index:90;">
|
||||
<div class="doc_infos">
|
||||
{% if app['settings'].getUserSetting(app['authentication'].getUser(), 'doctype_display') == '1' %}
|
||||
{% if app['settings'].getUserSetting(app['authentication'].user, 'doctype_display') == '1' %}
|
||||
{{doctype_icons.format(record)}}
|
||||
{% endif %}
|
||||
<span class="duration">
|
||||
@@ -93,12 +91,11 @@
|
||||
{% endif %}
|
||||
<td style='text-align:right;width:{{l_width}}px;' valign='bottom'>
|
||||
{{drop_down.prod(record, entry_id)}}
|
||||
{# @todo acl methods should accept RecordInterface Object as parameter #}
|
||||
{#{% if preview and app['acl'].get(app['authentication'].getUser()).has_access_to_subdef(record, 'preview') %}#}
|
||||
{#<div tooltipsrc="{{ path('prod_tooltip_preview', { 'databoxId' : record.databoxId, 'recordId' : record.recordId }) }}" class="previewTips"></div>#}
|
||||
{#{% endif %}#}
|
||||
{% if if preview and app['acl'].get(app['authentication'].user).has_access_to_subdef(record, 'preview') %}
|
||||
<div tooltipsrc="{{ path('prod_tooltip_preview', { 'databoxId' : record.databoxId, 'recordId' : record.recordId }) }}" class="previewTips"></div>
|
||||
{% enif %}
|
||||
{% if user_rollover_thumbnail == 'preview' %}
|
||||
<div tooltipsrc="{{ path('prod_tooltip_caption', { 'sbas_id' : record.databoxId, 'record_id' : record.recordId, 'context' : 'answer', 'number' : record.get_number() }) }}" class="captionRolloverTips"></div>
|
||||
<div tooltipsrc="{{ path('prod_tooltip_caption', { 'sbas_id' : record.databoxId, 'record_id' : record.recordId, 'context' : 'answer', 'number' : record.position }) }}" class="captionRolloverTips"></div>
|
||||
{% endif %}
|
||||
{% if user_technical_display == '1' %}
|
||||
<img class="infoTips" tooltipsrc="{{ path('prod_tooltip_technical_data', { 'sbas_id' : record.databoxId, 'record_id' : record.recordId }) }}" src="/skins/icons/info.gif"/>
|
||||
|
@@ -0,0 +1,210 @@
|
||||
servername: 'http://local.phrasea/'
|
||||
languages:
|
||||
available: []
|
||||
default: 'fr'
|
||||
main:
|
||||
maintenance: false
|
||||
key: ''
|
||||
database:
|
||||
host: 'sql-host'
|
||||
port: 3306
|
||||
user: 'sql-user'
|
||||
password: 'sql-password'
|
||||
dbname: ab_phraseanet
|
||||
driver: pdo_mysql
|
||||
charset: UTF8
|
||||
database-test:
|
||||
driver: pdo_sqlite
|
||||
path: '/tmp/db.sqlite'
|
||||
charset: UTF8
|
||||
cache:
|
||||
type: MemcacheCache
|
||||
options:
|
||||
host: localhost
|
||||
port: 11211
|
||||
opcodecache:
|
||||
type: ArrayCache
|
||||
options: []
|
||||
search-engine:
|
||||
type: Alchemy\Phrasea\SearchEngine\Phrasea\PhraseaEngine
|
||||
options: []
|
||||
task-manager:
|
||||
status: started
|
||||
enabled: true
|
||||
logger:
|
||||
max-files: 10
|
||||
enabled: true
|
||||
level: INFO
|
||||
listener:
|
||||
protocol: tcp
|
||||
host: 127.0.0.1
|
||||
port: 6660
|
||||
linger: 500
|
||||
websocket-server:
|
||||
host: local.phrasea
|
||||
port: 9090
|
||||
ip: 0.0.0.0
|
||||
subscriber:
|
||||
protocol: tcp
|
||||
host: 127.0.0.1
|
||||
port: 13598
|
||||
session:
|
||||
type: 'file'
|
||||
options: []
|
||||
ttl: 86400
|
||||
binaries:
|
||||
ghostscript_binary: null
|
||||
php_binary: null
|
||||
swf_extract_binary: null
|
||||
pdf2swf_binary: null
|
||||
swf_render_binary: null
|
||||
unoconv_binary: null
|
||||
ffmpeg_binary: null
|
||||
ffprobe_binary: null
|
||||
mp4box_binary: null
|
||||
pdftotext_binary: null
|
||||
recess_binary: null
|
||||
phraseanet_indexer: null
|
||||
ffmpeg_timeout: 3600
|
||||
ffprobe_timeout: 60
|
||||
gs_timeout: 60
|
||||
mp4box_timeout: 60
|
||||
swftools_timeout: 60
|
||||
unoconv_timeout: 60
|
||||
storage:
|
||||
subdefs: null
|
||||
cache: null
|
||||
log : null
|
||||
download: null
|
||||
lazaret: null
|
||||
caption: null
|
||||
bridge:
|
||||
youtube:
|
||||
enabled: false
|
||||
client_id: null
|
||||
client_secret: null
|
||||
developer_key: null
|
||||
flickr:
|
||||
enabled: false
|
||||
client_id: null
|
||||
client_secret: null
|
||||
dailymotion:
|
||||
enabled: false
|
||||
client_id: null
|
||||
client_secret: null
|
||||
trusted-proxies: []
|
||||
debugger:
|
||||
allowed-ips: []
|
||||
border-manager:
|
||||
enabled: true
|
||||
extension-mapping: { }
|
||||
checkers:
|
||||
-
|
||||
type: Checker\Sha256
|
||||
enabled: true
|
||||
-
|
||||
type: Checker\UUID
|
||||
enabled: true
|
||||
-
|
||||
type: Checker\Colorspace
|
||||
enabled: false
|
||||
options:
|
||||
colorspaces: [cmyk, grayscale, rgb]
|
||||
-
|
||||
type: Checker\Dimension
|
||||
enabled: false
|
||||
options:
|
||||
width: 80
|
||||
height: 160
|
||||
-
|
||||
type: Checker\Extension
|
||||
enabled: false
|
||||
options:
|
||||
extensions: [jpg, jpeg, bmp, tif, gif, png, pdf, doc, odt, mpg, mpeg, mov, avi, xls, flv, mp3, mp2]
|
||||
-
|
||||
type: Checker\Filename
|
||||
enabled: false
|
||||
options:
|
||||
sensitive: true
|
||||
-
|
||||
type: Checker\MediaType
|
||||
enabled: false
|
||||
options:
|
||||
mediatypes: [Audio, Document, Flash, Image, Video]
|
||||
authentication:
|
||||
auto-create:
|
||||
templates: { }
|
||||
captcha:
|
||||
enabled: true
|
||||
trials-before-display: 9
|
||||
providers:
|
||||
facebook:
|
||||
enabled: false
|
||||
options:
|
||||
app-id: ''
|
||||
secret: ''
|
||||
twitter:
|
||||
enabled: false
|
||||
options:
|
||||
consumer-key: ''
|
||||
consumer-secret: ''
|
||||
google-plus:
|
||||
enabled: false
|
||||
options:
|
||||
client-id: ''
|
||||
client-secret: ''
|
||||
github:
|
||||
enabled: false
|
||||
options:
|
||||
client-id: ''
|
||||
client-secret: ''
|
||||
viadeo:
|
||||
enabled: false
|
||||
options:
|
||||
client-id: ''
|
||||
client-secret: ''
|
||||
linkedin:
|
||||
enabled: false
|
||||
options:
|
||||
client-id: ''
|
||||
client-secret: ''
|
||||
registration-fields:
|
||||
-
|
||||
name: company
|
||||
required: true
|
||||
-
|
||||
name: lastname
|
||||
required: true
|
||||
-
|
||||
name: firstname
|
||||
required: true
|
||||
-
|
||||
name: geonameid
|
||||
required: true
|
||||
xsendfile:
|
||||
enabled: false
|
||||
type: nginx
|
||||
mapping: []
|
||||
h264-pseudo-streaming:
|
||||
enabled: false
|
||||
type: nginx
|
||||
mapping: []
|
||||
plugins: []
|
||||
api_cors:
|
||||
enabled: false
|
||||
allow_credentials: false
|
||||
allow_origin: []
|
||||
allow_headers: []
|
||||
allow_methods: []
|
||||
expose_headers: []
|
||||
max_age: 0
|
||||
hosts: []
|
||||
session:
|
||||
idle: 0
|
||||
# 1 week
|
||||
lifetime: 604800
|
||||
crossdomain:
|
||||
allow-access-from:
|
||||
-
|
||||
domain: '*.cooliris.com'
|
||||
secure: 'false'
|
Reference in New Issue
Block a user