GenericHierarchyContentServiceImpl
. In future this class is expected to inherit from GenericHierarchyContentServiceImpl
@Deprecated public class ContentServiceImpl extends Object implements ContentService, ChangeGenerator<Object[]>
ContentService
ChangeGenerator
; it will also generate Events of Type<Status, ContentDescriber>
}Locale
locale, Status
oldStatus, Status
newStatus}Modifier and Type | Field and Description |
---|---|
protected Map<String,com.neurosys.spider.indexer.service.AbstractIndexSearch<Identifiable<Long>>> |
searchMap
Deprecated.
Map of Index Name to the
AbstractIndexSearch
Default AbstractIndexSearch is mapped to null key |
CONTENT_LOOKUP_CACHE_NAME, CONTENT_PUBLISH_CACHE_NAME
Constructor and Description |
---|
ContentServiceImpl()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(ChangeListener changeListener)
Deprecated.
Allow Notify all
ChangeListener s about a change |
void |
clearCache()
Deprecated.
Clear all
Product related Cache |
void |
clearTemplates()
Deprecated.
Clear cached HTML pages that serve as base templates
|
List<ContentDescriber> |
clone(ContentDescriber content)
Deprecated.
clone a content across
Status & Locales (alter-egos) of this same content.The passed content is not persisted. |
void |
convert(IHierarchialReference entity,
Class to)
Deprecated.
If we wish to transform an entity type we should perform the transformation and then the update.
|
ContentDescriber |
createNewContent(ContentDescriber content,
Integer sequence)
Deprecated.
Saves content (new) & creates its clones (see
ContentService#clone() ). |
int |
deleteContent(String name,
boolean deleteChildren)
Deprecated.
HierarchyContentSource Override for event generationDelete a content and all associated content for all locales etc. |
void |
deleteSubHierarchy(ContentDescriber rootNode)
Deprecated.
Re-defining parent signature to satisfy CGLIB proxies
Avoid : {@literal ... |
List<String> |
getAdditionalCacheNames()
Deprecated.
Register additional caches, so that on
clearCache() all registered caches can be cleared |
org.springframework.cache.Cache |
getCache()
Deprecated.
|
HierarchyContentSource |
getContentSource()
Deprecated.
|
Collection<Status> |
getContentStatusCriticalForMove()
Deprecated.
While
move(ContentDescriber, ContentDescriber, Integer) the service will move the content across all Status types. |
List<ContentFacet> |
getFacets(Object contentNameorId,
String facetName,
Status status)
Deprecated.
Convenient method for Scripts to call to get dynamic content
for a
AbstractContentFacet reference.. |
String |
getLastChildHierarchyCode(ContentDescriber parent)
Deprecated.
Re-defining parent signature to satisfy CGLIB proxies
Avoid : Caused by: java.lang.VerifyError: (class: com/neurosys/content/service/ContentServiceImpl$$EnhancerByCGLIB$$1f9fbe23_24, method: CGLIB$getLastChildHierarchyCode$5 signature: (Lcom/neurosys/domain/IHierarchialReference;)Ljava/lang/String;) Incompatible argument to function at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:247) at net.sf.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:386) at net.sf.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:219) |
List |
getListeners()
Deprecated.
Get list directly.
|
MountPathReLoader<org.apache.wicket.protocol.http.WebApplication> |
getMountPathReLoader()
Deprecated.
|
List<AutoGenMenuItem> |
getRelatedNavigations()
Deprecated.
|
Map<String,com.neurosys.spider.indexer.service.AbstractIndexSearch<Identifiable<Long>>> |
getSearchMap()
Deprecated.
|
com.neurosys.spider.indexer.service.AbstractIndexSearch<Identifiable<Long>> |
getSearchService(String indexName)
Deprecated.
|
TemplateService |
getTemplateService()
Deprecated.
|
String |
getURL(ContentDescriber content)
Deprecated.
For the content get the URL
|
void |
index()
Deprecated.
Re-Index all the Content using Spider
|
void |
init()
Deprecated.
|
List |
loadHierarchy(ContentDescriber rootNode,
boolean loadLeaves)
Deprecated.
|
List<ContentDescriber> |
loadHierarchyFlat(ContentDescriber rootNode)
Deprecated.
Load list of nodes under the root in order of hierarchy but does not to a structural hierarchial conversion (Homogeneous list)
|
String |
mount(ContentDescriber content,
Template template)
Deprecated.
Mount a page so its accessible on the webite.
|
void |
move(ContentDescriber content,
ContentDescriber newParent,
Integer sequence)
Deprecated.
Ensures the move as defined in
super#move(ContentDescriber, ContentDescriber)
is across Preview & Publish.This operations will also update the passed node with the latest IHierarchialReference.getParentId() and IHierarchialReference.getHierarchy() . |
void |
notifyAllListeners(Object[] event)
Deprecated.
Whenever a node is selected/updated, it also notifies its listeners.
|
void |
publish(Collection<ContentDescriber> contents)
Deprecated.
Performs operations needed to publish content(s) and related attributes, facets etc.
|
ContentDescriber |
publish(ContentDescriber content)
Deprecated.
Performs operations needed to publish the content and its related attributes, facets etc.
|
ContentDescriber |
save(ContentDescriber content)
Deprecated.
|
ContentFacet |
saveFacet(ContentFacet cf)
Deprecated.
|
List |
search(String indexName,
com.neurosys.spider.domain.SearchParams searchParams,
PageInfo pageInfo,
String... categoryNames)
Deprecated.
Perform indexed/lucene based searches
|
int |
searchCount(String indexName,
com.neurosys.spider.domain.SearchParams searchParams,
String... categoryNames)
Deprecated.
Perform indexed/lucene based searches
|
void |
setAdditionalCacheNames(List<String> additionalCacheNames)
Deprecated.
Register additional caches, so that on
clearCache() all registered caches can be cleared |
void |
setContentSource(HierarchyContentSource contentSource)
Deprecated.
|
void |
setContentStatusCriticalForMove(Collection<Status> contentStatusCriticalForMove)
Deprecated.
While
move(ContentDescriber, ContentDescriber, Integer) the service will move the content across all Status types. |
void |
setListeners(List listeners)
Deprecated.
Set list directly.
|
void |
setMountPathReLoader(MountPathReLoader<org.apache.wicket.protocol.http.WebApplication> mountPathReLoader)
Deprecated.
|
void |
setRelatedNavigations(List<AutoGenMenuItem> relatedNavigations)
Deprecated.
|
void |
setSearchMap(Map<String,com.neurosys.spider.indexer.service.AbstractIndexSearch<Identifiable<Long>>> searchMap)
Deprecated.
|
void |
setTemplateService(TemplateService templateService)
Deprecated.
|
protected void |
sysAutoIndex()
Deprecated.
Based on a Scheduled job keep refreshing the Index
|
void |
unPublish(ContentDescriber content)
Deprecated.
It will remove the published version from the
ContentSource . |
int |
updateContentStatus(String name,
Locale locale,
Status oldStatus,
Status newStatus)
Deprecated.
HierarchyContentSource Override for event generationThis will cause an update to the Content state. |
void |
updateNav()
Deprecated.
Ability to refresh Navigation linked to the content service; if any
|
protected Map<String,com.neurosys.spider.indexer.service.AbstractIndexSearch<Identifiable<Long>>> searchMap
AbstractIndexSearch
Default AbstractIndexSearch
is mapped to null key@PostConstruct public void init()
@Transactional(readOnly=false) public 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).updateContentStatus
in interface GenericContentService<ContentDescriber,ContentAttribute,ContentFacet>
name
- as identifier for the contentlocale
- as the Locale
oldStatus
- as the Status
newStatus
- as the Status
(replace the oldStatus with this value)Exception
public List loadHierarchy(ContentDescriber rootNode, boolean loadLeaves)
loadHierarchy
in interface HierarchyService<ContentDescriber>
rootNode
- thispublic List<ContentDescriber> loadHierarchyFlat(ContentDescriber rootNode)
HierarchyService
loadHierarchyFlat
in interface HierarchyService<ContentDescriber>
@Transactional(readOnly=false) public ContentDescriber save(ContentDescriber content)
save
in interface GenericContentService<ContentDescriber,ContentAttribute,ContentFacet>
public String mount(ContentDescriber content, Template template)
mount
in interface GenericContentService<ContentDescriber,ContentAttribute,ContentFacet>
@Transactional(readOnly=false) public ContentDescriber publish(ContentDescriber content) throws PartialTransactionException
Content
record (& related ContentFacet
s, attributes) to publishpublish
in interface GenericContentService<ContentDescriber,ContentAttribute,ContentFacet>
content
- (this should be a record with Content.getStatus()
as Status.DRAFT
)PartialTransactionException
public void unPublish(ContentDescriber content) throws Exception
GenericContentService
ContentSource
. By default any paths etc are not mounted.unPublish
in interface GenericContentService<ContentDescriber,ContentAttribute,ContentFacet>
Exception
public void updateNav()
GenericContentService
updateNav
in interface GenericContentService<ContentDescriber,ContentAttribute,ContentFacet>
public void clearCache()
GenericContentService
Product
related CacheclearCache
in interface GenericContentService<ContentDescriber,ContentAttribute,ContentFacet>
public void publish(Collection<ContentDescriber> contents) throws Exception
Content
record (& related ContentFacet
s, attributes) to publishpublish
in interface GenericContentService<ContentDescriber,ContentAttribute,ContentFacet>
contents
- (these should be records with Content.getStatus()
as Status.DRAFT
)Exception
public List<AutoGenMenuItem> getRelatedNavigations()
public void setRelatedNavigations(List<AutoGenMenuItem> relatedNavigations)
@Transactional(readOnly=false, rollbackFor=java.lang.Exception.class) public void move(ContentDescriber content, ContentDescriber newParent, Integer sequence) throws Exception
super#move(ContentDescriber, ContentDescriber)
is across Preview & Publish.IHierarchialReference.getParentId()
and IHierarchialReference.getHierarchy()
.
move
in interface HierarchyService<ContentDescriber>
newParent
- @nullable true (if IHierarchialReference.ROOT
sequence
- as Integer @nullable true (optional)Exception
public List<ContentDescriber> clone(ContentDescriber content)
Status
& Locales (alter-egos) of this same content.clone
in interface GenericContentService<ContentDescriber,ContentAttribute,ContentFacet>
@Transactional(readOnly=false) public ContentDescriber createNewContent(ContentDescriber 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.
createNewContent
in interface GenericContentService<ContentDescriber,ContentAttribute,ContentFacet>
sequence
- is ignored in this implementationcontent
- @nullable false ;if Content#getParentId()
is null then it will assume rootpublic List search(String indexName, com.neurosys.spider.domain.SearchParams searchParams, PageInfo pageInfo, String... categoryNames) throws Exception
GenericContentService
search
in interface GenericContentService<ContentDescriber,ContentAttribute,ContentFacet>
indexName
- as String @Nuallble true implies the default index wilt be searchedsearchParams
- as SearchParams @nullable falsepageInfo
- as PageIngo @nullable truecategoryNames
- @nullable trueException
public int searchCount(String indexName, com.neurosys.spider.domain.SearchParams searchParams, String... categoryNames) throws Exception
GenericContentService
searchCount
in interface GenericContentService<ContentDescriber,ContentAttribute,ContentFacet>
indexName
- as String @Nuallble true implies the default index wilt be searchedsearchParams
- as SearchParams @nullable falsecategoryNames
- @nullable trueException
@Scheduled(cron="${search.indexer.content.cron}") protected void sysAutoIndex() throws Exception
Exception
public void index() throws Exception
GenericContentService
index
in interface GenericContentService<ContentDescriber,ContentAttribute,ContentFacet>
Exception
public Map<String,com.neurosys.spider.indexer.service.AbstractIndexSearch<Identifiable<Long>>> getSearchMap()
public void setSearchMap(Map<String,com.neurosys.spider.indexer.service.AbstractIndexSearch<Identifiable<Long>>> searchMap)
public com.neurosys.spider.indexer.service.AbstractIndexSearch<Identifiable<Long>> getSearchService(String indexName)
getSearchService
in interface GenericContentService<ContentDescriber,ContentAttribute,ContentFacet>
@Transactional(readOnly=false) public int deleteContent(String name, boolean deleteChildren)
GenericContentService
HierarchyContentSource
Override for event generationdeleteContent
in interface GenericContentService<ContentDescriber,ContentAttribute,ContentFacet>
name
- of Content as StringdeleteChildren
- as boolean; will delete sub-hierarchy to this contentContentAttribute
, ContentFacet
etc are not counted, just core content entity objects)@Transactional(readOnly=false) public ContentFacet saveFacet(ContentFacet cf)
GenericContentService
saveFacet
in interface GenericContentService<ContentDescriber,ContentAttribute,ContentFacet>
cf
- as ContentFacet
public String getLastChildHierarchyCode(ContentDescriber parent)
getLastChildHierarchyCode
in interface HierarchyService<ContentDescriber>
public void deleteSubHierarchy(ContentDescriber rootNode) throws Exception
deleteSubHierarchy
in interface HierarchyService<ContentDescriber>
Exception
public Collection<Status> getContentStatusCriticalForMove()
move(ContentDescriber, ContentDescriber, Integer)
the service will move the content across all Status types.
If the ones in this are not found it will break the process and not proceed.public void setContentStatusCriticalForMove(Collection<Status> contentStatusCriticalForMove)
move(ContentDescriber, ContentDescriber, Integer)
the service will move the content across all Status types.
If the ones in this are not found it will break the process and not proceed.public String getURL(ContentDescriber content)
GenericContentService
getURL
in interface GenericContentService<ContentDescriber,ContentAttribute,ContentFacet>
content
- as Content
public List<String> getAdditionalCacheNames()
clearCache()
all registered caches can be clearedpublic void setAdditionalCacheNames(List<String> additionalCacheNames)
clearCache()
all registered caches can be clearedpublic org.springframework.cache.Cache getCache()
getCache
in interface GenericContentService<ContentDescriber,ContentAttribute,ContentFacet>
public void clearTemplates() throws Exception
GenericContentService
clearTemplates
in interface GenericContentService<ContentDescriber,ContentAttribute,ContentFacet>
Exception
public void convert(IHierarchialReference entity, Class to)
HierarchyService
InheritanceType.SINGLE_TABLE
or oen where there is a shared DiscriminatorValue
convert
in interface HierarchyService<ContentDescriber>
public HierarchyContentSource getContentSource()
getContentSource
in interface GenericContentService<ContentDescriber,ContentAttribute,ContentFacet>
public void setContentSource(HierarchyContentSource contentSource)
public TemplateService getTemplateService()
public void setTemplateService(TemplateService templateService)
public MountPathReLoader<org.apache.wicket.protocol.http.WebApplication> getMountPathReLoader()
public void setMountPathReLoader(MountPathReLoader<org.apache.wicket.protocol.http.WebApplication> mountPathReLoader)
public List<ContentFacet> getFacets(Object contentNameorId, String facetName, Status status)
GenericContentService
AbstractContentFacet
reference.. Useful when called via embedded scripts in content.getFacets
in interface GenericContentService<ContentDescriber,ContentAttribute,ContentFacet>
contentNameorId
- as String or LongfacetName
- as Stringstatus
- as Status
(optional)List
of AbstractContentFacet
public void addChangeListener(ChangeListener changeListener)
ChangeGenerator
ChangeListener
s about a changeaddChangeListener
in interface ChangeGenerator<Object[]>
public void notifyAllListeners(Object[] event)
ChangeGenerator
notifyAllListeners
in interface ChangeGenerator<Object[]>
public List getListeners()
ChangeGenerator
getListeners
in interface ChangeGenerator<Object[]>
public void setListeners(List listeners)
ChangeGenerator
setListeners
in interface ChangeGenerator<Object[]>
Copyright © 2018. All rights reserved.