Author: amarkhel
Date: 2009-04-08 07:44:03 -0400 (Wed, 08 Apr 2009)
New Revision: 13427
Modified:
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/Constants.java
Log:
Refactoring
Modified:
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/Constants.java
===================================================================
---
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/Constants.java 2009-04-08
11:43:55 UTC (rev 13426)
+++
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/Constants.java 2009-04-08
11:44:03 UTC (rev 13427)
@@ -20,6 +20,7 @@
*/
package org.richfaces.realworld.service;
+
/**
* Utility class. Group of constants
*
@@ -27,25 +28,94 @@
*/
public class Constants {
+ //Events
public static final String ADD_ERROR_EVENT = "addErrorEvent";
+ public static final String ALBUM_DELETED_EVENT = "albumDeleted";
+ public static final String ALBUM_EDITED_EVENT = "albumEdited";
+ public static final String UPDATE_MAIN_AREA_EVENT = "updateMainArea";
+ public static final String CLEAR_EDITOR_EVENT = "clearEditor";
+ public static final String CLEAR_TREE_EVENT = "clearTree";
+ public static final String ALBUM_ADDED_EVENT = "albumAdded";
+ public static final String DNDUPLOADED_EVENT = "DNDUploadedEvent";
+ public static final String ADD_IMAGE_EVENT = "addImage";
+ public static final String SHELF_DELETED_EVENT = "shelfDeleted";
+ public static final String CLEAR_FILE_UPLOAD_EVENT = "clearFileUpload";
+ public static final String UPDATE_SELECTED_TAG_EVENT = "updateSelectedTag";
+ public static final String STOP_SLIDESHOW_EVENT = "StopSlideshow";
+ public static final String IMAGE_DELETED_EVENT = "imageDeleted";
+ public static final String IMAGE_ADDED_EVENT = "imageAdded";
- public static final String SLASH = "/";
- public static final String DOT = ".";
+ //Errors(Internationalization pending)
+ public static final String SHELF_MUST_BE_NOT_NULL_ERROR = "Shelf must be
not-null";
+ public static final String NO_SHELF_ERROR = "You must create at least one shelf
before creating album!";
+ public static final String ALBUM_CREATE_ERROR = "You must create at least one shelf
before creating album!";
+ public static final String DND_ALBUM_ERROR = "You can't add album to that
shelf";
+ public static final String DND_PHOTO_ERROR = "You can't add photo's to that
album";
+ public static final String NO_ALBUM_TO_DOWNLOAD_ERROR = "Please specify album to
download";
+ public static final String NULL_COMMENT_ERROR = "Comment must be not-null";
+ public static final String ADDING_COMMENT_ERROR = "For adding comment on this
picture you must login";
+ public static final String NO_IMAGES_FOR_SLIDESHOW_ERROR = "No images for
slideshow!";
+ public static final String FILE_IO_ERROR = "File IO Error";
+ public static final String UPLOAD_ROOT_CREATION_ERROR = "Upload root was not
created";
+ public static final String UPLOAD_FOLDER_PATH_ERROR = "Cannot bound image folder
path";
+ public static final String INVALID_LOGIN_OR_PASSWORD = "Invalid login or
password";
+ public static final String USER_WITH_THIS_LOGIN_ALREADY_EXIST = "User with this
login already exist";
+ public static final String CONFIRM_PASSWORD_NOT_EQUALS_PASSWORD = "Confirm
Password not equals password";
+ public static final String HAVENT_ACCESS = "You have no rights to view this
album";
+ public static final String FILE_PROCESSING_ERROR = "Error processing occured during
upload";
+ public static final String FILE_SAVE_ERROR = "Error occured during saving image to
disk";
- public static final String ADD_IMAGE_EVENT = "addImage";
- public static final String JPEG = "jpeg";
+ //Outcomes
+ public static final String LOGOUT_OUTCOME = "logout";
+ public static final String REGISTER_OUTCOME = "register";
+ public static final String MAIN_OUTCOME = "main";
+ public static final String INDEX_OUTCOME = "index";
- public static final String MAIN_OUTCOME = "main";
-
+ //Context-variables
+ public static final String ALBUM_VARIABLE = "album";
+ public static final String SHELF_VARIABLE = "shelf";
+
+ //ID's
public static final String REGISTER_LOGIN_NAME_ID = "register:loginName";
public static final String REGISTER_CONFIRM_PASSWORD_ID =
"register:confirmPassword";
- public static final String INDEX_OUTCOME = "index";
+ public static final String SHELF_ID = "shelf";
+
+ //Roles
public static final String ADMIN_ROLE = "admin";
public static final String GUEST_ROLE = "guest";
- public static final String UPDATE_MAIN_AREA_EVENT = "updateMainArea";
- public static final String CLEAR_EDITOR_EVENT = "clearEditor";
+
+ //Size
+ public static final int MEDIUM_SIZE = 600;
+ public static final int SMALL_200_SIZE = 200;
+ public static final int SMALL_160_SIZE = 160;
+ public static final int SMALL_120_SIZE = 120;
+ public static final int SMALL_80_SIZE = 80;
+ public static final int AVATAR_SIZE = 80;
+ public static final String AVATAR_JPG = "/avatar.jpg";
+ public static final String _SMALL160 = "_small160";
+ public static final String _SMALL120 = "_small120";
+ public static final String _SMALL80 = "_small80";
+ public static final String _SMALL200 = "_small200";
+ public static final String _MEDIUM = "_medium";
+
+ //misc
+ public static final String SLASH = "/";
+ public static final String DOT = ".";
+ public static final String JPEG = "jpeg";
+ public static final String JPG = "JPG";
+ public static final String UPLOAD_ROOT_COMPONENT_NAME = "uploadRoot";
+ public static final String UPLOAD_ROOT_PATH_COMPONENT_NAME =
"uploadRootPath";
public static final int INITIAL_DELAY = 4000;
public static final int DELAY = 3000;
+ public static final String DEFAULT_PICTURE = "default/noimage.jpg";
+ public static final int DEFAULT_BUFFER_SIZE = 8192;
+ public static final String UPLOAD = "upload";
+ public static final String FEMALE = "Female";
+ public static final String MALE = "Male";
+ public static final String TEMP_DIR = "java.io.tmpdir";
+ public static final String WEB_INF = "WEB-INF";
+ public static final String IMAGE_FOLDER = "/Upload";
+ public static final String REALWORLD_FOLDER = "richfaces_realworld";
//Service -constants
public static final String USER_EXIST_QUERY = "user-exist";
@@ -87,7 +157,5 @@
public static final String SHELF_PARAMETER = "shelf";
public static final String SHELF_UNVISITED_QUERY = "shelf-unvisited";
private Constants(){
-
}
-
-}
+}
\ No newline at end of file