Seam SVN: r8821 - trunk/src/rss/org/jboss/seam/rss/ui.
by seam-commits@lists.jboss.org
Author: nickarls
Date: 2008-08-26 15:41:59 -0400 (Tue, 26 Aug 2008)
New Revision: 8821
Modified:
trunk/src/rss/org/jboss/seam/rss/ui/UIFeed.java
Log:
Dropped DocumentStore for responseComplete()
Modified: trunk/src/rss/org/jboss/seam/rss/ui/UIFeed.java
===================================================================
--- trunk/src/rss/org/jboss/seam/rss/ui/UIFeed.java 2008-08-26 18:26:58 UTC (rev 8820)
+++ trunk/src/rss/org/jboss/seam/rss/ui/UIFeed.java 2008-08-26 19:41:59 UTC (rev 8821)
@@ -1,29 +1,19 @@
package org.jboss.seam.rss.ui;
import java.io.ByteArrayOutputStream;
-import java.io.File;
import java.io.IOException;
+import java.io.Writer;
import java.text.SimpleDateFormat;
import java.util.Date;
-import javax.faces.component.UIComponent;
-import javax.faces.component.ValueHolder;
-import javax.faces.context.FacesContext;
+import javax.servlet.http.HttpServletResponse;
-import org.jboss.seam.Component;
import org.jboss.seam.contexts.Contexts;
-import org.jboss.seam.core.Manager;
-import org.jboss.seam.document.DocumentData;
-import org.jboss.seam.document.DocumentStore;
-import org.jboss.seam.document.DocumentData.DocumentType;
-import org.jboss.seam.log.Logging;
-import org.jboss.seam.navigation.Pages;
+import javax.faces.context.FacesContext;
import yarfraw.core.datamodel.ChannelFeed;
import yarfraw.core.datamodel.FeedFormat;
-import yarfraw.core.datamodel.Text;
import yarfraw.core.datamodel.YarfrawException;
-import yarfraw.core.datamodel.Text.TextType;
import yarfraw.io.FeedWriter;
/*
@@ -87,38 +77,13 @@
} catch (YarfrawException e) {
throw new IOException("Could not create feed", e);
}
- byteStream.flush();
- String x = byteStream.toString();
- DocumentType documentType = new DocumentData.DocumentType(EXTENSION, MIMETYPE);
-
- String viewId = Pages.getViewId(facesContext);
- String baseName = baseNameForViewId(viewId);
-
- DocumentData documentData = new DocumentData(baseName, documentType, byteStream.toByteArray());
-
- if (sendRedirect)
- {
- DocumentStore store = DocumentStore.instance();
- String id = store.newId();
-
- String url = store.preferredUrlForContent(baseName, documentType.getExtension(), id);
- url = Manager.instance().encodeConversationId(url, viewId);
-
- store.saveData(id, documentData);
-
- facesContext.getExternalContext().redirect(url);
-
- }
- else
- {
- UIComponent parent = getParent();
-
- if (parent instanceof ValueHolder)
- {
- ValueHolder holder = (ValueHolder) parent;
- holder.setValue(documentData);
- }
- }
+ Writer responseWriter = ((HttpServletResponse)facesContext.getExternalContext().getResponse()).getWriter();
+ HttpServletResponse response = (HttpServletResponse)facesContext.getExternalContext().getResponse();
+ response.setContentType(MIMETYPE);
+ response.setContentLength(byteStream.size());
+ responseWriter.write(byteStream.toString());
+ response.flushBuffer();
+ facesContext.responseComplete();
}
public static String baseNameForViewId(String viewId)
16 years, 6 months
Seam SVN: r8820 - trunk/src/excel/org/jboss/seam/excel/ui.
by seam-commits@lists.jboss.org
Author: nickarls
Date: 2008-08-26 14:26:58 -0400 (Tue, 26 Aug 2008)
New Revision: 8820
Modified:
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/UIColumn.java
trunk/src/excel/org/jboss/seam/excel/ui/UIExcelExport.java
trunk/src/excel/org/jboss/seam/excel/ui/UIWorkbook.java
trunk/src/excel/org/jboss/seam/excel/ui/UIWorksheet.java
Log:
JBSEAM-3233 and some minor streamlining
Modified: trunk/src/excel/org/jboss/seam/excel/ui/ExcelComponent.java
===================================================================
--- trunk/src/excel/org/jboss/seam/excel/ui/ExcelComponent.java 2008-08-26 18:17:14 UTC (rev 8819)
+++ trunk/src/excel/org/jboss/seam/excel/ui/ExcelComponent.java 2008-08-26 18:26:58 UTC (rev 8820)
@@ -1,16 +1,23 @@
package org.jboss.seam.excel.ui;
+import java.io.IOException;
+import java.io.StringWriter;
import java.util.ArrayList;
import java.util.List;
import javax.faces.component.UIComponent;
import javax.faces.component.UIComponentBase;
import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
+import javax.faces.render.RenderKit;
import org.jboss.seam.excel.Command;
import org.jboss.seam.excel.ExcelWorkbook;
import org.jboss.seam.excel.Template;
import org.jboss.seam.excel.WorksheetItem;
+import org.jboss.seam.log.Log;
+import org.jboss.seam.log.Logging;
+import org.jboss.seam.ui.util.JSF;
/**
* Common superclass for the UI components. Contains helper methods for merging
@@ -23,7 +30,37 @@
public abstract class ExcelComponent extends UIComponentBase
{
public final static String HEADER_FACET = "header";
+ private static final String DEFAULT_CONTENT_TYPE = "text/html";
+ private static final String DEFAULT_CHARACTER_ENCODING = "utf-8";
+
+ /**
+ * Helper method for rendering a component (usually on a facescontext with a caching
+ * reponsewriter)
+ *
+ * @param facesContext The faces context to render to
+ * @param component The component to render
+ * @return The textual representation of the component
+ * @throws IOException If the JSF helper class can't render the component
+ */
+ public static String cmp2String(FacesContext facesContext, UIComponent component) throws IOException
+ {
+ ResponseWriter oldResponseWriter = facesContext.getResponseWriter();
+ String contentType = oldResponseWriter != null ? oldResponseWriter.getContentType() : DEFAULT_CONTENT_TYPE;
+ String characterEncoding = oldResponseWriter != null ? oldResponseWriter.getCharacterEncoding() : DEFAULT_CHARACTER_ENCODING;
+ RenderKit renderKit = facesContext.getRenderKit();
+ StringWriter cacheingWriter = new StringWriter();
+ ResponseWriter newResponseWriter = renderKit.createResponseWriter(cacheingWriter, contentType, characterEncoding);
+ facesContext.setResponseWriter(newResponseWriter);
+ JSF.renderChild(facesContext, component);
+ if (oldResponseWriter != null) {
+ facesContext.setResponseWriter(oldResponseWriter);
+ }
+ cacheingWriter.flush();
+ cacheingWriter.close();
+ return cacheingWriter.toString();
+ }
+
public ExcelComponent()
{
super();
Modified: trunk/src/excel/org/jboss/seam/excel/ui/UICell.java
===================================================================
--- trunk/src/excel/org/jboss/seam/excel/ui/UICell.java 2008-08-26 18:17:14 UTC (rev 8819)
+++ trunk/src/excel/org/jboss/seam/excel/ui/UICell.java 2008-08-26 18:26:58 UTC (rev 8820)
@@ -1,9 +1,14 @@
package org.jboss.seam.excel.ui;
+import java.io.IOException;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Date;
+import javax.faces.context.FacesContext;
+
+import org.jboss.seam.core.Interpolator;
+import org.jboss.seam.excel.ExcelWorkbookException;
import org.jboss.seam.excel.WorksheetItem;
public class UICell extends UICellFormat implements WorksheetItem
@@ -50,10 +55,20 @@
{
this.row = row;
}
-
+
+
public Object getValue()
{
- return valueOf("value", value);
+ Object theValue = valueOf("value", value);
+ if (theValue == null) {
+ try {
+ theValue = cmp2String(FacesContext.getCurrentInstance(), this);
+ } catch (IOException e) {
+ String message = Interpolator.instance().interpolate("Could not render cell #0", getId());
+ throw new ExcelWorkbookException(message, e);
+ }
+ }
+ return theValue;
}
public void setValue(Object value)
Modified: trunk/src/excel/org/jboss/seam/excel/ui/UIColumn.java
===================================================================
--- trunk/src/excel/org/jboss/seam/excel/ui/UIColumn.java 2008-08-26 18:17:14 UTC (rev 8819)
+++ trunk/src/excel/org/jboss/seam/excel/ui/UIColumn.java 2008-08-26 18:26:58 UTC (rev 8820)
@@ -1,6 +1,7 @@
package org.jboss.seam.excel.ui;
import java.io.IOException;
+import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
@@ -71,7 +72,7 @@
@SuppressWarnings("unchecked")
@Override
- public void encodeBegin(FacesContext arg0) throws IOException
+ public void encodeBegin(FacesContext facesContext) throws IOException
{
/**
* Get workbook and worksheet
@@ -120,28 +121,36 @@
*/
for (WorksheetItem item : getItems(getChildren()))
{
- if (item != null)
+ Object oldValue = null;
+ Iterator iterator = null;
+ // Store away the old value for the sheet binding var (if there is one)
+ if (sheet.getVar() != null) {
+ oldValue = FacesContext.getCurrentInstance().getExternalContext().getRequestMap().get(sheet.getVar());
+ iterator = sheet.getDataIterator();
+ } else {
+ // No var, no iteration...
+ iterator = new ArrayList().iterator();
+ }
+ while (iterator.hasNext())
{
- // Store away the old value for the sheet binding var
- Object oldValue = FacesContext.getCurrentInstance().getExternalContext().getRequestMap().get(sheet.getVar());
- Iterator iterator = sheet.getDataIterator();
- while (iterator.hasNext())
- {
- // Store the bound data in the request map and add the cell
- FacesContext.getCurrentInstance().getExternalContext().getRequestMap().put(sheet.getVar(), iterator.next());
- excelWorkbook.addItem(item);
- }
+ // Store the bound data in the request map and add the cell
+ FacesContext.getCurrentInstance().getExternalContext().getRequestMap().put(sheet.getVar(), iterator.next());
+ excelWorkbook.addItem(item);
+ }
- // Restore the previously modified request map
- if (oldValue == null)
- {
- FacesContext.getCurrentInstance().getExternalContext().getRequestMap().remove(sheet.getVar());
- }
- else
- {
- FacesContext.getCurrentInstance().getExternalContext().getRequestMap().put(sheet.getVar(), oldValue);
- }
+ // No iteration, nothing to restore
+ if (sheet.getVar() == null) {
+ continue;
}
+ // Restore the previously modified request map (if there was a var)
+ if (oldValue == null)
+ {
+ FacesContext.getCurrentInstance().getExternalContext().getRequestMap().remove(sheet.getVar());
+ }
+ else
+ {
+ FacesContext.getCurrentInstance().getExternalContext().getRequestMap().put(sheet.getVar(), oldValue);
+ }
}
/**
Modified: trunk/src/excel/org/jboss/seam/excel/ui/UIExcelExport.java
===================================================================
--- trunk/src/excel/org/jboss/seam/excel/ui/UIExcelExport.java 2008-08-26 18:17:14 UTC (rev 8819)
+++ trunk/src/excel/org/jboss/seam/excel/ui/UIExcelExport.java 2008-08-26 18:26:58 UTC (rev 8820)
@@ -41,7 +41,7 @@
@SuppressWarnings("unchecked")
@Override
- public void encodeBegin(javax.faces.context.FacesContext arg0) throws IOException
+ public void encodeBegin(javax.faces.context.FacesContext facesContext) throws IOException
{
UIData dataTable = (UIData) getParentByClass(getParent(), UIData.class);
if (dataTable == null)
Modified: trunk/src/excel/org/jboss/seam/excel/ui/UIWorkbook.java
===================================================================
--- trunk/src/excel/org/jboss/seam/excel/ui/UIWorkbook.java 2008-08-26 18:17:14 UTC (rev 8819)
+++ trunk/src/excel/org/jboss/seam/excel/ui/UIWorkbook.java 2008-08-26 18:26:58 UTC (rev 8820)
@@ -287,7 +287,7 @@
@SuppressWarnings("unchecked")
@Override
- public void encodeBegin(javax.faces.context.FacesContext arg0) throws IOException
+ public void encodeBegin(javax.faces.context.FacesContext facesContext) throws IOException
{
timing = new Date().getTime();
/**
Modified: trunk/src/excel/org/jboss/seam/excel/ui/UIWorksheet.java
===================================================================
--- trunk/src/excel/org/jboss/seam/excel/ui/UIWorksheet.java 2008-08-26 18:17:14 UTC (rev 8819)
+++ trunk/src/excel/org/jboss/seam/excel/ui/UIWorksheet.java 2008-08-26 18:26:58 UTC (rev 8820)
@@ -92,7 +92,7 @@
}
@Override
- public void encodeBegin(javax.faces.context.FacesContext arg0) throws java.io.IOException
+ public void encodeBegin(javax.faces.context.FacesContext facesContext) throws java.io.IOException
{
/**
* Get workbook
16 years, 6 months
Seam SVN: r8819 - trunk/build.
by seam-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2008-08-26 14:17:14 -0400 (Tue, 26 Aug 2008)
New Revision: 8819
Modified:
trunk/build/build.xml
Log:
fixed repository deployment of the jboss-seam-wicket.jar
Modified: trunk/build/build.xml
===================================================================
--- trunk/build/build.xml 2008-08-26 17:46:16 UTC (rev 8818)
+++ trunk/build/build.xml 2008-08-26 18:17:14 UTC (rev 8819)
@@ -50,6 +50,7 @@
<deployWithSources pom="${ui.pom}" jar="${lib.dir}/jboss-seam-ui.jar" repositoryId="offline.repository.jboss.org" srcjar="${lib.dir}/src/jboss-seam-ui-sources.jar"/>
<deployWithSources pom="${jul.pom}" jar="${lib.dir}/interop/jboss-seam-jul.jar" repositoryId="offline.repository.jboss.org" srcjar="${lib.dir}/interop/src/jboss-seam-jul-sources.jar"/>
<deployWithSources pom="${resteasy.pom}" jar="${lib.dir}/jboss-seam-resteasy.jar" repositoryId="offline.repository.jboss.org" srcjar="${lib.dir}/src/jboss-seam-resteasy-sources.jar"/>
+ <deployWithSources pom="${wicket.pom}" jar="${lib.dir}/jboss-seam-wicket.jar" repositoryId="offline.repository.jboss.org" srcjar="${lib.dir}/src/jboss-seam-wicket-sources.jar"/>
<deployExample name="booking" repositoryId="offline.repository.jboss.org"/>
<deployExampleNoDs name="numberguess" repositoryId="offline.repository.jboss.org"/>
<deployExample name="dvd" path="${seam.dir}/examples/dvdstore" repositoryId="offline.repository.jboss.org"/>
16 years, 6 months
Seam SVN: r8818 - trunk/build.
by seam-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2008-08-26 13:46:16 -0400 (Tue, 26 Aug 2008)
New Revision: 8818
Modified:
trunk/build/build.xml
Log:
fixed path to jboss-seam-jul-sources.jar for repository updates
Modified: trunk/build/build.xml
===================================================================
--- trunk/build/build.xml 2008-08-26 16:36:55 UTC (rev 8817)
+++ trunk/build/build.xml 2008-08-26 17:46:16 UTC (rev 8818)
@@ -48,7 +48,7 @@
<deployWithSources pom="${excel.pom}" jar="${lib.dir}/jboss-seam-excel.jar" repositoryId="offline.repository.jboss.org" srcjar="${lib.dir}/src/jboss-seam-excel-sources.jar"/>
<deployWithSources pom="${remoting.pom}" jar="${lib.dir}/jboss-seam-remoting.jar" repositoryId="offline.repository.jboss.org" srcjar="${lib.dir}/src/jboss-seam-remoting-sources.jar"/>
<deployWithSources pom="${ui.pom}" jar="${lib.dir}/jboss-seam-ui.jar" repositoryId="offline.repository.jboss.org" srcjar="${lib.dir}/src/jboss-seam-ui-sources.jar"/>
- <deployWithSources pom="${jul.pom}" jar="${lib.dir}/interop/jboss-seam-jul.jar" repositoryId="offline.repository.jboss.org" srcjar="${lib.dir}/src/interop/jboss-seam-jul-sources.jar"/>
+ <deployWithSources pom="${jul.pom}" jar="${lib.dir}/interop/jboss-seam-jul.jar" repositoryId="offline.repository.jboss.org" srcjar="${lib.dir}/interop/src/jboss-seam-jul-sources.jar"/>
<deployWithSources pom="${resteasy.pom}" jar="${lib.dir}/jboss-seam-resteasy.jar" repositoryId="offline.repository.jboss.org" srcjar="${lib.dir}/src/jboss-seam-resteasy-sources.jar"/>
<deployExample name="booking" repositoryId="offline.repository.jboss.org"/>
<deployExampleNoDs name="numberguess" repositoryId="offline.repository.jboss.org"/>
16 years, 6 months
Seam SVN: r8817 - in trunk/src/excel/org/jboss/seam/excel: csv and 1 other directory.
by seam-commits@lists.jboss.org
Author: danielc.roth
Date: 2008-08-26 12:36:55 -0400 (Tue, 26 Aug 2008)
New Revision: 8817
Modified:
trunk/src/excel/org/jboss/seam/excel/ExcelFactory.java
trunk/src/excel/org/jboss/seam/excel/ExcelWorkbook.java
trunk/src/excel/org/jboss/seam/excel/ExcelWorkbookException.java
trunk/src/excel/org/jboss/seam/excel/csv/CsvExcelWorkbook.java
Log:
Fixed some minors
Modified: trunk/src/excel/org/jboss/seam/excel/ExcelFactory.java
===================================================================
--- trunk/src/excel/org/jboss/seam/excel/ExcelFactory.java 2008-08-26 15:05:35 UTC (rev 8816)
+++ trunk/src/excel/org/jboss/seam/excel/ExcelFactory.java 2008-08-26 16:36:55 UTC (rev 8817)
@@ -13,6 +13,11 @@
import org.jboss.seam.excel.jxl.JXLExcelWorkbook;
import org.jboss.seam.util.Strings;
+/**
+ * Factory to get excel workbook implementation
+ *
+ * @author Daniel Roth (danielc.roth(a)gmail.com)
+ */
@Name("org.jboss.seam.excel.excelFactory")
@Scope(ScopeType.STATELESS)
@AutoCreate
Modified: trunk/src/excel/org/jboss/seam/excel/ExcelWorkbook.java
===================================================================
--- trunk/src/excel/org/jboss/seam/excel/ExcelWorkbook.java 2008-08-26 15:05:35 UTC (rev 8816)
+++ trunk/src/excel/org/jboss/seam/excel/ExcelWorkbook.java 2008-08-26 16:36:55 UTC (rev 8817)
@@ -6,8 +6,7 @@
import org.jboss.seam.excel.ui.UIWorksheet;
/**
- * General interface for interacting with an Excel Workbook abstraction NOTE:
- * Need to cleanup exceptions, since they are currently RI (JExcelAPI) typed
+ * General interface interacting with an Excel Workbook abstraction
*
* @author Nicklas Karlsson (nickarls(a)gmail.com)
* @author Daniel Roth (danielc.roth(a)gmail.com)
Modified: trunk/src/excel/org/jboss/seam/excel/ExcelWorkbookException.java
===================================================================
--- trunk/src/excel/org/jboss/seam/excel/ExcelWorkbookException.java 2008-08-26 15:05:35 UTC (rev 8816)
+++ trunk/src/excel/org/jboss/seam/excel/ExcelWorkbookException.java 2008-08-26 16:36:55 UTC (rev 8817)
@@ -2,6 +2,10 @@
/**
* Encapsulate errors occuring in excel workbook generation
+ *
+ * @author Nicklas Karlsson (nickarls(a)gmail.com)
+ * @author Daniel Roth (danielc.roth(a)gmail.com)
+ *
*/
public class ExcelWorkbookException extends RuntimeException
{
Modified: trunk/src/excel/org/jboss/seam/excel/csv/CsvExcelWorkbook.java
===================================================================
--- trunk/src/excel/org/jboss/seam/excel/csv/CsvExcelWorkbook.java 2008-08-26 15:05:35 UTC (rev 8816)
+++ trunk/src/excel/org/jboss/seam/excel/csv/CsvExcelWorkbook.java 2008-08-26 16:36:55 UTC (rev 8817)
@@ -17,6 +17,8 @@
import org.jboss.seam.excel.ui.UIImage;
import org.jboss.seam.excel.ui.UIWorkbook;
import org.jboss.seam.excel.ui.UIWorksheet;
+import org.jboss.seam.log.Log;
+import org.jboss.seam.log.Logging;
/**
* 10 minute (quite poor) implementation of csv excel workbook... Perhaps better
@@ -24,17 +26,24 @@
*
* Use at own risk.. :)
*
+ * @author Daniel Roth (danielc.roth(a)gmail.com)
*/
public class CsvExcelWorkbook implements ExcelWorkbook
{
- int column = 0;
- int row = 0;
- int sheet = -1;
- int maxrow = 0;
- int maxcolumn = 0;
- int maxsheet = 0;
+ private int column = 0;
+ private int row = 0;
+ private int sheet = -1;
+ private int maxrow = 0;
+ private int maxcolumn = 0;
+ private int maxsheet = 0;
+
+ private final String COLUMN_DELIMITER = "\"";
+ private final String LINEBREAK = "\n";
+
private Map<Integer, Map<Integer, List<String>>> table = null;
private List<String> sheets = new ArrayList<String>();
+
+ private Log log = Logging.getLog(getClass());
public void createWorkbook(UIWorkbook uiWorkbook) throws ExcelWorkbookException
{
@@ -48,11 +57,11 @@
}
- public void createOrSelectWorksheet(String worksheetName, Integer startRow, Integer startColumn)
+ private void createOrSelectWorksheet(String worksheetName, Integer startRow, Integer startColumn)
{
column = 0;
row = 0;
- if (sheets.contains(sheets))
+ if (sheets.contains(worksheetName))
{
sheet = sheets.indexOf(sheets);
column = startColumn;
@@ -74,16 +83,15 @@
Map<Integer, List<String>> sheet = table.get(i);
if (sheet != null)
{
- buffer.append(sheets.get(i)).append("\n");
- for (int j = 0; j < maxrow; j++)
+ for (int j = 0; j <= maxrow; j++)
{
for (List<String> col : sheet.values())
{
if (col.get(j) != null)
- buffer.append("\"").append(String.valueOf(col.get(j))).append("\"").append(",");
+ buffer.append(COLUMN_DELIMITER).append(String.valueOf(col.get(j))).append(COLUMN_DELIMITER).append(",");
}
- buffer.append("\n");
+ buffer.append(LINEBREAK);
}
}
@@ -91,7 +99,7 @@
return buffer.toString().getBytes();
}
- public void addCell(int sheet, int column, int row, UICell uiCell) throws ExcelWorkbookException
+ private void addCell(int sheet, int column, int row, UICell uiCell) throws ExcelWorkbookException
{
if (table.get(sheet) == null)
table.put(sheet, new TreeMap<Integer, List<String>>());
@@ -122,7 +130,7 @@
public void addImage(UIImage uiImage)
{
- // JPG2ASCII!!1!
+ log.warn("addImage() is not supported by CSV exporter", new Object[0]);
}
public void addItem(WorksheetItem item)
@@ -133,18 +141,22 @@
public void addTemplate(Template template)
{
+ log.trace("addTemplate() is not supported by CSV exporter", new Object[0]);
}
public void applyWorksheetSettings(UIWorksheet uiWorksheet)
{
+ log.trace("applyWorksheetSettings() is not supported by CSV exporter", new Object[0]);
}
public void applyColumnSettings(UIColumn uiColumn)
{
+ log.trace("applyColumnSettings() is not supported by CSV exporter", new Object[0]);
}
public void executeCommand(Command command)
{
+ log.trace("executeCommand() is not supported by CSV exporter", new Object[0]);
}
}
16 years, 6 months
Seam SVN: r8816 - trunk/examples/jee5/booking/view.
by seam-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2008-08-26 11:05:35 -0400 (Tue, 26 Aug 2008)
New Revision: 8816
Modified:
trunk/examples/jee5/booking/view/main.xhtml
Log:
JBSEAM-3335
Modified: trunk/examples/jee5/booking/view/main.xhtml
===================================================================
--- trunk/examples/jee5/booking/view/main.xhtml 2008-08-26 14:40:17 UTC (rev 8815)
+++ trunk/examples/jee5/booking/view/main.xhtml 2008-08-26 15:05:35 UTC (rev 8816)
@@ -20,7 +20,9 @@
<h1>Search Hotels</h1>
<fieldset>
<h:inputText id="searchString" value="#{hotelSearch.searchString}" style="width: 165px;">
- <a:support event="onkeyup" actionListener="#{hotelSearch.find}" reRender="searchResults" />
+ <a:support event="onkeyup" actionListener="#{hotelSearch.find}" reRender="searchResults" eventsQueue="searchQueue">
+ <s:conversationId/>
+ </a:support>
</h:inputText>
 
<a:commandButton id="findHotels" value="Find Hotels" action="#{hotelSearch.find}" reRender="searchResults"/>
16 years, 6 months
Seam SVN: r8815 - in trunk/src: rss and 5 other directories.
by seam-commits@lists.jboss.org
Author: nickarls
Date: 2008-08-26 10:40:17 -0400 (Tue, 26 Aug 2008)
New Revision: 8815
Added:
trunk/src/rss/
trunk/src/rss/build.xml
trunk/src/rss/org/
trunk/src/rss/org/jboss/
trunk/src/rss/org/jboss/seam/
trunk/src/rss/org/jboss/seam/rss/
trunk/src/rss/org/jboss/seam/rss/ui/
trunk/src/rss/org/jboss/seam/rss/ui/SyndicationComponent.java
trunk/src/rss/org/jboss/seam/rss/ui/UIEntry.java
trunk/src/rss/org/jboss/seam/rss/ui/UIFeed.java
trunk/src/rss/seam.properties
Log:
preview for JSF rss-support
Added: trunk/src/rss/build.xml
===================================================================
--- trunk/src/rss/build.xml (rev 0)
+++ trunk/src/rss/build.xml 2008-08-26 14:40:17 UTC (rev 8815)
@@ -0,0 +1,24 @@
+<?xml version="1.0"?>
+<project name="Concept" default="jar" basedir=".">
+
+ <fileset id="lib" dir="../../lib">
+ <include name="*.jar" />
+ </fileset>
+
+ <fileset id="yarfraw" dir="c:/java/lib/yarfraw-0.92-bin-all">
+ <include name="*.jar" />
+ </fileset>
+
+ <path id="build.classpath">
+ <fileset refid="lib" />
+ <fileset refid="yarfraw" />
+ </path>
+
+ <target name="compile">
+ <javac srcdir="." destdir="." classpathref="build.classpath" debug="on" source="1.5" />
+ </target>
+
+ <target name="jar" depends="compile">
+ <jar destfile="jboss-seam-rss.jar" basedir="." />
+ </target>
+</project>
Added: trunk/src/rss/org/jboss/seam/rss/ui/SyndicationComponent.java
===================================================================
--- trunk/src/rss/org/jboss/seam/rss/ui/SyndicationComponent.java (rev 0)
+++ trunk/src/rss/org/jboss/seam/rss/ui/SyndicationComponent.java 2008-08-26 14:40:17 UTC (rev 8815)
@@ -0,0 +1,21 @@
+package org.jboss.seam.rss.ui;
+
+import javax.faces.component.UIComponentBase;
+import javax.faces.context.FacesContext;
+
+public abstract class SyndicationComponent extends UIComponentBase
+{
+ protected static final String FEED_IMPL_KEY = "theFeed";
+ protected static final String ATOM_DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ss'Z'";
+
+ protected Object valueOf(String name, Object defaultValue)
+ {
+ Object value = defaultValue;
+ if (getValueExpression(name) != null)
+ {
+ value = getValueExpression(name).getValue(FacesContext.getCurrentInstance().getELContext());
+ }
+ return value;
+ }
+
+}
Added: trunk/src/rss/org/jboss/seam/rss/ui/UIEntry.java
===================================================================
--- trunk/src/rss/org/jboss/seam/rss/ui/UIEntry.java (rev 0)
+++ trunk/src/rss/org/jboss/seam/rss/ui/UIEntry.java 2008-08-26 14:40:17 UTC (rev 8815)
@@ -0,0 +1,162 @@
+package org.jboss.seam.rss.ui;
+
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import org.jboss.seam.contexts.Contexts;
+import javax.faces.context.FacesContext;
+
+import yarfraw.core.datamodel.ChannelFeed;
+import yarfraw.core.datamodel.Content;
+import yarfraw.core.datamodel.ItemEntry;
+import yarfraw.core.datamodel.Link;
+import yarfraw.core.datamodel.Person;
+import yarfraw.core.datamodel.Text;
+import yarfraw.core.datamodel.Text.TextType;
+
+/**
+ *atomEntry =
+ element atom:entry {
+ atomCommonAttributes,
+ (atomAuthor*
+ & atomCategory*
+ & atomContent?
+ & atomContributor*
+ & atomId
+ & atomLink*
+ & atomPublished?
+ & atomRights?
+ & atomSource?
+ & atomSummary?
+ & atomTitle
+ & atomUpdated
+ & extensionElement*)
+ }
+ */
+
+public class UIEntry extends SyndicationComponent
+{
+ private static final String COMPONENT_TYPE = "org.jboss.seam.rss.ui.UIEntry";
+
+ private String uid;
+ private String title;
+ private String link;
+ private String author;
+ private String summary;
+ private Date published;
+ private Date updated;
+
+ @Override
+ public String getFamily()
+ {
+ return COMPONENT_TYPE;
+ }
+
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public void encodeBegin(FacesContext facesContext) throws IOException
+ {
+ ChannelFeed channelFeed = (ChannelFeed) Contexts.getEventContext().get(FEED_IMPL_KEY);
+
+ ItemEntry itemEntry = new ItemEntry();
+ itemEntry.setUid(getUid());
+ itemEntry.setTitle(getTitle());
+ itemEntry.addLink(getLink());
+ String author = getAuthor();
+ if (author != null) {
+ Person authorPerson = new Person();
+ authorPerson.setName(author);
+ itemEntry.addAuthorOrCreator(authorPerson);
+ }
+ itemEntry.setDescriptionOrSummary(getSummary());
+ itemEntry.setUpdatedDate(getUpdated(), new SimpleDateFormat(ATOM_DATE_FORMAT));
+ itemEntry.setPubDate(getPublished(), new SimpleDateFormat(ATOM_DATE_FORMAT));
+
+ channelFeed.addItem(itemEntry);
+ }
+
+ public String getTitle()
+ {
+ return (String) valueOf("title", title);
+ }
+
+
+ public void setTitle(String title)
+ {
+ this.title = title;
+ }
+
+
+ public String getLink()
+ {
+ return (String) valueOf("link", link);
+ }
+
+
+ public void setLink(String link)
+ {
+ this.link = link;
+ }
+
+
+ public String getAuthor()
+ {
+ return (String) valueOf("author", author);
+ }
+
+
+ public void setAuthor(String author)
+ {
+ this.author = author;
+ }
+
+
+ public String getSummary()
+ {
+ return (String) valueOf("summary", summary);
+ }
+
+
+ public void setSummary(String summary)
+ {
+ this.summary = summary;
+ }
+
+ public Date getPublished()
+ {
+ return (Date) valueOf("published", published);
+ }
+
+
+ public void setPublished(Date published)
+ {
+ this.published = published;
+ }
+
+
+ public Date getUpdated()
+ {
+ return (Date) valueOf("updated", updated);
+ }
+
+
+ public void setUpdated(Date updated)
+ {
+ this.updated = updated;
+ }
+
+
+ public String getUid()
+ {
+ return (String) valueOf("uid", uid);
+ }
+
+
+ public void setUid(String uid)
+ {
+ this.uid = uid;
+ }
+
+}
Added: trunk/src/rss/org/jboss/seam/rss/ui/UIFeed.java
===================================================================
--- trunk/src/rss/org/jboss/seam/rss/ui/UIFeed.java (rev 0)
+++ trunk/src/rss/org/jboss/seam/rss/ui/UIFeed.java 2008-08-26 14:40:17 UTC (rev 8815)
@@ -0,0 +1,218 @@
+package org.jboss.seam.rss.ui;
+
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.ValueHolder;
+import javax.faces.context.FacesContext;
+
+import org.jboss.seam.Component;
+import org.jboss.seam.contexts.Contexts;
+import org.jboss.seam.core.Manager;
+import org.jboss.seam.document.DocumentData;
+import org.jboss.seam.document.DocumentStore;
+import org.jboss.seam.document.DocumentData.DocumentType;
+import org.jboss.seam.log.Logging;
+import org.jboss.seam.navigation.Pages;
+
+import yarfraw.core.datamodel.ChannelFeed;
+import yarfraw.core.datamodel.FeedFormat;
+import yarfraw.core.datamodel.Text;
+import yarfraw.core.datamodel.YarfrawException;
+import yarfraw.core.datamodel.Text.TextType;
+import yarfraw.io.FeedWriter;
+
+/*
+ * atomFeed =
+ element atom:feed {
+ atomCommonAttributes,
+ (atomAuthor*
+ & atomCategory*
+ & atomContributor*
+ & atomGenerator?
+ & atomIcon?
+ & atomId
+ & atomLink*
+ & atomLogo?
+ & atomRights?
+ & atomSubtitle?
+ & atomTitle
+ & atomUpdated
+ & extensionElement*),
+ atomEntry*
+ }
+ */
+
+public class UIFeed extends SyndicationComponent
+{
+ private static final String COMPONENT_TYPE = "org.jboss.seam.rss.ui.UIFeed";
+ private static final String EXTENSION = "xml";
+ private static final String MIMETYPE = "text/xml";
+ private static final FeedFormat DEFAULT_FEED_FORMAT = FeedFormat.ATOM10;
+
+ private boolean sendRedirect = true;
+
+ private FeedFormat feedFormat = DEFAULT_FEED_FORMAT;
+ private String uid;
+ private String title;
+ private String subtitle;
+ private Date updated;
+ private String link;
+
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public void encodeBegin(FacesContext facesContext) throws IOException
+ {
+ ChannelFeed channelFeed = new ChannelFeed();
+ channelFeed.setUid(getUid());
+ channelFeed.setTitle(getTitle());
+ channelFeed.setDescriptionOrSubtitle(getSubtitle());
+ channelFeed.setPubDate(getUpdated(), new SimpleDateFormat(ATOM_DATE_FORMAT));
+ channelFeed.addLink(getLink());
+ Contexts.getEventContext().set(FEED_IMPL_KEY, channelFeed);
+ }
+
+ @Override
+ public void encodeEnd(FacesContext facesContext) throws IOException
+ {
+ ChannelFeed channelFeed = (ChannelFeed) Contexts.getEventContext().get(FEED_IMPL_KEY);
+ ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
+ try {
+ FeedWriter.writeChannel(DEFAULT_FEED_FORMAT, channelFeed, byteStream);
+ } catch (YarfrawException e) {
+ throw new IOException("Could not create feed", e);
+ }
+ byteStream.flush();
+ String x = byteStream.toString();
+ DocumentType documentType = new DocumentData.DocumentType(EXTENSION, MIMETYPE);
+
+ String viewId = Pages.getViewId(facesContext);
+ String baseName = baseNameForViewId(viewId);
+
+ DocumentData documentData = new DocumentData(baseName, documentType, byteStream.toByteArray());
+
+ if (sendRedirect)
+ {
+ DocumentStore store = DocumentStore.instance();
+ String id = store.newId();
+
+ String url = store.preferredUrlForContent(baseName, documentType.getExtension(), id);
+ url = Manager.instance().encodeConversationId(url, viewId);
+
+ store.saveData(id, documentData);
+
+ facesContext.getExternalContext().redirect(url);
+
+ }
+ else
+ {
+ UIComponent parent = getParent();
+
+ if (parent instanceof ValueHolder)
+ {
+ ValueHolder holder = (ValueHolder) parent;
+ holder.setValue(documentData);
+ }
+ }
+ }
+
+ public static String baseNameForViewId(String viewId)
+ {
+ int pos = viewId.lastIndexOf("/");
+ if (pos != -1)
+ {
+ viewId = viewId.substring(pos + 1);
+ }
+
+ pos = viewId.lastIndexOf(".");
+ if (pos != -1)
+ {
+ viewId = viewId.substring(0, pos);
+ }
+
+ return viewId;
+ }
+
+ public boolean isSendRedirect()
+ {
+ return sendRedirect;
+ }
+
+ public void setSendRedirect(boolean sendRedirect)
+ {
+ this.sendRedirect = sendRedirect;
+ }
+
+ @Override
+ public String getFamily()
+ {
+ return COMPONENT_TYPE;
+ }
+
+ public String getTitle()
+ {
+ return (String) valueOf("title", title);
+ }
+
+ public void setTitle(String title)
+ {
+ this.title = title;
+ }
+
+ public String getSubtitle()
+ {
+ return (String) valueOf("subtitle", subtitle);
+ }
+
+ public void setSubtitle(String subtitle)
+ {
+ this.subtitle = subtitle;
+ }
+
+ public Date getUpdated()
+ {
+ return (Date) valueOf("updated", updated);
+ }
+
+ public void setUpdated(Date updated)
+ {
+ this.updated = updated;
+ }
+
+ public String getLink()
+ {
+ return (String) valueOf("link", link);
+ }
+
+ public void setLink(String link)
+ {
+ this.link = link;
+ }
+
+ public String getFeedFormat()
+ {
+ return (String) valueOf("feedFormat", feedFormat);
+ }
+
+ public void setFeedFormat(FeedFormat feedFormat)
+ {
+ this.feedFormat = feedFormat;
+ }
+
+ public String getUid()
+ {
+ return (String) valueOf("uid", uid);
+ }
+
+ public void setUid(String uid)
+ {
+ this.uid = uid;
+ }
+
+
+}
Added: trunk/src/rss/seam.properties
===================================================================
16 years, 6 months
Seam SVN: r8814 - in trunk: build and 1 other directory.
by seam-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2008-08-26 10:12:58 -0400 (Tue, 26 Aug 2008)
New Revision: 8814
Modified:
trunk/build/default.build.properties
trunk/build/root.pom.xml
trunk/readme.txt
Log:
revert to snapshot settings to unfreeze trunk
Modified: trunk/build/default.build.properties
===================================================================
--- trunk/build/default.build.properties 2008-08-26 14:03:45 UTC (rev 8813)
+++ trunk/build/default.build.properties 2008-08-26 14:12:58 UTC (rev 8814)
@@ -8,7 +8,7 @@
major.version 2
minor.version .1
patchlevel .0
-qualifier .BETA1
+qualifier -SNAPSHOT
#
# Other program locations
# -----------------------
Modified: trunk/build/root.pom.xml
===================================================================
--- trunk/build/root.pom.xml 2008-08-26 14:03:45 UTC (rev 8813)
+++ trunk/build/root.pom.xml 2008-08-26 14:12:58 UTC (rev 8814)
@@ -15,14 +15,12 @@
<name>JBoss Repository</name>
<url>http://repository.jboss.org/maven2</url>
</pluginRepository>
- <!-- commented out for 2.1.BETA1 tag
<pluginRepository>
<snapshots />
<id>snapshots.jboss.org</id>
<name>JBoss Snapshot Repository</name>
<url>http://snapshots.jboss.org/maven2</url>
- </pluginRepository>
- -->
+ </pluginRepository>
</pluginRepositories>
<repositories>
<repository>
@@ -30,14 +28,12 @@
<name>JBoss Repository</name>
<url>http://repository.jboss.org/maven2</url>
</repository>
- <!-- commented out for 2.1.BETA1 tag
<repository>
<snapshots />
<id>snapshots.jboss.org</id>
<name>JBoss Snapshot Repository</name>
<url>http://snapshots.jboss.org/maven2</url>
</repository>
- -->
</repositories>
<!-- Externalize some version numbers here -->
Modified: trunk/readme.txt
===================================================================
--- trunk/readme.txt 2008-08-26 14:03:45 UTC (rev 8813)
+++ trunk/readme.txt 2008-08-26 14:12:58 UTC (rev 8814)
@@ -1,6 +1,6 @@
JBoss Seam - Contextual Component framework for Java EE 5
=========================================================
-version 2.1.0.BETA1, August 2008
+version 2.1.0.SNAPSHOT, August 2008
This software is distributed under the terms of the FSF Lesser Gnu
Public License (see lgpl.txt).
16 years, 6 months
Seam SVN: r8813 - tags/JBoss_Seam_2_1_0_BETA1.
by seam-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2008-08-26 10:03:45 -0400 (Tue, 26 Aug 2008)
New Revision: 8813
Modified:
tags/JBoss_Seam_2_1_0_BETA1/changelog.txt
Log:
updated for port of JBSEAM-3318 in 2.1.0.BETA1 tag
Modified: tags/JBoss_Seam_2_1_0_BETA1/changelog.txt
===================================================================
--- tags/JBoss_Seam_2_1_0_BETA1/changelog.txt 2008-08-26 14:01:18 UTC (rev 8812)
+++ tags/JBoss_Seam_2_1_0_BETA1/changelog.txt 2008-08-26 14:03:45 UTC (rev 8813)
@@ -156,8 +156,10 @@
* [JBSEAM-3291] - jboss-seam-ui.jar and jboss-seam-ui-sources.jar do not have manifest version information
* [JBSEAM-3295] - Major reentrancy problem with "Application Scope" components and injection/disinjection
* [JBSEAM-3303] - Unable to deploy war in JBoss AS due to jgroups dependency
+ * [JBSEAM-3304] - Blog example throws NullPointerException with message: "Argument Error: Parameter message is null"
* [JBSEAM-3306] - excel example csv download does not point to a csv file
* [JBSEAM-3307] - The excel example's "Export Table" files does not contain header rows
+ * [JBSEAM-3318] - seambay example throws NullPointerException with message: "Argument Error: Parameter message is null" when bidding
** Feature Request
* [JBSEAM-273] - Specify HTTP headers in pages.xml
16 years, 6 months
Seam SVN: r8812 - trunk.
by seam-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2008-08-26 10:01:18 -0400 (Tue, 26 Aug 2008)
New Revision: 8812
Modified:
trunk/changelog.txt
Log:
updated based on fixes for JBSEAM-3318
Modified: trunk/changelog.txt
===================================================================
--- trunk/changelog.txt 2008-08-26 13:52:01 UTC (rev 8811)
+++ trunk/changelog.txt 2008-08-26 14:01:18 UTC (rev 8812)
@@ -156,8 +156,10 @@
* [JBSEAM-3291] - jboss-seam-ui.jar and jboss-seam-ui-sources.jar do not have manifest version information
* [JBSEAM-3295] - Major reentrancy problem with "Application Scope" components and injection/disinjection
* [JBSEAM-3303] - Unable to deploy war in JBoss AS due to jgroups dependency
+ * [JBSEAM-3304] - Blog example throws NullPointerException with message: "Argument Error: Parameter message is null"
* [JBSEAM-3306] - excel example csv download does not point to a csv file
* [JBSEAM-3307] - The excel example's "Export Table" files does not contain header rows
+ * [JBSEAM-3318] - seambay example throws NullPointerException with message: "Argument Error: Parameter message is null" when bidding
** Feature Request
* [JBSEAM-273] - Specify HTTP headers in pages.xml
16 years, 6 months