Package org.cyclos.impl.banking
Class VoucherTemplateImageServiceImpl
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.impl.BaseServiceImpl
-
- org.cyclos.impl.system.BaseImageServiceImpl<VoucherTemplateImage,QVoucherTemplateImage,NewVoucherTemplateImageParams>
-
- org.cyclos.impl.banking.VoucherTemplateImageServiceImpl
-
- All Implemented Interfaces:
VoucherTemplateImageServiceLocal,BaseImageServiceLocal<VoucherTemplateImage,NewVoucherTemplateImageParams>,VoucherTemplateImageService,Service,BaseImageService<NewVoucherTemplateImageParams>
@Service public class VoucherTemplateImageServiceImpl extends BaseImageServiceImpl<VoucherTemplateImage,QVoucherTemplateImage,NewVoucherTemplateImageParams> implements VoucherTemplateImageServiceLocal
Implementation forVoucherTemplateImageService
-
-
Field Summary
-
Fields inherited from class org.cyclos.impl.system.BaseImageServiceImpl
$, imageHandler, imageType, nature
-
Fields inherited from class org.cyclos.impl.AbstractNetworkedServerComponent
authHandler, conversionHandler, customFieldValueHandler, entityManagerHandler, groupsHandler, productsHandler, restBeanPropertyMapping, userLocatorHandler
-
Fields inherited from class org.cyclos.impl.AbstractServerComponent
accountHandler, configurationHandler, dataTranslationHandler, notificationHandler, profileFieldHandler, transactionHandler, translationHandler
-
-
Constructor Summary
Constructors Constructor Description VoucherTemplateImageServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetImageUrl(VoucherTemplate voucherTemplate, String name)Returns the URL for the given voucher template imageVoucherTemplateImageVOgetImageVO(Long voucherTemplateId, String name)Returns the image VO for the image with the given data, or throws anEntityNotFoundExceptionif the given image doesn't existList<VoucherTemplateImageVO>list(Long voucherTemplateId)Lists the given images for the given templateVoucherTemplateImagenewImage(NewVoucherTemplateImageParams param)Returns a new image for the given parametersprotected voidonAfterRemove(VoucherTemplateImage image)May be overridden in order to take actions after remove an imagebyte[]readImageContent(Long voucherTemplateId, String name)Reads a voucher template image by nameprotected voidregisterNetworkMappings(NetworkPathRegistry networkPathRegistry)Needs to be overridden by subclasses to register the path up to the networkvoidremoveAll(Collection<Long> ids)Removes all the given imageVoucherTemplateImageVOsave(NewVoucherTemplateImageParams param, String name, SerializableInputStream content, String contentType)Saves the given image for the given parameter (which depends on each image type), returning the descriptorVoucherTemplateImagesaveImage(VoucherTemplate voucherTemplate, String name, InputStream in, String contentType)Saves an image for the given template and name for the given input, returning the image id-
Methods inherited from class org.cyclos.impl.system.BaseImageServiceImpl
find, findByKey, getImageNature, isKeepOriginalContent, onAfterSave, onBeforeRemove, readContent, readContentByKey, remove, saveName, setDataAndPersist, setImageName, validateMaxImages
-
Methods inherited from class org.cyclos.impl.BaseServiceImpl
initializeNetworkMappings
-
Methods inherited from class org.cyclos.impl.AbstractNetworkedServerComponent
canManage, checkManagesUser, checkPermission, checkRelatesToUser, checkValue, clearAlreadyValidated, getBaseEntityManagerHandler, getConfiguration, getLoggedBasicUser, getLoggedUser, getProducts, getTranslatedName, getTranslatedValue, hasPermission, hasValue, inSameNetwork, inSameNetworkOrGlobal, isAdmin, isAlreadyValidated, isBroker, isGlobalAdmin, isGlobalAdminInNetwork, isGuest, isLoggedIn, isMember, isMemberOnly, isNetworkAdmin, isOperator, isRelatedToUser, isSystem, isUserManager, isUserManagerOf, message, message, permission, permission, permissionOptionalValue, permissionOptionalValue, setAlreadyValidated, toDate, toDateTime, validate
-
Methods inherited from class org.cyclos.impl.AbstractServerComponent
dataTranslationProxy, dataTranslationProxy, delete, detach, doDataTranslationProxy, find, flush, from, getApplicationContext, getFormatter, getFormatter, getFormatter, getLogger, getRemoteAddress, getSessionData, mailContentBuilder, message, message, persist, processBatch, processBatch, refresh, remove, selectFrom, subQuery, update
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.cyclos.services.system.BaseImageService
remove, saveName
-
Methods inherited from interface org.cyclos.impl.system.BaseImageServiceLocal
find, getImageNature, readContent, readContentByKey
-
-
-
-
Method Detail
-
getImageUrl
public String getImageUrl(VoucherTemplate voucherTemplate, String name)
Description copied from interface:VoucherTemplateImageServiceLocalReturns the URL for the given voucher template image- Specified by:
getImageUrlin interfaceVoucherTemplateImageServiceLocal
-
getImageVO
public VoucherTemplateImageVO getImageVO(Long voucherTemplateId, String name)
Description copied from interface:VoucherTemplateImageServiceReturns the image VO for the image with the given data, or throws anEntityNotFoundExceptionif the given image doesn't exist- Specified by:
getImageVOin interfaceVoucherTemplateImageService
-
list
public List<VoucherTemplateImageVO> list(Long voucherTemplateId)
Description copied from interface:VoucherTemplateImageServiceLists the given images for the given template- Specified by:
listin interfaceVoucherTemplateImageService
-
newImage
public VoucherTemplateImage newImage(NewVoucherTemplateImageParams param)
Description copied from class:BaseImageServiceImplReturns a new image for the given parameters- Specified by:
newImagein classBaseImageServiceImpl<VoucherTemplateImage,QVoucherTemplateImage,NewVoucherTemplateImageParams>
-
readImageContent
public byte[] readImageContent(Long voucherTemplateId, String name) throws EntityNotFoundException
Description copied from interface:VoucherTemplateImageServiceLocalReads a voucher template image by name- Specified by:
readImageContentin interfaceVoucherTemplateImageServiceLocal- Throws:
EntityNotFoundException
-
removeAll
public void removeAll(Collection<Long> ids) throws FrameworkException
Description copied from interface:BaseImageServiceRemoves all the given image- Specified by:
removeAllin interfaceBaseImageService<NewVoucherTemplateImageParams>- Overrides:
removeAllin classBaseImageServiceImpl<VoucherTemplateImage,QVoucherTemplateImage,NewVoucherTemplateImageParams>- Throws:
FrameworkException
-
save
public final VoucherTemplateImageVO save(NewVoucherTemplateImageParams param, String name, SerializableInputStream content, String contentType) throws FrameworkException
Description copied from interface:BaseImageServiceSaves the given image for the given parameter (which depends on each image type), returning the descriptor- Specified by:
savein interfaceBaseImageService<NewVoucherTemplateImageParams>- Overrides:
savein classBaseImageServiceImpl<VoucherTemplateImage,QVoucherTemplateImage,NewVoucherTemplateImageParams>- Throws:
FrameworkException
-
saveImage
public VoucherTemplateImage saveImage(VoucherTemplate voucherTemplate, String name, InputStream in, String contentType)
Description copied from interface:VoucherTemplateImageServiceLocalSaves an image for the given template and name for the given input, returning the image id- Specified by:
saveImagein interfaceVoucherTemplateImageServiceLocal
-
onAfterRemove
protected void onAfterRemove(VoucherTemplateImage image)
Description copied from class:BaseImageServiceImplMay be overridden in order to take actions after remove an image- Overrides:
onAfterRemovein classBaseImageServiceImpl<VoucherTemplateImage,QVoucherTemplateImage,NewVoucherTemplateImageParams>
-
registerNetworkMappings
protected void registerNetworkMappings(NetworkPathRegistry networkPathRegistry)
Description copied from class:BaseServiceImplNeeds to be overridden by subclasses to register the path up to the network- Specified by:
registerNetworkMappingsin classBaseServiceImpl
-
-