JBoss Rich Faces SVN: r13426 - in trunk/test-applications/realworld2/web/src/main: java/org/richfaces/realworld/search and 12 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2009-04-08 07:43:55 -0400 (Wed, 08 Apr 2009)
New Revision: 13426
Removed:
trunk/test-applications/realworld2/web/src/main/webapp/img/tree/
Modified:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/AlbumManager.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Controller.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/DnDManager.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/FileManager.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/FileUploadManager.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/ImageManager.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Model.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/ShelfManager.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/SlideshowManager.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/TreeManager.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/UserManager.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/ISearchOption.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/ImageSearchHelper.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/SearchOptionByAlbum.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/SearchOptionByImage.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/SearchOptionByShelf.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/SearchOptionByTag.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/SearchOptionByUser.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/ConfirmationPopupHelper.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/DirectLinkHelper.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/EditorBean.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/FileWrapper.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/ImageLoader.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/UserPrefsHelper.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/CopyImageStuff.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/FileUtils.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/SessionListener.java
trunk/test-applications/realworld2/web/src/main/resources/messages_en.properties
trunk/test-applications/realworld2/web/src/main/resources/messages_ru.properties
trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/pages.xml
trunk/test-applications/realworld2/web/src/main/webapp/error.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/album/createAlbum.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/contextMenu/CMForAlbum.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/contextMenu/CMForImage.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/contextMenu/CMForShelf.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/contextMenu/CMForUser.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/fileUpload/uploadResult.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/index/login.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/index/menu.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/misc/confirmation.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/misc/help.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/misc/modalPanels.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/misc/slideShowPooler.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/shelf/createShelf.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/index.xhtml
Log:
Refactoring
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/AlbumManager.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/AlbumManager.java 2009-04-08 10:01:51 UTC (rev 13425)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/AlbumManager.java 2009-04-08 11:43:55 UTC (rev 13426)
@@ -47,20 +47,24 @@
public class AlbumManager implements Serializable{
private static final long serialVersionUID = 2631634926126857691L;
+
private boolean validationSuccess = false;
+
@In private IAlbumAction albumAction;
@In private User user;
@In FileManager fileManager;
+
@In FacesMessages facesMessages;
+
@In @Out Model model;
@Restrict("#{s:hasRole('admin')}")
public void addAlbum(Album album){
if(album.getShelf() == null){
- facesMessages.addToControl("shelf", "Shelf must be not-null", null);
- Contexts.getConversationContext().set("album", album);
+ facesMessages.addToControl(Constants.SHELF_ID, Constants.SHELF_MUST_BE_NOT_NULL_ERROR, null);
+ Contexts.getConversationContext().set(Constants.ALBUM_VARIABLE, album);
return;
}
validationSuccess = true;
@@ -68,9 +72,9 @@
fileManager.addDirectory(user.getLogin(), album.getId().toString());
model.resetModel(NavigationEnum.ALBUM_PREVIEW, album.getShelf().getOwner(), album.getShelf(), album, null, album.getImages());
model.setImages(new ArrayList<Image>());
- Contexts.getConversationContext().set("album", null);
- Events.instance().raiseEvent("albumAdded");
- Events.instance().raiseEvent("clearTree");
+ Contexts.getConversationContext().set(Constants.ALBUM_VARIABLE, null);
+ Events.instance().raiseEvent(Constants.ALBUM_ADDED_EVENT);
+ Events.instance().raiseEvent(Constants.CLEAR_TREE_EVENT);
}
@Restrict("#{s:hasRole('admin')}")
@@ -81,19 +85,19 @@
shelf = user.getShelfs().get(0);
}
if(shelf == null){
- Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, "You must create at least one shelf before creating album!");
+ Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, Constants.NO_SHELF_ERROR);
return;
}
}
album.setShelf(shelf);
- Contexts.getConversationContext().set("album", album);
+ Contexts.getConversationContext().set(Constants.ALBUM_VARIABLE, album);
}
@Restrict("#{s:hasRole('admin')}")
public void editAlbum(Album album){
albumAction.editAlbum(album);
model.resetModel(NavigationEnum.ALBUM_PREVIEW, model.getSelectedUser(), model.getSelectedShelf(), album, null, album.getImages());
- Events.instance().raiseEvent("albumEdited");
+ Events.instance().raiseEvent(Constants.ALBUM_EDITED_EVENT);
}
@Restrict("#{s:hasRole('admin')}")
@@ -102,8 +106,8 @@
albumAction.deleteAlbum(album);
fileManager.deleteDirectory(user.getLogin(), albumName);
model.resetModel(NavigationEnum.ALL_ALBUMS, model.getSelectedUser(), model.getSelectedShelf(), null, null, null);
- Events.instance().raiseEvent("albumDeleted");
- Events.instance().raiseEvent("clearTree");
+ Events.instance().raiseEvent(Constants.ALBUM_DELETED_EVENT);
+ Events.instance().raiseEvent(Constants.CLEAR_TREE_EVENT);
}
public List<Image> getUnvisitedImages(Album album){
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java 2009-04-08 10:01:51 UTC (rev 13425)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java 2009-04-08 11:43:55 UTC (rev 13426)
@@ -51,30 +51,23 @@
@Scope(ScopeType.CONVERSATION)
public class Authenticator implements Serializable{
- @In ShelfManager shelfManager;
+ private static final long serialVersionUID = -4585673256547342140L;
- @In("#{messages['invalid_login']}")
- private String INVALID_LOGIN_OR_PASSWORD;
+ @In ShelfManager shelfManager;
@RequestParameter protected Long startConversation;
- private static final long serialVersionUID = -4585673256547342140L;
-
- @In("#{messages['user.exist']}") private String USER_WITH_THIS_LOGIN_ALREADY_EXIST;
-
- @In("#{messages['user.confirm.error']}") private String CONFIRM_PASSWORD_NOT_EQUALS_PASSWORD;
-
@Logger Log log;
@In Identity identity;
@Out(required=false) User user;
+
@In Credentials credentials;
@In FacesMessages facesMessages;
- @In("#{conversation}") @Out
- Conversation conversation;
+ @In @Out Conversation conversation;
@In IUserAction userAction;
@@ -107,7 +100,7 @@
}
}
public String login(){
- if(identity.hasRole("admin")){
+ if(identity.hasRole(Constants.ADMIN_ROLE)){
return null;
}
String password = credentials.getPassword();
@@ -123,24 +116,24 @@
identity.login();
identity.addRole(Constants.GUEST_ROLE);
facesMessages.clear();
- facesMessages.add(INVALID_LOGIN_OR_PASSWORD);
+ facesMessages.add(Constants.INVALID_LOGIN_OR_PASSWORD);
FacesContext.getCurrentInstance().renderResponse();
}
- return "main";
+ return Constants.MAIN_OUTCOME;
}
@End
public String register(User user){
if(checkPassword(user) || checkUserExist(user)){
- return "";
+ return null;
}
user.setPasswordHash(hash(user.getPassword()));
userAction.register(user);
- return "index";
+ return Constants.INDEX_OUTCOME;
}
public String goToIndex(){
- return "index";
+ return Constants.INDEX_OUTCOME;
}
public String goToRegister(){
@@ -148,12 +141,12 @@
identity.unAuthenticate();
credentials.clear();
credentials.invalidate();
- return "register";
+ return Constants.REGISTER_OUTCOME;
}
private boolean checkUserExist(User user) {
if(userAction.isUserExist(user.getLogin())){
- addFacesMessage(Constants.REGISTER_LOGIN_NAME_ID, USER_WITH_THIS_LOGIN_ALREADY_EXIST);
+ addFacesMessage(Constants.REGISTER_LOGIN_NAME_ID, Constants.USER_WITH_THIS_LOGIN_ALREADY_EXIST);
return true;
}
return false;
@@ -168,7 +161,7 @@
private boolean checkPassword(User user) {
if(!user.getPassword().equals(user.getConfirmPassword())){
- addFacesMessage(Constants.REGISTER_CONFIRM_PASSWORD_ID, CONFIRM_PASSWORD_NOT_EQUALS_PASSWORD);
+ addFacesMessage(Constants.REGISTER_CONFIRM_PASSWORD_ID, Constants.CONFIRM_PASSWORD_NOT_EQUALS_PASSWORD);
return true;
}
return false;
@@ -182,7 +175,6 @@
return true;
}
try {
- //TODO nick - move password holder into userAction
user = userAction.login(credentials.getUsername(), hash(credentials.getPassword()));
if (user != null) {
identity.addRole(Constants.ADMIN_ROLE);
@@ -201,28 +193,26 @@
identity.unAuthenticate();
credentials.clear();
Session.instance().invalidate();
- return "logout";
+ return Constants.LOGOUT_OUTCOME;
}
- public String start(){
+ public String startConversation(){
if(!identity.isLoggedIn()){
credentials.clear();
try {
identity.authenticate();
} catch (LoginException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ //No cases for that
}
}
- return "";
+ return null;
}
- public String startConversation(){
- //TODO nick - rename to destroyConversation()?
+ public String destroyConversation(){
identity.logout();
identity.unAuthenticate();
credentials.clear();
- return "";
+ return null;
}
private boolean wantLoginAnonymous() {
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Controller.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Controller.java 2009-04-08 10:01:51 UTC (rev 13425)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Controller.java 2009-04-08 11:43:55 UTC (rev 13426)
@@ -41,10 +41,9 @@
@Scope(ScopeType.EVENT)
public class Controller implements Serializable{
- private static final long serialVersionUID = 5656562187249324512L;
+ private static final String ALBUM_CREATE_ERROR = "You must create at least one shelf before creating album!";
- @In("#{messages['acess_not_granted']}")
- private String HAVENT_ACCESS;
+ private static final long serialVersionUID = 5656562187249324512L;
@In @Out Model model;
@@ -54,8 +53,7 @@
@In AlbumManager albumManager;
- @In
- private User user;
+ @In private User user;
public void selectShelfs(){
model.resetModel(NavigationEnum.ALL_SHELFS, user, null, null, null, null);
@@ -72,7 +70,7 @@
@Restrict("#{s:hasRole('admin')}")
public void startEditShelf(Shelf shelf){
if(!canViewShelf(shelf)){
- pushEvent(Constants.ADD_ERROR_EVENT, HAVENT_ACCESS);
+ pushEvent(Constants.ADD_ERROR_EVENT, Constants.HAVENT_ACCESS);
return;
}
model.resetModel(NavigationEnum.SHELF_EDIT, shelf.getOwner(), shelf, null, null, null);
@@ -84,7 +82,7 @@
public void showAlbum(Album album){
if(!canViewAlbum(album)){
- pushEvent(Constants.ADD_ERROR_EVENT, HAVENT_ACCESS);
+ pushEvent(Constants.ADD_ERROR_EVENT, Constants.HAVENT_ACCESS);
return;
}
model.resetModel(NavigationEnum.ALBUM_PREVIEW, album.getOwner(), album.getShelf(), album, null, album.getImages());
@@ -92,7 +90,7 @@
public void showImage(Image image){
if(!canViewImage(image)){
- pushEvent(Constants.ADD_ERROR_EVENT, HAVENT_ACCESS);
+ pushEvent(Constants.ADD_ERROR_EVENT, Constants.HAVENT_ACCESS);
return;
}
model.resetModel(NavigationEnum.ALBUM_IMAGE_PREVIEW, image.getAlbum().getOwner(), image.getAlbum().getShelf(), image.getAlbum(), image, image.getAlbum().getImages());
@@ -101,7 +99,6 @@
public void scroll(DataScrollerEvent e){
Integer index = e.getPage();
- model.setSelectedImageIndex(index);
Image image = model.getSelectedAlbum().getImages().get(index - 1);
model.resetModel(NavigationEnum.ALBUM_IMAGE_PREVIEW, image.getAlbum().getOwner(), image.getAlbum().getShelf(), image.getAlbum(), image, image.getAlbum().getImages());
image.getAlbum().visitImage(image, true);
@@ -110,7 +107,7 @@
@Restrict("#{s:hasRole('admin')}")
public void startEditImage(Image image){
if(!canViewImage(image)){
- pushEvent(Constants.ADD_ERROR_EVENT, HAVENT_ACCESS);
+ pushEvent(Constants.ADD_ERROR_EVENT, Constants.HAVENT_ACCESS);
return;
}
model.resetModel(NavigationEnum.ALBUM_IMAGE_EDIT, image.getAlbum().getShelf().getOwner(), image.getAlbum().getShelf(), image.getAlbum(), image, image.getAlbum().getImages());
@@ -154,7 +151,7 @@
@Restrict("#{s:hasRole('admin')}")
public void startEditAlbum(Album album){
if(!album.getOwner().getLogin().equals(user.getLogin())){
- pushEvent(Constants.ADD_ERROR_EVENT, HAVENT_ACCESS);
+ pushEvent(Constants.ADD_ERROR_EVENT, Constants.HAVENT_ACCESS);
return;
}
model.resetModel(NavigationEnum.ALBUM_EDIT, album.getShelf().getOwner(), album.getShelf(), album, null, album.getImages());
@@ -166,7 +163,7 @@
public void showFileUpload(){
if(!(user.getShelfs().size() > 0)){
- Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, "You must create at least one shelf before creating album!");
+ Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, ALBUM_CREATE_ERROR);
return;
}
model.resetModel(NavigationEnum.FILE_UPLOAD, model.getSelectedUser(), model.getSelectedShelf(), model.getSelectedAlbum(), model.getSelectedImage(), model.getImages());
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/DnDManager.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/DnDManager.java 2009-04-08 10:01:51 UTC (rev 13425)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/DnDManager.java 2009-04-08 11:43:55 UTC (rev 13426)
@@ -38,7 +38,9 @@
public class DnDManager implements DropListener {
@In User user;
+
@In FileManager fileManager;
+
@In IAlbumAction albumAction;
@Restrict("#{s:hasRole('admin')}")
@@ -48,13 +50,13 @@
Object dropValue = dropzone.getDropValue();
if(dragValue instanceof Image){
if(!((Album)dropValue).getOwner().getLogin().equals(user.getLogin())){
- Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, "You can't add photo's to that album");
+ Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, Constants.DND_PHOTO_ERROR);
return;
}
handleImage((Image)dragValue, (Album)dropValue);
}else if(dragValue instanceof Album){
if(!((Shelf)dropValue).getOwner().getLogin().equals(user.getLogin())){
- Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, "You can't add album to that shelf");
+ Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, Constants.DND_ALBUM_ERROR);
return;
}
handleAlbum((Album)dragValue, (Shelf)dropValue);
@@ -64,7 +66,7 @@
private void handleAlbum(Album dragValue, Shelf dropValue) {
dropValue.addAlbum(dragValue);
albumAction.editAlbum(dragValue);
- Events.instance().raiseEvent("clearTree");
+ Events.instance().raiseEvent(Constants.CLEAR_TREE_EVENT);
}
private void handleImage(Image dragValue, Album dropValue) {
@@ -75,15 +77,14 @@
dragValue.setPath(newPath);
dropValue.addImage(dragValue);
albumAction.editAlbum(dropValue);
- Events.instance().raiseEvent("DNDUploadedEvent", dragValue);
-
+ Events.instance().raiseEvent(Constants.DNDUPLOADED_EVENT, dragValue);
}
private String generateNewPathOfImage(Image dragValue, Album dropValue) {
String fileNameOld = dragValue.getPath();
int lastIndexOf = dragValue.getPath().lastIndexOf(Constants.SLASH);
String prevPathEnd = dragValue.getPath().substring(lastIndexOf);
- String fileNameNew = user.getLogin()+Constants.SLASH+dropValue.getId()+Constants.SLASH+prevPathEnd;
+ String fileNameNew = user.getLogin() + Constants.SLASH + dropValue.getId() + Constants.SLASH + prevPathEnd;
fileManager.renameImage(fileNameOld, fileNameNew);
return fileNameNew;
}
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/FileManager.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/FileManager.java 2009-04-08 10:01:51 UTC (rev 13425)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/FileManager.java 2009-04-08 11:43:55 UTC (rev 13426)
@@ -51,22 +51,14 @@
@AutoCreate
public class FileManager {
- private static final String _SMALL160 = "_small160";
- private static final String _SMALL120 = "_small120";
- private static final String _SMALL80 = "_small80";
- private static final String _SMALL200 = "_small200";
- private static final String _MEDIUM = "_medium";
-
- private static final String UPLOAD_ROOT_COMPONENT_NAME = "uploadRoot";
- private static final String UPLOAD_ROOT_PATH_COMPONENT_NAME = "uploadRootPath";
-
private File uploadRoot;
+
private String uploadRootPath;
@Create
public void create() {
- uploadRoot = (File)Component.getInstance(UPLOAD_ROOT_COMPONENT_NAME, ScopeType.APPLICATION);
- uploadRootPath = (String)Component.getInstance(UPLOAD_ROOT_PATH_COMPONENT_NAME, ScopeType.APPLICATION);
+ 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 {
@@ -111,22 +103,28 @@
@Restrict("#{s:hasRole('admin')}")
public void deleteDirectory(String... directories) {
final File file = getFileByPath(joinFiles(directories).toString());
- if (file.exists()) {
+ deleteDirectory(file);
+ }
+
+ private void deleteDirectory(File file) {
+ if (file.exists()) {
for (String f : file.list()) {
final File temp = new File(file, f);
- temp.delete();
+ if(temp.isDirectory()){
+ deleteDirectory(temp);
+ }else{
+ temp.delete();
+ }
}
file.delete();
}
- }
+ }
-
- private String joinFiles(String... files) {
+ private String joinFiles(String... files) {
final StringBuilder res = new StringBuilder();
for (String file : files) {
res.append(file).append(File.pathSeparatorChar);
}
-
return res.substring(0, res.length() - 1);
}
@@ -160,8 +158,8 @@
@Restrict("#{s:hasRole('admin')}")
public boolean saveAvatar(String path, User user) {
- return writeFile("/" + user.getLogin() +
- "/avatar.jpg", path, "", 80, true);
+ return writeFile(Constants.SLASH + user.getLogin() +
+ Constants.AVATAR_JPG, path, "", Constants.AVATAR_SIZE, true);
}
@Restrict("#{s:hasRole('admin')}")
@@ -169,48 +167,48 @@
createDirectoryIfNotExist(fileNameNew);
renameImage(getFileByPath(fileNameNew), getFileByPath(fileNameOld));
- renameImage(getFileByPath(transformPath(fileNameNew, _MEDIUM)),
- getFileByPath(transformPath(fileNameOld, _MEDIUM)));
+ renameImage(getFileByPath(transformPath(fileNameNew, Constants._MEDIUM)),
+ getFileByPath(transformPath(fileNameOld, Constants._MEDIUM)));
- renameImage(getFileByPath(transformPath(fileNameNew, _SMALL80)),
- getFileByPath(transformPath(fileNameOld, _SMALL80)));
+ renameImage(getFileByPath(transformPath(fileNameNew, Constants._SMALL80)),
+ getFileByPath(transformPath(fileNameOld, Constants._SMALL80)));
- renameImage(getFileByPath(transformPath(fileNameNew, _SMALL120)),
- getFileByPath(transformPath(fileNameOld, _SMALL120)));
+ renameImage(getFileByPath(transformPath(fileNameNew, Constants._SMALL120)),
+ getFileByPath(transformPath(fileNameOld, Constants._SMALL120)));
- renameImage(getFileByPath(transformPath(fileNameNew, _SMALL160)),
- getFileByPath(transformPath(fileNameOld, _SMALL160)));
+ renameImage(getFileByPath(transformPath(fileNameNew, Constants._SMALL160)),
+ getFileByPath(transformPath(fileNameOld, Constants._SMALL160)));
- renameImage(getFileByPath(transformPath(fileNameNew, _SMALL200)),
- getFileByPath(transformPath(fileNameOld, _SMALL200)));
+ renameImage(getFileByPath(transformPath(fileNameNew, Constants._SMALL200)),
+ getFileByPath(transformPath(fileNameOld, Constants._SMALL200)));
}
@Restrict("#{s:hasRole('admin')}")
public void deleteImage(String fileName) {
deleteImage(getFileByPath(fileName));
- deleteImage(getFileByPath(transformPath(fileName, _MEDIUM)));
- deleteImage(getFileByPath(transformPath(fileName, _SMALL80)));
- deleteImage(getFileByPath(transformPath(fileName, _SMALL120)));
- deleteImage(getFileByPath(transformPath(fileName, _SMALL160)));
- deleteImage(getFileByPath(transformPath(fileName, _SMALL200)));
+ deleteImage(getFileByPath(transformPath(fileName, Constants._MEDIUM)));
+ deleteImage(getFileByPath(transformPath(fileName, Constants._SMALL80)));
+ deleteImage(getFileByPath(transformPath(fileName, Constants._SMALL120)));
+ deleteImage(getFileByPath(transformPath(fileName, Constants._SMALL160)));
+ deleteImage(getFileByPath(transformPath(fileName, Constants._SMALL200)));
}
@Restrict("#{s:hasRole('admin')}")
public boolean addImage(String fileName, String tempFilePath) {
createDirectoryIfNotExist(fileName);
- if(!writeFile(fileName, tempFilePath, _SMALL80, 80, true)){
+ if(!writeFile(fileName, tempFilePath, Constants._SMALL80, Constants.SMALL_80_SIZE, true)){
return false;
}
- if(!writeFile(fileName, tempFilePath, _SMALL120, 120, true)){
+ if(!writeFile(fileName, tempFilePath, Constants._SMALL120, Constants.SMALL_120_SIZE, true)){
return false;
}
- if(!writeFile(fileName, tempFilePath, _SMALL160, 160, true)){
+ if(!writeFile(fileName, tempFilePath, Constants._SMALL160, Constants.SMALL_160_SIZE, true)){
return false;
}
- if(!writeFile(fileName, tempFilePath, _SMALL200, 200, true)){
+ if(!writeFile(fileName, tempFilePath, Constants._SMALL200, Constants.SMALL_200_SIZE, true)){
return false;
}
- if(!writeFile(fileName, tempFilePath, _MEDIUM, 600, true)){
+ if(!writeFile(fileName, tempFilePath, Constants._MEDIUM, Constants.MEDIUM_SIZE, true)){
return false;
}
return true;
@@ -312,7 +310,7 @@
String pattern, int size, boolean includeUploadRoot) {
BufferedImage bsrc = null;
try {
- bsrc = bitmapToImage(fileName, "JPG");
+ bsrc = bitmapToImage(fileName, Constants.JPG);
} catch (IOException e1) {
return false;
}
@@ -329,7 +327,7 @@
+ transformPath(newFileName, pattern) : transformPath(
newFileName, pattern);
try {
- imageToBitmap(bdest, dest, "JPG");
+ imageToBitmap(bdest, dest, Constants.JPG);
} catch (IOException ex) {
return false;
}
@@ -361,7 +359,7 @@
}
private void createDirectoryIfNotExist(String fileNameNew) {
- final int lastIndexOf = fileNameNew.lastIndexOf('/');
+ final int lastIndexOf = fileNameNew.lastIndexOf(Constants.SLASH);
if (lastIndexOf > 0) {
final String directory = fileNameNew.substring(0, lastIndexOf);
final File file = getFileByPath(directory);
@@ -383,7 +381,6 @@
}
public File getFileByAbsolutePath(String path) {
- File result = new File(path);
- return result;
+ return new File(path);
}
}
\ No newline at end of file
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/FileUploadManager.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/FileUploadManager.java 2009-04-08 10:01:51 UTC (rev 13425)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/FileUploadManager.java 2009-04-08 11:43:55 UTC (rev 13426)
@@ -56,20 +56,16 @@
@Scope(ScopeType.EVENT)
public class FileUploadManager implements Serializable {
- @In("#{messages['file_processing_error']}")
- private String FILE_PROCESSING_ERROR;
-
- @In("#{messages['file_saving_error']}")
- private String FILE_SAVE_ERROR;
+ private static final long serialVersionUID = 4969087557225414955L;
@In IImageAction imageAction;
+
@In(required = true, scope=ScopeType.CONVERSATION) @Out(scope=ScopeType.CONVERSATION)
FileWrapper fileWrapper;
@In Model model;
- @In private FileManager fileManager;
- private static final long serialVersionUID = 4969087557225414955L;
+ @In private FileManager fileManager;
@Restrict("#{s:hasRole('admin')}")
public void listener(UploadEvent event) throws Exception {
@@ -78,24 +74,24 @@
try {
extractMetadata(item, image);
} catch (Exception e1) {
- Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, FILE_PROCESSING_ERROR);
+ Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, Constants.FILE_PROCESSING_ERROR);
return;
}
image.setAlbum(model.getSelectedAlbum());
if(model.getSelectedAlbum() == null){
- Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, "Please specify album to download");
+ Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, Constants.NO_ALBUM_TO_DOWNLOAD_ERROR);
return;
}
String newPath = Constants.SLASH + model.getSelectedAlbum().getOwner().getLogin() + Constants.SLASH + model.getSelectedAlbum().getId() + Constants.SLASH +item.getFileName();
image.setPath(newPath);
if(!fileManager.addImage(newPath, item.getFile().getPath())){
- Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, FILE_SAVE_ERROR);
+ Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, Constants.FILE_SAVE_ERROR);
item.getFile().delete();
return;
}
fileWrapper.getFiles().add(image);
imageAction.addImage(image);
- Events.instance().raiseEvent("imageAdded");
+ Events.instance().raiseEvent(Constants.IMAGE_ADDED_EVENT);
item.getFile().delete();
}
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/ImageManager.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/ImageManager.java 2009-04-08 10:01:51 UTC (rev 13425)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/ImageManager.java 2009-04-08 11:43:55 UTC (rev 13426)
@@ -51,17 +51,13 @@
private static String imageDirectLinkPrefix;
- @In
- IImageAction imageAction;
+ @In IImageAction imageAction;
- @In
- FileManager fileManager;
+ @In FileManager fileManager;
- @In @Out
- Model model;
+ @In @Out Model model;
- @In
- private User user;
+ @In User user;
@Restrict("#{s:hasRole('admin')}")
public void deleteImage(Image image) {
@@ -69,23 +65,22 @@
model.resetModel(NavigationEnum.ALBUM_PREVIEW, image.getAlbum().getOwner(), image.getAlbum().getShelf(), image.getAlbum(), null, image.getAlbum().getImages());
imageAction.deleteImage(image);
fileManager.deleteImage(imagePath);
- Events.instance().raiseEvent("imageDeleted");
+ Events.instance().raiseEvent(Constants.IMAGE_DELETED_EVENT);
}
@Restrict("#{s:hasRole('admin')}")
public void editImage(Image image) {
imageAction.editImage(image);
Events.instance().raiseEvent(Constants.UPDATE_MAIN_AREA_EVENT, NavigationEnum.ALBUM_IMAGE_PREVIEW);
- Events.instance().raiseEvent("imageEdited");
}
@Restrict("#{s:hasRole('admin')}")
public void addComment(Image image, String message) {
if (null == user.getLogin()) {
- Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, "For vote on this picture you must login");
+ Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, Constants.ADDING_COMMENT_ERROR);
return;
}if(message.trim().equals("")){
- Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, "Comment must be not-null");
+ Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, Constants.NULL_COMMENT_ERROR);
return;
}
Comment comment = new Comment();
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Model.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Model.java 2009-04-08 10:01:51 UTC (rev 13425)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Model.java 2009-04-08 11:43:55 UTC (rev 13426)
@@ -22,7 +22,6 @@
public class Model implements Serializable{
private static final long serialVersionUID = -1767281809514660171L;
- private Integer selectedImageIndex = 0;
private Image selectedImage;
@@ -45,15 +44,12 @@
this.setSelectedShelf(selectedShelf);
this.setSelectedUser(selectedUser);
this.images = images;
- if(this.getSelectedAlbum() != null && this.getSelectedImage() != null){
- this.setSelectedImageIndex(this.getSelectedAlbum().getIndex(this.getSelectedImage())+1);
- }
}
@Observer(Constants.UPDATE_MAIN_AREA_EVENT)
public void setMainArea(NavigationEnum mainArea) {
if(this.mainArea != null && this.mainArea.equals(NavigationEnum.FILE_UPLOAD)){
- Events.instance().raiseEvent("clearFileUpload");
+ Events.instance().raiseEvent(Constants.CLEAR_FILE_UPLOAD_EVENT);
}
this.mainArea = mainArea;
if(this.mainArea != null && this.mainArea.equals(NavigationEnum.FILE_UPLOAD)){
@@ -63,18 +59,10 @@
}
}
}
-
- public Integer getSelectedImageIndex() {
- return selectedImageIndex;
- }
public NavigationEnum getMainArea() {
return mainArea;
}
-
- public void setSelectedImageIndex(Integer selectedImageIndex) {
- this.selectedImageIndex = selectedImageIndex;
- }
public Image getSelectedImage() {
return selectedImage;
@@ -112,7 +100,7 @@
return selectedTag;
}
- @Observer("updateSelectedTag")
+ @Observer(Constants.UPDATE_SELECTED_TAG_EVENT)
public void setSelectedTag(MetaTag selectedTag) {
this.selectedTag = selectedTag;
}
@@ -124,4 +112,4 @@
public void setImages(List<Image> images) {
this.images = images;
}
-}
+}
\ No newline at end of file
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/ShelfManager.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/ShelfManager.java 2009-04-08 10:01:51 UTC (rev 13425)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/ShelfManager.java 2009-04-08 11:43:55 UTC (rev 13426)
@@ -46,26 +46,24 @@
@AutoCreate
public class ShelfManager implements Serializable {
- private static final long serialVersionUID = 2631634926126857691L;
+ private static final long serialVersionUID = 2631634926126857691L;
+
private boolean validationSuccess = false;
+
private List<Shelf> shelfs;
- @In
- FileManager fileManager;
+ @In FileManager fileManager;
- @In
- IShelfAction shelfAction;
+ @In IShelfAction shelfAction;
- @In @Out
- Model model;
+ @In @Out Model model;
- @In
- User user;
+ @In User user;
@Restrict("#{s:hasRole('admin')}")
public void createShelf() {
Shelf shelf = new Shelf();
- Contexts.getConversationContext().set("shelf", shelf);
+ Contexts.getConversationContext().set(Constants.SHELF_VARIABLE, shelf);
}
@Restrict("#{s:hasRole('admin')}")
@@ -74,7 +72,7 @@
shelf.setPreDefined(false);
shelfAction.addShelf(shelf);
model.resetModel(NavigationEnum.SHELF_PREVIEW, shelf.getOwner(), shelf, null, null, null);
- Events.instance().raiseEvent("clearTree");
+ Events.instance().raiseEvent(Constants.CLEAR_TREE_EVENT);
}
public List<Shelf> getAvailableShelfs(User user) {
@@ -98,8 +96,8 @@
shelfAction.deleteShelf(shelf);
deleteDirectories(directoriesToDelete);
model.resetModel(NavigationEnum.ALL_SHELFS, model.getSelectedUser(), null, null, null, null);
- Events.instance().raiseEvent("shelfDeleted");
- Events.instance().raiseEvent("clearTree");
+ Events.instance().raiseEvent(Constants.SHELF_DELETED_EVENT);
+ Events.instance().raiseEvent(Constants.CLEAR_TREE_EVENT);
}
private void deleteDirectories(List<String> directoriesToDelete) {
@@ -113,7 +111,7 @@
return shelfs;
}
- @Observer("clearTree")
+ @Observer(Constants.CLEAR_TREE_EVENT)
public void clearShelfs() {
shelfs = null;
}
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/SlideshowManager.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/SlideshowManager.java 2009-04-08 10:01:51 UTC (rev 13425)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/SlideshowManager.java 2009-04-08 11:43:55 UTC (rev 13426)
@@ -37,8 +37,11 @@
public class SlideshowManager implements Serializable{
private static final long serialVersionUID = 7801877176558409702L;
+
private Integer slideshowIndex;
+
private Image selectedImage;
+
private boolean active;
@In @Out Model model;
@@ -66,7 +69,7 @@
this.slideshowIndex = 0;
if(model.getImages() == null || model.getImages().size() < 1){
stopSlideshow();
- Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, "No images for slideshow!");
+ Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, Constants.NO_IMAGES_FOR_SLIDESHOW_ERROR);
return;
}
this.selectedImage = model.getImages().get(this.slideshowIndex);
@@ -77,7 +80,7 @@
active = true;
if(model.getImages() == null || model.getImages().size() < 1){
stopSlideshow();
- Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, "No images for slideshow!");
+ Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, Constants.NO_IMAGES_FOR_SLIDESHOW_ERROR);
return;
}
this.slideshowIndex = model.getImages().indexOf(selectedImage);
@@ -85,7 +88,7 @@
this.selectedImage.getAlbum().visitImage(selectedImage, true);
}
- @Observer("stopSlideshow")
+ @Observer(Constants.STOP_SLIDESHOW_EVENT)
public void stopSlideshow(){
active = false;
this.selectedImage = null;
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/TreeManager.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/TreeManager.java 2009-04-08 10:01:51 UTC (rev 13425)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/TreeManager.java 2009-04-08 11:43:55 UTC (rev 13426)
@@ -14,6 +14,7 @@
public class TreeManager implements Serializable{
@In @Out Model model;
+
private static final long serialVersionUID = 5656562187249324512L;
@SuppressWarnings("unchecked")
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/UserManager.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/UserManager.java 2009-04-08 10:01:51 UTC (rev 13425)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/UserManager.java 2009-04-08 11:43:55 UTC (rev 13426)
@@ -42,13 +42,16 @@
@Scope(ScopeType.EVENT)
@AutoCreate
public class UserManager implements Serializable{
-
+
private static final long serialVersionUID = 6027103521084558931L;
- @In(scope=ScopeType.SESSION) @Out(scope=ScopeType.SESSION) private User user;
+ @In(scope=ScopeType.SESSION) @Out(scope=ScopeType.SESSION) User user;
+
@In FileManager fileManager;
- @In(required=false, scope=ScopeType.CONVERSATION) @Out(required=false, scope=ScopeType.CONVERSATION) private File avatarData;
- @In private IUserAction userAction;
+
+ @In(required=false, scope=ScopeType.CONVERSATION) @Out(required=false, scope=ScopeType.CONVERSATION) File avatarData;
+
+ @In IUserAction userAction;
public Long countImages() {
if(null == user.getCountImages() ){
@@ -83,7 +86,7 @@
public void editUser(){
if (avatarData != null) {
if(!fileManager.saveAvatar(avatarData.getPath(), user)){
- Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, "File IO Error");
+ Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, Constants.FILE_IO_ERROR);
return;
}
avatarData.delete();
@@ -97,29 +100,28 @@
avatarData = null;
}
- @Observer(value = "imageAdded")
+ @Observer(Constants.IMAGE_ADDED_EVENT)
public void onImageAdded() {
user.updateStatistics();
}
- @Observer(value = "imageDeleted")
+ @Observer(Constants.IMAGE_DELETED_EVENT)
public void onImageDeleted(){
user.updateStatistics();
}
- @Observer(value = "albumDeleted")
+ @Observer(Constants.ALBUM_DELETED_EVENT)
public void onAlbumDeleted(){
user.updateStatistics();
}
- @Observer(value = "albumAdded")
+ @Observer(Constants.ALBUM_ADDED_EVENT)
public void onAlbumAdded(){
user.updateStatistics();
}
- @Observer(value = "shelfDeleted")
+ @Observer(Constants.SHELF_DELETED_EVENT)
public void onShelfDeleted(){
user.updateStatistics();
}
-
}
\ No newline at end of file
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/ISearchOption.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/ISearchOption.java 2009-04-08 10:01:51 UTC (rev 13425)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/ISearchOption.java 2009-04-08 11:43:55 UTC (rev 13426)
@@ -13,6 +13,8 @@
*/
public abstract class ISearchOption {
+ private static final String TEMPLATE = "/includes/search/result/albumsResult.xhtml";
+
private boolean selected = true;
private List<?> searchResult;
@@ -37,7 +39,7 @@
}
public String getSearchResultTemplate() {
- return "/includes/search/result/albumsResult.xhtml";
+ return TEMPLATE;
}
public List<?> getSearchResult() {
@@ -47,5 +49,4 @@
public void setSearchResult(List<?> searchResult) {
this.searchResult = searchResult;
}
-
}
\ No newline at end of file
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/ImageSearchHelper.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/ImageSearchHelper.java 2009-04-08 10:01:51 UTC (rev 13425)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/ImageSearchHelper.java 2009-04-08 11:43:55 UTC (rev 13426)
@@ -29,6 +29,7 @@
ISearchOption selectedOption;
List<ISearchOption> options;
+
String selectedTab;
String searchQuery;
@@ -54,7 +55,7 @@
StringBuilder s = new StringBuilder();
for(ISearchOption option:options) {
if(option.getSelected()){
- s.append(option.getName() + ",");
+ s.append(option.getName() + Constants.COMMA);
}
}
if (s.length() >= 2) {
@@ -89,7 +90,7 @@
}
private List<String> parse(String searchQuery2) {
- return Arrays.asList(searchQuery2.split(","));
+ return Arrays.asList(searchQuery2.split(Constants.COMMA));
}
boolean isOptionSelected() {
@@ -163,5 +164,4 @@
public void setSelectedKeyword(String selectedKeyword) {
this.selectedKeyword = selectedKeyword;
}
-
-}
+}
\ No newline at end of file
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/SearchOptionByAlbum.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/SearchOptionByAlbum.java 2009-04-08 10:01:51 UTC (rev 13425)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/SearchOptionByAlbum.java 2009-04-08 11:43:55 UTC (rev 13426)
@@ -11,16 +11,19 @@
public class SearchOptionByAlbum extends ISearchOption {
+ private static final String TEMPLATE = "/includes/search/result/albumsResult.xhtml";
+ private static final String ALBUMS_SEARCH_RESULT = "Albums search result";
+ private static final String ALBUMS = "Albums";
Map<String, Object> params = new HashMap<String, Object>();
@Override
public String getName() {
- return "Albums";
+ return ALBUMS;
}
@Override
public String getSearchResultName() {
- return "Albums search result";
+ return ALBUMS_SEARCH_RESULT;
}
@Override
@@ -35,7 +38,7 @@
@Override
public String getSearchResultTemplate() {
- return "/includes/search/result/albumsResult.xhtml";
+ return TEMPLATE;
}
public Map<String, Object> getParams() {
@@ -45,5 +48,4 @@
public void setParams(Map<String, Object> params) {
this.params = params;
}
-
-}
+}
\ No newline at end of file
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/SearchOptionByImage.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/SearchOptionByImage.java 2009-04-08 10:01:51 UTC (rev 13425)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/SearchOptionByImage.java 2009-04-08 11:43:55 UTC (rev 13426)
@@ -17,18 +17,21 @@
*/
public class SearchOptionByImage extends ISearchOption {
+ private static final String TEMPLATE = "/includes/search/result/imageResult.xhtml";
+ private static final String IMAGES_SEARCH_RESULT = "Images search result";
+ private static final String IMAGES = "Images";
Map<String, Object> params = new HashMap<String, Object>();
/* (non-Javadoc)
* @see org.richfaces.realworld.search.ISearchOption#getName()
*/
public String getName() {
- return "Images";
+ return IMAGES;
}
@Override
public String getSearchResultName() {
- return "Images search result";
+ return IMAGES_SEARCH_RESULT;
}
@Override
@@ -43,7 +46,7 @@
@Override
public String getSearchResultTemplate() {
- return "/includes/search/result/imageResult.xhtml";
+ return TEMPLATE;
}
public Map<String, Object> getParams() {
@@ -53,5 +56,4 @@
public void setParams(Map<String, Object> params) {
this.params = params;
}
-
}
\ No newline at end of file
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/SearchOptionByShelf.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/SearchOptionByShelf.java 2009-04-08 10:01:51 UTC (rev 13425)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/SearchOptionByShelf.java 2009-04-08 11:43:55 UTC (rev 13426)
@@ -15,12 +15,16 @@
*/
public class SearchOptionByShelf extends ISearchOption {
+ private static final String TEMPLATE = "/includes/search/result/shelfResult.xhtml";
+ private static final String SHELF_SEARCH_RESULT = "Shelf search result";
+ private static final String SHELVES = "Shelves";
+
/* (non-Javadoc)
* @see org.richfaces.realworld.search.ISearchOption#getName()
*/
@Override
public String getName() {
- return "Shelves";
+ return SHELVES;
}
/* (non-Javadoc)
@@ -28,7 +32,7 @@
*/
@Override
public String getSearchResultName() {
- return "Shelf search result";
+ return SHELF_SEARCH_RESULT;
}
/* (non-Javadoc)
@@ -36,7 +40,7 @@
*/
@Override
public String getSearchResultTemplate() {
- return "/includes/search/result/shelfResult.xhtml";
+ return TEMPLATE;
}
/* (non-Javadoc)
@@ -51,7 +55,5 @@
}else{
setSearchResult(new ArrayList<Shelf>());
}
-
}
-
-}
+}
\ No newline at end of file
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/SearchOptionByTag.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/SearchOptionByTag.java 2009-04-08 10:01:51 UTC (rev 13425)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/SearchOptionByTag.java 2009-04-08 11:43:55 UTC (rev 13426)
@@ -15,12 +15,16 @@
*/
public class SearchOptionByTag extends ISearchOption {
+ private static final String TEMPLATE = "/includes/search/result/tagsResult.xhtml";
+ private static final String TAGS_SEARCH_RESULT = "Tags search result";
+ private static final String TAGS = "Tags";
+
/* (non-Javadoc)
* @see org.richfaces.realworld.search.ISearchOption#getName()
*/
@Override
public String getName() {
- return "Tags";
+ return TAGS;
}
/* (non-Javadoc)
@@ -28,7 +32,7 @@
*/
@Override
public String getSearchResultName() {
- return "Tags search result";
+ return TAGS_SEARCH_RESULT;
}
/* (non-Javadoc)
@@ -36,7 +40,7 @@
*/
@Override
public String getSearchResultTemplate() {
- return "/includes/search/result/tagsResult.xhtml";
+ return TEMPLATE;
}
/* (non-Javadoc)
@@ -51,6 +55,5 @@
}else{
setSearchResult(new ArrayList<MetaTag>());
}
-
}
-}
+}
\ No newline at end of file
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/SearchOptionByUser.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/SearchOptionByUser.java 2009-04-08 10:01:51 UTC (rev 13425)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/SearchOptionByUser.java 2009-04-08 11:43:55 UTC (rev 13426)
@@ -15,12 +15,16 @@
*/
public class SearchOptionByUser extends ISearchOption {
+ private static final String TEMPLATE = "/includes/search/result/userResult.xhtml";
+ private static final String USERS_SEARCH_RESULT = "Users search result";
+ private static final String USERS = "Users";
+
/* (non-Javadoc)
* @see org.richfaces.realworld.search.ISearchOption#getName()
*/
@Override
public String getName() {
- return "Users";
+ return USERS;
}
/* (non-Javadoc)
@@ -28,7 +32,7 @@
*/
@Override
public String getSearchResultName() {
- return "Users search result";
+ return USERS_SEARCH_RESULT;
}
/* (non-Javadoc)
@@ -36,7 +40,7 @@
*/
@Override
public String getSearchResultTemplate() {
- return "/includes/search/result/userResult.xhtml";
+ return TEMPLATE;
}
/* (non-Javadoc)
@@ -50,7 +54,5 @@
}else{
setSearchResult(new ArrayList<User>());
}
-
}
-
-}
+}
\ No newline at end of file
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/ConfirmationPopupHelper.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/ConfirmationPopupHelper.java 2009-04-08 10:01:51 UTC (rev 13425)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/ConfirmationPopupHelper.java 2009-04-08 11:43:55 UTC (rev 13426)
@@ -44,14 +44,11 @@
private String actionName;
- @In @Out
- private Image image;
+ @In @Out private Image image;
- @In @Out
- private Shelf shelf;
+ @In @Out private Shelf shelf;
- @In @Out
- private Album album;
+ @In @Out private Album album;
@In AlbumManager albumManager;
@@ -104,5 +101,4 @@
public void deleteImage(){
imageManager.deleteImage(this.image);
}
-
}
\ No newline at end of file
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/DirectLinkHelper.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/DirectLinkHelper.java 2009-04-08 10:01:51 UTC (rev 13425)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/DirectLinkHelper.java 2009-04-08 11:43:55 UTC (rev 13426)
@@ -20,10 +20,8 @@
@Scope(ScopeType.EVENT)
@AutoCreate
public class DirectLinkHelper {
- private static final String DEFAULT_PICTURE = "default/noimage.jpg";
- @In(value="entityManager")
- protected EntityManager em;
+ @In(value="entityManager") EntityManager em;
@In ImageLoader imageLoader;
@@ -36,7 +34,7 @@
Long id = Long.valueOf(data.toString());
Image im = em.find(Image.class, id);
if(im == null || im.getAlbum() == null || im.getAlbum().getShelf() == null){
- imageLoader.paintImage(out, DEFAULT_PICTURE);
+ imageLoader.paintImage(out, Constants.DEFAULT_PICTURE);
return;
}
if(im.getAlbum().getShelf().isShared() || (identity.hasRole(Constants.ADMIN_ROLE) && im.getAlbum().getOwner().getLogin().equals(credentials.getUsername()))){
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/EditorBean.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/EditorBean.java 2009-04-08 10:01:51 UTC (rev 13425)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/EditorBean.java 2009-04-08 11:43:55 UTC (rev 13426)
@@ -22,6 +22,7 @@
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Observer;
+import org.richfaces.realworld.service.Constants;
@Name("editorBean")
public class EditorBean {
@@ -34,7 +35,7 @@
return message;
}
- @Observer("clearEditor")
+ @Observer(Constants.CLEAR_EDITOR_EVENT)
public void setMessage(String message) {
this.message = message;
}
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/FileWrapper.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/FileWrapper.java 2009-04-08 10:01:51 UTC (rev 13425)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/FileWrapper.java 2009-04-08 11:43:55 UTC (rev 13426)
@@ -30,6 +30,7 @@
import org.jboss.seam.annotations.Observer;
import org.jboss.seam.annotations.Scope;
import org.richfaces.realworld.domain.Image;
+import org.richfaces.realworld.service.Constants;
@Name("fileWrapper")
@Scope(ScopeType.CONVERSATION)
@@ -52,12 +53,12 @@
this.files = files;
}
- @Observer("DNDUploadedEvent")
+ @Observer(Constants.DNDUPLOADED_EVENT)
public void removeImage(Image image){
files.remove(image);
}
- @Observer("clearFileUpload")
+ @Observer(Constants.CLEAR_FILE_UPLOAD_EVENT)
public void clear(){
files.clear();
}
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/ImageLoader.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/ImageLoader.java 2009-04-08 10:01:51 UTC (rev 13425)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/ImageLoader.java 2009-04-08 11:43:55 UTC (rev 13426)
@@ -35,30 +35,30 @@
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.richfaces.realworld.manager.FileManager;
+import org.richfaces.realworld.service.Constants;
@Name("imageLoader")
@Scope(ScopeType.EVENT)
@AutoCreate
public class ImageLoader implements Serializable {
- private static final long serialVersionUID = -1572789608594870285L;
+ private static final long serialVersionUID = -1572789608594870285L;
- @In
- FileManager fileManager;
+ @In FileManager fileManager;
public void paintImage(OutputStream out, Object data) throws IOException {
if (null == data) {
return;
}
File imageResource = null;
- if(data.toString().endsWith("upload")){
+ if(data.toString().endsWith(Constants.UPLOAD)){
imageResource = fileManager.getFileByAbsolutePath(data.toString());
}else{
imageResource = fileManager.getFileByPath(data.toString());
}
if (imageResource != null && imageResource.exists()) {
- byte [] toWrite = new byte[8192];
+ byte [] toWrite = new byte[Constants.DEFAULT_BUFFER_SIZE];
ImageInputStream inputStream = ImageIO.createImageInputStream(imageResource);
ImageOutputStream outputStream = ImageIO.createImageOutputStream(out);
@@ -75,4 +75,4 @@
}
}
-}
+}
\ No newline at end of file
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/UserPrefsHelper.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/UserPrefsHelper.java 2009-04-08 10:01:51 UTC (rev 13425)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/UserPrefsHelper.java 2009-04-08 11:43:55 UTC (rev 13426)
@@ -16,6 +16,7 @@
import org.richfaces.event.UploadEvent;
import org.richfaces.model.UploadItem;
import org.richfaces.realworld.domain.Sex;
+import org.richfaces.realworld.service.Constants;
import org.richfaces.realworld.service.IUserAction;
/**
@@ -26,6 +27,7 @@
@Scope(ScopeType.CONVERSATION)
public class UserPrefsHelper implements Serializable{
private static final long serialVersionUID = -1767281809514660171L;
+
@In IUserAction userAction;
Boolean avatarModalOpened = false;
@@ -33,8 +35,8 @@
@In(required=false, scope=ScopeType.CONVERSATION) @Out(required=false, scope=ScopeType.CONVERSATION) private File avatarData;
static final SelectItem[] sexs = new SelectItem[] {
- new SelectItem(Sex.MALE, "Male"),
- new SelectItem(Sex.FEMALE, "Female") };
+ new SelectItem(Sex.MALE, Constants.MALE),
+ new SelectItem(Sex.FEMALE, Constants.FEMALE) };
public SelectItem [] getSexs() {
return sexs;
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/CopyImageStuff.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/CopyImageStuff.java 2009-04-08 10:01:51 UTC (rev 13425)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/CopyImageStuff.java 2009-04-08 11:43:55 UTC (rev 13426)
@@ -15,6 +15,7 @@
import org.jboss.seam.annotations.Out;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.Startup;
+import org.richfaces.realworld.service.Constants;
/**
@@ -27,13 +28,6 @@
@Startup
public class CopyImageStuff {
- static final String WEB_INF = "WEB-INF";
-
- static final String IMAGE_FOLDER = "/Upload";
-
- //TODO nick - change constant value to include "richfaces"
- static final String REALWORLD_FOLDER = "realworld";
-
@Out(scope = ScopeType.APPLICATION)
File uploadRoot;
@@ -68,26 +62,26 @@
}
if (classLoadPath != null) {
- int index = classLoadPath.indexOf(WEB_INF);
+ int index = classLoadPath.indexOf(Constants.WEB_INF);
if (index != -1) {
- realPath = classLoadPath.substring(0, index + WEB_INF.length()) + IMAGE_FOLDER;
+ realPath = classLoadPath.substring(0, index + Constants.WEB_INF.length()) + Constants.IMAGE_FOLDER;
}
}
if (realPath != null) {
this.imageSrc = realPath;
}else {
- throw new NullPointerException("Cannot bound image folder path");
+ throw new NullPointerException(Constants.UPLOAD_FOLDER_PATH_ERROR);
}
}
void resolveUploadRoot()throws IOException {
- String property = System.getProperty("java.io.tmpdir");
+ String property = System.getProperty(Constants.TEMP_DIR);
if(!property.endsWith(File.separator)){
property+=File.separator;
}
- String uploadRootPath = property + REALWORLD_FOLDER + File.separator;
+ String uploadRootPath = property + Constants.REALWORLD_FOLDER + File.separator;
if (uploadRootPath != null) {
uploadRoot = new File(uploadRootPath);
if (uploadRoot.exists()) {
@@ -96,12 +90,11 @@
uploadRoot.mkdir();
this.uploadRootPath = uploadRoot.getCanonicalPath();
}else {
- throw new NullPointerException("Upload root was not created");
+ throw new NullPointerException(Constants.UPLOAD_ROOT_CREATION_ERROR);
}
}
void copyImages()throws IOException {
FileUtils.copyDirectory(new File(imageSrc), uploadRoot);
}
-
}
\ No newline at end of file
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/FileUtils.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/FileUtils.java 2009-04-08 10:01:51 UTC (rev 13425)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/FileUtils.java 2009-04-08 11:43:55 UTC (rev 13426)
@@ -5,12 +5,14 @@
public class FileUtils {
- private static final int BUFFER_SIZE = 4 * 1024;
+ private static final String JPEG = "jpeg";
+ private static final String JPG = "jpg";
+ private static final int BUFFER_SIZE = 4 * 1024;
private static final boolean CLOCK = true;
private static final boolean VERIFY = true;
public static void copyFile(File srcFile, File destFile) throws IOException {
- if (!srcFile.getPath().toLowerCase().endsWith("jpg") && !srcFile.getPath().toLowerCase().endsWith("jpeg")) {
+ if (!srcFile.getPath().toLowerCase().endsWith(JPG) && !srcFile.getPath().toLowerCase().endsWith(JPEG)) {
return;
}
final InputStream in = new FileInputStream(srcFile);
@@ -41,7 +43,6 @@
out.close();
in.close();
}
-
}
public static void copyDirectory(File srcDir, File dstDir)
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/SessionListener.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/SessionListener.java 2009-04-08 10:01:51 UTC (rev 13425)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/SessionListener.java 2009-04-08 11:43:55 UTC (rev 13426)
@@ -19,8 +19,9 @@
public class SessionListener {
@In(required=false) User user;
- @In(value="entityManager")
- EntityManager em;
+
+ @In(value="entityManager") EntityManager em;
+
@In FileManager fileManager;
@Destroy @Transactional @Observer("org.jboss.seam.sessionExpired")
Modified: trunk/test-applications/realworld2/web/src/main/resources/messages_en.properties
===================================================================
--- trunk/test-applications/realworld2/web/src/main/resources/messages_en.properties 2009-04-08 10:01:51 UTC (rev 13425)
+++ trunk/test-applications/realworld2/web/src/main/resources/messages_en.properties 2009-04-08 11:43:55 UTC (rev 13426)
@@ -90,21 +90,8 @@
error=Error
errorStub=Something bad happened :-(
-fileUpload.header=You will upload files in album: #{model.selectedAlbum.name}. If you want upload in another album, select it.
-fileUpload.header2=Choose album:
-fileUpload.uploadedPanelHeader=Uploaded Files Info
-fileUpload.fileNameLabel=File Name:
-fileUpload.fileLengthLabel=File Length(bytes):
-fileUpload.fileEditLabel=Edit
-fileUpload.storeAllLabel=Store All
-fileUpload.storeSelectedLabel=Store Selected
-fileUpload.clearLabel=Clear Uploaded Data
-fileUpload.clearSelectedLabel=Clear Selected
-
comment.label=View comments(#{model.selectedImage.comments.size})
comment.author=Author: #{comment.author.login}
-comment.askForFriend=Ask for friendship
-comment.askForFriend.message=Please, add me to your friends
comment.date=Date: #{comment.date}
comment.delete=Delete comment
comment.edit=Edit Comment
@@ -114,32 +101,10 @@
comment.cancel=Cancel
comment.comments=Comments
-message.sendMessage=Send message
-message.sendToUser=Send message for this user
-message.readed=Mark as read
-message.authorHeader=Author
-message.themeHeader=Theme
-message.dateHeader=Date
-message.theme=Theme\:
-message.author=Author\:
-message.date=Date: #{record.date}
-message.delete=Delete
-message.read=Read
-message.re=Re:
-message.message=Message
-message.owner=Owner\:
-message.content=Content\:
-message.addFriend=Add to friends
-message.friendRequest=It is request for friendship message. You may add this user to your friends by clicking on the 'Add to Friends button'
-message.send=Send
-message.close=Close
-
confirm.confirm=Confirmation:
confirm.ok=OK
confirm.cancel=Cancel
-shared.delete=Delete From shared
-
album.edit=Edit
album.delete=Delete
album.delete.confirm=Are you sure? All images associated with this album will also dropped! Click OK to proceed, else click Cancel.
@@ -153,13 +118,6 @@
album.store=Store
album.cancel=Cancel
-scroller.first=First
-scroller.last=Last
-scroller.prev=Prev
-scroller.next=Next
-scroller.pager=Image #{model.selectedImageIndex} of #{model.selectedAlbum.images.size}
-
-image.panelHeader=Image Preview: Selected Album: #{model.selectedAlbum.name}
image.delete=Delete
image.delete.confirm=Are you sure? Click OK to proceed, else click Cancel.
image.edit=Edit Properties
@@ -168,14 +126,12 @@
image.desc=Short Description:
image.album=Album
image.date=Created Date:
-image.meta=Image Meta-information:
image.store=Store
image.cancel=Cancel
image.save=Save
slideshow.start=Start Slideshow
slideshow.stop=Stop slideshow
-slideshow.interval=Interval in sec
index.header=Welcome!
@@ -184,20 +140,8 @@
login.userName=Username
login.password=Password
login.register=Register
-login.anonymous=Anonymous
-friends.delete=Delete from friends
-friends.choose=Choose album for preview:
-
-search.advanced=Advanced search:
-search.rank=Rank:
-search.numberVotes=Number of votes:
-search.date=Date created
-search.addShared=Add to favorite Albums
-search.preview=Preview
search.search=Search
-search.popular=Popular Images
-search.unpopular=UnPopular Images
search.nofound=No images found
user.loginPrefs=Login Preferences
@@ -228,33 +172,9 @@
menu.welcome=Welcome,
menu.welcome.guest=Welcome, guest! If you want access to full version of application, please register or login.
-menu.message.tooltip=You have #{messageManager.countUnreadedMessages} not-readed messages
-menu.messages=Read Messages
-menu.search=Search
-menu.image=Image Preview
-menu.user=User Prefs
-menu.file=File Upload
menu.logout=Logout
menu.login=Login
-realworld=RealWorld Demo application
-panel.albumHeader=Album Management
-panel.my=My albums
-panel.friend=Friend Albums
-panel.shared=Favorites
-
-samplename=Sample Name
-sampledesc=Sample Description
-addedtofriends=You are were added to friends
-addedtofriendsby=You are were added to friends by User
-removedfromfriends=You are were removed from friends
-removedfromfriendsby=You are were removed from friends of
-equals=Equals
-more=More
-less=Less
-nomatter=No Matter
-small=Small
-medium=Medium
full=Full size
file_processing_error=Error processing occured during upload
@@ -262,71 +182,35 @@
invalid_login=Invalid login or password
login_success=You are successfully registered.
wrong_dnd=That album isn't yours, so you can't change it's location
-friend_error=This user won't be your friend!
acess_not_granted=You have no rights to view this album
-invalid_syntax=Invalid syntax
album_addImage=Add image
-album_addToFavorites=Add to favorite albums
album_present=Album with this name already present!
-album_deleteFromFavorite=Delete from favorite
album_show=Show album
-album_reqForFriend=Send owner request for friendship
-album_deleteFromFriends=Delete owner from friends
album_viewProfile=View profile of owner
-album_sendMessage=Send message for owner
album_show_all=Show all albums of owner
-album_show_history=Show message history with owner
-image_showLinks=Show Links
-image_addFavorites=Add to favorite images
-image_deleteFavorites=Remove from favorite images
image_show_parent=Show parent album
image_show=Show image
-image_addParentToFavorite=Add parent to favorite albums
-image_removeParentFavorite=Remove parent from favorite albums
image_showParent=Show parent album
user_profile=View profile
-user_history=Show message history
user_show_albums=Show albums
-fileUpload_choosemode=Choose mode for upload:
-
camera=Camera
uploaded=Uploaded at
-size=Size
-dimensions=Dimensions
-sizeInKB=Size in KB
-width=Width
-height=Height
-choose_camera=Choose camera:
-choose_metatag=Choose metatag for search:
-case_sensitive=Case-sensitive search
-my_albums=My albums
-my_friends=My friends
-content=Content
-closeHistory=Close history
-history=History
-
errorGeneral=OOOps..... Error happened
errorDetail=Error: #{error.message}
albums=Albums:
images=Images:
-friends_albums=Friend albums
album=Album:
owner=Owner
metatags=Metatags:
-rating=Rating:
-friends=Friends
-friendsInfo=Friends info
viewProfile=View profile
show_albums=Show albums
-show_history=Show message history
author=Author
-linkManagement=Link management
close=Close
myAlbumShelfs=My album shelfs
newPhotos=New photos
Modified: trunk/test-applications/realworld2/web/src/main/resources/messages_ru.properties
===================================================================
--- trunk/test-applications/realworld2/web/src/main/resources/messages_ru.properties 2009-04-08 10:01:51 UTC (rev 13425)
+++ trunk/test-applications/realworld2/web/src/main/resources/messages_ru.properties 2009-04-08 11:43:55 UTC (rev 13426)
@@ -31,21 +31,8 @@
error=\u041E\u0448\u0438\u0431\u043A\u0430
errorStub=\u0421\u043B\u0443\u0447\u0438\u043B\u043E\u0441\u044C \u0447\u0442\u043E-\u0442\u043E \u043D\u0435\u043F\u0440\u0435\u0434\u0432\u0438\u0434\u0435\u043D\u043D\u043E\u0435 \:-(
-fileUpload.header=\u0412\u0430\u0448\u0438 \u0444\u0430\u0439\u043B\u044B \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043D\u044B \u0432 \u0430\u043B\u044C\u0431\u043E\u043C\: \#{model.selectedAlbum.name}. \u0415\u0441\u043B\u0438 \u0432\u044B \u0445\u043E\u0442\u0438\u0442\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C \u0438\u0445 \u0432 \u0434\u0440\u0443\u0433\u043E\u0439 \u0430\u043B\u044C\u0431\u043E\u043C, \u0432\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0435\u0433\u043E.
-fileUpload.header2=\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0430\u043B\u044C\u0431\u043E\u043C\:
-fileUpload.uploadedPanelHeader=\u0418\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F \u043E \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043D\u043D\u044B\u0445 \u0444\u0430\u0439\u043B\u0430\u0445
-fileUpload.fileNameLabel=\u0418\u043C\u044F \u0444\u0430\u0439\u043B\u0430\:
-fileUpload.fileLengthLabel=\u0420\u0430\u0437\u043C\u0435\u0440 \u0444\u0430\u0439\u043B\u0430 \u0432 \u0431\u0430\u0439\u0442\u0430\u0445\:
-fileUpload.fileEditLabel=\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C
-fileUpload.storeAllLabel=\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C \u0432\u0441\u0435
-fileUpload.storeSelectedLabel=\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C \u0432\u044B\u0434\u0435\u043B\u0435\u043D\u043D\u044B\u0435
-fileUpload.clearLabel=\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C \u0432\u0441\u0435
-fileUpload.clearSelectedLabel=\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C \u0432\u044B\u0434\u0435\u043B\u0435\u043D\u043D\u044B\u0435
-
comment.label=\u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0438 (\#{model.selectedImage.comments.size})
comment.author=\u0410\u0432\u0442\u043E\u0440\: \#{comment.author.login}
-comment.askForFriend=\u0417\u0430\u043F\u0440\u043E\u0441 \u043D\u0430 \u0434\u0440\u0443\u0436\u0431\u0443
-comment.askForFriend.message=\u041F\u043E\u0436\u0430\u043B\u0443\u0439\u0441\u0442\u0430, \u0434\u043E\u0431\u0430\u0432\u044C\u0442\u0435 \u043C\u0435\u043D\u044F \u0432 \u0441\u043F\u0438\u0441\u043E\u043A \u0432\u0430\u0448\u0438\u0445 \u0434\u0440\u0443\u0437\u0435\u0439.
comment.date=\u0414\u0430\u0442\u0430\: \#{comment.date}
comment.delete=\u0423\u0434\u0430\u043B\u0438\u0442\u044C
comment.edit=\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439
@@ -54,32 +41,10 @@
comment.save=\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C
comment.cancel=\u041E\u0442\u043C\u0435\u043D\u0430
-message.sendMessage=\u041F\u043E\u0441\u043B\u0430\u0442\u044C \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435
-message.sendToUser=\u041F\u043E\u0441\u043B\u0430\u0442\u044C \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435 \u044D\u0442\u043E\u043C\u0443 \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044E
-message.readed=\u041E\u0442\u043C\u0435\u0442\u0438\u0442\u044C \u043A\u0430\u043A \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u043D\u043D\u043E\u0435
-message.authorHeader=\u0410\u0432\u0442\u043E\u0440
-message.themeHeader=\u0422\u0435\u043C\u0430
-message.dateHeader=\u0414\u0430\u0442\u0430
-message.theme=\u0422\u0435\u043C\u0430\:
-message.author=\u0410\u0432\u0442\u043E\u0440\:
-message.date=\u0414\u0430\u0442\u0430\: \#{record.date}
-message.delete=\u0423\u0434\u0430\u043B\u0438\u0442\u044C
-message.read=\u041F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u044C
-message.re=Re:
-message.message=\u0421\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435
-message.owner=\u041F\u043E\u043B\u0443\u0447\u0430\u0442\u0435\u043B\u044C\:
-message.content=\u0421\u043E\u0434\u0435\u0440\u0436\u0430\u043D\u0438\u0435\:
-message.addFriend=\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0432 \u0434\u0440\u0443\u0437\u044C\u044F
-message.friendRequest=\u042D\u0442\u043E \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435 \u044F\u0432\u043B\u044F\u0435\u0442\u0441\u044F \u0437\u0430\u043F\u0440\u043E\u0441\u043E\u043C \u043D\u0430 \u0434\u0440\u0443\u0436\u0431\u0443. Y\u0412\u044B \u043C\u043E\u0436\u0435\u0442\u0435 \u0434\u043E\u0431\u0430\u0432\u0442\u044C \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u0432 \u0434\u0440\u0443\u0437\u044C\u044F, \u043D\u0430\u0436\u0430\u0432 \u043D\u0430 \u043A\u043D\u043E\u043F\u043A\u0443 '\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0432 \u0434\u0440\u0443\u0437\u044C\u044F'.
-message.send=\u041F\u043E\u0441\u043B\u0430\u0442\u044C
-message.close=\u0417\u0430\u043A\u0440\u044B\u0442\u044C
-
confirm.confirm=\u041F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D\u0438\u0435\:
confirm.ok=OK
confirm.cancel=\u041E\u0442\u043C\u0435\u043D\u0430
-shared.delete=\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0438\u0437 shared \u0430\u043B\u044C\u0431\u043E\u043C\u043E\u0432
-
album.edit=\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C
album.delete=\u0423\u0434\u0430\u043B\u0438\u0442\u044C
album.delete.confirm=\u0412\u044B \u0443\u0432\u0435\u0440\u0435\u043D\u044B? \u0412\u0441\u0435 \u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0438 \u0432 \u044D\u0442\u043E\u043C \u0430\u043B\u044C\u0431\u043E\u043C\u0435 \u0442\u0430\u043A\u0436\u0435 \u0431\u0443\u0434\u0443\u0442 \u0443\u0434\u0430\u043B\u0435\u043D\u044B\! \u041D\u0430\u0436\u043C\u0438\u0442\u0435 \u041E\u041A \u0434\u043B\u044F \u043F\u0440\u043E\u0434\u043E\u043B\u0436\u0435\u043D\u0438\u044F \u0438\u043B\u0438 \u041E\u0442\u043C\u0435\u043D\u0430 \u0434\u043B\u044F \u043F\u0440\u0435\u0440\u044B\u0432\u0430\u043D\u0438\u044F \u043E\u043F\u0435\u0440\u0430\u0446\u0438\u0438.
@@ -92,14 +57,6 @@
album.desc=\u041A\u043E\u0440\u043E\u0442\u043A\u043E\u0435 \u043E\u043F\u0438\u0441\u0430\u043D\u0438\u0435\:
album.store=\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C
album.cancel=\u041E\u0442\u043C\u0435\u043D\u0430
-
-scroller.first=\u041F\u0435\u0440\u0432\u0430\u044F
-scroller.last=\u041F\u043E\u0441\u043B\u0435\u0434\u043D\u044F\u044F
-scroller.prev=\u041F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0430\u044F
-scroller.next=\u0421\u043B\u0435\u0434\u0443\u044E\u0449\u0430\u044F
-scroller.pager=\u0418\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \#{model.selectedImageIndex} \u0438\u0437 \#{model.selectedAlbum.images.size}
-
-image.panelHeader=\u041F\u0440\u043E\u0441\u043C\u043E\u0442\u0440 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0439\: \u0412\u044B\u0431\u0440\u0430\u043D\u043D\u044B\u0439 \u0430\u043B\u044C\u0431\u043E\u043C\: \#{model.selectedAlbum.name}
image.delete=\u0423\u0434\u0430\u043B\u0438\u0442\u044C
image.delete.confirm=\u0412\u044B \u0443\u0432\u0435\u0440\u0435\u043D\u044B?
image.edit=\u0420\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0441\u0432\u043E\u0439\u0441\u0442\u0432\u0430
@@ -108,14 +65,12 @@
image.desc=\u041A\u043E\u0440\u043E\u0442\u043A\u043E\u0435 \u043E\u043F\u0438\u0441\u0430\u043D\u0438\u0435\:
image.album=\u0410\u043B\u044C\u0431\u043E\u043C
image.date=\u0414\u0430\u0442\u0430 \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F\:
-image.meta=\u041C\u0435\u0442\u0430-\u0438\u043D\u043E\u0444\u0440\u043C\u0430\u0446\u0438\u044F\:
image.store=\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C
image.cancel=\u041E\u0442\u043C\u0435\u043D\u0430
image.save=\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C
slideshow.start=\u041D\u0430\u0447\u0430\u0442\u044C \u0441\u043B\u0430\u0439\u0434-\u0448\u043E\u0443
slideshow.stop=\u041E\u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u044C \u0441\u043B\u0430\u0439\u0434-\u0448\u043E\u0443
-slideshow.interval=\u0418\u043D\u0442\u0435\u0440\u0432\u0430\u043B \u0432 \u0441\u0435\u043A.
index.header=\u0414\u043E\u0431\u0440\u043E \u043F\u043E\u0436\u0430\u043B\u043E\u0432\u0430\u0442\u044C\!
@@ -124,22 +79,7 @@
login.userName=\u0418\u043C\u044F \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F
login.password=\u041F\u0430\u0440\u043E\u043B\u044C
login.register=\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044F
-login.anonymous=\u0410\u043D\u043E\u043D\u0438\u043C\u043D\u044B\u0439 \u0432\u0445\u043E\u0434
-friends.delete=\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0438\u0437 \u0441\u043F\u0438\u0441\u043A\u0430 \u0434\u0440\u0443\u0437\u0435\u0439
-friends.choose=\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0430\u043B\u044C\u0431\u043E\u043C \u0434\u043B\u044F \u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0430\:
-
-search.advanced=\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043D\u043D\u044B\u0439 \u043F\u043E\u0438\u0441\u043A\:
-search.rank=\u0422\u0435\u043A\u0443\u0449\u0430\u044F \u043E\u0446\u0435\u043D\u043A\u0430\:
-search.numberVotes=\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u043F\u0440\u043E\u0433\u043E\u043B\u043E\u0441\u043E\u0432\u0430\u0432\u0448\u0438\u0445\:
-search.date=\u0414\u0430\u0442\u0430 \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F
-search.addShared=\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043A 'shared' \u0430\u043B\u044C\u0431\u043E\u043C\u0430\u043C
-search.preview=\u041F\u0440\u043E\u0441\u043C\u043E\u0442\u0440
-search.search=\u041F\u043E\u0438\u0441\u043A
-search.popular=\u041F\u043E\u043F\u0443\u043B\u044F\u0440\u043D\u044B\u0435 \u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0438
-search.unpopular=\u041E\u0442\u0441\u0442\u043E\u0439
-search.nofound=\u041D\u0438 \u043E\u0434\u043D\u043E \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F \u043D\u0435 \u043F\u043E\u0434\u0445\u043E\u0434\u0438\u0442 \u043F\u043E\u0434 \u0432\u0430\u0448\u0438 \u043A\u0440\u0438\u0442\u0435\u0440\u0438\u0438
-
user.loginPrefs=\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u0430\u043A\u043A\u0430\u0443\u043D\u0442\u0430
user.registration=\u0420\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044F
user.reginfo=\u0418\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F, \u043A\u0430\u0441\u0430\u044E\u0449\u0430\u044F\u0441\u044F \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438\:
@@ -154,9 +94,6 @@
user.save=\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C
user.reset=\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C \u043D\u0430 \u043F\u0440\u0435\u0436\u043D\u0438\u0435
user.confirm=\u041F\u043E\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435 \u043F\u0430\u0440\u043E\u043B\u044C
-user.avatar.info=\u0418\u043D\u043E\u0444\u0440\u043C\u0430\u0446\u0438\u044F \u043E \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043D\u043D\u044B\u0445 \u0444\u0430\u0439\u043B\u0430\u0445
-user.avatar.name=\u0418\u043C\u044F \u0444\u0430\u0439\u043B\u0430\:
-user.avatar.length=\u0414\u043B\u0438\u043D\u0430 \u0444\u0430\u0439\u043B\u0430 \u0432 \u0431\u0430\u0439\u0442\u0430\u0445\:
user.register=\u0417\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043E\u0432\u0430\u0442\u044C\u0441\u044F
user.cancel=\u041E\u0442\u043C\u0435\u043D\u0430
user.exist=\u041F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C \u0441 \u0442\u0430\u043A\u0438\u043C \u043B\u043E\u0433\u0438\u043D\u043E\u043C \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442;
@@ -168,106 +105,38 @@
menu.welcome=\u0414\u043E\u0431\u0440\u043E \u043F\u043E\u0436\u0430\u043B\u043E\u0432\u0430\u0442\u044C,
menu.welcome.guest=\u0414\u043E\u0431\u0440\u043E \u043F\u043E\u0436\u0430\u043B\u043E\u0432\u0430\u0442\u044C, \u0433\u043E\u0441\u0442\u044C\! \u0415\u0441\u043B\u0438 \u0432\u044B \u0445\u043E\u0442\u0438\u0442\u0435 \u0438\u043C\u0435\u0442\u044C \u0434\u043E\u0441\u0442\u0443\u043F \u043A\u043E \u0432\u0441\u0435\u043C \u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E\u0441\u0442\u044F\u043C \u0441\u0438\u0441\u0442\u0435\u043C\u044B, \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0439\u0442\u0435\u0441\u044C
-menu.message.tooltip=\u0423 \u0432\u0430\u0441 \#{messageManager.countUnreadedMessages} \u043D\u0435\u043F\u0440\u043E\u0447\u0438\u0442\u0430\u043D\u043D\u044B\u0445 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0439
-menu.messages=\u0421\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F
-menu.search=\u041F\u043E\u0438\u0441\u043A
-menu.image=\u041F\u0440\u043E\u0441\u043C\u043E\u0442\u0440 \u043A\u0430\u0440\u0442\u0438\u043D\u043E\u043A
-menu.user=\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F
-menu.file=\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430 \u043A\u0430\u0440\u0442\u0438\u043D\u043E\u043A
menu.logout=\u0412\u044B\u0445\u043E\u0434
menu.login=\u0412\u0445\u043E\u0434
-realworld=RealWorld Demo application
-panel.albumHeader=\u0423\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0430\u043B\u044C\u0431\u043E\u043C\u0430\u043C\u0438
-panel.my=\u041C\u043E\u0438 \u0430\u043B\u044C\u0431\u043E\u043C\u044B
-panel.friend=\u0410\u043B\u044C\u0431\u043E\u043C\u044B \u0434\u0440\u0443\u0437\u0435\u0439
-panel.shared=\u041B\u044E\u0431\u0438\u043C\u044B\u0435 \u0430\u043B\u044C\u0431\u043E\u043C\u044B
-
-samplename=\u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435
-sampledesc=\u041E\u043F\u0438\u0441\u0430\u043D\u0438\u0435
-addedtofriends=\u0412\u044B \u0431\u044B\u043B\u0438 \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u044B \u0432 \u0441\u043F\u0438\u0441\u043E\u043A \u0434\u0440\u0443\u0437\u0435\u0439
-addedtofriendsby=\u0412\u044B \u0431\u044B\u043B\u0438 \u0434\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u044B \u0432 \u0441\u043F\u0438\u0441\u043E\u043A \u0434\u0440\u0443\u0437\u0435\u0439 \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u0435\u043C
-removedfromfriends=\u0412\u044B \u0431\u044B\u043B\u0438 \u0443\u0434\u0430\u043B\u0435\u043D\u044B \u0438\u0437 \u0441\u043F\u0438\u0441\u043A\u0430 \u0434\u0440\u0443\u0437\u0435\u0439
-removedfromfriendsby=\u0412\u044B \u0431\u044B\u043B\u0438 \u0443\u0434\u0430\u043B\u0435\u043D\u044B \u0438\u0437 \u0441\u043F\u0438\u0441\u043A\u0430 \u0434\u0440\u0443\u0437\u0435\u0439 \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F
-equals=\u0420\u0430\u0432\u043D\u043E
-more=\u041C\u0435\u043D\u044C\u0448\u0435
-less=\u0411\u043E\u043B\u044C\u0448\u0435
-nomatter=\u041D\u0435 \u0438\u043C\u0435\u0435\u0442 \u0437\u0430\u043D\u0447\u0435\u043D\u0438\u044F
-small=\u041C\u0430\u043B\u0435\u043D\u044C\u043A\u0430\u044F
-medium=\u0421\u0440\u0435\u0434\u043D\u044F\u044F
-full=\u041F\u043E\u043B\u043D\u044B\u0439 \u0440\u0430\u0437\u043C\u0435\u0440
-
file_processing_error=\u041F\u0440\u043E\u0438\u0437\u043E\u0448\u043B\u0430 \u043E\u0448\u0438\u0431\u043A\u0430 \u043F\u0440\u0438 \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0435 \u0444\u0430\u0439\u043B\u0430
file_saving_error=\u041F\u0440\u043E\u0438\u0437\u043E\u0448\u043B\u0430 \u043F\u043E\u043F\u044B\u0442\u043A\u0430 \u043F\u0440\u0438 \u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u0438\u0438 \u0444\u0430\u0439\u043B\u0430 \u043D\u0430 \u0434\u0438\u0441\u043A
invalid_login=\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u044B\u0439 \u043B\u043E\u0433\u0438\u043D \u0438\u043B\u0438 \u043F\u0430\u0440\u043E\u043B\u044C
login_success=\u0412\u044B \u0443\u0441\u043F\u0435\u0448\u043D\u043E \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043E\u0432\u0430\u043D\u044B
wrong_dnd=\u0412\u044B \u043D\u0435 \u043C\u043E\u0436\u0435\u0442\u0435 \u043F\u0435\u0440\u0435\u043C\u0435\u0441\u0442\u0438\u0442\u044C \u044D\u0442\u043E\u0442 \u0430\u043B\u044C\u0431\u043E\u043C, \u0442\u0430\u043A \u043A\u0430\u043A \u043E\u043D \u043D\u0435 \u0432\u0430\u0448
-friend_error=\u041F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C \u043D\u0435 \u0445\u043E\u0447\u0435\u0442 \u0431\u044B\u0442\u044C \u0432\u0430\u0448\u0438\u043C \u0434\u0440\u0443\u0433\u043E\u043C\!
acess_not_granted=\u0412\u044B \u043D\u0435 \u0438\u043C\u0435\u0435\u0442\u0435 \u043F\u0440\u0430\u0432 \u0434\u043B\u044F \u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440\u0430 \u044D\u0442\u043E\u0433\u043E \u0430\u043B\u044C\u0431\u043E\u043C\u0430
-invalid_syntax=\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u044B\u0439 \u0441\u0438\u043D\u0442\u0430\u043A\u0441\u0438\u0441
album_addImage=\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0443
-album_addToFavorites=\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0432 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u0430\u043B\u044C\u0431\u043E\u043C\u044B
album_present=\u0410\u043B\u044C\u0431\u043E\u043C \u0441 \u0442\u0430\u043A\u0438\u043C \u0438\u043C\u0435\u043D\u0435\u043C \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442\!
-album_deleteFromFavorite=\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0438\u0437 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u043E\u0433\u043E
album_show=\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0430\u043B\u044C\u0431\u043E\u043C
-album_reqForFriend=\u041F\u043E\u0441\u043B\u0430\u0442\u044C \u0432\u043B\u0430\u0434\u0435\u043B\u044C\u0446\u0443 \u0437\u0430\u043F\u0440\u043E\u0441 \u043D\u0430 \u0434\u0440\u0443\u0436\u0431\u0443
-album_deleteFromFriends=\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0432\u043B\u0430\u0434\u0435\u043B\u044C\u0446\u0430 \u0438\u0437 \u0441\u043F\u0438\u0441\u043A\u0430 \u0434\u0440\u0443\u0437\u0435\u0439
album_viewProfile=\u041F\u043E\u0441\u043C\u043E\u0442\u0440\u0435\u0442\u044C \u043F\u0440\u043E\u0444\u0438\u043B\u044C \u0432\u043B\u0430\u0434\u0435\u043B\u044C\u0446\u0430
-album_sendMessage=\u041F\u043E\u0441\u043B\u0430\u0442\u044C \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435 \u0432\u043B\u0430\u0434\u0435\u043B\u044C\u0446\u0443 \u0430\u043B\u044C\u0431\u043E\u043C\u0430
album_show_all=\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0432\u0441\u0435 \u0430\u043B\u044C\u0431\u043E\u043C\u044B \u0432\u043B\u0430\u0434\u0435\u043B\u044C\u0446\u0430
-album_show_history=\u041F\u043E\u0441\u043C\u043E\u0442\u0440\u0435\u0442\u044C \u0438\u0441\u0442\u043E\u0440\u0438\u044E \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0439 \u0441 \u0432\u043B\u0430\u0434\u0435\u043B\u044C\u0446\u0435\u043C \u0430\u043B\u044C\u0431\u043E\u043C\u0430
-
-
-image_showLinks=\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0441\u0441\u044B\u043B\u043A\u0438
-image_addFavorites=\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u043A \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u044B\u043C \u0444\u043E\u0442\u043E\u0433\u0440\u0430\u0444\u0438\u044F\u043C
-image_deleteFavorites=\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0438\u0437 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u044B\u0445 \u043A\u0430\u0440\u0442\u0438\u043D\u043E\u043A
image_show_parent=\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0430\u043B\u044C\u0431\u043E\u043C, \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435
image_show=\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435
-image_addParentToFavorite=\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0432 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u0430\u043B\u044C\u0431\u043E\u043C\u044B
-image_removeParentFavorite=\u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0438\u0437 \u0438\u0437\u0431\u0440\u0430\u043D\u043D\u044B\u0445 \u0430\u043B\u044C\u0431\u043E\u043C\u043E\u0432
image_showParent=\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0430\u043B\u044C\u0431\u043E\u043C, \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435
user_profile=\u041F\u043E\u0441\u043C\u043E\u0442\u0440\u0435\u0442\u044C \u043F\u0440\u043E\u0444\u0438\u043B\u044C
-user_history=\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0438\u0441\u0442\u043E\u0440\u0438\u044E \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0439
user_show_albums=\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0430\u043B\u044C\u0431\u043E\u043C\u044B
-fileUpload_choosemode=\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0440\u0435\u0436\u0438\u043C \u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0438\:
-
camera=\u041C\u043E\u0434\u0435\u043B\u044C \u043A\u0430\u043C\u0435\u0440\u044B
-uploaded=\u0414\u0430\u0442\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043A\u0438
-size=\u0420\u0430\u0437\u043C\u0435\u0440
-dimensions=\u0420\u0430\u0437\u0440\u0435\u0448\u0435\u043D\u0438\u0435
-sizeInKB=\u0420\u0430\u0437\u043C\u0435\u0440 \u0432 KB
-width=\u0428\u0438\u0440\u0438\u043D\u0430
-height=\u0412\u044B\u0441\u043E\u0442\u0430
-choose_camera=\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043C\u043E\u0434\u0435\u043B\u044C \u043A\u0430\u043C\u0435\u0440\u044B\:
-choose_metatag=\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u043C\u0435\u0442\u0430\u0442\u044D\u0433\u0438 \u0434\u043B\u044F \u043F\u043E\u0438\u0441\u043A\u0430\:
-case_sensitive=\u0423\u0447\u0438\u0442\u044B\u0432\u0430\u0442\u044C \u0440\u0435\u0433\u0438\u0441\u0442\u0440
-tooltip_top=\u0411\u0443\u0434\u0443\u0442 \u043F\u043E\u043A\u0430\u0437\u0430\u043D\u044B \u043E\u0442\u043A\u0440\u044B\u0442\u044B\u0435 \u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0438 \u0441 \u043C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u044B\u043C \u0440\u0435\u0439\u0442\u0438\u043D\u0433\u043E\u043C
-tooltip_worst=\u0411\u0443\u0434\u0443\u0442 \u043F\u043E\u043A\u0430\u0437\u0430\u043D\u044B \u043E\u0442\u043A\u0440\u044B\u0442\u044B\u0435 \u043A\u0430\u0440\u0442\u0438\u043D\u043A\u0438 \u0441 \u043C\u0438\u043D\u0438\u043C\u0430\u043B\u044C\u043D\u044B\u043C \u0440\u0435\u0439\u0442\u0438\u043D\u0433\u043E\u043C
-my_albums=\u041C\u043E\u0438 \u0430\u043B\u044C\u0431\u043E\u043C\u044B
-my_friends=\u041C\u043E\u0438 \u0434\u0440\u0443\u0437\u044C\u044F
-content=\u0421\u043E\u0434\u0435\u0440\u0436\u0430\u043D\u0438\u0435
-closeHistory=\u0417\u0430\u043A\u0440\u044B\u0442\u044C \u0438\u0441\u0442\u043E\u0440\u0438\u044E \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0439
-history=\u0418\u0441\u0442\u043E\u0440\u0438\u044F \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0439
-
errorGeneral=\u0443\u043F\u0441....\u041F\u0440\u043E\u0438\u0437\u043E\u0448\u043B\u0430 \u043E\u0448\u0438\u0431\u043A\u0430
errorDetail=\u041E\u0448\u0438\u0431\u043A\u0430\: \#{error.message}
-
-albums=\u0418\u0437\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u0430\u043B\u044C\u0431\u043E\u043C\u044B\:
-images=\u0418\u0437\u0431\u0440\u0430\u043D\u043D\u044B\u0435 \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F\:
-friends_albums=\u0410\u043B\u044C\u0431\u043E\u043C\u044B \u0434\u0440\u0443\u0437\u0435\u0439
album=\u0410\u043B\u044C\u0431\u043E\u043C\:
owner=\u0412\u043B\u0430\u0434\u0435\u043B\u0435\u0446
metatags=\u041C\u0435\u0442\u0430\u0442\u044D\u0433\u0438\:
friends=\u0414\u0440\u0443\u0437\u044C\u044F
-friendsInfo=\u0418\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F \u043E \u0434\u0440\u0443\u0437\u044C\u044F\u0445
viewProfile=\u041F\u043E\u0441\u043C\u043E\u0442\u0440\u0435\u0442\u044C \u043F\u0440\u043E\u0444\u0438\u043B\u044C
show_albums=\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0430\u043B\u044C\u0431\u043E\u043C\u044B
-show_history=\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0438\u0441\u0442\u043E\u0440\u0438\u044E \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0439
author=\u0410\u0432\u0442\u043E\u0440
-linkManagement=\u0423\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u0441\u0441\u044B\u043B\u043A\u0430\u043C\u0438
close=\u0417\u0430\u043A\u0440\u044B\u0442\u044C
myAlbumShelfs=\u041C\u043E\u0438 \u043A\u043E\u043B\u043B\u0435\u043A\u0446\u0438\u0438 \u0430\u043B\u044C\u0431\u043E\u043C\u043E\u0432
newPhotos=\u041D\u043E\u0432\u044B\u0435 \u0444\u043E\u0442\u043E\u0433\u0440\u0430\u0444\u0438\u0438
Modified: trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/pages.xml
===================================================================
--- trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/pages.xml 2009-04-08 10:01:51 UTC (rev 13425)
+++ trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/pages.xml 2009-04-08 11:43:55 UTC (rev 13426)
@@ -19,15 +19,15 @@
<page view-id="/index.xhtml">
<begin-conversation if="#{!identity.isLoggedIn()}"/>
- <action if="#{authenticator.startConversation!=null}" execute="#{authenticator.startConversation()}"/>
- <action if="#{!identity.isLoggedIn()}" execute="#{authenticator.start}"/>
+ <action if="#{authenticator.startConversation!=null}" execute="#{authenticator.destroyConversation()}"/>
+ <action if="#{!identity.isLoggedIn()}" execute="#{authenticator.startConversation()}"/>
<navigation from-action="#{authenticator.logout}">
<rule if-outcome="logout">
<end-conversation />
<redirect view-id="/index.html"/>
</rule>
</navigation>
- <navigation from-action="#{authenticator.start}">
+ <navigation from-action="#{authenticator.startConversation}">
<redirect view-id="/index.xhtml"/>
</navigation>
</page>
Modified: trunk/test-applications/realworld2/web/src/main/webapp/error.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/album/createAlbum.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/contextMenu/CMForAlbum.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/contextMenu/CMForImage.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/contextMenu/CMForShelf.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/contextMenu/CMForUser.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/fileUpload/uploadResult.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/index/login.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/index/menu.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/misc/confirmation.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/misc/help.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/misc/modalPanels.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/misc/slideShowPooler.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/shelf/createShelf.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/index.xhtml
===================================================================
(Binary files differ)
15 years, 2 months
JBoss Rich Faces SVN: r13425 - in trunk/test-applications/realworld2/web/src/main/webapp/includes: album and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2009-04-08 06:01:51 -0400 (Wed, 08 Apr 2009)
New Revision: 13425
Added:
trunk/test-applications/realworld2/web/src/main/webapp/includes/image/imageScroller.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/image/inputNumberSlider.xhtml
Removed:
trunk/test-applications/realworld2/web/src/main/webapp/includes/misc/imageScroller.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/misc/inputNumberSlider.xhtml
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/includes/album/albumInfo.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/albumUnvisited.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/image/imageInfo.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/image/imageList.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/images.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/misc/modalPanels.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/search/result/imageResult.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/shelfUnvisited.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/tag.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/userSharedImages.xhtml
Log:
Refactoring
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/album/albumInfo.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/albumUnvisited.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/image/imageInfo.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/image/imageList.xhtml
===================================================================
(Binary files differ)
Copied: trunk/test-applications/realworld2/web/src/main/webapp/includes/image/imageScroller.xhtml (from rev 13419, trunk/test-applications/realworld2/web/src/main/webapp/includes/misc/imageScroller.xhtml)
===================================================================
--- trunk/test-applications/realworld2/web/src/main/webapp/includes/image/imageScroller.xhtml (rev 0)
+++ trunk/test-applications/realworld2/web/src/main/webapp/includes/image/imageScroller.xhtml 2009-04-08 10:01:51 UTC (rev 13425)
@@ -0,0 +1,63 @@
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+
+ <h:panelGroup layout="block" id="imagesTable"
+ style="margin: 30px 0px 40px 30px; float: left; position: relative; left: -2px;">
+ <a4j:repeat value="#{model.selectedAlbum.images}" rows="5" var="img"
+ id="repeat" rowKeyVar="rk">
+
+ <a4j:outputPanel layout="block"
+ styleClass="preview_box_photo_nav #{model.selectedImage == img ? 'preview_box_photo_current' : 'preview_box_photo_default'}">
+ <h:panelGroup layout="block" styleClass="preview_box_photo_80">
+ <h:graphicImage styleClass="pr_photo_bg"
+ value="/img/shell/frame_photo_80.png" />
+ <h:panelGrid cellpadding="0">
+ <h:panelGroup>
+ <a4j:mediaOutput element="img"
+ createContent="#{imageLoader.paintImage}"
+ value="#{fileManager.transformPath(img.path, '_small80')}">
+ <f:param value="#{imageSizeHelper.currentDimension.x}" name="x" />
+ </a4j:mediaOutput>
+ <br />
+ </h:panelGroup>
+ </h:panelGrid>
+ <h:panelGroup layout="block" styleClass="photo_name">#{img.name}</h:panelGroup>
+ <h:panelGroup layout="block" styleClass="photo_data">#{rk + 1}</h:panelGroup>
+ </h:panelGroup>
+
+ <a4j:support event="onclick"
+ rendered="#{model.selectedImage != img}"
+ reRender="mainImage, imagesTable"
+ action="#{controller.showImage(img)}" />
+ </a4j:outputPanel>
+ </a4j:repeat>
+
+ <rich:datascroller styleClass="image-scroller" lastPageMode="full"
+ for="repeat" reRender="imagesTable" boundaryControls="hide"
+ stepControls="hide">
+ <f:facet name="pages">
+ <h:outputText />
+ </f:facet>
+ <f:facet name="fastforward">
+ <h:graphicImage styleClass="image-scroller-right-arrow"
+ value="img/shell/arr_right.png" />
+ </f:facet>
+ <f:facet name="fastforward_disabled">
+ <h:graphicImage styleClass="image-scroller-right-arrow"
+ value="img/shell/arr_right_dis.png" />
+ </f:facet>
+ <f:facet name="fastrewind">
+ <h:graphicImage styleClass="image-scroller-left-arrow"
+ value="img/shell/arr_left.png" />
+ </f:facet>
+ <f:facet name="fastrewind_disabled">
+ <h:graphicImage styleClass="image-scroller-left-arrow"
+ value="img/shell/arr_left_dis.png" />
+ </f:facet>
+ </rich:datascroller>
+ </h:panelGroup>
+</ui:composition>
\ No newline at end of file
Copied: trunk/test-applications/realworld2/web/src/main/webapp/includes/image/inputNumberSlider.xhtml (from rev 13423, trunk/test-applications/realworld2/web/src/main/webapp/includes/misc/inputNumberSlider.xhtml)
===================================================================
--- trunk/test-applications/realworld2/web/src/main/webapp/includes/image/inputNumberSlider.xhtml (rev 0)
+++ trunk/test-applications/realworld2/web/src/main/webapp/includes/image/inputNumberSlider.xhtml 2009-04-08 10:01:51 UTC (rev 13425)
@@ -0,0 +1,14 @@
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich"
+ xmlns:richx="http://richfaces.org/richx">
+ <div><rich:inputNumberSlider enableManualInput="false"
+ value="#{imageSizeHelper.value}" minValue="80" maxValue="200"
+ showArrows="false" showBoundaryValues="true" showInput="false"
+ step="40">
+ <a4j:support event="onchange" reRender="userAlbumImages" />
+ </rich:inputNumberSlider></div>
+</ui:composition>
\ No newline at end of file
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/images.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld2/web/src/main/webapp/includes/misc/imageScroller.xhtml
===================================================================
--- trunk/test-applications/realworld2/web/src/main/webapp/includes/misc/imageScroller.xhtml 2009-04-08 09:55:22 UTC (rev 13424)
+++ trunk/test-applications/realworld2/web/src/main/webapp/includes/misc/imageScroller.xhtml 2009-04-08 10:01:51 UTC (rev 13425)
@@ -1,63 +0,0 @@
-<ui:composition xmlns="http://www.w3.org/1999/xhtml"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:a4j="http://richfaces.org/a4j"
- xmlns:rich="http://richfaces.org/rich">
-
- <h:panelGroup layout="block" id="imagesTable"
- style="margin: 30px 0px 40px 30px; float: left; position: relative; left: -2px;">
- <a4j:repeat value="#{model.selectedAlbum.images}" rows="5" var="img"
- id="repeat" rowKeyVar="rk">
-
- <a4j:outputPanel layout="block"
- styleClass="preview_box_photo_nav #{model.selectedImage == img ? 'preview_box_photo_current' : 'preview_box_photo_default'}">
- <h:panelGroup layout="block" styleClass="preview_box_photo_80">
- <h:graphicImage styleClass="pr_photo_bg"
- value="/img/shell/frame_photo_80.png" />
- <h:panelGrid cellpadding="0">
- <h:panelGroup>
- <a4j:mediaOutput element="img"
- createContent="#{imageLoader.paintImage}"
- value="#{fileManager.transformPath(img.path, '_small80')}">
- <f:param value="#{imageSizeHelper.currentDimension.x}" name="x" />
- </a4j:mediaOutput>
- <br />
- </h:panelGroup>
- </h:panelGrid>
- <h:panelGroup layout="block" styleClass="photo_name">#{img.name}</h:panelGroup>
- <h:panelGroup layout="block" styleClass="photo_data">#{rk + 1}</h:panelGroup>
- </h:panelGroup>
-
- <a4j:support event="onclick"
- rendered="#{model.selectedImage != img}"
- reRender="mainImage, imagesTable"
- action="#{controller.showImage(img)}" />
- </a4j:outputPanel>
- </a4j:repeat>
-
- <rich:datascroller styleClass="image-scroller" lastPageMode="full"
- for="repeat" reRender="imagesTable" boundaryControls="hide"
- stepControls="hide">
- <f:facet name="pages">
- <h:outputText />
- </f:facet>
- <f:facet name="fastforward">
- <h:graphicImage styleClass="image-scroller-right-arrow"
- value="img/shell/arr_right.png" />
- </f:facet>
- <f:facet name="fastforward_disabled">
- <h:graphicImage styleClass="image-scroller-right-arrow"
- value="img/shell/arr_right_dis.png" />
- </f:facet>
- <f:facet name="fastrewind">
- <h:graphicImage styleClass="image-scroller-left-arrow"
- value="img/shell/arr_left.png" />
- </f:facet>
- <f:facet name="fastrewind_disabled">
- <h:graphicImage styleClass="image-scroller-left-arrow"
- value="img/shell/arr_left_dis.png" />
- </f:facet>
- </rich:datascroller>
- </h:panelGroup>
-</ui:composition>
\ No newline at end of file
Deleted: trunk/test-applications/realworld2/web/src/main/webapp/includes/misc/inputNumberSlider.xhtml
===================================================================
--- trunk/test-applications/realworld2/web/src/main/webapp/includes/misc/inputNumberSlider.xhtml 2009-04-08 09:55:22 UTC (rev 13424)
+++ trunk/test-applications/realworld2/web/src/main/webapp/includes/misc/inputNumberSlider.xhtml 2009-04-08 10:01:51 UTC (rev 13425)
@@ -1,14 +0,0 @@
-<ui:composition xmlns="http://www.w3.org/1999/xhtml"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:a4j="http://richfaces.org/a4j"
- xmlns:rich="http://richfaces.org/rich"
- xmlns:richx="http://richfaces.org/richx">
- <div><rich:inputNumberSlider enableManualInput="false"
- value="#{imageSizeHelper.value}" minValue="80" maxValue="200"
- showArrows="false" showBoundaryValues="true" showInput="false"
- step="40">
- <a4j:support event="onchange" reRender="userAlbumImages" />
- </rich:inputNumberSlider></div>
-</ui:composition>
\ No newline at end of file
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/misc/modalPanels.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/search/result/imageResult.xhtml
===================================================================
--- trunk/test-applications/realworld2/web/src/main/webapp/includes/search/result/imageResult.xhtml 2009-04-08 09:55:22 UTC (rev 13424)
+++ trunk/test-applications/realworld2/web/src/main/webapp/includes/search/result/imageResult.xhtml 2009-04-08 10:01:51 UTC (rev 13425)
@@ -5,8 +5,8 @@
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
<a4j:outputPanel rendered="#{result.size() > 0}" id="imagesList">
- <rich:datascroller for="imageList" reRender="userAlbumImages"></rich:datascroller>
- <ui:include src="/includes/misc/inputNumberSlider.xhtml">
+ <rich:datascroller for="imageList" reRender="userAlbumImages"/>
+ <ui:include src="/includes/image/inputNumberSlider.xhtml">
<ui:param name="reRenderArea" value="imagesList" />
</ui:include>
<br/><br/>
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/shelfUnvisited.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/tag.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/userSharedImages.xhtml
===================================================================
(Binary files differ)
15 years, 2 months
JBoss Rich Faces SVN: r13424 - trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2009-04-08 05:55:22 -0400 (Wed, 08 Apr 2009)
New Revision: 13424
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 09:55:14 UTC (rev 13423)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/Constants.java 2009-04-08 09:55:22 UTC (rev 13424)
@@ -27,7 +27,6 @@
*/
public class Constants {
- public static final String CLEAR_ERROR_EVENT = "clearErrorEvent";
public static final String ADD_ERROR_EVENT = "addErrorEvent";
public static final String SLASH = "/";
15 years, 2 months
JBoss Rich Faces SVN: r13423 - in trunk/test-applications/realworld2/web/src/main: java/org/richfaces/realworld/manager and 10 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2009-04-08 05:55:14 -0400 (Wed, 08 Apr 2009)
New Revision: 13423
Added:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/FileUploadManager.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/DirectLinkHelper.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/ErrorHandlerBean.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/Help.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/ImageLoader.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/CopyImageStuff.java
Removed:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/RegistrationManager.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/startup/
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/tags/RealworldImageScrollerRenderer.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/FileUploadBean.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/PasswordHolder.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/DirectLinkHelper.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/ErrorHandlerBean.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/Help.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/ImageLoader.java
trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/tags/templates/
Modified:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/ConfirmationPopupHelper.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/EditorBean.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/FileWrapper.java
trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/components.xml
trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/faces-config.xml
trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/tags/realWorld-taglib.xml
trunk/test-applications/realworld2/web/src/main/webapp/includes/fileUpload/fileUploader.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/fileUpload/uploadResult.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/index/header.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/index/login.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/misc/errorPanel.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/misc/inputNumberSlider.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/register.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/scripts/realworld.js
Log:
Refactoring
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java 2009-04-08 09:53:10 UTC (rev 13422)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java 2009-04-08 09:55:14 UTC (rev 13423)
@@ -21,11 +21,15 @@
package org.richfaces.realworld.manager;
import java.io.Serializable;
+import java.security.MessageDigest;
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.security.auth.login.LoginException;
import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.End;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Logger;
import org.jboss.seam.annotations.Name;
@@ -37,11 +41,11 @@
import org.jboss.seam.log.Log;
import org.jboss.seam.security.Credentials;
import org.jboss.seam.security.Identity;
+import org.jboss.seam.util.Hex;
import org.jboss.seam.web.Session;
import org.richfaces.realworld.domain.User;
import org.richfaces.realworld.service.Constants;
import org.richfaces.realworld.service.IUserAction;
-import org.richfaces.realworld.ui.PasswordHolder;
@Name("authenticator")
@Scope(ScopeType.CONVERSATION)
@@ -55,8 +59,10 @@
@RequestParameter protected Long startConversation;
private static final long serialVersionUID = -4585673256547342140L;
+
+ @In("#{messages['user.exist']}") private String USER_WITH_THIS_LOGIN_ALREADY_EXIST;
- @In PasswordHolder passwordHolder;
+ @In("#{messages['user.confirm.error']}") private String CONFIRM_PASSWORD_NOT_EQUALS_PASSWORD;
@Logger Log log;
@@ -78,6 +84,28 @@
private boolean loginFailed = false;
+ private String digestAlgorithm;
+
+ private String charset;
+
+ public void setDigestAlgorithm(String algorithm) {
+ this.digestAlgorithm = algorithm;
+ }
+
+ public void setCharset(String charset) {
+ this.charset = charset;
+ }
+
+ public String hash(String plainTextPassword) {
+ try {
+ MessageDigest digest = MessageDigest.getInstance(digestAlgorithm);
+ digest.update(plainTextPassword.getBytes(charset));
+ byte[] rawHash = digest.digest();
+ return new String(Hex.encodeHex(rawHash));
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
public String login(){
if(identity.hasRole("admin")){
return null;
@@ -101,6 +129,51 @@
return "main";
}
+ @End
+ public String register(User user){
+ if(checkPassword(user) || checkUserExist(user)){
+ return "";
+ }
+ user.setPasswordHash(hash(user.getPassword()));
+ userAction.register(user);
+ return "index";
+ }
+
+ public String goToIndex(){
+ return "index";
+ }
+
+ public String goToRegister(){
+ identity.logout();
+ identity.unAuthenticate();
+ credentials.clear();
+ credentials.invalidate();
+ return "register";
+ }
+
+ private boolean checkUserExist(User user) {
+ if(userAction.isUserExist(user.getLogin())){
+ addFacesMessage(Constants.REGISTER_LOGIN_NAME_ID, USER_WITH_THIS_LOGIN_ALREADY_EXIST);
+ return true;
+ }
+ return false;
+ }
+
+ 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));
+ }
+
+ private boolean checkPassword(User user) {
+ if(!user.getPassword().equals(user.getConfirmPassword())){
+ addFacesMessage(Constants.REGISTER_CONFIRM_PASSWORD_ID, CONFIRM_PASSWORD_NOT_EQUALS_PASSWORD);
+ return true;
+ }
+ return false;
+ }
+
public boolean authenticate()
{
if (wantLoginAnonymous()) {
@@ -110,7 +183,7 @@
}
try {
//TODO nick - move password holder into userAction
- user = userAction.login(credentials.getUsername(), passwordHolder.hash(credentials.getPassword()));
+ user = userAction.login(credentials.getUsername(), hash(credentials.getPassword()));
if (user != null) {
identity.addRole(Constants.ADMIN_ROLE);
model.resetModel(NavigationEnum.ALL_SHELFS, user, null, null, null, null);
Added: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/FileUploadManager.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/FileUploadManager.java (rev 0)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/FileUploadManager.java 2009-04-08 09:55:14 UTC (rev 13423)
@@ -0,0 +1,163 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package org.richfaces.realworld.manager;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Serializable;
+import java.util.Date;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.security.Restrict;
+import org.jboss.seam.core.Events;
+import org.richfaces.event.UploadEvent;
+import org.richfaces.model.UploadItem;
+import org.richfaces.realworld.domain.Image;
+import org.richfaces.realworld.service.Constants;
+import org.richfaces.realworld.service.IImageAction;
+import org.richfaces.realworld.ui.FileWrapper;
+
+import com.drew.imaging.jpeg.JpegMetadataReader;
+import com.drew.metadata.Directory;
+import com.drew.metadata.Metadata;
+import com.drew.metadata.MetadataException;
+import com.drew.metadata.exif.ExifDirectory;
+import com.drew.metadata.jpeg.JpegDirectory;
+
+/**
+ * @author $Autor$
+ *
+ */
+@Name("fileUploadManager")
+(a)Scope(ScopeType.EVENT)
+public class FileUploadManager implements Serializable {
+
+ @In("#{messages['file_processing_error']}")
+ private String FILE_PROCESSING_ERROR;
+
+ @In("#{messages['file_saving_error']}")
+ private String FILE_SAVE_ERROR;
+
+ @In IImageAction imageAction;
+ @In(required = true, scope=ScopeType.CONVERSATION) @Out(scope=ScopeType.CONVERSATION)
+ FileWrapper fileWrapper;
+
+ @In Model model;
+ @In private FileManager fileManager;
+
+ private static final long serialVersionUID = 4969087557225414955L;
+
+ @Restrict("#{s:hasRole('admin')}")
+ public void listener(UploadEvent event) throws Exception {
+ UploadItem item = event.getUploadItem();
+ Image image = constructImage(item);
+ try {
+ extractMetadata(item, image);
+ } catch (Exception e1) {
+ Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, FILE_PROCESSING_ERROR);
+ return;
+ }
+ image.setAlbum(model.getSelectedAlbum());
+ if(model.getSelectedAlbum() == null){
+ Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, "Please specify album to download");
+ return;
+ }
+ String newPath = Constants.SLASH + model.getSelectedAlbum().getOwner().getLogin() + Constants.SLASH + model.getSelectedAlbum().getId() + Constants.SLASH +item.getFileName();
+ image.setPath(newPath);
+ if(!fileManager.addImage(newPath, item.getFile().getPath())){
+ Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, FILE_SAVE_ERROR);
+ item.getFile().delete();
+ return;
+ }
+ fileWrapper.getFiles().add(image);
+ imageAction.addImage(image);
+ Events.instance().raiseEvent("imageAdded");
+ item.getFile().delete();
+ }
+
+ private Image constructImage(UploadItem item) {
+ Image image = new Image();
+ image.setUploaded(new Date());
+ image.setDescription(item.getFileName());
+ image.setName(item.getFileName());
+ image.setSize(item.getFileSize());
+ image.setAllowComments(true);
+ return image;
+ }
+
+ private void extractMetadata(UploadItem item, Image image)
+ throws RuntimeException, IOException {
+ 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);
+ }catch(Exception e){
+ throw new RuntimeException();
+ }finally{
+ in.close();
+ }
+ }
+
+ private void setupCreatedDate(Image image, Directory exifDirectory)
+ throws MetadataException {
+ if (exifDirectory.containsTag(ExifDirectory.TAG_DATETIME_ORIGINAL)) {
+ Date time = exifDirectory.getDate(ExifDirectory.TAG_DATETIME_ORIGINAL);
+ image.setCreated(time);
+ }
+ }
+
+ 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);
+ image.setWidth(width);
+ int height = jpgDirectory.getInt(JpegDirectory.TAG_JPEG_IMAGE_HEIGHT);
+ image.setHeight(height);
+ }
+ }
+ }
+
+ private void setupCameraModel(Image image, Directory exifDirectory) {
+ if (exifDirectory.containsTag(ExifDirectory.TAG_MODEL)) {
+ String cameraModel = exifDirectory.getString(ExifDirectory.TAG_MODEL);
+ image.setCameraModel(cameraModel);
+ }else{
+ image.setCameraModel("");
+ }
+ }
+}
\ No newline at end of file
Property changes on: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/FileUploadManager.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Deleted: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/RegistrationManager.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/RegistrationManager.java 2009-04-08 09:53:10 UTC (rev 13422)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/RegistrationManager.java 2009-04-08 09:55:14 UTC (rev 13423)
@@ -1,88 +0,0 @@
-package org.richfaces.realworld.manager;
-
-import java.io.Serializable;
-
-import javax.faces.application.FacesMessage;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.End;
-import org.jboss.seam.annotations.In;
-import org.jboss.seam.annotations.Logger;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.faces.FacesMessages;
-import org.jboss.seam.log.Log;
-import org.jboss.seam.security.Credentials;
-import org.jboss.seam.security.Identity;
-import org.richfaces.realworld.domain.User;
-import org.richfaces.realworld.service.Constants;
-import org.richfaces.realworld.service.IUserAction;
-import org.richfaces.realworld.ui.PasswordHolder;
-
-@Name("registerManager")
-(a)Scope(ScopeType.EVENT)
-public class RegistrationManager implements Serializable{
-
- private static final long serialVersionUID = -1767281809514660171L;
- @In("#{messages['user.exist']}") private String USER_WITH_THIS_LOGIN_ALREADY_EXIST;
-
- @In("#{messages['user.confirm.error']}") private String CONFIRM_PASSWORD_NOT_EQUALS_PASSWORD;
-
- @Logger Log log;
-
- @In Identity identity;
-
- @In Credentials credentials;
-
- @In FacesMessages facesMessages;
-
- @In PasswordHolder passwordHolder;
- @In IUserAction userAction;
-
- @End
- public String register(User user){
- if(checkPassword(user) || checkUserExist(user)){
- return "";
- }
- user.setPasswordHash(passwordHolder.hash(user.getPassword()));
- userAction.register(user);
- return "index";
- }
-
- public String goToIndex(){
- return "index";
- }
-
- public String goToRegister(){
- identity.logout();
- identity.unAuthenticate();
- credentials.clear();
- credentials.invalidate();
- return "register";
- }
-
- private boolean checkUserExist(User user) {
- if(userAction.isUserExist(user.getLogin())){
- addFacesMessage(Constants.REGISTER_LOGIN_NAME_ID, USER_WITH_THIS_LOGIN_ALREADY_EXIST);
- return true;
- }
- return false;
- }
-
- 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));
- }
-
- private boolean checkPassword(User user) {
- if(!user.getPassword().equals(user.getConfirmPassword())){
- addFacesMessage(Constants.REGISTER_CONFIRM_PASSWORD_ID, CONFIRM_PASSWORD_NOT_EQUALS_PASSWORD);
- return true;
- }
- return false;
- }
-}
Deleted: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/tags/RealworldImageScrollerRenderer.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/tags/RealworldImageScrollerRenderer.java 2009-04-08 09:53:10 UTC (rev 13422)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/tags/RealworldImageScrollerRenderer.java 2009-04-08 09:55:14 UTC (rev 13423)
@@ -1,113 +0,0 @@
-/**
- *
- */
-package org.richfaces.realworld.tags;
-
-import java.io.IOException;
-
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.context.ResponseWriter;
-
-import org.richfaces.component.UIDatascroller;
-import org.richfaces.renderkit.html.DatascrollerTemplate;
-
-/**
- * @author Andrey Markavtsov
- *
- */
-//TODO nick - remove this
-public class RealworldImageScrollerRenderer extends DatascrollerTemplate {
-
- @Override
- public void renderPager(FacesContext context, UIComponent component,
- int pageIndex, int count) throws IOException {
- ResponseWriter out = context.getResponseWriter();
- UIDatascroller scroller = (UIDatascroller) component;
- int currentPage = pageIndex;
-
- int maxPages = scroller.getMaxPages();
- if (maxPages <= 1) {
- maxPages = 1;
- }
-
- int pageCount = count;
- if (pageCount <= 1) {
- return;
- }
-
- int delta = maxPages / 2;
-
- int pages;
- int start;
- if (pageCount > maxPages && currentPage > delta) {
- pages = maxPages;
- start = currentPage - pages / 2 - 1;
- if (start + pages > pageCount) {
- start = pageCount - pages;
- }
- } else {
- pages = pageCount < maxPages ? pageCount : maxPages;
- start = 0;
- }
-
- for (int i = start, size = start + pages; i < size; i++) {
-
- boolean isCurrentPage = (i + 1 == currentPage);
- String styleClass;
- String style;
- if (isCurrentPage) {
- styleClass = scroller.getSelectedStyleClass();
- style = scroller.getSelectedStyle();
- } else {
- styleClass = scroller.getInactiveStyleClass();
- style = scroller.getInactiveStyle();
- }
- if (styleClass==null){
- styleClass="";
- }
-
- out.startElement("td", component);
- out.startElement("div", component);
-
- if (!isCurrentPage) {
- out.writeAttribute("onclick", getOnClick(Integer.toString(i + 1)), null);
- }
-
- renderPageVar(context, component, i);
-
- if (isCurrentPage) {
- out.writeAttribute("class", styleClass, null);
- UIComponent facet = component.getFacet("activePage");
- if (facet != null) {
- renderChild(context, facet);
- }
- } else {
- out.writeAttribute("class", styleClass, null);
- UIComponent facet = component.getFacet("inactivePage");
- if (facet != null) {
- renderChild(context, facet);
- }
- }
- if (null != style) out.writeAttribute("style", style, null);
- //out.writeText(Integer.toString(i + 1), null);
- //renderChild(context, link);
- out.endElement("div");
- out.endElement("td");
- }
- }
-
- void renderPageVar(FacesContext context, UIComponent component, int i) {
- String varName = (String) component.getAttributes().get("pageVar");
- if (varName != null && varName.length() > 0) {
- context.getExternalContext()
- .getRequestMap().put(varName, new Integer(i));
- }
- }
-
- @Override
- protected Class getComponentClass() {
- return super.getComponentClass();
- }
-
-}
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/ConfirmationPopupHelper.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/ConfirmationPopupHelper.java 2009-04-08 09:53:10 UTC (rev 13422)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/ConfirmationPopupHelper.java 2009-04-08 09:55:14 UTC (rev 13423)
@@ -44,13 +44,13 @@
private String actionName;
- @In @Out(required=false)
+ @In @Out
private Image image;
- @In @Out(required=false)
+ @In @Out
private Shelf shelf;
- @In @Out(required=false)
+ @In @Out
private Album album;
@In AlbumManager albumManager;
Copied: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/DirectLinkHelper.java (from rev 13408, trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/DirectLinkHelper.java)
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/DirectLinkHelper.java (rev 0)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/DirectLinkHelper.java 2009-04-08 09:55:14 UTC (rev 13423)
@@ -0,0 +1,48 @@
+package org.richfaces.realworld.ui;
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+import javax.persistence.EntityManager;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.AutoCreate;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.security.Credentials;
+import org.jboss.seam.security.Identity;
+import org.richfaces.realworld.domain.Image;
+import org.richfaces.realworld.service.Constants;
+import org.richfaces.realworld.util.RealworldException;
+
+@Name("directLink")
+(a)Scope(ScopeType.EVENT)
+@AutoCreate
+public class DirectLinkHelper {
+ private static final String DEFAULT_PICTURE = "default/noimage.jpg";
+
+ @In(value="entityManager")
+ protected EntityManager em;
+
+ @In ImageLoader imageLoader;
+
+ @In Identity identity;
+
+ @In Credentials credentials;
+
+ public void paintImage(OutputStream out, Object data)
+ throws IOException, RealworldException {
+ Long id = Long.valueOf(data.toString());
+ Image im = em.find(Image.class, id);
+ if(im == null || im.getAlbum() == null || im.getAlbum().getShelf() == null){
+ imageLoader.paintImage(out, DEFAULT_PICTURE);
+ return;
+ }
+ if(im.getAlbum().getShelf().isShared() || (identity.hasRole(Constants.ADMIN_ROLE) && im.getAlbum().getOwner().getLogin().equals(credentials.getUsername()))){
+ imageLoader.paintImage(out, im.getPath());
+ }else{
+ return;
+ }
+ }
+}
\ No newline at end of file
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/EditorBean.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/EditorBean.java 2009-04-08 09:53:10 UTC (rev 13422)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/EditorBean.java 2009-04-08 09:55:14 UTC (rev 13423)
@@ -28,8 +28,6 @@
private String currentConfiguration = "/org/richfaces/realworld/editor/advanced";
- private boolean liveUpdatesEnabled=false;
-
private String message;
public String getMessage() {
@@ -44,13 +42,4 @@
public String getCurrentConfiguration() {
return currentConfiguration;
}
-
- public boolean isLiveUpdatesEnabled() {
- return liveUpdatesEnabled;
- }
-
- public void setLiveUpdatesEnabled(boolean liveUpdatesEnabled) {
- this.liveUpdatesEnabled = liveUpdatesEnabled;
- }
-
}
\ No newline at end of file
Copied: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/ErrorHandlerBean.java (from rev 13408, trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/ErrorHandlerBean.java)
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/ErrorHandlerBean.java (rev 0)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/ErrorHandlerBean.java 2009-04-08 09:55:14 UTC (rev 13423)
@@ -0,0 +1,51 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.realworld.ui;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.AutoCreate;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Observer;
+import org.jboss.seam.annotations.Scope;
+import org.richfaces.realworld.service.Constants;
+
+@Name("errorHandlerBean")
+(a)Scope(ScopeType.EVENT)
+@AutoCreate
+public class ErrorHandlerBean {
+ private List<String> errors = new ArrayList<String>();
+
+ public List<String> getErrors() {
+ return errors;
+ }
+
+ public boolean isErrorExist(){
+ return errors.size() > 0 ;
+ }
+
+ @Observer(Constants.ADD_ERROR_EVENT)
+ public void addToErrors(String e){
+ errors.add(e);
+ }
+}
Deleted: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/FileUploadBean.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/FileUploadBean.java 2009-04-08 09:53:10 UTC (rev 13422)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/FileUploadBean.java 2009-04-08 09:55:14 UTC (rev 13423)
@@ -1,164 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.realworld.ui;
-
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Serializable;
-import java.util.Date;
-
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.In;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Out;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.annotations.security.Restrict;
-import org.jboss.seam.core.Events;
-import org.richfaces.event.UploadEvent;
-import org.richfaces.model.UploadItem;
-import org.richfaces.realworld.domain.Image;
-import org.richfaces.realworld.manager.FileManager;
-import org.richfaces.realworld.manager.Model;
-import org.richfaces.realworld.service.Constants;
-import org.richfaces.realworld.service.IImageAction;
-
-import com.drew.imaging.jpeg.JpegMetadataReader;
-import com.drew.metadata.Directory;
-import com.drew.metadata.Metadata;
-import com.drew.metadata.MetadataException;
-import com.drew.metadata.exif.ExifDirectory;
-import com.drew.metadata.jpeg.JpegDirectory;
-
-/**
- * @author $Autor$
- *
- */
-@Name("fileUploadBean")
-(a)Scope(ScopeType.EVENT)
-public class FileUploadBean implements Serializable {
-
- @In("#{messages['file_processing_error']}")
- private String FILE_PROCESSING_ERROR;
-
- @In("#{messages['file_saving_error']}")
- private String FILE_SAVE_ERROR;
-
- @In IImageAction imageAction;
- @In(required = true, scope=ScopeType.CONVERSATION) @Out(scope=ScopeType.CONVERSATION)
- FileWrapper fileWrapper;
-
- @In Model model;
- @In private FileManager fileManager;
-
- private static final long serialVersionUID = 4969087557225414955L;
-
- @Restrict("#{s:hasRole('admin')}")
- public void listener(UploadEvent event) throws Exception {
- UploadItem item = event.getUploadItem();
- Image image = constructImage(item);
- try {
- extractMetadata(item, image);
- } catch (Exception e1) {
- Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, FILE_PROCESSING_ERROR);
- return;
- }
- image.setAlbum(model.getSelectedAlbum());
- if(model.getSelectedAlbum() == null){
- Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, "Please specify album to download");
- return;
- }
- String newPath = Constants.SLASH + model.getSelectedAlbum().getOwner().getLogin() + Constants.SLASH + model.getSelectedAlbum().getId() + Constants.SLASH +item.getFileName();
- image.setPath(newPath);
- if(!fileManager.addImage(newPath, item.getFile().getPath())){
- Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, FILE_SAVE_ERROR);
- item.getFile().delete();
- return;
- }
- fileWrapper.getFiles().add(0, image);
- imageAction.addImage(image);
- Events.instance().raiseEvent("imageAdded");
- item.getFile().delete();
- }
-
- private Image constructImage(UploadItem item) {
- Image image = new Image();
- image.setUploaded(new Date());
- image.setDescription(item.getFileName());
- image.setName(item.getFileName());
- image.setSize(item.getFileSize());
- image.setAllowComments(true);
- return image;
- }
-
- private void extractMetadata(UploadItem item, Image image)
- throws RuntimeException, IOException {
- 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);
- }catch(Exception e){
- throw new RuntimeException();
- }finally{
- in.close();
- }
- }
-
- private void setupCreatedDate(Image image, Directory exifDirectory)
- throws MetadataException {
- if (exifDirectory.containsTag(ExifDirectory.TAG_DATETIME_ORIGINAL)) {
- Date time = exifDirectory.getDate(ExifDirectory.TAG_DATETIME_ORIGINAL);
- image.setCreated(time);
- }
- }
-
- 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);
- image.setWidth(width);
- int height = jpgDirectory.getInt(JpegDirectory.TAG_JPEG_IMAGE_HEIGHT);
- image.setHeight(height);
- }
- }
- }
-
- private void setupCameraModel(Image image, Directory exifDirectory) {
- if (exifDirectory.containsTag(ExifDirectory.TAG_MODEL)) {
- String cameraModel = exifDirectory.getString(ExifDirectory.TAG_MODEL);
- image.setCameraModel(cameraModel);
- }else{
- image.setCameraModel("");
- }
- }
-}
\ No newline at end of file
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/FileWrapper.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/FileWrapper.java 2009-04-08 09:53:10 UTC (rev 13422)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/FileWrapper.java 2009-04-08 09:55:14 UTC (rev 13423)
@@ -37,7 +37,9 @@
public class FileWrapper implements Serializable{
private static final long serialVersionUID = -1767281809514660171L;
+
private List<Image> files = new ArrayList<Image>();
+
public int getSize() {
return getFiles().size();
}
@@ -59,4 +61,4 @@
public void clear(){
files.clear();
}
-}
+}
\ No newline at end of file
Copied: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/Help.java (from rev 13390, trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/Help.java)
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/Help.java (rev 0)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/Help.java 2009-04-08 09:55:14 UTC (rev 13423)
@@ -0,0 +1,26 @@
+package org.richfaces.realworld.ui;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.AutoCreate;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+
+@Name("help")
+(a)Scope(ScopeType.EVENT)
+@AutoCreate
+public class Help {
+
+ private String page = "/includes/help/tree_click_descr.xhtml";
+
+ public String getPage() {
+ return page;
+ }
+
+ public void setPage(String page) {
+ this.page = page;
+ }
+
+ public void navigateTo(String src){
+ this.setPage(src);
+ }
+}
Copied: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/ImageLoader.java (from rev 13408, trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/ImageLoader.java)
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/ImageLoader.java (rev 0)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/ImageLoader.java 2009-04-08 09:55:14 UTC (rev 13423)
@@ -0,0 +1,78 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.realworld.ui;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.Serializable;
+
+import javax.imageio.ImageIO;
+import javax.imageio.stream.ImageInputStream;
+import javax.imageio.stream.ImageOutputStream;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.AutoCreate;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.richfaces.realworld.manager.FileManager;
+
+@Name("imageLoader")
+(a)Scope(ScopeType.EVENT)
+@AutoCreate
+public class ImageLoader implements Serializable {
+
+ private static final long serialVersionUID = -1572789608594870285L;
+
+ @In
+ FileManager fileManager;
+
+ public void paintImage(OutputStream out, Object data) throws IOException {
+ if (null == data) {
+ return;
+ }
+ File imageResource = null;
+ if(data.toString().endsWith("upload")){
+ imageResource = fileManager.getFileByAbsolutePath(data.toString());
+ }else{
+ imageResource = fileManager.getFileByPath(data.toString());
+ }
+ if (imageResource != null && imageResource.exists()) {
+
+ byte [] toWrite = new byte[8192];
+
+ ImageInputStream inputStream = ImageIO.createImageInputStream(imageResource);
+ ImageOutputStream outputStream = ImageIO.createImageOutputStream(out);
+
+ try {
+ while(inputStream.read(toWrite) != -1) {
+ outputStream.write(toWrite);
+ }
+
+ } finally {
+ outputStream.close();
+ inputStream.close();
+ }
+
+ }
+ }
+}
Deleted: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/PasswordHolder.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/PasswordHolder.java 2009-04-08 09:53:10 UTC (rev 13422)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/PasswordHolder.java 2009-04-08 09:55:14 UTC (rev 13423)
@@ -1,33 +0,0 @@
-package org.richfaces.realworld.ui;
-
-import java.security.MessageDigest;
-
-import org.jboss.seam.annotations.AutoCreate;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.util.Hex;
-
-@Name("passwordHolder")
-@AutoCreate
-public class PasswordHolder {
- private String digestAlgorithm;
- private String charset;
-
- public void setDigestAlgorithm(String algorithm) {
- this.digestAlgorithm = algorithm;
- }
-
- public void setCharset(String charset) {
- this.charset = charset;
- }
-
- public String hash(String plainTextPassword) {
- try {
- MessageDigest digest = MessageDigest.getInstance(digestAlgorithm);
- digest.update(plainTextPassword.getBytes(charset));
- byte[] rawHash = digest.digest();
- return new String(Hex.encodeHex(rawHash));
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-}
\ No newline at end of file
Copied: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/CopyImageStuff.java (from rev 13408, trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/startup/CopyImageStuff.java)
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/CopyImageStuff.java (rev 0)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/CopyImageStuff.java 2009-04-08 09:55:14 UTC (rev 13423)
@@ -0,0 +1,107 @@
+/**
+ *
+ */
+package org.richfaces.realworld.util;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+import java.net.URLClassLoader;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Create;
+import org.jboss.seam.annotations.Destroy;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.Startup;
+
+
+/**
+ * @author Andrey Markavtsov
+ *
+ */
+
+@Name("CopyImagesStuff")
+(a)Scope(ScopeType.APPLICATION)
+@Startup
+public class CopyImageStuff {
+
+ static final String WEB_INF = "WEB-INF";
+
+ static final String IMAGE_FOLDER = "/Upload";
+
+ //TODO nick - change constant value to include "richfaces"
+ static final String REALWORLD_FOLDER = "realworld";
+
+ @Out(scope = ScopeType.APPLICATION)
+ File uploadRoot;
+
+ @Out(scope = ScopeType.APPLICATION)
+ String uploadRootPath;
+
+ String imageSrc;
+
+ @Create
+ public void create() throws Exception {
+ resolveImageFolder();
+ resolveUploadRoot();
+
+ copyImages();
+ }
+
+ @Destroy
+ public void destroy()throws IOException {
+ FileUtils.deleteDirectory(uploadRoot);
+ }
+
+ void resolveImageFolder() {
+ //TODO nick - what this cast is for?
+ URLClassLoader loader = (URLClassLoader)getClass().getClassLoader();
+ //TODO nick - rewrite that
+ URL path = loader.getResource("");
+ String classLoadPath = null;
+ String realPath = null;
+
+ if (path != null) {
+ classLoadPath = path.getFile();
+ }
+
+ if (classLoadPath != null) {
+ int index = classLoadPath.indexOf(WEB_INF);
+ if (index != -1) {
+ realPath = classLoadPath.substring(0, index + WEB_INF.length()) + IMAGE_FOLDER;
+ }
+ }
+
+ if (realPath != null) {
+ this.imageSrc = realPath;
+ }else {
+ throw new NullPointerException("Cannot bound image folder path");
+ }
+
+ }
+
+ void resolveUploadRoot()throws IOException {
+ String property = System.getProperty("java.io.tmpdir");
+ if(!property.endsWith(File.separator)){
+ property+=File.separator;
+ }
+ String uploadRootPath = property + REALWORLD_FOLDER + File.separator;
+ if (uploadRootPath != null) {
+ uploadRoot = new File(uploadRootPath);
+ if (uploadRoot.exists()) {
+ FileUtils.deleteDirectory(uploadRoot);
+ }
+ uploadRoot.mkdir();
+ this.uploadRootPath = uploadRoot.getCanonicalPath();
+ }else {
+ throw new NullPointerException("Upload root was not created");
+ }
+ }
+
+ void copyImages()throws IOException {
+ FileUtils.copyDirectory(new File(imageSrc), uploadRoot);
+ }
+
+}
\ No newline at end of file
Deleted: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/DirectLinkHelper.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/DirectLinkHelper.java 2009-04-08 09:53:10 UTC (rev 13422)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/DirectLinkHelper.java 2009-04-08 09:55:14 UTC (rev 13423)
@@ -1,47 +0,0 @@
-package org.richfaces.realworld.util;
-
-import java.io.IOException;
-import java.io.OutputStream;
-
-import javax.persistence.EntityManager;
-
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.AutoCreate;
-import org.jboss.seam.annotations.In;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.security.Credentials;
-import org.jboss.seam.security.Identity;
-import org.richfaces.realworld.domain.Image;
-import org.richfaces.realworld.service.Constants;
-
-@Name("directLink")
-(a)Scope(ScopeType.EVENT)
-@AutoCreate
-public class DirectLinkHelper {
- private static final String DEFAULT_PICTURE = "default/noimage.jpg";
-
- @In(value="entityManager")
- protected EntityManager em;
-
- @In ImageLoader imageLoader;
-
- @In Identity identity;
-
- @In Credentials credentials;
-
- public void paintImage(OutputStream out, Object data)
- throws IOException, RealworldException {
- Long id = Long.valueOf(data.toString());
- Image im = em.find(Image.class, id);
- if(im == null || im.getAlbum() == null || im.getAlbum().getShelf() == null){
- imageLoader.paintImage(out, DEFAULT_PICTURE);
- return;
- }
- if(im.getAlbum().getShelf().isShared() || (identity.hasRole(Constants.ADMIN_ROLE) && im.getAlbum().getOwner().getLogin().equals(credentials.getUsername()))){
- imageLoader.paintImage(out, im.getPath());
- }else{
- return;
- }
- }
-}
\ No newline at end of file
Deleted: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/ErrorHandlerBean.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/ErrorHandlerBean.java 2009-04-08 09:53:10 UTC (rev 13422)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/ErrorHandlerBean.java 2009-04-08 09:55:14 UTC (rev 13423)
@@ -1,56 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.realworld.util;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.AutoCreate;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Observer;
-import org.jboss.seam.annotations.Scope;
-import org.richfaces.realworld.service.Constants;
-
-@Name("errorHandlerBean")
-(a)Scope(ScopeType.EVENT)
-@AutoCreate
-public class ErrorHandlerBean {
- private List<String> errors = new ArrayList<String>();
-
- public List<String> getErrors() {
- return errors;
- }
-
- public boolean isErrorExist(){
- return errors.size() > 0 ;
- }
-
- @Observer(Constants.CLEAR_ERROR_EVENT)
- public void clearEvents(){
- errors.clear();
- }
-
- @Observer(Constants.ADD_ERROR_EVENT)
- public void addToErrors(String e){
- errors.add(e);
- }
-}
Deleted: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/Help.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/Help.java 2009-04-08 09:53:10 UTC (rev 13422)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/Help.java 2009-04-08 09:55:14 UTC (rev 13423)
@@ -1,26 +0,0 @@
-package org.richfaces.realworld.util;
-
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.AutoCreate;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-
-@Name("help")
-(a)Scope(ScopeType.EVENT)
-@AutoCreate
-public class Help {
-
- private String page = "/includes/help/tree_click_descr.xhtml";
-
- public String getPage() {
- return page;
- }
-
- public void setPage(String page) {
- this.page = page;
- }
-
- public void navigateTo(String src){
- this.setPage(src);
- }
-}
Deleted: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/ImageLoader.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/ImageLoader.java 2009-04-08 09:53:10 UTC (rev 13422)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/ImageLoader.java 2009-04-08 09:55:14 UTC (rev 13423)
@@ -1,78 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.realworld.util;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.Serializable;
-
-import javax.imageio.ImageIO;
-import javax.imageio.stream.ImageInputStream;
-import javax.imageio.stream.ImageOutputStream;
-
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.AutoCreate;
-import org.jboss.seam.annotations.In;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.richfaces.realworld.manager.FileManager;
-
-@Name("imageLoader")
-(a)Scope(ScopeType.EVENT)
-@AutoCreate
-public class ImageLoader implements Serializable {
-
- private static final long serialVersionUID = -1572789608594870285L;
-
- @In
- FileManager fileManager;
-
- public void paintImage(OutputStream out, Object data) throws IOException {
- if (null == data) {
- return;
- }
- File imageResource = null;
- if(data.toString().endsWith("upload")){
- imageResource = fileManager.getFileByAbsolutePath(data.toString());
- }else{
- imageResource = fileManager.getFileByPath(data.toString());
- }
- if (imageResource != null && imageResource.exists()) {
-
- byte [] toWrite = new byte[8192];
-
- ImageInputStream inputStream = ImageIO.createImageInputStream(imageResource);
- ImageOutputStream outputStream = ImageIO.createImageOutputStream(out);
-
- try {
- while(inputStream.read(toWrite) != -1) {
- outputStream.write(toWrite);
- }
-
- } finally {
- outputStream.close();
- inputStream.close();
- }
-
- }
- }
-}
Modified: trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/components.xml
===================================================================
--- trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/components.xml 2009-04-08 09:53:10 UTC (rev 13422)
+++ trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/components.xml 2009-04-08 09:55:14 UTC (rev 13423)
@@ -22,7 +22,7 @@
<core:init transaction-management-enabled="false" debug="true" jndi-pattern="@jndiPattern@"/>
<core:manager concurrent-request-timeout="20000"
- conversation-timeout="120000"
+ conversation-timeout="200000"
conversation-id-parameter="cid"
default-flush-mode="MANUAL"/>
<persistence:managed-persistence-context name="entityManager"
@@ -30,7 +30,7 @@
persistence-unit-jndi-name="java:/realWorldEntityManager"/>
<transaction:ejb-transaction/>
<security:identity authenticate-method="#{authenticator.authenticate}"/>
- <component name="passwordHolder" digestAlgorithm="SHA-1" charset="UTF-8"/>
+ <component name="authenticator" digestAlgorithm="SHA-1" charset="UTF-8"/>
<component name="org.jboss.seam.ui.entityConverter">
<property name="entityManager">#{em}</property>
</component>
Modified: trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/faces-config.xml 2009-04-08 09:53:10 UTC (rev 13422)
+++ trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/faces-config.xml 2009-04-08 09:55:14 UTC (rev 13423)
@@ -21,10 +21,5 @@
<renderer-type>org.ajax4jsf.components.RealworldAjaxCommandButtonRenderer</renderer-type>
<renderer-class>org.richfaces.realworld.tags.RealworldCommandButtonRenderer</renderer-class>
</renderer>
- <renderer>
- <component-family>org.richfaces.Datascroller</component-family>
- <renderer-type>org.ajax4jsf.components.RealworldImageDataScroller</renderer-type>
- <renderer-class>org.richfaces.realworld.tags.RealworldImageScrollerRenderer</renderer-class>
- </renderer>
</render-kit>
</faces-config>
Modified: trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/tags/realWorld-taglib.xml
===================================================================
--- trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/tags/realWorld-taglib.xml 2009-04-08 09:53:10 UTC (rev 13422)
+++ trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/tags/realWorld-taglib.xml 2009-04-08 09:55:14 UTC (rev 13423)
@@ -11,11 +11,4 @@
<renderer-type>org.ajax4jsf.components.RealworldAjaxCommandButtonRenderer</renderer-type>
</component>
</tag>
- <tag>
- <tag-name>imageDataScroller</tag-name>
- <component>
- <component-type>org.richfaces.Datascroller</component-type>
- <renderer-type>org.ajax4jsf.components.RealworldImageDataScroller</renderer-type>
- </component>
- </tag>
</facelet-taglib>
\ No newline at end of file
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/fileUpload/fileUploader.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/fileUpload/uploadResult.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/index/header.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/index/login.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/misc/errorPanel.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/misc/inputNumberSlider.xhtml
===================================================================
--- trunk/test-applications/realworld2/web/src/main/webapp/includes/misc/inputNumberSlider.xhtml 2009-04-08 09:53:10 UTC (rev 13422)
+++ trunk/test-applications/realworld2/web/src/main/webapp/includes/misc/inputNumberSlider.xhtml 2009-04-08 09:55:14 UTC (rev 13423)
@@ -5,16 +5,10 @@
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich"
xmlns:richx="http://richfaces.org/richx">
- <div>
- <rich:inputNumberSlider enableManualInput="false"
- value="#{imageSizeHelper.value}"
- minValue="80"
- maxValue="200"
- showArrows="false"
- showBoundaryValues="true"
- showInput="false"
- step="40">
- <a4j:support event="onchange" reRender="userAlbumImages"/>
- </rich:inputNumberSlider>
- </div>
+ <div><rich:inputNumberSlider enableManualInput="false"
+ value="#{imageSizeHelper.value}" minValue="80" maxValue="200"
+ showArrows="false" showBoundaryValues="true" showInput="false"
+ step="40">
+ <a4j:support event="onchange" reRender="userAlbumImages" />
+ </rich:inputNumberSlider></div>
</ui:composition>
\ No newline at end of file
Modified: trunk/test-applications/realworld2/web/src/main/webapp/register.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/scripts/realworld.js
===================================================================
--- trunk/test-applications/realworld2/web/src/main/webapp/scripts/realworld.js 2009-04-08 09:53:10 UTC (rev 13422)
+++ trunk/test-applications/realworld2/web/src/main/webapp/scripts/realworld.js 2009-04-08 09:55:14 UTC (rev 13423)
@@ -9,18 +9,4 @@
}
target.value += tag;
}
-}
-
-function updateUploadProgressBarLabel (progressBar, fileUpload) {
- var c = fileUpload.entries.length;
- var uploaded = 0;
- for (var i=0;i<c;i++) {
- if (fileUpload.entries[i].state == FileUploadEntry.UPLOAD_SUCCESS) {
- uploaded++;
- }
- }
-
- var value = (c >0) ? 100 * uploaded / c : 0;
- progressBar.setValue(value);
- progressBar.setLabel(uploaded + '/' + c + ' completed');
}
\ No newline at end of file
15 years, 2 months
JBoss Rich Faces SVN: r13422 - in trunk/test-applications/facelets/src/main: webapp/Skinning and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2009-04-08 05:53:10 -0400 (Wed, 08 Apr 2009)
New Revision: 13422
Modified:
trunk/test-applications/facelets/src/main/resources/util/data/cars.xml
trunk/test-applications/facelets/src/main/webapp/Skinning/Skinning.xhtml
Log:
Modified: trunk/test-applications/facelets/src/main/resources/util/data/cars.xml
===================================================================
--- trunk/test-applications/facelets/src/main/resources/util/data/cars.xml 2009-04-08 09:52:53 UTC (rev 13421)
+++ trunk/test-applications/facelets/src/main/resources/util/data/cars.xml 2009-04-08 09:53:10 UTC (rev 13422)
@@ -3,7 +3,7 @@
<car>
<make>Audi</make>
<model>A6</model>
- <price>20000</price>
+ <price>40000</price>
</car>
<car>
<make>Audi</make>
@@ -11,11 +11,31 @@
<price>48500</price>
</car>
<car>
+ <make>Audi</make>
+ <model>Q5</model>
+ <price>36500</price>
+ </car>
+ <car>
+ <make>Audi</make>
+ <model>Q8</model>
+ <price>102500</price>
+ </car>
+ <car>
<make>BMW</make>
<model>760Li</model>
<price>115400</price>
</car>
<car>
+ <make>BMW</make>
+ <model>330i</model>
+ <price>38400</price>
+ </car>
+ <car>
+ <make>BMW</make>
+ <model>X6</model>
+ <price>55900</price>
+ </car>
+ <car>
<make>Bentley</make>
<model>Arnage</model>
<price>240000</price>
@@ -36,21 +56,66 @@
<price>854200</price>
</car>
<car>
+ <make>Mercedes-Benz</make>
+ <model>E63AMG</model>
+ <price>120200</price>
+ </car>
+ <car>
+ <make>Mercedes-Benz</make>
+ <model>R350</model>
+ <price>61200</price>
+ </car>
+ <car>
+ <make>Mercedes-Benz</make>
+ <model>E300D</model>
+ <price>9800</price>
+ </car>
+ <car>
<make>Mazda</make>
+ <model>3</model>
+ <price>17300</price>
+ </car>
+ <car>
+ <make>Mazda</make>
<model>6</model>
<price>21300</price>
</car>
<car>
+ <make>Mazda</make>
+ <model>CX7</model>
+ <price>24300</price>
+ </car>
+ <car>
<make>Fiat</make>
<model>Punto</model>
<price>8200</price>
</car>
<car>
+ <make>Fiat</make>
+ <model>Multipla</model>
+ <price>9100</price>
+ </car>
+ <car>
<make>Ford</make>
<model>GT-40</model>
<price>325100</price>
</car>
<car>
+ <make>Ford</make>
+ <model>Mondeo</model>
+ <price>23100</price>
+ </car>
+ <car>
+ <make>Ford</make>
+ <model>Fiesta</model>
+ <price>5100</price>
+ </car>
+ <car>
+ <make>Ford</make>
+ <model>Scorpio</model>
+ <price>4800</price>
+ </car>
+ <car>
<make>Ferrari</make>
<model>Enzo</model>
<price>950000</price>
Modified: trunk/test-applications/facelets/src/main/webapp/Skinning/Skinning.xhtml
===================================================================
--- trunk/test-applications/facelets/src/main/webapp/Skinning/Skinning.xhtml 2009-04-08 09:52:53 UTC (rev 13421)
+++ trunk/test-applications/facelets/src/main/webapp/Skinning/Skinning.xhtml 2009-04-08 09:53:10 UTC (rev 13422)
@@ -1,15 +1,28 @@
-<f:subview xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:a4j="http://richfaces.org/a4j" xmlns:h="http://java.sun.com/jsf/html" xmlns:rich="http://richfaces.org/rich" id="skinningSubviewID">
+<f:subview xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich" id="skinningSubviewID">
<rich:dataTable columns="4" value="">
<f:facet name="caption">
- <h:outputText value="Standard controls skinning feature provides styling for standard HTML elements so that they become highly compliant with RichFaces look and feel. Skinning can be applied to all page controls based on element name and type attribute (where applicable). Also this feature provides a set of CSS styles so that skinning can be applied by assigning rich-.. classes to particular elements or to container element that nests controls." />
- </f:facet>
+ <h:outputText
+ value="Standard controls skinning feature provides styling for standard HTML elements so that they become highly compliant with RichFaces look and feel. Skinning can be applied to all page controls based on element name and type attribute (where applicable). Also this feature provides a set of CSS styles so that skinning can be applied by assigning rich-.. classes to particular elements or to container element that nests controls." />
+ </f:facet>
<f:facet name="header">
<rich:columnGroup>
- <rich:column><h:outputText value="Name of Component" /></rich:column>
- <rich:column><h:outputText value="styleClass of Component" /></rich:column>
- <rich:column><h:outputText value="Component is enabled" /></rich:column>
- <rich:column><h:outputText value="Component is disabled" /></rich:column>
- </rich:columnGroup>
+ <rich:column>
+ <h:outputText value="Name of Component" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="styleClass of Component" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="Component is enabled" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="Component is disabled" />
+ </rich:column>
+ </rich:columnGroup>
</f:facet>
<f:facet name="footer">
<h:outputText value="" />
@@ -22,10 +35,12 @@
<h:outputText value="#{skinning.inputTextStyleClass}" />
</rich:column>
<rich:column>
- <h:inputText styleClass="#{skinning.inputTextStyleClass}" value="#{skinning.inputText}" />
+ <h:inputText styleClass="#{skinning.inputTextStyleClass}"
+ value="#{skinning.inputText}" />
</rich:column>
<rich:column>
- <h:inputText styleClass="#{skinning.inputTextStyleClass}" value="#{skinning.inputText}" disabled="true"/>
+ <h:inputText styleClass="#{skinning.inputTextStyleClass}"
+ value="#{skinning.inputText}" disabled="true" />
</rich:column>
</rich:columnGroup>
<rich:columnGroup>
@@ -36,10 +51,12 @@
<h:outputText value="#{skinning.inputSecretStyleClass}" />
</rich:column>
<rich:column>
- <h:inputSecret styleClass="#{skinning.inputSecretStyleClass}" value="#{skinning.inputSecret}" redisplay="true"/>
+ <h:inputSecret styleClass="#{skinning.inputSecretStyleClass}"
+ value="#{skinning.inputSecret}" redisplay="true" />
</rich:column>
<rich:column>
- <h:inputSecret styleClass="#{skinning.inputSecretStyleClass}" value="#{skinning.inputSecret}" disabled="true" redisplay="true"/>
+ <h:inputSecret styleClass="#{skinning.inputSecretStyleClass}"
+ value="#{skinning.inputSecret}" disabled="true" redisplay="true" />
</rich:column>
</rich:columnGroup>
<rich:columnGroup>
@@ -50,10 +67,10 @@
<h:outputText value="rich-input" />
</rich:column>
<rich:column>
- <input class="rich-input" value="input" ></input>
+ <input class="rich-input" value="input"></input>
</rich:column>
<rich:column>
- <input class="rich-input" value="input" disabled="true" ></input>
+ <input class="rich-input" value="input" disabled="true"></input>
</rich:column>
</rich:columnGroup>
<rich:columnGroup>
@@ -64,10 +81,12 @@
<h:outputText value="#{skinning.inputTextareaStyleClass}" />
</rich:column>
<rich:column>
- <h:inputTextarea styleClass="#{skinning.inputTextareaStyleClass}" value="#{skinning.inputTextarea}" />
+ <h:inputTextarea styleClass="#{skinning.inputTextareaStyleClass}"
+ value="#{skinning.inputTextarea}" />
</rich:column>
<rich:column>
- <h:inputTextarea styleClass="#{skinning.inputTextareaStyleClass}" value="#{skinning.inputTextarea}" disabled="true" />
+ <h:inputTextarea styleClass="#{skinning.inputTextareaStyleClass}"
+ value="#{skinning.inputTextarea}" disabled="true" />
</rich:column>
</rich:columnGroup>
<rich:columnGroup>
@@ -78,12 +97,20 @@
<h:outputText value="#{skinning.selectBooleanCheckboxStyleClass}" />
</rich:column>
<rich:column>
- <h:selectBooleanCheckbox styleClass="#{skinning.selectBooleanCheckboxStyleClass}" value="#{skinning.selectBooleanCheckbox1}" />
- <h:selectBooleanCheckbox styleClass="#{skinning.selectBooleanCheckboxStyleClass}" value="#{skinning.selectBooleanCheckbox2}" />
+ <h:selectBooleanCheckbox
+ styleClass="#{skinning.selectBooleanCheckboxStyleClass}"
+ value="#{skinning.selectBooleanCheckbox1}" />
+ <h:selectBooleanCheckbox
+ styleClass="#{skinning.selectBooleanCheckboxStyleClass}"
+ value="#{skinning.selectBooleanCheckbox2}" />
</rich:column>
<rich:column>
- <h:selectBooleanCheckbox styleClass="#{skinning.selectBooleanCheckboxStyleClass}" value="#{skinning.selectBooleanCheckbox1}" disabled="true"/>
- <h:selectBooleanCheckbox styleClass="#{skinning.selectBooleanCheckboxStyleClass}" value="#{skinning.selectBooleanCheckbox2}" disabled="true" />
+ <h:selectBooleanCheckbox
+ styleClass="#{skinning.selectBooleanCheckboxStyleClass}"
+ value="#{skinning.selectBooleanCheckbox1}" disabled="true" />
+ <h:selectBooleanCheckbox
+ styleClass="#{skinning.selectBooleanCheckboxStyleClass}"
+ value="#{skinning.selectBooleanCheckbox2}" disabled="true" />
</rich:column>
</rich:columnGroup>
<rich:columnGroup>
@@ -94,13 +121,14 @@
<h:outputText value="#{skinning.selectManyCheckbox}" />
</rich:column>
<rich:column>
- <h:selectManyCheckbox styleClass="#{skinning.selectManyCheckbox}" >
- <f:selectItems value="#{skinning.list}"/>
+ <h:selectManyCheckbox styleClass="#{skinning.selectManyCheckbox}">
+ <f:selectItems value="#{skinning.list}" />
</h:selectManyCheckbox>
</rich:column>
<rich:column>
- <h:selectManyCheckbox styleClass="#{skinning.selectManyCheckbox}" disabled="true">
- <f:selectItems value="#{skinning.list}"/>
+ <h:selectManyCheckbox styleClass="#{skinning.selectManyCheckbox}"
+ disabled="true">
+ <f:selectItems value="#{skinning.list}" />
</h:selectManyCheckbox>
</rich:column>
</rich:columnGroup>
@@ -112,13 +140,15 @@
<h:outputText value="#{skinning.selectManyListbox}" />
</rich:column>
<rich:column>
- <h:selectManyListbox styleClass="#{skinning.selectManyListbox}" style="height: 55px;" >
- <f:selectItems value="#{skinning.list}"/>
+ <h:selectManyListbox styleClass="#{skinning.selectManyListbox}"
+ style="height: 55px;">
+ <f:selectItems value="#{skinning.list}" />
</h:selectManyListbox>
</rich:column>
<rich:column>
- <h:selectManyListbox styleClass="#{skinning.selectManyListbox}" style="height: 55px;" disabled="true">
- <f:selectItems value="#{skinning.list}"/>
+ <h:selectManyListbox styleClass="#{skinning.selectManyListbox}"
+ style="height: 55px;" disabled="true">
+ <f:selectItems value="#{skinning.list}" />
</h:selectManyListbox>
</rich:column>
</rich:columnGroup>
@@ -130,13 +160,15 @@
<h:outputText value="#{skinning.selectManyMenu}" />
</rich:column>
<rich:column>
- <h:selectManyMenu styleClass="#{skinning.selectManyMenu}" style="height: 55px;" >
- <f:selectItems value="#{skinning.list}"/>
+ <h:selectManyMenu styleClass="#{skinning.selectManyMenu}"
+ style="height: 55px;">
+ <f:selectItems value="#{skinning.list}" />
</h:selectManyMenu>
</rich:column>
<rich:column>
- <h:selectManyMenu styleClass="#{skinning.selectManyMenu}" style="height: 55px;" disabled="true">
- <f:selectItems value="#{skinning.list}"/>
+ <h:selectManyMenu styleClass="#{skinning.selectManyMenu}"
+ style="height: 55px;" disabled="true">
+ <f:selectItems value="#{skinning.list}" />
</h:selectManyMenu>
</rich:column>
</rich:columnGroup>
@@ -148,13 +180,15 @@
<h:outputText value="#{skinning.selectOneListbox}" />
</rich:column>
<rich:column>
- <h:selectOneListbox styleClass="#{skinning.selectOneListbox}" style="height: 55px;" >
- <f:selectItems value="#{skinning.list}"/>
+ <h:selectOneListbox styleClass="#{skinning.selectOneListbox}"
+ style="height: 55px;">
+ <f:selectItems value="#{skinning.list}" />
</h:selectOneListbox>
</rich:column>
<rich:column>
- <h:selectOneListbox styleClass="#{skinning.selectOneListbox}" style="height: 55px;" disabled="true">
- <f:selectItems value="#{skinning.list}"/>
+ <h:selectOneListbox styleClass="#{skinning.selectOneListbox}"
+ style="height: 55px;" disabled="true">
+ <f:selectItems value="#{skinning.list}" />
</h:selectOneListbox>
</rich:column>
</rich:columnGroup>
@@ -166,13 +200,14 @@
<h:outputText value="#{skinning.selectOneMenu}" />
</rich:column>
<rich:column>
- <h:selectOneMenu styleClass="#{skinning.selectOneMenu}" >
- <f:selectItems value="#{skinning.list}"/>
+ <h:selectOneMenu styleClass="#{skinning.selectOneMenu}">
+ <f:selectItems value="#{skinning.list}" />
</h:selectOneMenu>
</rich:column>
<rich:column>
- <h:selectOneMenu styleClass="#{skinning.selectOneMenu}" disabled="true">
- <f:selectItems value="#{skinning.list}"/>
+ <h:selectOneMenu styleClass="#{skinning.selectOneMenu}"
+ disabled="true">
+ <f:selectItems value="#{skinning.list}" />
</h:selectOneMenu>
</rich:column>
</rich:columnGroup>
@@ -184,13 +219,14 @@
<h:outputText value="#{skinning.selectOneRadio}" />
</rich:column>
<rich:column>
- <h:selectOneRadio styleClass="#{skinning.selectOneRadio}" >
- <f:selectItems value="#{skinning.list}"/>
+ <h:selectOneRadio styleClass="#{skinning.selectOneRadio}">
+ <f:selectItems value="#{skinning.list}" />
</h:selectOneRadio>
</rich:column>
<rich:column>
- <h:selectOneRadio styleClass="#{skinning.selectOneRadio}" disabled="true">
- <f:selectItems value="#{skinning.list}"/>
+ <h:selectOneRadio styleClass="#{skinning.selectOneRadio}"
+ disabled="true">
+ <f:selectItems value="#{skinning.list}" />
</h:selectOneRadio>
</rich:column>
</rich:columnGroup>
@@ -202,10 +238,12 @@
<h:outputText value="#{skinning.commandButton}" />
</rich:column>
<rich:column>
- <h:commandButton styleClass="#{skinning.commandButton}" value="commandButton" />
+ <h:commandButton styleClass="#{skinning.commandButton}"
+ value="commandButton" />
</rich:column>
<rich:column>
- <h:commandButton styleClass="#{skinning.commandButton}" value="commandButton" disabled="true" />
+ <h:commandButton styleClass="#{skinning.commandButton}"
+ value="commandButton" disabled="true" />
</rich:column>
</rich:columnGroup>
<rich:columnGroup>
@@ -216,10 +254,10 @@
<h:outputText value="rich-button" />
</rich:column>
<rich:column>
- <button class="rich-button" >button</button>
+ <button class="rich-button">button</button>
</rich:column>
<rich:column>
- <button class="rich-button" disabled="true" >button</button>
+ <button class="rich-button" disabled="true">button</button>
</rich:column>
</rich:columnGroup>
<rich:columnGroup>
@@ -230,10 +268,12 @@
<h:outputText value="#{skinning.commandLink}" />
</rich:column>
<rich:column>
- <h:commandLink styleClass="#{skinning.commandLink}" value="commandLink" />
+ <h:commandLink styleClass="#{skinning.commandLink}"
+ value="commandLink" />
</rich:column>
<rich:column>
- <h:commandLink styleClass="#{skinning.commandLink}" value="commandLink" disabled="true" />
+ <h:commandLink styleClass="#{skinning.commandLink}"
+ value="commandLink" disabled="true" />
</rich:column>
</rich:columnGroup>
<rich:columnGroup>
@@ -244,10 +284,14 @@
<h:outputText value="#{skinning.outputLink}" />
</rich:column>
<rich:column>
- <h:outputLink styleClass="#{skinning.outputLink}"><h:outputText value="outputLink" /></h:outputLink>
+ <h:outputLink styleClass="#{skinning.outputLink}">
+ <h:outputText value="outputLink" />
+ </h:outputLink>
</rich:column>
<rich:column>
- <h:outputLink styleClass="#{skinning.outputLink}" disabled="true"><h:outputText value="outputLink" /></h:outputLink>
+ <h:outputLink styleClass="#{skinning.outputLink}" disabled="true">
+ <h:outputText value="outputLink" />
+ </h:outputLink>
</rich:column>
</rich:columnGroup>
<rich:columnGroup>
@@ -258,7 +302,8 @@
<h:outputText value="rich-link" />
</rich:column>
<rich:column>
- <a href="http://localhost:8081/jsp/pages/Rich/Rich.jsf" class="rich-link" >link</a>
+ <a href="http://localhost:8081/jsp/pages/Rich/Rich.jsf"
+ class="rich-link">link</a>
</rich:column>
<rich:column>
<h:outputText value="component has not disabled state" />
@@ -274,6 +319,9 @@
<rich:column>
<fieldset class="rich-fieldset">
<legend class="rich-legend">Student</legend>
+ <input type="checkbox"> The first </input> <br />
+ <input type="checkbox"> The second </input> <br />
+ <input type="checkbox"> The third </input>
</fieldset>
</rich:column>
<rich:column>
@@ -294,6 +342,7 @@
<h:outputText value="components have not disabled state" />
</rich:column>
</rich:columnGroup>
+ <!--
<rich:columnGroup>
<rich:column>
<h:outputText value="isindex" />
@@ -322,5 +371,6 @@
<keygen disabled="true" class="rich-keygen" />
</rich:column>
</rich:columnGroup>
+-->
</rich:dataTable>
</f:subview>
\ No newline at end of file
15 years, 2 months
JBoss Rich Faces SVN: r13421 - in trunk/test-applications/jsp/src/main: webapp/Skinning and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2009-04-08 05:52:53 -0400 (Wed, 08 Apr 2009)
New Revision: 13421
Modified:
trunk/test-applications/jsp/src/main/resources/util/data/cars.xml
trunk/test-applications/jsp/src/main/webapp/Skinning/Skinning.jsp
Log:
Modified: trunk/test-applications/jsp/src/main/resources/util/data/cars.xml
===================================================================
--- trunk/test-applications/jsp/src/main/resources/util/data/cars.xml 2009-04-08 09:51:49 UTC (rev 13420)
+++ trunk/test-applications/jsp/src/main/resources/util/data/cars.xml 2009-04-08 09:52:53 UTC (rev 13421)
@@ -3,7 +3,7 @@
<car>
<make>Audi</make>
<model>A6</model>
- <price>20000</price>
+ <price>40000</price>
</car>
<car>
<make>Audi</make>
@@ -11,11 +11,31 @@
<price>48500</price>
</car>
<car>
+ <make>Audi</make>
+ <model>Q5</model>
+ <price>36500</price>
+ </car>
+ <car>
+ <make>Audi</make>
+ <model>Q8</model>
+ <price>102500</price>
+ </car>
+ <car>
<make>BMW</make>
<model>760Li</model>
<price>115400</price>
</car>
<car>
+ <make>BMW</make>
+ <model>330i</model>
+ <price>38400</price>
+ </car>
+ <car>
+ <make>BMW</make>
+ <model>X6</model>
+ <price>55900</price>
+ </car>
+ <car>
<make>Bentley</make>
<model>Arnage</model>
<price>240000</price>
@@ -36,21 +56,66 @@
<price>854200</price>
</car>
<car>
+ <make>Mercedes-Benz</make>
+ <model>E63AMG</model>
+ <price>120200</price>
+ </car>
+ <car>
+ <make>Mercedes-Benz</make>
+ <model>R350</model>
+ <price>61200</price>
+ </car>
+ <car>
+ <make>Mercedes-Benz</make>
+ <model>E300D</model>
+ <price>9800</price>
+ </car>
+ <car>
<make>Mazda</make>
+ <model>3</model>
+ <price>17300</price>
+ </car>
+ <car>
+ <make>Mazda</make>
<model>6</model>
<price>21300</price>
</car>
<car>
+ <make>Mazda</make>
+ <model>CX7</model>
+ <price>24300</price>
+ </car>
+ <car>
<make>Fiat</make>
<model>Punto</model>
<price>8200</price>
</car>
<car>
+ <make>Fiat</make>
+ <model>Multipla</model>
+ <price>9100</price>
+ </car>
+ <car>
<make>Ford</make>
<model>GT-40</model>
<price>325100</price>
</car>
<car>
+ <make>Ford</make>
+ <model>Mondeo</model>
+ <price>23100</price>
+ </car>
+ <car>
+ <make>Ford</make>
+ <model>Fiesta</model>
+ <price>5100</price>
+ </car>
+ <car>
+ <make>Ford</make>
+ <model>Scorpio</model>
+ <price>4800</price>
+ </car>
+ <car>
<make>Ferrari</make>
<model>Enzo</model>
<price>950000</price>
Modified: trunk/test-applications/jsp/src/main/webapp/Skinning/Skinning.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/Skinning/Skinning.jsp 2009-04-08 09:51:49 UTC (rev 13420)
+++ trunk/test-applications/jsp/src/main/webapp/Skinning/Skinning.jsp 2009-04-08 09:52:53 UTC (rev 13421)
@@ -6,15 +6,24 @@
<f:subview id="skinningSubviewID">
<rich:dataTable columns="4" value="">
<f:facet name="caption">
- <h:outputText value="Standard controls skinning feature provides styling for standard HTML elements so that they become highly compliant with RichFaces look and feel. Skinning can be applied to all page controls based on element name and type attribute (where applicable). Also this feature provides a set of CSS styles so that skinning can be applied by assigning rich-.. classes to particular elements or to container element that nests controls." />
- </f:facet>
+ <h:outputText
+ value="Standard controls skinning feature provides styling for standard HTML elements so that they become highly compliant with RichFaces look and feel. Skinning can be applied to all page controls based on element name and type attribute (where applicable). Also this feature provides a set of CSS styles so that skinning can be applied by assigning rich-.. classes to particular elements or to container element that nests controls." />
+ </f:facet>
<f:facet name="header">
<rich:columnGroup>
- <rich:column><h:outputText value="Name of Component" /></rich:column>
- <rich:column><h:outputText value="styleClass of Component" /></rich:column>
- <rich:column><h:outputText value="Component is enabled" /></rich:column>
- <rich:column><h:outputText value="Component is disabled" /></rich:column>
- </rich:columnGroup>
+ <rich:column>
+ <h:outputText value="Name of Component" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="styleClass of Component" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="Component is enabled" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="Component is disabled" />
+ </rich:column>
+ </rich:columnGroup>
</f:facet>
<f:facet name="footer">
<h:outputText value="" />
@@ -27,10 +36,12 @@
<h:outputText value="#{skinning.inputTextStyleClass}" />
</rich:column>
<rich:column>
- <h:inputText styleClass="#{skinning.inputTextStyleClass}" value="#{skinning.inputText}" />
+ <h:inputText styleClass="#{skinning.inputTextStyleClass}"
+ value="#{skinning.inputText}" />
</rich:column>
<rich:column>
- <h:inputText styleClass="#{skinning.inputTextStyleClass}" value="#{skinning.inputText}" disabled="true"/>
+ <h:inputText styleClass="#{skinning.inputTextStyleClass}"
+ value="#{skinning.inputText}" disabled="true" />
</rich:column>
</rich:columnGroup>
<rich:columnGroup>
@@ -41,10 +52,12 @@
<h:outputText value="#{skinning.inputSecretStyleClass}" />
</rich:column>
<rich:column>
- <h:inputSecret styleClass="#{skinning.inputSecretStyleClass}" value="#{skinning.inputSecret}" redisplay="true"/>
+ <h:inputSecret styleClass="#{skinning.inputSecretStyleClass}"
+ value="#{skinning.inputSecret}" redisplay="true" />
</rich:column>
<rich:column>
- <h:inputSecret styleClass="#{skinning.inputSecretStyleClass}" value="#{skinning.inputSecret}" disabled="true" redisplay="true"/>
+ <h:inputSecret styleClass="#{skinning.inputSecretStyleClass}"
+ value="#{skinning.inputSecret}" disabled="true" redisplay="true" />
</rich:column>
</rich:columnGroup>
<rich:columnGroup>
@@ -55,10 +68,10 @@
<h:outputText value="rich-input" />
</rich:column>
<rich:column>
- <input class="rich-input" value="input" ></input>
+ <input class="rich-input" value="input"></input>
</rich:column>
<rich:column>
- <input class="rich-input" value="input" disabled="true" ></input>
+ <input class="rich-input" value="input" disabled="true"></input>
</rich:column>
</rich:columnGroup>
<rich:columnGroup>
@@ -83,12 +96,20 @@
<h:outputText value="#{skinning.selectBooleanCheckboxStyleClass}" />
</rich:column>
<rich:column>
- <h:selectBooleanCheckbox styleClass="#{skinning.selectBooleanCheckboxStyleClass}" value="#{skinning.selectBooleanCheckbox1}" />
- <h:selectBooleanCheckbox styleClass="#{skinning.selectBooleanCheckboxStyleClass}" value="#{skinning.selectBooleanCheckbox2}" />
+ <h:selectBooleanCheckbox
+ styleClass="#{skinning.selectBooleanCheckboxStyleClass}"
+ value="#{skinning.selectBooleanCheckbox1}" />
+ <h:selectBooleanCheckbox
+ styleClass="#{skinning.selectBooleanCheckboxStyleClass}"
+ value="#{skinning.selectBooleanCheckbox2}" />
</rich:column>
<rich:column>
- <h:selectBooleanCheckbox styleClass="#{skinning.selectBooleanCheckboxStyleClass}" value="#{skinning.selectBooleanCheckbox1}" disabled="true"/>
- <h:selectBooleanCheckbox styleClass="#{skinning.selectBooleanCheckboxStyleClass}" value="#{skinning.selectBooleanCheckbox2}" disabled="true" />
+ <h:selectBooleanCheckbox
+ styleClass="#{skinning.selectBooleanCheckboxStyleClass}"
+ value="#{skinning.selectBooleanCheckbox1}" disabled="true" />
+ <h:selectBooleanCheckbox
+ styleClass="#{skinning.selectBooleanCheckboxStyleClass}"
+ value="#{skinning.selectBooleanCheckbox2}" disabled="true" />
</rich:column>
</rich:columnGroup>
<rich:columnGroup>
@@ -99,13 +120,14 @@
<h:outputText value="#{skinning.selectManyCheckbox}" />
</rich:column>
<rich:column>
- <h:selectManyCheckbox styleClass="#{skinning.selectManyCheckbox}" >
- <f:selectItems value="#{skinning.list}"/>
+ <h:selectManyCheckbox styleClass="#{skinning.selectManyCheckbox}">
+ <f:selectItems value="#{skinning.list}" />
</h:selectManyCheckbox>
</rich:column>
<rich:column>
- <h:selectManyCheckbox styleClass="#{skinning.selectManyCheckbox}" disabled="true">
- <f:selectItems value="#{skinning.list}"/>
+ <h:selectManyCheckbox styleClass="#{skinning.selectManyCheckbox}"
+ disabled="true">
+ <f:selectItems value="#{skinning.list}" />
</h:selectManyCheckbox>
</rich:column>
</rich:columnGroup>
@@ -117,13 +139,15 @@
<h:outputText value="#{skinning.selectManyListbox}" />
</rich:column>
<rich:column>
- <h:selectManyListbox styleClass="#{skinning.selectManyListbox}" style="height: 55px;" >
- <f:selectItems value="#{skinning.list}"/>
+ <h:selectManyListbox styleClass="#{skinning.selectManyListbox}"
+ style="height: 55px;">
+ <f:selectItems value="#{skinning.list}" />
</h:selectManyListbox>
</rich:column>
<rich:column>
- <h:selectManyListbox styleClass="#{skinning.selectManyListbox}" style="height: 55px;" disabled="true">
- <f:selectItems value="#{skinning.list}"/>
+ <h:selectManyListbox styleClass="#{skinning.selectManyListbox}"
+ style="height: 55px;" disabled="true">
+ <f:selectItems value="#{skinning.list}" />
</h:selectManyListbox>
</rich:column>
</rich:columnGroup>
@@ -135,13 +159,15 @@
<h:outputText value="#{skinning.selectManyMenu}" />
</rich:column>
<rich:column>
- <h:selectManyMenu styleClass="#{skinning.selectManyMenu}" style="height: 55px;" >
- <f:selectItems value="#{skinning.list}"/>
+ <h:selectManyMenu styleClass="#{skinning.selectManyMenu}"
+ style="height: 55px;">
+ <f:selectItems value="#{skinning.list}" />
</h:selectManyMenu>
</rich:column>
<rich:column>
- <h:selectManyMenu styleClass="#{skinning.selectManyMenu}" style="height: 55px;" disabled="true">
- <f:selectItems value="#{skinning.list}"/>
+ <h:selectManyMenu styleClass="#{skinning.selectManyMenu}"
+ style="height: 55px;" disabled="true">
+ <f:selectItems value="#{skinning.list}" />
</h:selectManyMenu>
</rich:column>
</rich:columnGroup>
@@ -153,13 +179,15 @@
<h:outputText value="#{skinning.selectOneListbox}" />
</rich:column>
<rich:column>
- <h:selectOneListbox styleClass="#{skinning.selectOneListbox}" style="height: 55px;" >
- <f:selectItems value="#{skinning.list}"/>
+ <h:selectOneListbox styleClass="#{skinning.selectOneListbox}"
+ style="height: 55px;">
+ <f:selectItems value="#{skinning.list}" />
</h:selectOneListbox>
</rich:column>
<rich:column>
- <h:selectOneListbox styleClass="#{skinning.selectOneListbox}" style="height: 55px;" disabled="true">
- <f:selectItems value="#{skinning.list}"/>
+ <h:selectOneListbox styleClass="#{skinning.selectOneListbox}"
+ style="height: 55px;" disabled="true">
+ <f:selectItems value="#{skinning.list}" />
</h:selectOneListbox>
</rich:column>
</rich:columnGroup>
@@ -171,13 +199,14 @@
<h:outputText value="#{skinning.selectOneMenu}" />
</rich:column>
<rich:column>
- <h:selectOneMenu styleClass="#{skinning.selectOneMenu}" >
- <f:selectItems value="#{skinning.list}"/>
+ <h:selectOneMenu styleClass="#{skinning.selectOneMenu}">
+ <f:selectItems value="#{skinning.list}" />
</h:selectOneMenu>
</rich:column>
<rich:column>
- <h:selectOneMenu styleClass="#{skinning.selectOneMenu}" disabled="true">
- <f:selectItems value="#{skinning.list}"/>
+ <h:selectOneMenu styleClass="#{skinning.selectOneMenu}"
+ disabled="true">
+ <f:selectItems value="#{skinning.list}" />
</h:selectOneMenu>
</rich:column>
</rich:columnGroup>
@@ -189,13 +218,14 @@
<h:outputText value="#{skinning.selectOneRadio}" />
</rich:column>
<rich:column>
- <h:selectOneRadio styleClass="#{skinning.selectOneRadio}" >
- <f:selectItems value="#{skinning.list}"/>
+ <h:selectOneRadio styleClass="#{skinning.selectOneRadio}">
+ <f:selectItems value="#{skinning.list}" />
</h:selectOneRadio>
</rich:column>
<rich:column>
- <h:selectOneRadio styleClass="#{skinning.selectOneRadio}" disabled="true">
- <f:selectItems value="#{skinning.list}"/>
+ <h:selectOneRadio styleClass="#{skinning.selectOneRadio}"
+ disabled="true">
+ <f:selectItems value="#{skinning.list}" />
</h:selectOneRadio>
</rich:column>
</rich:columnGroup>
@@ -207,10 +237,12 @@
<h:outputText value="#{skinning.commandButton}" />
</rich:column>
<rich:column>
- <h:commandButton styleClass="#{skinning.commandButton}" value="commandButton" />
+ <h:commandButton styleClass="#{skinning.commandButton}"
+ value="commandButton" />
</rich:column>
<rich:column>
- <h:commandButton styleClass="#{skinning.commandButton}" value="commandButton" disabled="true" />
+ <h:commandButton styleClass="#{skinning.commandButton}"
+ value="commandButton" disabled="true" />
</rich:column>
</rich:columnGroup>
<rich:columnGroup>
@@ -221,10 +253,10 @@
<h:outputText value="rich-button" />
</rich:column>
<rich:column>
- <button class="rich-button" >button</button>
+ <button class="rich-button">button</button>
</rich:column>
<rich:column>
- <button class="rich-button" disabled="true" >button</button>
+ <button class="rich-button" disabled="true">button</button>
</rich:column>
</rich:columnGroup>
<rich:columnGroup>
@@ -235,10 +267,12 @@
<h:outputText value="#{skinning.commandLink}" />
</rich:column>
<rich:column>
- <h:commandLink styleClass="#{skinning.commandLink}" value="commandLink" />
+ <h:commandLink styleClass="#{skinning.commandLink}"
+ value="commandLink" />
</rich:column>
<rich:column>
- <h:commandLink styleClass="#{skinning.commandLink}" value="commandLink" disabled="true" />
+ <h:commandLink styleClass="#{skinning.commandLink}"
+ value="commandLink" disabled="true" />
</rich:column>
</rich:columnGroup>
<rich:columnGroup>
@@ -249,10 +283,14 @@
<h:outputText value="#{skinning.outputLink}" />
</rich:column>
<rich:column>
- <h:outputLink styleClass="#{skinning.outputLink}"><h:outputText value="outputLink" /></h:outputLink>
+ <h:outputLink styleClass="#{skinning.outputLink}">
+ <h:outputText value="outputLink" />
+ </h:outputLink>
</rich:column>
<rich:column>
- <h:outputLink styleClass="#{skinning.outputLink}" disabled="true"><h:outputText value="outputLink" /></h:outputLink>
+ <h:outputLink styleClass="#{skinning.outputLink}" disabled="true">
+ <h:outputText value="outputLink" />
+ </h:outputLink>
</rich:column>
</rich:columnGroup>
<rich:columnGroup>
@@ -263,7 +301,8 @@
<h:outputText value="rich-link" />
</rich:column>
<rich:column>
- <a href="http://localhost:8081/jsp/pages/Rich/Rich.jsf" class="rich-link" >link</a>
+ <a href="http://localhost:8081/jsp/pages/Rich/Rich.jsf"
+ class="rich-link">link</a>
</rich:column>
<rich:column>
<h:outputText value="component has not disabled state" />
@@ -279,6 +318,9 @@
<rich:column>
<fieldset class="rich-fieldset">
<legend class="rich-legend">Student</legend>
+ <input type="checkbox"> The first </input> <br />
+ <input type="checkbox"> The second </input> <br />
+ <input type="checkbox"> The third </input>
</fieldset>
</rich:column>
<rich:column>
@@ -299,6 +341,7 @@
<h:outputText value="components have not disabled state" />
</rich:column>
</rich:columnGroup>
+ <%--
<rich:columnGroup>
<rich:column>
<h:outputText value="isindex" />
@@ -327,5 +370,6 @@
<keygen disabled="true" class="rich-keygen" />
</rich:column>
</rich:columnGroup>
+--%>
</rich:dataTable>
</f:subview>
\ No newline at end of file
15 years, 2 months
JBoss Rich Faces SVN: r13420 - in trunk/test-applications/seamApp/web/src/main: java/org/richfaces/helloworld/domain/rich and 8 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2009-04-08 05:51:49 -0400 (Wed, 08 Apr 2009)
New Revision: 13420
Added:
trunk/test-applications/seamApp/web/src/main/java/tTree/
trunk/test-applications/seamApp/web/src/main/java/tTree/PVisability.java
trunk/test-applications/seamApp/web/src/main/java/tTree/TTree.java
trunk/test-applications/seamApp/web/src/main/java/tTree/TTreeDND.java
trunk/test-applications/seamApp/web/src/main/java/tTree/TTreeNA.java
trunk/test-applications/seamApp/web/src/main/java/tTree/TTreeRNA.java
trunk/test-applications/seamApp/web/src/main/java/tTree/data/
trunk/test-applications/seamApp/web/src/main/java/tTree/data/Dir.java
trunk/test-applications/seamApp/web/src/main/java/tTree/data/Package.java
trunk/test-applications/seamApp/web/src/main/java/tTree/data/Project.java
trunk/test-applications/seamApp/web/src/main/resources/org/
trunk/test-applications/seamApp/web/src/main/resources/org/richfaces/
trunk/test-applications/seamApp/web/src/main/resources/org/richfaces/simpleTreeData.properties
trunk/test-applications/seamApp/web/src/main/resources/tTree/
trunk/test-applications/seamApp/web/src/main/resources/tTree/pom_sample.xml
trunk/test-applications/seamApp/web/src/main/resources/tTree/test.xml
trunk/test-applications/seamApp/web/src/main/webapp/Tree/TreeStraightforward.xhtml
Removed:
trunk/test-applications/seamApp/web/src/main/webapp/Tree/TreeDefault.xhtml
Modified:
trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/rich/RichBean.java
trunk/test-applications/seamApp/web/src/main/webapp/Skinning/Skinning.xhtml
trunk/test-applications/seamApp/web/src/main/webapp/Tree/Tree.xhtml
trunk/test-applications/seamApp/web/src/main/webapp/Tree/TreeProperty.xhtml
Log:
+ tree changes
Modified: trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/rich/RichBean.java
===================================================================
--- trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/rich/RichBean.java 2009-04-08 08:40:26 UTC (rev 13419)
+++ trunk/test-applications/seamApp/web/src/main/java/org/richfaces/helloworld/domain/rich/RichBean.java 2009-04-08 09:51:49 UTC (rev 13420)
@@ -56,7 +56,7 @@
map.add("TogglePanel", add("/TogglePanel/TogglePanel", new boolean [] {false, true, true}));
map.add("ToolBar", add("/ToolBar/ToolBar", new boolean [] {false, true, false}));
map.add("Tooltip", add("/Tooltip/Tooltip", new boolean [] {false, true, true}));
- map.add("Tree", add("/Tree/Tree", new boolean [] {false, true, false}));
+ map.add("Tree", add("/Tree/Tree", new boolean [] {true, true, true}));
map.add("VirtualEarth", add("/VirtualEarth/VirtualEarth", new boolean [] {false, true, false}));
map.add("ScrollableDataTable", add("/ScrollableDataTable/ScrollableDataTable", new boolean [] {false, true, false}));
map.add("jQuery", add("/jQuery/jQuery", new boolean [] {true, false, false}));
Added: trunk/test-applications/seamApp/web/src/main/java/tTree/PVisability.java
===================================================================
--- trunk/test-applications/seamApp/web/src/main/java/tTree/PVisability.java (rev 0)
+++ trunk/test-applications/seamApp/web/src/main/java/tTree/PVisability.java 2009-04-08 09:51:49 UTC (rev 13420)
@@ -0,0 +1,54 @@
+package tTree;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+
+@Name("pVisability")
+(a)Scope(ScopeType.SESSION)
+public class PVisability {
+ private boolean tTreeSubviewID;
+ private boolean tTreePropertySubviewID;
+ private boolean tTreeStraightforwardSubviewID;
+ private boolean tTreeDefaultSubviewID;
+
+ public PVisability() {
+ tTreeSubviewID = true;
+ tTreePropertySubviewID = false;
+ tTreeStraightforwardSubviewID = false;
+ tTreeDefaultSubviewID = false;
+ }
+
+ public boolean istTreeDefaultSubviewID() {
+ return tTreeDefaultSubviewID;
+ }
+
+ public void settTreeDefaultSubviewID(boolean treeDefaultSubviewID) {
+ tTreeDefaultSubviewID = treeDefaultSubviewID;
+ }
+
+ public boolean istTreeSubviewID() {
+ return tTreeSubviewID;
+ }
+
+ public void settTreeSubviewID(boolean treeSubviewID) {
+ tTreeSubviewID = treeSubviewID;
+ }
+
+ public boolean istTreePropertySubviewID() {
+ return tTreePropertySubviewID;
+ }
+
+ public void settTreePropertySubviewID(boolean treePropertySubviewID) {
+ tTreePropertySubviewID = treePropertySubviewID;
+ }
+
+ public boolean istTreeStraightforwardSubviewID() {
+ return tTreeStraightforwardSubviewID;
+ }
+
+ public void settTreeStraightforwardSubviewID(
+ boolean treeStraightforwardSubviewID) {
+ tTreeStraightforwardSubviewID = treeStraightforwardSubviewID;
+ }
+}
Added: trunk/test-applications/seamApp/web/src/main/java/tTree/TTree.java
===================================================================
--- trunk/test-applications/seamApp/web/src/main/java/tTree/TTree.java (rev 0)
+++ trunk/test-applications/seamApp/web/src/main/java/tTree/TTree.java 2009-04-08 09:51:49 UTC (rev 13420)
@@ -0,0 +1,202 @@
+package tTree;
+
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.richfaces.component.UITree;
+import org.richfaces.component.xml.XmlTreeDataBuilder;
+import org.richfaces.event.NodeExpandedEvent;
+import org.richfaces.event.NodeSelectedEvent;
+import org.richfaces.model.TreeNode;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+import org.richfaces.helloworld.domain.util.componentInfo.ComponentInfo;;
+
+@Name("tTree")
+(a)Scope(ScopeType.SESSION)
+public class TTree {
+ private String switchType = "server";
+ private TreeNode data;
+ private UITree tree;
+ private boolean immediate = false;
+ private boolean ajaxSubmitSelection = false;
+ private String anOpened = "null";
+ private String anSelected = "null";
+ private boolean rendered = true;
+ private boolean showConnectingLines = false;
+ private boolean toggleOnClick = false;
+ private boolean useCustomIcons = false;
+
+ private String reRenderCheck = "... waiting ...";
+
+ public TTree() {
+ try {
+ data = XmlTreeDataBuilder.build(new InputSource(getClass()
+ .getResourceAsStream("test.xml")));
+
+ TreeNode pomData = XmlTreeDataBuilder.build(new InputSource(
+ getClass().getResourceAsStream("pom_sample.xml")));
+
+ Iterator children = pomData.getChildren();
+ while (children.hasNext()) {
+ Map.Entry entry = (Map.Entry) children.next();
+ data.addChild(new Long(1), (TreeNode) entry.getValue());
+ }
+
+ } catch (SAXException e) {
+ e.printStackTrace();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void addCustomIcons() {
+ if (useCustomIcons) {
+ tree.setIcon("/pics/1.gif");
+ tree.setIconCollapsed("/pics/3.gif");
+ tree.setIconExpanded("/pics/4.gif");
+ tree.setIconLeaf("/pics/2.gif");
+ } else {
+ tree.setIcon(null);
+ tree.setIconCollapsed(null);
+ tree.setIconExpanded(null);
+ tree.setIconLeaf(null);
+ }
+ }
+
+ public void add() {
+ ComponentInfo info = ComponentInfo.getInstance();
+ info.addField(tree);
+ }
+
+ public void resetReRenderCheck() {
+ reRenderCheck = "... waiting ...";
+ }
+
+ public Boolean adviseNodeOpened(UITree t) {
+ Boolean tAnOpened = null;
+ if (anOpened.equals("FALSE"))
+ tAnOpened = Boolean.FALSE;
+ else if (anOpened.equals("TRUE"))
+ tAnOpened = Boolean.TRUE;
+
+ return tAnOpened;
+ }
+
+ public Boolean adviseNodeSelected(UITree t) {
+ Boolean tAnSelected = null;
+ if (anSelected.equals("FALSE"))
+ tAnSelected = Boolean.FALSE;
+ else if (anSelected.equals("TRUE"))
+ tAnSelected = Boolean.TRUE;
+
+ return tAnSelected;
+ }
+
+ public void changeExpandListener(NodeExpandedEvent e) {
+ reRenderCheck = "!!! I am WORKing !!!";
+ System.out.println("!!! changeExpandListener !!!");
+ }
+
+ public void nodeSelectListener(NodeSelectedEvent e) {
+ reRenderCheck = "!!! I am WORKing !!!";
+ System.out.println("!!! nodeSelectListener !!!");
+ }
+
+ public String getReRenderCheck() {
+ return reRenderCheck;
+ }
+
+ public boolean isImmediate() {
+ return immediate;
+ }
+
+ public void setImmediate(boolean immediate) {
+ this.immediate = immediate;
+ }
+
+ public boolean isAjaxSubmitSelection() {
+ return ajaxSubmitSelection;
+ }
+
+ public void setAjaxSubmitSelection(boolean ajaxSubmitSelection) {
+ this.ajaxSubmitSelection = ajaxSubmitSelection;
+ }
+
+ public String getSwitchType() {
+ return switchType;
+ }
+
+ public void setSwitchType(String switchType) {
+ this.switchType = switchType;
+ }
+
+ public TreeNode getData() {
+ return data;
+ }
+
+ public void setData(TreeNode data) {
+ this.data = data;
+ }
+
+ public UITree getTree() {
+ return tree;
+ }
+
+ public void setTree(UITree tree) {
+ this.tree = tree;
+ }
+
+ public String getAnOpened() {
+ return anOpened;
+ }
+
+ public void setAnOpened(String anOpened) {
+ this.anOpened = anOpened;
+ }
+
+ public String getAnSelected() {
+ return anSelected;
+ }
+
+ public void setAnSelected(String anSelected) {
+ this.anSelected = anSelected;
+ }
+
+ public boolean isRendered() {
+ return rendered;
+ }
+
+ public void setRendered(boolean rendered) {
+ this.rendered = rendered;
+ }
+
+ public boolean isShowConnectingLines() {
+ return showConnectingLines;
+ }
+
+ public void setShowConnectingLines(boolean showConnectingLines) {
+ this.showConnectingLines = showConnectingLines;
+ }
+
+ public boolean isToggleOnClick() {
+ return toggleOnClick;
+ }
+
+ public void setToggleOnClick(boolean toggleOnClick) {
+ this.toggleOnClick = toggleOnClick;
+ }
+
+ public boolean isUseCustomIcons() {
+ return useCustomIcons;
+ }
+
+ public void setUseCustomIcons(boolean useCustomIcons) {
+ this.useCustomIcons = useCustomIcons;
+ }
+}
\ No newline at end of file
Added: trunk/test-applications/seamApp/web/src/main/java/tTree/TTreeDND.java
===================================================================
--- trunk/test-applications/seamApp/web/src/main/java/tTree/TTreeDND.java (rev 0)
+++ trunk/test-applications/seamApp/web/src/main/java/tTree/TTreeDND.java 2009-04-08 09:51:49 UTC (rev 13420)
@@ -0,0 +1,254 @@
+package tTree;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+
+import javax.faces.FacesException;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.context.AjaxContext;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.richfaces.component.UITree;
+import org.richfaces.component.UITreeNode;
+import org.richfaces.event.DragEvent;
+import org.richfaces.event.DropEvent;
+import org.richfaces.event.NodeExpandedEvent;
+import org.richfaces.event.NodeSelectedEvent;
+import org.richfaces.model.TreeNode;
+import org.richfaces.model.TreeNodeImpl;
+import org.richfaces.model.TreeRowKey;
+
+@Name("tTreeDND")
+(a)Scope(ScopeType.SESSION)
+public class TTreeDND {
+ private static final String DATA_PATH = "org/richfaces/simpleTreeData.properties";
+
+ private TreeNode<String> treeNodeLeft;
+ private UITree leftTree;
+ private String leftSelectedNodeTitle;
+ private String rightSelectedNodeTitle;
+ private TreeNode<String> treeNodeRight;
+ private UITree rightTree;
+
+ private void addNodes(String path, TreeNode<String> node,
+ Properties properties) {
+ boolean end = false;
+ int counter = 1;
+ while (!end) {
+ String key = path != null ? path + '.' + counter : String
+ .valueOf(counter);
+ String value = properties.getProperty(key);
+ if (value != null) {
+ TreeNodeImpl<String> nodeImpl = new TreeNodeImpl<String>();
+ nodeImpl.setData(value);
+ node.addChild(new Integer(counter), nodeImpl);
+ addNodes(key, nodeImpl, properties);
+ counter++;
+ } else {
+ end = true;
+ }
+ }
+ }
+
+ private TreeNode<String> initPaneTree() {
+ TreeNode<String> rootNode = null;
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ ExternalContext externalContext = facesContext.getExternalContext();
+
+ InputStream dataStream = this.getClass().getClassLoader()
+ .getResourceAsStream(DATA_PATH);
+
+ try {
+ Properties properties = new Properties();
+ properties.load(dataStream);
+ rootNode = new TreeNodeImpl<String>();
+ addNodes(null, rootNode, properties);
+ } catch (IOException e) {
+
+ throw new FacesException(e.getMessage(), e);
+
+ } finally {
+ if (dataStream != null) {
+ try {
+ dataStream.close();
+ } catch (IOException e) {
+ externalContext.log(e.getMessage(), e);
+ }
+ }
+ }
+ return rootNode;
+ }
+
+ private Object getNewId(TreeNode parentNode) {
+ Map<Object, TreeNode> childs = new HashMap<Object, TreeNode>();
+ Iterator<Map.Entry<Object, TreeNode>> iter = parentNode.getChildren();
+ while (iter != null && iter.hasNext()) {
+ Map.Entry<Object, TreeNode> entry = iter.next();
+ childs.put(entry.getKey(), entry.getValue());
+ }
+
+ Integer index = 1;
+ while (childs.containsKey(index)) {
+ index++;
+ }
+ return index;
+ }
+
+ public void onDrop(DropEvent dropEvent) {
+ System.out.println("onDrop occured.");
+ System.out.println("DragValue: " + dropEvent.getDragValue());
+ System.out.println("DropValue: " + dropEvent.getDropValue());
+
+ // resolve drag source attributes
+ UITreeNode srcNode = (dropEvent.getDraggableSource() instanceof UITreeNode) ? (UITreeNode) dropEvent
+ .getDraggableSource()
+ : null;
+ UITree srcTree = srcNode != null ? srcNode.getUITree() : null;
+ TreeRowKey dragNodeKey = (dropEvent.getDragValue() instanceof TreeRowKey) ? (TreeRowKey) dropEvent
+ .getDragValue()
+ : null;
+
+ // resolve drag destination attributes
+ UITreeNode destNode = (dropEvent.getSource() instanceof UITreeNode) ? (UITreeNode) dropEvent
+ .getSource()
+ : null;
+ UITree destTree = destNode != null ? destNode.getUITree()
+ : (UITree) dropEvent.getComponent();
+ TreeRowKey dropNodeKey = (dropEvent.getDropValue() instanceof TreeRowKey) ? (TreeRowKey) dropEvent
+ .getDropValue()
+ : null;
+
+ FacesContext context = FacesContext.getCurrentInstance();
+
+ if (dropNodeKey != null) {
+ // add destination node for rerender
+ destTree.addRequestKey(dropNodeKey);
+
+ Object state = null;
+ TreeNode draggedNode = null;
+ if (dragNodeKey != null) { // Drag from this or other tree
+ draggedNode = srcTree.getModelTreeNode(dragNodeKey);
+
+ TreeNode parentNode = draggedNode.getParent();
+ // 1. remove node from tree
+ state = srcTree.removeNode(dragNodeKey);
+ // 2. add parent for rerender
+ Object rowKey = srcTree.getTreeNodeRowKey(parentNode);
+ srcTree.addRequestKey(rowKey);
+ } else if (dropEvent.getDragValue() != null) { // Drag from some
+ // drag source
+ draggedNode = new TreeNodeImpl<String>();
+ draggedNode.setData(dropEvent.getDragValue().toString());
+ }
+
+ // generate new node id
+ Object id = getNewId(destTree.getTreeNode(dropNodeKey));
+ destTree.addNode(dropNodeKey, draggedNode, id, state);
+ }
+
+ AjaxContext ac = AjaxContext.getCurrentInstance();
+ // Add destination tree to reRender
+ try {
+ ac.addComponentToAjaxRender(destTree);
+ } catch (Exception e) {
+ System.err.print(e.getMessage());
+ }
+
+ // Add source tree to reRender
+ try {
+ ac.addComponentToAjaxRender(srcTree);
+ } catch (Exception e) {
+ System.err.print(e.getMessage());
+ }
+
+ System.out.println("+++++");
+ }
+
+ public void onExpand(NodeExpandedEvent event) {
+ UITree tree = (UITree) event.getComponent();
+ System.out.println("Tree ('" + tree.getId() + "') node "
+ + (tree.isExpanded() ? "expanded" : "collapsed") + " "
+ + tree.getRowKey());
+ }
+
+ public void onDrag(DragEvent dragEvent) {
+ System.out.println("onDrag occured.");
+ System.out.println("DragValue: " + dragEvent.getDragValue());
+ System.out.println("DropValue: " + dragEvent.getDropValue());
+ }
+
+ public void processLSelection(NodeSelectedEvent event) {
+ UITree tree = (UITree) event.getComponent();
+ if (tree != null) {
+ leftSelectedNodeTitle = (String) tree.getRowData();
+ }
+ }
+
+ public void processRSelection(NodeSelectedEvent event) {
+ UITree tree = (UITree) event.getComponent();
+ if (tree != null) {
+ rightSelectedNodeTitle = (String) tree.getRowData();
+ }
+ }
+
+ public TreeNode<String> getTreeNodeLeft() {
+ if (treeNodeLeft == null) {
+ treeNodeLeft = initPaneTree();
+ }
+ return treeNodeLeft;
+ }
+
+ public void setTreeNodeLeft(TreeNode<String> treeNodeLeft) {
+ this.treeNodeLeft = treeNodeLeft;
+ }
+
+ public UITree getLeftTree() {
+ return leftTree;
+ }
+
+ public void setLeftTree(UITree leftTree) {
+ this.leftTree = leftTree;
+ }
+
+ public String getRightSelectedNodeTitle() {
+ return rightSelectedNodeTitle;
+ }
+
+ public void setRightSelectedNodeTitle(String rightSelectedNodeTitle) {
+ this.rightSelectedNodeTitle = rightSelectedNodeTitle;
+ }
+
+ public String getLeftSelectedNodeTitle() {
+ return leftSelectedNodeTitle;
+ }
+
+ public void setLeftSelectedNodeTitle(String leftSelectedNodeTitle) {
+ this.leftSelectedNodeTitle = leftSelectedNodeTitle;
+ }
+
+ public UITree getRightTree() {
+ return rightTree;
+ }
+
+ public void setRightTree(UITree rightTree) {
+ this.rightTree = rightTree;
+ }
+
+ public TreeNode<String> getTreeNodeRight() {
+ if (treeNodeRight == null) {
+ treeNodeRight = initPaneTree();
+ }
+ return treeNodeRight;
+ }
+
+ public void setTreeNodeRight(TreeNode<String> treeNodeRight) {
+ this.treeNodeRight = treeNodeRight;
+ }
+}
Added: trunk/test-applications/seamApp/web/src/main/java/tTree/TTreeNA.java
===================================================================
--- trunk/test-applications/seamApp/web/src/main/java/tTree/TTreeNA.java (rev 0)
+++ trunk/test-applications/seamApp/web/src/main/java/tTree/TTreeNA.java 2009-04-08 09:51:49 UTC (rev 13420)
@@ -0,0 +1,44 @@
+package tTree;
+
+import java.util.ArrayList;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+
+import tTree.data.Dir;
+import tTree.data.Package;
+import tTree.data.Project;
+
+@Name("tTreeNA")
+(a)Scope(ScopeType.SESSION)
+public class TTreeNA {
+ private ArrayList<Project> treeNA;
+
+ public TTreeNA() {
+ treeNA = new ArrayList<Project>();
+ ArrayList<Dir> dirsArr = new ArrayList<Dir>();
+ ArrayList<Package> packArr = new ArrayList<Package>();
+
+ treeNA.clear();
+ for (int i = 0; i < 3; i++) {
+ dirsArr.clear();
+ for (int j = 0; j < 4; j++) {
+ packArr.clear();
+ for (int k = 0; k < 5; k++) {
+ packArr.add(new Package("package #" + i + " " + j + " " + k));
+ }
+ dirsArr.add(new Dir("dir #" + i + " " + j, new ArrayList<Package>(packArr)));
+ }
+ treeNA.add(new Project("project #" + i, new ArrayList<Dir>(dirsArr)));
+ }
+ }
+
+ public ArrayList<Project> getTreeNA() {
+ return treeNA;
+ }
+
+ public void setTreeNA(ArrayList<Project> treeNA) {
+ this.treeNA = treeNA;
+ }
+}
Added: trunk/test-applications/seamApp/web/src/main/java/tTree/TTreeRNA.java
===================================================================
--- trunk/test-applications/seamApp/web/src/main/java/tTree/TTreeRNA.java (rev 0)
+++ trunk/test-applications/seamApp/web/src/main/java/tTree/TTreeRNA.java 2009-04-08 09:51:49 UTC (rev 13420)
@@ -0,0 +1,54 @@
+package tTree;
+
+import java.util.ArrayList;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+
+import tTree.data.Dir;
+import tTree.data.Package;
+
+@Name("tTreeRNA")
+(a)Scope(ScopeType.SESSION)
+public class TTreeRNA {
+ private ArrayList<Dir> treeRNAroots;
+
+ public TTreeRNA() {
+ treeRNAroots = new ArrayList<Dir>();
+ ArrayList<Dir> dirsArr = new ArrayList<Dir>();
+ ArrayList<Dir> subDirsArr = new ArrayList<Dir>();
+ ArrayList<Package> packArr = new ArrayList<Package>();
+ ArrayList<Package> subPackArr = new ArrayList<Package>();
+
+ treeRNAroots.clear();
+ dirsArr.clear();
+ for (int j = 0; j < 4; j++) {
+ packArr.clear();
+ subDirsArr.clear();
+ for (int k = 0; k < 5; k++) {
+ packArr.add(new Package("package #" + j + " " + k));
+ }
+ for (int f = 0; f < 4; f++) {
+ subPackArr.clear();
+ for (int l = 0; l < 5; l++) {
+ subPackArr.add(new Package("subPackage #" + j + " " + f
+ + " " + l));
+ }
+ subDirsArr.add(new Dir("subDir #" + j + " " + f,
+ new ArrayList<Package>(subPackArr)));
+ }
+ dirsArr.add(new Dir("dir #" + j, new ArrayList<Package>(packArr),
+ new ArrayList<Dir>(subDirsArr)));
+ }
+ treeRNAroots.add(new Dir("*** root ***", null, dirsArr));
+ }
+
+ public ArrayList<Dir> getTreeRNAroots() {
+ return treeRNAroots;
+ }
+
+ public void setTreeRNAroots(ArrayList<Dir> treeRNAroots) {
+ this.treeRNAroots = treeRNAroots;
+ }
+}
Added: trunk/test-applications/seamApp/web/src/main/java/tTree/data/Dir.java
===================================================================
--- trunk/test-applications/seamApp/web/src/main/java/tTree/data/Dir.java (rev 0)
+++ trunk/test-applications/seamApp/web/src/main/java/tTree/data/Dir.java 2009-04-08 09:51:49 UTC (rev 13420)
@@ -0,0 +1,44 @@
+package tTree.data;
+
+import java.util.ArrayList;
+
+public class Dir {
+ private String name;
+ private ArrayList<Package> packages;
+ private ArrayList<Dir> dirs;
+
+ public Dir(String name, ArrayList<Package> packages) {
+ this.name = name;
+ this.packages = packages;
+ }
+
+ public Dir(String name, ArrayList<Package> packages, ArrayList<Dir> dirs) {
+ this.name = name;
+ this.packages = packages;
+ this.dirs = dirs;
+ }
+
+ public ArrayList<Dir> getDirs() {
+ return dirs;
+ }
+
+ public void setDirs(ArrayList<Dir> dirs) {
+ this.dirs = dirs;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public ArrayList<Package> getPackages() {
+ return packages;
+ }
+
+ public void setPackages(ArrayList<Package> packages) {
+ this.packages = packages;
+ }
+}
Added: trunk/test-applications/seamApp/web/src/main/java/tTree/data/Package.java
===================================================================
--- trunk/test-applications/seamApp/web/src/main/java/tTree/data/Package.java (rev 0)
+++ trunk/test-applications/seamApp/web/src/main/java/tTree/data/Package.java 2009-04-08 09:51:49 UTC (rev 13420)
@@ -0,0 +1,17 @@
+package tTree.data;
+
+public class Package {
+ private String name;
+
+ public Package(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
Added: trunk/test-applications/seamApp/web/src/main/java/tTree/data/Project.java
===================================================================
--- trunk/test-applications/seamApp/web/src/main/java/tTree/data/Project.java (rev 0)
+++ trunk/test-applications/seamApp/web/src/main/java/tTree/data/Project.java 2009-04-08 09:51:49 UTC (rev 13420)
@@ -0,0 +1,29 @@
+package tTree.data;
+
+import java.util.ArrayList;
+
+public class Project {
+ private String name;
+ private ArrayList<Dir> srcDirs;
+
+ public Project(String name, ArrayList<Dir> srcDirs) {
+ this.name = name;
+ this.srcDirs = srcDirs;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public ArrayList<Dir> getSrcDirs() {
+ return srcDirs;
+ }
+
+ public void setSrcDirs(ArrayList<Dir> srcDirs) {
+ this.srcDirs = srcDirs;
+ }
+}
Added: trunk/test-applications/seamApp/web/src/main/resources/org/richfaces/simpleTreeData.properties
===================================================================
--- trunk/test-applications/seamApp/web/src/main/resources/org/richfaces/simpleTreeData.properties (rev 0)
+++ trunk/test-applications/seamApp/web/src/main/resources/org/richfaces/simpleTreeData.properties 2009-04-08 09:51:49 UTC (rev 13420)
@@ -0,0 +1,67 @@
+1=Daniel Defo
+1.1=Robinson Crusoe
+1.1.1=Start In Life
+1.1.2=Slavery And Escape
+1.1.3=Wrecked On A Desert Island
+1.1.4=First Weeks On The Island
+1.1.5=Builds A House - The Journal
+1.1.6=Ill And Conscience-Stricken
+1.1.7=Agricultural Experience
+1.1.8=Surveys His Position
+1.1.9=A Boat
+1.1.10=Tames Goats
+1.1.11=Finds Print Of Man's Foot On The Sand
+1.1.12=A Cave Retreat
+1.1.13=Wreck Of A Spanish Ship
+1.1.14=A Dream Realised
+1.1.15=Friday's Education
+1.1.16=Rescue Of Prisoners From Cannibals
+1.1.17=Visit Of Mutineers
+1.1.18=The Ship Recovered
+1.1.19=Return To England
+1.1.20=Fight Between Friday And A Bear
+2=Edgar Allan Poe
+2.1=Plays
+2.1.1=Politian
+2.2=Short stories
+2.2.1=The Assignation
+2.2.2=Berenice
+2.2.3=The Black Cat
+2.2.4=The Cask of Amontillado
+2.2.5=A Descent into the Maelstrom
+2.3=Poetry
+2.3.1=Alone
+2.3.2=An Enigma
+2.3.3=Annabel Lee
+2.3.4=Bridal Ballad
+3=Henry Wadsworth Longfellow
+3.1=The Song of Hiawatha
+3.1.1=Introduction
+3.1.2=I. The Peace-Pipe
+3.1.3=II. The Four Winds
+3.1.4=III. Hiawatha's Childhood
+3.1.5=IV. Hiawatha and Mudjekeewis
+3.1.6=V. Hiawatha's Fasting
+3.1.7=VI. Hiawatha's Friends
+3.1.8=VII. Hiawatha's Sailing
+3.1.9=VIII. Hiawatha's Fishing
+3.1.10=IX. Hiawatha and the Pearl-Feather
+3.1.11=X. Hiawatha's Wooing
+3.1.12=XI. Hiawatha's Wedding-Feast
+3.1.13=XII. The Son of the Evening Star
+3.1.14=XIII. Blessing the Cornfields
+3.1.15=XIV. Picture-Writing
+3.1.16=XV. Hiawatha's Lamentation
+3.1.17=XVI. Pau-Puk-Keewis
+3.1.18=XVII. The Hunting of Pau-Puk-Keewis
+3.1.19=XVIII. The Death of Kwasind
+3.1.20=XIX. The Ghosts
+3.1.21=XX. The Famine
+3.1.22=XXI. The White Man's Foot
+3.1.23=XXII. Hiawatha's Departure
+3.2=Poetry
+3.2.1=A Psalm Of Life
+3.2.2=Birds Of Passage
+3.2.3=Hiawatha's Childhood
+3.2.4=Hymn To The Night
+
Added: trunk/test-applications/seamApp/web/src/main/resources/tTree/pom_sample.xml
===================================================================
--- trunk/test-applications/seamApp/web/src/main/resources/tTree/pom_sample.xml (rev 0)
+++ trunk/test-applications/seamApp/web/src/main/resources/tTree/pom_sample.xml 2009-04-08 09:51:49 UTC (rev 13420)
@@ -0,0 +1,102 @@
+<?xml version="1.0"?>
+
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces</groupId>
+ <artifactId>tree</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.ajax4jsf.cdk</groupId>
+ <artifactId>maven-cdk-plugin</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <library>
+ <prefix>org.richfaces</prefix>
+ <taglib>
+ <shortName>tree</shortName>
+ </taglib>
+ </library>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <repositories>
+ <repository>
+ <releases />
+ <snapshots>
+ <enabled>false</enabled>
+ <updatePolicy>never</updatePolicy>
+ </snapshots>
+ <id>maven2-repository.dev.java.net</id>
+ <name>Java.net Repository for Maven</name>
+ <url>https://maven2-repository.dev.java.net/nonav/repository</url>
+ </repository>
+ <repository>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <updatePolicy>always</updatePolicy>
+ </snapshots>
+ <id>maven2-snapshots.ajax4jsf.org</id>
+ <name>Ajax4jsf Repository for Maven Snapshots</name>
+ <url>https://ajax4jsf.dev.java.net/nonav/snapshots</url>
+ </repository>
+ </repositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <updatePolicy>always</updatePolicy>
+ </snapshots>
+ <id>maven2-snapshots.ajax4jsf.org</id>
+ <name>Ajax4jsf Repository for Maven Snapshots</name>
+ <url>https://ajax4jsf.dev.java.net/nonav/snapshots</url>
+ </pluginRepository>
+ </pluginRepositories>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.facelets</groupId>
+ <artifactId>jsf-facelets</artifactId>
+ <version>1.1.6</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.4</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jsp-api</artifactId>
+ <version>2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>1.1_02</version>
+ </dependency>
+ <dependency>
+ <groupId>org.ajax4jsf</groupId>
+ <artifactId>framework</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Added: trunk/test-applications/seamApp/web/src/main/resources/tTree/test.xml
===================================================================
--- trunk/test-applications/seamApp/web/src/main/resources/tTree/test.xml (rev 0)
+++ trunk/test-applications/seamApp/web/src/main/resources/tTree/test.xml 2009-04-08 09:51:49 UTC (rev 13420)
@@ -0,0 +1,74 @@
+<?xml version="1.0"?>
+<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+ <description>RF Test-Application</description>
+ <display-name>test-application</display-name>
+ <context-param>
+ <param-name>org.ajax4jsf.SKIN</param-name>
+ <param-value>#{skinBean.skin}</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+ <param-value>.xhtml</param-value>
+ </context-param>
+ <context-param>
+ <param-name>facelets.REFRESH_PERIOD</param-name>
+ <param-value>2</param-value>
+ </context-param>
+ <context-param>
+ <param-name>facelets.DEVELOPMENT</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>client</param-value>
+ </context-param>
+ <context-param>
+ <param-name>com.sun.faces.validateXml</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>com.sun.faces.verifyObjects</param-name>
+ <param-value>true</param-value>
+ </context-param>
+ <context-param>
+ <param-name>javax.faces.CONFIG_FILES</param-name>
+ <param-value>/WEB-INF/faces-config-RichPanelsBean.xml,/WEB-INF/faces-config-DataTable.xml,/WEB-INF/faces-config-SimpleTogglePanel.xml,
+ /WEB-INF/faces-config-Panel.xml,/WEB-INF/faces-config-PanelBar.xml,/WEB-INF/faces-config-TabPanel.xml,
+ /WEB-INF/faces-config-TogglePanel.xml,/WEB-INF/faces-config-Paint2D.xml,/WEB-INF/faces-config-InputNumberSlider.xml,
+ /WEB-INF/faces-config-InputNumberSpinner.xml,/WEB-INF/faces-config-DDMenu.xml,/WEB-INF/faces-config-Tree.xml,
+ /WEB-INF/faces-config-PanelMenu.xml,/WEB-INF/faces-config-Icon.xml,/WEB-INF/faces-config-ModalPanel.xml,
+ /WEB-INF/faces-config-tooltip.xml,/WEB-INF/faces-config-Skin.xml,/WEB-INF/faces-config-Calendar.xml,
+ /WEB-INF/faces-config-Gmap.xml,/WEB-INF/faces-config-DataFilterSlider.xml,/WEB-INF/faces-config-Separator.xml,
+ /WEB-INF/faces-config-Spacer.xml,/WEB-INF/faces-config-ToolBar.xml,/WEB-INF/faces-config-DataScroller.xml,
+ /WEB-INF/faces-config-SuggestionBox.xml,/WEB-INF/faces-config-Message.xml,
+ /WEB-INF/faces-config-VirtualEarth.xml,/WEB-INF/faces-config-Effect.xml,/WEB-INF/faces-config-Insert.xml,
+ /WEB-INF/faces-config-RichBean.xml,/WEB-INF/faces-config-ScrollableDataTable.xml,
+ /WEB-INF/faces-config-RichTest.xml,/WEB-INF/faces-config-jQuery.xml,/WEB-INF/faces-config-DragAndDrop.xml,
+ /WEB-INF/faces-config-OrderingList.xml,/WEB-INF/faces-config-DataOrderedList.xml,/WEB-INF/faces-config-DataDefinitionList.xml</param-value>
+ </context-param>
+ <filter>
+ <display-name>Ajax4jsf Filter</display-name>
+ <filter-name>ajax4jsf</filter-name>
+ <filter-class>org.ajax4jsf.Filter</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>ajax4jsf</filter-name>
+ <servlet-name>Faces Servlet</servlet-name>
+ <dispatcher>FORWARD</dispatcher>
+ <dispatcher>REQUEST</dispatcher>
+ <dispatcher>INCLUDE</dispatcher>
+ </filter-mapping>
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+ <login-config>
+ <auth-method>BASIC</auth-method>
+ </login-config>
+</web-app>
Modified: trunk/test-applications/seamApp/web/src/main/webapp/Skinning/Skinning.xhtml
===================================================================
--- trunk/test-applications/seamApp/web/src/main/webapp/Skinning/Skinning.xhtml 2009-04-08 08:40:26 UTC (rev 13419)
+++ trunk/test-applications/seamApp/web/src/main/webapp/Skinning/Skinning.xhtml 2009-04-08 09:51:49 UTC (rev 13420)
@@ -274,6 +274,9 @@
<rich:column>
<fieldset class="rich-fieldset">
<legend class="rich-legend">Student</legend>
+ <input type="checkbox"> The first </input> <br />
+ <input type="checkbox"> The second </input> <br />
+ <input type="checkbox"> The third </input>
</fieldset>
</rich:column>
<rich:column>
@@ -294,6 +297,7 @@
<h:outputText value="components have not disabled state" />
</rich:column>
</rich:columnGroup>
+<!--
<rich:columnGroup>
<rich:column>
<h:outputText value="isindex" />
@@ -322,5 +326,6 @@
<keygen disabled="true" class="rich-keygen" />
</rich:column>
</rich:columnGroup>
+ -->
</rich:dataTable>
</f:subview>
\ No newline at end of file
Modified: trunk/test-applications/seamApp/web/src/main/webapp/Tree/Tree.xhtml
===================================================================
--- trunk/test-applications/seamApp/web/src/main/webapp/Tree/Tree.xhtml 2009-04-08 08:40:26 UTC (rev 13419)
+++ trunk/test-applications/seamApp/web/src/main/webapp/Tree/Tree.xhtml 2009-04-08 09:51:49 UTC (rev 13420)
@@ -1,194 +1,133 @@
+<f:subview xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich" id="tTreeSubviewID">
-<f:subview xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:a4j="http://richfaces.org/a4j" xmlns:h="http://java.sun.com/jsf/html" xmlns:rich="http://richfaces.org/rich" id="treeSubviewID">
-<style type="text/css">
-.LeftTreePane {
-
-}
+ <h:panelGrid columns="2" border="1">
+ <f:facet name="header">
+ <h:outputText value="Select tree to show: " />
+ </f:facet>
+ <h:outputText value="default Tree: " />
+ <h:selectBooleanCheckbox value="#{pVisability.tTreeSubviewID}">
+ <a4j:support event="onchange" reRender="dTreePanelID"></a4j:support>
+ </h:selectBooleanCheckbox>
+ <h:outputText value="Tree with treeNodesAdaptor: " />
+ <h:selectBooleanCheckbox value="#{pVisability.tTreePropertySubviewID}">
+ <a4j:support event="onchange" reRender="tTreeNAPanelID"></a4j:support>
+ </h:selectBooleanCheckbox>
+ <h:outputText value="Tree with recursiveTreeNodesAdaptor: " />
+ <h:selectBooleanCheckbox
+ value="#{pVisability.tTreeStraightforwardSubviewID}">
+ <a4j:support event="onchange" reRender="tTreeRNAPanelID"></a4j:support>
+ </h:selectBooleanCheckbox>
+ <h:outputText value="Tree with Drag and Drop functionality: " />
+ <h:selectBooleanCheckbox value="#{pVisability.tTreeDefaultSubviewID}">
+ <a4j:support event="onchange" reRender="tTreeDNDPanelID"></a4j:support>
+ </h:selectBooleanCheckbox>
+ </h:panelGrid>
+ <rich:spacer height="10" />
-.RightTreePane {
-
-}
+ <a4j:outputPanel id="dTreePanelID">
+ <h:panelGrid columns="1" rendered="#{pVisability.tTreeSubviewID}">
+ <h:outputText value="default Tree" style="color: red" />
+ <rich:tree id="dTree" switchType="#{tTree.switchType}"
+ value="#{tTree.data}" var="defTree" binding="#{tTree.tree}"
+ ajaxSubmitSelection="#{tTree.ajaxSubmitSelection}"
+ immediate="#{tTree.immediate}" rendered="#{tTree.rendered}"
+ reRender="reRenderID" ignoreDupResponses="true"
+ nodeFace="#{defTree.name != 'param-value' ? 'text' : 'input'}"
+ showConnectingLines="#{tTree.showConnectingLines}" focus="focusID"
+ nodeSelectListener="#{tTree.nodeSelectListener}"
+ toggleOnClick="#{tTree.toggleOnClick}"
+ changeExpandListener="#{tTree.changeExpandListener}"
+ adviseNodeOpened="#{tTree.adviseNodeOpened}"
+ adviseNodeSelected="#{tTree.adviseNodeSelected}"
+ onbeforedomupdate="#{event.onbeforedomupdate}"
+ onclick="#{event.onclick}" oncollapse="#{event.oncollapse}"
+ oncomplete="#{event.oncomplete}" ondblclick="#{event.ondblclick}"
+ ondragend="#{event.ondragend}" ondragenter="#{event.ondragenter}"
+ ondragexit="#{event.ondragexit}" ondragstart="#{event.ondragstart}"
+ ondrop="#{event.ondrop}" ondropend="#{event.ondropend}"
+ ondropout="#{event.ondropout}" ondropover="#{event.ondropover}"
+ onexpand="#{event.onexpand}" onkeydown="#{event.onkeydown}"
+ onkeypress="#{event.onkeypress}" onkeyup="#{event.onkeyup}"
+ onmousedown="#{event.onmousedown}"
+ onmousemove="#{event.onmousemove}" onmouseout="#{event.onmouseout}"
+ onmouseover="#{event.onmouseover}" onmouseup="#{event.onmouseup}"
+ onselected="#{event.onselected}">
-.TreeContainer {
- overflow: auto;
- height: 400px;
- border: 3px inset gray;
-}
-</style>
-<script type="text/javascript">
- // <![CDATA[
- function blinkElement(elt) {
- while (elt.tagName.toLowerCase() != 'table') {
- elt = elt.parentNode;
- }
-
- elt.style.borderColor= '#5555FF';
- elt.style.borderStyle= 'dotted';
- elt.style.borderWidth = '3px';
- setTimeout( function() { this.style.borderStyle = 'none'; }.bind(elt), 300);
- }
- // ]]>
- </script>
- <a4j:outputPanel ajaxRendered="true">
- <h:messages />
- </a4j:outputPanel>
+ <rich:treeNode type="input">
+ <h:outputText value="#{defTree} : " />
+ <h:inputText value="#{defTree.name}" />
+ </rich:treeNode>
- <rich:tree id="tree" switchType="#{treeBean.switchType}" value="#{treeBean.data}" var="data" selectedClass="#{style.selectedClass}" styleClass="#{style.styleClass}" style="#{style.style}" highlightedClass="#{style.highlightedClass}"
- nodeFace="#{data.name != 'param-value' ? 'input' : 'text'}" changeExpandListener="#{treeBean.onExpand}"
- nodeSelectListener="#{treeBean.onSelect}" binding="#{treeBean.tree}" onselected="window.status='selectedNode: '+event.selectedNode;"
- onexpand="window.status='expandedNode: '+event.expandedNode" oncollapse="window.status='collapsedNode: '+ event.collapsedNode"
- ajaxSubmitSelection="true" reRender="outputText, selectOneListbox" preserveModel="none" dragIndicator="treeIndicator"
- immediate="false" acceptedTypes="file1" dragType="#{treeBean.dragOn ? 'file1' : ''}" iconCollapsed="#{treeBean.iconCollapsed}"
- iconExpanded="#{treeBean.iconExpanded}" iconLeaf="#{treeBean.iconLeaf}" icon="#{treeBean.icon}" dropListener="#{treeBean.processDrop}"
- onclick="#{event.onclick}" ondblclick="#{event.ondblclick}" ondragend="#{event.ondragend}" ondragenter="#{event.ondragenter}" ondragexit="#{event.ondragexit}" ondragstart="#{event.ondragstart}" ondrop="#{event.ondrop}" ondropend="#{event.ondropend}" onkeydown="#{event.onkeydown}" onkeypress="#{event.onkeypress}" onkeyup="#{event.onkeyup}" onmousedown="#{event.onmousedown}" onmousemove="#{event.onmousemove}" onmouseout="#{event.onmouseout}" onmouseover="#{event.onmouseover}" onmouseup="#{event.onmouseup}" onbeforedomupdate="#{event.onbeforedomupdate}" oncomplete="#{event.oncomplete}" ondropout="#{event.ondropout}" ondropover="#{event.ondropover}">
+ <rich:treeNode type="text">
+ <h:outputText value="#{defTree}" />
+ </rich:treeNode>
+ </rich:tree>
+ <hr />
+ <h:commandButton id="focusID" action="#{tTree.add}" value="add test" />
+ <h:panelGrid columns="2">
+ <f:facet name="header">
+ <h:outputText value="Tree Properties" />
+ </f:facet>
- <f:facet name="icon">
- <h:outputText value="icon" rendered="#{treeBean.renderFacets}" />
- </f:facet>
- <f:facet name="iconLeaf">
- <h:outputText value="leaf" rendered="#{treeBean.renderFacets}" />
- </f:facet>
- <f:facet name="iconExpanded">
- <h:outputText value="expanded" rendered="#{treeBean.renderFacets}" />
- </f:facet>
- <f:facet name="iconCollapsed">
- <h:outputText value="collapsed" rendered="#{treeBean.renderFacets}" />
- </f:facet>
+ <h:outputText value="reRender:" />
+ <h:panelGroup>
+ <a4j:commandButton value="reset"
+ action="#{tTree.resetReRenderCheck}" reRender="reRenderID"></a4j:commandButton>
+ <h:outputText id="reRenderID" value="#{tTree.reRenderCheck}" />
+ </h:panelGroup>
- <rich:dndParam name="treeParam" value="Tree Parameter" />
- <rich:dndParam name="accept" value="accept" />
+ <h:outputText value="Change tree switchType:" />
+ <h:selectOneRadio value="#{tTree.switchType}" onclick="submit();">
+ <f:selectItem itemLabel="client" itemValue="client" />
+ <f:selectItem itemLabel="server" itemValue="server" />
+ <f:selectItem itemLabel="ajax" itemValue="ajax" />
+ </h:selectOneRadio>
- <rich:treeNode type="input" dropListener="#{treeBean.processDrop}"
- oncollapse="Element.removeClassName(event['treeItem'].getElement(), 'colored')"
- onexpand="Element.addClassName(event['treeItem'].getElement(), 'colored')"
- onbeforedomupdate="#{event.onbeforedomupdate}" onclick="#{event.onclick}" oncomplete="#{event.oncomplete}" oncontextmenu="#{event.oncontextmenu}" ondblclick="#{event.ondblclick}" ondragend="#{event.ondragend}" ondragenter="#{event.ondragenter}" ondragexit="#{event.ondragexit}" ondragstart="#{event.ondragstart}" ondrop="#{event.ondrop}" ondropend="#{event.ondropend}" ondropout="#{event.ondropout}" ondropover="#{event.ondropover}" onkeydown="#{event.onkeydown}" onkeypress="#{event.onkeypress}" onkeyup="#{event.onkeyup}" onmousedown="#{event.onmousedown}" onmousemove="#{event.onmousemove}" onmouseout="#{event.onmouseout}" onmouseover="#{event.onmouseover}" onmouseup="#{event.onmouseup}" onselected="#{event.onselected}">
- <h:outputText value="#{data} : " />
- <h:inputText value="#{data.name}" required="true" styleClass="inputs">
- </h:inputText>
+ <h:outputText value="rendered:" />
+ <h:selectBooleanCheckbox value="#{tTree.rendered}"
+ onchange="submit();" />
- <rich:dndParam name="nodeParam" value="Node Parameter" />
+ <h:outputText value="showConnectingLines:" />
+ <h:selectBooleanCheckbox value="#{tTree.showConnectingLines}"
+ onchange="submit();" />
- </rich:treeNode>
- <rich:treeNode type="text" nodeClass="customNode" acceptedTypes="file2" onselected="return false;">
- <h:outputText value="#{data}" />
- </rich:treeNode>
- </rich:tree>
+ <h:outputText value="toggleOnClick:" />
+ <h:selectBooleanCheckbox value="#{tTree.toggleOnClick}"
+ onchange="submit();" />
- <f:verbatim>
- <br />
- </f:verbatim>
+ <h:outputText value="ajaxSubmitSelection:" />
+ <h:selectBooleanCheckbox value="#{tTree.ajaxSubmitSelection}"
+ onchange="submit();" />
- <h:outputText value="Enter path to expand:" />
- <h:inputText value="#{treeBean.pathToExpand}">
- <a4j:support event="onchange" reRender="tree" action="#{treeBean.expandNode}" />
- </h:inputText>
+ <h:outputText value="immediate:" />
+ <h:selectBooleanCheckbox value="#{tTree.immediate}"
+ onchange="submit();" />
- <rich:separator></rich:separator>
+ <h:outputText value="use custom icons:" />
+ <h:selectBooleanCheckbox value="#{tTree.useCustomIcons}">
+ <a4j:support action="#{tTree.addCustomIcons}" event="onchange"
+ reRender="dTreePanelID"></a4j:support>
+ </h:selectBooleanCheckbox>
- <h:panelGrid columns="2">
- <h:outputText value="Change tree switchType:" />
- <h:selectOneRadio value="#{treeBean.switchType}" onclick="submit()">
- <f:selectItem itemLabel="client" itemValue="client" />
- <f:selectItem itemLabel="server" itemValue="server" />
- <f:selectItem itemLabel="ajax" itemValue="ajax" />
- </h:selectOneRadio>
+ <h:outputText value="adviseNodeOpened:" />
+ <h:selectOneRadio value="#{tTree.anOpened}" onclick="submit();">
+ <f:selectItem itemLabel="null (default)" itemValue="null" />
+ <f:selectItem itemLabel="false (do not open)" itemValue="FALSE" />
+ <f:selectItem itemLabel="true (open)" itemValue="TRUE" />
+ </h:selectOneRadio>
- <h:outputText value="Drag switch:" />
- <h:selectBooleanCheckbox value="#{treeBean.dragOn}" onchange="submit();"></h:selectBooleanCheckbox>
-
- <h:outputText value="Render facets:" />
- <h:selectBooleanCheckbox value="#{treeBean.renderFacets}" onchange="submit();"></h:selectBooleanCheckbox>
-
- <h:commandButton value="#{treeBean.commandButtonCaption}" actionListener="#{treeBean.changeIcons}" />
+ <h:outputText value="adviseNodeSelected:" />
+ <h:selectOneRadio value="#{tTree.anSelected}" onclick="submit();">
+ <f:selectItem itemLabel="null (default)" itemValue="null" />
+ <f:selectItem itemLabel="false (do not select)" itemValue="FALSE" />
+ <f:selectItem itemLabel="true (select)" itemValue="TRUE" />
+ </h:selectOneRadio>
+ </h:panelGrid>
+ <rich:separator height="10" />
</h:panelGrid>
-
- <f:verbatim>
- <br />
- <br />
- </f:verbatim>
-
- <rich:tree id="testTree" var="_data" switchType="ajax" ajaxSubmitSelection="true" preserveModel="none" value="#{treeBean.data1}"
- nodeSelectListener="#{treeBean.onSelectInc}" nodeFace="node">
- <rich:treeNode type="node">
- <h:outputText value="#{_data}" />
- </rich:treeNode>
- </rich:tree>
- <rich:separator></rich:separator>
- <h:outputText value="Tree without treeNode:"></h:outputText>
- <rich:separator></rich:separator>
-
- <rich:tree switchType="client" style="width:300px" value="#{pathwayBean.pathwayTree}" var="item" nodeFace="#{item.type}">
- <rich:treeNode type="library">
- <h:outputText value="#{item.type}" />
- </rich:treeNode>
- <rich:treeNode type="pathway">
- <h:outputText value="#{item.name}" />
- </rich:treeNode>
- <rich:treeNode type="organism">
- <h:outputText value="#{item.name}" />
- </rich:treeNode>
- </rich:tree>
-
- <rich:spacer></rich:spacer>
- <!-- Drag and Drop API for rich:tree component -->
- <div style="FONT-WEIGHT: bold;">Drag and Drop example</div>
- <br />
-
- <rich:dragIndicator id="treeIndicator">
- <f:facet name="single">
- <f:verbatim>{marker} {nodeParam}({treeParam})</f:verbatim>
- </f:facet>
- </rich:dragIndicator>
-
- <h:panelGrid columns="2" columnClasses="LeftTreePane,RightTreePane">
-
- <h:panelGroup id="leftContainer" layout="block"
- styleClass="TreeContainer">
- <h:outputText escape="false"
- value="Selected Node: #{treeDndBean.leftSelectedNodeTitle}"
- id="selectedNodeL" />
-
- <rich:tree id="leftTree" style="width:300px"
- nodeSelectListener="#{treeDndBean.processLSelection}"
- reRender="selectedNodeL" ajaxSubmitSelection="true"
- switchType="client" value="#{treeDndBean.treeNodeLeft}"
- changeExpandListener="#{treeDndBean.onExpand}"
- binding="#{treeDndBean.leftTree}"
- onselected="window.status='selectedNode: '+event.selectedNode;"
- onexpand="window.status='expandedNode: '+event.expandedNode"
- oncollapse="window.status='collapsedNode: '+event.collapsedNode"
- dropListener="#{treeDndBean.onDrop}"
- dragListener="#{treeDndBean.onDrag}" dragIndicator="treeIndicator"
- acceptedTypes="treeNode" dragType="treeNode" rowKeyVar="key"
- var="item" >
-
- <rich:dndParam name="treeParam" value="leftTree" />
- </rich:tree>
-
- </h:panelGroup>
-
- <h:panelGroup id="rightContainer" layout="block"
- styleClass="TreeContainer">
- <h:outputText escape="false"
- value="Selected Node: #{treeDndBean.rightSelectedNodeTitle}"
- id="selectedNodeR" />
-
- <rich:tree id="rightTree" style="width:300px"
- nodeSelectListener="#{treeDndBean.processRSelection}"
- reRender="selectedNodeR,rightContainer" ajaxSubmitSelection="true"
- switchType="client" value="#{treeDndBean.treeNodeRight}"
- changeExpandListener="#{treeDndBean.onExpand}"
- binding="#{treeDndBean.rightTree}"
- onselected="window.status='selectedNode: '+event.selectedNode;"
- onexpand="window.status='expandedNode: '+event.expandedNode"
- oncollapse="window.status='collapsedNode: '+event.collapsedNode"
- rowKeyVar="key" dropListener="#{treeDndBean.onDrop}"
- dragListener="#{treeDndBean.onDrag}" dragIndicator="treeIndicator"
- acceptedTypes="treeNode" dragType="treeNode" var="item">
- <rich:dndParam name="treeParam" value="rightTree" />
- </rich:tree>
- </h:panelGroup>
-
- </h:panelGrid>
-
+ </a4j:outputPanel>
</f:subview>
Deleted: trunk/test-applications/seamApp/web/src/main/webapp/Tree/TreeDefault.xhtml
===================================================================
Modified: trunk/test-applications/seamApp/web/src/main/webapp/Tree/TreeProperty.xhtml
===================================================================
--- trunk/test-applications/seamApp/web/src/main/webapp/Tree/TreeProperty.xhtml 2009-04-08 08:40:26 UTC (rev 13419)
+++ trunk/test-applications/seamApp/web/src/main/webapp/Tree/TreeProperty.xhtml 2009-04-08 09:51:49 UTC (rev 13420)
@@ -1,20 +1,30 @@
-
<f:subview xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:h="http://java.sun.com/jsf/html"
- xmlns:rich="http://richfaces.org/rich" id="treePropertySubviewID">
- <br />
- <h:commandButton action="#{treeBean.add}" value="add test" />
- <br />
- <div style="FONT-WEIGHT: bold;">rich:findComponent</div>
- <h:panelGrid columns="2">
- <rich:column>
- <a4j:commandLink value="getAdviseNodeSelected" reRender="findID"></a4j:commandLink>
- </rich:column>
- <rich:column id="findID">
- <h:outputText
- value="#{rich:findComponent('tree').adviseNodeSelected}" />
- </rich:column>
- </h:panelGrid>
+ xmlns:rich="http://richfaces.org/rich" id="tTreePropertySubviewID">
+
+ <a4j:outputPanel id="tTreeNAPanelID">
+ <h:panelGrid columns="1"
+ rendered="#{pVisability.tTreePropertySubviewID}">
+ <h:outputText value="Tree with treeNodesAdaptor" style="color: red" />
+ <rich:tree>
+ <rich:treeNodesAdaptor nodes="#{tTreeNA.treeNA}" var="project">
+ <rich:treeNode>
+ <h:outputText value="#{project.name}" />
+ </rich:treeNode>
+ <rich:treeNodesAdaptor nodes="#{project.srcDirs}" var="dir">
+ <rich:treeNode>
+ <h:outputText value="#{dir.name}" />
+ </rich:treeNode>
+ <rich:treeNodesAdaptor nodes="#{dir.packages}" var="package">
+ <rich:treeNode>
+ <h:outputText value="#{package.name}" />
+ </rich:treeNode>
+ </rich:treeNodesAdaptor>
+ </rich:treeNodesAdaptor>
+ </rich:treeNodesAdaptor>
+ </rich:tree>
+ </h:panelGrid>
+ </a4j:outputPanel>
</f:subview>
\ No newline at end of file
Copied: trunk/test-applications/seamApp/web/src/main/webapp/Tree/TreeStraightforward.xhtml (from rev 13382, trunk/test-applications/seamApp/web/src/main/webapp/Tree/TreeDefault.xhtml)
===================================================================
--- trunk/test-applications/seamApp/web/src/main/webapp/Tree/TreeStraightforward.xhtml (rev 0)
+++ trunk/test-applications/seamApp/web/src/main/webapp/Tree/TreeStraightforward.xhtml 2009-04-08 09:51:49 UTC (rev 13420)
@@ -0,0 +1,117 @@
+<f:subview xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:rich="http://richfaces.org/rich"
+ id="tTreeStraightforwardSubviewID">
+
+ <style type="text/css">
+.LeftTreePane {
+
+}
+
+.RightTreePane {
+
+}
+
+.TreeContainer {
+ overflow: auto;
+ height: 400px;
+ border: 3px inset gray;
+}
+</style>
+
+ <a4j:outputPanel id="tTreeRNAPanelID">
+ <h:panelGrid columns="1"
+ rendered="#{pVisability.tTreeStraightforwardSubviewID}">
+ <h:outputText value="Tree with recursiveTreeNodesAdaptor"
+ style="color: red" />
+ <rich:tree>
+ <rich:treeNodesAdaptor nodes="#{tTreeRNA.treeRNAroots}" var="root">
+ <rich:treeNode>
+ <h:outputText value="#{root.name}" />
+ </rich:treeNode>
+ <rich:recursiveTreeNodesAdaptor var="dir" roots="#{root.dirs}"
+ nodes="#{dir.dirs}">
+ <rich:treeNodesAdaptor nodes="#{dir.packages}" var="package">
+ <rich:treeNode>
+ <h:outputText value="#{package.name}" />
+ </rich:treeNode>
+ </rich:treeNodesAdaptor>
+ <rich:treeNode>
+ <h:outputText value="#{dir.name}" />
+ </rich:treeNode>
+ </rich:recursiveTreeNodesAdaptor>
+ </rich:treeNodesAdaptor>
+ </rich:tree>
+ <rich:separator height="10" />
+ </h:panelGrid>
+ </a4j:outputPanel>
+
+ <a4j:outputPanel id="tTreeDNDPanelID">
+ <h:panelGrid columns="1"
+ rendered="#{pVisability.tTreeDefaultSubviewID}">
+ <h:outputText value="Tree with Drag and Drop functionality"
+ style="color: red" />
+
+ <rich:dragIndicator id="treeIndicator">
+ <f:facet name="single">
+ <f:verbatim>{marker} {nodeParam}({treeParam})</f:verbatim>
+ </f:facet>
+ </rich:dragIndicator>
+
+ <h:panelGrid columns="2" columnClasses="LeftTreePane,RightTreePane">
+
+ <h:panelGroup id="leftContainer" layout="block"
+ styleClass="TreeContainer">
+ <h:outputText escape="false"
+ value="Selected Node:
+ #{tTreeDND.leftSelectedNodeTitle}"
+ id="selectedNodeL" />
+
+ <rich:tree id="leftTree" style="width:300px"
+ nodeSelectListener="#{tTreeDND.processLSelection}"
+ reRender="selectedNodeL" ajaxSubmitSelection="true"
+ switchType="client" value="#{tTreeDND.treeNodeLeft}"
+ changeExpandListener="#{tTreeDND.onExpand}"
+ binding="#{tTreeDND.leftTree}"
+ onselected="window.status='selectedNode: '+event.selectedNode;"
+ onexpand="window.status='expandedNode: '+event.expandedNode"
+ oncollapse="window.status='collapsedNode: '+event.collapsedNode"
+ dropListener="#{tTreeDND.onDrop}"
+ dragListener="#{tTreeDND.onDrag}" dragIndicator="treeIndicator"
+ acceptedTypes="treeNodeR" dragType="treeNodeL" rowKeyVar="key"
+ var="item">
+
+ <rich:dndParam name="treeParam" value="leftTree" />
+ </rich:tree>
+ </h:panelGroup>
+
+ <h:panelGroup id="rightContainer" layout="block"
+ styleClass="TreeContainer">
+ <h:outputText escape="false"
+ value="Selected Node:
+ #{tTreeDND.rightSelectedNodeTitle}"
+ id="selectedNodeR" />
+
+ <rich:tree id="rightTree" style="width:300px"
+ nodeSelectListener="#{tTreeDND.processRSelection}"
+ reRender="selectedNodeR" ajaxSubmitSelection="true"
+ switchType="client" value="#{tTreeDND.treeNodeRight}"
+ changeExpandListener="#{tTreeDND.onExpand}"
+ binding="#{tTreeDND.rightTree}"
+ onselected="window.status='selectedNode: '+event.selectedNode;"
+ onexpand="window.status='expandedNode: '+event.expandedNode"
+ oncollapse="window.status='collapsedNode: '+event.collapsedNode"
+ rowKeyVar="key" dropListener="#{tTreeDND.onDrop}"
+ dragListener="#{tTreeDND.onDrag}" dragIndicator="treeIndicator"
+ acceptedTypes="treeNodeL" dragType="treeNodeR" var="item">
+
+ <rich:dndParam name="treeParam" value="rightTree" />
+ </rich:tree>
+ </h:panelGroup>
+ </h:panelGrid>
+ <rich:separator height="10" />
+ </h:panelGrid>
+ </a4j:outputPanel>
+</f:subview>
\ No newline at end of file
15 years, 2 months
JBoss Rich Faces SVN: r13419 - trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2009-04-08 04:40:26 -0400 (Wed, 08 Apr 2009)
New Revision: 13419
Modified:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/RegistrationManager.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/ShelfManager.java
Log:
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/RegistrationManager.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/RegistrationManager.java 2009-04-07 18:55:23 UTC (rev 13418)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/RegistrationManager.java 2009-04-08 08:40:26 UTC (rev 13419)
@@ -65,21 +65,22 @@
private boolean checkUserExist(User user) {
if(userAction.isUserExist(user.getLogin())){
- UIComponent root = FacesContext.getCurrentInstance().getViewRoot();
- UIComponent component = root.findComponent(Constants.REGISTER_LOGIN_NAME_ID);
- FacesContext.getCurrentInstance().addMessage(component.getClientId(FacesContext.getCurrentInstance()), new FacesMessage(
- FacesMessage.SEVERITY_ERROR, USER_WITH_THIS_LOGIN_ALREADY_EXIST , USER_WITH_THIS_LOGIN_ALREADY_EXIST));
- return true;
+ addFacesMessage(Constants.REGISTER_LOGIN_NAME_ID, USER_WITH_THIS_LOGIN_ALREADY_EXIST);
+ return true;
}
return false;
}
+ 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));
+ }
+
private boolean checkPassword(User user) {
if(!user.getPassword().equals(user.getConfirmPassword())){
- UIComponent root = FacesContext.getCurrentInstance().getViewRoot();
- UIComponent component = root.findComponent(Constants.REGISTER_CONFIRM_PASSWORD_ID);
- FacesContext.getCurrentInstance().addMessage(component.getClientId(FacesContext.getCurrentInstance()), new FacesMessage(
- FacesMessage.SEVERITY_ERROR, CONFIRM_PASSWORD_NOT_EQUALS_PASSWORD , CONFIRM_PASSWORD_NOT_EQUALS_PASSWORD));
+ addFacesMessage(Constants.REGISTER_CONFIRM_PASSWORD_ID, CONFIRM_PASSWORD_NOT_EQUALS_PASSWORD);
return true;
}
return false;
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/ShelfManager.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/ShelfManager.java 2009-04-07 18:55:23 UTC (rev 13418)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/ShelfManager.java 2009-04-08 08:40:26 UTC (rev 13419)
@@ -38,6 +38,7 @@
import org.richfaces.realworld.domain.Image;
import org.richfaces.realworld.domain.Shelf;
import org.richfaces.realworld.domain.User;
+import org.richfaces.realworld.service.Constants;
import org.richfaces.realworld.service.IShelfAction;
@Name("shelfManager")
@@ -70,6 +71,7 @@
@Restrict("#{s:hasRole('admin')}")
public void addShelf(Shelf shelf) {
validationSuccess = true;
+ shelf.setPreDefined(false);
shelfAction.addShelf(shelf);
model.resetModel(NavigationEnum.SHELF_PREVIEW, shelf.getOwner(), shelf, null, null, null);
Events.instance().raiseEvent("clearTree");
@@ -81,6 +83,7 @@
@Restrict("#{s:hasRole('admin')}")
public void editShelf(Shelf shelf) {
+ shelf.setPreDefined(false);
shelfAction.editShelf(shelf);
model.resetModel(NavigationEnum.SHELF_PREVIEW, model.getSelectedUser(), shelf, null, null, null);
}
@@ -90,7 +93,7 @@
//Update domain model
List<String> directoriesToDelete = new ArrayList<String>();
for (Album a : shelf.getAlbums()) {
- directoriesToDelete.add(user.getLogin() + "/" + a.getId());
+ directoriesToDelete.add(user.getLogin() + Constants.SLASH + a.getId());
}
shelfAction.deleteShelf(shelf);
deleteDirectories(directoriesToDelete);
15 years, 2 months
JBoss Rich Faces SVN: r13418 - trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-04-07 14:55:23 -0400 (Tue, 07 Apr 2009)
New Revision: 13418
Modified:
trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
Log:
https://jira.jboss.org/jira/browse/RF-6574
Modified: trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js
===================================================================
--- trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2009-04-07 18:10:09 UTC (rev 13417)
+++ trunk/ui/combobox/src/main/resources/org/richfaces/renderkit/html/scripts/combobox.js 2009-04-07 18:55:23 UTC (rev 13418)
@@ -367,8 +367,8 @@
if (!this.comboList.activeItem) {
return;
}
-
- var value = this.comboList.activeItem.childNodes[0].nodeValue;
+
+ var value = jQuery(this.comboList.activeItem).text();
if (toSetOnly) {
var oV = this.field.value;
15 years, 2 months
JBoss Rich Faces SVN: r13417 - in trunk/test-applications/realworld2/web/src/main/webapp: includes/image and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-04-07 14:10:09 -0400 (Tue, 07 Apr 2009)
New Revision: 13417
Added:
trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/tags/templates/
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/includes/image/imageInfo.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/misc/imageScroller.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/stylesheet/realworld.css
Log:
Image scroller updated
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/image/imageInfo.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/misc/imageScroller.xhtml
===================================================================
--- trunk/test-applications/realworld2/web/src/main/webapp/includes/misc/imageScroller.xhtml 2009-04-07 17:50:57 UTC (rev 13416)
+++ trunk/test-applications/realworld2/web/src/main/webapp/includes/misc/imageScroller.xhtml 2009-04-07 18:10:09 UTC (rev 13417)
@@ -3,72 +3,61 @@
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
- xmlns:rich="http://richfaces.org/rich"
- xmlns:richx="http://richfaces.org/richx">
-
-<style>
-.rich-datascr-button {
- background-color: #CECECE;
-}
-</style>
-
-<richx:imageDataScroller reRender="tree"
- scrollerListener="#{controller.scroll}" id="imageScroller"
- fastControls="hide"
- boundaryControls="hide"
- pageVar="pageVar"
- styleClass="imageScroller"
- inactiveStyleClass="imageScroller-inactive"
- tableStyleClass="imageScroller-table"
- maxPages="5"
- for="mainImage" align="left" page="#{model.selectedImageIndex}">
- <f:facet name="activePage">
- <h:panelGroup layout="block" styleClass="preview_box_photo_80" style="margin: 0px; margin-right: 3px">
- <h:graphicImage style="border: 2px solid red" styleClass="pr_photo_bg" value="/img/shell/frame_photo_80.png" />
- <h:panelGrid cellpadding="0">
- <h:panelGroup>
- <a4j:mediaOutput element="img"
- createContent="#{imageLoader.paintImage}"
- style="border : 2px solid #FFFFFF;"
- value="#{fileManager.transformPath(model.selectedAlbum.images[pageVar].path, '_small80')}">
- <f:param value="#{imageSizeHelper.currentDimension.x}" name="x" />
- </a4j:mediaOutput>
- <br/>
+ xmlns:rich="http://richfaces.org/rich">
+
+ <h:panelGroup layout="block" id="imagesTable"
+ style="margin: 30px 0px 40px 30px; float: left; position: relative; left: -2px;">
+ <a4j:repeat value="#{model.selectedAlbum.images}" rows="5" var="img"
+ id="repeat" rowKeyVar="rk">
+
+ <a4j:outputPanel layout="block"
+ styleClass="preview_box_photo_nav #{model.selectedImage == img ? 'preview_box_photo_current' : 'preview_box_photo_default'}">
+ <h:panelGroup layout="block" styleClass="preview_box_photo_80">
+ <h:graphicImage styleClass="pr_photo_bg"
+ value="/img/shell/frame_photo_80.png" />
+ <h:panelGrid cellpadding="0">
+ <h:panelGroup>
+ <a4j:mediaOutput element="img"
+ createContent="#{imageLoader.paintImage}"
+ value="#{fileManager.transformPath(img.path, '_small80')}">
+ <f:param value="#{imageSizeHelper.currentDimension.x}" name="x" />
+ </a4j:mediaOutput>
+ <br />
+ </h:panelGroup>
+ </h:panelGrid>
+ <h:panelGroup layout="block" styleClass="photo_name">#{img.name}</h:panelGroup>
+ <h:panelGroup layout="block" styleClass="photo_data">#{rk + 1}</h:panelGroup>
</h:panelGroup>
- </h:panelGrid>
- <h:panelGroup layout="block" styleClass="photo_name">#{model.selectedAlbum.images[pageVar].name}</h:panelGroup>
- <h:panelGroup layout="block" styleClass="photo_data">#{pageVar+1}</h:panelGroup>
- </h:panelGroup>
- </f:facet>
- <f:facet name="inactivePage">
- <h:panelGroup layout="block" styleClass="preview_box_photo_80" style="margin: 0px">
- <h:graphicImage styleClass="pr_photo_bg" value="/img/shell/frame_photo_80.png" />
- <h:panelGrid cellpadding="0">
- <h:panelGroup>
- <a4j:mediaOutput element="img"
- createContent="#{imageLoader.paintImage}"
- style="border : 2px solid #FFFFFF;"
- value="#{fileManager.transformPath(model.selectedAlbum.images[pageVar].path, '_small80')}">
- <f:param value="#{imageSizeHelper.currentDimension.x}" name="x" />
- </a4j:mediaOutput>
- <br/>
- </h:panelGroup>
- </h:panelGrid>
- <h:panelGroup layout="block" styleClass="photo_name">#{model.selectedAlbum.images[pageVar].name}</h:panelGroup>
- <h:panelGroup layout="block" styleClass="photo_data">#{pageVar+1}</h:panelGroup>
- </h:panelGroup>
- </f:facet>
- <f:facet name="previous">
- <h:graphicImage styleClass="imageScroller-leftArr" value="img/shell/arr_left.png"></h:graphicImage>
- </f:facet>
- <f:facet name="previous_disabled">
- <h:graphicImage styleClass="imageScroller-leftArr" value="img/shell/arr_left_dis.png"></h:graphicImage>
- </f:facet>
- <f:facet name="next">
- <h:graphicImage styleClass="imageScroller-rightArr" value="img/shell/arr_right.png"></h:graphicImage>
- </f:facet>
- <f:facet name="next_disabled">
- <h:graphicImage styleClass="imageScroller-rightArr" value="img/shell/arr_right_dis.png"></h:graphicImage>
- </f:facet>
- </richx:imageDataScroller>
+
+ <a4j:support event="onclick"
+ rendered="#{model.selectedImage != img}"
+ reRender="mainImage, imagesTable"
+ action="#{controller.showImage(img)}" />
+ </a4j:outputPanel>
+ </a4j:repeat>
+
+ <rich:datascroller styleClass="image-scroller" lastPageMode="full"
+ for="repeat" reRender="imagesTable" boundaryControls="hide"
+ stepControls="hide">
+ <f:facet name="pages">
+ <h:outputText />
+ </f:facet>
+ <f:facet name="fastforward">
+ <h:graphicImage styleClass="image-scroller-right-arrow"
+ value="img/shell/arr_right.png" />
+ </f:facet>
+ <f:facet name="fastforward_disabled">
+ <h:graphicImage styleClass="image-scroller-right-arrow"
+ value="img/shell/arr_right_dis.png" />
+ </f:facet>
+ <f:facet name="fastrewind">
+ <h:graphicImage styleClass="image-scroller-left-arrow"
+ value="img/shell/arr_left.png" />
+ </f:facet>
+ <f:facet name="fastrewind_disabled">
+ <h:graphicImage styleClass="image-scroller-left-arrow"
+ value="img/shell/arr_left_dis.png" />
+ </f:facet>
+ </rich:datascroller>
+ </h:panelGroup>
</ui:composition>
\ No newline at end of file
Modified: trunk/test-applications/realworld2/web/src/main/webapp/stylesheet/realworld.css
===================================================================
--- trunk/test-applications/realworld2/web/src/main/webapp/stylesheet/realworld.css 2009-04-07 17:50:57 UTC (rev 13416)
+++ trunk/test-applications/realworld2/web/src/main/webapp/stylesheet/realworld.css 2009-04-07 18:10:09 UTC (rev 13417)
@@ -362,8 +362,44 @@
.preview_box_photo_nav img.pr_photo_bg {width : 100px; height : 100px; position : absolute; border: 0px;}
.preview_box_photo_nav table{position : relative; width : 100px; height : 100px; text-align : center; vertical-align : middle; border-collapse : collapse;}
.preview_box_photo_nav table img{margin: 0px 0px 0px 0px; border : 1px solid #FFFFFF;}
-.preview_box_photo_nav table img.sel{margin: 0px 0px 0px 0px; border : 3px solid #DF6400;}
-
+.preview_box_photo_current table img{margin: 0px 0px 0px 0px; border : 3px solid #DF6400;}
+
+.preview_box_photo_default table {
+ cursor: pointer;
+}
+
+.image-scroller {
+ position: relative;
+ left: 0px;
+ top: 0px;
+}
+
+.image-scroller table {
+ position: absolute;
+ left: 0px;
+ top: 0px;
+ width: 100%;
+}
+
+.image-scroller, .image-scroller * {
+ border-style: none;
+ background-color: transparent;
+}
+
+.image-scroller-left-arrow {
+ position: absolute;
+ top: 80px;
+ left: -35px;
+ z-index: 2;
+}
+
+.image-scroller-right-arrow {
+ position: absolute;
+ top: 80px;
+ right: -33px;
+ z-index: 2;
+}
+
.search-div {
height: 65px;
width: 339px;
@@ -886,41 +922,6 @@
font-weight: bold;
}
-.imageScroller {
- border: none;
- position: relative;
- float: left;
- background-color: #CECECE;
-}
-
-.imageScroller-inactive table {
- border: none;
- cursor: pointer;
-}
-
-.imageScroller-table {
- border: none;
- background-color: #CECECE;
-}
-
-.imageScroller-table td {
- border: none;
-}
-
-.imageScroller-leftArr {
- position: absolute;
- left: -10px;
- bottom: 5px;
- z-index: 2;
-}
-
-.imageScroller-rightArr {
- position: absolute;
- right: -10px;
- bottom: 5px;
- z-index: 2;
-}
-
.slideshow-table{
width: 100%;
height: 100%;
15 years, 2 months