1 13 package info.magnolia.module.admininterface.dialogs; 14 15 import info.magnolia.cms.beans.config.Paragraph; 16 import info.magnolia.cms.beans.config.ParagraphManager; 17 import info.magnolia.cms.core.Content; 18 import info.magnolia.cms.gui.dialog.Dialog; 19 20 import javax.jcr.RepositoryException; 21 import javax.servlet.http.HttpServletRequest ; 22 import javax.servlet.http.HttpServletResponse ; 23 24 import org.apache.commons.lang.StringUtils; 25 import org.slf4j.Logger; 26 import org.slf4j.LoggerFactory; 27 28 29 33 public class ParagraphEditDialog extends ConfiguredDialog { 34 35 private static Logger log = LoggerFactory.getLogger(ParagraphEditDialog.class); 36 37 private String paragraph = StringUtils.EMPTY; 38 39 public ParagraphEditDialog(String name, HttpServletRequest request, HttpServletResponse response, Content configNode) { 40 super(name, request, response, configNode); 41 paragraph = params.getParameter("mgnlParagraph"); } 43 44 49 protected Dialog createDialog(Content configNode, Content websiteNode) throws RepositoryException { 50 Dialog dialog = super.createDialog(configNode, websiteNode); 51 dialog.setConfig("paragraph", paragraph); return dialog; 53 } 54 55 58 public static Content getConfigNode(HttpServletRequest request, String paragraph) { 59 Paragraph para = ParagraphManager.getInstance().getInfo(paragraph); 60 61 if (para == null) { 62 log.error("paragraph not found: " + paragraph); return null; 65 } 66 67 return null; 69 } 70 71 74 public String getParagraph() { 75 return paragraph; 76 } 77 } | Popular Tags |