Initial Upload
This commit is contained in:
75
lib/Xmds/Entity/Dependency.php
Normal file
75
lib/Xmds/Entity/Dependency.php
Normal file
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2023 Xibo Signage Ltd
|
||||
*
|
||||
* Xibo - Digital Signage - https://xibosignage.com
|
||||
*
|
||||
* This file is part of Xibo.
|
||||
*
|
||||
* Xibo is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* any later version.
|
||||
*
|
||||
* Xibo is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Xibo. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace Xibo\Xmds\Entity;
|
||||
|
||||
/**
|
||||
* XMDS Depedency
|
||||
* represents a player dependency
|
||||
*/
|
||||
class Dependency
|
||||
{
|
||||
const LEGACY_ID_OFFSET_FONT = 100000000;
|
||||
const LEGACY_ID_OFFSET_PLAYER_SOFTWARE = 200000000;
|
||||
const LEGACY_ID_OFFSET_ASSET = 300000000;
|
||||
const LEGACY_ID_OFFSET_DATA_CONNECTOR = 400000000;
|
||||
|
||||
public $fileType;
|
||||
public $legacyId;
|
||||
public $id;
|
||||
public $path;
|
||||
public $size;
|
||||
public $md5;
|
||||
public $isAvailableOverHttp;
|
||||
|
||||
/**
|
||||
* Prior versions of XMDS need to use a legacyId to download the file via GetFile.
|
||||
* This is a negative number in a range (to avoid collisions with existing IDs). Each dependency type should
|
||||
* resolve to a different negative number range.
|
||||
* The "real id" set on $this->id is saved in required files as the realId and used to resolve requests for this
|
||||
* type of file.
|
||||
* @param string $fileType
|
||||
* @param string|int $id
|
||||
* @param int $legacyId
|
||||
* @param string $path
|
||||
* @param int $size
|
||||
* @param string $md5
|
||||
* @param bool $isAvailableOverHttp
|
||||
*/
|
||||
public function __construct(
|
||||
string $fileType,
|
||||
$id,
|
||||
int $legacyId,
|
||||
string $path,
|
||||
int $size,
|
||||
string $md5,
|
||||
bool $isAvailableOverHttp = true
|
||||
) {
|
||||
$this->fileType = $fileType;
|
||||
$this->id = $id;
|
||||
$this->legacyId = $legacyId;
|
||||
$this->path = $path;
|
||||
$this->size = $size;
|
||||
$this->md5 = $md5;
|
||||
$this->isAvailableOverHttp = $isAvailableOverHttp;
|
||||
}
|
||||
}
|
||||
82
lib/Xmds/Listeners/XmdsAssetsListener.php
Normal file
82
lib/Xmds/Listeners/XmdsAssetsListener.php
Normal file
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2023 Xibo Signage Ltd
|
||||
*
|
||||
* Xibo - Digital Signage - https://xibosignage.com
|
||||
*
|
||||
* This file is part of Xibo.
|
||||
*
|
||||
* Xibo is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* any later version.
|
||||
*
|
||||
* Xibo is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Xibo. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace Xibo\Xmds\Listeners;
|
||||
|
||||
use Xibo\Event\XmdsDependencyRequestEvent;
|
||||
use Xibo\Factory\ModuleFactory;
|
||||
use Xibo\Factory\ModuleTemplateFactory;
|
||||
use Xibo\Listener\ListenerConfigTrait;
|
||||
use Xibo\Listener\ListenerLoggerTrait;
|
||||
use Xibo\Support\Exception\NotFoundException;
|
||||
|
||||
/**
|
||||
* Listener which handles requests for assets.
|
||||
*/
|
||||
class XmdsAssetsListener
|
||||
{
|
||||
use ListenerLoggerTrait;
|
||||
use ListenerConfigTrait;
|
||||
|
||||
/** @var \Xibo\Factory\ModuleFactory */
|
||||
private $moduleFactory;
|
||||
|
||||
/** @var \Xibo\Factory\ModuleTemplateFactory */
|
||||
private $moduleTemplateFactory;
|
||||
|
||||
/**
|
||||
* @param \Xibo\Factory\ModuleFactory $moduleFactory
|
||||
* @param \Xibo\Factory\ModuleTemplateFactory $moduleTemplateFactory
|
||||
*/
|
||||
public function __construct(ModuleFactory $moduleFactory, ModuleTemplateFactory $moduleTemplateFactory)
|
||||
{
|
||||
$this->moduleFactory = $moduleFactory;
|
||||
$this->moduleTemplateFactory = $moduleTemplateFactory;
|
||||
}
|
||||
|
||||
public function onDependencyRequest(XmdsDependencyRequestEvent $event): void
|
||||
{
|
||||
$this->getLogger()->debug('onDependencyRequest: XmdsAssetsListener');
|
||||
|
||||
if ($event->getFileType() === 'asset') {
|
||||
// Get the asset using only the assetId.
|
||||
try {
|
||||
$asset = $this->moduleFactory
|
||||
->getAssetsFromAnywhereById($event->getRealId(), $this->moduleTemplateFactory);
|
||||
|
||||
if ($asset->isSendToPlayer()) {
|
||||
// Make sure the asset cache is there
|
||||
$asset->updateAssetCache($this->getConfig()->getSetting('LIBRARY_LOCATION'));
|
||||
|
||||
// Return the full path to this asset
|
||||
$event->setRelativePathToLibrary('assets/' . $asset->getFilename());
|
||||
$event->stopPropagation();
|
||||
} else {
|
||||
$this->getLogger()->debug('onDependencyRequest: asset found but is cms only');
|
||||
}
|
||||
} catch (NotFoundException $notFoundException) {
|
||||
$this->getLogger()->info('onDependencyRequest: No asset found for assetId: '
|
||||
. $event->getRealId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
76
lib/Xmds/Listeners/XmdsDataConnectorListener.php
Normal file
76
lib/Xmds/Listeners/XmdsDataConnectorListener.php
Normal file
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2023 Xibo Signage Ltd
|
||||
*
|
||||
* Xibo - Digital Signage - https://xibosignage.com
|
||||
*
|
||||
* This file is part of Xibo.
|
||||
*
|
||||
* Xibo is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* any later version.
|
||||
*
|
||||
* Xibo is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Xibo. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace Xibo\Xmds\Listeners;
|
||||
|
||||
use Xibo\Event\XmdsDependencyRequestEvent;
|
||||
use Xibo\Listener\ListenerConfigTrait;
|
||||
use Xibo\Listener\ListenerLoggerTrait;
|
||||
use Xibo\Support\Exception\NotFoundException;
|
||||
use Xibo\Xmds\Entity\Dependency;
|
||||
|
||||
/**
|
||||
* Listener to handle dependency requests for data connectors.
|
||||
*/
|
||||
class XmdsDataConnectorListener
|
||||
{
|
||||
use ListenerLoggerTrait;
|
||||
use ListenerConfigTrait;
|
||||
|
||||
public function onDependencyRequest(XmdsDependencyRequestEvent $event)
|
||||
{
|
||||
// Can we return this type of file?
|
||||
if ($event->getFileType() === 'data_connector') {
|
||||
// Set the path
|
||||
$event->setRelativePathToLibrary('data_connectors/dataSet_' . $event->getRealId() . '.js');
|
||||
|
||||
// No need to carry on, we've found it.
|
||||
$event->stopPropagation();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws NotFoundException
|
||||
*/
|
||||
public static function getDataConnectorDependency(string $libraryLocation, int $dataSetId): Dependency
|
||||
{
|
||||
// Check that this asset is valid.
|
||||
$path = $libraryLocation
|
||||
. 'data_connectors' . DIRECTORY_SEPARATOR
|
||||
. 'dataSet_' . $dataSetId . '.js';
|
||||
|
||||
if (!file_exists($path)) {
|
||||
throw new NotFoundException(sprintf(__('Data Connector %s not found'), $path));
|
||||
}
|
||||
|
||||
// Return a dependency
|
||||
return new Dependency(
|
||||
'data_connector',
|
||||
$dataSetId,
|
||||
(Dependency::LEGACY_ID_OFFSET_DATA_CONNECTOR + $dataSetId) * -1,
|
||||
$path,
|
||||
filesize($path),
|
||||
file_get_contents($path . '.md5'),
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
93
lib/Xmds/Listeners/XmdsFontsListener.php
Normal file
93
lib/Xmds/Listeners/XmdsFontsListener.php
Normal file
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2023 Xibo Signage Ltd
|
||||
*
|
||||
* Xibo - Digital Signage - https://xibosignage.com
|
||||
*
|
||||
* This file is part of Xibo.
|
||||
*
|
||||
* Xibo is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* any later version.
|
||||
*
|
||||
* Xibo is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Xibo. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace Xibo\Xmds\Listeners;
|
||||
|
||||
use Xibo\Event\XmdsDependencyListEvent;
|
||||
use Xibo\Event\XmdsDependencyRequestEvent;
|
||||
use Xibo\Factory\FontFactory;
|
||||
use Xibo\Listener\ListenerConfigTrait;
|
||||
use Xibo\Listener\ListenerLoggerTrait;
|
||||
use Xibo\Xmds\Entity\Dependency;
|
||||
|
||||
/**
|
||||
* A listener to supply fonts as dependencies to players.
|
||||
*/
|
||||
class XmdsFontsListener
|
||||
{
|
||||
use ListenerLoggerTrait;
|
||||
use ListenerConfigTrait;
|
||||
|
||||
use XmdsListenerTrait;
|
||||
|
||||
/**
|
||||
* @var FontFactory
|
||||
*/
|
||||
private $fontFactory;
|
||||
|
||||
public function __construct(FontFactory $fontFactory)
|
||||
{
|
||||
$this->fontFactory = $fontFactory;
|
||||
}
|
||||
|
||||
public function onDependencyList(XmdsDependencyListEvent $event): void
|
||||
{
|
||||
$this->getLogger()->debug('onDependencyList: XmdsFontsListener');
|
||||
|
||||
foreach ($this->fontFactory->query() as $font) {
|
||||
$event->addDependency(
|
||||
'font',
|
||||
$font->id,
|
||||
'fonts/' . $font->fileName,
|
||||
$font->size,
|
||||
$font->md5,
|
||||
true,
|
||||
$this->getLegacyId($font->id, Dependency::LEGACY_ID_OFFSET_FONT)
|
||||
);
|
||||
}
|
||||
|
||||
// Always add fonts.css to the list.
|
||||
// This can have the ID of 1 because it is a different file type and will therefore be unique.
|
||||
$fontsCssPath = $this->getConfig()->getSetting('LIBRARY_LOCATION') . 'fonts/fonts.css';
|
||||
$event->addDependency(
|
||||
'fontCss',
|
||||
1,
|
||||
'fonts/fonts.css',
|
||||
filesize($fontsCssPath),
|
||||
md5_file($fontsCssPath),
|
||||
true,
|
||||
$this->getLegacyId(0, Dependency::LEGACY_ID_OFFSET_FONT)
|
||||
);
|
||||
}
|
||||
|
||||
public function onDependencyRequest(XmdsDependencyRequestEvent $event): void
|
||||
{
|
||||
$this->getLogger()->debug('onDependencyRequest: XmdsFontsListener');
|
||||
|
||||
if ($event->getFileType() === 'font') {
|
||||
$font = $this->fontFactory->getById($event->getRealId());
|
||||
$event->setRelativePathToLibrary('fonts/' . $font->fileName);
|
||||
} else if ($event->getFileType() === 'fontCss') {
|
||||
$event->setRelativePathToLibrary('fonts/fonts.css');
|
||||
}
|
||||
}
|
||||
}
|
||||
40
lib/Xmds/Listeners/XmdsListenerTrait.php
Normal file
40
lib/Xmds/Listeners/XmdsListenerTrait.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2023 Xibo Signage Ltd
|
||||
*
|
||||
* Xibo - Digital Signage - https://xibosignage.com
|
||||
*
|
||||
* This file is part of Xibo.
|
||||
*
|
||||
* Xibo is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* any later version.
|
||||
*
|
||||
* Xibo is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Xibo. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace Xibo\Xmds\Listeners;
|
||||
|
||||
/**
|
||||
* A trait added to all Xmds Listeners
|
||||
*/
|
||||
trait XmdsListenerTrait
|
||||
{
|
||||
/**
|
||||
* Get a Legacy ID we can use for older XMDS schema versions
|
||||
* @param int $id
|
||||
* @param int $offset
|
||||
* @return int
|
||||
*/
|
||||
private function getLegacyId(int $id, int $offset): int
|
||||
{
|
||||
return ($id + $offset) * -1;
|
||||
}
|
||||
}
|
||||
88
lib/Xmds/Listeners/XmdsPlayerBundleListener.php
Normal file
88
lib/Xmds/Listeners/XmdsPlayerBundleListener.php
Normal file
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2023 Xibo Signage Ltd
|
||||
*
|
||||
* Xibo - Digital Signage - https://xibosignage.com
|
||||
*
|
||||
* This file is part of Xibo.
|
||||
*
|
||||
* Xibo is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* any later version.
|
||||
*
|
||||
* Xibo is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Xibo. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace Xibo\Xmds\Listeners;
|
||||
|
||||
use Xibo\Event\XmdsDependencyListEvent;
|
||||
use Xibo\Event\XmdsDependencyRequestEvent;
|
||||
use Xibo\Listener\ListenerCacheTrait;
|
||||
use Xibo\Listener\ListenerConfigTrait;
|
||||
use Xibo\Listener\ListenerLoggerTrait;
|
||||
use Xibo\Support\Exception\GeneralException;
|
||||
|
||||
/**
|
||||
* XMDS player bundle listener
|
||||
* responsible for adding the player bundle to the list of required files, and for returning the player bundle
|
||||
* when requested.
|
||||
*/
|
||||
class XmdsPlayerBundleListener
|
||||
{
|
||||
use ListenerLoggerTrait;
|
||||
use ListenerConfigTrait;
|
||||
|
||||
public function onDependencyList(XmdsDependencyListEvent $event)
|
||||
{
|
||||
$this->getLogger()->debug('onDependencyList: XmdsPlayerBundleListener');
|
||||
|
||||
// Output the player bundle
|
||||
$forceUpdate = false;
|
||||
$bundlePath = $this->getConfig()->getSetting('LIBRARY_LOCATION') . 'assets/bundle.min.js';
|
||||
if (!file_exists($bundlePath)) {
|
||||
$result = @copy(PROJECT_ROOT . '/modules/bundle.min.js', $bundlePath);
|
||||
if (!$result) {
|
||||
throw new GeneralException('Unable to copy asset');
|
||||
}
|
||||
$forceUpdate = true;
|
||||
}
|
||||
|
||||
// Get the bundle MD5
|
||||
$bundleMd5CachePath = $bundlePath . '.md5';
|
||||
if (!file_exists($bundleMd5CachePath) || $forceUpdate) {
|
||||
$bundleMd5 = md5_file($bundlePath);
|
||||
file_put_contents($bundleMd5CachePath, $bundleMd5);
|
||||
} else {
|
||||
$bundleMd5 = file_get_contents($bundlePath . '.md5');
|
||||
}
|
||||
|
||||
$event->addDependency(
|
||||
'bundle',
|
||||
1,
|
||||
'assets/bundle.min.js',
|
||||
filesize($bundlePath),
|
||||
$bundleMd5,
|
||||
true,
|
||||
-1
|
||||
);
|
||||
}
|
||||
|
||||
public function onDependencyRequest(XmdsDependencyRequestEvent $event)
|
||||
{
|
||||
// Can we return this type of file?
|
||||
if ($event->getFileType() === 'bundle' && $event->getRealId() == 1) {
|
||||
// Set the path
|
||||
$event->setRelativePathToLibrary('assets/bundle.min.js');
|
||||
|
||||
// No need to carry on, we've found it.
|
||||
$event->stopPropagation();
|
||||
}
|
||||
}
|
||||
}
|
||||
95
lib/Xmds/Listeners/XmdsPlayerVersionListener.php
Normal file
95
lib/Xmds/Listeners/XmdsPlayerVersionListener.php
Normal file
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2023 Xibo Signage Ltd
|
||||
*
|
||||
* Xibo - Digital Signage - https://xibosignage.com
|
||||
*
|
||||
* This file is part of Xibo.
|
||||
*
|
||||
* Xibo is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* any later version.
|
||||
*
|
||||
* Xibo is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Xibo. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace Xibo\Xmds\Listeners;
|
||||
|
||||
use Xibo\Event\XmdsDependencyListEvent;
|
||||
use Xibo\Event\XmdsDependencyRequestEvent;
|
||||
use Xibo\Factory\PlayerVersionFactory;
|
||||
use Xibo\Listener\ListenerLoggerTrait;
|
||||
use Xibo\Support\Exception\NotFoundException;
|
||||
use Xibo\Xmds\Entity\Dependency;
|
||||
|
||||
/**
|
||||
* A listener to supply player version files to players
|
||||
*/
|
||||
class XmdsPlayerVersionListener
|
||||
{
|
||||
use ListenerLoggerTrait;
|
||||
|
||||
use XmdsListenerTrait;
|
||||
|
||||
/**
|
||||
* @var PlayerVersionFactory
|
||||
*/
|
||||
private $playerVersionFactory;
|
||||
|
||||
public function __construct(PlayerVersionFactory $playerVersionFactory)
|
||||
{
|
||||
$this->playerVersionFactory = $playerVersionFactory;
|
||||
}
|
||||
|
||||
public function onDependencyList(XmdsDependencyListEvent $event): void
|
||||
{
|
||||
$this->getLogger()->debug('onDependencyList: XmdsPlayerVersionListener');
|
||||
|
||||
// We do not supply a dependency to SSSP players.
|
||||
if ($event->getDisplay()->clientType === 'sssp') {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
$playerVersionMediaId = $event->getDisplay()
|
||||
->getSetting('versionMediaId', null, ['displayOverride' => true]);
|
||||
|
||||
// If it isn't set, then we have nothing to do.
|
||||
if (empty($playerVersionMediaId)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$version = $this->playerVersionFactory->getById($playerVersionMediaId);
|
||||
$event->addDependency(
|
||||
'playersoftware',
|
||||
$version->versionId,
|
||||
'playersoftware/' . $version->fileName,
|
||||
$version->size,
|
||||
$version->md5,
|
||||
true,
|
||||
$this->getLegacyId($playerVersionMediaId, Dependency::LEGACY_ID_OFFSET_PLAYER_SOFTWARE)
|
||||
);
|
||||
} catch (NotFoundException $notFoundException) {
|
||||
// Ignore this
|
||||
$this->getLogger()->error('onDependencyList: player version not found for displayId '
|
||||
. $event->getDisplay()->displayId);
|
||||
}
|
||||
}
|
||||
|
||||
public function onDependencyRequest(XmdsDependencyRequestEvent $event)
|
||||
{
|
||||
$this->getLogger()->debug('onDependencyRequest: XmdsPlayerVersionListener');
|
||||
|
||||
if ($event->getFileType() === 'playersoftware') {
|
||||
$version = $this->playerVersionFactory->getById($event->getRealId());
|
||||
$event->setRelativePathToLibrary('playersoftware/' . $version->fileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
120
lib/Xmds/LogProcessor.php
Normal file
120
lib/Xmds/LogProcessor.php
Normal file
@@ -0,0 +1,120 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2024 Xibo Signage Ltd
|
||||
*
|
||||
* Xibo - Digital Signage - https://xibosignage.com
|
||||
*
|
||||
* This file is part of Xibo.
|
||||
*
|
||||
* Xibo is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* any later version.
|
||||
*
|
||||
* Xibo is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Xibo. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
namespace Xibo\Xmds;
|
||||
|
||||
use Monolog\Logger;
|
||||
use Xibo\Helper\DatabaseLogHandler;
|
||||
|
||||
/**
|
||||
* Class LogProcessor
|
||||
* @package Xibo\Xmds
|
||||
*/
|
||||
class LogProcessor
|
||||
{
|
||||
/** @var Logger */
|
||||
private $log;
|
||||
private $displayId;
|
||||
private $route;
|
||||
private $method;
|
||||
private $uid;
|
||||
|
||||
/**
|
||||
* Log Processor
|
||||
* @param Logger $log
|
||||
* @param $uid
|
||||
* @param string $method
|
||||
*/
|
||||
public function __construct($log, $uid, $method = 'POST')
|
||||
{
|
||||
$this->log = $log;
|
||||
$this->uid = $uid;
|
||||
$this->method = $method;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $route
|
||||
*/
|
||||
public function setRoute($route)
|
||||
{
|
||||
$this->route = $route;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $displayId
|
||||
* @param bool $isAuditing
|
||||
*/
|
||||
public function setDisplay($displayId, $isAuditing)
|
||||
{
|
||||
if ($isAuditing) {
|
||||
foreach ($this->log->getHandlers() as $handler) {
|
||||
if ($handler instanceof DatabaseLogHandler) {
|
||||
$handler->setLevel(\Xibo\Service\LogService::resolveLogLevel('debug'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->displayId = $displayId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Log Level
|
||||
* @return int
|
||||
*/
|
||||
public function getLevel()
|
||||
{
|
||||
$level = Logger::ERROR;
|
||||
|
||||
foreach ($this->log->getHandlers() as $handler) {
|
||||
if ($handler instanceof DatabaseLogHandler) {
|
||||
$level = $handler->getLevel();
|
||||
} else {
|
||||
$this->log->error('Log level not set in DatabaseLogHandler');
|
||||
}
|
||||
}
|
||||
|
||||
return $level;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get UID
|
||||
* @return string
|
||||
*/
|
||||
public function getUid()
|
||||
{
|
||||
return $this->uid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $record
|
||||
* @return array
|
||||
*/
|
||||
public function __invoke(array $record)
|
||||
{
|
||||
$record['extra']['displayId'] = $this->displayId;
|
||||
$record['extra']['route'] = $this->route;
|
||||
$record['extra']['method'] = $this->method;
|
||||
|
||||
return $record;
|
||||
}
|
||||
}
|
||||
3138
lib/Xmds/Soap.php
Normal file
3138
lib/Xmds/Soap.php
Normal file
File diff suppressed because it is too large
Load Diff
364
lib/Xmds/Soap3.php
Normal file
364
lib/Xmds/Soap3.php
Normal file
@@ -0,0 +1,364 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2025 Xibo Signage Ltd
|
||||
*
|
||||
* Xibo - Digital Signage - https://xibosignage.com
|
||||
*
|
||||
* This file is part of Xibo.
|
||||
*
|
||||
* Xibo is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* any later version.
|
||||
*
|
||||
* Xibo is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Xibo. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
namespace Xibo\Xmds;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Xibo\Entity\Bandwidth;
|
||||
use Xibo\Event\XmdsDependencyRequestEvent;
|
||||
use Xibo\Support\Exception\NotFoundException;
|
||||
|
||||
/**
|
||||
* Class Soap3
|
||||
* @package Xibo\Xmds
|
||||
* @phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
|
||||
*/
|
||||
class Soap3 extends Soap
|
||||
{
|
||||
/**
|
||||
* Registers a new display
|
||||
* @param string $serverKey
|
||||
* @param string $hardwareKey
|
||||
* @param string $displayName
|
||||
* @param string $version
|
||||
* @return string
|
||||
* @throws \SoapFault
|
||||
* @throws \Xibo\Support\Exception\GeneralException
|
||||
*/
|
||||
public function RegisterDisplay($serverKey, $hardwareKey, $displayName, $version)
|
||||
{
|
||||
$this->logProcessor->setRoute('RegisterDisplay');
|
||||
|
||||
// Sanitize
|
||||
$sanitizer = $this->getSanitizer([
|
||||
'serverKey' => $serverKey,
|
||||
'hardwareKey' => $hardwareKey
|
||||
]);
|
||||
|
||||
$serverKey = $sanitizer->getString('serverKey');
|
||||
$hardwareKey = $sanitizer->getString('hardwareKey');
|
||||
|
||||
// Check the serverKey matches the one we have
|
||||
if ($serverKey != $this->getConfig()->getSetting('SERVER_KEY'))
|
||||
throw new \SoapFault('Sender', 'The Server key you entered does not match with the server key at this address');
|
||||
|
||||
// Check the Length of the hardwareKey
|
||||
if (strlen($hardwareKey) > 40)
|
||||
throw new \SoapFault('Sender', 'The Hardware Key you sent was too long. Only 40 characters are allowed (SHA1).');
|
||||
|
||||
// Check in the database for this hardwareKey
|
||||
try {
|
||||
$display = $this->displayFactory->getByLicence($hardwareKey);
|
||||
|
||||
if (!$display->isDisplaySlotAvailable()) {
|
||||
$display->licensed = 0;
|
||||
}
|
||||
|
||||
$this->logProcessor->setDisplay($display->displayId, $display->isAuditing());
|
||||
|
||||
if ($display->licensed == 0) {
|
||||
$active = 'Display is awaiting licensing approval from an Administrator.';
|
||||
} else {
|
||||
$active = 'Display is active and ready to start.';
|
||||
}
|
||||
|
||||
// Touch
|
||||
$display->lastAccessed = Carbon::now()->format('U');
|
||||
$display->loggedIn = 1;
|
||||
$display->save(['validate' => false, 'audit' => false]);
|
||||
|
||||
// Log Bandwidth
|
||||
$this->logBandwidth($display->displayId, Bandwidth::$REGISTER, strlen($active));
|
||||
|
||||
$this->getLog()->debug($active, $display->displayId);
|
||||
|
||||
return $active;
|
||||
} catch (NotFoundException $e) {
|
||||
$this->getLog()->error('Attempt to register a Version 3 Display with key %s.', $hardwareKey);
|
||||
|
||||
throw new \SoapFault('Sender', 'You cannot register an old display against this CMS.');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string containing the required files xml for the requesting display
|
||||
* @param string $serverKey
|
||||
* @param string $hardwareKey Display Hardware Key
|
||||
* @param string $version
|
||||
* @return string $requiredXml Xml Formatted
|
||||
* @throws NotFoundException
|
||||
* @throws \SoapFault
|
||||
*/
|
||||
function RequiredFiles($serverKey, $hardwareKey, $version)
|
||||
{
|
||||
return $this->doRequiredFiles($serverKey, $hardwareKey, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get File
|
||||
* @param string $serverKey The ServerKey for this CMS
|
||||
* @param string $hardwareKey The HardwareKey for this Display
|
||||
* @param string $filePath
|
||||
* @param string $fileType The File Type
|
||||
* @param int $chunkOffset The Offset of the Chunk Requested
|
||||
* @param string $chunkSize The Size of the Chunk Requested
|
||||
* @param string $version
|
||||
* @return string
|
||||
* @throws NotFoundException
|
||||
* @throws \SoapFault
|
||||
* @throws \Xibo\Support\Exception\GeneralException
|
||||
* @throws \Xibo\Support\Exception\InvalidArgumentException
|
||||
*/
|
||||
public function GetFile($serverKey, $hardwareKey, $filePath, $fileType, $chunkOffset, $chunkSize, $version)
|
||||
{
|
||||
$this->logProcessor->setRoute('GetFile');
|
||||
|
||||
// Sanitize
|
||||
$sanitizer = $this->getSanitizer([
|
||||
'serverKey' => $serverKey,
|
||||
'hardwareKey' => $hardwareKey,
|
||||
'filePath' => $filePath,
|
||||
'fileType' => $fileType,
|
||||
'chunkOffset' => $chunkOffset,
|
||||
'chunkSize' => $chunkSize
|
||||
]);
|
||||
|
||||
$serverKey = $sanitizer->getString('serverKey');
|
||||
$hardwareKey = $sanitizer->getString('hardwareKey');
|
||||
$filePath = $sanitizer->getString('filePath');
|
||||
$fileType = $sanitizer->getString('fileType');
|
||||
$chunkOffset = $sanitizer->getDouble('chunkOffset');
|
||||
$chunkSize = $sanitizer->getDouble('chunkSize');
|
||||
|
||||
$libraryLocation = $this->getConfig()->getSetting('LIBRARY_LOCATION');
|
||||
|
||||
// Check the serverKey matches
|
||||
if ($serverKey != $this->getConfig()->getSetting('SERVER_KEY')) {
|
||||
throw new \SoapFault(
|
||||
'Sender',
|
||||
'The Server key you entered does not match with the server key at this address'
|
||||
);
|
||||
}
|
||||
|
||||
// Authenticate this request...
|
||||
if (!$this->authDisplay($hardwareKey)) {
|
||||
throw new \SoapFault('Receiver', 'This Display is not authorised.');
|
||||
}
|
||||
|
||||
// Now that we authenticated the Display, make sure we are sticking to our bandwidth limit
|
||||
if (!$this->checkBandwidth($this->display->displayId)) {
|
||||
throw new \SoapFault('Receiver', 'Bandwidth Limit exceeded');
|
||||
}
|
||||
|
||||
$this->getLog()->debug(
|
||||
'[IN] Params: ['. $hardwareKey .'] ['. $filePath . ']
|
||||
['. $fileType.'] ['.$chunkOffset.'] ['.$chunkSize.']'
|
||||
);
|
||||
|
||||
$file = null;
|
||||
|
||||
if (empty($filePath)) {
|
||||
$this->getLog()->error('Soap3 GetFile request without a file path. Maybe a player missing ?v= parameter');
|
||||
throw new \SoapFault(
|
||||
'Receiver',
|
||||
'GetFile request is missing file path - is this version compatible with this CMS?'
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
// Handle fetching the file
|
||||
if ($fileType == 'layout') {
|
||||
$fileId = (int) $filePath;
|
||||
|
||||
// Validate the nonce
|
||||
$requiredFile = $this->requiredFileFactory->getByDisplayAndLayout($this->display->displayId, $fileId);
|
||||
|
||||
// Load the layout
|
||||
$layout = $this->layoutFactory->concurrentRequestLock($this->layoutFactory->getById($fileId));
|
||||
try {
|
||||
$path = $layout->xlfToDisk();
|
||||
} finally {
|
||||
$this->layoutFactory->concurrentRequestRelease($layout);
|
||||
}
|
||||
|
||||
$file = file_get_contents($path);
|
||||
$chunkSize = filesize($path);
|
||||
|
||||
$requiredFile->bytesRequested = $requiredFile->bytesRequested + $chunkSize;
|
||||
$requiredFile->save();
|
||||
} else if ($fileType == 'media') {
|
||||
// Get the ID
|
||||
if (strstr($filePath, '/') || strstr($filePath, '\\')) {
|
||||
throw new NotFoundException('Invalid file path.');
|
||||
}
|
||||
|
||||
$fileId = explode('.', $filePath);
|
||||
|
||||
if (is_numeric($fileId)) {
|
||||
// Validate the nonce
|
||||
$requiredFile = $this->requiredFileFactory->getByDisplayAndMedia(
|
||||
$this->display->displayId,
|
||||
$fileId[0]
|
||||
);
|
||||
|
||||
// Return the Chunk size specified
|
||||
$f = fopen($libraryLocation . $filePath, 'r');
|
||||
} else {
|
||||
// Non-numeric, so assume we're a dependency
|
||||
$this->getLog()->debug('Assumed dependency with path: ' . $filePath);
|
||||
|
||||
$requiredFile = $this->requiredFileFactory->getByDisplayAndDependencyPath(
|
||||
$this->display->displayId,
|
||||
$filePath
|
||||
);
|
||||
|
||||
$event = new XmdsDependencyRequestEvent($requiredFile);
|
||||
$this->getDispatcher()->dispatch($event, 'xmds.dependency.request');
|
||||
|
||||
// Get the path
|
||||
$path = $event->getRelativePath();
|
||||
if (empty($path)) {
|
||||
throw new NotFoundException(__('File not found'));
|
||||
}
|
||||
|
||||
$path = $libraryLocation . $path;
|
||||
|
||||
$f = fopen($path, 'r');
|
||||
}
|
||||
|
||||
fseek($f, $chunkOffset);
|
||||
|
||||
$file = fread($f, $chunkSize);
|
||||
|
||||
// Store file size for bandwidth log
|
||||
$chunkSize = strlen($file);
|
||||
|
||||
$requiredFile->bytesRequested = $requiredFile->bytesRequested + $chunkSize;
|
||||
$requiredFile->save();
|
||||
|
||||
} else {
|
||||
throw new NotFoundException(__('Unknown FileType Requested.'));
|
||||
}
|
||||
}
|
||||
catch (NotFoundException $e) {
|
||||
$this->getLog()->error($e->getMessage());
|
||||
throw new \SoapFault('Receiver', 'Requested an invalid file.');
|
||||
}
|
||||
|
||||
// Log Bandwidth
|
||||
$this->logBandwidth($this->display->displayId, Bandwidth::$GETFILE, $chunkSize);
|
||||
|
||||
return $file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the schedule for the hardware key specified
|
||||
* @param string $serverKey
|
||||
* @param string $hardwareKey
|
||||
* @param string $version
|
||||
* @return string
|
||||
* @throws NotFoundException
|
||||
* @throws \SoapFault
|
||||
*/
|
||||
function Schedule($serverKey, $hardwareKey, $version)
|
||||
{
|
||||
return $this->doSchedule($serverKey, $hardwareKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* BlackList
|
||||
* @param string $serverKey
|
||||
* @param string $hardwareKey
|
||||
* @param string $mediaId
|
||||
* @param string $type
|
||||
* @param string $reason
|
||||
* @param string $version
|
||||
* @return bool
|
||||
* @throws NotFoundException
|
||||
* @throws \SoapFault
|
||||
*/
|
||||
function BlackList($serverKey, $hardwareKey, $mediaId, $type, $reason, $version)
|
||||
{
|
||||
return $this->doBlackList($serverKey, $hardwareKey, $mediaId, $type, $reason);
|
||||
}
|
||||
|
||||
/**
|
||||
* Submit client logging
|
||||
* @param string $version
|
||||
* @param string $serverKey
|
||||
* @param string $hardwareKey
|
||||
* @param string $logXml
|
||||
* @return bool
|
||||
* @throws NotFoundException
|
||||
* @throws \SoapFault
|
||||
*/
|
||||
function SubmitLog($version, $serverKey, $hardwareKey, $logXml)
|
||||
{
|
||||
return $this->doSubmitLog($serverKey, $hardwareKey, $logXml);
|
||||
}
|
||||
|
||||
/**
|
||||
* Submit display statistics to the server
|
||||
* @param string $version
|
||||
* @param string $serverKey
|
||||
* @param string $hardwareKey
|
||||
* @param string $statXml
|
||||
* @return bool
|
||||
* @throws NotFoundException
|
||||
* @throws \SoapFault
|
||||
*/
|
||||
function SubmitStats($version, $serverKey, $hardwareKey, $statXml)
|
||||
{
|
||||
return $this->doSubmitStats($serverKey, $hardwareKey, $statXml);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store the media inventory for a client
|
||||
* @param string $version
|
||||
* @param string $serverKey
|
||||
* @param string $hardwareKey
|
||||
* @param string $inventory
|
||||
* @return bool
|
||||
* @throws NotFoundException
|
||||
* @throws \SoapFault
|
||||
*/
|
||||
public function MediaInventory($version, $serverKey, $hardwareKey, $inventory)
|
||||
{
|
||||
return $this->doMediaInventory($serverKey, $hardwareKey, $inventory);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets additional resources for assigned media
|
||||
* @param string $serverKey
|
||||
* @param string $hardwareKey
|
||||
* @param int $layoutId
|
||||
* @param string $regionId
|
||||
* @param string $mediaId
|
||||
* @param string $version
|
||||
* @return string
|
||||
* @throws NotFoundException
|
||||
* @throws \SoapFault
|
||||
*/
|
||||
function GetResource($serverKey, $hardwareKey, $layoutId, $regionId, $mediaId, $version)
|
||||
{
|
||||
return $this->doGetResource($serverKey, $hardwareKey, $layoutId, $regionId, $mediaId);
|
||||
}
|
||||
}
|
||||
828
lib/Xmds/Soap4.php
Normal file
828
lib/Xmds/Soap4.php
Normal file
@@ -0,0 +1,828 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2025 Xibo Signage Ltd
|
||||
*
|
||||
* Xibo - Digital Signage - https://xibosignage.com
|
||||
*
|
||||
* This file is part of Xibo.
|
||||
*
|
||||
* Xibo is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* any later version.
|
||||
*
|
||||
* Xibo is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Xibo. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
namespace Xibo\Xmds;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Intervention\Image\ImageManagerStatic as Img;
|
||||
use Xibo\Entity\Bandwidth;
|
||||
use Xibo\Entity\Display;
|
||||
use Xibo\Event\XmdsDependencyRequestEvent;
|
||||
use Xibo\Helper\DateFormatHelper;
|
||||
use Xibo\Helper\Random;
|
||||
use Xibo\Support\Exception\GeneralException;
|
||||
use Xibo\Support\Exception\NotFoundException;
|
||||
|
||||
/**
|
||||
* Class Soap4
|
||||
* @package Xibo\Xmds
|
||||
* @phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
|
||||
*/
|
||||
class Soap4 extends Soap
|
||||
{
|
||||
/**
|
||||
* Registers a new display
|
||||
* @param string $serverKey
|
||||
* @param string $hardwareKey
|
||||
* @param string $displayName
|
||||
* @param string $clientType
|
||||
* @param string $clientVersion
|
||||
* @param int $clientCode
|
||||
* @param string $operatingSystem
|
||||
* @param string $macAddress
|
||||
* @param null $xmrChannel
|
||||
* @param null $xmrPubKey
|
||||
* @return string
|
||||
* @throws GeneralException
|
||||
* @throws NotFoundException
|
||||
* @throws \SoapFault
|
||||
*/
|
||||
public function RegisterDisplay($serverKey, $hardwareKey, $displayName, $clientType, $clientVersion, $clientCode, $operatingSystem, $macAddress, $xmrChannel = null, $xmrPubKey = null)
|
||||
{
|
||||
$this->logProcessor->setRoute('RegisterDisplay');
|
||||
|
||||
$sanitized = $this->getSanitizer([
|
||||
'serverKey' => $serverKey,
|
||||
'hardwareKey' => $hardwareKey,
|
||||
'displayName' => $displayName,
|
||||
'clientType' => $clientType,
|
||||
'clientVersion' => $clientVersion,
|
||||
'clientCode' => $clientCode,
|
||||
'operatingSystem' => $operatingSystem,
|
||||
'macAddress' => $macAddress,
|
||||
'xmrChannel' => $xmrChannel,
|
||||
'xmrPubKey' => $xmrPubKey,
|
||||
]);
|
||||
|
||||
// Sanitize
|
||||
$serverKey = $sanitized->getString('serverKey');
|
||||
$hardwareKey = $sanitized->getString('hardwareKey');
|
||||
$displayName = $sanitized->getString('displayName');
|
||||
$clientType = $sanitized->getString('clientType');
|
||||
$clientVersion = $sanitized->getString('clientVersion');
|
||||
$clientCode = $sanitized->getInt('clientCode');
|
||||
$macAddress = $sanitized->getString('macAddress');
|
||||
$clientAddress = $this->getIp();
|
||||
$operatingSystem = $sanitized->getString('operatingSystem');
|
||||
|
||||
// Check the serverKey matches
|
||||
if ($serverKey != $this->getConfig()->getSetting('SERVER_KEY')) {
|
||||
throw new \SoapFault('Sender', 'The Server key you entered does not match with the server key at this address');
|
||||
}
|
||||
|
||||
// Check the Length of the hardwareKey
|
||||
if (strlen($hardwareKey) > 40) {
|
||||
throw new \SoapFault('Sender', 'The Hardware Key you sent was too long. Only 40 characters are allowed (SHA1).');
|
||||
}
|
||||
|
||||
// Return an XML formatted string
|
||||
$return = new \DOMDocument('1.0');
|
||||
$displayElement = $return->createElement('display');
|
||||
$return->appendChild($displayElement);
|
||||
|
||||
// Check in the database for this hardwareKey
|
||||
try {
|
||||
$display = $this->displayFactory->getByLicence($hardwareKey);
|
||||
$this->display = $display;
|
||||
|
||||
$this->logProcessor->setDisplay($display->displayId, $display->isAuditing());
|
||||
|
||||
// Audit in
|
||||
$this->getLog()->debug(
|
||||
'serverKey: ' . $serverKey . ', hardwareKey: ' . $hardwareKey .
|
||||
', displayName: ' . $displayName . ', macAddress: ' . $macAddress
|
||||
);
|
||||
|
||||
// Now
|
||||
$dateNow = Carbon::now();
|
||||
|
||||
// Append the time
|
||||
$displayElement->setAttribute('date', $dateNow->format(DateFormatHelper::getSystemFormat()));
|
||||
$displayElement->setAttribute('timezone', $this->getConfig()->getSetting('defaultTimezone'));
|
||||
|
||||
// Determine if we are licensed or not
|
||||
if ($display->licensed == 0) {
|
||||
// It is not authorised
|
||||
$displayElement->setAttribute('status', 2);
|
||||
$displayElement->setAttribute('code', 'WAITING');
|
||||
$displayElement->setAttribute('message', 'Display is awaiting licensing approval from an Administrator.');
|
||||
} else {
|
||||
// It is licensed
|
||||
$displayElement->setAttribute('status', 0);
|
||||
$displayElement->setAttribute('code', 'READY');
|
||||
$displayElement->setAttribute('message', 'Display is active and ready to start.');
|
||||
|
||||
// Display Settings
|
||||
$settings = $this->display->getSettings(['displayOverride' => true]);
|
||||
|
||||
// Create the XML nodes
|
||||
foreach ($settings as $arrayItem) {
|
||||
// Upper case the setting name for windows
|
||||
$settingName = ($clientType == 'windows') ? ucfirst($arrayItem['name']) : $arrayItem['name'];
|
||||
|
||||
// Patch download and update windows to make sure they are unix time stamps
|
||||
// XMDS schema 4 sent down unix time
|
||||
// https://github.com/xibosignage/xibo/issues/1791
|
||||
if (strtolower($arrayItem['name']) == 'downloadstartwindow'
|
||||
|| strtolower($arrayItem['name']) == 'downloadendwindow'
|
||||
|| strtolower($arrayItem['name']) == 'updatestartwindow'
|
||||
|| strtolower($arrayItem['name']) == 'updateendwindow'
|
||||
) {
|
||||
// Split by :
|
||||
$timeParts = explode(':', $arrayItem['value']);
|
||||
if ($timeParts[0] == '00' && $timeParts[1] == '00') {
|
||||
$arrayItem['value'] = 0;
|
||||
} else {
|
||||
$arrayItem['value'] = Carbon::now()->setTime(intval($timeParts[0]), intval($timeParts[1]));
|
||||
}
|
||||
}
|
||||
|
||||
// Apply an offset to the collectInterval
|
||||
// https://github.com/xibosignage/xibo/issues/3530
|
||||
if (strtolower($arrayItem['name']) == 'collectinterval') {
|
||||
$arrayItem['value'] = $this->collectionIntervalWithOffset($arrayItem['value']);
|
||||
}
|
||||
|
||||
$node = $return->createElement($arrayItem['name'], $arrayItem['value'] ?? $arrayItem['default']);
|
||||
$node->setAttribute('type', $arrayItem['type']);
|
||||
$displayElement->appendChild($node);
|
||||
}
|
||||
|
||||
// Player upgrades
|
||||
$version = '';
|
||||
try {
|
||||
$versionId = $this->display->getSetting('versionMediaId', null, ['displayOverride' => true]);
|
||||
|
||||
if ($clientType != 'windows' && $versionId != null) {
|
||||
$version = $this->playerVersionFactory->getById($versionId);
|
||||
|
||||
if ($clientType == 'android') {
|
||||
$version = json_encode([
|
||||
'id' => $versionId,
|
||||
'file' => $version->fileName,
|
||||
'code' => $version->code
|
||||
]);
|
||||
} elseif ($clientType == 'lg') {
|
||||
$version = json_encode([
|
||||
'id' => $versionId,
|
||||
'file' => $version->fileName,
|
||||
'code' => $version->code
|
||||
]);
|
||||
} elseif ($clientType == 'sssp') {
|
||||
// Create a nonce and store it in the cache for this display.
|
||||
$nonce = Random::generateString();
|
||||
$cache = $this->getPool()->getItem('/playerVersion/' . $nonce);
|
||||
$cache->set($this->display->displayId);
|
||||
$cache->expiresAfter(86400);
|
||||
$this->getPool()->saveDeferred($cache);
|
||||
|
||||
$version = json_encode([
|
||||
'id' => $versionId,
|
||||
'file' => $version->fileName,
|
||||
'code' => $version->code,
|
||||
'url' => str_replace('/xmds.php', '', Wsdl::getRoot()) . '/playersoftware/' . $nonce
|
||||
]);
|
||||
}
|
||||
}
|
||||
} catch (NotFoundException $notFoundException) {
|
||||
$this->getLog()->error('Non-existing version set on displayId ' . $this->display->displayId);
|
||||
}
|
||||
|
||||
$displayElement->setAttribute('version_instructions', $version);
|
||||
|
||||
// Add some special settings
|
||||
$nodeName = ($clientType == 'windows') ? 'DisplayName' : 'displayName';
|
||||
$node = $return->createElement($nodeName);
|
||||
$node->appendChild($return->createTextNode($display->display));
|
||||
$node->setAttribute('type', 'string');
|
||||
$displayElement->appendChild($node);
|
||||
|
||||
$nodeName = ($clientType == 'windows') ? 'ScreenShotRequested' : 'screenShotRequested';
|
||||
$node = $return->createElement($nodeName, $display->screenShotRequested);
|
||||
$node->setAttribute('type', 'checkbox');
|
||||
$displayElement->appendChild($node);
|
||||
|
||||
$nodeName = ($clientType == 'windows') ? 'DisplayTimeZone' : 'displayTimeZone';
|
||||
$node = $return->createElement($nodeName, (!empty($display->timeZone)) ? $display->timeZone : '');
|
||||
$node->setAttribute('type', 'string');
|
||||
$displayElement->appendChild($node);
|
||||
|
||||
if (!empty($display->timeZone)) {
|
||||
// Calculate local time
|
||||
$dateNow->timezone($display->timeZone);
|
||||
|
||||
// Append Local Time
|
||||
$displayElement->setAttribute('localDate', $dateNow->format(DateFormatHelper::getSystemFormat()));
|
||||
}
|
||||
}
|
||||
} catch (NotFoundException $e) {
|
||||
// Add a new display
|
||||
try {
|
||||
$display = $this->displayFactory->createEmpty();
|
||||
$this->display = $display;
|
||||
$display->display = $displayName;
|
||||
$display->auditingUntil = 0;
|
||||
$display->defaultLayoutId = $this->getConfig()->getSetting('DEFAULT_LAYOUT');
|
||||
$display->license = $hardwareKey;
|
||||
$display->licensed = $this->getConfig()->getSetting('DISPLAY_AUTO_AUTH', 0);
|
||||
$display->incSchedule = 0;
|
||||
$display->clientAddress = $this->getIp();
|
||||
|
||||
if (!$display->isDisplaySlotAvailable()) {
|
||||
$display->licensed = 0;
|
||||
}
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
throw new \SoapFault('Sender', $e->getMessage());
|
||||
}
|
||||
|
||||
$displayElement->setAttribute('status', 1);
|
||||
$displayElement->setAttribute('code', 'ADDED');
|
||||
if ($display->licensed == 0) {
|
||||
$displayElement->setAttribute('message', 'Display added and is awaiting licensing approval from an Administrator.');
|
||||
} else {
|
||||
$displayElement->setAttribute('message', 'Display is active and ready to start.');
|
||||
}
|
||||
}
|
||||
|
||||
// Send Notification if required
|
||||
$this->alertDisplayUp();
|
||||
|
||||
$display->lastAccessed = Carbon::now()->format('U');
|
||||
$display->loggedIn = 1;
|
||||
$display->clientAddress = $clientAddress;
|
||||
$display->macAddress = $macAddress;
|
||||
$display->clientType = $clientType;
|
||||
$display->clientVersion = $clientVersion;
|
||||
$display->clientCode = $clientCode;
|
||||
|
||||
// Parse operatingSystem JSON data
|
||||
$operatingSystemJson = json_decode($operatingSystem, false);
|
||||
|
||||
// Newer version of players will return a JSON value, but for older version, it will return a string.
|
||||
// In case the json decode fails, use the operatingSystem string value as the default value for the osVersion.
|
||||
$display->osVersion = $operatingSystemJson->version ?? $operatingSystem;
|
||||
$display->osSdk = $operatingSystemJson->sdk ?? null;
|
||||
$display->manufacturer = $operatingSystemJson->manufacturer ?? null;
|
||||
$display->brand = $operatingSystemJson->brand ?? null;
|
||||
$display->model = $operatingSystemJson->model ?? null;
|
||||
|
||||
$display->save(['validate' => false, 'audit' => false]);
|
||||
|
||||
// Log Bandwidth
|
||||
$returnXml = $return->saveXML();
|
||||
$this->logBandwidth($display->displayId, Bandwidth::$REGISTER, strlen($returnXml));
|
||||
|
||||
// Audit our return
|
||||
$this->getLog()->debug($returnXml);
|
||||
|
||||
return $returnXml;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string containing the required files xml for the requesting display
|
||||
* @param string $serverKey The Server Key
|
||||
* @param string $hardwareKey Display Hardware Key
|
||||
* @return string $requiredXml Xml Formatted String
|
||||
* @throws \SoapFault
|
||||
* @throws \Xibo\Support\Exception\NotFoundException
|
||||
*/
|
||||
function RequiredFiles($serverKey, $hardwareKey)
|
||||
{
|
||||
$httpDownloads = ($this->getConfig()->getSetting('SENDFILE_MODE') != 'Off');
|
||||
return $this->doRequiredFiles($serverKey, $hardwareKey, $httpDownloads);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get File
|
||||
* @param string $serverKey The ServerKey for this CMS
|
||||
* @param string $hardwareKey The HardwareKey for this Display
|
||||
* @param int $fileId The ID
|
||||
* @param string $fileType The File Type
|
||||
* @param int $chunkOffset The Offset of the Chunk Requested
|
||||
* @param string $chunkSize The Size of the Chunk Requested
|
||||
* @return mixed
|
||||
* @throws \SoapFault
|
||||
* @throws GeneralException
|
||||
* @throws \Xibo\Support\Exception\InvalidArgumentException
|
||||
* @throws \Xibo\Support\Exception\NotFoundException
|
||||
*/
|
||||
function GetFile($serverKey, $hardwareKey, $fileId, $fileType, $chunkOffset, $chunkSize, $isDependency = false)
|
||||
{
|
||||
$this->logProcessor->setRoute('GetFile');
|
||||
|
||||
$sanitizer = $this->getSanitizer([
|
||||
'serverKey' => $serverKey,
|
||||
'hardwareKey' => $hardwareKey,
|
||||
'fileId' => $fileId,
|
||||
'fileType' => $fileType,
|
||||
'chunkOffset' => $chunkOffset,
|
||||
'chunkSize' => $chunkSize
|
||||
]);
|
||||
|
||||
// Sanitize
|
||||
$serverKey = $sanitizer->getString('serverKey');
|
||||
$hardwareKey = $sanitizer->getString('hardwareKey');
|
||||
if ($isDependency) {
|
||||
$fileId = $sanitizer->getString('fileId');
|
||||
} else {
|
||||
$fileId = $sanitizer->getInt('fileId');
|
||||
}
|
||||
$fileType = $sanitizer->getString('fileType');
|
||||
$chunkOffset = $sanitizer->getDouble('chunkOffset');
|
||||
$chunkSize = $sanitizer->getDouble('chunkSize');
|
||||
|
||||
$libraryLocation = $this->getConfig()->getSetting('LIBRARY_LOCATION');
|
||||
|
||||
// Check the serverKey matches
|
||||
if ($serverKey != $this->getConfig()->getSetting('SERVER_KEY')) {
|
||||
throw new \SoapFault(
|
||||
'Sender',
|
||||
'The Server key you entered does not match with the server key at this address'
|
||||
);
|
||||
}
|
||||
|
||||
// Authenticate this request...
|
||||
if (!$this->authDisplay($hardwareKey)) {
|
||||
throw new \SoapFault('Receiver', 'This Display is not authorised.');
|
||||
}
|
||||
|
||||
// Now that we authenticated the Display, make sure we are sticking to our bandwidth limit
|
||||
if (!$this->checkBandwidth($this->display->displayId)) {
|
||||
throw new \SoapFault('Receiver', 'Bandwidth Limit exceeded');
|
||||
}
|
||||
|
||||
|
||||
$this->getLog()->debug(
|
||||
'hardwareKey: ' . $hardwareKey . ', fileId: ' . $fileId . ', fileType: ' . $fileType .
|
||||
', chunkOffset: ' . $chunkOffset . ', chunkSize: ' . $chunkSize
|
||||
);
|
||||
|
||||
|
||||
try {
|
||||
if ($isDependency || ($fileType == 'media' && $fileId < 0)) {
|
||||
// Validate the nonce
|
||||
// If we are an older player downloading as media using a faux fileId, then this lookup
|
||||
// should be performed against the `itemId`
|
||||
$requiredFile = $this->requiredFileFactory->getByDisplayAndDependency(
|
||||
$this->display->displayId,
|
||||
$fileType,
|
||||
$fileId,
|
||||
!($fileType == 'media' && $fileId < 0)
|
||||
);
|
||||
|
||||
// File is valid, see if we can return it.
|
||||
$event = new XmdsDependencyRequestEvent($requiredFile);
|
||||
$this->getDispatcher()->dispatch($event, 'xmds.dependency.request');
|
||||
|
||||
// Get the path
|
||||
$path = $event->getRelativePath();
|
||||
if (empty($path)) {
|
||||
throw new NotFoundException(__('File not found'));
|
||||
}
|
||||
|
||||
$path = $libraryLocation . $path;
|
||||
|
||||
$f = fopen($path, 'r');
|
||||
if (!$f) {
|
||||
throw new NotFoundException(__('Unable to get file pointer'));
|
||||
}
|
||||
|
||||
fseek($f, $chunkOffset);
|
||||
$file = fread($f, $chunkSize);
|
||||
|
||||
// Store file size for bandwidth log
|
||||
$chunkSize = strlen($file);
|
||||
|
||||
if ($chunkSize === 0) {
|
||||
throw new NotFoundException(__('Empty file'));
|
||||
}
|
||||
|
||||
$requiredFile->bytesRequested = $requiredFile->bytesRequested + $chunkSize;
|
||||
$requiredFile->save();
|
||||
} else if ($fileType == 'layout') {
|
||||
// Validate the nonce
|
||||
$requiredFile = $this->requiredFileFactory->getByDisplayAndLayout($this->display->displayId, $fileId);
|
||||
|
||||
// Load the layout
|
||||
$layout = $this->layoutFactory->concurrentRequestLock($this->layoutFactory->getById($fileId));
|
||||
try {
|
||||
$path = $layout->xlfToDisk();
|
||||
} finally {
|
||||
$this->layoutFactory->concurrentRequestRelease($layout);
|
||||
}
|
||||
|
||||
$file = file_get_contents($path);
|
||||
$chunkSize = filesize($path);
|
||||
|
||||
$requiredFile->bytesRequested = $requiredFile->bytesRequested + $chunkSize;
|
||||
$requiredFile->save();
|
||||
} else if ($fileType == 'media') {
|
||||
// A normal media file.
|
||||
$requiredFile = $this->requiredFileFactory->getByDisplayAndMedia(
|
||||
$this->display->displayId,
|
||||
$fileId
|
||||
);
|
||||
|
||||
$media = $this->mediaFactory->getById($fileId);
|
||||
$this->getLog()->debug(json_encode($media));
|
||||
|
||||
if (!file_exists($libraryLocation . $media->storedAs)) {
|
||||
throw new NotFoundException(__('Media exists but file missing from library.'));
|
||||
}
|
||||
|
||||
// Return the Chunk size specified
|
||||
$f = fopen($libraryLocation . $media->storedAs, 'r');
|
||||
|
||||
if (!$f) {
|
||||
throw new NotFoundException(__('Unable to get file pointer'));
|
||||
}
|
||||
|
||||
fseek($f, $chunkOffset);
|
||||
|
||||
$file = fread($f, $chunkSize);
|
||||
|
||||
// Store file size for bandwidth log
|
||||
$chunkSize = strlen($file);
|
||||
|
||||
if ($chunkSize === 0) {
|
||||
throw new NotFoundException(__('Empty file'));
|
||||
}
|
||||
|
||||
$requiredFile->bytesRequested = $requiredFile->bytesRequested + $chunkSize;
|
||||
$requiredFile->save();
|
||||
} else {
|
||||
throw new NotFoundException(__('Unknown FileType Requested.'));
|
||||
}
|
||||
} catch (NotFoundException $e) {
|
||||
$this->getLog()->error('Not found FileId: ' . $fileId . '. FileType: '
|
||||
. $fileType . '. ' . $e->getMessage());
|
||||
throw new \SoapFault('Receiver', 'Requested an invalid file.');
|
||||
}
|
||||
|
||||
// Log Bandwidth
|
||||
if ($isDependency) {
|
||||
$this->logBandwidth($this->display->displayId, Bandwidth::$GET_DEPENDENCY, $chunkSize);
|
||||
} else {
|
||||
$this->logBandwidth($this->display->displayId, Bandwidth::$GETFILE, $chunkSize);
|
||||
}
|
||||
|
||||
return $file;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the schedule for the hardware key specified
|
||||
* @param string $serverKey
|
||||
* @param string $hardwareKey
|
||||
* @return string
|
||||
* @throws \SoapFault
|
||||
* @throws \Xibo\Support\Exception\NotFoundException
|
||||
*/
|
||||
function Schedule($serverKey, $hardwareKey)
|
||||
{
|
||||
return $this->doSchedule($serverKey, $hardwareKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* Black List
|
||||
* @param string $serverKey
|
||||
* @param string $hardwareKey
|
||||
* @param string $mediaId
|
||||
* @param string $type
|
||||
* @param string $reason
|
||||
* @return bool
|
||||
* @throws \SoapFault
|
||||
* @throws \Xibo\Support\Exception\NotFoundException
|
||||
*/
|
||||
function BlackList($serverKey, $hardwareKey, $mediaId, $type, $reason)
|
||||
{
|
||||
return $this->doBlackList($serverKey, $hardwareKey, $mediaId, $type, $reason);
|
||||
}
|
||||
|
||||
/**
|
||||
* Submit client logging
|
||||
* @param string $serverKey
|
||||
* @param string $hardwareKey
|
||||
* @param string $logXml
|
||||
* @return bool
|
||||
* @throws \SoapFault
|
||||
* @throws \Xibo\Support\Exception\NotFoundException
|
||||
*/
|
||||
function SubmitLog($serverKey, $hardwareKey, $logXml)
|
||||
{
|
||||
return $this->doSubmitLog($serverKey, $hardwareKey, $logXml);
|
||||
}
|
||||
|
||||
/**
|
||||
* Submit display statistics to the server
|
||||
* @param string $serverKey
|
||||
* @param string $hardwareKey
|
||||
* @param string $statXml
|
||||
* @return bool
|
||||
* @throws \SoapFault
|
||||
* @throws \Xibo\Support\Exception\NotFoundException
|
||||
*/
|
||||
function SubmitStats($serverKey, $hardwareKey, $statXml)
|
||||
{
|
||||
return $this->doSubmitStats($serverKey, $hardwareKey, $statXml);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store the media inventory for a client
|
||||
* @param string $serverKey
|
||||
* @param string $hardwareKey
|
||||
* @param string $inventory
|
||||
* @return bool
|
||||
* @throws \SoapFault
|
||||
* @throws \Xibo\Support\Exception\NotFoundException
|
||||
*/
|
||||
public function MediaInventory($serverKey, $hardwareKey, $inventory)
|
||||
{
|
||||
return $this->doMediaInventory($serverKey, $hardwareKey, $inventory);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets additional resources for assigned media
|
||||
* @param string $serverKey
|
||||
* @param string $hardwareKey
|
||||
* @param int $layoutId
|
||||
* @param string $regionId
|
||||
* @param string $mediaId
|
||||
* @return mixed
|
||||
* @throws \SoapFault
|
||||
* @throws \Xibo\Support\Exception\NotFoundException
|
||||
*/
|
||||
function GetResource($serverKey, $hardwareKey, $layoutId, $regionId, $mediaId)
|
||||
{
|
||||
return $this->doGetResource($serverKey, $hardwareKey, $layoutId, $regionId, $mediaId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Notify Status
|
||||
* @param string $serverKey
|
||||
* @param string $hardwareKey
|
||||
* @param string $status
|
||||
* @return bool
|
||||
* @throws \SoapFault
|
||||
* @throws GeneralException
|
||||
* @throws \Xibo\Support\Exception\NotFoundException
|
||||
*/
|
||||
public function NotifyStatus($serverKey, $hardwareKey, $status)
|
||||
{
|
||||
$this->logProcessor->setRoute('NotifyStatus');
|
||||
|
||||
$sanitizer = $this->getSanitizer([
|
||||
'serverKey' => $serverKey,
|
||||
'hardwareKey' => $hardwareKey
|
||||
]);
|
||||
// Sanitize
|
||||
$serverKey = $sanitizer->getString('serverKey');
|
||||
$hardwareKey = $sanitizer->getString('hardwareKey');
|
||||
|
||||
// Check the serverKey matches
|
||||
if ($serverKey != $this->getConfig()->getSetting('SERVER_KEY')) {
|
||||
throw new \SoapFault('Sender', 'The Server key you entered does not match with the server key at this address');
|
||||
}
|
||||
|
||||
// Auth this request...
|
||||
if (!$this->authDisplay($hardwareKey)) {
|
||||
throw new \SoapFault('Receiver', 'This Display is not authorised.');
|
||||
}
|
||||
|
||||
// Now that we authenticated the Display, make sure we are sticking to our bandwidth limit
|
||||
if (!$this->checkBandwidth($this->display->displayId)) {
|
||||
throw new \SoapFault('Receiver', "Bandwidth Limit exceeded");
|
||||
}
|
||||
|
||||
// Important to keep this logging in place (status screen notification gets logged)
|
||||
$this->getLog()->debug($status);
|
||||
|
||||
$this->logBandwidth($this->display->displayId, Bandwidth::$NOTIFYSTATUS, strlen($status));
|
||||
|
||||
$status = json_decode($status, true);
|
||||
$sanitizedStatus = $this->getSanitizer($status);
|
||||
|
||||
$this->display->storageAvailableSpace = $sanitizedStatus->getInt('availableSpace', ['default' => $this->display->storageAvailableSpace]);
|
||||
$this->display->storageTotalSpace = $sanitizedStatus->getInt('totalSpace', ['default' => $this->display->storageTotalSpace]);
|
||||
$this->display->lastCommandSuccess = $sanitizedStatus->getCheckbox('lastCommandSuccess');
|
||||
$this->display->deviceName = $sanitizedStatus->getString('deviceName', ['default' => $this->display->deviceName]);
|
||||
$this->display->lanIpAddress = $sanitizedStatus->getString('lanIpAddress', ['default' => $this->display->lanIpAddress]);
|
||||
$commercialLicenceString = $sanitizedStatus->getString('licenceResult', ['default' => null]);
|
||||
|
||||
// Commercial Licence Check, 0 - Not licensed, 1 - licensed, 2 - trial licence, 3 - not applicable
|
||||
if (!empty($commercialLicenceString)) {
|
||||
if ($commercialLicenceString === 'Licensed fully'
|
||||
|| $commercialLicenceString === 'licensed'
|
||||
|| $commercialLicenceString === 'full'
|
||||
) {
|
||||
$commercialLicence = 1;
|
||||
} elseif ($commercialLicenceString === 'Trial' || $commercialLicenceString === 'trial') {
|
||||
$commercialLicence = 2;
|
||||
} else {
|
||||
$commercialLicence = 0;
|
||||
}
|
||||
|
||||
$this->display->commercialLicence = $commercialLicence;
|
||||
}
|
||||
|
||||
// commercial licence not applicable for Windows and Linux players.
|
||||
if (in_array($this->display->clientType, ['windows', 'linux'])) {
|
||||
$this->display->commercialLicence = 3;
|
||||
}
|
||||
|
||||
if ($this->getConfig()->getSetting('DISPLAY_LOCK_NAME_TO_DEVICENAME') == 1 && $this->display->hasPropertyChanged('deviceName')) {
|
||||
$this->display->display = $this->display->deviceName;
|
||||
}
|
||||
|
||||
// Timezone
|
||||
$timeZone = $sanitizedStatus->getString('timeZone');
|
||||
|
||||
if (!empty($timeZone)) {
|
||||
// Validate the provided data and log/ignore if not well formatted
|
||||
if (array_key_exists($timeZone, DateFormatHelper::timezoneList())) {
|
||||
$this->display->timeZone = $timeZone;
|
||||
} else {
|
||||
$this->getLog()->info('Ignoring Incorrect timezone string: ' . $timeZone);
|
||||
}
|
||||
}
|
||||
|
||||
// Current Layout
|
||||
// don't fail: xibosignage/xibo#2517
|
||||
try {
|
||||
$currentLayoutId = $sanitizedStatus->getInt('currentLayoutId');
|
||||
|
||||
if ($currentLayoutId !== null) {
|
||||
$this->display->setCurrentLayoutId($this->getPool(), $currentLayoutId);
|
||||
}
|
||||
} catch (\Exception $exception) {
|
||||
$this->getLog()->debug('Ignoring currentLayout due to a validation error.');
|
||||
}
|
||||
|
||||
// Status Dialog
|
||||
$statusDialog = $sanitizedStatus->getString('statusDialog', ['default' => null]);
|
||||
|
||||
if ($statusDialog !== null) {
|
||||
// special handling for Android Players (Other Players send status as json already)
|
||||
if ($this->display->clientType == 'android') {
|
||||
$statusDialog = json_encode($statusDialog);
|
||||
}
|
||||
|
||||
// Log in as an alert
|
||||
$this->getLog()->alert($statusDialog);
|
||||
|
||||
// Cache on the display as transient data
|
||||
try {
|
||||
$this->display->setStatusWindow($this->getPool(), json_decode($statusDialog, true));
|
||||
} catch (\Exception $exception) {
|
||||
$this->getLog()->error('Unable to cache display status. e = ' . $exception->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
// Resolution
|
||||
$width = $sanitizedStatus->getInt('width');
|
||||
$height = $sanitizedStatus->getInt('height');
|
||||
|
||||
if ($width != null && $height != null) {
|
||||
// Determine the orientation
|
||||
$this->display->orientation = ($width >= $height) ? 'landscape' : 'portrait';
|
||||
$this->display->resolution = $width . 'x' . $height;
|
||||
}
|
||||
|
||||
// Lat/Long
|
||||
$latitude = $sanitizedStatus->getDouble('latitude', ['default' => null]);
|
||||
$longitude = $sanitizedStatus->getDouble('longitude', ['default' => null]);
|
||||
|
||||
if ($latitude != null && $longitude != null) {
|
||||
$this->display->latitude = $latitude;
|
||||
$this->display->longitude = $longitude;
|
||||
}
|
||||
|
||||
// Touch the display record
|
||||
try {
|
||||
if (count($this->display->getChangedProperties()) > 0) {
|
||||
$this->display->save(Display::$saveOptionsMinimum);
|
||||
}
|
||||
} catch (GeneralException $xiboException) {
|
||||
$this->getLog()->error($xiboException->getMessage());
|
||||
throw new \SoapFault('Receiver', 'Unable to save status update');
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Submit ScreenShot
|
||||
* @param string $serverKey
|
||||
* @param string $hardwareKey
|
||||
* @param string $screenShot
|
||||
* @return bool
|
||||
* @throws \SoapFault
|
||||
* @throws GeneralException
|
||||
* @throws \Xibo\Support\Exception\NotFoundException
|
||||
*/
|
||||
public function SubmitScreenShot($serverKey, $hardwareKey, $screenShot)
|
||||
{
|
||||
$this->logProcessor->setRoute('SubmitScreenShot');
|
||||
|
||||
$sanitizer = $this->getSanitizer([
|
||||
'serverKey' => $serverKey,
|
||||
'hardwareKey' => $hardwareKey,
|
||||
]);
|
||||
// Sanitize
|
||||
$serverKey = $sanitizer->getString('serverKey');
|
||||
$hardwareKey = $sanitizer->getString('hardwareKey');
|
||||
|
||||
$screenShotFmt = "jpg";
|
||||
$screenShotMime = "image/jpeg";
|
||||
$screenShotImg = false;
|
||||
|
||||
$converted = false;
|
||||
$needConversion = false;
|
||||
|
||||
// Check the serverKey matches
|
||||
if ($serverKey != $this->getConfig()->getSetting('SERVER_KEY')) {
|
||||
throw new \SoapFault('Sender', 'The Server key you entered does not match with the server key at this address');
|
||||
}
|
||||
|
||||
// Auth this request...
|
||||
if (!$this->authDisplay($hardwareKey)) {
|
||||
throw new \SoapFault('Receiver', 'This Display is not authorised.');
|
||||
}
|
||||
|
||||
// Now that we authenticated the Display, make sure we are sticking to our bandwidth limit
|
||||
if (!$this->checkBandwidth($this->display->displayId)) {
|
||||
throw new \SoapFault('Receiver', "Bandwidth Limit exceeded");
|
||||
}
|
||||
|
||||
$this->getLog()->debug('Received Screen shot');
|
||||
|
||||
// Open this displays screen shot file and save this.
|
||||
$location = $this->getConfig()->getSetting('LIBRARY_LOCATION') . 'screenshots/' . $this->display->displayId . '_screenshot.' . $screenShotFmt;
|
||||
|
||||
foreach (array('imagick', 'gd') as $imgDriver) {
|
||||
Img::configure(array('driver' => $imgDriver));
|
||||
try {
|
||||
$screenShotImg = Img::make($screenShot);
|
||||
} catch (\Exception $e) {
|
||||
$this->getLog()->debug($imgDriver . ' - ' . $e->getMessage());
|
||||
}
|
||||
if ($screenShotImg !== false) {
|
||||
$this->getLog()->debug('Use ' . $imgDriver);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($screenShotImg !== false) {
|
||||
$imgMime = $screenShotImg->mime();
|
||||
|
||||
if ($imgMime != $screenShotMime) {
|
||||
$needConversion = true;
|
||||
try {
|
||||
$this->getLog()->debug("converting: '" . $imgMime . "' to '" . $screenShotMime . "'");
|
||||
$screenShot = (string) $screenShotImg->encode($screenShotFmt);
|
||||
$converted = true;
|
||||
} catch (\Exception $e) {
|
||||
$this->getLog()->debug($e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// return early with false, keep screenShotRequested intact, let the Player retry.
|
||||
if ($needConversion && !$converted) {
|
||||
$this->logBandwidth($this->display->displayId, Bandwidth::$SCREENSHOT, filesize($location));
|
||||
throw new \SoapFault('Receiver', __('Incorrect Screen shot Format'));
|
||||
}
|
||||
|
||||
$fp = fopen($location, 'wb');
|
||||
fwrite($fp, $screenShot);
|
||||
fclose($fp);
|
||||
|
||||
// Touch the display record
|
||||
$this->display->screenShotRequested = 0;
|
||||
$this->display->save(Display::$saveOptionsMinimum);
|
||||
|
||||
// Cache the current screen shot time
|
||||
$this->display->setCurrentScreenShotTime($this->getPool(), Carbon::now()->format(DateFormatHelper::getSystemFormat()));
|
||||
|
||||
$this->logBandwidth($this->display->displayId, Bandwidth::$SCREENSHOT, filesize($location));
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
571
lib/Xmds/Soap5.php
Executable file
571
lib/Xmds/Soap5.php
Executable file
@@ -0,0 +1,571 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2025 Xibo Signage Ltd
|
||||
*
|
||||
* Xibo - Digital Signage - https://xibosignage.com
|
||||
*
|
||||
* This file is part of Xibo.
|
||||
*
|
||||
* Xibo is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* any later version.
|
||||
*
|
||||
* Xibo is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Xibo. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
namespace Xibo\Xmds;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Str;
|
||||
use Stash\Invalidation;
|
||||
use Xibo\Entity\Bandwidth;
|
||||
use Xibo\Entity\Display;
|
||||
use Xibo\Helper\DateFormatHelper;
|
||||
use Xibo\Helper\Random;
|
||||
use Xibo\Support\Exception\GeneralException;
|
||||
use Xibo\Support\Exception\NotFoundException;
|
||||
|
||||
/**
|
||||
* Class Soap5
|
||||
* @package Xibo\Xmds
|
||||
*
|
||||
* @phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
|
||||
*/
|
||||
class Soap5 extends Soap4
|
||||
{
|
||||
/**
|
||||
* Registers a new display
|
||||
* @param string $serverKey
|
||||
* @param string $hardwareKey
|
||||
* @param string $displayName
|
||||
* @param string $clientType
|
||||
* @param string $clientVersion
|
||||
* @param int $clientCode
|
||||
* @param string $operatingSystem
|
||||
* @param string $macAddress
|
||||
* @param string $xmrChannel
|
||||
* @param string $xmrPubKey
|
||||
* @param string $licenceCheck
|
||||
* @return string
|
||||
* @throws NotFoundException
|
||||
* @throws \SoapFault
|
||||
* @throws GeneralException
|
||||
*/
|
||||
public function RegisterDisplay(
|
||||
$serverKey,
|
||||
$hardwareKey,
|
||||
$displayName,
|
||||
$clientType,
|
||||
$clientVersion,
|
||||
$clientCode,
|
||||
$operatingSystem,
|
||||
$macAddress,
|
||||
$xmrChannel = null,
|
||||
$xmrPubKey = null,
|
||||
$licenceResult = null
|
||||
) {
|
||||
$this->logProcessor->setRoute('RegisterDisplay');
|
||||
|
||||
$sanitized = $this->getSanitizer([
|
||||
'serverKey' => $serverKey,
|
||||
'hardwareKey' => $hardwareKey,
|
||||
'displayName' => $displayName,
|
||||
'clientType' => $clientType,
|
||||
'clientVersion' => $clientVersion,
|
||||
'clientCode' => $clientCode,
|
||||
'operatingSystem' => $operatingSystem,
|
||||
'macAddress' => $macAddress,
|
||||
'xmrChannel' => $xmrChannel,
|
||||
'xmrPubKey' => $xmrPubKey,
|
||||
'licenceResult' => $licenceResult
|
||||
]);
|
||||
|
||||
// Sanitize
|
||||
$serverKey = $sanitized->getString('serverKey');
|
||||
$hardwareKey = $sanitized->getString('hardwareKey');
|
||||
$displayName = $sanitized->getString('displayName');
|
||||
$clientType = $sanitized->getString('clientType');
|
||||
$clientVersion = $sanitized->getString('clientVersion');
|
||||
$clientCode = $sanitized->getInt('clientCode');
|
||||
$macAddress = $sanitized->getString('macAddress');
|
||||
$clientAddress = $this->getIp();
|
||||
$xmrChannel = $sanitized->getString('xmrChannel');
|
||||
$xmrPubKey = trim($sanitized->getString('xmrPubKey'));
|
||||
$operatingSystem = $sanitized->getString('operatingSystem');
|
||||
|
||||
// this is only sent from xmds v7
|
||||
$commercialLicenceString = $sanitized->getString('licenceResult');
|
||||
|
||||
if ($xmrPubKey != '' && !Str::contains($xmrPubKey, 'BEGIN PUBLIC KEY')) {
|
||||
$xmrPubKey = "-----BEGIN PUBLIC KEY-----\n" . $xmrPubKey . "\n-----END PUBLIC KEY-----\n";
|
||||
}
|
||||
|
||||
// Check the serverKey matches
|
||||
if ($serverKey != $this->getConfig()->getSetting('SERVER_KEY')) {
|
||||
throw new \SoapFault(
|
||||
'Sender',
|
||||
'The Server key you entered does not match with the server key at this address'
|
||||
);
|
||||
}
|
||||
|
||||
// Check the Length of the hardwareKey
|
||||
if (strlen($hardwareKey) > 40) {
|
||||
throw new \SoapFault(
|
||||
'Sender',
|
||||
'The Hardware Key you sent was too long. Only 40 characters are allowed (SHA1).'
|
||||
);
|
||||
}
|
||||
|
||||
// Return an XML formatted string
|
||||
$return = new \DOMDocument('1.0');
|
||||
$displayElement = $return->createElement('display');
|
||||
$return->appendChild($displayElement);
|
||||
|
||||
// Uncomment this if we want additional logging in register.
|
||||
//$this->logProcessor->setDisplay(0, 'debug');
|
||||
|
||||
// Check in the database for this hardwareKey
|
||||
try {
|
||||
$display = $this->displayFactory->getByLicence($hardwareKey);
|
||||
$this->display = $display;
|
||||
|
||||
$this->logProcessor->setDisplay($display->displayId, $display->isAuditing());
|
||||
|
||||
// Audit in
|
||||
$this->getLog()->debug(
|
||||
'serverKey: ' . $serverKey . ', hardwareKey: ' . $hardwareKey .
|
||||
', displayName: ' . $displayName . ', macAddress: ' . $macAddress
|
||||
);
|
||||
|
||||
// Now
|
||||
$dateNow = Carbon::now();
|
||||
|
||||
// Append the time
|
||||
$displayElement->setAttribute('date', $dateNow->format(DateFormatHelper::getSystemFormat()));
|
||||
$displayElement->setAttribute('timezone', $this->getConfig()->getSetting('defaultTimezone'));
|
||||
|
||||
// Determine if we are licensed or not
|
||||
if ($display->licensed == 0) {
|
||||
// It is not authorised
|
||||
$displayElement->setAttribute('status', 2);
|
||||
$displayElement->setAttribute('code', 'WAITING');
|
||||
$displayElement->setAttribute(
|
||||
'message',
|
||||
'Display is Registered and awaiting Authorisation from an Administrator in the CMS'
|
||||
);
|
||||
} else {
|
||||
// It is licensed
|
||||
$displayElement->setAttribute('status', 0);
|
||||
$displayElement->setAttribute('code', 'READY');
|
||||
$displayElement->setAttribute('message', 'Display is active and ready to start.');
|
||||
|
||||
// Display Settings
|
||||
$settings = $this->display->getSettings(['displayOverride' => true]);
|
||||
|
||||
// Create the XML nodes
|
||||
foreach ($settings as $arrayItem) {
|
||||
// Upper case the setting name for windows
|
||||
$settingName = ($clientType == 'windows') ? ucfirst($arrayItem['name']) : $arrayItem['name'];
|
||||
|
||||
// Disable the CEF browser option on Windows players
|
||||
if (strtolower($settingName) == 'usecefwebbrowser' && ($clientType == 'windows')) {
|
||||
$arrayItem['value'] = 0;
|
||||
}
|
||||
|
||||
// Override the XMR address if empty
|
||||
if (strtolower($settingName) == 'xmrnetworkaddress' &&
|
||||
(!isset($arrayItem['value']) || $arrayItem['value'] == '')
|
||||
) {
|
||||
$arrayItem['value'] = $this->getConfig()->getSetting('XMR_PUB_ADDRESS');
|
||||
}
|
||||
|
||||
// Override the XMR address if empty
|
||||
if (strtolower($settingName) == 'xmrwebsocketaddress' &&
|
||||
(!isset($arrayItem['value']) || $arrayItem['value'] == '')
|
||||
) {
|
||||
$arrayItem['value'] = $this->getConfig()->getSetting('XMR_WS_ADDRESS');
|
||||
}
|
||||
|
||||
// logLevels
|
||||
if (strtolower($settingName) == 'loglevel') {
|
||||
// return resting log level
|
||||
// unless it is currently elevated, in which case return debug
|
||||
$arrayItem['value'] = $this->display->getLogLevel();
|
||||
}
|
||||
|
||||
$value = ($arrayItem['value'] ?? $arrayItem['default']);
|
||||
|
||||
// Patch download and update windows to make sure they are only 00:00
|
||||
// https://github.com/xibosignage/xibo/issues/1791
|
||||
if (strtolower($arrayItem['name']) == 'downloadstartwindow'
|
||||
|| strtolower($arrayItem['name']) == 'downloadendwindow'
|
||||
|| strtolower($arrayItem['name']) == 'updatestartwindow'
|
||||
|| strtolower($arrayItem['name']) == 'updateendwindow'
|
||||
) {
|
||||
// Split by :
|
||||
$timeParts = explode(':', $value);
|
||||
$value = $timeParts[0] . ':' . $timeParts[1];
|
||||
}
|
||||
|
||||
// Apply an offset to the collectInterval
|
||||
// https://github.com/xibosignage/xibo/issues/3530
|
||||
if (strtolower($arrayItem['name']) == 'collectinterval') {
|
||||
$value = $this->collectionIntervalWithOffset($value);
|
||||
}
|
||||
|
||||
$node = $return->createElement($settingName, $value);
|
||||
|
||||
if (isset($arrayItem['type'])) {
|
||||
$node->setAttribute('type', $arrayItem['type']);
|
||||
}
|
||||
|
||||
$displayElement->appendChild($node);
|
||||
}
|
||||
|
||||
// Player upgrades
|
||||
$version = '';
|
||||
try {
|
||||
$versionId = $this->display->getSetting('versionMediaId', null, ['displayOverride' => true]);
|
||||
|
||||
if ($clientType != 'windows' && $versionId != null) {
|
||||
$version = $this->playerVersionFactory->getById($versionId);
|
||||
|
||||
if ($clientType == 'android') {
|
||||
$version = json_encode([
|
||||
'id' => $versionId,
|
||||
'file' => $version->fileName,
|
||||
'code' => $version->code
|
||||
]);
|
||||
} elseif ($clientType == 'lg') {
|
||||
$version = json_encode([
|
||||
'id' => $versionId,
|
||||
'file' => $version->fileName,
|
||||
'code' => $version->code
|
||||
]);
|
||||
} elseif ($clientType == 'sssp') {
|
||||
// Create a nonce and store it in the cache for this display.
|
||||
$nonce = Random::generateString();
|
||||
$cache = $this->getPool()->getItem('/playerVersion/' . $nonce);
|
||||
$cache->set($this->display->displayId);
|
||||
$cache->expiresAfter(86400);
|
||||
$this->getPool()->saveDeferred($cache);
|
||||
|
||||
$version = json_encode([
|
||||
'id' => $versionId,
|
||||
'file' => $version->fileName,
|
||||
'code' => $version->code,
|
||||
'url' => str_replace('/xmds.php', '', Wsdl::getRoot()) . '/playersoftware/' . $nonce
|
||||
]);
|
||||
}
|
||||
}
|
||||
} catch (NotFoundException $notFoundException) {
|
||||
$this->getLog()->error('Non-existing version set on displayId ' . $this->display->displayId);
|
||||
}
|
||||
|
||||
$displayElement->setAttribute('version_instructions', $version);
|
||||
|
||||
// cms move
|
||||
$displayMoveAddress = ($clientType == 'windows') ? 'NewCmsAddress' : 'newCmsAddress';
|
||||
$node = $return->createElement($displayMoveAddress, $display->newCmsAddress);
|
||||
|
||||
if ($clientType == 'windows') {
|
||||
$node->setAttribute('type', 'string');
|
||||
}
|
||||
|
||||
$displayElement->appendChild($node);
|
||||
|
||||
$displayMoveKey = ($clientType == 'windows') ? 'NewCmsKey' : 'newCmsKey';
|
||||
$node = $return->createElement($displayMoveKey, $display->newCmsKey);
|
||||
|
||||
if ($clientType == 'windows') {
|
||||
$node->setAttribute('type', 'string');
|
||||
}
|
||||
|
||||
$displayElement->appendChild($node);
|
||||
|
||||
// Add some special settings
|
||||
$nodeName = ($clientType == 'windows') ? 'DisplayName' : 'displayName';
|
||||
$node = $return->createElement($nodeName);
|
||||
$node->appendChild($return->createTextNode($display->display));
|
||||
|
||||
if ($clientType == 'windows') {
|
||||
$node->setAttribute('type', 'string');
|
||||
}
|
||||
$displayElement->appendChild($node);
|
||||
|
||||
$nodeName = ($clientType == 'windows') ? 'ScreenShotRequested' : 'screenShotRequested';
|
||||
$node = $return->createElement($nodeName, $display->screenShotRequested);
|
||||
$node->setAttribute('type', 'checkbox');
|
||||
$displayElement->appendChild($node);
|
||||
|
||||
$nodeName = ($clientType == 'windows') ? 'DisplayTimeZone' : 'displayTimeZone';
|
||||
$node = $return->createElement($nodeName, (!empty($display->timeZone)) ? $display->timeZone : '');
|
||||
if ($clientType == 'windows') {
|
||||
$node->setAttribute('type', 'string');
|
||||
}
|
||||
$displayElement->appendChild($node);
|
||||
|
||||
// Adspace Enabled CMS?
|
||||
$isAdspaceEnabled = intval($this->getConfig()->getSetting('isAdspaceEnabled', 0));
|
||||
$node = $return->createElement('isAdspaceEnabled', $isAdspaceEnabled);
|
||||
$node->setAttribute('type', 'checkbox');
|
||||
$displayElement->appendChild($node);
|
||||
|
||||
if (!empty($display->timeZone)) {
|
||||
// Calculate local time
|
||||
$dateNow->timezone($display->timeZone);
|
||||
|
||||
// Append Local Time
|
||||
$displayElement->setAttribute('localTimezone', $display->timeZone);
|
||||
$displayElement->setAttribute('localDate', $dateNow->format(DateFormatHelper::getSystemFormat()));
|
||||
}
|
||||
|
||||
// XMR
|
||||
// Type of XMR connection
|
||||
$node = $return->createElement('xmrType', $this->display->isWebSocketXmrSupported() ? 'ws' : 'zmq');
|
||||
$node->setAttribute('type', 'string');
|
||||
$displayElement->appendChild($node);
|
||||
|
||||
// XMR key (this is the key a player should use the intialise a connection to XMR
|
||||
$node = $return->createElement('xmrCmsKey', $this->getConfig()->getSetting('XMR_CMS_KEY'));
|
||||
$node->setAttribute('type', 'string');
|
||||
$displayElement->appendChild($node);
|
||||
|
||||
// Commands
|
||||
$commands = $display->getCommands();
|
||||
|
||||
if (count($commands) > 0) {
|
||||
// Append a command element
|
||||
$commandElement = $return->createElement('commands');
|
||||
$displayElement->appendChild($commandElement);
|
||||
|
||||
// Append each individual command
|
||||
foreach ($display->getCommands() as $command) {
|
||||
try {
|
||||
if (!$command->isReady()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$node = $return->createElement($command->code);
|
||||
$commandString = $return->createElement('commandString');
|
||||
$commandStringCData = $return->createCDATASection($command->getCommandString());
|
||||
$commandString->appendChild($commandStringCData);
|
||||
$validationString = $return->createElement('validationString');
|
||||
$validationStringCData = $return->createCDATASection($command->getValidationString());
|
||||
$validationString->appendChild($validationStringCData);
|
||||
$alertOnString = $return->createElement('createAlertOn');
|
||||
$alertOnStringCData = $return->createCDATASection($command->getCreateAlertOn());
|
||||
$alertOnString->appendChild($alertOnStringCData);
|
||||
|
||||
$node->appendChild($commandString);
|
||||
$node->appendChild($validationString);
|
||||
$node->appendChild($alertOnString);
|
||||
|
||||
$commandElement->appendChild($node);
|
||||
} catch (\DOMException $DOMException) {
|
||||
$this->getLog()->error(
|
||||
'Cannot add command to settings for displayId ' .
|
||||
$this->display->displayId . ', ' . $DOMException->getMessage()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Tags
|
||||
if (count($display->tags) > 0) {
|
||||
$tagsElement = $return->createElement('tags');
|
||||
$displayElement->appendChild($tagsElement);
|
||||
|
||||
foreach ($display->tags as $tagLink) {
|
||||
$tagNode = $return->createElement('tag');
|
||||
|
||||
$tagNameNode = $return->createElement('tagName');
|
||||
$tag = $return->createTextNode($tagLink->tag);
|
||||
$tagNameNode->appendChild($tag);
|
||||
|
||||
$tagNode->appendChild($tagNameNode);
|
||||
|
||||
if ($tagLink->value !== null) {
|
||||
$valueNode = $return->createElement('tagValue');
|
||||
$value = $return->createTextNode($tagLink->value);
|
||||
$valueNode->appendChild($value);
|
||||
|
||||
$tagNode->appendChild($valueNode);
|
||||
}
|
||||
|
||||
$tagsElement->appendChild($tagNode);
|
||||
}
|
||||
}
|
||||
|
||||
// Check to see if the channel/pubKey are already entered
|
||||
$this->getLog()->debug('xmrChannel: [' . $xmrChannel . ']. xmrPublicKey: [' . $xmrPubKey . ']');
|
||||
|
||||
// Update the Channel
|
||||
$display->xmrChannel = $xmrChannel;
|
||||
// Update the PUB Key only if it has been cleared
|
||||
if ($display->xmrPubKey == '') {
|
||||
$display->xmrPubKey = $xmrPubKey;
|
||||
}
|
||||
}
|
||||
} catch (NotFoundException $e) {
|
||||
// Add a new display
|
||||
try {
|
||||
$display = $this->displayFactory->createEmpty();
|
||||
$this->display = $display;
|
||||
$display->display = $displayName;
|
||||
$display->auditingUntil = 0;
|
||||
// defaultLayoutId column cannot be null or empty string
|
||||
// if we do not have global default layout, set it here to 0 to allow register to proceed
|
||||
$display->defaultLayoutId = intval($this->getConfig()->getSetting('DEFAULT_LAYOUT', 0));
|
||||
$display->license = $hardwareKey;
|
||||
$display->licensed = $this->getConfig()->getSetting('DISPLAY_AUTO_AUTH', 0);
|
||||
$display->incSchedule = 0;
|
||||
$display->clientAddress = $this->getIp();
|
||||
$display->xmrChannel = $xmrChannel;
|
||||
$display->xmrPubKey = $xmrPubKey;
|
||||
$display->folderId = $this->getConfig()->getSetting('DISPLAY_DEFAULT_FOLDER', 1);
|
||||
|
||||
if (!$display->isDisplaySlotAvailable()) {
|
||||
$display->licensed = 0;
|
||||
}
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
throw new \SoapFault('Sender', $e->getMessage());
|
||||
}
|
||||
|
||||
$displayElement->setAttribute('status', 1);
|
||||
$displayElement->setAttribute('code', 'ADDED');
|
||||
if ($display->licensed == 0) {
|
||||
$displayElement->setAttribute(
|
||||
'message',
|
||||
'Display is now Registered and awaiting Authorisation from an Administrator in the CMS'
|
||||
);
|
||||
} else {
|
||||
$displayElement->setAttribute('message', 'Display is active and ready to start.');
|
||||
}
|
||||
}
|
||||
|
||||
// Send Notification if required
|
||||
$this->alertDisplayUp();
|
||||
|
||||
$display->lastAccessed = Carbon::now()->format('U');
|
||||
$display->loggedIn = 1;
|
||||
$display->clientAddress = $clientAddress;
|
||||
$display->macAddress = $macAddress;
|
||||
$display->clientType = $clientType;
|
||||
$display->clientVersion = $clientVersion;
|
||||
$display->clientCode = $clientCode;
|
||||
|
||||
// Parse operatingSystem data
|
||||
$operatingSystemJson = json_decode($operatingSystem, false);
|
||||
|
||||
// Newer version of players will return a JSON value, but for older version, it will return a string.
|
||||
// In case the json decode fails, use the operatingSystem string value as the default value for the osVersion.
|
||||
$display->osVersion = $operatingSystemJson->version ?? $operatingSystem;
|
||||
$display->osSdk = $operatingSystemJson->sdk ?? null;
|
||||
$display->manufacturer = $operatingSystemJson->manufacturer ?? null;
|
||||
$display->brand = $operatingSystemJson->brand ?? null;
|
||||
$display->model = $operatingSystemJson->model ?? null;
|
||||
|
||||
// Commercial Licence Check, 0 - Not licensed, 1 - licensed, 2 - trial licence, 3 - not applicable
|
||||
// only sent by xmds v7
|
||||
if (!empty($commercialLicenceString) && !in_array($display->clientType, ['windows', 'linux'])) {
|
||||
$commercialLicenceString = strtolower($commercialLicenceString);
|
||||
if ($commercialLicenceString === 'licensed' || $commercialLicenceString === 'full') {
|
||||
$commercialLicence = 1;
|
||||
} elseif ($commercialLicenceString === 'trial') {
|
||||
$commercialLicence = 2;
|
||||
} else {
|
||||
$commercialLicence = 0;
|
||||
}
|
||||
|
||||
$display->commercialLicence = $commercialLicence;
|
||||
$node = $return->createElement('commercialLicence', $commercialLicenceString);
|
||||
$displayElement->appendChild($node);
|
||||
}
|
||||
|
||||
// commercial licence not applicable for Windows and Linux players.
|
||||
if (in_array($display->clientType, ['windows', 'linux'])) {
|
||||
$display->commercialLicence = 3;
|
||||
}
|
||||
|
||||
if (!empty($display->syncGroupId)) {
|
||||
try {
|
||||
$syncGroup = $this->syncGroupFactory->getById($display->syncGroupId);
|
||||
|
||||
if ($syncGroup->leadDisplayId === $display->displayId) {
|
||||
$syncNodeValue = 'lead';
|
||||
} else {
|
||||
$leadDisplay = $this->syncGroupFactory->getLeadDisplay($syncGroup->leadDisplayId);
|
||||
$syncNodeValue = $leadDisplay->lanIpAddress;
|
||||
}
|
||||
|
||||
$syncNode = $return->createElement('syncGroup');
|
||||
$value = $return->createTextNode($syncNodeValue ?? '');
|
||||
$syncNode->appendChild($value);
|
||||
$displayElement->appendChild($syncNode);
|
||||
|
||||
$syncPublisherPortNode = $return->createElement('syncPublisherPort');
|
||||
$value = $return->createTextNode($syncGroup->syncPublisherPort ?? 9590);
|
||||
$syncPublisherPortNode->appendChild($value);
|
||||
$displayElement->appendChild($syncPublisherPortNode);
|
||||
|
||||
$syncSwitchDelayNode = $return->createElement('syncSwitchDelay');
|
||||
$value = $return->createTextNode($syncGroup->syncSwitchDelay ?? 750);
|
||||
$syncSwitchDelayNode->appendChild($value);
|
||||
$displayElement->appendChild($syncSwitchDelayNode);
|
||||
|
||||
$syncVideoPauseDelayNode = $return->createElement('syncVideoPauseDelay');
|
||||
$value = $return->createTextNode($syncGroup->syncVideoPauseDelay ?? 100);
|
||||
$syncVideoPauseDelayNode->appendChild($value);
|
||||
$displayElement->appendChild($syncVideoPauseDelayNode);
|
||||
} catch (GeneralException $exception) {
|
||||
$this->getLog()->error('registerDisplay: cannot get sync group information, e = '
|
||||
. $exception->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
$display->save(Display::$saveOptionsMinimum);
|
||||
|
||||
// cache checks
|
||||
$cacheSchedule = $this->getPool()->getItem($this->display->getCacheKey() . '/schedule');
|
||||
$cacheSchedule->setInvalidationMethod(Invalidation::OLD);
|
||||
$displayElement->setAttribute(
|
||||
'checkSchedule',
|
||||
($cacheSchedule->isHit() ? crc32($cacheSchedule->get()) : '')
|
||||
);
|
||||
|
||||
$cacheRF = $this->getPool()->getItem($this->display->getCacheKey() . '/requiredFiles');
|
||||
$cacheRF->setInvalidationMethod(Invalidation::OLD);
|
||||
$displayElement->setAttribute('checkRf', ($cacheRF->isHit() ? crc32($cacheRF->get()) : ''));
|
||||
|
||||
// Log Bandwidth
|
||||
$returnXml = $return->saveXML();
|
||||
$this->logBandwidth($display->displayId, Bandwidth::$REGISTER, strlen($returnXml));
|
||||
|
||||
// Audit our return
|
||||
$this->getLog()->debug($returnXml);
|
||||
|
||||
return $returnXml;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the schedule for the hardware key specified
|
||||
* @param string $serverKey
|
||||
* @param string $hardwareKey
|
||||
* @return string
|
||||
* @throws NotFoundException
|
||||
* @throws \SoapFault
|
||||
*/
|
||||
public function Schedule($serverKey, $hardwareKey)
|
||||
{
|
||||
return $this->doSchedule($serverKey, $hardwareKey, ['dependentsAsNodes' => true, 'includeOverlays' => true]);
|
||||
}
|
||||
}
|
||||
233
lib/Xmds/Soap6.php
Normal file
233
lib/Xmds/Soap6.php
Normal file
@@ -0,0 +1,233 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2024 Xibo Signage Ltd
|
||||
*
|
||||
* Xibo - Digital Signage - https://xibosignage.com
|
||||
*
|
||||
* This file is part of Xibo.
|
||||
*
|
||||
* Xibo is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* any later version.
|
||||
*
|
||||
* Xibo is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Xibo. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace Xibo\Xmds;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Xibo\Entity\Bandwidth;
|
||||
use Xibo\Helper\DateFormatHelper;
|
||||
use Xibo\Support\Sanitizer\SanitizerInterface;
|
||||
|
||||
/**
|
||||
* Class Soap6
|
||||
* @package Xibo\Xmds
|
||||
*/
|
||||
class Soap6 extends Soap5
|
||||
{
|
||||
/**
|
||||
* Report Player Fault to the CMS
|
||||
*
|
||||
* @param string $serverKey
|
||||
* @param string $hardwareKey
|
||||
* @param string $fault
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function reportFaults(string $serverKey, string $hardwareKey, string $fault): bool
|
||||
{
|
||||
$this->logProcessor->setRoute('ReportFault');
|
||||
//$this->logProcessor->setDisplay(0, 'debug');
|
||||
|
||||
$sanitizer = $this->getSanitizer([
|
||||
'serverKey' => $serverKey,
|
||||
'hardwareKey' => $hardwareKey
|
||||
]);
|
||||
|
||||
// Sanitize
|
||||
$serverKey = $sanitizer->getString('serverKey');
|
||||
$hardwareKey = $sanitizer->getString('hardwareKey');
|
||||
|
||||
// Check the serverKey matches
|
||||
if ($serverKey != $this->getConfig()->getSetting('SERVER_KEY')) {
|
||||
throw new \SoapFault(
|
||||
'Sender',
|
||||
'The Server key you entered does not match with the server key at this address'
|
||||
);
|
||||
}
|
||||
|
||||
// Auth this request...
|
||||
if (!$this->authDisplay($hardwareKey)) {
|
||||
throw new \SoapFault('Receiver', 'This Display is not authorised.');
|
||||
}
|
||||
|
||||
// Now that we authenticated the Display, make sure we are sticking to our bandwidth limit
|
||||
if (!$this->checkBandwidth($this->display->displayId)) {
|
||||
throw new \SoapFault('Receiver', 'Bandwidth Limit exceeded');
|
||||
}
|
||||
|
||||
$faultDecoded = json_decode($fault, true);
|
||||
|
||||
// check if we should record or update any display events.
|
||||
$this->manageDisplayAlerts($faultDecoded);
|
||||
|
||||
// clear existing records from player_faults table
|
||||
$this->getStore()->update('DELETE FROM `player_faults` WHERE displayId = :displayId', [
|
||||
'displayId' => $this->display->displayId
|
||||
]);
|
||||
|
||||
foreach ($faultDecoded as $faultAlert) {
|
||||
$sanitizedFaultAlert = $this->getSanitizer($faultAlert);
|
||||
|
||||
$incidentDt = $sanitizedFaultAlert->getDate(
|
||||
'date',
|
||||
['default' => Carbon::now()]
|
||||
)->format(DateFormatHelper::getSystemFormat());
|
||||
$expires = $sanitizedFaultAlert->getDate('expires', ['default' => null]);
|
||||
$code = $sanitizedFaultAlert->getInt('code');
|
||||
$reason = $sanitizedFaultAlert->getString('reason');
|
||||
$scheduleId = $sanitizedFaultAlert->getInt('scheduleId');
|
||||
$layoutId = $sanitizedFaultAlert->getInt('layoutId');
|
||||
$regionId = $sanitizedFaultAlert->getInt('regionId');
|
||||
$mediaId = $sanitizedFaultAlert->getInt('mediaId');
|
||||
$widgetId = $sanitizedFaultAlert->getInt('widgetId');
|
||||
|
||||
// Trim the reason if it is too long
|
||||
if (strlen($reason) >= 255) {
|
||||
$reason = substr($reason, 0, 255);
|
||||
}
|
||||
|
||||
try {
|
||||
$dbh = $this->getStore()->getConnection();
|
||||
|
||||
$insertSth = $dbh->prepare('
|
||||
INSERT INTO player_faults (displayId, incidentDt, expires, code, reason, scheduleId, layoutId, regionId, mediaId, widgetId)
|
||||
VALUES (:displayId, :incidentDt, :expires, :code, :reason, :scheduleId, :layoutId, :regionId, :mediaId, :widgetId)
|
||||
');
|
||||
|
||||
$insertSth->execute([
|
||||
'displayId' => $this->display->displayId,
|
||||
'incidentDt' => $incidentDt,
|
||||
'expires' => $expires,
|
||||
'code' => $code,
|
||||
'reason' => $reason,
|
||||
'scheduleId' => $scheduleId,
|
||||
'layoutId' => $layoutId,
|
||||
'regionId' => $regionId,
|
||||
'mediaId' => $mediaId,
|
||||
'widgetId' => $widgetId
|
||||
]);
|
||||
} catch (\Exception $e) {
|
||||
$this->getLog()->error('Unable to insert Player Faults records. ' . $e->getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$this->logBandwidth($this->display->displayId, Bandwidth::$REPORTFAULT, strlen($fault));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private function manageDisplayAlerts(array $newPlayerFaults)
|
||||
{
|
||||
// check current faults for player
|
||||
$currentFaults = $this->playerFaultFactory->getByDisplayId($this->display->displayId);
|
||||
|
||||
// if we had faults and now we no longer have any to add
|
||||
// set end date for any existing fault events
|
||||
// add display event for cleared all faults
|
||||
if (!empty($currentFaults) && empty($newPlayerFaults)) {
|
||||
$displayEvent = $this->displayEventFactory->createEmpty();
|
||||
$displayEvent->eventTypeId = $displayEvent->getEventIdFromString('Player Fault');
|
||||
$displayEvent->displayId = $this->display->displayId;
|
||||
// clear any open player fault events for this display
|
||||
$displayEvent->eventEnd($displayEvent->displayId, $displayEvent->eventTypeId);
|
||||
|
||||
// log new event for all faults cleared.
|
||||
$displayEvent->start = Carbon::now()->format('U');
|
||||
$displayEvent->end = Carbon::now()->format('U');
|
||||
$displayEvent->detail = __('All Player faults cleared');
|
||||
$displayEvent->save();
|
||||
} else if (empty($currentFaults) && !empty($newPlayerFaults)) {
|
||||
$codesAdded = [];
|
||||
// we do not have any faults currently, but new ones will be added
|
||||
foreach ($newPlayerFaults as $newPlayerFault) {
|
||||
$sanitizedFaultAlert = $this->getSanitizer($newPlayerFault);
|
||||
// if we do not have an alert for the specific code yet, add it
|
||||
if (!in_array($sanitizedFaultAlert->getInt('code'), $codesAdded)) {
|
||||
$this->addDisplayEvent($sanitizedFaultAlert);
|
||||
// keep track of added codes, we want a single alert per code
|
||||
$codesAdded[] = $sanitizedFaultAlert->getInt('code');
|
||||
}
|
||||
}
|
||||
} else if (!empty($newPlayerFaults) && !empty($currentFaults)) {
|
||||
// we have both existing faults and new faults
|
||||
$existingFaultsCodes = [];
|
||||
$newFaultCodes = [];
|
||||
$codesAdded = [];
|
||||
|
||||
// keep track of existing fault codes.
|
||||
foreach ($currentFaults as $currentFault) {
|
||||
$existingFaultsCodes[] = $currentFault->code;
|
||||
}
|
||||
|
||||
// go through new faults
|
||||
foreach ($newPlayerFaults as $newPlayerFault) {
|
||||
$sanitizedFaultAlert = $this->getSanitizer($newPlayerFault);
|
||||
$newFaultCodes[] = $sanitizedFaultAlert->getInt('code');
|
||||
// if it already exists, we do not do anything with alerts
|
||||
// if it is a new code and was not added already
|
||||
// add it now
|
||||
if (!in_array($sanitizedFaultAlert->getInt('code'), $existingFaultsCodes)
|
||||
&& !in_array($sanitizedFaultAlert->getInt('code'), $codesAdded)
|
||||
) {
|
||||
$this->addDisplayEvent($sanitizedFaultAlert);
|
||||
// keep track of added codes, we want a single alert per code
|
||||
$codesAdded[] = $sanitizedFaultAlert->getInt('code');
|
||||
}
|
||||
}
|
||||
|
||||
// go through any existing codes that are no longer reported
|
||||
// update the end date on all of them.
|
||||
foreach (array_diff($existingFaultsCodes, $newFaultCodes) as $code) {
|
||||
$displayEvent = $this->displayEventFactory->createEmpty();
|
||||
$displayEvent->eventEndByReference(
|
||||
$this->display->displayId,
|
||||
$displayEvent->getEventIdFromString('Player Fault'),
|
||||
$code
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function addDisplayEvent(SanitizerInterface $sanitizedFaultAlert)
|
||||
{
|
||||
$this->getLog()->debug(
|
||||
sprintf(
|
||||
'displayEvent : add new display alert for player fault code %d and displayId %d',
|
||||
$sanitizedFaultAlert->getInt('code'),
|
||||
$this->display->displayId
|
||||
)
|
||||
);
|
||||
|
||||
$displayEvent = $this->displayEventFactory->createEmpty();
|
||||
$displayEvent->eventTypeId = $displayEvent->getEventIdFromString('Player Fault');
|
||||
$displayEvent->displayId = $this->display->displayId;
|
||||
$displayEvent->start = $sanitizedFaultAlert->getDate(
|
||||
'date',
|
||||
['default' => Carbon::now()]
|
||||
)->format('U');
|
||||
$displayEvent->end = null;
|
||||
$displayEvent->detail = $sanitizedFaultAlert->getString('reason');
|
||||
$displayEvent->refId = $sanitizedFaultAlert->getInt('code');
|
||||
$displayEvent->save();
|
||||
}
|
||||
}
|
||||
324
lib/Xmds/Soap7.php
Normal file
324
lib/Xmds/Soap7.php
Normal file
@@ -0,0 +1,324 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2025 Xibo Signage Ltd
|
||||
*
|
||||
* Xibo - Digital Signage - https://xibosignage.com
|
||||
*
|
||||
* This file is part of Xibo.
|
||||
*
|
||||
* Xibo is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* any later version.
|
||||
*
|
||||
* Xibo is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Xibo. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace Xibo\Xmds;
|
||||
|
||||
use Xibo\Entity\Bandwidth;
|
||||
use Xibo\Event\XmdsWeatherRequestEvent;
|
||||
use Xibo\Helper\LinkSigner;
|
||||
use Xibo\Support\Exception\GeneralException;
|
||||
use Xibo\Support\Exception\NotFoundException;
|
||||
|
||||
/**
|
||||
* Class Soap7
|
||||
* @package Xibo\Xmds
|
||||
*
|
||||
* @phpcs:disable PSR1.Methods.CamelCapsMethodName.NotCamelCaps
|
||||
*/
|
||||
class Soap7 extends Soap6
|
||||
{
|
||||
/**
|
||||
* @inheritDoc
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function RequiredFiles($serverKey, $hardwareKey)
|
||||
{
|
||||
$httpDownloads = ($this->getConfig()->getSetting('SENDFILE_MODE') != 'Off');
|
||||
return $this->doRequiredFiles($serverKey, $hardwareKey, $httpDownloads, true, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
* @noinspection PhpMissingParentCallCommonInspection
|
||||
*/
|
||||
public function GetResource($serverKey, $hardwareKey, $layoutId, $regionId, $mediaId)
|
||||
{
|
||||
return $this->doGetResource($serverKey, $hardwareKey, $layoutId, $regionId, $mediaId, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get player dependencies.
|
||||
* @param $serverKey
|
||||
* @param $hardwareKey
|
||||
* @param $fileType
|
||||
* @param $id
|
||||
* @param $chunkOffset
|
||||
* @param $chunkSize
|
||||
* @return string
|
||||
* @throws NotFoundException
|
||||
* @throws \SoapFault
|
||||
*/
|
||||
public function GetDependency($serverKey, $hardwareKey, $fileType, $id, $chunkOffset, $chunkSize)
|
||||
{
|
||||
return $this->GetFile($serverKey, $hardwareKey, $id, $fileType, $chunkOffset, $chunkSize, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Data for a widget
|
||||
* @param $serverKey
|
||||
* @param $hardwareKey
|
||||
* @param $widgetId
|
||||
* @return false|string
|
||||
* @throws NotFoundException
|
||||
* @throws \SoapFault
|
||||
*/
|
||||
public function GetData($serverKey, $hardwareKey, $widgetId)
|
||||
{
|
||||
$this->logProcessor->setRoute('GetData');
|
||||
$sanitizer = $this->getSanitizer([
|
||||
'serverKey' => $serverKey,
|
||||
'hardwareKey' => $hardwareKey,
|
||||
'widgetId' => $widgetId,
|
||||
]);
|
||||
|
||||
// Sanitize
|
||||
$serverKey = $sanitizer->getString('serverKey');
|
||||
$hardwareKey = $sanitizer->getString('hardwareKey');
|
||||
$widgetId = $sanitizer->getInt('widgetId');
|
||||
|
||||
// Check the serverKey matches
|
||||
if ($serverKey != $this->getConfig()->getSetting('SERVER_KEY')) {
|
||||
throw new \SoapFault(
|
||||
'Sender',
|
||||
'The Server key you entered does not match with the server key at this address'
|
||||
);
|
||||
}
|
||||
|
||||
// Auth this request...
|
||||
if (!$this->authDisplay($hardwareKey)) {
|
||||
throw new \SoapFault('Receiver', 'This Display is not authorised.');
|
||||
}
|
||||
|
||||
// Now that we authenticated the Display, make sure we are sticking to our bandwidth limit
|
||||
if (!$this->checkBandwidth($this->display->displayId)) {
|
||||
throw new \SoapFault('Receiver', 'Bandwidth Limit exceeded');
|
||||
}
|
||||
|
||||
// The MediaId is actually the widgetId
|
||||
try {
|
||||
$requiredFile = $this->requiredFileFactory->getByDisplayAndWidget(
|
||||
$this->display->displayId,
|
||||
$widgetId,
|
||||
'D',
|
||||
);
|
||||
|
||||
$widget = $this->widgetFactory->loadByWidgetId($widgetId);
|
||||
|
||||
$module = $this->moduleFactory->getByType($widget->type);
|
||||
|
||||
// We just want the data.
|
||||
$dataModule = $this->moduleFactory->getByType($widget->type);
|
||||
if ($dataModule->isDataProviderExpected()) {
|
||||
// We only ever return cache.
|
||||
$dataProvider = $module->createDataProvider($widget);
|
||||
$dataProvider->setDisplayProperties(
|
||||
$this->display->latitude ?: $this->getConfig()->getSetting('DEFAULT_LAT'),
|
||||
$this->display->longitude ?: $this->getConfig()->getSetting('DEFAULT_LONG'),
|
||||
$this->display->displayId
|
||||
);
|
||||
|
||||
// We only __ever__ return cache from XMDS.
|
||||
try {
|
||||
$cacheKey = $this->moduleFactory->determineCacheKey(
|
||||
$module,
|
||||
$widget,
|
||||
$this->display->displayId,
|
||||
$dataProvider,
|
||||
$module->getWidgetProviderOrNull()
|
||||
);
|
||||
|
||||
$widgetDataProviderCache = $this->moduleFactory->createWidgetDataProviderCache();
|
||||
|
||||
// We do not pass a modifiedDt in here because we always expect to be cached.
|
||||
if (!$widgetDataProviderCache->decorateWithCache($dataProvider, $cacheKey, null, false)) {
|
||||
throw new NotFoundException('Cache not ready');
|
||||
}
|
||||
|
||||
$this->getLog()->debug('Cache ready and populated');
|
||||
|
||||
// Get media references
|
||||
$media = [];
|
||||
$requiredFiles = [];
|
||||
$mediaIds = $widgetDataProviderCache->getCachedMediaIds();
|
||||
$cdnUrl = $this->configService->getSetting('CDN_URL');
|
||||
|
||||
if (count($mediaIds) > 0) {
|
||||
$this->getLog()->debug('Processing media links');
|
||||
|
||||
$sql = '
|
||||
SELECT `media`.`mediaId`,
|
||||
`media`.`storedAs`,
|
||||
`media`.`fileSize`,
|
||||
`media`.`released`,
|
||||
`media`.`md5`,
|
||||
`display_media`.`mediaId` AS displayMediaId
|
||||
FROM `media`
|
||||
LEFT OUTER JOIN `display_media`
|
||||
ON `display_media`.`mediaId` = `media`.`mediaId`
|
||||
AND `display_media`.`displayId` = :displayId
|
||||
WHERE `media`.`mediaId` IN ( ' . implode(',', $mediaIds) . ')
|
||||
';
|
||||
|
||||
// There isn't any point using a prepared statement because the widgetIds are substituted
|
||||
// at runtime
|
||||
foreach ($this->getStore()->select($sql, [
|
||||
'displayId' => $this->display->displayId
|
||||
]) as $row) {
|
||||
// Media to use for decorating the JSON file.
|
||||
$media[$row['mediaId']] = $row['storedAs'];
|
||||
|
||||
// Only media we're interested in.
|
||||
if (!in_array($row['displayMediaId'], $mediaIds)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Output required file nodes for any media used in get data.
|
||||
// these will appear in required files as well, and may already be downloaded.
|
||||
$released = intval($row['released']);
|
||||
$this->requiredFileFactory
|
||||
->createForMedia(
|
||||
$this->display->displayId,
|
||||
$row['mediaId'],
|
||||
$row['fileSize'],
|
||||
$row['storedAs'],
|
||||
$released
|
||||
)
|
||||
->save();
|
||||
|
||||
// skip media which has released == 0 or 2
|
||||
if ($released == 0 || $released == 2) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Add the file node
|
||||
$requiredFiles[] = [
|
||||
'id' => intval($row['mediaId']),
|
||||
'size' => intval($row['fileSize']),
|
||||
'md5' => $row['md5'],
|
||||
'saveAs' => $row['storedAs'],
|
||||
'path' => LinkSigner::generateSignedLink(
|
||||
$this->display,
|
||||
$this->configService->getApiKeyDetails()['encryptionKey'],
|
||||
$cdnUrl,
|
||||
'M',
|
||||
intval($row['mediaId']),
|
||||
$row['storedAs'],
|
||||
),
|
||||
];
|
||||
}
|
||||
} else {
|
||||
$this->getLog()->debug('No media links');
|
||||
}
|
||||
|
||||
$resource = json_encode([
|
||||
'data' => $widgetDataProviderCache->decorateForPlayer(
|
||||
$this->configService,
|
||||
$this->display,
|
||||
$this->configService->getApiKeyDetails()['encryptionKey'],
|
||||
$dataProvider->getData(),
|
||||
$media,
|
||||
),
|
||||
'meta' => $dataProvider->getMeta(),
|
||||
'files' => $requiredFiles,
|
||||
]);
|
||||
} catch (GeneralException $exception) {
|
||||
$this->getLog()->error('getData: Failed to get data cache for widgetId '
|
||||
. $widget->widgetId . ', e = ' . $exception->getMessage());
|
||||
throw new \SoapFault('Receiver', 'Cache not ready');
|
||||
}
|
||||
} else {
|
||||
// No data cached yet, exception
|
||||
throw new \SoapFault('Receiver', 'Cache not ready');
|
||||
}
|
||||
|
||||
// Log bandwidth
|
||||
$requiredFile->bytesRequested = $requiredFile->bytesRequested + strlen($resource);
|
||||
$requiredFile->save();
|
||||
} catch (NotFoundException) {
|
||||
throw new \SoapFault('Receiver', 'Requested an invalid file.');
|
||||
} catch (\Exception $e) {
|
||||
if ($e instanceof \SoapFault) {
|
||||
return $e;
|
||||
}
|
||||
|
||||
$this->getLog()->error('Unknown error during getData. E = ' . $e->getMessage());
|
||||
$this->getLog()->debug($e->getTraceAsString());
|
||||
throw new \SoapFault('Receiver', 'Unable to get the media resource');
|
||||
}
|
||||
|
||||
// Log Bandwidth
|
||||
$this->logBandwidth($this->display->displayId, Bandwidth::$GET_DATA, strlen($resource));
|
||||
|
||||
return $resource;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Weather data for Display
|
||||
* @param $serverKey
|
||||
* @param $hardwareKey
|
||||
* @return string
|
||||
* @throws \SoapFault
|
||||
*/
|
||||
public function GetWeather($serverKey, $hardwareKey): string
|
||||
{
|
||||
$this->logProcessor->setRoute('GetWeather');
|
||||
$sanitizer = $this->getSanitizer([
|
||||
'serverKey' => $serverKey,
|
||||
'hardwareKey' => $hardwareKey,
|
||||
]);
|
||||
|
||||
// Sanitize
|
||||
$serverKey = $sanitizer->getString('serverKey');
|
||||
$hardwareKey = $sanitizer->getString('hardwareKey');
|
||||
|
||||
// Check the serverKey matches
|
||||
if ($serverKey != $this->getConfig()->getSetting('SERVER_KEY')) {
|
||||
throw new \SoapFault(
|
||||
'Sender',
|
||||
'The Server key you entered does not match with the server key at this address'
|
||||
);
|
||||
}
|
||||
|
||||
// Auth this request...
|
||||
if (!$this->authDisplay($hardwareKey)) {
|
||||
throw new \SoapFault('Receiver', 'This Display is not authorised.');
|
||||
}
|
||||
|
||||
$latitude = $this->display->latitude;
|
||||
$longitude = $this->display->longitude;
|
||||
|
||||
// check for coordinates if present
|
||||
if ($latitude && $longitude) {
|
||||
// Dispatch an event to initialize weather data.
|
||||
$event = new XmdsWeatherRequestEvent($latitude, $longitude);
|
||||
$this->getDispatcher()->dispatch($event, XmdsWeatherRequestEvent::$NAME);
|
||||
} else {
|
||||
throw new \SoapFault(
|
||||
'Receiver',
|
||||
'Display coordinates is not configured'
|
||||
);
|
||||
}
|
||||
|
||||
// return weather data
|
||||
return $event->getWeatherData();
|
||||
}
|
||||
}
|
||||
73
lib/Xmds/Wsdl.php
Normal file
73
lib/Xmds/Wsdl.php
Normal file
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (C) 2025 Xibo Signage Ltd
|
||||
*
|
||||
* Xibo - Digital Signage - https://xibosignage.com
|
||||
*
|
||||
* This file is part of Xibo.
|
||||
*
|
||||
* Xibo is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* any later version.
|
||||
*
|
||||
* Xibo is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with Xibo. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
namespace Xibo\Xmds;
|
||||
|
||||
|
||||
use Xibo\Helper\HttpsDetect;
|
||||
|
||||
class Wsdl
|
||||
{
|
||||
private $path;
|
||||
private $version;
|
||||
|
||||
/**
|
||||
* Wsdl
|
||||
* @param $path
|
||||
* @param $version
|
||||
*/
|
||||
public function __construct($path, $version)
|
||||
{
|
||||
$this->path = $path;
|
||||
$this->version = $version;
|
||||
}
|
||||
|
||||
public function output()
|
||||
{
|
||||
// We need to buffer the output so that we can send a Content-Length header with the WSDL
|
||||
ob_start();
|
||||
$wsdl = file_get_contents($this->path);
|
||||
$wsdl = str_replace('{{XMDS_LOCATION}}', $this->getRoot() . '?v=' . $this->version, $wsdl);
|
||||
echo $wsdl;
|
||||
|
||||
// Get the contents of the buffer and work out its length
|
||||
$buffer = ob_get_contents();
|
||||
$length = strlen($buffer);
|
||||
|
||||
// Output the headers
|
||||
header('Content-Type: text/xml; charset=ISO-8859-1\r\n');
|
||||
header('Content-Length: ' . $length);
|
||||
|
||||
// Flush the buffer
|
||||
ob_end_flush();
|
||||
}
|
||||
|
||||
/**
|
||||
* get Root url
|
||||
* @return string
|
||||
*/
|
||||
public static function getRoot(): string
|
||||
{
|
||||
return (new HttpsDetect())->getBaseUrl();
|
||||
}
|
||||
}
|
||||
232
lib/Xmds/service_v3.wsdl
Normal file
232
lib/Xmds/service_v3.wsdl
Normal file
@@ -0,0 +1,232 @@
|
||||
<definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="urn:xmds"
|
||||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/"
|
||||
targetNamespace="urn:xmds">
|
||||
<types>
|
||||
<xsd:schema targetNamespace="urn:xmds">
|
||||
<xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
|
||||
<xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" />
|
||||
</xsd:schema>
|
||||
</types>
|
||||
<message name="RegisterDisplayRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="displayName" type="xsd:string" />
|
||||
<part name="version" type="xsd:string" />
|
||||
</message>
|
||||
<message name="RegisterDisplayResponse">
|
||||
<part name="ActivationMessage" type="xsd:string" />
|
||||
</message>
|
||||
<message name="RequiredFilesRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="version" type="xsd:string" />
|
||||
</message>
|
||||
<message name="RequiredFilesResponse">
|
||||
<part name="RequiredFilesXml" type="xsd:string" />
|
||||
</message>
|
||||
<message name="GetFileRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="filePath" type="xsd:string" />
|
||||
<part name="fileType" type="xsd:string" />
|
||||
<part name="chunkOffset" type="xsd:int" />
|
||||
<part name="chuckSize" type="xsd:int" />
|
||||
<part name="version" type="xsd:string" />
|
||||
</message>
|
||||
<message name="GetFileResponse">
|
||||
<part name="file" type="xsd:base64Binary" />
|
||||
</message>
|
||||
<message name="ScheduleRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="version" type="xsd:string" />
|
||||
</message>
|
||||
<message name="ScheduleResponse">
|
||||
<part name="ScheduleXml" type="xsd:string" />
|
||||
</message>
|
||||
<message name="BlackListRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="mediaId" type="xsd:int" />
|
||||
<part name="type" type="xsd:string" />
|
||||
<part name="reason" type="xsd:string" />
|
||||
<part name="version" type="xsd:string" />
|
||||
</message>
|
||||
<message name="BlackListResponse">
|
||||
<part name="success" type="xsd:boolean" />
|
||||
</message>
|
||||
<message name="SubmitLogRequest">
|
||||
<part name="version" type="xsd:string" />
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="logXml" type="xsd:string" />
|
||||
</message>
|
||||
<message name="SubmitLogResponse">
|
||||
<part name="success" type="xsd:boolean" />
|
||||
</message>
|
||||
<message name="SubmitStatsRequest">
|
||||
<part name="version" type="xsd:string" />
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="statXml" type="xsd:string" />
|
||||
</message>
|
||||
<message name="SubmitStatsResponse">
|
||||
<part name="success" type="xsd:boolean" />
|
||||
</message>
|
||||
<message name="MediaInventoryRequest">
|
||||
<part name="version" type="xsd:string" />
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="mediaInventory" type="xsd:string" />
|
||||
</message>
|
||||
<message name="MediaInventoryResponse">
|
||||
<part name="success" type="xsd:boolean" />
|
||||
</message>
|
||||
<message name="GetResourceRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="layoutId" type="xsd:int" />
|
||||
<part name="regionId" type="xsd:string" />
|
||||
<part name="mediaId" type="xsd:string" />
|
||||
<part name="version" type="xsd:string" />
|
||||
</message>
|
||||
<message name="GetResourceResponse">
|
||||
<part name="resource" type="xsd:string" />
|
||||
</message>
|
||||
<portType name="xmdsPortType">
|
||||
<operation name="RegisterDisplay">
|
||||
<documentation>Register the Display with the CMS</documentation>
|
||||
<input message="tns:RegisterDisplayRequest"/>
|
||||
<output message="tns:RegisterDisplayResponse"/>
|
||||
</operation>
|
||||
<operation name="RequiredFiles">
|
||||
<documentation>The files required by the requesting display</documentation>
|
||||
<input message="tns:RequiredFilesRequest"/>
|
||||
<output message="tns:RequiredFilesResponse"/>
|
||||
</operation>
|
||||
<operation name="GetFile">
|
||||
<documentation>Gets the file requested</documentation>
|
||||
<input message="tns:GetFileRequest"/>
|
||||
<output message="tns:GetFileResponse"/>
|
||||
</operation>
|
||||
<operation name="Schedule">
|
||||
<documentation>Gets the schedule</documentation>
|
||||
<input message="tns:ScheduleRequest"/>
|
||||
<output message="tns:ScheduleResponse"/>
|
||||
</operation>
|
||||
<operation name="BlackList">
|
||||
<documentation>Set media to be blacklisted</documentation>
|
||||
<input message="tns:BlackListRequest"/>
|
||||
<output message="tns:BlackListResponse"/>
|
||||
</operation>
|
||||
<operation name="SubmitLog">
|
||||
<documentation>Submit Logging from the Client</documentation>
|
||||
<input message="tns:SubmitLogRequest"/>
|
||||
<output message="tns:SubmitLogResponse"/>
|
||||
</operation>
|
||||
<operation name="SubmitStats">
|
||||
<documentation>Submit Display statistics from the Client</documentation>
|
||||
<input message="tns:SubmitStatsRequest"/>
|
||||
<output message="tns:SubmitStatsResponse"/>
|
||||
</operation>
|
||||
<operation name="MediaInventory">
|
||||
<documentation>Report back the clients MediaInventory</documentation>
|
||||
<input message="tns:MediaInventoryRequest" />
|
||||
<output message="tns:MediaInventoryResponse" />
|
||||
</operation>
|
||||
<operation name="GetResource">
|
||||
<documentation>Gets the file requested</documentation>
|
||||
<input message="tns:GetResourceRequest"/>
|
||||
<output message="tns:GetResourceResponse"/>
|
||||
</operation>
|
||||
</portType>
|
||||
<binding name="xmdsBinding" type="tns:xmdsPortType">
|
||||
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
<operation name="RegisterDisplay">
|
||||
<soap:operation soapAction="urn:xmds#RegisterDisplay" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="RequiredFiles">
|
||||
<soap:operation soapAction="urn:xmds#RequiredFiles" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="GetFile">
|
||||
<soap:operation soapAction="urn:xmds#GetFile" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="Schedule">
|
||||
<soap:operation soapAction="urn:xmds#Schedule" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="BlackList">
|
||||
<soap:operation soapAction="urn:xmds#BlackList" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="SubmitLog">
|
||||
<soap:operation soapAction="urn:xmds#SubmitLog" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="SubmitStats">
|
||||
<soap:operation soapAction="urn:xmds#SubmitLog" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="MediaInventory">
|
||||
<soap:operation soapAction="urn:xmds#MediaInventory" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="GetResource">
|
||||
<soap:operation soapAction="urn:xmds#GetResource" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
</binding>
|
||||
<service name="xmds">
|
||||
<port name="xmdsPort" binding="tns:xmdsBinding">
|
||||
<soap:address location="{{XMDS_LOCATION}}"/>
|
||||
</port>
|
||||
</service>
|
||||
</definitions>
|
||||
272
lib/Xmds/service_v4.wsdl
Normal file
272
lib/Xmds/service_v4.wsdl
Normal file
@@ -0,0 +1,272 @@
|
||||
<definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="urn:xmds"
|
||||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/"
|
||||
targetNamespace="urn:xmds">
|
||||
<types>
|
||||
<xsd:schema targetNamespace="urn:xmds">
|
||||
<xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
|
||||
<xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" />
|
||||
</xsd:schema>
|
||||
</types>
|
||||
<message name="RegisterDisplayRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="displayName" type="xsd:string" />
|
||||
<part name="clientType" type="xsd:string" />
|
||||
<part name="clientVersion" type="xsd:string" />
|
||||
<part name="clientCode" type="xsd:int" />
|
||||
<part name="operatingSystem" type="xsd:string" />
|
||||
<part name="macAddress" type="xsd:string" />
|
||||
</message>
|
||||
<message name="RegisterDisplayResponse">
|
||||
<part name="ActivationMessage" type="xsd:string" />
|
||||
</message>
|
||||
<message name="RequiredFilesRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
</message>
|
||||
<message name="RequiredFilesResponse">
|
||||
<part name="RequiredFilesXml" type="xsd:string" />
|
||||
</message>
|
||||
<message name="GetFileRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="fileId" type="xsd:int" />
|
||||
<part name="fileType" type="xsd:string" />
|
||||
<part name="chunkOffset" type="xsd:double" />
|
||||
<part name="chuckSize" type="xsd:double" />
|
||||
</message>
|
||||
<message name="GetFileResponse">
|
||||
<part name="file" type="xsd:base64Binary" />
|
||||
</message>
|
||||
<message name="ScheduleRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
</message>
|
||||
<message name="ScheduleResponse">
|
||||
<part name="ScheduleXml" type="xsd:string" />
|
||||
</message>
|
||||
<message name="BlackListRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="mediaId" type="xsd:int" />
|
||||
<part name="type" type="xsd:string" />
|
||||
<part name="reason" type="xsd:string" />
|
||||
</message>
|
||||
<message name="BlackListResponse">
|
||||
<part name="success" type="xsd:boolean" />
|
||||
</message>
|
||||
<message name="SubmitLogRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="logXml" type="xsd:string" />
|
||||
</message>
|
||||
<message name="SubmitLogResponse">
|
||||
<part name="success" type="xsd:boolean" />
|
||||
</message>
|
||||
<message name="SubmitStatsRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="statXml" type="xsd:string" />
|
||||
</message>
|
||||
<message name="SubmitStatsResponse">
|
||||
<part name="success" type="xsd:boolean" />
|
||||
</message>
|
||||
<message name="MediaInventoryRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="mediaInventory" type="xsd:string" />
|
||||
</message>
|
||||
<message name="MediaInventoryResponse">
|
||||
<part name="success" type="xsd:boolean" />
|
||||
</message>
|
||||
<message name="GetResourceRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="layoutId" type="xsd:int" />
|
||||
<part name="regionId" type="xsd:string" />
|
||||
<part name="mediaId" type="xsd:string" />
|
||||
</message>
|
||||
<message name="GetResourceResponse">
|
||||
<part name="resource" type="xsd:string" />
|
||||
</message>
|
||||
<message name="NotifyStatusRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="status" type="xsd:string" />
|
||||
</message>
|
||||
<message name="NotifyStatusResponse">
|
||||
<part name="success" type="xsd:boolean" />
|
||||
</message>
|
||||
<message name="SubmitScreenShotRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="screenShot" type="xsd:base64Binary" />
|
||||
</message>
|
||||
<message name="SubmitScreenShotResponse">
|
||||
<part name="success" type="xsd:boolean" />
|
||||
</message>
|
||||
<portType name="xmdsPortType">
|
||||
<operation name="RegisterDisplay">
|
||||
<documentation>Register the Display with the CMS</documentation>
|
||||
<input message="tns:RegisterDisplayRequest"/>
|
||||
<output message="tns:RegisterDisplayResponse"/>
|
||||
</operation>
|
||||
<operation name="RequiredFiles">
|
||||
<documentation>The files required by the requesting display</documentation>
|
||||
<input message="tns:RequiredFilesRequest"/>
|
||||
<output message="tns:RequiredFilesResponse"/>
|
||||
</operation>
|
||||
<operation name="GetFile">
|
||||
<documentation>Gets the file requested</documentation>
|
||||
<input message="tns:GetFileRequest"/>
|
||||
<output message="tns:GetFileResponse"/>
|
||||
</operation>
|
||||
<operation name="Schedule">
|
||||
<documentation>Gets the schedule</documentation>
|
||||
<input message="tns:ScheduleRequest"/>
|
||||
<output message="tns:ScheduleResponse"/>
|
||||
</operation>
|
||||
<operation name="BlackList">
|
||||
<documentation>Set media to be blacklisted</documentation>
|
||||
<input message="tns:BlackListRequest"/>
|
||||
<output message="tns:BlackListResponse"/>
|
||||
</operation>
|
||||
<operation name="SubmitLog">
|
||||
<documentation>Submit Logging from the Client</documentation>
|
||||
<input message="tns:SubmitLogRequest"/>
|
||||
<output message="tns:SubmitLogResponse"/>
|
||||
</operation>
|
||||
<operation name="SubmitStats">
|
||||
<documentation>Submit Display statistics from the Client</documentation>
|
||||
<input message="tns:SubmitStatsRequest"/>
|
||||
<output message="tns:SubmitStatsResponse"/>
|
||||
</operation>
|
||||
<operation name="MediaInventory">
|
||||
<documentation>Report back the clients MediaInventory</documentation>
|
||||
<input message="tns:MediaInventoryRequest" />
|
||||
<output message="tns:MediaInventoryResponse" />
|
||||
</operation>
|
||||
<operation name="GetResource">
|
||||
<documentation>Gets the file requested</documentation>
|
||||
<input message="tns:GetResourceRequest"/>
|
||||
<output message="tns:GetResourceResponse"/>
|
||||
</operation>
|
||||
<operation name="NotifyStatus">
|
||||
<documentation>Report back the current status</documentation>
|
||||
<input message="tns:NotifyStatusRequest"/>
|
||||
<output message="tns:NotifyStatusResponse"/>
|
||||
</operation>
|
||||
<operation name="SubmitScreenShot">
|
||||
<documentation>Submit a screen shot for a display</documentation>
|
||||
<input message="tns:SubmitScreenShotRequest"/>
|
||||
<output message="tns:SubmitScreenShotResponse"/>
|
||||
</operation>
|
||||
</portType>
|
||||
<binding name="xmdsBinding" type="tns:xmdsPortType">
|
||||
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
<operation name="RegisterDisplay">
|
||||
<soap:operation soapAction="urn:xmds#RegisterDisplay" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="RequiredFiles">
|
||||
<soap:operation soapAction="urn:xmds#RequiredFiles" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="GetFile">
|
||||
<soap:operation soapAction="urn:xmds#GetFile" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="Schedule">
|
||||
<soap:operation soapAction="urn:xmds#Schedule" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="BlackList">
|
||||
<soap:operation soapAction="urn:xmds#BlackList" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="SubmitLog">
|
||||
<soap:operation soapAction="urn:xmds#SubmitLog" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="SubmitStats">
|
||||
<soap:operation soapAction="urn:xmds#SubmitLog" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="MediaInventory">
|
||||
<soap:operation soapAction="urn:xmds#MediaInventory" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="GetResource">
|
||||
<soap:operation soapAction="urn:xmds#GetResource" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="NotifyStatus">
|
||||
<soap:operation soapAction="urn:xmds#NotifyStatus" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="SubmitScreenShot">
|
||||
<soap:operation soapAction="urn:xmds#SubmitScreenShot" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
</binding>
|
||||
<service name="xmds">
|
||||
<port name="xmdsPort" binding="tns:xmdsBinding">
|
||||
<soap:address location="{{XMDS_LOCATION}}"/>
|
||||
</port>
|
||||
</service>
|
||||
</definitions>
|
||||
274
lib/Xmds/service_v5.wsdl
Normal file
274
lib/Xmds/service_v5.wsdl
Normal file
@@ -0,0 +1,274 @@
|
||||
<definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="urn:xmds"
|
||||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/"
|
||||
targetNamespace="urn:xmds">
|
||||
<types>
|
||||
<xsd:schema targetNamespace="urn:xmds">
|
||||
<xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
|
||||
<xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" />
|
||||
</xsd:schema>
|
||||
</types>
|
||||
<message name="RegisterDisplayRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="displayName" type="xsd:string" />
|
||||
<part name="clientType" type="xsd:string" />
|
||||
<part name="clientVersion" type="xsd:string" />
|
||||
<part name="clientCode" type="xsd:int" />
|
||||
<part name="operatingSystem" type="xsd:string" />
|
||||
<part name="macAddress" type="xsd:string" />
|
||||
<part name="xmrChannel" type="xsd:string" />
|
||||
<part name="xmrPubKey" type="xsd:string" />
|
||||
</message>
|
||||
<message name="RegisterDisplayResponse">
|
||||
<part name="ActivationMessage" type="xsd:string" />
|
||||
</message>
|
||||
<message name="RequiredFilesRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
</message>
|
||||
<message name="RequiredFilesResponse">
|
||||
<part name="RequiredFilesXml" type="xsd:string" />
|
||||
</message>
|
||||
<message name="GetFileRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="fileId" type="xsd:int" />
|
||||
<part name="fileType" type="xsd:string" />
|
||||
<part name="chunkOffset" type="xsd:double" />
|
||||
<part name="chuckSize" type="xsd:double" />
|
||||
</message>
|
||||
<message name="GetFileResponse">
|
||||
<part name="file" type="xsd:base64Binary" />
|
||||
</message>
|
||||
<message name="ScheduleRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
</message>
|
||||
<message name="ScheduleResponse">
|
||||
<part name="ScheduleXml" type="xsd:string" />
|
||||
</message>
|
||||
<message name="BlackListRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="mediaId" type="xsd:int" />
|
||||
<part name="type" type="xsd:string" />
|
||||
<part name="reason" type="xsd:string" />
|
||||
</message>
|
||||
<message name="BlackListResponse">
|
||||
<part name="success" type="xsd:boolean" />
|
||||
</message>
|
||||
<message name="SubmitLogRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="logXml" type="xsd:string" />
|
||||
</message>
|
||||
<message name="SubmitLogResponse">
|
||||
<part name="success" type="xsd:boolean" />
|
||||
</message>
|
||||
<message name="SubmitStatsRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="statXml" type="xsd:string" />
|
||||
</message>
|
||||
<message name="SubmitStatsResponse">
|
||||
<part name="success" type="xsd:boolean" />
|
||||
</message>
|
||||
<message name="MediaInventoryRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="mediaInventory" type="xsd:string" />
|
||||
</message>
|
||||
<message name="MediaInventoryResponse">
|
||||
<part name="success" type="xsd:boolean" />
|
||||
</message>
|
||||
<message name="GetResourceRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="layoutId" type="xsd:int" />
|
||||
<part name="regionId" type="xsd:string" />
|
||||
<part name="mediaId" type="xsd:string" />
|
||||
</message>
|
||||
<message name="GetResourceResponse">
|
||||
<part name="resource" type="xsd:string" />
|
||||
</message>
|
||||
<message name="NotifyStatusRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="status" type="xsd:string" />
|
||||
</message>
|
||||
<message name="NotifyStatusResponse">
|
||||
<part name="success" type="xsd:boolean" />
|
||||
</message>
|
||||
<message name="SubmitScreenShotRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="screenShot" type="xsd:base64Binary" />
|
||||
</message>
|
||||
<message name="SubmitScreenShotResponse">
|
||||
<part name="success" type="xsd:boolean" />
|
||||
</message>
|
||||
<portType name="xmdsPortType">
|
||||
<operation name="RegisterDisplay">
|
||||
<documentation>Register the Display with the CMS</documentation>
|
||||
<input message="tns:RegisterDisplayRequest"/>
|
||||
<output message="tns:RegisterDisplayResponse"/>
|
||||
</operation>
|
||||
<operation name="RequiredFiles">
|
||||
<documentation>The files required by the requesting display</documentation>
|
||||
<input message="tns:RequiredFilesRequest"/>
|
||||
<output message="tns:RequiredFilesResponse"/>
|
||||
</operation>
|
||||
<operation name="GetFile">
|
||||
<documentation>Gets the file requested</documentation>
|
||||
<input message="tns:GetFileRequest"/>
|
||||
<output message="tns:GetFileResponse"/>
|
||||
</operation>
|
||||
<operation name="Schedule">
|
||||
<documentation>Gets the schedule</documentation>
|
||||
<input message="tns:ScheduleRequest"/>
|
||||
<output message="tns:ScheduleResponse"/>
|
||||
</operation>
|
||||
<operation name="BlackList">
|
||||
<documentation>Set media to be blacklisted</documentation>
|
||||
<input message="tns:BlackListRequest"/>
|
||||
<output message="tns:BlackListResponse"/>
|
||||
</operation>
|
||||
<operation name="SubmitLog">
|
||||
<documentation>Submit Logging from the Client</documentation>
|
||||
<input message="tns:SubmitLogRequest"/>
|
||||
<output message="tns:SubmitLogResponse"/>
|
||||
</operation>
|
||||
<operation name="SubmitStats">
|
||||
<documentation>Submit Display statistics from the Client</documentation>
|
||||
<input message="tns:SubmitStatsRequest"/>
|
||||
<output message="tns:SubmitStatsResponse"/>
|
||||
</operation>
|
||||
<operation name="MediaInventory">
|
||||
<documentation>Report back the clients MediaInventory</documentation>
|
||||
<input message="tns:MediaInventoryRequest" />
|
||||
<output message="tns:MediaInventoryResponse" />
|
||||
</operation>
|
||||
<operation name="GetResource">
|
||||
<documentation>Gets the file requested</documentation>
|
||||
<input message="tns:GetResourceRequest"/>
|
||||
<output message="tns:GetResourceResponse"/>
|
||||
</operation>
|
||||
<operation name="NotifyStatus">
|
||||
<documentation>Report back the current status</documentation>
|
||||
<input message="tns:NotifyStatusRequest"/>
|
||||
<output message="tns:NotifyStatusResponse"/>
|
||||
</operation>
|
||||
<operation name="SubmitScreenShot">
|
||||
<documentation>Submit a screen shot for a display</documentation>
|
||||
<input message="tns:SubmitScreenShotRequest"/>
|
||||
<output message="tns:SubmitScreenShotResponse"/>
|
||||
</operation>
|
||||
</portType>
|
||||
<binding name="xmdsBinding" type="tns:xmdsPortType">
|
||||
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
<operation name="RegisterDisplay">
|
||||
<soap:operation soapAction="urn:xmds#RegisterDisplay" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="RequiredFiles">
|
||||
<soap:operation soapAction="urn:xmds#RequiredFiles" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="GetFile">
|
||||
<soap:operation soapAction="urn:xmds#GetFile" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="Schedule">
|
||||
<soap:operation soapAction="urn:xmds#Schedule" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="BlackList">
|
||||
<soap:operation soapAction="urn:xmds#BlackList" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="SubmitLog">
|
||||
<soap:operation soapAction="urn:xmds#SubmitLog" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="SubmitStats">
|
||||
<soap:operation soapAction="urn:xmds#SubmitLog" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="MediaInventory">
|
||||
<soap:operation soapAction="urn:xmds#MediaInventory" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="GetResource">
|
||||
<soap:operation soapAction="urn:xmds#GetResource" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="NotifyStatus">
|
||||
<soap:operation soapAction="urn:xmds#NotifyStatus" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="SubmitScreenShot">
|
||||
<soap:operation soapAction="urn:xmds#SubmitScreenShot" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
</binding>
|
||||
<service name="xmds">
|
||||
<port name="xmdsPort" binding="tns:xmdsBinding">
|
||||
<soap:address location="{{XMDS_LOCATION}}"/>
|
||||
</port>
|
||||
</service>
|
||||
</definitions>
|
||||
272
lib/Xmds/service_v6.wsdl
Normal file
272
lib/Xmds/service_v6.wsdl
Normal file
@@ -0,0 +1,272 @@
|
||||
<definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="urn:xmds"
|
||||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/"
|
||||
targetNamespace="urn:xmds">
|
||||
<types>
|
||||
<xsd:schema targetNamespace="urn:xmds">
|
||||
<xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
|
||||
<xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" />
|
||||
</xsd:schema>
|
||||
</types>
|
||||
<message name="RegisterDisplayRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="displayName" type="xsd:string" />
|
||||
<part name="clientType" type="xsd:string" />
|
||||
<part name="clientVersion" type="xsd:string" />
|
||||
<part name="clientCode" type="xsd:int" />
|
||||
<part name="operatingSystem" type="xsd:string" />
|
||||
<part name="macAddress" type="xsd:string" />
|
||||
<part name="xmrChannel" type="xsd:string" />
|
||||
<part name="xmrPubKey" type="xsd:string" />
|
||||
</message>
|
||||
<message name="RegisterDisplayResponse">
|
||||
<part name="ActivationMessage" type="xsd:string" />
|
||||
</message>
|
||||
<message name="RequiredFilesRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
</message>
|
||||
<message name="RequiredFilesResponse">
|
||||
<part name="RequiredFilesXml" type="xsd:string" />
|
||||
</message>
|
||||
<message name="GetFileRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="fileId" type="xsd:int" />
|
||||
<part name="fileType" type="xsd:string" />
|
||||
<part name="chunkOffset" type="xsd:double" />
|
||||
<part name="chuckSize" type="xsd:double" />
|
||||
</message>
|
||||
<message name="GetFileResponse">
|
||||
<part name="file" type="xsd:base64Binary" />
|
||||
</message>
|
||||
<message name="ScheduleRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
</message>
|
||||
<message name="ScheduleResponse">
|
||||
<part name="ScheduleXml" type="xsd:string" />
|
||||
</message>
|
||||
<message name="ReportFaultsRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="fault" type="xsd:string" />
|
||||
</message>
|
||||
<message name="ReportFaultsResponse">
|
||||
<part name="success" type="xsd:boolean" />
|
||||
</message>
|
||||
<message name="SubmitLogRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="logXml" type="xsd:string" />
|
||||
</message>
|
||||
<message name="SubmitLogResponse">
|
||||
<part name="success" type="xsd:boolean" />
|
||||
</message>
|
||||
<message name="SubmitStatsRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="statXml" type="xsd:string" />
|
||||
</message>
|
||||
<message name="SubmitStatsResponse">
|
||||
<part name="success" type="xsd:boolean" />
|
||||
</message>
|
||||
<message name="MediaInventoryRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="mediaInventory" type="xsd:string" />
|
||||
</message>
|
||||
<message name="MediaInventoryResponse">
|
||||
<part name="success" type="xsd:boolean" />
|
||||
</message>
|
||||
<message name="GetResourceRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="layoutId" type="xsd:int" />
|
||||
<part name="regionId" type="xsd:string" />
|
||||
<part name="mediaId" type="xsd:string" />
|
||||
</message>
|
||||
<message name="GetResourceResponse">
|
||||
<part name="resource" type="xsd:string" />
|
||||
</message>
|
||||
<message name="NotifyStatusRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="status" type="xsd:string" />
|
||||
</message>
|
||||
<message name="NotifyStatusResponse">
|
||||
<part name="success" type="xsd:boolean" />
|
||||
</message>
|
||||
<message name="SubmitScreenShotRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="screenShot" type="xsd:base64Binary" />
|
||||
</message>
|
||||
<message name="SubmitScreenShotResponse">
|
||||
<part name="success" type="xsd:boolean" />
|
||||
</message>
|
||||
<portType name="xmdsPortType">
|
||||
<operation name="RegisterDisplay">
|
||||
<documentation>Register the Display with the CMS</documentation>
|
||||
<input message="tns:RegisterDisplayRequest"/>
|
||||
<output message="tns:RegisterDisplayResponse"/>
|
||||
</operation>
|
||||
<operation name="RequiredFiles">
|
||||
<documentation>The files required by the requesting display</documentation>
|
||||
<input message="tns:RequiredFilesRequest"/>
|
||||
<output message="tns:RequiredFilesResponse"/>
|
||||
</operation>
|
||||
<operation name="GetFile">
|
||||
<documentation>Gets the file requested</documentation>
|
||||
<input message="tns:GetFileRequest"/>
|
||||
<output message="tns:GetFileResponse"/>
|
||||
</operation>
|
||||
<operation name="Schedule">
|
||||
<documentation>Gets the schedule</documentation>
|
||||
<input message="tns:ScheduleRequest"/>
|
||||
<output message="tns:ScheduleResponse"/>
|
||||
</operation>
|
||||
<operation name="ReportFaults">
|
||||
<documentation>Report Player faults</documentation>
|
||||
<input message="tns:ReportFaultsRequest"/>
|
||||
<output message="tns:ReportFaultsResponse"/>
|
||||
</operation>
|
||||
<operation name="SubmitLog">
|
||||
<documentation>Submit Logging from the Client</documentation>
|
||||
<input message="tns:SubmitLogRequest"/>
|
||||
<output message="tns:SubmitLogResponse"/>
|
||||
</operation>
|
||||
<operation name="SubmitStats">
|
||||
<documentation>Submit Display statistics from the Client</documentation>
|
||||
<input message="tns:SubmitStatsRequest"/>
|
||||
<output message="tns:SubmitStatsResponse"/>
|
||||
</operation>
|
||||
<operation name="MediaInventory">
|
||||
<documentation>Report back the clients MediaInventory</documentation>
|
||||
<input message="tns:MediaInventoryRequest" />
|
||||
<output message="tns:MediaInventoryResponse" />
|
||||
</operation>
|
||||
<operation name="GetResource">
|
||||
<documentation>Gets the file requested</documentation>
|
||||
<input message="tns:GetResourceRequest"/>
|
||||
<output message="tns:GetResourceResponse"/>
|
||||
</operation>
|
||||
<operation name="NotifyStatus">
|
||||
<documentation>Report back the current status</documentation>
|
||||
<input message="tns:NotifyStatusRequest"/>
|
||||
<output message="tns:NotifyStatusResponse"/>
|
||||
</operation>
|
||||
<operation name="SubmitScreenShot">
|
||||
<documentation>Submit a screen shot for a display</documentation>
|
||||
<input message="tns:SubmitScreenShotRequest"/>
|
||||
<output message="tns:SubmitScreenShotResponse"/>
|
||||
</operation>
|
||||
</portType>
|
||||
<binding name="xmdsBinding" type="tns:xmdsPortType">
|
||||
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
<operation name="RegisterDisplay">
|
||||
<soap:operation soapAction="urn:xmds#RegisterDisplay" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="RequiredFiles">
|
||||
<soap:operation soapAction="urn:xmds#RequiredFiles" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="GetFile">
|
||||
<soap:operation soapAction="urn:xmds#GetFile" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="Schedule">
|
||||
<soap:operation soapAction="urn:xmds#Schedule" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="ReportFaults">
|
||||
<soap:operation soapAction="urn:xmds#ReportFaults" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="SubmitLog">
|
||||
<soap:operation soapAction="urn:xmds#SubmitLog" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="SubmitStats">
|
||||
<soap:operation soapAction="urn:xmds#SubmitLog" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="MediaInventory">
|
||||
<soap:operation soapAction="urn:xmds#MediaInventory" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="GetResource">
|
||||
<soap:operation soapAction="urn:xmds#GetResource" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="NotifyStatus">
|
||||
<soap:operation soapAction="urn:xmds#NotifyStatus" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="SubmitScreenShot">
|
||||
<soap:operation soapAction="urn:xmds#SubmitScreenShot" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
</binding>
|
||||
<service name="xmds">
|
||||
<port name="xmdsPort" binding="tns:xmdsBinding">
|
||||
<soap:address location="{{XMDS_LOCATION}}"/>
|
||||
</port>
|
||||
</service>
|
||||
</definitions>
|
||||
361
lib/Xmds/service_v7.wsdl
Normal file
361
lib/Xmds/service_v7.wsdl
Normal file
@@ -0,0 +1,361 @@
|
||||
<!--
|
||||
~ Copyright (C) 2023 Xibo Signage Ltd
|
||||
~
|
||||
~ Xibo - Digital Signage - https://xibosignage.com
|
||||
~
|
||||
~ This file is part of Xibo.
|
||||
~
|
||||
~ Xibo is free software: you can redistribute it and/or modify
|
||||
~ it under the terms of the GNU Affero General Public License as published by
|
||||
~ the Free Software Foundation, either version 3 of the License, or
|
||||
~ any later version.
|
||||
~
|
||||
~ Xibo is distributed in the hope that it will be useful,
|
||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
~ GNU Affero General Public License for more details.
|
||||
~
|
||||
~ You should have received a copy of the GNU Affero General Public License
|
||||
~ along with Xibo. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
<definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="urn:xmds"
|
||||
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/"
|
||||
targetNamespace="urn:xmds">
|
||||
<types>
|
||||
<xsd:schema targetNamespace="urn:xmds">
|
||||
<xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
|
||||
<xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" />
|
||||
</xsd:schema>
|
||||
</types>
|
||||
<message name="RegisterDisplayRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="displayName" type="xsd:string" />
|
||||
<part name="clientType" type="xsd:string" />
|
||||
<part name="clientVersion" type="xsd:string" />
|
||||
<part name="clientCode" type="xsd:int" />
|
||||
<part name="operatingSystem" type="xsd:string" />
|
||||
<part name="macAddress" type="xsd:string" />
|
||||
<part name="xmrChannel" type="xsd:string" />
|
||||
<part name="xmrPubKey" type="xsd:string" />
|
||||
<part name="licenceResult" type="xsd:string" />
|
||||
</message>
|
||||
<message name="RegisterDisplayResponse">
|
||||
<part name="ActivationMessage" type="xsd:string" />
|
||||
</message>
|
||||
<message name="RequiredFilesRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
</message>
|
||||
<message name="RequiredFilesResponse">
|
||||
<part name="RequiredFilesXml" type="xsd:string" />
|
||||
</message>
|
||||
<message name="GetFileRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="fileId" type="xsd:int" />
|
||||
<part name="fileType" type="xsd:string" />
|
||||
<part name="chunkOffset" type="xsd:double" />
|
||||
<part name="chuckSize" type="xsd:double" />
|
||||
</message>
|
||||
<message name="GetFileResponse">
|
||||
<part name="file" type="xsd:base64Binary" />
|
||||
</message>
|
||||
<message name="ScheduleRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
</message>
|
||||
<message name="ScheduleResponse">
|
||||
<part name="ScheduleXml" type="xsd:string" />
|
||||
</message>
|
||||
<message name="ReportFaultsRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="fault" type="xsd:string" />
|
||||
</message>
|
||||
<message name="ReportFaultsResponse">
|
||||
<part name="success" type="xsd:boolean" />
|
||||
</message>
|
||||
<message name="SubmitLogRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="logXml" type="xsd:string" />
|
||||
</message>
|
||||
<message name="SubmitLogResponse">
|
||||
<part name="success" type="xsd:boolean" />
|
||||
</message>
|
||||
<message name="SubmitStatsRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="statXml" type="xsd:string" />
|
||||
</message>
|
||||
<message name="SubmitStatsResponse">
|
||||
<part name="success" type="xsd:boolean" />
|
||||
</message>
|
||||
<message name="MediaInventoryRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="mediaInventory" type="xsd:string" />
|
||||
</message>
|
||||
<message name="MediaInventoryResponse">
|
||||
<part name="success" type="xsd:boolean" />
|
||||
</message>
|
||||
<message name="GetResourceRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="layoutId" type="xsd:int" />
|
||||
<part name="regionId" type="xsd:string" />
|
||||
<part name="mediaId" type="xsd:string" />
|
||||
</message>
|
||||
<message name="GetResourceResponse">
|
||||
<part name="resource" type="xsd:string" />
|
||||
</message>
|
||||
<message name="NotifyStatusRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="status" type="xsd:string" />
|
||||
</message>
|
||||
<message name="NotifyStatusResponse">
|
||||
<part name="success" type="xsd:boolean" />
|
||||
</message>
|
||||
<message name="SubmitScreenShotRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="screenShot" type="xsd:base64Binary" />
|
||||
</message>
|
||||
<message name="SubmitScreenShotResponse">
|
||||
<part name="success" type="xsd:boolean" />
|
||||
</message>
|
||||
<message name="GetDataRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="widgetId" type="xsd:int" />
|
||||
</message>
|
||||
<message name="GetDataResponse">
|
||||
<part name="data" type="xsd:string" />
|
||||
</message>
|
||||
<message name="GetDependencyRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
<part name="fileType" type="xsd:string" />
|
||||
<part name="id" type="xsd:string" />
|
||||
<part name="chunkOffset" type="xsd:double" />
|
||||
<part name="chunkSize" type="xsd:double" />
|
||||
</message>
|
||||
<message name="GetDependencyResponse">
|
||||
<part name="file" type="xsd:base64Binary" />
|
||||
</message>
|
||||
<message name="GetWeatherRequest">
|
||||
<part name="serverKey" type="xsd:string" />
|
||||
<part name="hardwareKey" type="xsd:string" />
|
||||
</message>
|
||||
<message name="GetWeatherResponse">
|
||||
<part name="data" type="xsd:string" />
|
||||
</message>
|
||||
<portType name="xmdsPortType">
|
||||
<operation name="RegisterDisplay">
|
||||
<documentation>Register the Display with the CMS</documentation>
|
||||
<input message="tns:RegisterDisplayRequest"/>
|
||||
<output message="tns:RegisterDisplayResponse"/>
|
||||
</operation>
|
||||
<operation name="RequiredFiles">
|
||||
<documentation>The files required by the requesting display</documentation>
|
||||
<input message="tns:RequiredFilesRequest"/>
|
||||
<output message="tns:RequiredFilesResponse"/>
|
||||
</operation>
|
||||
<operation name="GetFile">
|
||||
<documentation>Gets the file requested</documentation>
|
||||
<input message="tns:GetFileRequest"/>
|
||||
<output message="tns:GetFileResponse"/>
|
||||
</operation>
|
||||
<operation name="Schedule">
|
||||
<documentation>Gets the schedule</documentation>
|
||||
<input message="tns:ScheduleRequest"/>
|
||||
<output message="tns:ScheduleResponse"/>
|
||||
</operation>
|
||||
<operation name="ReportFaults">
|
||||
<documentation>Report Player faults</documentation>
|
||||
<input message="tns:ReportFaultsRequest"/>
|
||||
<output message="tns:ReportFaultsResponse"/>
|
||||
</operation>
|
||||
<operation name="SubmitLog">
|
||||
<documentation>Submit Logging from the Client</documentation>
|
||||
<input message="tns:SubmitLogRequest"/>
|
||||
<output message="tns:SubmitLogResponse"/>
|
||||
</operation>
|
||||
<operation name="SubmitStats">
|
||||
<documentation>Submit Display statistics from the Client</documentation>
|
||||
<input message="tns:SubmitStatsRequest"/>
|
||||
<output message="tns:SubmitStatsResponse"/>
|
||||
</operation>
|
||||
<operation name="MediaInventory">
|
||||
<documentation>Report back the clients MediaInventory</documentation>
|
||||
<input message="tns:MediaInventoryRequest" />
|
||||
<output message="tns:MediaInventoryResponse" />
|
||||
</operation>
|
||||
<operation name="GetResource">
|
||||
<documentation>Gets the file requested</documentation>
|
||||
<input message="tns:GetResourceRequest"/>
|
||||
<output message="tns:GetResourceResponse"/>
|
||||
</operation>
|
||||
<operation name="NotifyStatus">
|
||||
<documentation>Report back the current status</documentation>
|
||||
<input message="tns:NotifyStatusRequest"/>
|
||||
<output message="tns:NotifyStatusResponse"/>
|
||||
</operation>
|
||||
<operation name="SubmitScreenShot">
|
||||
<documentation>Submit a screen shot for a display</documentation>
|
||||
<input message="tns:SubmitScreenShotRequest"/>
|
||||
<output message="tns:SubmitScreenShotResponse"/>
|
||||
</operation>
|
||||
<operation name="GetData">
|
||||
<documentation>Get data for a widget</documentation>
|
||||
<input message="tns:GetDataRequest"/>
|
||||
<output message="tns:GetDataResponse"/>
|
||||
</operation>
|
||||
<operation name="GetDependency">
|
||||
<documentation>Get a player dependency (player bundle/font/etc)</documentation>
|
||||
<input message="tns:GetDependencyRequest"/>
|
||||
<output message="tns:GetDependencyResponse"/>
|
||||
</operation>
|
||||
<operation name="GetWeather">
|
||||
<documentation>Get Weather conditions</documentation>
|
||||
<input message="tns:GetWeatherRequest"/>
|
||||
<output message="tns:GetWeatherResponse"/>
|
||||
</operation>
|
||||
</portType>
|
||||
<binding name="xmdsBinding" type="tns:xmdsPortType">
|
||||
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
|
||||
<operation name="RegisterDisplay">
|
||||
<soap:operation soapAction="urn:xmds#RegisterDisplay" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="RequiredFiles">
|
||||
<soap:operation soapAction="urn:xmds#RequiredFiles" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="GetFile">
|
||||
<soap:operation soapAction="urn:xmds#GetFile" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="Schedule">
|
||||
<soap:operation soapAction="urn:xmds#Schedule" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="ReportFaults">
|
||||
<soap:operation soapAction="urn:xmds#ReportFaults" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="SubmitLog">
|
||||
<soap:operation soapAction="urn:xmds#SubmitLog" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="SubmitStats">
|
||||
<soap:operation soapAction="urn:xmds#SubmitLog" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="MediaInventory">
|
||||
<soap:operation soapAction="urn:xmds#MediaInventory" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="GetResource">
|
||||
<soap:operation soapAction="urn:xmds#GetResource" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="NotifyStatus">
|
||||
<soap:operation soapAction="urn:xmds#NotifyStatus" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="SubmitScreenShot">
|
||||
<soap:operation soapAction="urn:xmds#SubmitScreenShot" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="GetData">
|
||||
<soap:operation soapAction="urn:xmds#GetData" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="GetDependency">
|
||||
<soap:operation soapAction="urn:xmds#GetDependency" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="GetWeather">
|
||||
<soap:operation soapAction="urn:xmds#GetWeather" style="rpc"/>
|
||||
<input>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap:body use="encoded" namespace="urn:xmds" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
|
||||
</output>
|
||||
</operation>
|
||||
</binding>
|
||||
<service name="xmds">
|
||||
<port name="xmdsPort" binding="tns:xmdsBinding">
|
||||
<soap:address location="{{XMDS_LOCATION}}"/>
|
||||
</port>
|
||||
</service>
|
||||
</definitions>
|
||||
Reference in New Issue
Block a user