Class ThemeImageServiceImpl
- java.lang.Object
-
- org.cyclos.impl.AbstractServerComponent
-
- org.cyclos.impl.AbstractNetworkedServerComponent
-
- org.cyclos.impl.BaseServiceImpl
-
- org.cyclos.impl.system.BaseImageServiceImpl<ThemeImage,QThemeImage,NewThemeImageParams>
-
- org.cyclos.impl.contentmanagement.ThemeImageServiceImpl
-
- All Implemented Interfaces:
ThemeImageServiceLocal,BaseImageServiceLocal<ThemeImage,NewThemeImageParams>,ThemeImageService,Service,BaseImageService<NewThemeImageParams>
@Service public class ThemeImageServiceImpl extends BaseImageServiceImpl<ThemeImage,QThemeImage,NewThemeImageParams> implements ThemeImageServiceLocal
Implementation forThemeImageService
-
-
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 ThemeImageServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetImageUrl(Theme theme, ThemeImageType type, String name)Returns the URL for the given theme imageThemeImageVOgetImageVO(Long themeId, ThemeImageType type, String name)Returns the image VO for the image with the given data, or throws anEntityNotFoundExceptionif the given image doesn't existvoidinitialize()List<ThemeImageVO>list(Long themeId, Set<ThemeImageType> types)Lists the given theme's images of the given typesThemeImagenewImage(NewThemeImageParams param)Returns a new image for the given parametersprotected voidonAfterRemove(ThemeImage image)May be overridden in order to take actions after remove an imagebyte[]readImageContent(Long themeId, ThemeImageType type, String name)Reads a theme image by type and 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 imageThemeImageVOsave(NewThemeImageParams param, String name, SerializableInputStream content, String contentType)Saves the given image for the given parameter (which depends on each image type), returning the descriptorThemeImagesaveImage(Theme theme, ThemeImageType type, String name, InputStream in, String contentType)Saves an image for the given theme, type 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(Theme theme, ThemeImageType type, String name)
Description copied from interface:ThemeImageServiceLocalReturns the URL for the given theme image- Specified by:
getImageUrlin interfaceThemeImageServiceLocal
-
getImageVO
public ThemeImageVO getImageVO(Long themeId, ThemeImageType type, String name)
Description copied from interface:ThemeImageServiceReturns the image VO for the image with the given data, or throws anEntityNotFoundExceptionif the given image doesn't exist- Specified by:
getImageVOin interfaceThemeImageService
-
initialize
@PostConstruct public void initialize()
-
list
public List<ThemeImageVO> list(Long themeId, Set<ThemeImageType> types)
Description copied from interface:ThemeImageServiceLists the given theme's images of the given types- Specified by:
listin interfaceThemeImageService
-
newImage
public ThemeImage newImage(NewThemeImageParams param)
Description copied from class:BaseImageServiceImplReturns a new image for the given parameters- Specified by:
newImagein classBaseImageServiceImpl<ThemeImage,QThemeImage,NewThemeImageParams>
-
readImageContent
public byte[] readImageContent(Long themeId, ThemeImageType type, String name) throws EntityNotFoundException
Description copied from interface:ThemeImageServiceLocalReads a theme image by type and name- Specified by:
readImageContentin interfaceThemeImageServiceLocal- Throws:
EntityNotFoundException
-
removeAll
public void removeAll(Collection<Long> ids) throws FrameworkException
Description copied from interface:BaseImageServiceRemoves all the given image- Specified by:
removeAllin interfaceBaseImageService<NewThemeImageParams>- Overrides:
removeAllin classBaseImageServiceImpl<ThemeImage,QThemeImage,NewThemeImageParams>- Throws:
FrameworkException
-
save
public final ThemeImageVO save(NewThemeImageParams 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<NewThemeImageParams>- Overrides:
savein classBaseImageServiceImpl<ThemeImage,QThemeImage,NewThemeImageParams>- Throws:
FrameworkException
-
saveImage
public ThemeImage saveImage(Theme theme, ThemeImageType type, String name, InputStream in, String contentType)
Description copied from interface:ThemeImageServiceLocalSaves an image for the given theme, type and name for the given input, returning the image id- Specified by:
saveImagein interfaceThemeImageServiceLocal
-
onAfterRemove
protected void onAfterRemove(ThemeImage image)
Description copied from class:BaseImageServiceImplMay be overridden in order to take actions after remove an image- Overrides:
onAfterRemovein classBaseImageServiceImpl<ThemeImage,QThemeImage,NewThemeImageParams>
-
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
-
-