...
Code Block |
---|
import com.cognifide.slice.api.link.Link; import com.cognifide.slice.api.link.LinkBuilder; import com.cognifide.slice.api.link.LinkBuilderFactory; import com.cognifide.slice.cq.qualifier.RequestedLink; import com.google.inject.Inject; public class EventModel { private final LinkBuilderFactory linkBuilderFactory; private final Link requestedLink; @Inject public TextModel2EventModel(LinkBuilderFactory linkBuilderFactory, @RequestedLink Link requestedLink) { this.linkBuilderFactory = linkBuilderFactory; this.requestedLink = requestedLink; } public String getPrintLink() { LinkBuilder linkBuilder = linkBuilderFactory.getLinkBuilder(requestedLink); linkBuilder.addSelector("print").setExtension("pdf"); // it will retain query string and suffix return linkBuilder.toString(); } ... } |
...