User generated content activation | Adobe Higher Education
Skip to main content
Level 2
October 3, 2017
Beantwoord

User generated content activation

  • October 3, 2017
  • 3 reacties
  • 1050 Bekeken

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?

Er kunnen geen reacties meer worden geplaatst op dit onderwerp.
Beste antwoord door VeenaVikraman

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

3 reacties

smacdonald2008
Level 10
October 3, 2017

Please refer to the official documentation here: Blog Feature

titliAuteur
Level 2
October 3, 2017

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.

VeenaVikraman
Community Advisor
Community Advisor
October 3, 2017

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