JBoss Rich Faces SVN: r15944 - in branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf: context and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-11-20 10:16:08 -0500 (Fri, 20 Nov 2009)
New Revision: 15944
Modified:
branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/application/AjaxStateManager.java
branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/context/ContextInitParameters.java
Log:
https://jira.jboss.org/jira/browse/RF-8145
Modified: branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/application/AjaxStateManager.java
===================================================================
--- branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/application/AjaxStateManager.java 2009-11-20 14:32:01 UTC (rev 15943)
+++ branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/application/AjaxStateManager.java 2009-11-20 15:16:08 UTC (rev 15944)
@@ -1,667 +1,690 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.ajax4jsf.application;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.ObjectStreamClass;
-import java.io.StringWriter;
-import java.lang.reflect.Constructor;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import javax.faces.FacesException;
-import javax.faces.FactoryFinder;
-import javax.faces.application.StateManager;
-import javax.faces.component.UIComponentBase;
-import javax.faces.component.UIViewRoot;
-import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
-import javax.faces.render.RenderKit;
-import javax.faces.render.RenderKitFactory;
-import javax.faces.render.ResponseStateManager;
-
-import org.ajax4jsf.context.AjaxContext;
-import org.ajax4jsf.context.ContextInitParameters;
-import org.ajax4jsf.model.KeepAlive;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- * @author shura
- *
- */
-public class AjaxStateManager extends StateManager {
-
-
- public static final String CAPTURED_VIEW_STATE = "org.ajax4jsf.captured_view_state";
-
- private final class SeamStateManagerWrapper extends StateManager {
- protected Object getComponentStateToSave(FacesContext arg0) {
- // do nothing
- return null;
- }
-
- protected Object getTreeStructureToSave(FacesContext arg0) {
- // do nothing
- return null;
- }
-
- protected void restoreComponentState(FacesContext arg0,
- UIViewRoot arg1, String arg2) {
- // do nothing
-
- }
-
- protected UIViewRoot restoreTreeStructure(FacesContext arg0,
- String arg1, String arg2) {
- // do nothing
- return null;
- }
-
- public UIViewRoot restoreView(FacesContext arg0, String arg1,
- String arg2) {
- // do nothing
- return null;
- }
-
- @SuppressWarnings("deprecation")
- public SerializedView saveSerializedView(FacesContext context) {
- // delegate to enclosed class method.
- Object[] viewState = buildViewState(context);
- return new SerializedView(viewState[0],viewState[1]);
- }
-
- @Override
- public Object saveView(FacesContext context) {
- // TODO Auto-generated method stub
- return buildViewState(context);
- }
- @SuppressWarnings("deprecation")
- public void writeState(FacesContext arg0, SerializedView arg1)
- throws IOException {
- // do nothing
- }
- }
-
- private static final Class<StateManager> STATE_MANAGER_ARGUMENTS = StateManager.class;
-
- public static final int DEFAULT_NUMBER_OF_VIEWS = 16;
-
- public static final String AJAX_VIEW_SEQUENCE = AjaxStateManager.class.getName()
- + ".AJAX_VIEW_SEQUENCE";
- public static final String VIEW_SEQUENCE = AjaxStateManager.class.getName()
- + ".VIEW_SEQUENCE";
-
- private final StateManager parent;
-
- private StateManager seamStateManager;
-
- private final ComponentsLoader componentLoader;
-
- private static final Log _log = LogFactory.getLog(AjaxStateManager.class);
-
- public static final String VIEW_SEQUENCE_ATTRIBUTE = AjaxStateManager.class
- .getName()
- + ".view_sequence";
-
- /**
- * @param parent
- */
- public AjaxStateManager(StateManager parent) {
- super();
- this.parent = parent;
- componentLoader = new ComponentsLoaderImpl();
- // HACK - Seam perform significant operations before save tree state.
- // Try to create it instance by reflection,
- // to call in real state saving operations.
- ClassLoader classLoader = Thread.currentThread()
- .getContextClassLoader();
- if (null == classLoader) {
- classLoader = AjaxStateManager.class.getClassLoader();
- }
- try {
- Class<? extends StateManager> seamStateManagerClass = classLoader
- .loadClass("org.jboss.seam.jsf.SeamStateManager")
- .asSubclass(StateManager.class);
- Constructor<? extends StateManager> constructor = seamStateManagerClass
- .getConstructor(STATE_MANAGER_ARGUMENTS);
- seamStateManager = constructor
- .newInstance(new Object[] { new SeamStateManagerWrapper() });
- if (_log.isDebugEnabled()) {
- _log.debug("Create instance of the SeamStateManager");
- }
- } catch (Exception e) {
- seamStateManager = null;
- if (_log.isDebugEnabled()) {
- _log.debug("SeamStateManager is not present");
- }
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.application.StateManager#getComponentStateToSave(javax.faces.context.FacesContext)
- */
- protected Object getComponentStateToSave(FacesContext context) {
- Object treeState = context.getViewRoot().processSaveState(context);
- Object state[] = { treeState, getAdditionalState(context) };
- return state;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.application.StateManager#getTreeStructureToSave(javax.faces.context.FacesContext)
- */
- protected Object getTreeStructureToSave(FacesContext context) {
- TreeStructureNode treeStructure = new TreeStructureNode();
- treeStructure.apply(context, context.getViewRoot(),
- new HashSet<String>());
- return treeStructure;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.application.StateManager#restoreComponentState(javax.faces.context.FacesContext,
- * javax.faces.component.UIViewRoot, java.lang.String)
- */
- protected void restoreComponentState(FacesContext context,
- UIViewRoot viewRoot, String renderKitId) {
- throw new UnsupportedOperationException();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.application.StateManager#restoreTreeStructure(javax.faces.context.FacesContext,
- * java.lang.String, java.lang.String)
- */
- protected UIViewRoot restoreTreeStructure(FacesContext context,
- String viewId, String renderKitId) {
- throw new UnsupportedOperationException();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.application.StateManager#writeState(javax.faces.context.FacesContext,
- * javax.faces.application.StateManager.SerializedView)
- */
- public void writeState(FacesContext context, Object state)
- throws IOException {
- RenderKit renderKit = getRenderKit(context);
- ResponseStateManager responseStateManager = renderKit
- .getResponseStateManager();
- Object[] stateArray = getStateArray( state );
- if(null == stateArray[0] && null == stateArray[1]){
- // Myfaces https://issues.apache.org/jira/browse/MYFACES-1753 hack.
- stateArray=new Object[]{getLogicalViewId(context),null};
- }
- writeState(context, responseStateManager, stateArray);
- if (_log.isDebugEnabled()) {
- _log.debug("Write view state to the response");
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.application.StateManager#writeState(javax.faces.context.FacesContext,
- * javax.faces.application.StateManager.SerializedView)
- */
- @SuppressWarnings("deprecation")
- public void writeState(FacesContext context, SerializedView state)
- throws IOException {
- RenderKit renderKit = getRenderKit(context);
- ResponseStateManager responseStateManager = renderKit
- .getResponseStateManager();
- Object[] stateArray;
- if(null == state.getState() && null == state.getStructure()){
- // MyFaces https://issues.apache.org/jira/browse/MYFACES-1753 hack
- stateArray = new Object[]{getLogicalViewId(context),null};
- } else {
- stateArray = new Object[] {
- state.getStructure(),state.getState() };
- }
- writeState(context, responseStateManager, stateArray);
- if (_log.isDebugEnabled()) {
- _log.debug("Write view state to the response");
- }
- }
-
- /**
- * @param context
- * @param state
- * @param responseStateManager
- * @throws IOException
- * @throws FacesException
- */
- private Object[] getStateArray(Object state) throws IOException,
- FacesException {
- if (null != state && state.getClass().isArray()
- && state.getClass().getComponentType().equals(Object.class)) {
- Object stateArray[] = (Object[]) state;
- if (2 == stateArray.length) {
- return stateArray;
- } else {
- throw new FacesException("Unexpected length of the state object array "+stateArray.length);
- }
- } else {
- throw new FacesException("Unexpected type of the state "+state.getClass().getName());
- }
- }
-
- private void writeState(FacesContext context,
- ResponseStateManager responseStateManager, Object[] stateArray)
- throws IOException {
- // Capture writed state into string.
- ResponseWriter originalWriter = context.getResponseWriter();
- StringWriter buff = new StringWriter(128);
- try {
- ResponseWriter stateResponseWriter = originalWriter
- .cloneWithWriter(buff);
- context.setResponseWriter(stateResponseWriter);
- responseStateManager.writeState(context, stateArray);
- stateResponseWriter.flush();
- String stateString = buff.toString();
- originalWriter.write(stateString);
- String stateValue = getStateValue(stateString);
- context.getExternalContext().getRequestMap().put(CAPTURED_VIEW_STATE, stateValue);
- if (null != stateValue) {
- } else {
- }
- } finally {
- context.setResponseWriter(originalWriter);
- }
- }
-
- static final Pattern PATTERN = Pattern.compile(".*<input.*(?:\\svalue=[\"\'](\\S*)[\"\']\\s).*name=[\"']"+ResponseStateManager.VIEW_STATE_PARAM+"[\"'].*>");
- static final Pattern PATTERN2 = Pattern.compile(".*<input .*name=[\"']"+ResponseStateManager.VIEW_STATE_PARAM+"[\"'].*(?:\\svalue=[\"\'](\\S*)[\"\']\\s).*>");
-
-
- /**
- * Parse content of the writed viewState hidden input field for a state value.
- * @param input
- * @return
- */
- private String getStateValue(String input) {
- Matcher matcher = PATTERN.matcher(input);
- if(!matcher.matches()){
- matcher = PATTERN2.matcher(input);
- if(!matcher.matches()){
- return null;
- }
- }
- return matcher.group(1);
-}
-
- private static final Map<String,Class<?>> PRIMITIVE_CLASSES =
- new HashMap<String,Class<?>>(9, 1.0F);
-
- static {
- PRIMITIVE_CLASSES.put("boolean", boolean.class);
- PRIMITIVE_CLASSES.put("byte", byte.class);
- PRIMITIVE_CLASSES.put("char", char.class);
- PRIMITIVE_CLASSES.put("short", short.class);
- PRIMITIVE_CLASSES.put("int", int.class);
- PRIMITIVE_CLASSES.put("long", long.class);
- PRIMITIVE_CLASSES.put("float", float.class);
- PRIMITIVE_CLASSES.put("double", double.class);
- PRIMITIVE_CLASSES.put("void", void.class);
- }
-
- private static final Object handleRestoreState(FacesContext context, Object state) {
- if (ContextInitParameters.isSerializeServerState(context)) {
- ObjectInputStream ois = null;
- try {
- ois = new ObjectInputStream(new ByteArrayInputStream((byte[]) state)) {
- @Override
- protected Class<?> resolveClass(ObjectStreamClass desc)
- throws IOException, ClassNotFoundException {
- String name = desc.getName();
- try {
- return Class.forName(name, true,
- Thread.currentThread().getContextClassLoader());
- } catch (ClassNotFoundException cnfe) {
- Class<?> clazz = PRIMITIVE_CLASSES.get(name);
- if (clazz != null) {
- return clazz;
- } else {
- throw cnfe;
- }
- }
- }
- };
- return ois.readObject();
- } catch (Exception e) {
- throw new FacesException(e);
- } finally {
- if (ois != null) {
- try {
- ois.close();
- } catch (IOException ignored) { }
- }
- }
- } else {
- return state;
- }
- }
-
- private static final Object handleSaveState(FacesContext context, Object state) {
- if (ContextInitParameters.isSerializeServerState(context)) {
- ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
- ObjectOutputStream oas = null;
- try {
- oas = new ObjectOutputStream(baos);
- oas.writeObject(state);
- oas.flush();
- } catch (Exception e) {
- throw new FacesException(e);
- } finally {
- if (oas != null) {
- try {
- oas.close();
- } catch (IOException ignored) { }
- }
- }
- return baos.toByteArray();
- } else {
- return state;
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.faces.application.StateManager#restoreView(javax.faces.context.FacesContext,
- * java.lang.String, java.lang.String)
- */
- public UIViewRoot restoreView(FacesContext context, String viewId,
- String renderKitId) {
- UIViewRoot viewRoot = null;
- ResponseStateManager responseStateManager = getRenderKit(context,
- renderKitId).getResponseStateManager();
- TreeStructureNode treeStructure = null;
- Object[] state = null;
- Object[] serializedView = null;
- if (isSavingStateInClient(context)) {
- serializedView = (Object[]) responseStateManager.getState(context,
- viewId);
-
- if (null != serializedView) {
- treeStructure = (TreeStructureNode) serializedView[0];
- state = (Object[]) serializedView[1];
- }
- } else {
- serializedView = restoreStateFromSession(context, viewId,
- renderKitId);
-
- if (null != serializedView) {
- treeStructure = (TreeStructureNode) serializedView[0];
- state = (Object[]) handleRestoreState(context, serializedView[1]);
- }
- }
-
- if (null != treeStructure) {
- viewRoot = (UIViewRoot) treeStructure.restore(componentLoader);
- if (null != viewRoot && null != state) {
- viewRoot.processRestoreState(context, state[0]);
- restoreAdditionalState(context, state[1]);
- }
- }
- return viewRoot;
-
- }
-
- @SuppressWarnings("deprecation")
- public SerializedView saveSerializedView(FacesContext context) {
- Object[] stateViewArray;
- if (null == seamStateManager) {
- stateViewArray = buildViewState(context);
- } else {
- // Delegate save method to seam State Manager.
- stateViewArray=(Object[]) seamStateManager.saveView(context);
- }
- return new SerializedView(stateViewArray[0],stateViewArray[1]);
- }
-
- @Override
- public Object saveView(FacesContext context) {
- if (null == seamStateManager) {
- return buildViewState(context);
- } else {
- // Delegate save method to seam State Manager.
- return seamStateManager.saveView(context);
- }
- }
- /**
- * @param context
- * @return
- * @see javax.faces.application.StateManager#isSavingStateInClient(javax.faces.context.FacesContext)
- */
- public boolean isSavingStateInClient(FacesContext context) {
- return parent.isSavingStateInClient(context);
- }
-
- protected Object[] restoreStateFromSession(FacesContext context,
- String viewId, String renderKitId) {
- String id = restoreLogicalViewId(context, viewId, renderKitId);
- StateHolder stateHolder = getStateHolder(context);
- Object[] restoredState = stateHolder.getState(context, viewId, id);
-
- if (restoredState != null && id != null) {
- context.getExternalContext().getRequestMap().put(AJAX_VIEW_SEQUENCE, id);
- }
-
- return restoredState;
- }
-
- /**
- * @param context
- * @return
- */
- protected Object[] buildViewState(FacesContext context) {
- Object[] viewStateArray = null;
- UIViewRoot viewRoot = context.getViewRoot();
- if (null != viewRoot && !viewRoot.isTransient()) {
- TreeStructureNode treeStructure = (TreeStructureNode) getTreeStructureToSave(context);
- Object state = getComponentStateToSave(context);
- if (isSavingStateInClient(context)) {
- viewStateArray = new Object[]{treeStructure, state};
- } else {
- viewStateArray = saveStateInSession(context, treeStructure,
- handleSaveState(context, state));
- }
-
- }
- return viewStateArray;
- }
-
- /**
- * @param context
- * @param treeStructure
- * @param state
- * @return
- */
- protected Object[] saveStateInSession(FacesContext context,
- Object treeStructure, Object state) {
- Object[] serializedView;
- UIViewRoot viewRoot = context.getViewRoot();
- StateHolder stateHolder = getStateHolder(context);
- String id = getLogicalViewId(context);
- stateHolder.saveState(context, viewRoot.getViewId(), id, new Object[] {
- treeStructure, state });
- serializedView = new Object[]{id, null};
- return serializedView;
- }
-
- /**
- * @param context
- * @return
- */
- protected StateHolder getStateHolder(FacesContext context) {
- return AjaxStateHolder.getInstance(context);
- }
-
- protected Object getAdditionalState(FacesContext context) {
- Map<String, Object> keepAliveBeans = new HashMap<String, Object>();
- Map<String, Object> requestMap = context.getExternalContext()
- .getRequestMap();
- // Save all objects form request map wich marked by @KeepAlive
- // annotations
- for (Entry<String, Object> requestEntry : requestMap.entrySet()) {
- Object bean = requestEntry.getValue();
- // check value for a NULL -
- // http://jira.jboss.com/jira/browse/RF-3576
- if (null != bean
- && bean.getClass().isAnnotationPresent(KeepAlive.class)) {
- keepAliveBeans.put(requestEntry.getKey(), bean);
- }
- }
- if (keepAliveBeans.size() > 0) {
- return UIComponentBase.saveAttachedState(context, keepAliveBeans);
- } else {
- return null;
- }
- }
-
- @SuppressWarnings("unchecked")
- protected void restoreAdditionalState(FacesContext context, Object state) {
- if (null != state) {
- boolean isAjax = AjaxContext.getCurrentInstance(context).isAjaxRequest();
-
- // Append all saved beans to the request map.
- Map beansMap = (Map) UIComponentBase.restoreAttachedState(context,
- state);
- Map<String, Object> requestMap = context.getExternalContext()
- .getRequestMap();
- for (Object key : beansMap.keySet()) {
- Object bean = beansMap.get(key);
- if (bean != null) {
- KeepAlive annotation = bean.getClass().getAnnotation(KeepAlive.class);
- if (annotation != null) {
- if (!isAjax && annotation.ajaxOnly()) {
-
- //skip ajax-only beans for non-ajax requests
- continue;
- }
- }
- }
-
- requestMap.put((String) key, bean);
- }
- }
- }
-
- /**
- * Restore logical view id from request.
- *
- * @param context
- * @param viewId
- * @param renderKitId
- * @return
- */
- @SuppressWarnings("deprecation")
- protected String restoreLogicalViewId(FacesContext context, String viewId,
- String renderKitId) {
- String id = (String) getRenderKit(context, renderKitId)
- .getResponseStateManager().getTreeStructureToRestore(context,
- viewId);
- return id;
- }
-
- /**
- * Return logical Id for current request view state. For a faces requests,
- * generate sequence numbers. For a ajax request, attempt to re-use id from
- * request submit.
- *
- * @param context
- * @return
- */
- protected String getLogicalViewId(FacesContext context) {
- AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
- ExternalContext externalContext = context.getExternalContext();
- Object id=null;
- Map<String, Object> requestMap = externalContext.getRequestMap();
- id = requestMap.get(ajaxContext.isAjaxRequest()?AJAX_VIEW_SEQUENCE:VIEW_SEQUENCE);
- if (null != id) {
- return id.toString();
- }
- // Store sequence in session, to avoyd claster configuration problem
- // see https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=662
- Object session = externalContext.getSession(true);
- int viewSequence;
- synchronized (session) {
- Map<String, Object> sessionMap = externalContext.getSessionMap();
- Integer sequence = (Integer) sessionMap
- .get(VIEW_SEQUENCE_ATTRIBUTE);
- if (null != sequence) {
- viewSequence = sequence.intValue();
- } else {
- viewSequence = 0;
- }
- if (viewSequence++ == Character.MAX_VALUE) {
- viewSequence = 0;
- }
- sessionMap.put(VIEW_SEQUENCE_ATTRIBUTE, new Integer(viewSequence));
- }
- String logicalViewId = UIViewRoot.UNIQUE_ID_PREFIX + ((int) viewSequence);
- // Store new viewId in the request parameters, to avoid re-increments in the same request.
- requestMap.put(VIEW_SEQUENCE,logicalViewId);
- return logicalViewId;
- }
-
- protected RenderKit getRenderKit(FacesContext context) {
- String renderKitId = null;
- UIViewRoot viewRoot = context.getViewRoot();
- if (null != viewRoot) {
- renderKitId = viewRoot.getRenderKitId();
- }
- if (null == renderKitId) {
- renderKitId = context.getApplication().getViewHandler()
- .calculateRenderKitId(context);
- }
- return getRenderKit(context, renderKitId);
- }
-
- protected RenderKit getRenderKit(FacesContext context, String renderKitId) {
- RenderKit renderKit = context.getRenderKit();
- if (null == renderKit) {
- RenderKitFactory factory = (RenderKitFactory) FactoryFinder
- .getFactory(FactoryFinder.RENDER_KIT_FACTORY);
- renderKit = factory.getRenderKit(context, renderKitId);
- }
- return renderKit;
- }
-
-}
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.ajax4jsf.application;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.ObjectStreamClass;
+import java.io.OutputStream;
+import java.io.StringWriter;
+import java.lang.reflect.Constructor;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.zip.GZIPInputStream;
+import java.util.zip.GZIPOutputStream;
+
+import javax.faces.FacesException;
+import javax.faces.FactoryFinder;
+import javax.faces.application.StateManager;
+import javax.faces.component.UIComponentBase;
+import javax.faces.component.UIViewRoot;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import javax.faces.render.RenderKit;
+import javax.faces.render.RenderKitFactory;
+import javax.faces.render.ResponseStateManager;
+
+import org.ajax4jsf.context.AjaxContext;
+import org.ajax4jsf.context.ContextInitParameters;
+import org.ajax4jsf.model.KeepAlive;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * @author shura
+ *
+ */
+public class AjaxStateManager extends StateManager {
+
+
+ public static final String CAPTURED_VIEW_STATE = "org.ajax4jsf.captured_view_state";
+
+ private final class SeamStateManagerWrapper extends StateManager {
+ protected Object getComponentStateToSave(FacesContext arg0) {
+ // do nothing
+ return null;
+ }
+
+ protected Object getTreeStructureToSave(FacesContext arg0) {
+ // do nothing
+ return null;
+ }
+
+ protected void restoreComponentState(FacesContext arg0,
+ UIViewRoot arg1, String arg2) {
+ // do nothing
+
+ }
+
+ protected UIViewRoot restoreTreeStructure(FacesContext arg0,
+ String arg1, String arg2) {
+ // do nothing
+ return null;
+ }
+
+ public UIViewRoot restoreView(FacesContext arg0, String arg1,
+ String arg2) {
+ // do nothing
+ return null;
+ }
+
+ @SuppressWarnings("deprecation")
+ public SerializedView saveSerializedView(FacesContext context) {
+ // delegate to enclosed class method.
+ Object[] viewState = buildViewState(context);
+ return new SerializedView(viewState[0],viewState[1]);
+ }
+
+ @Override
+ public Object saveView(FacesContext context) {
+ // TODO Auto-generated method stub
+ return buildViewState(context);
+ }
+ @SuppressWarnings("deprecation")
+ public void writeState(FacesContext arg0, SerializedView arg1)
+ throws IOException {
+ // do nothing
+ }
+ }
+
+ private static final Class<StateManager> STATE_MANAGER_ARGUMENTS = StateManager.class;
+
+ public static final int DEFAULT_NUMBER_OF_VIEWS = 16;
+
+ public static final String AJAX_VIEW_SEQUENCE = AjaxStateManager.class.getName()
+ + ".AJAX_VIEW_SEQUENCE";
+ public static final String VIEW_SEQUENCE = AjaxStateManager.class.getName()
+ + ".VIEW_SEQUENCE";
+
+ private final StateManager parent;
+
+ private StateManager seamStateManager;
+
+ private final ComponentsLoader componentLoader;
+
+ private static final Log _log = LogFactory.getLog(AjaxStateManager.class);
+
+ public static final String VIEW_SEQUENCE_ATTRIBUTE = AjaxStateManager.class
+ .getName()
+ + ".view_sequence";
+
+ private static final int UNCOMPRESSED_FLAG = 0;
+ private static final int COMPRESSED_FLAG = 1;
+
+ /**
+ * @param parent
+ */
+ public AjaxStateManager(StateManager parent) {
+ super();
+ this.parent = parent;
+ componentLoader = new ComponentsLoaderImpl();
+ // HACK - Seam perform significant operations before save tree state.
+ // Try to create it instance by reflection,
+ // to call in real state saving operations.
+ ClassLoader classLoader = Thread.currentThread()
+ .getContextClassLoader();
+ if (null == classLoader) {
+ classLoader = AjaxStateManager.class.getClassLoader();
+ }
+ try {
+ Class<? extends StateManager> seamStateManagerClass = classLoader
+ .loadClass("org.jboss.seam.jsf.SeamStateManager")
+ .asSubclass(StateManager.class);
+ Constructor<? extends StateManager> constructor = seamStateManagerClass
+ .getConstructor(STATE_MANAGER_ARGUMENTS);
+ seamStateManager = constructor
+ .newInstance(new Object[] { new SeamStateManagerWrapper() });
+ if (_log.isDebugEnabled()) {
+ _log.debug("Create instance of the SeamStateManager");
+ }
+ } catch (Exception e) {
+ seamStateManager = null;
+ if (_log.isDebugEnabled()) {
+ _log.debug("SeamStateManager is not present");
+ }
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.faces.application.StateManager#getComponentStateToSave(javax.faces.context.FacesContext)
+ */
+ protected Object getComponentStateToSave(FacesContext context) {
+ Object treeState = context.getViewRoot().processSaveState(context);
+ Object state[] = { treeState, getAdditionalState(context) };
+ return state;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.faces.application.StateManager#getTreeStructureToSave(javax.faces.context.FacesContext)
+ */
+ protected Object getTreeStructureToSave(FacesContext context) {
+ TreeStructureNode treeStructure = new TreeStructureNode();
+ treeStructure.apply(context, context.getViewRoot(),
+ new HashSet<String>());
+ return treeStructure;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.faces.application.StateManager#restoreComponentState(javax.faces.context.FacesContext,
+ * javax.faces.component.UIViewRoot, java.lang.String)
+ */
+ protected void restoreComponentState(FacesContext context,
+ UIViewRoot viewRoot, String renderKitId) {
+ throw new UnsupportedOperationException();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.faces.application.StateManager#restoreTreeStructure(javax.faces.context.FacesContext,
+ * java.lang.String, java.lang.String)
+ */
+ protected UIViewRoot restoreTreeStructure(FacesContext context,
+ String viewId, String renderKitId) {
+ throw new UnsupportedOperationException();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.faces.application.StateManager#writeState(javax.faces.context.FacesContext,
+ * javax.faces.application.StateManager.SerializedView)
+ */
+ public void writeState(FacesContext context, Object state)
+ throws IOException {
+ RenderKit renderKit = getRenderKit(context);
+ ResponseStateManager responseStateManager = renderKit
+ .getResponseStateManager();
+ Object[] stateArray = getStateArray( state );
+ if(null == stateArray[0] && null == stateArray[1]){
+ // Myfaces https://issues.apache.org/jira/browse/MYFACES-1753 hack.
+ stateArray=new Object[]{getLogicalViewId(context),null};
+ }
+ writeState(context, responseStateManager, stateArray);
+ if (_log.isDebugEnabled()) {
+ _log.debug("Write view state to the response");
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.faces.application.StateManager#writeState(javax.faces.context.FacesContext,
+ * javax.faces.application.StateManager.SerializedView)
+ */
+ @SuppressWarnings("deprecation")
+ public void writeState(FacesContext context, SerializedView state)
+ throws IOException {
+ RenderKit renderKit = getRenderKit(context);
+ ResponseStateManager responseStateManager = renderKit
+ .getResponseStateManager();
+ Object[] stateArray;
+ if(null == state.getState() && null == state.getStructure()){
+ // MyFaces https://issues.apache.org/jira/browse/MYFACES-1753 hack
+ stateArray = new Object[]{getLogicalViewId(context),null};
+ } else {
+ stateArray = new Object[] {
+ state.getStructure(),state.getState() };
+ }
+ writeState(context, responseStateManager, stateArray);
+ if (_log.isDebugEnabled()) {
+ _log.debug("Write view state to the response");
+ }
+ }
+
+ /**
+ * @param context
+ * @param state
+ * @param responseStateManager
+ * @throws IOException
+ * @throws FacesException
+ */
+ private Object[] getStateArray(Object state) throws IOException,
+ FacesException {
+ if (null != state && state.getClass().isArray()
+ && state.getClass().getComponentType().equals(Object.class)) {
+ Object stateArray[] = (Object[]) state;
+ if (2 == stateArray.length) {
+ return stateArray;
+ } else {
+ throw new FacesException("Unexpected length of the state object array "+stateArray.length);
+ }
+ } else {
+ throw new FacesException("Unexpected type of the state "+state.getClass().getName());
+ }
+ }
+
+ private void writeState(FacesContext context,
+ ResponseStateManager responseStateManager, Object[] stateArray)
+ throws IOException {
+ // Capture writed state into string.
+ ResponseWriter originalWriter = context.getResponseWriter();
+ StringWriter buff = new StringWriter(128);
+ try {
+ ResponseWriter stateResponseWriter = originalWriter
+ .cloneWithWriter(buff);
+ context.setResponseWriter(stateResponseWriter);
+ responseStateManager.writeState(context, stateArray);
+ stateResponseWriter.flush();
+ String stateString = buff.toString();
+ originalWriter.write(stateString);
+ String stateValue = getStateValue(stateString);
+ context.getExternalContext().getRequestMap().put(CAPTURED_VIEW_STATE, stateValue);
+ if (null != stateValue) {
+ } else {
+ }
+ } finally {
+ context.setResponseWriter(originalWriter);
+ }
+ }
+
+ static final Pattern PATTERN = Pattern.compile(".*<input.*(?:\\svalue=[\"\'](\\S*)[\"\']\\s).*name=[\"']"+ResponseStateManager.VIEW_STATE_PARAM+"[\"'].*>");
+ static final Pattern PATTERN2 = Pattern.compile(".*<input .*name=[\"']"+ResponseStateManager.VIEW_STATE_PARAM+"[\"'].*(?:\\svalue=[\"\'](\\S*)[\"\']\\s).*>");
+
+
+ /**
+ * Parse content of the writed viewState hidden input field for a state value.
+ * @param input
+ * @return
+ */
+ private String getStateValue(String input) {
+ Matcher matcher = PATTERN.matcher(input);
+ if(!matcher.matches()){
+ matcher = PATTERN2.matcher(input);
+ if(!matcher.matches()){
+ return null;
+ }
+ }
+ return matcher.group(1);
+ }
+
+ private static final Map<String,Class<?>> PRIMITIVE_CLASSES =
+ new HashMap<String,Class<?>>(9, 1.0F);
+
+ static {
+ PRIMITIVE_CLASSES.put("boolean", boolean.class);
+ PRIMITIVE_CLASSES.put("byte", byte.class);
+ PRIMITIVE_CLASSES.put("char", char.class);
+ PRIMITIVE_CLASSES.put("short", short.class);
+ PRIMITIVE_CLASSES.put("int", int.class);
+ PRIMITIVE_CLASSES.put("long", long.class);
+ PRIMITIVE_CLASSES.put("float", float.class);
+ PRIMITIVE_CLASSES.put("double", double.class);
+ PRIMITIVE_CLASSES.put("void", void.class);
+ }
+
+ private static final Object handleRestoreState(FacesContext context, Object state) {
+ if (ContextInitParameters.isSerializeServerState(context)) {
+ ObjectInputStream ois = null;
+ try {
+ ByteArrayInputStream bais = new ByteArrayInputStream((byte[]) state);
+ InputStream is = bais;
+
+ int compressionFlag = is.read();
+ if(compressionFlag == COMPRESSED_FLAG) {
+ is = new GZIPInputStream(is);
+ }
+
+ ois = new ObjectInputStream(is) {
+ @Override
+ protected Class<?> resolveClass(ObjectStreamClass desc)
+ throws IOException, ClassNotFoundException {
+ String name = desc.getName();
+ try {
+ return Class.forName(name, true,
+ Thread.currentThread().getContextClassLoader());
+ } catch (ClassNotFoundException cnfe) {
+ Class<?> clazz = PRIMITIVE_CLASSES.get(name);
+ if (clazz != null) {
+ return clazz;
+ } else {
+ throw cnfe;
+ }
+ }
+ }
+ };
+ return ois.readObject();
+ } catch (Exception e) {
+ throw new FacesException(e);
+ } finally {
+ if (ois != null) {
+ try {
+ ois.close();
+ } catch (IOException ignored) { }
+ }
+ }
+ } else {
+ return state;
+ }
+ }
+
+ private static final Object handleSaveState(FacesContext context, Object state) {
+ if (ContextInitParameters.isSerializeServerState(context)) {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
+ ObjectOutputStream oas = null;
+ try {
+ OutputStream os = baos;
+ if (ContextInitParameters.isCompressServerState(context)) {
+ os.write(COMPRESSED_FLAG);
+ os = new GZIPOutputStream(os, 1024);
+ } else {
+ os.write(UNCOMPRESSED_FLAG);
+ }
+
+ oas = new ObjectOutputStream(os);
+ oas.writeObject(state);
+ oas.flush();
+ } catch (Exception e) {
+ throw new FacesException(e);
+ } finally {
+ if (oas != null) {
+ try {
+ oas.close();
+ } catch (IOException ignored) { }
+ }
+ }
+ return baos.toByteArray();
+ } else {
+ return state;
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.faces.application.StateManager#restoreView(javax.faces.context.FacesContext,
+ * java.lang.String, java.lang.String)
+ */
+ public UIViewRoot restoreView(FacesContext context, String viewId,
+ String renderKitId) {
+ UIViewRoot viewRoot = null;
+ ResponseStateManager responseStateManager = getRenderKit(context,
+ renderKitId).getResponseStateManager();
+ TreeStructureNode treeStructure = null;
+ Object[] state = null;
+ Object[] serializedView = null;
+ if (isSavingStateInClient(context)) {
+ serializedView = (Object[]) responseStateManager.getState(context,
+ viewId);
+
+ if (null != serializedView) {
+ treeStructure = (TreeStructureNode) serializedView[0];
+ state = (Object[]) serializedView[1];
+ }
+ } else {
+ serializedView = restoreStateFromSession(context, viewId,
+ renderKitId);
+
+ if (null != serializedView) {
+ treeStructure = (TreeStructureNode) serializedView[0];
+ state = (Object[]) handleRestoreState(context, serializedView[1]);
+ }
+ }
+
+ if (null != treeStructure) {
+ viewRoot = (UIViewRoot) treeStructure.restore(componentLoader);
+ if (null != viewRoot && null != state) {
+ viewRoot.processRestoreState(context, state[0]);
+ restoreAdditionalState(context, state[1]);
+ }
+ }
+ return viewRoot;
+
+ }
+
+ @SuppressWarnings("deprecation")
+ public SerializedView saveSerializedView(FacesContext context) {
+ Object[] stateViewArray;
+ if (null == seamStateManager) {
+ stateViewArray = buildViewState(context);
+ } else {
+ // Delegate save method to seam State Manager.
+ stateViewArray=(Object[]) seamStateManager.saveView(context);
+ }
+ return new SerializedView(stateViewArray[0],stateViewArray[1]);
+ }
+
+ @Override
+ public Object saveView(FacesContext context) {
+ if (null == seamStateManager) {
+ return buildViewState(context);
+ } else {
+ // Delegate save method to seam State Manager.
+ return seamStateManager.saveView(context);
+ }
+ }
+ /**
+ * @param context
+ * @return
+ * @see javax.faces.application.StateManager#isSavingStateInClient(javax.faces.context.FacesContext)
+ */
+ public boolean isSavingStateInClient(FacesContext context) {
+ return parent.isSavingStateInClient(context);
+ }
+
+ protected Object[] restoreStateFromSession(FacesContext context,
+ String viewId, String renderKitId) {
+ String id = restoreLogicalViewId(context, viewId, renderKitId);
+ StateHolder stateHolder = getStateHolder(context);
+ Object[] restoredState = stateHolder.getState(context, viewId, id);
+
+ if (restoredState != null && id != null) {
+ context.getExternalContext().getRequestMap().put(AJAX_VIEW_SEQUENCE, id);
+ }
+
+ return restoredState;
+ }
+
+ /**
+ * @param context
+ * @return
+ */
+ protected Object[] buildViewState(FacesContext context) {
+ Object[] viewStateArray = null;
+ UIViewRoot viewRoot = context.getViewRoot();
+ if (null != viewRoot && !viewRoot.isTransient()) {
+ TreeStructureNode treeStructure = (TreeStructureNode) getTreeStructureToSave(context);
+ Object state = getComponentStateToSave(context);
+ if (isSavingStateInClient(context)) {
+ viewStateArray = new Object[]{treeStructure, state};
+ } else {
+ viewStateArray = saveStateInSession(context, treeStructure,
+ handleSaveState(context, state));
+ }
+
+ }
+ return viewStateArray;
+ }
+
+ /**
+ * @param context
+ * @param treeStructure
+ * @param state
+ * @return
+ */
+ protected Object[] saveStateInSession(FacesContext context,
+ Object treeStructure, Object state) {
+ Object[] serializedView;
+ UIViewRoot viewRoot = context.getViewRoot();
+ StateHolder stateHolder = getStateHolder(context);
+ String id = getLogicalViewId(context);
+ stateHolder.saveState(context, viewRoot.getViewId(), id, new Object[] {
+ treeStructure, state });
+ serializedView = new Object[]{id, null};
+ return serializedView;
+ }
+
+ /**
+ * @param context
+ * @return
+ */
+ protected StateHolder getStateHolder(FacesContext context) {
+ return AjaxStateHolder.getInstance(context);
+ }
+
+ protected Object getAdditionalState(FacesContext context) {
+ Map<String, Object> keepAliveBeans = new HashMap<String, Object>();
+ Map<String, Object> requestMap = context.getExternalContext()
+ .getRequestMap();
+ // Save all objects form request map wich marked by @KeepAlive
+ // annotations
+ for (Entry<String, Object> requestEntry : requestMap.entrySet()) {
+ Object bean = requestEntry.getValue();
+ // check value for a NULL -
+ // http://jira.jboss.com/jira/browse/RF-3576
+ if (null != bean
+ && bean.getClass().isAnnotationPresent(KeepAlive.class)) {
+ keepAliveBeans.put(requestEntry.getKey(), bean);
+ }
+ }
+ if (keepAliveBeans.size() > 0) {
+ return UIComponentBase.saveAttachedState(context, keepAliveBeans);
+ } else {
+ return null;
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ protected void restoreAdditionalState(FacesContext context, Object state) {
+ if (null != state) {
+ boolean isAjax = AjaxContext.getCurrentInstance(context).isAjaxRequest();
+
+ // Append all saved beans to the request map.
+ Map beansMap = (Map) UIComponentBase.restoreAttachedState(context,
+ state);
+ Map<String, Object> requestMap = context.getExternalContext()
+ .getRequestMap();
+ for (Object key : beansMap.keySet()) {
+ Object bean = beansMap.get(key);
+ if (bean != null) {
+ KeepAlive annotation = bean.getClass().getAnnotation(KeepAlive.class);
+ if (annotation != null) {
+ if (!isAjax && annotation.ajaxOnly()) {
+
+ //skip ajax-only beans for non-ajax requests
+ continue;
+ }
+ }
+ }
+
+ requestMap.put((String) key, bean);
+ }
+ }
+ }
+
+ /**
+ * Restore logical view id from request.
+ *
+ * @param context
+ * @param viewId
+ * @param renderKitId
+ * @return
+ */
+ @SuppressWarnings("deprecation")
+ protected String restoreLogicalViewId(FacesContext context, String viewId,
+ String renderKitId) {
+ String id = (String) getRenderKit(context, renderKitId)
+ .getResponseStateManager().getTreeStructureToRestore(context,
+ viewId);
+ return id;
+ }
+
+ /**
+ * Return logical Id for current request view state. For a faces requests,
+ * generate sequence numbers. For a ajax request, attempt to re-use id from
+ * request submit.
+ *
+ * @param context
+ * @return
+ */
+ protected String getLogicalViewId(FacesContext context) {
+ AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
+ ExternalContext externalContext = context.getExternalContext();
+ Object id=null;
+ Map<String, Object> requestMap = externalContext.getRequestMap();
+ id = requestMap.get(ajaxContext.isAjaxRequest()?AJAX_VIEW_SEQUENCE:VIEW_SEQUENCE);
+ if (null != id) {
+ return id.toString();
+ }
+ // Store sequence in session, to avoyd claster configuration problem
+ // see https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=662
+ Object session = externalContext.getSession(true);
+ int viewSequence;
+ synchronized (session) {
+ Map<String, Object> sessionMap = externalContext.getSessionMap();
+ Integer sequence = (Integer) sessionMap
+ .get(VIEW_SEQUENCE_ATTRIBUTE);
+ if (null != sequence) {
+ viewSequence = sequence.intValue();
+ } else {
+ viewSequence = 0;
+ }
+ if (viewSequence++ == Character.MAX_VALUE) {
+ viewSequence = 0;
+ }
+ sessionMap.put(VIEW_SEQUENCE_ATTRIBUTE, new Integer(viewSequence));
+ }
+ String logicalViewId = UIViewRoot.UNIQUE_ID_PREFIX + ((int) viewSequence);
+ // Store new viewId in the request parameters, to avoid re-increments in the same request.
+ requestMap.put(VIEW_SEQUENCE,logicalViewId);
+ return logicalViewId;
+ }
+
+ protected RenderKit getRenderKit(FacesContext context) {
+ String renderKitId = null;
+ UIViewRoot viewRoot = context.getViewRoot();
+ if (null != viewRoot) {
+ renderKitId = viewRoot.getRenderKitId();
+ }
+ if (null == renderKitId) {
+ renderKitId = context.getApplication().getViewHandler()
+ .calculateRenderKitId(context);
+ }
+ return getRenderKit(context, renderKitId);
+ }
+
+ protected RenderKit getRenderKit(FacesContext context, String renderKitId) {
+ RenderKit renderKit = context.getRenderKit();
+ if (null == renderKit) {
+ RenderKitFactory factory = (RenderKitFactory) FactoryFinder
+ .getFactory(FactoryFinder.RENDER_KIT_FACTORY);
+ renderKit = factory.getRenderKit(context, renderKitId);
+ }
+ return renderKit;
+ }
+
+}
Modified: branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/context/ContextInitParameters.java
===================================================================
--- branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/context/ContextInitParameters.java 2009-11-20 14:32:01 UTC (rev 15943)
+++ branches/community/3.3.X/framework/impl/src/main/java/org/ajax4jsf/context/ContextInitParameters.java 2009-11-20 15:16:08 UTC (rev 15944)
@@ -51,7 +51,20 @@
"com.sun.faces.serializeServerState",
"org.apache.myfaces.SERIALIZE_STATE_IN_SESSION"
};
+
+ /**
+ * @since 3.3.3
+ */
+ public static final String[] COMPRESS_SERVER_STATE = new String[] {
+ "org.ajax4jsf.COMPRESS_SERVER_STATE",
+
+ /* detect MyFaces vs. RI */
+ "com.sun.faces.compressViewState",
+ "org.apache.myfaces.COMPRESS_STATE_IN_SESSION",
+ "com.sun.faces.COMPRESS_STATE"
+ };
+
public static final String[] NUMBER_OF_VIEWS_IN_SESSION = {"com.sun.faces.numberOfViewsInSession"};
public static final String[] NUMBER_OF_LOGICAL_VIEWS_IN_SESSION = {"com.sun.faces.numberOfLogicalViews"};
@@ -66,6 +79,15 @@
public static final boolean isSerializeServerState(FacesContext context) {
return getBoolean(context, SERIALIZE_SERVER_STATE, false);
}
+
+ /**
+ * @since 3.3.3
+ * @param context
+ * @return
+ */
+ public static final boolean isCompressServerState(FacesContext context) {
+ return getBoolean(context, COMPRESS_SERVER_STATE, true);
+ }
/**
* Get number of views for store in session by {@link AjaxStateManager}
15 years, 1 month
JBoss Rich Faces SVN: r15943 - in branches/community/3.3.X/samples/richfaces-demo/src/main: webapp/richfaces/message and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2009-11-20 09:32:01 -0500 (Fri, 20 Nov 2009)
New Revision: 15943
Modified:
branches/community/3.3.X/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties
branches/community/3.3.X/samples/richfaces-demo/src/main/webapp/richfaces/message/examples/form.xhtml
branches/community/3.3.X/samples/richfaces-demo/src/main/webapp/richfaces/message/usage.xhtml
branches/community/3.3.X/samples/richfaces-demo/src/main/webapp/richfaces/messages/usage.xhtml
branches/community/3.3.X/samples/richfaces-demo/src/main/webapp/richfaces/panelMenu/examples/example.xhtml
branches/community/3.3.X/samples/richfaces-demo/src/main/webapp/richfaces/panelMenu/usage.xhtml
Log:
Modified: branches/community/3.3.X/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties 2009-11-20 11:52:39 UTC (rev 15942)
+++ branches/community/3.3.X/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties 2009-11-20 14:32:01 UTC (rev 15943)
@@ -78,7 +78,7 @@
inplaceInput= richInputs, Inplace Input, /images/ico_InplaceInput.gif, \t\t/images/cn_InplaceInput.gif, rich_inplaceInput.html, rich/inplaceInput.html, org/richfaces/component/UIInplaceInput.html, \t\t\t\t\t/richfaces/inplaceInput.jsf
inplaceSelect= richInputs, Inplace Select, /images/ico_InplaceSelect.gif, \t\t/images/cn_InplaceSelect.gif, rich_inplaceSelect.html, rich/inplaceSelect.html, org/richfaces/component/UIInplaceSelect.html, \t\t\t\t\t/richfaces/inplaceSelect.jsf
sorting=richDataIterators, Table Sorting, \t/images/ico_TableSorting.gif, \t\t/images/cn_TableSorting.gif, rich_dataTable.html, rich/dataTable.html, org/richfaces/component/UIDataTable.html, \t\t\t\t\t/richfaces/sortingFeature.jsf
-filtering=richDataIterators, Table Filtering, \t/images/ico_TableFiltering.gif, \t\t/images/cn_TableFiltering.gif, rich_dataTable.html, rich/dataTable.html, org/richfaces/component/UIDataTable.html, \t\t\t\t\t/richfaces/filteringFeature.jsf , new
+filtering=richDataIterators, Table Filtering, \t/images/ico_TableFiltering.gif, \t\t/images/cn_TableFiltering.gif, rich_dataTable.html, rich/dataTable.html, org/richfaces/component/UIDataTable.html, \t\t\t\t\t/richfaces/filteringFeature.jsf
columns =richDataIterators, \t Columns, \t\t\t/images/ico_columns.gif, \t\t/images/cn_Columns.gif, rich_columns.html, rich/columns.html, org/richfaces/taglib/ColumnsTag.html, \t\t\t\t\t/richfaces/columns.jsf
fileUpload =richInputs, \t File Upload, \t\t/images/ico_FileUpload.gif, \t\t/images/cn_FileUpload.gif, rich_fileUpload.html, rich/fileUpload.html, org/richfaces/component/UIFileUpload.html, \t\t\t\t\t/richfaces/fileUpload.jsf
StandardSkinning =richMisc, \t Standard Skinning, \t\t/images/ico_StandardComponentsSkinning.gif, \t\t/images/cn_StandardComponentsSkinning.gif, ArchitectureOverview.html\#StControlsSkinning, rich/StandardSkinning.html, org/richfaces/component/UIfileUpload.html, \t\t\t\t\t/richfaces/standardSkinning.jsf
@@ -88,7 +88,7 @@
beanValidator=richValidators, \t Bean Validator, \t\t/images/ico_BeanValidator.gif, \t\t/images/cn_BeanValidator.gif, beanValidator.html, rich/beanValidator.html, org/richfaces/component/UIBeanValidator.html, \t\t\t\t\t/richfaces/beanValidator.jsf
graphValidator=richValidators, \t Graph Validator, \t\t/images/ico_GraphValidator.gif, \t\t/images/cn_GraphValidator.gif, graphValidator.html, rich/graphValidator.html, org/richfaces/component/UIGraphValidator.html, \t\t\t\t\t/richfaces/graphValidator.jsf
stateAPI=richMisc, \t State Manager API, \t\t/images/ico_StateManagerAPI.gif, \t\t/images/cn_StateManagerAPI.gif, ArchitectureOverview.html\#statemanagerapi, rich/graphValidator.html, org/richfaces/component/UIhotkey.html, \t\t\t\t\t/richfaces/stateAPI.jsf
-extendedDataTable=richDataIterators, Extended Data Table, /images/ico_ExtendedDataTable.gif, /images/cn_ExtendedDataTable.gif, rich_extendedDataTable.html, rich/extendedDataTable.html, org/richfaces/component/UIExtendedDataTable.html, /richfaces/extendedDataTable.jsf, new
+extendedDataTable=richDataIterators, Extended Data Table, /images/ico_ExtendedDataTable.gif, /images/cn_ExtendedDataTable.gif, rich_extendedDataTable.html, rich/extendedDataTable.html, org/richfaces/component/UIExtendedDataTable.html, /richfaces/extendedDataTable.jsf
editor=richInputs, Editor, /images/ico_Editor.gif, /images/cn_Editor.gif, rich_editor.html, rich/editor.html, org/richfaces/component/UIEditor.html, /richfaces/editor.jsf
queue=ajaxSupport, Queue, /images/ico_common.gif, /images/cn_Queue.gif, queue.html, a4j/queue.html, org/ajax4jsf/component/UIQueue.html, /richfaces/queue.jsf
colorPicker= richInputs, Color Picker, /images/ico_ColorPicker.gif, /images/cn_ColorPicker.gif, rich_colorPicker.html, rich/colorPicker.html, org/richfaces/component/UIColorPicker.html, /richfaces/colorPicker.jsf
Modified: branches/community/3.3.X/samples/richfaces-demo/src/main/webapp/richfaces/message/examples/form.xhtml
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/src/main/webapp/richfaces/message/examples/form.xhtml 2009-11-20 11:52:39 UTC (rev 15942)
+++ branches/community/3.3.X/samples/richfaces-demo/src/main/webapp/richfaces/message/examples/form.xhtml 2009-11-20 14:32:01 UTC (rev 15943)
@@ -27,9 +27,6 @@
<f:validateLength minimum="3" />
</h:inputText>
<rich:message for="name">
- <f:facet name="passedMarker">
- <h:graphicImage value="/images/ajax/passed.gif" />
- </f:facet>
<f:facet name="errorMarker">
<h:graphicImage value="/images/ajax/error.gif" />
</f:facet>
@@ -40,47 +37,31 @@
<f:validateLength minimum="3" maximum="50" />
</h:inputText>
<rich:message for="job">
- <f:facet name="passedMarker">
- <h:graphicImage value="/images/ajax/passed.gif" />
- </f:facet>
<f:facet name="errorMarker">
<h:graphicImage value="/images/ajax/error.gif" />
</f:facet>
</rich:message>
-
-
-
<h:outputText value="Address:" />
<h:inputText label="Address" id="address" required="true" value="#{userBean.address}">
<f:validateLength minimum="10" />
</h:inputText>
<rich:message for="address">
- <f:facet name="passedMarker">
- <h:graphicImage value="/images/ajax/passed.gif" />
- </f:facet>
<f:facet name="errorMarker">
<h:graphicImage value="/images/ajax/error.gif" />
</f:facet>
</rich:message>
-
<h:outputText value="Zip:" />
<h:inputText label="Zip" id="zip" required="true" value="#{userBean.zip}">
<f:validateLength minimum="4" maximum="9" />
</h:inputText>
<rich:message for="zip">
- <f:facet name="passedMarker">
- <h:graphicImage value="/images/ajax/passed.gif" />
- </f:facet>
<f:facet name="errorMarker">
<h:graphicImage value="/images/ajax/error.gif" />
</f:facet>
</rich:message>
-
<f:facet name="footer">
<a4j:commandButton value="Validate" />
</f:facet>
-
-
</h:panelGrid>
</h:form>
</rich:panel>
Modified: branches/community/3.3.X/samples/richfaces-demo/src/main/webapp/richfaces/message/usage.xhtml
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/src/main/webapp/richfaces/message/usage.xhtml 2009-11-20 11:52:39 UTC (rev 15942)
+++ branches/community/3.3.X/samples/richfaces-demo/src/main/webapp/richfaces/message/usage.xhtml 2009-11-20 14:32:01 UTC (rev 15943)
@@ -14,7 +14,7 @@
<ul>
<li>does not require to be wrapped with a4j:outputPanel in order to be rendered during the
Ajax requests</li>
- <li>allows to have a "passed" or "failed" marker before the text label</li>
+ <li>allows to define different "failed" markers before the text labels</li>
<li>has a predefined css class names for different kinds of message severities</li>
</ul>
</p>
Modified: branches/community/3.3.X/samples/richfaces-demo/src/main/webapp/richfaces/messages/usage.xhtml
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/src/main/webapp/richfaces/messages/usage.xhtml 2009-11-20 11:52:39 UTC (rev 15942)
+++ branches/community/3.3.X/samples/richfaces-demo/src/main/webapp/richfaces/messages/usage.xhtml 2009-11-20 14:32:01 UTC (rev 15943)
@@ -14,7 +14,7 @@
<ul>
<li>does not require to be wrapped with a4j:outputPanel in order to be rendered during the
Ajax requests</li>
- <li>allows to have one "passed" or a few "failed" markers before the text labels</li>
+ <li>allows to define different "failed" markers before the text labels</li>
<li>has a predefined css class names for different kinds of messages severities</li>
</ul>
</p>
Modified: branches/community/3.3.X/samples/richfaces-demo/src/main/webapp/richfaces/panelMenu/examples/example.xhtml
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/src/main/webapp/richfaces/panelMenu/examples/example.xhtml 2009-11-20 11:52:39 UTC (rev 15942)
+++ branches/community/3.3.X/samples/richfaces-demo/src/main/webapp/richfaces/panelMenu/examples/example.xhtml 2009-11-20 14:32:01 UTC (rev 15943)
@@ -9,12 +9,11 @@
<style>
.cols{
vertical-align:top;
- width:50%;
}
</style>
<h:form id="form">
- <h:panelGrid columns="2" columnClasses="cols" width="100%">
- <rich:panelMenu style="width:200px" mode="ajax"
+ <h:panelGrid columns="2" columnClasses="cols,cols" width="400">
+ <rich:panelMenu style="width:200px" mode="ajax"
iconExpandedGroup="disc" iconCollapsedGroup="disc"
iconExpandedTopGroup="chevronUp" iconGroupTopPosition="right"
iconCollapsedTopGroup="chevronDown">
Modified: branches/community/3.3.X/samples/richfaces-demo/src/main/webapp/richfaces/panelMenu/usage.xhtml
===================================================================
--- branches/community/3.3.X/samples/richfaces-demo/src/main/webapp/richfaces/panelMenu/usage.xhtml 2009-11-20 11:52:39 UTC (rev 15942)
+++ branches/community/3.3.X/samples/richfaces-demo/src/main/webapp/richfaces/panelMenu/usage.xhtml 2009-11-20 14:32:01 UTC (rev 15943)
@@ -6,7 +6,6 @@
xmlns:rich="http://richfaces.org/rich">
<ui:composition template="/templates/component-sample.xhtml">
<ui:define name="sample">
-
<p>
The rich:panelMenu component is used to define a collapsible side-menu panel. The component has a pre-defined
skinable look-n-feel. You can customize it with styles and a set of component attributes. The folowing demo
15 years, 1 month
JBoss Rich Faces SVN: r15942 - in branches/sandbox/3.3.X_JSF2/samples/richfaces-demo/functional-test/src/test/resources: org/jboss/richfaces/integrationTest/extendedDataTable and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2009-11-20 06:52:39 -0500 (Fri, 20 Nov 2009)
New Revision: 15942
Modified:
branches/sandbox/3.3.X_JSF2/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/extendedDataTable/locators.properties
branches/sandbox/3.3.X_JSF2/samples/richfaces-demo/functional-test/src/test/resources/testng.xml
Log:
ExtendedDataTable: FilteringTestCase fails with exception for duplicate component ID
https://jira.jboss.org/jira/browse/RF-8031
Modified: branches/sandbox/3.3.X_JSF2/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/extendedDataTable/locators.properties
===================================================================
--- branches/sandbox/3.3.X_JSF2/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/extendedDataTable/locators.properties 2009-11-20 11:49:53 UTC (rev 15941)
+++ branches/sandbox/3.3.X_JSF2/samples/richfaces-demo/functional-test/src/test/resources/org/jboss/richfaces/integrationTest/extendedDataTable/locators.properties 2009-11-20 11:52:39 UTC (rev 15942)
@@ -1,9 +1,9 @@
-TH_STATE=//*[contains(@class,'extdt-sortable-header') and text()\='State Name']
-TH_CAPITAL=//*[contains(@class,'extdt-sortable-header') and text()\='State Capital']
-TH_TIME_ZONE=//*[contains(@class,'extdt-sortable-header') and text()\='Time Zone']
-TH_FLAG=//*[contains(@class,'extdt-sortable-header') and text()\='Flag']
+TH_STATE=//*[contains(@id,'state_name')]
+TH_CAPITAL=//*[contains(@id,'state_capital')]
+TH_TIME_ZONE=//*[contains(@id,'time_zone')]
+TH_FLAG=//*[contains(@id,'flag')]
TD_PREFORMATTED=//*[contains(@class,'extdt-maindiv')]//*[contains(@class,'rich-extdt-firstrow')]{0,choice,0\#|1\#[{0}]}/*[contains(@class,'rich-extdt-cell')]{1,choice,0\#|1\#[{1}]}
TABLE_EXTENDED=//*[contains(@class,'extdt-maindiv')]
-TH_RELATIVE={0}/../../..
+TH_RELATIVE={0}/../../../..
INPUT_COLUMN_FILTER=//*[contains(@class,'extdt-maindiv')]//*[contains(@class,'extdt-table-filterrow')]//*[contains(@class,'rich-extdt-subheadercell')][{0}]//*[@type\='text']
DIV_SPLASH_SCREEN=//*[@class\='extdt-ss-vsbl']
\ No newline at end of file
Modified: branches/sandbox/3.3.X_JSF2/samples/richfaces-demo/functional-test/src/test/resources/testng.xml
===================================================================
--- branches/sandbox/3.3.X_JSF2/samples/richfaces-demo/functional-test/src/test/resources/testng.xml 2009-11-20 11:49:53 UTC (rev 15941)
+++ branches/sandbox/3.3.X_JSF2/samples/richfaces-demo/functional-test/src/test/resources/testng.xml 2009-11-20 11:52:39 UTC (rev 15942)
@@ -1,7 +1,7 @@
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="seleniumTest">
-<!-- <test
+ <test
name="org.jboss.richfaces.integrationTest.actionParameter.ActionParameterTestCase">
<classes>
<class
@@ -226,7 +226,7 @@
<class
name="org.jboss.richfaces.integrationTest.extendedDataTable.DraggingTestCase" />
</classes>
- </test>-->
+ </test>
<test name="org.jboss.richfaces.integrationTest.extendedDataTable.FilteringTestCase">
<classes>
@@ -234,7 +234,6 @@
</classes>
</test>
-<!--
<test
name="org.jboss.richfaces.integrationTest.extendedDataTable.GroupingTestCase">
<classes>
@@ -506,7 +505,6 @@
name="org.jboss.richfaces.integrationTest.suggestionBox.SuggestionBoxTestCase" />
</classes>
</test>
--->
<test
name="org.jboss.richfaces.integrationTest.tableFiltering.TableFilteringTestCase">
@@ -516,7 +514,6 @@
</classes>
</test>
-<!--
<test
name="org.jboss.richfaces.integrationTest.tableSorting.TableSortingTestCase">
<classes>
@@ -573,7 +570,6 @@
<class name="org.jboss.richfaces.integrationTest.tree.TreeTestCase" />
</classes>
</test>
--->
</suite>
15 years, 1 month
JBoss Rich Faces SVN: r15941 - branches/sandbox/3.3.X_JSF2/samples/richfaces-demo/src/main/webapp/richfaces/extendedDataTable/examples.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2009-11-20 06:49:53 -0500 (Fri, 20 Nov 2009)
New Revision: 15941
Modified:
branches/sandbox/3.3.X_JSF2/samples/richfaces-demo/src/main/webapp/richfaces/extendedDataTable/examples/simple.xhtml
Log:
ExtendedDataTable: FilteringTestCase fails with exception for duplicate component ID
https://jira.jboss.org/jira/browse/RF-8031
Modified: branches/sandbox/3.3.X_JSF2/samples/richfaces-demo/src/main/webapp/richfaces/extendedDataTable/examples/simple.xhtml
===================================================================
--- branches/sandbox/3.3.X_JSF2/samples/richfaces-demo/src/main/webapp/richfaces/extendedDataTable/examples/simple.xhtml 2009-11-20 05:43:01 UTC (rev 15940)
+++ branches/sandbox/3.3.X_JSF2/samples/richfaces-demo/src/main/webapp/richfaces/extendedDataTable/examples/simple.xhtml 2009-11-20 11:49:53 UTC (rev 15941)
@@ -7,7 +7,7 @@
xmlns:rich="http://richfaces.org/rich">
<ui:composition>
- <h:form>
+ <h:form id="form">
<h:panelGrid columns="2" columnClasses="top , top">
<rich:extendedDataTable
value="#{extendedTableBean.capitalsDataModel}" var="cap" id="table"
@@ -16,35 +16,35 @@
selectionMode="#{extendedTableBean.selectionMode}"
tableState="#{extendedTableBean.tableState}"
selection="#{extendedTableBean.selection}">
- <rich:column sortable="false" label="Flag">
+ <rich:column sortable="false" label="Flag" id="col_1">
<f:facet name="header">
- <h:outputText value="Flag" />
+ <h:outputText value="Flag" id="flag"/>
</f:facet>
- <h:graphicImage value="#{cap.stateFlag}" />
+ <h:graphicImage value="#{cap.stateFlag}" id="cap_state_flag"/>
</rich:column>
- <rich:column sortable="true" sortBy="#{cap.state}"
+ <rich:column sortable="true" sortBy="#{cap.state}" id="col_2"
filterBy="#{cap.state}" filterEvent="onkeyup" width="170px"
label="State Name">
<f:facet name="header">
- <h:outputText value="State Name" />
+ <h:outputText value="State Name" id="state_name"/>
</f:facet>
- <h:outputText value="#{cap.state}" />
+ <h:outputText value="#{cap.state}" id="cap_state"/>
</rich:column>
- <rich:column sortable="true" sortBy="#{cap.name}"
+ <rich:column sortable="true" sortBy="#{cap.name}" id="col_3"
filterBy="#{cap.name}" filterEvent="onkeyup" width="170px"
label="State Capital">
<f:facet name="header">
- <h:outputText value="State Capital" />
+ <h:outputText value="State Capital" id="state_capital"/>
</f:facet>
- <h:outputText value="#{cap.name}" />
+ <h:outputText value="#{cap.name}" id="cap_name"/>
</rich:column>
- <rich:column sortable="false" label="Time Zone">
+ <rich:column sortable="false" label="Time Zone" id="col_4">
<f:facet name="header">
- <h:outputText value="Time Zone" />
+ <h:outputText value="Time Zone" id="time_zone"/>
</f:facet>
- <h:outputText value="#{cap.timeZone}" />
+ <h:outputText value="#{cap.timeZone}" id="cap_time_zone"/>
</rich:column>
- <a4j:support reRender="selectiontable"
+ <a4j:support reRender="selectiontable" id="extended_table_bean_take_selection"
action="#{extendedTableBean.takeSelection}"
event="onselectionchange" />
</rich:extendedDataTable>
@@ -58,11 +58,11 @@
<h:selectOneMenu value="#{extendedTableBean.sortMode}">
<f:selectItem itemLabel="Single" itemValue="single" />
<f:selectItem itemLabel="Multi" itemValue="multi" />
- <a4j:support event="onchange" ajaxSingle="true" reRender="table" />
+ <a4j:support event="onchange" ajaxSingle="true" reRender="table" id="support_sort_onchange"/>
</h:selectOneMenu>
<h:outputText value="Selection Mode:" />
<h:selectOneMenu value="#{extendedTableBean.selectionMode}">
- <a4j:support ajaxSingle="true" event="onchange" reRender="table" />
+ <a4j:support ajaxSingle="true" event="onchange" reRender="table" id="support_select_onchange"/>
<f:selectItem itemLabel="Single" itemValue="single" />
<f:selectItem itemLabel="Multi" itemValue="multi" />
<f:selectItem itemLabel="None" itemValue="none" />
15 years, 1 month
JBoss Rich Faces SVN: r15940 - in root/docs/trunk: Developer_Guide and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: SeanRogers
Date: 2009-11-20 00:43:01 -0500 (Fri, 20 Nov 2009)
New Revision: 15940
Added:
root/docs/trunk/Component_Development_Kit_Guide/publican.cfg
root/docs/trunk/Developer_Guide/publican.cfg
root/docs/trunk/Migration_Guide/publican.cfg
Log:
Converted all to Publican 1
Added: root/docs/trunk/Component_Development_Kit_Guide/publican.cfg
===================================================================
--- root/docs/trunk/Component_Development_Kit_Guide/publican.cfg (rev 0)
+++ root/docs/trunk/Component_Development_Kit_Guide/publican.cfg 2009-11-20 05:43:01 UTC (rev 15940)
@@ -0,0 +1,7 @@
+# Config::Simple 4.59
+# Fri Nov 20 15:18:13 2009
+
+show_remarks: 1
+debug: 1
+xml_lang: en-US
+
Added: root/docs/trunk/Developer_Guide/publican.cfg
===================================================================
--- root/docs/trunk/Developer_Guide/publican.cfg (rev 0)
+++ root/docs/trunk/Developer_Guide/publican.cfg 2009-11-20 05:43:01 UTC (rev 15940)
@@ -0,0 +1,7 @@
+# Config::Simple 4.59
+# Fri Nov 20 15:18:45 2009
+
+show_remarks: 1
+debug: 1
+xml_lang: en-US
+
Added: root/docs/trunk/Migration_Guide/publican.cfg
===================================================================
--- root/docs/trunk/Migration_Guide/publican.cfg (rev 0)
+++ root/docs/trunk/Migration_Guide/publican.cfg 2009-11-20 05:43:01 UTC (rev 15940)
@@ -0,0 +1,7 @@
+# Config::Simple 4.59
+# Fri Nov 20 15:18:57 2009
+
+show_remarks: 1
+debug: 1
+xml_lang: en-US
+
15 years, 1 month
JBoss Rich Faces SVN: r15939 - in root/docs/trunk/Component_Reference: en-US and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: SeanRogers
Date: 2009-11-20 00:39:44 -0500 (Fri, 20 Nov 2009)
New Revision: 15939
Added:
root/docs/trunk/Component_Reference/en-US/extras/
root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-a4jactionParam-a4jactionParam_example.js
root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-a4jactionParam-a4jactionParam_example.xmlt
root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-a4jjsFunction-a4jjsFunction_example.xmlt
root/docs/trunk/Component_Reference/publican.cfg
Modified:
root/docs/trunk/Component_Reference/en-US/Actions.xml
root/docs/trunk/Component_Reference/en-US/Common_Ajax_attributes.xml
root/docs/trunk/Component_Reference/en-US/Menus_and_toolbars.xml
root/docs/trunk/Component_Reference/en-US/Panels_and_containers.xml
root/docs/trunk/Component_Reference/en-US/Preface.xml
root/docs/trunk/Component_Reference/en-US/Revision_History.xml
root/docs/trunk/Component_Reference/en-US/Rich_inputs.xml
root/docs/trunk/Component_Reference/en-US/Tables_and_grids.xml
Log:
Converted to Publican 1 and added code extras
Modified: root/docs/trunk/Component_Reference/en-US/Actions.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/Actions.xml 2009-11-20 03:19:39 UTC (rev 15938)
+++ root/docs/trunk/Component_Reference/en-US/Actions.xml 2009-11-20 05:39:44 UTC (rev 15939)
@@ -37,10 +37,10 @@
</para>
<example id="exam-Component_Reference-a4jactionParam-a4jactionParam_example">
<title><a4j:actionParam> example</title>
-<programlisting language="xml">
-<xi:include parse="text" href="extras/exam-Component_Reference-a4jactionParam-a4jactionParam_example.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+<programlisting language="XML" role="XML">
+<xi:include parse="text" href="extras/exam-Component_Reference-a4jactionParam-a4jactionParam_example.xmlt" xmlns:xi="http://www.w3.org/2001/XInclude" />
</programlisting>
-<programlisting language="java">
+<programlisting language="Java" role="JAVA">
<xi:include parse="text" href="extras/exam-Component_Reference-a4jactionParam-a4jactionParam_example.js" xmlns:xi="http://www.w3.org/2001/XInclude" />
</programlisting>
</example>
@@ -197,8 +197,8 @@
<example id="exam-Component_Reference-a4jjsFunction-a4jjsFunction_example">
<title><a4j:jsFunction> example</title>
-<programlisting language="xml">
-<xi:include href="extras/exam-Component_Reference-a4jjsFunction-a4jjsFunction_example.xml" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
+<programlisting language="XML" role="XML">
+<xi:include href="extras/exam-Component_Reference-a4jjsFunction-a4jjsFunction_example.xmlt" parse="text" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
</programlisting>
</example>
<para>
Modified: root/docs/trunk/Component_Reference/en-US/Common_Ajax_attributes.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/Common_Ajax_attributes.xml 2009-11-20 03:19:39 UTC (rev 15938)
+++ root/docs/trunk/Component_Reference/en-US/Common_Ajax_attributes.xml 2009-11-20 05:39:44 UTC (rev 15939)
@@ -20,7 +20,7 @@
<example id="exam-Component_Reference-render-render_example">
<title>render example</title>
-<programlisting language="xml">
+<programlisting language="XML" role="XML">
<h:form id="form1">
<a4j:commandButton value="Basic reference" render="infoBlock, infoBlock2" />
<a4j:commandButton value="Specific reference" render=":infoBlock,:sv:infoBlock2" />
@@ -72,7 +72,7 @@
<example id="exam-Component_Reference-limitRender-Rendering_example">
<title>Rendering example</title>
-<programlisting language="XML">
+<programlisting language="XML" role="XML">
<h:form id="form1">
<a4j:commandButton value="Normal rendering" render="infoBlock" />
<a4j:commandButton value="Limited rendering" render="infoBlock" limitRender="true" />
@@ -226,7 +226,7 @@
<example id="exam-Component_Reference-data-Data_reference_example">
<title>Data reference example</title>
-<programlisting language="XML">
+<programlisting language="XML" role="XML">
<a4j:commandButton value="Update" data="#{userBean.name}" oncomplete="showTheName(data.name)" />
</programlisting>
</example>
Modified: root/docs/trunk/Component_Reference/en-US/Menus_and_toolbars.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/Menus_and_toolbars.xml 2009-11-20 03:19:39 UTC (rev 15938)
+++ root/docs/trunk/Component_Reference/en-US/Menus_and_toolbars.xml 2009-11-20 05:39:44 UTC (rev 15939)
@@ -100,7 +100,7 @@
<example id="exam-Component_Reference-richpanelMenuGroup-Using_custom_icons">
<title>Using custom icons</title>
-<programlisting language="xml">
+<programlisting language="XML" role="XML">
<rich:panelMenu>
<rich:PanelMenuGroup label="Group 1" iconExpanded="\images\img1.png" iconCollapsed="\images\img2.png">>
<!--Nested menu components-->
@@ -135,7 +135,7 @@
<example id="exam-Component_Reference-richpanelMenuItem-Using_custom_icons">
<title>Using custom icons</title>
-<programlisting language="xml">
+<programlisting language="XML" role="XML">
<rich:panelMenu>
...
<rich:panelMenuItem value="Item 1.1" icon="\images\img1.png" iconDisabled="\images\img2.png" />
Modified: root/docs/trunk/Component_Reference/en-US/Panels_and_containers.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/Panels_and_containers.xml 2009-11-20 03:19:39 UTC (rev 15938)
+++ root/docs/trunk/Component_Reference/en-US/Panels_and_containers.xml 2009-11-20 05:39:44 UTC (rev 15939)
@@ -27,7 +27,7 @@
<example id="exam-Component_Reference-richmodalPanel-richmodalPanel_example">
<title><rich:modalPanel> example</title>
-<programlisting language="xml">
+<programlisting language="XML" role="XML">
<a onclick="Richfaces.showModalPanel('pnl');" href="#">Show ModalPanel</a>
<a4j:form>
<rich:modalPanel id="pnl" >
@@ -170,19 +170,19 @@
<example id="exam-Component_Reference-richtogglePanel-State_order_example">
<title>State order example</title>
-<programlisting language="xml">
->rich:togglePanel id="panel" initialState="panelB" switchType="client" stateOrder="panelA,panelB,panelC"<
- >f:facet name="panelA"<
+<programlisting language="XML" role="XML">
+<rich:togglePanel id="panel" initialState="panelB" switchType="client" stateOrder="panelA,panelB,panelC">
+ <f:facet name="panelA">
...
- >/f:facet<
- >f:facet name="panelB"<
+ </f:facet>
+ <f:facet name="panelB">
...
- >/f:facet<
- >f:facet name="panelC"<
+ </f:facet>
+ <f:facet name="panelC">
...
- >/f:facet<
->/rich:togglePanel<
->rich:toggleControl for="panel" value="Switch"/<
+ </f:facet>
+</rich:togglePanel>
+<rich:toggleControl for="panel" value="Switch"/>
</programlisting>
</example>
</section>
@@ -201,7 +201,7 @@
<example id="exam-Component_Reference-richtoggleControl-Switching_panel_states">
<title>Switching panel states</title>
-<programlisting language="xml">
+<programlisting language="XML" role="XML">
<rich:togglePanel id="panel" initialState="empty" switchType="client">
<f:facet name="first">
<h:panelGroup>
Modified: root/docs/trunk/Component_Reference/en-US/Preface.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/Preface.xml 2009-11-20 03:19:39 UTC (rev 15938)
+++ root/docs/trunk/Component_Reference/en-US/Preface.xml 2009-11-20 05:39:44 UTC (rev 15939)
@@ -4,13 +4,23 @@
<preface id="pref-Component_Reference-Preface">
<title>Preface</title>
- <!-- FOR JDOCBOOK --><xi:include href="Common_Content/Conventions.xml" xmlns:xi="http://www.w3.org/2001/XInclude"><!-- FOR PUBLICAN --><xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude"><xi:include href="fallback_content/Conventions.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
- </xi:fallback>
+ <!-- FOR JDOCBOOK -->
+ <xi:include href="Common_Content/Conventions.xml" xmlns:xi="http://www.w3.org/2001/XInclude">
+ <!-- FOR PUBLICAN -->
+ <xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude">
+ <xi:include href="fallback_content/Conventions.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
+ </xi:fallback>
</xi:include>
- <!-- PUBLICAN'S ORIGINAL XINCLUDES --><xi:include href="Feedback.xml" xmlns:xi="http://www.w3.org/2001/XInclude"><xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude"><xi:include href="Common_Content/Feedback.xml" xmlns:xi="http://www.w3.org/2001/XInclude"><!-- FOR JDOCBOOK --><xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude"><xi:include href="fallback_content/Feedback.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
- </xi:fallback>
+ <!-- PUBLICAN'S ORIGINAL XINCLUDES -->
+ <xi:include href="Feedback.xml" xmlns:xi="http://www.w3.org/2001/XInclude">
+ <xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude">
+ <xi:include href="Common_Content/Feedback.xml" xmlns:xi="http://www.w3.org/2001/XInclude">
+ <!-- FOR JDOCBOOK -->
+ <xi:fallback xmlns:xi="http://www.w3.org/2001/XInclude">
+ <xi:include href="fallback_content/Feedback.xml" xmlns:xi="http://www.w3.org/2001/XInclude"></xi:include>
+ </xi:fallback>
+ </xi:include>
+ </xi:fallback>
</xi:include>
- </xi:fallback>
- </xi:include>
</preface>
Modified: root/docs/trunk/Component_Reference/en-US/Revision_History.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/Revision_History.xml 2009-11-20 03:19:39 UTC (rev 15938)
+++ root/docs/trunk/Component_Reference/en-US/Revision_History.xml 2009-11-20 05:39:44 UTC (rev 15939)
@@ -8,15 +8,15 @@
<revhistory>
<revision>
<revnumber>1.0</revnumber>
- <date></date>
+ <date>Fri Nov 20 2009</date>
<author>
- <firstname></firstname>
- <surname></surname>
- <email></email>
+ <firstname>Sean</firstname>
+ <surname>Rogers</surname>
+ <email>serogers(a)redhat.com</email>
</author>
<revdescription>
<simplelist>
- <member></member>
+ <member>First draft</member>
</simplelist>
</revdescription>
</revision>
Modified: root/docs/trunk/Component_Reference/en-US/Rich_inputs.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/Rich_inputs.xml 2009-11-20 03:19:39 UTC (rev 15938)
+++ root/docs/trunk/Component_Reference/en-US/Rich_inputs.xml 2009-11-20 05:39:44 UTC (rev 15939)
@@ -116,7 +116,7 @@
<example id="exam-Component_Reference-richcomboBox-Defining_suggestion_values">
<title>Defining suggestion values</title>
-<programlisting language="XML">
+<programlisting language="XML" role="XML">
<rich:comboBox value="#{bean.state}" suggestionValues="#{bean.suggestions}"
</programlisting>
</example>
@@ -128,7 +128,7 @@
<example id="exam-Component_Reference-richcomboBox-Defining_list_items_for_richinplaceSelect">
<title>Defining list items for <rich:inplaceSelect></title>
-<programlisting language="XML">
+<programlisting language="XML" role="XML">
<rich:comboBox value="#{bean.item}" valueChangeListener="#{bean.selectionChanged}" >
<f:selectItems value="#{bean.selectItems}" />
<f.selectItem itemValue="Item 1" />
@@ -181,7 +181,7 @@
<example id="exam-Component_Reference-richfileUpload-Basic_usage_of_richfileUpload">
<title>Basic usage of <rich:fileUpload></title>
-<programlisting language="XML">
+<programlisting language="XML" role="XML">
<rich:fileUpload uploadData="#{bean.data}" />
</programlisting>
</example>
@@ -307,7 +307,7 @@
<example id="exam-Component_Reference-richinplaceSelect-Defining_list_items_for_richinplaceSelect">
<title>Defining list items for <rich:inplaceSelect></title>
-<programlisting language="XML">
+<programlisting language="XML" role="XML">
<rich:inplaceSelect value="#{bean.inputValue}" defaultLabel="click to edit" >
<f:selectItems value="#{bean.selectItems}" />
<f.selectItem itemValue="1" itemLabel="Item 1" />
Modified: root/docs/trunk/Component_Reference/en-US/Tables_and_grids.xml
===================================================================
--- root/docs/trunk/Component_Reference/en-US/Tables_and_grids.xml 2009-11-20 03:19:39 UTC (rev 15938)
+++ root/docs/trunk/Component_Reference/en-US/Tables_and_grids.xml 2009-11-20 05:39:44 UTC (rev 15939)
@@ -18,7 +18,7 @@
<example id="exam-Component_Reference-richcolumn-Basic_column_example">
<title>Basic column example</title>
-<programlisting language="xml">
+<programlisting language="XML" role="XML">
<rich:dataTable value="#{capitalsBean.capitals}" var="cap" rows="5">
<rich:column>
<f:facet name="header">State Flag</f:facet>
@@ -53,7 +53,7 @@
<example id="exam-Component_Reference-richcolumn-Column_spanning_example">
<title>Column spanning example</title>
-<programlisting language="xml">
+<programlisting language="XML" role="XML">
<rich:dataTable value="#{capitalsBean.capitals}" var="cap" rows="5">
<rich:column colspan="3">
<h:graphicImage value="#{cap.stateFlag}"/>
@@ -84,7 +84,7 @@
<example id="exam-Component_Reference-richcolumn-Row_spanning_example">
<title>Row spanning example</title>
-<programlisting language="xml">
+<programlisting language="XML" role="XML">
<rich:dataTable value="#{capitalsBean.capitals}" var="cap" rows="5">
<rich:column rowspan="3">
<f:facet name="header">State Flag</f:facet>
@@ -127,7 +127,7 @@
<example id="exam-Component_Reference-richcolumnGroup-Complex_headers_using_column_groups">
<title>Complex headers using column groups</title>
-<programlisting language="xml">
+<programlisting language="XML" role="XML">
<rich:dataTable value="#{capitalsBean.capitals}" var="cap" rows="5" id="sublist">
<f:facet name="header">
<rich:columnGroup>
@@ -184,7 +184,7 @@
<example id="exam-Component_Reference-richcolumns-Basic_columns_example">
<title>Basic columns example</title>
-<programlisting language="xml">
+<programlisting language="XML" role="XML">
<rich:dataTable value="#{dataTableScrollerBean.model}" var="model" width="750">
<rich:columns value="#{dataTableScrollerBean.columns}" var="columns" index="ind" id="column#{ind}">
<f:facet name="header">
Added: root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-a4jactionParam-a4jactionParam_example.js
===================================================================
--- root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-a4jactionParam-a4jactionParam_example.js (rev 0)
+++ root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-a4jactionParam-a4jactionParam_example.js 2009-11-20 05:39:44 UTC (rev 15939)
@@ -0,0 +1,11 @@
+public class ActionparamBean {
+ private String name = "John";
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
Added: root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-a4jactionParam-a4jactionParam_example.xmlt
===================================================================
--- root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-a4jactionParam-a4jactionParam_example.xmlt (rev 0)
+++ root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-a4jactionParam-a4jactionParam_example.xmlt 2009-11-20 05:39:44 UTC (rev 15939)
@@ -0,0 +1,6 @@
+<h:form id="form">
+ <a4j:commandButton value="Set name to Alex" reRender="rep">
+ <a4j:actionparam name="username" value="Alex" assignTo="#{actionparamBean.name}"/>
+ </a4j:commandButton>
+ <h:outputText id="rep" value="Name: #{actionparamBean.name}"/>
+</h:form>
Added: root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-a4jjsFunction-a4jjsFunction_example.xmlt
===================================================================
--- root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-a4jjsFunction-a4jjsFunction_example.xmlt (rev 0)
+++ root/docs/trunk/Component_Reference/en-US/extras/exam-Component_Reference-a4jjsFunction-a4jjsFunction_example.xmlt 2009-11-20 05:39:44 UTC (rev 15939)
@@ -0,0 +1,7 @@
+<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:jsFunction>
+ ...
+</h:form>
Added: root/docs/trunk/Component_Reference/publican.cfg
===================================================================
--- root/docs/trunk/Component_Reference/publican.cfg (rev 0)
+++ root/docs/trunk/Component_Reference/publican.cfg 2009-11-20 05:39:44 UTC (rev 15939)
@@ -0,0 +1,7 @@
+# Config::Simple 4.59
+# Fri Nov 20 15:18:32 2009
+
+show_remarks: 1
+debug: 1
+xml_lang: en-US
+
15 years, 1 month
JBoss Rich Faces SVN: r15938 - in root/ui-sandbox/trunk: components/tables/ui/src/main and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-11-19 22:19:39 -0500 (Thu, 19 Nov 2009)
New Revision: 15938
Added:
root/ui-sandbox/trunk/components/tables/ui/src/main/config/faces-config.xml
root/ui-sandbox/trunk/components/tables/ui/src/main/old_configs/
root/ui-sandbox/trunk/components/tables/ui/src/main/old_configs/component/
Removed:
root/ui-sandbox/trunk/components/tables/ui/src/main/config/component/
root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/faces-config.xml
Modified:
root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/ToggleControlRendererBase.java
root/ui-sandbox/trunk/components/tables/ui/src/main/templates/org/richfaces/renderkit/html/toggle-control.template.xml
root/ui-sandbox/trunk/pom.xml
Log:
https://jira.jboss.org/jira/browse/RF-7732 - updates for ui-sandbox/tables/* projects
Copied: root/ui-sandbox/trunk/components/tables/ui/src/main/config/faces-config.xml (from rev 15927, root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/faces-config.xml)
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/config/faces-config.xml (rev 0)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/config/faces-config.xml 2009-11-20 03:19:39 UTC (rev 15938)
@@ -0,0 +1,86 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!--
+JBoss, Home of Professional Open Source
+Copyright ${year}, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+-->
+<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
+ version="2.0">
+
+ <component>
+ <component-type>org.richfaces.DataTable</component-type>
+ <component-class>org.richfaces.component.html.HtmlDataTable</component-class>
+ <component-extension>
+ <cdk:generate xmlns:cdk="http://richfaces.org/cdk/extensions">false</cdk:generate>
+ </component-extension>
+ </component>
+
+ <component>
+ <component-type>org.richfaces.ExtendedDataTable</component-type>
+ <component-class>org.richfaces.component.html.HtmlExtendedDataTable</component-class>
+ <component-extension>
+ <cdk:generate xmlns:cdk="http://richfaces.org/cdk/extensions">false</cdk:generate>
+ </component-extension>
+ </component>
+ <component>
+ <component-type>org.richfaces.Column</component-type>
+ <component-class>org.richfaces.component.html.HtmlColumn</component-class>
+ <component-extension>
+ <cdk:generate xmlns:cdk="http://richfaces.org/cdk/extensions">false</cdk:generate>
+ </component-extension>
+ </component>
+ <component>
+ <component-type>org.richfaces.Colgroup</component-type>
+ <component-class>org.richfaces.component.html.HtmlColumnGroup</component-class>
+ <component-extension>
+ <cdk:generate xmlns:cdk="http://richfaces.org/cdk/extensions">false</cdk:generate>
+ </component-extension>
+ </component>
+ <component>
+ <component-type>org.richfaces.SubTable</component-type>
+ <component-class>org.richfaces.component.html.HtmlSubTable</component-class>
+ <component-extension>
+ <cdk:generate xmlns:cdk="http://richfaces.org/cdk/extensions">false</cdk:generate>
+ </component-extension>
+ </component>
+ <component>
+ <component-type>org.richfaces.ToggleControl</component-type>
+ <component-class>org.richfaces.component.html.HtmlToggleControl</component-class>
+ <component-extension>
+ <cdk:generate xmlns:cdk="http://richfaces.org/cdk/extensions">false</cdk:generate>
+ </component-extension>
+ </component>
+
+ <render-kit>
+ <render-kit-id>HTML_BASIC</render-kit-id>
+ <renderer>
+ <component-family>org.richfaces.DataTable</component-family>
+ <renderer-type>org.richfaces.DataTableRenderer</renderer-type>
+ <renderer-class>org.richfaces.renderkit.DataTableRenderer</renderer-class>
+ </renderer>
+ <renderer>
+ <component-family>org.richfaces.Data</component-family>
+ <renderer-type>org.richfaces.ExtendedDataTableRenderer</renderer-type>
+ <renderer-class>org.richfaces.renderkit.ExtendedDataTableRenderer</renderer-class>
+ </renderer>
+ </render-kit>
+</faces-config>
\ No newline at end of file
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/ToggleControlRendererBase.java
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/ToggleControlRendererBase.java 2009-11-20 03:13:24 UTC (rev 15937)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/java/org/richfaces/renderkit/ToggleControlRendererBase.java 2009-11-20 03:19:39 UTC (rev 15938)
@@ -34,14 +34,14 @@
private static final String COLLAPSE_STATE = "collapse";
- public void encodeControl(FacesContext context, UIToggleControl toggleControl) throws IOException{
-
+ protected void encodeControl(FacesContext context, UIComponent component) throws IOException{
+ UIToggleControl toggleControl = (UIToggleControl) component;
UISubTable subTable = findComponent(context, toggleControl);
if(subTable != null) {
ResponseWriter writer = context.getResponseWriter();
- String toggleId = toggleControl.getClientId();
- String subTableId = subTable.getClientId();
+ String toggleId = toggleControl.getClientId(context);
+ String subTableId = subTable.getClientId(context);
boolean expanded = subTable.getExpanded();
String initialState = expanded ? EXPAND_STATE : COLLAPSE_STATE;
Copied: root/ui-sandbox/trunk/components/tables/ui/src/main/old_configs/component (from rev 15927, root/ui-sandbox/trunk/components/tables/ui/src/main/config/component)
Deleted: root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/faces-config.xml
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/faces-config.xml 2009-11-20 03:13:24 UTC (rev 15937)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/resources/META-INF/faces-config.xml 2009-11-20 03:19:39 UTC (rev 15938)
@@ -1,73 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!--
-JBoss, Home of Professional Open Source
-Copyright ${year}, Red Hat, Inc. and individual contributors
-by the @authors tag. See the copyright.txt in the distribution for a
-full listing of individual contributors.
-
-
-This is free software; you can redistribute it and/or modify it
-under the terms of the GNU Lesser General Public License as
-published by the Free Software Foundation; either version 2.1 of
-the License, or (at your option) any later version.
-
-
-This software is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Lesser General Public License for more details.
-
-
-You should have received a copy of the GNU Lesser General Public
-License along with this software; if not, write to the Free
-Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-02110-1301 USA, or see the FSF site: http://www.fsf.org.
--->
-<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
- version="2.0">
-
- <component>
- <component-type>org.richfaces.DataTable</component-type>
- <component-class>org.richfaces.component.html.HtmlDataTable</component-class>
- </component>
-
- <component>
- <component-type>org.richfaces.ExtendedDataTable</component-type>
- <component-class>org.richfaces.component.html.HtmlExtendedDataTable</component-class>
- </component>
- <component>
- <component-type>org.richfaces.Column</component-type>
- <component-class>org.richfaces.component.html.HtmlColumn</component-class>
- </component>
- <component>
- <component-type>org.richfaces.Colgroup</component-type>
- <component-class>org.richfaces.component.html.HtmlColumnGroup</component-class>
- </component>
- <component>
- <component-type>org.richfaces.SubTable</component-type>
- <component-class>org.richfaces.component.html.HtmlSubTable</component-class>
- </component>
- <component>
- <component-type>org.richfaces.ToggleControl</component-type>
- <component-class>org.richfaces.component.html.HtmlToggleControl</component-class>
- </component>
-
- <render-kit>
- <render-kit-id>HTML_BASIC</render-kit-id>
- <renderer>
- <component-family>org.richfaces.DataTable</component-family>
- <renderer-type>org.richfaces.DataTableRenderer</renderer-type>
- <renderer-class>org.richfaces.renderkit.DataTableRenderer</renderer-class>
- </renderer>
- <renderer>
- <component-family>org.richfaces.Data</component-family>
- <renderer-type>org.richfaces.ExtendedDataTableRenderer</renderer-type>
- <renderer-class>org.richfaces.renderkit.ExtendedDataTableRenderer</renderer-class>
- </renderer>
- <renderer>
- <component-family>org.richfaces.ToggleControl</component-family>
- <renderer-type>org.richfaces.ToggleControlRenderer</renderer-type>
- <renderer-class>org.richfaces.renderkit.html.ToggleControlRenderer</renderer-class>
- </renderer>
- </render-kit>
-</faces-config>
\ No newline at end of file
Modified: root/ui-sandbox/trunk/components/tables/ui/src/main/templates/org/richfaces/renderkit/html/toggle-control.template.xml
===================================================================
--- root/ui-sandbox/trunk/components/tables/ui/src/main/templates/org/richfaces/renderkit/html/toggle-control.template.xml 2009-11-20 03:13:24 UTC (rev 15937)
+++ root/ui-sandbox/trunk/components/tables/ui/src/main/templates/org/richfaces/renderkit/html/toggle-control.template.xml 2009-11-20 03:19:39 UTC (rev 15938)
@@ -1,13 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
+
<cdk:root xmlns="http://richfaces.org/xhtml-el" xmlns:cdk="http://richfaces.org/cdk"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- class="org.richfaces.renderkit.html.ToggleControlRenderer"
- superclass="org.richfaces.renderkit.ToggleControlRendererBase"
- componentclass="org.richfaces.component.UIToggleControl">
-
- <span id="#{clientId}" class="#{component.attributes['styleClass']}">
- <cdk:call expression="encodeControl(context, component);" />
- </span>
+ xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:cc="http://java.sun.com/jsf/composite"
+ xmlns:javaee="http://java.sun.com/xml/ns/javaee">
+
+ <cc:interface>
+ <cdk:class>org.richfaces.renderkit.html.ToggleControlRenderer</cdk:class>
+ <cdk:superclass>org.richfaces.renderkit.ToggleControlRendererBase</cdk:superclass>
+ <cdk:component-family>org.richfaces.ToggleControl</cdk:component-family>
+ <cdk:renderer-type>org.richfaces.ToggleControlRenderer</cdk:renderer-type>
+ </cc:interface>
+
+ <cc:implementation>
+ <span id="#{clientId}" class="#{cc.attributes['styleClass']}">
+ <cdk:call expression="encodeControl(facesContext, cc);" />
+ </span>
+ </cc:implementation>
</cdk:root>
\ No newline at end of file
Modified: root/ui-sandbox/trunk/pom.xml
===================================================================
--- root/ui-sandbox/trunk/pom.xml 2009-11-20 03:13:24 UTC (rev 15937)
+++ root/ui-sandbox/trunk/pom.xml 2009-11-20 03:19:39 UTC (rev 15938)
@@ -22,6 +22,13 @@
<groupId>org.richfaces.cdk</groupId>
<artifactId>maven-cdk-plugin</artifactId>
<executions>
+ <execution>
+ <id>cdk-generate-sources</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
<!--execution>
<phase>generate-sources</phase>
<goals>
15 years, 1 month
JBoss Rich Faces SVN: r15937 - in root/cdk/trunk/plugins: maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-11-19 22:13:24 -0500 (Thu, 19 Nov 2009)
New Revision: 15937
Modified:
root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptBuilder.java
root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java
Log:
Fixed CDK execution issues for aggregation environments
Modified: root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptBuilder.java
===================================================================
--- root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptBuilder.java 2009-11-20 02:34:09 UTC (rev 15936)
+++ root/cdk/trunk/plugins/generator/src/main/java/org/richfaces/cdk/apt/AptBuilder.java 2009-11-20 03:13:24 UTC (rev 15937)
@@ -192,14 +192,18 @@
sourceObjects.add(sourceObject);
}
- CompilationTask task = getJavaCompiler().getTask(null, getFileManager(), listener, getOptions(), null,
- sourceObjects);
+ if (!sourceObjects.isEmpty()) {
+ CompilationTask task = getJavaCompiler().getTask(null, getFileManager(), listener, getOptions(), null,
+ sourceObjects);
- task.setProcessors(Arrays.asList(processors));
- task.setLocale(locale);
+ task.setProcessors(Arrays.asList(processors));
+ task.setLocale(locale);
- if (!task.call()) {
- throw new AptException("Compilation error: " + messages);
+ if (!task.call()) {
+ throw new AptException("Compilation error: " + messages);
+ }
+ } else {
+ LOG.info("No source objects detected, skipping compilation");
}
}
Modified: root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java
===================================================================
--- root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java 2009-11-20 02:34:09 UTC (rev 15936)
+++ root/cdk/trunk/plugins/maven-cdk-plugin/src/main/java/org/richfaces/builder/mojo/GenerateMojo.java 2009-11-20 03:13:24 UTC (rev 15937)
@@ -173,6 +173,10 @@
*/
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
+ if ("pom".equals(project.getPackaging())) {
+ getLog().info("Skipping 'pom' packaging project: " + project.getModel().getId());
+ return;
+ }
// Setup logger.
LoggerFactory.setLogger(new MavenLogger(getLog()));
@@ -319,9 +323,18 @@
// TODO Auto-generated method stub
}
+ private File resolveRelativePath(File file) {
+ File result = file;
+ if (!result.isAbsolute()) {
+ result = new File(project.getBasedir(), result.getPath());
+ }
+
+ return result;
+ }
+
private Iterable<File> findTemplateFiles() throws MojoExecutionException {
if (null == templates) {
- File defaultDirectory = new File(MAIN_TEMPLATES);
+ File defaultDirectory = resolveRelativePath(new File(MAIN_TEMPLATES));
if (defaultDirectory.exists() && defaultDirectory.isDirectory()) {
FileSet fileSet = new FileSet();
@@ -353,7 +366,7 @@
private Iterable<File> findFacesConfigFiles() throws MojoExecutionException {
if (null == facesConfigs) {
- File defaultDirectory = new File(MAIN_CONFIG);
+ File defaultDirectory = resolveRelativePath(new File(MAIN_CONFIG));
if (defaultDirectory.exists() && defaultDirectory.isDirectory()) {
FileSet fileSet = new FileSet();
@@ -423,16 +436,11 @@
for (FileSet fileSet : filesets) {
String[] includes = (String[]) fileSet.getIncludes().toArray(STRINGS_ARRAY);
String[] excludes = (String[]) fileSet.getExcludes().toArray(STRINGS_ARRAY);
- File fileSetDirectory = new File(fileSet.getDirectory());
+ File fileSetDirectory = resolveRelativePath(new File(fileSet.getDirectory()));
String[] scan = doScan(includes, excludes, fileSetDirectory);
for (String filename : scan) {
- File file = new File(fileSetDirectory, filename);
- if (!file.exists()) {
- file = new File(project.getBasedir(), file.getPath());
- }
-
- files.add(file);
+ files.add(resolveRelativePath(new File(fileSetDirectory, filename)));
}
}
}
15 years, 1 month
JBoss Rich Faces SVN: r15936 - in root/ui/trunk/components/core: src/main and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-11-19 21:34:09 -0500 (Thu, 19 Nov 2009)
New Revision: 15936
Added:
root/ui/trunk/components/core/src/main/config/faces-config.xml
root/ui/trunk/components/core/src/main/old_configs/
root/ui/trunk/components/core/src/main/old_configs/component/
root/ui/trunk/components/core/src/main/old_configs/resources/
root/ui/trunk/components/core/src/main/old_configs/taglib/
root/ui/trunk/components/core/src/main/resources/META-INF/push-managed-beans.faces-config.xml
Removed:
root/ui/trunk/components/core/src/main/config/component/
root/ui/trunk/components/core/src/main/config/resources/
root/ui/trunk/components/core/src/main/config/taglib/
root/ui/trunk/components/core/src/main/resources/META-INF/faces-config.xml
Modified:
root/ui/trunk/components/core/pom.xml
root/ui/trunk/components/core/src/main/templates/org/ajax4jsf/renderkit/html/button.template.xml
root/ui/trunk/components/core/src/main/templates/org/ajax4jsf/renderkit/html/function.template.xml
root/ui/trunk/components/core/src/main/templates/org/ajax4jsf/renderkit/html/link.template.xml
root/ui/trunk/components/core/src/main/templates/org/ajax4jsf/renderkit/html/log.template.xml
Log:
https://jira.jboss.org/jira/browse/RF-7732 - updates for ui/* projects
Modified: root/ui/trunk/components/core/pom.xml
===================================================================
--- root/ui/trunk/components/core/pom.xml 2009-11-20 02:29:35 UTC (rev 15935)
+++ root/ui/trunk/components/core/pom.xml 2009-11-20 02:34:09 UTC (rev 15936)
@@ -28,6 +28,15 @@
</taglib>
</library>
</configuration>
+ <executions>
+ <execution>
+ <id>cdk-generate-sources</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
</plugin>
</plugins>
Added: root/ui/trunk/components/core/src/main/config/faces-config.xml
===================================================================
--- root/ui/trunk/components/core/src/main/config/faces-config.xml (rev 0)
+++ root/ui/trunk/components/core/src/main/config/faces-config.xml 2009-11-20 02:34:09 UTC (rev 15936)
@@ -0,0 +1,93 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
+ version="2.0">
+
+ <component>
+ <component-type>org.richfaces.Push</component-type>
+ <component-class>org.richfaces.component.html.HtmlPush</component-class>
+ <component-extension>
+ <cdk:generate xmlns:cdk="http://richfaces.org/cdk/extensions">false</cdk:generate>
+ </component-extension>
+ </component>
+
+ <component>
+ <component-type>org.richfaces.Function</component-type>
+ <component-class>org.richfaces.component.html.HtmlAjaxFunction</component-class>
+ <component-extension>
+ <cdk:generate xmlns:cdk="http://richfaces.org/cdk/extensions">false</cdk:generate>
+ </component-extension>
+ </component>
+
+ <component>
+ <component-type>org.richfaces.MediaOutput</component-type>
+ <component-class>org.richfaces.component.html.HtmlMediaOutput</component-class>
+ <component-extension>
+ <cdk:generate xmlns:cdk="http://richfaces.org/cdk/extensions">false</cdk:generate>
+ </component-extension>
+ </component>
+
+ <component>
+ <component-type>org.richfaces.OutputPanel</component-type>
+ <component-class>org.richfaces.component.html.HtmlOutputPanel</component-class>
+ <component-extension>
+ <cdk:generate xmlns:cdk="http://richfaces.org/cdk/extensions">false</cdk:generate>
+ </component-extension>
+ </component>
+
+ <component>
+ <component-type>org.richfaces.Status</component-type>
+ <component-class>org.richfaces.component.html.HtmlAjaxStatus</component-class>
+ <component-extension>
+ <cdk:generate xmlns:cdk="http://richfaces.org/cdk/extensions">false</cdk:generate>
+ </component-extension>
+ </component>
+
+ <component>
+ <component-type>org.richfaces.AjaxLog</component-type>
+ <component-class>org.richfaces.component.html.HtmlAjaxLog</component-class>
+ <component-extension>
+ <cdk:generate xmlns:cdk="http://richfaces.org/cdk/extensions">false</cdk:generate>
+ </component-extension>
+ </component>
+
+ <component>
+ <component-type>org.richfaces.CommandLink</component-type>
+ <component-class>org.richfaces.component.html.HtmlCommandLink</component-class>
+ <component-extension>
+ <cdk:generate xmlns:cdk="http://richfaces.org/cdk/extensions">false</cdk:generate>
+ </component-extension>
+ </component>
+
+ <component>
+ <component-type>org.richfaces.CommandButton</component-type>
+ <component-class>org.richfaces.component.html.HtmlCommandButton</component-class>
+ <component-extension>
+ <cdk:generate xmlns:cdk="http://richfaces.org/cdk/extensions">false</cdk:generate>
+ </component-extension>
+ </component>
+
+ <render-kit>
+ <render-kit-id>HTML_BASIC</render-kit-id>
+ <renderer>
+ <component-family>org.richfaces.Push</component-family>
+ <renderer-type>org.richfaces.PushRenderer</renderer-type>
+ <renderer-class>org.richfaces.renderkit.html.AjaxPushRenderer</renderer-class>
+ </renderer>
+ <renderer>
+ <component-family>org.richfaces.MediaOutput</component-family>
+ <renderer-type>org.richfaces.MediaOutputRenderer</renderer-type>
+ <renderer-class>org.richfaces.renderkit.html.MediaOutputRenderer</renderer-class>
+ </renderer>
+ <renderer>
+ <component-family>javax.faces.Panel</component-family>
+ <renderer-type>org.richfaces.OutputPanelRenderer</renderer-type>
+ <renderer-class>org.richfaces.renderkit.html.AjaxOutputPanelRenderer</renderer-class>
+ </renderer>
+ <renderer>
+ <component-family>org.richfaces.Status</component-family>
+ <renderer-type>org.richfaces.StatusRenderer</renderer-type>
+ <renderer-class>org.richfaces.renderkit.html.AjaxStatusRenderer</renderer-class>
+ </renderer>
+ </render-kit>
+</faces-config>
\ No newline at end of file
Copied: root/ui/trunk/components/core/src/main/old_configs/component (from rev 15927, root/ui/trunk/components/core/src/main/config/component)
Copied: root/ui/trunk/components/core/src/main/old_configs/resources (from rev 15927, root/ui/trunk/components/core/src/main/config/resources)
Copied: root/ui/trunk/components/core/src/main/old_configs/taglib (from rev 15927, root/ui/trunk/components/core/src/main/config/taglib)
Deleted: root/ui/trunk/components/core/src/main/resources/META-INF/faces-config.xml
===================================================================
--- root/ui/trunk/components/core/src/main/resources/META-INF/faces-config.xml 2009-11-20 02:29:35 UTC (rev 15935)
+++ root/ui/trunk/components/core/src/main/resources/META-INF/faces-config.xml 2009-11-20 02:34:09 UTC (rev 15936)
@@ -1,95 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-
-<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
- version="2.0">
-
- <managed-bean eager="true">
- <managed-bean-name>richFacesPushListenersManager</managed-bean-name>
- <managed-bean-class>org.richfaces.component.PushListenersManager</managed-bean-class>
- <managed-bean-scope>application</managed-bean-scope>
- </managed-bean>
-
- <component>
- <component-type>org.richfaces.Push</component-type>
- <component-class>org.richfaces.component.html.HtmlPush</component-class>
- </component>
-
- <component>
- <component-type>org.richfaces.Function</component-type>
- <component-class>org.richfaces.component.html.HtmlAjaxFunction</component-class>
- </component>
-
- <component>
- <component-type>org.richfaces.MediaOutput</component-type>
- <component-class>org.richfaces.component.html.HtmlMediaOutput</component-class>
- </component>
-
- <component>
- <component-type>org.richfaces.OutputPanel</component-type>
- <component-class>org.richfaces.component.html.HtmlOutputPanel</component-class>
- </component>
-
- <component>
- <component-type>org.richfaces.Status</component-type>
- <component-class>org.richfaces.component.html.HtmlAjaxStatus</component-class>
- </component>
-
- <component>
- <component-type>org.richfaces.AjaxLog</component-type>
- <component-class>org.richfaces.component.html.HtmlAjaxLog</component-class>
- </component>
-
- <component>
- <component-type>org.richfaces.CommandLink</component-type>
- <component-class>org.richfaces.component.html.HtmlCommandLink</component-class>
- </component>
-
- <component>
- <component-type>org.richfaces.CommandButton</component-type>
- <component-class>org.richfaces.component.html.HtmlCommandButton</component-class>
- </component>
-
- <render-kit>
- <render-kit-id>HTML_BASIC</render-kit-id>
- <renderer>
- <component-family>org.richfaces.Push</component-family>
- <renderer-type>org.richfaces.PushRenderer</renderer-type>
- <renderer-class>org.richfaces.renderkit.html.AjaxPushRenderer</renderer-class>
- </renderer>
- <renderer>
- <component-family>javax.faces.Command</component-family>
- <renderer-type>org.richfaces.FunctionRenderer</renderer-type>
- <renderer-class>org.richfaces.renderkit.html.AjaxFunctionRenderer</renderer-class>
- </renderer>
- <renderer>
- <component-family>org.richfaces.MediaOutput</component-family>
- <renderer-type>org.richfaces.MediaOutputRenderer</renderer-type>
- <renderer-class>org.richfaces.renderkit.html.MediaOutputRenderer</renderer-class>
- </renderer>
- <renderer>
- <component-family>javax.faces.Panel</component-family>
- <renderer-type>org.richfaces.OutputPanelRenderer</renderer-type>
- <renderer-class>org.richfaces.renderkit.html.AjaxOutputPanelRenderer</renderer-class>
- </renderer>
- <renderer>
- <component-family>org.richfaces.Status</component-family>
- <renderer-type>org.richfaces.StatusRenderer</renderer-type>
- <renderer-class>org.richfaces.renderkit.html.AjaxStatusRenderer</renderer-class>
- </renderer>
- <renderer>
- <component-family>org.richfaces.AjaxLog</component-family>
- <renderer-type>org.richfaces.AjaxLogRenderer</renderer-type>
- <renderer-class>org.richfaces.renderkit.html.AjaxLogRenderer</renderer-class>
- </renderer>
- <renderer>
- <component-family>javax.faces.Command</component-family>
- <renderer-type>org.richfaces.CommandLinkRenderer</renderer-type>
- <renderer-class>org.richfaces.renderkit.html.CommandLinkRenderer</renderer-class>
- </renderer>
- <renderer>
- <component-family>javax.faces.Command</component-family>
- <renderer-type>org.richfaces.CommandButtonRenderer</renderer-type>
- <renderer-class>org.richfaces.renderkit.html.CommandButtonRenderer</renderer-class>
- </renderer>
- </render-kit>
-</faces-config>
\ No newline at end of file
Copied: root/ui/trunk/components/core/src/main/resources/META-INF/push-managed-beans.faces-config.xml (from rev 15927, root/ui/trunk/components/core/src/main/resources/META-INF/faces-config.xml)
===================================================================
--- root/ui/trunk/components/core/src/main/resources/META-INF/push-managed-beans.faces-config.xml (rev 0)
+++ root/ui/trunk/components/core/src/main/resources/META-INF/push-managed-beans.faces-config.xml 2009-11-20 02:34:09 UTC (rev 15936)
@@ -0,0 +1,12 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
+ version="2.0">
+
+ <managed-bean eager="true">
+ <managed-bean-name>richFacesPushListenersManager</managed-bean-name>
+ <managed-bean-class>org.richfaces.component.PushListenersManager</managed-bean-class>
+ <managed-bean-scope>application</managed-bean-scope>
+ </managed-bean>
+
+</faces-config>
\ No newline at end of file
Modified: root/ui/trunk/components/core/src/main/templates/org/ajax4jsf/renderkit/html/button.template.xml
===================================================================
--- root/ui/trunk/components/core/src/main/templates/org/ajax4jsf/renderkit/html/button.template.xml 2009-11-20 02:29:35 UTC (rev 15935)
+++ root/ui/trunk/components/core/src/main/templates/org/ajax4jsf/renderkit/html/button.template.xml 2009-11-20 02:34:09 UTC (rev 15936)
@@ -1,22 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<cdk:root xmlns="http://richfaces.org/xhtml-el" xmlns:cdk="http://richfaces.org/cdk"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- class="org.richfaces.renderkit.html.CommandButtonRenderer"
- superclass="org.richfaces.renderkit.html.AjaxCommandButtonRendererBase"
- componentclass="javax.faces.component.UIComponent">
+ xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:cc="http://java.sun.com/jsf/composite"
+ xmlns:javaee="http://java.sun.com/xml/ns/javaee">
- <!-- f:clientid var="clientId"/ -->
+ <cc:interface>
+ <cdk:class>org.richfaces.renderkit.html.CommandButtonRenderer</cdk:class>
+ <cdk:superclass>org.richfaces.renderkit.html.AjaxCommandButtonRendererBase</cdk:superclass>
+ <cdk:component-family>javax.faces.Command</cdk:component-family>
+ <cdk:renderer-type>org.richfaces.CommandButtonRenderer
+ </cdk:renderer-type>
+ </cc:interface>
- <input
- id="#{clientId}"
- name="#{clientId}"
- cdk:passThroughWithExclusions="name onclick type id class"
- onclick="#{this.getOnClick(context,component)}"
- value="#{component.attributes['value']}"
- class="#{component.attributes['styleClass']}"
- >
- <cdk:call expression="encodeTypeAndImage(context,component);" />
- </input>
-
+ <cc:implementation>
+ <input id="#{clientId}" name="#{clientId}"
+ cdk:passThroughWithExclusions="name onclick type id class" onclick="#{this.getOnClick(facesContext,cc)}"
+ value="#{cc.attributes['value']}" class="#{cc.attributes['styleClass']}">
+ <cdk:call expression="encodeTypeAndImage(facesContext,cc);" />
+ </input>
+ </cc:implementation>
</cdk:root>
Modified: root/ui/trunk/components/core/src/main/templates/org/ajax4jsf/renderkit/html/function.template.xml
===================================================================
--- root/ui/trunk/components/core/src/main/templates/org/ajax4jsf/renderkit/html/function.template.xml 2009-11-20 02:29:35 UTC (rev 15935)
+++ root/ui/trunk/components/core/src/main/templates/org/ajax4jsf/renderkit/html/function.template.xml 2009-11-20 02:34:09 UTC (rev 15936)
@@ -1,14 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
+
<cdk:root xmlns="http://richfaces.org/xhtml-el" xmlns:cdk="http://richfaces.org/cdk"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- class="org.richfaces.renderkit.html.AjaxFunctionRenderer"
- superclass="org.richfaces.renderkit.AjaxFunctionRendererBase"
- componentclass="javax.faces.component.UIComponent">
+ xmlns:c="http://java.sun.com/jsp/jstl/core"
+ xmlns:cc="http://java.sun.com/jsf/composite" xmlns:javaee="http://java.sun.com/xml/ns/javaee">
- <!-- f:clientid var="clientId"/ -->
- <span id="#{clientId}" style="display: none;">
- <script type="text/javascript">
- #{this.getFunction(context,component)};
- </script>
- </span>
+ <cc:interface>
+ <cdk:class>org.richfaces.renderkit.html.AjaxFunctionRenderer</cdk:class>
+ <cdk:superclass>org.richfaces.renderkit.AjaxFunctionRendererBase</cdk:superclass>
+ <cdk:component-family>javax.faces.Command</cdk:component-family>
+ <cdk:renderer-type>org.richfaces.FunctionRenderer</cdk:renderer-type>
+ </cc:interface>
+
+ <cc:implementation>
+ <span id="#{clientId}" style="display: none;">
+ <script type="text/javascript">
+ #{this.getFunction(facesContext, cc)};
+ </script>
+ </span>
+ </cc:implementation>
</cdk:root>
Modified: root/ui/trunk/components/core/src/main/templates/org/ajax4jsf/renderkit/html/link.template.xml
===================================================================
--- root/ui/trunk/components/core/src/main/templates/org/ajax4jsf/renderkit/html/link.template.xml 2009-11-20 02:29:35 UTC (rev 15935)
+++ root/ui/trunk/components/core/src/main/templates/org/ajax4jsf/renderkit/html/link.template.xml 2009-11-20 02:34:09 UTC (rev 15936)
@@ -1,23 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<cdk:root xmlns="http://richfaces.org/xhtml-el" xmlns:cdk="http://richfaces.org/cdk"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- class="org.richfaces.renderkit.html.CommandLinkRenderer"
- superclass="org.richfaces.renderkit.AjaxCommandRendererBase"
- componentclass="javax.faces.component.UIComponent">
+ xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:cc="http://java.sun.com/jsf/composite"
+ xmlns:javaee="http://java.sun.com/xml/ns/javaee">
- <!-- f:clientid var="clientId"/ -->
- <a
- id="#{clientId}"
- name="#{clientId}"
- cdk:passThroughWithExclusions="value name onclick href id"
- onclick="#{this.getOnClick(context,component)}"
- href="#"
- class="#{component.attributes['styleClass']}"
- >
- #{component.attributes['value']}
- <cdk:body>
- <cdk:call expression="renderChildren(context,component);" />
- </cdk:body>
- </a>
-</cdk:root>
\ No newline at end of file
+ <cc:interface>
+ <cdk:class>org.richfaces.renderkit.html.CommandLinkRenderer</cdk:class>
+ <cdk:superclass>org.richfaces.renderkit.AjaxCommandRendererBase</cdk:superclass>
+ <cdk:component-family>javax.faces.Command</cdk:component-family>
+ <cdk:renderer-type>org.richfaces.CommandLinkRenderer</cdk:renderer-type>
+ </cc:interface>
+
+ <cc:implementation>
+ <a id="#{clientId}" name="#{clientId}"
+ cdk:passThroughWithExclusions="value name onclick href id" onclick="#{this.getOnClick(facesContext, cc)}"
+ href="#" class="#{cc.attributes['styleClass']}">
+ #{cc.attributes['value']}
+ <cdk:body>
+ <cdk:call expression="renderChildren(facesContext, cc);" />
+ </cdk:body>
+ </a>
+ </cc:implementation>
+
+</cdk:root>
Modified: root/ui/trunk/components/core/src/main/templates/org/ajax4jsf/renderkit/html/log.template.xml
===================================================================
--- root/ui/trunk/components/core/src/main/templates/org/ajax4jsf/renderkit/html/log.template.xml 2009-11-20 02:29:35 UTC (rev 15935)
+++ root/ui/trunk/components/core/src/main/templates/org/ajax4jsf/renderkit/html/log.template.xml 2009-11-20 02:34:09 UTC (rev 15936)
@@ -1,38 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<cdk:root xmlns="http://richfaces.org/xhtml-el" xmlns:cdk="http://richfaces.org/cdk"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- class="org.richfaces.renderkit.html.AjaxLogRenderer"
- superclass="org.ajax4jsf.renderkit.RendererBase"
- componentclass="org.richfaces.component.UIAjaxLog">
+ xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:cc="http://java.sun.com/jsf/composite"
+ xmlns:javaee="http://java.sun.com/xml/ns/javaee">
- <!-- f:clientid var="clientId"/ >
- <cdk:choose>
- <cdk:when test="#{component.isPopup()}">
- <script id="#{clientId}" type="text/javascript">
- LOG.registerPopup(
- '#{component.attributes["hotkey"]}',
- '#{component.attributes["name"]}',
- #{component.attributes["width"]},
- #{component.attributes["height"]},
- LOG.#{component.attributes["level"]});
- </script>
- </cdk:when>
- <cdk:otherwise>
- <div id="richfaces.log"
+ <cc:interface>
+ <cdk:class>org.richfaces.renderkit.html.AjaxLogRenderer</cdk:class>
+ <cdk:superclass>org.ajax4jsf.renderkit.RendererBase</cdk:superclass>
+ <cdk:component-family>org.richfaces.AjaxLog</cdk:component-family>
+ <cdk:renderer-type>org.richfaces.AjaxLogRenderer</cdk:renderer-type>
+ </cc:interface>
+
+ <cc:implementation>
+ <!--
+ f:clientid var="clientId"/ > <cdk:choose> <cdk:when
+ test="#{component.isPopup()}"> <script id="#{clientId}"
+ type="text/javascript"> LOG.registerPopup(
+ '#{component.attributes["hotkey"]}',
+ '#{component.attributes["name"]}', #{component.attributes["width"]},
+ #{component.attributes["height"]},
+ LOG.#{component.attributes["level"]}); </script> </cdk:when>
+ <cdk:otherwise> <div id="richfaces.log"
style='width:#{component.attributes["width"]};height:#{component.attributes["height"]};overflow:auto;#{component.attributes["style"]}'
cdk:passThroughWithExclusions="value name id style">
- <button>Clear</button><br />
- <script type="text/javascript">
- LOG.LEVEL = LOG.#{component.attributes["level"]};
- </script>
- </div>
- </cdk:otherwise>
- </cdk:choose-->
- <div id="richfaces.log" class="rich-log #{component.attributes['styleClass']}"
- cdk:passThroughWithExclusions="id class">
- <script type="text/javascript">
- RichFaces.log.setLevel("#{component.attributes['level']}");
+ <button>Clear</button><br /> <script type="text/javascript">
+ LOG.LEVEL = LOG.#{component.attributes["level"]}; </script> </div>
+ </cdk:otherwise> </cdk:choose
+ -->
+ <div id="richfaces.log" class="rich-log #{cc.attributes['styleClass']}"
+ cdk:passThroughWithExclusions="id class">
+ <script type="text/javascript">
+ RichFaces.log.setLevel("#{cc.attributes['level']}");
</script>
- </div>
+ </div>
+ </cc:implementation>
</cdk:root>
15 years, 1 month
JBoss Rich Faces SVN: r15935 - root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/templates.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-11-19 21:29:35 -0500 (Thu, 19 Nov 2009)
New Revision: 15935
Modified:
root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/templates/testComponent.xml
Log:
https://jira.jboss.org/jira/browse/RF-7732
Modified: root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/templates/testComponent.xml
===================================================================
--- root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/templates/testComponent.xml 2009-11-20 02:19:52 UTC (rev 15934)
+++ root/cdk/trunk/plugins/maven-cdk-plugin/src/it/annotated-component/src/main/templates/testComponent.xml 2009-11-20 02:29:35 UTC (rev 15935)
@@ -32,16 +32,16 @@
</cc:interface>
<cc:implementation>
start
- <c:if test="#{someTest}">if content</c:if>
+ <c:if test="#{cc.attributes['ifTest'] != null}">if content</c:if>
<c:choose>
- <c:when test="#{anotherTest}">when content</c:when>
- <c:when test="#{coolTest}">
- <c:if test="#{nestedIfTest}">nested if content</c:if>
+ <c:when test="#{cc.attributes['anotherTest'] != null}">when content</c:when>
+ <c:when test="#{cc.attributes['coolTest'] != null}">
+ <c:if test="#{cc.attributes['nestedIfTest'] != null}">nested if content</c:if>
</c:when>
<c:otherwise>otherwise content</c:otherwise>
</c:choose>
- <c:forEach items="#{someCollection}" var="iterationVar">
- "forEach content
+ <c:forEach items="#{cc.children}" var="iterationVar">
+ forEach content
</c:forEach>
finish
</cc:implementation>
15 years, 1 month