JBoss Rich Faces SVN: r13181 - in trunk/ui/colorPicker: src/main/config/component and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-03-25 11:55:14 -0400 (Wed, 25 Mar 2009)
New Revision: 13181
Modified:
trunk/ui/colorPicker/
trunk/ui/colorPicker/pom.xml
trunk/ui/colorPicker/src/main/config/component/colorPicker.xml
Log:
Added tests generation for colorPicker component
Property changes on: trunk/ui/colorPicker
___________________________________________________________________
Name: svn:ignore
- target
+ target
.classpath
.project
.settings
Modified: trunk/ui/colorPicker/pom.xml
===================================================================
--- trunk/ui/colorPicker/pom.xml 2009-03-25 15:47:45 UTC (rev 13180)
+++ trunk/ui/colorPicker/pom.xml 2009-03-25 15:55:14 UTC (rev 13181)
@@ -20,6 +20,13 @@
<goal>generate</goal>
</goals>
</execution>
+ <execution>
+ <id>generate-test-sources</id>
+ <phase>generate-test-sources</phase>
+ <goals>
+ <goal>generate-tests</goal>
+ </goals>
+ </execution>
</executions>
<configuration>
<library>
Modified: trunk/ui/colorPicker/src/main/config/component/colorPicker.xml
===================================================================
--- trunk/ui/colorPicker/src/main/config/component/colorPicker.xml 2009-03-25 15:47:45 UTC (rev 13180)
+++ trunk/ui/colorPicker/src/main/config/component/colorPicker.xml 2009-03-25 15:55:14 UTC (rev 13181)
@@ -6,6 +6,7 @@
<family>org.richfaces.ColorPicker</family>
<classname>org.richfaces.component.html.HtmlColorPicker</classname>
<superclass>org.richfaces.component.UIColorPicker</superclass>
+ <test />
<description>
<![CDATA[
]]>
@@ -17,6 +18,7 @@
<tag>
<name>colorPicker</name>
<classname>org.richfaces.taglib.ColorPickerTag</classname>
+ <test />
<superclass>
org.ajax4jsf.webapp.taglib.HtmlComponentTagBase
</superclass>
15 years, 9 months
JBoss Rich Faces SVN: r13180 - in trunk/ui/panelmenu/src/main: templates/org/richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-03-25 11:47:45 -0400 (Wed, 25 Mar 2009)
New Revision: 13180
Modified:
trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuRendererBase.java
trunk/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenu.jspx
trunk/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuGroup.jspx
trunk/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuItem.jspx
Log:
https://jira.jboss.org/jira/browse/RF-6548
Modified: trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuRendererBase.java
===================================================================
--- trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuRendererBase.java 2009-03-25 15:33:11 UTC (rev 13179)
+++ trunk/ui/panelmenu/src/main/java/org/richfaces/renderkit/PanelMenuRendererBase.java 2009-03-25 15:47:45 UTC (rev 13180)
@@ -66,9 +66,7 @@
for (int i=0;i<level;i++){
writer.startElement("img", component);
writer.writeAttribute("src", src, null);
- writer.writeAttribute("alt", " ", null);
- writer.writeAttribute("hspace", "0", null);
- writer.writeAttribute("vspace", "0", null);
+ writer.writeAttribute("alt", "", null);
writer.writeAttribute("height", String.valueOf(w), null);
writer.writeAttribute("width", String.valueOf(w), null);
writer.endElement("img");
@@ -278,9 +276,7 @@
writer.writeAttribute("style", "display: none;", null);
}
writer.writeAttribute("src", imageSrc, null);
- writer.writeAttribute("alt", " ", null);
- writer.writeAttribute("vspace", "0", null);
- writer.writeAttribute("hspace", "0", null);
+ writer.writeAttribute("alt", "", null);
writer.writeAttribute("width", String.valueOf(h), null);
writer.writeAttribute("height", String.valueOf(h), null);
writer.writeAttribute("id", id, null);
Modified: trunk/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenu.jspx
===================================================================
--- trunk/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenu.jspx 2009-03-25 15:33:11 UTC (rev 13179)
+++ trunk/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenu.jspx 2009-03-25 15:47:45 UTC (rev 13180)
@@ -40,11 +40,7 @@
<f:call name="utils.encodeBeginFormIfNessesary"/>
<div style="width:#{component.width}; #{style}" class="rich-pmenu #{component.styleClass}"
id="#{clientId}"
- onclick="#{component.onclick}"
- ondblclick="#{component.ondblclick}"
- onmousemove="#{component.onmousemove}"
- onmouseout="#{component.onmouseout}"
- onmouseover="#{component.onmouseover}" >
+ x:passThruWithExclusions="style,width,class,styleClass,id">
<input type="hidden" id="#{clientId}selectedItemName" name="#{clientId}selectedItemName" value="" />
<vcp:body>
<f:call name="renderChildren" />
Modified: trunk/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuGroup.jspx
===================================================================
--- trunk/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuGroup.jspx 2009-03-25 15:33:11 UTC (rev 13179)
+++ trunk/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuGroup.jspx 2009-03-25 15:47:45 UTC (rev 13180)
@@ -23,9 +23,8 @@
<table cellspacing="0" cellpadding="0" border="0"
id="tablehide#{clientId}"
class="#{this:getTableClass(context, component)} rich-pmenu-group #{this:getFullStyleClass( context, component )} "
- style="#{this:getFullStyle( context, component )}" >
-
- <f:call name="utils.encodePassThru" />
+ style="#{this:getFullStyle( context, component )}"
+ x:passThruWithExclusions="cellspacing,cellpadding,border,id,class,styleClass,style">
<tbody>
<tr id="row_#{clientId}"
Modified: trunk/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuItem.jspx
===================================================================
--- trunk/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuItem.jspx 2009-03-25 15:33:11 UTC (rev 13179)
+++ trunk/ui/panelmenu/src/main/templates/org/richfaces/htmlPanelMenuItem.jspx 2009-03-25 15:47:45 UTC (rev 13180)
@@ -17,12 +17,8 @@
<table cellspacing="0" cellpadding="0" border="0"
id="tablehide#{clientId}"
class="dr-pmenu-item rich-pmenu-item #{this:getFullStyleClass( context, component )} "
- style="#{this:getFullStyle( context, component )}" >
-
- <f:call name="utils.encodeAttributes">
- <f:parameter value="onclick,onmousedown,onmouseup,onmousemove" />
- </f:call>
-
+ style="#{this:getFullStyle( context, component )}"
+ x:passThruWithExclusions="cellspacing,cellpadding,border,id,class,styleClass,style">
<tbody>
<tr id="row_#{clientId}"
class="#{this:getSelectedClass( context, component )}" >
15 years, 9 months
JBoss Rich Faces SVN: r13179 - trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2009-03-25 11:33:11 -0400 (Wed, 25 Mar 2009)
New Revision: 13179
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/GraphValidatorTest.java
Log:
reset data before on renderPage phase
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/GraphValidatorTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/GraphValidatorTest.java 2009-03-25 15:03:13 UTC (rev 13178)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/GraphValidatorTest.java 2009-03-25 15:33:11 UTC (rev 13179)
@@ -38,10 +38,12 @@
private static final String ALL_MSGS = "all_messages";
private static final String SAVE_BTN = "_save";
+
+ private static final String RESET_DATA = "#{validationBean.reset}";
@Test
public void testGraphValidatorComponentWithComponentSubtree(Template template) {
- renderPage(template);
+ renderPage(template,RESET_DATA);
writeStatus("Check that components subtree confined by the component is validated "
+ "with Hibernate Validator properly");
@@ -94,7 +96,7 @@
@Test
public void testGraphValidatorComponentWithValueBoundToBean(Template template) {
- renderPage(template);
+ renderPage(template, RESET_DATA);
writeStatus("Check that component validates a bean bound to component value property. "
+ "After model is updated the bean must be validated again.");
15 years, 9 months
JBoss Rich Faces SVN: r13178 - trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2009-03-25 11:03:13 -0400 (Wed, 25 Mar 2009)
New Revision: 13178
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/EditorTest.java
Log:
skip reRender parent component during render page
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/EditorTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/EditorTest.java 2009-03-25 14:50:05 UTC (rev 13177)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/EditorTest.java 2009-03-25 15:03:13 UTC (rev 13178)
@@ -55,6 +55,7 @@
private static String FORM_ID = "formId:";
private static String EDITOR_DIV_ID = FORM_ID + "editorId";
+
private static String EDITOR_TEXAREA_DIV_ID = FORM_ID + "editorIdTextArea";
private static String EDITOR_TABLE_ID = EDITOR_TEXAREA_DIV_ID + "_tbl";
private static String EDITOR_IFRAME_ID = EDITOR_TEXAREA_DIV_ID + "_ifr";
@@ -170,7 +171,12 @@
Assert.assertEquals(message, "Incorrect input",
"Validator message not correct");
}
-
+
+ @Override
+ public void reRenderForm() {
+ // we should skip reRender parent container on render page (tinyMCE JS script becomes broken after this)
+ }
+
@Test
public void testConvertorAttribute(Template template) {
renderPage(CONVERTER_TEST_URL, template, RESET_METHOD_ME);
15 years, 9 months
JBoss Rich Faces SVN: r13177 - in trunk/test-applications/realworld2/web/src/main/webapp: layout and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alevkovsky
Date: 2009-03-25 10:50:05 -0400 (Wed, 25 Mar 2009)
New Revision: 13177
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/includes/image/imageAdditionalInfo.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/image/imageEditInfo.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/layout/template.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/scripts/realworld.js
Log:
Realworld: add links for popular tags, hide comment for not loged users
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/image/imageAdditionalInfo.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/image/imageEditInfo.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/layout/template.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/scripts/realworld.js
===================================================================
--- trunk/test-applications/realworld2/web/src/main/webapp/scripts/realworld.js 2009-03-25 14:33:05 UTC (rev 13176)
+++ trunk/test-applications/realworld2/web/src/main/webapp/scripts/realworld.js 2009-03-25 14:50:05 UTC (rev 13177)
@@ -47,4 +47,17 @@
}else {
showSearch();
}
+}
+
+function selectPopularTag(tag, target) {
+ if(target){
+ var value = target.value;
+ if(value && value.indexOf(tag) != -1){
+ return;
+ }
+ if(value && value.length > 0){
+ target.value += ', ';
+ }
+ target.value += tag;
+ }
}
\ No newline at end of file
15 years, 9 months
JBoss Rich Faces SVN: r13176 - 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: alevkovsky
Date: 2009-03-25 10:33:05 -0400 (Wed, 25 Mar 2009)
New Revision: 13176
Modified:
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Album.java
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Comment.java
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Image.java
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/MetaTag.java
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Sex.java
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Shelf.java
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/User.java
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/test.java
Log:
add equals and hashCode methods for domain objects
change ImageProcessingTools for convert image to 200px format
correct popular tags query
Modified: trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Album.java
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Album.java 2009-03-25 13:06:42 UTC (rev 13175)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Album.java 2009-03-25 14:33:05 UTC (rev 13176)
@@ -51,235 +51,256 @@
/**
* Class for representing Album Entity EJB3 Entity Bean
- *
+ *
* @author Andrey Markhel
*/
-@NamedQueries( { @NamedQuery(name = "album-byAlbumNameAndLogin", query = "from Album a where a.name=:albumName and a.owner.login=:login") })
+@NamedQueries({
+ @NamedQuery(name = "album-byAlbumNameAndLogin", query = "from Album a where a.name=:albumName and a.owner.login=:login")})
@Entity
@Name("album")
@Table(name = "albums")
@Role(name = "selectedAlbum", scope = ScopeType.CONVERSATION)
public class Album implements Serializable {
- private static final long serialVersionUID = -7042878411608396483L;
+ private static final long serialVersionUID = -7042878411608396483L;
- @Id
- @GeneratedValue
- @Column(name = "ALBUM_ID")
- private Long id = null;
+ @Id
+ @GeneratedValue
+ @Column(name = "ALBUM_ID")
+ private Long id = null;
- @Column(length = 255, nullable = false)
- @NotNull
- @NotEmpty
- @Length(min = 3)
- private String name;
+ @Column(length = 255, nullable = false)
+ @NotNull
+ @NotEmpty
+ @Length(min = 3)
+ private String name;
- @Column(length = 1024)
- private String description;
+ @Column(length = 1024)
+ private String description;
- @ManyToOne(fetch = FetchType.LAZY)
- @JoinColumn(name = "ALBUM_USER_ID", referencedColumnName = "USER_ID")
- private User owner;
+ @ManyToOne(fetch = FetchType.LAZY)
+ @JoinColumn(name = "ALBUM_USER_ID", referencedColumnName = "USER_ID")
+ private User owner;
- @OneToMany(cascade = CascadeType.ALL, mappedBy = "album")
- @org.hibernate.annotations.Fetch(org.hibernate.annotations.FetchMode.SUBSELECT)
- private List<Image> images = new ArrayList<Image>();
+ @OneToMany(cascade = CascadeType.ALL, mappedBy = "album")
+ @org.hibernate.annotations.Fetch(org.hibernate.annotations.FetchMode.SUBSELECT)
+ private List<Image> images = new ArrayList<Image>();
- @NotNull
- @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
- @JoinColumn(name = "PARENT_SHELF_ID", nullable = false)
- @org.hibernate.annotations.ForeignKey(name = "FK_SHELF_PARENT_ID")
- private Shelf shelf;
-
- @Temporal(TemporalType.TIMESTAMP)
+ @NotNull
+ @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+ @JoinColumn(name = "PARENT_SHELF_ID", nullable = false)
+ @org.hibernate.annotations.ForeignKey(name = "FK_SHELF_PARENT_ID")
+ private Shelf shelf;
+
+ @Temporal(TemporalType.TIMESTAMP)
private Date created;
-
- @Transient
- private List<Image> unvisitedImages = new ArrayList<Image>();
-
- @Transient
- private Long countUnvisitedImages;
- @OneToOne(cascade=CascadeType.ALL, optional=true)
- private Image coveringImage;
+ @Transient
+ private List<Image> unvisitedImages = new ArrayList<Image>();
- // ********************** Accessor Methods ********************** //
+ @Transient
+ private Long countUnvisitedImages;
-
+ @OneToOne(cascade = CascadeType.ALL, optional = true)
+ private Image coveringImage;
- public Shelf getShelf() {
- return shelf;
- }
+ // ********************** Accessor Methods ********************** //
- public void setShelf(Shelf parent) {
- this.shelf = parent;
- }
- /**
- * Getter for property id
- *
- * @return id of album
- */
- public Long getId() {
- return id;
- }
+ public Shelf getShelf() {
+ return shelf;
+ }
- /**
- * Getter for property name
- *
- * @return name of album
- */
- public String getName() {
- return name;
- }
+ public void setShelf(Shelf parent) {
+ this.shelf = parent;
+ }
- /**
- * Setter for property name
- *
- * @param name -
- * name of album
- */
- public void setName(String name) {
- this.name = name;
- }
+ /**
+ * Getter for property id
+ *
+ * @return id of album
+ */
+ public Long getId() {
+ return id;
+ }
- /**
- * Getter for property description
- *
- * @return description of album
- */
- public String getDescription() {
- return description;
- }
+ /**
+ * Getter for property name
+ *
+ * @return name of album
+ */
+ public String getName() {
+ return name;
+ }
- /**
- * Setter for property description
- *
- * @param description -
- * description of album
- */
- public void setDescription(String description) {
- this.description = description;
- }
+ /**
+ * Setter for property name
+ *
+ * @param name -
+ * name of album
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
- // ********************** Business Methods ********************** //
+ /**
+ * Getter for property description
+ *
+ * @return description of album
+ */
+ public String getDescription() {
+ return description;
+ }
- /**
- * This method add image to collection of images of current album
- *
- * @param image -
- * image to add
- */
- public void addImage(Image image) {
- if (image == null) {
- throw new IllegalArgumentException("Null image!");
- }
- if (image.getAlbum() != null && !this.equals(image.getAlbum())) {
- image.getAlbum().getImages().remove(image);
- }
- image.setAlbum(this);
- images.add(image);
- }
+ /**
+ * Setter for property description
+ *
+ * @param description -
+ * description of album
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
- /**
- * This method remove image from collection of images of album
- *
- * @param image -
- * image to remove
- */
- public void removeImage(Image image) {
- if (image == null) {
- throw new IllegalArgumentException("Null image");
- }
- image.setAlbum(null);
- images.remove(image);
- }
+ // ********************** Business Methods ********************** //
- /**
- * This method return count of images of current album
- *
- * @return count of images of this album
- */
- public int getCountImages() {
- return this.getImages() != null ? this.getImages().size() : 0;
+ /**
+ * This method add image to collection of images of current album
+ *
+ * @param image -
+ * image to add
+ */
+ public void addImage(Image image) {
+ if (image == null) {
+ throw new IllegalArgumentException("Null image!");
+ }
+ if (image.getAlbum() != null && !this.equals(image.getAlbum())) {
+ image.getAlbum().getImages().remove(image);
+ }
+ image.setAlbum(this);
+ images.add(image);
+ }
- }
+ /**
+ * This method remove image from collection of images of album
+ *
+ * @param image -
+ * image to remove
+ */
+ public void removeImage(Image image) {
+ if (image == null) {
+ throw new IllegalArgumentException("Null image");
+ }
+ image.setAlbum(null);
+ images.remove(image);
+ }
- public User getOwner() {
- return owner;
- }
+ /**
+ * This method return count of images of current album
+ *
+ * @return count of images of this album
+ */
+ public int getCountImages() {
+ return this.getImages() != null ? this.getImages().size() : 0;
- public List<Image> getImages() {
- return images;
- }
+ }
- public void setOwner(User owner) {
- this.owner = owner;
- }
-
- public int getIndex(Image image) {
- for (int i = 0; i < this.images.size(); i++) {
- if (this.images.get(i).equals(image)) {
- return i;
- }
- }
- return -1;
- }
-
- public Image getCoveringImage(){
- if(coveringImage != null){
- return coveringImage;
- }
- if(images != null && images.size() > 0){
- coveringImage = images.get(0);
- return images.get(0);
- }else{
- return null;
- }
- }
-
- public boolean isEmpty() {
- return images == null || images.size() == 0;
- }
+ public User getOwner() {
+ return owner;
+ }
- /**
- * @return the created
- */
- public Date getCreated() {
- return created;
- }
+ public List<Image> getImages() {
+ return images;
+ }
- /**
- * @param created the created to set
- */
- public void setCreated(Date created) {
- this.created = created;
- }
+ public void setOwner(User owner) {
+ this.owner = owner;
+ }
- public Long getCountUnvisitedImages() {
- return countUnvisitedImages;
- }
+ public int getIndex(Image image) {
+ for (int i = 0; i < this.images.size(); i++) {
+ if (this.images.get(i).equals(image)) {
+ return i;
+ }
+ }
+ return -1;
+ }
- public void setCountUnvisitedImages(Long countUnvisitedImages) {
- this.countUnvisitedImages = countUnvisitedImages;
- }
+ public Image getCoveringImage() {
+ if (coveringImage != null) {
+ return coveringImage;
+ }
+ if (images != null && images.size() > 0) {
+ coveringImage = images.get(0);
+ return images.get(0);
+ } else {
+ return null;
+ }
+ }
- public List<Image> getUnvisitedImages() {
- return unvisitedImages;
- }
+ public boolean isEmpty() {
+ return images == null || images.size() == 0;
+ }
- public void setUnvisitedImages(List<Image> unvisitedImages) {
- this.unvisitedImages = unvisitedImages;
- }
+ /**
+ * @return the created
+ */
+ public Date getCreated() {
+ return created;
+ }
- public void visitImage(Image image) {
- if(unvisitedImages.contains(image)){
- unvisitedImages.remove(image);
- countUnvisitedImages--;
- }
- }
+ /**
+ * @param created the created to set
+ */
+ public void setCreated(Date created) {
+ this.created = created;
+ }
- public void setCoveringImage(Image coveringImage) {
- this.coveringImage = coveringImage;
- }
+ public Long getCountUnvisitedImages() {
+ return countUnvisitedImages;
+ }
+
+ public void setCountUnvisitedImages(Long countUnvisitedImages) {
+ this.countUnvisitedImages = countUnvisitedImages;
+ }
+
+ public List<Image> getUnvisitedImages() {
+ return unvisitedImages;
+ }
+
+ public void setUnvisitedImages(List<Image> unvisitedImages) {
+ this.unvisitedImages = unvisitedImages;
+ }
+
+ public void visitImage(Image image) {
+ if (unvisitedImages.contains(image)) {
+ unvisitedImages.remove(image);
+ countUnvisitedImages--;
+ }
+ }
+
+ public void setCoveringImage(Image coveringImage) {
+ this.coveringImage = coveringImage;
+ }
+
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ Album album = (Album) o;
+
+ if (id != null ? !id.equals(album.id) : album.id != null) return false;
+ if (!shelf.equals(album.shelf)) return false;
+ if (!name.equals(album.name)) return false;
+
+ return true;
+ }
+
+ public int hashCode() {
+ int result;
+ result = (id != null ? id.hashCode() : 0);
+ result = 31 * result + name.hashCode();
+ result = 31 * result + shelf.hashCode();
+ return result;
+ }
}
Modified: trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Comment.java
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Comment.java 2009-03-25 13:06:42 UTC (rev 13175)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Comment.java 2009-03-25 14:33:05 UTC (rev 13176)
@@ -42,68 +42,90 @@
@Entity
@Name("comment")
@Table(name = "comments")
-public class Comment implements Serializable{
+public class Comment implements Serializable {
- private static final long serialVersionUID = 3429270322123226071L;
+ private static final long serialVersionUID = 3429270322123226071L;
- @Id
- @GeneratedValue
- @Column(name = "COMMENT_ID")
- private Long id;
-
- @Temporal(TemporalType.TIMESTAMP)
- private Date date;
-
- @ManyToOne
- @JoinColumn(name="IMAGE_COMMENT_ID",
- referencedColumnName="IMAGE_ID")
- private Image image;
-
- @ManyToOne(fetch = FetchType.LAZY)
+ @Id
+ @GeneratedValue
+ @Column(name = "COMMENT_ID")
+ private Long id;
+
+ @Temporal(TemporalType.TIMESTAMP)
+ private Date date;
+
+ @ManyToOne
+ @JoinColumn(name = "IMAGE_COMMENT_ID", referencedColumnName = "IMAGE_ID")
+ private Image image;
+
+ @ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "FROM_USER_ID", nullable = false, updatable = false)
@org.hibernate.annotations.ForeignKey(name = "FK_FROM_USER_ID")
- private User author;
-
- @Column(length = 1024, nullable = false)
+ private User author;
+
+ @Column(length = 1024, nullable = false)
@NotNull
- @NotEmpty
- @Length(min=2)
- private String message;
-
- public Long getId() {
- return id;
- }
+ @NotEmpty
+ @Length(min = 2)
+ private String message;
- public Date getDate() {
- return date;
- }
-
- public void setDate(Date date) {
- this.date = date;
- }
-
- public User getAuthor() {
- return author;
- }
-
- public void setAuthor(User author) {
- this.author = author;
- }
-
- public String getMessage() {
- return message;
- }
-
- public void setMessage(String message) {
- this.message = message;
- }
+ public Long getId() {
+ return id;
+ }
- public Image getImage() {
- return image;
- }
+ public Date getDate() {
+ return date;
+ }
- public void setImage(Image image) {
- this.image = image;
- }
-
+ public void setDate(Date date) {
+ this.date = date;
+ }
+
+ public User getAuthor() {
+ return author;
+ }
+
+ public void setAuthor(User author) {
+ this.author = author;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ public Image getImage() {
+ return image;
+ }
+
+ public void setImage(Image image) {
+ this.image = image;
+ }
+
+
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ Comment comment = (Comment) o;
+
+ if (!author.equals(comment.author)) return false;
+ if (id != null ? !id.equals(comment.id) : comment.id != null) return false;
+ if (!image.equals(comment.image)) return false;
+ if (!message.equals(comment.message)) return false;
+
+ return true;
+ }
+
+ public int hashCode() {
+ int result;
+ result = (id != null ? id.hashCode() : 0);
+ result = 31 * result + image.hashCode();
+ result = 31 * result + author.hashCode();
+ result = 31 * result + message.hashCode();
+ return result;
+ }
}
Modified: trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Image.java
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Image.java 2009-03-25 13:06:42 UTC (rev 13175)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Image.java 2009-03-25 14:33:05 UTC (rev 13176)
@@ -56,23 +56,23 @@
import org.jboss.seam.annotations.Role;
@NamedQueries({
- @NamedQuery(
- name = "image-camera",
- query = "select distinct i.cameraModel from Image i"
- )
- }
+ @NamedQuery(
+ name = "image-camera",
+ query = "select distinct i.cameraModel from Image i"
+ )
+ }
)
/**
* Class for representing Image Entity
* EJB3 Entity Bean
- *
+ *
* @author Andrey Markhel
*/
@Entity
@Name("image")
@Table(name = "Images")
-@Role(name="selectedImage", scope = ScopeType.CONVERSATION)
+@Role(name = "selectedImage", scope = ScopeType.CONVERSATION)
public class Image implements Serializable {
private static final long serialVersionUID = -7042878411608396483L;
@@ -81,148 +81,151 @@
@GeneratedValue
@Column(name = "IMAGE_ID")
private Long id = null;
-
+
@Column(length = 255, nullable = false)
@NotNull
- @NotEmpty
- @Length(min=3)
+ @NotEmpty
+ @Length(min = 3)
private String name;
@Transient
private Boolean covering;
@Column(length = 1024, nullable = false)
@NotNull
- @NotEmpty
- @Length(min=3)
+ @NotEmpty
+ @Length(min = 3)
private String path;
-
+
@ManyToMany(cascade = CascadeType.ALL)
- @JoinTable(name="IMAGES_METATAGS",
- joinColumns=
- @JoinColumn(name="CI_IMAGE_ID",
- referencedColumnName="IMAGE_ID"),
- inverseJoinColumns=
- @JoinColumn(name="CI_METATAG_ID",
- referencedColumnName="METATAG_ID"))
- protected List<MetaTag> imageTags;
-
+ @JoinTable(name = "IMAGES_METATAGS",
+ joinColumns =
+ @JoinColumn(name = "CI_IMAGE_ID",
+ referencedColumnName = "IMAGE_ID"),
+ inverseJoinColumns =
+ @JoinColumn(name = "CI_METATAG_ID",
+ referencedColumnName = "METATAG_ID"))
+ protected List<MetaTag> imageTags;
+
+
+ /*
+ * Comma separated tag value
+ * */
+ @Transient
+ private String meta = "";
+
@Column(length = 255)
private String cameraModel;
-
+
private int height;
-
+
private double size;
-
+
private int width;
-
+
@Temporal(TemporalType.TIMESTAMP)
private Date uploaded;
-
+
@Column(length = 1024)
@NotNull
- @NotEmpty
- @Length(min=3)
+ @NotEmpty
+ @Length(min = 3)
private String description;
-
+
@Temporal(TemporalType.TIMESTAMP)
private Date created;
-
- @Transient
- private String meta = "";
-
- @OneToMany(mappedBy = "image", cascade = { CascadeType.ALL }, fetch = FetchType.LAZY)
+
+ @OneToMany(mappedBy = "image", cascade = {CascadeType.ALL}, fetch = FetchType.LAZY)
@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.EXTRA)
- @org.hibernate.annotations.OrderBy(clause="date asc")
+ @org.hibernate.annotations.OrderBy(clause = "date asc")
private List<Comment> comments = new ArrayList<Comment>();
-
+
@ManyToOne(fetch = FetchType.LAZY)
- @JoinColumn(name="IMG_ALBUM_ID",
- referencedColumnName="ALBUM_ID")
+ @JoinColumn(name = "IMG_ALBUM_ID", referencedColumnName = "ALBUM_ID")
private Album album;
-
+
@NotNull
- private boolean allowComments;
+ private boolean allowComments;
- // ********************** Accessor Methods ********************** //
+ // ********************** Accessor Methods ********************** //
/**
- * Getter for property id
- *
- * @return id of image
- */
+ * Getter for property id
+ *
+ * @return id of image
+ */
public Long getId() {
return id;
}
/**
- * Getter for property name
- *
- * @return name of image
- */
+ * Getter for property name
+ *
+ * @return name of image
+ */
public String getName() {
return name;
}
- /**
- * Setter for property name
- *
- * @param name - name of image
- */
+ /**
+ * Setter for property name
+ *
+ * @param name - name of image
+ */
public void setName(String name) {
this.name = name;
}
-
- /**
- * Getter for property description
- *
- * @return description of image
- */
+
+ /**
+ * Getter for property description
+ *
+ * @return description of image
+ */
public String getDescription() {
return description;
}
- /**
- * Setter for property description
- *
- * @param description - description of image
- */
+ /**
+ * Setter for property description
+ *
+ * @param description - description of image
+ */
public void setDescription(String description) {
this.description = description;
}
- public String getPath() {
- return path;
- }
+ public String getPath() {
+ return path;
+ }
- public void setPath(String path) {
- this.path = path;
- }
+ public void setPath(String path) {
+ this.path = path;
+ }
- public Date getCreated() {
- return created;
- }
+ public Date getCreated() {
+ return created;
+ }
- public void setCreated(Date created) {
- this.created = created;
- }
-
- public Album getAlbum() {
- return album;
- }
+ public void setCreated(Date created) {
+ this.created = created;
+ }
- public void setAlbum(Album album) {
- this.album = album;
- }
-
- //---------------------------Business methods
-
+ public Album getAlbum() {
+ return album;
+ }
+
+ public void setAlbum(Album album) {
+ this.album = album;
+ }
+
+ //---------------------------Business methods
+
public void addComment(Comment comment) {
if (comment == null) {
throw new IllegalArgumentException("Null comment!");
- }
+ }
if (comment.getImage() != null && !this.equals(comment.getImage())) {
- comment.getImage().getComments().remove(comment);
- }
+ comment.getImage().getComments().remove(comment);
+ }
comment.setImage(this);
comments.add(comment);
}
@@ -230,138 +233,157 @@
public void removeComment(Comment comment) {
if (comment == null) {
throw new IllegalArgumentException("Null comment");
- }
+ }
comment.setImage(null);
comments.remove(comment);
}
- public List<Comment> getComments() {
- return comments;
- }
+ public List<Comment> getComments() {
+ return comments;
+ }
- public List<MetaTag> getImageTags() {
- return imageTags;
- }
+ public List<MetaTag> getImageTags() {
+ return imageTags;
+ }
- public void setImageTags(List<MetaTag> imageTags) {
- this.imageTags = imageTags;
- }
+ public void setImageTags(List<MetaTag> imageTags) {
+ this.imageTags = imageTags;
+ }
- public String getMeta() {
- StringBuilder s = new StringBuilder();
- for(MetaTag tag: this.imageTags){
- s.append(tag.getTag()+", ");
- }
- String string = s.toString();
- return string.substring(0, string.length() - 2);
- }
+ public String getMeta() {
+ StringBuilder s = new StringBuilder();
+ for (MetaTag tag : this.imageTags) {
+ s.append(tag.getTag()).append(", ");
+ }
- public void setMeta(String meta) {
- this.meta = meta;
- }
-
- public String getMetaString(){
- return meta;
- }
+ return s.substring(0, s.length() - 2);
+ }
- public String getCameraModel() {
- return cameraModel;
- }
+ public void setMeta(String meta) {
+ this.meta = meta;
+ }
- public void setCameraModel(String cameraModel) {
- this.cameraModel = cameraModel;
- }
+ public String getMetaString() {
+ return meta;
+ }
- public int getHeight() {
- return height;
- }
+ public String getCameraModel() {
+ return cameraModel;
+ }
- public void setHeight(int height) {
- this.height = height;
- }
+ public void setCameraModel(String cameraModel) {
+ this.cameraModel = cameraModel;
+ }
- public double getSize() {
- return size;
- }
+ public int getHeight() {
+ return height;
+ }
- public void setSize(double size) {
- this.size = size;
- }
+ public void setHeight(int height) {
+ this.height = height;
+ }
- public int getWidth() {
- return width;
- }
+ public double getSize() {
+ return size;
+ }
- public void setWidth(int width) {
- this.width = width;
- }
+ public void setSize(double size) {
+ this.size = size;
+ }
- public Date getUploaded() {
- return uploaded;
- }
+ public int getWidth() {
+ return width;
+ }
- public void setUploaded(Date uploaded) {
- this.uploaded = uploaded;
- }
-
- public void addMetaTag(MetaTag metatag) {
- if (metatag == null) {
- throw new IllegalArgumentException("Null metatag!");
- }
- if(!imageTags.contains(metatag)){
- metatag.addImage(this);
- imageTags.add(metatag);
- }
- }
-
- public void removeMetaTag(MetaTag metatag) {
- if (metatag == null) {
- throw new IllegalArgumentException("Null metatag!");
- }
- if(imageTags.contains(metatag)){
- metatag.removeImage(this);
- imageTags.remove(metatag);
- }
- }
+ public void setWidth(int width) {
+ this.width = width;
+ }
- /**
- * @return the allowComments
- */
- public boolean isAllowComments() {
- return allowComments;
- }
+ public Date getUploaded() {
+ return uploaded;
+ }
- /**
- * @param allowCommennts the allowComments to set
- */
- public void setAllowComments(boolean allowComments) {
- this.allowComments = allowComments;
- }
+ public void setUploaded(Date uploaded) {
+ this.uploaded = uploaded;
+ }
- public boolean isCovering() {
- return this.equals(this.getAlbum().getCoveringImage());
- }
+ public void addMetaTag(MetaTag metatag) {
+ if (metatag == null) {
+ throw new IllegalArgumentException("Null metatag!");
+ }
+ if (!imageTags.contains(metatag)) {
+ metatag.addImage(this);
+ imageTags.add(metatag);
+ }
+ }
- public void setCovering(boolean covering) {
- this.covering = covering;
- }
+ public void removeMetaTag(MetaTag metatag) {
+ if (metatag == null) {
+ throw new IllegalArgumentException("Null metatag!");
+ }
+ if (imageTags.contains(metatag)) {
+ metatag.removeImage(this);
+ imageTags.remove(metatag);
+ }
+ }
- public boolean containTag(String s) {
- for(MetaTag t : imageTags){
- if(t.getTag().equals(s)){
- return true;
- }
- }
- return false;
- }
+ /**
+ * @return the allowComments
+ */
+ public boolean isAllowComments() {
+ return allowComments;
+ }
- public MetaTag getTagByName(String s) {
- for(MetaTag t : imageTags){
- if(t.getTag().equals(s)){
- return t;
- }
- }
- return null;
- }
-
+ /**
+ * @param allowComments the allowComments to set
+ */
+ public void setAllowComments(boolean allowComments) {
+ this.allowComments = allowComments;
+ }
+
+ public boolean isCovering() {
+ return this.equals(this.getAlbum().getCoveringImage());
+ }
+
+ public void setCovering(boolean covering) {
+ this.covering = covering;
+ }
+
+ public boolean containTag(String s) {
+ for (MetaTag t : imageTags) {
+ if (t.getTag().equals(s)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public MetaTag getTagByName(String s) {
+ for (MetaTag t : imageTags) {
+ if (t.getTag().equals(s)) {
+ return t;
+ }
+ }
+ return null;
+ }
+
+
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ Image image = (Image) o;
+
+ if (id != null ? !id.equals(image.id) : image.id != null) return false;
+ if (path != null ? !path.equals(image.path) : image.path != null) return false;
+
+ return true;
+ }
+
+ public int hashCode() {
+ int result;
+ result = (id != null ? id.hashCode() : 0);
+ result = 31 * result + (path != null ? path.hashCode() : 0);
+ return result;
+ }
}
Modified: trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/MetaTag.java
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/MetaTag.java 2009-03-25 13:06:42 UTC (rev 13175)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/MetaTag.java 2009-03-25 14:33:05 UTC (rev 13176)
@@ -39,49 +39,78 @@
@Entity
@Name("metaTag")
@Table(name = "metatags")
-public class MetaTag implements Serializable{
+public class MetaTag implements Serializable {
- private static final long serialVersionUID = -9065024051468971330L;
+ private static final long serialVersionUID = -9065024051468971330L;
- @Id
- @GeneratedValue
- @Column(name = "METATAG_ID")
- private Long id;
-
- @Column(length = 255, nullable = false)
+ @Id
+ @GeneratedValue
+ @Column(name = "METATAG_ID")
+ private Long id;
+
+ @Column(length = 255, nullable = false)
@NotNull
- @NotEmpty
- @Length(min=3)
- private String tag;
-
- @ManyToMany(mappedBy="imageTags")
- private List<Image> images = new ArrayList<Image>();
+ @NotEmpty
+ @Length(min = 3)
+ private String tag;
- public Long getId() {
- return id;
- }
+ @ManyToMany(mappedBy = "imageTags")
+ private List<Image> images = new ArrayList<Image>();
- public String getTag() {
- return tag;
- }
+ public MetaTag() {
+ }
- public void setTag(String tag) {
- this.tag = tag;
- }
+ public MetaTag(Long id) {
+ this.id = id;
+ }
- public List<Image> getImages() {
- return images;
- }
+ public MetaTag(Long id, String tag) {
+ this.id = id;
+ this.tag = tag;
+ }
- public void setImages(List<Image> images) {
- this.images = images;
- }
-
- public void addImage(Image image){
- images.add(image);
- }
-
- public void removeImage(Image image){
- images.remove(image);
- }
+ public Long getId() {
+ return id;
+ }
+
+ public String getTag() {
+ return tag;
+ }
+
+ public void setTag(String tag) {
+ this.tag = tag;
+ }
+
+ public List<Image> getImages() {
+ return images;
+ }
+
+ public void setImages(List<Image> images) {
+ this.images = images;
+ }
+
+ public void addImage(Image image) {
+ images.add(image);
+ }
+
+ public void removeImage(Image image) {
+ images.remove(image);
+ }
+
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ MetaTag metaTag = (MetaTag) o;
+
+ return (id == null ? metaTag.id == null : id.equals(metaTag.id))
+ && tag.equalsIgnoreCase(metaTag.tag);
+ }
+
+ public int hashCode() {
+ int result;
+ result = (id != null ? id.hashCode() : 0);
+ result = 31 * result + tag.hashCode();
+ return result;
+ }
}
Modified: trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Sex.java
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Sex.java 2009-03-25 13:06:42 UTC (rev 13175)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Sex.java 2009-03-25 14:33:05 UTC (rev 13176)
@@ -1,29 +1,26 @@
package org.richfaces.realworld.domain;
public enum Sex {
- MALE("1"),
- FEMALE("0");
-
- String key;
-
- private Sex(String key) {
- this.key = key;
- }
+ MALE("1"),
+ FEMALE("0");
- /**
- * @return the key
- */
- public String getKey() {
- return key;
- }
+ String key;
- /**
- * @param key the key to set
- */
- public void setKey(String key) {
- this.key = key;
- }
-
-
-
+ private Sex(String key) {
+ this.key = key;
+ }
+
+ /**
+ * @return the key
+ */
+ public String getKey() {
+ return key;
+ }
+
+ /**
+ * @param key the key to set
+ */
+ public void setKey(String key) {
+ this.key = key;
+ }
}
Modified: trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Shelf.java
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Shelf.java 2009-03-25 13:06:42 UTC (rev 13175)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Shelf.java 2009-03-25 14:33:05 UTC (rev 13176)
@@ -32,179 +32,200 @@
@Table(name = "shelfs")
public class Shelf implements Serializable {
- private static final long serialVersionUID = -7042878411608396483L;
+ private static final long serialVersionUID = -7042878411608396483L;
- @Id
- @GeneratedValue
- @Column(name = "SHELF_ID")
- private Long id = null;
+ @Id
+ @GeneratedValue
+ @Column(name = "SHELF_ID")
+ private Long id = null;
- @Column(length = 255, nullable = false)
- @NotNull
- @NotEmpty
- @Length(min = 3)
- private String name;
+ @Column(length = 255, nullable = false)
+ @NotNull
+ @NotEmpty
+ @Length(min = 3)
+ private String name;
- @Column(length = 1024)
- private String description;
+ @Column(length = 1024)
+ private String description;
- @ManyToOne(fetch = FetchType.LAZY)
- @JoinColumn(name = "SHELF_USER_ID", referencedColumnName = "USER_ID")
- private User owner;
+ @ManyToOne(fetch = FetchType.LAZY)
+ @JoinColumn(name = "SHELF_USER_ID", referencedColumnName = "USER_ID")
+ private User owner;
- @OneToMany(mappedBy = "shelf", cascade = { CascadeType.ALL })
- @org.hibernate.annotations.OrderBy(clause = "NAME asc")
- private List<Album> albums = new ArrayList<Album>();
- @Transient
- private List<Image> unvisitedImages = new ArrayList<Image>();
- @NotNull
- private boolean shared;
-
- @Temporal(TemporalType.TIMESTAMP)
+ @OneToMany(mappedBy = "shelf", cascade = {CascadeType.ALL})
+ @org.hibernate.annotations.OrderBy(clause = "NAME asc")
+ private List<Album> albums = new ArrayList<Album>();
+ @Transient
+ private List<Image> unvisitedImages = new ArrayList<Image>();
+ @NotNull
+ private boolean shared;
+
+ @Temporal(TemporalType.TIMESTAMP)
private Date created;
-
- @Transient
- private Long countUnvisitedImages;
-
- /**
- * Getter for property id
- *
- * @return id of album
- */
- public Long getId() {
- return id;
- }
- /**
- * Getter for property name
- *
- * @return name of album
- */
- public String getName() {
- return name;
- }
+ @Transient
+ private Long countUnvisitedImages;
- /**
- * Setter for property name
- *
- * @param name -
- * name of album
- */
- public void setName(String name) {
- this.name = name;
- }
+ /**
+ * Getter for property id
+ *
+ * @return id of album
+ */
+ public Long getId() {
+ return id;
+ }
- /**
- * Getter for property description
- *
- * @return description of album
- */
- public String getDescription() {
- return description;
- }
+ /**
+ * Getter for property name
+ *
+ * @return name of album
+ */
+ public String getName() {
+ return name;
+ }
- /**
- * Setter for property description
- *
- * @param description -
- * description of album
- */
- public void setDescription(String description) {
- this.description = description;
- }
-
- public List<Album> getAlbums() {
- return albums;
- }
-
- public User getOwner() {
- return owner;
- }
+ /**
+ * Setter for property name
+ *
+ * @param name -
+ * name of album
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
- public void setOwner(User owner) {
- this.owner = owner;
- }
+ /**
+ * Getter for property description
+ *
+ * @return description of album
+ */
+ public String getDescription() {
+ return description;
+ }
- public void addAlbum(Album album) {
- if (album == null)
- throw new IllegalArgumentException("Null child!");
- if (album.getShelf() != null)
- album.getShelf().getAlbums().remove(album);
- album.setShelf(this);
- albums.add(album);
- }
+ /**
+ * Setter for property description
+ *
+ * @param description -
+ * description of album
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
- public void removeChildAlbum(Album album) {
- if (album == null)
- throw new IllegalArgumentException("Null child!");
- album.setShelf(null);
- albums.remove(album);
- }
-
- public int getCountAlbums() {
- return this.getAlbums() != null ? this.getAlbums().size() : 0;
+ public List<Album> getAlbums() {
+ return albums;
+ }
- }
-
- public int getCountImages() {
- int result = 0;
- if(getCountAlbums() > 0){
- for(Album album : getAlbums()){
- result += album.getCountImages();
- }
- }
- return result;
- }
+ public User getOwner() {
+ return owner;
+ }
- /**
- * @return the created
- */
- public Date getCreated() {
- return created;
- }
+ public void setOwner(User owner) {
+ this.owner = owner;
+ }
- /**
- * @param created the created to set
- */
- public void setCreated(Date created) {
- this.created = created;
- }
+ public void addAlbum(Album album) {
+ if (album == null)
+ throw new IllegalArgumentException("Null child!");
+ if (album.getShelf() != null)
+ album.getShelf().getAlbums().remove(album);
+ album.setShelf(this);
+ albums.add(album);
+ }
- public boolean isShared() {
- return shared;
- }
+ public void removeChildAlbum(Album album) {
+ if (album == null)
+ throw new IllegalArgumentException("Null child!");
+ album.setShelf(null);
+ albums.remove(album);
+ }
- public void setShared(boolean shared) {
- this.shared = shared;
- }
+ public int getCountAlbums() {
+ return this.getAlbums() != null ? this.getAlbums().size() : 0;
- public Long getCountUnvisitedImages() {
- return countUnvisitedImages;
- }
+ }
- public void setCountUnvisitedImages(Long countUnvisitedImages) {
- this.countUnvisitedImages = countUnvisitedImages;
- }
+ public int getCountImages() {
+ int result = 0;
+ if (getCountAlbums() > 0) {
+ for (Album album : getAlbums()) {
+ result += album.getCountImages();
+ }
+ }
+ return result;
+ }
- public List<Image> getUnvisitedImages() {
- return unvisitedImages;
- }
+ /**
+ * @return the created
+ */
+ public Date getCreated() {
+ return created;
+ }
- public void setUnvisitedImages(List<Image> unvisitedImages) {
- this.unvisitedImages = unvisitedImages;
- }
+ /**
+ * @param created the created to set
+ */
+ public void setCreated(Date created) {
+ this.created = created;
+ }
- public void visitImage(Image image) {
- if(unvisitedImages.contains(image)){
- unvisitedImages.remove(image);
- countUnvisitedImages--;
- }
- }
+ public boolean isShared() {
+ return shared;
+ }
- public Album getFirstAlbum() {
- if(this.albums.size() > 0){
- return this.albums.get(0);
- }
- return null;
- }
+ public void setShared(boolean shared) {
+ this.shared = shared;
+ }
+
+ public Long getCountUnvisitedImages() {
+ return countUnvisitedImages;
+ }
+
+ public void setCountUnvisitedImages(Long countUnvisitedImages) {
+ this.countUnvisitedImages = countUnvisitedImages;
+ }
+
+ public List<Image> getUnvisitedImages() {
+ return unvisitedImages;
+ }
+
+ public void setUnvisitedImages(List<Image> unvisitedImages) {
+ this.unvisitedImages = unvisitedImages;
+ }
+
+ public void visitImage(Image image) {
+ if (unvisitedImages.contains(image)) {
+ unvisitedImages.remove(image);
+ countUnvisitedImages--;
+ }
+ }
+
+ public Album getFirstAlbum() {
+ if (this.albums.size() > 0) {
+ return this.albums.get(0);
+ }
+ return null;
+ }
+
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ Shelf shelf = (Shelf) o;
+
+ if (id != null ? !id.equals(shelf.id) : shelf.id != null) return false;
+ if (owner != null ? !owner.equals(shelf.owner) : shelf.owner != null) return false;
+ if (!name.equals(shelf.name)) return false;
+
+ return true;
+ }
+
+ public int hashCode() {
+ int result;
+ result = (id != null ? id.hashCode() : 0);
+ result = 31 * result + name.hashCode();
+ result = 31 * result + (owner != null ? owner.hashCode() : 0);
+ return result;
+ }
}
Modified: trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/User.java
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/User.java 2009-03-25 13:06:42 UTC (rev 13175)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/User.java 2009-03-25 14:33:05 UTC (rev 13176)
@@ -303,4 +303,25 @@
}
return images;
}
+
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ User user = (User) o;
+
+ if (email != null ? !email.equals(user.email) : user.email != null) return false;
+ if (id != null ? !id.equals(user.id) : user.id != null) return false;
+ if (login != null ? !login.equals(user.login) : user.login != null) return false;
+
+ return true;
+ }
+
+ public int hashCode() {
+ int result;
+ result = (id != null ? id.hashCode() : 0);
+ result = 31 * result + (email != null ? email.hashCode() : 0);
+ result = 31 * result + (login != null ? login.hashCode() : 0);
+ return result;
+ }
}
\ No newline at end of file
Modified: trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java 2009-03-25 13:06:42 UTC (rev 13175)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java 2009-03-25 14:33:05 UTC (rev 13176)
@@ -41,87 +41,87 @@
@AutoCreate
public class ImageAction implements IImageAction {
- @In(value="entityManager")
- EntityManager em;
-
- public void deleteImage(Image image, boolean isFlushNeeded){
- image.getAlbum().removeImage(image);
- if(isFlushNeeded){
- em.flush();
- }
- }
+ @In(value = "entityManager")
+ EntityManager em;
- public void editImage(Image image, boolean isFlushNeeded) {
- List<MetaTag> removals = new ArrayList<MetaTag>(image.getImageTags());
- String[] tokens = image.getMetaString().split(",");
- Set<String> toks = new HashSet<String>();
- for(String s:tokens){
- toks.add(s.trim());
- }
- for(String s:toks){
- if(!image.containTag(s)){
- MetaTag tag = getTagByName(s);
- if(tag == null){
- tag = new MetaTag();
- tag.setTag(s);
- }
- image.addMetaTag(tag);
- }else{
- MetaTag t = image.getTagByName(s);
- removals.remove(t);
- }
- }
- for(MetaTag tag:removals){
- image.removeMetaTag(tag);
- tag.removeImage(image);
- }
- if(image.isCovering()){
- if(!image.equals(image.getAlbum().getCoveringImage())){
- image.getAlbum().setCoveringImage(image);
- }
- }
- if(isFlushNeeded){
- em.flush();
- }
- }
+ public void deleteImage(Image image, boolean isFlushNeeded) {
+ image.getAlbum().removeImage(image);
+ if (isFlushNeeded) {
+ em.flush();
+ }
+ }
- public void addImage(Image image, boolean isFlushNeeded) {
- em.persist(image);
- image.getAlbum().addImage(image);
- if(isFlushNeeded){
- em.flush();
- }
- }
-
- public void deleteComment(Comment comment, boolean isFlushNeeded){
- comment.getImage().removeComment(comment);
- if(isFlushNeeded){
- em.flush();
- }
- }
-
- public void addComment(Comment comment, boolean isFlushNeeded){
- comment.getImage().addComment(comment);
- if(isFlushNeeded){
- em.flush();
- }
- }
+ public void editImage(Image image, boolean isFlushNeeded) {
+ List<MetaTag> removals = new ArrayList<MetaTag>(image.getImageTags());
+ String[] tokens = image.getMetaString().split(",");
+ Set<String> toks = new HashSet<String>();
+ for (String s : tokens) {
+ toks.add(s.trim());
+ }
+ for (String s : toks) {
+ if (!image.containTag(s)) {
+ MetaTag tag = getTagByName(s);
+ if (tag == null) {
+ tag = new MetaTag();
+ tag.setTag(s);
+ }
+ image.addMetaTag(tag);
+ } else {
+ MetaTag t = image.getTagByName(s);
+ removals.remove(t);
+ }
+ }
+ for (MetaTag tag : removals) {
+ image.removeMetaTag(tag);
+ tag.removeImage(image);
+ }
+ if (image.isCovering()) {
+ if (!image.equals(image.getAlbum().getCoveringImage())) {
+ image.getAlbum().setCoveringImage(image);
+ }
+ }
+ if (isFlushNeeded) {
+ em.flush();
+ }
+ }
- public MetaTag getTagByName(String tag) {
- MetaTag t;
- try{
- t = (MetaTag)em.createQuery("from MetaTag m where m.tag =:tag").setParameter("tag", tag).getSingleResult();
- }catch(NoResultException nre){
- return null;
- }
- return t;
- }
+ public void addImage(Image image, boolean isFlushNeeded) {
+ em.persist(image);
+ image.getAlbum().addImage(image);
+ if (isFlushNeeded) {
+ em.flush();
+ }
+ }
- public List<MetaTag> popularTags() {
- return (List<MetaTag>)em.createQuery("select m from MetaTag m").setMaxResults(20).getResultList();
- }
+ public void deleteComment(Comment comment, boolean isFlushNeeded) {
+ comment.getImage().removeComment(comment);
+ if (isFlushNeeded) {
+ em.flush();
+ }
+ }
- public List<MetaTag> getTagsLikeString(String suggest) {
- return (List<MetaTag>)em.createQuery("select m from MetaTag m where lower(m.tag) like :tag").setParameter("tag", suggest + "%").getResultList();
- }
+ public void addComment(Comment comment, boolean isFlushNeeded) {
+ comment.getImage().addComment(comment);
+ if (isFlushNeeded) {
+ em.flush();
+ }
+ }
+
+ public MetaTag getTagByName(String tag) {
+ MetaTag t;
+ try {
+ t = (MetaTag) em.createQuery("from MetaTag m where m.tag =:tag").setParameter("tag", tag).getSingleResult();
+ } catch (NoResultException nre) {
+ return null;
+ }
+ return t;
+ }
+
+ public List<MetaTag> popularTags() {
+ return em.createQuery("select new MetaTag(m.id, m.tag) from MetaTag m join m.images img group by m.id, m.tag order by count(img) desc").setMaxResults(20).getResultList();
+ }
+
+ public List<MetaTag> getTagsLikeString(String suggest) {
+ return (List<MetaTag>) em.createQuery("select m from MetaTag m where lower(m.tag) like :tag").setParameter("tag", suggest + "%").getResultList();
+ }
}
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/test.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/test.java 2009-03-25 13:06:42 UTC (rev 13175)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/test.java 2009-03-25 14:33:05 UTC (rev 13176)
@@ -29,6 +29,7 @@
writeFiles(file, "_small80", 80);
writeFiles(file, "_small120", 120);
writeFiles(file, "_small160", 160);
+ writeFiles(file, "_small200", 200);
writeFiles(file, "_mini", 150);
writeFiles(file, "_medium", 600);
}
@@ -40,7 +41,9 @@
}
} else if (file.isFile()) {
final String s = file.getName().toLowerCase();
- if (s.endsWith(".jpg") && !s.endsWith("_mini.jpg") && !s.endsWith("_medium.jpg") && !s.endsWith("_small80.jpg") && !s.endsWith("_small120.jpg") && !s.endsWith("_small160.jpg")) {
+ if (s.endsWith(".jpg") && !s.endsWith("_mini.jpg") && !s.endsWith("_medium.jpg")
+ && !s.endsWith("_small80.jpg") && !s.endsWith("_small120.jpg")
+ && !s.endsWith("_small160.jpg") && !s.endsWith("_small200.jpg")) {
System.out.println("processing file >> " + file.getPath());
writeOneImage(file.getParent(), pattern, size, s);
}
15 years, 9 months
JBoss Rich Faces SVN: r13175 - in trunk/test-applications/realworld2/web/src/main/webapp: includes/help and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2009-03-25 09:06:42 -0400 (Wed, 25 Mar 2009)
New Revision: 13175
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/tags/templates/help.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/help/tree_build_descr.xhtml
Log:
scrolling content for help modal panel
Modified: trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/tags/templates/help.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/help/tree_build_descr.xhtml
===================================================================
(Binary files differ)
15 years, 9 months
JBoss Rich Faces SVN: r13174 - trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2009-03-25 08:23:08 -0400 (Wed, 25 Mar 2009)
New Revision: 13174
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataScrollerTest.java
Log:
define templates in which test should run
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataScrollerTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataScrollerTest.java 2009-03-25 12:19:52 UTC (rev 13173)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataScrollerTest.java 2009-03-25 12:23:08 UTC (rev 13174)
@@ -655,6 +655,15 @@
public String getTestUrl() {
return TEST__URL;
}
-
+
+ @Override
+ public String getTestDependedTemplates() {
+ return "simple,modal_panel";
+ }
+
+ @Override
+ public boolean useDefaultTemplates() {
+ return false;
+ }
}
15 years, 9 months
JBoss Rich Faces SVN: r13173 - trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2009-03-25 08:19:52 -0400 (Wed, 25 Mar 2009)
New Revision: 13173
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
Log:
add possibility to user to define a set of html layout templates per test class in which tests methods will be executing. (now default templates are: simple, data_table, data_table2, modal_panel);
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2009-03-25 12:14:06 UTC (rev 13172)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2009-03-25 12:19:52 UTC (rev 13173)
@@ -222,10 +222,27 @@
protected void loadConfiguration(String loadStyleStrategy, String loadScriptStrategy, @Optional String templates) throws Exception {
Configurator.setLoadScriptStrategy(loadScriptStrategy);
Configurator.setLoadStyleStrategy(loadStyleStrategy);
- Configurator.setTemplates(templates);
+ String processTemplates = templates;
+ if(!useDefaultTemplates()) {
+ processTemplates = getTestDependedTemplates();
+ }
+ Configurator.setTemplates(processTemplates);
}
-
+
+
/**
+ * override this methods if you want use set custom templates per test class
+ *
+ */
+ protected String getTestDependedTemplates() {
+ return null;
+ }
+
+ public boolean useDefaultTemplates() {
+ return true;
+ }
+
+ /**
* This method are invoked after selenium tests completed
*/
@AfterClass(alwaysRun=true)
15 years, 9 months