Revision 62221
Added by Argiro Kokogiannaki over 2 years ago
modules/uoa-joomla/trunk/joomla-3.4/com_openaire_beta/site/models/search.php | ||
---|---|---|
3677 | 3677 |
throw new Exception('error parsing results'); |
3678 | 3678 |
if (($embargoEndDateNodes = $xpath->query('./field[@name = "embargoenddate"]/@value', $resultNode)) == FALSE) |
3679 | 3679 |
throw new Exception('error parsing results'); |
3680 |
if (($descriptionNodes = $xpath->query('./field[@name = "description"]/@value', $resultNode)) == FALSE) |
|
3681 |
throw new Exception('error parsing results'); |
|
3680 |
// if (($descriptionNodes = $xpath->query('./field[@name = "description"]/@value', $resultNode)) == FALSE)
|
|
3681 |
// throw new Exception('error parsing results');
|
|
3682 | 3682 |
$publication = new JObject(); |
3683 | 3683 |
// $publication->id = (($idNode = $idNodes->item(0)) == NULL) ? NULL : trim($idNode->nodeValue); |
3684 | 3684 |
// $first=$publication->id; |
... | ... | |
3700 | 3700 |
$publication->subjects = array(); |
3701 | 3701 |
$publication->related = array(); |
3702 | 3702 |
$publication->embargoEndDate = (($embargoEndDateNode = $embargoEndDateNodes->item(0)) == NULL) ? NULL : strtotime(trim($embargoEndDateNode->nodeValue)); |
3703 |
$publication->description = (($descriptionNode = $descriptionNodes->item(0)) == NULL) ? NULL : trim($descriptionNode->nodeValue); |
|
3703 |
// $publication->description = (($descriptionNode = $descriptionNodes->item(0)) == NULL) ? NULL : trim($descriptionNode->nodeValue);
|
|
3704 | 3704 |
foreach ($subjectNodes as $subjectNode) { |
3705 | 3705 |
if (($titleNodes = $xpath->query('./@value', $subjectNode)) == FALSE) |
3706 | 3706 |
throw new Exception('error parsing results'); |
... | ... | |
3825 | 3825 |
throw new Exception('error parsing publications'); |
3826 | 3826 |
if (($embargoEndDateNodes = $xpath->query('./field[@name = "embargoenddate"]/@value', $resultNode)) == FALSE) |
3827 | 3827 |
throw new Exception('error parsing publications'); |
3828 |
if (($descriptionNodes = $xpath->query('./field[@name = "description"]/@value', $resultNode)) == FALSE) |
|
3829 |
throw new Exception('error parsing publications'); |
|
3828 |
// if (($descriptionNodes = $xpath->query('./field[@name = "description"]/@value', $resultNode)) == FALSE)
|
|
3829 |
// throw new Exception('error parsing publications');
|
|
3830 | 3830 |
if (($sourceNodes = $xpath->query('./field[@name = "source"]/@value', $resultNode)) == FALSE) |
3831 | 3831 |
throw new Exception('error parsing publication'); |
3832 | 3832 |
if (($pidNodes = $xpath->query('./field[@name = "pid"]', $resultNode)) == FALSE) |
... | ... | |
3853 | 3853 |
$publication->subjects = array(); |
3854 | 3854 |
$publication->related = array(); |
3855 | 3855 |
$publication->embargoEndDate = (($embargoEndDateNode = $embargoEndDateNodes->item(0)) == NULL) ? NULL : strtotime(trim($embargoEndDateNode->nodeValue)); |
3856 |
$publication->description = (($descriptionNode = $descriptionNodes->item(0)) == NULL) ? NULL : trim($descriptionNode->nodeValue); |
|
3856 |
// $publication->description = (($descriptionNode = $descriptionNodes->item(0)) == NULL) ? NULL : trim($descriptionNode->nodeValue);
|
|
3857 | 3857 |
$publication->pids = array(); |
3858 | 3858 |
foreach ($pidNodes as $pidNode) { |
3859 | 3859 |
if (($classNodes = $xpath->query('./field[@name = "classid"]/@value', $pidNode)) == FALSE) |
... | ... | |
3999 | 3999 |
throw new Exception('error parsing datasets'); |
4000 | 4000 |
if (($embargoEndDateNodes = $xpath->query('./field[@name = "embargoenddate"]/@value', $resultNode)) == FALSE) |
4001 | 4001 |
throw new Exception('error parsing datasets'); |
4002 |
if (($descriptionNodes = $xpath->query('./field[@name = "description"]/@value', $resultNode)) == FALSE) |
|
4003 |
throw new Exception('error parsing datasets'); |
|
4002 |
// if (($descriptionNodes = $xpath->query('./field[@name = "description"]/@value', $resultNode)) == FALSE)
|
|
4003 |
// throw new Exception('error parsing datasets');
|
|
4004 | 4004 |
$dataset = new JObject(); |
4005 | 4005 |
$dataset->id = (($idNode = $idNodes->item(0)) == NULL) ? NULL : trim($idNode->nodeValue); |
4006 | 4006 |
$dataset->source = 'openaire'; |
... | ... | |
4014 | 4014 |
$dataset->language = (($languageNode = $languageNodes->item(0)) == NULL) ? NULL : trim($languageNode->nodeValue); |
4015 | 4015 |
$dataset->projects = array(); |
4016 | 4016 |
$dataset->embargoEndDate = (($embargoEndDateNode = $embargoEndDateNodes->item(0)) == NULL) ? NULL : strtotime(trim($embargoEndDateNode->nodeValue)); |
4017 |
$dataset->description = (($descriptionNode = $descriptionNodes->item(0)) == NULL) ? NULL : trim($descriptionNode->nodeValue); |
|
4017 |
// $dataset->description = (($descriptionNode = $descriptionNodes->item(0)) == NULL) ? NULL : trim($descriptionNode->nodeValue);
|
|
4018 | 4018 |
foreach ($datasourceNodes as $datasourceNode) { |
4019 | 4019 |
if (($urlNodes = $xpath->query('./field[@name = "url"]/@value', $datasourceNode)) == FALSE) |
4020 | 4020 |
throw new Exception('error parsing datasets'); |
... | ... | |
4262 | 4262 |
throw new Exception('error parsing datasources'); |
4263 | 4263 |
if (($oaiPmhNodes = $xpath->query('./field[@name = "accessinfopackage"]/@value', $resultNode)) == FALSE) |
4264 | 4264 |
throw new Exception('error parsing datasources'); |
4265 |
if (($descriptionNodes = $xpath->query('./field[@name = "oddescription"]/@value', $resultNode)) == FALSE) |
|
4266 |
throw new Exception('error parsing datasources'); |
|
4265 |
// if (($descriptionNodes = $xpath->query('./field[@name = "oddescription"]/@value', $resultNode)) == FALSE)
|
|
4266 |
// throw new Exception('error parsing datasources');
|
|
4267 | 4267 |
if (($organizationNodes = $xpath->query('./field[@name = "organization"]', $resultNode)) == FALSE) |
4268 | 4268 |
throw new Exception('error parsing datasources'); |
4269 | 4269 |
$datasource = new JObject(); |
... | ... | |
4280 | 4280 |
$datasource->policies = array(); |
4281 | 4281 |
$datasource->contents = array(); |
4282 | 4282 |
$datasource->oaiPmhUrls = array(); |
4283 |
$datasource->description = (($descriptionNode = $descriptionNodes->item(0)) == NULL) ? NULL : trim($descriptionNode->nodeValue); |
|
4283 |
// $datasource->description = (($descriptionNode = $descriptionNodes->item(0)) == NULL) ? NULL : trim($descriptionNode->nodeValue);
|
|
4284 | 4284 |
$datasource->organizations = array(); |
4285 | 4285 |
foreach ($languageNodes as $languageNode) { |
4286 | 4286 |
if (trim($languageNode->nodeValue) != NULL) |
... | ... | |
4351 | 4351 |
throw new Exception('error parsing publication'); |
4352 | 4352 |
if (($embargoEndDateNodes = $xpath->query('./field[@name = "embargoenddate"]/@value', $resultNode)) == FALSE) |
4353 | 4353 |
throw new Exception('error parsing publication'); |
4354 |
if (($descriptionNodes = $xpath->query('./field[@name = "description"]/@value', $resultNode)) == FALSE) |
|
4355 |
throw new Exception('error parsing publication'); |
|
4354 |
// if (($descriptionNodes = $xpath->query('./field[@name = "description"]/@value', $resultNode)) == FALSE)
|
|
4355 |
// throw new Exception('error parsing publication');
|
|
4356 | 4356 |
if (($datasourceNodes = $xpath->query('./field[@name = "datasource"]', $resultNode)) == FALSE) |
4357 | 4357 |
throw new Exception('error parsing publication'); |
4358 | 4358 |
if (($collectedFromNodes = $xpath->query('./field[@name = "collectedfrom"]', $resultNode)) == FALSE) |
... | ... | |
4393 | 4393 |
$publication->categorizedSubjects = array(); |
4394 | 4394 |
$publication->inferredSubjects = array(); |
4395 | 4395 |
$publication->embargoEndDate = (($embargoEndDateNode = $embargoEndDateNodes->item(0)) == NULL) ? NULL : strtotime(trim($embargoEndDateNode->nodeValue)); |
4396 |
$publication->description = (($descriptionNode = $descriptionNodes->item(0)) == NULL) ? NULL : trim($descriptionNode->nodeValue); |
|
4396 |
// $publication->description = (($descriptionNode = $descriptionNodes->item(0)) == NULL) ? NULL : trim($descriptionNode->nodeValue);
|
|
4397 | 4397 |
$publication->datasources = array(); |
4398 | 4398 |
$publication->collectedFrom = array(); |
4399 | 4399 |
$publication->sources = array(); |
... | ... | |
4911 | 4911 |
throw new Exception('error parsing dataset'); |
4912 | 4912 |
if (($embargoEndDateNodes = $xpath->query('./field[@name = "embargoenddate"]/@value', $resultNode)) == FALSE) |
4913 | 4913 |
throw new Exception('error parsing dataset'); |
4914 |
if (($descriptionNodes = $xpath->query('./field[@name = "description"]/@value', $resultNode)) == FALSE) |
|
4915 |
throw new Exception('error parsing dataset'); |
|
4914 |
// if (($descriptionNodes = $xpath->query('./field[@name = "description"]/@value', $resultNode)) == FALSE)
|
|
4915 |
// throw new Exception('error parsing dataset');
|
|
4916 | 4916 |
if (($datasourceNodes = $xpath->query('./field[@name = "datasource"]', $resultNode)) == FALSE) |
4917 | 4917 |
throw new Exception('error parsing dataset'); |
4918 | 4918 |
if (($collectedFromNodes = $xpath->query('./field[@name = "collectedfrom"]', $resultNode)) == FALSE) |
... | ... | |
4944 | 4944 |
$dataset->type = (($typeNode = $typeNodes->item(0)) == NULL) ? NULL : trim($typeNode->nodeValue); |
4945 | 4945 |
$dataset->subjects = array(); |
4946 | 4946 |
$dataset->embargoEndDate = (($embargoEndDateNode = $embargoEndDateNodes->item(0)) == NULL) ? NULL : strtotime(trim($embargoEndDateNode->nodeValue)); |
4947 |
$dataset->description = (($descriptionNode = $descriptionNodes->item(0)) == NULL) ? NULL : trim($descriptionNode->nodeValue); |
|
4947 |
// $dataset->description = (($descriptionNode = $descriptionNodes->item(0)) == NULL) ? NULL : trim($descriptionNode->nodeValue);
|
|
4948 | 4948 |
$dataset->datasources = array(); |
4949 | 4949 |
$dataset->collectedFrom = array(); |
4950 | 4950 |
$dataset->sources = array(); |
... | ... | |
5560 | 5560 |
throw new Exception('error parsing datasource'); |
5561 | 5561 |
if (($oaiPmhNodes = $xpath->query('./field[@name = "accessinfopackage"]/@value', $resultNode)) == FALSE) |
5562 | 5562 |
throw new Exception('error parsing datasources'); |
5563 |
if (($descriptionNodes = $xpath->query('./field[@name = "oddescription"]/@value', $resultNode)) == FALSE) |
|
5564 |
throw new Exception('error parsing datasource'); |
|
5563 |
// if (($descriptionNodes = $xpath->query('./field[@name = "oddescription"]/@value', $resultNode)) == FALSE)
|
|
5564 |
// throw new Exception('error parsing datasource');
|
|
5565 | 5565 |
$datasource = new JObject(); |
5566 | 5566 |
$datasource->name = (($nameNode = $nameNodes->item(0)) == NULL) ? NULL : trim($nameNode->nodeValue); |
5567 | 5567 |
$datasource->englishName = (($englishNameNode = $englishNameNodes->item(0)) == NULL) ? NULL : trim($englishNameNode->nodeValue); |
... | ... | |
5576 | 5576 |
$datasource->policies = (($policiesNode = $policiesNodes->item(0)) == NULL) ? NULL : trim($policiesNode->nodeValue); |
5577 | 5577 |
$datasource->compatibility = (($compatibilityNode = $compatibilityNodes->item(0)) == NULL) ? NULL : trim($compatibilityNode->nodeValue); |
5578 | 5578 |
$datasource->oaiPmh = (($oaiPmhNode = $oaiPmhNodes->item(0)) == NULL) ? NULL : trim($oaiPmhNode->nodeValue); |
5579 |
$datasource->description = (($descriptionNode = $descriptionNodes->item(0)) == NULL) ? NULL : trim($descriptionNode->nodeValue); |
|
5579 |
// $datasource->description = (($descriptionNode = $descriptionNodes->item(0)) == NULL) ? NULL : trim($descriptionNode->nodeValue);
|
|
5580 | 5580 |
$datasource->originalId = (($originalIdNode = $originalIdNodes->item(0)) == NULL) ? NULL : trim($originalIdNode->nodeValue); |
5581 | 5581 |
return $datasource; |
5582 | 5582 |
} |
Also available in: Unified diff
Fix: comment out description parsing, as it contained invalid characters and broke the widget