1 24 package org.riotfamily.pages.riot.command; 25 26 import org.riotfamily.common.web.util.ServletUtils; 27 import org.riotfamily.pages.Page; 28 import org.riotfamily.pages.mapping.PageLocationResolver; 29 import org.riotfamily.riot.list.command.CommandContext; 30 import org.riotfamily.riot.list.command.core.PopupCommand; 31 32 36 public class GotoPageCommand extends PopupCommand { 37 38 public static final String STYLE_CLASS = "link"; 39 40 private PageLocationResolver resolver; 41 42 public GotoPageCommand(PageLocationResolver resolver) { 43 this.resolver = resolver; 44 } 45 46 protected String getUrl(CommandContext context) { 47 Page page = (Page) context.getBean(); 48 String url = resolver.getUrl(page); 49 return ServletUtils.resolveUrl(url, context.getRequest()); 50 } 51 52 protected String getStyleClass(CommandContext context, String action) { 53 return STYLE_CLASS; 54 } 55 56 } 57 | Popular Tags |