JBoss Rich Faces SVN: r12805 - in trunk/test-applications/realworld2/web/src/main: webapp/img and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2009-03-03 09:51:30 -0500 (Tue, 03 Mar 2009)
New Revision: 12805
Added:
trunk/test-applications/realworld2/web/src/main/webapp/img/avatar.jpg
Modified:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/ImageSearchHelper.java
trunk/test-applications/realworld2/web/src/main/webapp/includes/register/regInfo.xhtml
Log:
Add avatar
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/ImageSearchHelper.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/ImageSearchHelper.java 2009-03-03 14:22:27 UTC (rev 12804)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/ImageSearchHelper.java 2009-03-03 14:51:30 UTC (rev 12805)
@@ -22,7 +22,7 @@
private static final long serialVersionUID = -304368268896942902L;
- @In
+ @In(required=false)
ConversationState conversationState;
@In(create=true, required=true)
Added: trunk/test-applications/realworld2/web/src/main/webapp/img/avatar.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld2/web/src/main/webapp/img/avatar.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/register/regInfo.xhtml
===================================================================
(Binary files differ)
15 years, 10 months
JBoss Rich Faces SVN: r12804 - trunk/test-applications/realworld2/ejb/src/main/resources.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2009-03-03 09:22:27 -0500 (Tue, 03 Mar 2009)
New Revision: 12804
Modified:
trunk/test-applications/realworld2/ejb/src/main/resources/import.sql
Log:
Long album name example
Modified: trunk/test-applications/realworld2/ejb/src/main/resources/import.sql
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/resources/import.sql 2009-03-03 14:22:16 UTC (rev 12803)
+++ trunk/test-applications/realworld2/ejb/src/main/resources/import.sql 2009-03-03 14:22:27 UTC (rev 12804)
@@ -15,6 +15,7 @@
INSERT INTO albums(album_id, name, description, shared, album_user_id, parent_shelf_id) VALUES (26, 'Travel', 'Fun pictures', true, 1, 2);
INSERT INTO albums(album_id, name, description, shared, album_user_id, parent_shelf_id) VALUES (25, 'Beach', 'Fun pictures', true, 1, 1);
INSERT INTO albums(album_id, name, description, shared, album_user_id, parent_shelf_id) VALUES (23, 'Flowers', 'Fun pictures', true, 3, 4);
+INSERT INTO albums(album_id, name, description, shared, album_user_id, parent_shelf_id) VALUES (27, 'Very very very very very very very long album name ', 'Long name test', true, 1, 2);
INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (98, 'korana', 'Viking/15/korana.jpg', 'korana', '2008-12-18', 15, 'Canon S3', 1024, 1917.000000, 768, '2008-12-01');
15 years, 10 months
JBoss Rich Faces SVN: r12803 - in trunk/test-applications/realworld2/web/src/main/webapp: stylesheet and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2009-03-03 09:22:16 -0500 (Tue, 03 Mar 2009)
New Revision: 12803
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/includes/panelBar/tree.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/stylesheet/realworld2.css
Log:
Long album name example
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/panelBar/tree.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/stylesheet/realworld2.css
===================================================================
--- trunk/test-applications/realworld2/web/src/main/webapp/stylesheet/realworld2.css 2009-03-03 14:19:50 UTC (rev 12802)
+++ trunk/test-applications/realworld2/web/src/main/webapp/stylesheet/realworld2.css 2009-03-03 14:22:16 UTC (rev 12803)
@@ -397,4 +397,8 @@
.search-hide-options-link {
color: rgb(255, 255, 255);
text-decoration: none;
+}
+
+.dr-tree-h-text {
+ white-space: normal;
}
\ No newline at end of file
15 years, 10 months
JBoss Rich Faces SVN: r12802 - in trunk: ui/dataTable/src/main/java/org/richfaces/renderkit and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2009-03-03 09:19:50 -0500 (Tue, 03 Mar 2009)
New Revision: 12802
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxFormTest.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxValidatorTest.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataTableTest.java
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractRowsRenderer.java
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
trunk/ui/dataTable/src/test/java/org/richfaces/renderkit/DataTableRenderingTest.java
Log:
DataTable: .rich-table-firstrow is used for all rows and not the first one
https://jira.jboss.org/jira/browse/RF-5007
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxFormTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxFormTest.java 2009-03-03 14:07:09 UTC (rev 12801)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxFormTest.java 2009-03-03 14:19:50 UTC (rev 12802)
@@ -44,18 +44,8 @@
private final static String NEXT_TEXT = "after submit";
- private final static String CHECK_ID_AJAXSUBMIT = "ajaxSubmit";
-
- private final static String CHECK_ID_IGNOREDUPRESPONSES = "ignoreDupResponses";
-
- private final static String CHECK_ID_PREPENDID = "prependId";
-
private final static String CHECK_ID_RENDERED = "rendered";
- private final static String PANEL_GROUP = "content";
-
- private final static String RERENDER_ID = "rerender";
-
private final static String LINK_ID = "link";
private final static String RESET_METHOD = "#{formBean.reset}";
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxValidatorTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxValidatorTest.java 2009-03-03 14:07:09 UTC (rev 12801)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxValidatorTest.java 2009-03-03 14:19:50 UTC (rev 12802)
@@ -20,8 +20,6 @@
*/
package org.richfaces.testng;
-import junit.framework.Assert;
-
import org.ajax4jsf.template.Template;
import org.richfaces.SeleniumTestBase;
import org.testng.annotations.Test;
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataTableTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataTableTest.java 2009-03-03 14:07:09 UTC (rev 12801)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataTableTest.java 2009-03-03 14:19:50 UTC (rev 12802)
@@ -349,20 +349,16 @@
int rowCount = values.length;
assertRowsCount(rowCount, dataTableId);
- int i = 0;
- String [] actualValues = new String[values.length];
- for (String v : values) {
+ String [] actualValues = new String[rowCount];
+ for (int i = 0; i < rowCount; i++) {
actualValues[i] = getCellText(i, columns);
- i++;
}
- i = 0;
- for (String v : values) {
- if (!v.equals(actualValues[i])) {
+
+ for (int i = 0; i < rowCount; i++) {
+ if (!values[i].equals(actualValues[i])) {
Assert.fail("Columns was sorted incorectly. Expected: " + toString(values) + " But was: " + toString(actualValues));
}
- i++;
}
-
}
private void clickSort(int column) {
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractRowsRenderer.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractRowsRenderer.java 2009-03-03 14:07:09 UTC (rev 12801)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractRowsRenderer.java 2009-03-03 14:19:50 UTC (rev 12802)
@@ -197,12 +197,14 @@
protected void encodeStyleClass(ResponseWriter writer, Object parentPredefined,
Object predefined, Object parent, Object custom) throws IOException {
StringBuffer styleClass = new StringBuffer();
+
// Construct predefined classes
if (null != parentPredefined) {
styleClass.append(parentPredefined).append(" ");
} else if (null != predefined) {
styleClass.append(predefined).append(" ");
}
+
// Append class from parent component.
if (null != parent) {
styleClass.append(parent).append(" ");
Modified: trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
===================================================================
--- trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2009-03-03 14:07:09 UTC (rev 12801)
+++ trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2009-03-03 14:19:50 UTC (rev 12802)
@@ -341,7 +341,7 @@
UIDataTable table = (UIDataTable) holder.getTable();
ResponseWriter writer = context.getResponseWriter();
Iterator<UIComponent> iter = table.columns();
- boolean first = true;
+ boolean first = holder.getRowCounter() == 0;
int currentColumn = 0;
UIComponent column = null;
while (iter.hasNext()) {
@@ -349,8 +349,8 @@
// Start new row for first column - expect a case of the detail
// table, wich will be insert own row.
if (first && !(column instanceof Row)) {
- encodeRowStart(context, getFirstRowSkinClass(), holder
- .getRowClass(), table, writer);
+ encodeRowStart(context, getFirstRowSkinClass(),
+ holder.getRowClass(), table, writer);
}
if (column instanceof Column) {
boolean breakBefore = ((Column) column).isBreakBefore()
@@ -364,15 +364,14 @@
// will be insert own row.
if (!(column instanceof Row)) {
holder.nextRow();
- encodeRowStart(context, holder.getRowClass(), table,
- writer);
+ encodeRowStart(context, holder.getRowClass(), table, writer);
}
}
+
encodeCellChildren(context, column,
first ? getFirstRowSkinClass() : null,
getRowSkinClass(), holder.getRowClass(),
- getCellSkinClass(), holder
- .getColumnClass(currentColumn));
+ getCellSkinClass(), holder.getColumnClass(currentColumn));
// renderChild(context, column);
if ((column instanceof Row) && iter.hasNext()) {
// Start new row for remained columns.
@@ -386,8 +385,8 @@
writer.startElement(HTML.td_ELEM, table);
getUtils().encodeId(context, column);
String columnClass = holder.getColumnClass(currentColumn);
- encodeStyleClass(writer, null, getCellSkinClass(), null,
- columnClass);
+ encodeStyleClass(writer, null, getCellSkinClass(), null, columnClass);
+
// TODO - encode column attributes.
renderChildren(context, column);
writer.endElement(HTML.td_ELEM);
Modified: trunk/ui/dataTable/src/test/java/org/richfaces/renderkit/DataTableRenderingTest.java
===================================================================
--- trunk/ui/dataTable/src/test/java/org/richfaces/renderkit/DataTableRenderingTest.java 2009-03-03 14:07:09 UTC (rev 12801)
+++ trunk/ui/dataTable/src/test/java/org/richfaces/renderkit/DataTableRenderingTest.java 2009-03-03 14:19:50 UTC (rev 12802)
@@ -66,7 +66,21 @@
}
/*
- * (non-Javadoc)
+ * <form>
+ * <dataTable id="dataTable" value="List<Date>">
+ * <columnGroup>
+ * <column>
+ * <outputText column="" />
+ * <column>
+ * <column>
+ * <outputLink value="" />
+ * <column>
+ * </columnGroup>
+ * <column>
+ * <output value="value" />
+ * </column>
+ * </dataTable>
+ * </form>
*
* @see org.ajax4jsf.tests.AbstractAjax4JsfTestCase#setUp()
*/
@@ -75,9 +89,24 @@
form = new HtmlForm();
form.setId("form");
+ form.getChildren().add(getDataTable());
+
facesContext.getViewRoot().getChildren().add(form);
- dataTable = (UIDataTable) application
- .createComponent("org.richfaces.DataTable");
+ }
+
+ /*
+ * <dataTable id="dataTable" value="List<Date>">
+ * <columnGroup>
+ * ...
+ * </columnGroup>
+ * <column>
+ * <output value="value" />
+ * </column>
+ * </dataTable>
+ *
+ * */
+ private UIDataTable getDataTable() {
+ dataTable = (UIDataTable) application.createComponent("org.richfaces.DataTable");
dataTable.setId("dataTable");
List<Date> list = new ArrayList<Date>();
@@ -86,36 +115,51 @@
}
dataTable.setValue(new ListDataModel(list));
- columnGroup = (UIColumnGroup) application
- .createComponent("org.richfaces.ColumnGroup");
- dataTable.getChildren().add(columnGroup);
+ dataTable.getChildren().add(getColumnGroup());
+ dataTable.getChildren().add(getColumn3());
+
+ return dataTable;
+ }
- column1 = (UIColumn) application
- .createComponent("org.richfaces.Column");
- UIOutput cellElement1 = (UIOutput) createComponent(
- HtmlOutputText.COMPONENT_TYPE, HtmlOutputText.class.getName(),
- null, null, null);
+ private javax.faces.component.UIColumn getColumn3() {
+ javax.faces.component.UIColumn column3 = new javax.faces.component.UIColumn();
+ column3.setId("column3");
+ UIOutput cellElement3 = (UIOutput) application.createComponent(UIOutput.COMPONENT_TYPE);
+ cellElement3.setValue("value");
+ column3.getChildren().add(cellElement3);
+ return column3;
+ }
+
+ /*
+ * <columnGroup>
+ * <column>
+ * <outputText column="" />
+ * <column>
+ * <column>
+ * <outputLink value="" />
+ * <column>
+ * </columnGroup>
+ *
+ * */
+ private UIColumnGroup getColumnGroup() {
+ columnGroup = (UIColumnGroup) application.createComponent("org.richfaces.ColumnGroup");
+ columnGroup.setId("columnGroup");
+
+ column1 = (UIColumn) application.createComponent("org.richfaces.Column");
+ column1.setId("column1");
+ UIOutput cellElement1 = (UIOutput) createComponent(HtmlOutputText.COMPONENT_TYPE, HtmlOutputText.class.getName(),null, null, null);
cellElement1.setValueExpression("column", new ColumnValueExpression());
column1.getChildren().add(cellElement1);
columnGroup.getChildren().add(column1);
- column2 = (UIColumn) application
- .createComponent("org.richfaces.Column");
- UIOutput cellElement2 = (UIOutput) createComponent(
- HtmlOutputText.COMPONENT_TYPE, HtmlOutputLink.class.getName(),
- null, null, null);
+ column2 = (UIColumn) application.createComponent("org.richfaces.Column");
+ column2.setId("column2");
+ UIOutput cellElement2 = (UIOutput) createComponent(HtmlOutputText.COMPONENT_TYPE, HtmlOutputLink.class.getName(),null, null, null);
cellElement2.setValueExpression("value", new ColumnValueExpression());
column2.getChildren().add(cellElement2);
- columnGroup.getChildren().add(column2);
+ columnGroup.getChildren().add(column2);
- javax.faces.component.UIColumn column3 = new javax.faces.component.UIColumn();
- UIOutput cellElement3 = (UIOutput) application.createComponent(UIOutput.COMPONENT_TYPE);
- cellElement3.setValue("value");
- column3.getChildren().add(cellElement3);
- dataTable.getChildren().add(column3);
-
- form.getChildren().add(dataTable);
-
+ return columnGroup;
}
/*
@@ -138,56 +182,64 @@
* @throws Exception
*/
public void testRenderDataTable() throws Exception {
-
+ // setUp
dataTable.getAttributes().put("columnsWidth", "400px,200px");
- UIColumn column3 = (UIColumn) application
- .createComponent("org.richfaces.Column");
+ UIColumn column3 = (UIColumn) application.createComponent("org.richfaces.Column");
+ column3.setId("local_column3");
dataTable.getChildren().add(column3);
- UIOutput text = (UIOutput) createComponent(
- HtmlOutputText.COMPONENT_TYPE, HtmlOutputText.class.getName(),
- null, null, null);
+ UIOutput text = (UIOutput) createComponent(HtmlOutputText.COMPONENT_TYPE, HtmlOutputText.class.getName(),null, null, null);
text.setValue("Column");
column3.getChildren().add(text);
column3.setBreakBefore(true);
- UIColumn column4 = (UIColumn) application
- .createComponent("org.richfaces.Column");
+ UIColumn column4 = (UIColumn) application.createComponent("org.richfaces.Column");
+ column4.setId("local_column4");
dataTable.getChildren().add(column4);
- UIOutput text2 = (UIOutput) createComponent(
- HtmlOutputText.COMPONENT_TYPE, HtmlOutputText.class.getName(),
- null, null, null);
+ UIOutput text2 = (UIOutput) createComponent(HtmlOutputText.COMPONENT_TYPE, HtmlOutputText.class.getName(),null, null, null);
text.setValue("Column2");
column4.getChildren().add(text2);
column4.setRendered(false);
+ // test
HtmlPage page = renderView();
+// System.out.println(page.asXml());
+
assertNotNull(page);
- HtmlElement table = page.getHtmlElementById(dataTable
- .getClientId(facesContext));
+ HtmlElement table = page.getHtmlElementById(dataTable.getClientId(facesContext));
assertNotNull(table);
assertEquals("table", table.getNodeName());
String classAttr = table.getAttributeValue("class");
assertTrue(classAttr.contains("dr-table rich-table"));
- List<HtmlElement> elements = table.getHtmlElementsByTagName("col");
+ List<?> elements = table.getHtmlElementsByTagName("col");
assertEquals(2, elements.size());
classAttr = ((HtmlElement) elements.get(0)).getAttributeValue("width");
assertTrue(classAttr.contains("400px"));
classAttr = ((HtmlElement) elements.get(1)).getAttributeValue("width");
assertTrue(classAttr.contains("200px"));
- List<HtmlElement> bodies = table.getHtmlElementsByTagName("tbody");
+ List<?> bodies = table.getHtmlElementsByTagName("tbody");
assertEquals(1, bodies.size());
- List<HtmlElement> trs = ((HtmlElement) bodies.get(0)).getHtmlElementsByTagName("tr");
+ List<?> trs = ((HtmlElement) bodies.get(0)).getHtmlElementsByTagName("tr");
assertTrue(trs.size() > 0);
HtmlElement tr = (HtmlElement) trs.get(0);
assertNotNull(tr);
classAttr = tr.getAttributeValue("class");
assertTrue(classAttr.contains("dr-table-firstrow rich-table-firstrow"));
+ for (int i = 1; i < trs.size(); i++) {
+ tr = (HtmlElement) trs.get(i);
+ assertNotNull(tr);
+ classAttr = tr.getAttributeValue("class");
+
+ assertFalse("Row i = " + i + " have 'dr-table-firstrow' style",
+ classAttr.contains("dr-table-firstrow"));
+ assertFalse("Row i = " + i + " have 'rich-table-firstrow' style",
+ classAttr.contains("rich-table-firstrow"));
+ }
- Iterator<HtmlElement> tds = tr.getChildIterator();
+ Iterator<?> tds = tr.getChildIterator();
assertTrue(tds.hasNext());
HtmlElement td = (HtmlElement) tds.next();
assertNotNull(td);
@@ -201,54 +253,41 @@
* @throws Exception
*/
public void testRenderDataTableFacets() throws Exception {
-
- UIColumnGroup header1 = (UIColumnGroup) application
- .createComponent("org.richfaces.ColumnGroup");
+
+ UIColumnGroup header1 = (UIColumnGroup) application.createComponent("org.richfaces.ColumnGroup");
header1.getAttributes().put("columnClasses", "cola, colb");
dataTable.getFacets().put("header", header1);
- UIColumn headerColumn1 = (UIColumn) application
- .createComponent("org.richfaces.Column");
- UIOutput headerText1 = (UIOutput) createComponent(
- HtmlOutputText.COMPONENT_TYPE, HtmlOutputText.class.getName(),
- null, null, null);
+ UIColumn headerColumn1 = (UIColumn) application.createComponent("org.richfaces.Column");
+ UIOutput headerText1 = (UIOutput) createComponent(HtmlOutputText.COMPONENT_TYPE, HtmlOutputText.class.getName(),null, null, null);
headerText1.setValue("Header Column1");
headerColumn1.getChildren().add(headerText1);
header1.getChildren().add(headerColumn1);
- UIOutput column1header = (UIOutput) createComponent(
- HtmlOutputText.COMPONENT_TYPE, HtmlOutputText.class.getName(),
- null, null, null);
+ UIOutput column1header = (UIOutput) createComponent(HtmlOutputText.COMPONENT_TYPE, HtmlOutputText.class.getName(),null, null, null);
column1header.setValue("Column1 Header");
headerColumn1.getFacets().put("header", column1header);
- UIColumn headerColumn2 = (UIColumn) application
- .createComponent("org.richfaces.Column");
- UIOutput headerText2 = (UIOutput) createComponent(
- HtmlOutputText.COMPONENT_TYPE, HtmlOutputText.class.getName(),
- null, null, null);
+ UIColumn headerColumn2 = (UIColumn) application.createComponent("org.richfaces.Column");
+ UIOutput headerText2 = (UIOutput) createComponent(HtmlOutputText.COMPONENT_TYPE, HtmlOutputText.class.getName(),null, null, null);
headerText2.setValue("Header Column2");
headerColumn2.getChildren().add(headerText2);
header1.getChildren().add(headerColumn2);
- UIOutput column2header = (UIOutput) createComponent(
- HtmlOutputText.COMPONENT_TYPE, HtmlOutputText.class.getName(),
- null, null, null);
+ UIOutput column2header = (UIOutput) createComponent(HtmlOutputText.COMPONENT_TYPE, HtmlOutputText.class.getName(),null, null, null);
column2header.setValue("Column2 Header");
headerColumn2.getFacets().put("header", column2header);
- UIOutput caption = (UIOutput) createComponent(
- HtmlOutputText.COMPONENT_TYPE, HtmlOutputText.class.getName(),
- null, null, null);
+ UIOutput caption = (UIOutput) createComponent(HtmlOutputText.COMPONENT_TYPE, HtmlOutputText.class.getName(),null, null, null);
dataTable.getFacets().put("caption", caption);
caption.setValue("Caption");
- UIOutput footer = (UIOutput) createComponent(
- HtmlOutputText.COMPONENT_TYPE, HtmlOutputText.class.getName(),
- null, null, null);
+ UIOutput footer = (UIOutput) createComponent(HtmlOutputText.COMPONENT_TYPE, HtmlOutputText.class.getName(),null, null, null);
dataTable.getFacets().put("footer", footer);
footer.setValue("Footer");
+
+ // test
HtmlPage page = renderView();
assertNotNull(page);
@@ -256,35 +295,33 @@
.getClientId(facesContext));
assertNotNull(table);
- List<HtmlElement> captions = table.getHtmlElementsByTagName("caption");
+ List<?> captions = table.getHtmlElementsByTagName("caption");
assertNotNull(captions);
assertEquals(1, captions.size());
String classAttr = ((HtmlElement) captions.get(0))
.getAttributeValue("class");
assertTrue(classAttr.contains("dr-table-caption rich-table-caption"));
- List<HtmlElement> headers = table.getHtmlElementsByTagName("thead");
+ List<?> headers = table.getHtmlElementsByTagName("thead");
assertNotNull(headers);
assertEquals(1, headers.size());
- List<HtmlElement> trs = ((HtmlElement) headers.get(0))
- .getHtmlElementsByTagName("tr");
+ List<?> trs = ((HtmlElement) headers.get(0)).getHtmlElementsByTagName("tr");
assertTrue(trs.size() > 0);
HtmlElement tr = (HtmlElement) trs.get(0);
assertNotNull(tr);
classAttr = tr.getAttributeValue("class");
assertTrue(classAttr.contains("dr-table-header rich-table-header"));
- Iterator<HtmlElement> tds = tr.getChildIterator();
+ Iterator<?> tds = tr.getChildIterator();
assertNotNull(tds);
assertTrue(tds.hasNext());
- HtmlElement td = tds.next();
+ HtmlElement td = (HtmlElement) tds.next();
assertNotNull(td);
classAttr = td.getAttributeValue("class");
- assertTrue(classAttr
- .contains("dr-table-headercell rich-table-headercell"));
+ assertTrue(classAttr.contains("dr-table-headercell rich-table-headercell"));
assertTrue(classAttr.contains("cola"));
- List<HtmlElement> footers = table.getHtmlElementsByTagName("tfoot");
+ List<?> footers = table.getHtmlElementsByTagName("tfoot");
assertNotNull(footers);
assertEquals(1, footers.size());
trs = ((HtmlElement) footers.get(0)).getHtmlElementsByTagName("tr");
@@ -296,12 +333,12 @@
tds = tr.getChildIterator();
assertTrue(tds.hasNext());
- td = tds.next();
+ td = (HtmlElement) tds.next();
assertNotNull(td);
classAttr = td.getAttributeValue("class");
assertTrue(classAttr.contains("dr-table-footercell rich-table-footercell "));
- Iterator fixedChildren = dataTable.fixedChildren();
+ Iterator<?> fixedChildren = dataTable.fixedChildren();
assertNotNull(fixedChildren);
assertTrue(fixedChildren.hasNext());
}
@@ -334,25 +371,24 @@
.getClientId(facesContext));
assertNotNull(table);
- List<HtmlElement> captions = table.getHtmlElementsByTagName("caption");
+ List<?> captions = table.getHtmlElementsByTagName("caption");
assertNotNull(captions);
assertEquals(1, captions.size());
- String classAttr = ((HtmlElement) captions.get(0))
- .getAttributeValue("class");
+ String classAttr = ((HtmlElement) captions.get(0)).getAttributeValue("class");
assertTrue(classAttr.contains("captionClass"));
classAttr = ((HtmlElement) captions.get(0)).getAttributeValue("style");
assertTrue(classAttr.contains("captionStyle"));
- List<HtmlElement> bodies = table.getHtmlElementsByTagName("tbody");
+ List<?> bodies = table.getHtmlElementsByTagName("tbody");
assertTrue(bodies.size() > 0);
- List<HtmlElement> trs = ((HtmlElement) bodies.get(0)).getHtmlElementsByTagName("tr");
+ List<?> trs = ((HtmlElement) bodies.get(0)).getHtmlElementsByTagName("tr");
assertTrue(trs.size() > 0);
HtmlElement tr = (HtmlElement) trs.get(0);
assertNotNull(tr);
classAttr = tr.getAttributeValue("class");
assertTrue(classAttr.contains("row1"));
- List<HtmlElement> tds = tr.getHtmlElementsByTagName("td");
+ List<?> tds = tr.getHtmlElementsByTagName("td");
assertTrue(tds.size() > 0);
HtmlElement td = (HtmlElement) tds.get(0);
assertNotNull(td);
15 years, 10 months
JBoss Rich Faces SVN: r12801 - in trunk/test-applications/seleniumTest/richfaces/src: main/webapp/pages/pickList and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2009-03-03 09:07:09 -0500 (Tue, 03 Mar 2009)
New Revision: 12801
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/resources/org/ajax4jsf/message/resources_de_DE.properties
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/pickList/testI18N.xhtml
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/PickListTest.java
Log:
RF-6168, RF-6174
Added: trunk/test-applications/seleniumTest/richfaces/src/main/resources/org/ajax4jsf/message/resources_de_DE.properties
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/resources/org/ajax4jsf/message/resources_de_DE.properties (rev 0)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/resources/org/ajax4jsf/message/resources_de_DE.properties 2009-03-03 14:07:09 UTC (rev 12801)
@@ -0,0 +1,4 @@
+RICH_PICK_LIST_COPY_ALL_LABEL=kopieren alles
+RICH_PICK_LIST_COPY_LABEL=kopieren
+RICH_PICK_LIST_REMOVE_ALL_LABEL=l\u00f6schen alles
+RICH_PICK_LIST_REMOVE_LABEL=l\u00f6schen
\ No newline at end of file
Property changes on: trunk/test-applications/seleniumTest/richfaces/src/main/resources/org/ajax4jsf/message/resources_de_DE.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/pickList/testI18N.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/pickList/testI18N.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/PickListTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/PickListTest.java 2009-03-03 13:37:23 UTC (rev 12800)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/PickListTest.java 2009-03-03 14:07:09 UTC (rev 12801)
@@ -40,6 +40,8 @@
private final static String RESET_METHOD = "#{pickListBean.reset}";
+ private final static String I18N_TEST_URL = "pages/pickList/testI18N.xhtml";
+
private static Map<String, String> params = new HashMap<String, String>();
static {
@@ -153,6 +155,43 @@
tester.testRequiredAndRequiredMessageAttributes();
}
+ @Test
+ public void testImmediate(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, RESET_METHOD);
+ writeStatus("Test immediate attribute");
+ tester.testSubmitImmediate();
+ }
+
+ @Test
+ public void testSubmitImmediateWithExternalValidationFailed(Template template ) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, null);
+ writeStatus("Test submission of component with immediate = true and external validation failed");
+ tester.testSubmitImmediateWithExternalValidationFailed();
+ }
+
+ @Test
+ public void testI18N(Template template) {
+ renderPage(I18N_TEST_URL, template, RESET_METHOD);
+
+ writeStatus("Check internationalization");
+
+ String pickListId = getParentId() + "_form:" + PICK_LIST;
+
+ String copyElemId = pickListId + COPY_BTN;
+ String copyAllElemId = pickListId + COPY_ALL_BTN;
+ String removeElemId = pickListId + REMOVE_BTN;
+ String removeAllElemId = pickListId + REMOVE_ALL_BTN;
+
+ writeStatus("This test page forces German locale. Check all labels are in German");
+
+ AssertTextEquals(copyElemId, "kopieren");
+ AssertTextEquals(copyAllElemId, "kopieren alles");
+ AssertTextEquals(removeElemId, "l�schen");
+ AssertTextEquals(removeAllElemId, "l�schen alles");
+ }
+
private void assertButtonEnabled(String btnId) {
String id = getParentId() + "_form:" + PICK_LIST;
AssertVisible(id + btnId);
15 years, 10 months
JBoss Rich Faces SVN: r12800 - trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2009-03-03 08:37:23 -0500 (Tue, 03 Mar 2009)
New Revision: 12800
Modified:
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/SearchAction.java
Log:
Fix for the search
Modified: trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/SearchAction.java
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/SearchAction.java 2009-03-03 13:37:15 UTC (rev 12799)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/SearchAction.java 2009-03-03 13:37:23 UTC (rev 12800)
@@ -56,9 +56,9 @@
}
public List<Image> searchByUsers(String searchQuery, boolean searchInMyAlbums, boolean searchInShared) {
- StringBuilder b = new StringBuilder("from User u where u.name=:name");
+ StringBuilder b = new StringBuilder("select distinct u from User u, Album a where u.login=:name");
if (searchInShared) {
- b.append(" and u.childAlbums.shared=true");
+ b.append(" and a.owner=u and a.shared=true");
}
Query query = em.createQuery(b.toString());
@@ -69,20 +69,9 @@
public List<Image> searchByTags(String searchQuery, boolean searchInMyAlbums, boolean searchInShared) {
StringBuilder b = new StringBuilder("from MetaTag t where t.tag=:name");
- if (searchInShared) {
- b.append(" and t.albums.shared=true");
- }
- if (searchInMyAlbums) {
- b.append(" and t.albums.owner.login=:login");
- }
-
Query query = em.createQuery(b.toString());
query.setParameter("name", searchQuery);
- if (searchInMyAlbums) {
- query.setParameter("login", user.getLogin());
- }
-
return query.getResultList();
}
15 years, 10 months
JBoss Rich Faces SVN: r12799 - in trunk/test-applications/realworld2/web/src/main: java/org/richfaces/realworld/util and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2009-03-03 08:37:15 -0500 (Tue, 03 Mar 2009)
New Revision: 12799
Modified:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/SearchOptionByTag.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/ConversationState.java
trunk/test-applications/realworld2/web/src/main/webapp/includes/search.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/search/result/userResult.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/layout/template3.xhtml
Log:
Fix for the search
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/SearchOptionByTag.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/SearchOptionByTag.java 2009-03-03 12:46:20 UTC (rev 12798)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/SearchOptionByTag.java 2009-03-03 13:37:15 UTC (rev 12799)
@@ -32,7 +32,7 @@
*/
@Override
public String getSearchResultTemplate() {
- return "includes/search/result/tagsResult.xhtml";
+ return "/includes/search/result/tagsResult.xhtml";
}
/* (non-Javadoc)
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/ConversationState.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/ConversationState.java 2009-03-03 12:46:20 UTC (rev 12798)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/ConversationState.java 2009-03-03 13:37:15 UTC (rev 12799)
@@ -73,7 +73,8 @@
private NavigationEnum mainArea;
- @In private User user;
+ //@In
+ private User user;
//@In(required=false, create=false) private TreeMyAlbumsItem treeMyAlbumsItem;
public Integer getSelectedImageIndex() {
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/search/result/userResult.xhtml
===================================================================
--- trunk/test-applications/realworld2/web/src/main/webapp/includes/search/result/userResult.xhtml 2009-03-03 12:46:20 UTC (rev 12798)
+++ trunk/test-applications/realworld2/web/src/main/webapp/includes/search/result/userResult.xhtml 2009-03-03 13:37:15 UTC (rev 12799)
@@ -6,7 +6,7 @@
xmlns:rich="http://richfaces.org/rich">
<a4j:repeat id="previewList" value="#{result}" var="user">
<div>
- <img src="" width="50" height="50" /><h:outputText value="#{user.firstName user.lastName}"></h:outputText>
+ <img src="" width="50" height="50" /><h:outputText value="#{user.firstName}"></h:outputText>
</div>
</a4j:repeat>
</ui:composition>
\ No newline at end of file
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/search.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/layout/template3.xhtml
===================================================================
(Binary files differ)
15 years, 10 months
JBoss Rich Faces SVN: r12798 - in trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld: service and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2009-03-03 07:46:20 -0500 (Tue, 03 Mar 2009)
New Revision: 12798
Added:
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/utils/
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/utils/SearhUtils.java
Modified:
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/ISearchAction.java
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/SearchAction.java
Log:
Searching
Modified: trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/ISearchAction.java
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/ISearchAction.java 2009-03-03 12:46:14 UTC (rev 12797)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/ISearchAction.java 2009-03-03 12:46:20 UTC (rev 12798)
@@ -1,18 +1,16 @@
package org.richfaces.realworld.service;
-import java.util.Date;
import java.util.List;
-import java.util.Map;
-import org.richfaces.realworld.domain.Album;
import org.richfaces.realworld.domain.Image;
public interface ISearchAction {
- public List<Image> searchByImage(String name, String description, String path, Integer width, Integer height, Integer size, Date createdDate, Date uploadedDate);
+ public List<Image> searchByImage(String query, boolean searchInMyAlbums, boolean searchInShared);
- public List<Image> searchByTags(Map<String, String> params);
+ public List<Image> searchByTags(String query, boolean searchInMyAlbums, boolean searchInShared);
- public List<Album> searchByAlbum(String name, String description, String ownerName, boolean shared );
+ public List<Image> searchByAlbum(String query, boolean searchInMyAlbums, boolean searchInShared);
- public List<Image> searchByUsers(Map<String, String> params);
+ public List<Image> searchByUsers(String query, boolean searchInMyAlbums, boolean searchInShared);
+
}
Modified: trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/SearchAction.java
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/SearchAction.java 2009-03-03 12:46:14 UTC (rev 12797)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/SearchAction.java 2009-03-03 12:46:20 UTC (rev 12798)
@@ -1,8 +1,6 @@
package org.richfaces.realworld.service;
-import java.util.Date;
import java.util.List;
-import java.util.Map;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
@@ -11,12 +9,12 @@
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Out;
-import org.richfaces.realworld.domain.Album;
import org.richfaces.realworld.domain.Image;
import org.richfaces.realworld.domain.User;
@Name("searchAction")
@Stateless
+@SuppressWarnings("unchecked")
public class SearchAction implements ISearchAction {
@In(value="entityManager")
@@ -25,92 +23,68 @@
@In @Out
private User user;
- public List<Image> searchByImage(String name, String description, String path, Integer width, Integer height, Integer size, Date createdDate, Date uploadedDate){
- StringBuffer b = new StringBuffer("from Image i where ");
- if (name != null && name.length() > 0) {
- b.append("i.name like :name");
+ public List<Image> searchByAlbum(String searchQuery, boolean searchInMyAlbums, boolean searchInShared) {
+ StringBuilder b = new StringBuilder("from Album a where a.name=:name and a.shared=:shared");
+ if (searchInMyAlbums) {
+ b.append(" and a.owner.login=:login");
}
- if (description != null && description.length() > 0) {
- b.append("i.description like :description");
+ Query query = em.createQuery(b.toString());
+
+ query.setParameter("name", searchQuery);
+ query.setParameter("shared", searchInShared);
+
+ if (searchInMyAlbums) {
+ query.setParameter("login", user.getLogin());
}
- if (path != null && path.length() > 0) {
- b.append("i.path like :path");
+ return query.getResultList();
+ }
+
+ public List<Image> searchByImage(String searchQuery, boolean searchInMyAlbums, boolean searchInShared) {
+ StringBuilder b = new StringBuilder("from Image i where i.name=:name and i.album.shared=:shared");
+ if (searchInMyAlbums) {
+ b.append(" and i.album.owner.login=:login");
}
- if (width != null && width > 0) {
- b.append("i.width =:width");
- }
- if (height != null && height > 0) {
- b.append("i.height =:height)");
- }
- if (size != null && size > 0) {
- b.append("i.size =:size");
- }
- if (createdDate != null) {
- b.append("i.createdDate =:createdDate");
- }
- if (uploadedDate != null) {
- b.append("i.uploadedDate =:uploadedDate");
- }
+ Query query = em.createQuery(b.toString());
+ query.setParameter("name", searchQuery);
+ query.setParameter("shared", searchInShared);
- Query q = em.createQuery(b.toString());
-
- if (name != null && name.length() > 0) {
- q.setParameter("name", name);
+ if (searchInMyAlbums) {
+ query.setParameter("login", user.getLogin());
}
- if (description != null && description.length() > 0) {
- q.setParameter("description", description);
+ return query.getResultList();
+ }
+
+ public List<Image> searchByUsers(String searchQuery, boolean searchInMyAlbums, boolean searchInShared) {
+ StringBuilder b = new StringBuilder("from User u where u.name=:name");
+ if (searchInShared) {
+ b.append(" and u.childAlbums.shared=true");
}
- if (path != null && path.length() > 0) {
- q.setParameter("path", path);
- }
- if (width != null && width > 0) {
- q.setParameter("width", width);
- }
- if (height != null && height > 0) {
- q.setParameter("height", height);
- }
- if (size != null && size > 0) {
- q.setParameter("size", size);
- }
- if (createdDate != null) {
- q.setParameter("createdDate", createdDate);
- }
- if (uploadedDate != null) {
- q.setParameter("uploadedDate", uploadedDate);
- }
+ Query query = em.createQuery(b.toString());
- return q.getResultList();
+ query.setParameter("name", searchQuery);
+
+ return query.getResultList();
}
-
- public List<Image> searchByTags(Map<String, String> params){
- return null;
- }
-
- public List<Album> searchByAlbum(String name, String description, String ownerName, boolean shared ){
- StringBuffer b = new StringBuffer("from Album a where a.name like :name and a.shared=:shared");
- if (description != null && description.length() > 0) {
- b.append("and a.description like :description ");
+
+ public List<Image> searchByTags(String searchQuery, boolean searchInMyAlbums, boolean searchInShared) {
+ StringBuilder b = new StringBuilder("from MetaTag t where t.tag=:name");
+ if (searchInShared) {
+ b.append(" and t.albums.shared=true");
}
- if (ownerName != null && ownerName.length() > 0) {
- b.append("and a.owner.login like :ownewName");
+ if (searchInMyAlbums) {
+ b.append(" and t.albums.owner.login=:login");
}
- Query q = em.createQuery(b.toString())
- .setParameter("name", name)
- .setParameter("shared", shared);
- if (description != null && description.length() > 0) {
- q.setParameter("description", description);
- }
+ Query query = em.createQuery(b.toString());
- if (ownerName != null && ownerName.length() > 0) {
- q.setParameter("ownewName", ownerName);
+ query.setParameter("name", searchQuery);
+ if (searchInMyAlbums) {
+ query.setParameter("login", user.getLogin());
}
- return q.getResultList();
+ return query.getResultList();
}
+
- public List<Image> searchByUsers(Map<String, String> params){
- return null;
- }
}
Added: trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/utils/SearhUtils.java
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/utils/SearhUtils.java (rev 0)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/utils/SearhUtils.java 2009-03-03 12:46:20 UTC (rev 12798)
@@ -0,0 +1,69 @@
+/**
+ *
+ */
+package org.richfaces.realworld.utils;
+
+import java.util.Map;
+
+import javax.persistence.EntityManager;
+import javax.persistence.Query;
+
+/**
+ * @author Andrey Markavtsov
+ *
+ */
+public class SearhUtils {
+
+ static final String ALIAS = "a";
+
+ public static Query buildQuery (EntityManager em, String base, Map<String, Object> params) {
+ StringBuilder b = new StringBuilder(base);
+ b.append(" ").append(ALIAS);
+ String [] properties = params.keySet().toArray(new String [] {});
+
+ if (properties.length > 0) {
+ b.append(" where ");
+ }
+
+ boolean isFirst = true;
+ for (int i=0; i < properties.length; i++) {
+ String property = properties[i];
+ if (propertyShouldBeSearched(params.get(property))) {
+ if (isFirst) {
+ isFirst = false;
+ }else {
+ b.append(" and ");
+ }
+ b.append(" a.").append(property).append("=");
+ b.append(":").append(property.replace(".", ""));
+
+ }
+ }
+
+ Query query = em.createQuery(b.toString());
+
+ for (int i=0; i < properties.length; i++) {
+ String property = properties[i];
+ if (propertyShouldBeSearched(params.get(property))) {
+ query.setParameter(property.replace(".", ""), params.get(property));
+ }
+ }
+
+ return query;
+
+ }
+
+ private static boolean propertyShouldBeSearched(Object property) {
+ if (property == null) {
+ return false;
+ }
+ if (property instanceof String) {
+ return property.toString().length() > 0;
+ }else if (property instanceof Number) {
+ return ((Number)property).intValue() > 0;
+ }
+
+ return true;
+ }
+
+}
15 years, 10 months
JBoss Rich Faces SVN: r12797 - in trunk/test-applications/realworld2/web/src/main: webapp/img and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2009-03-03 07:46:14 -0500 (Tue, 03 Mar 2009)
New Revision: 12797
Added:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/SearchOptionByTag.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/SearchOptionByUser.java
trunk/test-applications/realworld2/web/src/main/webapp/img/search/
trunk/test-applications/realworld2/web/src/main/webapp/img/search/bull_arr_down.gif
trunk/test-applications/realworld2/web/src/main/webapp/img/search/bull_arr_up.gif
trunk/test-applications/realworld2/web/src/main/webapp/img/search/search_bg.png
trunk/test-applications/realworld2/web/src/main/webapp/img/search/search_option_bg.png
trunk/test-applications/realworld2/web/src/main/webapp/img/search/spacer.gif
trunk/test-applications/realworld2/web/src/main/webapp/includes/search/result/tagsResult.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/search/result/userResult.xhtml
Modified:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/ISearchOption.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/ImageSearchHelper.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/SearchOptionByAlbum.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/SearchOptionByImage.java
trunk/test-applications/realworld2/web/src/main/webapp/includes/search/searchByAlbumTemplate.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/search/searchByImageTemplate.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/layout/menu.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/layout/template3.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/stylesheet/realworld2.css
Log:
Searching
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/ISearchOption.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/ISearchOption.java 2009-03-03 00:59:57 UTC (rev 12796)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/ISearchOption.java 2009-03-03 12:46:14 UTC (rev 12797)
@@ -25,8 +25,9 @@
public abstract String getSearchResultTemplate();
- public abstract void search(ISearchAction action);
+ public abstract void search(ISearchAction action, String searchQuery, boolean searchInMyAlbums, boolean searchInShared);
+
public boolean getSelected() {
return selected;
}
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/ImageSearchHelper.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/ImageSearchHelper.java 2009-03-03 00:59:57 UTC (rev 12796)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/ImageSearchHelper.java 2009-03-03 12:46:14 UTC (rev 12797)
@@ -14,7 +14,6 @@
import org.jboss.seam.annotations.Scope;
import org.richfaces.realworld.navigation.NavigationEnum;
import org.richfaces.realworld.service.ISearchAction;
-import org.richfaces.realworld.service.SearchAction;
import org.richfaces.realworld.util.ConversationState;
@Name("searchImageHelper")
@@ -35,16 +34,31 @@
String selectedTab;
+ String searchQuery;
+
+ boolean seachInMyAlbums;
+
+ boolean searchInShared = true;
+
public ImageSearchHelper() {
options = new ArrayList<ISearchOption>();
options.add(new SearchOptionByAlbum());
options.add(new SearchOptionByImage());
+ options.add(new SearchOptionByUser());
+ options.add(new SearchOptionByTag());
}
public void search(ActionEvent event) {
conversationState.setMainArea(NavigationEnum.SEARCH);
- selectedOption.search(searchAction);
- setSelectedTab(selectedOption.getSearchResultName());
+ Iterator<ISearchOption> it = options.iterator();
+ while (it.hasNext()) {
+ ISearchOption option = it.next();
+ if (option.getSelected()) {
+ option.search(searchAction, searchQuery, seachInMyAlbums, searchInShared);
+ }else {
+ option.setSearchResult(null);
+ }
+ }
}
boolean isOptionSelected() {
@@ -101,6 +115,30 @@
public void setSelectedTab(String selectedTab) {
this.selectedTab = selectedTab;
}
+
+ public String getSearchQuery() {
+ return searchQuery;
+ }
+
+ public void setSearchQuery(String searchQuery) {
+ this.searchQuery = searchQuery;
+ }
+
+ public boolean isSeachInMyAlbums() {
+ return seachInMyAlbums;
+ }
+
+ public void setSeachInMyAlbums(boolean seachInMyAlbums) {
+ this.seachInMyAlbums = seachInMyAlbums;
+ }
+
+ public boolean isSearchInShared() {
+ return searchInShared;
+ }
+
+ public void setSearchInShared(boolean searchInShared) {
+ this.searchInShared = searchInShared;
+ }
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/SearchOptionByAlbum.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/SearchOptionByAlbum.java 2009-03-03 00:59:57 UTC (rev 12796)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/SearchOptionByAlbum.java 2009-03-03 12:46:14 UTC (rev 12797)
@@ -1,23 +1,19 @@
package org.richfaces.realworld.search;
+import java.util.HashMap;
+import java.util.Map;
+
import org.richfaces.realworld.service.ISearchAction;
-import org.richfaces.realworld.util.ConversationState;
public class SearchOptionByAlbum extends ISearchOption {
+ Map<String, Object> params = new HashMap<String, Object>();
- String albumName;
-
- String ownerName;
-
- String description;
-
- boolean shared;
@Override
public String getName() {
- return "Search By Album";
+ return "Albums";
}
@Override
@@ -26,8 +22,8 @@
}
@Override
- public void search(ISearchAction action) {
- setSearchResult(action.searchByAlbum(albumName, description, ownerName, shared));
+ public void search(ISearchAction action, String q, boolean searchInMyAlbums, boolean searchInShared) {
+ setSearchResult(action.searchByAlbum(q, searchInMyAlbums, searchInShared));
}
@Override
@@ -39,39 +35,15 @@
public String getSearchResultTemplate() {
return "/includes/search/result/albumsResult.xhtml";
}
-
-
- public String getAlbumName() {
- return albumName;
+ public Map<String, Object> getParams() {
+ return params;
}
- public void setAlbumName(String albumName) {
- this.albumName = albumName;
+ public void setParams(Map<String, Object> params) {
+ this.params = params;
}
+
- public String getOwnerName() {
- return ownerName;
- }
- public void setOwnerName(String ownerName) {
- this.ownerName = ownerName;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public boolean getShared() {
- return shared;
- }
-
- public void setShared(boolean shared) {
- this.shared = shared;
- }
-
}
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/SearchOptionByImage.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/SearchOptionByImage.java 2009-03-03 00:59:57 UTC (rev 12796)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/SearchOptionByImage.java 2009-03-03 12:46:14 UTC (rev 12797)
@@ -4,7 +4,10 @@
package org.richfaces.realworld.search;
import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+import org.jboss.seam.annotations.In;
import org.richfaces.realworld.service.ISearchAction;
/**
@@ -13,29 +16,13 @@
*/
public class SearchOptionByImage extends ISearchOption {
- String fileName;
+ Map<String, Object> params = new HashMap<String, Object>();
- String description;
-
- String path;
-
- Integer fileSize;
-
- Integer width;
-
- Integer height;
-
- Date uploadedDate;
-
- Date createdDate;
-
-
-
/* (non-Javadoc)
* @see org.richfaces.realworld.search.ISearchOption#getName()
*/
public String getName() {
- return "Search By Image";
+ return "Images";
}
@Override
@@ -44,8 +31,8 @@
}
@Override
- public void search(ISearchAction action) {
- setSearchResult(action.searchByImage(fileName, description, path, width, height, fileSize, createdDate, uploadedDate));
+ public void search(ISearchAction action, String q, boolean searchInMyAlbums, boolean searchInShared) {
+ setSearchResult(action.searchByImage(q, searchInMyAlbums, searchInShared));
}
@@ -61,75 +48,15 @@
return "/includes/search/result/imageResult.xhtml";
}
-
- public String getFileName() {
- return fileName;
+ public Map<String, Object> getParams() {
+ return params;
}
-
- public void setFileName(String fileName) {
- this.fileName = fileName;
+ public void setParams(Map<String, Object> params) {
+ this.params = params;
}
- public Integer getFileSize() {
- return fileSize;
- }
-
- public void setFileSize(Integer fileSize) {
- this.fileSize = fileSize;
- }
-
-
- public Date getUploadedDate() {
- return uploadedDate;
- }
-
-
- public void setUploadedDate(Date uploadedDate) {
- this.uploadedDate = uploadedDate;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public String getPath() {
- return path;
- }
-
- public void setPath(String path) {
- this.path = path;
- }
-
- public Integer getWidth() {
- return width;
- }
-
- public void setWidth(Integer width) {
- this.width = width;
- }
-
- public Integer getHeight() {
- return height;
- }
-
- public void setHeight(Integer height) {
- this.height = height;
- }
-
- public Date getCreatedDate() {
- return createdDate;
- }
-
- public void setCreatedDate(Date createdDate) {
- this.createdDate = createdDate;
- }
-
}
Added: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/SearchOptionByTag.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/SearchOptionByTag.java (rev 0)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/SearchOptionByTag.java 2009-03-03 12:46:14 UTC (rev 12797)
@@ -0,0 +1,57 @@
+/**
+ *
+ */
+package org.richfaces.realworld.search;
+
+import org.richfaces.realworld.service.ISearchAction;
+
+/**
+ * @author Andrey
+ *
+ */
+public class SearchOptionByTag extends ISearchOption {
+
+ /* (non-Javadoc)
+ * @see org.richfaces.realworld.search.ISearchOption#getName()
+ */
+ @Override
+ public String getName() {
+ return "Tags";
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.realworld.search.ISearchOption#getSearchResultName()
+ */
+ @Override
+ public String getSearchResultName() {
+ return "Tags";
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.realworld.search.ISearchOption#getSearchResultTemplate()
+ */
+ @Override
+ public String getSearchResultTemplate() {
+ return "includes/search/result/tagsResult.xhtml";
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.realworld.search.ISearchOption#getTemplate()
+ */
+ @Override
+ public String getTemplate() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.realworld.search.ISearchOption#search(org.richfaces.realworld.service.ISearchAction, java.lang.String, boolean, boolean)
+ */
+ @Override
+ public void search(ISearchAction action, String searchQuery,
+ boolean searchInMyAlbums, boolean searchInShared) {
+ setSearchResult(action.searchByTags(searchQuery, searchInMyAlbums, searchInShared));
+
+ }
+
+}
Added: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/SearchOptionByUser.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/SearchOptionByUser.java (rev 0)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/SearchOptionByUser.java 2009-03-03 12:46:14 UTC (rev 12797)
@@ -0,0 +1,55 @@
+/**
+ *
+ */
+package org.richfaces.realworld.search;
+
+import org.richfaces.realworld.service.ISearchAction;
+
+/**
+ * @author Andrey Markavtsov
+ *
+ */
+public class SearchOptionByUser extends ISearchOption {
+
+ /* (non-Javadoc)
+ * @see org.richfaces.realworld.search.ISearchOption#getName()
+ */
+ @Override
+ public String getName() {
+ return "Users";
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.realworld.search.ISearchOption#getSearchResultName()
+ */
+ @Override
+ public String getSearchResultName() {
+ return "Users";
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.realworld.search.ISearchOption#getSearchResultTemplate()
+ */
+ @Override
+ public String getSearchResultTemplate() {
+ return "/includes/search/result/userResult.xhtml";
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.realworld.search.ISearchOption#getTemplate()
+ */
+ @Override
+ public String getTemplate() {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.realworld.search.ISearchOption#search(org.richfaces.realworld.service.ISearchAction)
+ */
+ @Override
+ public void search(ISearchAction action, String q, boolean searchInMyAlbums, boolean searchInShared) {
+ setSearchResult(action.searchByUsers(q, searchInMyAlbums, searchInShared));
+
+ }
+
+}
Added: trunk/test-applications/realworld2/web/src/main/webapp/img/search/bull_arr_down.gif
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld2/web/src/main/webapp/img/search/bull_arr_down.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/test-applications/realworld2/web/src/main/webapp/img/search/bull_arr_up.gif
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld2/web/src/main/webapp/img/search/bull_arr_up.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/test-applications/realworld2/web/src/main/webapp/img/search/search_bg.png
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld2/web/src/main/webapp/img/search/search_bg.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/test-applications/realworld2/web/src/main/webapp/img/search/search_option_bg.png
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld2/web/src/main/webapp/img/search/search_option_bg.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/test-applications/realworld2/web/src/main/webapp/img/search/spacer.gif
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld2/web/src/main/webapp/img/search/spacer.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/test-applications/realworld2/web/src/main/webapp/includes/search/result/tagsResult.xhtml
===================================================================
--- trunk/test-applications/realworld2/web/src/main/webapp/includes/search/result/tagsResult.xhtml (rev 0)
+++ trunk/test-applications/realworld2/web/src/main/webapp/includes/search/result/tagsResult.xhtml 2009-03-03 12:46:14 UTC (rev 12797)
@@ -0,0 +1,10 @@
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+ <a4j:repeat id="previewList" value="#{result}" var="tag">
+ <h:outputText value="#{tag.tag}"></h:outputText><br/>
+ </a4j:repeat>
+</ui:composition>
\ No newline at end of file
Added: trunk/test-applications/realworld2/web/src/main/webapp/includes/search/result/userResult.xhtml
===================================================================
--- trunk/test-applications/realworld2/web/src/main/webapp/includes/search/result/userResult.xhtml (rev 0)
+++ trunk/test-applications/realworld2/web/src/main/webapp/includes/search/result/userResult.xhtml 2009-03-03 12:46:14 UTC (rev 12797)
@@ -0,0 +1,12 @@
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+ <a4j:repeat id="previewList" value="#{result}" var="user">
+ <div>
+ <img src="" width="50" height="50" /><h:outputText value="#{user.firstName user.lastName}"></h:outputText>
+ </div>
+ </a4j:repeat>
+</ui:composition>
\ No newline at end of file
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/search/searchByAlbumTemplate.xhtml
===================================================================
--- trunk/test-applications/realworld2/web/src/main/webapp/includes/search/searchByAlbumTemplate.xhtml 2009-03-03 00:59:57 UTC (rev 12796)
+++ trunk/test-applications/realworld2/web/src/main/webapp/includes/search/searchByAlbumTemplate.xhtml 2009-03-03 12:46:14 UTC (rev 12797)
@@ -7,13 +7,13 @@
<h:panelGrid columns="2">
<h:outputText value="Name"></h:outputText>
- <h:inputText value="#{searchImageHelper.selectedOption.albumName}" />
+ <h:inputText value="#{searchImageHelper.selectedOption.params['name']}" />
<h:outputText value="Description"></h:outputText>
- <h:inputText value="#{searchImageHelper.selectedOption.description}"></h:inputText>
+ <h:inputText value="#{searchImageHelper.selectedOption.params['description']}"></h:inputText>
<h:outputText value="Owner Name"></h:outputText>
- <h:inputText value="#{searchImageHelper.selectedOption.ownerName}" />
+ <h:inputText value="#{searchImageHelper.selectedOption.params['owner.login']}" />
<h:outputText value="Shared"></h:outputText>
- <h:inputText value="#{searchImageHelper.selectedOption.shared}" />
+ <h:selectBooleanCheckbox value="#{searchImageHelper.selectedOption.params['shared']}"></h:selectBooleanCheckbox>
</h:panelGrid>
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/search/searchByImageTemplate.xhtml
===================================================================
--- trunk/test-applications/realworld2/web/src/main/webapp/includes/search/searchByImageTemplate.xhtml 2009-03-03 00:59:57 UTC (rev 12796)
+++ trunk/test-applications/realworld2/web/src/main/webapp/includes/search/searchByImageTemplate.xhtml 2009-03-03 12:46:14 UTC (rev 12797)
@@ -7,21 +7,21 @@
<h:panelGrid columns="2">
<h:outputText value="Name"></h:outputText>
- <h:inputText value="#{searchImageHelper.selectedOption.fileName}" />
+ <h:inputText value="#{searchImageHelper.selectedOption.params['name']}" />
<h:outputText value="Description"></h:outputText>
- <h:inputText value="#{searchImageHelper.selectedOption.description}" />
+ <h:inputText value="#{searchImageHelper.selectedOption.params['description']}" />
<h:outputText value="Path"></h:outputText>
- <h:inputText value="#{searchImageHelper.selectedOption.path}" />
+ <h:inputText value="#{searchImageHelper.selectedOption.params['path']}" />
<h:outputText value="Size"></h:outputText>
- <h:inputText value="#{searchImageHelper.selectedOption.fileSize}" />
+ <h:inputText value="#{searchImageHelper.selectedOption.params['size']}" converter="javax.faces.Integer" />
<h:outputText value="Width"></h:outputText>
- <h:inputText value="#{searchImageHelper.selectedOption.width}" />
+ <h:inputText value="#{searchImageHelper.selectedOption.params['width']}" converter="javax.faces.Integer" />
<h:outputText value="Height"></h:outputText>
- <h:inputText value="#{searchImageHelper.selectedOption.height}" />
+ <h:inputText value="#{searchImageHelper.selectedOption.params['height']}" converter="javax.faces.Integer"/>
<h:outputText value="Uploaded Date"></h:outputText>
- <rich:calendar value="#{searchImageHelper.selectedOption.uploadedDate}"></rich:calendar>
+ <rich:calendar value="#{searchImageHelper.selectedOption.params['uploaded']}" />
<h:outputText value="Created Date"></h:outputText>
- <rich:calendar value="#{searchImageHelper.selectedOption.createdDate}"></rich:calendar>
+ <rich:calendar value="#{searchImageHelper.selectedOption.params['created']}" />
</h:panelGrid>
</ui:composition>
\ No newline at end of file
Modified: trunk/test-applications/realworld2/web/src/main/webapp/layout/menu.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/layout/template3.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/stylesheet/realworld2.css
===================================================================
--- trunk/test-applications/realworld2/web/src/main/webapp/stylesheet/realworld2.css 2009-03-03 00:59:57 UTC (rev 12796)
+++ trunk/test-applications/realworld2/web/src/main/webapp/stylesheet/realworld2.css 2009-03-03 12:46:14 UTC (rev 12797)
@@ -288,3 +288,113 @@
color: black;
}
+.search-div {
+ height: 65px;
+ width: 339px;
+ position: absolute;
+ top: 64px;
+ right: 0px;
+ margin-right: 0px;
+}
+
+.search-img-bg {
+ position: absolute;
+ top: 0px;
+ left: 0px;
+}
+
+.search-label {
+ position: absolute;
+ color: rgb(255, 255, 255);
+ font-weight: bold;
+ top: 22px;
+ left: 20px;
+}
+
+.search-find-button {
+ position: absolute;
+ color: rgb(255, 255, 255);
+ font-weight: bold;
+ top: 21px;
+ left: 277px;
+ text-decoration: none;
+}
+
+.search-input {
+ border: 0px none ;
+ background: transparent none repeat scroll 0% 0%;
+ width: 176px;
+ height: 17px;
+ position: absolute;
+ top: 20px;
+ left: 73px;
+ -moz-background-clip: -moz-initial;
+ -moz-background-origin: -moz-initial;
+ -moz-background-inline-policy: -moz-initial;
+ font-weight: bold;
+}
+
+.search-img {
+ width: 61px;
+ height: 18px;
+ position: absolute;
+ top: 20px;
+ left: 261px;
+}
+
+.search-option-div {
+ position: absolute;
+ top: 41px;
+ left: 197px;
+}
+
+.search-option-link {
+ color: rgb(255, 255, 255);
+ text-decoration: none;
+}
+
+.search-options {
+ background: transparent none repeat scroll 0% 0%;
+ overflow: hidden;
+ height: 90px;
+ width: 327px;
+ position: absolute;
+ top: 107px;
+ right: 5px;
+ -moz-background-clip: -moz-initial;
+ -moz-background-origin: -moz-initial;
+ -moz-background-inline-policy: -moz-initial;
+}
+
+.search-option-img {
+ position: absolute;
+ bottom: 0px;
+ left: 0px;
+}
+
+.search-options-div1 {
+ position: absolute;
+ color: white;
+ top: 7px;
+ left: 45px;
+}
+
+.search-options-div2 {
+ border-top: 1px solid rgb(56, 56, 56);
+ position: absolute;
+ color: white;
+ top: 32px;
+ padding-top: 3px;
+ left: 38px;
+}
+
+.search-hide-options-div {
+ position: absolute;
+ top: 70px;
+ left: 163px;
+}
+
+.search-hide-options-link {
+ color: rgb(255, 255, 255);
+ text-decoration: none;
+}
\ No newline at end of file
15 years, 10 months
JBoss Rich Faces SVN: r12796 - in trunk/sandbox: samples/layout-sample/src/main/java and 9 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2009-03-02 19:59:57 -0500 (Mon, 02 Mar 2009)
New Revision: 12796
Added:
trunk/sandbox/samples/layout-sample/src/main/java/org/
trunk/sandbox/samples/layout-sample/src/main/java/org/richfaces/
trunk/sandbox/samples/layout-sample/src/main/java/org/richfaces/samples/
trunk/sandbox/samples/layout-sample/src/main/java/org/richfaces/samples/Bean.java
Removed:
trunk/sandbox/samples/layout-sample/src/main/webapp/pages/index.jsp
Modified:
trunk/sandbox/samples/layout-sample/pom.xml
trunk/sandbox/samples/layout-sample/src/main/webapp/WEB-INF/faces-config.xml
trunk/sandbox/samples/layout-sample/src/main/webapp/WEB-INF/web.xml
trunk/sandbox/samples/layout-sample/src/main/webapp/pages/index.xhtml
trunk/sandbox/ui/layout/pom.xml
trunk/sandbox/ui/layout/src/main/config/component/page.xml
trunk/sandbox/ui/layout/src/main/java/org/richfaces/renderkit/AbstractPageRenderer.java
trunk/sandbox/ui/layout/src/main/templates/org/richfaces/htmlPage.jspx
Log:
layout components example starts working
Modified: trunk/sandbox/samples/layout-sample/pom.xml
===================================================================
--- trunk/sandbox/samples/layout-sample/pom.xml 2009-03-02 18:00:56 UTC (rev 12795)
+++ trunk/sandbox/samples/layout-sample/pom.xml 2009-03-03 00:59:57 UTC (rev 12796)
@@ -1,11 +1,11 @@
<?xml version="1.0"?><project>
<parent>
<artifactId>samples</artifactId>
- <groupId>org.richfaces.sandbox</groupId>
+ <groupId>org.richfaces</groupId>
<version>3.3.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.sandbox.samples</groupId>
+ <groupId>org.richfaces.samples</groupId>
<artifactId>layout-sample</artifactId>
<packaging>war</packaging>
<name>layout Maven Webapp</name>
@@ -30,11 +30,6 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.richfaces.ui</groupId>
- <artifactId>richfaces-ui</artifactId>
- <version>3.3.1-SNAPSHOT</version>
- </dependency>
- <dependency>
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-impl</artifactId>
<version>3.3.1-SNAPSHOT</version>
Added: trunk/sandbox/samples/layout-sample/src/main/java/org/richfaces/samples/Bean.java
===================================================================
--- trunk/sandbox/samples/layout-sample/src/main/java/org/richfaces/samples/Bean.java (rev 0)
+++ trunk/sandbox/samples/layout-sample/src/main/java/org/richfaces/samples/Bean.java 2009-03-03 00:59:57 UTC (rev 12796)
@@ -0,0 +1,12 @@
+/**
+ *
+ */
+package org.richfaces.samples;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class Bean {
+
+}
Property changes on: trunk/sandbox/samples/layout-sample/src/main/java/org/richfaces/samples/Bean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/sandbox/samples/layout-sample/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/sandbox/samples/layout-sample/src/main/webapp/WEB-INF/faces-config.xml 2009-03-02 18:00:56 UTC (rev 12795)
+++ trunk/sandbox/samples/layout-sample/src/main/webapp/WEB-INF/faces-config.xml 2009-03-03 00:59:57 UTC (rev 12796)
@@ -1,10 +1,14 @@
<?xml version="1.0"?>
-<!DOCTYPE faces-config PUBLIC "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
- "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
-<faces-config>
+<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd"
+ version="1.2">
+ <application>
+ <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
+ </application>
<managed-bean>
<managed-bean-name>bean</managed-bean-name>
- <managed-bean-class>org.richfaces.sandbox.samples.Bean</managed-bean-class>
+ <managed-bean-class>org.richfaces.samples.Bean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
</faces-config>
Modified: trunk/sandbox/samples/layout-sample/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/sandbox/samples/layout-sample/src/main/webapp/WEB-INF/web.xml 2009-03-02 18:00:56 UTC (rev 12795)
+++ trunk/sandbox/samples/layout-sample/src/main/webapp/WEB-INF/web.xml 2009-03-03 00:59:57 UTC (rev 12796)
@@ -3,13 +3,17 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>Archetype Created Web Application</display-name>
<context-param>
- <param-name>javax.faces.CONFIG_FILES</param-name>
- <param-value>/WEB-INF/faces-config.xml</param-value>
- </context-param>
- <context-param>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
+ <context-param>
+ <param-name>facelets.VIEW_MAPPINGS</param-name>
+ <param-value>*.xhtml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+ <param-value>.xhtml</param-value>
+ </context-param>
<context-param>
<param-name>org.richfaces.SKIN</param-name>
Deleted: trunk/sandbox/samples/layout-sample/src/main/webapp/pages/index.jsp
===================================================================
--- trunk/sandbox/samples/layout-sample/src/main/webapp/pages/index.jsp 2009-03-02 18:00:56 UTC (rev 12795)
+++ trunk/sandbox/samples/layout-sample/src/main/webapp/pages/index.jsp 2009-03-03 00:59:57 UTC (rev 12796)
@@ -1,20 +0,0 @@
-<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
-<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
-<%@ taglib uri="http://labs.jboss.com/jbossrichfaces/ui/ui/layout" prefix="layout"%>
-<html>
- <head>
- <title>layout sample page</title>
- </head>
- <body>
- <f:view>
- <layout:layoutPanel type="gd">
- <layout:layoutPanel type="u first">
- <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna.</p>
- </layout:layoutPanel>
- <layout:layoutPanel type="u">
- <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna.</p>
- </layout:layoutPanel>
- </layout:layoutPanel>
- </f:view>
- </body>
-</html>
Modified: trunk/sandbox/samples/layout-sample/src/main/webapp/pages/index.xhtml
===================================================================
(Binary files differ)
Modified: trunk/sandbox/ui/layout/pom.xml
===================================================================
--- trunk/sandbox/ui/layout/pom.xml 2009-03-02 18:00:56 UTC (rev 12795)
+++ trunk/sandbox/ui/layout/pom.xml 2009-03-03 00:59:57 UTC (rev 12796)
@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>ui</artifactId>
- <groupId>org.richfaces.sandbox</groupId>
+ <groupId>org.richfaces</groupId>
<version>3.3.1-SNAPSHOT</version>
</parent>
<groupId>org.richfaces.ui</groupId>
@@ -36,6 +36,7 @@
<library>
<prefix>org.richfaces</prefix>
<taglib>
+ <uri>http://richfaces.org/layout</uri>
<shortName>layout</shortName>
</taglib>
</library>
Modified: trunk/sandbox/ui/layout/src/main/config/component/page.xml
===================================================================
--- trunk/sandbox/ui/layout/src/main/config/component/page.xml 2009-03-02 18:00:56 UTC (rev 12795)
+++ trunk/sandbox/ui/layout/src/main/config/component/page.xml 2009-03-03 00:59:57 UTC (rev 12796)
@@ -51,7 +51,7 @@
</description>
</property>
<property>
- <name>format</name>
+ <name>markupType</name>
<classname>java.lang.String</classname>
<description>
<![CDATA[Page layout format ( html, xhtml, html-transitional, html-3.2 ) for encoding DOCTYPE, namespace and Content-Type definitions]]>
Modified: trunk/sandbox/ui/layout/src/main/java/org/richfaces/renderkit/AbstractPageRenderer.java
===================================================================
--- trunk/sandbox/ui/layout/src/main/java/org/richfaces/renderkit/AbstractPageRenderer.java 2009-03-02 18:00:56 UTC (rev 12795)
+++ trunk/sandbox/ui/layout/src/main/java/org/richfaces/renderkit/AbstractPageRenderer.java 2009-03-03 00:59:57 UTC (rev 12796)
@@ -76,7 +76,7 @@
public String prolog(FacesContext context, UIComponent component) throws IOException {
ResponseWriter out = context.getResponseWriter();
Map<String,Object> attributes = component.getAttributes();
- String format = (String) attributes.get("format");
+ String format = (String) attributes.get("markupType");
String contentType = null;
String namespace = null;
// String characterEncoding = out.getCharacterEncoding();
@@ -116,5 +116,9 @@
//TODO - calculate class.
return "ui-t3";
}
+
+ public boolean hasFacet(UIComponent component, String facet){
+ return null != component.getFacet(facet);
+ }
}
Modified: trunk/sandbox/ui/layout/src/main/templates/org/richfaces/htmlPage.jspx
===================================================================
--- trunk/sandbox/ui/layout/src/main/templates/org/richfaces/htmlPage.jspx 2009-03-02 18:00:56 UTC (rev 12795)
+++ trunk/sandbox/ui/layout/src/main/templates/org/richfaces/htmlPage.jspx 2009-03-03 00:59:57 UTC (rev 12796)
@@ -5,7 +5,9 @@
xmlns:ui=" http://ajax4jsf.org/cdk/ui"
xmlns:u=" http://ajax4jsf.org/cdk/u"
xmlns:x=" http://ajax4jsf.org/cdk/x"
- class="org.richfaces.renderkit.html.PageRenderer"
+ xmlns:h="http://jsf.exadel.com/header"
+ xmlns:vcp="http://ajax4jsf.org/cdk/vcp"
+ class="org.richfaces.renderkit.html.PageRenderer"
baseclass="org.richfaces.renderkit.AbstractPageRenderer"
component="org.richfaces.component.UIPage"
>
@@ -21,28 +23,30 @@
</head>
<body x:passThruWithExclusions="value,name,type,id">
<div id="doc3" class="#{this:documentClass(context,component)}">
- <u:insertFacet name="header">
+ <c:if test="#{this:hasFacet(component,'header')}">
<div id="hd" x:class="#{component.attributes['headerClass']}">
- <u:insertChild/>
+ <u:insertFacet name="header"/>
</div>
- </u:insertFacet>
+ </c:if>
<div id="bd">
- <u:insertFacet name="sidebar">
+ <c:if test="#{this:hasFacet(component,'sidebar')}">
<div class="yui-b">
- <u:insertChild/>
+ <u:insertFacet name="sidebar"/>
</div>
- </u:insertFacet>
+ </c:if>
+ <vcp:body>
<div class="yui-main">
<div class="yui-b #{component.attributes['bodyClass']}">
- <u:insertChildren/>
+ <f:call name="renderChildren" />
</div>
</div>
+ </vcp:body>
</div>
- <u:insertFacet name="footer">
+ <c:if test="#{this:hasFacet(component,'footer')}">
<div id="ft" x:class="#{component.attributes['footerClass']}">
- <u:insertChild/>
+ <u:insertFacet name="footer"/>
</div>
- </u:insertFacet>
+ </c:if>
</div>
</body>
</html>
15 years, 10 months