Project

General

Profile

« Previous | Next » 

Revision 31202

new parsing for the authors, using the \'hasAuthor\' value instead of \'author\'

View differences:

modules/uoa-joomla/trunk/joomla-2.5.3/com_openaire/site/models/search.php
3134 3134
				throw new Exception('error parsing publications');
3135 3135
           	if (($relatedNodes = $xpath -> query('./field[@name = "related"]', $resultNode)) == FALSE)
3136 3136
				throw new Exception('error parsing publications');
3137
			if (($authorNodes = $xpath -> query('./field[@name = "author"]', $resultNode)) == FALSE)
3137
			if (($authorNodes = $xpath -> query('./field[@name = "hasAuthor"]', $resultNode)) == FALSE)
3138 3138
				throw new Exception('error parsing publications');
3139 3139
			if (($publisherNodes = $xpath -> query('./field[@name = "publisher"]/@value', $resultNode)) == FALSE)
3140 3140
				throw new Exception('error parsing publications');
......
3270 3270
				throw new Exception('error parsing datasets');		
3271 3271
			if (($titleNodes = $xpath -> query('./field[@name = "title"]/@value', $resultNode)) == FALSE)
3272 3272
				throw new Exception('error parsing datasets');
3273
			if (($authorNodes = $xpath -> query('./field[@name = "author"]', $resultNode)) == FALSE)
3273
			if (($authorNodes = $xpath -> query('./field[@name = "hasAuthor"]', $resultNode)) == FALSE)
3274 3274
				throw new Exception('error parsing datasets');
3275 3275
			if (($publisherNodes = $xpath -> query('./field[@name = "publisher"]/@value', $resultNode)) == FALSE)
3276 3276
				throw new Exception('error parsing datasets');
......
3599 3599
			throw new Exception('error parsing publication');
3600 3600
		if (($titleNodes = $xpath -> query('./field[@name = "title"]/@value', $resultNode)) == FALSE)
3601 3601
			throw new Exception('error parsing publication');			
3602
		if (($authorNodes = $xpath -> query('./field[@name = "author"]', $resultNode)) == FALSE)
3602
		if (($authorNodes = $xpath -> query('./field[@name = "hasAuthor"]', $resultNode)) == FALSE)
3603 3603
			throw new Exception('error parsing publication');	
3604 3604
		if (($dateNodes = $xpath -> query('./field[@name = "dateofacceptance"]/@value', $resultNode)) == FALSE)
3605 3605
			throw new Exception('error parsing publication');	
......
4066 4066
			throw new Exception('error parsing dataset');
4067 4067
		if (($titleNodes = $xpath -> query('./field[@name = "title"]/@value', $resultNode)) == FALSE)
4068 4068
			throw new Exception('error parsing dataset');			
4069
		if (($authorNodes = $xpath -> query('./field[@name = "author"]', $resultNode)) == FALSE)
4069
		if (($authorNodes = $xpath -> query('./field[@name = "hasAuthor"]', $resultNode)) == FALSE)
4070 4070
			throw new Exception('error parsing dataset');	
4071 4071
		if (($dateNodes = $xpath -> query('./field[@name = "dateofacceptance"]/@value', $resultNode)) == FALSE)
4072 4072
			throw new Exception('error parsing dataset');	
modules/uoa-joomla/trunk/joomla-2.5.3/com_openaire/site/views/publications/tmpl/default.php
34 34
							<th><?php echo(JText :: _('AUTHORS')); ?></th>
35 35
							<th><?php echo(JText :: _('PUBLICATION_YEAR')); ?></th>
36 36
							<th><?php echo(JText :: _('PERMANENT_IDENTIFIER')); ?></th>
37
							<th><?php echo(JText :: _('ACCESS_MODE')); ?></th>
37 38
						</tr>
38 39
					</thead>
39 40
					<tbody>
......
42 43
								<td><?php echo(htmlspecialchars($publication -> title)); ?></td>
43 44
								<td><?php echo(htmlspecialchars(implode('; ', array_filter(array_map(function ($author) {return (($author == NULL) || ((($author -> lastName == NULL) || ($author -> firstName == NULL)) && ($author -> fullName == NULL))) ? '' : ((($author -> lastName == NULL) || ($author -> firstName == NULL)) ? $author -> fullName : ($author -> lastName . ' ' . $author -> firstName));}, $publication -> authors))))); ?></td>
44 45
								<td><?php echo(($publication -> year == NULL) ? '' : htmlspecialchars($publication -> year)); ?></td>
45
								<td><?php echo(array_key_exists($publication -> id, $publication -> datasources) ? ('<a target="_blank" href="' . htmlspecialchars($publication -> datasources[$publication -> id] -> url) . '">' . htmlspecialchars($publication -> datasources[$publication -> id] -> url) . '</a>') : ''); ?></td>
46
								<td><?php echo(!empty($publication -> datasources) ? ('<a target="_blank" href="' . htmlspecialchars($publication -> datasources[0] -> url) . '">' . htmlspecialchars($publication -> datasources[0] -> url) . '</a>') : ''); ?></td>
47
								<td><?php echo(htmlspecialchars($publication -> accessMode)); ?></td>
46 48
							</tr>
47 49
						<?php } ?>
48 50
					</tbody>
......
60 62
			str_replace('"', '""', preg_replace('/\s+/', ' ', str_replace("\n", ' ', $publication -> title))) . '","' .
61 63
			str_replace('"', '""', preg_replace('/\s+/', ' ', str_replace("\n", ' ', implode('; ', array_filter(array_map(function ($author) {return (($author == NULL) || ((($author -> lastName == NULL) || ($author -> firstName == NULL)) && ($author -> fullName == NULL))) ? '' : ((($author -> lastName == NULL) || ($author -> firstName == NULL)) ? $author -> fullName : ($auhtor -> lastName . ' ' . $author -> firstName));}, $publication -> authors)))))) . '","' .
62 64
			str_replace('"', '""', preg_replace('/\s+/', ' ', str_replace("\n", ' ', ($publication -> year == NULL) ? '' : $publication -> year))) . '","' .
63
			str_replace('"', '""', preg_replace('/\s+/', ' ', str_replace("\n", ' ', array_key_exists($publication -> id, $publication -> datasources) ? $publication -> datasources[$publication -> id] -> url : ''))) . "\"\n");
65
			str_replace('"', '""', preg_replace('/\s+/', ' ', str_replace("\n", ' ', !empty($publication -> datasources) ? $publication -> datasources[0] -> url : ''))) . '","' .
66
			str_replace('"', '""', preg_replace('/\s+/', ' ', str_replace("\n", ' ', ($publication -> accessMode == NULL) ? '' : $publication -> accessMode))). "\"\n");
64 67
		}
65 68
	}
66 69
}

Also available in: Unified diff