Class EntityDocThumbnailDataProvider

java.lang.Object
ch.tocco.nice2.dms.spi.customdataprovider.EntityDocThumbnailDataProvider
All Implemented Interfaces:
CustomDataProvider

public class EntityDocThumbnailDataProvider extends Object implements CustomDataProvider
This data-provider returns thumbnail url (as string) of an entity doc. It can be contributed in a spring boot configuration (you need to specify entityName, fieldName and size).

 @Bean
 public CustomDataProviderContribution articleThumbnailDataProvider(TypeManager typeManager,
                                                                    Context context,
                                                                    QueryBuilderFactory queryBuilderFactory,
                                                                    ContentTreeService contentTreeService,
                                                                    SecurityManager securityManager) {
     EntityDocThumbnailDataProvider dataProvider = new EntityDocThumbnailDataProvider(typeManager, context, queryBuilderFactory, contentTreeService, securityManager);
     dataProvider.setEntityName("Article");
     dataProvider.setFieldName("pic_small");
     dataProvider.setSize(80);
     return new CustomDataProviderContribution("nice2.optional.webshop.ArticleThumbnailDataProvider", dataProvider);
 }
 
Implementation note: it resolves entity doc in privileged mode for performance reasons (you can assume that you can read an entity doc when you can read the related entity).