While using a Blog component in SCF if i configure to use it in the author mode and wish to activate the page and send the content to publish what would be the best way to do that?
Activating the page does not activate the /content/usergenerated/asi/jcr/content path content (containing the post infos)
When I use activate tree it fails as well. What is the way out?
Solved! Go to Solution.
Views
Replies
Total Likes
one solution I could recommend is to write an event listener on page activation. If you have a generic pattern for the node where the content is saved; on activation of the page , just activate the node programatically.
This would be something like below
@Component
@Service
@Property(name = "event.topics", value = ReplicationAction.EVENT_TOPIC)
public class ReplicatonEventHandler implements Runnable, EventHandler {
private Logger LOG = LoggerFactory.getLogger(this.getClass());
private BundleContext bundleContext;
@Override
public void handleEvent(Event event) {
ReplicationAction action = ReplicationAction.fromEvent(event);
if (action != null) {
LOG.info("Replication action {} occured on {} ", action.getType().getName(), action.getPath());
if ("Activate".equalsIgnoreCase(action.getType().getName())) {
//Your logic here
}
}
}
public void run() {
LOG.info("Running...");
}
protected void activate(ComponentContext ctx) {
this.bundleContext = ctx.getBundleContext();
}
protected void deactivate(ComponentContext ctx) {
this.bundleContext = null;
}
}
Let me know if this doesn't help you .
Thanks
Veena
Views
Replies
Total Likes
Please refer to the official documentation here: Blog Feature
Views
Replies
Total Likes
I did go through the information. However my requirement is to write the content in the author environment and publish the page once done. Usually when u activate the page it works but here the content lying in a different location does not get published. That is the problem for which Im searching for a solution.
Views
Replies
Total Likes
one solution I could recommend is to write an event listener on page activation. If you have a generic pattern for the node where the content is saved; on activation of the page , just activate the node programatically.
This would be something like below
@Component
@Service
@Property(name = "event.topics", value = ReplicationAction.EVENT_TOPIC)
public class ReplicatonEventHandler implements Runnable, EventHandler {
private Logger LOG = LoggerFactory.getLogger(this.getClass());
private BundleContext bundleContext;
@Override
public void handleEvent(Event event) {
ReplicationAction action = ReplicationAction.fromEvent(event);
if (action != null) {
LOG.info("Replication action {} occured on {} ", action.getType().getName(), action.getPath());
if ("Activate".equalsIgnoreCase(action.getType().getName())) {
//Your logic here
}
}
}
public void run() {
LOG.info("Running...");
}
protected void activate(ComponentContext ctx) {
this.bundleContext = ctx.getBundleContext();
}
protected void deactivate(ComponentContext ctx) {
this.bundleContext = null;
}
}
Let me know if this doesn't help you .
Thanks
Veena
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies