com.rapidtransform.part.service.impl
Class ItemServiceImpl

java.lang.Object
  extended by com.rapidtransform.core.service.impl.ServiceImpl
      extended by com.rapidtransform.core.service.impl.CRUDServiceImpl<Type>
          extended by com.rapidtransform.core.service.impl.MetaCRUDServiceImpl<ItemVersion>
              extended by com.rapidtransform.part.service.impl.ItemServiceImpl
All Implemented Interfaces:
CRUDService<ItemVersion>, MetaCRUDService<ItemVersion>, Service, DocumentedService<ItemVersion>, ItemService, SpecifiedService<ItemVersion>

public class ItemServiceImpl
extends MetaCRUDServiceImpl<ItemVersion>
implements ItemService

This service implementation provides find and CRUD methods for Items, ItemVersions, ItemViews, and ItemInstances. This class provides the transaction wrapper for all operations and can be extended to provide other custom extensions, such as starting workflow operations or validating business rules prior to performing the action. The service class is a logical object to create new Aspects or Interceptors which do the work for the business rules, workflow, or any other custom operations. Using the Spring Framework and Hibernate, it is easy to configure and implement a custom Aspect or interceptors, and apply them to any class or method via configuration.

Author:
S. Werner

Constructor Summary
ItemServiceImpl()
           
 
Method Summary
 Relation<ItemVersion,Document> addDocument(Documented source, Document target, java.lang.String relationType)
           
 Relation<ItemVersion,Specification> addSpecification(Specified source, Specification target, java.lang.String relationType)
           
 ItemVersion create()
          Creates a new Item and returns the initial version (ItemVersion) for the Item.
 Item findItem(java.lang.String itemId)
          Returns the Item with the specified Id.
 java.util.List findItems(java.lang.Integer resultsPerPage)
          Returns a paged list of Items.
 java.util.Collection<Document> getDocuments(java.lang.String relationQname, java.lang.String documentedId)
           
 org.apache.commons.logging.Log getLog()
           
 java.util.Collection<Specification> getSpecifications(java.lang.String relationQname, java.lang.String specifiedId)
           
 ItemVersion revise(Item item)
          Creates a new version for the given item.
 Assembly saveAssembly(Assembly assembly)
           
 CollectionView saveCollectionView(CollectionView collectionView)
           
 ItemInstance saveItemInstance(ItemInstance itemInstance)
           
 ItemView saveItemView(ItemView itemView)
           
 QuantifiedInstance saveQuantifiedInstance(QuantifiedInstance quantifiedInstance)
           
 SelectedInstance saveSelectedInstance(SelectedInstance selectedInstance)
           
 SingleInstance saveSingleInstance(SingleInstance singleInstance)
           
 SpecifiedInstance saveSpecifiedInstance(SpecifiedInstance specifiedInstance)
           
 void setItemDAO(ItemDAO itemDao)
           
 void setItemInstanceDAO(ItemInstanceDAO itemInstanceDao)
           
 void setItemVersionDAO(ItemVersionDAO itemVersionDao)
           
 void setItemViewDAO(ItemViewDAO itemViewDao)
           
 
Methods inherited from class com.rapidtransform.core.service.impl.MetaCRUDServiceImpl
create, createRelation, findByMetaType, getMetaService, getRelationDao, setMetaService, setRelationDao
 
Methods inherited from class com.rapidtransform.core.service.impl.CRUDServiceImpl
find, findAll, getDao, getPersistentClass, save, setDao, setPersistentClass
 
Methods inherited from class com.rapidtransform.core.service.impl.ServiceImpl
getMessageSource, getSecurityService, setMessageSource, setSecurityService
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.rapidtransform.core.service.MetaCRUDService
create, createRelation, findByMetaType
 
Methods inherited from interface com.rapidtransform.core.service.CRUDService
find, findAll, save
 

Constructor Detail

ItemServiceImpl

public ItemServiceImpl()
Method Detail

getLog

public org.apache.commons.logging.Log getLog()
Specified by:
getLog in class CRUDServiceImpl<ItemVersion>

setItemVersionDAO

public void setItemVersionDAO(ItemVersionDAO itemVersionDao)

setItemDAO

public void setItemDAO(ItemDAO itemDao)

setItemInstanceDAO

public void setItemInstanceDAO(ItemInstanceDAO itemInstanceDao)

setItemViewDAO

public void setItemViewDAO(ItemViewDAO itemViewDao)

findItem

public Item findItem(java.lang.String itemId)
              throws ConveloException,
                     org.springframework.dao.DataAccessException
Returns the Item with the specified Id.

