JBoss Rich Faces SVN: r7720 - in branches/3.2.x/framework/impl/src/main/java/org/ajax4jsf: webapp and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-04-09 14:34:05 -0400 (Wed, 09 Apr 2008)
New Revision: 7720
Modified:
branches/3.2.x/framework/impl/src/main/java/org/ajax4jsf/FastFilter.java
branches/3.2.x/framework/impl/src/main/java/org/ajax4jsf/Filter.java
branches/3.2.x/framework/impl/src/main/java/org/ajax4jsf/webapp/BaseFilter.java
Log:
http://jira.jboss.com/jira/browse/RF-2962
Modified: branches/3.2.x/framework/impl/src/main/java/org/ajax4jsf/FastFilter.java
===================================================================
--- branches/3.2.x/framework/impl/src/main/java/org/ajax4jsf/FastFilter.java 2008-04-09 18:28:09 UTC (rev 7719)
+++ branches/3.2.x/framework/impl/src/main/java/org/ajax4jsf/FastFilter.java 2008-04-09 18:34:05 UTC (rev 7720)
@@ -21,217 +21,7 @@
package org.ajax4jsf;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import javax.servlet.FilterChain;
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-
-import org.ajax4jsf.request.MultipartRequest;
-
public class FastFilter extends org.ajax4jsf.webapp.NekkoFilter {
- /** Multipart request start */
- public static final String MULTIPART = "multipart/";
-
- /** Session bean name where multipart requests map will be stored */
- public static final String REQUESTS_SESSIONS_BEAN_NAME = "_richfaces_upload_sessions";
-
- /** Session bean name where progress bar's percent map will be stored */
- public static final String PERCENT_BEAN_NAME = "_richfaces_upload_percents";
-
- /**
- * Request parameter that indicates if multipart request forced by rich file
- * upload component
- */
- public static final String UPLOAD_FILES_ID = "_richfaces_upload_uid";
-
- /**
- * Flag indicating whether a temporary file should be used to cache the
- * uploaded file
- */
- private boolean createTempFiles = false;
-
- /**
- * The maximum size of a file upload request. 0 means no limit.
- */
- private int maxRequestSize = 0;
-
- /***************************************************************************
- * Method catches upload files request. Request parameter
- * <b>org.ajax4jsf.Filter.UPLOAD_FILES_ID</b> indicates if request
- * generated by rich-upload component. If it was detected custom parsing
- * request should be done. Processing information about percent of
- * completion and file size will be put into session scope. In other case
- * super filter's method will be invoked for request processing.
- *
- * @param request
- * @param response
- * @param chain
- */
- public void doFilter(ServletRequest request, ServletResponse response,
- FilterChain chain) throws IOException, ServletException {
- if (!(response instanceof HttpServletResponse)) {
- chain.doFilter(request, response);
- return;
- }
-
- HttpServletRequest httpRequest = (HttpServletRequest) request;
- String uid = httpRequest.getParameter(UPLOAD_FILES_ID);
- if (uid != null) {
- if (isMultipartRequest(httpRequest)) {
- MultipartRequest multipartRequest = new MultipartRequest(
- httpRequest, createTempFiles, maxRequestSize, uid);
-
- Map<String, MultipartRequest> sessionsMap = null;
- Map<String, Object> percentMap = null;
- try {
- if (isFileSizeRestricted(request, maxRequestSize)) {
- printResponse(response,
- "<html id=\"_richfaces_file_upload_size_restricted\"></html>");
- } else if (!checkFileCount(httpRequest)) {
- printResponse(response,
- "<html id=\"_richfaces_file_upload_forbidden\"></html>");
- } else {
- HttpSession session = httpRequest.getSession();
- synchronized (session) {
- sessionsMap = (Map<String, MultipartRequest>) session
- .getAttribute(REQUESTS_SESSIONS_BEAN_NAME);
- percentMap = (Map<String, Object>) session
- .getAttribute(PERCENT_BEAN_NAME);
- if (sessionsMap == null) {
- sessionsMap = Collections
- .synchronizedMap(new HashMap<String, MultipartRequest>());
- session.setAttribute(
- REQUESTS_SESSIONS_BEAN_NAME,
- sessionsMap);
- }
- if (percentMap == null) {
- percentMap = new HashMap<String, Object>();
- session.setAttribute(PERCENT_BEAN_NAME,
- percentMap);
- }
- }
- percentMap.put(uid, 0); // associate percent value with
- // file
- // entry uid
- sessionsMap.put(uid, multipartRequest);
-
- if (multipartRequest.parseRequest()) {
- super.doFilter(multipartRequest, response, chain);
- } else {
- printResponse(response,
- "<html id=\"_richfaces_file_upload_stopped\"></html>");
- }
- }
- } finally {
- if (sessionsMap != null) {
- sessionsMap.remove(uid);
- percentMap.remove(uid);
- }
- }
- } else {
- if ("stop".equals(httpRequest.getParameter("action"))) {
- HttpSession session = httpRequest.getSession();
- Map<String, MultipartRequest> sessions = (Map<String, MultipartRequest>) session
- .getAttribute(REQUESTS_SESSIONS_BEAN_NAME);
-
- if (sessions != null) {
- MultipartRequest multipartRequest = sessions.get(uid);
- if (multipartRequest != null) {
- multipartRequest.stop();
- HttpServletResponse httpResponse = (HttpServletResponse) response;
- httpResponse
- .setStatus(HttpServletResponse.SC_NO_CONTENT);
- httpResponse.getOutputStream().close();
- }
- }
- } else {
- super.doFilter(request, response, chain);
- }
- }
- } else {
- super.doFilter(request, response, chain);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.webapp.BaseFilter#init(javax.servlet.FilterConfig)
- */
- @Override
- public void init(FilterConfig filterConfig) throws ServletException {
- super.init(filterConfig);
- String param = filterConfig.getInitParameter("createTempFiles");
- if (param != null) {
- this.createTempFiles = Boolean.parseBoolean(param);
- }else {
- this.createTempFiles = true;
- }
- param = filterConfig.getInitParameter("maxRequestSize");
- if (param != null) {
- this.maxRequestSize = Integer.parseInt(param);
- }
- }
-
- private boolean isMultipartRequest(HttpServletRequest request) {
- if (!"post".equals(request.getMethod().toLowerCase())) {
- return false;
- }
-
- String contentType = request.getContentType();
- if (contentType == null) {
- return false;
- }
-
- if (contentType.toLowerCase().startsWith(MULTIPART)) {
- return true;
- }
-
- return false;
- }
-
- private boolean isFileSizeRestricted(ServletRequest request, int maxSize) {
- if (maxSize != 0 && request.getContentLength() > maxSize) {
- return true;
- }
- return false;
- }
-
- private boolean checkFileCount(HttpServletRequest request) {
- HttpSession session = request.getSession();
- Map<String, Integer> map = (Map<String, Integer>) session
- .getAttribute(Filter.UPLOADED_COUNTER);
- if (map != null) {
- String id = request.getParameter("id");
- if (id != null) {
- Integer i = map.get(id);
- if (i != null && i == 0) {
- return false;
- }
- }
- }
- return true;
- }
-
- private void printResponse(ServletResponse response, String message)
- throws IOException {
- HttpServletResponse httpResponse = (HttpServletResponse) response;
- httpResponse.setStatus(HttpServletResponse.SC_OK);
- httpResponse.setContentType("text/html");
- PrintWriter writer = httpResponse.getWriter();
- writer.write(message);
- writer.close();
- }
-
}
Modified: branches/3.2.x/framework/impl/src/main/java/org/ajax4jsf/Filter.java
===================================================================
--- branches/3.2.x/framework/impl/src/main/java/org/ajax4jsf/Filter.java 2008-04-09 18:28:09 UTC (rev 7719)
+++ branches/3.2.x/framework/impl/src/main/java/org/ajax4jsf/Filter.java 2008-04-09 18:34:05 UTC (rev 7720)
@@ -21,22 +21,6 @@
package org.ajax4jsf;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.servlet.FilterChain;
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-
-import org.ajax4jsf.request.MultipartRequest;
import org.ajax4jsf.webapp.ConfigurableFilter;
/**
@@ -48,202 +32,4 @@
*/
public class Filter extends ConfigurableFilter {
- /** Multipart request start */
- public static final String MULTIPART = "multipart/";
-
- /** Session bean name where multipart requests map will be stored */
- public static final String REQUESTS_SESSIONS_BEAN_NAME = "_richfaces_upload_sessions";
-
- /** Session bean name where progress bar's percent map will be stored */
- public static final String PERCENT_BEAN_NAME = "_richfaces_upload_percents";
-
- /**
- * Request parameter that indicates if multipart request forced by rich file
- * upload component
- */
- public static final String UPLOAD_FILES_ID = "_richfaces_upload_uid";
-
- /** Session bean name to store max files count allowed to upload */
- public static final String UPLOADED_COUNTER = "_richfaces_uploaded_file_counter";
-
- /**
- * Flag indicating whether a temporary file should be used to cache the
- * uploaded file
- */
- private boolean createTempFiles = false;
-
- /**
- * The maximum size of a file upload request. 0 means no limit.
- */
- private int maxRequestSize = 0;
-
- /***************************************************************************
- * Method catches upload files request. Request parameter
- * <b>org.ajax4jsf.Filter.UPLOAD_FILES_ID</b> indicates if request
- * generated by rich-upload component. If it was detected custom parsing
- * request should be done. Processing information about percent of
- * completion and file size will be put into session scope. In other case
- * super filter's method will be invoked for request processing.
- *
- * @param request
- * @param response
- * @param chain
- */
- @Override
- public void doFilter(ServletRequest request, ServletResponse response,
- FilterChain chain) throws IOException, ServletException {
- if (!(response instanceof HttpServletResponse)) {
- chain.doFilter(request, response);
- return;
- }
-
- HttpServletRequest httpRequest = (HttpServletRequest) request;
- String uid = httpRequest.getParameter(UPLOAD_FILES_ID);
- if (uid != null) {
- if (isMultipartRequest(httpRequest)) {
- MultipartRequest multipartRequest = new MultipartRequest(
- httpRequest, createTempFiles, maxRequestSize, uid);
-
- Map<String, MultipartRequest> sessionsMap = null;
- Map<String, Object> percentMap = null;
- try {
- if (isFileSizeRestricted(request, maxRequestSize)) {
- printResponse(response,
- "<html id=\"_richfaces_file_upload_size_restricted\"></html>");
- } else if (!checkFileCount(httpRequest)) {
- printResponse(response,
- "<html id=\"_richfaces_file_upload_forbidden\"></html>");
- } else {
- HttpSession session = httpRequest.getSession();
- synchronized (session) {
- sessionsMap = (Map<String, MultipartRequest>) session
- .getAttribute(REQUESTS_SESSIONS_BEAN_NAME);
- percentMap = (Map<String, Object>) session
- .getAttribute(PERCENT_BEAN_NAME);
- if (sessionsMap == null) {
- sessionsMap = Collections
- .synchronizedMap(new HashMap<String, MultipartRequest>());
- session.setAttribute(
- REQUESTS_SESSIONS_BEAN_NAME,
- sessionsMap);
- }
- if (percentMap == null) {
- percentMap = new HashMap<String, Object>();
- session.setAttribute(PERCENT_BEAN_NAME,
- percentMap);
- }
- }
- percentMap.put(uid, 0); // associate percent value with
- // file
- // entry uid
- sessionsMap.put(uid, multipartRequest);
-
- if (multipartRequest.parseRequest()) {
- super.doFilter(multipartRequest, response, chain);
- } else {
- printResponse(response,
- "<html id=\"_richfaces_file_upload_stopped\"></html>");
- }
- }
- } finally {
- if (sessionsMap != null) {
- sessionsMap.remove(uid);
- percentMap.remove(uid);
- }
- }
- } else {
- if ("stop".equals(httpRequest.getParameter("action"))) {
- HttpSession session = httpRequest.getSession();
- Map<String, MultipartRequest> sessions = (Map<String, MultipartRequest>) session
- .getAttribute(REQUESTS_SESSIONS_BEAN_NAME);
-
- if (sessions != null) {
- MultipartRequest multipartRequest = sessions.get(uid);
- if (multipartRequest != null) {
- multipartRequest.stop();
- HttpServletResponse httpResponse = (HttpServletResponse) response;
- httpResponse
- .setStatus(HttpServletResponse.SC_NO_CONTENT);
- httpResponse.getOutputStream().close();
- }
- }
- } else {
- super.doFilter(request, response, chain);
- }
- }
- } else {
- super.doFilter(request, response, chain);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.ajax4jsf.webapp.BaseFilter#init(javax.servlet.FilterConfig)
- */
- @Override
- public void init(FilterConfig filterConfig) throws ServletException {
- super.init(filterConfig);
- String param = filterConfig.getInitParameter("createTempFiles");
- if (param != null) {
- this.createTempFiles = Boolean.parseBoolean(param);
- } else {
- this.createTempFiles = true;
- }
- param = filterConfig.getInitParameter("maxRequestSize");
- if (param != null) {
- this.maxRequestSize = Integer.parseInt(param);
- }
- }
-
- private boolean isMultipartRequest(HttpServletRequest request) {
- if (!"post".equals(request.getMethod().toLowerCase())) {
- return false;
- }
-
- String contentType = request.getContentType();
- if (contentType == null) {
- return false;
- }
-
- if (contentType.toLowerCase().startsWith(MULTIPART)) {
- return true;
- }
-
- return false;
- }
-
- private boolean isFileSizeRestricted(ServletRequest request, int maxSize) {
- if (maxSize != 0 && request.getContentLength() > maxSize) {
- return true;
- }
- return false;
- }
-
- private boolean checkFileCount(HttpServletRequest request) {
- HttpSession session = request.getSession();
- Map<String, Integer> map = (Map<String, Integer>) session
- .getAttribute(UPLOADED_COUNTER);
- if (map != null) {
- String id = request.getParameter("id");
- if (id != null) {
- Integer i = map.get(id);
- if (i != null && i == 0) {
- return false;
- }
- }
- }
- return true;
- }
-
- private void printResponse(ServletResponse response, String message)
- throws IOException {
- HttpServletResponse httpResponse = (HttpServletResponse) response;
- httpResponse.setStatus(HttpServletResponse.SC_OK);
- httpResponse.setContentType("text/html");
- PrintWriter writer = httpResponse.getWriter();
- writer.write(message);
- writer.close();
- }
-
}
Modified: branches/3.2.x/framework/impl/src/main/java/org/ajax4jsf/webapp/BaseFilter.java
===================================================================
--- branches/3.2.x/framework/impl/src/main/java/org/ajax4jsf/webapp/BaseFilter.java 2008-04-09 18:28:09 UTC (rev 7719)
+++ branches/3.2.x/framework/impl/src/main/java/org/ajax4jsf/webapp/BaseFilter.java 2008-04-09 18:34:05 UTC (rev 7720)
@@ -22,9 +22,13 @@
package org.ajax4jsf.webapp;
import java.io.IOException;
+import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
+import java.util.Collections;
import java.util.Date;
import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
import javax.faces.application.ViewHandler;
import javax.servlet.Filter;
@@ -41,6 +45,7 @@
import org.ajax4jsf.Messages;
import org.ajax4jsf.context.AjaxContext;
import org.ajax4jsf.renderkit.AjaxContainerRenderer;
+import org.ajax4jsf.request.MultipartRequest;
import org.ajax4jsf.resource.InternetResourceService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -108,6 +113,35 @@
protected PollEventsManager eventsManager;
/**
+ * Flag indicating whether a temporary file should be used to cache the
+ * uploaded file
+ */
+ private boolean createTempFiles = false;
+
+ /**
+ * The maximum size of a file upload request. 0 means no limit.
+ */
+ private int maxRequestSize = 0;
+
+ /** Multipart request start */
+ public static final String MULTIPART = "multipart/";
+
+ /** Session bean name where multipart requests map will be stored */
+ public static final String REQUESTS_SESSIONS_BEAN_NAME = "_richfaces_upload_sessions";
+
+ /** Session bean name where progress bar's percent map will be stored */
+ public static final String PERCENT_BEAN_NAME = "_richfaces_upload_percents";
+
+ /**
+ * Request parameter that indicates if multipart request forced by rich file
+ * upload component
+ */
+ public static final String UPLOAD_FILES_ID = "_richfaces_upload_uid";
+
+ /** Session bean name to store max files count allowed to upload */
+ public static final String UPLOADED_COUNTER = "_richfaces_uploaded_file_counter";
+
+ /**
* Initialize the filter.
*/
public void init(FilterConfig config) throws ServletException {
@@ -140,9 +174,193 @@
resourceService.init(filterConfig);
eventsManager = new PollEventsManager();
eventsManager.init(filterConfig.getServletContext());
+
+ String param = filterConfig.getInitParameter("createTempFiles");
+ if (param != null) {
+ this.createTempFiles = Boolean.parseBoolean(param);
+ } else {
+ this.createTempFiles = true;
+ }
+ param = filterConfig.getInitParameter("maxRequestSize");
+ if (param != null) {
+ this.maxRequestSize = Integer.parseInt(param);
+ }
}
+ private boolean isMultipartRequest(HttpServletRequest request) {
+ if (!"post".equals(request.getMethod().toLowerCase())) {
+ return false;
+ }
+
+ String contentType = request.getContentType();
+ if (contentType == null) {
+ return false;
+ }
+
+ if (contentType.toLowerCase().startsWith(MULTIPART)) {
+ return true;
+ }
+
+ return false;
+ }
+
+ private boolean isFileSizeRestricted(ServletRequest request, int maxSize) {
+ if (maxSize != 0 && request.getContentLength() > maxSize) {
+ return true;
+ }
+ return false;
+ }
+
+ private boolean checkFileCount(HttpServletRequest request) {
+ HttpSession session = request.getSession();
+ Map<String, Integer> map = (Map<String, Integer>) session
+ .getAttribute(UPLOADED_COUNTER);
+ if (map != null) {
+ String id = request.getParameter("id");
+ if (id != null) {
+ Integer i = map.get(id);
+ if (i != null && i == 0) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ private void printResponse(ServletResponse response, String message)
+ throws IOException {
+ HttpServletResponse httpResponse = (HttpServletResponse) response;
+ httpResponse.setStatus(HttpServletResponse.SC_OK);
+ httpResponse.setContentType("text/html");
+ PrintWriter writer = httpResponse.getWriter();
+ writer.write(message);
+ writer.close();
+ }
+
+ protected void handleRequest(HttpServletRequest request, HttpServletResponse response,
+ FilterChain chain) throws IOException, ServletException {
+
+ // check ajax request parameter
+ // TODO - check for JSF page.
+ if (true) {
+ if (log.isDebugEnabled()) {
+ log.debug(Messages
+ .getMessage(Messages.FILTER_XML_OUTPUT));
+ }
+
+ // Execute the rest of the filter chain, including the
+ // JSP
+ xmlFilter.doXmlFilter(chain, request,
+ response);
+ } else {
+ // normal request, execute chain ...
+ if (log.isDebugEnabled()) {
+ log.debug(Messages
+ .getMessage(Messages.FILTER_NO_XML_CHAIN));
+ }
+ chain.doFilter(request, response);
+
+ }
+
+ }
+
/**
+ * Method catches upload files request. Request parameter
+ * <b>org.ajax4jsf.Filter.UPLOAD_FILES_ID</b> indicates if request
+ * generated by rich-upload component. If it was detected custom parsing
+ * request should be done. Processing information about percent of
+ * completion and file size will be put into session scope.
+ *
+ * @param request
+ * @param response
+ * @return
+ * @throws IOException
+ * @throws ServletException
+ */
+ protected void processUploadsAndHandleRequest(HttpServletRequest request, HttpServletResponse response,
+ FilterChain chain) throws IOException, ServletException {
+ HttpServletRequest httpRequest = (HttpServletRequest) request;
+ String uid = httpRequest.getParameter(UPLOAD_FILES_ID);
+ if (uid != null) {
+ if (isMultipartRequest(httpRequest)) {
+ MultipartRequest multipartRequest = new MultipartRequest(
+ httpRequest, createTempFiles, maxRequestSize, uid);
+
+ Map<String, MultipartRequest> sessionsMap = null;
+ Map<String, Object> percentMap = null;
+ try {
+ if (isFileSizeRestricted(request, maxRequestSize)) {
+ printResponse(response,
+ "<html id=\"_richfaces_file_upload_size_restricted\"></html>");
+ } else if (!checkFileCount(httpRequest)) {
+ printResponse(response,
+ "<html id=\"_richfaces_file_upload_forbidden\"></html>");
+ } else {
+ HttpSession session = httpRequest.getSession();
+ synchronized (session) {
+ sessionsMap = (Map<String, MultipartRequest>) session
+ .getAttribute(REQUESTS_SESSIONS_BEAN_NAME);
+ percentMap = (Map<String, Object>) session
+ .getAttribute(PERCENT_BEAN_NAME);
+ if (sessionsMap == null) {
+ sessionsMap = Collections
+ .synchronizedMap(new HashMap<String, MultipartRequest>());
+ session.setAttribute(
+ REQUESTS_SESSIONS_BEAN_NAME,
+ sessionsMap);
+ }
+ if (percentMap == null) {
+ percentMap = new HashMap<String, Object>();
+ session.setAttribute(PERCENT_BEAN_NAME,
+ percentMap);
+ }
+ }
+ percentMap.put(uid, 0); // associate percent value with
+ // file
+ // entry uid
+ sessionsMap.put(uid, multipartRequest);
+
+ if (multipartRequest.parseRequest()) {
+ handleRequest(multipartRequest, response, chain);
+ } else {
+ printResponse(response,
+ "<html id=\"_richfaces_file_upload_stopped\"></html>");
+ }
+ }
+ } finally {
+ if (sessionsMap != null) {
+ sessionsMap.remove(uid);
+ percentMap.remove(uid);
+ }
+ }
+ } else {
+ if ("stop".equals(httpRequest.getParameter("action"))) {
+ HttpSession session = httpRequest.getSession();
+ Map<String, MultipartRequest> sessions = (Map<String, MultipartRequest>) session
+ .getAttribute(REQUESTS_SESSIONS_BEAN_NAME);
+
+ if (sessions != null) {
+ MultipartRequest multipartRequest = sessions.get(uid);
+ if (multipartRequest != null) {
+ multipartRequest.stop();
+ HttpServletResponse httpResponse = (HttpServletResponse) response;
+ httpResponse
+ .setStatus(HttpServletResponse.SC_NO_CONTENT);
+ httpResponse.getOutputStream().close();
+ }
+ }
+
+ //TODO what's here?
+ } else {
+ handleRequest(request, response, chain);
+ }
+ }
+ } else {
+ handleRequest(request, response, chain);
+ }
+ }
+
+ /**
* @param httpServletRequest
* @throws UnsupportedEncodingException
*/
@@ -263,29 +481,9 @@
// first stage - detect/set encoding of request. Same as in
// Myfaces External Context.
setupRequestEncoding(httpServletRequest);
- // check ajax request parameter
- // TODO - check for JSF page.
- if (true) {
- if (log.isDebugEnabled()) {
- log.debug(Messages
- .getMessage(Messages.FILTER_XML_OUTPUT));
- }
-
- // Execute the rest of the filter chain, including the
- // JSP
- xmlFilter.doXmlFilter(chain, httpServletRequest,
- httpServletResponse);
- } else {
- // normal request, execute chain ...
- if (log.isDebugEnabled()) {
- log.debug(Messages
- .getMessage(Messages.FILTER_NO_XML_CHAIN));
- }
- chain.doFilter(request, response);
-
- }
+
+ processUploadsAndHandleRequest(httpServletRequest, httpServletResponse, chain);
}
-
} finally {
// Remove filter marker from response, to enable sequence calls ( for example, forward to error page )
request.removeAttribute(FILTER_PERFORMED);
16 years, 9 months
JBoss Rich Faces SVN: r7719 - branches/3.2.x/cdk/generator/src/main/java/org/ajax4jsf/builder/config.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-04-09 14:28:09 -0400 (Wed, 09 Apr 2008)
New Revision: 7719
Modified:
branches/3.2.x/cdk/generator/src/main/java/org/ajax4jsf/builder/config/ComponentBaseBean.java
Log:
http://jira.jboss.com/jira/browse/RF-2918
Modified: branches/3.2.x/cdk/generator/src/main/java/org/ajax4jsf/builder/config/ComponentBaseBean.java
===================================================================
--- branches/3.2.x/cdk/generator/src/main/java/org/ajax4jsf/builder/config/ComponentBaseBean.java 2008-04-09 18:21:26 UTC (rev 7718)
+++ branches/3.2.x/cdk/generator/src/main/java/org/ajax4jsf/builder/config/ComponentBaseBean.java 2008-04-09 18:28:09 UTC (rev 7719)
@@ -5,7 +5,6 @@
import java.lang.reflect.Modifier;
import java.util.Arrays;
import java.util.Collection;
-import java.util.HashMap;
import java.util.Map;
import java.util.TreeMap;
@@ -14,7 +13,6 @@
import javax.naming.ConfigurationException;
import org.apache.commons.beanutils.PropertyUtils;
-import org.apache.tools.ant.BuildException;
public class ComponentBaseBean extends JsfBean {
@@ -239,7 +237,7 @@
if(!property.getClassname().equals(descriptor.getPropertyType().getCanonicalName())){
String message = "Class "+property.getClassname()+" for property "+property.getName()+" not equals with real bean property type: "+descriptor.getPropertyType().getCanonicalName();
getLog().error(message);
- //throw new IllegalArgumentException(message);
+ throw new IllegalArgumentException(message);
}
}
if (property.getDescription() == null) {
16 years, 9 months
JBoss Rich Faces SVN: r7718 - trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-04-09 14:21:26 -0400 (Wed, 09 Apr 2008)
New Revision: 7718
Modified:
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config/ComponentBaseBean.java
Log:
http://jira.jboss.com/jira/browse/RF-2918
Modified: trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config/ComponentBaseBean.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config/ComponentBaseBean.java 2008-04-09 18:00:38 UTC (rev 7717)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/config/ComponentBaseBean.java 2008-04-09 18:21:26 UTC (rev 7718)
@@ -5,7 +5,6 @@
import java.lang.reflect.Modifier;
import java.util.Arrays;
import java.util.Collection;
-import java.util.HashMap;
import java.util.Map;
import java.util.TreeMap;
@@ -14,7 +13,6 @@
import javax.naming.ConfigurationException;
import org.apache.commons.beanutils.PropertyUtils;
-import org.apache.tools.ant.BuildException;
public class ComponentBaseBean extends JsfBean {
16 years, 9 months
JBoss Rich Faces SVN: r7717 - in trunk/cdk/generator/src/main/java/org/ajax4jsf: templatecompiler/builder and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-04-09 14:00:38 -0400 (Wed, 09 Apr 2008)
New Revision: 7717
Modified:
trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/RendererGenerator.java
trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/builder/AbstractCompilationContext.java
trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/builder/CompilationContext.java
trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/el/ELCompiler.java
trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/vcp/FCallTemplateElement.java
trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/vcp/FClientIDTemplateElement.java
trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/vcp/ParameterProcessor.java
Log:
CDK exceptions handling enhanced
Modified: trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/RendererGenerator.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/RendererGenerator.java 2008-04-09 17:59:16 UTC (rev 7716)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/builder/generator/RendererGenerator.java 2008-04-09 18:00:38 UTC (rev 7717)
@@ -129,8 +129,9 @@
} else {
template = new File(renderer.getTemplate());
}
+ ClassLoader classLoader = getClassLoader();
CompilationContext rendererBean = new RendererCompilationContext(
- getLog(), getClassLoader(),getConfig());
+ getLog(), classLoader,getConfig());
if (null != renderer.getClassname()) {
rendererBean.setBaseclass(renderer.getClassname());
@@ -150,6 +151,35 @@
}
}
+
+// unfinished check of non-static fields in renderer classes
+//
+// String baseclassName = rendererBean.getFullClassName();
+// try {
+// classLoader.loadClass(baseclassName);
+// } catch (ClassNotFoundException e) {
+// getLog().debug("Class not found: " + e.getLocalizedMessage());
+//
+// baseclassName = rendererBean.getFullBaseclass();
+// classLoader.loadClass(baseclassName);
+// }
+//
+// if (baseclassName != null) {
+// Class<?> baseclass = classLoader.loadClass(baseclassName);
+// Class<? extends Annotation> annotationClass = (Class<? extends Annotation>) classLoader.loadClass("org.richfaces.AllowedRendererField");
+//
+// do {
+// Field[] fields = baseclass.getDeclaredFields();
+// for (Field field : fields) {
+// if ((field.getModifiers() & Modifier.STATIC) == 0 && field.getAnnotation(annotationClass) == null) {
+// throw new RuntimeException("Non-static field: " + field + " in renderer class. ");
+// }
+// }
+//
+// baseclass = baseclass.getSuperclass();
+// } while (baseclass != null);
+// }
+
TemplateCompiler templateCompiler = new TemplateCompiler();
InputStream templateStream = new FileInputStream(template);
templateCompiler.processing(templateStream, rendererBean);
Modified: trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/builder/AbstractCompilationContext.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/builder/AbstractCompilationContext.java 2008-04-09 17:59:16 UTC (rev 7716)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/builder/AbstractCompilationContext.java 2008-04-09 18:00:38 UTC (rev 7717)
@@ -352,15 +352,13 @@
clazz = this.classLoader.loadClass(className);
}
} catch (ClassNotFoundException e) {
- System.err.println("ClassNotFoundException message: "
- + e.getMessage());
+ throw e;
} catch (Throwable e) {
- e.printStackTrace();
+ log.error(e.getLocalizedMessage(), e);
}
if (null == clazz) {
- log.error("Error load class: " + className);
- throw new ClassNotFoundException();
+ throw new ClassNotFoundException(className);
}
return clazz;
}
@@ -375,7 +373,7 @@
}
public Class<?> getMethodReturnedClass(Class<?> clazz, String methodName,
- Class<?>[] parametersTypes) {
+ Class<?>[] parametersTypes) throws NoSuchMethodException {
Class<?> returnedType = null;
log.debug("class : " + clazz.getName() + "\n\t method : "
+ methodName + "\n\t paramTypes : "
@@ -388,11 +386,12 @@
returnedType = method.getReturnType();
log.debug("Method found, return type : "
+ returnedType.getName());
+
+ return returnedType;
} else {
- log.error("Method not found: " + clazz + "#" + methodName + "(" + parametersTypes + ")");
+ throw new NoSuchMethodException(clazz + "#" + methodName + "(" + Arrays.toString(parametersTypes) + ")");
}
- return returnedType;
}
public PropertyDescriptor getPropertyDescriptor(Class<?> clazz,
Modified: trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/builder/CompilationContext.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/builder/CompilationContext.java 2008-04-09 17:59:16 UTC (rev 7716)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/builder/CompilationContext.java 2008-04-09 18:00:38 UTC (rev 7717)
@@ -116,7 +116,7 @@
public Class<?> loadClass(String className) throws ClassNotFoundException;
public Class<?> getMethodReturnedClass(Class<?> clazz, String methodName,
- Class<?>[] parametersTypes);
+ Class<?>[] parametersTypes) throws NoSuchMethodException;
public PropertyDescriptor getPropertyDescriptor(Class<?> clazz,
String propertyName);
Modified: trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/el/ELCompiler.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/el/ELCompiler.java 2008-04-09 17:59:16 UTC (rev 7716)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/el/ELCompiler.java 2008-04-09 18:00:38 UTC (rev 7717)
@@ -653,7 +653,7 @@
lastVariableType = propertyDescriptor.getPropertyType()
.getName();
} catch (ClassNotFoundException e) {
- e.printStackTrace();
+ log.error(e.getLocalizedMessage(), e);
}
} else {
Modified: trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/vcp/FCallTemplateElement.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/vcp/FCallTemplateElement.java 2008-04-09 17:59:16 UTC (rev 7716)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/vcp/FCallTemplateElement.java 2008-04-09 18:00:38 UTC (rev 7717)
@@ -217,7 +217,7 @@
* @return
*/
private String getMethod(Class clazz, String methodName)
- throws ClassNotFoundException {
+ throws ClassNotFoundException, NoSuchMethodException {
String returnValue = null;
Class[][] arrayParametersTypes = null;
@@ -263,39 +263,51 @@
}
- for (int i = 0; i < arrayParametersTypes.length; i++) {
- if (null != this.getComponentBean().getMethodReturnedClass(clazz, methodName,
- arrayParametersTypes[i])) {
- StringBuffer buffer = new StringBuffer();
+ List<String> methodNotFoundMessagesList = new ArrayList<String>();
+ boolean found = false;
+
+ for (int i = 0; i < arrayParametersTypes.length && !found; i++) {
+
+ try {
+ this.getComponentBean().getMethodReturnedClass(clazz, methodName,
+ arrayParametersTypes[i]);
+ StringBuffer buffer = new StringBuffer();
- buffer.append(methodName);
- buffer.append("(");
+ buffer.append(methodName);
+ buffer.append("(");
- int shift = 0;
- if (i < PARAM_NAMES.length) {
- shift = PARAM_NAMES[i].length;
- }
+ int shift = 0;
+ if (i < PARAM_NAMES.length) {
+ shift = PARAM_NAMES[i].length;
+ }
- for (int j = 0; j < arrayParametersTypes[i].length; j++) {
- if (j > 0) {
- buffer.append(", ");
- }
- if ((i < PARAM_NAMES.length) && (j < PARAM_NAMES[i].length)) {
- buffer.append(PARAM_NAMES[i][j]);
- } else {
- Parameter parameter = (Parameter) this.parameters.get(j
- - shift);
- String tmp = ELParser.compileEL(parameter.getValue(),
- this.getComponentBean());
- buffer.append(tmp);
- }
- }
- buffer.append(")");
- returnValue = buffer.toString();
- break;
+ for (int j = 0; j < arrayParametersTypes[i].length; j++) {
+ if (j > 0) {
+ buffer.append(", ");
+ }
+ if ((i < PARAM_NAMES.length) && (j < PARAM_NAMES[i].length)) {
+ buffer.append(PARAM_NAMES[i][j]);
+ } else {
+ Parameter parameter = (Parameter) this.parameters.get(j
+ - shift);
+ String tmp = ELParser.compileEL(parameter.getValue(),
+ this.getComponentBean());
+ buffer.append(tmp);
+ }
}
+ buffer.append(")");
+ returnValue = buffer.toString();
+ found = true;
+
+ } catch (NoSuchMethodException e) {
+ methodNotFoundMessagesList.add(e.getLocalizedMessage());
+ }
} // for
+ if (!found) {
+ throw new NoSuchMethodException("Could not find methods: " + methodNotFoundMessagesList);
+ }
+
return returnValue;
}
Modified: trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/vcp/FClientIDTemplateElement.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/vcp/FClientIDTemplateElement.java 2008-04-09 17:59:16 UTC (rev 7716)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/vcp/FClientIDTemplateElement.java 2008-04-09 18:00:38 UTC (rev 7717)
@@ -24,6 +24,7 @@
import java.util.Formatter;
import org.ajax4jsf.templatecompiler.builder.CompilationContext;
+import org.ajax4jsf.templatecompiler.builder.CompilationException;
import org.ajax4jsf.templatecompiler.elements.TemplateElementBase;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
@@ -40,7 +41,7 @@
private Class type;
public FClientIDTemplateElement(final Node element,
- final CompilationContext componentBean) {
+ final CompilationContext componentBean) throws CompilationException {
super(element, componentBean);
NamedNodeMap nnm = element.getAttributes();
String sVariableName = nnm.getNamedItem("var").getNodeValue();
@@ -50,8 +51,12 @@
Class[] parameters = new Class[1];
parameters[0] = componentBean.getVariableType("context");
- this.type = componentBean.getMethodReturnedClass(componentBean
- .getVariableType("component"), "getClientId", parameters);
+ try {
+ this.type = componentBean.getMethodReturnedClass(componentBean
+ .getVariableType("component"), "getClientId", parameters);
+ } catch (NoSuchMethodException e) {
+ throw new CompilationException(e.getLocalizedMessage(), e);
+ }
componentBean.addVariable(this.strThisVariable, this.type);
}
Modified: trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/vcp/ParameterProcessor.java
===================================================================
--- trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/vcp/ParameterProcessor.java 2008-04-09 17:59:16 UTC (rev 7716)
+++ trunk/cdk/generator/src/main/java/org/ajax4jsf/templatecompiler/elements/vcp/ParameterProcessor.java 2008-04-09 18:00:38 UTC (rev 7717)
@@ -74,7 +74,7 @@
parameterType = componentBean
.loadClass(nodeType.getNodeValue());
} catch (ClassNotFoundException e) {
- throw new CompilationException();
+ throw new CompilationException(e.getLocalizedMessage(), e);
}
param = new Parameter(nodeValue.getNodeValue(),
parameterType);
16 years, 9 months
JBoss Rich Faces SVN: r7716 - branches/3.1.x/test-applications/jsp/src/main/java/util/phaseTracker.
by richfaces-svn-commits@lists.jboss.org
Author: ayanul
Date: 2008-04-09 13:59:16 -0400 (Wed, 09 Apr 2008)
New Revision: 7716
Added:
branches/3.1.x/test-applications/jsp/src/main/java/util/phaseTracker/PhaseTrackerComponent.java
Log:
Added: branches/3.1.x/test-applications/jsp/src/main/java/util/phaseTracker/PhaseTrackerComponent.java
===================================================================
--- branches/3.1.x/test-applications/jsp/src/main/java/util/phaseTracker/PhaseTrackerComponent.java (rev 0)
+++ branches/3.1.x/test-applications/jsp/src/main/java/util/phaseTracker/PhaseTrackerComponent.java 2008-04-09 17:59:16 UTC (rev 7716)
@@ -0,0 +1,60 @@
+/**
+ *
+ */
+package util.phaseTracker;
+
+import java.io.IOException;
+import java.io.StringWriter;
+import java.util.Map;
+
+import javax.faces.component.UIPanel;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+
+/**
+ * @author user
+ *
+ */
+public class PhaseTrackerComponent extends UIPanel{
+
+// private String var;
+//
+// public String getVar() {
+// if (var == null) {
+// return "pttc";
+// }
+// return var;
+// }
+//
+// public void setVar(String var) {
+// this.var = var;
+// }
+
+
+ public void encodeAll(FacesContext context) throws IOException {
+ ResponseWriter responseWriter = context.getResponseWriter();
+ StringWriter stringWriter = new StringWriter();
+ ResponseWriter clonedWriter = responseWriter.cloneWithWriter(stringWriter);
+ context.setResponseWriter(clonedWriter);
+
+ clonedWriter.flush();
+ context.setResponseWriter(responseWriter);
+
+ String string = stringWriter.toString();
+ responseWriter.write(string);
+ //System.out.println(string);
+
+ ExternalContext externalContext = context.getExternalContext();
+ Map<String, Object> requestMap = externalContext.getRequestMap();
+ requestMap.put("pttc", string);
+// requestMap.put(getAttributes().get("var"), string);
+ }
+
+ @Override
+ public String getRendererType() {
+ return null;
+ }
+
+
+}
16 years, 9 months
JBoss Rich Faces SVN: r7715 - in trunk: framework/impl/src/main/java/org/ajax4jsf/context and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2008-04-09 13:51:54 -0400 (Wed, 09 Apr 2008)
New Revision: 7715
Modified:
trunk/docs/userguide/pom.xml
trunk/framework/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java
Log:
Fix xml plugin version for a documentation builds.
Move common css after all comonents styles.
Modified: trunk/docs/userguide/pom.xml
===================================================================
--- trunk/docs/userguide/pom.xml 2008-04-09 16:41:09 UTC (rev 7714)
+++ trunk/docs/userguide/pom.xml 2008-04-09 17:51:54 UTC (rev 7715)
@@ -560,6 +560,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>xml-maven-plugin</artifactId>
+ <version>1.0-beta-2</version>
<executions>
<execution>
<id>transformTld</id>
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java 2008-04-09 16:41:09 UTC (rev 7714)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/context/AjaxContextImpl.java 2008-04-09 17:51:54 UTC (rev 7715)
@@ -284,17 +284,12 @@
}
UIViewRoot root = context.getViewRoot();
ViewResources viewResources = new ViewResources();
+ String skinStyleSheetUri = null;
try {
Skin skin = SkinFactory.getInstance().getSkin(context);
// Set default style sheet for current skin.
- String styleSheetUri = (String) skin.getParameter(context,
+ skinStyleSheetUri = (String) skin.getParameter(context,
Skin.generalStyleSheet);
- if (null != styleSheetUri) {
- String resourceURL = context.getApplication()
- .getViewHandler().getResourceURL(context,
- styleSheetUri);
- viewResources.addStyle(resourceURL);
- }
// For a "NULL" skin, do not collect components stylesheets
if ("false".equals(skin.getParameter(context,
Skin.loadStyleSheets))) {
@@ -441,6 +436,13 @@
}
Set<String> styles = viewResources.getStyles();
+ // Append Skin StyleSheet after a
+ if (null != skinStyleSheetUri) {
+ String resourceURL = context.getApplication()
+ .getViewHandler().getResourceURL(context,
+ skinStyleSheetUri);
+ styles.add(resourceURL);
+ }
if (styles.size() > 0) {
if (log.isDebugEnabled()) {
StringBuffer buff = new StringBuffer(
16 years, 9 months
JBoss Rich Faces SVN: r7714 - trunk/docs/faq/en/src/main/resources/css.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2008-04-09 12:41:09 -0400 (Wed, 09 Apr 2008)
New Revision: 7714
Modified:
trunk/docs/faq/en/src/main/resources/css/html.css
Log:
http://jira.jboss.com/jira/browse/RF-758 - css style changed
Modified: trunk/docs/faq/en/src/main/resources/css/html.css
===================================================================
--- trunk/docs/faq/en/src/main/resources/css/html.css 2008-04-09 16:32:55 UTC (rev 7713)
+++ trunk/docs/faq/en/src/main/resources/css/html.css 2008-04-09 16:41:09 UTC (rev 7714)
@@ -112,7 +112,7 @@
}
DIV.note{
- BORDER: #CECECE 1px solid; PADDING: 3px 10px 10px 50px; line-height : 14px; MARGIN: 10px 0px 10px 0px; FONT-SIZE: 11px; WIDTH: 500px; BACKGROUND-COLOR: #FFFDD3;
+ BORDER: #CECECE 1px solid; PADDING: 3px 10px 10px 50px; line-height : 14px; MARGIN: 10px 0px 10px 0px; FONT-SIZE: 11px; WIDTH: 500px; BACKGROUND-COLOR: #FFFDD3;
background-image : url('../images/ico_note.gif'); background-repeat : no-repeat; background-position :top left;
}
@@ -127,7 +127,7 @@
MARGIN-TOP: 0px; MARGIN-BOTTOM: 1em; PADDING-BOTTOM: 0px; PADDING-TOP: 0px
}
DIV.important {
- BORDER: #CECECE 1px solid; PADDING: 3px 10px 10px 50px; line-height : 14px; MARGIN: 10px 0px 10px 0px; FONT-SIZE: 11px; WIDTH: 500px; BACKGROUND-COLOR: #CFE3FF;
+ BORDER: #CECECE 1px solid; PADDING: 3px 10px 10px 50px; line-height : 14px; MARGIN: 10px 0px 10px 0px; FONT-SIZE: 11px; WIDTH: 500px; BACKGROUND-COLOR: #fee3d9;
background-image : url('../images/ico_important.gif'); background-repeat : no-repeat; background-position :top left;
}
@@ -140,7 +140,19 @@
}
+DIV.tip {
+ BORDER: #CECECE 1px solid; PADDING: 3px 10px 10px 50px; line-height : 14px; MARGIN: 10px 0px 10px 0px; FONT-SIZE: 11px; WIDTH: 500px; BACKGROUND-COLOR: #CFE3FF; background-repeat : no-repeat; background-position :top left; background-image : url('../images/ico_tip.gif');
+}
+DIV.tip *{
+ line-height : 14px;
+}
+
+.tip pre.XML {
+PADDING: 1px 1px 1px 10px;
+
+}
+
TABLE {
BORDER: #cccccc 1px solid; FONT-SIZE: 11px; BORDER-COLLAPSE: collapse; border-spacing: 0; empty-cells: hide; margin-bottom : 10px;
}
@@ -347,10 +359,15 @@
cursor: pointer;
}
-.css_comment {
-color:#3F5FBF;
+pre.CSS, pre.css {
+ line-height:0px;
+ margin-bottom:0em;
}
.css_normal {
+ line-height:0px;
+ color:#000000;
+}
+.css_colon {
color:#000000;
}
.css_semi_colon {
@@ -359,30 +376,34 @@
.css_curly_brace {
color:#000000;
}
-.css_atmark_rule {
-color:#3F7F7F;
+.css_comment {
+color:#939393;
}
+.css_error {
+color:#BF3F3F;
+}
.css_selector {
-color:#3F7F7F;
+color:#008cca;
}
-.css_media {
-color:#2A00FF;
+.css_null {
+color:#008cca;
}
-.css_string {
-color:#2A00FF;
+.css_property_name {
+color:#000000;
+font-weight:bold;
}
+.css_property_value {
+color:#ff6600;
+}
.css_uri {
color:#2A00FF;
}
-.css_property_value {
-color:#2A00FF;
+.css_atmark_rule {
+color:#3F7F7F;
}
-.css_colon {
-color:#000000;
+.css_media {
+color:#336699;
}
-.css_error {
-color:#BF3F3F;
-}
-.css_property_name {
-color:#7F007F;
-}
+.css_string {
+color:#336699;
+}
\ No newline at end of file
16 years, 9 months
JBoss Rich Faces SVN: r7713 - in trunk/docs/faq/en/src/main/resources: images and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2008-04-09 12:32:55 -0400 (Wed, 09 Apr 2008)
New Revision: 7713
Added:
trunk/docs/faq/en/src/main/resources/images/
trunk/docs/faq/en/src/main/resources/images/ico_important.gif
trunk/docs/faq/en/src/main/resources/images/ico_note.gif
trunk/docs/faq/en/src/main/resources/images/ico_tip.gif
Log:
missing folder with images was restored
Added: trunk/docs/faq/en/src/main/resources/images/ico_important.gif
===================================================================
(Binary files differ)
Property changes on: trunk/docs/faq/en/src/main/resources/images/ico_important.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/faq/en/src/main/resources/images/ico_note.gif
===================================================================
(Binary files differ)
Property changes on: trunk/docs/faq/en/src/main/resources/images/ico_note.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/faq/en/src/main/resources/images/ico_tip.gif
===================================================================
(Binary files differ)
Property changes on: trunk/docs/faq/en/src/main/resources/images/ico_tip.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
16 years, 9 months
JBoss Rich Faces SVN: r7712 - trunk/docs/faq/en/src/main/docbook/module.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2008-04-09 12:32:29 -0400 (Wed, 09 Apr 2008)
New Revision: 7712
Modified:
trunk/docs/faq/en/src/main/docbook/module/RFCfaq.xml
Log:
http://jira.jboss.com/jira/browse/RF-1207 - Seam Filter conf added
Modified: trunk/docs/faq/en/src/main/docbook/module/RFCfaq.xml
===================================================================
--- trunk/docs/faq/en/src/main/docbook/module/RFCfaq.xml 2008-04-09 16:21:48 UTC (rev 7711)
+++ trunk/docs/faq/en/src/main/docbook/module/RFCfaq.xml 2008-04-09 16:32:29 UTC (rev 7712)
@@ -879,9 +879,9 @@
<property><a4j:commandLink onclick="var myControl=this;"
oncomplete="anotherFunction(myControl)"/></property>
</emphasis>). </para>
- <important>
- <title>New:</title>
- <para> The onComplete syntax now is: </para>
+ <tip>
+ <title>Tip:</title>
+ <para>The onComplete syntax now is:</para>
<programlisting role="XML">
<![CDATA[<someAjaxActionComponent ...oncomplete="myFunc(req,event,data)".../>]]>
</programlisting>
@@ -890,7 +890,7 @@
the element instead of this. and <property>data</property> is a
variable that contains deserialized value from the
<property>data</property> attribute. </para>
- </important>
+ </tip>
</section>
<section id="InvokeOnComponentUsingWithJSF1.2">
<?dbhtml filename="InvokeOnComponentUsingWithJSF1.2.html"?>
@@ -2284,4 +2284,33 @@
Adding feature with exclusion makes it possible to use Prototype with version less than 1.6.0. This will break some of the components.</para>
</section>
+
+ <section id="fileUploadConf">
+ <?dbhtml filename="FileUploadConf.html"?>
+ <title><rich:fileUpload> with Seam</title>
+ <para>
+ The <emphasis role="bold"><property><rich:fileUpload></property></emphasis> component could work together with Seam framework.
+ </para>
+ <para>
+ Initialization parameters should be defined for Seam Filter in <property>web.xml</property>.
+ They will be automatically set up for Ajax4Jsf Filer by Seam framework on start up.
+ </para>
+ <para>
+ <emphasis role="bold">Example:</emphasis>
+ </para>
+ <programlisting role="XML"><![CDATA[...
+<filter>
+ <filter-name>Seam Filter</filter-name>
+ <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
+ <init-param>
+ <param-name>createTempFiles</param-name>
+ <param-value>true</param-value>
+ </init-param>
+ <init-param>
+ <param-name>maxRequestSize</param-name>
+ <param-value>200000</param-value>
+ </init-param>
+</filter>
+...]]></programlisting>
+ </section>
</chapter>
16 years, 9 months
JBoss Rich Faces SVN: r7711 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2008-04-09 12:21:48 -0400 (Wed, 09 Apr 2008)
New Revision: 7711
Modified:
trunk/docs/userguide/en/src/main/docbook/included/pickList.xml
Log:
http://jira.jboss.com/jira/browse/RF-2174 - Datails of Usage were changed according to doc file
Modified: trunk/docs/userguide/en/src/main/docbook/included/pickList.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/pickList.xml 2008-04-09 16:21:19 UTC (rev 7710)
+++ trunk/docs/userguide/en/src/main/docbook/included/pickList.xml 2008-04-09 16:21:48 UTC (rev 7711)
@@ -20,27 +20,22 @@
<tbody>
<row>
<entry>component-type</entry>
-
<entry>org.richfaces.PickList</entry>
</row>
<row>
<entry>component-class</entry>
-
<entry>org.richfaces.component.html.HtmlPickList</entry>
</row>
<row>
<entry>component-family</entry>
-
<entry>org.richfaces.PickList</entry>
</row>
<row>
<entry>renderer-type</entry>
-
<entry>org.richfaces.PickListRenderer</entry>
</row>
<row>
<entry>tag-class</entry>
-
<entry>org.richfaces.taglib.PickListTag</entry>
</row>
</tbody>
@@ -54,9 +49,9 @@
<emphasis role="bold">Example:</emphasis>
</para>
<programlisting role="XML"><![CDATA[...
-<rich:pickList value="#{pickBean.listValues}">
+<rich:pickList value="#{pickBean.targetValues}">
<f:selectItem itemValue="Bentley" itemLabel="Bentley"/>
- <f:selectItems value="#{pickBean.testList}"/>
+ <f:selectItems value="#{pickBean.sourceValues}"/>
</rich:pickList>
...]]></programlisting>
</section>
@@ -85,11 +80,11 @@
</para>
<para>
- The <emphasis><property>"value"</property></emphasis> attribute is used to access the values of a target list.
+ The <emphasis><property>"value"</property></emphasis> attribute is the initial value of this component.
</para>
<para>
The <emphasis role="bold"><property><f:selectItem /></property></emphasis> or <emphasis role="bold">
- <property><f:selectItems /></property></emphasis> facets are used to access the values of a source list.
+ <property><f:selectItems /></property></emphasis> facets are used to define the values of a source list.
</para>
<para>
<emphasis role="bold">Example:</emphasis>
@@ -98,7 +93,7 @@
<rich:pickList value="#{pickBean.listValues}">
<f:selectItem itemValue="Bentley" itemLabel="Bentley"/>
<f:selectItem itemValue="Audi" itemLabel="Audi"/>
- <f:selectItems value="#{pickBean.testList}"/>
+ <f:selectItems value="#{pickBean.sourceList}"/>
</rich:pickList>
...]]></programlisting>
@@ -121,7 +116,7 @@
removeAllControlLabel ="#{pickBean.removeAllLabel}" value="#{pickBean.listValues}">
<f:selectItem itemValue="Bentley" itemLabel="Bentley"/>
<f:selectItem itemValue="Audi" itemLabel="Audi"/>
- <f:selectItems value="#{pickBean.testList}"/>
+ <f:selectItems value="#{pickBean.sourceList}"/>
</rich:pickList>
...]]></programlisting>
<para>
@@ -171,10 +166,18 @@
<rich:pickList listsHeight="#{pickBean.listsHeight}" sourceListWidth="#{pickBean.sourceListWidth}" targetListWidth="#{pickBean.targetListWidth}" value="#{pickBean.listValues}">
<f:selectItem itemValue="Bentley" itemLabel="Bentley"/>
<f:selectItem itemValue="Audi" itemLabel="Audi"/>
- <f:selectItems value="#{pickBean.testList}"/>
+ <f:selectItems value="#{pickBean.sourceList}"/>
</rich:pickList>
...]]></programlisting>
+ <para>The <emphasis role="bold"><property><rich:pickList></property></emphasis> component allows to use internationalization method
+ to redefine and localize the labels. You could use application resource bundle and define
+ <property>RICH_PICK_LIST_COPY_ALL_LABEL</property>,
+ <property>RICH_PICK_LIST_COPY_LABEL</property>,
+ <property>RICH_PICK_LIST_REMOVE_ALL_LABEL</property>,
+ <property>RICH_PICK_LIST_REMOVE_LABEL</property> there.
+ </para>
+
<table>
<title>Keyboard usage for elements selection</title>
<tgroup cols="2">
16 years, 9 months