@Security public class AdServiceSecurity extends CRUDServiceSecurity<BasicAdDTO,BasicAd,AdDetailsData,AdDataParams> implements AdService
AdServiceentityClass| Constructor and Description |
|---|
AdServiceSecurity() |
| Modifier and Type | Method and Description |
|---|---|
void |
approve(@NotNull BasicAdVO adVO)
Approves the publication of an advertisement in status
AdStatus.PENDING. |
protected boolean |
canCreateNew(boolean isSimpleAd,
User user) |
boolean |
canPerformOperation(BasicAd entity,
CRUDOperation operation)
Returns whether the logged user can perform the given operation over the given entity
|
protected void |
checkApproveOrReject(BasicAdVO adVO) |
protected void |
checkCreateNew(AdDataParams params)
Checks whether creating new entities with the given context parameters is allowed, throwing
PermissionDeniedException if not |
protected void |
customizeData(AdDetailsData data)
Can be overridden in order to process the returned data object for the given entity
|
boolean |
doHasManageAccess(BasicAd ad)
Should be implemented in order to return whether the caller is allowed to manage the given entity, for the given
operation
|
boolean |
doHasViewAccess(BasicAd ad)
Should be implemented in order to return whether the caller is allowed to view the given entity.
|
FileInfo |
exportAd(ExportFormatVO format,
BasicAdVO adVO)
Exports the given advertisement to file
|
AdSearchData |
getAdSearchData(AdType type,
boolean overBrokeredUsers)
Returns data for searching advertisements
|
protected AdServiceLocal |
getImplementation()
Should be implemented in order to return the actual implementation of the service
|
UserAdsSearchData |
getUserAdsSearchData(UserLocatorVO locator,
AdType type)
Returns data for searching advertisements
|
AdViewData |
getViewData(BasicAdVO adVO)
Returns data for viewing details of an advertisement
|
boolean |
isAccessible(SessionData sessionData,
BasicAd entity)
Must be implemented in order to determine whether the given entity is accessible for the given session data.
|
BasicAdVO |
loadVO(BasicAdVO adVO)
Loads a VO, by id
|
void |
reject(@NotNull BasicAdVO adVO,
java.lang.String comments)
Rejects the publication of an advertisement in status
AdStatus.PENDING. |
Page<BasicAdVO> |
search(BasicAdQuery params)
Searches for advertisements, according to the given query parameters
|
void |
setAsDraft(BasicAdVO adVO,
java.lang.String comments)
Sets the ad back to draft status.
|
void |
setHidden(BasicAdVO adVO,
boolean hidden)
Hides or unhides the ad according to given hidden parameter.
|
void |
submitForAuthorization(@NotNull BasicAdVO adVO)
Submits the given ad for authorization.
|
canViewData, checkManageAccess, checkOperation, checkSave, checkViewAccess, find, getConfirmationPasswordInputForRemove, getData, getDataForNew, getEntityClass, hasManageAccess, hasViewAccess, load, onBeforeSave, remove, removeAll, removeAllWithConfirmationPassword, removeWithConfirmationPassword, resolveEntityCheck, save, saveWithConfirmationPasswordcheckGuest, checkId, checkIds, checkInternalName, checkLoggedIn, checkManagesUser, checkRelatesToUser, checkScope, checkVO, checkVOs, doInitialize, getEntityCheckRegistry, getUser, initializecanManage, 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, toDate, toDateTime, validatedelete, detach, find, flush, from, getApplicationContext, getFormatter, getFormatter, getFormatter, getLogger, getRemoteAddress, getSessionData, mailContentBuilder, message, message, persist, processBatch, processBatch, refresh, remove, selectFrom, subQuery, updateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetData, getDataForNew, load, remove, removeAll, savepublic void approve(@NotNull
@NotNull BasicAdVO adVO)
throws FrameworkException
AdServiceAdStatus.PENDING.
The new status will be AdStatus.ACTIVE.approve in interface AdServiceFrameworkExceptionpublic boolean canPerformOperation(BasicAd entity, CRUDOperation operation)
CRUDServiceSecuritycanPerformOperation in class CRUDServiceSecurity<BasicAdDTO,BasicAd,AdDetailsData,AdDataParams>public boolean doHasManageAccess(BasicAd ad)
CRUDServiceSecuritydoHasManageAccess in class CRUDServiceSecurity<BasicAdDTO,BasicAd,AdDetailsData,AdDataParams>public boolean doHasViewAccess(BasicAd ad)
CRUDServiceSecuritydoHasViewAccess in class CRUDServiceSecurity<BasicAdDTO,BasicAd,AdDetailsData,AdDataParams>public FileInfo exportAd(ExportFormatVO format, BasicAdVO adVO) throws FrameworkException
AdServiceexportAd in interface AdServiceFrameworkExceptionpublic AdSearchData getAdSearchData(AdType type, boolean overBrokeredUsers)
AdServicegetAdSearchData in interface AdServicepublic UserAdsSearchData getUserAdsSearchData(UserLocatorVO locator, AdType type)
AdServicegetUserAdsSearchData in interface AdServicepublic AdViewData getViewData(BasicAdVO adVO) throws EntityNotFoundException
AdServicegetViewData in interface AdServiceEntityNotFoundExceptionpublic boolean isAccessible(SessionData sessionData, BasicAd entity)
CRUDServiceSecurityCRUDServiceSecurity.hasViewAccess(BaseEntity). If the only condition for an entity is
CRUDServiceSecurity.hasViewAccess(BaseEntity), this method
should return false.isAccessible in class CRUDServiceSecurity<BasicAdDTO,BasicAd,AdDetailsData,AdDataParams>public BasicAdVO loadVO(BasicAdVO adVO) throws FrameworkException
AdServiceloadVO in interface AdServiceFrameworkExceptionpublic void reject(@NotNull
@NotNull BasicAdVO adVO,
java.lang.String comments)
throws FrameworkException
AdServiceAdStatus.PENDING.
The new status will be AdStatus.DRAFT.reject in interface AdServiceFrameworkExceptionpublic Page<BasicAdVO> search(BasicAdQuery params)
AdServicepublic void setAsDraft(BasicAdVO adVO, java.lang.String comments)
AdServicesetAsDraft in interface AdServicepublic void setHidden(BasicAdVO adVO, boolean hidden)
AdServicepublic void submitForAuthorization(@NotNull
@NotNull BasicAdVO adVO)
AdServiceAdStatus.PENDING status.
This is used only by the REST services but we should refactor the marketplace module too to use actions instead
of save the ad each time the status changes.submitForAuthorization in interface AdServiceprotected boolean canCreateNew(boolean isSimpleAd,
User user)
protected void checkApproveOrReject(BasicAdVO adVO)
protected void checkCreateNew(AdDataParams params)
CRUDServiceSecurityPermissionDeniedException if notcheckCreateNew in class CRUDServiceSecurity<BasicAdDTO,BasicAd,AdDetailsData,AdDataParams>protected void customizeData(AdDetailsData data)
CRUDServiceSecuritycustomizeData in class CRUDServiceSecurity<BasicAdDTO,BasicAd,AdDetailsData,AdDataParams>protected AdServiceLocal getImplementation()
CRUDServiceSecuritygetImplementation in class CRUDServiceSecurity<BasicAdDTO,BasicAd,AdDetailsData,AdDataParams>