edu.utah.further.mdr.impl.service.asset
Class AssetServiceImpl

java.lang.Object
  extended by edu.utah.further.mdr.common.asset.AbstractAssetService
      extended by edu.utah.further.mdr.impl.service.asset.AssetServiceImpl
All Implemented Interfaces:
AssetService

@Implementation
@Service(value="assetService")
@Transactional(readOnly=true)
public class AssetServiceImpl
extends AbstractAssetService

Asset service implementation.

-----------------------------------------------------------------------------------
(c) 2008-2011 FURTHeR Project, AVP Health Sciences IT Office, University of Utah
Contact: Dr. Scott Narus <scott.narus@hsc.utah.edu>
Biomedical Informatics, 26 South 2000 East
Room 5775 HSEB, Salt Lake City, UT 84112
Day Phone: 1-801-213-3288
-----------------------------------------------------------------------------------

Version:
Mar 23, 2009
Author:
Oren E. Livne <oren.livne@utah.edu>

Constructor Summary
AssetServiceImpl()
           
 
Method Summary
 Asset findAssetById(Long id)
          Find an asset by unique identifier.
 List<Asset> findAssetsByLikeLabel(String label)
          Find assets that match (LIKE) an asset label.
 Resource findResourceById(Long id)
          Find a resource by unique identifier.
 List<Resource> findResourcesByLikeTypeLabel(String typeLabel)
          Find resources that match (LIKE) a resource type label.
 List<Resource> findResourcesByTypeId(Long typeId)
          Find resources that match a resource type identifier.
 List<ResourceType> findResourceTypesByLikeTypeLabel(String typeLabel)
          Find resource types that match (LIKE) a resource type label.
 Resource getActiveResourceByPath(String path)
           
 Resource getActiveResourceByPathHelper(String path)
          A helper method whose purpose is to filter the resource using AOP.
<T> T
getResourceContent(Class<T> type, Long id)
          Return the content of a resource by unique resource identifier.
 String getTransformedResource(DocumentType docType, String docPath, TransformType transType, String transPath, Map<String,String> params)
           
 void setDao(Dao dao)
          Set a new value for the dao property.
 void setDaoEager(Dao daoEager)
          Set a new value for the daoEager property.
 void setFetchProperties(boolean fetchProperties)
          Set a new value for the fetchProperties property.
 void setXqueryService(XQueryService xqueryService)
          Set a new value for the xqueryService property.
 
Methods inherited from class edu.utah.further.mdr.common.asset.AbstractAssetService
getActiveResourceContentByPath, getActiveResourceInputstreamByPath, getResolver, getResourceContentService, getSelf, setResolver, setResourceContentService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AssetServiceImpl

public AssetServiceImpl()
Method Detail

findAssetById

public Asset findAssetById(Long id)
Find an asset by unique identifier.

Parameters:
id - asset unique identifier to look for
Returns:
persistent asset domain entity, if found. If not found, returns null
See Also:
AssetService.findAssetById(java.lang.Long)

findAssetsByLikeLabel

public List<Asset> findAssetsByLikeLabel(String label)
Find assets that match (LIKE) an asset label.

Parameters:
label - asset label (description) substring
Returns:
list matching resources
See Also:
edu.utah.further.mdr.api.service.asset.AssetService#findAssetsByLikeLabel(java.lang.Long)

findResourceById

@Filtered
public Resource findResourceById(Long id)
Find a resource by unique identifier.

Parameters:
id - resource unique identifier to look for
Returns:
persistent resource domain entity, if found. If not found, returns null
See Also:
AssetService.findAssetById(java.lang.Long)

findResourcesByTypeId

@Filtered
public List<Resource> findResourcesByTypeId(Long typeId)
Find resources that match a resource type identifier.

Parameters:
typeId - resource type identifier to look for
Returns:
list matching resources
See Also:
AssetService.findResourcesByTypeId(java.lang.Long)

findResourcesByLikeTypeLabel

@Filtered
public List<Resource> findResourcesByLikeTypeLabel(String typeLabel)
Find resources that match (LIKE) a resource type label.

Parameters:
typeLabel - resource type label (description) substring
Returns:
list matching resources
See Also:
edu.utah.further.mdr.api.service.asset.AssetService#findResourcesByLikeTypeLabel(java.lang.Long)

getActiveResourceByPath

public Resource getActiveResourceByPath(String path)
Parameters:
path -
Returns:
See Also:
AssetService.getActiveResourceByPath(java.lang.String)

getResourceContent

public <T> T getResourceContent(Class<T> type,
                                Long id)
Return the content of a resource by unique resource identifier. The content is taken from the column that matches the resource's storage code. It is clients responsibility to pass the correct class. type to cast resource content to

Parameters:
id - resource unique identifier to look for
clazz - the type of resource to return
Returns:
resource content field string, if persistent resource entity is found found. Otherwise, returns null
Throws:
ClassCastException - if the cast to type T fails
See Also:
AssetService.findAssetById(java.lang.Long)

findResourceTypesByLikeTypeLabel

public List<ResourceType> findResourceTypesByLikeTypeLabel(String typeLabel)
Find resource types that match (LIKE) a resource type label.

Parameters:
typeLabel - resource type label (description) substring
Returns:
list matching resource types
See Also:
edu.utah.further.mdr.api.service.asset.AssetService#findResourceTypesByLikeTypeLabel(java.lang.Long)

getTransformedResource

public String getTransformedResource(DocumentType docType,
                                     String docPath,
                                     TransformType transType,
                                     String transPath,
                                     Map<String,String> params)

setDao

public void setDao(Dao dao)
Set a new value for the dao property.

Parameters:
dao - the dao to set

setDaoEager

public void setDaoEager(Dao daoEager)
Set a new value for the daoEager property.

Parameters:
daoEager - the daoEager to set

setFetchProperties

public void setFetchProperties(boolean fetchProperties)
Set a new value for the fetchProperties property.

Parameters:
fetchProperties - the fetchProperties to set

setXqueryService

public void setXqueryService(XQueryService xqueryService)
Set a new value for the xqueryService property.

Parameters:
xqueryService - the xqueryService to set

getActiveResourceByPathHelper

@Filtered
public Resource getActiveResourceByPathHelper(String path)
A helper method whose purpose is to filter the resource using AOP.

Parameters:
path -
Returns:


Copyright © 2011 Office of the AVP for Health Sci. IT. All Rights Reserved.