JBoss Rich Faces SVN: r13754 - in trunk/examples/photoalbum/web/src/main/webapp/includes: userPrefs and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2009-04-22 06:33:12 -0400 (Wed, 22 Apr 2009)
New Revision: 13754
Modified:
trunk/examples/photoalbum/web/src/main/webapp/includes/shelf/shelfEditInfo.xhtml
trunk/examples/photoalbum/web/src/main/webapp/includes/userPrefs/userPrefsEdit.xhtml
Log:
calendar validation
Modified: trunk/examples/photoalbum/web/src/main/webapp/includes/shelf/shelfEditInfo.xhtml
===================================================================
--- trunk/examples/photoalbum/web/src/main/webapp/includes/shelf/shelfEditInfo.xhtml 2009-04-22 09:05:50 UTC (rev 13753)
+++ trunk/examples/photoalbum/web/src/main/webapp/includes/shelf/shelfEditInfo.xhtml 2009-04-22 10:33:12 UTC (rev 13754)
@@ -6,78 +6,80 @@
xmlns:richx="http://richfaces.org/richx"
xmlns:rich="http://richfaces.org/rich">
<div class="shelf-edit">
- <table style="border-collapse : collapse;" cellpadding="5" border="0">
- <tr>
- <td valign="top" nowrap="true" style="padding-top : 8px">
- #{messages['shelf_name']}
- </td>
- <td valign="top" colspan="2">
- <h:inputText id="shelf_name"
- value="#{model.selectedShelf.name}"
- styleClass="shelf-edit-input"
- required="true"/>
- </td>
- </tr>
- <tr>
- <td style="padding:0; margin:0;" />
- <td style="padding:0; margin:0;" ><rich:message for="shelf_name" /></td>
- </tr>
- <tr>
- <td valign="top" nowrap="true" style="padding-top : 8px">
- #{messages['creation_date']}
- </td>
- <td valign="top">
- <a4j:outputPanel id="calendar" layout="block">
- <rich:calendar id="shelf_date"
- styleClass="shelf-edit-calendar"
- enableManualInput="true"
- value="#{model.selectedShelf.created}"
- cellWidth="24px"
- cellHeight="22px">
- <rich:ajaxValidator event="onchange"/>
- </rich:calendar>
- </a4j:outputPanel>
- <rich:message for="calendar" />
- </td>
- </tr>
- <tr>
- <td style="padding:0; margin:0;" />
- <td style="padding:0; margin:0;" ><rich:message for="shelf_date" /></td>
- </tr>
- <tr>
- <td valign="top" nowrap="true" style="padding-top : 8px">
- #{messages['description']}
- </td>
- <td valign="top" colspan="2">
- <h:inputTextarea id="shelf_description"
- value="#{model.selectedShelf.description}"
- styleClass="shelf-edit-area" />
- </td>
- </tr>
- <tr>
- <td style="padding:0; margin:0;" />
- <td style="padding:0; margin:0;" ><rich:message for="shelf_description" /></td>
- </tr>
- <tr>
- <td valign="top" nowrap="true" style="padding-top : 8px">
- <h:outputText value="#{messages['album.shared']}" />
- </td>
- <td valign="top">
- <h:selectBooleanCheckbox styleClass="selectBooleanCheckbox"
- id="shared"
- value="#{model.selectedShelf.shared}"/>
- <rich:message for="shared" />
- </td>
- </tr>
- <tr>
- <td valign="top">
- </td>
- <td valign="top" align="right" colspan="2" style="padding : 10px;">
- <richx:commandButton id="saveButton" style="float: left" value="#{messages['save']}" actionListener="#{shelfManager.editShelf(model.selectedShelf)}" reRender="mainArea" />
- <richx:commandButton id="cancelButton" value="#{messages['cancel']}" immediate="true" actionListener="#{controller.cancelEditShelf()}" reRender="mainArea" />
- </td>
- </tr>
- </table>
+ <rich:graphValidator>
+ <table style="border-collapse : collapse;" cellpadding="5" border="0">
+ <tr>
+ <td valign="top" nowrap="true" style="padding-top : 8px">
+ #{messages['shelf_name']}
+ </td>
+ <td valign="top" colspan="2">
+ <h:inputText id="shelf_name"
+ value="#{model.selectedShelf.name}"
+ styleClass="shelf-edit-input"
+ required="true"/>
+ </td>
+ </tr>
+ <tr>
+ <td style="padding:0; margin:0;" />
+ <td style="padding:0; margin:0;" ><rich:message for="shelf_name" /></td>
+ </tr>
+ <tr>
+ <td valign="top" nowrap="true" style="padding-top : 8px">
+ #{messages['creation_date']}
+ </td>
+ <td valign="top">
+ <a4j:outputPanel id="calendar" layout="block">
+ <rich:calendar id="shelf_date"
+ styleClass="shelf-edit-calendar"
+ enableManualInput="true"
+ value="#{model.selectedShelf.created}"
+ cellWidth="24px"
+ cellHeight="22px">
+ <rich:ajaxValidator event="onchange"/>
+ </rich:calendar>
+ </a4j:outputPanel>
+ <rich:message for="calendar" />
+ </td>
+ </tr>
+ <tr>
+ <td style="padding:0; margin:0;" />
+ <td style="padding:0; margin:0;" ><rich:message for="shelf_date" /></td>
+ </tr>
+ <tr>
+ <td valign="top" nowrap="true" style="padding-top : 8px">
+ #{messages['description']}
+ </td>
+ <td valign="top" colspan="2">
+ <h:inputTextarea id="shelf_description"
+ value="#{model.selectedShelf.description}"
+ styleClass="shelf-edit-area" />
+ </td>
+ </tr>
+ <tr>
+ <td style="padding:0; margin:0;" />
+ <td style="padding:0; margin:0;" ><rich:message for="shelf_description" /></td>
+ </tr>
+ <tr>
+ <td valign="top" nowrap="true" style="padding-top : 8px">
+ <h:outputText value="#{messages['album.shared']}" />
+ </td>
+ <td valign="top">
+ <h:selectBooleanCheckbox styleClass="selectBooleanCheckbox"
+ id="shared"
+ value="#{model.selectedShelf.shared}"/>
+ <rich:message for="shared" />
+ </td>
+ </tr>
+ <tr>
+ <td valign="top">
+ </td>
+ <td valign="top" align="right" colspan="2" style="padding : 10px;">
+ <richx:commandButton id="saveButton" style="float: left" value="#{messages['save']}" actionListener="#{shelfManager.editShelf(model.selectedShelf)}" reRender="mainArea" />
+ <richx:commandButton id="cancelButton" value="#{messages['cancel']}" immediate="true" actionListener="#{controller.cancelEditShelf()}" reRender="mainArea" />
+ </td>
+ </tr>
+ </table>
+ </rich:graphValidator>
</div>
<ui:include src="/includes/album/albumsList.xhtml">
<ui:param name="albums" value="#{model.selectedShelf.albums}" />
Modified: trunk/examples/photoalbum/web/src/main/webapp/includes/userPrefs/userPrefsEdit.xhtml
===================================================================
(Binary files differ)
15 years, 8 months
JBoss Rich Faces SVN: r13753 - trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2009-04-22 05:05:50 -0400 (Wed, 22 Apr 2009)
New Revision: 13753
Modified:
trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/Image.java
Log:
formatting
Modified: trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/Image.java
===================================================================
--- trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/Image.java 2009-04-22 08:37:54 UTC (rev 13752)
+++ trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/Image.java 2009-04-22 09:05:50 UTC (rev 13753)
@@ -25,10 +25,17 @@
*/
package org.richfaces.photoalbum.domain;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
+import org.hibernate.annotations.LazyCollection;
+import org.hibernate.annotations.LazyCollectionOption;
+import org.hibernate.annotations.OrderBy;
+import org.hibernate.validator.Length;
+import org.hibernate.validator.NotEmpty;
+import org.hibernate.validator.NotNull;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.AutoCreate;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.richfaces.photoalbum.service.ActionTools;
import javax.persistence.CascadeType;
import javax.persistence.Column;
@@ -47,41 +54,32 @@
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
-import javax.persistence.UniqueConstraint;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
-import org.hibernate.validator.Length;
-import org.hibernate.validator.NotEmpty;
-import org.hibernate.validator.NotNull;
-import org.hibernate.annotations.LazyCollection;
-import org.hibernate.annotations.LazyCollectionOption;
-import org.hibernate.annotations.OrderBy;
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.AutoCreate;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.richfaces.photoalbum.service.ActionTools;
-
@NamedQueries({
- @NamedQuery(
- name = "tag-byName",
- query = "from MetaTag m where m.tag =:tag"
- ),
- @NamedQuery(
- name = "tag-popular",
- query = "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"
- ),
- @NamedQuery(
- name = "user-shelves",
- query = "select distinct s from Shelf s where (s.shared = true and s.owner.preDefined = true) order by s.name"
- ),
- @NamedQuery(
- name = "image-exist",
- query = "from Image i where i.path = :path and i.album = :album"
- ),
- @NamedQuery(
- name = "tag-suggest",
- query = "select m from MetaTag m where lower(m.tag) like :tag"
- )})
+ @NamedQuery(
+ name = "tag-byName",
+ query = "from MetaTag m where m.tag =:tag"
+ ),
+ @NamedQuery(
+ name = "tag-popular",
+ query = "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"
+ ),
+ @NamedQuery(
+ name = "user-shelves",
+ query = "select distinct s from Shelf s where (s.shared = true and s.owner.preDefined = true) order by s.name"
+ ),
+ @NamedQuery(
+ name = "image-exist",
+ query = "from Image i where i.path = :path and i.album = :album"
+ ),
+ @NamedQuery(
+ name = "tag-suggest",
+ query = "select m from MetaTag m where lower(m.tag) like :tag"
+ )})
/**
* Class for representing Image Entity
* EJB3 Entity Bean
@@ -96,87 +94,93 @@
@AutoCreate
public class Image implements Serializable {
- private static final long serialVersionUID = -7042878411608396483L;
+ private static final long serialVersionUID = -7042878411608396483L;
- @Id
- @GeneratedValue
- @Column(name = "IMAGE_ID")
- private Long id = null;
+ public static final int STRING_LENGTH = 255;
+ public static final int TEXT_LENGTH = 1024;
- @Column(length = 255, nullable = false)
- @NotNull
- @NotEmpty
- @Length(min = 3)
- private String name;
-
- @Transient
- private boolean covering;
+ @Id
+ @GeneratedValue
+ @Column(name = "IMAGE_ID")
+ private Long id = null;
- @Column(length = 1024, nullable = false)
- @NotNull
- @NotEmpty
- @Length(min = 3)
- private String path;
- @ManyToMany(cascade = CascadeType.PERSIST)
- @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 = new ArrayList<MetaTag>();
+ @Column(length = STRING_LENGTH, nullable = false)
+ @NotNull
+ @NotEmpty
+ @Length(min = 3)
+ private String name;
- @Transient
- private boolean visited;
- /*
- * Comma separated tag value
- * */
- @Transient
- private String meta = "";
+ @Transient
+ private boolean covering;
- @Column(length = 255)
- private String cameraModel;
+ @Column(length = TEXT_LENGTH, nullable = false)
+ @NotNull
+ @NotEmpty
+ @Length(min = 3)
+ private String path;
- private int height;
+ @ManyToMany(cascade = CascadeType.PERSIST)
+ @JoinTable(name = "IMAGES_METATAGS",
+ joinColumns =
+ @JoinColumn(name = "CI_IMAGE_ID",
+ referencedColumnName = "IMAGE_ID"),
+ inverseJoinColumns =
+ @JoinColumn(name = "CI_METATAG_ID",
+ referencedColumnName = "METATAG_ID"))
+ private List<MetaTag> imageTags = new ArrayList<MetaTag>();
- private double size;
+ @Transient
+ private boolean visited;
+ /*
+ * Comma separated tag value
+ * */
+ @Transient
+ private String meta = "";
- private int width;
+ @Column(length = STRING_LENGTH)
+ private String cameraModel;
- @Temporal(TemporalType.TIMESTAMP)
- private Date uploaded;
+ private int height;
- @Column(length = 1024)
- @NotNull
- @NotEmpty
- @Length(min = 3)
- private String description;
+ private double size;
- @Temporal(TemporalType.TIMESTAMP)
- private Date created;
+ private int width;
- @OneToMany(mappedBy = "image", cascade = {CascadeType.ALL}, fetch = FetchType.LAZY)
- @LazyCollection(LazyCollectionOption.EXTRA)
- @OrderBy(clause = "date asc")
- private List<Comment> comments = new ArrayList<Comment>();
+ @Temporal(TemporalType.TIMESTAMP)
+ private Date uploaded;
- @ManyToOne(fetch = FetchType.LAZY)
- @JoinColumn(name = "ALBUM_ID", referencedColumnName = "ALBUM_ID")
- private Album album;
+ @Column(length = TEXT_LENGTH)
+ @NotNull
+ @NotEmpty
+ @Length(min = 3)
+ private String description;
- @NotNull
- private boolean allowComments;
+ @Temporal(TemporalType.TIMESTAMP)
+ private Date created;
+ @OneToMany(mappedBy = "image", cascade = {
+ CascadeType.ALL}, fetch = FetchType.LAZY)
+ @LazyCollection(LazyCollectionOption.EXTRA)
+ @OrderBy(clause = "date asc")
+ private List<Comment> comments = new ArrayList<Comment>();
+
+ @ManyToOne(fetch = FetchType.LAZY)
+ @JoinColumn(name = "ALBUM_ID", referencedColumnName = "ALBUM_ID")
+ private Album album;
+
+ @NotNull
+ private boolean allowComments;
+
private Boolean showMetaInfo = true;
+
/**
- * Getter for property preDefined
- *
- * @return is this shelf is predefined
- */
- public boolean isPreDefined() {
- return getAlbum() != null? getAlbum().isPreDefined() : false;
+ * Getter for property preDefined
+ *
+ * @return is this shelf is predefined
+ */
+ public boolean isPreDefined() {
+ return getAlbum() != null && getAlbum().isPreDefined();
}
// ********************** Accessor Methods ********************** //
@@ -189,415 +193,352 @@
this.showMetaInfo = showMetaInfo;
}
- /**
- * Getter for property id
- *
- * @return id of image
- */
- public Long getId() {
- return id;
- }
+ public Long getId() {
+ return id;
+ }
- /**
- * Getter for property name
- *
- * @return name of image
- */
- public String getName() {
- return name;
- }
+ public String getName() {
+ return name;
+ }
- /**
- * Setter for property name
- *
- * @param name - name of image
- */
- public void setName(String name) {
- this.name = name;
- }
+ public void setName(String name) {
+ this.name = name;
+ }
- /**
- * Getter for property description
- *
- * @return description of image
- */
- public String getDescription() {
- return description;
- }
+ public String getDescription() {
+ return description;
+ }
- /**
- * Setter for property description
- *
- * @param description - description of image
- */
- public void setDescription(String description) {
- this.description = description;
- }
+ public void setDescription(String description) {
+ this.description = description;
+ }
- /**
- * Getter for property path.
- * Represent file-system structure, relative at uploadRoot dir(determined at startup, by default is system temp dir)
- * Usually is user.GetLogin() + SLASH + image.getAlbum().getId() + SLASH + fileName,
- * for example "amarkhel/15/coolPicture.jpg"
- *
- * @return relative path of image
- */
- public String getPath() {
- return path;
- }
+ /**
+ * Getter for property path.
+ * Represent file-system structure, relative at uploadRoot dir(determined at startup, by default is system temp dir)
+ * Usually is user.GetLogin() + SLASH + image.getAlbum().getId() + SLASH + fileName,
+ * for example "amarkhel/15/coolPicture.jpg"
+ *
+ * @return relative path of image
+ */
+ public String getPath() {
+ return path;
+ }
- /**
- * Setter for property path
- *
- * @param path - relative path to image
- */
- public void setPath(String path) {
- this.path = path;
- }
+ /**
+ * Setter for property path
+ *
+ * @param path - relative path to image
+ */
+ public void setPath(String path) {
+ this.path = path;
+ }
- /**
- * Getter for property created
- *
- * @return date of creation of this image
- */
- public Date getCreated() {
- return created;
- }
+ public Date getCreated() {
+ return created;
+ }
- /**
- * Setter for property created
- *
- * @param created - date of creation
- */
- public void setCreated(Date created) {
- this.created = created;
- }
+ public void setCreated(Date created) {
+ this.created = created;
+ }
- /**
- * Getter for property album
- *
- * @return containing album
- */
- public Album getAlbum() {
- return album;
- }
+ /**
+ * Getter for property album
+ *
+ * @return containing album
+ */
+ public Album getAlbum() {
+ return album;
+ }
- /**
- * Setter for property album
- *
- * @param album - album, that will contain this image
- */
- public void setAlbum(Album album) {
- this.album = album;
- }
+ /**
+ * Setter for property album
+ *
+ * @param album - album, that will contain this image
+ */
+ public void setAlbum(Album album) {
+ this.album = album;
+ }
- /**
- * Getter for property comments
- *
- * @return collection of comments, belongs to that image
- */
- public List<Comment> getComments() {
- return comments;
- }
+ /**
+ * Getter for property comments
+ *
+ * @return collection of comments, belongs to that image
+ */
+ public List<Comment> getComments() {
+ return comments;
+ }
- /**
- * Getter for property imageTags
- *
- * @return collection of MetaTags, associated to that image
- */
- public List<MetaTag> getImageTags() {
- return imageTags;
- }
+ /**
+ * Getter for property imageTags
+ *
+ * @return collection of MetaTags, associated to that image
+ */
+ public List<MetaTag> getImageTags() {
+ return imageTags;
+ }
- /**
- * Setter for property meta
- *
- * @param meta - string representation of metatags, associated to image. Used at jsf page.
- */
- public void setMeta(String meta) {
- this.meta = meta;
- }
+ /**
+ * Setter for property meta
+ *
+ * @param meta - string representation of metatags, associated to image. Used at jsf page.
+ */
+ public void setMeta(String meta) {
+ this.meta = meta;
+ }
- /**
- * Getter for property meta
- *
- * @return string representation of metatags, associated to image. Used at jsf page.
- */
- public String getMetaString(){
- return meta;
- }
-
- /**
- * Getter for property cameraModel
- *
- * @return model of camera
- */
- public String getCameraModel() {
- return cameraModel;
- }
+ /**
+ * Getter for property meta
+ *
+ * @return string representation of metatags, associated to image. Used at jsf page.
+ */
+ public String getMetaString() {
+ return meta;
+ }
- /**
- * setter for property cameraModel
- *
- * @param cameraModel- model of camera
- */
- public void setCameraModel(String cameraModel) {
- this.cameraModel = cameraModel;
- }
+ public String getCameraModel() {
+ return cameraModel;
+ }
- /**
- * Getter for property height
- *
- * @return height of image
- */
- public int getHeight() {
- return height;
- }
+ public void setCameraModel(String cameraModel) {
+ this.cameraModel = cameraModel;
+ }
- /**
- * setter for property height
- *
- * @param height - height of image
- */
- public void setHeight(int height) {
- this.height = height;
- }
+ public int getHeight() {
+ return height;
+ }
- /**
- * Getter for property size
- *
- * @return size of image in KB
- */
- public double getSize() {
- return size;
- }
+ public void setHeight(int height) {
+ this.height = height;
+ }
- /**
- * setter for property size
- *
- * @param size - size of image in KB
- */
- public void setSize(double size) {
- this.size = size;
- }
+ /**
+ * Getter for property size
+ *
+ * @return size of image in KB
+ */
+ public double getSize() {
+ return size;
+ }
- /**
- * Getter for property width
- *
- * @return width of image
- */
- public int getWidth() {
- return width;
- }
+ /**
+ * setter for property size
+ *
+ * @param size - size of image in KB
+ */
+ public void setSize(double size) {
+ this.size = size;
+ }
- /**
- * setter for property width
- *
- * @param width - width of image
- */
- public void setWidth(int width) {
- this.width = width;
- }
+ public int getWidth() {
+ return width;
+ }
- /**
- * Getter for property uploaded
- *
- * @return date of upload to site of this image
- */
- public Date getUploaded() {
- return uploaded;
- }
+ public void setWidth(int width) {
+ this.width = width;
+ }
- /**
- * setter for property uploaded
- *
- * @param uploaded - date of upload
- */
- public void setUploaded(Date uploaded) {
- this.uploaded = uploaded;
- }
-
- /**
- * Getter for property allowComments. If true, other user may comment this image.
- *
- * @return is other users may comment this image
- */
- public boolean isAllowComments() {
- return allowComments;
- }
+ /**
+ * Getter for property uploaded
+ *
+ * @return date of upload to site of this image
+ */
+ public Date getUploaded() {
+ return uploaded;
+ }
- /**
- * @param allowComments the allowComments to set
- */
- public void setAllowComments(boolean allowComments) {
- this.allowComments = allowComments;
- }
+ /**
+ * setter for property uploaded
+ *
+ * @param uploaded - date of upload
+ */
+ public void setUploaded(Date uploaded) {
+ this.uploaded = uploaded;
+ }
- /**
- *
- * @return if this image is covering for containing album
- */
- public boolean isCovering() {
- return covering;
- }
+ /**
+ * Getter for property allowComments. If true, other user may comment this image.
+ *
+ * @return is other users may comment this image
+ */
+ public boolean isAllowComments() {
+ return allowComments;
+ }
- /**
- *
- * @param covering - determine if this image is covering for containing album
- */
- public void setCovering(boolean covering) {
- this.covering = covering;
- }
-
- /**
- * Getter for property visited
- *
- * @return boolean value, that indicated is user visit this image already
- */
- public boolean isVisited() {
+ /**
+ * @param allowComments the allowComments to set
+ */
+ public void setAllowComments(boolean allowComments) {
+ this.allowComments = allowComments;
+ }
+
+ /**
+ * @return if this image is covering for containing album
+ */
+ public boolean isCovering() {
+ return covering;
+ }
+
+ /**
+ * @param covering - determine if this image is covering for containing album
+ */
+ public void setCovering(boolean covering) {
+ this.covering = covering;
+ }
+
+ /**
+ * Getter for property visited
+ *
+ * @return boolean value, that indicated is user visit this image already
+ */
+ public boolean isVisited() {
return visited;
}
- /**
- * Setter for property visited
- *
- * @param visited - boolean value, that indicated is user visit this image already
- */
+ /**
+ * Setter for property visited
+ *
+ * @param visited - boolean value, that indicated is user visit this image already
+ */
public void setVisited(boolean visited) {
this.visited = visited;
}
-
+
/**
- * Determine if this image should be marked as new(on jsf page, for example in tree)
- *
- * @return boolean value, that indicated is this image should be marked as new
- */
- public boolean isNew(){
- if(!visited){
+ * Determine if this image should be marked as new(on jsf page, for example in tree)
+ *
+ * @return boolean value, that indicated is this image should be marked as new
+ */
+ public boolean isNew() {
+ if (!visited) {
return this.getUploaded().after(ActionTools.getRecentlyDate());
}
return false;
}
-
- //---------------------------Business methods
- /**
- * Add comment to this image.
- *
- * @param comment - comment to add
- */
- public void addComment(Comment comment) {
- if (comment == null) {
- throw new IllegalArgumentException("Null comment!");
- }
- comment.setImage(this);
- comments.add(comment);
- }
+ //---------------------------Business methods
- /**
- * Remove comment from list of comments, belongs to that image.
- *
- * @param comment - comment to delete
- */
- public void removeComment(Comment comment) {
- if (comment == null) {
- throw new IllegalArgumentException("Null comment");
- }
- if(comment.getImage().equals(this)){
- comment.setImage(null);
- comments.remove(comment);
- }else{
- throw new IllegalArgumentException("Comment not belongs to this image");
- }
- }
+ /**
+ * Add comment to this image.
+ *
+ * @param comment - comment to add
+ */
+ public void addComment(Comment comment) {
+ if (comment == null) {
+ throw new IllegalArgumentException("Null comment!");
+ }
+ comment.setImage(this);
+ comments.add(comment);
+ }
- /**
- * Add metatag to this image.
- *
- * @param metatag - metatag to add
- */
- public void addMetaTag(MetaTag metatag) {
- if (metatag == null) {
- throw new IllegalArgumentException("Null metatag!");
- }
- if (!imageTags.contains(metatag)) {
- metatag.addImage(this);
- imageTags.add(metatag);
- }
- }
+ /**
+ * Remove comment from list of comments, belongs to that image.
+ *
+ * @param comment - comment to delete
+ */
+ public void removeComment(Comment comment) {
+ if (comment == null) {
+ throw new IllegalArgumentException("Null comment");
+ }
+ if (comment.getImage().equals(this)) {
+ comment.setImage(null);
+ comments.remove(comment);
+ } else {
+ throw new IllegalArgumentException("Comment not belongs to this image");
+ }
+ }
- /**
- * Remove metatag from list of metatag, associated to that image.
- *
- * @param metatag - metatag to delete
- */
- public void removeMetaTag(MetaTag metatag) {
- if (metatag == null) {
- throw new IllegalArgumentException("Null metatag!");
- }
- if (imageTags.contains(metatag)) {
- metatag.removeImage(this);
- imageTags.remove(metatag);
- }
- }
+ /**
+ * Add metatag to this image.
+ *
+ * @param metatag - metatag to add
+ */
+ public void addMetaTag(MetaTag metatag) {
+ if (metatag == null) {
+ throw new IllegalArgumentException("Null metatag!");
+ }
+ if (!imageTags.contains(metatag)) {
+ metatag.addImage(this);
+ imageTags.add(metatag);
+ }
+ }
- /**
- * Return MetaTag object by string representation
- *
- * @param s - string representation of metatag
- */
- public MetaTag getTagByName(String s) {
- for (MetaTag t : imageTags) {
- if (t.getTag().equals(s)) {
- return t;
- }
- }
- return null;
- }
+ /**
+ * Remove metatag from list of metatag, associated to that image.
+ *
+ * @param metatag - metatag to delete
+ */
+ public void removeMetaTag(MetaTag metatag) {
+ if (metatag == null) {
+ throw new IllegalArgumentException("Null metatag!");
+ }
+ if (imageTags.contains(metatag)) {
+ metatag.removeImage(this);
+ imageTags.remove(metatag);
+ }
+ }
- /**
- * Return Comma separated tag value for presentation in view
- *
- */
- public String getMeta() {
- final StringBuilder s = new StringBuilder();
- for (MetaTag tag : this.imageTags) {
- s.append(tag.getTag()).append(", ");
- }
- //Remove ',' from end
+ /**
+ * Return MetaTag object by string representation
+ *
+ * @param s - string representation of metatag
+ */
+ public MetaTag getTagByName(String s) {
+ for (MetaTag t : imageTags) {
+ if (t.getTag().equals(s)) {
+ return t;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Return Comma separated tag value for presentation in view
+ */
+ public String getMeta() {
+ final StringBuilder s = new StringBuilder();
+ for (MetaTag tag : this.imageTags) {
+ s.append(tag.getTag()).append(", ");
+ }
+ //Remove ',' from end
if (s.length() >= 2) {
s.delete(s.length() - 2, s.length());
}
return s.toString();
- }
-
- /**
- * Return relative path of this image in file-system(relative to uploadRoot parameter)
- *
- */
- public String getFullPath(){
- if(getAlbum() != null && getAlbum().getOwner() != null && getAlbum().getPath() != null){
+ }
+
+ /**
+ * Return relative path of this image in file-system(relative to uploadRoot parameter)
+ */
+ public String getFullPath() {
+ if (getAlbum() != null
+ && getAlbum().getOwner() != null
+ && getAlbum().getPath() != null) {
return getAlbum().getPath() + this.path;
}
return null;
}
-
- public boolean equals(Object o) {
- if (this == o) return true;
- if (o == null || getClass() != o.getClass()) return false;
- Image image = (Image) o;
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
- if (id != null ? !id.equals(image.id) : image.id != null) return false;
- if (path != null ? !path.equals(image.path) : image.path != null) return false;
+ if (obj == null || getClass() != obj.getClass()) {
+ return false;
+ }
- return true;
- }
+ final Image image = (Image) obj;
- public int hashCode() {
- int result;
- result = (id != null ? id.hashCode() : 0);
- result = 31 * result + (path != null ? path.hashCode() : 0);
- return result;
- }
+ return (id == null ? image.getId() == null : id.equals(image.getId()))
+ && (path == null ? image.getPath() == null : path.equals(image.getPath()));
+ }
+
+ @Override
+ public int hashCode() {
+ int result = id != null ? id.hashCode() : 0;
+ result = 31 * result + (path != null ? path.hashCode() : 0);
+ return result;
+ }
}
15 years, 8 months
JBoss Rich Faces SVN: r13752 - in trunk/examples/photoalbum: web/src/main/webapp/includes/album and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2009-04-22 04:37:54 -0400 (Wed, 22 Apr 2009)
New Revision: 13752
Modified:
trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/Album.java
trunk/examples/photoalbum/web/src/main/webapp/includes/album/albumEditInfo.xhtml
trunk/examples/photoalbum/web/src/main/webapp/includes/image/imageEditInfo.xhtml
trunk/examples/photoalbum/web/src/main/webapp/includes/shelf/shelfEditInfo.xhtml
Log:
realworld/shelfs, albums: Validation message doesn't appear in case incorrect data in calendar input field
https://jira.jboss.org/jira/browse/RF-6849
Modified: trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/Album.java
===================================================================
--- trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/Album.java 2009-04-22 00:56:37 UTC (rev 13751)
+++ trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/Album.java 2009-04-22 08:37:54 UTC (rev 13752)
@@ -43,6 +43,9 @@
import org.hibernate.validator.Length;
import org.hibernate.validator.NotEmpty;
import org.hibernate.validator.NotNull;
+import org.hibernate.annotations.Fetch;
+import org.hibernate.annotations.FetchMode;
+import org.hibernate.annotations.ForeignKey;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.AutoCreate;
import org.jboss.seam.annotations.Name;
@@ -77,13 +80,13 @@
private String description;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "album")
- @org.hibernate.annotations.Fetch(org.hibernate.annotations.FetchMode.SUBSELECT)
+ @Fetch(FetchMode.SUBSELECT)
private List<Image> images = new ArrayList<Image>();
@NotNull
@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinColumn(name = "SHELF_ID", nullable = false)
- @org.hibernate.annotations.ForeignKey(name = "FK_SHELF_ID")
+ @ForeignKey(name = "FK_SHELF_ID")
private Shelf shelf;
@Temporal(TemporalType.TIMESTAMP)
Modified: trunk/examples/photoalbum/web/src/main/webapp/includes/album/albumEditInfo.xhtml
===================================================================
(Binary files differ)
Modified: trunk/examples/photoalbum/web/src/main/webapp/includes/image/imageEditInfo.xhtml
===================================================================
(Binary files differ)
Modified: trunk/examples/photoalbum/web/src/main/webapp/includes/shelf/shelfEditInfo.xhtml
===================================================================
--- trunk/examples/photoalbum/web/src/main/webapp/includes/shelf/shelfEditInfo.xhtml 2009-04-22 00:56:37 UTC (rev 13751)
+++ trunk/examples/photoalbum/web/src/main/webapp/includes/shelf/shelfEditInfo.xhtml 2009-04-22 08:37:54 UTC (rev 13752)
@@ -12,44 +12,65 @@
#{messages['shelf_name']}
</td>
<td valign="top" colspan="2">
- <h:inputText value="#{model.selectedShelf.name}" styleClass="shelf-edit-input" />
+ <h:inputText id="shelf_name"
+ value="#{model.selectedShelf.name}"
+ styleClass="shelf-edit-input"
+ required="true"/>
</td>
</tr>
<tr>
+ <td style="padding:0; margin:0;" />
+ <td style="padding:0; margin:0;" ><rich:message for="shelf_name" /></td>
+ </tr>
+ <tr>
<td valign="top" nowrap="true" style="padding-top : 8px">
#{messages['creation_date']}
</td>
<td valign="top">
<a4j:outputPanel id="calendar" layout="block">
- <rich:calendar styleClass="shelf-edit-calendar" enableManualInput="true" value="#{model.selectedShelf.created}"
- cellWidth="24px" cellHeight="22px">
+ <rich:calendar id="shelf_date"
+ styleClass="shelf-edit-calendar"
+ enableManualInput="true"
+ value="#{model.selectedShelf.created}"
+ cellWidth="24px"
+ cellHeight="22px">
+ <rich:ajaxValidator event="onchange"/>
</rich:calendar>
</a4j:outputPanel>
<rich:message for="calendar" />
</td>
</tr>
<tr>
+ <td style="padding:0; margin:0;" />
+ <td style="padding:0; margin:0;" ><rich:message for="shelf_date" /></td>
+ </tr>
+ <tr>
<td valign="top" nowrap="true" style="padding-top : 8px">
#{messages['description']}
</td>
<td valign="top" colspan="2">
- <h:inputTextarea value="#{model.selectedShelf.description}" styleClass="shelf-edit-area" />
+ <h:inputTextarea id="shelf_description"
+ value="#{model.selectedShelf.description}"
+ styleClass="shelf-edit-area" />
</td>
</tr>
<tr>
+ <td style="padding:0; margin:0;" />
+ <td style="padding:0; margin:0;" ><rich:message for="shelf_description" /></td>
+ </tr>
+ <tr>
<td valign="top" nowrap="true" style="padding-top : 8px">
<h:outputText value="#{messages['album.shared']}" />
</td>
<td valign="top">
<h:selectBooleanCheckbox styleClass="selectBooleanCheckbox"
- id="shared" value="#{model.selectedShelf.shared}"/>
+ id="shared"
+ value="#{model.selectedShelf.shared}"/>
<rich:message for="shared" />
</td>
</tr>
<tr>
<td valign="top">
-
-
</td>
<td valign="top" align="right" colspan="2" style="padding : 10px;">
<richx:commandButton id="saveButton" style="float: left" value="#{messages['save']}" actionListener="#{shelfManager.editShelf(model.selectedShelf)}" reRender="mainArea" />
15 years, 8 months
JBoss Rich Faces SVN: r13751 - in trunk: samples/layout-sample/src/main/webapp/pages and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2009-04-21 20:56:37 -0400 (Tue, 21 Apr 2009)
New Revision: 13751
Added:
trunk/samples/themes/src/main/config/component/oldschool.xml
trunk/samples/themes/src/main/config/component/smooth.xml
trunk/samples/themes/src/main/java/org/richfaces/theme/images/BaseShadowGradient.java
trunk/samples/themes/src/main/java/org/richfaces/theme/images/ShadowHeaderLeft.java
trunk/samples/themes/src/main/java/org/richfaces/theme/images/ShadowHeaderRight.java
trunk/samples/themes/src/main/resources/META-INF/themes/oldschool.theme.properties
trunk/samples/themes/src/main/resources/META-INF/themes/smooth.theme.properties
trunk/samples/themes/src/main/resources/org/richfaces/renderkit/html/css/oldschool.xcss
trunk/samples/themes/src/main/resources/org/richfaces/renderkit/html/css/smooth.xcss
trunk/samples/themes/src/main/templates/org/richfaces/oldschool.jspx
trunk/samples/themes/src/main/templates/org/richfaces/smooth.jspx
Removed:
trunk/samples/themes/src/main/config/component/theme1.xml
trunk/samples/themes/src/main/config/component/theme2.xml
trunk/samples/themes/src/main/resources/META-INF/themes/theme1.theme.properties
trunk/samples/themes/src/main/resources/META-INF/themes/theme2.theme.properties
trunk/samples/themes/src/main/resources/org/richfaces/renderkit/html/css/theme1.xcss
trunk/samples/themes/src/main/resources/org/richfaces/renderkit/html/css/theme2.xcss
trunk/samples/themes/src/main/templates/org/richfaces/theme1.jspx
trunk/samples/themes/src/main/templates/org/richfaces/theme2.jspx
Modified:
trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/BaseGradient.java
trunk/samples/layout-sample/src/main/webapp/pages/index.xhtml
trunk/samples/themes/src/main/java/org/richfaces/theme/images/ShadowHeaderBackground.java
Log:
Rounded backgroung images.
Themes 1&2 was renamed to 'smooth' and 'oldschool'
Modified: trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/BaseGradient.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/BaseGradient.java 2009-04-21 23:57:19 UTC (rev 13750)
+++ trunk/framework/impl/src/main/java/org/richfaces/renderkit/html/BaseGradient.java 2009-04-22 00:56:37 UTC (rev 13751)
@@ -25,6 +25,7 @@
import java.awt.GradientPaint;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
+import java.awt.Shape;
import java.awt.geom.AffineTransform;
import java.awt.geom.Rectangle2D;
import java.io.Serializable;
@@ -150,11 +151,11 @@
return horizontal;
}
- protected void drawGradient(Graphics2D g2d, Rectangle2D rectangle, BiColor colors, int height) {
+ protected void drawGradient(Graphics2D g2d, Shape shape, BiColor colors, int height) {
if (colors != null) {
GradientPaint gragient = new GradientPaint(0, 0, colors.getTopColor(), 0, height, colors.getBottomColor());
g2d.setPaint(gragient);
- g2d.fill(rectangle);
+ g2d.fill(shape);
}
}
Modified: trunk/samples/layout-sample/src/main/webapp/pages/index.xhtml
===================================================================
(Binary files differ)
Copied: trunk/samples/themes/src/main/config/component/oldschool.xml (from rev 13743, trunk/samples/themes/src/main/config/component/theme2.xml)
===================================================================
--- trunk/samples/themes/src/main/config/component/oldschool.xml (rev 0)
+++ trunk/samples/themes/src/main/config/component/oldschool.xml 2009-04-22 00:56:37 UTC (rev 13751)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE components PUBLIC "-//AJAX4JSF//CDK Generator config/EN" "http://labs.jboss.com/jbossrichfaces/component-config.dtd">
+
+<components>
+ <renderer generate="true" override="true">
+ <name>org.richfaces.OldSchoolThemeRenderer</name>
+ <family>org.richfaces.Page</family>
+ <template>org/richfaces/oldschool.jspx</template>
+ </renderer>
+</components>
\ No newline at end of file
Property changes on: trunk/samples/themes/src/main/config/component/oldschool.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/samples/themes/src/main/config/component/smooth.xml (from rev 13743, trunk/samples/themes/src/main/config/component/theme1.xml)
===================================================================
--- trunk/samples/themes/src/main/config/component/smooth.xml (rev 0)
+++ trunk/samples/themes/src/main/config/component/smooth.xml 2009-04-22 00:56:37 UTC (rev 13751)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE components PUBLIC "-//AJAX4JSF//CDK Generator config/EN" "http://labs.jboss.com/jbossrichfaces/component-config.dtd">
+
+<components>
+ <renderer generate="true" override="true">
+ <name>org.richfaces.SmoothThemeRenderer</name>
+ <family>org.richfaces.Page</family>
+ <template>org/richfaces/smooth.jspx</template>
+ </renderer>
+</components>
\ No newline at end of file
Property changes on: trunk/samples/themes/src/main/config/component/smooth.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: trunk/samples/themes/src/main/config/component/theme1.xml
===================================================================
--- trunk/samples/themes/src/main/config/component/theme1.xml 2009-04-21 23:57:19 UTC (rev 13750)
+++ trunk/samples/themes/src/main/config/component/theme1.xml 2009-04-22 00:56:37 UTC (rev 13751)
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE components PUBLIC "-//AJAX4JSF//CDK Generator config/EN" "http://labs.jboss.com/jbossrichfaces/component-config.dtd">
-
-<components>
- <renderer generate="true" override="true">
- <name>org.richfaces.Theme1Renderer</name>
- <family>org.richfaces.Page</family>
- <template>org/richfaces/theme1.jspx</template>
- </renderer>
-</components>
\ No newline at end of file
Deleted: trunk/samples/themes/src/main/config/component/theme2.xml
===================================================================
--- trunk/samples/themes/src/main/config/component/theme2.xml 2009-04-21 23:57:19 UTC (rev 13750)
+++ trunk/samples/themes/src/main/config/component/theme2.xml 2009-04-22 00:56:37 UTC (rev 13751)
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE components PUBLIC "-//AJAX4JSF//CDK Generator config/EN" "http://labs.jboss.com/jbossrichfaces/component-config.dtd">
-
-<components>
- <renderer generate="true" override="true">
- <name>org.richfaces.Theme2Renderer</name>
- <family>org.richfaces.Page</family>
- <template>org/richfaces/theme2.jspx</template>
- </renderer>
-</components>
\ No newline at end of file
Added: trunk/samples/themes/src/main/java/org/richfaces/theme/images/BaseShadowGradient.java
===================================================================
--- trunk/samples/themes/src/main/java/org/richfaces/theme/images/BaseShadowGradient.java (rev 0)
+++ trunk/samples/themes/src/main/java/org/richfaces/theme/images/BaseShadowGradient.java 2009-04-22 00:56:37 UTC (rev 13751)
@@ -0,0 +1,120 @@
+package org.richfaces.theme.images;
+
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.util.Zipper2;
+import org.richfaces.renderkit.html.BaseGradient;
+
+public abstract class BaseShadowGradient extends BaseGradient {
+
+ @SuppressWarnings("serial")
+ protected static class ShadowData extends BaseGradient.Data {
+
+ private Integer shadowColor;
+
+ /**
+ * @return the shadowColor
+ */
+ protected Integer getShadowColor() {
+ return shadowColor;
+ }
+
+ /**
+ * @param shadowColor the shadowColor to set
+ */
+ protected void setShadowColor(Integer shadowColor) {
+ this.shadowColor = shadowColor;
+ }
+
+ @Override
+ public byte[] toByteArray() {
+ byte[] bs = super.toByteArray();
+ byte[] result = new byte[(bs != null ? bs.length : 0) + 4];
+ new Zipper2(result).addInt(shadowColor).addBytes(bs);
+
+ return result;
+ }
+
+ }
+
+ public BaseShadowGradient(int width, int height, int gradientHeight,
+ String baseColor, String gradientColor, boolean horizontal) {
+ super(width, height, gradientHeight, baseColor, gradientColor,
+ horizontal);
+ }
+
+ public BaseShadowGradient(int width, int height, int gradientHeight) {
+ super(width, height, gradientHeight);
+ }
+
+ public BaseShadowGradient(int width, int height, int gradientHeight,
+ String baseColor, String gradientColor) {
+ super(width, height, gradientHeight, baseColor, gradientColor);
+ }
+
+ public BaseShadowGradient(int width, int height) {
+ super(width, height);
+ }
+
+ public BaseShadowGradient(int width, int height, String baseColor,
+ String gradientColor) {
+ super(width, height, baseColor, gradientColor);
+ }
+
+ public BaseShadowGradient() {
+ super();
+ }
+
+ public BaseShadowGradient(String baseColor, String gradientColor) {
+ super(baseColor, gradientColor);
+ }
+
+ public BaseShadowGradient(int width, int height, int gradientHeight,
+ boolean horizontal) {
+ super(width, height, gradientHeight, horizontal);
+ }
+
+ public BaseShadowGradient(int width, int height, boolean horizontal) {
+ super(width, height, horizontal);
+ }
+
+ public BaseShadowGradient(int width, int height, String baseColor,
+ String gradientColor, boolean horizontal) {
+ super(width, height, baseColor, gradientColor, horizontal);
+ }
+
+ public BaseShadowGradient(boolean horizontal) {
+ super(horizontal);
+ }
+
+ protected abstract String getShadowColor();
+
+ @Override
+ protected Data createData() {
+ return new ShadowData();
+ }
+
+ @Override
+ protected void saveData(FacesContext context, Data data, Object parameterData) {
+ super.saveData(context, data, parameterData);
+ ShadowData d = ((ShadowData) data);
+ d.setShadowColor(getShadowColor(context));
+ }
+
+ protected Integer getShadowColor(FacesContext context) {
+ return getColorValueParameter(context, getShadowColor(), false);
+ }
+
+ protected void restoreData(Data data, Zipper2 zipper2) {
+ if (zipper2.hasMore()) {
+ ((ShadowData) data).setShadowColor(zipper2.nextInt());
+ super.restoreData(data, zipper2);
+ }
+ }
+
+ public BaseShadowGradient(String baseColor, String gradientColor,
+ boolean horizontal) {
+ super(baseColor, gradientColor, horizontal);
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/samples/themes/src/main/java/org/richfaces/theme/images/BaseShadowGradient.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/samples/themes/src/main/java/org/richfaces/theme/images/ShadowHeaderBackground.java
===================================================================
--- trunk/samples/themes/src/main/java/org/richfaces/theme/images/ShadowHeaderBackground.java 2009-04-21 23:57:19 UTC (rev 13750)
+++ trunk/samples/themes/src/main/java/org/richfaces/theme/images/ShadowHeaderBackground.java 2009-04-22 00:56:37 UTC (rev 13751)
@@ -6,14 +6,15 @@
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
+import java.awt.geom.RoundRectangle2D;
-import org.richfaces.renderkit.html.BaseGradient;
+
/**
* @author asmirnov
*
*/
-public class ShadowHeaderBackground extends BaseGradient {
+public class ShadowHeaderBackground extends BaseShadowGradient {
public ShadowHeaderBackground() {
super(15, 95, 80,"headerGradientColor","headerBackgroundColor", false);
@@ -21,10 +22,10 @@
@Override
protected void paintGradient(Graphics2D g2d, Data data) {
+ Dimension dim = getDimensions(null, data);
// Paint gradient itself
super.paintGradient(g2d, data);
// Paint lower bar
- Dimension dim = getDimensions(null, data);
Integer headerBackgroundColor = data.getHeaderBackgroundColor();
if(headerBackgroundColor != null && dim.height > getGradientHeight() && getGradientHeight() >=0){
@@ -33,4 +34,9 @@
g2d.fillRect(0,getGradientHeight(),dim.width,dim.height);
}
}
+
+ @Override
+ protected String getShadowColor() {
+ return "shadowBackgroundColor";
+ }
}
Added: trunk/samples/themes/src/main/java/org/richfaces/theme/images/ShadowHeaderLeft.java
===================================================================
--- trunk/samples/themes/src/main/java/org/richfaces/theme/images/ShadowHeaderLeft.java (rev 0)
+++ trunk/samples/themes/src/main/java/org/richfaces/theme/images/ShadowHeaderLeft.java 2009-04-22 00:56:37 UTC (rev 13751)
@@ -0,0 +1,24 @@
+/**
+ *
+ */
+package org.richfaces.theme.images;
+
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+import java.awt.geom.RoundRectangle2D;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class ShadowHeaderLeft extends ShadowHeaderBackground {
+
+ @Override
+ protected void paintGradient(Graphics2D g2d, Data data) {
+ Dimension dim = getDimensions(null, data);
+ RoundRectangle2D clip = new RoundRectangle2D.Double(5,5,dim.width*2.0,dim.height*2.0,5,5);
+ g2d.setClip(clip);
+ super.paintGradient(g2d, data);
+ }
+
+}
Property changes on: trunk/samples/themes/src/main/java/org/richfaces/theme/images/ShadowHeaderLeft.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/samples/themes/src/main/java/org/richfaces/theme/images/ShadowHeaderRight.java
===================================================================
--- trunk/samples/themes/src/main/java/org/richfaces/theme/images/ShadowHeaderRight.java (rev 0)
+++ trunk/samples/themes/src/main/java/org/richfaces/theme/images/ShadowHeaderRight.java 2009-04-22 00:56:37 UTC (rev 13751)
@@ -0,0 +1,22 @@
+/**
+ *
+ */
+package org.richfaces.theme.images;
+
+import java.awt.Graphics2D;
+import java.awt.geom.AffineTransform;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class ShadowHeaderRight extends ShadowHeaderLeft {
+
+ @Override
+ protected void paintGradient(Graphics2D g2d, Data data) {
+ //x -> -x, y -> y
+ g2d.transform(new AffineTransform(-1, 0, 0, 1, 0, 0));
+ super.paintGradient(g2d, data);
+ }
+
+}
Property changes on: trunk/samples/themes/src/main/java/org/richfaces/theme/images/ShadowHeaderRight.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/samples/themes/src/main/resources/META-INF/themes/oldschool.theme.properties (from rev 13743, trunk/samples/themes/src/main/resources/META-INF/themes/theme2.theme.properties)
===================================================================
--- trunk/samples/themes/src/main/resources/META-INF/themes/oldschool.theme.properties (rev 0)
+++ trunk/samples/themes/src/main/resources/META-INF/themes/oldschool.theme.properties 2009-04-22 00:56:37 UTC (rev 13751)
@@ -0,0 +1,2 @@
+rendererType=org.richfaces.OldSchoolThemeRenderer
+styleSheet=resource\:///org/richfaces/renderkit/html/css/oldschool.xcss
Property changes on: trunk/samples/themes/src/main/resources/META-INF/themes/oldschool.theme.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/samples/themes/src/main/resources/META-INF/themes/smooth.theme.properties (from rev 13743, trunk/samples/themes/src/main/resources/META-INF/themes/theme1.theme.properties)
===================================================================
--- trunk/samples/themes/src/main/resources/META-INF/themes/smooth.theme.properties (rev 0)
+++ trunk/samples/themes/src/main/resources/META-INF/themes/smooth.theme.properties 2009-04-22 00:56:37 UTC (rev 13751)
@@ -0,0 +1,2 @@
+rendererType=org.richfaces.SmoothThemeRenderer
+styleSheet=resource\:///org/richfaces/renderkit/html/css/smooth.xcss
Property changes on: trunk/samples/themes/src/main/resources/META-INF/themes/smooth.theme.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: trunk/samples/themes/src/main/resources/META-INF/themes/theme1.theme.properties
===================================================================
--- trunk/samples/themes/src/main/resources/META-INF/themes/theme1.theme.properties 2009-04-21 23:57:19 UTC (rev 13750)
+++ trunk/samples/themes/src/main/resources/META-INF/themes/theme1.theme.properties 2009-04-22 00:56:37 UTC (rev 13751)
@@ -1,2 +0,0 @@
-rendererType=org.richfaces.Theme1Renderer
-styleSheet=resource:///org/richfaces/renderkit/html/css/theme1.xcss
Deleted: trunk/samples/themes/src/main/resources/META-INF/themes/theme2.theme.properties
===================================================================
--- trunk/samples/themes/src/main/resources/META-INF/themes/theme2.theme.properties 2009-04-21 23:57:19 UTC (rev 13750)
+++ trunk/samples/themes/src/main/resources/META-INF/themes/theme2.theme.properties 2009-04-22 00:56:37 UTC (rev 13751)
@@ -1,2 +0,0 @@
-rendererType=org.richfaces.Theme2Renderer
-styleSheet=resource:///org/richfaces/renderkit/html/css/theme2.xcss
Copied: trunk/samples/themes/src/main/resources/org/richfaces/renderkit/html/css/oldschool.xcss (from rev 13743, trunk/samples/themes/src/main/resources/org/richfaces/renderkit/html/css/theme2.xcss)
===================================================================
--- trunk/samples/themes/src/main/resources/org/richfaces/renderkit/html/css/oldschool.xcss (rev 0)
+++ trunk/samples/themes/src/main/resources/org/richfaces/renderkit/html/css/oldschool.xcss 2009-04-22 00:56:37 UTC (rev 13751)
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<f:template xmlns:f='http:/jsf.exadel.com/template'
+ xmlns:u='http:/jsf.exadel.com/template/util'
+ xmlns="http://www.w3.org/1999/xhtml">
+ <u:selector name="body">
+ <u:style name="background" skin="generalBackgroundColor"/>
+ <u:style name="margin" value="0px"/>
+ </u:selector>
+
+ <u:selector name=".header_bg">
+ <u:style name="background-image">
+ <!-- images/bg_header.png -->
+ <f:resource f:key="org.richfaces.theme.images.HeaderBackground"/>
+ </u:style>
+ <u:style name="border-bottom" value="1px solid" />
+ <u:style name="border-bottom-color" skin="generalBackgroundColor" />
+ <u:style name="background-color" skin="headerBackgroundColor"/>
+ <u:style name="background-repeat" value="repeat-x"/>
+ <u:style name="background-position" value="top left"/>
+ </u:selector>
+
+ <u:selector name=".footer_bg">
+ <u:style name="background-image">
+ <!-- images/bg_footer.png -->
+ <f:resource f:key="org.richfaces.theme.images.FooterBackground"/>
+ </u:style>
+ <u:style name="border-top" value="1px solid" />
+ <u:style name="border-top-color" skin="generalBackgroundColor" />
+ <u:style name="background-color" skin="panelBorderColor"/>
+ <u:style name="background-repeat" value="repeat-x"/>
+ <u:style name="background-position" value="center left"/>
+ </u:selector>
+
+ <u:selector name=".menu_col">
+ <u:style name="background" skin="generalBackgroundColor"/>
+ <u:style name="vertical-align" value="top"/>
+ <u:style name="border-top" value="2px solid" />
+ <u:style name="border-top-color" skin="panelBorderColor" />
+ <u:style name="border-right" value="2px solid" />
+ <u:style name="border-right-color" skin="panelBorderColor" />
+ <u:style name="border-bottom" value="2px solid" />
+ <u:style name="border-bottom-color" skin="panelBorderColor" />
+ </u:selector>
+
+ <u:selector name=".content_col">
+ <u:style name="background" skin="generalBackgroundColor"/>
+ <u:style name="vertical-align" value="top"/>
+ <u:style name="width" value="100%"/>
+ <u:style name="border-top" value="2px solid" />
+ <u:style name="border-top-color" skin="panelBorderColor" />
+ <u:style name="border-bottom" value="2px solid" />
+ <u:style name="border-bottom-color" skin="panelBorderColor" />
+ </u:selector>
+ <u:selector name="*.menu_col, *.content_col, *.footer_bg">
+ <u:style name="font-family" skin="generalFamilyFont" />
+ <u:style name="color" skin="generalTextColor" />
+ <u:style name="font-size" skin="generalSizeFont" />
+ </u:selector>
+ <u:selector name="*.header_content">
+ <u:style name="font-family" skin="headerFamilyFont" />
+ <u:style name="color" skin="headerTextColor" />
+ <u:style name="font-size" skin="headerSizeFont" />
+ </u:selector>
+ <f:verbatim>
+ <![CDATA[
+/*.menu_width{width : 300px;}*/
+
+
+.page_size {
+ width : 100%;
+ height : 100%;
+}
+
+
+.header_content {
+ margin : 0px 0px 0px 0px;
+ height : 95px; position : relative;
+}
+
+.spacer{font-size : 1px;}
+
+
+.footer_bg_content {
+ margin : 0px 0px 0px 0px;
+ height : 45px;
+ position : relative;
+}
+ ]]>
+ </f:verbatim>
+</f:template>
\ No newline at end of file
Copied: trunk/samples/themes/src/main/resources/org/richfaces/renderkit/html/css/smooth.xcss (from rev 13743, trunk/samples/themes/src/main/resources/org/richfaces/renderkit/html/css/theme1.xcss)
===================================================================
--- trunk/samples/themes/src/main/resources/org/richfaces/renderkit/html/css/smooth.xcss (rev 0)
+++ trunk/samples/themes/src/main/resources/org/richfaces/renderkit/html/css/smooth.xcss 2009-04-22 00:56:37 UTC (rev 13751)
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<f:template xmlns:f='http:/jsf.exadel.com/template'
+ xmlns:u='http:/jsf.exadel.com/template/util'
+ xmlns="http://www.w3.org/1999/xhtml">
+ <u:selector name="body">
+ <u:style name="background" skin="headerGradientColor"/>
+ <u:style name="margin" value="0px"/>
+ <u:style name="background-image">
+ <!-- images/bg_header.png -->
+ <f:resource f:key="org.richfaces.theme.images.PageBackground"/>
+ </u:style>
+ <u:style name="background-repeat" value="repeat-x"/>
+ <u:style name="background-position" value="top left"/>
+ </u:selector>
+ <u:selector name=".header_content">
+ <u:style name="background-image">
+ <!-- images/bg_header.png -->
+ <f:resource f:key="org.richfaces.theme.images.ShadowHeaderBackground"/>
+ </u:style>
+ <u:style name="margin" value="0px 10px 0px 10px" />
+ <u:style name="border-bottom-color" skin="generalBackgroundColor" />
+ <u:style name="background-color" skin="headerBackgroundColor"/>
+ <u:style name="background-repeat" value="repeat-x"/>
+ <u:style name="background-position" value="top left"/>
+ <u:style name="height" value="80px"/>
+ <u:style name="position" value="relative"/>
+ </u:selector>
+
+ <u:selector name=".header_bg_left">
+ <u:style name="background-image">
+ <!-- images/bg_header.png -->
+ <f:resource f:key="org.richfaces.theme.images.ShadowHeaderLeft"/>
+ </u:style>
+ <u:style name="background-repeat" value="no-repeat"/>
+ <u:style name="background-position" value="top left"/>
+ </u:selector>
+ <u:selector name=".header_bg_right">
+ <u:style name="background-image">
+ <!-- images/bg_header.png -->
+ <f:resource f:key="org.richfaces.theme.images.ShadowHeaderRight"/>
+ </u:style>
+ <u:style name="background-repeat" value="no-repeat"/>
+ <u:style name="background-position" value="top right"/>
+ <u:style name="height" value="80px"/>
+ </u:selector>
+
+ <u:selector name=".footer_bg">
+ <u:style name="background-image">
+ <!-- images/bg_footer.png -->
+ <f:resource f:key="org.richfaces.theme.images.FooterBackground"/>
+ </u:style>
+ <u:style name="border-top" value="1px solid" />
+ <u:style name="border-top-color" skin="generalBackgroundColor" />
+ <u:style name="background-color" skin="panelBorderColor"/>
+ <u:style name="background-repeat" value="repeat-x"/>
+ <u:style name="background-position" value="center left"/>
+ </u:selector>
+
+ <f:verbatim>
+ <![CDATA[
+.page_size{width : 90%;}
+.menu_width{width : 300px;}
+
+.common_box {margin : 0px; }
+.spacer{font-size : 1px;}
+.left_col {background : url(images/bg_left.png) top left no-repeat; vertical-align : top}
+.left_strut {background : url(images/bg_left_strut.png) top left no-repeat; height : 389px; width : 14px}
+.bg_tabbody {background : #c0c0c0}
+
+.menu_col {border-right : 2px solid #C0C0C0; vertical-align : top; background : #FFFFFF;}
+.content_col {vertical-align : top; width : 100%; background : #FFFFFF;}
+
+.right_col {background : url(images/bg_right.png) top right no-repeat; vertical-align : top}
+.right_strut {background : url(images/bg_right_strut.png) top right no-repeat; height : 389px; width : 14px}
+.footer_bg_left {background : url(images/bg_footer_left.png) top left no-repeat;}
+.footer_bg_right {background : url(images/bg_footer_right.png) top right no-repeat; height : 72px;}
+.footer_bg_content {margin : 0px 10px 0px 10px; height : 53px; position : relative;}
+ ]]>
+ </f:verbatim>
+</f:template>
\ No newline at end of file
Deleted: trunk/samples/themes/src/main/resources/org/richfaces/renderkit/html/css/theme1.xcss
===================================================================
--- trunk/samples/themes/src/main/resources/org/richfaces/renderkit/html/css/theme1.xcss 2009-04-21 23:57:19 UTC (rev 13750)
+++ trunk/samples/themes/src/main/resources/org/richfaces/renderkit/html/css/theme1.xcss 2009-04-22 00:56:37 UTC (rev 13751)
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<f:template xmlns:f='http:/jsf.exadel.com/template'
- xmlns:u='http:/jsf.exadel.com/template/util'
- xmlns="http://www.w3.org/1999/xhtml">
- <u:selector name="body">
- <u:style name="background" skin="headerGradientColor"/>
- <u:style name="margin" value="0px"/>
- <u:style name="background-image">
- <!-- images/bg_header.png -->
- <f:resource f:key="org.richfaces.theme.images.PageBackground"/>
- </u:style>
- <u:style name="background-repeat" value="repeat-x"/>
- <u:style name="background-position" value="top left"/>
- </u:selector>
- <u:selector name=".header_content">
- <u:style name="background-image">
- <!-- images/bg_header.png -->
- <f:resource f:key="org.richfaces.theme.images.ShadowHeaderBackground"/>
- </u:style>
- <u:style name="margin" value="0px 10px 0px 10px" />
- <u:style name="border-bottom-color" skin="generalBackgroundColor" />
- <u:style name="background-color" skin="headerBackgroundColor"/>
- <u:style name="background-repeat" value="repeat-x"/>
- <u:style name="background-position" value="top left"/>
- </u:selector>
-
- <u:selector name=".footer_bg">
- <u:style name="background-image">
- <!-- images/bg_footer.png -->
- <f:resource f:key="org.richfaces.theme.images.FooterBackground"/>
- </u:style>
- <u:style name="border-top" value="1px solid" />
- <u:style name="border-top-color" skin="generalBackgroundColor" />
- <u:style name="background-color" skin="panelBorderColor"/>
- <u:style name="background-repeat" value="repeat-x"/>
- <u:style name="background-position" value="center left"/>
- </u:selector>
-
- <f:verbatim>
- <![CDATA[
-.page_size{width : 90%;}
-.menu_width{width : 300px;}
-
-.common_box {margin : 0px; }
-.header_bg_left {background : url(images/bg_header_left.png) top left no-repeat;}
-.header_bg_right {background : url(images/bg_header_right.png) top right no-repeat; height : 105px;}
-.header_content {margin : 0px 10px 0px 10px; height : 80px; position : relative;}
-.spacer{font-size : 1px;}
-.left_col {background : url(images/bg_left.png) top left no-repeat; vertical-align : top}
-.left_strut {background : url(images/bg_left_strut.png) top left no-repeat; height : 389px; width : 14px}
-.bg_tabbody {background : #c0c0c0}
-
-.menu_col {border-right : 2px solid #C0C0C0; vertical-align : top; background : #FFFFFF;}
-.content_col {vertical-align : top; width : 100%; background : #FFFFFF;}
-
-.right_col {background : url(images/bg_right.png) top right no-repeat; vertical-align : top}
-.right_strut {background : url(images/bg_right_strut.png) top right no-repeat; height : 389px; width : 14px}
-.footer_bg_left {background : url(images/bg_footer_left.png) top left no-repeat;}
-.footer_bg_right {background : url(images/bg_footer_right.png) top right no-repeat; height : 72px;}
-.footer_bg_content {margin : 0px 10px 0px 10px; height : 53px; position : relative;}
- ]]>
- </f:verbatim>
-</f:template>
\ No newline at end of file
Deleted: trunk/samples/themes/src/main/resources/org/richfaces/renderkit/html/css/theme2.xcss
===================================================================
--- trunk/samples/themes/src/main/resources/org/richfaces/renderkit/html/css/theme2.xcss 2009-04-21 23:57:19 UTC (rev 13750)
+++ trunk/samples/themes/src/main/resources/org/richfaces/renderkit/html/css/theme2.xcss 2009-04-22 00:56:37 UTC (rev 13751)
@@ -1,91 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<f:template xmlns:f='http:/jsf.exadel.com/template'
- xmlns:u='http:/jsf.exadel.com/template/util'
- xmlns="http://www.w3.org/1999/xhtml">
- <u:selector name="body">
- <u:style name="background" skin="generalBackgroundColor"/>
- <u:style name="margin" value="0px"/>
- </u:selector>
-
- <u:selector name=".header_bg">
- <u:style name="background-image">
- <!-- images/bg_header.png -->
- <f:resource f:key="org.richfaces.theme.images.HeaderBackground"/>
- </u:style>
- <u:style name="border-bottom" value="1px solid" />
- <u:style name="border-bottom-color" skin="generalBackgroundColor" />
- <u:style name="background-color" skin="headerBackgroundColor"/>
- <u:style name="background-repeat" value="repeat-x"/>
- <u:style name="background-position" value="top left"/>
- </u:selector>
-
- <u:selector name=".footer_bg">
- <u:style name="background-image">
- <!-- images/bg_footer.png -->
- <f:resource f:key="org.richfaces.theme.images.FooterBackground"/>
- </u:style>
- <u:style name="border-top" value="1px solid" />
- <u:style name="border-top-color" skin="generalBackgroundColor" />
- <u:style name="background-color" skin="panelBorderColor"/>
- <u:style name="background-repeat" value="repeat-x"/>
- <u:style name="background-position" value="center left"/>
- </u:selector>
-
- <u:selector name=".menu_col">
- <u:style name="background" skin="generalBackgroundColor"/>
- <u:style name="vertical-align" value="top"/>
- <u:style name="border-top" value="2px solid" />
- <u:style name="border-top-color" skin="panelBorderColor" />
- <u:style name="border-right" value="2px solid" />
- <u:style name="border-right-color" skin="panelBorderColor" />
- <u:style name="border-bottom" value="2px solid" />
- <u:style name="border-bottom-color" skin="panelBorderColor" />
- </u:selector>
-
- <u:selector name=".content_col">
- <u:style name="background" skin="generalBackgroundColor"/>
- <u:style name="vertical-align" value="top"/>
- <u:style name="width" value="100%"/>
- <u:style name="border-top" value="2px solid" />
- <u:style name="border-top-color" skin="panelBorderColor" />
- <u:style name="border-bottom" value="2px solid" />
- <u:style name="border-bottom-color" skin="panelBorderColor" />
- </u:selector>
- <u:selector name="*.menu_col, *.content_col, *.footer_bg">
- <u:style name="font-family" skin="generalFamilyFont" />
- <u:style name="color" skin="generalTextColor" />
- <u:style name="font-size" skin="generalSizeFont" />
- </u:selector>
- <u:selector name="*.header_content">
- <u:style name="font-family" skin="headerFamilyFont" />
- <u:style name="color" skin="headerTextColor" />
- <u:style name="font-size" skin="headerSizeFont" />
- </u:selector>
- <f:verbatim>
- <![CDATA[
-/*.menu_width{width : 300px;}*/
-
-
-.page_size {
- width : 100%;
- height : 100%;
-}
-
-
-.header_content {
- margin : 0px 0px 0px 0px;
- height : 95px; position : relative;
-}
-
-.spacer{font-size : 1px;}
-
-
-.footer_bg_content {
- margin : 0px 0px 0px 0px;
- height : 45px;
- position : relative;
-}
- ]]>
- </f:verbatim>
-</f:template>
\ No newline at end of file
Copied: trunk/samples/themes/src/main/templates/org/richfaces/oldschool.jspx (from rev 13743, trunk/samples/themes/src/main/templates/org/richfaces/theme2.jspx)
===================================================================
--- trunk/samples/themes/src/main/templates/org/richfaces/oldschool.jspx (rev 0)
+++ trunk/samples/themes/src/main/templates/org/richfaces/oldschool.jspx 2009-04-22 00:56:37 UTC (rev 13751)
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<f:root
+ xmlns:f="http://ajax4jsf.org/cdk/template"
+ xmlns:jsp="http://java.sun.com/JSP/Page"
+ xmlns:c=" http://java.sun.com/jsf/core"
+ xmlns:ui=" http://ajax4jsf.org/cdk/ui"
+ xmlns:u=" http://ajax4jsf.org/cdk/u"
+ xmlns:x=" http://ajax4jsf.org/cdk/x"
+ xmlns:h="http://jsf.exadel.com/header"
+ xmlns:vcp="http://ajax4jsf.org/cdk/vcp"
+ class="org.richfaces.renderkit.html.OldSchoolThemeRenderer"
+ baseclass="org.richfaces.renderkit.AbstractPageRenderer"
+ component="org.richfaces.component.UIPage"
+ >
+ <c:set var="namespace" value="#{this:prolog(context,component)}"/>
+ <html x:xmlns="#{namespace}" x:lang="#{context.viewRoot.locale}">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8" />
+ <title>#{component.attributes['pageTitle']}</title>
+ <f:call name="themeStyle"/>
+ <f:call name="themeScript"/>
+ <style type="text/css">
+ <jsp:scriptlet><![CDATA[
+ Integer width = (Integer) component.getAttributes().get("width");
+ if (null != width && width.intValue() > 0) {
+ StringBuilder format = new StringBuilder(
+ ".rich-page{margin:auto;text-align:left;");
+ format.append("width:").append(width).append("px;");
+ writer.write(format.toString());
+ } else {
+ writer.write(".rich-page{width:100%;}\n");
+ }
+ ]]></jsp:scriptlet>
+ </style>
+ <u:insertFacet name="pageHeader"/>
+
+</head>
+<body x:passThruWithExclusions="value,name,type,id">
+ <table border="0" cellpadding="0" cellspacing="0" class="rich-page">
+ <tr>
+ <td class="header_bg">
+ <div class="header_content">
+<!-- begin header -->
+ <u:insertFacet name="header"/>
+<!-- end header -->
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td width="100%" height="100%" class="bg_tabbody">
+ <table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
+ <tr>
+ <td class="menu_col">
+ <div class="menu_width spacer" style="width:#{component.attributes['sidebarWidth']}px"></div>
+<!-- begin menu -->
+ <u:insertFacet name="sidebar"/>
+<!-- end meny -->
+ </td>
+ <td class="content_col">
+<!-- begin content -->
+ <vcp:body>
+ <f:call name="renderChildren" />
+ </vcp:body>
+<!-- end content -->
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td class="footer_bg">
+ <div class="footer_bg_content">
+<!-- begin footer -->
+ <u:insertFacet name="footer"/>
+<!-- end footer -->
+ </div>
+ </td>
+ </tr>
+ </table>
+</body>
+</html>
+</f:root>
\ No newline at end of file
Property changes on: trunk/samples/themes/src/main/templates/org/richfaces/oldschool.jspx
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/samples/themes/src/main/templates/org/richfaces/smooth.jspx (from rev 13743, trunk/samples/themes/src/main/templates/org/richfaces/theme1.jspx)
===================================================================
--- trunk/samples/themes/src/main/templates/org/richfaces/smooth.jspx (rev 0)
+++ trunk/samples/themes/src/main/templates/org/richfaces/smooth.jspx 2009-04-22 00:56:37 UTC (rev 13751)
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<f:root
+ xmlns:f="http://ajax4jsf.org/cdk/template"
+ xmlns:c=" http://java.sun.com/jsf/core"
+ xmlns:ui=" http://ajax4jsf.org/cdk/ui"
+ xmlns:u=" http://ajax4jsf.org/cdk/u"
+ xmlns:x=" http://ajax4jsf.org/cdk/x"
+ xmlns:h="http://jsf.exadel.com/header"
+ xmlns:vcp="http://ajax4jsf.org/cdk/vcp"
+ class="org.richfaces.renderkit.html.SmoothThemeRenderer"
+ baseclass="org.richfaces.renderkit.AbstractPageRenderer"
+ component="org.richfaces.component.UIPage"
+ >
+ <c:set var="namespace" value="#{this:prolog(context,component)}"/>
+ <html x:xmlns="#{namespace}" x:lang="#{context.viewRoot.locale}"
+ >
+<head>
+ <title>#{component.attributes['pageTitle']}</title>
+ <f:call name="themeStyle"/>
+ <f:call name="themeScript"/>
+ <style type="text/css">
+ <jsp:scriptlet><![CDATA[
+ Integer width = (Integer) component.getAttributes().get("width");
+ if (null != width && width.intValue() > 0) {
+ StringBuilder format = new StringBuilder(
+ ".rich-page{margin:auto;text-align:left;");
+ format.append("width:").append(width).append("px;");
+ writer.write(format.toString());
+ } else {
+ writer.write(".rich-page{width:100%;}\n");
+ }
+ ]]></jsp:scriptlet>
+ </style>
+ <u:insertFacet name="pageHeader"/>
+
+</head>
+<body x:passThruWithExclusions="value,name,type,id">
+<table class="rich-page" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td align="center" class="common_box">
+
+ <table height="100%" border="0" cellpadding="0" cellspacing="0" class="page_size">
+ <tr>
+ <td colspan="3" class="header_bg_left">
+ <div class="header_bg_right">
+ <div class="spacer" style="height : 15px"></div>
+ <div class="header_content">
+ <u:insertFacet name="header"/>
+ </div>
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td class="left_col">
+ <div class="left_strut">
+ <br />
+ </div>
+ </td>
+ <td width="100%" height="100%" class="bg_tabbody">
+ <table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
+ <tr>
+ <td class="menu_col">
+ <div class="spacer" style="width:#{component.attributes['sidebarWidth']}px"></div>
+ <u:insertFacet name="sidebar"/>
+ </td>
+ <td class="content_col">
+ <vcp:body>
+ <f:call name="renderChildren" />
+ </vcp:body>
+ </td>
+ </tr>
+ </table>
+ </td>
+ <td class="right_col">
+ <div class="right_strut">
+ <br />
+ </div>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="3" class="footer_bg_left">
+ <div class="footer_bg_right">
+ <div class="footer_bg_content">
+ <u:insertFacet name="footer"/>
+
+ </div>
+ </div>
+ </td>
+ </tr>
+ </table>
+
+ </td>
+ </tr>
+</table>
+</body>
+</html>
+</f:root>
\ No newline at end of file
Property changes on: trunk/samples/themes/src/main/templates/org/richfaces/smooth.jspx
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: trunk/samples/themes/src/main/templates/org/richfaces/theme1.jspx
===================================================================
--- trunk/samples/themes/src/main/templates/org/richfaces/theme1.jspx 2009-04-21 23:57:19 UTC (rev 13750)
+++ trunk/samples/themes/src/main/templates/org/richfaces/theme1.jspx 2009-04-22 00:56:37 UTC (rev 13751)
@@ -1,97 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<f:root
- xmlns:f="http://ajax4jsf.org/cdk/template"
- xmlns:c=" http://java.sun.com/jsf/core"
- xmlns:ui=" http://ajax4jsf.org/cdk/ui"
- xmlns:u=" http://ajax4jsf.org/cdk/u"
- xmlns:x=" http://ajax4jsf.org/cdk/x"
- xmlns:h="http://jsf.exadel.com/header"
- xmlns:vcp="http://ajax4jsf.org/cdk/vcp"
- class="org.richfaces.renderkit.html.Theme1Renderer"
- baseclass="org.richfaces.renderkit.AbstractPageRenderer"
- component="org.richfaces.component.UIPage"
- >
- <c:set var="namespace" value="#{this:prolog(context,component)}"/>
- <html x:xmlns="#{namespace}" x:lang="#{context.viewRoot.locale}"
- >
-<head>
- <title>#{component.attributes['pageTitle']}</title>
- <f:call name="themeStyle"/>
- <f:call name="themeScript"/>
- <style type="text/css">
- <jsp:scriptlet><![CDATA[
- Integer width = (Integer) component.getAttributes().get("width");
- if (null != width && width.intValue() > 0) {
- StringBuilder format = new StringBuilder(
- ".rich-page{margin:auto;text-align:left;");
- format.append("width:").append(width).append("px;");
- writer.write(format.toString());
- } else {
- writer.write(".rich-page{width:100%;}\n");
- }
- ]]></jsp:scriptlet>
- </style>
- <u:insertFacet name="pageHeader"/>
-
-</head>
-<body x:passThruWithExclusions="value,name,type,id">
-<table class="rich-page" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td align="center" class="common_box">
-
- <table height="100%" border="0" cellpadding="0" cellspacing="0" class="page_size">
- <tr>
- <td colspan="3" class="header_bg_left">
- <div class="header_bg_right">
- <div class="spacer" style="height : 15px"></div>
- <div class="header_content">
- <u:insertFacet name="header"/>
- </div>
- </div>
- </td>
- </tr>
- <tr>
- <td class="left_col">
- <div class="left_strut">
- <br />
- </div>
- </td>
- <td width="100%" height="100%" class="bg_tabbody">
- <table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
- <tr>
- <td class="menu_col">
- <div class="spacer" style="width:#{component.attributes['sidebarWidth']}px"></div>
- <u:insertFacet name="sidebar"/>
- </td>
- <td class="content_col">
- <vcp:body>
- <f:call name="renderChildren" />
- </vcp:body>
- </td>
- </tr>
- </table>
- </td>
- <td class="right_col">
- <div class="right_strut">
- <br />
- </div>
- </td>
- </tr>
- <tr>
- <td colspan="3" class="footer_bg_left">
- <div class="footer_bg_right">
- <div class="footer_bg_content">
- <u:insertFacet name="footer"/>
-
- </div>
- </div>
- </td>
- </tr>
- </table>
-
- </td>
- </tr>
-</table>
-</body>
-</html>
-</f:root>
\ No newline at end of file
Deleted: trunk/samples/themes/src/main/templates/org/richfaces/theme2.jspx
===================================================================
--- trunk/samples/themes/src/main/templates/org/richfaces/theme2.jspx 2009-04-21 23:57:19 UTC (rev 13750)
+++ trunk/samples/themes/src/main/templates/org/richfaces/theme2.jspx 2009-04-22 00:56:37 UTC (rev 13751)
@@ -1,82 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<f:root
- xmlns:f="http://ajax4jsf.org/cdk/template"
- xmlns:jsp="http://java.sun.com/JSP/Page"
- xmlns:c=" http://java.sun.com/jsf/core"
- xmlns:ui=" http://ajax4jsf.org/cdk/ui"
- xmlns:u=" http://ajax4jsf.org/cdk/u"
- xmlns:x=" http://ajax4jsf.org/cdk/x"
- xmlns:h="http://jsf.exadel.com/header"
- xmlns:vcp="http://ajax4jsf.org/cdk/vcp"
- class="org.richfaces.renderkit.html.Theme2Renderer"
- baseclass="org.richfaces.renderkit.AbstractPageRenderer"
- component="org.richfaces.component.UIPage"
- >
- <c:set var="namespace" value="#{this:prolog(context,component)}"/>
- <html x:xmlns="#{namespace}" x:lang="#{context.viewRoot.locale}">
-<head>
-<meta http-equiv="content-type" content="text/html; charset=utf-8" />
- <title>#{component.attributes['pageTitle']}</title>
- <f:call name="themeStyle"/>
- <f:call name="themeScript"/>
- <style type="text/css">
- <jsp:scriptlet><![CDATA[
- Integer width = (Integer) component.getAttributes().get("width");
- if (null != width && width.intValue() > 0) {
- StringBuilder format = new StringBuilder(
- ".rich-page{margin:auto;text-align:left;");
- format.append("width:").append(width).append("px;");
- writer.write(format.toString());
- } else {
- writer.write(".rich-page{width:100%;}\n");
- }
- ]]></jsp:scriptlet>
- </style>
- <u:insertFacet name="pageHeader"/>
-
-</head>
-<body x:passThruWithExclusions="value,name,type,id">
- <table border="0" cellpadding="0" cellspacing="0" class="rich-page">
- <tr>
- <td class="header_bg">
- <div class="header_content">
-<!-- begin header -->
- <u:insertFacet name="header"/>
-<!-- end header -->
- </div>
- </td>
- </tr>
- <tr>
- <td width="100%" height="100%" class="bg_tabbody">
- <table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
- <tr>
- <td class="menu_col">
- <div class="menu_width spacer" style="width:#{component.attributes['sidebarWidth']}px"></div>
-<!-- begin menu -->
- <u:insertFacet name="sidebar"/>
-<!-- end meny -->
- </td>
- <td class="content_col">
-<!-- begin content -->
- <vcp:body>
- <f:call name="renderChildren" />
- </vcp:body>
-<!-- end content -->
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td class="footer_bg">
- <div class="footer_bg_content">
-<!-- begin footer -->
- <u:insertFacet name="footer"/>
-<!-- end footer -->
- </div>
- </td>
- </tr>
- </table>
-</body>
-</html>
-</f:root>
\ No newline at end of file
15 years, 8 months
JBoss Rich Faces SVN: r13750 - in trunk/ui/inplaceSelect/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-04-21 19:57:19 -0400 (Tue, 21 Apr 2009)
New Revision: 13750
Modified:
trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java
trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx
Log:
https://jira.jboss.org/jira/browse/RF-6650
Modified: trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java
===================================================================
--- trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java 2009-04-21 23:05:53 UTC (rev 13749)
+++ trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java 2009-04-21 23:57:19 UTC (rev 13750)
@@ -27,8 +27,14 @@
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
+import javax.faces.context.ResponseWriter;
import javax.faces.model.SelectItem;
+import org.ajax4jsf.javascript.JSFunctionDefinition;
+import org.ajax4jsf.javascript.ScriptString;
+import org.ajax4jsf.javascript.ScriptUtils;
+import org.ajax4jsf.renderkit.HeaderResourcesRendererBase;
+import org.ajax4jsf.renderkit.RendererUtils.HTML;
import org.ajax4jsf.util.InputUtils;
import org.ajax4jsf.util.SelectUtils;
import org.apache.commons.logging.Log;
@@ -40,7 +46,7 @@
* @author Anton Belevich
* @since 3.2.0
*/
-public class InplaceSelectBaseRenderer extends ComboBoxBaseRenderer{
+public class InplaceSelectBaseRenderer extends HeaderResourcesRendererBase {
private static Log logger = LogFactory.getLog(InplaceSelectBaseRenderer.class);
//TODO: move duplicate constants to superclass
@@ -48,6 +54,33 @@
private static final String CONTROLS_FACET = "controls";
private static final String EMPTY_DEFAULT_LABEL = "\u00a0\u00a0\u00a0";
+ protected static final class PreparedSelectItem implements ScriptString {
+ private String label;
+ private String convertedValue;
+
+ public PreparedSelectItem(String convertedValue, String label) {
+ super();
+ this.convertedValue = convertedValue;
+ this.label = label;
+ }
+
+ public String getLabel() {
+ return label;
+ }
+
+ public String getConvertedValue() {
+ return convertedValue;
+ }
+
+ public void appendScript(StringBuffer functionString) {
+ functionString.append(this.toScript());
+ }
+
+ public String toScript() {
+ return "[" + ScriptUtils.toScript(label) + ", " + ScriptUtils.toScript(convertedValue) + "]";
+ }
+ }
+
@Override
protected void doDecode(FacesContext context, UIComponent component) {
UIInplaceSelect inplaceSelect = null;
@@ -83,30 +116,53 @@
}
}
- public List<Object> encodeItems(FacesContext context, UIComponent component) throws IOException, IllegalArgumentException {
+ protected boolean isAcceptableComponent(UIComponent component) {
+ return component != null && this.getComponentClass().isAssignableFrom(component.getClass());
+ }
+ protected String getConvertedStringValue(FacesContext context, UIComponent component, Object value) {
+ return InputUtils.getConvertedStringValue(context, component, value);
+ }
+
+ protected void encodeSuggestion(FacesContext context, UIComponent component, String value, String classes) throws IOException {
+ ResponseWriter writer = context.getResponseWriter();
+ if(writer != null) {
+ writer.startElement(HTML.SPAN_ELEM, component);
+ writer.writeAttribute(HTML.class_ATTRIBUTE, classes, null);
+ writer.writeText(value, null);
+ writer.endElement(HTML.SPAN_ELEM);
+ }
+ }
+
+ public List<PreparedSelectItem> prepareItems(FacesContext context, UIComponent component) {
if (!isAcceptableComponent(component)) {
return null;
}
- List<Object> parentList = new ArrayList<Object>();
- List<String> labels = new ArrayList<String>();
+ List<PreparedSelectItem> itemsList = new ArrayList<PreparedSelectItem>();
UIInplaceSelect inplaceSelect = (UIInplaceSelect) component;
List<SelectItem> selectItems = SelectUtils.getSelectItems(context, inplaceSelect);
for (SelectItem selectItem : selectItems) {
- String value = getConvertedStringValue(context, inplaceSelect, selectItem.getValue());
+ String convertedValue = getConvertedStringValue(context, inplaceSelect, selectItem.getValue());
String label = selectItem.getLabel().trim();
- labels.add(label);
- encodeSuggestion(context, inplaceSelect, label, RICH_INPLACE_SELECT_CLASSES);
- Object[] child = new Object[2];
- child[0] = label;
- child[1] = value;
- parentList.add(child);
+ itemsList.add(new PreparedSelectItem(convertedValue, label));
}
- return parentList;
+
+ return itemsList;
}
+ public void encodeItems(FacesContext context, UIComponent component, List<PreparedSelectItem> items) throws IOException, IllegalArgumentException {
+ if (items != null) {
+ UIInplaceSelect inplaceSelect = (UIInplaceSelect) component;
+
+ for (PreparedSelectItem preparedSelectItem : items) {
+
+ encodeSuggestion(context, inplaceSelect, preparedSelectItem.getLabel(), RICH_INPLACE_SELECT_CLASSES);
+ }
+ }
+ }
+
public String encodeScriptAttributes(FacesContext context, UIComponent component) {
StringBuilder attributes = new StringBuilder();
attributes.append("var attributes = ");
@@ -168,6 +224,15 @@
// return selectedItemLabel;
// }
+ public String getAsEventHandler(FacesContext context, UIComponent component, String attributeName) {
+ JSFunctionDefinition script = getUtils().getAsEventHandler(context, component, attributeName, null);
+ return ScriptUtils.toScript(script);
+ }
+
+ public String encodeJS(Object object) {
+ return ScriptUtils.toScript(object);
+ }
+
protected String getItemLabel(FacesContext context, UIInplaceSelect component, Object value) {
String itemLabel = null;
// TODO: SelectUtils.getSelectItems is called minimum twice during encode
Modified: trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx
===================================================================
--- trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx 2009-04-21 23:05:53 UTC (rev 13749)
+++ trunk/ui/inplaceSelect/src/main/templates/inplaceselect.jspx 2009-04-21 23:57:19 UTC (rev 13750)
@@ -29,13 +29,31 @@
<f:clientid var="clientId" />
<f:resource var="saveIcon" name="org.richfaces.renderkit.html.images.SaveControlIcon"/>
<f:resource var="cancelIcon" name="org.richfaces.renderkit.html.images.CancelControlIcon"/>
+
+<c:object var="preparedItems" type="java.util.List" value="#{this:prepareItems(context, component)}" />
+
<jsp:scriptlet>
<![CDATA[
-
- Object value = component.getAttributes().get("value");
- String selectedItemLabel = getItemLabel(context, component, value);
- value = getConvertedStringValue(context, component,value);
+ Object value = null;
+ String selectedItemLabel = null;
+ Object submittedValue = component.getSubmittedValue();
+ if (submittedValue != null) {
+ if (preparedItems != null) {
+ for (Object o: preparedItems) {
+ PreparedSelectItem item = (PreparedSelectItem) o;
+ if (submittedValue.equals(item.getConvertedValue())) {
+ selectedItemLabel = item.getLabel();
+ value = submittedValue;
+ break;
+ }
+ }
+ }
+ } else {
+ value = component.getAttributes().get("value");
+ selectedItemLabel = getItemLabel(context, component, value);
+ value = getConvertedStringValue(context, component,value);
+ }
String fieldValue = null;
String fieldLabel = null;
@@ -51,7 +69,7 @@
fieldInputLabel = fieldLabel;
}
- String encodedFieldValue = encodeValue(fieldValue);
+ String encodedFieldValue = encodeJS(fieldValue);
variables.setVariable("fieldLabel", fieldLabel);
variables.setVariable("fieldValue", fieldValue);
@@ -219,8 +237,11 @@
<div id="#{clientId}listPosition" class="rich-inplace-select-list-position">
<div id="#{clientId}listDecoration" class="rich-inplace-select-list-decoration">
<div id="#{clientId}list" class="rich-inplace-select-list-scroll">
- <c:object type="java.util.List" var="items" value="#{this:encodeItems(context,component)}">
- </c:object>
+ <jsp:scriptlet>
+ <![CDATA[
+ encodeItems(context, component, preparedItems);
+ ]]>
+ </jsp:scriptlet>
</div>
</div>
</div>
@@ -246,7 +267,7 @@
var inplaceSelectCommonStyles = new Richfaces.InplaceSelectStyles();
new Richfaces.InplaceSelect(new Richfaces.InplaceSelectList('#{clientId}list', '#{clientId}listParent', true,
- inplaceSelectUserStyles.combolist, inplaceSelectCommonStyles.getCommonStyles().combolist, '#{component.attributes["listWidth"]}', '#{component.attributes["listHeight"]}', #{this:getItemsTextAsJSArray(context, component,items)}, null,
+ inplaceSelectUserStyles.combolist, inplaceSelectCommonStyles.getCommonStyles().combolist, '#{component.attributes["listWidth"]}', '#{component.attributes["listHeight"]}', #{this:encodeJS(preparedItems)}, null,
'#{clientId}inplaceTmpValue', '#{clientId}shadow', 0, 0, #{encodedFieldValue}),
'#{clientId}', '#{clientId}inplaceTmpValue',
'#{clientId}inplaceValue', '#{clientId}tabber',
15 years, 8 months
JBoss Rich Faces SVN: r13749 - trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-04-21 19:05:53 -0400 (Tue, 21 Apr 2009)
New Revision: 13749
Modified:
trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java
Log:
File indented
Modified: trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java
===================================================================
--- trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java 2009-04-21 22:35:29 UTC (rev 13748)
+++ trunk/ui/inplaceSelect/src/main/java/org/richfaces/renderkit/InplaceSelectBaseRenderer.java 2009-04-21 23:05:53 UTC (rev 13749)
@@ -41,163 +41,163 @@
* @since 3.2.0
*/
public class InplaceSelectBaseRenderer extends ComboBoxBaseRenderer{
-
- private static Log logger = LogFactory.getLog(InplaceSelectBaseRenderer.class);
- //TODO: move duplicate constants to superclass
- private static final String RICH_INPLACE_SELECT_CLASSES = "rich-inplace-select-item rich-inplace-select-font";
- private static final String CONTROLS_FACET = "controls";
- private static final String EMPTY_DEFAULT_LABEL = "\u00a0\u00a0\u00a0";
- @Override
- protected void doDecode(FacesContext context, UIComponent component) {
- UIInplaceSelect inplaceSelect = null;
+ private static Log logger = LogFactory.getLog(InplaceSelectBaseRenderer.class);
+ //TODO: move duplicate constants to superclass
+ private static final String RICH_INPLACE_SELECT_CLASSES = "rich-inplace-select-item rich-inplace-select-font";
+ private static final String CONTROLS_FACET = "controls";
+ private static final String EMPTY_DEFAULT_LABEL = "\u00a0\u00a0\u00a0";
- if (component instanceof UIInplaceSelect) {
- inplaceSelect = (UIInplaceSelect) component;
- } else {
- if (logger.isDebugEnabled()) {
- logger.debug("No decoding necessary since the component " + component.getId()
- + " is not an instance or a sub class of UIInplaceSelect");
- }
- return;
+ @Override
+ protected void doDecode(FacesContext context, UIComponent component) {
+ UIInplaceSelect inplaceSelect = null;
+
+ if (component instanceof UIInplaceSelect) {
+ inplaceSelect = (UIInplaceSelect) component;
+ } else {
+ if (logger.isDebugEnabled()) {
+ logger.debug("No decoding necessary since the component " + component.getId()
+ + " is not an instance or a sub class of UIInplaceSelect");
+ }
+ return;
+ }
+
+ String clientId = inplaceSelect.getClientId(context);
+ if (clientId == null) {
+ throw new NullPointerException("component client id is NULL");
+ }
+
+ if (InputUtils.isDisabled(inplaceSelect) || InputUtils.isReadOnly(inplaceSelect)) {
+ if (logger.isDebugEnabled()) {
+ logger.debug(("No decoding necessary since the component " + component.getId() + " is disabled"));
+ }
+ return;
+ }
+
+ Map <String,String> request = context.getExternalContext().getRequestParameterMap();
+ String newValue = (String) request.get(clientId);
+ if (newValue != null && newValue.length()!= 0) {
+ inplaceSelect.setSubmittedValue(newValue);
+ } else {
+ inplaceSelect.setSubmittedValue(null);
+ }
}
-
- String clientId = inplaceSelect.getClientId(context);
- if (clientId == null) {
- throw new NullPointerException("component client id is NULL");
- }
- if (InputUtils.isDisabled(inplaceSelect) || InputUtils.isReadOnly(inplaceSelect)) {
- if (logger.isDebugEnabled()) {
- logger.debug(("No decoding necessary since the component " + component.getId() + " is disabled"));
- }
- return;
+ public List<Object> encodeItems(FacesContext context, UIComponent component) throws IOException, IllegalArgumentException {
+
+ if (!isAcceptableComponent(component)) {
+ return null;
+ }
+
+ List<Object> parentList = new ArrayList<Object>();
+ List<String> labels = new ArrayList<String>();
+
+ UIInplaceSelect inplaceSelect = (UIInplaceSelect) component;
+ List<SelectItem> selectItems = SelectUtils.getSelectItems(context, inplaceSelect);
+ for (SelectItem selectItem : selectItems) {
+ String value = getConvertedStringValue(context, inplaceSelect, selectItem.getValue());
+ String label = selectItem.getLabel().trim();
+ labels.add(label);
+ encodeSuggestion(context, inplaceSelect, label, RICH_INPLACE_SELECT_CLASSES);
+ Object[] child = new Object[2];
+ child[0] = label;
+ child[1] = value;
+ parentList.add(child);
+ }
+ return parentList;
}
-
- Map <String,String> request = context.getExternalContext().getRequestParameterMap();
- String newValue = (String) request.get(clientId);
- if (newValue != null && newValue.length()!= 0) {
- inplaceSelect.setSubmittedValue(newValue);
- } else {
- inplaceSelect.setSubmittedValue(null);
- }
- }
- public List<Object> encodeItems(FacesContext context, UIComponent component) throws IOException, IllegalArgumentException {
+ public String encodeScriptAttributes(FacesContext context, UIComponent component) {
+ StringBuilder attributes = new StringBuilder();
+ attributes.append("var attributes = ");
- if (!isAcceptableComponent(component)) {
- return null;
+ ScriptOptions options = new ScriptOptions(component);
+
+ String defaultLabel = (String)component.getAttributes().get("defaultLabel");
+
+ if (defaultLabel == null || defaultLabel.trim().equals("")) {
+ defaultLabel = EMPTY_DEFAULT_LABEL;
+ }
+
+ options.addOption("defaultLabel", defaultLabel);
+ options.addOption("showControls");
+ options.addOption("editEvent");
+ options.addOption("verticalPosition", component.getAttributes().get("controlsVerticalPosition"));
+ options.addOption("horizontalPosition", component.getAttributes().get("controlsHorizontalPosition"));
+ options.addOption("inputWidth",component.getAttributes().get("selectWidth") );
+ options.addOption("minInputWidth", component.getAttributes().get("minSelectWidth"));
+ options.addOption("maxInputWidth", component.getAttributes().get("maxSelectWidth") );
+ options.addOption("openOnEdit");
+ options.addOption("showValueInView");
+ options.addOption("closeOnSelect", true);
+
+ attributes.append(options.toScript());
+
+ return attributes.toString();
}
- List<Object> parentList = new ArrayList<Object>();
- List<String> labels = new ArrayList<String>();
-
- UIInplaceSelect inplaceSelect = (UIInplaceSelect) component;
- List<SelectItem> selectItems = SelectUtils.getSelectItems(context, inplaceSelect);
- for (SelectItem selectItem : selectItems) {
- String value = getConvertedStringValue(context, inplaceSelect, selectItem.getValue());
- String label = selectItem.getLabel().trim();
- labels.add(label);
- encodeSuggestion(context, inplaceSelect, label, RICH_INPLACE_SELECT_CLASSES);
- Object[] child = new Object[2];
- child[0] = label;
- child[1] = value;
- parentList.add(child);
+ public void encodeControlsFacet(FacesContext context, UIComponent component) throws IOException {
+ UIComponent facet = component.getFacet(CONTROLS_FACET);
+ if ((facet != null) && (facet.isRendered())) {
+ renderChild(context, facet);
+ }
}
- return parentList;
- }
-
- public String encodeScriptAttributes(FacesContext context, UIComponent component) {
- StringBuilder attributes = new StringBuilder();
- attributes.append("var attributes = ");
-
- ScriptOptions options = new ScriptOptions(component);
-
- String defaultLabel = (String)component.getAttributes().get("defaultLabel");
- if (defaultLabel == null || defaultLabel.trim().equals("")) {
- defaultLabel = EMPTY_DEFAULT_LABEL;
- }
-
- options.addOption("defaultLabel", defaultLabel);
- options.addOption("showControls");
- options.addOption("editEvent");
- options.addOption("verticalPosition", component.getAttributes().get("controlsVerticalPosition"));
- options.addOption("horizontalPosition", component.getAttributes().get("controlsHorizontalPosition"));
- options.addOption("inputWidth",component.getAttributes().get("selectWidth") );
- options.addOption("minInputWidth", component.getAttributes().get("minSelectWidth"));
- options.addOption("maxInputWidth", component.getAttributes().get("maxSelectWidth") );
- options.addOption("openOnEdit");
- options.addOption("showValueInView");
- options.addOption("closeOnSelect", true);
-
- attributes.append(options.toScript());
-
- return attributes.toString();
- }
-
- public void encodeControlsFacet(FacesContext context, UIComponent component) throws IOException {
- UIComponent facet = component.getFacet(CONTROLS_FACET);
- if ((facet != null) && (facet.isRendered())) {
- renderChild(context, facet);
+ public boolean isControlsFacetExists(FacesContext context, UIComponent component) {
+ UIComponent facet = component.getFacet(CONTROLS_FACET);
+ if (facet != null && facet.isRendered()) {
+ return true;
+ }
+ return false;
}
- }
- public boolean isControlsFacetExists(FacesContext context, UIComponent component) {
- UIComponent facet = component.getFacet(CONTROLS_FACET);
- if (facet != null && facet.isRendered()) {
- return true;
+ protected Class<? extends UIComponent> getComponentClass() {
+ return UIInplaceSelect.class;
}
- return false;
- }
- protected Class<? extends UIComponent> getComponentClass() {
- return UIInplaceSelect.class;
- }
-
-// public String getSelectedItemLabel(FacesContext context, UIInplaceSelect component) {
-// String selectedItemLabel = (String)component.getSubmittedValue();
-// if(selectedItemLabel == null || !component.isValid()) {
-// Object value = component.getAttributes().get("value");
-// if (value == null || "".equals(value)) {
-// selectedItemLabel = createDefaultLabel(component);
-// } else {
-// selectedItemLabel = getItemLabel(context, component, value);
-// }
-// }
-// return selectedItemLabel;
-// }
-
- protected String getItemLabel(FacesContext context, UIInplaceSelect component, Object value) {
- String itemLabel = null;
- // TODO: SelectUtils.getSelectItems is called minimum twice during encode
- if(value != null) {
- List<SelectItem> selectItems = SelectUtils.getSelectItems(context, component);
- if (!selectItems.isEmpty()) {
- for (SelectItem item : selectItems) {
- if (value.equals(item.getValue())) {
- itemLabel = component.isShowValueInView() ? getConvertedStringValue(context, component, item.getValue()) : item.getLabel();
- break;
+ // public String getSelectedItemLabel(FacesContext context, UIInplaceSelect component) {
+ // String selectedItemLabel = (String)component.getSubmittedValue();
+ // if(selectedItemLabel == null || !component.isValid()) {
+ // Object value = component.getAttributes().get("value");
+ // if (value == null || "".equals(value)) {
+ // selectedItemLabel = createDefaultLabel(component);
+ // } else {
+ // selectedItemLabel = getItemLabel(context, component, value);
+ // }
+ // }
+ // return selectedItemLabel;
+ // }
+
+ protected String getItemLabel(FacesContext context, UIInplaceSelect component, Object value) {
+ String itemLabel = null;
+ // TODO: SelectUtils.getSelectItems is called minimum twice during encode
+ if(value != null) {
+ List<SelectItem> selectItems = SelectUtils.getSelectItems(context, component);
+ if (!selectItems.isEmpty()) {
+ for (SelectItem item : selectItems) {
+ if (value.equals(item.getValue())) {
+ itemLabel = component.isShowValueInView() ? getConvertedStringValue(context, component, item.getValue()) : item.getLabel();
+ break;
+ }
}
}
}
+
+ return itemLabel;
}
- return itemLabel;
- }
-
- protected String createDefaultLabel(UIComponent component) {
- String defaultLabel = (String) component.getAttributes().get("defaultLabel");
- if (defaultLabel == null || defaultLabel.trim().equals("")) {
- defaultLabel = EMPTY_DEFAULT_LABEL;
+ protected String createDefaultLabel(UIComponent component) {
+ String defaultLabel = (String) component.getAttributes().get("defaultLabel");
+ if (defaultLabel == null || defaultLabel.trim().equals("")) {
+ defaultLabel = EMPTY_DEFAULT_LABEL;
+ }
+ return defaultLabel;
}
- return defaultLabel;
- }
-
- protected boolean isEmptyDefaultLabel(String defaultLabel) {
- if (EMPTY_DEFAULT_LABEL.equals(defaultLabel)) {
- return true;
- }
- return false;
- }
+
+ protected boolean isEmptyDefaultLabel(String defaultLabel) {
+ if (EMPTY_DEFAULT_LABEL.equals(defaultLabel)) {
+ return true;
+ }
+ return false;
+ }
}
15 years, 8 months
JBoss Rich Faces SVN: r13748 - trunk/docs/userguide/en/src/main/docbook/included.
by richfaces-svn-commits@lists.jboss.org
Author: smukhina
Date: 2009-04-21 18:35:29 -0400 (Tue, 21 Apr 2009)
New Revision: 13748
Modified:
trunk/docs/userguide/en/src/main/docbook/included/modalPanel.xml
trunk/docs/userguide/en/src/main/docbook/included/outputPanel.xml
trunk/docs/userguide/en/src/main/docbook/included/region.xml
trunk/docs/userguide/en/src/main/docbook/included/scrollableDataTable.xml
trunk/docs/userguide/en/src/main/docbook/included/suggestionbox.xml
Log:
https://jira.jboss.org/jira/browse/RF-6023 Demonstrative pronouns as links, here is replaced everywhere in RF with more meaningful phrases
Modified: trunk/docs/userguide/en/src/main/docbook/included/modalPanel.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/modalPanel.xml 2009-04-21 18:40:38 UTC (rev 13747)
+++ trunk/docs/userguide/en/src/main/docbook/included/modalPanel.xml 2009-04-21 22:35:29 UTC (rev 13748)
@@ -390,10 +390,10 @@
in the messages. For example, {1} for
<code>"DoubleRangeValidator.MAXIMUM"</code>,
{2} for <code>"ShortConverter.SHORT"</code>. </para>
- <para>
+ <para>In RichFaces Cookbook article about
<ulink
url="http://wiki.jboss.org/auth/wiki/RichFacesCookbook/DetailModalPanelFromTable"
- > Here </ulink> there is information for those of you who
+ > Modal Panel </ulink> there is information for those of you who
would like to click on a details link in table and have it show a
modal panel with information loaded from the server. </para>
</section>
Modified: trunk/docs/userguide/en/src/main/docbook/included/outputPanel.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/outputPanel.xml 2009-04-21 18:40:38 UTC (rev 13747)
+++ trunk/docs/userguide/en/src/main/docbook/included/outputPanel.xml 2009-04-21 22:35:29 UTC (rev 13748)
@@ -191,10 +191,10 @@
</section>
<section>
<title>Relevant resources links</title>
- <para>
+ <para>On
<ulink
url="http://livedemo.exadel.com/richfaces-demo/richfaces/outputPanel.jsf?c=out..."
- > Here </ulink> you can see the example of <emphasis role="bold">
+ > RichFaces Live Demo page </ulink> you can see the example of <emphasis role="bold">
<property><a4j:outputPanel></property>
</emphasis> usage and sources for the given example. </para>
<para> Some additional information about usage of component can be found on the <ulink
Modified: trunk/docs/userguide/en/src/main/docbook/included/region.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/region.xml 2009-04-21 18:40:38 UTC (rev 13747)
+++ trunk/docs/userguide/en/src/main/docbook/included/region.xml 2009-04-21 22:35:29 UTC (rev 13748)
@@ -57,7 +57,7 @@
</section>
<section>
<title>Key attributes and ways of usage</title>
- <para>The region is a component used for manipulation with components sent to the server. It sets particular processing parameters for an area on the server, i.e. the region deals with data input on the server and has no direct impact on output. To read more on the components responsible for out, see "reference" <ulink url="http://java.sun.com/javaee/javaserverfaces/reference/index.html">here</ulink>.
+ <para>The region is a component used for manipulation with components sent to the server. It sets particular processing parameters for an area on the server, i.e. the region deals with data input on the server and has no direct impact on output. To read more on the components responsible for out, see <ulink url="http://java.sun.com/javaee/javaserverfaces/reference/index.html">Sun official documentation</ulink>.
</para>
<para>The region marks an area page that is decoded on the server. In most cases it is not necessary to use the region, as ViewRoot is a default region. This component helps to reduce data quantity processed by the server, but the region doesn't influence on the standard submission rules. It means that:<itemizedlist>
<listitem><para>
Modified: trunk/docs/userguide/en/src/main/docbook/included/scrollableDataTable.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/scrollableDataTable.xml 2009-04-21 18:40:38 UTC (rev 13747)
+++ trunk/docs/userguide/en/src/main/docbook/included/scrollableDataTable.xml 2009-04-21 22:35:29 UTC (rev 13748)
@@ -275,8 +275,8 @@
</listitem>
</itemizedlist>
</para>
- <para>Information about sorting and filtering you can find <link linkend="sort"
- >here</link>.</para>
+ <para>Information about sorting and filtering you can find in RichFaces Developer guide section about<link linkend="sort"
+ >sorting</link>.</para>
<para> Information about the <emphasis>
<property>"process"</property>
</emphasis> attribute usage you can find in the
Modified: trunk/docs/userguide/en/src/main/docbook/included/suggestionbox.xml
===================================================================
--- trunk/docs/userguide/en/src/main/docbook/included/suggestionbox.xml 2009-04-21 18:40:38 UTC (rev 13747)
+++ trunk/docs/userguide/en/src/main/docbook/included/suggestionbox.xml 2009-04-21 22:35:29 UTC (rev 13748)
@@ -268,10 +268,10 @@
<property>"process"</property>
</emphasis> attribute usage you can findin the
<link linkend="process"> "Decide what to process" </link> guide section. </para>
- <para>
+ <para>In RichFaces Wiki article about
<ulink
url="http://wiki.jboss.org/wiki/RichFacesSuggestionGettingAdditionalProperties"
- >Here </ulink> you can find example of getting additional
+ >Additional Properties </ulink> you can find example of getting additional
properties. </para>
</section>
<section>
15 years, 8 months
JBoss Rich Faces SVN: r13747 - in trunk/examples/photoalbum: ejb/src/main/java/org/richfaces/photoalbum/domain and 17 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2009-04-21 14:40:38 -0400 (Tue, 21 Apr 2009)
New Revision: 13747
Added:
trunk/examples/photoalbum/JBossORG-EULA.txt
trunk/examples/photoalbum/lgpl.txt
Modified:
trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/Image.java
trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/service/Constants.java
trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/service/ISearchAction.java
trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/service/SearchAction.java
trunk/examples/photoalbum/web/
trunk/examples/photoalbum/web/META-INF/MANIFEST.MF
trunk/examples/photoalbum/web/Upload/
trunk/examples/photoalbum/web/src/main/java/org/richfaces/photoalbum/manager/AlbumManager.java
trunk/examples/photoalbum/web/src/main/java/org/richfaces/photoalbum/manager/Controller.java
trunk/examples/photoalbum/web/src/main/java/org/richfaces/photoalbum/manager/ShelfManager.java
trunk/examples/photoalbum/web/src/main/java/org/richfaces/photoalbum/manager/TreeManager.java
trunk/examples/photoalbum/web/src/main/java/org/richfaces/photoalbum/search/ImageSearchHelper.java
trunk/examples/photoalbum/web/src/main/java/org/richfaces/photoalbum/search/SearchOptionByShelf.java
trunk/examples/photoalbum/web/src/main/resources/messages_en.properties
trunk/examples/photoalbum/web/src/main/webapp/WEB-INF/web.xml
trunk/examples/photoalbum/web/src/main/webapp/includes/album/albumEditInfo.xhtml
trunk/examples/photoalbum/web/src/main/webapp/includes/album/albumInfo.xhtml
trunk/examples/photoalbum/web/src/main/webapp/includes/album/albumsList.xhtml
trunk/examples/photoalbum/web/src/main/webapp/includes/album/createAlbum.xhtml
trunk/examples/photoalbum/web/src/main/webapp/includes/contextMenu/CMForAlbum.xhtml
trunk/examples/photoalbum/web/src/main/webapp/includes/contextMenu/CMForImage.xhtml
trunk/examples/photoalbum/web/src/main/webapp/includes/contextMenu/CMForShelf.xhtml
trunk/examples/photoalbum/web/src/main/webapp/includes/fileUpload/fileUploader.xhtml
trunk/examples/photoalbum/web/src/main/webapp/includes/fileUpload/uploadResult.xhtml
trunk/examples/photoalbum/web/src/main/webapp/includes/image/imageEditInfo.xhtml
trunk/examples/photoalbum/web/src/main/webapp/includes/image/imageInfo.xhtml
trunk/examples/photoalbum/web/src/main/webapp/includes/image/imageList.xhtml
trunk/examples/photoalbum/web/src/main/webapp/includes/image/imageScroller.xhtml
trunk/examples/photoalbum/web/src/main/webapp/includes/image/slideshow.xhtml
trunk/examples/photoalbum/web/src/main/webapp/includes/index/login.xhtml
trunk/examples/photoalbum/web/src/main/webapp/includes/index/menu.xhtml
trunk/examples/photoalbum/web/src/main/webapp/includes/index/tree.xhtml
trunk/examples/photoalbum/web/src/main/webapp/includes/misc/confirmation.xhtml
trunk/examples/photoalbum/web/src/main/webapp/includes/search/result/albumsResult.xhtml
trunk/examples/photoalbum/web/src/main/webapp/includes/search/result/imageResult.xhtml
trunk/examples/photoalbum/web/src/main/webapp/includes/search/result/userResult.xhtml
trunk/examples/photoalbum/web/src/main/webapp/includes/search/searchWidget.xhtml
trunk/examples/photoalbum/web/src/main/webapp/includes/shelf/createShelf.xhtml
trunk/examples/photoalbum/web/src/main/webapp/includes/shelf/shelfEditInfo.xhtml
trunk/examples/photoalbum/web/src/main/webapp/includes/shelf/shelfInfo.xhtml
Log:
Added: trunk/examples/photoalbum/JBossORG-EULA.txt
===================================================================
--- trunk/examples/photoalbum/JBossORG-EULA.txt (rev 0)
+++ trunk/examples/photoalbum/JBossORG-EULA.txt 2009-04-21 18:40:38 UTC (rev 13747)
@@ -0,0 +1,104 @@
+LICENSE AGREEMENT
+JBOSS(r)
+
+This License Agreement governs the use of the Software Packages and any updates to the Software
+Packages, regardless of the delivery mechanism. Each Software Package is a collective work
+under U.S. Copyright Law. Subject to the following terms, Red Hat, Inc. ("Red Hat") grants to
+the user ("Client") a license to the applicable collective work(s) pursuant to the
+GNU Lesser General Public License v. 2.1 except for the following Software Packages:
+(a) JBoss Portal Forums and JBoss Transactions JTS, each of which is licensed pursuant to the
+GNU General Public License v.2;
+
+(b) JBoss Rules, which is licensed pursuant to the Apache License v.2.0;
+
+(c) an optional download for JBoss Cache for the Berkeley DB for Java database, which is licensed under the
+(open source) Sleepycat License (if Client does not wish to use the open source version of this database,
+it may purchase a license from Sleepycat Software);
+
+and (d) the BPEL extension for JBoss jBPM, which is licensed under the Common Public License v.1,
+and, pursuant to the OASIS BPEL4WS standard, requires parties wishing to redistribute to enter various
+royalty-free patent licenses.
+
+Each of the foregoing licenses is available at http://www.opensource.org/licenses/index.php.
+
+1. The Software. "Software Packages" refer to the various software modules that are created and made available
+for distribution by the JBoss.org open source community at http://www.jboss.org. Each of the Software Packages
+may be comprised of hundreds of software components. The end user license agreement for each component is located in
+the component's source code. With the exception of certain image files identified in Section 2 below,
+the license terms for the components permit Client to copy, modify, and redistribute the component,
+in both source code and binary code forms. This agreement does not limit Client's rights under,
+or grant Client rights that supersede, the license terms of any particular component.
+
+2. Intellectual Property Rights. The Software Packages are owned by Red Hat and others and are protected under copyright
+and other laws. Title to the Software Packages and any component, or to any copy, modification, or merged portion shall
+remain with the aforementioned, subject to the applicable license. The "JBoss" trademark, "Red Hat" trademark, the
+individual Software Package trademarks, and the "Shadowman" logo are registered trademarks of Red Hat and its affiliates
+in the U.S. and other countries. This agreement permits Client to distribute unmodified copies of the Software Packages
+using the Red Hat trademarks that Red Hat has inserted in the Software Packages on the condition that Client follows Red Hat's
+trademark guidelines for those trademarks located at http://www.redhat.com/about/corporate/trademark/. Client must abide by
+these trademark guidelines when distributing the Software Packages, regardless of whether the Software Packages have been modified.
+If Client modifies the Software Packages, then Client must replace all Red Hat trademarks and logos identified at
+http://www.jboss.com/company/logos unless a separate agreement with Red Hat is executed or other permission granted.
+Merely deleting the files containing the Red Hat trademarks may corrupt the Software Packages.
+
+3. Limited Warranty. Except as specifically stated in this Paragraph 3 or a license for a particular
+component, to the maximum extent permitted under applicable law, the Software Packages and the
+components are provided and licensed "as is" without warranty of any kind, expressed or implied,
+including the implied warranties of merchantability, non-infringement or fitness for a particular purpose.
+Red Hat warrants that the media on which Software Packages may be furnished will be free from defects in
+materials and manufacture under normal use for a period of 30 days from the date of delivery to Client.
+Red Hat does not warrant that the functions contained in the Software Packages will meet Client's requirements
+or that the operation of the Software Packages will be entirely error free or appear precisely as described
+in the accompanying documentation. This warranty extends only to the party that purchases the Services
+pertaining to the Software Packages from Red Hat or a Red Hat authorized distributor.
+
+4. Limitation of Remedies and Liability. To the maximum extent permitted by applicable law, the remedies
+described below are accepted by Client as its only remedies. Red Hat's entire liability, and Client's
+exclusive remedies, shall be: If the Software media is defective, Client may return it within 30 days of
+delivery along with a copy of Client's payment receipt and Red Hat, at its option, will replace it or
+refund the money paid by Client for the Software. To the maximum extent permitted by applicable law,
+Red Hat or any Red Hat authorized dealer will not be liable to Client for any incidental or consequential
+damages, including lost profits or lost savings arising out of the use or inability to use the Software,
+even if Red Hat or such dealer has been advised of the possibility of such damages. In no event shall
+Red Hat's liability under this agreement exceed the amount that Client paid to Red Hat under this
+Agreement during the twelve months preceding the action.
+
+5. Export Control. As required by U.S. law, Client represents and warrants that it:
+(a) understands that the Software Packages are subject to export controls under the
+U.S. Commerce Department's Export Administration Regulations ("EAR");
+
+(b) is not located in a prohibited destination country under the EAR or U.S. sanctions regulations
+(currently Cuba, Iran, Iraq, Libya, North Korea, Sudan and Syria);
+
+(c) will not export, re-export, or transfer the Software Packages to any prohibited destination, entity,
+or individual without the necessary export license(s) or authorizations(s) from the U.S. Government;
+
+(d) will not use or transfer the Software Packages for use in any sensitive nuclear, chemical or
+biological weapons, or missile technology end-uses unless authorized by the U.S. Government by
+regulation or specific license;
+
+(e) understands and agrees that if it is in the United States and exports or transfers the Software
+Packages to eligible end users, it will, as required by EAR Section 740.17(e), submit semi-annual
+reports to the Commerce Department's Bureau of Industry & Security (BIS), which include the name and
+address (including country) of each transferee;
+
+and (f) understands that countries other than the United States may restrict the import, use, or
+export of encryption products and that it shall be solely responsible for compliance with any such
+import, use, or export restrictions.
+
+6. Third Party Programs. Red Hat may distribute third party software programs with the Software Packages
+that are not part of the Software Packages and which Client must install separately. These third party
+programs are subject to their own license terms. The license terms either accompany the programs or
+can be viewed at http://www.redhat.com/licenses/. If Client does not agree to abide by the applicable
+license terms for such programs, then Client may not install them. If Client wishes to install the programs
+on more than one system or transfer the programs to another party, then Client must contact the licensor
+of the programs.
+
+7. General. If any provision of this agreement is held to be unenforceable, that shall not affect the
+enforceability of the remaining provisions. This License Agreement shall be governed by the laws of the
+State of North Carolina and of the United States, without regard to any conflict of laws provisions,
+except that the United Nations Convention on the International Sale of Goods shall not apply.
+
+Copyright 2006-2008 Red Hat, Inc. All rights reserved.
+"JBoss" and the JBoss logo are registered trademarks of Red Hat, Inc.
+All other trademarks are the property of their respective owners.
Property changes on: trunk/examples/photoalbum/JBossORG-EULA.txt
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Modified: trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/Image.java
===================================================================
--- trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/Image.java 2009-04-21 18:07:03 UTC (rev 13746)
+++ trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/domain/Image.java 2009-04-21 18:40:38 UTC (rev 13747)
@@ -91,9 +91,7 @@
@Entity
@Name("image")
-@Table(name = "Images", uniqueConstraints = {
- @UniqueConstraint(columnNames = "path")
- })
+@Table(name = "Images")
@Scope(ScopeType.CONVERSATION)
@AutoCreate
public class Image implements Serializable {
Modified: trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/service/Constants.java
===================================================================
--- trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/service/Constants.java 2009-04-21 18:07:03 UTC (rev 13746)
+++ trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/service/Constants.java 2009-04-21 18:40:38 UTC (rev 13747)
@@ -163,7 +163,8 @@
public static final String PATH_PARAMETER = "path";
public static final String IMAGE_PATH_EXIST_QUERY = "image-exist";
public static final String SEARCH_NO_OPTIONS_ERROR = "You must select at least one search option";
- public static final String TREE_ID = "mainform:tree";
+ public static final String TREE_ID = "treeform";
+ public static final String SEARCH_NO_WHERE_OPTIONS_ERROR = "You must specify where search execute";
private Constants(){
}
}
\ No newline at end of file
Modified: trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/service/ISearchAction.java
===================================================================
--- trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/service/ISearchAction.java 2009-04-21 18:07:03 UTC (rev 13746)
+++ trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/service/ISearchAction.java 2009-04-21 18:40:38 UTC (rev 13747)
@@ -45,6 +45,6 @@
public List<User> searchByUsers(String query, boolean searchInMyAlbums, boolean searchInShared);
- public List<Shelf> searchByShelfs(String query,boolean searchInMyAlbums, boolean searchInShared);
+ public List<Shelf> searchByShelves(String query,boolean searchInMyAlbums, boolean searchInShared);
}
Modified: trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/service/SearchAction.java
===================================================================
--- trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/service/SearchAction.java 2009-04-21 18:07:03 UTC (rev 13746)
+++ trunk/examples/photoalbum/ejb/src/main/java/org/richfaces/photoalbum/service/SearchAction.java 2009-04-21 18:40:38 UTC (rev 13747)
@@ -165,7 +165,7 @@
* @param searchInShared - determine is search will be making in only shared shelves
* @return list of founded images
*/
- public List<Shelf> searchByShelfs(String searchQuery, boolean searchInMyAlbums,
+ public List<Shelf> searchByShelves(String searchQuery, boolean searchInMyAlbums,
boolean searchInShared) {
StringBuilder b = new StringBuilder(Constants.SEARCH_SHELVES_QUERY);
//If we search in user's shelves
Added: trunk/examples/photoalbum/lgpl.txt
===================================================================
--- trunk/examples/photoalbum/lgpl.txt (rev 0)
+++ trunk/examples/photoalbum/lgpl.txt 2009-04-21 18:40:38 UTC (rev 13747)
@@ -0,0 +1,504 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+ When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the library's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ <signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
+
+
Property changes on: trunk/examples/photoalbum/lgpl.txt
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Property changes on: trunk/examples/photoalbum/web
___________________________________________________________________
Name: svn:ignore
- *.classpath
*.project
.settings
target
+ *.classpath
*.project
.settings
target
.externalToolBuilders
maven-eclipse.xml
Modified: trunk/examples/photoalbum/web/META-INF/MANIFEST.MF
===================================================================
--- trunk/examples/photoalbum/web/META-INF/MANIFEST.MF 2009-04-21 18:07:03 UTC (rev 13746)
+++ trunk/examples/photoalbum/web/META-INF/MANIFEST.MF 2009-04-21 18:40:38 UTC (rev 13747)
@@ -1,9 +1,8 @@
Manifest-Version: 1.0
-Class-Path: avalon-framework-4.1.3.jar commons-beanutils-1.7.0.jar com
- mons-digester-2.0.jar commons-logging-1.1.jar jboss-seam-debug-2.1.0.
- SP1.jar jboss-seam-jul-2.1.0.SP1.jar jboss-seam-remoting-2.1.0.SP1.ja
- r jboss-seam-ui-2.1.0.SP1.jar jhighlight-1.0.jar jsf-facelets-1.1.14.
- jar junit-3.8.jar log4j-1.2.14.jar logkit-1.0.1.jar metadata-extracto
- r-2.4.0-beta1.jar richfaces-impl-3.3.1-SNAPSHOT.jar richfaces-ui-3.3.
- 1-SNAPSHOT.jar
+Class-Path: commons-beanutils-1.7.0.jar commons-digester-2.0.jar commo
+ ns-logging-1.1.1.jar jboss-seam-debug-2.1.1.GA.jar jboss-seam-jul-2.1
+ .1.GA.jar jboss-seam-remoting-2.1.1.GA.jar jboss-seam-ui-2.1.1.GA.jar
+ jhighlight-1.0.jar jsf-facelets-1.1.15.B1.jar junit-3.8.jar metadata
+ -extractor-2.4.0-beta1.jar richfaces-impl-3.3.1-SNAPSHOT.jar richface
+ s-ui-3.3.1-SNAPSHOT.jar
Property changes on: trunk/examples/photoalbum/web/Upload
___________________________________________________________________
Name: svn:ignore
+ full
Modified: trunk/examples/photoalbum/web/src/main/java/org/richfaces/photoalbum/manager/AlbumManager.java
===================================================================
--- trunk/examples/photoalbum/web/src/main/java/org/richfaces/photoalbum/manager/AlbumManager.java 2009-04-21 18:07:03 UTC (rev 13746)
+++ trunk/examples/photoalbum/web/src/main/java/org/richfaces/photoalbum/manager/AlbumManager.java 2009-04-21 18:40:38 UTC (rev 13747)
@@ -46,6 +46,8 @@
private boolean validationSuccess = false;
+ private boolean errorInCreate = false;
+
@In private IAlbumAction albumAction;
@In private User user;
@@ -79,6 +81,7 @@
}
if(shelf == null){
Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, Constants.NO_SHELF_ERROR);
+ setErrorInCreate(true);
return;
}
}
@@ -116,4 +119,12 @@
public void setValidationSuccess(boolean validationSuccess) {
this.validationSuccess = validationSuccess;
}
+
+ public boolean isErrorInCreate() {
+ return errorInCreate;
+ }
+
+ public void setErrorInCreate(boolean errorInCreate) {
+ this.errorInCreate = errorInCreate;
+ }
}
\ No newline at end of file
Modified: trunk/examples/photoalbum/web/src/main/java/org/richfaces/photoalbum/manager/Controller.java
===================================================================
--- trunk/examples/photoalbum/web/src/main/java/org/richfaces/photoalbum/manager/Controller.java 2009-04-21 18:07:03 UTC (rev 13746)
+++ trunk/examples/photoalbum/web/src/main/java/org/richfaces/photoalbum/manager/Controller.java 2009-04-21 18:40:38 UTC (rev 13747)
@@ -48,7 +48,11 @@
@In(scope = ScopeType.SESSION) User user;
- public void selectShelfs(){
+ public void selectPublicShelves(){
+ model.resetModel(NavigationEnum.ANONYM, user, null, null, null, null);
+ }
+
+ public void selectShelves(){
model.resetModel(NavigationEnum.ALL_SHELFS, user, null, null, null, null);
}
Modified: trunk/examples/photoalbum/web/src/main/java/org/richfaces/photoalbum/manager/ShelfManager.java
===================================================================
--- trunk/examples/photoalbum/web/src/main/java/org/richfaces/photoalbum/manager/ShelfManager.java 2009-04-21 18:07:03 UTC (rev 13746)
+++ trunk/examples/photoalbum/web/src/main/java/org/richfaces/photoalbum/manager/ShelfManager.java 2009-04-21 18:40:38 UTC (rev 13747)
@@ -69,7 +69,7 @@
Events.instance().raiseEvent(Constants.SHELF_ADDED_EVENT, shelf);
}
- public List<Shelf> getAvailableShelfs(User user) {
+ public List<Shelf> getAvailableShelves(User user) {
return user.getShelves();
}
Modified: trunk/examples/photoalbum/web/src/main/java/org/richfaces/photoalbum/manager/TreeManager.java
===================================================================
--- trunk/examples/photoalbum/web/src/main/java/org/richfaces/photoalbum/manager/TreeManager.java 2009-04-21 18:07:03 UTC (rev 13746)
+++ trunk/examples/photoalbum/web/src/main/java/org/richfaces/photoalbum/manager/TreeManager.java 2009-04-21 18:40:38 UTC (rev 13747)
@@ -22,6 +22,6 @@
if(currentNode.equals(model.getSelectedAlbum()) || currentNode.equals(model.getSelectedShelf())){
return true;
}
- return null;
+ return false;
}
}
Modified: trunk/examples/photoalbum/web/src/main/java/org/richfaces/photoalbum/search/ImageSearchHelper.java
===================================================================
--- trunk/examples/photoalbum/web/src/main/java/org/richfaces/photoalbum/search/ImageSearchHelper.java 2009-04-21 18:07:03 UTC (rev 13746)
+++ trunk/examples/photoalbum/web/src/main/java/org/richfaces/photoalbum/search/ImageSearchHelper.java 2009-04-21 18:40:38 UTC (rev 13747)
@@ -68,6 +68,10 @@
Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, Constants.SEARCH_NO_OPTIONS_ERROR);
return;
}
+ if(!isWhereSearchOptionSelected()){
+ Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, Constants.SEARCH_NO_WHERE_OPTIONS_ERROR);
+ return;
+ }
keywords = new ArrayList<String>();
Events.instance().raiseEvent(Constants.UPDATE_MAIN_AREA_EVENT, NavigationEnum.SEARCH);
keywords = parse(searchQuery);
@@ -81,6 +85,10 @@
}
}
+ private boolean isWhereSearchOptionSelected() {
+ return seachInMyAlbums || searchInShared;
+ }
+
public void search(String keyword) {
if(!isSearchOptionSelected()){
Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, Constants.SEARCH_NO_OPTIONS_ERROR);
Modified: trunk/examples/photoalbum/web/src/main/java/org/richfaces/photoalbum/search/SearchOptionByShelf.java
===================================================================
--- trunk/examples/photoalbum/web/src/main/java/org/richfaces/photoalbum/search/SearchOptionByShelf.java 2009-04-21 18:07:03 UTC (rev 13746)
+++ trunk/examples/photoalbum/web/src/main/java/org/richfaces/photoalbum/search/SearchOptionByShelf.java 2009-04-21 18:40:38 UTC (rev 13747)
@@ -49,7 +49,7 @@
@Override
public void search(ISearchAction action, String searchQuery,
boolean searchInMyAlbums, boolean searchInShared) {
- List<Shelf> list = action.searchByShelfs(searchQuery, searchInMyAlbums, searchInShared);
+ List<Shelf> list = action.searchByShelves(searchQuery, searchInMyAlbums, searchInShared);
if(list != null){
setSearchResult(list);
}else{
Modified: trunk/examples/photoalbum/web/src/main/resources/messages_en.properties
===================================================================
--- trunk/examples/photoalbum/web/src/main/resources/messages_en.properties 2009-04-21 18:07:03 UTC (rev 13746)
+++ trunk/examples/photoalbum/web/src/main/resources/messages_en.properties 2009-04-21 18:40:38 UTC (rev 13747)
@@ -104,9 +104,12 @@
confirm.confirm=Confirmation:
confirm.ok=OK
confirm.cancel=Cancel
-
-album.edit=Edit
-album.delete=Delete
+shelf.edit=Edit shelf properties
+image.edit=Edit image
+shelf.delete=Delete shelf
+image.delete=Delete album
+album.edit=Edit album properties
+album.delete=Delete album
album.delete.confirm=Are you sure? All images associated with this album will also dropped! Click OK to proceed, else click Cancel.
album.add=Add album
album.edit.long=Edit Album:
@@ -115,18 +118,18 @@
album.shared=Shared:
album.owner=Owner:
album.desc=Short description:
-album.store=Store
+album.store=Save
album.cancel=Cancel
-image.delete=Delete
+image.delete=Delete Image
image.delete.confirm=Are you sure? Click OK to proceed, else click Cancel.
-image.edit=Edit Properties
+image.edit=Edit image properties
image.prop=Image Properties:
image.name=Name:
image.desc=Short Description:
image.album=Album
image.date=Created Date:
-image.store=Store
+image.store=Save
image.cancel=Cancel
image.save=Save
@@ -167,7 +170,7 @@
user.confirm.error=Confirm Password not equals password
user.sex=Sex
user.dontshowmail=Do not show to others
-user.informaboutnews=Inform me about news in PhotoAlbum Demo
+user.informaboutnews=Inform me about news in Photo Album Demo
user.changeavatar=Change avatar
menu.welcome=Welcome,
@@ -183,7 +186,7 @@
login_success=You are successfully registered.
wrong_dnd=That album isn't yours, so you can't change it's location
acess_not_granted=You have no rights to view this album
-album_addImage=Add image
+album_addImage=Add images
album_present=Album with this name already present!
album_show=Show album
album_viewProfile=View profile of owner
@@ -275,7 +278,7 @@
save=Save
add_album=Add album
delete_shelf=Delete shelf
-edit_shelf=Edit Shelf
+edit_shelf=Edit Shelf Properties
files_upload=Files upload
create=Create
file=File:
Modified: trunk/examples/photoalbum/web/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/examples/photoalbum/web/src/main/webapp/WEB-INF/web.xml 2009-04-21 18:07:03 UTC (rev 13746)
+++ trunk/examples/photoalbum/web/src/main/webapp/WEB-INF/web.xml 2009-04-21 18:40:38 UTC (rev 13747)
@@ -98,6 +98,11 @@
<param-name>org.richfaces.LoadScriptStrategy</param-name>
<param-value>ALL</param-value>
</context-param>
+
+ <context-param>
+ <param-name>org.richfaces.LoadStyleStrategy</param-name>
+ <param-value>ALL</param-value>
+ </context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
Modified: trunk/examples/photoalbum/web/src/main/webapp/includes/album/albumEditInfo.xhtml
===================================================================
(Binary files differ)
Modified: trunk/examples/photoalbum/web/src/main/webapp/includes/album/albumInfo.xhtml
===================================================================
(Binary files differ)
Modified: trunk/examples/photoalbum/web/src/main/webapp/includes/album/albumsList.xhtml
===================================================================
(Binary files differ)
Modified: trunk/examples/photoalbum/web/src/main/webapp/includes/album/createAlbum.xhtml
===================================================================
(Binary files differ)
Modified: trunk/examples/photoalbum/web/src/main/webapp/includes/contextMenu/CMForAlbum.xhtml
===================================================================
(Binary files differ)
Modified: trunk/examples/photoalbum/web/src/main/webapp/includes/contextMenu/CMForImage.xhtml
===================================================================
(Binary files differ)
Modified: trunk/examples/photoalbum/web/src/main/webapp/includes/contextMenu/CMForShelf.xhtml
===================================================================
(Binary files differ)
Modified: trunk/examples/photoalbum/web/src/main/webapp/includes/fileUpload/fileUploader.xhtml
===================================================================
(Binary files differ)
Modified: trunk/examples/photoalbum/web/src/main/webapp/includes/fileUpload/uploadResult.xhtml
===================================================================
(Binary files differ)
Modified: trunk/examples/photoalbum/web/src/main/webapp/includes/image/imageEditInfo.xhtml
===================================================================
(Binary files differ)
Modified: trunk/examples/photoalbum/web/src/main/webapp/includes/image/imageInfo.xhtml
===================================================================
(Binary files differ)
Modified: trunk/examples/photoalbum/web/src/main/webapp/includes/image/imageList.xhtml
===================================================================
(Binary files differ)
Modified: trunk/examples/photoalbum/web/src/main/webapp/includes/image/imageScroller.xhtml
===================================================================
--- trunk/examples/photoalbum/web/src/main/webapp/includes/image/imageScroller.xhtml 2009-04-21 18:07:03 UTC (rev 13746)
+++ trunk/examples/photoalbum/web/src/main/webapp/includes/image/imageScroller.xhtml 2009-04-21 18:40:38 UTC (rev 13747)
@@ -29,7 +29,7 @@
<a4j:support event="onclick"
rendered="#{model.selectedImage != img}"
- reRender="mainImage, imagesTable"
+ reRender="mainImage,treeform, imagesTable"
action="#{controller.showImage(img)}" />
</a4j:outputPanel>
</a4j:repeat>
Modified: trunk/examples/photoalbum/web/src/main/webapp/includes/image/slideshow.xhtml
===================================================================
(Binary files differ)
Modified: trunk/examples/photoalbum/web/src/main/webapp/includes/index/login.xhtml
===================================================================
(Binary files differ)
Modified: trunk/examples/photoalbum/web/src/main/webapp/includes/index/menu.xhtml
===================================================================
(Binary files differ)
Modified: trunk/examples/photoalbum/web/src/main/webapp/includes/index/tree.xhtml
===================================================================
(Binary files differ)
Modified: trunk/examples/photoalbum/web/src/main/webapp/includes/misc/confirmation.xhtml
===================================================================
(Binary files differ)
Modified: trunk/examples/photoalbum/web/src/main/webapp/includes/search/result/albumsResult.xhtml
===================================================================
--- trunk/examples/photoalbum/web/src/main/webapp/includes/search/result/albumsResult.xhtml 2009-04-21 18:07:03 UTC (rev 13746)
+++ trunk/examples/photoalbum/web/src/main/webapp/includes/search/result/albumsResult.xhtml 2009-04-21 18:40:38 UTC (rev 13747)
@@ -11,7 +11,7 @@
<h:panelGroup>
<a4j:commandLink
actionListener="#{controller.showAlbum(album)}"
- reRender="mainArea, tree">
+ reRender="mainArea, treeform">
<a4j:mediaOutput rendered="#{!album.isEmpty()}" id="img" element="img"
createContent="#{imageLoader.paintImage}"
styleClass="album-cover-image"
Modified: trunk/examples/photoalbum/web/src/main/webapp/includes/search/result/imageResult.xhtml
===================================================================
--- trunk/examples/photoalbum/web/src/main/webapp/includes/search/result/imageResult.xhtml 2009-04-21 18:07:03 UTC (rev 13746)
+++ trunk/examples/photoalbum/web/src/main/webapp/includes/search/result/imageResult.xhtml 2009-04-21 18:40:38 UTC (rev 13747)
@@ -18,7 +18,7 @@
<h:panelGroup>
<a4j:commandLink
actionListener="#{controller.showImage(image)}"
- reRender="mainArea, tree">
+ reRender="mainArea, treeform">
<a4j:mediaOutput id="img" element="img"
createContent="#{imageLoader.paintImage}"
style="border : 2px solid #FFFFFF;"
Modified: trunk/examples/photoalbum/web/src/main/webapp/includes/search/result/userResult.xhtml
===================================================================
--- trunk/examples/photoalbum/web/src/main/webapp/includes/search/result/userResult.xhtml 2009-04-21 18:07:03 UTC (rev 13746)
+++ trunk/examples/photoalbum/web/src/main/webapp/includes/search/result/userResult.xhtml 2009-04-21 18:40:38 UTC (rev 13747)
@@ -28,7 +28,7 @@
</h:outputText>
</h:panelGroup>
<h:panelGroup layout="block" styleClass="photo_data">
- <a4j:commandLink reRender="tree, mainArea" actionListener="#{controller.showSharedAlbums(searchedUser)}" ><h:outputText value="#{searchedUser.sharedAlbums.size} #{messages['albums_small']} "/></a4j:commandLink> | <a4j:commandLink reRender="mainArea" actionListener="#{controller.showSharedImages(searchedUser)}"><h:outputText value="#{searchedUser.sharedImages.size} #{messages['photos']}"/></a4j:commandLink>
+ <a4j:commandLink reRender="treeform, mainArea" actionListener="#{controller.showSharedAlbums(searchedUser)}" ><h:outputText value="#{searchedUser.sharedAlbums.size} #{messages['albums_small']} "/></a4j:commandLink> | <a4j:commandLink reRender="mainArea" actionListener="#{controller.showSharedImages(searchedUser)}"><h:outputText value="#{searchedUser.sharedImages.size} #{messages['photos']}"/></a4j:commandLink>
</h:panelGroup>
</h:panelGroup>
</a4j:repeat>
Modified: trunk/examples/photoalbum/web/src/main/webapp/includes/search/searchWidget.xhtml
===================================================================
(Binary files differ)
Modified: trunk/examples/photoalbum/web/src/main/webapp/includes/shelf/createShelf.xhtml
===================================================================
(Binary files differ)
Modified: trunk/examples/photoalbum/web/src/main/webapp/includes/shelf/shelfEditInfo.xhtml
===================================================================
--- trunk/examples/photoalbum/web/src/main/webapp/includes/shelf/shelfEditInfo.xhtml 2009-04-21 18:07:03 UTC (rev 13746)
+++ trunk/examples/photoalbum/web/src/main/webapp/includes/shelf/shelfEditInfo.xhtml 2009-04-21 18:40:38 UTC (rev 13747)
@@ -52,8 +52,8 @@
</td>
<td valign="top" align="right" colspan="2" style="padding : 10px;">
- <richx:commandButton id="cancelButton" value="#{messages['cancel']}" style="float: left" immediate="true" actionListener="#{controller.cancelEditShelf()}" reRender="mainArea" />
- <richx:commandButton id="saveButton" value="#{messages['save']}" actionListener="#{shelfManager.editShelf(model.selectedShelf)}" reRender="mainArea" />
+ <richx:commandButton id="saveButton" style="float: left" value="#{messages['save']}" actionListener="#{shelfManager.editShelf(model.selectedShelf)}" reRender="mainArea" />
+ <richx:commandButton id="cancelButton" value="#{messages['cancel']}" immediate="true" actionListener="#{controller.cancelEditShelf()}" reRender="mainArea" />
</td>
</tr>
</table>
Modified: trunk/examples/photoalbum/web/src/main/webapp/includes/shelf/shelfInfo.xhtml
===================================================================
(Binary files differ)
15 years, 8 months
JBoss Rich Faces SVN: r13746 - trunk/examples/photoalbum/web/src/main/webapp/stylesheet.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2009-04-21 14:07:03 -0400 (Tue, 21 Apr 2009)
New Revision: 13746
Modified:
trunk/examples/photoalbum/web/src/main/webapp/stylesheet/photoalbum.css
Log:
fix layout
Modified: trunk/examples/photoalbum/web/src/main/webapp/stylesheet/photoalbum.css
===================================================================
--- trunk/examples/photoalbum/web/src/main/webapp/stylesheet/photoalbum.css 2009-04-21 18:03:52 UTC (rev 13745)
+++ trunk/examples/photoalbum/web/src/main/webapp/stylesheet/photoalbum.css 2009-04-21 18:07:03 UTC (rev 13746)
@@ -1,6 +1,5 @@
.main-body {
margin: 0px;
- background: url(../img/shell/page_bg.gif) repeat-x #D7D7D7;
height: 100%;
}
@@ -8,7 +7,8 @@
height: 116px;
border: none;
padding: 0px;
- background: none;
+ background: url(../img/shell/page_bg.gif) repeat-x #D7D7D7;
+
}
.header-panel-body {
@@ -74,6 +74,10 @@
background: url(../img/shell/general_panel_bg.gif) right top repeat-y;
}
+.main-panel {
+ background: url(../img/shell/panel_bg.gif) right top;
+}
+
.body-main-panel {
height: 100%;
@@ -82,9 +86,12 @@
background-color: transparent;
}
+.panel-header-bg {
+ background: url(../img/shell/general_panel_header_bg.gif) repeat-x right top;
+}
+
.body-main-panel-header {
height: 15px;
- background: url(../img/shell/general_panel_header_bg.gif) right top;
font-size: 1px;
padding: 0px;
border: none;
@@ -450,7 +457,7 @@
.search-input {
border: 0px none ;
- background: transparent none repeat scroll 0% 0%;
+ background: transparent url('../img/spacer.gif') repeat scroll 0% 0%;
width: 176px;
height: 17px;
position: absolute;
15 years, 8 months
JBoss Rich Faces SVN: r13745 - trunk/examples/photoalbum/web/src/main/webapp/layout.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2009-04-21 14:03:52 -0400 (Tue, 21 Apr 2009)
New Revision: 13745
Modified:
trunk/examples/photoalbum/web/src/main/webapp/layout/template.xhtml
Log:
fix layout
Modified: trunk/examples/photoalbum/web/src/main/webapp/layout/template.xhtml
===================================================================
(Binary files differ)
15 years, 8 months