Seam SVN: r9274 - trunk/ui/src/main/java/org/jboss/seam/ui/facelet.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-10-12 14:19:25 -0400 (Sun, 12 Oct 2008)
New Revision: 9274
Added:
trunk/ui/src/main/java/org/jboss/seam/ui/facelet/HttpSessionManager.java
trunk/ui/src/main/java/org/jboss/seam/ui/facelet/ServletContextManager.java
Removed:
trunk/ui/src/main/java/org/jboss/seam/ui/facelet/MockHttpSessionManager.java
trunk/ui/src/main/java/org/jboss/seam/ui/facelet/MockServletContextManager.java
Modified:
trunk/ui/src/main/java/org/jboss/seam/ui/facelet/RendererFacesContextFactory.java
trunk/ui/src/main/java/org/jboss/seam/ui/facelet/RendererRequest.java
Log:
JBSEAM-3542
Copied: trunk/ui/src/main/java/org/jboss/seam/ui/facelet/HttpSessionManager.java (from rev 9270, trunk/ui/src/main/java/org/jboss/seam/ui/facelet/MockHttpSessionManager.java)
===================================================================
--- trunk/ui/src/main/java/org/jboss/seam/ui/facelet/HttpSessionManager.java (rev 0)
+++ trunk/ui/src/main/java/org/jboss/seam/ui/facelet/HttpSessionManager.java 2008-10-12 18:19:25 UTC (rev 9274)
@@ -0,0 +1,49 @@
+package org.jboss.seam.ui.facelet;
+
+import static org.jboss.seam.ScopeType.SESSION;
+
+import javax.servlet.http.HttpSession;
+
+import org.jboss.seam.Component;
+import org.jboss.seam.annotations.AutoCreate;
+import org.jboss.seam.annotations.Create;
+import org.jboss.seam.annotations.Install;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.Unwrap;
+import org.jboss.seam.annotations.intercept.BypassInterceptors;
+import org.jboss.seam.contexts.Contexts;
+import org.jboss.seam.mock.MockHttpSession;
+
+@Name("org.jboss.seam.ui.facelet.mockHttpSession")
+@Scope(SESSION)
+@BypassInterceptors
+@Install(dependencies="org.jboss.seam.faces.renderer")
+@AutoCreate
+public class HttpSessionManager
+{
+
+ private HttpSession session;
+
+ @Create
+ public void create()
+ {
+ this.session = new MockHttpSession(ServletContextManager.instance());
+ }
+
+ @Unwrap
+ public HttpSession getSession()
+ {
+ return session;
+ }
+
+ public static HttpSession instance()
+ {
+ if (!Contexts.isSessionContextActive())
+ {
+ throw new IllegalStateException("Session context is not active");
+ }
+ return (HttpSession) Component.getInstance(HttpSessionManager.class, SESSION);
+ }
+
+}
Property changes on: trunk/ui/src/main/java/org/jboss/seam/ui/facelet/HttpSessionManager.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: trunk/ui/src/main/java/org/jboss/seam/ui/facelet/MockHttpSessionManager.java
===================================================================
--- trunk/ui/src/main/java/org/jboss/seam/ui/facelet/MockHttpSessionManager.java 2008-10-12 17:28:12 UTC (rev 9273)
+++ trunk/ui/src/main/java/org/jboss/seam/ui/facelet/MockHttpSessionManager.java 2008-10-12 18:19:25 UTC (rev 9274)
@@ -1,49 +0,0 @@
-package org.jboss.seam.ui.facelet;
-
-import static org.jboss.seam.ScopeType.SESSION;
-
-import javax.servlet.http.HttpSession;
-
-import org.jboss.seam.Component;
-import org.jboss.seam.annotations.AutoCreate;
-import org.jboss.seam.annotations.Create;
-import org.jboss.seam.annotations.Install;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.annotations.Unwrap;
-import org.jboss.seam.annotations.intercept.BypassInterceptors;
-import org.jboss.seam.contexts.Contexts;
-import org.jboss.seam.mock.MockHttpSession;
-
-@Name("org.jboss.seam.ui.facelet.mockHttpSession")
-@Scope(SESSION)
-@BypassInterceptors
-@Install(dependencies="org.jboss.seam.faces.renderer")
-@AutoCreate
-public class MockHttpSessionManager
-{
-
- private HttpSession session;
-
- @Create
- public void create()
- {
- this.session = new MockHttpSession(MockServletContextManager.instance());
- }
-
- @Unwrap
- public HttpSession getSession()
- {
- return session;
- }
-
- public static HttpSession instance()
- {
- if (!Contexts.isSessionContextActive())
- {
- throw new IllegalStateException("Session context is not active");
- }
- return (HttpSession) Component.getInstance(MockHttpSessionManager.class, SESSION);
- }
-
-}
Deleted: trunk/ui/src/main/java/org/jboss/seam/ui/facelet/MockServletContextManager.java
===================================================================
--- trunk/ui/src/main/java/org/jboss/seam/ui/facelet/MockServletContextManager.java 2008-10-12 17:28:12 UTC (rev 9273)
+++ trunk/ui/src/main/java/org/jboss/seam/ui/facelet/MockServletContextManager.java 2008-10-12 18:19:25 UTC (rev 9274)
@@ -1,49 +0,0 @@
-package org.jboss.seam.ui.facelet;
-
-import static org.jboss.seam.ScopeType.APPLICATION;
-
-import javax.servlet.ServletContext;
-
-import org.jboss.seam.Component;
-import org.jboss.seam.annotations.AutoCreate;
-import org.jboss.seam.annotations.Create;
-import org.jboss.seam.annotations.Install;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.annotations.Unwrap;
-import org.jboss.seam.annotations.intercept.BypassInterceptors;
-import org.jboss.seam.contexts.Contexts;
-import org.jboss.seam.mock.MockServletContext;
-
-@Name("org.jboss.seam.ui.facelet.mockServletContext")
-@Scope(APPLICATION)
-@BypassInterceptors
-@Install(dependencies="org.jboss.seam.faces.renderer")
-@AutoCreate
-public class MockServletContextManager
-{
-
- private ServletContext servletContext;
-
- @Create
- public void create()
- {
- this.servletContext = new MockServletContext();
- }
-
- @Unwrap
- public ServletContext getServletContext()
- {
- return servletContext;
- }
-
- public static ServletContext instance()
- {
- if (!Contexts.isApplicationContextActive())
- {
- throw new IllegalStateException("Application context is not active");
- }
- return (ServletContext) Component.getInstance(MockServletContextManager.class, APPLICATION);
- }
-
-}
Modified: trunk/ui/src/main/java/org/jboss/seam/ui/facelet/RendererFacesContextFactory.java
===================================================================
--- trunk/ui/src/main/java/org/jboss/seam/ui/facelet/RendererFacesContextFactory.java 2008-10-12 17:28:12 UTC (rev 9273)
+++ trunk/ui/src/main/java/org/jboss/seam/ui/facelet/RendererFacesContextFactory.java 2008-10-12 18:19:25 UTC (rev 9274)
@@ -53,7 +53,7 @@
public FacesContext getFacesContext(ServletRequest request, ServletResponse response)
{
- return facesContextFactory.getFacesContext(MockServletContextManager.instance(), request, response, lifecycle);
+ return facesContextFactory.getFacesContext(ServletContextManager.instance(), request, response, lifecycle);
}
@Destroy
Modified: trunk/ui/src/main/java/org/jboss/seam/ui/facelet/RendererRequest.java
===================================================================
--- trunk/ui/src/main/java/org/jboss/seam/ui/facelet/RendererRequest.java 2008-10-12 17:28:12 UTC (rev 9273)
+++ trunk/ui/src/main/java/org/jboss/seam/ui/facelet/RendererRequest.java 2008-10-12 18:19:25 UTC (rev 9274)
@@ -26,8 +26,6 @@
private MockHttpServletRequest request;
private MockHttpServletResponse response;
- private ClassLoader originalClassLoader;
-
private StringWriter writer;
private String viewId;
@@ -39,14 +37,9 @@
private void init()
{
- request = new MockHttpServletRequest(MockHttpSessionManager.instance());
+ request = new MockHttpServletRequest(HttpSessionManager.instance());
response = new MockHttpServletResponse();
- // Make sure we are using the correct ClassLoader
- // TODO Is this still necessary
- originalClassLoader = Thread.currentThread().getContextClassLoader();
- Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
-
// Generate the FacesContext from the JSF FacesContextFactory
originalFacesContext = FacesContext.getCurrentInstance();
facesContext = RendererFacesContextFactory.instance().getFacesContext(request, response);
@@ -67,13 +60,11 @@
facesContext.release();
DelegatingFacesContext.setCurrentInstance(originalFacesContext);
- Thread.currentThread().setContextClassLoader(originalClassLoader);
originalFacesContext = null;
facesContext = null;
request = null;
response = null;
- originalClassLoader = null;
}
public void run() throws IOException
Copied: trunk/ui/src/main/java/org/jboss/seam/ui/facelet/ServletContextManager.java (from rev 9253, trunk/ui/src/main/java/org/jboss/seam/ui/facelet/MockServletContextManager.java)
===================================================================
--- trunk/ui/src/main/java/org/jboss/seam/ui/facelet/ServletContextManager.java (rev 0)
+++ trunk/ui/src/main/java/org/jboss/seam/ui/facelet/ServletContextManager.java 2008-10-12 18:19:25 UTC (rev 9274)
@@ -0,0 +1,58 @@
+package org.jboss.seam.ui.facelet;
+
+import static org.jboss.seam.ScopeType.APPLICATION;
+
+import javax.servlet.ServletContext;
+
+import org.jboss.seam.Component;
+import org.jboss.seam.annotations.AutoCreate;
+import org.jboss.seam.annotations.Create;
+import org.jboss.seam.annotations.Install;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.Unwrap;
+import org.jboss.seam.annotations.intercept.BypassInterceptors;
+import org.jboss.seam.contexts.Contexts;
+import org.jboss.seam.contexts.ServletLifecycle;
+import org.jboss.seam.mock.MockServletContext;
+
+@Name("org.jboss.seam.ui.facelet.mockServletContext")
+@Scope(APPLICATION)
+@BypassInterceptors
+@Install(dependencies="org.jboss.seam.faces.renderer")
+@AutoCreate
+public class ServletContextManager
+{
+
+ private ServletContext servletContext;
+
+ @Create
+ public void create()
+ {
+ // TODO A bit of a hack, we should store the servlet context properly
+ if (ServletLifecycle.getServletContext() != null)
+ {
+ servletContext = ServletLifecycle.getServletContext();
+ }
+ else
+ {
+ this.servletContext = new MockServletContext();
+ }
+ }
+
+ @Unwrap
+ public ServletContext getServletContext()
+ {
+ return servletContext;
+ }
+
+ public static ServletContext instance()
+ {
+ if (!Contexts.isApplicationContextActive())
+ {
+ throw new IllegalStateException("Application context is not active");
+ }
+ return (ServletContext) Component.getInstance(ServletContextManager.class, APPLICATION);
+ }
+
+}
Property changes on: trunk/ui/src/main/java/org/jboss/seam/ui/facelet/ServletContextManager.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
16 years, 1 month
Seam SVN: r9273 - in trunk: src/excel/org/jboss/seam/excel/css and 2 other directories.
by seam-commits@lists.jboss.org
Author: nickarls
Date: 2008-10-12 13:28:12 -0400 (Sun, 12 Oct 2008)
New Revision: 9273
Modified:
trunk/doc/Seam_Reference_Guide/en-US/Excel.xml
trunk/src/excel/org/jboss/seam/excel/css/CSSNames.java
trunk/src/excel/org/jboss/seam/excel/css/CellStyle.java
trunk/src/excel/org/jboss/seam/excel/css/PropertyBuilders.java
trunk/src/excel/org/jboss/seam/excel/jxl/JXLHelper.java
trunk/src/excel/org/jboss/seam/excel/ui/ExcelComponent.java
trunk/src/excel/org/jboss/seam/excel/ui/UICell.java
trunk/src/excel/org/jboss/seam/excel/ui/UIFormula.java
Log:
complete migration of forceType attribute to css (partial commit broke build)
Modified: trunk/doc/Seam_Reference_Guide/en-US/Excel.xml
===================================================================
--- trunk/doc/Seam_Reference_Guide/en-US/Excel.xml 2008-10-12 17:00:37 UTC (rev 9272)
+++ trunk/doc/Seam_Reference_Guide/en-US/Excel.xml 2008-10-12 17:28:12 UTC (rev 9273)
@@ -340,6 +340,14 @@
to some pattern, this file extension must also match.
</para>
</listitem>
+ <listitem>
+ <para>
+ <literal>exportKey</literal>
+ —A key under which to store the resulting data
+ in a DocumentData object under the event scope. If used,
+ there is no redirection.
+ </para>
+ </listitem>
</itemizedlist>
<para>
<emphasis>Child elemenents</emphasis>
@@ -983,16 +991,6 @@
</listitem>
<listitem>
<para>
- <literal>forceType</literal>
- —The forced type of the cell data. The value
- is a string that can be one of "general",
- "number", "text", "date", "formula" or "bool". The
- type is automatically detected so there is rarely
- any use for this attribute.
- </para>
- </listitem>
- <listitem>
- <para>
<literal>comment</literal>
—A comment to add to the cell. The value is
a string.
@@ -3043,6 +3041,18 @@
</row>
<row>
<entry valign="top">
+ <para>xls-force-type</para>
+ </entry>
+ <entry valign="top">
+ <para>
+ The forced type of the cell data. The value is a string that can be one
+ of "general", "number", "text", "date", "formula" or "bool". The type
+ is automatically detected so there is rarely any use for this attribute.
+ </para>
+ </entry>
+ </row>
+ <row>
+ <entry valign="top">
<para>xls-format-mask</para>
</entry>
<entry valign="top">
Modified: trunk/src/excel/org/jboss/seam/excel/css/CSSNames.java
===================================================================
--- trunk/src/excel/org/jboss/seam/excel/css/CSSNames.java 2008-10-12 17:00:37 UTC (rev 9272)
+++ trunk/src/excel/org/jboss/seam/excel/css/CSSNames.java 2008-10-12 17:28:12 UTC (rev 9273)
@@ -47,12 +47,11 @@
public static final String SHRINK_TO_FIT = "xls-shrink-to-fit";
public static final String VERICAL_ALIGNMENT = "xls-vertical-alignment";
public static final String WRAP = "xls-wrap";
+ public static final String FORCE_TYPE = "xls-force-type";
public static final String COLUMN_WIDTH = "xls-column-width";
public static final String COLUMN_WIDTHS = "xls-column-widths";
public static final String COLUMN_AUTO_SIZE = "xls-column-autosize";
public static final String COLUMN_HIDDEN = "xls-column-hidden";
- public static final String FORCE_TYPE = "xls-force-type";
-
}
Modified: trunk/src/excel/org/jboss/seam/excel/css/CellStyle.java
===================================================================
--- trunk/src/excel/org/jboss/seam/excel/css/CellStyle.java 2008-10-12 17:00:37 UTC (rev 9272)
+++ trunk/src/excel/org/jboss/seam/excel/css/CellStyle.java 2008-10-12 17:28:12 UTC (rev 9273)
@@ -66,6 +66,7 @@
public Boolean wrap;
public String verticalAlignment;
public String formatMask;
+ public String forceType;
public CellStyle(Map<String, Object> styleMap)
{
@@ -95,6 +96,7 @@
wrap = (Boolean) styleMap.get(CSSNames.WRAP);
verticalAlignment = (String) styleMap.get(CSSNames.VERICAL_ALIGNMENT);
formatMask = (String) styleMap.get(CSSNames.FORMAT_MASK);
+ forceType = (String) styleMap.get(CSSNames.FORCE_TYPE);
}
}
Modified: trunk/src/excel/org/jboss/seam/excel/css/PropertyBuilders.java
===================================================================
--- trunk/src/excel/org/jboss/seam/excel/css/PropertyBuilders.java 2008-10-12 17:00:37 UTC (rev 9272)
+++ trunk/src/excel/org/jboss/seam/excel/css/PropertyBuilders.java 2008-10-12 17:28:12 UTC (rev 9273)
@@ -11,9 +11,12 @@
*/
public class PropertyBuilders
{
+
// Wildcard symbol for column widths
private static final String COLUMN_WIDTH_WILDCARD = "*";
-
+
+ public static class ForceType extends StringPropertyBuilder {}
+
public static class ColumnWidths implements PropertyBuilder
{
public StyleMap parseProperty(String key, String[] values)
@@ -54,12 +57,7 @@
public static class BorderBottomColor extends StringPropertyBuilder
{
}
-
- public static class ForceType extends StringPropertyBuilder
- {
- }
-
public static class BorderBottomShorthand implements PropertyBuilder
{
public StyleMap parseProperty(String key, String[] values)
Modified: trunk/src/excel/org/jboss/seam/excel/jxl/JXLHelper.java
===================================================================
--- trunk/src/excel/org/jboss/seam/excel/jxl/JXLHelper.java 2008-10-12 17:00:37 UTC (rev 9272)
+++ trunk/src/excel/org/jboss/seam/excel/jxl/JXLHelper.java 2008-10-12 17:28:12 UTC (rev 9273)
@@ -54,10 +54,11 @@
import org.jboss.seam.log.Logging;
/**
- * A helper class for the JXLExcelWorkbook, caches cell info and holds CSS parser
+ * A helper class for the JXLExcelWorkbook, caches cell info and holds CSS
+ * parser
*
* @author Nicklas Karlsson (nickarls(a)gmail.com)
- *
+ *
*/
public class JXLHelper
{
@@ -66,10 +67,10 @@
// The CSS parser
private Parser parser = new Parser();
-
+
// A cache of cell info
private CellInfoCache cellInfoCache = new CellInfoCache();
-
+
/**
* Creates a cell format
*
@@ -82,7 +83,8 @@
WritableCellFormat cellFormat = null;
CellStyle cellStyle = new CellStyle(parser.getCascadedStyleMap(uiCell));
- switch (uiCell.getDataType())
+ CellType cellType = cellStyle.forceType != null ? CellType.valueOf(cellStyle.forceType) : uiCell.getDataType();
+ switch (cellType)
{
case text:
// Creates a basic text format
@@ -203,32 +205,23 @@
if (cellStyle.leftBorder.isUsed())
{
- cellFormat.setBorder(JXLFactory.createBorder("left"),
- JXLFactory.createLineStyle(cellStyle.leftBorder.lineStyle),
- JXLFactory.createColor(cellStyle.leftBorder.color));
+ cellFormat.setBorder(JXLFactory.createBorder("left"), JXLFactory.createLineStyle(cellStyle.leftBorder.lineStyle), JXLFactory.createColor(cellStyle.leftBorder.color));
}
if (cellStyle.topBorder.isUsed())
{
- cellFormat.setBorder(JXLFactory.createBorder("top"),
- JXLFactory.createLineStyle(cellStyle.topBorder.lineStyle),
- JXLFactory.createColor(cellStyle.topBorder.color));
+ cellFormat.setBorder(JXLFactory.createBorder("top"), JXLFactory.createLineStyle(cellStyle.topBorder.lineStyle), JXLFactory.createColor(cellStyle.topBorder.color));
}
if (cellStyle.rightBorder.isUsed())
{
- cellFormat.setBorder(JXLFactory.createBorder("right"),
- JXLFactory.createLineStyle(cellStyle.rightBorder.lineStyle),
- JXLFactory.createColor(cellStyle.rightBorder.color));
+ cellFormat.setBorder(JXLFactory.createBorder("right"), JXLFactory.createLineStyle(cellStyle.rightBorder.lineStyle), JXLFactory.createColor(cellStyle.rightBorder.color));
}
if (cellStyle.bottomBorder.isUsed())
{
- cellFormat.setBorder(JXLFactory.createBorder("bottom"),
- JXLFactory.createLineStyle(cellStyle.bottomBorder.lineStyle),
- JXLFactory.createColor(cellStyle.bottomBorder.color));
+ cellFormat.setBorder(JXLFactory.createBorder("bottom"), JXLFactory.createLineStyle(cellStyle.bottomBorder.lineStyle), JXLFactory.createColor(cellStyle.bottomBorder.color));
}
if (cellStyle.background.isUsed())
{
- cellFormat.setBackground(JXLFactory.createColor(cellStyle.background.color),
- JXLFactory.createPattern(cellStyle.background.pattern));
+ cellFormat.setBackground(JXLFactory.createColor(cellStyle.background.color), JXLFactory.createPattern(cellStyle.background.pattern));
}
return cellFormat;
}
@@ -246,7 +239,7 @@
}
/**
- * Applied worksheet settings
+ * Applied worksheet settings
*
* @param worksheet The worksheet to apply the settings to
* @param uiWorksheet The settings to set
@@ -416,10 +409,13 @@
UIPrintTitles printTitles = (UIPrintTitles) child;
settings.setPrintTitles(printTitles.getFirstCol(), printTitles.getFirstRow(), printTitles.getLastCol(), printTitles.getLastRow());
}
- else if (child.getClass() == UIHeader.class) {
+ else if (child.getClass() == UIHeader.class)
+ {
UIHeader uiHeader = (UIHeader) child;
settings.setHeader(JXLFactory.createHeaderFooter(uiHeader, settings.getHeader()));
- } else if (child.getClass() == UIFooter.class) {
+ }
+ else if (child.getClass() == UIFooter.class)
+ {
UIFooter uiFooter = (UIFooter) child;
settings.setFooter(JXLFactory.createHeaderFooter(uiFooter, settings.getFooter()));
}
@@ -628,8 +624,8 @@
* @param data The contents of the cell
* @param cellFormat The cell format settings of the cell
* @return The prepared cell representation
- * @see <a
- * href="http://jexcelapi.sourceforge.net/resources/javadocs/2_6/docs/jxl/write/Wr...">WritableCell</a>
+ * @see <a * href="http://jexcelapi.sourceforge.net/resources/javadocs/2_6/docs/jxl/write/Wr..."
+ * >WritableCell< /a>
*/
public static WritableCell createCell(int column, int row, CellType type, Object data, WritableCellFormat cellFormat)
{
@@ -758,7 +754,7 @@
public void applyColumnSettings(UIColumn uiColumn, WritableSheet worksheet, int columnIndex)
{
ColumnStyle columnStyle = new ColumnStyle(parser.getCascadedStyleMap(uiColumn));
-
+
if (log.isTraceEnabled())
{
log.trace("Applying column settings #0 on column #1", columnStyle, columnIndex);
Modified: trunk/src/excel/org/jboss/seam/excel/ui/ExcelComponent.java
===================================================================
--- trunk/src/excel/org/jboss/seam/excel/ui/ExcelComponent.java 2008-10-12 17:00:37 UTC (rev 9272)
+++ trunk/src/excel/org/jboss/seam/excel/ui/ExcelComponent.java 2008-10-12 17:28:12 UTC (rev 9273)
@@ -28,7 +28,10 @@
private static final String DEFAULT_CONTENT_TYPE = "text/html";
private static final String DEFAULT_CHARACTER_ENCODING = "utf-8";
+ // The CSS style class
private String styleClass;
+
+ // The CSS style
private String style;
/**
Modified: trunk/src/excel/org/jboss/seam/excel/ui/UICell.java
===================================================================
--- trunk/src/excel/org/jboss/seam/excel/ui/UICell.java 2008-10-12 17:00:37 UTC (rev 9272)
+++ trunk/src/excel/org/jboss/seam/excel/ui/UICell.java 2008-10-12 17:28:12 UTC (rev 9273)
@@ -20,7 +20,6 @@
general, number, text, date, formula, bool
}
- private CellType forceType;
private Object value;
private Integer column;
private Integer row;
@@ -65,16 +64,6 @@
this.value = value;
}
- public CellType getForceType()
- {
- return (CellType) valueOf("forceType", forceType);
- }
-
- public void setForceType(CellType forceType)
- {
- this.forceType = forceType;
- }
-
@Override
public String getFamily()
{
@@ -95,10 +84,6 @@
{
return CellType.formula;
}
- if (forceType != null)
- {
- return forceType;
- }
Object value = getValue();
if (value instanceof Integer || value instanceof Long || value instanceof Double || value instanceof Short || value instanceof BigDecimal || value instanceof BigInteger || value instanceof Byte || value instanceof Float)
{
Modified: trunk/src/excel/org/jboss/seam/excel/ui/UIFormula.java
===================================================================
--- trunk/src/excel/org/jboss/seam/excel/ui/UIFormula.java 2008-10-12 17:00:37 UTC (rev 9272)
+++ trunk/src/excel/org/jboss/seam/excel/ui/UIFormula.java 2008-10-12 17:28:12 UTC (rev 9273)
@@ -1,5 +1,6 @@
package org.jboss.seam.excel.ui;
+
public class UIFormula extends UICell
{
public static final String COMPONENT_TYPE = "org.jboss.seam.excel.ui.UIFormula";
@@ -9,11 +10,5 @@
{
return COMPONENT_TYPE;
}
-
- @Override
- public CellType getForceType()
- {
- return CellType.formula;
- }
-
+
}
16 years, 1 month
Seam SVN: r9272 - in trunk/examples/ui: view and 1 other directory.
by seam-commits@lists.jboss.org
Author: danielc.roth
Date: 2008-10-12 13:00:37 -0400 (Sun, 12 Oct 2008)
New Revision: 9272
Modified:
trunk/examples/ui/src/org/jboss/seam/example/ui/EqualityValidatorBean.java
trunk/examples/ui/view/equalityValidator.xhtml
Log:
JBSEAM-2809
Modified: trunk/examples/ui/src/org/jboss/seam/example/ui/EqualityValidatorBean.java
===================================================================
--- trunk/examples/ui/src/org/jboss/seam/example/ui/EqualityValidatorBean.java 2008-10-12 14:05:46 UTC (rev 9271)
+++ trunk/examples/ui/src/org/jboss/seam/example/ui/EqualityValidatorBean.java 2008-10-12 17:00:37 UTC (rev 9272)
@@ -12,48 +12,28 @@
@Scope(ScopeType.SESSION)
public class EqualityValidatorBean
{
-
+
private String name;
-
- private String nameVerification;
-
+
@In
private StatusMessages statusMessages;
-
+
public String getName()
{
return name;
}
-
+
public void setName(String name)
{
this.name = name;
}
-
- public String getNameVerification()
- {
- return nameVerification;
- }
- public void setNameVerification(String nameVerification)
- {
- this.nameVerification = nameVerification;
- }
-
public void check()
{
if (Strings.isEmpty(name))
{
statusMessages.addToControl("name", Severity.WARN, "Enter a name!");
}
- if (Strings.isEmpty(nameVerification))
- {
- statusMessages.addToControl("nameVerification", Severity.WARN, "Enter a name verification!");
- }
- if (name != null && nameVerification != null && !name.equals(nameVerification))
- {
- statusMessages.addToControl("nameVerification", Severity.WARN, "Name and Name Verification not equal (should have been caught by equality validator!)");
- }
}
-
+
}
Modified: trunk/examples/ui/view/equalityValidator.xhtml
===================================================================
--- trunk/examples/ui/view/equalityValidator.xhtml 2008-10-12 14:05:46 UTC (rev 9271)
+++ trunk/examples/ui/view/equalityValidator.xhtml 2008-10-12 17:00:37 UTC (rev 9272)
@@ -14,7 +14,7 @@
<h:inputText id="name" value="#{equalityValidatorBean.name}" />
<h:message for="name" />
<s:label for="nameVerification">Name Verification</s:label>
- <h:inputText id="nameVerification" value="#{equalityValidatorBean.nameVerification}">
+ <h:inputText id="nameVerification" value=" ">
<s:validateEquality for="name" />
</h:inputText>
<h:message for="nameVerification" />
16 years, 1 month
Seam SVN: r9271 - trunk/src/excel/org/jboss/seam/excel/css.
by seam-commits@lists.jboss.org
Author: danielc.roth
Date: 2008-10-12 10:05:46 -0400 (Sun, 12 Oct 2008)
New Revision: 9271
Modified:
trunk/src/excel/org/jboss/seam/excel/css/CSSNames.java
trunk/src/excel/org/jboss/seam/excel/css/PropertyBuilders.java
Log:
Fix for trunk
Modified: trunk/src/excel/org/jboss/seam/excel/css/CSSNames.java
===================================================================
--- trunk/src/excel/org/jboss/seam/excel/css/CSSNames.java 2008-10-12 13:52:15 UTC (rev 9270)
+++ trunk/src/excel/org/jboss/seam/excel/css/CSSNames.java 2008-10-12 14:05:46 UTC (rev 9271)
@@ -52,5 +52,7 @@
public static final String COLUMN_WIDTHS = "xls-column-widths";
public static final String COLUMN_AUTO_SIZE = "xls-column-autosize";
public static final String COLUMN_HIDDEN = "xls-column-hidden";
-
+
+ public static final String FORCE_TYPE = "xls-force-type";
+
}
Modified: trunk/src/excel/org/jboss/seam/excel/css/PropertyBuilders.java
===================================================================
--- trunk/src/excel/org/jboss/seam/excel/css/PropertyBuilders.java 2008-10-12 13:52:15 UTC (rev 9270)
+++ trunk/src/excel/org/jboss/seam/excel/css/PropertyBuilders.java 2008-10-12 14:05:46 UTC (rev 9271)
@@ -55,6 +55,11 @@
{
}
+
+ public static class ForceType extends StringPropertyBuilder
+ {
+ }
+
public static class BorderBottomShorthand implements PropertyBuilder
{
public StyleMap parseProperty(String key, String[] values)
16 years, 1 month
Seam SVN: r9270 - trunk/src/main/org/jboss/seam/mock.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-10-12 09:52:15 -0400 (Sun, 12 Oct 2008)
New Revision: 9270
Modified:
trunk/src/main/org/jboss/seam/mock/MockServletContext.java
Log:
Shouldn't choke on not being able to find web.xml
Modified: trunk/src/main/org/jboss/seam/mock/MockServletContext.java
===================================================================
--- trunk/src/main/org/jboss/seam/mock/MockServletContext.java 2008-10-12 11:12:48 UTC (rev 9269)
+++ trunk/src/main/org/jboss/seam/mock/MockServletContext.java 2008-10-12 13:52:15 UTC (rev 9270)
@@ -21,12 +21,16 @@
import org.dom4j.DocumentException;
import org.dom4j.Element;
+import org.jboss.seam.log.LogProvider;
+import org.jboss.seam.log.Logging;
import org.jboss.seam.util.IteratorEnumeration;
import org.jboss.seam.util.XML;
public class MockServletContext implements ServletContext
{
+ private transient LogProvider log = Logging.getLogProvider(MockServletContext.class);
+
private Map<String, String> initParameters = new HashMap<String, String>();
private Map<String, Object> attributes = new HashMap<String, Object>();
@@ -57,7 +61,7 @@
}
catch (URISyntaxException e)
{
- throw new IllegalStateException(e);
+ log.warn("Unable to find web.xml", e);
}
}
@@ -257,7 +261,14 @@
public String getRealPath(String relativePath)
{
- return webappRoot.getAbsolutePath() + relativePath;
+ if (webappRoot != null)
+ {
+ return webappRoot.getAbsolutePath() + relativePath;
+ }
+ else
+ {
+ return relativePath;
+ }
}
public String getServerInfo()
16 years, 1 month
Seam SVN: r9269 - trunk/src/excel/org/jboss/seam/excel/css.
by seam-commits@lists.jboss.org
Author: nickarls
Date: 2008-10-12 07:12:48 -0400 (Sun, 12 Oct 2008)
New Revision: 9269
Modified:
trunk/src/excel/org/jboss/seam/excel/css/Parser.java
Log:
Support local URLs in e:link as documented
ref: http://www.seamframework.org/Community/UILinkCausesUrlMalformedException
Modified: trunk/src/excel/org/jboss/seam/excel/css/Parser.java
===================================================================
--- trunk/src/excel/org/jboss/seam/excel/css/Parser.java 2008-10-12 07:30:32 UTC (rev 9268)
+++ trunk/src/excel/org/jboss/seam/excel/css/Parser.java 2008-10-12 11:12:48 UTC (rev 9269)
@@ -2,6 +2,7 @@
import java.io.BufferedReader;
import java.io.IOException;
+import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
@@ -138,6 +139,7 @@
propertyBuilders.put(CSSNames.COLUMN_AUTO_SIZE, new PropertyBuilders.ColumnAutoSize());
propertyBuilders.put(CSSNames.COLUMN_HIDDEN, new PropertyBuilders.ColumnHidden());
propertyBuilders.put(CSSNames.COLUMN_WIDTHS, new PropertyBuilders.ColumnWidths());
+ propertyBuilders.put(CSSNames.FORCE_TYPE, new PropertyBuilders.ForceType());
}
/**
@@ -147,9 +149,9 @@
* @return The read data as a String
* @throws IOException If the stream could not be read
*/
- private static String readCSS(URL url) throws IOException
+ private static String readCSS(InputStream in) throws IOException
{
- BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));
+ BufferedReader reader = new BufferedReader(new InputStreamReader(in));
StringBuffer buffer = new StringBuffer();
String line;
while ((line = reader.readLine()) != null)
@@ -164,15 +166,21 @@
* Parses a style sheet. Really crude. Assumes data is nicely formatted on
* one line per entry
*
- * @param URL The URL to read
+ * @param urlString The URL to read
* @return A map of style class names mapped to StyleMaps
* @throws MalformedURLException
* @throws IOException
*/
- private Map<String, StyleMap> parseStylesheet(String URL) throws MalformedURLException, IOException
+ private Map<String, StyleMap> parseStylesheet(String urlString) throws MalformedURLException, IOException
{
Map<String, StyleMap> styleClasses = new HashMap<String, StyleMap>();
- String css = readCSS(new URL(URL)).toLowerCase();
+ InputStream cssStream = null;
+ if (urlString.indexOf("://") < 0) {
+ cssStream = getClass().getResourceAsStream(urlString);
+ } else {
+ cssStream = new URL(urlString).openStream();
+ }
+ String css = readCSS(cssStream).toLowerCase();
int firstBrace = -1;
int secondBrace = -1;
while (!"".equals(css))
16 years, 1 month
Seam SVN: r9268 - trunk/seam-gen.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2008-10-12 03:30:32 -0400 (Sun, 12 Oct 2008)
New Revision: 9268
Modified:
trunk/seam-gen/build.xml
Log:
make classic the default rather than blueSky
Modified: trunk/seam-gen/build.xml
===================================================================
--- trunk/seam-gen/build.xml 2008-10-12 06:56:30 UTC (rev 9267)
+++ trunk/seam-gen/build.xml 2008-10-12 07:30:32 UTC (rev 9268)
@@ -219,10 +219,10 @@
<equals arg1="${icefaces.new}" arg2="y"/>
</condition>
- <property name="old.richfaces.skin" value="blueSky"/>
+ <property name="old.richfaces.skin" value="classic"/>
<input addproperty="richfaces.skin.new"
message="Select a RichFaces skin [${old.richfaces.skin}]"
- validargs="blueSky,classic,ruby,wine,deepMarine,emeraldTown,japanCherry,DEFAULT"
+ validargs="blueSky,classic,deepMarine,DEFAULT,emeraldTown,japanCherry,ruby,wine"
defaultvalue="${old.richfaces.skin}"/>
<property name="old.project.type" value="ear"/>
16 years, 1 month
Seam SVN: r9267 - trunk/seam-gen/view/img.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2008-10-12 02:56:30 -0400 (Sun, 12 Oct 2008)
New Revision: 9267
Modified:
trunk/seam-gen/view/img/seamlogo.png
Log:
use transparent logo
Modified: trunk/seam-gen/view/img/seamlogo.png
===================================================================
(Binary files differ)
16 years, 1 month
Seam SVN: r9266 - in trunk/seam-gen/view: img and 1 other directories.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2008-10-12 02:53:12 -0400 (Sun, 12 Oct 2008)
New Revision: 9266
Added:
trunk/seam-gen/view/img/seamlogo.png
Modified:
trunk/seam-gen/view/home.xhtml
trunk/seam-gen/view/stylesheet/theme.css
Log:
put the seam logo on the generated home page
Modified: trunk/seam-gen/view/home.xhtml
===================================================================
--- trunk/seam-gen/view/home.xhtml 2008-10-12 06:01:39 UTC (rev 9265)
+++ trunk/seam-gen/view/home.xhtml 2008-10-12 06:53:12 UTC (rev 9266)
@@ -10,22 +10,27 @@
<ui:define name="body">
+ <h1>Welcome to Seam!</h1>
<rich:panel>
- <f:facet name="header">Welcome!</f:facet>
- <p>This empty shell application includes:</p>
- <ul>
- <li>Ant build script</li>
- <li>Deployment to JBoss AS (EAR or WAR)</li>
- <li>Development and production profiles</li>
- <li>Integration testing using TestNG and Embedded JBoss</li>
- <li>JavaBean or EJB 3.0 Seam components</li>
- <li>JPA entity classes</li>
- <li>A configurable DataSource and JPA EntityManager</li>
- <li>Templated Facelets views</li>
- <li>RichFaces panels and tables</li>
- <li>Default CSS stylesheet</li>
- <li>Internationalization support</li>
- </ul>
+ <h:panelGrid columns="2">
+ <h:graphicImage value="/img/seamlogo.png" alt="Seam logo"/>
+ <s:div styleClass="info">
+ <p><strong>Your seam-gen project is deployed!</strong> Here are some of the features this project provides:</p>
+ <ul class="bullets">
+ <li>Ant build script</li>
+ <li>Deployment to JBoss AS (EAR or WAR)</li>
+ <li>Development and production profiles</li>
+ <li>Integration testing using TestNG and Embedded JBoss</li>
+ <li>JavaBean or EJB 3.0 Seam components</li>
+ <li>JPA entity classes</li>
+ <li>A configurable DataSource and JPA EntityManager</li>
+ <li>Templated Facelets views</li>
+ <li>RichFaces panels and tables</li>
+ <li>Default CSS stylesheet</li>
+ <li>Internationalization support</li>
+ </ul>
+ </s:div>
+ </h:panelGrid>
</rich:panel>
</ui:define>
Added: trunk/seam-gen/view/img/seamlogo.png
===================================================================
(Binary files differ)
Property changes on: trunk/seam-gen/view/img/seamlogo.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/seam-gen/view/stylesheet/theme.css
===================================================================
--- trunk/seam-gen/view/stylesheet/theme.css 2008-10-12 06:01:39 UTC (rev 9265)
+++ trunk/seam-gen/view/stylesheet/theme.css 2008-10-12 06:53:12 UTC (rev 9266)
@@ -174,3 +174,15 @@
.rich-list-item {
padding-bottom: 4px;
}
+
+div.info {
+ font-size: 1.25em;
+}
+
+ul.bullets {
+ list-style: square;
+}
+
+ul.bullets li {
+ padding-bottom: 2px;
+}
16 years, 1 month
Seam SVN: r9265 - in trunk/seam-gen: view and 1 other directories.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2008-10-12 02:01:39 -0400 (Sun, 12 Oct 2008)
New Revision: 9265
Added:
trunk/seam-gen/view/img/manytoone.gif
trunk/seam-gen/view/img/onetomany.gif
Modified:
trunk/seam-gen/resources/WEB-INF/web.xml
trunk/seam-gen/view/edit.xhtml.ftl
trunk/seam-gen/view/list.xhtml.ftl
trunk/seam-gen/view/view.xhtml.ftl
Log:
use image in tab to denote parent and child associations
make script/style packs the default
Modified: trunk/seam-gen/resources/WEB-INF/web.xml
===================================================================
--- trunk/seam-gen/resources/WEB-INF/web.xml 2008-10-12 05:26:44 UTC (rev 9264)
+++ trunk/seam-gen/resources/WEB-INF/web.xml 2008-10-12 06:01:39 UTC (rev 9265)
@@ -23,16 +23,16 @@
<param-value>disable</param-value>
</context-param>
- <!-- Change the load strategies to ALL to create bundles -->
+ <!-- Change load strategy to DEFAULT to disable sending scripts/styles as packs -->
<context-param>
<param-name>org.richfaces.LoadStyleStrategy</param-name>
- <param-value>DEFAULT</param-value>
+ <param-value>ALL</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.LoadScriptStrategy</param-name>
- <param-value>DEFAULT</param-value>
+ <param-value>ALL</param-value>
</context-param>
<!-- Seam -->
Modified: trunk/seam-gen/view/edit.xhtml.ftl
===================================================================
--- trunk/seam-gen/view/edit.xhtml.ftl 2008-10-12 05:26:44 UTC (rev 9264)
+++ trunk/seam-gen/view/edit.xhtml.ftl 2008-10-12 06:01:39 UTC (rev 9265)
@@ -1,5 +1,6 @@
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<#include "../util/TypeInfo.ftl">
<#assign entityName = pojo.shortName>
<#assign componentName = entityName?uncap_first>
<#assign homeName = componentName + "Home">
@@ -19,7 +20,7 @@
<h:form id="${componentName}" styleClass="edit">
<rich:panel>
- <f:facet name="header">${'#'}{${homeName}.managed ? 'Edit' : 'Add'} ${entityName}</f:facet>
+ <f:facet name="header">${'#'}{${homeName}.managed ? 'Edit' : 'Add'} ${label(entityName)}</f:facet>
<#foreach property in pojo.allPropertiesIterator>
<#include "editproperty.xhtml.ftl">
</#foreach>
@@ -128,28 +129,11 @@
</#if>
</#if>
</#foreach>
- <h:column>
- <f:facet name="header">Action</f:facet>
- <s:link view="/${parentPageName}.xhtml"
- id="view${parentName}"
- value="View"
- propagation="none">
-<#if parentPojo.isComponent(parentPojo.identifierProperty)>
-<#foreach componentProperty in parentPojo.identifierProperty.value.propertyIterator>
- <f:param name="${parentName}${componentProperty.name?cap_first}"
- value="${'#'}{_${parentName}.${parentPojo.identifierProperty.name}.${componentProperty.name}}"/>
-</#foreach>
-<#else>
- <f:param name="${parentName}${parentPojo.identifierProperty.name?cap_first}"
- value="${'#'}{_${parentName}.${parentPojo.identifierProperty.name}}"/>
-</#if>
- </s:link>
- </h:column>
</rich:dataTable>
<#if parentPojo.shortName!=pojo.shortName>
<div class="actionButtons">
- <s:button value="Select ${property.name}"
+ <s:button value="${'#'}{${homeName}.instance.${property.name} != null ? 'Change' : 'Select'} ${property.name}"
view="/${parentPageName}List.xhtml">
<f:param name="from" value="${pageName}Edit"/>
</s:button>
@@ -193,24 +177,6 @@
</#if>
</#if>
</#foreach>
- <h:column>
- <f:facet name="header">Action</f:facet>
- <s:link view="/${childPageName}.xhtml"
- id="select${childName}"
- value="View"
- propagation="none">
-<#if childPojo.isComponent(childPojo.identifierProperty)>
-<#foreach componentProperty in childPojo.identifierProperty.value.propertyIterator>
- <f:param name="${childName}${componentProperty.name?cap_first}"
- value="${'#'}{_${childName}.${childPojo.identifierProperty.name}.${componentProperty.name}}"/>
-</#foreach>
-<#else>
- <f:param name="${childName}${childPojo.identifierProperty.name?cap_first}"
- value="${'#'}{_${childName}.${childPojo.identifierProperty.name}}"/>
-</#if>
- <f:param name="${childName}From" value="${entityName}"/>
- </s:link>
- </h:column>
</rich:dataTable>
</h:form>
Added: trunk/seam-gen/view/img/manytoone.gif
===================================================================
(Binary files differ)
Property changes on: trunk/seam-gen/view/img/manytoone.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/seam-gen/view/img/onetomany.gif
===================================================================
(Binary files differ)
Property changes on: trunk/seam-gen/view/img/onetomany.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/seam-gen/view/list.xhtml.ftl
===================================================================
--- trunk/seam-gen/view/list.xhtml.ftl 2008-10-12 05:26:44 UTC (rev 9264)
+++ trunk/seam-gen/view/list.xhtml.ftl 2008-10-12 06:01:39 UTC (rev 9265)
@@ -19,7 +19,7 @@
<h:form id="${componentName}Search" styleClass="edit">
- <rich:simpleTogglePanel label="${entityName} search filter" switchType="ajax">
+ <rich:simpleTogglePanel label="${entityName} Search Filter" switchType="ajax">
<#foreach property in pojo.allPropertiesIterator>
<#if !c2h.isCollection(property) && !isToOne(property) && property != pojo.versionProperty!>
@@ -54,7 +54,7 @@
</h:form>
<rich:panel>
- <f:facet name="header">${entityName} search results</f:facet>
+ <f:facet name="header">${entityName} Search Results</f:facet>
<div class="results" id="${componentName}List">
<h:outputText value="The ${componentName} search returned no results."
Modified: trunk/seam-gen/view/view.xhtml.ftl
===================================================================
--- trunk/seam-gen/view/view.xhtml.ftl 2008-10-12 05:26:44 UTC (rev 9264)
+++ trunk/seam-gen/view/view.xhtml.ftl 2008-10-12 06:01:39 UTC (rev 9265)
@@ -17,7 +17,7 @@
<ui:define name="body">
<rich:panel>
- <f:facet name="header">${entityName}</f:facet>
+ <f:facet name="header">${label(entityName)} Details</f:facet>
<#foreach property in pojo.allPropertiesIterator>
<#if !c2h.isCollection(property) && !isToOne(property) && property != pojo.versionProperty!>
<#include "viewproperty.xhtml.ftl">
@@ -55,7 +55,10 @@
<#assign parentPageName = parentPojo.shortName>
<#assign parentName = parentPojo.shortName?uncap_first>
- <rich:tab label="${label(property.name)}">
+ <rich:tab>
+ <f:facet name="label">
+ <h:panelGroup><h:graphicImage value="/img/manytoone.gif" style="vertical-align: middle; padding-right: 4px;"/>${label(property.name)}</h:panelGroup>
+ </f:facet>
<div class="association" id="${property.name}Parent">
<h:outputText value="There is no ${property.name} associated with this ${componentName}."
@@ -122,7 +125,10 @@
</#if>
<#if c2h.isOneToManyCollection(property)>
- <rich:tab label="${label(property.name)}">
+ <rich:tab>
+ <f:facet name="label">
+ <h:panelGroup><h:graphicImage value="/img/onetomany.gif" style="vertical-align: middle; padding-right: 4px;"/>${label(property.name)}</h:panelGroup>
+ </f:facet>
<h:form styleClass="association" id="${property.name}Children">
<#assign childPojo = c2j.getPOJOClass(property.value.element.associatedClass)>
16 years, 1 month