Package org.cyclos.impl.system
Class InternalImageServiceImpl
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.impl.BaseServiceImpl
-
- org.cyclos.impl.system.InternalImageServiceImpl
-
- All Implemented Interfaces:
InternalImageServiceLocal,Service,InternalImageService
@Service public class InternalImageServiceImpl extends BaseServiceImpl implements InternalImageServiceLocal
Implementation forInternalImageService
-
-
Field Summary
-
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 InternalImageServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImagefindByKey(String key)Finds an image by keyvoidinitialize()ImageVOload(Long id)Loads an image by idImageVOloadByKey(String key)Loads an image by keySerializableInputStreamqrCode(String value, ImageSize size)Generates a qr-code image with the given value and sizeSerializableInputStreamreadConfigurationImage(Long configurationId, ConfigurationImageType type)Returns the content of a given configuration image, for the given configurationSerializableInputStreamreadContent(Long id)Reads the contents for the image with the given id, with the specified sizeSerializableInputStreamreadContentByKey(String key)Reads the contents for the image with the given key, with the specified sizeSerializableInputStreamreadThemeImage(Long themeId, ThemeImageType type, String name)Returns the content of an image, according to the given image natureSerializableInputStreamreadVoucherTemplateImage(Long voucherTemplateId, String name)Returns the content of an image,protected voidregisterNetworkMappings(NetworkPathRegistry networkPathRegistry)Needs to be overridden by subclasses to register the path up to the networkvoidremove(Long id)Removes an image, no matter its typevoidremoveByKey(String key)Removes an image, no matter its type-
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
-
-
-
-
Method Detail
-
findByKey
public Image findByKey(String key)
Description copied from interface:InternalImageServiceLocalFinds an image by key- Specified by:
findByKeyin interfaceInternalImageServiceLocal
-
initialize
@PostConstruct public void initialize()
-
load
public ImageVO load(Long id) throws FrameworkException
Description copied from interface:InternalImageServiceLoads an image by id- Specified by:
loadin interfaceInternalImageService- Throws:
FrameworkException
-
loadByKey
public ImageVO loadByKey(String key) throws FrameworkException
Description copied from interface:InternalImageServiceLoads an image by key- Specified by:
loadByKeyin interfaceInternalImageService- Throws:
FrameworkException
-
qrCode
public SerializableInputStream qrCode(String value, ImageSize size) throws FrameworkException
Description copied from interface:InternalImageServiceGenerates a qr-code image with the given value and size- Specified by:
qrCodein interfaceInternalImageService- Throws:
FrameworkException
-
readConfigurationImage
public SerializableInputStream readConfigurationImage(Long configurationId, ConfigurationImageType type) throws FrameworkException
Description copied from interface:InternalImageServiceReturns the content of a given configuration image, for the given configuration- Specified by:
readConfigurationImagein interfaceInternalImageService- Throws:
FrameworkException
-
readContent
public SerializableInputStream readContent(Long id) throws FrameworkException
Description copied from interface:InternalImageServiceReads the contents for the image with the given id, with the specified size- Specified by:
readContentin interfaceInternalImageService- Throws:
FrameworkException
-
readContentByKey
public SerializableInputStream readContentByKey(String key) throws FrameworkException
Description copied from interface:InternalImageServiceReads the contents for the image with the given key, with the specified size- Specified by:
readContentByKeyin interfaceInternalImageService- Throws:
FrameworkException
-
readThemeImage
public SerializableInputStream readThemeImage(Long themeId, ThemeImageType type, String name) throws FrameworkException
Description copied from interface:InternalImageServiceReturns the content of an image, according to the given image nature- Specified by:
readThemeImagein interfaceInternalImageService- Parameters:
themeId- The theme identifiertype- The image type. Will determine the semantics for the other parametersname- Depends on the nature. When nature ==ThemeImageType.CUSTOM, will be the file name. Otherwise, will be the name for the corresponding enumeration- Throws:
FrameworkException
-
readVoucherTemplateImage
public SerializableInputStream readVoucherTemplateImage(Long voucherTemplateId, String name) throws FrameworkException
Description copied from interface:InternalImageServiceReturns the content of an image,- Specified by:
readVoucherTemplateImagein interfaceInternalImageService- Parameters:
voucherTemplateId- The voucher template identifiername- The file name.- Throws:
FrameworkException
-
remove
public void remove(Long id) throws FrameworkException
Description copied from interface:InternalImageServiceRemoves an image, no matter its type- Specified by:
removein interfaceInternalImageService- Throws:
FrameworkException
-
removeByKey
public void removeByKey(String key) throws FrameworkException
Description copied from interface:InternalImageServiceRemoves an image, no matter its type- Specified by:
removeByKeyin interfaceInternalImageService- Throws:
FrameworkException
-
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
-
-