Class MarketingServiceImpl
- java.lang.Object
-
- co.mastermindcms.modules.services.MarketingServiceImpl
-
- All Implemented Interfaces:
MarketingService
@Service public class MarketingServiceImpl extends java.lang.Object implements MarketingService
-
-
Field Summary
Fields Modifier and Type Field Description private AccessManagementService
accessManagementService
private org.springframework.context.ApplicationContext
appContext
private CommonProperties
commonProperties
private JobsManagementService
jobService
private static com.fasterxml.jackson.databind.ObjectMapper
mapper
private org.springframework.data.mongodb.core.MongoTemplate
mongoTemplate
private SequenceGeneratorService
sequenceGeneratorService
private MongoStorageService
storageService
private TemplateLocatorService
templateLocatorService
private TranslationService
translationService
private UserAuditRepository
userAuditRepository
private WebSocketService
webSocketService
-
Constructor Summary
Constructors Constructor Description MarketingServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
generateDashlyHash()
This method generates the hash with algorithm HMAC SHA 256 for Dashly Analytics Platformjava.util.List<ContactsReport>
getContactsReport(co.mastermindcms.modules.beans.SearchRequest request)
Retrieves a list of ContactsReport objects based on the given search request.java.util.List<CustomerReport>
getCustomersReport(co.mastermindcms.modules.beans.SearchRequest request)
This method is used to generate a report which contains all registered customersjava.util.Deque<java.util.Map<java.lang.String,java.lang.Object>>
getPaginationAnalyticsData(java.lang.String requestJson)
This method does calculation for a pages based on the request.java.util.Map<java.lang.String,java.lang.Object>
getSeoMetaData(java.lang.String seoUrl, java.lang.String repositoryName)
This method does search request for database entity based on seo URL propertyjava.util.List<SEOMetaDataReport>
getSeoMetaDataReport(co.mastermindcms.modules.beans.SearchRequest request)
Retrieves SEO metadata report based on the specified search request.java.lang.String
getSeoUrl(java.lang.String id, java.lang.String repositoryName)
This method does search request for seo URL propertyjava.util.Map<java.lang.String,java.lang.Object>
getSeoUrlAsValue(java.lang.String id, java.lang.String repositoryName)
This method does search request for seo URL propertyjava.lang.String
getSeoUrlByLang(java.lang.String id, java.lang.String lang, java.lang.String repositoryName)
This method does search request for seo URL propertyboolean
saveSearchRequest(java.lang.String searchTerm)
Saves the search request with the specified search term.java.util.LinkedHashSet<UserAuditSettings>
searchUserAnalytics(java.lang.String requestJson)
This method does search requests and returns data as list.org.springframework.data.domain.Page<UserAuditSettings>
searchUserAnalyticsPaged(java.lang.String requestJson)
This method does search requests and returns data as pages.void
uploadSEO(java.io.File file, java.lang.String lang, java.lang.String username)
Uploads SEO information from a given file for a specific language and user.
-
-
-
Field Detail
-
mongoTemplate
@Autowired private org.springframework.data.mongodb.core.MongoTemplate mongoTemplate
-
commonProperties
@Autowired private CommonProperties commonProperties
-
accessManagementService
@Autowired private AccessManagementService accessManagementService
-
translationService
@Autowired private TranslationService translationService
-
templateLocatorService
@Autowired private TemplateLocatorService templateLocatorService
-
userAuditRepository
@Autowired private UserAuditRepository userAuditRepository
-
sequenceGeneratorService
@Autowired private SequenceGeneratorService sequenceGeneratorService
-
storageService
@Autowired private MongoStorageService storageService
-
webSocketService
@Autowired private WebSocketService webSocketService
-
jobService
@Autowired private JobsManagementService jobService
-
appContext
@Autowired private org.springframework.context.ApplicationContext appContext
-
mapper
private static final com.fasterxml.jackson.databind.ObjectMapper mapper
-
-
Method Detail
-
searchUserAnalytics
public java.util.LinkedHashSet<UserAuditSettings> searchUserAnalytics(java.lang.String requestJson)
Description copied from interface:MarketingService
This method does search requests and returns data as list.- Specified by:
searchUserAnalytics
in interfaceMarketingService
- Parameters:
requestJson
- search request- Returns:
- data transport entities as list
-
searchUserAnalyticsPaged
public org.springframework.data.domain.Page<UserAuditSettings> searchUserAnalyticsPaged(java.lang.String requestJson)
Description copied from interface:MarketingService
This method does search requests and returns data as pages.- Specified by:
searchUserAnalyticsPaged
in interfaceMarketingService
- Parameters:
requestJson
- JSON-object of request contains an instructions for search queries- Returns:
- database entities separated to pages
-
getPaginationAnalyticsData
public java.util.Deque<java.util.Map<java.lang.String,java.lang.Object>> getPaginationAnalyticsData(java.lang.String requestJson)
Description copied from interface:MarketingService
This method does calculation for a pages based on the request.- Specified by:
getPaginationAnalyticsData
in interfaceMarketingService
- Parameters:
requestJson
- JSON-object of request contains an instructions for search queries- Returns:
- map-representation of data
-
getCustomersReport
public java.util.List<CustomerReport> getCustomersReport(co.mastermindcms.modules.beans.SearchRequest request)
Description copied from interface:MarketingService
This method is used to generate a report which contains all registered customers- Specified by:
getCustomersReport
in interfaceMarketingService
- Parameters:
request
- the search request containing the criteria for fetching the report- Returns:
- a list of entities for each customer
-
getContactsReport
public java.util.List<ContactsReport> getContactsReport(co.mastermindcms.modules.beans.SearchRequest request)
Description copied from interface:MarketingService
Retrieves a list of ContactsReport objects based on the given search request.- Specified by:
getContactsReport
in interfaceMarketingService
- Parameters:
request
- the search request containing the criteria for fetching the ContactReports- Returns:
- a list of ContactsReport objects that match the search request criteria
-
getSeoMetaDataReport
public java.util.List<SEOMetaDataReport> getSeoMetaDataReport(co.mastermindcms.modules.beans.SearchRequest request)
Description copied from interface:MarketingService
Retrieves SEO metadata report based on the specified search request.- Specified by:
getSeoMetaDataReport
in interfaceMarketingService
- Parameters:
request
- the search request to retrieve SEO metadata report for- Returns:
- a CompletableFuture with a list of SEOMetaDataReport objects representing the SEO metadata report
-
generateDashlyHash
public java.lang.String generateDashlyHash()
Description copied from interface:MarketingService
This method generates the hash with algorithm HMAC SHA 256 for Dashly Analytics Platform- Specified by:
generateDashlyHash
in interfaceMarketingService
- Returns:
- hash calculated by the HMAC SHA 256
-
getSeoMetaData
public java.util.Map<java.lang.String,java.lang.Object> getSeoMetaData(java.lang.String seoUrl, java.lang.String repositoryName)
Description copied from interface:MarketingService
This method does search request for database entity based on seo URL property- Specified by:
getSeoMetaData
in interfaceMarketingService
- Parameters:
seoUrl
- this is SEO-url, human-readable valuerepositoryName
- repository name from where will be returned data- Returns:
- map-representation of data
-
getSeoUrl
public java.lang.String getSeoUrl(java.lang.String id, java.lang.String repositoryName)
Description copied from interface:MarketingService
This method does search request for seo URL property- Specified by:
getSeoUrl
in interfaceMarketingService
- Parameters:
id
- this is entity idrepositoryName
- repository name from where will be returned data- Returns:
- SEO-url value as a string
-
getSeoUrlAsValue
public java.util.Map<java.lang.String,java.lang.Object> getSeoUrlAsValue(java.lang.String id, java.lang.String repositoryName)
Description copied from interface:MarketingService
This method does search request for seo URL property- Specified by:
getSeoUrlAsValue
in interfaceMarketingService
- Parameters:
id
- this is entity idrepositoryName
- repository name from where will be returned data- Returns:
- map-representation of data
-
getSeoUrlByLang
public java.lang.String getSeoUrlByLang(java.lang.String id, java.lang.String lang, java.lang.String repositoryName)
Description copied from interface:MarketingService
This method does search request for seo URL property- Specified by:
getSeoUrlByLang
in interfaceMarketingService
- Parameters:
id
- this is entity idlang
- iso code for languagerepositoryName
- repository name from where will be returned data- Returns:
- SEO-url value as a string
-
saveSearchRequest
public boolean saveSearchRequest(java.lang.String searchTerm)
Description copied from interface:MarketingService
Saves the search request with the specified search term.- Specified by:
saveSearchRequest
in interfaceMarketingService
- Parameters:
searchTerm
- the search term to be saved- Returns:
- true if the search request is successfully saved, false otherwise
-
uploadSEO
@Async("asyncTaskExecutor") public void uploadSEO(java.io.File file, java.lang.String lang, java.lang.String username)
Description copied from interface:MarketingService
Uploads SEO information from a given file for a specific language and user.- Specified by:
uploadSEO
in interfaceMarketingService
- Parameters:
file
- the file containing the SEO information to be uploadedlang
- the language for which the SEO information is intendedusername
- the username of the user responsible for the upload
-
-