Examples of CopyHelper


Examples of org.socialmusicdiscovery.server.support.copy.CopyHelper

            transactionManager.begin();
            ((WorkEntity)work).setLastUpdated(new Date());
            ((WorkEntity)work).setLastUpdatedBy(super.CHANGED_BY);
            WorkEntity createdEntity = super.createEntity(((WorkEntity)work));
            getRepository().refresh(createdEntity);
            return new CopyHelper().copy(createdEntity, Expose.class);
        }catch (RuntimeException e) {
            transactionManager.setRollbackOnly();
            throw e;
        }finally {
            transactionManager.end();
View Full Code Here

Examples of org.socialmusicdiscovery.server.support.copy.CopyHelper

            transactionManager.begin();
            ((WorkEntity)work).setLastUpdated(new Date());
            ((WorkEntity)work).setLastUpdatedBy(super.CHANGED_BY);
            WorkEntity updatedEntity = super.updateEntity(id, ((WorkEntity)work));
            getRepository().refresh(updatedEntity);
            return new CopyHelper().copy(updatedEntity, Expose.class);
        }catch (RuntimeException e) {
            transactionManager.setRollbackOnly();
            throw e;
        }finally {
            transactionManager.end();
View Full Code Here

Examples of org.socialmusicdiscovery.server.support.copy.CopyHelper

            criteriaList.add(0, object);
            object = object.substring(0, object.indexOf("."));
        }

        BrowseService browseService = browseServiceManager.getBrowseService(object);
        org.socialmusicdiscovery.server.business.service.browse.Result result = new CopyHelper().detachedCopy(browseService.findChildren(criteriaList, new ArrayList<String>(), offset, size, childs));

        List<ItemResult.Item> genericResultItems = new ArrayList<ItemResult.Item>(result.getItems().size());
        for (Object o : result.getItems()) {
            ResultItem resultItem = (ResultItem) o;
            Object item = null;
View Full Code Here

Examples of org.socialmusicdiscovery.server.support.copy.CopyHelper

            org.socialmusicdiscovery.server.business.service.browse.Result<TrackEntity> result = null;
            if (trackId != null) {
                // Special case for track since it's not supported to look for Track objects in TrackBrowseService
                ResultItem<TrackEntity> track = browseService.findById(trackId);
                if (track != null) {
                    result = new CopyHelper().detachedCopy(new org.socialmusicdiscovery.server.business.service.browse.Result<TrackEntity>(1, new ArrayList<ResultItem<TrackEntity>>(Arrays.asList(track))));
                } else {
                    result = new org.socialmusicdiscovery.server.business.service.browse.Result<TrackEntity>();
                }
            } else {
                // Lookup track objects matching the search criteria
                result = new CopyHelper().detachedCopy(browseService.findChildren(criteriaList, new ArrayList<String>(), offset, size, false));
            }

            // Extract the first playable element for each found track object
            for (ResultItem<TrackEntity> resultItem : result.getItems()) {
                PlayableElement playableElement = resultItem.getItem().getPlayableElements().iterator().next();
View Full Code Here

Examples of org.socialmusicdiscovery.server.support.copy.CopyHelper

        if (size != null && offset == null) {
            offset = 0;
        }

        LibraryBrowseService browseService = InjectHelper.instance(LibraryBrowseService.class);
        org.socialmusicdiscovery.server.business.service.browse.Result result = new CopyHelper().detachedCopy(browseService.findChildren(clientType, objectId, offset, size, childs));

        List<String> parentObjects = new ArrayList<String>();
        if (objectId != null) {
            parentObjects = Arrays.asList(objectId.split("/"));
        }
View Full Code Here

Examples of org.socialmusicdiscovery.server.support.copy.CopyHelper

    public Collection<ImageEntity> search(@QueryParam("relatedTo") String relatedToSMDId, @QueryParam("imageType") String imageType) {
      logger.debug("ImageFacade 'search' called!");
      try {
            transactionManager.begin();
            if ( (relatedToSMDId) != null &&  (imageType == null) ) {
                return new CopyHelper().detachedCopy(repository.findByRelatedToSMDId(relatedToSMDId), Expose.class);
            } else if ( (relatedToSMDId) != null &&  (imageType != null) ) {
                    return new CopyHelper().detachedCopy(repository.findByRelatedToSMDIdAndType(relatedToSMDId, imageType), Expose.class);
            } else if ( (imageType == null) && (relatedToSMDId == null)) {
              return new CopyHelper().detachedCopy(repository.findAll(), Expose.class);
            } else {
                return null;
            }
        }finally {
            transactionManager.end();
View Full Code Here

Examples of org.socialmusicdiscovery.server.support.copy.CopyHelper

        if (size != null && offset == null) {
            offset = 0;
        }

        ContextBrowseService browseService = InjectHelper.instance(ContextBrowseService.class);
        org.socialmusicdiscovery.server.business.service.browse.Result result = new CopyHelper().detachedCopy(browseService.findChildren(clientType, objectId, offset, size, childs));

        List<String> parentObjects = new ArrayList<String>(Arrays.asList(objectId.split("/")));
        parentObjects.remove(0);

        List<ItemResult.Item> genericResultItems = new ArrayList<ItemResult.Item>(result.getItems().size());
View Full Code Here

Examples of org.socialmusicdiscovery.server.support.copy.CopyHelper

    @Produces(MediaType.APPLICATION_JSON)
    @Path("/{id}")
    public ImageEntity get(@PathParam("id") String id) {
        try {
            transactionManager.begin();
            return new CopyHelper().copy(super.getEntity(id), Expose.class);
        }finally {
            transactionManager.end();
        }
    }
View Full Code Here

Examples of org.socialmusicdiscovery.server.support.copy.CopyHelper

      }
        try {
            transactionManager.begin();
            image.setLastUpdated(new Date());
            image.setLastUpdatedBy(super.CHANGED_BY);
            return new CopyHelper().copy(super.createEntity(image), Expose.class);
        }catch (RuntimeException e) {
            transactionManager.setRollbackOnly();
            throw e;
        }finally {
            transactionManager.end();
View Full Code Here

Examples of org.socialmusicdiscovery.server.support.copy.CopyHelper

    public ImageEntity update(@PathParam("id") String id, ImageEntity artist) {
        try {
            transactionManager.begin();
            artist.setLastUpdated(new Date());
            artist.setLastUpdatedBy(super.CHANGED_BY);
            return new CopyHelper().copy(super.updateEntity(id, artist), Expose.class);
        }catch (RuntimeException e) {
            transactionManager.setRollbackOnly();
            throw e;
        }finally {
            transactionManager.end();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.