JBoss Ajax4JSF SVN: r303 - trunk/docs/userguide/en/src/main/docbook/included.
by ajax4jsf-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2007-07-09 09:37:48 -0400 (Mon, 09 Jul 2007)
New Revision: 303
Modified:
trunk/docs/userguide/en/src/main/docbook/included/jsFunction.xml
Log:
http://jira.jboss.com/jira/browse/RF-421
Improved discription for jsFunction. Added ways of usage and link to example.
Modified: trunk/docs/userguide/en/src/main/docbook/included/jsFunction.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/jsFunction.xml 2007-07-07 01:16:15 UTC (rev 302)
+++ trunk/docs/userguide/en/src/main/docbook/included/jsFunction.xml 2007-07-09 13:37:48 UTC (rev 303)
@@ -1,36 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<chapter>
-
- <table>
- <title>Component identification parameters </title>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Name</entry>
- <entry>Value</entry>
- </row>
- </thead>
- <tbody>
- <row>
- <entry>component-type</entry>
- <entry>org.ajax4jsf.ajax.Function</entry>
- </row>
- <row>
- <entry>component-family</entry>
- <entry>org.ajax4jsf.components.AjaxFunction</entry>
- </row>
- <row>
- <entry>component-class</entry>
- <entry>org.ajax4jsf.ajax.html.HtmlAjaxFunction</entry>
- </row>
- <row>
- <entry>renderer-type</entry>
- <entry>org.ajax4jsf.components.AjaxFunctionRenderer</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
-
+
+ <table>
+ <title>Component identification parameters </title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Value</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry>component-type</entry>
+ <entry>org.ajax4jsf.ajax.Function</entry>
+ </row>
+ <row>
+ <entry>component-family</entry>
+ <entry>org.ajax4jsf.components.AjaxFunction</entry>
+ </row>
+ <row>
+ <entry>component-class</entry>
+ <entry>org.ajax4jsf.ajax.html.HtmlAjaxFunction</entry>
+ </row>
+ <row>
+ <entry>renderer-type</entry>
+ <entry>org.ajax4jsf.components.AjaxFunctionRenderer</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
<section>
<title>Creating on a page</title>
<para>Simple component definition example:</para>
@@ -45,10 +45,9 @@
<a4j:jsFunction data="#{bean.someProperty}" name="callScript" oncomplete="myScript(data.subProperty1, data.subProperty2)"/>
...]]>
</programlisting>
- <para>
- The script "myScript" will be called after <property>bean.someProperty</property> data
- will be returned from server(e.g. It'll be object with two subproperties).
- </para>
+ <para> The script "myScript" will be called after
+ <property>bean.someProperty</property> data will be returned from server(e.g. It'll
+ be object with two subproperties). </para>
</section>
<section>
<title>Dynamical creation of a component from Java code</title>
@@ -60,11 +59,55 @@
</section>
<section>
<title>Key attributes and ways of usage</title>
- <para>
- As the component uses Ajax request to get data from server - it has all
- common Ajax Action attributes. So, action and actionListener can be
- invoked, and reRendering some parts of the page fired after calling
- function.
- </para>
- </section>
-</chapter>
\ No newline at end of file
+ <para> As the component uses Ajax request to get data from server - it has all common Ajax
+ Action attributes. So, action and actionListener can be invoked, and reRendering some parts of
+ the page fired after calling function. </para>
+ <para> When using the <emphasis role="bold">
+ <property><a4j:jsFunction></property>
+ </emphasis> it's possible to initiate the AJAX request from the JavaScript and
+ perform partial update of a page and/or invoke the JavaScript function with data returned by
+ AJAX response. </para>
+ <programlisting role="XML"><![CDATA[...
+<body onload="callScript()">
+ ...
+ <h:form>
+ ...
+ <a4j:jsFunction name="callScript" data="#{bean.someProperty1 }
+ "reRender="someComponent" oncomplete="myScript(data.subProperty1, data.subProperty2)">
+ <a4j:actionparam name="param_name" assignTo="#{bean.someProperty2}">
+ </a4j:actionparam>
+ </a4j:jsFunction>
+ ...
+ </h:form>
+ ...
+</body>
+...]]></programlisting>
+ <para> The <emphasis role="bold">
+ <property><a4j:jsFunction></property>
+ </emphasis> allows to use <emphasis role="bold">
+ <property><a4j:actionparam></property>
+ </emphasis> or pure <emphasis role="bold">
+ <property><f:param></property>
+ </emphasis> for passing any number of parameters of the JavaScript function into AJAX request.
+ <emphasis role="bold">
+ <property><a4j:jsFunction></property>
+ </emphasis> is similar to <emphasis role="bold">
+ <property><a4j:commandButton></property>
+ </emphasis>, but it could be activated from the JavaScript code. It allows to invoke some
+ server side functionality and use the returned data in the JavaScript function invoked from
+ "oncomplete" attribute. So it's possible to use <emphasis
+ role="bold">
+ <property><a4j:jsFunction></property>
+ </emphasis> instead of <emphasis role="bold">
+ <property><a4j:commandButton></property>
+ </emphasis>. You can put it anywhere, just don't forget to use
+ <h:form> … </h:form> around it. </para>
+ </section>
+ <section>
+ <title>Relevant resources links</title>
+ <para> To see how <emphasis role="bold">
+ <property><a4j:jsFunction></property>
+ </emphasis> works on practice, look at a4j-jsFunction example from <ulink
+ url="http://labs.jboss.com/jbossajax4jsf/demo/index.html">here</ulink>.</para>
+ </section>
+</chapter>
16 years, 10 months
JBoss Ajax4JSF SVN: r302 - in trunk: framework/src/main/java/org/ajax4jsf/framework/ajax and 13 other directories.
by ajax4jsf-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2007-07-06 21:16:15 -0400 (Fri, 06 Jul 2007)
New Revision: 302
Added:
trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/xmlfilter/ConfigurableFilter.java
trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/xmlfilter/ConfigurableXMLFilter.java
trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/xmlfilter/ParserConfig.java
trunk/framework/src/test/java/org/ajax4jsf/framework/ajax/xmlfilter/ConfigurableXMLFilterTestCase.java
trunk/framework/src/test/java/org/ajax4jsf/framework/ajax/xmlfilter/ParterConfigTestCase.java
trunk/samples/useCases/src/main/java/beans/
trunk/samples/useCases/src/main/java/beans/performance/
trunk/samples/useCases/src/main/java/beans/performance/Data.java
trunk/samples/useCases/src/main/webapp/META-INF/
trunk/samples/useCases/src/main/webapp/META-INF/MANIFEST.MF
trunk/samples/useCases/src/main/webapp/pages/performance.xhtml
Modified:
trunk/framework/src/main/java/org/ajax4jsf/Filter.java
trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/AjaxContext.java
trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/AjaxViewHandler.java
trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/xmlfilter/BaseFilter.java
trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/xmlfilter/BaseXMLFilter.java
trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/xmlfilter/HtmlParser.java
trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/xmlfilter/nekko/NekkoParser.java
trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/xmlfilter/nekko/NekkoXMLFilter.java
trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/xmlfilter/tidy/TidyParser.java
trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/xmlfilter/tidy/TidyXMLFilter.java
trunk/framework/src/main/java/org/ajax4jsf/framework/resource/InternetResourceService.java
trunk/framework/src/main/java/org/ajax4jsf/io/parser/FastHtmlParser.java
trunk/samples/useCases/src/main/webapp/WEB-INF/faces-config.xml
trunk/samples/useCases/src/main/webapp/WEB-INF/web.xml
Log:
Create configurable XML filter, can use different parsers for a different URL.
Modified: trunk/framework/src/main/java/org/ajax4jsf/Filter.java
===================================================================
--- trunk/framework/src/main/java/org/ajax4jsf/Filter.java 2007-07-06 14:48:03 UTC (rev 301)
+++ trunk/framework/src/main/java/org/ajax4jsf/Filter.java 2007-07-07 01:16:15 UTC (rev 302)
@@ -21,6 +21,7 @@
package org.ajax4jsf;
+import org.ajax4jsf.framework.ajax.xmlfilter.ConfigurableFilter;
import org.ajax4jsf.framework.ajax.xmlfilter.TidyFilter;
/**
@@ -29,6 +30,6 @@
* @version $Revision: 1.1.2.1 $ $Date: 2007/01/09 18:58:29 $
*
*/
-public class Filter extends TidyFilter {
+public class Filter extends ConfigurableFilter {
}
Modified: trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/AjaxContext.java
===================================================================
--- trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/AjaxContext.java 2007-07-06 14:48:03 UTC (rev 301)
+++ trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/AjaxContext.java 2007-07-07 01:16:15 UTC (rev 302)
@@ -431,6 +431,9 @@
}
// Mark as processed.
requestMap.put(RESOURCES_PROCESSED, Boolean.TRUE);
+ // Save viewId for a parser selection
+ requestMap.put(
+ AjaxViewHandler.VIEW_ID_KEY,root.getViewId());
}
}
@@ -499,15 +502,16 @@
public void saveViewState(FacesContext context) throws IOException {
// TODO - for facelets environment, we need to remove transient
// components.
- try {
- Application.class.getMethod("getExpressionFactory", null);
- } catch (NoSuchMethodException e) {
- // JSF 1.1 !
- }
+// try {
+// Application.class.getMethod("getExpressionFactory", null);
+// } catch (NoSuchMethodException e) {
+// // JSF 1.1 !
+// }
ResponseWriter writer = context.getResponseWriter();
StateManager stateManager = context.getApplication().getStateManager();
SerializedView serializedView = stateManager
.saveSerializedView(context);
+ Map requestMap = context.getExternalContext().getRequestMap();
if (null != serializedView) {
StringWriter bufWriter = new StringWriter();
ResponseWriter cloneWithWriter = writer.cloneWithWriter(bufWriter);
@@ -515,7 +519,7 @@
stateManager.writeState(context, serializedView);
cloneWithWriter.flush();
if (bufWriter.getBuffer().length() > 0) {
- context.getExternalContext().getRequestMap().put(
+ requestMap.put(
AjaxViewHandler.SERIALIZED_STATE_KEY,
bufWriter.toString());
}
Modified: trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/AjaxViewHandler.java
===================================================================
--- trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/AjaxViewHandler.java 2007-07-06 14:48:03 UTC (rev 301)
+++ trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/AjaxViewHandler.java 2007-07-07 01:16:15 UTC (rev 302)
@@ -58,6 +58,8 @@
private static final String REDIRECTED = "org.ajax4jsf.view.REDIRECTED";
+ public static final String VIEW_ID_KEY = "org.ajax4jsf.view.ID";
+
/**
* @param parent
*/
Modified: trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/xmlfilter/BaseFilter.java
===================================================================
--- trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/xmlfilter/BaseFilter.java 2007-07-06 14:48:03 UTC (rev 301)
+++ trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/xmlfilter/BaseFilter.java 2007-07-07 01:16:15 UTC (rev 302)
@@ -39,7 +39,6 @@
import javax.servlet.http.HttpSession;
import org.ajax4jsf.ajax.PushEventsCounter;
-import org.ajax4jsf.cache.Cache;
import org.ajax4jsf.framework.renderer.AjaxContainerRenderer;
import org.ajax4jsf.framework.resource.InternetResourceService;
import org.ajax4jsf.framework.util.message.Messages;
Modified: trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/xmlfilter/BaseXMLFilter.java
===================================================================
--- trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/xmlfilter/BaseXMLFilter.java 2007-07-06 14:48:03 UTC (rev 301)
+++ trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/xmlfilter/BaseXMLFilter.java 2007-07-07 01:16:15 UTC (rev 302)
@@ -67,9 +67,12 @@
private static final String NAMESPACE_PARAMETER = "namespace";
private boolean forcexml = false;
+
private static final String FORCEXML_PARAMETER = "forceparser";
+ private static final String INIT_PARAMETER_PREFIX = "org.ajax4jsf.xmlfilter.";
+
public BaseFilter filter;
public void setFilter(BaseFilter filter) {
@@ -81,14 +84,10 @@
log.debug("init XML filter service with class "
+ this.getClass().getName());
}
- if ("false".equalsIgnoreCase(config
- .getInitParameter(FORCEXML_PARAMETER))) {
- this.forcexml = false;
- }
- if ("true"
- .equalsIgnoreCase(config.getInitParameter(FORCEXML_PARAMETER))) {
- this.forcexml = true;
- }
+ String forceXmlParameter = config
+ .getInitParameter(FORCEXML_PARAMETER);
+ setupForceXml(forceXmlParameter);
+ forceXmlParameter = config.getServletContext().getInitParameter(INIT_PARAMETER_PREFIX+FORCEXML_PARAMETER);
setMimetype((String) nz(config.getInitParameter(MIME_TYPE_PARAMETER),
"text/xml"));
setPublicid((String) nz(config.getInitParameter(PUBLICID_PARAMETER),
@@ -100,6 +99,19 @@
}
/**
+ * @param forceXmlParameter
+ */
+ private void setupForceXml(String forceXmlParameter) {
+ if ("false".equalsIgnoreCase(forceXmlParameter)) {
+ this.forcexml = false;
+ }
+ if ("true"
+ .equalsIgnoreCase(forceXmlParameter)) {
+ this.forcexml = true;
+ }
+ }
+
+ /**
* Perform filter chain with xml parsing and transformation. Subclasses
* must implement concrete HTML to XML parsing, nesseasary
* transformations and serialization.
@@ -125,6 +137,7 @@
.setAttribute(RESPONSE_WRAPPER_ATTRIBUTE,
servletResponseWrapper);
chain.doFilter(request, servletResponseWrapper);
+ String viewId = (String) request.getAttribute(AjaxViewHandler.VIEW_ID_KEY);
HtmlParser parser = null;
// setup response
// Redirect in AJAX request - convert to special response recognized by
@@ -203,7 +216,7 @@
String outputEncoding = "UTF-8";
String contentType = getMimetype() + ";charset=" + outputEncoding;
response.setContentType(contentType);
- parser = getParser(getMimetype(), true);
+ parser = getParser(getMimetype(), true, viewId);
if (null == parser) {
throw new ServletException(Messages.getMessage(
Messages.PARSER_NOT_INSTANTIATED_ERROR, contentType));
@@ -231,7 +244,7 @@
&& null != characterEncoding) {
contentType += ";charset=" + characterEncoding;
}
- parser = getParser(contentType, false);
+ parser = getParser(contentType, false, viewId);
response.setContentType(contentType);
}
// null or unsupported content type
@@ -332,7 +345,7 @@
protected abstract void reuseParser(HtmlParser parser);
- protected abstract HtmlParser getParser(String mimetype, boolean isAjax);
+ protected abstract HtmlParser getParser(String mimetype, boolean isAjax, String viewId);
/**
* @param publicid
Added: trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/xmlfilter/ConfigurableFilter.java
===================================================================
--- trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/xmlfilter/ConfigurableFilter.java (rev 0)
+++ trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/xmlfilter/ConfigurableFilter.java 2007-07-07 01:16:15 UTC (rev 302)
@@ -0,0 +1,20 @@
+/**
+ *
+ */
+package org.ajax4jsf.framework.ajax.xmlfilter;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class ConfigurableFilter extends BaseFilter {
+
+ /**
+ *
+ */
+ public ConfigurableFilter() {
+ xmlFilter = new ConfigurableXMLFilter();
+ xmlFilter.setFilter(this);
+ }
+
+}
Added: trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/xmlfilter/ConfigurableXMLFilter.java
===================================================================
--- trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/xmlfilter/ConfigurableXMLFilter.java (rev 0)
+++ trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/xmlfilter/ConfigurableXMLFilter.java 2007-07-07 01:16:15 UTC (rev 302)
@@ -0,0 +1,238 @@
+/**
+ *
+ */
+package org.ajax4jsf.framework.ajax.xmlfilter;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.EmptyStackException;
+import java.util.Properties;
+import java.util.regex.PatternSyntaxException;
+
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+
+import org.ajax4jsf.framework.ajax.xmlfilter.nekko.NekkoParser;
+import org.ajax4jsf.framework.ajax.xmlfilter.tidy.TidyParser;
+import org.ajax4jsf.framework.ajax.xmlfilter.tidy.TidyXMLFilter;
+import org.ajax4jsf.framework.util.message.Messages;
+import org.ajax4jsf.io.parser.FastHtmlParser;
+import org.apache.commons.collections.ArrayStack;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class ConfigurableXMLFilter extends BaseXMLFilter {
+
+ private static final Log log = LogFactory
+ .getLog(ConfigurableXMLFilter.class);
+
+ private static final String PARSERS_LIST_PARAMETER = "org.ajax4jsf.xmlparsers";
+
+ private static final String VIEW_ID_PATTERN_PARAMETER = "org.ajax4jsf.xmlparser.";
+
+ /**
+ * map of the parsers names and viewId patterns for all parser type.
+ */
+ private ParserConfig parsers = new TidyParserConfig();
+
+ // private ParserConfig passParserConfig = new PassParserConfig();
+
+ public void init(FilterConfig config) throws ServletException {
+ super.init(config);
+ ServletContext servletContext = config.getServletContext();
+ String parsersParameter = servletContext
+ .getInitParameter(PARSERS_LIST_PARAMETER);
+ if (null != parsersParameter) {
+ configureParsers(servletContext, parsersParameter);
+ }
+ }
+
+ /**
+ * @param servletContext
+ * @param parsersParameter
+ * @throws ServletException
+ */
+ public void configureParsers(ServletContext servletContext,
+ String parsersParameter) throws ServletException {
+ String[] parsersNames = parsersParameter.split("\\s*,\\s*");
+ for (int i = parsersNames.length - 1; i >= 0; i--) {
+ String parserName = parsersNames[i];
+ ParserConfig parserConfig;
+ if ("TIDY".equals(parserName)) {
+ parserConfig = new TidyParserConfig();
+ } else if ("NEKO".equals(parserName)) {
+ parserConfig = new NekoParserConfig();
+ } else if ("PASS".equals(parserName)) {
+ parserConfig = new PassParserConfig();
+ } else {
+ throw new ServletException(
+ "Unknown XML parser type in config parameter "
+ + parserName);
+ }
+ parserConfig.setNext(parsers);
+ if (null != servletContext) {
+ try {
+ String parserViewPattern = servletContext
+ .getInitParameter(VIEW_ID_PATTERN_PARAMETER
+ + parserName);
+ parserConfig.setPatterns(parserViewPattern);
+
+ } catch (PatternSyntaxException e) {
+ throw new ServletException("Invalid pattern for a parser "
+ + parserName + " :" + e.getMessage());
+ }
+ }
+ parsers = parserConfig;
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter#getParser(java.lang.String,
+ * boolean, java.lang.String)
+ */
+ protected HtmlParser getParser(String mimetype, boolean isAjax,
+ String viewId) {
+ HtmlParser parser = null;
+ if (isAjax || isForcexml()) {
+ parser = parsers.getParser(viewId, mimetype);
+ } else if (mimetype.startsWith("text/html")
+ || mimetype.startsWith("application/xhtml+xml")) {
+ parser = new FastHtmlParser();
+ }
+ return parser;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter#reuseParser(org.ajax4jsf.framework.ajax.xmlfilter.HtmlParser)
+ */
+ protected void reuseParser(HtmlParser parser) {
+ parsers.reuseParser(parser);
+
+ }
+
+ private static final int STACK_SIZE = 100;
+
+ private ArrayStack _xhtmlParsersPool = new ArrayStack(STACK_SIZE);
+
+ private class NekoParserConfig extends ParserConfig {
+
+ protected HtmlParser createParser(String mime) {
+ NekkoParser parser;
+ try {
+ synchronized (_xhtmlParsersPool) {
+ parser = (NekkoParser) _xhtmlParsersPool.pop();
+ }
+ } catch (EmptyStackException e) {
+ parser = new NekkoParser();
+ parser.setPublicId(getPublicid());
+ parser.setSystemid(getSystemid());
+ parser.setNamespace(getNamespace());
+ // If tidy not handle all requests, disable reorganising
+ // of html
+ // parser.setMoveElements(isForcexml());
+ }
+ // TODO - set header scripts/styles filter.
+ return parser;
+ }
+
+ boolean storeParser(HtmlParser parser) {
+ if (null != parser && parser instanceof NekkoParser) {
+ synchronized (_xhtmlParsersPool) {
+ if (_xhtmlParsersPool.size() < STACK_SIZE) {
+ ((NekkoParser) parser).reset();
+ _xhtmlParsersPool.push(parser);
+ }
+
+ }
+ return true;
+ }
+ return false;
+ }
+ }
+
+ private class TidyParserConfig extends ParserConfig {
+
+ protected HtmlParser createParser(String mime) {
+ // TODO Auto-generated method stub
+ TidyParser tidyParser = new TidyParser(getTidyProperties());
+ tidyParser.setMoveElements(isForcexml());
+ tidyParser.setMime(mime);
+ return tidyParser;
+ }
+
+ }
+
+ private class PassParserConfig extends ParserConfig {
+
+ protected HtmlParser createParser(String mime) {
+ return new FastHtmlParser();
+ }
+
+ }
+
+ private Properties _tidyProperties;
+
+ private Properties getTidyProperties() {
+ if (null == _tidyProperties) {
+ _tidyProperties = new Properties();
+ InputStream defaultprops = null;
+ InputStream props = null;
+ try {
+ defaultprops = TidyParser.class
+ .getResourceAsStream("tidy.properties");
+ if (null != defaultprops) {
+ _tidyProperties.load(defaultprops);
+ if (log.isDebugEnabled()) {
+ log.debug("default tidy parser properties loaded");
+ }
+ } else if (log.isDebugEnabled()) {
+ log.debug("No default tidy parser properties found");
+ }
+
+ // Second part - user-defined properties.
+ props = Thread.currentThread().getContextClassLoader()
+ .getResourceAsStream("tidy.properties");
+ if (null != props) {
+ _tidyProperties.load(props);
+ if (log.isDebugEnabled()) {
+ log.debug("application-specific tidy parser properties loaded");
+ }
+ }
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ log.warn(Messages
+ .getMessage(Messages.READING_TIDY_PROPERTIES_ERROR), e);
+ } finally {
+ if (null != props) {
+ try {
+ props.close();
+ } catch (IOException e) {
+ // can be ignored
+ }
+ }
+ if (null != defaultprops) {
+ try {
+ defaultprops.close();
+ } catch (IOException e) {
+ // can be ignored
+ }
+ }
+ }
+ }
+ return _tidyProperties;
+ }
+
+ public ParserConfig getParsers() {
+ return parsers;
+ }
+
+}
Modified: trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/xmlfilter/HtmlParser.java
===================================================================
--- trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/xmlfilter/HtmlParser.java 2007-07-06 14:48:03 UTC (rev 301)
+++ trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/xmlfilter/HtmlParser.java 2007-07-07 01:16:15 UTC (rev 302)
@@ -66,4 +66,6 @@
*/
public abstract void setViewState(String viewState);
+ public abstract boolean setMime(String mimeType);
+
}
\ No newline at end of file
Added: trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/xmlfilter/ParserConfig.java
===================================================================
--- trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/xmlfilter/ParserConfig.java (rev 0)
+++ trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/xmlfilter/ParserConfig.java 2007-07-07 01:16:15 UTC (rev 302)
@@ -0,0 +1,67 @@
+/**
+ *
+ */
+package org.ajax4jsf.framework.ajax.xmlfilter;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+abstract class ParserConfig {
+
+ private static final Pattern[] ALL_VIEWS_PATTERN = { Pattern.compile(".*") };
+
+ private static final Pattern SEPARATOR_PATTERN = Pattern.compile("\\s*,\\s*");
+
+ private Pattern[] patterns = ALL_VIEWS_PATTERN;
+
+ private ParserConfig next;
+
+ protected abstract HtmlParser createParser(String mimetype);
+
+ boolean storeParser(HtmlParser parser) {
+ return false;
+ }
+
+ HtmlParser getParser(String viewId, String mimetype) {
+ HtmlParser result = null;
+ for (int i = 0; i < patterns.length && null == result; i++) {
+ Matcher matcher = patterns[i].matcher(viewId);
+ if (matcher.matches()) {
+ result = createParser(mimetype);
+ }
+ }
+ if (null == result && null != next) {
+ result = next.getParser(viewId, mimetype);
+ }
+ return result;
+ }
+
+ public void reuseParser(HtmlParser parser) {
+ if (!storeParser(parser) && null != next) {
+ next.reuseParser(parser);
+ }
+ }
+
+ public ParserConfig getNext() {
+ return next;
+ }
+
+ public void setNext(ParserConfig next) {
+ this.next = next;
+ }
+
+ public void setPatterns(String patternsString) {
+ if (null != patternsString) {
+ String[] split = SEPARATOR_PATTERN.split(patternsString);
+ patterns = new Pattern[split.length];
+ for (int i = 0; i < split.length; i++) {
+ patterns[i]=Pattern.compile(split[i].trim());
+ }
+ }
+ }
+
+ public Pattern[] getPatterns() {
+ return patterns;
+ }
+
+}
\ No newline at end of file
Modified: trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/xmlfilter/nekko/NekkoParser.java
===================================================================
--- trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/xmlfilter/nekko/NekkoParser.java 2007-07-06 14:48:03 UTC (rev 301)
+++ trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/xmlfilter/nekko/NekkoParser.java 2007-07-07 01:16:15 UTC (rev 302)
@@ -108,7 +108,8 @@
*/
public NekkoParser() {
_parser=new HtmlSAXParser(getHtmlConfig());
- Properties properties = OutputPropertiesFactory.getDefaultMethodProperties(Method.XHTML);
+// Properties properties = OutputPropertiesFactory.getDefaultMethodProperties(Method.XHTML);
+ Properties properties = OutputPropertiesFactory.getDefaultMethodProperties(Method.XML);
// properties.put("encoding",_encoding);
_serializer = SerializerFactory.getSerializer(properties);
// serializer.setOutputStream(output);
@@ -641,4 +642,8 @@
_systemid = systemid;
}
+ public boolean setMime(String mimeType) {
+ return false;
+ }
+
}
Modified: trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/xmlfilter/nekko/NekkoXMLFilter.java
===================================================================
--- trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/xmlfilter/nekko/NekkoXMLFilter.java 2007-07-06 14:48:03 UTC (rev 301)
+++ trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/xmlfilter/nekko/NekkoXMLFilter.java 2007-07-07 01:16:15 UTC (rev 302)
@@ -36,7 +36,7 @@
public NekkoXMLFilter() {}
- protected HtmlParser getParser(String mimetype, boolean isAjax) {
+ protected HtmlParser getParser(String mimetype, boolean isAjax, String viewId) {
HtmlParser parser = null;
if( isAjax ){
parser = getXmlParser();
Modified: trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/xmlfilter/tidy/TidyParser.java
===================================================================
--- trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/xmlfilter/tidy/TidyParser.java 2007-07-06 14:48:03 UTC (rev 301)
+++ trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/xmlfilter/tidy/TidyParser.java 2007-07-07 01:16:15 UTC (rev 302)
@@ -322,7 +322,9 @@
// setup html output
tidy.setXHTML(false);
tidy.setXmlOut(false);
- // TODO - auto doctype ?
+ if (log.isDebugEnabled()) {
+ log.debug("Print output as ordinary HTML");
+ }
return true;
}
}
@@ -332,6 +334,9 @@
// setup xhtml output
tidy.setXHTML(true);
tidy.setXmlOut(false);
+ if (log.isDebugEnabled()) {
+ log.debug("Print output as XHTML");
+ }
return true;
}
}
@@ -344,6 +349,9 @@
tidy.setXmlPi(true);
tidy.setEscapeCdata(false);
tidy.setNumEntities(true);
+ if (log.isDebugEnabled()) {
+ log.debug("Print output as XML");
+ }
return true;
}
}
@@ -384,7 +392,7 @@
* @see org.ajax4jsf.framework.ajax.xmlfilter.HtmlParser#setDoctype(java.lang.String)
*/
public void setDoctype(String doctype) {
- tidy.setDocType(doctype);
+ tidy.setDocType("omit");//doctype);
}
/*
Modified: trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/xmlfilter/tidy/TidyXMLFilter.java
===================================================================
--- trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/xmlfilter/tidy/TidyXMLFilter.java 2007-07-06 14:48:03 UTC (rev 301)
+++ trunk/framework/src/main/java/org/ajax4jsf/framework/ajax/xmlfilter/tidy/TidyXMLFilter.java 2007-07-07 01:16:15 UTC (rev 302)
@@ -66,7 +66,7 @@
* @param string Encodings for parser
* @return
*/
- protected HtmlParser getParser(String mime, boolean isAjax) {
+ protected HtmlParser getParser(String mime, boolean isAjax, String viewId) {
// For non-ajax, parse only html types !
if (isAjax || mime.startsWith("text/html") || mime.startsWith("application/xhtml+xml")) {
if(isAjax || isForcexml()){
Modified: trunk/framework/src/main/java/org/ajax4jsf/framework/resource/InternetResourceService.java
===================================================================
--- trunk/framework/src/main/java/org/ajax4jsf/framework/resource/InternetResourceService.java 2007-07-06 14:48:03 UTC (rev 301)
+++ trunk/framework/src/main/java/org/ajax4jsf/framework/resource/InternetResourceService.java 2007-07-07 01:16:15 UTC (rev 302)
@@ -53,8 +53,8 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-
-public class InternetResourceService implements CacheLoader, CacheConfigurationLoader {
+public class InternetResourceService implements CacheLoader,
+ CacheConfigurationLoader {
private static final Log log = LogFactory
.getLog(InternetResourceService.class);
@@ -67,9 +67,9 @@
private boolean cacheEnabled = true;
private Cache cache = null;
-
- //private ServletCacheAdministrator cacheAdmin;
+ // private ServletCacheAdministrator cacheAdmin;
+
private FacesContextFactory contextFactory;
// private RenderKitFactory renderKitFactory;
@@ -78,7 +78,7 @@
private ResourceLifecycle lifecycle;
private InternetResourceBuilder resourceBuilder;
-
+
private WebXml webXml;
public InternetResourceService() {
@@ -95,18 +95,18 @@
.getInitParameter(ENABLE_CACHING_PARAMETER))) {
setCacheEnabled(false);
// this.cacheEnabled = false;
- //this.cacheAdmin = null;
+ // this.cacheAdmin = null;
} else {
- //this.cacheAdmin = ServletCacheAdministrator.getInstance(
- // servletContext, cacheProperties);
+ // this.cacheAdmin = ServletCacheAdministrator.getInstance(
+ // servletContext, cacheProperties);
try {
- CacheManager cacheManager = CacheManager.getInstance();
- Map env = new ServletContextInitMap(servletContext);
- CacheFactory cacheFactory = cacheManager.getCacheFactory(env);
- this.cache = cacheFactory.createCache(env, this, this);
- } catch (CacheException e) {
- throw new FacesException(e.getMessage(), e);
- }
+ CacheManager cacheManager = CacheManager.getInstance();
+ Map env = new ServletContextInitMap(servletContext);
+ CacheFactory cacheFactory = cacheManager.getCacheFactory(env);
+ this.cache = cacheFactory.createCache(env, this, this);
+ } catch (CacheException e) {
+ throw new FacesException(e.getMessage(), e);
+ }
}
// Create Resource-specific Faces Lifecycle instance.
lifecycleClass = servletContext
@@ -125,18 +125,22 @@
} else {
lifecycle = new ResourceLifecycle();
}
- webXml = new WebXml();
- webXml.init(servletContext,filterConfig.getFilterName());
- if (log.isDebugEnabled()) {
- log.debug("Resources service initialized");
+ // Check for existing configuration.
+ webXml = (WebXml) servletContext.getAttribute(WebXml.CONTEXT_ATTRIBUTE);
+ if (null == webXml) {
+ webXml = new WebXml();
+ webXml.init(servletContext, filterConfig.getFilterName());
+ if (log.isDebugEnabled()) {
+ log.debug("Resources service initialized");
+ }
+
}
}
public boolean serviceResource(HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse) throws ServletException,
IOException {
- String resourceKey = webXml
- .getFacesResourceKey(httpServletRequest);
+ String resourceKey = webXml.getFacesResourceKey(httpServletRequest);
if (null != resourceKey) {
serviceResource(resourceKey, httpServletRequest,
httpServletResponse);
@@ -153,8 +157,8 @@
} catch (ResourceNotFoundException e) {
throw new ServletException(e);
}
- Object resourceDataForKey = getResourceBuilder()
- .getResourceDataForKey(resourceKey);
+ Object resourceDataForKey = getResourceBuilder().getResourceDataForKey(
+ resourceKey);
if (resource.isCacheable(null) && this.cacheEnabled) {
// Test for client request modification time.
try {
@@ -162,7 +166,7 @@
.getDateHeader("If-Modified-Since");
if (ifModifiedSince >= 0) {
// Test for modification. 1000 ms due to round
- // modification
+ // modification
// time to seconds.
long lastModified = resource.getLastModified(null)
.getTime() - 1000;
@@ -179,74 +183,64 @@
e);
}
String cacheKey = resourceKey;// + "?" +
- // request.getQueryString();
+ // request.getQueryString();
// TODO - select session/application scope.
- //Cache cache = cacheAdmin.getAppScopeCache(getServletContext());
-// try {
- // TODO - use last modified/expires time
-
- CacheKey key = new CacheKey(resourceDataForKey, request, response, resource);
-
+ // Cache cache = cacheAdmin.getAppScopeCache(getServletContext());
+ // try {
+ // TODO - use last modified/expires time
+
+ CacheKey key = new CacheKey(resourceDataForKey, request, response,
+ resource);
+
CacheContent content;
- try {
- content = (CacheContent) cache
- .get(cacheKey, key);
- if (log.isDebugEnabled()) {
- log.debug(Messages.getMessage(
- Messages.GET_CONTENT_FROM_CACHE_INFO, cacheKey));
- }
- content.sendHeaders(response);
- // Correct expires date for resource.
- Date expired = resource.getExpired(null);
- if (expired != null) {
- response.setDateHeader("Expires", expired.getTime());
- } else {
- response.setDateHeader("Expires", System
- .currentTimeMillis()
- + InternetResource.DEFAULT_EXPIRE);
- }
- if (!request.getMethod().equals("HEAD")) {
- content.send(response);
- }/*
- } catch (NeedsRefreshException e) {
- try {
- if (log.isDebugEnabled()) {
- log.debug(Messages.getMessage(
- Messages.CONTENT_NOT_FOUND_ERROR, cacheKey));
- }
- CachedResourceContext context = (CachedResourceContext) sendResource(
- resource, request, response, resourceDataForKey);
- // TODO - set refresh interval ?
- cache.put(cacheKey, context.getContent());
- } catch (Exception ex) {
- //cache.cancelUpdate(cacheKey);
- log.error(
- Messages.getMessage(Messages.SEND_RESOURCE_ERROR),
- ex);
- throw new ServletException(Messages.getMessage(
- Messages.SEND_RESOURCE_ERROR_2, ex.getMessage()),
- ex);
- }
- }*/
- } catch (CacheException e) {
- log.error(
- Messages.getMessage(Messages.SEND_RESOURCE_ERROR),
- e);
- throw new ServletException(Messages.getMessage(
- Messages.SEND_RESOURCE_ERROR_2, e.getMessage()),
- e);
+ try {
+ content = (CacheContent) cache.get(cacheKey, key);
+ if (log.isDebugEnabled()) {
+ log.debug(Messages.getMessage(
+ Messages.GET_CONTENT_FROM_CACHE_INFO, cacheKey));
}
+ content.sendHeaders(response);
+ // Correct expires date for resource.
+ Date expired = resource.getExpired(null);
+ if (expired != null) {
+ response.setDateHeader("Expires", expired.getTime());
+ } else {
+ response.setDateHeader("Expires", System
+ .currentTimeMillis()
+ + InternetResource.DEFAULT_EXPIRE);
+ }
+ if (!request.getMethod().equals("HEAD")) {
+ content.send(response);
+ }/*
+ * } catch (NeedsRefreshException e) { try { if
+ * (log.isDebugEnabled()) { log.debug(Messages.getMessage(
+ * Messages.CONTENT_NOT_FOUND_ERROR, cacheKey)); }
+ * CachedResourceContext context = (CachedResourceContext)
+ * sendResource( resource, request, response,
+ * resourceDataForKey); // TODO - set refresh interval ?
+ * cache.put(cacheKey, context.getContent()); } catch
+ * (Exception ex) { //cache.cancelUpdate(cacheKey);
+ * log.error(
+ * Messages.getMessage(Messages.SEND_RESOURCE_ERROR), ex);
+ * throw new ServletException(Messages.getMessage(
+ * Messages.SEND_RESOURCE_ERROR_2, ex.getMessage()), ex); } }
+ */
+ } catch (CacheException e) {
+ log.error(Messages.getMessage(Messages.SEND_RESOURCE_ERROR), e);
+ throw new ServletException(Messages.getMessage(
+ Messages.SEND_RESOURCE_ERROR_2, e.getMessage()), e);
+ }
} else {
sendResource(resource, request, response, resourceDataForKey);
}
}
/**
- * @param resource
- * @param request
- * @param response
- * @throws IOException
- */
+ * @param resource
+ * @param request
+ * @param response
+ * @throws IOException
+ */
protected ResourceContext sendResource(InternetResource resource,
HttpServletRequest request, HttpServletResponse response,
Object data) throws IOException {
@@ -259,13 +253,13 @@
}
/**
- * @param resource
- * @param request
- * @param response
- * @return
- * @throws ServletException
- * @throws FacesException
- */
+ * @param resource
+ * @param request
+ * @param response
+ * @return
+ * @throws ServletException
+ * @throws FacesException
+ */
protected ResourceContext getResourceContext(InternetResource resource,
HttpServletRequest request, HttpServletResponse response)
throws FacesException {
@@ -285,11 +279,11 @@
}
/**
- * Get properties file from classpath
- *
- * @param name
- * @return
- */
+ * Get properties file from classpath
+ *
+ * @param name
+ * @return
+ */
protected Properties getProperties(String name) {
Properties properties = new Properties();
InputStream props = BaseFilter.class.getResourceAsStream(name);
@@ -313,27 +307,27 @@
}
/**
- * @return Returns the servletContext.
- */
+ * @return Returns the servletContext.
+ */
protected ServletContext getServletContext() {
return filterConfig.getServletContext();
}
/**
- * @return the lifecycle
- * @throws ServletException
- */
+ * @return the lifecycle
+ * @throws ServletException
+ */
protected ResourceLifecycle getLifecycle() throws FacesException {
return lifecycle;
}
/**
- * @return the contextFactory
- */
+ * @return the contextFactory
+ */
protected synchronized FacesContextFactory getContextFactory() {
if (contextFactory == null) {
- contextFactory = (FacesContextFactory) FactoryFinder
- .getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);
+ contextFactory = (FacesContextFactory) FactoryFinder
+ .getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);
}
return contextFactory;
@@ -346,36 +340,37 @@
}
/**
- * @return the resourceBuilder
- */
+ * @return the resourceBuilder
+ */
protected InternetResourceBuilder getResourceBuilder() {
if (resourceBuilder == null) {
- // Create resource builder for this filter.
- resourceBuilder = InternetResourceBuilder.getInstance();
+ // Create resource builder for this filter.
+ resourceBuilder = InternetResourceBuilder.getInstance();
}
return resourceBuilder;
}
- public Object load(Object key, Object context) throws CacheException {
- CacheKey cacheKey = (CacheKey) context;
-
- CachedResourceContext resourceContext = (CachedResourceContext) getResourceContext(cacheKey.getResource(), cacheKey.getRequest(),
- cacheKey.getResponse());
- resourceContext.setResourceData(cacheKey.getResourceData());
- try {
- getLifecycle().send(resourceContext, cacheKey.getResource());
- } catch (IOException e) {
- throw new CacheException(e.getMessage(), e);
- }
- resourceContext.release();
+ public Object load(Object key, Object context) throws CacheException {
+ CacheKey cacheKey = (CacheKey) context;
- // TODO - set refresh interval ?
- //cache.put(cacheKey, resourceContext.getContent());
- return resourceContext.getContent();
+ CachedResourceContext resourceContext = (CachedResourceContext) getResourceContext(
+ cacheKey.getResource(), cacheKey.getRequest(), cacheKey
+ .getResponse());
+ resourceContext.setResourceData(cacheKey.getResourceData());
+ try {
+ getLifecycle().send(resourceContext, cacheKey.getResource());
+ } catch (IOException e) {
+ throw new CacheException(e.getMessage(), e);
}
+ resourceContext.release();
- public Properties loadProperties(String name) {
- return getProperties(name);
- }
+ // TODO - set refresh interval ?
+ // cache.put(cacheKey, resourceContext.getContent());
+ return resourceContext.getContent();
+ }
+ public Properties loadProperties(String name) {
+ return getProperties(name);
+ }
+
}
Modified: trunk/framework/src/main/java/org/ajax4jsf/io/parser/FastHtmlParser.java
===================================================================
--- trunk/framework/src/main/java/org/ajax4jsf/io/parser/FastHtmlParser.java 2007-07-06 14:48:03 UTC (rev 301)
+++ trunk/framework/src/main/java/org/ajax4jsf/io/parser/FastHtmlParser.java 2007-07-07 01:16:15 UTC (rev 302)
@@ -56,6 +56,8 @@
private String viewState;
+ private String mimeType;
+
public void parse(Reader in, Writer out) throws IOException {
boolean haveHtml = false;
boolean haveHead = false;
@@ -163,7 +165,7 @@
private void writeToHead(Writer out, boolean haveHtml, boolean haveHead)
throws IOException {
if (!haveHead && !haveHtml) {
- out.write("<html>");
+ out.write("<html xmlns=\"http://www.w3.org/1999/xhtml\">");
}
if (!haveHead) {
out.write("<head>");
@@ -252,4 +254,9 @@
this.viewState = viewState;
}
+
+ public boolean setMime(String mimeType) {
+ this.mimeType=mimeType;
+ return true;
+ }
}
Added: trunk/framework/src/test/java/org/ajax4jsf/framework/ajax/xmlfilter/ConfigurableXMLFilterTestCase.java
===================================================================
--- trunk/framework/src/test/java/org/ajax4jsf/framework/ajax/xmlfilter/ConfigurableXMLFilterTestCase.java (rev 0)
+++ trunk/framework/src/test/java/org/ajax4jsf/framework/ajax/xmlfilter/ConfigurableXMLFilterTestCase.java 2007-07-07 01:16:15 UTC (rev 302)
@@ -0,0 +1,97 @@
+/**
+ *
+ */
+package org.ajax4jsf.framework.ajax.xmlfilter;
+
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+
+import org.ajax4jsf.framework.ajax.xmlfilter.nekko.NekkoParser;
+import org.ajax4jsf.io.parser.FastHtmlParser;
+
+import junit.framework.TestCase;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class ConfigurableXMLFilterTestCase extends TestCase {
+
+ ServletContext servletContext;
+
+ FilterConfig filterConfig;
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ }
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ }
+
+ /**
+ * Test method for {@link org.ajax4jsf.framework.ajax.xmlfilter.ConfigurableXMLFilter#reuseParser(org.ajax4jsf.framework.ajax.xmlfilter.HtmlParser)}.
+ * @throws ServletException
+ */
+ public void testReuseParser() throws ServletException {
+ ConfigurableXMLFilter filter = createFilter();
+ HtmlParser parser = filter.getParser("text/html", true, "/index.jsp");
+ assertNotNull(parser);
+ filter.reuseParser(parser);
+ HtmlParser reusedParser = filter.getParser("text/html", true, "/index.jsp");
+ assertSame(parser, reusedParser);
+ }
+
+ /**
+ * Test method for {@link org.ajax4jsf.framework.ajax.xmlfilter.ConfigurableXMLFilter#getParser(java.lang.String, boolean, java.lang.String)}.
+ * @throws ServletException
+ */
+ public void testGetParser() throws ServletException {
+ ConfigurableXMLFilter filter = createFilter();
+ HtmlParser parser = filter.getParser("text/html", true, "/index.jsp");
+ assertNotNull(parser);
+ assertTrue(parser instanceof NekkoParser);
+ }
+
+ /**
+ * Test method for {@link org.ajax4jsf.framework.ajax.xmlfilter.ConfigurableXMLFilter#getParser(java.lang.String, boolean, java.lang.String)}.
+ * @throws ServletException
+ */
+ public void testGetFastParser() throws ServletException {
+ ConfigurableXMLFilter filter = createFilter();
+ HtmlParser parser = filter.getParser("text/html", true, "/index.xhtml");
+ assertNotNull(parser);
+ assertTrue(parser instanceof FastHtmlParser);
+ }
+ /**
+ * @return
+ * @throws ServletException
+ */
+ private ConfigurableXMLFilter createFilter() throws ServletException {
+ ConfigurableXMLFilter filter = new ConfigurableXMLFilter();
+ filter.configureParsers(servletContext, "PASS,NEKO");
+ filter.getParsers().setPatterns(".*\\.xhtml");
+ return filter;
+ }
+
+ /**
+ * Test method for {@link org.ajax4jsf.framework.ajax.xmlfilter.ConfigurableXMLFilter#configureParsers(javax.servlet.ServletContext, java.lang.String)}.
+ * @throws ServletException
+ */
+ public void testConfigureParsers() throws ServletException {
+ ConfigurableXMLFilter filter = new ConfigurableXMLFilter();
+ filter.configureParsers(servletContext, "PASS");
+ ParserConfig parsers = filter.getParsers();
+ HtmlParser createParser = parsers.createParser(null);
+ assertNotNull(createParser);
+ assertTrue(createParser instanceof FastHtmlParser);
+ }
+
+}
Added: trunk/framework/src/test/java/org/ajax4jsf/framework/ajax/xmlfilter/ParterConfigTestCase.java
===================================================================
--- trunk/framework/src/test/java/org/ajax4jsf/framework/ajax/xmlfilter/ParterConfigTestCase.java (rev 0)
+++ trunk/framework/src/test/java/org/ajax4jsf/framework/ajax/xmlfilter/ParterConfigTestCase.java 2007-07-07 01:16:15 UTC (rev 302)
@@ -0,0 +1,156 @@
+/**
+ *
+ */
+package org.ajax4jsf.framework.ajax.xmlfilter;
+
+import java.util.regex.Pattern;
+
+import org.ajax4jsf.io.parser.FastHtmlParser;
+
+import junit.framework.TestCase;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class ParterConfigTestCase extends TestCase {
+
+ private ParserConfig testConfig;
+
+ private boolean parserCreated;
+
+ private boolean parserReused;
+
+ private String mimetype;
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ parserCreated = false;
+ parserReused = false;
+ testConfig = new ParserConfig(){
+
+ protected HtmlParser createParser(String mime) {
+ parserCreated = true;
+ return new FastHtmlParser();
+ }
+
+ boolean storeParser(HtmlParser parser) {
+ parserReused = true;
+ return super.storeParser(parser);
+ }
+
+ };
+ }
+
+ /* (non-Javadoc)
+ * @see junit.framework.TestCase#tearDown()
+ */
+ protected void tearDown() throws Exception {
+ testConfig = null;
+ super.tearDown();
+ }
+
+ /**
+ * Test method for {@link org.ajax4jsf.framework.ajax.xmlfilter.ParserConfig#getParser(java.lang.String, String)}.
+ */
+ public void testGetParser() {
+ HtmlParser parser = testConfig.getParser("/default.jsp", mimetype);
+ assertNotNull(parser);
+ assertTrue(parserCreated);
+ }
+
+ /**
+ * Test method for {@link org.ajax4jsf.framework.ajax.xmlfilter.ParserConfig#getParser(java.lang.String, String)}.
+ */
+ public void testGetParserWithPattern() {
+ testConfig.setPatterns(".*\\.jsp");
+ HtmlParser parser = testConfig.getParser("/default.jsp", mimetype);
+ assertNotNull(parser);
+ assertTrue(parserCreated);
+ }
+
+ /**
+ * Test method for {@link org.ajax4jsf.framework.ajax.xmlfilter.ParserConfig#getParser(java.lang.String, String)}.
+ */
+ public void testGetParserWithPattern1() {
+ testConfig.setPatterns(".*\\.xhtml");
+ HtmlParser parser = testConfig.getParser("/default.jsp", mimetype);
+ assertNull(parser);
+ assertFalse(parserCreated);
+ }
+
+ /**
+ * Test method for {@link org.ajax4jsf.framework.ajax.xmlfilter.ParserConfig#getParser(java.lang.String, String)}.
+ */
+ public void testGetParserWithPatternAndChain() {
+ ParserConfig firstConfig = new ParserConfig(){
+
+ protected HtmlParser createParser(String mime) {
+ return null;
+ }
+
+ };
+ firstConfig.setPatterns("^.*\\.jspx$");
+ firstConfig.setNext(testConfig);
+ testConfig.setPatterns(".*\\.xhtml,.*\\.jsp");
+ HtmlParser parser = firstConfig.getParser("/default.jsp", mimetype);
+ assertNotNull(parser);
+ assertTrue(parserCreated);
+ }
+ /**
+ * Test method for {@link org.ajax4jsf.framework.ajax.xmlfilter.ParserConfig#reuseParser(org.ajax4jsf.framework.ajax.xmlfilter.HtmlParser)}.
+ */
+ public void testReuseParserChain() {
+ ParserConfig firstConfig = new ParserConfig(){
+
+ protected HtmlParser createParser(String mime) {
+ return null;
+ }
+
+ };
+ firstConfig.setNext(testConfig);
+ HtmlParser parser = testConfig.getParser("/default.jsp", mimetype);
+ firstConfig.reuseParser(parser);
+ assertTrue(parserReused);
+ }
+
+ /**
+ * Test method for {@link org.ajax4jsf.framework.ajax.xmlfilter.ParserConfig#setPatterns(java.lang.String)}.
+ */
+ public void testSetPatterns() {
+ testConfig.setPatterns("a.*");
+ Pattern[] patterns = testConfig.getPatterns();
+ assertEquals(1, patterns.length);
+ assertTrue(patterns[0].matcher("abb").matches());
+ assertFalse(patterns[0].matcher("bbb").matches());
+ }
+
+ /**
+ * Test method for {@link org.ajax4jsf.framework.ajax.xmlfilter.ParserConfig#setPatterns(java.lang.String)}.
+ */
+ public void testSetPatterns2() {
+ testConfig.setPatterns("a.*,b.*");
+ Pattern[] patterns = testConfig.getPatterns();
+ assertEquals(2, patterns.length);
+ assertTrue(patterns[0].matcher("abb").matches());
+ assertFalse(patterns[0].matcher("bbb").matches());
+ assertTrue(patterns[1].matcher("bbb").matches());
+ assertFalse(patterns[1].matcher("abb").matches());
+ }
+
+ /**
+ * Test method for {@link org.ajax4jsf.framework.ajax.xmlfilter.ParserConfig#setPatterns(java.lang.String)}.
+ */
+ public void testSetPatterns3() {
+ testConfig.setPatterns(" a.*\t, b.* ");
+ Pattern[] patterns = testConfig.getPatterns();
+ assertEquals(2, patterns.length);
+ assertTrue(patterns[0].matcher("abb").matches());
+ assertFalse(patterns[0].matcher("bbb").matches());
+ assertTrue(patterns[1].matcher("bbb").matches());
+ assertFalse(patterns[1].matcher("abb").matches());
+ }
+}
Added: trunk/samples/useCases/src/main/java/beans/performance/Data.java
===================================================================
--- trunk/samples/useCases/src/main/java/beans/performance/Data.java (rev 0)
+++ trunk/samples/useCases/src/main/java/beans/performance/Data.java 2007-07-07 01:16:15 UTC (rev 302)
@@ -0,0 +1,40 @@
+package beans.performance;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class Data {
+ private Collection<Map<String,String>> buffer = null;
+ public Collection<Map<String,String>> getData() {
+ if (buffer==null) {
+ List<Map<String,String>> ret = new ArrayList<Map<String,String>>();
+ for (int row = 0;row<500;row++) {
+ Map<String, String> rowData = new HashMap<String,String>();
+ for (int col=0; col<5; col++) {
+ String key = "col"+col;
+ String data = "column data ["+row+"]["+col+"]";
+ rowData.put(key,data);
+ ret.add(rowData);
+ }
+ }
+ buffer = ret;
+ return ret;
+ } else {
+ return buffer;
+ }
+ }
+ private String param;
+ public String getParam() {
+ return param;
+ }
+ public void setParam(String param) {
+ this.param = param;
+ }
+ public String action() {
+ System.out.println("param="+param);
+ return null;
+ }
+}
Added: trunk/samples/useCases/src/main/webapp/META-INF/MANIFEST.MF
===================================================================
--- trunk/samples/useCases/src/main/webapp/META-INF/MANIFEST.MF (rev 0)
+++ trunk/samples/useCases/src/main/webapp/META-INF/MANIFEST.MF 2007-07-07 01:16:15 UTC (rev 302)
@@ -0,0 +1,2 @@
+Manifest-Version: 1.0
+
Modified: trunk/samples/useCases/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/samples/useCases/src/main/webapp/WEB-INF/faces-config.xml 2007-07-06 14:48:03 UTC (rev 301)
+++ trunk/samples/useCases/src/main/webapp/WEB-INF/faces-config.xml 2007-07-07 01:16:15 UTC (rev 302)
@@ -32,6 +32,11 @@
<managed-bean-class>control.test.ControlBackingBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
+ <managed-bean>
+ <managed-bean-name>performance</managed-bean-name>
+ <managed-bean-class>beans.performance.Data</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
<navigation-rule>
<navigation-case>
Modified: trunk/samples/useCases/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/samples/useCases/src/main/webapp/WEB-INF/web.xml 2007-07-06 14:48:03 UTC (rev 301)
+++ trunk/samples/useCases/src/main/webapp/WEB-INF/web.xml 2007-07-07 01:16:15 UTC (rev 302)
@@ -34,12 +34,24 @@
<param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
<param-value>false</param-value>
</context-param>
+ <context-param>
+ <param-name>org.ajax4jsf.xmlparsers</param-name>
+ <param-value>PASS,NEKO,TIDY</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.ajax4jsf.xmlparser.PASS</param-name>
+ <param-value>/pages/performance.xhtml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>org.ajax4jsf.xmlparser.NEKO</param-name>
+ <param-value>/pages/repeat.xhtml</param-value>
+ </context-param>
<!--
-->
<filter>
<display-name>Ajax4jsf Filter</display-name>
<filter-name>ajax4jsf</filter-name>
- <filter-class>org.ajax4jsf.FastFilter</filter-class>
+ <filter-class>org.ajax4jsf.Filter</filter-class>
</filter>
<filter-mapping>
<filter-name>ajax4jsf</filter-name>
Added: trunk/samples/useCases/src/main/webapp/pages/performance.xhtml
===================================================================
--- trunk/samples/useCases/src/main/webapp/pages/performance.xhtml (rev 0)
+++ trunk/samples/useCases/src/main/webapp/pages/performance.xhtml 2007-07-07 01:16:15 UTC (rev 302)
@@ -0,0 +1,55 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+ xmlns:c="http://java.sun.com/jsp/jstl/core"
+ xmlns:rich="http://richfaces.ajax4jsf.org/rich"
+ >
+ <head>
+ </head>
+ <body>
+ <h:form>
+ <h:dataTable id="tbl" value="#{performance.data}" var="row">
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="Col0" />
+ </f:facet>
+ <h:outputText value="#{row.col0}" />
+ <a4j:commandLink action="#{performance.action}" value="command" reRender="tbl">
+ <a4j:actionparam value="#{row.col0}" name="param" assignTo="#{performance.param}"/>
+ </a4j:commandLink>
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="Col1" />
+ </f:facet>
+ <h:outputText value="#{row.col1}" />
+ <a4j:commandLink action="#{performance.action}" value="command" reRender="tbl">
+ <a4j:actionparam value="#{row.col1}" name="param" assignTo="#{performance.param}"/>
+ </a4j:commandLink>
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="Col2" />
+ </f:facet>
+ <h:outputText value="#{row.col2}" />
+ <a4j:commandLink action="#{performance.action}" value="command" reRender="tbl">
+ <a4j:actionparam value="#{row.col2}" name="param" assignTo="#{performance.param}"/>
+ </a4j:commandLink>
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="Col3" />
+ </f:facet>
+ <h:outputText value="#{row.col3}" />
+ <a4j:commandLink action="#{performance.action}" value="command" reRender="tbl">
+ <a4j:actionparam value="#{row.col3}" name="param" assignTo="#{performance.param}"/>
+ </a4j:commandLink>
+ </h:column>
+ </h:dataTable>
+ </h:form>
+ <a4j:log hotkey="M"/>
+ </body>
+</html>
\ No newline at end of file
16 years, 10 months
JBoss Ajax4JSF SVN: r301 - trunk/docs/userguide/en/src/main/docbook/included.
by ajax4jsf-svn-commits@lists.jboss.org
Author: vkorluzhenko
Date: 2007-07-06 10:48:03 -0400 (Fri, 06 Jul 2007)
New Revision: 301
Modified:
trunk/docs/userguide/en/src/main/docbook/included/log.xml
Log:
http://jira.jboss.org/jira/browse/RF-414
Modified: trunk/docs/userguide/en/src/main/docbook/included/log.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/log.xml 2007-07-05 08:35:27 UTC (rev 300)
+++ trunk/docs/userguide/en/src/main/docbook/included/log.xml 2007-07-06 14:48:03 UTC (rev 301)
@@ -60,5 +60,9 @@
attribute on the component. </para>
<para>Example:</para><programlisting role="XML"><![CDATA[<a4j:log level="ALL" popup="false" width="400" height="200"/>]]></programlisting>
<para>The component defined this way is decoded on a page as <emphasis role="bold"><property><div></property></emphasis> inside a page, where all the information beginning with informational message is generated.</para>
+ <note>
+ <title>Note:</title>
+ <para><emphasis role="bold"><a4j:log></emphasis> is getting renewed automatically after execution of ajax requests. Don't renew <emphasis role="bold"><a4j:log></emphasis> by using reRender!</para>
+ </note>
</section>
</chapter>
16 years, 10 months
JBoss Ajax4JSF SVN: r300 - trunk/docs/userguide/en/src/main/docbook/modules.
by ajax4jsf-svn-commits@lists.jboss.org
Author: smukhina
Date: 2007-07-05 04:35:27 -0400 (Thu, 05 Jul 2007)
New Revision: 300
Modified:
trunk/docs/userguide/en/src/main/docbook/modules/AUGWADParams.xml
trunk/docs/userguide/en/src/main/docbook/modules/a4jUGfaq.xml
trunk/docs/userguide/en/src/main/docbook/modules/a4jUGintro.xml
trunk/docs/userguide/en/src/main/docbook/modules/a4jUGstart.xml
Log:
http://jira.jboss.org/jira/browse/EXIN-373
italic font style is added
Modified: trunk/docs/userguide/en/src/main/docbook/modules/AUGWADParams.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/modules/AUGWADParams.xml 2007-07-05 08:31:09 UTC (rev 299)
+++ trunk/docs/userguide/en/src/main/docbook/modules/AUGWADParams.xml 2007-07-05 08:35:27 UTC (rev 300)
@@ -30,14 +30,14 @@
<entry>org.ajax4jsf.LOGFILE</entry>
<entry>none</entry>
<entry>
- The is an URL to an application or a container log file (if possible). If this parameter is set, a content from the given URL will be shown on a <emphasis role="italic"><property>Debug</property></emphasis> error page in the <emphasis role="italic"><property>iframe</property></emphasis> window
+ The is an URL to an application or a container log file (if possible). If this parameter is set, a content from the given URL will be shown on a <emphasis ><property>Debug</property></emphasis> error page in the <emphasis ><property>iframe</property></emphasis> window
</entry>
</row>
<row>
<entry>org.ajax4jsf.VIEW_HANDLERS</entry>
<entry>none</entry>
<entry>
- Is a comma-separated list of custom <emphasis role="italic"><property>"ViewHandler"</property></emphasis> instances
+ Is a comma-separated list of custom <emphasis ><property>"ViewHandler"</property></emphasis> instances
for inserting in chain. Handlers are inserted in the given order. So must be used if the order of them is important.
No need to define ajax4jsf handler there, as it will be always the first.
</entry>
@@ -46,14 +46,14 @@
<entry> org.ajax4jsf.CONTROL_COMPONENTS</entry>
<entry>none</entry>
<entry>
- Is a comma-separated list of names for a component as a special control case, such as messages bundle loader, alias bean components, etc. Is a type of component got by a reflection from the static field <emphasis role="italic"><property>COMPONENT_TYPE</property></emphasis>. For components with such types encode methods always are called in rendering AJAX responses, even if a component isn't in an updated part
+ Is a comma-separated list of names for a component as a special control case, such as messages bundle loader, alias bean components, etc. Is a type of component got by a reflection from the static field <emphasis ><property>COMPONENT_TYPE</property></emphasis>. For components with such types encode methods always are called in rendering AJAX responses, even if a component isn't in an updated part
</entry>
</row>
<row>
<entry>org.ajax4jsf.ENCRYPT_RESOURCE_DATA</entry>
<entry>false</entry>
<entry>
- For generated resources, such as encrypt generation data, it's encoded in the resource URL. For example, URL for an image generated from the <emphasis role="italic"><property>mediaOutput</property></emphasis> component contains a name of a generation method, since for a hacker attack, it is possible to create a request for any JSF baked beans or other attributes. To prevent such attacks, set this parameter to true in critical applications (works with JRE > 1.4)
+ For generated resources, such as encrypt generation data, it's encoded in the resource URL. For example, URL for an image generated from the <emphasis ><property>mediaOutput</property></emphasis> component contains a name of a generation method, since for a hacker attack, it is possible to create a request for any JSF baked beans or other attributes. To prevent such attacks, set this parameter to true in critical applications (works with JRE > 1.4)
</entry>
</row>
<row>
@@ -66,7 +66,7 @@
<row>
<entry>org.ajax4jsf.SKIN</entry>
<entry>DEFAULT</entry>
- <entry>Is a name of a skin used in an application. It can be a literal string with a skin name, or the <emphasis role="italic"><property>EL</property></emphasis> expression (#{...}) pointed to a <emphasis role="italic"><property>String</property></emphasis> property (skin name) or a property with the type org.ajax4jsf.framework.skin. Skin in last case, this instance will be used as a current skin
+ <entry>Is a name of a skin used in an application. It can be a literal string with a skin name, or the <emphasis ><property>EL</property></emphasis> expression (#{...}) pointed to a <emphasis ><property>String</property></emphasis> property (skin name) or a property with the type org.ajax4jsf.framework.skin. Skin in last case, this instance will be used as a current skin
</entry>
</row>
<row>
@@ -107,7 +107,7 @@
<entry>forceparser</entry>
<entry>true</entry>
<entry>
- Forces parsing by a filter <emphasis role="italic"><property>HTML</property></emphasis> syntax checker on any JSF page. If false, only AJAX responses are parsed to syntax check and conversion to well-formed XML. Setting to false improve performance, but can provide visual effects on AJAX updates
+ Forces parsing by a filter <emphasis ><property>HTML</property></emphasis> syntax checker on any JSF page. If false, only AJAX responses are parsed to syntax check and conversion to well-formed XML. Setting to false improve performance, but can provide visual effects on AJAX updates
</entry>
</row>
</tbody>
Modified: trunk/docs/userguide/en/src/main/docbook/modules/a4jUGfaq.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/modules/a4jUGfaq.xml 2007-07-05 08:31:09 UTC (rev 299)
+++ trunk/docs/userguide/en/src/main/docbook/modules/a4jUGfaq.xml 2007-07-05 08:35:27 UTC (rev 300)
@@ -28,7 +28,7 @@
<title>How to check sending request conditions? Custom JavaScript before request
"OnSubmit" attribute.</title>
- <para> To check on the client some terms of request sending, the <emphasis role="italic">
+ <para> To check on the client some terms of request sending, the <emphasis >
<property>"onSubmit</property>
</emphasis>" attribute is added to all components, which may cause the request. </para>
<para>
@@ -37,17 +37,17 @@
<programlisting role="XML"><![CDATA[<h:inputText id="i" value="#{beanText.kennung}">
<a4j:support event="onfocus" onsubmit="doSomething();" reRender="panelToReRender"/>
</h:inputText>]]></programlisting>
- <para> So in this case "<emphasis role="italic"
+ <para> So in this case "<emphasis
><property>doSomething()</property>"</emphasis> function is executed before
the AJAX request. </para>
<para> Besides, if this function returns "false", AJAX request
isn't fired. </para>
<note>
<title>Note:</title>
- <para>Behavior of our <emphasis role="italic">
+ <para>Behavior of our <emphasis >
<property>"onsubmit"</property>
</emphasis>slightly differs from the standard one. Do not return <emphasis
- role="italic">
+ >
<property>"true"</property>
</emphasis> if you want to fire the request - because <emphasis role="bold">
<property><xxx><a4j:support
@@ -56,7 +56,7 @@
</emphasis> is transformed into <xxx onclick="return true;
A4J.Submit(.... );" > and the request isn't fired also in
this case (but the standard event processing fired). You must only return <emphasis
- role="italic">
+ >
<property>"false"</property>
</emphasis> if your conditions weren't completed or perform some actions
(if needed) without any returns in case you need to fire it. </para>
@@ -70,15 +70,15 @@
(..oncomplete :anotherFunction(this)..), it places (oncomplete:
function(){anotherFunction(this);}..) in anonymous function, to allow put
"chain" of statements in attribute. </para>
- <para> Since, <emphasis role="italic">
+ <para> Since, <emphasis >
<property>"this"</property>
</emphasis> keyword will point to a parameters map instead of a control element as it
- was before. You may use <emphasis role="italic">
+ was before. You may use <emphasis >
<property>document.findElementById()</property>
</emphasis>to get references to this object after a request is processed as when a page
is updated in AJAX you will have reference to a control, removed from a DOM tree. </para>
<para> Or, if you are sure that your element is not updated, you can add <emphasis
- role="italic">
+ >
<property>"onsubmit"</property>
</emphasis> in <emphasis role="bold">
<property><a4j:support></property>
@@ -103,13 +103,13 @@
<section id="InvokeOnComponentUsingWithJSF1.2">
<?dbhtml filename="InvokeOnComponentUsingWithJSF1.2.html"?>
<title>Is it possible to use InvokeOnComponent with JSF 1.2?</title>
- <para> Ajax4jsf currently does not use <emphasis role="italic">invokeOnComponent</emphasis>
+ <para> Ajax4jsf currently does not use <emphasis >invokeOnComponent</emphasis>
because of the 2 reasons: </para>
<itemizedlist>
<listitem> Compatibility with JSF 1.1 and MyFaces applications is kept, due to a big
amount of code used in corporate applications. </listitem>
<listitem>
- <emphasis role="italic"> InvokeOnComponent</emphasis> works with already known
+ <emphasis > InvokeOnComponent</emphasis> works with already known
clientId, and works fine for communication between widget and backed component, or
updates content of already rendered component. But there are some troubles to use
this method for more complex use-cases implemented in Ajax4jsf, as there is a choice
@@ -216,14 +216,14 @@
<?dbhtml filename="IgnoreDupResponsesAndRequestDelay.html"?>
<title>How to use IgnoreDupResponses and requestDelay?</title>
- <para>The <emphasis role="italic">
+ <para>The <emphasis >
<property>"IgnoreDupResponses"</property>
</emphasis> attribute appeared from 1.0.4 RC1 version and is used on the client for
response ignoring after an AJAX request if a newer request has been already sent. <para>
The additional information could be found <ulink
url="http://jboss.com/index.html?module=bb&op=viewtopic&t=105766"
>here</ulink>. </para>
- <emphasis role="italic">
+ <emphasis >
<property>"RequestDelay"</property>
</emphasis> attribute also defines the client behavior. It sets the time delay, after
which another request could be sent, all other requests are taken away from a queue
@@ -245,7 +245,7 @@
<section id="EventQueueUsage">
<?dbhtml filename="EventQueueUsage.html"?>
<title>How to use "EventQueue" attribute?</title>
- <para>The <emphasis role="italic">
+ <para>The <emphasis >
<property>"EventQueue"</property>
</emphasis> attribute defines the query name where the requests are saved before their
sending to the server. The queue is created for redundant requests deleting during
Modified: trunk/docs/userguide/en/src/main/docbook/modules/a4jUGintro.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/modules/a4jUGintro.xml 2007-07-05 08:31:09 UTC (rev 299)
+++ trunk/docs/userguide/en/src/main/docbook/modules/a4jUGintro.xml 2007-07-05 08:35:27 UTC (rev 300)
@@ -52,7 +52,7 @@
<title>Easily generate images on-the-fly</title>
<para>Resource framework can generate images on-the-fly so that it becomes possible to
create images using the familiar approach of the
- <emphasis role="italic"><property>"Java Graphics2D"</property></emphasis> library.</para>
+ <emphasis ><property>"Java Graphics2D"</property></emphasis> library.</para>
</formalpara>
<formalpara>
<title>Create a modern rich user interface look-and-feel with skins-based technology</title>
Modified: trunk/docs/userguide/en/src/main/docbook/modules/a4jUGstart.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/modules/a4jUGstart.xml 2007-07-05 08:31:09 UTC (rev 299)
+++ trunk/docs/userguide/en/src/main/docbook/modules/a4jUGstart.xml 2007-07-05 08:35:27 UTC (rev 300)
@@ -35,14 +35,14 @@
<itemizedlist>
<listitem>
- Unzip <emphasis role="italic">
+ Unzip <emphasis >
<property>"ajax4jsf.zip"</property>
</emphasis> file to the chosen folder.
</listitem>
<listitem>
- Copy <emphasis role="italic"><property>"ajax4jsf.jar"</property></emphasis> and <emphasis role="italic"><property>"oscache-2.3.2.jar"</property></emphasis> files into the <emphasis role="italic">
+ Copy <emphasis ><property>"ajax4jsf.jar"</property></emphasis> and <emphasis ><property>"oscache-2.3.2.jar"</property></emphasis> files into the <emphasis >
<property>"WEB-INF/lib"</property>
</emphasis> folder of your application.
@@ -53,7 +53,7 @@
</para>
</note>
<listitem>
- Add the following content into the <emphasis role="italic">
+ Add the following content into the <emphasis >
<property>"WEB-INF/web.xml"</property>
</emphasis> file of your application:
@@ -71,7 +71,7 @@
</filter-mapping>]]></programlisting>
<note>
<title>Note:</title>
- <para>You can copy and paste the above text from the <emphasis role="italic">
+ <para>You can copy and paste the above text from the <emphasis >
<property>"README.txt"</property>
</emphasis> file.</para>
</note>
@@ -135,15 +135,15 @@
text field pointed to our managed bean property contains up-to-date value of our input.
</para>
<para>
- The value of <emphasis role="italic"><property>"reRender"</property></emphasis> attribute of the <emphasis role="bold">
+ The value of <emphasis ><property>"reRender"</property></emphasis> attribute of the <emphasis role="bold">
<property><a4j:support></property>
</emphasis> tag defines which part(s) of our
page is (are) to be updated. In this case, the only part of the page to
update is the <emphasis role="bold">
<property><h:outputText></property>
- </emphasis> tag because its ID value matches to the value of <emphasis role="italic"><property>"reRender"</property></emphasis>
+ </emphasis> tag because its ID value matches to the value of <emphasis ><property>"reRender"</property></emphasis>
attribute. As you see, it's not difficult to update multiple elements on the page, only list their IDs
- as the value of <emphasis role="italic"><property>"reRender"</property></emphasis>.
+ as the value of <emphasis ><property>"reRender"</property></emphasis>.
</para>
</section>
<section id="DataBean">
16 years, 10 months
JBoss Ajax4JSF SVN: r299 - trunk/docs/userguide/en/src/main/docbook/included.
by ajax4jsf-svn-commits@lists.jboss.org
Author: smukhina
Date: 2007-07-05 04:31:09 -0400 (Thu, 05 Jul 2007)
New Revision: 299
Modified:
trunk/docs/userguide/en/src/main/docbook/included/form.xml
trunk/docs/userguide/en/src/main/docbook/included/log.xml
trunk/docs/userguide/en/src/main/docbook/included/mediaOutput.xml
trunk/docs/userguide/en/src/main/docbook/included/outputPanel.xml
trunk/docs/userguide/en/src/main/docbook/included/page.xml
trunk/docs/userguide/en/src/main/docbook/included/poll.xml
trunk/docs/userguide/en/src/main/docbook/included/region.xml
trunk/docs/userguide/en/src/main/docbook/included/repeat.xml
trunk/docs/userguide/en/src/main/docbook/included/status.xml
trunk/docs/userguide/en/src/main/docbook/included/support.xml
Log:
http://jira.jboss.com/jira/browse/EXIN-373
italic font style is added
Modified: trunk/docs/userguide/en/src/main/docbook/included/form.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/form.xml 2007-07-05 08:23:01 UTC (rev 298)
+++ trunk/docs/userguide/en/src/main/docbook/included/form.xml 2007-07-05 08:31:09 UTC (rev 299)
@@ -50,9 +50,9 @@
<section>
<title>Key attributes and ways of usage</title>
<para>The difference with the original component is that all hidden fields required for command links are always rendered and it doesn't depend on links rendering on the initial page. It solves the problem with invalid links that weren't rendered on a page immediately, but after some AJAX request.</para>
- <para>Beginning with release 1.0.5 additional attributes that make this form variant universal have appeared. With a new attribute definition as ajax=<emphasis role="italic">
+ <para>Beginning with release 1.0.5 additional attributes that make this form variant universal have appeared. With a new attribute definition as ajax=<emphasis >
<property>"true"</property>
- </emphasis>, it becomes possible to set AJAX submission way for any components inside, i.e. not a page URL is used as an <emphasis role="italic">
+ </emphasis>, it becomes possible to set AJAX submission way for any components inside, i.e. not a page URL is used as an <emphasis >
<property>"action"</property>
</emphasis> attribute, but the javascript:A4J.AJAX.Submit(...) call. In this case, rendering is defined as reRender=list of Ids for the form element itself.</para>
<para>Example</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/log.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/log.xml 2007-07-05 08:23:01 UTC (rev 298)
+++ trunk/docs/userguide/en/src/main/docbook/included/log.xml 2007-07-05 08:31:09 UTC (rev 299)
@@ -46,15 +46,15 @@
<section>
<title>Key attributes and ways of usage</title>
<para>Usage of the appropriate component attributes could change a representation level of debug information as well as the hot key for a window opening.</para>
- <para>The hot key could be changed with the <emphasis role="italic">
+ <para>The hot key could be changed with the <emphasis >
<property>"hotkey"</property>
</emphasis>
attribute, where it's necessary to define one letter that together with "CTRL+SHIFT" opens a window.</para>
- <para>The <emphasis role="italic">
+ <para>The <emphasis >
<property>"level"</property>
</emphasis>
attribute with several possible values (FATAL, ERROR, WARN, INFO, ALL) could change a logging level.</para>
- <para>The log could be generated not only in a new window, but also on the current page in a separate <emphasis role="bold"><property><div></property></emphasis>, this is also controlled with the <emphasis role="italic">
+ <para>The log could be generated not only in a new window, but also on the current page in a separate <emphasis role="bold"><property><div></property></emphasis>, this is also controlled with the <emphasis >
<property>"popup"</property>
</emphasis>
attribute on the component. </para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/mediaOutput.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/mediaOutput.xml 2007-07-05 08:23:01 UTC (rev 298)
+++ trunk/docs/userguide/en/src/main/docbook/included/mediaOutput.xml 2007-07-05 08:31:09 UTC (rev 299)
@@ -68,7 +68,7 @@
<para>As it was shown in the example above there are two main components:</para>
<itemizedlist>
<listitem>
- createContent specifies a method accepting 2 parameters. The first (of java.io.OutputStream type) defines a stream, where any binary data is output. The second (of java.lang.Object type) contains deserialized object with data specified in the <emphasis role="italic">
+ createContent specifies a method accepting 2 parameters. The first (of java.io.OutputStream type) defines a stream, where any binary data is output. The second (of java.lang.Object type) contains deserialized object with data specified in the <emphasis >
<property>"value"</property>
</emphasis> attribute.
</listitem>
Modified: trunk/docs/userguide/en/src/main/docbook/included/outputPanel.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/outputPanel.xml 2007-07-05 08:23:01 UTC (rev 298)
+++ trunk/docs/userguide/en/src/main/docbook/included/outputPanel.xml 2007-07-05 08:31:09 UTC (rev 299)
@@ -106,13 +106,13 @@
</h:panelGrid>
</a4j:outputPanel>
]]></programlisting>
- <para>As you see, the code is very similar to the one shown above, but <emphasis role="italic"><property>"reRender "</property></emphasis> attribute refers directly to the updating panelGrid and not to the framing outputPanel, and it's more semantically correct.</para>
+ <para>As you see, the code is very similar to the one shown above, but <emphasis ><property>"reRender "</property></emphasis> attribute refers directly to the updating panelGrid and not to the framing outputPanel, and it's more semantically correct.</para>
<para><emphasis role="bold"><property><a4j:outPanel></property></emphasis> should be used for non-JSF component part framing, which is to be updated on Ajax response, as Ajax4jsf specifies the list of updating areas as a list of an existing JSF component. </para>
<para>On default non-JSF context isn't saved in a component tree, but is rendered anew every time. To accelerate the processing speed and Ajax response input speed, Ajax4jsf saves non-JSF context in a component tree on default. This option could be canceled by keepTransient attribute that cancels transient flag forced setting for child components. This flag setting keeps the current value set by child components.</para>
<para>Note: In JSF 1.1 implementation and lower, where non-JSF context should be framed with the "f:verbatim" attribute, <emphasis role="bold">
<property><a4j:outputPanel></property>
</emphasis> doesn't improve this JSF implementation option in any way, so you still have to use this tag where it's necessary without Ajax4jsf usage. </para>
- <para>Ajax4jsf allows setting Ajax responses rendering directly basing on component tree nodes without referring to the JSP (XHTML) page code. It could be defined by selfRendered attribute setting to <emphasis role="italic">
+ <para>Ajax4jsf allows setting Ajax responses rendering directly basing on component tree nodes without referring to the JSP (XHTML) page code. It could be defined by selfRendered attribute setting to <emphasis >
<property>"true"</property>
</emphasis>
on <emphasis role="bold">
Modified: trunk/docs/userguide/en/src/main/docbook/included/page.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/page.xml 2007-07-05 08:23:01 UTC (rev 298)
+++ trunk/docs/userguide/en/src/main/docbook/included/page.xml 2007-07-05 08:31:09 UTC (rev 299)
@@ -67,12 +67,12 @@
<title>Key attributes and ways of usage</title>
<para>The component is mostly used to solve the following problem with MyFaces for erlier Ajax4gsf versions: in MyFaces <emphasis role="bold">
<property><f:view></property>
- </emphasis> doesn't get control over the "<emphasis role="italic">
+ </emphasis> doesn't get control over the "<emphasis >
<property>RENDER_RESPONSE</property>
</emphasis>" phase, thus AJAX can't get control and make a response also. To avoid this problem it was necessary to use <emphasis role="bold">
<property><a4j:page></property>
</emphasis> on the page round the AJAX updatable area. In the last versions of both frameworks the problem is successfully fixed and no <emphasis role="bold"><property><a4j:page></property></emphasis> usage is required.</para>
- <para>The component is rendered as a full HTML page template (it was shown in the example). The "<emphasis role="italic">
+ <para>The component is rendered as a full HTML page template (it was shown in the example). The "<emphasis >
<property>head</property>
</emphasis>" section is defined with the help of the corresponding facet with the name="head" and also there is an attribute with the same name for contentType definition.</para>
<para>All other component functionality is the same as of <emphasis role="bold">
Modified: trunk/docs/userguide/en/src/main/docbook/included/poll.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/poll.xml 2007-07-05 08:23:01 UTC (rev 298)
+++ trunk/docs/userguide/en/src/main/docbook/included/poll.xml 2007-07-05 08:31:09 UTC (rev 299)
@@ -38,7 +38,7 @@
]]></programlisting>
<para>The <emphasis role="bold">
<property><a4j:poll></property>
- </emphasis> component defined this way every second submits AJAX form onto the server, performs the corresponding action and renders a components with the <emphasis role="italic">
+ </emphasis> component defined this way every second submits AJAX form onto the server, performs the corresponding action and renders a components with the <emphasis >
<property>"someDataTable"</property>
</emphasis> id after a response comes back.</para>
</section>
@@ -55,7 +55,7 @@
<para>The component decodes all necessary JavaScript for time count and on the expiry of some interval for calling of a Ajax4jsf utility method for Ajax request sending (A4J.AJAX.Submit (Some request parameters)).
</para>
<para>
- The timer could be stopped or started in any time. The current state is controlled on the component with the <emphasis role="italic">
+ The timer could be stopped or started in any time. The current state is controlled on the component with the <emphasis >
<property>"enabled"</property>
</emphasis> attribute:
</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/region.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/region.xml 2007-07-05 08:23:01 UTC (rev 298)
+++ trunk/docs/userguide/en/src/main/docbook/included/region.xml 2007-07-05 08:31:09 UTC (rev 299)
@@ -93,7 +93,7 @@
<!--..Some content with HTML used ("br" ,"h1" and other tags used)-->
</a4j:region >]]></programlisting>
<para>In this case, the processing is quicker and going on without referring to a page code, but the HTML code that isn't saved in a component tree could be lost. Thus, this optimization should be very carefully performed and a usage of the additional components ajax4jsf (<emphasis role="bold"><property><a4j:outputPanel></property></emphasis>) is required. </para>
- <para>The processing could be also accelerated if a region decoded for the processing passes straight away into Encode. But to update some data out of the region or on another region, use the <emphasis role="italic">
+ <para>The processing could be also accelerated if a region decoded for the processing passes straight away into Encode. But to update some data out of the region or on another region, use the <emphasis >
<property>"renderRegionOnly"</property>
</emphasis>
attribute set to "false" ("true on default") to change this behaviour.</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/repeat.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/repeat.xml 2007-07-05 08:23:01 UTC (rev 298)
+++ trunk/docs/userguide/en/src/main/docbook/included/repeat.xml 2007-07-05 08:31:09 UTC (rev 299)
@@ -33,13 +33,13 @@
<section>
<title>Creating on a page</title>
- <para>The component definition on a page is the same as for the <emphasis role="italic">
+ <para>The component definition on a page is the same as for the <emphasis >
<property>"facelets"</property>
</emphasis> component:</para>
<programlisting role="XML"><![CDATA[<a4j:repeat id="detail" value="#{bean.props}" var="detail">
<h:outputText value="#{detail.someProperty}"/>
</a4j:repeat>]]></programlisting>
- <para>The output is generated according to a collection contained in <emphasis role="italic">
+ <para>The output is generated according to a collection contained in <emphasis >
<property>"bean.props"</property>
</emphasis> with the "detail" key passed to child components.</para>
</section>
@@ -53,7 +53,7 @@
</section>
<section>
<title>Key attributes and ways of usage</title>
- <para>The main difference of this component from iterative components of other libraries is a special <emphasis role="italic">
+ <para>The main difference of this component from iterative components of other libraries is a special <emphasis >
<property>"ajaxKeys"</property>
</emphasis> attribute. This attribute defines strings that are updated after an AJAX request. As a result it becomes easier to update several child components separately without updating the whole page.</para>
<programlisting role="JSP"><![CDATA[<a4j:poll intervall="1000" action="#{repeater.action}" reRender="list">
@@ -71,14 +71,14 @@
<tbody>
<table>
]]></programlisting>
- <para>Thus, a list with a table structure from <emphasis role="italic">
+ <para>Thus, a list with a table structure from <emphasis >
<property>"bean.props"</property>
</emphasis> is output.</para>
<para>In the above-mentioned example the component <emphasis role="bold">
<property><a4j:poll></property>
- </emphasis> sends AJAX requests every second, calling the <emphasis role="italic">
+ </emphasis> sends AJAX requests every second, calling the <emphasis >
<property>"action"</property>
- </emphasis> method of the <emphasis role="italic">
+ </emphasis> method of the <emphasis >
<property>"repeater"</property>
</emphasis> bean.
</para>
@@ -86,12 +86,12 @@
<title>Note:</title>
<para>The <emphasis role="bold">
<property><a4j:repeater></property>
- </emphasis> component is defined as fully updated, but really updated there are only the strings which rowKeys are included into the set <emphasis role="italic">
+ </emphasis> component is defined as fully updated, but really updated there are only the strings which rowKeys are included into the set <emphasis >
<property>"ajaxRowSet"</property>
- </emphasis> defined in the <emphasis role="italic">
+ </emphasis> defined in the <emphasis >
<property>"ajaxKeys"</property>
</emphasis> attribute </para>
- <para>The set could be defined during the action method processing using data on a model from the property <emphasis role="italic">
+ <para>The set could be defined during the action method processing using data on a model from the property <emphasis >
<property>"repeater.myRepeat"</property>
</emphasis></para>
</note>
Modified: trunk/docs/userguide/en/src/main/docbook/included/status.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/status.xml 2007-07-05 08:23:01 UTC (rev 298)
+++ trunk/docs/userguide/en/src/main/docbook/included/status.xml 2007-07-05 08:31:09 UTC (rev 299)
@@ -36,7 +36,7 @@
<para>There are two ways to define elements indicating a request status :</para>
<itemizedlist>
<listitem>
- With <emphasis role="italic">
+ With <emphasis >
<property>"StartText"/"StopText"</property>
</emphasis> atributes:
<programlisting role="XML"><![CDATA[<a4j:status startText="Progress" stopText="Done" for="stat1">]]></programlisting>
@@ -69,19 +69,19 @@
<title>Key attributes and ways of usage</title>
<para>There are two ways for components or containers definition, which AJAX requests status is tracked by a component.<itemizedlist>
<listitem>
- Definition with the <emphasis role="italic">
+ Definition with the <emphasis >
<property>"for"</property>
</emphasis>
attribute on the <emphasis role="bold">
<property><a4j:status></property>
- </emphasis> component. Here <emphasis role="italic">
+ </emphasis> component. Here <emphasis >
<property>"for"</property>
</emphasis>
attribute should point at an AJAX container (<emphasis role="bold"><property><a4j:region></property></emphasis>) "id", which requests are tracked by a component.
</listitem>
</itemizedlist><itemizedlist>
<listitem>
- Definition with the <emphasis role="italic">
+ Definition with the <emphasis >
<property>"status"</property>
</emphasis>
attribute obtained by any Ajax4jsf library action component. The attribute should point at the <emphasis role="bold">
@@ -107,7 +107,7 @@
<span id="j_id20:status.stop" style="display: none">
Stopped
</span>]]></programlisting>
- <para>There is a possibility to group a <emphasis role="bold"><property><a4j:status></property></emphasis> elements content into <emphasis role="bold"><property><div></property></emphasis> elements, instead of <emphasis role="bold"><property><span></property></emphasis>. To use it, just redefine the <emphasis role="italic">
+ <para>There is a possibility to group a <emphasis role="bold"><property><a4j:status></property></emphasis> elements content into <emphasis role="bold"><property><div></property></emphasis> elements, instead of <emphasis role="bold"><property><span></property></emphasis>. To use it, just redefine the <emphasis >
<property>"layout"</property>
</emphasis>
attribute from "incline"(default) to "block".</para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/support.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/support.xml 2007-07-05 08:23:01 UTC (rev 298)
+++ trunk/docs/userguide/en/src/main/docbook/included/support.xml 2007-07-05 08:31:09 UTC (rev 299)
@@ -75,8 +75,8 @@
<property><a4j:support></property>
</emphasis> functionality and there is no necessity to add the support to them. </para>
</note>
- <para>With the help of <emphasis role="italic">
- <property>"onsubmit"</property></emphasis> and <emphasis role="italic">
+ <para>With the help of <emphasis >
+ <property>"onsubmit"</property></emphasis> and <emphasis >
<property>"oncomplete"</property></emphasis> attributes the component allows using JavaScript before (for request sending conditions checking) and after an AJAX response processing termination (for performance of user-defined activities on the client) </para>
<para><emphasis role="bold">Example:</emphasis></para>
<programlisting role="XML"><![CDATA[<h:selectOneMenu value="#{bean.text}">
@@ -91,10 +91,10 @@
<itemizedlist>
<listitem>
<emphasis role="bold">Limitation of the submit area and updating area for the request.</emphasis>
- <para><emphasis role="italic"><property>"ajaxSingle"</property></emphasis> is an attribute that allows submission on the server only component sending a request, as if the component presented on a separate form.
+ <para><emphasis ><property>"ajaxSingle"</property></emphasis> is an attribute that allows submission on the server only component sending a request, as if the component presented on a separate form.
</para>
- <para><emphasis role="italic"><property>"limitToList"</property></emphasis> is an attribute that allows to limit areas, which are updated after the responses. Only these components defined in the reRender attribute are updated. </para>
+ <para><emphasis ><property>"limitToList"</property></emphasis> is an attribute that allows to limit areas, which are updated after the responses. Only these components defined in the reRender attribute are updated. </para>
</listitem>
</itemizedlist></para>
<para><emphasis role="bold">Example 1:</emphasis></para>
@@ -119,15 +119,15 @@
<itemizedlist>
<listitem>
<emphasis role="bold">Limitation of requests frequency and updates quantity after the responses. </emphasis>
- <para><emphasis role="italic"><property>"requestDelay"</property></emphasis> is an attribute that defines a time interval in seconds minimally permissible between responses.
+ <para><emphasis ><property>"requestDelay"</property></emphasis> is an attribute that defines a time interval in seconds minimally permissible between responses.
</para>
- <para><emphasis role="italic"><property>"eventQueue"</property></emphasis> is an attribute for naming of the queue where the next response is kept in till its processing, but if the next event comes in till this time is over, the waiting event is taken away, replacing with a new one.
+ <para><emphasis ><property>"eventQueue"</property></emphasis> is an attribute for naming of the queue where the next response is kept in till its processing, but if the next event comes in till this time is over, the waiting event is taken away, replacing with a new one.
</para>
- <para><emphasis role="italic"><property>"ignoreDupResponces"</property></emphasis> is an attribute that allows to disable any updates on the client after an AJAX request if another AJAX request is already sent.
+ <para><emphasis ><property>"ignoreDupResponces"</property></emphasis> is an attribute that allows to disable any updates on the client after an AJAX request if another AJAX request is already sent.
</para>
- <para><emphasis role="italic"><property>"timeout"</property></emphasis> is an attribute that allows to set a time interval in millisecond to define a maximum time period of response wait time. In case of the interval interaction, a new request is sent and the previous one is canceled. Postprocessing of a response isn't performed.
+ <para><emphasis ><property>"timeout"</property></emphasis> is an attribute that allows to set a time interval in millisecond to define a maximum time period of response wait time. In case of the interval interaction, a new request is sent and the previous one is canceled. Postprocessing of a response isn't performed.
</para>
<para><emphasis role="bold">Example:</emphasis></para>
<programlisting role="XML"><![CDATA[<h:form>
16 years, 10 months
JBoss Ajax4JSF SVN: r298 - trunk/docs/userguide/en/src/main/docbook/modules.
by ajax4jsf-svn-commits@lists.jboss.org
Author: smukhina
Date: 2007-07-05 04:23:01 -0400 (Thu, 05 Jul 2007)
New Revision: 298
Modified:
trunk/docs/userguide/en/src/main/docbook/modules/a4jUGusingAJAX.xml
Log:
http://jira.jboss.com/jira/browse/EXIN-373
some words are marked with italic font style
Modified: trunk/docs/userguide/en/src/main/docbook/modules/a4jUGusingAJAX.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/modules/a4jUGusingAJAX.xml 2007-07-04 19:04:49 UTC (rev 297)
+++ trunk/docs/userguide/en/src/main/docbook/modules/a4jUGusingAJAX.xml 2007-07-05 08:23:01 UTC (rev 298)
@@ -112,7 +112,7 @@
<para>In order to create AJAX4JSF applications properly, keep the following points in mind:</para>
<itemizedlist>
<listitem>
- The AJAX framework should not append or delete, but only replace elements on the page. For successful updates, an element with the same ID as in the response must exist on the page. If you'd like to append any code to a page, put in a placeholder for it (any empty element). For the same reason, it's recommended to place messages in the<emphasis role="italic">
+ The AJAX framework should not append or delete, but only replace elements on the page. For successful updates, an element with the same ID as in the response must exist on the page. If you'd like to append any code to a page, put in a placeholder for it (any empty element). For the same reason, it's recommended to place messages in the<emphasis >
<property>"AjaxOutput"</property>
</emphasis> component (as no messages is also a message).
</listitem>
@@ -167,14 +167,14 @@
<para>Most important attributes of components that provide AJAX request calling features are:</para>
<itemizedlist>
<listitem>
- <emphasis role="italic">
+ <emphasis >
<property>"reRender"</property>
</emphasis>attribute as it was mentioned <link linkend="SendAnAJAXRequest">before</link> specifies components to be reRendered
after AJAX response. The attribute can be specified using EL expression and formed dynamicaly on the
server side (see <ulink url="index.html#FAQ">FAQ chapter</ulink>).
</listitem>
<listitem>
- <emphasis role="italic">
+ <emphasis >
<property>"RequestDelay"</property>
</emphasis> attribute is used for a requests frequency regulation.
</listitem>
@@ -187,18 +187,18 @@
</para>
<itemizedlist>
<listitem>
- <emphasis role="italic">
+ <emphasis >
<property>"EventsQueue"</property>
</emphasis> is a queue that stores the next request.
</listitem>
<listitem>
- <emphasis role="italic">
+ <emphasis >
<property>"LimitToList"</property>
</emphasis> attribute is used to regulate updatable regions. Setting
it to true limits the updatable areas only to ones specified in a
reRender list, in other case all Output Panels of the region are updated.
</listitem>
- <listitem> <emphasis role="italic">
+ <listitem> <emphasis >
<property>"ajaxSingle"</property>
</emphasis> attributes specify regions to be sent with a request,
if "false" it is a full region, in other case it's is only a control caused
@@ -288,9 +288,9 @@
<section id="SessionExpiredHandling">
<?dbhtml filename="SessionExpiredHandling.html"?>
<title>Session Expired Handling</title>
- <para>Beginning with Ajax4jsf version 1.0.5 it's possible to redefine also the <emphasis role="italic">
+ <para>Beginning with Ajax4jsf version 1.0.5 it's possible to redefine also the <emphasis >
<property>"onExpired"</property>
- </emphasis> framework method that is called on the <emphasis role="italic">
+ </emphasis> framework method that is called on the <emphasis >
<property>"Session Expiration"</property>
</emphasis> event.</para>
<programlisting role="JAVA"><![CDATA[A4J.AJAX.onExpired = function(loc,expiredMsg){
@@ -301,13 +301,13 @@
<para>Here the function receives in params:</para>
<itemizedlist>
<listitem>loc - URL of the current page (on demand can be updated) </listitem>
- <listitem>expiredMsg - a default message on <emphasis role="italic">
+ <listitem>expiredMsg - a default message on <emphasis >
<property>"Session Expiration"</property>
</emphasis>event.</listitem>
</itemizedlist>
<note>
<title>Note:</title>
-Until the version 1.0.5 the method can't be redefined on <emphasis role="italic">
+Until the version 1.0.5 the method can't be redefined on <emphasis >
<property>"Session Expiration"</property>,
</emphasis> a confirmation dialog with a request for view reloading was always called.
</note>
16 years, 10 months
JBoss Ajax4JSF SVN: r297 - in trunk/cdk/generator/src/main/resources/META-INF: templates12 and 1 other directory.
by ajax4jsf-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2007-07-04 15:04:49 -0400 (Wed, 04 Jul 2007)
New Revision: 297
Modified:
trunk/cdk/generator/src/main/resources/META-INF/templates/componentTag.vm
trunk/cdk/generator/src/main/resources/META-INF/templates12/componentTag.vm
Log:
elonly invalid case fixed
Modified: trunk/cdk/generator/src/main/resources/META-INF/templates/componentTag.vm
===================================================================
--- trunk/cdk/generator/src/main/resources/META-INF/templates/componentTag.vm 2007-07-04 13:36:12 UTC (rev 296)
+++ trunk/cdk/generator/src/main/resources/META-INF/templates/componentTag.vm 2007-07-04 19:04:49 UTC (rev 297)
@@ -94,7 +94,7 @@
setValueChangedListenerProperty(component, this._${prop.name});
#elseif($prop.name == "value")
setValueProperty(component, this._${prop.name});
- #elseif($prop.elOnly || $prop.isInstanceof("javax.faces.el.ValueBinding") )
+ #elseif($prop.elonly || $prop.isInstanceof("javax.faces.el.ValueBinding") )
setValueBinding(component, "${prop.name}",this._${prop.name});
#elseif(${prop.simpleType})
// Simple type - ${prop.simpleClassName}
Modified: trunk/cdk/generator/src/main/resources/META-INF/templates12/componentTag.vm
===================================================================
--- trunk/cdk/generator/src/main/resources/META-INF/templates12/componentTag.vm 2007-07-04 13:36:12 UTC (rev 296)
+++ trunk/cdk/generator/src/main/resources/META-INF/templates12/componentTag.vm 2007-07-04 19:04:49 UTC (rev 297)
@@ -94,7 +94,7 @@
setValueChangedListenerProperty(component, this._${prop.name});
#elseif($prop.name == "value")
setValueProperty(component, this._${prop.name});
- #elseif($prop.elOnly || $prop.isInstanceof("javax.faces.el.ValueBinding") )
+ #elseif($prop.elonly || $prop.isInstanceof("javax.faces.el.ValueBinding") )
setValueBinding(component, "${prop.name}",this._${prop.name});
#elseif(${prop.simpleType})
// Simple type - ${prop.simpleClassName}
16 years, 10 months
JBoss Ajax4JSF SVN: r296 - trunk/docs/userguide/en/src/main/docbook.
by ajax4jsf-svn-commits@lists.jboss.org
Author: afedosik
Date: 2007-07-04 09:36:12 -0400 (Wed, 04 Jul 2007)
New Revision: 296
Modified:
trunk/docs/userguide/en/src/main/docbook/master.xml
Log:
"Other relevant resources" section with link to http://jsf.javabeat.net/articles/2007/06/introduction-to-ajax4jsf/ article added in 4,5,6 chapters.
Modified: trunk/docs/userguide/en/src/main/docbook/master.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/master.xml 2007-07-04 13:35:55 UTC (rev 295)
+++ trunk/docs/userguide/en/src/main/docbook/master.xml 2007-07-04 13:36:12 UTC (rev 296)
@@ -7,6 +7,7 @@
<!ENTITY envSettings SYSTEM "modules/a4jUGenvsettings.xml">
<!ENTITY usingAJAX SYSTEM "modules/a4jUGusingAJAX.xml">
<!ENTITY componentDetails SYSTEM "../../../target/generated/a4j.xml">
+ <!ENTITY a4jRelevantRsc SYSTEM "modules/a4jRelevantRsc.xml">
<!ENTITY skinnability SYSTEM "modules/a4jUGskinnability.xml">
<!ENTITY IDEintegration SYSTEM "modules/a4jUGideintegration.xml">
<!ENTITY EVCP SYSTEM "modules/a4jUGevcp.xml">
@@ -30,10 +31,11 @@
&envSettings;
&getttingStarted;
&usingAJAX;
- <chapter>
-
- <title>Ajax4jsf components</title>
- &componentDetails;
+ <chapter>
+
+ <title>Ajax4jsf components</title>
+ &componentDetails;
+ &a4jRelevantRsc;
</chapter>
&skinnability;
&IDEintegration;
16 years, 10 months
JBoss Ajax4JSF SVN: r295 - trunk/docs/userguide/en/src/main/docbook/modules.
by ajax4jsf-svn-commits@lists.jboss.org
Author: afedosik
Date: 2007-07-04 09:35:55 -0400 (Wed, 04 Jul 2007)
New Revision: 295
Added:
trunk/docs/userguide/en/src/main/docbook/modules/a4jRelevantRsc.xml
Modified:
trunk/docs/userguide/en/src/main/docbook/modules/a4jUGstart.xml
trunk/docs/userguide/en/src/main/docbook/modules/a4jUGusingAJAX.xml
Log:
"Other relevant resources" section with link to http://jsf.javabeat.net/articles/2007/06/introduction-to-ajax4jsf/ article added in 4,5,6 chapters.
Added: trunk/docs/userguide/en/src/main/docbook/modules/a4jRelevantRsc.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/modules/a4jRelevantRsc.xml (rev 0)
+++ trunk/docs/userguide/en/src/main/docbook/modules/a4jRelevantRsc.xml 2007-07-04 13:35:55 UTC (rev 295)
@@ -0,0 +1,5 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<section id="Relevant_src_library">
+ <title>Other Relevant Resources</title>
+ <para><ulink url="http://jsf.javabeat.net/articles/2007/06/introduction-to-ajax4jsf/2">Introduction to Ajax4Jsf - Exploring the Ajax4Jsf Library</ulink> by Shunmuga Raja</para>
+</section>
Modified: trunk/docs/userguide/en/src/main/docbook/modules/a4jUGstart.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/modules/a4jUGstart.xml 2007-06-29 16:03:59 UTC (rev 294)
+++ trunk/docs/userguide/en/src/main/docbook/modules/a4jUGstart.xml 2007-07-04 13:35:55 UTC (rev 295)
@@ -251,4 +251,8 @@
</para>
</section>
</section>
+ <section id="Relevant_src">
+ <title>Other Relevant Resources</title>
+ <para><ulink url="http://jsf.javabeat.net/articles/2007/06/introduction-to-ajax4jsf/3">Introduction to Ajax4Jsf - Sample Application</ulink> by Shunmuga Raja</para>
+ </section>
</chapter>
Modified: trunk/docs/userguide/en/src/main/docbook/modules/a4jUGusingAJAX.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/modules/a4jUGusingAJAX.xml 2007-06-29 16:03:59 UTC (rev 294)
+++ trunk/docs/userguide/en/src/main/docbook/modules/a4jUGusingAJAX.xml 2007-07-04 13:35:55 UTC (rev 295)
@@ -313,4 +313,10 @@
</note>
</section>
</section>
-&FAQ;</chapter>
+&FAQ;
+<section id="OtherRelevantResources">
+ <title>Other Relevant Resources</title>
+ <para><ulink url="http://jsf.javabeat.net/articles/2007/06/introduction-to-ajax4jsf/">Introduction to Ajax4Jsf</ulink> by Shunmuga Raja</para>
+
+</section>
+</chapter>
16 years, 10 months