CCM NG: Migrated BebopConfig to new configuration system

git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@3795 8810af33-2d31-482b-a856-94f89814c4df
pull/2/head
jensp 2016-01-14 09:14:28 +00:00
parent 3ce721d6e3
commit d1251b5fc0
11 changed files with 547 additions and 504 deletions

View File

@ -1,40 +0,0 @@
/*
* Copyright (C) 2003-2004 Red Hat Inc. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
package com.arsdigita.bebop;
import org.apache.log4j.Logger;
/**
* @author Justin Ross
* @see com.arsdigita.bebop.BebopConfig
* @version $Id$
*/
public final class Bebop {
private static final Logger s_log = Logger.getLogger(Bebop.class);
private static BebopConfig s_config = BebopConfig.getInstance();
/**
* Gets the <code>BebopConfig</code> object.
*/
public static BebopConfig getConfig() {
return s_config;
}
}

View File

@ -1,191 +1,283 @@
/* /*
* Copyright (C) 2003-2004 Red Hat Inc. All Rights Reserved. * Copyright (C) 2016 LibreCCM Foundation.
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public
* as published by the Free Software Foundation; either version 2.1 of * License as published by the Free Software Foundation; either
* the License, or (at your option) any later version. * version 2.1 of the License, or (at your option) any later version.
* *
* This library is distributed in the hope that it will be useful, * This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details. * Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public * You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* * MA 02110-1301 USA
*/ */
package com.arsdigita.bebop; package com.arsdigita.bebop;
import com.arsdigita.bebop.page.PageTransformer; import com.arsdigita.bebop.page.PageTransformer;
import com.arsdigita.bebop.util.BebopConstants; import com.arsdigita.bebop.util.BebopConstants;
import com.arsdigita.runtime.AbstractConfig;
import com.arsdigita.templating.PresentationManager; import com.arsdigita.templating.PresentationManager;
import com.arsdigita.ui.SimplePage; import com.arsdigita.ui.SimplePage;
import com.arsdigita.util.parameter.BooleanParameter; import com.arsdigita.util.UncheckedWrapperException;
import com.arsdigita.util.parameter.ClassParameter; import java.util.Arrays;
import com.arsdigita.util.parameter.EnumerationParameter; import java.util.HashSet;
import com.arsdigita.util.parameter.Parameter; import java.util.Objects;
import com.arsdigita.util.parameter.SingletonParameter; import java.util.Set;
import com.arsdigita.util.parameter.StringParameter; import java.util.StringJoiner;
import org.apache.log4j.Logger; import org.libreccm.cdi.utils.CdiUtil;
import org.libreccm.configuration.Configuration;
import org.libreccm.configuration.ConfigurationManager;
import org.libreccm.configuration.Setting;
/** /**
* @author Justin Ross *
* @see com.arsdigita.bebop.Bebop * @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
* @version $Id: BebopConfig.java 1498 2007-03-19 16:22:15Z apevec $
*/ */
public final class BebopConfig extends AbstractConfig { @Configuration(descBundle = "com.arsdigita.bebop.BebopConfigDescription",
descKey = "bebop.config.description")
public final class BebopConfig {
/** A logger instance to assist debugging. */ @Setting(descKey = "bebop.config.presenter_class_name")
private static final Logger s_log = Logger.getLogger(BebopConfig.class); private String presenterClassName = PageTransformer.class.getName();
/** Singleton config object. */ @Setting(descKey = "bebop.config.base_page_name")
private static BebopConfig s_config; private String basePageClassName = SimplePage.class.getName();
/** @Setting(descKey = "bebop.config.tidy_config_file")
* Gain a BebopConfig object. private String tidyConfigFile
* = "com/arsdigita/bebop/parameters/tidy.properties";
* Singleton pattern, don't instantiate a config object using the
* constructor directly! @Setting(descKey = "bebop.config.fancy_errors")
* @return private Boolean fancyErrors = false;
*/
public static synchronized BebopConfig getInstance() { @Setting(descKey = "bebop.config.dcp_on_buttons")
if (s_config == null) { private Boolean dcpOnButtons = true;
s_config = new BebopConfig();
s_config.load(); @Setting(descKey = "bebop.config.dcp_on_links")
private Boolean dcpOnLinks = false;
@Setting(descKey = "bebop.config.tree_select_enabled")
private Boolean treeSelectEnabled = false;
@Setting(descKey = "bebop.config.dhtml_editors")
private Set<String> dhtmlEditors = new HashSet<>(
Arrays.asList(new String[]{BebopConstants.BEBOP_XINHAEDITOR,
BebopConstants.BEBOP_FCKEDITOR,
BebopConstants.BEBOP_DHTMLEDITOR}));
@Setting(descKey = "bebop.config.default_dhtml_editor")
private String defaultDhtmlEditor = BebopConstants.BEBOP_XINHAEDITOR;
@Setting(descKey = "bebop.config.dhtml_editor_srcfile")
private String dhtmlEditorSrcFile = "/assets/xinha/XinhaLoader.js";
@Setting(descKey = "bebop.config.show_class_name")
private Boolean showClassName = false;
public static BebopConfig getConfig() {
final CdiUtil cdiUtil = new CdiUtil();
final ConfigurationManager confManager = cdiUtil.findBean(
ConfigurationManager.class);
return confManager.findConfiguration(BebopConfig.class);
}
public String getPresenterClassName() {
return presenterClassName;
}
public Class<PresentationManager> getPresenterClass() {
try {
return (Class<PresentationManager>) Class.
forName(presenterClassName);
} catch (ClassNotFoundException ex) {
throw new UncheckedWrapperException(ex);
} }
return s_config;
} }
// set of configuration parameters public void setPresenterClassName(final String presenterClassName) {
// ///////////////////////////////////////////////////////////////// this.presenterClassName = presenterClassName;
/**
* */
private final Parameter m_presenter = new SingletonParameter
("waf.bebop.presentation_manager", Parameter.REQUIRED,
new PageTransformer());
/**
*
*/
private final Parameter m_page = new ClassParameter
("waf.bebop.base_page", Parameter.REQUIRED, SimplePage.class);
/** Pointer to JTidy validation listener config file */
private final Parameter m_tidy = new StringParameter
("waf.bebop.tidy_config_file", Parameter.REQUIRED,
"com/arsdigita/bebop/parameters/tidy.properties");
private final Parameter m_fancyErrors = new BooleanParameter
("waf.bebop.fancy_xsl_errors",
Parameter.REQUIRED,
Boolean.FALSE);
/** Double Click Protection, enabled by default for all buttons in a form.*/
private final Parameter m_dcpOnButtons = new BooleanParameter
("waf.bebop.dcp_on_buttons", Parameter.REQUIRED, Boolean.TRUE);
/** Double Click Protection, disabled by default for all links. */
private final Parameter m_dcpOnLinks = new BooleanParameter
("waf.bebop.dcp_on_links", Parameter.REQUIRED, Boolean.FALSE);
/**
*
*/
private final Parameter m_enableTreeSelect = new BooleanParameter
("waf.bebop.enable_tree_select_attribute",
Parameter.REQUIRED,
Boolean.FALSE);
/** List of supported DHTML editors, first one is default (Xinha) */
private final EnumerationParameter m_dhtmlEditor;
/** Path to DHTML editor source file, relativ to document root */
private final Parameter m_dhtmlEditorSrcFile;
/** */
private final Parameter m_showClassName = new BooleanParameter
("waf.bebop.show_class_name", Parameter.OPTIONAL, Boolean.FALSE);
/**
* Constructor.
* Singelton pattern, don't instantiate a config object using the
* constructor directly! Use getConfig() instead.
*
*/
public BebopConfig() {
/** List of supported DHTML editors, first one is default (Xinha) */
m_dhtmlEditor = new EnumerationParameter("waf.bebop.dhtml_editor",
Parameter.REQUIRED,BebopConstants.BEBOP_XINHAEDITOR);
m_dhtmlEditor.put("Xinha", BebopConstants.BEBOP_XINHAEDITOR);
m_dhtmlEditor.put("FCKeditor", BebopConstants.BEBOP_FCKEDITOR);
// HTMLArea for backwards compatibility with old XSL. to be removed soon!
m_dhtmlEditor.put("HTMLArea", BebopConstants.BEBOP_DHTMLEDITOR);
// Xinha is now default!
m_dhtmlEditorSrcFile = new StringParameter
("waf.bebop.dhtml_editor_src", Parameter.REQUIRED,
"/assets/xinha/XinhaLoader.js");
register(m_presenter);
register(m_page);
register(m_tidy);
register(m_fancyErrors);
register(m_dhtmlEditor);
register(m_dhtmlEditorSrcFile);
register(m_dcpOnButtons);
register(m_dcpOnLinks);
register(m_enableTreeSelect);
register(m_showClassName);
loadInfo();
} }
/** public void setPresenterClass(
* Gets the configured <code>PresentationManger</code>. final Class<PresentationManager> presenterClass) {
*/ setPresenterClassName(presenterClass.getName());
public final PresentationManager getPresentationManager() {
return (PresentationManager) get(m_presenter);
} }
final Class getBasePageClass() { public String getBasePageClassName() {
return (Class) get(m_page); return basePageClassName;
} }
/** public Class<BasePage> getBasePageClass() {
* I don't *want* to make this public. XXX try {
*/ return (Class<BasePage>)Class.forName(basePageClassName);
public final String getTidyConfigFile() { } catch (ClassNotFoundException ex) {
return (String) get(m_tidy); throw new UncheckedWrapperException(ex);
}
} }
public boolean wantFancyXSLErrors() { public void setBasePageClassName(final String basePageClassName) {
return ((Boolean)get(m_fancyErrors)).booleanValue(); this.basePageClassName = basePageClassName;
} }
public final boolean doubleClickProtectionOnButtons() { public void setBasePageClass(final Class<BasePage> basePageClass) {
return ((Boolean) get(m_dcpOnButtons)).booleanValue(); setBasePageClassName(basePageClass.getName());
} }
public final boolean doubleClickProtectionOnLinks() { public String getTidyConfigFile() {
return ((Boolean) get(m_dcpOnLinks)).booleanValue(); return tidyConfigFile;
} }
public final boolean treeSelectAttributeEnabled() { public void setTidyConfigFile(final String tidyConfigFile) {
return ((Boolean) get(m_enableTreeSelect)).booleanValue(); this.tidyConfigFile = tidyConfigFile;
} }
/** public Boolean getFancyErrors() {
* Gets the DHTML editor to use return fancyErrors;
*/
public final String getDHTMLEditor() {
return (String) get(m_dhtmlEditor);
} }
/** public void setFancyErrors(final Boolean fancyErrors) {
* Gets the location of DHTML editor's source file this.fancyErrors = fancyErrors;
*/
public final String getDHTMLEditorSrcFile() {
return (String) get(m_dhtmlEditorSrcFile);
} }
public final boolean showClassName() { public Boolean getDcpOnButtons() {
return ((Boolean) get(m_showClassName)).booleanValue(); return dcpOnButtons;
}
public void setDcpOnButtons(final Boolean dcpOnButtons) {
this.dcpOnButtons = dcpOnButtons;
}
public Boolean getDcpOnLinks() {
return dcpOnLinks;
}
public void setDcpOnLinks(final Boolean dcpOnLinks) {
this.dcpOnLinks = dcpOnLinks;
}
public Boolean isTreeSelectEnabled() {
return treeSelectEnabled;
}
public void setTreeSelectEnabled(final Boolean treeSelectEnabled) {
this.treeSelectEnabled = treeSelectEnabled;
}
public Set<String> getDhtmlEditors() {
return new HashSet<>(dhtmlEditors);
}
public void setDhtmlEditors(final Set<String> dhtmlEditors) {
this.dhtmlEditors = dhtmlEditors;
}
public String getDefaultDhtmlEditor() {
return defaultDhtmlEditor;
}
public void setDefaultDhtmlEditor(final String defaultDhtmlEditor) {
this.defaultDhtmlEditor = defaultDhtmlEditor;
}
public String getDhtmlEditorSrcFile() {
return dhtmlEditorSrcFile;
}
public void setDhtmlEditorSrcFile(final String dhtmlEditorSrcFile) {
this.dhtmlEditorSrcFile = dhtmlEditorSrcFile;
}
public Boolean getShowClassName() {
return showClassName;
}
public void setShowClassName(final Boolean showClassName) {
this.showClassName = showClassName;
}
@Override
public int hashCode() {
int hash = 7;
hash = 89 * hash + Objects.hashCode(tidyConfigFile);
hash = 89 * hash + Objects.hashCode(fancyErrors);
hash = 89 * hash + Objects.hashCode(dcpOnButtons);
hash = 89 * hash + Objects.hashCode(dcpOnLinks);
hash = 89 * hash + Objects.hashCode(treeSelectEnabled);
hash = 89 * hash + Objects.hashCode(dhtmlEditors);
hash = 89 * hash + Objects.hashCode(defaultDhtmlEditor);
hash = 89 * hash + Objects.hashCode(dhtmlEditorSrcFile);
hash = 89 * hash + Objects.hashCode(showClassName);
return hash;
}
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof BebopConfig)) {
return false;
}
final BebopConfig other = (BebopConfig) obj;
if (!Objects.equals(tidyConfigFile, other.getTidyConfigFile())) {
return false;
}
if (!Objects.equals(defaultDhtmlEditor, other.getDefaultDhtmlEditor())) {
return false;
}
if (!Objects.equals(dhtmlEditorSrcFile, other.getDhtmlEditorSrcFile())) {
return false;
}
if (!Objects.equals(fancyErrors, other.getFancyErrors())) {
return false;
}
if (!Objects.equals(dcpOnButtons, other.getDcpOnButtons())) {
return false;
}
if (!Objects.equals(dcpOnLinks, other.getDcpOnLinks())) {
return false;
}
if (!Objects.equals(treeSelectEnabled, other.isTreeSelectEnabled())) {
return false;
}
if (!Objects.equals(dhtmlEditors, other.getDhtmlEditors())) {
return false;
}
return Objects.equals(showClassName, other.getShowClassName());
}
@Override
public String toString() {
final StringJoiner joiner = new StringJoiner(", ");
dhtmlEditors.forEach(s -> joiner.add(s));
return String.format("%s{ "
+ "tidyConfigFile = %s, "
+ "fancyErrors = %b, "
+ "dcpOnButtons = %b, "
+ "dcpOnLinks = %b, "
+ "treeSelectEnabled = %b, "
+ "dhtmlEditors = { %s }, "
+ "defaultDhtmlEditor = %s, "
+ "dhtmlEditorSrcFile = %s, "
+ "showClassName = %b"
+ " }",
super.toString(),
tidyConfigFile,
fancyErrors,
dcpOnButtons,
dcpOnLinks,
treeSelectEnabled,
joiner.toString(),
defaultDhtmlEditor,
dhtmlEditorSrcFile,
showClassName);
} }
} }

