getNamespaceName(); if (!in_array($serviceNamespace, array('PKP\Services', 'OJS\Services', 'OMP\Services'))) { throw new InvalidServiceException(); } $this->service = $service; } /** * @copydoc \PKP\Services\EntityProperties\EntityPropertyInterface::getProperties() */ abstract public function getProperties($entity, $props, $args = null); /** * @copydoc \PKP\Services\EntityProperties\EntityPropertyInterface::getSummaryProperties() */ abstract public function getSummaryProperties($entity, $args = null); /** * @copydoc \PKP\Services\EntityProperties\EntityPropertyInterface::getFullProperties() */ abstract public function getFullProperties($entity, $args = null); /** * Build a URL to an object in the API * * This method builds the correct URL depending on whether disable_path_info * is enabled in the config file. * * @param Request $request * @param string $contextPath * @param string $apiVersion * @param string $baseEndpoint Example: 'submissions' * @param string $endpointParams Example: '1', '1/galleys' * @return string */ public function getAPIHref($request, $contextPath, $apiVersion, $baseEndpoint = '', $endpointParams = '') { $fullBaseEndpoint = sprintf('/%s/api/%s/%s', $contextPath, $apiVersion, $baseEndpoint); $baseUrl = $request->getBaseUrl(); if (!$request->isRestfulUrlsEnabled()) { $baseUrl .= '/index.php'; } if ($request->isPathInfoEnabled()) { return sprintf('%s%s/%s', $baseUrl, $fullBaseEndpoint, $endpointParams); } return sprintf('%s?journal=%s&endpoint=%s/%s', $baseUrl, $contextPath, $fullBaseEndpoint, $endpointParams); } }