Ignore:
Timestamp:
12/19/13 14:36:04 (10 years ago)
Author:
olhsha
Message:

adding trasnactional, refactoring and fixing bugs in updated annotations, removing try-catch from resource methods (The Greek's advice)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • DASISH/t5.6/backend/annotator-backend/trunk/annotator-backend/src/main/java/eu/dasish/annotation/backend/rest/TargetResource.java

    r4028 r4207  
    2626import eu.dasish.annotation.schema.ReferenceList;
    2727import eu.dasish.annotation.schema.Target;
     28import java.io.IOException;
    2829import java.io.InputStream;
    2930import java.sql.SQLException;
     
    4142import javax.ws.rs.core.UriInfo;
    4243import javax.xml.bind.JAXBElement;
     44import javax.xml.parsers.ParserConfigurationException;
    4345import org.springframework.beans.factory.annotation.Autowired;
    4446import org.springframework.security.access.annotation.Secured;
    4547import org.springframework.stereotype.Component;
     48import org.springframework.transaction.annotation.Transactional;
    4649
    4750/**
     
    5558@Component
    5659@Path("/targets")
     60@Transactional(rollbackFor={Exception.class, SQLException.class, IOException.class, ParserConfigurationException.class})
    5761public class TargetResource {
    5862
     
    7579    @Produces(MediaType.TEXT_XML)
    7680    @Path("{targetid: " + BackendConstants.regExpIdentifier + "}")
    77     @Secured("ROLE_USER")
     81    @Secured("ROLE_USER")   
     82    @Transactional(readOnly=true)
    7883    public JAXBElement<Target> getTarget(@PathParam("targetid") String ExternalIdentifier) throws SQLException {
    7984        dbIntegrityService.setServiceURI(uriInfo.getBaseUri().toString());
     
    8792    @Produces(MediaType.TEXT_XML)
    8893    @Path("{targetid: " + BackendConstants.regExpIdentifier + "}/versions")
    89     @Secured("ROLE_USER")
     94    @Secured("ROLE_USER")   
     95    @Transactional(readOnly=true)
    9096    public JAXBElement<ReferenceList> getSiblingTargets(@PathParam("targetid") String ExternalIdentifier) throws SQLException {
    9197        dbIntegrityService.setServiceURI(uriInfo.getBaseUri().toString());
Note: See TracChangeset for help on using the changeset viewer.