JBoss Rich Faces SVN: r14155 - in trunk/examples/photoalbum/source/web/src/main/webapp: includes/misc and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2009-05-13 08:14:22 -0400 (Wed, 13 May 2009)
New Revision: 14155
Modified:
trunk/examples/photoalbum/source/web/src/main/webapp/includes/misc/errorPanel.xhtml
trunk/examples/photoalbum/source/web/src/main/webapp/index.xhtml
trunk/examples/photoalbum/source/web/src/main/webapp/layout/template.xhtml
Log:
Modified: trunk/examples/photoalbum/source/web/src/main/webapp/includes/misc/errorPanel.xhtml
===================================================================
(Binary files differ)
Modified: trunk/examples/photoalbum/source/web/src/main/webapp/index.xhtml
===================================================================
(Binary files differ)
Modified: trunk/examples/photoalbum/source/web/src/main/webapp/layout/template.xhtml
===================================================================
(Binary files differ)
15 years, 8 months
JBoss Rich Faces SVN: r14154 - trunk/examples/photoalbum/source.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2009-05-13 08:10:02 -0400 (Wed, 13 May 2009)
New Revision: 14154
Modified:
trunk/examples/photoalbum/source/readme.txt
Log:
added info to the readme file
https://jira.jboss.org/jira/browse/RF-7112
Modified: trunk/examples/photoalbum/source/readme.txt
===================================================================
--- trunk/examples/photoalbum/source/readme.txt 2009-05-13 12:09:36 UTC (rev 14153)
+++ trunk/examples/photoalbum/source/readme.txt 2009-05-13 12:10:02 UTC (rev 14154)
@@ -0,0 +1,42 @@
+The Photo Album application: sort description
+
+
+
+1 Building and Running the application
+
+
+1.1. Requirements
+
+-Maven 2.0.9 or later
+-JBoss Application server 4.2.3 or 5.0
+
+1.2 Optional Additional Software
+- svn client( only if you want to build the application with a full set of images)
+- Eclipse IDE + JBoss Tools (to explore and run the application in IDE)
+
+
+1.3 Building the application
+
+By default Photo Album is assembled with a limited set of images (4-5 in each album). In order to build the version of the application with a full set of images you need to use livedemo profile while building Photo Album(details further in the text).
+
+To build the project you need to and run
+
+mvn clean install
+
+in the current folder.
+
+When you see the BUILD SUCCESSFUL message you can deploy the application on the server. You can deploy it on the server by copying the photoalbum/sources/ear/target/photoalbum-ear-1.0-SNAPSHOT.ear file to the JBOSS_HOME/server/default/deploy folder. Then, launch the run.bat file from JBOSS_HOME/bin/ directory to start the server.
+
+To build the project with a full set of images you need to run
+
+mvn clean install -Plivedemo
+
+To make sure the project is built successfully you need to have a SVN client installed on your local machine, for example Subversion. To launch the application use the instructions given above.
+
+In order to explore, run and deploy the application in Eclipse IDE build it with the
+ mvn clean install eclipse:clean eclipse:eclipse eclipse:eclipse
+
+command and import the project to the IDE. More details you can find in the JBoss Server Manager Reference Guide (http://download.jboss.org/jbosstools/nightly-docs/en/as/html/index.html)
+
+
+
15 years, 8 months
JBoss Rich Faces SVN: r14153 - trunk/examples/photoalbum.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2009-05-13 08:09:36 -0400 (Wed, 13 May 2009)
New Revision: 14153
Modified:
trunk/examples/photoalbum/readme.txt
Log:
added info to the readme file
https://jira.jboss.org/jira/browse/RF-7112
Modified: trunk/examples/photoalbum/readme.txt
===================================================================
--- trunk/examples/photoalbum/readme.txt 2009-05-13 12:06:23 UTC (rev 14152)
+++ trunk/examples/photoalbum/readme.txt 2009-05-13 12:09:36 UTC (rev 14153)
@@ -0,0 +1,41 @@
+The Photo Album application: sort description
+
+
+
+1 Building and Running the application
+
+
+1.1. Requirements
+
+-Maven 2.0.9 or later
+-JBoss Application server 4.2.3 or 5.0
+
+1.2 Optional Additional Software
+-svn client( only if you want to build the application with a full set of images)
+- Eclipse IDE + JBoss Tools (to explore and run the application in IDE)
+
+
+
+1.3 Building the application
+
+By default Photo Album is assembled with a limited set of images (4-5 in each album). In order to build the version of the application with a full set of images you need to use livedemo profile while building Photo Album(details further in the text).
+
+To build the project you need to navigate to the examples/photoalbum/source/ and run
+
+mvn clean install
+
+When you see the BUILD SUCCESSFUL message you can deploy the application on the server. You can deploy it on the server by copying the photoalbum/sources/ear/target/photoalbum-ear-1.0-SNAPSHOT.ear file to the JBOSS_HOME/server/default/deploy folder. Then, launch the run.bat file from JBOSS_HOME/bin/ directory to start the server.
+
+To build the project with a full set of images you need to run
+
+mvn clean install -Plivedemo
+
+To make sure the project is built successfully you need to have a SVN client installed on your local machine, for example Subversion. To launch the application use the instructions given above.
+
+In order to explore, run and deploy the application in Eclipse IDE build it with the
+ mvn clean install eclipse:clean eclipse:eclipse eclipse:eclipse
+
+command and import the project to the IDE. More details you can find in the JBoss Server Manager Reference Guide (http://download.jboss.org/jbosstools/nightly-docs/en/as/html/index.html)
+
+
+
15 years, 8 months
JBoss Rich Faces SVN: r14152 - trunk/examples.
by richfaces-svn-commits@lists.jboss.org
Author: msorokin
Date: 2009-05-13 08:06:23 -0400 (Wed, 13 May 2009)
New Revision: 14152
Added:
trunk/examples/readme.txt
Log:
added readme file
https://jira.jboss.org/jira/browse/RF-7112
Added: trunk/examples/readme.txt
===================================================================
--- trunk/examples/readme.txt (rev 0)
+++ trunk/examples/readme.txt 2009-05-13 12:06:23 UTC (rev 14152)
@@ -0,0 +1,35 @@
+1. Introduction
+This folder contains real world applications developed using RichFaces library. The primary purpose of the applications is to demonstrate that RichFaces is a library designed to rapidly develop high quality web applications with rich user interface.
+
+2. Building and Running Examples
+
+2.1 Requirements
+
+- Maven 2.0.9 or later
+- JBoss Application Server (4.2.3.GA, 5.0.x.GA)
+
+You can import the application into your favorite IDE. We recommend using Eclipse IDE and JBoss Tools as they are specially tailored to fully support the technologies used in the applications.
+
+2.2 Building Application
+
+To build an application you need to run
+
+mvn clean install
+
+in the folder that contains the application you are intending to build.
+
+If you would like to build a application for Eclipse IDE you need to run
+
+mvn clean install eclipse:clean eclipse:eclipse
+
+When you see the BUILD SUCCESSFUL message you can run the built application on the Jboss Application server either manually or from IDE.
+Let's take the Photo Album application as an example.
+To run the application you need to deploy it on the server by copying the photoalbum/sources/ear/target/photoalbum-ear-1.0-SNAPSHOT.ear file to the JBOSS_HOME/server/default/deploy folder. Launch the run.bat file from JBOSS_HOME/bin/ directory to start the server.
+To explore the application start your favorite browser and point it to http://localhost:8080/photoalbum.
+In order to explore, run and deploy the application in Eclipse IDE build it with the
+
+ mvn clean install eclipse:clean eclipse:eclipse eclipse:eclipse command
+
+and import the project to the IDE. More details you can find in the JBoss Server Manager Reference Guide (http://download.jboss.org/jbosstools/nightly-docs/en/as/html/index.html)
+
+
\ No newline at end of file
15 years, 8 months
JBoss Rich Faces SVN: r14151 - in trunk/examples/photoalbum/source/web/src/main: java/org/richfaces/photoalbum/ui and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2009-05-13 07:53:15 -0400 (Wed, 13 May 2009)
New Revision: 14151
Modified:
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/Authenticator.java
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/Controller.java
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/DnDManager.java
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/FileManager.java
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/FileUploadManager.java
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/ImageManager.java
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/Model.java
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/NavigationEnum.java
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/SlideshowManager.java
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/UserManager.java
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/ui/DirectLinkHelper.java
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/ui/EditorBean.java
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/ui/ErrorHandlerBean.java
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/ui/Help.java
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/ui/ImageLoader.java
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/ui/ImageSizeHelper.java
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/ui/UserPrefsHelper.java
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/util/Environment.java
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/util/FileUtils.java
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/util/HashUtils.java
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/util/ImageDimension.java
trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/util/SessionListener.java
trunk/examples/photoalbum/source/web/src/main/webapp/includes/help/errorHelp.xhtml
trunk/examples/photoalbum/source/web/src/main/webapp/includes/image/imageInfo.xhtml
trunk/examples/photoalbum/source/web/src/main/webapp/includes/misc/errorPanel.xhtml
trunk/examples/photoalbum/source/web/src/main/webapp/includes/misc/modalPanels.xhtml
trunk/examples/photoalbum/source/web/src/main/webapp/index.xhtml
Log:
Modified: trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/Authenticator.java
===================================================================
--- trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/Authenticator.java 2009-05-13 08:55:07 UTC (rev 14150)
+++ trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/Authenticator.java 2009-05-13 11:53:15 UTC (rev 14151)
@@ -19,7 +19,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package org.richfaces.photoalbum.manager;
-
+/**
+ * Class encapsulated all functionality, related to working with authenticating/registering users.
+ *
+ * @author Andrey Markhel
+ */
import java.io.File;
import java.io.Serializable;
@@ -33,7 +37,6 @@
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Out;
import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.annotations.web.RequestParameter;
import org.jboss.seam.contexts.Contexts;
import org.jboss.seam.core.Events;
import org.jboss.seam.faces.FacesMessages;
@@ -51,11 +54,7 @@
private static final long serialVersionUID = -4585673256547342140L;
- @RequestParameter
- protected Long startConversation;
-
- @In
- @Out
+ @In @Out
User user;
@In
@@ -74,18 +73,27 @@
private boolean conversationStarted = false;
+ /**
+ * Method, that invoked when user try to login to the application.
+ * @return boolean indicator, that denotative is user succesfully loginned to the system.
+ *
+ */
public boolean authenticate() {
try {
- user = userAction.login(credentials.getUsername(), HashUtils
- .hash(credentials.getPassword()));
+ //If user with this login and password exist, the user object will be returned
+ user = userAction.login(credentials.getUsername(), HashUtils.hash(credentials.getPassword()));
if (user != null) {
+ //This check is actual only on livedemo server to prevent hacks.
+ //Check if pre-defined user login.
if (Environment.isInProduction() && user.isPreDefined()) {
+ //If true assume that login failed
loginFailed();
return false;
}
identity.addRole(Constants.ADMIN_ROLE);
- Events.instance().raiseEvent(Constants.AUTHENTICATED_EVENT,
- user);
+ //Raise event to controller to update Model
+ Events.instance().raiseEvent(Constants.AUTHENTICATED_EVENT, user);
+ //Login was succesfull
setLoginFailed(false);
return true;
}
@@ -96,70 +104,95 @@
return false;
}
+ /**
+ * Method, that invoked when user logout from application.
+ * @return outcome string to redirect.
+ *
+ */
public String logout() {
identity.logout();
setConversationStarted(false);
return Constants.LOGOUT_OUTCOME;
}
+ /**
+ * Method, that invoked when user try to register in the application.
+ * If registration was successfull, user immediately will be loginned to the system.
+ * @param user - user object, that will be passed to registration procedure.
+ *
+ */
public void register(User user) {
+ //Checks
if (checkPassword(user) || checkUserExist(user)
|| checkEmailExist(user.getEmail())) {
return;
}
user.setPasswordHash(HashUtils.hash(user.getPassword()));
+ //This check is actual only on livedemo server to prevent hacks.
+ //Only admins can mark user as pre-defined
user.setPreDefined(false);
- File avatarData = (File) Contexts.getConversationContext().get(
- Constants.AVATAR_DATA_COMPONENT);
- if (avatarData != null) {
- user.setHasAvatar(true);
- FileManager fileManager = (FileManager) Contexts
- .getApplicationContext().get(
- Constants.FILE_MANAGER_COMPONENT);
- if (fileManager == null
- || !fileManager.saveAvatar(avatarData, user)) {
- Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT,
- Constants.AVATAR_SAVING_ERROR);
- return;
- }
+ if(!handleAvatar(user)){
+ return;
}
try {
userAction.register(user);
} catch (Exception e) {
- Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT,
- Constants.REGISTRATION_ERROR);
+ Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, Constants.REGISTRATION_ERROR);
return;
}
+ //Registration was successfull, so we can login this user.
credentials.setPassword(user.getPassword());
credentials.setUsername(user.getLogin());
try {
identity.authenticate();
} catch (LoginException e) {
- Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT,
- Constants.LOGIN_ERROR);
+ Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, Constants.LOGIN_ERROR);
}
}
+ /**
+ * Method, that invoked when user want to go to the registration screen
+ *
+ */
public void goToRegister() {
+ //create new User object
user = new User();
- Contexts.getConversationContext().set(Constants.AVATAR_DATA_COMPONENT,
- null);
+ //Clear avatarData component in conversation scope
+ Contexts.getConversationContext().set(Constants.AVATAR_DATA_COMPONENT, null);
setLoginFailed(false);
+ //raise event to controller to prepare Model.
Events.instance().raiseEvent(Constants.START_REGISTER_EVENT);
}
+ /**
+ * Method, that invoked when new conversation is started.
+ * This method prevent instantiation of couples of conversations when user refresh the whole page.
+ *
+ * @return string outcome to properly redirect on the current page(to assign to page parameters conversationId.
+ */
public String startConversation() {
- Events.instance().raiseEvent(Constants.UPDATE_MAIN_AREA_EVENT,
- NavigationEnum.ANONYM);
+ Events.instance().raiseEvent(Constants.UPDATE_MAIN_AREA_EVENT, NavigationEnum.ANONYM);
setConversationStarted(true);
return "";
}
+ private boolean handleAvatar(User user) {
+ File avatarData = (File) Contexts.getConversationContext().get(Constants.AVATAR_DATA_COMPONENT);
+ if (avatarData != null) {
+ user.setHasAvatar(true);
+ FileManager fileManager = (FileManager) Contexts.getApplicationContext().get(Constants.FILE_MANAGER_COMPONENT);
+ if (fileManager == null || !fileManager.saveAvatar(avatarData, user)) {
+ Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, Constants.AVATAR_SAVING_ERROR);
+ return false;
+ }
+ }
+ return true;
+ }
+
private boolean checkUserExist(User user) {
if (userAction.isUserExist(user.getLogin())) {
- addFacesMessage(Constants.REGISTER_LOGIN_NAME_ID,
- Constants.USER_WITH_THIS_LOGIN_ALREADY_EXIST);
+ addFacesMessage(Constants.REGISTER_LOGIN_NAME_ID, Constants.USER_WITH_THIS_LOGIN_ALREADY_EXIST);
return true;
}
return false;
@@ -167,8 +200,7 @@
private boolean checkEmailExist(String email) {
if (userAction.isEmailExist(email)) {
- addFacesMessage(Constants.REGISTER_EMAIL_ID,
- Constants.USER_WITH_THIS_EMAIL_ALREADY_EXIST);
+ addFacesMessage(Constants.REGISTER_EMAIL_ID, Constants.USER_WITH_THIS_EMAIL_ALREADY_EXIST);
return true;
}
return false;
@@ -177,19 +209,13 @@
private void addFacesMessage(String componentId, String message) {
UIComponent root = FacesContext.getCurrentInstance().getViewRoot();
UIComponent component = root.findComponent(componentId);
- FacesContext
- .getCurrentInstance()
- .addMessage(
- component
- .getClientId(FacesContext.getCurrentInstance()),
- new FacesMessage(FacesMessage.SEVERITY_ERROR, message,
- message));
+ FacesContext.getCurrentInstance().addMessage(component
+ .getClientId(FacesContext.getCurrentInstance()),new FacesMessage(FacesMessage.SEVERITY_ERROR, message, message));
}
private boolean checkPassword(User user) {
if (!user.getPassword().equals(user.getConfirmPassword())) {
- addFacesMessage(Constants.REGISTER_CONFIRM_PASSWORD_ID,
- Constants.CONFIRM_PASSWORD_NOT_EQUALS_PASSWORD);
+ addFacesMessage(Constants.REGISTER_CONFIRM_PASSWORD_ID, Constants.CONFIRM_PASSWORD_NOT_EQUALS_PASSWORD);
return true;
}
return false;
Modified: trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/Controller.java
===================================================================
--- trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/Controller.java 2009-05-13 08:55:07 UTC (rev 14150)
+++ trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/Controller.java 2009-05-13 11:53:15 UTC (rev 14151)
@@ -38,7 +38,12 @@
import org.richfaces.photoalbum.domain.Shelf;
import org.richfaces.photoalbum.domain.User;
import org.richfaces.photoalbum.service.Constants;
-
+/**
+ * This class represent 'C' in MVC pattern. It is logic that determine what actions invoked and what next page need to be showed.
+ * Typically on almost all user actions, this class populates the model and determine new view to show.
+ * Also contain utility logic, such as checking is the given shelf belongs to the specified user etc..
+ * @author Andrey Markhel
+ */
@Name("controller")
@Scope(ScopeType.EVENT)
public class Controller implements Serializable{
@@ -49,22 +54,38 @@
@In(scope = ScopeType.SESSION) User user;
+ /**
+ * This method invoked after the user want to see all predefined shelves, existed in application
+ */
public void selectPublicShelves(){
model.resetModel(NavigationEnum.ANONYM, user, null, null, null, null);
}
+ /**
+ * This method invoked after the user want to see all her shelves.
+ */
public void selectShelves(){
model.resetModel(NavigationEnum.ALL_SHELFS, user, null, null, null, null);
}
+ /**
+ * This method invoked after the user want to see all her albums.
+ */
public void selectAlbums(){
model.resetModel(NavigationEnum.ALL_ALBUMS, user, null, null, null, null);
}
+ /**
+ * This method invoked after the user want to see all her images.
+ */
public void selectImages(){
model.resetModel(NavigationEnum.ALL_IMAGES, user, null, null, null, user.getImages() );
}
+ /**
+ * This method invoked after the user want to edit specified shelf.
+ * @param shelf - shelf to edit
+ */
@Restrict("#{s:hasRole('admin')}")
public void startEditShelf(Shelf shelf){
if(!canViewShelf(shelf)){
@@ -74,16 +95,25 @@
model.resetModel(NavigationEnum.SHELF_EDIT, shelf.getOwner(), shelf, null, null, null);
}
+ /**
+ * This method invoked after the user want to interrupt edit shelf process
+ *
+ */
public void cancelEditShelf(){
model.resetModel(NavigationEnum.SHELF_PREVIEW, model.getSelectedShelf().getOwner(), model.getSelectedShelf(), null, null, null);
}
+ /**
+ * This method invoked after the user want to see specified album independently is it her album or not.
+ * @param album - album to show
+ */
public void showAlbum(Album album){
if(!canViewAlbum(album)){
pushEvent(Constants.ADD_ERROR_EVENT, Constants.HAVENT_ACCESS);
return;
}
FileManager fileManager = (FileManager)Contexts.getApplicationContext().get(Constants.FILE_MANAGER_COMPONENT);
+ //Check, that album was not deleted recently.
if(!fileManager.isDirectoryPresent(album.getPath())){
pushEvent(Constants.ADD_ERROR_EVENT, Constants.ALBUM_RECENTLY_DELETED_ERROR);
model.resetModel(NavigationEnum.SHELF_PREVIEW, album.getOwner(), album.getShelf(), null, null, null);
@@ -92,16 +122,26 @@
model.resetModel(NavigationEnum.ALBUM_PREVIEW, album.getOwner(), album.getShelf(), album, null, album.getImages());
}
+ /**
+ * This method invoked in cases, when it is need to clear fileUpload component
+ *
+ */
public void resetFileUpload(){
pushEvent(Constants.CLEAR_FILE_UPLOAD_EVENT);
}
+ /**
+ * This method invoked after the user want to see specified image independently is it her image or not.
+ * @param album - album to show
+ */
public void showImage(Image image){
+ //Clear not-saved comment in editor
pushEvent(Constants.CLEAR_EDITOR_EVENT, "");
if(!canViewImage(image)){
pushEvent(Constants.ADD_ERROR_EVENT, Constants.HAVENT_ACCESS);
return;
}
+ //Check, that image was not deleted recently
final FileManager fileManager = (FileManager)Contexts.getApplicationContext().get(Constants.FILE_MANAGER_COMPONENT);
if(!fileManager.isFilePresent(image.getFullPath())){
pushEvent(Constants.ADD_ERROR_EVENT, Constants.IMAGE_RECENTLY_DELETED_ERROR);
@@ -112,6 +152,10 @@
image.setVisited(true);
}
+ /**
+ * This method invoked after the user want to edit specified image.
+ * @param image - image to edit
+ */
@Restrict("#{s:hasRole('admin')}")
public void startEditImage(Image image){
if(!canViewImage(image)){
@@ -121,21 +165,37 @@
model.resetModel(NavigationEnum.ALBUM_IMAGE_EDIT, image.getOwner(), image.getAlbum().getShelf(), image.getAlbum(), image, image.getAlbum().getImages());
}
+ /**
+ * This method invoked after the user want to save just edited user to database.
+ *
+ */
@Restrict("#{s:hasRole('admin')}")
public void editUser(){
pushEvent(Constants.EDIT_USER_EVENT);
model.resetModel(NavigationEnum.ALL_SHELFS, user, model.getSelectedShelf(), model.getSelectedAlbum(), model.getSelectedImage(), model.getImages());
}
+ /**
+ * This method invoked after the user want to interrupt edit user process
+ *
+ */
public void cancelEditUser(){
pushEvent(Constants.CANCEL_EDIT_USER_EVENT);
model.resetModel(NavigationEnum.ANONYM, user, null, null, null, null);
}
+ /**
+ * This method invoked after the user want to interrupt edit image process
+ *
+ */
public void cancelEditImage(){
model.resetModel(NavigationEnum.ALBUM_IMAGE_PREVIEW, model.getSelectedImage().getAlbum().getShelf().getOwner(), model.getSelectedImage().getAlbum().getShelf(), model.getSelectedImage().getAlbum(), model.getSelectedImage(), model.getSelectedImage().getAlbum().getImages() );
}
+ /**
+ * This method invoked after the user want to see specified shelf independently is it her shelf or not.
+ * @param album - album to show
+ */
public void showShelf(Shelf shelf){
final FileManager fileManager = (FileManager)Contexts.getApplicationContext().get(Constants.FILE_MANAGER_COMPONENT);
if(!fileManager.isDirectoryPresent(shelf.getPath())){
@@ -146,6 +206,10 @@
model.resetModel(NavigationEnum.SHELF_PREVIEW, shelf.getOwner(), shelf, null, null, null);
}
+ /**
+ * This method invoked after the user want to edit specified album.
+ * @param album - album to edit
+ */
@Restrict("#{s:hasRole('admin')}")
public void startEditAlbum(Album album){
if(!album.isOwner(user)) {
@@ -155,71 +219,110 @@
model.resetModel(NavigationEnum.ALBUM_EDIT, album.getOwner(), album.getShelf(), album, null, album.getImages());
}
+ /**
+ * This method invoked after the user want to interrupt edit album process
+ *
+ */
public void cancelEditAlbum(){
model.resetModel(NavigationEnum.ALBUM_PREVIEW, model.getSelectedAlbum().getOwner(), model.getSelectedAlbum().getShelf(), model.getSelectedAlbum(), null, model.getSelectedAlbum().getImages());
}
+ /**
+ * This method observes <code>Constants.ALBUM_ADDED_EVENT</code> and invoked after the user add new album
+ * @param album - added album
+ */
@Observer(Constants.ALBUM_ADDED_EVENT)
public void onAlbumAdded(Album album){
model.resetModel(NavigationEnum.ALBUM_PREVIEW, album.getOwner(), album.getShelf(), album, null, album.getImages());
}
+ /**
+ * This method observes <code>Constants.ALBUM_EDITED_EVENT</code> and invoked after the user edit her album
+ * @param album - edited album
+ */
@Observer(Constants.ALBUM_EDITED_EVENT)
public void onAlbumEdited(Album album){
model.resetModel(NavigationEnum.ALBUM_PREVIEW, model.getSelectedUser(), model.getSelectedShelf(), album, null, album.getImages());
}
+ /**
+ * This method observes <code>Constants.ALBUM_DELETED_EVENT</code> and invoked after the user delete her album
+ * @param album - deleted album
+ * @param path - relative path of the album directory
+ */
@Observer(Constants.ALBUM_DELETED_EVENT)
public void onAlbumDeleted(Album album, String path){
model.resetModel(NavigationEnum.ALL_ALBUMS, model.getSelectedUser(), model.getSelectedShelf(), null, null, null);
}
+ /**
+ * This method observes <code>Constants.SHELF_DELETED_EVENT</code> and invoked after the user delete her shelf
+ * @param shelf - deleted shelf
+ * @param path - relative path of the shelf directory
+ */
@Observer(Constants.SHELF_DELETED_EVENT)
public void onShelfDeleted(Shelf shelf, String path){
model.resetModel(NavigationEnum.ALL_SHELFS, model.getSelectedUser(), null, null, null, null);
}
+ /**
+ * This method observes <code>Constants.SHELF_ADDED_EVENT</code> and invoked after the user add new shelf
+ * @param shelf - added shelf
+ */
@Observer(Constants.SHELF_ADDED_EVENT)
public void onShelfAdded(Shelf shelf){
model.resetModel(NavigationEnum.SHELF_PREVIEW, shelf.getOwner(), shelf, null, null, null);
}
+ /**
+ * This method observes <code>Constants.SHELF_EDITED_EVENT</code> and invoked after the user edit her shelf
+ * @param shelf - edited shelf
+ */
@Observer(Constants.SHELF_EDITED_EVENT)
public void onShelfEdited(Shelf shelf){
model.resetModel(NavigationEnum.SHELF_PREVIEW, shelf.getOwner(), shelf, null, null, null);
}
+ /**
+ * This method observes <code>Constants.IMAGE_DELETED_EVENT</code> and invoked after the user delete her image
+ * @param image - deleted image
+ * @param path - relative path of the image file
+ */
@Observer(Constants.IMAGE_DELETED_EVENT)
public void onImageDeleted(Image image, String path){
model.resetModel(NavigationEnum.ALBUM_PREVIEW, model.getSelectedUser(), model.getSelectedShelf(), model.getSelectedAlbum(), null, model.getSelectedAlbum().getImages());
}
+ /**
+ * This method observes <code>Constants.AUTHENTICATED_EVENT</code> and invoked after the user successfully authenticate to the system
+ * @param u - authenticated user
+ */
@Observer(Constants.AUTHENTICATED_EVENT)
public void onAuthenticate(User u){
model.resetModel(NavigationEnum.ALL_SHELFS, u, null, null, null, null);
}
+ /**
+ * This method invoked after the user want to go to the file-upload page
+ *
+ */
public void showFileUpload(){
if(!(user.getShelves().size() > 0)){
+ //If user have no shelves, that can start fileupload process
pushEvent(Constants.ADD_ERROR_EVENT, Constants.FILE_UPLOAD_SHOW_ERROR);
return;
}
Album alb = null;
- if(isUserAlbum(model.getSelectedAlbum())){
- alb = model.getSelectedAlbum();
- }
- if(alb == null){
- if(user != null && user.getShelves().size() > 0 && user.getShelves().get(0).getAlbums().size() > 0)
- for(Shelf s : user.getShelves()){
- if(s.getAlbums().size() > 0){
- alb = s.getAlbums().get(0);
- break;
- }
- }
- }
+ //If selected album belongs to user
+ alb = setDefaultAlbumToUpload(alb);
model.resetModel(NavigationEnum.FILE_UPLOAD, user, alb.getShelf(), alb, null, alb.getImages());
- }
+ }
+ /**
+ * This method invoked after the user want to go to the file-upload page and download images to the specified album
+ * @param album - selected album
+ *
+ */
public void showFileUpload(Album album){
if(!isUserAlbum(album)){
showError(Constants.YOU_CAN_T_ADD_IMAGES_TO_THAT_ALBUM_ERROR);
@@ -228,45 +331,92 @@
model.resetModel(NavigationEnum.FILE_UPLOAD, album.getShelf().getOwner(), album.getShelf(), album, null, album.getImages());
}
+ /**
+ * This method invoked after the user want to see all shared albums of the specified user
+ * @param user - user to see
+ *
+ */
public void showSharedAlbums(User user){
model.resetModel(NavigationEnum.USER_SHARED_ALBUMS, user, null, null, null, user.getSharedImages());
}
+ /**
+ * This method invoked after the user want to see all shared images of the specified user
+ * @param user - user to see
+ *
+ */
public void showSharedImages(User user){
model.resetModel(NavigationEnum.USER_SHARED_IMAGES, user, null, null, null, user.getSharedImages());
}
+ /**
+ * This method invoked after the user want to see profile of the specified user
+ * @param user - user to see
+ *
+ */
public void showUser(User user){
model.resetModel(NavigationEnum.USER_PREFS, user, null, null, null, null);
Contexts.getConversationContext().set(Constants.AVATAR_DATA_COMPONENT, null);
}
+ /**
+ * This method invoked after the user want to see all unvisited images, belongs to the of specified shelf
+ * @param shelf - shelf to see
+ *
+ */
public void showUnvisitedImages(Shelf shelf){
model.resetModel(NavigationEnum.SHELF_UNVISITED, shelf.getOwner(), shelf, null, null, shelf.getUnvisitedImages());
}
+ /**
+ * This method invoked after the user want to see all unvisited images, belongs to the of specified album
+ * @param album - album to see
+ *
+ */
public void showUnvisitedImages(Album album){
model.resetModel(NavigationEnum.ALBUM_UNVISITED, album.getOwner(), album.getShelf(), album, null, album.getUnvisitedImages());
}
+ /**
+ * This method invoked after the user want to see all images, related to the of specified album
+ * @param metatag - tag to see
+ *
+ */
public void showTag(MetaTag metatag){
model.resetModel(NavigationEnum.TAGS, model.getSelectedUser(), model.getSelectedShelf(), model.getSelectedAlbum(), model.getSelectedImage(), metatag.getImages());
model.setSelectedTag(metatag);
}
+ /**
+ * This utility method invoked in case if you want to show to the user specified error in popup
+ * @param error - error to show
+ *
+ */
public void showError(String error){
pushEvent(Constants.ADD_ERROR_EVENT, error);
}
+ /**
+ * This method observes <code>Constants.START_REGISTER_EVENT</code> and invoked after the user want to start registration process.
+ *
+ */
@Observer(Constants.START_REGISTER_EVENT)
public void startRegistration(){
model.resetModel(NavigationEnum.REGISTER, user, null, null, null, null);
}
+ /**
+ * This method invoked after the user want to interrupt registration process
+ *
+ */
public void cancelRegistration(){
model.resetModel(NavigationEnum.ANONYM, user, null, null, null, null);
}
+ /**
+ * This utility method determine if the specified node should be marked as selected.
+ * Used in internal rich:tree mechanism
+ */
@SuppressWarnings("unchecked")
public Boolean adviseNodeSelected(UITree tree) {
Object currentNode = tree.getRowData();
@@ -276,11 +426,19 @@
return false;
}
+ /**
+ * This utility method used by custom datascroller to determine images to show.
+ * Used in internal rich:tree mechanism
+ */
public Integer getPage(){
final Integer index = model.getSelectedAlbum().getIndex(model.getSelectedImage());
return index / 5 + 1;
}
+ /**
+ * This utility method used to determine if the specified image belongs to the logged user
+ * @param image - image to check
+ */
public boolean isUserImage(Image image){
if(image == null || image.getOwner() == null) {
return false;
@@ -288,22 +446,46 @@
return image.isOwner(user);
}
+ /**
+ * This utility method used to determine if the logged user have any shelves.
+ *
+ */
public boolean isUserHaveShelves(){
return user.getShelves().size() > 0 ;
}
+ /**
+ * This utility method used to determine if the logged user have any albums.
+ *
+ */
public boolean isUserHaveAlbums(){
return user.getAlbums().size() > 0 ;
}
+ /**
+ * This utility method used to determine if the specified shelf belongs to the logged user
+ * @param shelf - shelf to check
+ */
public boolean isUserShelf(Shelf shelf){
return shelf != null && shelf.isOwner(user);
}
+ /**
+ * This utility method used to determine if the specified album belongs to the logged user
+ * @param album - album to check
+ */
public boolean isUserAlbum(Album album){
return album != null && album.isOwner(user);
}
+ /**
+ * This utility method used to determine if the specified user can be edited
+ * @param user - user to check
+ */
+ public boolean isProfileEditable(User selectedUser){
+ return selectedUser != null && selectedUser.equals(user);
+ }
+
private boolean canViewShelf(Shelf shelf) {
return shelf != null && shelf.isOwner(user);
}
@@ -320,7 +502,19 @@
Events.instance().raiseEvent(type, parameters);
}
- public boolean isProfileEditable(User selectedUser){
- return selectedUser != null && selectedUser.equals(user);
- }
+ private Album setDefaultAlbumToUpload(Album alb) {
+ if(isUserAlbum(model.getSelectedAlbum())){
+ alb = model.getSelectedAlbum();
+ }
+ if(alb == null){
+ if(user != null && user.getShelves().size() > 0 && user.getShelves().get(0).getAlbums().size() > 0)
+ for(Shelf s : user.getShelves()){
+ if(s.getAlbums().size() > 0){
+ alb = s.getAlbums().get(0);
+ break;
+ }
+ }
+ }
+ return alb;
+ }
}
\ No newline at end of file
Modified: trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/DnDManager.java
===================================================================
--- trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/DnDManager.java 2009-05-13 08:55:07 UTC (rev 14150)
+++ trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/DnDManager.java 2009-05-13 11:53:15 UTC (rev 14151)
@@ -64,6 +64,7 @@
if(dragValue instanceof Image){
//If user drag image
if(!((Album)dropValue).getOwner().getLogin().equals(user.getLogin())){
+ //Drag in the album, that not belongs to user
Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, Constants.DND_PHOTO_ERROR);
return;
}
@@ -71,6 +72,7 @@
}else if(dragValue instanceof Album){
//If user drag album
if(!((Shelf)dropValue).getOwner().getLogin().equals(user.getLogin())){
+ //Drag in the shelf, that not belongs to user
Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, Constants.DND_ALBUM_ERROR);
return;
}
Modified: trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/FileManager.java
===================================================================
--- trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/FileManager.java 2009-05-13 08:55:07 UTC (rev 14150)
+++ trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/FileManager.java 2009-05-13 11:53:15 UTC (rev 14151)
@@ -19,7 +19,11 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
package org.richfaces.photoalbum.manager;
-
+/**
+ * Class encapsulated all functionality, related to working with the file system.
+ *
+ * @author Andrey Markhel
+ */
import java.awt.RenderingHints;
import java.awt.image.BufferedImage;
import java.io.File;
@@ -50,29 +54,21 @@
private String uploadRootPath;
+ /**
+ * Method, that invoked at startup application. Used to determine where application will be write new images.
+ * This method set uploadRoot field - it is reference to the file where images will be copied.
+ */
@Create
public void create() {
uploadRoot = (File)Component.getInstance(Constants.UPLOAD_ROOT_COMPONENT_NAME, ScopeType.APPLICATION);
uploadRootPath = (String)Component.getInstance(Constants.UPLOAD_ROOT_PATH_COMPONENT_NAME, ScopeType.APPLICATION);
}
-
- public void setUploadRoot(String uploadRootPath) throws IOException {
- if (uploadRootPath != null) {
- this.uploadRoot = new File(uploadRootPath);
- for (String f : uploadRoot.list()) {
- File temp = new File(uploadRoot, f);
- temp.delete();
- }
- uploadRoot.delete();
- uploadRoot.mkdirs();
- this.uploadRootPath = this.uploadRoot.getCanonicalPath()
- + File.separator;
- } else {
- this.uploadRoot = null;
- this.uploadRootPath = null;
- }
- }
+ /**
+ * This method used to get reference to the file with the specified relative path to the uploadRoot field
+ * @param path - relative path of file
+ * @return File reference
+ */
public File getFileByPath(String path) {
if (this.uploadRoot != null) {
File result = new File(this.uploadRoot, path);
@@ -90,41 +86,81 @@
return null;
}
+ /**
+ * This method observes <code>Constants.ALBUM_DELETED_EVENT</code> and invoked after the user delete album.
+ * This method delete album directory from the disk
+ * @param album - deleted album
+ * @param path - relative path of the album directory
+ *
+ */
@Restrict("#{s:hasRole('admin')}")
@Observer(Constants.ALBUM_DELETED_EVENT)
public void onAlbumDeleted(Album album, String path) {
deleteDirectory(path);
}
+ /**
+ * This method observes <code>Constants.SHELF_DELETED_EVENT</code> and invoked after the user delete her shelf
+ * This method delete shelf directory from the disk
+ * @param shelf - deleted shelf
+ * @param path - relative path of the shelf directory
+ */
@Restrict("#{s:hasRole('admin')}")
@Observer(Constants.SHELF_DELETED_EVENT)
public void onShelfDeleted(Shelf shelf, String path) {
deleteDirectory(path);
}
+ /**
+ * This method observes <code>Constants.USER_DELETED_EVENT</code> and invoked after the user was deleted(used in livedemo to prevent flooding)
+ * This method delete user directory from the disk
+ * @param user - deleted user
+ * @param path - relative path of the user directory
+ */
@Observer(Constants.USER_DELETED_EVENT)
public void onUserDeleted(User user){
deleteDirectory(user.getPath());
}
+ /**
+ * This method observes <code>SHELF_ADDED_EVENT</code> and invoked after the user add new shelf
+ * This method add shelf directory to the disk
+ * @param shelf - added shelf
+ */
@Observer(Constants.SHELF_ADDED_EVENT)
public void onShelfAdded(Shelf shelf){
File directory = getFileByPath(shelf.getPath());
FileUtils.addDirectory(directory);
}
+ /**
+ * This method observes <code>ALBUM_ADDED_EVENT</code> and invoked after the user add new album
+ * This method add album directory to the disk
+ * @param album - added album
+ */
@Observer(Constants.ALBUM_ADDED_EVENT)
- public void onShelfAdded(Album album){
+ public void onAlbumAdded(Album album){
File directory = getFileByPath(album.getPath());
FileUtils.addDirectory(directory);
}
+ /**
+ * This method invoked after user set new avatar icon
+ * @param avatarData - avatar file
+ * @param user - user, that add avatar
+ */
public boolean saveAvatar(File avatarData, User user) {
String avatarPath = File.separator + user.getLogin() + File.separator + Constants.AVATAR_JPG;
createDirectoryIfNotExist(avatarPath);
return writeFile(avatarPath, avatarData.getPath(), "", Constants.AVATAR_SIZE, true);
}
+ /**
+ * This method observes <code>Constants.IMAGE_DELETED_EVENT</code> and invoked after the user delete her image
+ * This method delete image and all thumbnails of this image from the disk
+ * @param image - deleted image
+ * @param path - relative path of the image file
+ */
@Restrict("#{s:hasRole('admin')}")
@Observer(Constants.IMAGE_DELETED_EVENT)
public void deleteImage(Image image, String path) {
@@ -133,6 +169,11 @@
}
}
+ /**
+ * This method invoked after user upload new image
+ * @param fileName - new relative path to the image file
+ * @param tempFilePath - absolute path to uploaded image
+ */
@Restrict("#{s:hasRole('admin')}")
public boolean addImage(String fileName, String tempFilePath) {
createDirectoryIfNotExist(fileName);
@@ -144,39 +185,12 @@
return true;
}
- @Restrict("#{s:hasRole('admin')}")
- public boolean writeFile(String newFileName, String fileName,
- String pattern, int size, boolean includeUploadRoot) {
- BufferedImage bsrc = null;
- try {
- bsrc = FileUtils.bitmapToImage(fileName, Constants.JPG);
- } catch (IOException e1) {
- return false;
- }
- int i = bsrc.getWidth() > bsrc.getHeight() ? bsrc.getWidth() : bsrc.getHeight();
- double d = (double) size / i;
- Double yy = ((Double) d * bsrc.getWidth());
- int width = yy.intValue();
- yy = ((Double) d * bsrc.getHeight());
- int height = yy.intValue();
- // Too small picture or original size
- if (width > bsrc.getWidth() || height > bsrc.getHeight() || size == 0) {
- width = bsrc.getWidth();
- height = bsrc.getHeight();
- }
- BufferedImage bdest = FileUtils.getScaledInstance(bsrc, width, height,
- RenderingHints.VALUE_INTERPOLATION_BICUBIC, true);
- String dest = includeUploadRoot ? this.uploadRootPath
- + transformPath(newFileName, pattern) : transformPath(
- newFileName, pattern);
- try {
- FileUtils.imageToBitmap(bdest, dest, Constants.JPG);
- } catch (IOException ex) {
- return false;
- }
- return true;
- }
-
+ /**
+ * This method used to transform one path to another.
+ * For example you want get path of the file with dimensioms 80 of image with path /user/1/2/image.jpg, this method return /user/1/2/image_substitute.jpg
+ * @param target - path to transform
+ * @param substitute - new 'addon' to the path
+ */
public String transformPath(String target, String substitute) {
if(target.length()<2 || target.lastIndexOf(Constants.DOT) == -1){
return "";
@@ -186,20 +200,41 @@
return begin + substitute + end;
}
+ /**
+ * This method used to get reference to the file with the absolute path
+ * @param path - absolute path of file
+ * @return File reference
+ */
public File getFileByAbsolutePath(String path) {
return new File(path);
}
+ /**
+ * This utility method used to determine if the directory with specified relative path exist
+ * @param path - absolute path of directory
+ * @return File reference
+ */
public boolean isDirectoryPresent(String path){
final File file = getFileByPath(path);
return file.exists() && file.isDirectory();
}
+ /**
+ * This utility method used to determine if the file with specified relative path exist
+ * @param path - absolute path of file
+ * @return File reference
+ */
public boolean isFilePresent(String path){
final File file = getFileByPath(path);
return file.exists();
}
+ /**
+ * This method observes <code>Constants.ALBUM_DRAGGED_EVENT</code> and invoked after the user dragged album form one shelf to the another.
+ * This method rename album directory to the new directory
+ * @param album - dragged album
+ * @param pathOld - old path of album directory
+ */
@Observer(Constants.ALBUM_DRAGGED_EVENT)
public void renameAlbumDirectory(Album album, String pathOld){
File file = getFileByPath(pathOld);
@@ -214,6 +249,12 @@
file.renameTo(file2);
}
+ /**
+ * This method observes <code>Constants.IMAGE_DRAGGED_EVENT</code> and invoked after the user dragged image form one album to the another.
+ * This method rename image file and all thumbnails to the new name
+ * @param image - dragged image
+ * @param pathOld - old path of image file
+ */
@Observer(Constants.IMAGE_DRAGGED_EVENT)
public void renameImageFile(Image image, String pathOld){
File file = null;
@@ -232,6 +273,42 @@
}
}
+ private boolean writeFile(String newFileName, String fileName,
+ String pattern, int size, boolean includeUploadRoot) {
+ BufferedImage bsrc = null;
+ try {
+ //Read file form disk
+ bsrc = FileUtils.bitmapToImage(fileName, Constants.JPG);
+ } catch (IOException e1) {
+ return false;
+ }
+ int resizedParam = bsrc.getWidth() > bsrc.getHeight() ? bsrc.getWidth() : bsrc.getHeight();
+ double scale = (double) size / resizedParam;
+ Double widthInDouble = ((Double) scale * bsrc.getWidth());
+ int width = widthInDouble.intValue();
+ Double heightInDouble = ((Double) scale * bsrc.getHeight());
+ int height = heightInDouble.intValue();
+ // Too small picture or original size
+ if (width > bsrc.getWidth() || height > bsrc.getHeight() || size == 0) {
+ width = bsrc.getWidth();
+ height = bsrc.getHeight();
+ }
+ //scale image if need
+ BufferedImage bdest = FileUtils.getScaledInstance(bsrc, width, height,
+ RenderingHints.VALUE_INTERPOLATION_BICUBIC, true);
+ //Determine new path of image file
+ String dest = includeUploadRoot ? this.uploadRootPath
+ + transformPath(newFileName, pattern) : transformPath(
+ newFileName, pattern);
+ try {
+ //save to disk
+ FileUtils.imageToBitmap(bdest, dest, Constants.JPG);
+ } catch (IOException ex) {
+ return false;
+ }
+ return true;
+ }
+
private void deleteDirectory(String directory){
final File file = getFileByPath(directory);
FileUtils.deleteDirectory(file, false);
Modified: trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/FileUploadManager.java
===================================================================
--- trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/FileUploadManager.java 2009-05-13 08:55:07 UTC (rev 14150)
+++ trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/FileUploadManager.java 2009-05-13 11:53:15 UTC (rev 14151)
@@ -49,8 +49,9 @@
import com.drew.metadata.jpeg.JpegDirectory;
/**
- * @author $Autor$
- *
+ * Class encapsulated all functionality, related to file-upload process.
+ *
+ * @author Andrey Markhel
*/
@Name("fileUploadManager")
@Scope(ScopeType.EVENT)
@@ -73,7 +74,7 @@
* @param event - event, indicated that file upload started
*/
@Restrict("#{s:hasRole('admin')}")
- public void listener(UploadEvent event) throws Exception {
+ public void listener(UploadEvent event){
UploadItem item = event.getUploadItem();
//Construct image from item
Image image = constructImage(item);
@@ -109,7 +110,7 @@
//Prepare to show in UI
fileWrapper.getFiles().add(image);
Events.instance().raiseEvent(Constants.IMAGE_ADDED_EVENT, image);
- //Delete temporary fule
+ //Delete temporary file
item.getFile().delete();
}
@@ -121,6 +122,10 @@
fileWrapper.onFileUploadError(image, error);
item.getFile().delete();
}
+
+ private void addError(Image image, String error) {
+ fileWrapper.onFileUploadError(image, error);
+ }
private Image constructImage(UploadItem item) {
Image image = new Image();
@@ -133,21 +138,24 @@
return image;
}
- private void extractMetadata(UploadItem item, Image image)
- throws RuntimeException, IOException {
- InputStream in =null;
+ private void extractMetadata(UploadItem item, Image image){
+ InputStream in = null;
try{
- in = new FileInputStream(item.getFile());
- Metadata metadata = JpegMetadataReader.readMetadata(in);
- Directory exifDirectory = metadata.getDirectory(ExifDirectory.class);
- Directory jpgDirectory = metadata.getDirectory(JpegDirectory.class);
- setupCameraModel(image, exifDirectory);
- setupDimensions(image, exifDirectory, jpgDirectory);
- setupCreatedDate(image, exifDirectory);
+ in = new FileInputStream(item.getFile());
+ Metadata metadata = JpegMetadataReader.readMetadata(in);
+ Directory exifDirectory = metadata.getDirectory(ExifDirectory.class);
+ Directory jpgDirectory = metadata.getDirectory(JpegDirectory.class);
+ setupCameraModel(image, exifDirectory);
+ setupDimensions(image, exifDirectory, jpgDirectory);
+ setupCreatedDate(image, exifDirectory);
}catch(Exception e){
- throw new RuntimeException();
+ addError(item, image, Constants.IMAGE_SAVING_ERROR);
}finally{
- in.close();
+ try {
+ in.close();
+ } catch (IOException e) {
+ addError(item, image, Constants.IMAGE_SAVING_ERROR);
+ }
}
}
@@ -159,20 +167,23 @@
}
}
- private void setupDimensions(Image image, Directory exifDirectory,
- Directory jpgDirectory) throws MetadataException {
- if (exifDirectory.containsTag(ExifDirectory.TAG_EXIF_IMAGE_WIDTH) && exifDirectory.containsTag(ExifDirectory.TAG_EXIF_IMAGE_HEIGHT)) {
- int width = exifDirectory.getInt(ExifDirectory.TAG_EXIF_IMAGE_WIDTH);
- image.setWidth(width);
- int height = exifDirectory.getInt(ExifDirectory.TAG_EXIF_IMAGE_HEIGHT);
- image.setHeight(height);
- } else {
- if (jpgDirectory.containsTag(JpegDirectory.TAG_JPEG_IMAGE_HEIGHT)) {
- int width = jpgDirectory.getInt(JpegDirectory.TAG_JPEG_IMAGE_WIDTH);
+ private void setupDimensions(Image image, Directory exifDirectory, Directory jpgDirectory){
+ try{
+ if (exifDirectory.containsTag(ExifDirectory.TAG_EXIF_IMAGE_WIDTH) && exifDirectory.containsTag(ExifDirectory.TAG_EXIF_IMAGE_HEIGHT)) {
+ int width = exifDirectory.getInt(ExifDirectory.TAG_EXIF_IMAGE_WIDTH);
image.setWidth(width);
- int height = jpgDirectory.getInt(JpegDirectory.TAG_JPEG_IMAGE_HEIGHT);
+ int height = exifDirectory.getInt(ExifDirectory.TAG_EXIF_IMAGE_HEIGHT);
image.setHeight(height);
+ } else {
+ if (jpgDirectory.containsTag(JpegDirectory.TAG_JPEG_IMAGE_HEIGHT)) {
+ int width = jpgDirectory.getInt(JpegDirectory.TAG_JPEG_IMAGE_WIDTH);
+ image.setWidth(width);
+ int height = jpgDirectory.getInt(JpegDirectory.TAG_JPEG_IMAGE_HEIGHT);
+ image.setHeight(height);
+ }
}
+ }catch(MetadataException e){
+ addError(image, Constants.IMAGE_SAVING_ERROR);
}
}
Modified: trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/ImageManager.java
===================================================================
--- trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/ImageManager.java 2009-05-13 08:55:07 UTC (rev 14150)
+++ trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/ImageManager.java 2009-05-13 11:53:15 UTC (rev 14151)
@@ -103,7 +103,7 @@
return;
}
}
- imageAction.editImage(image, editFromInplace);
+ imageAction.editImage(image, !editFromInplace);
}catch(Exception e){
Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, Constants.IMAGE_SAVING_ERROR);
imageAction.resetImage(image);
Modified: trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/Model.java
===================================================================
--- trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/Model.java 2009-05-13 08:55:07 UTC (rev 14150)
+++ trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/Model.java 2009-05-13 11:53:15 UTC (rev 14151)
@@ -15,7 +15,11 @@
import org.richfaces.photoalbum.domain.Shelf;
import org.richfaces.photoalbum.domain.User;
import org.richfaces.photoalbum.service.Constants;
-
+/**
+ * This class represent 'M' in MVC pattern. It is storage to application flow related data such as selectedAlbum, image, mainArea to preview etc..
+ *
+ * @author Andrey Markhel
+ */
@Name("model")
@Scope(ScopeType.CONVERSATION)
@AutoCreate
@@ -37,6 +41,15 @@
private List<Image> images;
+ /**
+ * This method invoked after the almost user actions, to prepare properly data to show in the UI.
+ * @param mainArea - next Area to show(determined in controller)
+ * @param selectedUser - user, that was selected(determined in controller)
+ * @param selectedShelf - shelf, that was selected(determined in controller)
+ * @param selectedAlbum - album, that was selected(determined in controller)
+ * @param selectedImage - image, that was selected(determined in controller)
+ * @param images - list of images, to show during slideshow process(determined in controller)
+ */
public void resetModel(NavigationEnum mainArea, User selectedUser, Shelf selectedShelf, Album selectedAlbum, Image selectedImage, List<Image> images){
this.setSelectedAlbum(selectedAlbum);
this.setSelectedImage(selectedImage);
@@ -46,6 +59,11 @@
this.images = images;
}
+ /**
+ * This method observes <code> Constants.UPDATE_MAIN_AREA_EVENT </code>event and invoked after the user actions, that not change model, but change area to preview
+ * @param mainArea - next Area to show
+ *
+ */
@Observer(Constants.UPDATE_MAIN_AREA_EVENT)
public void setMainArea(NavigationEnum mainArea) {
if(this.mainArea != null && this.mainArea.equals(NavigationEnum.FILE_UPLOAD)){
@@ -54,6 +72,16 @@
this.mainArea = mainArea;
}
+ /**
+ * This method observes <code> Constants.UPDATE_SELECTED_TAG_EVENT </code>event and invoked after the user click on any metatag.
+ * @param selectedTag - clicked tag
+ *
+ */
+ @Observer(Constants.UPDATE_SELECTED_TAG_EVENT)
+ public void setSelectedTag(MetaTag selectedTag) {
+ this.selectedTag = selectedTag;
+ }
+
public NavigationEnum getMainArea() {
return mainArea;
}
@@ -93,11 +121,6 @@
public MetaTag getSelectedTag() {
return selectedTag;
}
-
- @Observer(Constants.UPDATE_SELECTED_TAG_EVENT)
- public void setSelectedTag(MetaTag selectedTag) {
- this.selectedTag = selectedTag;
- }
public List<Image> getImages() {
return images;
Modified: trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/NavigationEnum.java
===================================================================
--- trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/NavigationEnum.java 2009-05-13 08:55:07 UTC (rev 14150)
+++ trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/NavigationEnum.java 2009-05-13 11:53:15 UTC (rev 14151)
@@ -22,7 +22,8 @@
/**
* Class encapsulated all possible states, that can be applied to so called 'mainArea' area on the page.
- *
+ * This ensured that properly template will be applied, and user will be redirected to desired page.
+ * Next template to show obviously determined in Controller and pushes to Model.
* @author Andrey Markhel
*/
Modified: trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/SlideshowManager.java
===================================================================
--- trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/SlideshowManager.java 2009-05-13 08:55:07 UTC (rev 14150)
+++ trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/SlideshowManager.java 2009-05-13 11:53:15 UTC (rev 14151)
@@ -89,7 +89,7 @@
this.selectedImage = model.getImages().get(this.slideshowIndex);
//mark image as 'visited'
this.selectedImage.setVisited(true);
- //Check if that image was recently deleted. If yes, immediately stop slideshow
+ //Check if that image was recently deleted. If yes, immediately stop slideshow process
FileManager fileManager = (FileManager)Contexts.getApplicationContext().get(Constants.FILE_MANAGER_COMPONENT);
if(!fileManager.isFilePresent(this.selectedImage.getFullPath())){
Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, Constants.IMAGE_RECENTLY_DELETED_ERROR);
@@ -172,6 +172,7 @@
slideshowIndex = -1;
}
slideshowIndex++;
+ //To prevent slideshow mechanism working in cycle.
if(slideshowIndex == startSlideshowIndex){
stopSlideshow();
errorDetected = true;
Modified: trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/UserManager.java
===================================================================
--- trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/UserManager.java 2009-05-13 08:55:07 UTC (rev 14150)
+++ trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/manager/UserManager.java 2009-05-13 11:53:15 UTC (rev 14151)
@@ -71,6 +71,8 @@
avatarData = null;
user.setHasAvatar(true);
}try{
+ //This check is actual only on livedemo server to prevent hacks.
+ //Prevent hackers to mark user as pre-defined
user.setPreDefined(false);
user.setPasswordHash(HashUtils.hash(user.getPassword()));
user = userAction.updateUser();
Modified: trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/ui/DirectLinkHelper.java
===================================================================
--- trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/ui/DirectLinkHelper.java 2009-05-13 08:55:07 UTC (rev 14150)
+++ trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/ui/DirectLinkHelper.java 2009-05-13 11:53:15 UTC (rev 14151)
@@ -14,7 +14,11 @@
import org.jboss.seam.security.Identity;
import org.richfaces.photoalbum.domain.Image;
import org.richfaces.photoalbum.service.Constants;
-
+/**
+ * Convenience UI class for 'directLink' functionality.
+ *
+ * @author Andrey Markhel
+ */
@Name("directLink")
@Scope(ScopeType.EVENT)
@AutoCreate
@@ -27,7 +31,12 @@
@In Identity identity;
@In Credentials credentials;
-
+ /**
+ * Convenience method to paint full-sized image in new tab or window
+ *
+ * @param out - OutputStream to write image
+ * @param data - relative path of the image
+ */
public void paintImage(OutputStream out, Object data)
throws IOException {
Long id = Long.valueOf(data.toString());
Modified: trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/ui/EditorBean.java
===================================================================
--- trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/ui/EditorBean.java 2009-05-13 08:55:07 UTC (rev 14150)
+++ trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/ui/EditorBean.java 2009-05-13 11:53:15 UTC (rev 14151)
@@ -23,7 +23,11 @@
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Observer;
import org.richfaces.photoalbum.service.Constants;
-
+/**
+ * Convenience UI class for rich:editor component
+ *
+ * @author Andrey Markhel
+ */
@Name("editorBean")
public class EditorBean {
Modified: trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/ui/ErrorHandlerBean.java
===================================================================
--- trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/ui/ErrorHandlerBean.java 2009-05-13 08:55:07 UTC (rev 14150)
+++ trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/ui/ErrorHandlerBean.java 2009-05-13 11:53:15 UTC (rev 14151)
@@ -29,7 +29,11 @@
import org.jboss.seam.annotations.Observer;
import org.jboss.seam.annotations.Scope;
import org.richfaces.photoalbum.service.Constants;
-
+/**
+ * Convenience UI class for global eeror-checking mechanism
+ *
+ * @author Andrey Markhel
+ */
@Name("errorHandlerBean")
@Scope(ScopeType.EVENT)
@AutoCreate
@@ -44,6 +48,11 @@
return errors.size() > 0 ;
}
+ /**
+ * Convenience method that observes <code>Constants.ADD_ERROR_EVENT</code>. After error occured add error to the list of erors andon rerendering modal panel with all errors will be showed.
+ *
+ * @param e - string representation of error.
+ */
@Observer(Constants.ADD_ERROR_EVENT)
public void addToErrors(String e){
errors.add(e);
Modified: trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/ui/Help.java
===================================================================
--- trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/ui/Help.java 2009-05-13 08:55:07 UTC (rev 14150)
+++ trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/ui/Help.java 2009-05-13 11:53:15 UTC (rev 14151)
@@ -5,7 +5,11 @@
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.richfaces.photoalbum.util.Environment;
-
+/**
+ * Convenience UI class for application help system
+ *
+ * @author Andrey Markhel
+ */
@Name("help")
@Scope(ScopeType.EVENT)
@AutoCreate
@@ -21,10 +25,20 @@
this.page = page;
}
+ /**
+ * Convenience method to show specified page with help info in modal panel
+ *
+ * @param src - page to show
+ */
public void navigateTo(String src){
this.setPage(src);
}
+ /**
+ * Convenience method to determine is there need to render application help system.
+ *
+ * @param src - page to show
+ */
public boolean isShowHelp(){
return Environment.isShowHelp();
}
Modified: trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/ui/ImageLoader.java
===================================================================
--- trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/ui/ImageLoader.java 2009-05-13 08:55:07 UTC (rev 14150)
+++ trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/ui/ImageLoader.java 2009-05-13 11:53:15 UTC (rev 14151)
@@ -31,8 +31,6 @@
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.contexts.Contexts;
-import org.richfaces.photoalbum.domain.User;
import org.richfaces.photoalbum.manager.FileManager;
import org.richfaces.photoalbum.service.Constants;
Modified: trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/ui/ImageSizeHelper.java
===================================================================
--- trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/ui/ImageSizeHelper.java 2009-05-13 08:55:07 UTC (rev 14150)
+++ trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/ui/ImageSizeHelper.java 2009-05-13 11:53:15 UTC (rev 14151)
@@ -10,8 +10,10 @@
import org.richfaces.photoalbum.util.ImageDimension;
/**
- * @author Andrey Markavtsov
*
+ * Convenience UI class for image resizing
+ *
+ * @author Andrey Markhel
*/
@Name("imageSizeHelper")
@Scope(ScopeType.PAGE)
@@ -28,7 +30,13 @@
public int getValue() {
return value;
}
-
+
+ /**
+ *
+ * Convenience method invoked after user want to change image dimensions
+ *
+ * @param value - new image dimension value
+ */
public void setValue(int value) {
currentDimension = ImageDimension.getInstance(value);
this.value = currentDimension.getX();
Modified: trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/ui/UserPrefsHelper.java
===================================================================
--- trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/ui/UserPrefsHelper.java 2009-05-13 08:55:07 UTC (rev 14150)
+++ trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/ui/UserPrefsHelper.java 2009-05-13 11:53:15 UTC (rev 14151)
@@ -5,9 +5,6 @@
import java.io.File;
import java.io.Serializable;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.GregorianCalendar;
import javax.faces.model.SelectItem;
@@ -23,14 +20,15 @@
import org.richfaces.photoalbum.service.IUserAction;
/**
- * @author Andrey Markavtsov
+ * Convenience UI class for userPrefs page
*
+ * @author Andrey Markhel
*/
+
@Name("userPrefsBean")
@Scope(ScopeType.EVENT)
public class UserPrefsHelper implements Serializable{
private static final long serialVersionUID = -1767281809514660171L;
- private Calendar calendar;
@In IUserAction userAction;
@In(required=false, scope=ScopeType.CONVERSATION) @Out(required=false, scope=ScopeType.CONVERSATION) private File avatarData;
@@ -43,17 +41,15 @@
return sexs;
}
+ /**
+ * Convenience method invoked after user add avatar and outject avatar to conversation
+ *
+ * param event - upload event
+ */
public void uploadAvatar(UploadEvent event) {
UploadItem item = event.getUploadItem();
avatarData = item.getFile();
}
-
- /*public Date getDefaultDate(){
- if(calendar == null){
- calendar = new GregorianCalendar(1980, Calendar.DECEMBER, 25);
- }
- return calendar.getTime();
- }*/
public File getAvatarData() {
return avatarData;
Modified: trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/util/Environment.java
===================================================================
--- trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/util/Environment.java 2009-05-13 08:55:07 UTC (rev 14150)
+++ trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/util/Environment.java 2009-05-13 11:53:15 UTC (rev 14151)
@@ -1,5 +1,9 @@
package org.richfaces.photoalbum.util;
-
+/**
+ * Convenience class to determine in which environment application running.
+ *
+ * @author Andrey Markhel
+ */
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
@@ -49,6 +53,11 @@
return null;
}
+ /**
+ * Convenience method to determine is the application running in production mode.
+ *
+ * @return true if application running in production mode
+ */
public static boolean isInProduction(){
final String environment = getEnvironment();
if (DEVELOPMENT.equals(environment)) {
@@ -57,6 +66,11 @@
return true;
}
+ /**
+ * Convenience method to determine is the application help system will be rendered
+ *
+ * @return true if the application help system need to be rendered
+ */
public static boolean isShowHelp(){
final String environment = getShowHelpIconsStrategy();
if (SHOW.equals(environment)) {
Modified: trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/util/FileUtils.java
===================================================================
--- trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/util/FileUtils.java 2009-05-13 08:55:07 UTC (rev 14150)
+++ trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/util/FileUtils.java 2009-05-13 11:53:15 UTC (rev 14151)
@@ -27,7 +27,8 @@
/**
* Utility method for copying file
- *
+ * @param srcFile - source file
+ * @param destFile - destination file
*/
public static void copyFile(File srcFile, File destFile) throws IOException {
if (!srcFile.getPath().toLowerCase().endsWith(JPG) && !srcFile.getPath().toLowerCase().endsWith(JPEG)) {
@@ -65,7 +66,8 @@
/**
* Utility method for copying directory
- *
+ * @param srcDir - source directory
+ * @param dstDir - destination directory
*/
public static void copyDirectory(File srcDir, File dstDir)
throws IOException {
@@ -89,7 +91,9 @@
/**
* Utility method for delete directory
- *
+ * @param dir - directory to delete
+ * @param isInitialDelete - determine if the deleting process running at startup or on destroy of application
+ * @return true if directory succesfully deleted
*/
public static boolean deleteDirectory(File dir , boolean isInitialDelete){
if (dir.isDirectory()) {
@@ -119,7 +123,8 @@
/**
* Utility method for concatenation names of collection of files
- *
+ * @param files - array of strings to concatenate
+ * @return concatenated string
*/
public static String joinFiles(String... files) {
final StringBuilder res = new StringBuilder();
@@ -132,7 +137,7 @@
/**
* Utility method for delete file
- *
+ * @param file - file to delete
*/
public static void deleteFile(File file) {
if (file.exists()) {
@@ -140,6 +145,13 @@
}
}
+ /**
+ * Utility method to read image from disk and transform image to BufferedImage object
+ * @param data - relative path to the image
+ * @param format - file prefix of the image
+ * @return BufferedImage representation of the image
+ *
+ */
public static BufferedImage bitmapToImage(String data, String format) throws IOException {
final InputStream inb = new FileInputStream(data);
final ImageReader rdr = ImageIO.getImageReadersByFormatName(format).next();
@@ -150,6 +162,14 @@
return image;
}
+ /**
+ * Utility method to write BufferedImage object to disk
+ * @param image - BufferedImage object to save.
+ * @param data - relative path to the image
+ * @param format - file prefix of the image
+ * @return BufferedImage representation of the image
+ *
+ */
public static void imageToBitmap(BufferedImage image, String data, String format) throws IOException {
final OutputStream inb = new FileOutputStream(data);
final ImageWriter wrt = ImageIO.getImageWritersByFormatName(format).next();
@@ -233,6 +253,7 @@
/**
* Utility method for creation of directory
+ * @param directory - directory to create
*
*/
public static void addDirectory(File directory) {
Modified: trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/util/HashUtils.java
===================================================================
--- trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/util/HashUtils.java 2009-05-13 08:55:07 UTC (rev 14150)
+++ trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/util/HashUtils.java 2009-05-13 11:53:15 UTC (rev 14151)
@@ -1,5 +1,9 @@
package org.richfaces.photoalbum.util;
-
+/**
+ * Convenience class to hash user passwords.
+ *
+ * @author Andrey Markhel
+ */
import java.security.MessageDigest;
import org.jboss.seam.util.Hex;
@@ -8,7 +12,11 @@
private static String digestAlgorithm = "SHA-1";
private static String charset = "UTF-8";
-
+ /**
+ * Convenience method to hash user passwords.
+ *
+ * @param plainTextPassword - password to hash
+ */
public static String hash(String plainTextPassword) {
try {
MessageDigest digest = MessageDigest.getInstance(digestAlgorithm);
Modified: trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/util/ImageDimension.java
===================================================================
--- trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/util/ImageDimension.java 2009-05-13 08:55:07 UTC (rev 14150)
+++ trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/util/ImageDimension.java 2009-05-13 11:53:15 UTC (rev 14151)
@@ -1,5 +1,10 @@
package org.richfaces.photoalbum.util;
-
+/**
+ * Convenience UI class for represent image object in different dimensions. Each image have 5 thumbnails with different
+ * size, background style, file prefix, css class and background image. CurrentDimension field will be used to determine rendering parameters used during page rendering process
+ *
+ * @author Andrey Markhel
+ */
import org.richfaces.photoalbum.service.Constants;
public enum ImageDimension {
Modified: trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/util/SessionListener.java
===================================================================
--- trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/util/SessionListener.java 2009-05-13 08:55:07 UTC (rev 14150)
+++ trunk/examples/photoalbum/source/web/src/main/java/org/richfaces/photoalbum/util/SessionListener.java 2009-05-13 11:53:15 UTC (rev 14151)
@@ -1,5 +1,10 @@
package org.richfaces.photoalbum.util;
-
+/**
+ * This class is session listener that observes <code>"org.jboss.seam.sessionExpired"</code> event to delete in production systems users when it's session is expired
+ * to prevent flood. Used only on livedemo server. If you don't want this functionality simply delete this class from distributive.
+ *
+ * @author Andrey Markhel
+ */
import java.util.List;
import javax.persistence.EntityManager;
Modified: trunk/examples/photoalbum/source/web/src/main/webapp/includes/help/errorHelp.xhtml
===================================================================
(Binary files differ)
Modified: trunk/examples/photoalbum/source/web/src/main/webapp/includes/image/imageInfo.xhtml
===================================================================
(Binary files differ)
Modified: trunk/examples/photoalbum/source/web/src/main/webapp/includes/misc/errorPanel.xhtml
===================================================================
(Binary files differ)
Modified: trunk/examples/photoalbum/source/web/src/main/webapp/includes/misc/modalPanels.xhtml
===================================================================
(Binary files differ)
Modified: trunk/examples/photoalbum/source/web/src/main/webapp/index.xhtml
===================================================================
(Binary files differ)
15 years, 8 months
JBoss Rich Faces SVN: r14150 - trunk/test-applications/jsp/src/main/java/colorPicker.
by richfaces-svn-commits@lists.jboss.org
Author: Vadim Mikovoz
Date: 2009-05-13 04:55:07 -0400 (Wed, 13 May 2009)
New Revision: 14150
Modified:
trunk/test-applications/jsp/src/main/java/colorPicker/ColorPicker.java
Log:
Modified: trunk/test-applications/jsp/src/main/java/colorPicker/ColorPicker.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/colorPicker/ColorPicker.java 2009-05-13 08:54:52 UTC (rev 14149)
+++ trunk/test-applications/jsp/src/main/java/colorPicker/ColorPicker.java 2009-05-13 08:55:07 UTC (rev 14150)
@@ -20,12 +20,10 @@
private String converterMessage;
private boolean flat;
private boolean immediate;
- private boolean localValueSet;
private boolean rendered;
private boolean facets;
private boolean required;
private String requiredMessage;
- private boolean valid;
private String validatorMessage;
private String value;
private String facetsValue;
@@ -46,11 +44,9 @@
converterMessage = "custom converter message";
flat = false;
immediate = false;
- localValueSet = true;
rendered = true;
required = false;
requiredMessage = "custom required message";
- valid = true;
validatorMessage = "custom validator message";
value = new String();
facetsValue = new String();
@@ -146,14 +142,6 @@
this.immediate = immediate;
}
- public boolean isLocalValueSet() {
- return localValueSet;
- }
-
- public void setLocalValueSet(boolean localValueSet) {
- this.localValueSet = localValueSet;
- }
-
public boolean isRendered() {
return rendered;
}
@@ -178,14 +166,6 @@
this.requiredMessage = requiredMessage;
}
- public boolean isValid() {
- return valid;
- }
-
- public void setValid(boolean valid) {
- this.valid = valid;
- }
-
public String getValidatorMessage() {
return validatorMessage;
}
15 years, 8 months
JBoss Rich Faces SVN: r14149 - trunk/test-applications/jsp/src/main/webapp/ColorPicker.
by richfaces-svn-commits@lists.jboss.org
Author: Vadim Mikovoz
Date: 2009-05-13 04:54:52 -0400 (Wed, 13 May 2009)
New Revision: 14149
Modified:
trunk/test-applications/jsp/src/main/webapp/ColorPicker/ColorPicker.jsp
trunk/test-applications/jsp/src/main/webapp/ColorPicker/ColorPickerProperty.jsp
Log:
Modified: trunk/test-applications/jsp/src/main/webapp/ColorPicker/ColorPicker.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/ColorPicker/ColorPicker.jsp 2009-05-13 01:25:30 UTC (rev 14148)
+++ trunk/test-applications/jsp/src/main/webapp/ColorPicker/ColorPicker.jsp 2009-05-13 08:54:52 UTC (rev 14149)
@@ -16,28 +16,25 @@
onmouseout="#{event.onmouseout}" onmouseover="#{event.onmouseover}"
onmouseup="#{event.onmouseup}"
rendered="#{colorPicker.rendered and !colorPicker.facets}"
-
-
+ required="#{colorPicker.required}"
+ value="#{colorPicker.value}"
showEvent="#{colorPicker.showEvent}"
validator="#{colorPicker.validate}"
validatorMessage="#{colorPicker.validatorMessage}"
- value="#{colorPicker.value}"
valueChangeListener="#{colorPicker.changeValue}">
</rich:colorPicker>
- <rich:colorPicker colorMode="#{colorPicker.colorMode}" flat="#{colorPicker.flat}"
- id="colorPickerIDFacets" onclick="#{event.onclick}"
- ondblclick="#{event.ondblclick}" onkeydown="#{event.onkeydown}"
- onkeypress="#{event.onkeypress}" onkeyup="#{event.onkeyup}"
- onmousedown="#{event.onmousedown}" onmousemove="#{event.onmousemove}"
- onmouseout="#{event.onmouseout}" onmouseover="#{event.onmouseover}"
- onmouseup="#{event.onmouseup}"
+ <rich:colorPicker colorMode="#{colorPicker.colorMode}"
+ flat="#{colorPicker.flat}" id="colorPickerIDFacets"
+ onclick="#{event.onclick}" ondblclick="#{event.ondblclick}"
+ onkeydown="#{event.onkeydown}" onkeypress="#{event.onkeypress}"
+ onkeyup="#{event.onkeyup}" onmousedown="#{event.onmousedown}"
+ onmousemove="#{event.onmousemove}" onmouseout="#{event.onmouseout}"
+ onmouseover="#{event.onmouseover}" onmouseup="#{event.onmouseup}"
rendered="#{colorPicker.rendered and colorPicker.facets}"
-
-
- showEvent="#{colorPicker.showEvent}" validator="#{colorPicker.validate}"
+ showEvent="#{colorPicker.showEvent}"
+ validator="#{colorPicker.validate}"
validatorMessage="#{colorPicker.validatorMessage}"
- value="#{colorPicker.facetsValue}"
valueChangeListener="#{colorPicker.changeValue}">
<f:facet name="icon">
<h:graphicImage value="/ColorPicker/images/colorPicker_ico.png"
@@ -50,5 +47,4 @@
</rich:colorPicker>
-
</f:subview>
Modified: trunk/test-applications/jsp/src/main/webapp/ColorPicker/ColorPickerProperty.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/ColorPicker/ColorPickerProperty.jsp 2009-05-13 01:25:30 UTC (rev 14148)
+++ trunk/test-applications/jsp/src/main/webapp/ColorPicker/ColorPickerProperty.jsp 2009-05-13 08:54:52 UTC (rev 14149)
@@ -1,4 +1,5 @@
- <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
+
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
@@ -29,10 +30,6 @@
<h:selectBooleanCheckbox value="#{colorPicker.immediate}">
</h:selectBooleanCheckbox>
- <h:outputText value="localValueSet" />
- <h:selectBooleanCheckbox value="#{colorPicker.localValueSet}">
- </h:selectBooleanCheckbox>
-
<h:outputText value="rendered" />
<h:selectBooleanCheckbox value="#{colorPicker.rendered}">
</h:selectBooleanCheckbox>
@@ -49,10 +46,6 @@
<h:inputText value="#{colorPicker.requiredMessage}">
</h:inputText>
- <h:outputText value="valid" />
- <h:selectBooleanCheckbox value="#{colorPicker.valid}">
- </h:selectBooleanCheckbox>
-
<h:outputText value="validatorMessage: "></h:outputText>
<h:inputText value="#{colorPicker.validatorMessage}">
</h:inputText>
15 years, 8 months
JBoss Rich Faces SVN: r14148 - trunk/examples/photoalbum/source/web.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-05-12 21:25:30 -0400 (Tue, 12 May 2009)
New Revision: 14148
Modified:
trunk/examples/photoalbum/source/web/pom.xml
Log:
https://jira.jboss.org/jira/browse/RF-7082
Modified: trunk/examples/photoalbum/source/web/pom.xml
===================================================================
--- trunk/examples/photoalbum/source/web/pom.xml 2009-05-13 01:03:19 UTC (rev 14147)
+++ trunk/examples/photoalbum/source/web/pom.xml 2009-05-13 01:25:30 UTC (rev 14148)
@@ -191,6 +191,10 @@
<groupId>org.richfaces.framework</groupId>
<artifactId>richfaces-api</artifactId>
</exclusion>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
</exclusions>
</dependency>
<dependency>
@@ -203,6 +207,12 @@
<artifactId>richfaces-api</artifactId>
<version>${richfacesVersion}</version>
<scope>provided</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.richfaces.examples</groupId>
15 years, 8 months
JBoss Rich Faces SVN: r14147 - in trunk/examples/photoalbum: assembly and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-05-12 21:03:19 -0400 (Tue, 12 May 2009)
New Revision: 14147
Removed:
trunk/examples/photoalbum/assembly/ear.xml
Modified:
trunk/examples/photoalbum/assembly/photoalbum.xml
trunk/examples/photoalbum/assembly/pom.xml
trunk/examples/photoalbum/pom.xml
trunk/examples/photoalbum/source/pom.xml
Log:
https://jira.jboss.org/jira/browse/RF-7082
Deleted: trunk/examples/photoalbum/assembly/ear.xml
===================================================================
--- trunk/examples/photoalbum/assembly/ear.xml 2009-05-13 00:46:30 UTC (rev 14146)
+++ trunk/examples/photoalbum/assembly/ear.xml 2009-05-13 01:03:19 UTC (rev 14147)
@@ -1,18 +0,0 @@
-<assembly>
- <id>photoalbum-ear</id>
- <formats>
- <format>zip</format>
- <format>tar.gz</format>
- </formats>
- <files>
- <file>
- <source>/../source/ear/target/photoalbum-ear-1.0-SNAPSHOT.ear</source>
- </file>
- <file>
- <source>/../../JBossORG-EULA.txt</source>
- </file>
- <file>
- <source>/../../lgpl.txt</source>
- </file>
- </files>
-</assembly>
\ No newline at end of file
Modified: trunk/examples/photoalbum/assembly/photoalbum.xml
===================================================================
--- trunk/examples/photoalbum/assembly/photoalbum.xml 2009-05-13 00:46:30 UTC (rev 14146)
+++ trunk/examples/photoalbum/assembly/photoalbum.xml 2009-05-13 01:03:19 UTC (rev 14147)
@@ -17,6 +17,10 @@
<fileSet>
<directory>target/docs</directory>
<outputDirectory>photoalbum/docs</outputDirectory>
+ <excludes>
+ <exclude>**/META-INF/*</exclude>
+ <exclude>**/META-INF</exclude>
+ </excludes>
</fileSet>
<fileSet>
<directory>../source</directory>
Modified: trunk/examples/photoalbum/assembly/pom.xml
===================================================================
--- trunk/examples/photoalbum/assembly/pom.xml 2009-05-13 00:46:30 UTC (rev 14146)
+++ trunk/examples/photoalbum/assembly/pom.xml 2009-05-13 01:03:19 UTC (rev 14147)
@@ -12,10 +12,6 @@
<name>Examples assembly project</name>
<packaging>pom</packaging>
- <build>
- <finalName>richfaces-examples-${project.version}</finalName>
- </build>
-
<dependencies>
<dependency>
<groupId>org.richfaces.examples</groupId>
@@ -25,69 +21,62 @@
</dependency>
</dependencies>
- <profiles>
- <profile>
- <id>release</id>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>unpack</id>
- <phase>generate-resources</phase>
- <goals>
- <goal>unpack</goal>
- </goals>
- <configuration>
- <artifactItems>
- <artifactItem>
- <groupId>org.richfaces.docs.realworld</groupId>
- <artifactId>en</artifactId>
- <version>3.3.1-SNAPSHOT</version>
- <type>jar</type>
- <!--classifier>pdf</classifier-->
- </artifactItem>
- </artifactItems>
- <outputDirectory>
- ${project.build.directory}/docs
- </outputDirectory>
- <overWriteReleases>
- false
- </overWriteReleases>
- <overWriteSnapshots>
- true
- </overWriteSnapshots>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
+ <build>
+ <finalName>richfaces-examples-${project.version}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>unpack</id>
+ <phase>generate-resources</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
<configuration>
- <outputDirectory>${project.build.directory}/dist</outputDirectory>
- <descriptors>
- <descriptor>photoalbum.xml</descriptor>
- <descriptor>ear.xml</descriptor>
- </descriptors>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.richfaces.docs.realworld</groupId>
+ <artifactId>en</artifactId>
+ <version>3.3.1-SNAPSHOT</version>
+ <type>jar</type>
+ <!--classifier>pdf</classifier-->
+ </artifactItem>
+ </artifactItems>
+ <outputDirectory>
+ ${project.build.directory}/docs
+ </outputDirectory>
+ <overWriteReleases>
+ false
+ </overWriteReleases>
+ <overWriteSnapshots>
+ true
+ </overWriteSnapshots>
</configuration>
- <executions>
- <execution>
- <id>make-assembly</id>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
+ </execution>
+ </executions>
+ </plugin>
- </profiles>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <outputDirectory>${project.build.directory}/dist</outputDirectory>
+ <descriptors>
+ <descriptor>photoalbum.xml</descriptor>
+ </descriptors>
+ </configuration>
+ <executions>
+ <execution>
+ <id>make-assembly</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</project>
Modified: trunk/examples/photoalbum/pom.xml
===================================================================
--- trunk/examples/photoalbum/pom.xml 2009-05-13 00:46:30 UTC (rev 14146)
+++ trunk/examples/photoalbum/pom.xml 2009-05-13 01:03:19 UTC (rev 14147)
@@ -10,45 +10,4 @@
<module>source</module>
</modules>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-ejb-plugin</artifactId>
- <configuration>
- <ejbVersion>3.0</ejbVersion>
- </configuration>
- </plugin>
- </plugins>
-
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-eclipse-plugin</artifactId>
- <version>2.5</version>
- <configuration>
- <downloadSources>true</downloadSources>
- <downloadJavadocs>false</downloadJavadocs>
- <projectNameTemplate>[artifactId]-[version]</projectNameTemplate>
- <wtpmanifest>true</wtpmanifest>
- <wtpapplicationxml>true</wtpapplicationxml>
- <wtpversion>2.0</wtpversion>
- <classpathContainers>
- <classpathContainer>org.eclipse.jdt.launching.JDK_CONTAINER</classpathContainer>
- </classpathContainers>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- </build>
-
</project>
\ No newline at end of file
Modified: trunk/examples/photoalbum/source/pom.xml
===================================================================
--- trunk/examples/photoalbum/source/pom.xml 2009-05-13 00:46:30 UTC (rev 14146)
+++ trunk/examples/photoalbum/source/pom.xml 2009-05-13 01:03:19 UTC (rev 14147)
@@ -2,18 +2,13 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
+ <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.richfaces.examples</groupId>
- <artifactId>photoalbum</artifactId>
- <version>1.0-SNAPSHOT</version>
- </parent>
-
<groupId>org.richfaces.examples</groupId>
<artifactId>photoalbum-source</artifactId>
<packaging>pom</packaging>
<name>${appName}</name>
+ <version>1.0-SNAPSHOT</version>
<properties>
<appName>Photoalbum Demo Application</appName>
15 years, 8 months
JBoss Rich Faces SVN: r14146 - in trunk/examples/photoalbum: assembly and 7 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-05-12 20:46:30 -0400 (Tue, 12 May 2009)
New Revision: 14146
Removed:
trunk/examples/photoalbum/source/ear/src/main/application/jboss-app.xml
Modified:
trunk/examples/photoalbum/assembly/
trunk/examples/photoalbum/assembly/photoalbum.xml
trunk/examples/photoalbum/assembly/pom.xml
trunk/examples/photoalbum/pom.xml
trunk/examples/photoalbum/source/ear/pom.xml
trunk/examples/photoalbum/source/ejb/pom.xml
trunk/examples/photoalbum/source/pom.xml
trunk/examples/photoalbum/source/web/pom.xml
trunk/examples/photoalbum/tests/pom.xml
trunk/examples/photoalbum/tests/src/test/java/org/richfaces/photoalbum/SeleniumTestBase.java
Log:
https://jira.jboss.org/jira/browse/RF-7082
Property changes on: trunk/examples/photoalbum/assembly
___________________________________________________________________
Name: svn:ignore
+ target
Modified: trunk/examples/photoalbum/assembly/photoalbum.xml
===================================================================
--- trunk/examples/photoalbum/assembly/photoalbum.xml 2009-05-12 23:36:50 UTC (rev 14145)
+++ trunk/examples/photoalbum/assembly/photoalbum.xml 2009-05-13 00:46:30 UTC (rev 14146)
@@ -1,5 +1,4 @@
<assembly>
- <id>photoalbum</id>
<formats>
<format>zip</format>
<format>tar.gz</format>
@@ -7,9 +6,6 @@
<files>
<file>
- <source>/../source/ear/target/photoalbum-ear-1.0-SNAPSHOT.ear</source>
- </file>
- <file>
<source>/../../JBossORG-EULA.txt</source>
</file>
<file>
@@ -19,60 +15,31 @@
<fileSets>
<fileSet>
- <directory>/../doc</directory>
- <outputDirectory>/docs</outputDirectory>
+ <directory>target/docs</directory>
+ <outputDirectory>photoalbum/docs</outputDirectory>
</fileSet>
<fileSet>
- <directory>/../source</directory>
- <outputDirectory>/src</outputDirectory>
+ <directory>../source</directory>
+ <outputDirectory>photoalbum/source</outputDirectory>
<includes>
- <include>*build.xml</include>
- <include>*build.properties</include>
- <include>pom.xml</include>
+ <include>*/src/**</include>
+ <include>*/sql/**</include>
+ <include>*/environment/**</include>
+ <include>*/Upload/short/**</include>
+ <include>**/*build.xml</include>
+ <include>**/build.properties</include>
+ <include>**/pom.xml</include>
</includes>
</fileSet>
- <fileSet>
- <directory>/../source/ear</directory>
- <outputDirectory>/src/ear</outputDirectory>
- <includes>
- <include>src/**</include>
- <include>*build.xml</include>
- <include>*build.properties</include>
- <include>pom.xml</include>
- </includes>
- </fileSet>
- <fileSet>
- <directory>/../source/ejb</directory>
- <outputDirectory>/src/ejb</outputDirectory>
- <includes>
- <include>src/**</include>
- <include>sql/**</include>
- <include>*build.xml</include>
- <include>*build.properties</include>
- <include>pom.xml</include>
- </includes>
- </fileSet>
- <fileSet>
- <directory>/../source/web</directory>
- <outputDirectory>/src/web</outputDirectory>
- <includes>
- <include>src/**</include>
- <include>environment/**</include>
- <include>Upload/short/**</include>
- <include>*build.xml</include>
- <include>*build.properties</include>
- <include>pom.xml</include>
- </includes>
- </fileSet>
- <fileSet>
- <directory>/../tests</directory>
- <outputDirectory>/src/tests</outputDirectory>
- <includes>
- <include>src/**</include>
- <include>*build.xml</include>
- <include>*build.properties</include>
- <include>pom.xml</include>
- </includes>
- </fileSet>
</fileSets>
+ <dependencySets>
+ <dependencySet>
+ <outputDirectory>photoalbum/dist</outputDirectory>
+ <unpack>false</unpack>
+ <scope>runtime</scope>
+ <includes>
+ <include>org.richfaces.examples:*</include>
+ </includes>
+ </dependencySet>
+ </dependencySets>
</assembly>
\ No newline at end of file
Modified: trunk/examples/photoalbum/assembly/pom.xml
===================================================================
--- trunk/examples/photoalbum/assembly/pom.xml 2009-05-12 23:36:50 UTC (rev 14145)
+++ trunk/examples/photoalbum/assembly/pom.xml 2009-05-13 00:46:30 UTC (rev 14146)
@@ -2,95 +2,88 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.richfaces</groupId>
+ <groupId>org.richfaces.examples</groupId>
<artifactId>photoalbum</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
- <artifactId>${projectName}-assembler</artifactId>
- <name>Assembler module</name>
+
+ <groupId>org.richfaces.examples</groupId>
+ <artifactId>assembly</artifactId>
+ <name>Examples assembly project</name>
<packaging>pom</packaging>
<build>
- <finalName>${projectName}-ear-1.0-SNAPSHOT</finalName>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-scm-plugin</artifactId>
- <executions>
- <execution>
- <id>fetch-feature</id>
- <phase>none</phase>
- </execution>
- </executions>
- </plugin>
- </plugins>
+ <finalName>richfaces-examples-${project.version}</finalName>
</build>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces.examples</groupId>
+ <artifactId>photoalbum-ear</artifactId>
+ <version>${project.version}</version>
+ <type>ear</type>
+ </dependency>
+ </dependencies>
+
<profiles>
<profile>
- <id>livedemo</id>
- </profile>
-
- <profile>
<id>release</id>
<build>
<plugins>
<plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <configuration>
- <outputDirectory>../dist</outputDirectory>
- <descriptors>
- <descriptor>photoalbum.xml</descriptor>
- <descriptor>ear.xml</descriptor>
- </descriptors>
- </configuration>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
- <id>make-assembly</id>
- <phase>install</phase>
+ <id>unpack</id>
+ <phase>generate-resources</phase>
<goals>
- <goal>single</goal>
+ <goal>unpack</goal>
</goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.richfaces.docs.realworld</groupId>
+ <artifactId>en</artifactId>
+ <version>3.3.1-SNAPSHOT</version>
+ <type>jar</type>
+ <!--classifier>pdf</classifier-->
+ </artifactItem>
+ </artifactItems>
+ <outputDirectory>
+ ${project.build.directory}/docs
+ </outputDirectory>
+ <overWriteReleases>
+ false
+ </overWriteReleases>
+ <overWriteSnapshots>
+ true
+ </overWriteSnapshots>
+ </configuration>
</execution>
</executions>
</plugin>
-
+
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-scm-plugin</artifactId>
- <version>1.2</version>
+ <artifactId>maven-assembly-plugin</artifactId>
<configuration>
- <connectionType>developerConnection</connectionType>
+ <outputDirectory>${project.build.directory}/dist</outputDirectory>
+ <descriptors>
+ <descriptor>photoalbum.xml</descriptor>
+ <descriptor>ear.xml</descriptor>
+ </descriptors>
</configuration>
<executions>
<execution>
- <id>fetch-feature</id>
- <phase>generate-sources</phase>
+ <id>make-assembly</id>
+ <phase>package</phase>
<goals>
- <goal>export</goal>
+ <goal>single</goal>
</goals>
-
- <configuration>
- <connectionType>developerConnection</connectionType>
- <developerConnectionUrl>scm:svn:https://svn.jboss.org/repos/richfaces/branches/examples-data/phot...</developerConnectionUrl>
- <skipExportIfExists>true</skipExportIfExists>
- <exportDirectory>source/web/Upload/full</exportDirectory>
- </configuration>
</execution>
</executions>
</plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-scm-plugin</artifactId>
- <executions>
- <execution>
- <id>fetch-feature</id>
- <phase>none</phase>
- </execution>
- </executions>
- </plugin>
</plugins>
</build>
</profile>
Modified: trunk/examples/photoalbum/pom.xml
===================================================================
--- trunk/examples/photoalbum/pom.xml 2009-05-12 23:36:50 UTC (rev 14145)
+++ trunk/examples/photoalbum/pom.xml 2009-05-13 00:46:30 UTC (rev 14146)
@@ -1,47 +1,13 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces</groupId>
+ <groupId>org.richfaces.examples</groupId>
<artifactId>photoalbum</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
- <name>sample application</name>
- <parent>
- <groupId>org.jboss.seam</groupId>
- <artifactId>root</artifactId>
- <version>2.1.1.GA</version>
- </parent>
- <properties>
- <projectName>photoalbum</projectName>
- <richfacesVersion>3.3.1-SNAPSHOT</richfacesVersion>
- <seamVersion>2.1.1.GA</seamVersion>
- <faceletsVersion>1.1.15.B1</faceletsVersion>
- <jbosshome>${project.basedir}/target/installs/jboss-4.2.3.GA/jboss-4.2.3.GA</jbosshome>
- <jbosscontext>default</jbosscontext>
- <jboss.installer.url>file:E:\install\Develop\java\JBoss\jboss-4.2.3.GA.zip</jboss.installer.url>
- <imageset>full</imageset>
- <environment.properties>environment/prod</environment.properties>
- </properties>
- <repositories>
- <repository>
- <id>repository.jboss.com</id>
- <name>Jboss Repository for Maven</name>
- <url>http://repository.jboss.com/maven2/</url>
- </repository>
- <repository>
- <id>repository.jboss.org</id>
- <name>Jboss Repository for Maven</name>
- <url>http://repository.jboss.org/maven2/</url>
- </repository>
- </repositories>
-
<modules>
- <module>source/ear</module>
- <module>source/ejb</module>
- <module>source/web</module>
- <module>assembly</module>
- <!--module>tests</module-->
+ <module>source</module>
</modules>
<build>
@@ -85,63 +51,4 @@
</pluginManagement>
</build>
- <profiles>
- <profile>
- <id>livedemo</id>
- <activation>
- <activeByDefault>true</activeByDefault>
- </activation>
-
- <properties>
- <imageset>full</imageset>
- <imagespath>Upload/full/images</imagespath>
- </properties>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-scm-plugin</artifactId>
- <version>1.2</version>
- <configuration>
- <connectionType>developerConnection</connectionType>
- </configuration>
- <executions>
- <execution>
- <id>fetch-feature</id>
- <phase>generate-sources</phase>
- <goals>
- <goal>export</goal>
- </goals>
-
- <configuration>
- <connectionType>developerConnection</connectionType>
- <developerConnectionUrl>scm:svn:https://svn.jboss.org/repos/richfaces/branches/examples-data/phot...</developerConnectionUrl>
- <skipExportIfExists>true</skipExportIfExists>
- <exportDirectory>source/web/Upload/full</exportDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- <profile>
- <id>hudson</id>
- <properties>
- <jboss.installer.url>http://internap.dl.sourceforge.net/sourceforge/jboss/jboss-4.2.3.GA.zip</jboss.installer.url>
- </properties>
- </profile>
-
- <profile>
- <id>release</id>
-
- <properties>
- <imageset>full</imageset>
- <imagespath>Upload/full/images</imagespath>
- </properties>
- </profile>
- </profiles>
-
</project>
\ No newline at end of file
Modified: trunk/examples/photoalbum/source/ear/pom.xml
===================================================================
--- trunk/examples/photoalbum/source/ear/pom.xml 2009-05-12 23:36:50 UTC (rev 14145)
+++ trunk/examples/photoalbum/source/ear/pom.xml 2009-05-13 00:46:30 UTC (rev 14146)
@@ -2,18 +2,21 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.richfaces</groupId>
- <artifactId>photoalbum</artifactId>
+ <groupId>org.richfaces.examples</groupId>
+ <artifactId>photoalbum-source</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
+
+ <groupId>org.richfaces.examples</groupId>
<artifactId>${projectName}-ear</artifactId>
- <name>EAR module</name>
+ <name>${appName} EAR module</name>
<packaging>ear</packaging>
+
<dependencies>
<dependency>
- <groupId>org.richfaces</groupId>
+ <groupId>org.richfaces.examples</groupId>
<artifactId>${projectName}-web</artifactId>
- <version>1.0-SNAPSHOT</version>
+ <version>${project.version}</version>
<type>war</type>
</dependency>
<dependency>
@@ -22,9 +25,9 @@
<version>${richfacesVersion}</version>
</dependency>
<dependency>
- <groupId>org.richfaces</groupId>
+ <groupId>org.richfaces.examples</groupId>
<artifactId>${projectName}-ejb</artifactId>
- <version>1.0-SNAPSHOT</version>
+ <version>${project.version}</version>
<type>ejb</type>
</dependency>
<dependency>
@@ -62,43 +65,20 @@
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-scm-plugin</artifactId>
- <executions>
- <execution>
- <id>fetch-feature</id>
- <phase>none</phase>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <executions>
- <execution>
- <id>make-assembly</id>
- <phase>none</phase>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ear-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<generateApplicationXml>true</generateApplicationXml>
<includeJar>false</includeJar>
<defaultLibBundleDir>lib</defaultLibBundleDir>
- <loader-repository>seam.jboss.org:loader=${project.build.finalName}</loader-repository>
<modules>
<webModule>
- <groupId>org.richfaces</groupId>
+ <groupId>org.richfaces.examples</groupId>
<artifactId>${projectName}-web</artifactId>
<contextRoot>/${projectName}</contextRoot>
</webModule>
<ejbModule>
- <groupId>org.richfaces</groupId>
+ <groupId>org.richfaces.examples</groupId>
<artifactId>${projectName}-ejb</artifactId>
</ejbModule>
<ejbModule>
@@ -106,6 +86,10 @@
<artifactId>jboss-seam</artifactId>
</ejbModule>
</modules>
+ <jboss>
+ <version>4.2</version>
+ <loader-repository>org.richfaces.examples:loader=${project.build.finalName}</loader-repository>
+ </jboss>
</configuration>
</plugin>
Deleted: trunk/examples/photoalbum/source/ear/src/main/application/jboss-app.xml
===================================================================
--- trunk/examples/photoalbum/source/ear/src/main/application/jboss-app.xml 2009-05-12 23:36:50 UTC (rev 14145)
+++ trunk/examples/photoalbum/source/ear/src/main/application/jboss-app.xml 2009-05-13 00:46:30 UTC (rev 14146)
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE jboss-app
- PUBLIC "-//JBoss//DTD J2EE Application 4.2//EN"
- "http://www.jboss.org/j2ee/dtd/jboss-app_4_2.dtd">
-
-<jboss-app>
- <loader-repository>
- seam.jboss.org:loader=photoalbum-ear-1.0-SNAPSHOT.ear
- </loader-repository>
-</jboss-app>
\ No newline at end of file
Modified: trunk/examples/photoalbum/source/ejb/pom.xml
===================================================================
--- trunk/examples/photoalbum/source/ejb/pom.xml 2009-05-12 23:36:50 UTC (rev 14145)
+++ trunk/examples/photoalbum/source/ejb/pom.xml 2009-05-13 00:46:30 UTC (rev 14146)
@@ -4,13 +4,14 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.richfaces</groupId>
- <artifactId>photoalbum</artifactId>
+ <groupId>org.richfaces.examples</groupId>
+ <artifactId>photoalbum-source</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
+
+ <groupId>org.richfaces.examples</groupId>
<artifactId>${projectName}-ejb</artifactId>
- <name>EJB module</name>
- <version>1.0-SNAPSHOT</version>
+ <name>${appName} EJB module</name>
<packaging>ejb</packaging>
<dependencies>
@@ -97,28 +98,6 @@
<plugins>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-scm-plugin</artifactId>
- <executions>
- <execution>
- <id>fetch-feature</id>
- <phase>none</phase>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <executions>
- <execution>
- <id>make-assembly</id>
- <phase>none</phase>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
<artifactId>maven-ejb-plugin</artifactId>
<configuration>
<ejbVersion>3.0</ejbVersion>
Modified: trunk/examples/photoalbum/source/pom.xml
===================================================================
--- trunk/examples/photoalbum/source/pom.xml 2009-05-12 23:36:50 UTC (rev 14145)
+++ trunk/examples/photoalbum/source/pom.xml 2009-05-13 00:46:30 UTC (rev 14146)
@@ -1,19 +1,22 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces</groupId>
- <artifactId>photoalbum</artifactId>
- <packaging>pom</packaging>
- <version>1.0-SNAPSHOT</version>
- <name>sample application</name>
+
+ <modelVersion>4.0.0</modelVersion>
+
<parent>
- <groupId>org.jboss.seam</groupId>
- <artifactId>root</artifactId>
- <version>2.1.1.GA</version>
+ <groupId>org.richfaces.examples</groupId>
+ <artifactId>photoalbum</artifactId>
+ <version>1.0-SNAPSHOT</version>
</parent>
+ <groupId>org.richfaces.examples</groupId>
+ <artifactId>photoalbum-source</artifactId>
+ <packaging>pom</packaging>
+ <name>${appName}</name>
+
<properties>
+ <appName>Photoalbum Demo Application</appName>
<projectName>photoalbum</projectName>
<richfacesVersion>3.3.1-SNAPSHOT</richfacesVersion>
<seamVersion>2.1.1.GA</seamVersion>
@@ -26,21 +29,15 @@
</properties>
<repositories>
<repository>
- <id>repository.jboss.com</id>
- <name>Jboss Repository for Maven</name>
- <url>http://repository.jboss.com/maven2/</url>
- </repository>
- <repository>
<id>repository.jboss.org</id>
<name>Jboss Repository for Maven</name>
<url>http://repository.jboss.org/maven2/</url>
</repository>
</repositories>
<modules>
- <module>ear</module>
<module>ejb</module>
<module>web</module>
- <!--module>tests</module-->
+ <module>ear</module>
</modules>
<build>
<plugins>
@@ -86,16 +83,14 @@
</pluginManagement>
</build>
-
<profiles>
<profile>
- <id>hudson</id>
+ <id>livedemo</id>
<properties>
- <jboss.installer.url>
- http://internap.dl.sourceforge.net/sourceforge/jboss/jboss-4.2.3.GA.zip
- </jboss.installer.url>
+ <imageset>full</imageset>
+ <imagespath>Upload/full/images</imagespath>
+ <environment.properties>environment/prod</environment.properties>
</properties>
</profile>
</profiles>
-
</project>
\ No newline at end of file
Modified: trunk/examples/photoalbum/source/web/pom.xml
===================================================================
--- trunk/examples/photoalbum/source/web/pom.xml 2009-05-12 23:36:50 UTC (rev 14145)
+++ trunk/examples/photoalbum/source/web/pom.xml 2009-05-13 00:46:30 UTC (rev 14146)
@@ -4,13 +4,14 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>org.richfaces</groupId>
- <artifactId>photoalbum</artifactId>
+ <groupId>org.richfaces.examples</groupId>
+ <artifactId>photoalbum-source</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
+
+ <groupId>org.richfaces.examples</groupId>
<artifactId>${projectName}-web</artifactId>
- <name>WAR module</name>
- <version>1.0-SNAPSHOT</version>
+ <name>${appName} WAR module</name>
<packaging>war</packaging>
<dependencies>
@@ -204,7 +205,7 @@
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.richfaces</groupId>
+ <groupId>org.richfaces.examples</groupId>
<artifactId>${projectName}-ejb</artifactId>
<version>1.0-SNAPSHOT</version>
<type>ejb</type>
@@ -226,7 +227,7 @@
<artifactId>maven-scm-plugin</artifactId>
<version>1.2</version>
<configuration>
- <connectionType>developerConnection</connectionType>
+ <connectionType>connection</connectionType>
</configuration>
<executions>
<execution>
@@ -237,8 +238,8 @@
</goals>
<configuration>
- <connectionType>developerConnection</connectionType>
- <developerConnectionUrl>scm:svn:https://svn.jboss.org/repos/richfaces/branches/examples-data/phot...</developerConnectionUrl>
+ <connectionType>connection</connectionType>
+ <developerConnectionUrl>scm:svn:http://anonsvn.jboss.org/repos/richfaces/branches/examples-data/p...</developerConnectionUrl>
<skipExportIfExists>true</skipExportIfExists>
<exportDirectory>Upload/full</exportDirectory>
</configuration>
Modified: trunk/examples/photoalbum/tests/pom.xml
===================================================================
--- trunk/examples/photoalbum/tests/pom.xml 2009-05-12 23:36:50 UTC (rev 14145)
+++ trunk/examples/photoalbum/tests/pom.xml 2009-05-13 00:46:30 UTC (rev 14146)
@@ -1,11 +1,22 @@
<?xml version="1.0"?><project>
<modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.richfaces</groupId>
+ <parent>
+ <groupId>org.richfaces.examples</groupId>
<artifactId>photoalbum</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
+ <groupId>org.richfaces.examples</groupId>
+ <artifactId>photoalbum-tests</artifactId>
+ <name>Photoalbum Selenium Tests Module</name>
+ <packaging>jar</packaging>
+
+ <properties>
+ <jbosshome>${project.basedir}/target/installs/jboss-4.2.3.GA/jboss-4.2.3.GA</jbosshome>
+ <jboss.installer.url>file:F:\Distribs\jboss-4.2.3.GA.zip</jboss.installer.url>
+ <jbosscontext>default</jbosscontext>
+ </properties>
+
<repositories>
<repository>
<id>nexus-openqa</id>
@@ -33,18 +44,10 @@
</repository>
</repositories>
- <artifactId>${projectName}-tests</artifactId>
- <name>Selenium Tests Module</name>
- <version>1.0-SNAPSHOT</version>
- <packaging>jar</packaging>
- <properties>
- <jbosshome>${project.basedir}/target/installs/jboss-4.2.3.GA/jboss-4.2.3.GA</jbosshome>
- <jboss.installer.url>file:E:\apps\jboss\jboss-4.2.3.GA.zip</jboss.installer.url>
- </properties>
<dependencies>
<dependency>
- <groupId>org.richfaces</groupId>
- <artifactId>${projectName}-ear</artifactId>
+ <groupId>org.richfaces.examples</groupId>
+ <artifactId>photoalbum-ear</artifactId>
<version>${project.version}</version>
<type>ear</type>
<scope>provided</scope>
@@ -64,27 +67,6 @@
<classifier>jdk15</classifier>
</dependency>
<dependency>
- <groupId>org.richfaces.framework</groupId>
- <artifactId>richfaces-api</artifactId>
- <version>${richfacesVersion}</version>
- </dependency>
- <dependency>
- <groupId>org.richfaces.framework</groupId>
- <artifactId>richfaces-impl</artifactId>
- <version>${richfacesVersion}</version>
- </dependency>
- <dependency>
- <groupId>org.richfaces.ui</groupId>
- <artifactId>richfaces-ui</artifactId>
- <version>${richfacesVersion}</version>
- </dependency>
- <dependency>
- <groupId>javax.faces</groupId>
- <artifactId>jsf-api</artifactId>
- <version>1.2_08</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
<groupId>org.openqa.selenium.client-drivers</groupId>
<artifactId>selenium-java-client-driver</artifactId>
<version>1.0-SNAPSHOT</version>
@@ -113,17 +95,6 @@
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-scm-plugin</artifactId>
- <executions>
- <execution>
- <id>fetch-feature</id>
- <phase>none</phase>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.4.3</version>
<configuration>
@@ -196,7 +167,7 @@
<type>installed</type>
<deployables>
<deployable>
- <artifactId>${projectName}-ear</artifactId>
+ <artifactId>photoalbum-ear</artifactId>
<type>ear</type>
</deployable>
</deployables>
Modified: trunk/examples/photoalbum/tests/src/test/java/org/richfaces/photoalbum/SeleniumTestBase.java
===================================================================
--- trunk/examples/photoalbum/tests/src/test/java/org/richfaces/photoalbum/SeleniumTestBase.java 2009-05-12 23:36:50 UTC (rev 14145)
+++ trunk/examples/photoalbum/tests/src/test/java/org/richfaces/photoalbum/SeleniumTestBase.java 2009-05-13 00:46:30 UTC (rev 14146)
@@ -7,8 +7,6 @@
import java.io.FileFilter;
import java.io.FileInputStream;
-import org.ajax4jsf.javascript.JSFunction;
-import org.ajax4jsf.javascript.ScriptUtils;
import org.openqa.selenium.server.RemoteControlConfiguration;
import org.openqa.selenium.server.SeleniumServer;
import org.testng.Assert;
@@ -651,31 +649,6 @@
}
/**
- * Invokes JS method on client.
- *
- * @param id -
- * DOM id of component
- * @param method -
- * string method name
- * @param parameters -
- * parameters
- * @return
- */
- public String invokeFromComponent(String id, String method, Object parameters) {
- String _return = null;
- StringBuffer buffer = new StringBuffer();
- buffer.append("$('");
- buffer.append(id);
- buffer.append("').component.");
- buffer.append(method);
- buffer.append("(");
- buffer.append(ScriptUtils.toScript(parameters));
- buffer.append(");");
- _return = runScript(buffer.toString());
- return _return;
- }
-
- /**
* Creates delay
*
* @param miliSeconds
@@ -889,18 +862,4 @@
+ x + "," + y + ","+ctrl+");");
}
- /**
- * Calls component JS API
- *
- * @param id - Client id of the component to call operation on
- * @param function - JS function representing operation that should be called
- * @return - Result of execution
- */
- public String callComponentOperation(String id, JSFunction function) {
- StringBuffer command = new StringBuffer();
- new JSFunction("document.getElementById", id).appendScript(command);
- command.append(".component.");
- function.appendScript(command);
- return runScript(command.toString());
- }
}
15 years, 8 months