Package no.nsd.qddt.domain.publication
Class PublicationServiceImpl
- java.lang.Object
-
- no.nsd.qddt.domain.publication.PublicationServiceImpl
-
- All Implemented Interfaces:
BaseService<Publication,java.util.UUID>
,PublicationService
@Service("publicationService") public class PublicationServiceImpl extends java.lang.Object implements PublicationService
-
-
Field Summary
Fields Modifier and Type Field Description protected org.slf4j.Logger
LOG
-
Constructor Summary
Constructors Constructor Description PublicationServiceImpl(PublicationRepository repository, PublicationAuditService publicationAuditService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
count()
void
delete(java.util.List<Publication> instances)
Deletes object with these IDs from backstore, exception raised by failure.void
delete(java.util.UUID uuid)
Deletes object with id ID from backstore, exception raised by failure.boolean
exists(java.util.UUID uuid)
org.springframework.data.domain.Page<Publication>
findAllPageable(org.springframework.data.domain.Pageable pageable)
org.springframework.data.domain.Page<Publication>
findByNameOrPurposeAndStatus(java.lang.String name, java.lang.String purpose, java.lang.String publicationStatus, java.lang.String publishedKind, org.springframework.data.domain.Pageable pageable)
Publication
findOne(java.util.UUID uuid)
Return a entity based on its ID.ElementRef
getDetail(ElementRef publicationElement)
protected Publication
prePersistProcessing(Publication instance)
Publication
save(Publication instance)
Store object T to backstore
-
-
-
Constructor Detail
-
PublicationServiceImpl
@Autowired public PublicationServiceImpl(PublicationRepository repository, PublicationAuditService publicationAuditService)
-
-
Method Detail
-
count
public long count()
- Specified by:
count
in interfaceBaseService<Publication,java.util.UUID>
- Returns:
- number of entities
-
exists
public boolean exists(java.util.UUID uuid)
- Specified by:
exists
in interfaceBaseService<Publication,java.util.UUID>
- Parameters:
uuid
- ID of entity- Returns:
- true if exists
-
findOne
@PreAuthorize("hasAnyAuthority(\'ROLE_ADMIN\',\'ROLE_EDITOR\',\'ROLE_CONCEPT\',\'ROLE_VIEW\',\'ROLE_GUEST\')") public Publication findOne(java.util.UUID uuid)
Description copied from interface:BaseService
Return a entity based on its ID.- Specified by:
findOne
in interfaceBaseService<Publication,java.util.UUID>
- Parameters:
uuid
- ID of entity- Returns:
- Entity
-
save
@Transactional @PreAuthorize("hasAnyAuthority(\'ROLE_ADMIN\',\'ROLE_EDITOR\') and hasPermission(#instance,\'AGENCY\')") public Publication save(Publication instance)
Description copied from interface:BaseService
Store object T to backstore- Specified by:
save
in interfaceBaseService<Publication,java.util.UUID>
- Parameters:
instance
- object T- Returns:
- saved instance T (may have fields updated by backstore)
-
delete
@Transactional @PreAuthorize("hasAnyAuthority(\'ROLE_ADMIN\',\'ROLE_EDITOR\')") public void delete(java.util.UUID uuid)
Description copied from interface:BaseService
Deletes object with id ID from backstore, exception raised by failure.- Specified by:
delete
in interfaceBaseService<Publication,java.util.UUID>
- Parameters:
uuid
- ID of entity
-
delete
@Transactional @PreAuthorize("hasAnyAuthority(\'ROLE_ADMIN\',\'ROLE_EDITOR\')") public void delete(java.util.List<Publication> instances)
Description copied from interface:BaseService
Deletes object with these IDs from backstore, exception raised by failure.- Specified by:
delete
in interfaceBaseService<Publication,java.util.UUID>
- Parameters:
instances
- list of entity IDs
-
findAllPageable
@Transactional(readOnly=true) @PreAuthorize("hasAnyAuthority(\'ROLE_ADMIN\',\'ROLE_EDITOR\',\'ROLE_CONCEPT\',\'ROLE_VIEW\',\'ROLE_GUEST\')") public org.springframework.data.domain.Page<Publication> findAllPageable(org.springframework.data.domain.Pageable pageable)
- Specified by:
findAllPageable
in interfacePublicationService
-
findByNameOrPurposeAndStatus
@Transactional(readOnly=true) @PreAuthorize("hasAnyAuthority(\'ROLE_ADMIN\',\'ROLE_EDITOR\',\'ROLE_CONCEPT\',\'ROLE_VIEW\',\'ROLE_GUEST\')") public org.springframework.data.domain.Page<Publication> findByNameOrPurposeAndStatus(java.lang.String name, java.lang.String purpose, java.lang.String publicationStatus, java.lang.String publishedKind, org.springframework.data.domain.Pageable pageable)
- Specified by:
findByNameOrPurposeAndStatus
in interfacePublicationService
-
getDetail
@Transactional(readOnly=true) @PreAuthorize("hasAnyAuthority(\'ROLE_ADMIN\',\'ROLE_EDITOR\',\'ROLE_CONCEPT\',\'ROLE_VIEW\',\'ROLE_GUEST\')") public ElementRef getDetail(ElementRef publicationElement)
- Specified by:
getDetail
in interfacePublicationService
-
prePersistProcessing
protected Publication prePersistProcessing(Publication instance)
-
-