Package org.cyclos.impl.marketplace
Interface AdServiceLocal
-
- All Superinterfaces:
AdService,CRUDService<BasicAdDTO,AdDetailsData,AdDataParams>,CRUDServiceLocal<BasicAd,BasicAdDTO,AdDetailsData,AdDataParams>,Service
- All Known Implementing Classes:
AdServiceImpl
public interface AdServiceLocal extends AdService, CRUDServiceLocal<BasicAd,BasicAdDTO,AdDetailsData,AdDataParams>
Local interface forAdService
-
-
Field Summary
Fields Modifier and Type Field Description static StringATTR_AD_TYPEAttribute name for scripting: The advertisement type being searchedstatic StringATTR_USERAttribute name for scripting: The user in which advertisements are being searched
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanadRequiresAuthorization(BasicAd ad)Returns true if the ad requires authorization for publishing.booleancanViewAddresses(User adOwner)Returns if the given ad owner or a user manager can view addresses in an adbooleancanViewAuthorizationNotes(BasicAd ad)Returns true if the logged user can view the authorization notes of the given adbooleancanViewPendings(AdType adType, User owner, boolean brokeredSearch)Returns true if the logged user can view pending ads with the given restrictionsvoidcheckStatus(boolean guest, boolean ownAds, BasicAdQuery params, User owner)Check the statuses in the query params according to the relationship between the logged user and the ad owner.intdisableInCurrencies(User user, Collection<Currency> currencies)Disables all the ads for the given user which are related to the given currenciesAdWebShopfindByOwnerAndNumber(User user, String orderNumber)Returns an AdWebShop by product owner and number, or throwsEntityNotFoundExceptionif not foundIntegergetAdvertisementsCount(User owner, AdType type)Counts the number of ads filtering by status, for more details about the filters seecheckStatus(boolean, boolean, BasicAdQuery, User)}Set<AdCategoryVO>getCategories(Long adId)Returns the categories for the given Ad idbooleanhasManageAccess(Date deletedDate, AdStatus status, AdStatus persistedStatus, AdType type, User owner)Returns true if the logged user has manage access to the ad with the given conditionsbooleanhasManageAccess(BasicAd ad)Returns true if the logged user has manage access for the given ad.booleanhasManageAccess(AdType type, User owner)Returns true if the logged user can manage ads of the given type and user.List<SitemapItemVO>listForSitemap()Returns the sitemap entries for all enabled advertisements in this networkvoidremoveAll(User user)Removes all the advertisements for the given user-
Methods inherited from interface org.cyclos.services.marketplace.AdService
approve, exportAd, getAdSearchData, getUserAdsSearchData, getViewData, loadVO, reject, search, setAsDraft, setHidden, submitForAuthorization
-
Methods inherited from interface org.cyclos.services.CRUDService
getData, getDataForNew, load, remove, removeAll, save
-
Methods inherited from interface org.cyclos.impl.CRUDServiceLocal
find, findAll, getEntityClass, newEntity, remove, removeAll, saveEntity, saveSkippingEntityLog, toDTO, toEntity, validate
-
-
-
-
Field Detail
-
ATTR_USER
static final String ATTR_USER
Attribute name for scripting: The user in which advertisements are being searched- See Also:
- Constant Field Values
-
ATTR_AD_TYPE
static final String ATTR_AD_TYPE
Attribute name for scripting: The advertisement type being searched- See Also:
- Constant Field Values
-
-
Method Detail
-
adRequiresAuthorization
boolean adRequiresAuthorization(BasicAd ad)
Returns true if the ad requires authorization for publishing.
-
canViewAddresses
boolean canViewAddresses(User adOwner)
Returns if the given ad owner or a user manager can view addresses in an ad
-
canViewAuthorizationNotes
boolean canViewAuthorizationNotes(BasicAd ad)
Returns true if the logged user can view the authorization notes of the given ad
-
canViewPendings
boolean canViewPendings(AdType adType, User owner, boolean brokeredSearch)
Returns true if the logged user can view pending ads with the given restrictions
-
checkStatus
void checkStatus(boolean guest, boolean ownAds, BasicAdQuery params, User owner)Check the statuses in the query params according to the relationship between the logged user and the ad owner. if no status is passed in the query params, all the allowed ones are setted.
-
disableInCurrencies
int disableInCurrencies(User user, Collection<Currency> currencies)
Disables all the ads for the given user which are related to the given currencies
-
findByOwnerAndNumber
AdWebShop findByOwnerAndNumber(User user, String orderNumber)
Returns an AdWebShop by product owner and number, or throwsEntityNotFoundExceptionif not found
-
getAdvertisementsCount
Integer getAdvertisementsCount(User owner, AdType type)
Counts the number of ads filtering by status, for more details about the filters seecheckStatus(boolean, boolean, BasicAdQuery, User)}
-
getCategories
Set<AdCategoryVO> getCategories(Long adId)
Returns the categories for the given Ad id
-
hasManageAccess
boolean hasManageAccess(AdType type, User owner)
Returns true if the logged user can manage ads of the given type and user. Doesn't takes into account the authorization status of advertisements.
-
hasManageAccess
boolean hasManageAccess(BasicAd ad)
Returns true if the logged user has manage access for the given ad.
-
hasManageAccess
boolean hasManageAccess(Date deletedDate, AdStatus status, AdStatus persistedStatus, AdType type, User owner)
Returns true if the logged user has manage access to the ad with the given conditions
-
listForSitemap
List<SitemapItemVO> listForSitemap()
Returns the sitemap entries for all enabled advertisements in this network
-
removeAll
void removeAll(User user)
Removes all the advertisements for the given user
-
-