Package org.cyclos.services.marketplace
Interface AdService
-
- All Superinterfaces:
CRUDService<BasicAdDTO,AdDetailsData,AdDataParams>,Service
- All Known Subinterfaces:
AdServiceLocal
public interface AdService extends CRUDService<BasicAdDTO,AdDetailsData,AdDataParams>
Service interface for advertisements
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidapprove(@NotNull BasicAdVO adVO)Approves the publication of an advertisement in statusAdStatus.PENDING.FileInfoexportAd(ExportFormatVO format, BasicAdVO adVO)Exports the given advertisement to fileAdSearchDatagetAdSearchData(AdType type, boolean overBrokeredUsers)Returns data for searching advertisementsUserFavoriteAdsListDatagetFavoritesListData(UserLocatorVO locator)Returns the data for advertisement favorites belonging to the given user, or the logged user if the given locator is null, plus permissions over them.UserAdsSearchDatagetUserAdsSearchData(@NotNull UserLocatorVO locator, AdType type)Returns data for searching advertisementsAdViewDatagetViewData(@NotNull BasicAdVO adVO)Returns data for viewing details of an advertisementBasicAdVOloadVO(@NotNull BasicAdVO adVO)Loads a VO, by idvoidmarkAsFavorite(@NotNull BasicAdVO adVO, boolean asFavorite)Marks the given ad as favorite for the current logged uservoidreject(@NotNull BasicAdVO adVO, String comments)Rejects the publication of an advertisement in statusAdStatus.PENDING.Page<BasicAdVO>search(@NotNull BasicAdQuery params)Searches for advertisements, according to the given query parametersvoidsetAsDraft(@NotNull BasicAdVO adVO, String comments)Sets the ad back to draft status.voidsetHidden(@NotNull BasicAdVO adVO, boolean hidden)Hides or unhides the ad according to given hidden parameter.voidsubmitForAuthorization(@NotNull BasicAdVO adVO)Submits the given ad for authorization.-
Methods inherited from interface org.cyclos.services.CRUDService
getData, getDataForNew, load, remove, removeAll, save
-
-
-
-
Method Detail
-
approve
void approve(@NotNull @NotNull BasicAdVO adVO) throws FrameworkExceptionApproves the publication of an advertisement in statusAdStatus.PENDING. The new status will beAdStatus.ACTIVE.- Throws:
FrameworkException
-
exportAd
FileInfo exportAd(ExportFormatVO format, BasicAdVO adVO) throws FrameworkException
Exports the given advertisement to file- Throws:
FrameworkException
-
getAdSearchData
AdSearchData getAdSearchData(AdType type, boolean overBrokeredUsers) throws FrameworkException
Returns data for searching advertisements- Throws:
FrameworkException
-
getFavoritesListData
UserFavoriteAdsListData getFavoritesListData(UserLocatorVO locator) throws FrameworkException
Returns the data for advertisement favorites belonging to the given user, or the logged user if the given locator is null, plus permissions over them.- Throws:
FrameworkException
-
getUserAdsSearchData
UserAdsSearchData getUserAdsSearchData(@NotNull @NotNull UserLocatorVO locator, AdType type) throws FrameworkException
Returns data for searching advertisements- Throws:
FrameworkException
-
getViewData
AdViewData getViewData(@NotNull @NotNull BasicAdVO adVO) throws FrameworkException
Returns data for viewing details of an advertisement- Throws:
FrameworkException
-
loadVO
BasicAdVO loadVO(@NotNull @NotNull BasicAdVO adVO) throws FrameworkException
Loads a VO, by id- Throws:
FrameworkException
-
markAsFavorite
void markAsFavorite(@NotNull @NotNull BasicAdVO adVO, boolean asFavorite)Marks the given ad as favorite for the current logged user
-
reject
void reject(@NotNull @NotNull BasicAdVO adVO, String comments) throws FrameworkExceptionRejects the publication of an advertisement in statusAdStatus.PENDING. The new status will beAdStatus.DRAFT.- Throws:
FrameworkException
-
search
Page<BasicAdVO> search(@NotNull @NotNull BasicAdQuery params) throws FrameworkException, QueryParseException
Searches for advertisements, according to the given query parameters
-
setAsDraft
void setAsDraft(@NotNull @NotNull BasicAdVO adVO, String comments)Sets the ad back to draft status.
-
setHidden
void setHidden(@NotNull @NotNull BasicAdVO adVO, boolean hidden)Hides or unhides the ad according to given hidden parameter.
-
submitForAuthorization
void submitForAuthorization(@NotNull @NotNull BasicAdVO adVO)Submits the given ad for authorization. Only available if the logged user can manage the given ad and in case it isn't the owner it can't manage pending ads. NOTE: The main web doesn't use this method instead it saves the ad with theAdStatus.PENDINGstatus. 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.
-
-