Revision 50219
Added by Panagiotis Kanakakis over 6 years ago
PiWikApiImpl.java | ||
---|---|---|
4 | 4 |
import eu.dnetlib.utils.md5.MD5; |
5 | 5 |
import org.springframework.beans.factory.annotation.Autowired; |
6 | 6 |
import org.springframework.beans.factory.annotation.Qualifier; |
7 |
import org.springframework.dao.EmptyResultDataAccessException; |
|
7 | 8 |
import org.springframework.jdbc.core.JdbcTemplate; |
8 | 9 |
import org.springframework.jdbc.core.RowMapper; |
9 | 10 |
import org.springframework.stereotype.Component; |
... | ... | |
43 | 44 |
|
44 | 45 |
@Override |
45 | 46 |
public PiwikInfo getPiwikSiteForRepo(@PathVariable("repositoryId") String repositoryId) { |
46 |
return new JdbcTemplate(dataSource).queryForObject(GET_PIWIK_SITE, new String[]{repositoryId}, new int[]{Types.VARCHAR}, piwikRowMapper); |
|
47 |
try{ |
|
48 |
return new JdbcTemplate(dataSource).queryForObject(GET_PIWIK_SITE, new String[]{repositoryId}, new int[]{Types.VARCHAR}, piwikRowMapper); |
|
49 |
}catch (EmptyResultDataAccessException e){ |
|
50 |
return null; |
|
51 |
} |
|
47 | 52 |
} |
48 | 53 |
|
49 | 54 |
@Override |
... | ... | |
58 | 63 |
@Override |
59 | 64 |
public List<PiwikInfo> getPiwikSitesForRepos() { |
60 | 65 |
LOGGER.debug("Getting piwik sites for repos! "); |
61 |
return new JdbcTemplate(dataSource).query(GET_PIWIK_SITES, piwikRowMapper); |
|
66 |
try{ |
|
67 |
return new JdbcTemplate(dataSource).query(GET_PIWIK_SITES, piwikRowMapper); |
|
68 |
}catch (EmptyResultDataAccessException e){ |
|
69 |
return null; |
|
70 |
} |
|
71 |
|
|
62 | 72 |
} |
63 | 73 |
|
64 | 74 |
@Override |
Also available in: Unified diff
1. Changes on piwik api
2. Changes on repository interface (new response entities)
3. Changes on converter class due to new json response.