In the last blog, we saw what happened when we publish a new component, it only calls the create method, but when we re-publish an item it first calls the remove method and then create.
As you can see when I re-published an item, we have remove method invoked first and then create method. Next, is un-publish an item and see how it works/ in what sequence.
When we publish a new item only create method is called, re-publishing will call the remove method and then create and finally in un-publish only remove method is called.
Remove Method
public void remove(int publicationId, int componentId, int componentTemplateId, ComponentPresentationTypeEnum componentPresentationType)
throws StorageException
{
log.debug("Custom storage remove Method");
super.remove(publicationId, componentId, componentTemplateId, componentPresentationType);
log.debug("Custom storage remove Method :- "+componentId);
}
Re-Publish an item |
Un-Publish an Item |
When we publish a new item only create method is called, re-publishing will call the remove method and then create and finally in un-publish only remove method is called.
In the last two blogs, we learned how to set up and configure the project to build storage extension and Publishing a new item and in this blog, we saw other functionalities as well and how they are invoked, in what sequence/order, with this approach we can add/update/remove DCPs in custom storage e:g SOLR, ElasticSearch, MongoDB, etc.
This data can further be used for analytics and for third-party applications.
This data can further be used for analytics and for third-party applications.
Happy Coding and Keep Sharing !!!
No comments:
Post a Comment