Specified by:
findItem in interface ItemService
Throws:
ConveloException
org.springframework.dao.DataAccessException

findItems

public java.util.List findItems(java.lang.Integer resultsPerPage)
                         throws ConveloException,
                                org.springframework.dao.DataAccessException
Returns a paged list of Items.

Specified by:
findItems in interface ItemService
Throws:
ConveloException
org.springframework.dao.DataAccessException

create

public ItemVersion create()
                   throws ConveloException
Creates a new Item and returns the initial version (ItemVersion) for the Item. The Item information can be accessed via the initial ItemVersion.

Specified by:
create in interface CRUDService<ItemVersion>
Overrides:
create in class CRUDServiceImpl<ItemVersion>
Returns:
Throws:
ConveloException

revise

public ItemVersion revise(Item item)
                   throws ConveloException
Creates a new version for the given item. The ItemVersion is added to the list of versions contained in the item object.

Specified by:
revise in interface ItemService
Parameters:
item -
Returns:
Throws:
ConveloException

saveItemView

@Transactional
public ItemView saveItemView(ItemView itemView)
                      throws ConveloException,
                             org.springframework.dao.DataAccessException
Specified by:
saveItemView in interface ItemService
Throws:
ConveloException
org.springframework.dao.DataAccessException

saveAssembly

@Transactional
public Assembly saveAssembly(Assembly assembly)
                      throws ConveloException,
                             org.springframework.dao.DataAccessException
Specified by:
saveAssembly in interface ItemService
Throws:
ConveloException
org.springframework.dao.DataAccessException

saveCollectionView

@Transactional
public CollectionView saveCollectionView(CollectionView collectionView)
                                  throws ConveloException,
                                         org.springframework.dao.DataAccessException
Specified by:
saveCollectionView in interface ItemService
Throws:
ConveloException
org.springframework.dao.DataAccessException

saveItemInstance

@Transactional
public ItemInstance saveItemInstance(ItemInstance itemInstance)
                              throws ConveloException,
                                     org.springframework.dao.DataAccessException
Specified by:
saveItemInstance in interface ItemService
Throws:
ConveloException
org.springframework.dao.DataAccessException

saveSingleInstance

@Transactional
public SingleInstance saveSingleInstance(SingleInstance singleInstance)
                                  throws ConveloException,
                                         org.springframework.dao.DataAccessException
Specified by:
saveSingleInstance in interface ItemService
Throws:
ConveloException
org.springframework.dao.DataAccessException

saveQuantifiedInstance

@Transactional
public QuantifiedInstance saveQuantifiedInstance(QuantifiedInstance quantifiedInstance)
                                          throws ConveloException,
                                                 org.springframework.dao.DataAccessException
Specified by:
saveQuantifiedInstance in interface ItemService
Throws:
ConveloException
org.springframework.dao.DataAccessException

saveSelectedInstance

@Transactional
public SelectedInstance saveSelectedInstance(SelectedInstance selectedInstance)
                                      throws ConveloException,
                                             org.springframework.dao.DataAccessException
Specified by:
saveSelectedInstance in interface ItemService
Throws:
ConveloException
org.springframework.dao.DataAccessException

saveSpecifiedInstance

@Transactional
public SpecifiedInstance saveSpecifiedInstance(SpecifiedInstance specifiedInstance)
                                        throws ConveloException,
                                               org.springframework.dao.DataAccessException
Specified by:
saveSpecifiedInstance in interface ItemService
Throws:
ConveloException
org.springframework.dao.DataAccessException

addSpecification

public Relation<ItemVersion,Specification> addSpecification(Specified source,
                                                            Specification target,
                                                            java.lang.String relationType)
                                                     throws ConveloException
Specified by:
addSpecification in interface SpecifiedService<ItemVersion>
Throws:
ConveloException

getSpecifications

public java.util.Collection<Specification> getSpecifications(java.lang.String relationQname,
                                                             java.lang.String specifiedId)
                                                      throws ConveloException
Specified by:
getSpecifications in interface SpecifiedService<ItemVersion>
Throws:
ConveloException

addDocument

public Relation<ItemVersion,Document> addDocument(Documented source,
                                                  Document target,
                                                  java.lang.String relationType)
                                           throws ConveloException
Specified by:
addDocument in interface DocumentedService<ItemVersion>
Throws:
ConveloException

getDocuments

public java.util.Collection<Document> getDocuments(java.lang.String relationQname,
                                                   java.lang.String documentedId)
                                            throws ConveloException
Specified by:
getDocuments in interface DocumentedService<ItemVersion>
Throws:
ConveloException