Option 1: You can write a publish workflow to publish your content based on the selection you can calculate the payload under that file struture or folder
sample code :
var replicator = sling.getService(Packages.com.day.cq.replication.Replicator); var session = workflowSession.getSession(); // get list of paths to replicate (no resource collection: size == 1 //@param: pathList for (var aPath: pathList) { replicator.replicate(session, Packages.com.day.cq.replication.ReplicationActionType.ACTIVATE, aPath); // CUSTOMIZED CODE.... }
Option 3: if you have loads of data under selection than use vlt rcp this will be a tricky thing as you have to run a command like this every time you publish something