Changeset 1327
- Timestamp:
- 05/17/11 11:24:03 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry/impl/database/ComponentRegistryDbImpl.java
r1326 r1327 76 76 @Override 77 77 public ProfileDescription getProfileDescription(String id) { 78 return profileDescriptionDao.getByCmdId(id); 78 try { 79 return profileDescriptionDao.getByCmdId(id); 80 } catch (DataAccessException ex) { 81 LOG.error("Database access error while trying to get profile description", ex); 82 throw ex; 83 } 79 84 } 80 85 … … 95 100 @Override 96 101 public ComponentDescription getComponentDescription(String id) { 97 return componentDescriptionDao.getByCmdId(id); 102 try { 103 return componentDescriptionDao.getByCmdId(id); 104 } catch (DataAccessException ex) { 105 LOG.error("Database access error while trying to get component description", ex); 106 throw ex; 107 } 98 108 } 99 109 100 110 @Override 101 111 public CMDComponentSpec getMDProfile(String id) { 102 return getMDComponent(id, profileDescriptionDao); 112 try { 113 return getMDComponent(id, profileDescriptionDao); 114 } catch (DataAccessException ex) { 115 LOG.error("Database access error while trying to get profile", ex); 116 throw ex; 117 } 103 118 } 104 119 105 120 @Override 106 121 public CMDComponentSpec getMDComponent(String id) { 107 return getMDComponent(id, componentDescriptionDao); 122 try { 123 return getMDComponent(id, componentDescriptionDao); 124 } catch (DataAccessException ex) { 125 LOG.error("Database access error while trying to get component", ex); 126 throw ex; 127 } 108 128 } 109 129 … … 177 197 @Override 178 198 public void deleteMDProfile(String profileId, Principal principal) throws IOException, UserUnauthorizedException, DeleteFailedException { 179 ProfileDescription desc = getProfileDescription(profileId); 180 if (desc != null) { 181 checkAuthorisation(desc, principal); 182 checkAge(desc, principal); 183 profileDescriptionDao.setDeleted(profileId); 184 } 199 try { 200 ProfileDescription desc = getProfileDescription(profileId); 201 if (desc != null) { 202 checkAuthorisation(desc, principal); 203 checkAge(desc, principal); 204 profileDescriptionDao.setDeleted(profileId); 205 } 206 } catch (DataAccessException ex) { 207 LOG.error("Database access error while trying to delete profile", ex); 208 throw ex; 209 } 210 185 211 } 186 212 … … 217 243 @Override 218 244 public void deleteMDComponent(String componentId, Principal principal, boolean forceDelete) throws IOException, UserUnauthorizedException, DeleteFailedException { 219 ComponentDescription desc = componentDescriptionDao.getByCmdId(componentId); 220 if (desc != null) { 221 checkAuthorisation(desc, principal); 222 checkAge(desc, principal); 223 224 // TODO : check still used! 245 try { 246 ComponentDescription desc = componentDescriptionDao.getByCmdId(componentId); 247 if (desc != null) { 248 checkAuthorisation(desc, principal); 249 checkAge(desc, principal); 250 251 // TODO : check still used! 225 252 // if (!forceDelete) { 226 253 // checkStillUsed(componentId); 227 254 // } 228 componentDescriptionDao.setDeleted(componentId); 255 componentDescriptionDao.setDeleted(componentId); 256 } 257 } catch (DataAccessException ex) { 258 LOG.error("Database access error while trying to delete component", ex); 259 throw ex; 229 260 } 230 261 }
Note: See TracChangeset
for help on using the changeset viewer.