View File

@ -170,7 +170,7 @@ public class PageFactory {
if (initialized) { if (initialized) {
return; return;
} }
setPageClass(Bebop.getConfig().getBasePageClass()); setPageClass(BebopConfig.getConfig().getBasePageClass());
} }
/** /**

View File

@ -295,7 +295,7 @@ public class SimpleComponent extends Completable
m_attr.exportAttributes(target); m_attr.exportAttributes(target);
} }
if (KernelConfig.getConfig().isDebugEnabled() || if (KernelConfig.getConfig().isDebugEnabled() ||
Bebop.getConfig().showClassName()) { BebopConfig.getConfig().getShowClassName()) {
target.addAttribute("bebop:classname", getClass().getName(), target.addAttribute("bebop:classname", getClass().getName(),
BEBOP_XML_NS); BEBOP_XML_NS);
} }

View File

@ -62,7 +62,7 @@ public class Tree extends SimpleComponent implements Resettable {
Logger.getLogger(Tree.class); Logger.getLogger(Tree.class);
private static final boolean s_selectAttributeEnabled = private static final boolean s_selectAttributeEnabled =
Bebop.getConfig().treeSelectAttributeEnabled(); BebopConfig.getConfig().isTreeSelectEnabled();
// Any node id in the currentState is equivalent // Any node id in the currentState is equivalent
// to that node being expanded. If node id is // to that node being expanded. If node id is

View File

@ -22,7 +22,7 @@ import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import java.util.Set; import java.util.Set;
import com.arsdigita.bebop.Bebop; import com.arsdigita.bebop.BebopConfig;
import com.arsdigita.bebop.PageState; import com.arsdigita.bebop.PageState;
import com.arsdigita.bebop.parameters.ParameterModel; import com.arsdigita.bebop.parameters.ParameterModel;
import com.arsdigita.bebop.parameters.StringParameter; import com.arsdigita.bebop.parameters.StringParameter;
@ -182,12 +182,13 @@ public class DHTMLEditor extends TextArea {
} }
public String getEditorURL() { public String getEditorURL() {
return Bebop.getConfig().getDHTMLEditorSrcFile().substring( return BebopConfig.getConfig().getDhtmlEditorSrcFile().substring(
0, Bebop.getConfig().getDHTMLEditorSrcFile().lastIndexOf("/") + 1); 0,
BebopConfig.getConfig().getDhtmlEditorSrcFile().lastIndexOf("/") + 1);
} }
public String getEditorSrc() { public String getEditorSrc() {
return Bebop.getConfig().getDHTMLEditorSrcFile(); return BebopConfig.getConfig().getDhtmlEditorSrcFile();
} }
/** /**
@ -264,7 +265,7 @@ public class DHTMLEditor extends TextArea {
*/ */
@Override @Override
protected String getElementTag() { protected String getElementTag() {
return Bebop.getConfig().getDHTMLEditor(); return BebopConfig.getConfig().getDefaultDhtmlEditor();
} }
/** /**

View File

@ -18,7 +18,7 @@
*/ */
package com.arsdigita.bebop.page; package com.arsdigita.bebop.page;
import com.arsdigita.bebop.Bebop; import com.arsdigita.bebop.BebopConfig;
import com.arsdigita.dispatcher.DispatcherHelper; import com.arsdigita.dispatcher.DispatcherHelper;
import com.arsdigita.globalization.Globalization; import com.arsdigita.globalization.Globalization;
import com.arsdigita.globalization.GlobalizationHelper; import com.arsdigita.globalization.GlobalizationHelper;
@ -84,199 +84,199 @@ public class PageTransformer implements PresentationManager {
registerXSLParameterGenerator("contextPath", registerXSLParameterGenerator("contextPath",
new XSLParameterGenerator() { new XSLParameterGenerator() {
@Override @Override
public String generateValue( public String generateValue(
HttpServletRequest request) { HttpServletRequest request) {
return request return request
.getContextPath(); .getContextPath();
} }
}); });
registerXSLParameterGenerator("root-context-prefix", registerXSLParameterGenerator("root-context-prefix",
new XSLParameterGenerator() { new XSLParameterGenerator() {
@Override @Override
public String generateValue( public String generateValue(
HttpServletRequest request) { HttpServletRequest request) {
return Web.getConfig() return Web.getConfig()
.getDispatcherContextPath(); .getDispatcherContextPath();
} }
}); });
registerXSLParameterGenerator("context-prefix", registerXSLParameterGenerator("context-prefix",
new XSLParameterGenerator() { new XSLParameterGenerator() {
@Override @Override
public String generateValue( public String generateValue(
HttpServletRequest request) { HttpServletRequest request) {
return Web.getWebContext() return Web.getWebContext()
.getRequestURL() .getRequestURL()
.getContextPath(); .getContextPath();
} }
}); });
registerXSLParameterGenerator("internal-theme", registerXSLParameterGenerator("internal-theme",
new XSLParameterGenerator() { new XSLParameterGenerator() {
@Override @Override
public String generateValue( public String generateValue(
HttpServletRequest request) { HttpServletRequest request) {
return Web.getWebContext() return Web.getWebContext()
.getRequestURL() .getRequestURL()
.getContextPath() .getContextPath()
+ com.arsdigita.web.URL.INTERNAL_THEME_DIR; + com.arsdigita.web.URL.INTERNAL_THEME_DIR;
} }
}); });
registerXSLParameterGenerator("dispatcher-prefix", registerXSLParameterGenerator("dispatcher-prefix",
new XSLParameterGenerator() { new XSLParameterGenerator() {
@Override @Override
public String generateValue( public String generateValue(
HttpServletRequest request) { HttpServletRequest request) {
return com.arsdigita.web.URL return com.arsdigita.web.URL
.getDispatcherPath(); .getDispatcherPath();
} }
}); });
registerXSLParameterGenerator("dcp-on-buttons", registerXSLParameterGenerator("dcp-on-buttons",
new XSLParameterGenerator() { new XSLParameterGenerator() {
@Override @Override
public String generateValue( public String generateValue(
HttpServletRequest request) { HttpServletRequest request) {
if (Bebop.getConfig() if (BebopConfig.getConfig()
.doubleClickProtectionOnButtons()) { .getDcpOnButtons()) {
return "true"; return "true";
} else { } else {
return null; return null;
} }
} }
}); });
registerXSLParameterGenerator("dcp-on-links", registerXSLParameterGenerator("dcp-on-links",
new XSLParameterGenerator() { new XSLParameterGenerator() {
@Override @Override
public String generateValue( public String generateValue(
HttpServletRequest request) { HttpServletRequest request) {
if (Bebop.getConfig() if (BebopConfig.getConfig()
.doubleClickProtectionOnLinks()) { .getDcpOnLinks()) {
return "true"; return "true";
} else { } else {
return null; return null;
} }
} }
}); });
registerXSLParameterGenerator("user-agent", registerXSLParameterGenerator("user-agent",
new XSLParameterGenerator() { new XSLParameterGenerator() {
@Override @Override
public String generateValue( public String generateValue(
HttpServletRequest request) { HttpServletRequest request) {
return request.getHeader( return request.getHeader(
"User-Agent"); "User-Agent");
} }
}); });
registerXSLParameterGenerator("negotiated-language", registerXSLParameterGenerator("negotiated-language",
new XSLParameterGenerator() { new XSLParameterGenerator() {
@Override @Override
public String generateValue( public String generateValue(
HttpServletRequest request) { HttpServletRequest request) {
return GlobalizationHelper return GlobalizationHelper
.getNegotiatedLocale() .getNegotiatedLocale()
.getLanguage(); .getLanguage();
} }
}); });
registerXSLParameterGenerator("selected-language", registerXSLParameterGenerator("selected-language",
new XSLParameterGenerator() { new XSLParameterGenerator() {
@Override @Override
public String generateValue( public String generateValue(
HttpServletRequest request) { HttpServletRequest request) {
Locale selectedLocale Locale selectedLocale
= com.arsdigita.globalization.GlobalizationHelper = com.arsdigita.globalization.GlobalizationHelper.
.getSelectedLocale(request); getSelectedLocale(request);
return (selectedLocale != null) return (selectedLocale != null)
? selectedLocale ? selectedLocale
.toString() : ""; .toString() : "";
} }
}); });
registerXSLParameterGenerator("request-scheme", registerXSLParameterGenerator("request-scheme",
new XSLParameterGenerator() { new XSLParameterGenerator() {
@Override @Override
public String generateValue( public String generateValue(
HttpServletRequest request) { HttpServletRequest request) {
return request.getScheme(); return request.getScheme();
} }
}); });
registerXSLParameterGenerator("server-name", registerXSLParameterGenerator("server-name",
new XSLParameterGenerator() { new XSLParameterGenerator() {
@Override @Override
public String generateValue( public String generateValue(
HttpServletRequest request) { HttpServletRequest request) {
return request.getServerName(); return request.getServerName();
} }
}); });
registerXSLParameterGenerator("server-port", registerXSLParameterGenerator("server-port",
new XSLParameterGenerator() { new XSLParameterGenerator() {
@Override @Override
public String generateValue( public String generateValue(
HttpServletRequest request) { HttpServletRequest request) {
return Integer.toString( return Integer.toString(
request.getServerPort()); request.getServerPort());
} }
}); });
registerXSLParameterGenerator("host", registerXSLParameterGenerator("host",
new XSLParameterGenerator() { new XSLParameterGenerator() {
@Override @Override
public String generateValue( public String generateValue(
HttpServletRequest request) { HttpServletRequest request) {
if (request.getServerPort() if (request.getServerPort()
== 80) { == 80) {
return String.format( return String.format(
"%s://%s", request "%s://%s", request
.getScheme(), request .getScheme(), request
.getServerName()); .getServerName());
} else { } else {
return String.format( return String.format(
"%s://%s:%d", "%s://%s:%d",
request.getScheme(), request.getScheme(),
request request
.getServerName(), .getServerName(),
request request
.getServerPort()); .getServerPort());
} }
} }
}); });
s_log.debug("Static initalizer finished."); s_log.debug("Static initalizer finished.");
} }
@ -343,7 +343,7 @@ public class PageTransformer implements PresentationManager {
try { try {
return new PrintWriter(new OutputStreamWriter(resp. return new PrintWriter(new OutputStreamWriter(resp.
getOutputStream(), getOutputStream(),
charset)); charset));
} catch (IOException ex) { } catch (IOException ex) {
throw new UncheckedWrapperException(ex); throw new UncheckedWrapperException(ex);
@ -372,11 +372,11 @@ public class PageTransformer implements PresentationManager {
* always be passed to XSLT, which is the value of * always be passed to XSLT, which is the value of
* <code>req.getWebContextPath()</code>. * <code>req.getWebContextPath()</code>.
* *
* @param doc the Bebop page to serve * @param doc the Bebop page to serve
* @param req the servlet request * @param req the servlet request
* @param resp the servlet response * @param resp the servlet response
* @param params a set of name-value pairs to pass as parameters to the * @param params a set of name-value pairs to pass as parameters to the
* Transformer * Transformer
*/ */
public void servePage(final Document doc, public void servePage(final Document doc,
final HttpServletRequest req, final HttpServletRequest req,
@ -393,24 +393,24 @@ public class PageTransformer implements PresentationManager {
try { try {
final String charset = Globalization final String charset = Globalization
.getDefaultCharset(DispatcherHelper.getNegotiatedLocale()); .getDefaultCharset(DispatcherHelper.getNegotiatedLocale());
final String output = req.getParameter("output"); final String output = req.getParameter("output");
s_log.info("output=" + output); s_log.info("output=" + output);
if (output == null) { if (output == null) {
boolean fancyErrors = Bebop.getConfig().wantFancyXSLErrors() boolean fancyErrors
|| Boolean.TRUE.equals(req = BebopConfig.getConfig().getFancyErrors()
.getAttribute( || Boolean.TRUE.equals(req.getAttribute(
FANCY_ERRORS)); FANCY_ERRORS));
// Get the stylesheet transformer object corresponding to the // Get the stylesheet transformer object corresponding to the
// current request. // current request.
final XSLTemplate template = Templating.getTemplate( final XSLTemplate template = Templating.getTemplate(
req, req,
fancyErrors, fancyErrors,
!Boolean.TRUE.equals(req.getAttribute(CACHE_XSL_NONE))); !Boolean.TRUE.equals(req.getAttribute(CACHE_XSL_NONE)));
final PrintWriter writer = getWriter(resp, "text/html", charset); final PrintWriter writer = getWriter(resp, "text/html", charset);
@ -450,15 +450,15 @@ public class PageTransformer implements PresentationManager {
new StreamResult(writer)); new StreamResult(writer));
} catch (TransformerException ex) { } catch (TransformerException ex) {
throw new UncheckedWrapperException( throw new UncheckedWrapperException(
"cannot transform document", ex); "cannot transform document", ex);
} }
// copy and paste from BasePresentationManager // copy and paste from BasePresentationManager
if (KernelConfig.getConfig().isDebugEnabled()) { if (KernelConfig.getConfig().isDebugEnabled()) {
Document origDoc = (Document) req.getAttribute( Document origDoc = (Document) req.getAttribute(
"com.arsdigita.xml.Document"); "com.arsdigita.xml.Document");
Debugger.addDebugger(new TransformationDebugger(template. Debugger.addDebugger(new TransformationDebugger(template.
getSource(), template.getDependents())); getSource(), template.getDependents()));
writer.print(Debugger.getDebugging(req)); writer.print(Debugger.getDebugging(req));
} }
@ -478,11 +478,11 @@ public class PageTransformer implements PresentationManager {
// current request. // current request.
template = Templating.getTemplate(req, template = Templating.getTemplate(req,
Boolean.TRUE.equals(req Boolean.TRUE.equals(req
.getAttribute( .getAttribute(
PageTransformer.FANCY_ERRORS)), PageTransformer.FANCY_ERRORS)),
!Boolean.TRUE.equals(req !Boolean.TRUE.equals(req
.getAttribute( .getAttribute(
PageTransformer.CACHE_XSL_NONE))); PageTransformer.CACHE_XSL_NONE)));
endTransaction(req); endTransaction(req);
} finally { } finally {
} }
@ -490,7 +490,7 @@ public class PageTransformer implements PresentationManager {
try { try {
Date now = new Date(); Date now = new Date();
SimpleDateFormat fmt = new SimpleDateFormat( SimpleDateFormat fmt = new SimpleDateFormat(
"yyyy-MM-dd-HH-mm"); "yyyy-MM-dd-HH-mm");
String prefix = "waf-xsl-" + fmt.format(now); String prefix = "waf-xsl-" + fmt.format(now);
final OutputStream os = resp.getOutputStream(); final OutputStream os = resp.getOutputStream();
@ -509,7 +509,7 @@ public class PageTransformer implements PresentationManager {
} }
} else { } else {
throw new IllegalStateException(output throw new IllegalStateException(output
+ " is an unknown output"); + " is an unknown output");
} }
} finally { } finally {
} }
@ -577,7 +577,7 @@ public class PageTransformer implements PresentationManager {
HttpServletRequest request) { HttpServletRequest request) {
XSLParameterGenerator generator XSLParameterGenerator generator
= (XSLParameterGenerator) s_XSLParameters = (XSLParameterGenerator) s_XSLParameters
.get(name); .get(name);
if (generator != null) { if (generator != null) {
return generator.generateValue(request); return generator.generateValue(request);
} else { } else {
@ -600,7 +600,7 @@ public class PageTransformer implements PresentationManager {
final Map.Entry entry = (Map.Entry) entries.next(); final Map.Entry entry = (Map.Entry) entries.next();
String value = ((XSLParameterGenerator) entry.getValue()). String value = ((XSLParameterGenerator) entry.getValue()).
generateValue(request); generateValue(request);
if (value == null) { if (value == null) {
// XSL does not like nulls // XSL does not like nulls
value = ""; value = "";

View File

@ -18,7 +18,7 @@
*/ */
package com.arsdigita.bebop.parameters; package com.arsdigita.bebop.parameters;
import com.arsdigita.bebop.Bebop; import com.arsdigita.bebop.BebopConfig;
import com.arsdigita.bebop.event.ParameterEvent; import com.arsdigita.bebop.event.ParameterEvent;
import com.arsdigita.bebop.event.ParameterListener; import com.arsdigita.bebop.event.ParameterListener;
import com.arsdigita.util.StringUtils; import com.arsdigita.util.StringUtils;
@ -102,7 +102,7 @@ public class TidyHTMLValidationListener implements ParameterListener {
private static Properties getJTidyProperties() { private static Properties getJTidyProperties() {
if (s_tidyProperties == null) { if (s_tidyProperties == null) {
s_tidyProperties = new LockableProperties(); s_tidyProperties = new LockableProperties();
String path = Bebop.getConfig().getTidyConfigFile(); String path = BebopConfig.getConfig().getTidyConfigFile();
InputStream is = TidyHTMLValidationListener.class.getClassLoader InputStream is = TidyHTMLValidationListener.class.getClassLoader
().getResourceAsStream(path); ().getResourceAsStream(path);

View File

@ -17,7 +17,7 @@
*/ */
package com.arsdigita.templating; package com.arsdigita.templating;
import com.arsdigita.bebop.Bebop; import com.arsdigita.bebop.BebopConfig;
import com.arsdigita.kernel.KernelConfig; import com.arsdigita.kernel.KernelConfig;
import com.arsdigita.util.Assert; import com.arsdigita.util.Assert;
import com.arsdigita.util.ExceptionUnwrapper; import com.arsdigita.util.ExceptionUnwrapper;
@ -49,8 +49,8 @@ import org.apache.log4j.Logger;
* An entry-point class for the functions of the templating package. The class * An entry-point class for the functions of the templating package. The class
* manages access to all theme files (XSL as well as css, pirctures, etc). * manages access to all theme files (XSL as well as css, pirctures, etc).
* *
* This class maintains a cache of <code>XSLTemplate</code> objects, managed * This class maintains a cache of <code>XSLTemplate</code> objects, managed via
* via the <code>getTemplate</code> and <code>purgeTemplate</code> methods. * the <code>getTemplate</code> and <code>purgeTemplate</code> methods.
* *
* @author Dan Berrange * @author Dan Berrange
* @author Justin Ross &lt;jross@redhat.com&gt; * @author Justin Ross &lt;jross@redhat.com&gt;
@ -58,21 +58,26 @@ import org.apache.log4j.Logger;
*/ */
public class Templating { public class Templating {
/** Internal logger instance to faciliate debugging. Enable logging output /**
* by editing /WEB-INF/conf/log4j.properties int hte runtime environment * Internal logger instance to faciliate debugging. Enable logging output by
* and set com.arsdigita.templating.Templating=DEBUG by uncommenting it * editing /WEB-INF/conf/log4j.properties int hte runtime environment and
* or adding the line. */ * set com.arsdigita.templating.Templating=DEBUG by uncommenting it or
* adding the line.
*/
private static final Logger s_log = Logger.getLogger(Templating.class); private static final Logger s_log = Logger.getLogger(Templating.class);
/** This is the name of the attribute that is set in the request whose /**
* value, if present, is a collection of TransformerExceptions that * This is the name of the attribute that is set in the request whose value,
* can be used to produce a "pretty" error. */ * if present, is a collection of TransformerExceptions that can be used to
* produce a "pretty" error.
*/
public static final String FANCY_ERROR_COLLECTION = "fancyErrorCollection"; public static final String FANCY_ERROR_COLLECTION = "fancyErrorCollection";
/**
/** Config object containing various parameter */ * Config object containing various parameter
*/
private static final TemplatingConfig s_config = TemplatingConfig private static final TemplatingConfig s_config = TemplatingConfig
.getInstanceOf(); .getInstanceOf();
static { static {
s_log.debug("Static initalizer starting..."); s_log.debug("Static initalizer starting...");
@ -81,15 +86,14 @@ public class Templating {
TransformerException.class, TransformerException.class,
new ExceptionUnwrapper() { new ExceptionUnwrapper() {
@Override @Override
public Throwable unwrap(Throwable t) { public Throwable unwrap(Throwable t) {
TransformerException ex = (TransformerException) t; TransformerException ex = (TransformerException) t;
return ex.getCause(); return ex.getCause();
} }
}); });
// now we initiate the CacheTable here // now we initiate the CacheTable here
// default cache size used to be 50, which is too high I reckon, // default cache size used to be 50, which is too high I reckon,
// each template can eat up to 4 megs // each template can eat up to 4 megs
Integer setting = s_config.getCacheSize(); Integer setting = s_config.getCacheSize();
@ -121,8 +125,7 @@ public class Templating {
* an implementation. To avoid class hierachie kludge we directly return the * an implementation. To avoid class hierachie kludge we directly return the
* bebop config here. * bebop config here.
* *
* @return an instance of the <code>PresentationManager</code> * @return an instance of the <code>PresentationManager</code> interface
* interface
*/ */
/* NON Javadoc /* NON Javadoc
* Used to be deprecated up to version 6.6.0. Reverted to non-deprecated. * Used to be deprecated up to version 6.6.0. Reverted to non-deprecated.
@ -134,17 +137,22 @@ public class Templating {
* instead. * instead.
*/ */
public static PresentationManager getPresentationManager() { public static PresentationManager getPresentationManager() {
return Bebop.getConfig().getPresentationManager(); try {
return (PresentationManager) BebopConfig.getConfig().
getPresenterClass().newInstance();
} catch (IllegalAccessException | InstantiationException ex) {
throw new UncheckedWrapperException(ex);
}
} }
/** /**
* Retrieves an XSL template. If the template is already loaded in the * Retrieves an XSL template. If the template is already loaded in the
* cache, it will be returned. If the template has been modified since * cache, it will be returned. If the template has been modified since it
* it was first generated, it will be regenerated first. * was first generated, it will be regenerated first.
* *
* @param source the <code>URL</code> to the top-level template resource * @param source the <code>URL</code> to the top-level template resource
* @return an <code>XSLTemplate</code> instance representing * @return an <code>XSLTemplate</code> instance representing
* <code>source</code> * <code>source</code>
*/ */
public static synchronized XSLTemplate getTemplate(final URL source) { public static synchronized XSLTemplate getTemplate(final URL source) {
return getTemplate(source, false, true); return getTemplate(source, false, true);
@ -152,19 +160,18 @@ public class Templating {
/** /**
* Retrieves an XSL template. If the template is already loaded in the * Retrieves an XSL template. If the template is already loaded in the
* cache, it will be returned. If the template has been modified since * cache, it will be returned. If the template has been modified since it
* it was first generated, it will be regenerated first. * was first generated, it will be regenerated first.
* *
* @param source the <code>URL</code> to the top-level template resource * @param source the <code>URL</code> to the top-level template resource
* @param fancyErrors Should this place any xsl errors in the request * @param fancyErrors Should this place any xsl errors in the request for
* for use by another class. If this is true, the * use by another class. If this is true, the the errors are stored for
* the errors are stored for later use. * later use.
* @param useCache Should the templates be pulled from cache, if available? * @param useCache Should the templates be pulled from cache, if available?
* True means they are pulled from cache. False means * True means they are pulled from cache. False means they are pulled from
* they are pulled from the disk. If this is false * the disk. If this is false the pages are also not placed in the cache.
* the pages are also not placed in the cache.
* @return an <code>XSLTemplate</code> instance representing * @return an <code>XSLTemplate</code> instance representing
* <code>source</code> * <code>source</code>
*/ */
public static synchronized XSLTemplate getTemplate(final URL source, public static synchronized XSLTemplate getTemplate(final URL source,
boolean fancyErrors, boolean fancyErrors,
@ -181,7 +188,7 @@ public class Templating {
if (template == null) { if (template == null) {
if (s_log.isInfoEnabled()) { if (s_log.isInfoEnabled()) {
s_log.info("The template for URL " + source + " is not " s_log.info("The template for URL " + source + " is not "
+ "cached; creating and caching it now"); + "cached; creating and caching it now");
} }
if (fancyErrors) { if (fancyErrors) {
@ -194,14 +201,14 @@ public class Templating {
} }
} else if (KernelConfig.getConfig().isDebugEnabled() } else if (KernelConfig.getConfig().isDebugEnabled()
&& template.isModified()) { && template.isModified()) {
// XXX referencing Kernel above is a broken dependency. // XXX referencing Kernel above is a broken dependency.
// Debug mode should be captured at a lower level, // Debug mode should be captured at a lower level,
// probably on UtilConfig. // probably on UtilConfig.
if (s_log.isInfoEnabled()) { if (s_log.isInfoEnabled()) {
s_log.info("Template " + template + " has been modified; " s_log.info("Template " + template + " has been modified; "
+ "recreating it from scratch"); + "recreating it from scratch");
} }
if (fancyErrors) { if (fancyErrors) {
@ -220,7 +227,7 @@ public class Templating {
/** /**
* Resolves and retrieves the template for the given request. * Resolves and retrieves the template for the given request.
* *
* @param sreq The current request object * @param sreq The current request object
* @return The resolved <code>XSLTemplate</code> instance * @return The resolved <code>XSLTemplate</code> instance
*/ */
public static XSLTemplate getTemplate(final HttpServletRequest sreq) { public static XSLTemplate getTemplate(final HttpServletRequest sreq) {
@ -231,13 +238,12 @@ public class Templating {
* Resolves the template for the given request to an URL. * Resolves the template for the given request to an URL.
* *
* @param sreq The current request object * @param sreq The current request object
* @param fancyErrors Should this place any xsl errors in the request * @param fancyErrors Should this place any xsl errors in the request for
* for use by another class. If this is true, the * use by another class. If this is true, the the errors are stored for
* the errors are stored for later use. * later use.
* @param useCache Should the templates be pulled from cache, if available? * @param useCache Should the templates be pulled from cache, if available?
* True means they are pulled from cache. False means * True means they are pulled from cache. False means they are pulled from
* they are pulled from the disk. If this is false * the disk. If this is false the pages are also not placed in the cache.
* the pages are also not placed in the cache.
* @return The resolved <code>XSLTemplate</code> instance * @return The resolved <code>XSLTemplate</code> instance
*/ */
public static XSLTemplate getTemplate(final HttpServletRequest sreq, public static XSLTemplate getTemplate(final HttpServletRequest sreq,
@ -253,12 +259,10 @@ public class Templating {
} }
/** /**
* Removes an XSL template from the internal cache. The template * Removes an XSL template from the internal cache. The template for
* for <code>source</code> will be regenerated on the next request * <code>source</code> will be regenerated on the next request for it.
* for it.
* *
* @param source the <code>URL</code> to the top-level template * @param source the <code>URL</code> to the top-level template resource
* resource
*/ */
public static synchronized void purgeTemplate(final URL source) { public static synchronized void purgeTemplate(final URL source) {
if (s_log.isDebugEnabled()) { if (s_log.isDebugEnabled()) {
@ -269,8 +273,8 @@ public class Templating {
} }
/** /**
* Removes all cached template objects. All template objects will * Removes all cached template objects. All template objects will be
* be regenerated on-demand as each gets requested. * regenerated on-demand as each gets requested.
*/ */
public static synchronized void purgeTemplates() { public static synchronized void purgeTemplates() {
if (s_log.isDebugEnabled()) { if (s_log.isDebugEnabled()) {
@ -318,8 +322,8 @@ public class Templating {
} }
/** /**
* Transforms an URL, that refers to a local resource inside the running * Transforms an URL, that refers to a local resource inside the running CCM
* CCM web application. NON-local URLs remain unmodified. * web application. NON-local URLs remain unmodified.
* *
* In case of a virtual path "/resource" it is short-circuiting access to * In case of a virtual path "/resource" it is short-circuiting access to
* the resource servlet. All other http:// URLs are transformed into file:// * the resource servlet. All other http:// URLs are transformed into file://
@ -335,19 +339,21 @@ public class Templating {
static URL transformURL(URL url) { static URL transformURL(URL url) {
HttpHost self = Web.getConfig().getHost(); HttpHost self = Web.getConfig().getHost();
/** Indicates whether url refers to a local resource inside the /**
* running CCM web application (inside it's webapp context) */ * Indicates whether url refers to a local resource inside the running
* CCM web application (inside it's webapp context)
*/
Boolean isLocal = false; Boolean isLocal = false;
/** Contains the transformed "localized" path to url, i.e. without /**
* host part. */ * Contains the transformed "localized" path to url, i.e. without host
* part.
*/
String localPath = ""; String localPath = "";
// Check if the url refers to our own host // Check if the url refers to our own host
if (self.getName().equals(url.getHost()) if (self.getName().equals(url.getHost())
&& ( (self.getPort() == url.getPort()) && ((self.getPort() == url.getPort())
|| (url.getPort()== -1 && self.getPort()== 80) || (url.getPort() == -1 && self.getPort() == 80))) {
)
) {
// host part denotes to a local resource, cut off host part. // host part denotes to a local resource, cut off host part.
localPath = url.getPath(); localPath = url.getPath();
isLocal = true; isLocal = true;
@ -365,15 +371,14 @@ public class Templating {
s_log.debug("Installation context is >" + installContext + "<."); s_log.debug("Installation context is >" + installContext + "<.");
} }
if (!installContext.equals("")) { if (!installContext.equals("")) {
// CCM is installed into a non-ROOT context // CCM is installed into a non-ROOT context
if (localPath.startsWith(installContext)) { if (localPath.startsWith(installContext)) {
// remove webapp context part // remove webapp context part
localPath = localPath.substring(installContext.length()); localPath = localPath.substring(installContext.length());
if (s_log.isDebugEnabled()) { if (s_log.isDebugEnabled()) {
s_log.debug("WebApp context removed: >>" + s_log.debug("WebApp context removed: >>" + localPath + "<<");
localPath + "<<");
}
} }
}
} }
if (isLocal) { if (isLocal) {
@ -385,39 +390,37 @@ public class Templating {
localPath = localPath.substring("/resource".length()); //remove virtual part localPath = localPath.substring("/resource".length()); //remove virtual part
URL newURL = Web.findResource(localPath); //without host part here! URL newURL = Web.findResource(localPath); //without host part here!
if (s_log.isDebugEnabled()) { if (s_log.isDebugEnabled()) {
s_log.debug("Transforming resource " + url + " to " + newURL); s_log.
debug("Transforming resource " + url + " to "
+ newURL);
} }
return newURL; return newURL;
} else { } else {
// A real path to disk // A real path to disk
final String filename = Web.getServletContext() final String filename = Web.getServletContext()
.getRealPath(localPath); .getRealPath(localPath);
File file = new File(filename); File file = new File(filename);
if (file.exists()) { if (file.exists()) {
try { try {
URL newURL = file.toURL(); URL newURL = file.toURL();
if (s_log.isDebugEnabled()) { if (s_log.isDebugEnabled()) {
s_log.debug("Transforming resource " + url + " to " s_log.debug("Transforming resource " + url + " to "
+ newURL); + newURL);
} }
return newURL; return newURL;
} catch (MalformedURLException ex) { } catch (MalformedURLException ex) {
throw new UncheckedWrapperException(ex); throw new UncheckedWrapperException(ex);
} }
} else { } else if (s_log.isDebugEnabled()) {
if (s_log.isDebugEnabled()) { s_log.debug("File " + filename
s_log.debug("File " + filename + " doesn't exist on disk");
+ " doesn't exist on disk");
}
} }
} }
} else { } else // url is not the (local) running CCM host, no transformation
// url is not the (local) running CCM host, no transformation // is done
// is done if (s_log.isDebugEnabled()) {
if (s_log.isDebugEnabled()) {
s_log.debug("URL " + url + " is not local"); s_log.debug("URL " + url + " is not local");
} }
}
return url; // returns the original, unmodified url here return url; // returns the original, unmodified url here
} }
@ -429,8 +432,8 @@ public class Templating {
*/ */
class LoggingErrorListener implements ErrorListener { class LoggingErrorListener implements ErrorListener {
private static final Logger s_log = private static final Logger s_log
Logger.getLogger(LoggingErrorListener.class); = Logger.getLogger(LoggingErrorListener.class);
private final ArrayList m_errors; private final ArrayList m_errors;
LoggingErrorListener() { LoggingErrorListener() {
@ -458,7 +461,8 @@ class LoggingErrorListener implements ErrorListener {
private void log(Level level, TransformerException ex) { private void log(Level level, TransformerException ex) {
s_log.log(level, "Transformer " + level + ": " s_log.log(level, "Transformer " + level + ": "
+ ex.getLocationAsString() + ": " + ex.getMessage(), + ex.getLocationAsString() + ": " + ex.
getMessage(),
ex); ex);
m_errors.add(ex); m_errors.add(ex);
} }

View File

@ -0,0 +1,30 @@
# Copyright (C) 2016 LibreCCM Foundation.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA
bebop.config.description = Several configuration options for Bebop
bebop.config.presenter_class_name = Determines what implementation of PresentationManager is used to style Bebop pages
bebop.config.base_page_name = Determines what implementation of BasePage is used to serve Bebop pages
bebop.config.tidy_config_file = Points to the configuration file for the JTidy parameter validation listener
bebop.config.fancy_errors = Always display fancy XSL error pages
bebop.config.dcp_on_buttons = Specify whether to apply javascript double click protection to form submits
bebop.config.dcp_on_links = Specify whether to apply javascript double click protection to anchor elements
bebop.config.tree_select_enabled = Specify whether to turn on isSelected XML attribute on bebop.Tree nodes (performance impact)
bebop.config.dhtml_editors = Lists of all available DHTML text input widgets
bebop.config.default_dhtml_editor = Select which DHTML text input widget is used for DHTMLEditor Bebop component.
bebop.config.dhtml_editor_srcfile = Relative path to the source javascript file
bebop.config.show_class_name =

View File

@ -1,44 +0,0 @@
waf.bebop.base_page.title=Bebop base page class
waf.bebop.base_page.purpose=Determines what implementation of BasePage is used to serve Bebop pages
waf.bebop.base_page.example=com.arsdigita.ui.SimplePage
waf.bebop.base_page.format=[classname]
waf.bebop.presentation_manager.title=Bebop presentation manager class
waf.bebop.presentation_manager.purpose=Determines what implementation of PresentationManager is used to style Bebop pages
waf.bebop.presentation_manager.example=com.arsdigita.bebop.page.PageTransformer
waf.bebop.presentation_manager.format=[classname]
waf.bebop.tidy_config_file.title=JTidy validation listener config file
waf.bebop.tidy_config_file.purpose=Points to the configuration file for the JTidy parameter validation listener
waf.bebop.tidy_config_file.example=com/arsdigita/bebop/parameters/tidy.properties
waf.bebop.tidy_config_file.format=[string]
waf.bebop.fancy_xsl_errors.title=Fancy XSL errors
waf.bebop.fancy_xsl_errors.purpose=Always display fancy XSL error pages
waf.bebop.fancy_xsl_errors.example=true|false
waf.bebop.fancy_xsl_errors.format=[boolean]
waf.bebop.dcp_on_buttons.title=Double Click protection for buttons
waf.bebop.dcp_on_buttons.purpose=Specify whether to apply javascript double click protection to form submits
waf.bebop.dcp_on_buttons.example=true|false
waf.bebop.dcp_on_buttons.format=[boolean]
waf.bebop.dcp_on_links.title=Double Click protection for links
waf.bebop.dcp_on_links.purpose=Specify whether to apply javascript double click protection to anchor elements
waf.bebop.dcp_on_links.example=true|false
waf.bebop.dcp_on_links.format=[boolean]
waf.bebop.dhtml_editor.title=DHTML editor implementation
waf.bebop.dhtml_editor.purpose=Select which DHTML text input widget is used for DHTMLEditor Bebop component.
waf.bebop.dhtml_editor.example=FCKeditor
waf.bebop.dhtml_editor.format=Xinha|FCKeditor|HTMLArea
waf.bebop.dhtml_editor_src.title=Relative path to the source javascript file
waf.bebop.dhtml_editor_src.purpose=Relative path to the source javascript file
waf.bebop.dhtml_editor_src.example=/assets/xinha/XinhaLoader.js
waf.bebop.dhtml_editor_src.format=[String]
waf.bebop.enable_tree_select_attribute.title=isSelected attribute for bebop.Tree nodes
waf.bebop.enable_tree_select_attribute.purpose=Specify whether to turn on isSelected XML attribute on bebop.Tree nodes (performance impact)
waf.bebop.enable_tree_select_attribute.example=true|false
waf.bebop.enable_tree_select_attribute.format=[boolean]