public interface GenericContentService<C extends Content<CA,CF>,CA extends AbstractContentAttribute,CF extends AbstractContentFacet>
Content
, Arjun DharModifier and Type | Field and Description |
---|---|
static String |
CONTENT_LOOKUP_CACHE_NAME
Cache for looking up Categories, top level
Content s that
are called often in the project
On save the cache is updated (ideally, check admin code Key: Content.getId() or Content#getParentId() or Content.getName() |
static String |
CONTENT_PUBLISH_CACHE_NAME
Published Content is cached
On publish the cache is updated ; ideally, check admin code Key : The Location / url |
Modifier and Type | Method and Description |
---|---|
void |
clearCache()
Clear all
Product related Cache |
void |
clearTemplates()
Clear cached HTML pages that serve as base templates
|
List<C> |
clone(C content)
Ability to clone (create clones & persist) content across
Content.getStatus() and/or Localizable.getLocale() . |
C |
createNewContent(C content,
Integer sequence)
Saves content (new) & creates its clones (see
ContentService#clone() ). |
int |
deleteContent(String name,
boolean deleteChildren)
HierarchyContentSource Override for event generationDelete a content and all associated content for all locales etc. |
org.springframework.cache.Cache |
getCache() |
ContentSource<C,CA,CF> |
getContentSource() |
List<CF> |
getFacets(Object contentNameorId,
String facetName,
Status status)
Convenient method for Scripts to call to get dynamic content
for a
AbstractContentFacet reference.. |
com.neurosys.spider.indexer.service.AbstractIndexSearch<Identifiable<Long>> |
getSearchService(String indexName) |
String |
getURL(C content)
For the content get the URL
|
void |
index()
Re-Index all the Content using Spider
|
String |
mount(C content,
Template template)
Mount a page so its accessible on the webite.
|
C |
publish(C content)
Performs operations needed to publish the content and its related attributes, facets etc.
|
void |
publish(Collection<C> contents)
Performs operations needed to publish content(s) and related attributes, facets etc.
|
C |
save(C content) |
CF |
saveFacet(CF cf)
|
List |
search(String indexName,
com.neurosys.spider.domain.SearchParams searchParams,
PageInfo pageInfo,
String... categoryNames)
Perform indexed/lucene based searches
|
int |
searchCount(String indexName,
com.neurosys.spider.domain.SearchParams searchParams,
String... categoryNames)
Perform indexed/lucene based searches
|
void |
unPublish(C content)
It will remove the published version from the
ContentSource . |
int |
updateContentStatus(String name,
Locale locale,
Status oldStatus,
Status newStatus)
HierarchyContentSource Override for event generationThis will cause an update to the Content state. |
void |
updateNav()
Ability to refresh Navigation linked to the content service; if any
|
static final String CONTENT_PUBLISH_CACHE_NAME
SingleContentPerFacetPublishAdapter}
,
Constant Field Valuesstatic final String CONTENT_LOOKUP_CACHE_NAME
Content
s that
are called often in the project
Content.getId()
or Content#getParentId()
or Content.getName()
String mount(C content, Template template)
content
- template
- C publish(C content) throws Exception
Content
record (& related ContentFacet
s, attributes) to publishcontent
- (this should be a record with Content.getStatus()
as Status.DRAFT
)Exception
void unPublish(C content) throws Exception
ContentSource
. By default any paths etc are not mounted.content
- Exception
void publish(Collection<C> contents) throws Exception
Content
record (& related ContentFacet
s, attributes) to publishcontents
- (these should be records with Content.getStatus()
as Status.DRAFT
)Exception
void updateNav()
List<C> clone(C content)
Content.getStatus()
and/or Localizable.getLocale()
.
The content should have a valid parentId. If hierarchy is not set, it will be derived from the parent (max + 1)
C createNewContent(C content, Integer sequence)
ContentService#clone()
).
The content being saved should be ideally a Status.DRAFT
version, if its not set then it will set it; and replicate
across other status. The content should also have its parent id set.content
- @nullable false ;if Content#getParentId()
is null then it will assume rootsequence
- as Integer, an alternate order within the parent where this content will be created @nullable trueList search(String indexName, com.neurosys.spider.domain.SearchParams searchParams, PageInfo pageInfo, String... categoryNames) throws Exception
indexName
- as String @Nuallble true implies the default index wilt be searchedsearchParams
- as SearchParams @nullable falsepageInfo
- as PageIngo @nullable truecategoryNames
- @nullable trueException
int searchCount(String indexName, com.neurosys.spider.domain.SearchParams searchParams, String... categoryNames) throws Exception
indexName
- as String @Nuallble true implies the default index wilt be searchedsearchParams
- as SearchParams @nullable falsecategoryNames
- @nullable trueException
org.springframework.cache.Cache getCache()
void clearTemplates() throws Exception
Exception
String getURL(C content)
content
- as Content
ContentSource<C,CA,CF> getContentSource()
int updateContentStatus(String name, Locale locale, Status oldStatus, Status newStatus) throws Exception
HierarchyContentSource
Override for event generationStatus.DRAFT
, and is being updated to Status.PUBLISH
while another Status.PUBLISH
one already exists. Then it should update the PUBLISH record for the content and
mute the Status.DRAFT
one (in concept).int deleteContent(String name, boolean deleteChildren)
HierarchyContentSource
Override for event generationname
- of Content as StringdeleteChildren
- as boolean; will delete sub-hierarchy to this contentContentAttribute
, ContentFacet
etc are not counted, just core content entity objects)CF saveFacet(CF cf)
cf
- as ContentFacet
List<CF> getFacets(Object contentNameorId, String facetName, Status status)
AbstractContentFacet
reference.. Useful when called via embedded scripts in content.contentNameorId
- as String or LongfacetName
- as Stringstatus
- as Status
(optional)List
of AbstractContentFacet
com.neurosys.spider.indexer.service.AbstractIndexSearch<Identifiable<Long>> getSearchService(String indexName)
Copyright © 2018. All rights reserved.