Author: amarkhel
Date: 2009-02-10 09:44:13 -0500 (Tue, 10 Feb 2009)
New Revision: 12610
Removed:
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IMessageAction.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/MessageAction.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/error/
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileItem.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileUploadBean.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileWrapper.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/DnDManager.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/MessageManager.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/NewsManager.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/SearchManager.java
Modified:
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileManager.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/ImageLoader.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/AlbumManager.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/ImageManager.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/UserManager.java
Log:
Deleted:
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IMessageAction.java
===================================================================
---
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IMessageAction.java 2009-02-10
12:13:58 UTC (rev 12609)
+++
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IMessageAction.java 2009-02-10
14:44:13 UTC (rev 12610)
@@ -1,31 +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.service;
-
-import javax.ejb.Local;
-
-import org.richfaces.realworld.domain.User;
-
-@Local
-public interface IMessageAction {
-
- public long countNotReadedMessages(User user);
-}
\ No newline at end of file
Deleted:
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/MessageAction.java
===================================================================
---
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/MessageAction.java 2009-02-10
12:13:58 UTC (rev 12609)
+++
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/MessageAction.java 2009-02-10
14:44:13 UTC (rev 12610)
@@ -1,47 +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.service;
-
-import javax.ejb.Stateless;
-import javax.persistence.EntityManager;
-
-import org.jboss.seam.annotations.In;
-import org.jboss.seam.annotations.Name;
-import org.richfaces.realworld.domain.User;
-
-@Name("messageAction")
-@Stateless
-public class MessageAction implements IMessageAction {
-
- @In(value="entityManager")
- EntityManager em;
-
-
-
- public long countNotReadedMessages(User user){
- Long result = (Long)em.createNamedQuery(Constants.USER_COUNT_MESSAGES_QUERY)
- .setParameter(Constants.LOGIN_PARAMETER, user.getLogin())
- .getSingleResult();
- return result;
- }
-
-
-}
Deleted:
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileItem.java
===================================================================
---
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileItem.java 2009-02-10
12:13:58 UTC (rev 12609)
+++
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileItem.java 2009-02-10
14:44:13 UTC (rev 12610)
@@ -1,76 +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.fileupload;
-
-import java.io.File;
-
-import org.richfaces.realworld.domain.Image;
-
-public class FileItem {
-
- private Image image = new Image();
-
- private boolean selected;
-
- private long length;
-
- private byte[] data;
-
- private File file;
-
- public byte[] getData() {
- return data;
- }
- public void setData(byte[] data) {
- this.data = data;
- }
-
- public long getLength() {
- return length;
- }
- public void setLength(long length) {
- this.length = length;
- }
-
- public boolean isSelected() {
- return selected;
- }
-
- public void setSelected(boolean selected) {
- this.selected = selected;
- }
-
- public Image getImage() {
- return image;
- }
-
- public void setImage(Image image) {
- this.image = image;
- }
- public File getFile() {
- return file;
- }
- public void setFile(File file) {
- this.file = file;
- }
-
-
-}
Modified:
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileManager.java
===================================================================
---
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileManager.java 2009-02-10
12:13:58 UTC (rev 12609)
+++
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileManager.java 2009-02-10
14:44:13 UTC (rev 12610)
@@ -119,17 +119,13 @@
public void addDirectory(String... directories) {
String directory = new String();
for (String chunk: directories){
- directory += chunk + getFileSeparator();
+ directory += chunk ;
}
- String fullPath = getAbsolutePath(removeSlashFromEnd(directory));
+ String fullPath = getAbsolutePath(directory);
File file = new File(fullPath);
file.mkdirs();
}
- private String removeSlashFromEnd(String directory) {
- return directory.substring(0, directory.length() - 2);
- }
-
public boolean addImage(String fileName, byte[] data) {
createDirectoryIfNotExist(fileName);
/*
Deleted:
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileUploadBean.java
===================================================================
---
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileUploadBean.java 2009-02-10
12:13:58 UTC (rev 12609)
+++
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileUploadBean.java 2009-02-10
14:44:13 UTC (rev 12610)
@@ -1,241 +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.fileupload;
-
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.In;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Observer;
-import org.jboss.seam.annotations.Out;
-import org.jboss.seam.annotations.Scope;
-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.domain.User;
-import org.richfaces.realworld.navigation.NavigationEnum;
-import org.richfaces.realworld.service.Constants;
-import org.richfaces.realworld.util.ConversationState;
-import org.richfaces.realworld.util.ImageUtils;
-
-import com.drew.imaging.jpeg.JpegMetadataReader;
-import com.drew.imaging.jpeg.JpegProcessingException;
-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.CONVERSATION)
-public class FileUploadBean implements Serializable {
-
- @In
- private User user;
- @In("#{messages['file_processing_error']}")
- private String FILE_PROCESSING_ERROR;
- @In("#{messages['file_saving_error']}")
- private String FILE_SAVE_ERROR;
- @In(create = true) @Out
- FileWrapper fileWrapper;
-
- @In @Out
- private ConversationState conversationState;
-
- @In(create = true)
- private FileManager fileManager;
-
- @In("#{messages['samplename']}")
- private String SAMPLE_NAME;
-
- @In("#{messages['sampledesc']}")
- private String SAMPLE_DESCRIPTION;
-
- private static final long serialVersionUID = 4969087557225414955L;
-
- private boolean fileUploadRendered;
-
- public synchronized void listener(UploadEvent event) throws Exception {
- UploadItem item = event.getUploadItem();
-
- FileItem file = new FileItem();
-
- file.setLength(item.getFileSize());
- //file.setData(item.getData());
- file.setFile(item.getFile());
- file.setSelected(false);
- Image image = constructImage(item, file);
-
- resizeImages(item, fileManager.getUploadRoot() + image.getPath());
- try {
- extractMetadata(file, image);
- } catch (JpegProcessingException e1) {
- Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, new
Exception(FILE_PROCESSING_ERROR));
- return;
- } catch (MetadataException me) {
- Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, new
Exception(FILE_PROCESSING_ERROR));
- return;
- }
- file.setImage(image);
- fileWrapper.getFiles().add(file);
- }
-
- private void resizeImages(UploadItem src, String pathToUpload) throws IOException {
- ImageUtils.resizeImage(src, pathToUpload, ImageUtils.MINI, ImageUtils.MEDIUM);
- }
-
- @Observer(Constants.FILE_UPLOAD_CLEAR_EVENT)
- public void clearUploadData() {
- fileWrapper.getFiles().clear();
- }
-
- public void clearSelectedData() {
- for (int i = 0; i < fileWrapper.getFiles().size(); i++) {
- if (fileWrapper.getFiles().get(i).isSelected()) {
- fileWrapper.getFiles().remove(i);
- }
- }
- }
-
- public void storeSelectedData() {
- List<FileItem> temp = new ArrayList<FileItem>();
- for (FileItem file : fileWrapper.getFiles()) {
- if (file.isSelected()) {
- // Save file to disk
- String fileName = fileManager.transformToServerPath(file.getImage().getPath());
- if(!fileManager.addImage(fileName, file.getData())){
- Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, new
Exception(FILE_SAVE_ERROR));
- }
- // Update domain model
- Events.instance().raiseEvent(Constants.ADD_IMAGE_EVENT, file.getImage());
- } else {
- temp.add(file);
- }
- }
- fileWrapper.getFiles().clear();
- fileWrapper.getFiles().addAll(temp);
- }
-
- public void storeAll() {
- for (FileItem file : fileWrapper.getFiles()) {
- // Save file to disk
- String fileName = fileManager.transformToServerPath(file.getImage()
- .getPath());
- if(!fileManager.addImage(fileName, file.getData())){
- Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, new
Exception(FILE_SAVE_ERROR));
- }
- // Update domain model
- Events.instance().raiseEvent(Constants.ADD_IMAGE_EVENT, file.getImage());
- }
- fileWrapper.getFiles().clear();
- Events.instance().raiseEvent(Constants.UPDATE_MAIN_AREA_EVENT,NavigationEnum.IMAGE_PREVIEW);
- }
-
- public boolean isFileUploadRendered() {
- return fileUploadRendered;
- }
-
- public void setFileUploadRendered(boolean fileUploadRendered) {
- this.fileUploadRendered = fileUploadRendered;
- }
-
- @Observer(Constants.SHOW_FILE_UPLOAD_EVENT)
- public void showFileUpload(boolean result) {
- this.setFileUploadRendered(result);
- clearUploadData();
- }
-
-
- private Image constructImage(UploadItem item, FileItem file) {
- Image image = new Image();
- image.setUploaded(new Date());
- image.setDescription(SAMPLE_DESCRIPTION);
- image.setName(SAMPLE_NAME);
- image.setSize(file.getLength());
- String albumPath =
conversationState.getSelectedAlbum().getAlbumPathFromParents(conversationState.getSelectedAlbum(),
- Constants.SLASH, true);
- image.setPath(user.getLogin() + Constants.SLASH + albumPath + item.getFileName());
- //image.setAlbumName(conversationState.getSelectedAlbum().getName());
- image.setAlbum(conversationState.getSelectedAlbum());
- //addRankToImage(image);
- //addMetaTags(image);
- return image;
- }
-
- private void extractMetadata(FileItem file, Image image)
- throws JpegProcessingException, MetadataException, FileNotFoundException {
- InputStream in = new FileInputStream(file.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);
- }
-
- 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
Deleted:
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileWrapper.java
===================================================================
---
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileWrapper.java 2009-02-10
12:13:58 UTC (rev 12609)
+++
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileWrapper.java 2009-02-10
14:44:13 UTC (rev 12610)
@@ -1,45 +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.fileupload;
-
-import java.util.ArrayList;
-
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-
-@Name("fileWrapper")
-(a)Scope(ScopeType.SESSION)
-public class FileWrapper {
-
- private ArrayList<FileItem> files = new ArrayList<FileItem>();
- public int getSize() {
- return getFiles().size();
- }
-
- public ArrayList<FileItem> getFiles() {
- return files;
- }
-
- public void setFiles(ArrayList<FileItem> files) {
- this.files = files;
- }
-}
Modified:
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/ImageLoader.java
===================================================================
---
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/ImageLoader.java 2009-02-10
12:13:58 UTC (rev 12609)
+++
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/ImageLoader.java 2009-02-10
14:44:13 UTC (rev 12610)
@@ -49,52 +49,7 @@
FileManager fileManager;
@In("#{messages['file_processing_error']}")
private String FILE_PROCESSING_ERROR;
- @In(create=true)
- FileWrapper fileWrapper;
- public synchronized void paintImageFromByteArray(OutputStream stream, Object data)
throws IOException {
- int index;
- if(data instanceof Integer){
- index = (Integer)data;
- }else{
- index = ((Long)data).intValue();
- }
- FileInputStream fileInputStream = new
FileInputStream(fileWrapper.getFiles().get(index).getFile());
- int read = -1;
- byte [] bytes = new byte [4096];
- while ((read = fileInputStream.read(bytes)) != -1) {
- if (read == 0) {
- break;
- }
- stream.write(bytes);
- }
- //stream.write(fileWrapper.getFiles().get(index).getData());
- }
-
- public synchronized void paintSearchImage(OutputStream stream, Object object)
- throws IOException {
- File image =
fileManager.getImage(fileManager.transformToServerPath(object.toString()));
- InputStream paintData = null;
- byte[] data = new byte[(int) image.length() - 1];
- FileInputStream fileInputStream = null;
- BufferedInputStream bufferedInputStream = null;
- if (image != null) {
- try {
- fileInputStream = new FileInputStream(image);
- bufferedInputStream = new BufferedInputStream(fileInputStream);
- paintData = bufferedInputStream;
- paintData.read(data);
- } catch (FileNotFoundException e) {
- Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, new
Exception(FILE_PROCESSING_ERROR));
- return;
- } finally {
- fileInputStream.close();
- bufferedInputStream.close();
- paintData.close();
- }
- }
- stream.write(data);
- }
-
+
public synchronized void paintImage(OutputStream out, Object data) throws IOException{
if (null == data) {
return;
Modified:
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/AlbumManager.java
===================================================================
---
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/AlbumManager.java 2009-02-10
12:13:58 UTC (rev 12609)
+++
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/AlbumManager.java 2009-02-10
14:44:13 UTC (rev 12610)
@@ -20,6 +20,7 @@
*/
package org.richfaces.realworld.manager;
+import java.io.Serializable;
import java.util.List;
import org.jboss.seam.ScopeType;
@@ -32,9 +33,10 @@
import org.richfaces.realworld.util.ConversationState;
@Name("albumManager")
-(a)Scope(ScopeType.PAGE)
-public class AlbumManager {
+(a)Scope(ScopeType.CONVERSATION)
+public class AlbumManager implements Serializable{
+ private static final long serialVersionUID = -1793632515385735086L;
@In @Out
private ConversationState conversationState;
private List<Album> sharedAlbums;
Modified:
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java
===================================================================
---
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java 2009-02-10
12:13:58 UTC (rev 12609)
+++
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java 2009-02-10
14:44:13 UTC (rev 12610)
@@ -35,7 +35,6 @@
import org.jboss.seam.annotations.Out;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.core.Conversation;
-import org.jboss.seam.core.Events;
import org.jboss.seam.faces.FacesMessages;
import org.jboss.seam.log.Log;
import org.jboss.seam.security.Credentials;
@@ -43,10 +42,9 @@
import org.jboss.seam.web.Session;
import org.richfaces.realworld.domain.User;
import org.richfaces.realworld.fileupload.FileManager;
-import org.richfaces.realworld.navigation.NavigationEnum;
+import org.richfaces.realworld.service.Constants;
import org.richfaces.realworld.service.IUserAction;
import org.richfaces.realworld.util.ConversationState;
-import org.richfaces.realworld.service.Constants;
@Name("authenticator")
@Scope(ScopeType.CONVERSATION)
@@ -173,7 +171,7 @@
//identity.unAuthenticate();
credentials.clear();
//credentials.invalidate();
- conversation.begin();
+ //conversation.begin();
try {
identity.authenticate();
} catch (LoginException e) {
@@ -183,12 +181,6 @@
}
return "";
}
-
- private void setupCatalogForUser() {
- if (!fileManager.isDirectoryPresent(credentials.getUsername())) {
- fileManager.addDirectory(credentials.getUsername());
- }
- }
private boolean wantLoginAnonymous() {
return null == credentials.getUsername() ||
credentials.getUsername().equals("");
Deleted:
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/DnDManager.java
===================================================================
---
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/DnDManager.java 2009-02-10
12:13:58 UTC (rev 12609)
+++
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/DnDManager.java 2009-02-10
14:44:13 UTC (rev 12610)
@@ -1,185 +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.manager;
-
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import org.richfaces.realworld.service.Constants;
-
-import org.ajax4jsf.context.AjaxContext;
-import org.jboss.seam.annotations.In;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Out;
-import org.jboss.seam.core.Events;
-import org.richfaces.component.Dropzone;
-import org.richfaces.event.DropEvent;
-import org.richfaces.event.DropListener;
-import org.richfaces.model.TreeNode;
-import org.richfaces.realworld.domain.Album;
-import org.richfaces.realworld.domain.Image;
-import org.richfaces.realworld.domain.User;
-import org.richfaces.realworld.fileupload.FileManager;
-import org.richfaces.realworld.service.IAlbumAction;
-import org.richfaces.realworld.tree.TreeAlbumItem;
-import org.richfaces.realworld.tree.TreeMyAlbumsItem;
-
-@Name("dndManager")
-public class DnDManager implements DropListener {
-
- @In(required=false, create=false) @Out(required=false) TreeMyAlbumsItem
treeMyAlbumsItem;
- @In("#{messages['album_present']}")
- private String ALBUM_WITH_THIS_NAME_ALREADY_PRESENT;
- @In User user;
- @In(create=true)
- FileManager fileManager;
- @In(create=true)
- IAlbumAction albumAction;
-
- public void processDrop(DropEvent dropEvent) {
- Dropzone dropzone = (Dropzone) dropEvent.getComponent();
- Object dragValue = dropEvent.getDragValue();
- Object dropValue = dropzone.getDropValue();
- if(dragValue instanceof Image){
- handleImage((Image)dragValue, (Album)dropValue);
- }else if(dragValue instanceof Album){
- if(dropValue instanceof TreeMyAlbumsItem){
- handleRoot((Album)dragValue);
- }else{
- handleAlbum((Album)dragValue, (Album)dropValue);
- }
- }
- }
-
- private void handleRoot(Album dragValue) {
- TreeAlbumItem itemParent = removeAlbumFromParentAlbum(dragValue);
- if(null == itemParent){
- //Tree root contain this album
- return;
- }
- if(!renameDirectory(dragValue)){
- Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT,
ALBUM_WITH_THIS_NAME_ALREADY_PRESENT);
- return;
- }
- renameImagesFromAlbum(dragValue);
- updateRootTreeNode(dragValue, itemParent);
- addTreeToRerender();
- }
-
- private TreeAlbumItem removeAlbumFromParentAlbum(Album dragValue) {
- TreeAlbumItem itemParent = null;
- if(dragValue.getParent() != null ){
- itemParent =
(TreeAlbumItem)treeMyAlbumsItem.getNode(dragValue.getParent().getName());
- dragValue.getParent().removeChildAlbum(dragValue);
- }else{
- //Tree root contain this album
- return null;
- }
- return itemParent;
- }
-
- private boolean renameDirectory(Album dragValue) {
- String directoryOld = fileManager.concat(user.getLogin(),
dragValue.getAlbumPathFromParents(dragValue, fileManager.getFileSeparator(), true ));
- String directoryNew = fileManager.concat(user.getLogin(), dragValue.getName());
- return fileManager.renameDirectory(directoryOld, directoryNew);
- }
-
- private void renameImagesFromAlbum(Album dragValue) {
- String albumOld = fileManager.concatwithSlash(user.getLogin(),
dragValue.getAlbumPathFromParents(dragValue, Constants.SLASH, false ));
- String albumNew = user.getLogin() + Constants.SLASH;
- //albumAction.renameAllImagesFromAlbumAndChilds(dragValue, albumOld, albumNew);
- }
-
- private void updateRootTreeNode(Album dragValue, TreeAlbumItem itemParent) {
- TreeAlbumItem item = (TreeAlbumItem)treeMyAlbumsItem.getNode(dragValue.getName());
- itemParent.removeChild(item.getId());
- treeMyAlbumsItem.addChild(item.getId(), item);
- }
-
- private void addTreeToRerender() {
- try {
- FacesContext fc = FacesContext.getCurrentInstance();
- AjaxContext ac = AjaxContext.getCurrentInstance();
- UIComponent destTree = fc.getViewRoot().findComponent(Constants.TREE_ID);
- ac.addComponentToAjaxRender(destTree);
- } catch (Exception e) {
- System.err.print(e.getMessage());
- }
- }
-
- private void handleAlbum(Album dragValue, Album dropValue) {
- TreeNode<Object> itemParent = null;
- if(dragValue.getParent() != null ){
- itemParent = treeMyAlbumsItem.getNode(dragValue.getParent().getName());
- if(dragValue.getParent().equals(dropValue)){
- //Parent album contain this album
- return;
- }
- }else{
- itemParent = treeMyAlbumsItem;
- }
- String directoryOld = fileManager.concat(user.getLogin(),
dragValue.getAlbumPathFromParents(dragValue, fileManager.getFileSeparator(), true ));
- String directoryNew = fileManager.concat(user.getLogin()
,dropValue.getAlbumPathFromParents(dropValue, fileManager.getFileSeparator(), false),
dragValue.getName());
- if(!fileManager.renameDirectory(directoryOld, directoryNew)){
- Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT,
ALBUM_WITH_THIS_NAME_ALREADY_PRESENT);
- return;
- }
-
- updateAlbums(dragValue, dropValue, itemParent);
- addTreeToRerender();
- }
-
- private void updateAlbums(Album dragValue, Album dropValue,
- TreeNode<Object> itemParent) {
- String albumOld = fileManager.concatwithSlash(user.getLogin(),
dragValue.getAlbumPathFromParents(dragValue, Constants.SLASH, false ));
- String albumNew = fileManager.concatwithSlash(user.getLogin()
,dropValue.getAlbumPathFromParents(dropValue, Constants.SLASH, false));
- //albumAction.renameAllImagesFromAlbumAndChilds(dragValue, albumOld, albumNew);
- dropValue.addChildAlbum(dragValue);
- updateTree(dragValue, dropValue, itemParent);
- }
-
- private void updateTree(Album dragValue, Album dropValue,
- TreeNode<Object> itemParent) {
- TreeAlbumItem itemParentNew =
(TreeAlbumItem)treeMyAlbumsItem.getNode(dropValue.getName());
- TreeAlbumItem item = (TreeAlbumItem)treeMyAlbumsItem.getNode(dragValue.getName());
- itemParent.removeChild(item.getId());
- itemParentNew.addAlbum(item);
- }
-
- private void handleImage(Image dragValue, Album dropValue) {
- if(dragValue.getAlbum().equals(dropValue)){
- return;
- }
- String newPath = getNewPathOfImage(dragValue, dropValue);
- dragValue.setPath(newPath);
- dropValue.addImage(dragValue);
- //albumAction.flush();
- }
-
- private String getNewPathOfImage(Image dragValue, Album dropValue) {
- String fileNameOld = fileManager.transformToServerPath(dragValue.getPath());
- int lastIndexOf = dragValue.getPath().lastIndexOf(Constants.SLASH);
- String prevPathEnd = dragValue.getPath().substring(lastIndexOf);
- String fileNameNew = fileManager.concat(user.getLogin(),
dropValue.getAlbumPathFromParents(dropValue, fileManager.getFileSeparator(), true),
prevPathEnd);
- String newPath = fileManager.concatwithSlash(user.getLogin() ,
dropValue.getAlbumPathFromParents(dropValue, Constants.SLASH, true), prevPathEnd);
- fileManager.renameImage(fileNameOld, fileNameNew);
- return newPath;
- }
-}
Modified:
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/ImageManager.java
===================================================================
---
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/ImageManager.java 2009-02-10
12:13:58 UTC (rev 12609)
+++
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/ImageManager.java 2009-02-10
14:44:13 UTC (rev 12610)
@@ -31,12 +31,8 @@
import org.richfaces.realworld.domain.Image;
import org.richfaces.realworld.domain.User;
import org.richfaces.realworld.fileupload.FileManager;
-import org.richfaces.realworld.navigation.NavigationEnum;
import org.richfaces.realworld.service.Constants;
import org.richfaces.realworld.service.IImageAction;
-import org.richfaces.realworld.tree.TreeAlbumItem;
-import org.richfaces.realworld.tree.TreeMyAlbumsItem;
-import org.richfaces.realworld.ui.RatingBinder;
import org.richfaces.realworld.util.ConversationState;
@Name("imageManager")
@@ -49,83 +45,16 @@
@In(create=true)
FileManager fileManager;
- @In(required=false, create=false) @Out(required=false) TreeMyAlbumsItem
treeMyAlbumsItem;
-
@In(create=true) @Out
private ConversationState conversationState;
@In
private User user;
- @In(create=true, required=true)
- private RatingBinder ratingBinder;
-
- private String oncomplete;
-
- public ImageManager() {
- oncomplete = null;
- }
-
public void deleteImage(Image image){
String imagePath = image.getPath();
imageAction.deleteImage(image);
fileManager.deleteImage(fileManager.transformToServerPath(imagePath));
- }
-
- public void editImage(Image image){
- TreeAlbumItem parent =
(TreeAlbumItem)treeMyAlbumsItem.getNode(image.getAlbum().getName());
- boolean parentChanged = parentChanged(image, parent);
- if(parentChanged){
- TreeAlbumItem albumItem =
(TreeAlbumItem)treeMyAlbumsItem.getNode(image.getAlbumName());
- String newPath = getNewPathOfImage(image, albumItem);
- image.setPath(newPath);
- conversationState.setSelectedImage(image);
- conversationState.setSelectedAlbum(albumItem.getAlbum());
- }
- //imageAction.editImage(image, parentChanged);
- setOncomplete();
- }
+ }
- @Observer(Constants.ADD_IMAGE_EVENT)
- public void addImage(Image image) {
- //imageAction.addImage(image);
- TreeAlbumItem albumItem =
(TreeAlbumItem)treeMyAlbumsItem.getNode(image.getAlbumName());
- conversationState.setSelectedAlbum(albumItem.getAlbum());
- Events.instance().raiseEvent(Constants.UPDATE_MAIN_AREA_EVENT,
NavigationEnum.IMAGE_PREVIEW);
- //setOncomplete();
- }
-
-
- public void vote(Image image){
- //imageAction.vote(image,
Long.valueOf(ratingBinder.getInputSlider().getValue().toString()));
- }
-
- private void setOncomplete() {
- oncomplete = "$('imageModalPanel').component.hide()";
- }
-
- private boolean parentChanged(Image image, TreeAlbumItem parent) {
- return !parent.getAlbum().getName().equals(image.getAlbumName());
- }
-
- private String getNewPathOfImage(Image image, TreeAlbumItem albumItem) {
- String fileNameOld = fileManager.transformToServerPath(image.getPath());
- int lastIndexOf = image.getPath().lastIndexOf(Constants.SLASH);
- String prevPathEnd = image.getPath().substring(lastIndexOf);
- Album dropValue =
((TreeAlbumItem)treeMyAlbumsItem.getNode(image.getAlbumName())).getAlbum();
- String fileNameNew = fileManager.concat(user.getLogin(),
dropValue.getAlbumPathFromParents(dropValue , fileManager.getFileSeparator(), true),
prevPathEnd);
- String newPath = fileManager.concatwithSlash(user.getLogin(),
albumItem.getAlbum().getAlbumPathFromParents(albumItem.getAlbum(), Constants.SLASH, true),
prevPathEnd);
- fileManager.renameImage(fileNameOld, fileNameNew);
- return newPath;
- }
-
- public String getOncomplete() {
- return oncomplete;
- }
-
- public void setOncomplete(String oncomplete) {
- this.oncomplete = oncomplete;
- }
-
-
}
Deleted:
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/MessageManager.java
===================================================================
---
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/MessageManager.java 2009-02-10
12:13:58 UTC (rev 12609)
+++
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/MessageManager.java 2009-02-10
14:44:13 UTC (rev 12610)
@@ -1,40 +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.manager;
-
-import java.io.Serializable;
-
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.In;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.richfaces.realworld.domain.User;
-
-@Name("messageManager")
-(a)Scope(ScopeType.CONVERSATION)
-public class MessageManager implements Serializable{
-
- private static final long serialVersionUID = 2561824019376412988L;
-
- @In
- private User user;
-
-}
Deleted:
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/NewsManager.java
===================================================================
---
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/NewsManager.java 2009-02-10
12:13:58 UTC (rev 12609)
+++
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/NewsManager.java 2009-02-10
14:44:13 UTC (rev 12610)
@@ -1,43 +0,0 @@
-package org.richfaces.realworld.manager;
-
-import java.io.Serializable;
-import java.util.List;
-
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.In;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.richfaces.realworld.domain.Image;
-import org.richfaces.realworld.service.ISearchService;
-
-@Name("newsManager")
-(a)Scope(ScopeType.CONVERSATION)
-public class NewsManager implements Serializable {
-
- private static final long serialVersionUID = 5071655218132021316L;
- @In(create=true) private ISearchService searchService;
-
- public List<Image> getRecentImages(){
- return searchService.getRecentImages();
- }
-
- public List<Image> getLastFriendImages(){
- return searchService.getLastFriendImages();
- }
-
- public List<Image> getTopImages(){
- return searchService.getTopImages();
- }
-
- public List<Image> getTopCommentedImages(){
- return searchService.getTopCommentedImages();
- }
-
- public List<Image> getRecentCommentedImages(){
- return searchService.getRecentCommentedImages();
- }
-
- public List<Image> getLastCommentedYourImages(){
- return searchService.getLastCommentedYourImages();
- }
-}
Deleted:
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/SearchManager.java
===================================================================
---
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/SearchManager.java 2009-02-10
12:13:58 UTC (rev 12609)
+++
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/SearchManager.java 2009-02-10
14:44:13 UTC (rev 12610)
@@ -1,165 +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.manager;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.In;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.richfaces.realworld.domain.Image;
-import org.richfaces.realworld.search.SearchBeanHelper;
-import org.richfaces.realworld.search.SearchParamHolder;
-import org.richfaces.realworld.service.Constants;
-import org.richfaces.realworld.service.ISearchService;
-
-@Name("searchManager")
-(a)Scope(ScopeType.CONVERSATION)
-public class SearchManager implements Serializable {
-
- @In(required = false)
- private SearchBeanHelper helper;
-
- @In(required = false)
- private SearchParamHolder searchParams;
-
- private static final long serialVersionUID = 5071655218132021316L;
-
- @In(create=true)
- private ISearchService searchService;
-
- private List<Image> findedImages = new ArrayList<Image>();
-
- public List<String> getAllCameras(){
- return searchService.getAllCameras();
- }
-
- public List<String> getAllMetatags(){
- return searchService.getAllMetatags();
- }
-
- public List<Image> searchImages(){
- String additionalParams = populateAdditionalParams();
- findedImages = searchService.searchImages(searchParams.getSearchPattern(),
additionalParams, populateMap(additionalParams));
- return findedImages;
- }
-
- public List<Image> popularImages(){
- findedImages = searchService.popularImages();
- return findedImages;
- }
-
- public List<Image> worstImages(){
- findedImages = searchService.worstImages();
- return findedImages;
- }
-
- private Map<String, Object> populateMap(String additionalParams) {
- Map<String, Object> map = new HashMap<String, Object>();
- populateParameter(map, additionalParams, Constants.SPINNER_VALUE_NAMED_PARAMETER,
Long.valueOf(helper.getInputSpinner().getValue().toString()));
- populateParameter(map, additionalParams, Constants.CHOICE_NAMED_PARAMETER,
searchParams.getNumberOfVotes());
- populateParameter(map, additionalParams, Constants.DATE_NAMED_PARAMETER,
searchParams.getDate());
- populateParameter(map, additionalParams, Constants.UPLOAD_NAMED_PARAMETER,
searchParams.getUploadDate());
- populateParameter(map, additionalParams, Constants.SIZE_NAMED_PARAMETER,
searchParams.getSize());
- populateParameter(map, additionalParams, Constants.WIDTH_NAMED_PARAMETER,
searchParams.getWidth());
- populateParameter(map, additionalParams, Constants.HEIGHT_NAMED_PARAMETER,
searchParams.getHeight());
- populateParameter(map, additionalParams, Constants.CAMERA_NAMED_PARAMETER,
searchParams.getCamera());
- if(searchParams.getMatcherChoice() != null){
- map.put(Constants.STRICT_PARAMETER, getMatcher(searchParams.getMatcherChoice()));
- }
- map.put(Constants.CASE_SENSITIVE_PARAMETER, searchParams.isCaseSensitive());
- return map;
- }
-
- private String populateAdditionalParams() {
- StringBuilder additionalParams = new StringBuilder("");
- populateChoiceAddon(additionalParams, searchParams.getSpinnerChoice(),
Constants.SPINNER_ADDON, Constants.SPINNER_VALUE_NAMED_PARAMETER);
- populateChoiceAddon(additionalParams, searchParams.getVotesChoice(),
Constants.VOTES_ADDON, Constants.CHOICE_NAMED_PARAMETER);
- populateDateAddon(additionalParams, searchParams.getDateChoice(), Constants.DATE_ADDON,
Constants.DATE_NAMED_PARAMETER, searchParams.getDate());
- populateDateAddon(additionalParams, searchParams.getUploadChoice(),
Constants.UPLOAD_ADDON, Constants.UPLOAD_NAMED_PARAMETER, searchParams.getUploadDate());
- populateChoiceAddon(additionalParams, searchParams.getWidthChoice(),
Constants.WIDTH_ADDON, Constants.WIDTH_NAMED_PARAMETER);
- populateChoiceAddon(additionalParams, searchParams.getHeightChoice(),
Constants.HEIGHT_ADDON, Constants.HEIGHT_NAMED_PARAMETER);
- populateChoiceAddon(additionalParams, searchParams.getSizeChoice(),
Constants.SIZE_ADDON, Constants.SIZE_NAMED_PARAMETER);
- if(searchParams.getCamera()!= null &&
!searchParams.getCamera().equals("")){
- additionalParams.append(Constants.CAMERA_ADDON);
- additionalParams.append(Constants.EQUALS);
- additionalParams.append(Constants.CAMERA_NAMED_PARAMETER);
- }
- return additionalParams.toString();
- }
-
- private String getAstFromIndex(Long item){
- if(item == 1L){
- return Constants.GREATTHEN;
- }else if(item == 2L){
- return Constants.LESSTHEN;
- }else if(item == 3L){
- return Constants.EQUALS;
- }
- return null;
- }
-
- private String getMatcher(Long item){
- if(item == 1L){
- return Constants.START;
- }else if(item == 2L){
- return Constants.END;
- }else if(item == 3L){
- return Constants.INCLUDE;
- }else if(item == 0L){
- return Constants.STRICT;
- }
- return null;
- }
-
- private void populateParameter(Map<String, Object> map, String additionalParams,
String parameter, Object value){
- if(additionalParams.lastIndexOf(parameter) != -1){
- map.put(parameter, value);
- }
- }
-
- private void populateChoiceAddon(StringBuilder additionalParams, Long choice, String
addon, String namedParameter){
- if(choice != null && choice > 0L){
- additionalParams.append(addon);
- additionalParams.append(getAstFromIndex(choice));
- additionalParams.append(namedParameter);
- }
- }
-
- private void populateDateAddon(StringBuilder additionalParams, Long choice, String
addon, String namedParameter, Date date){
- if(choice != null && choice > 0L && date != null ){
- additionalParams.append(addon);
- additionalParams.append(getAstFromIndex(choice));
- additionalParams.append(namedParameter);
- }
- }
-
- public List<Image> getFindedImages() {
- return findedImages;
- }
-
-}
\ No newline at end of file
Modified:
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/UserManager.java
===================================================================
---
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/UserManager.java 2009-02-10
12:13:58 UTC (rev 12609)
+++
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/UserManager.java 2009-02-10
14:44:13 UTC (rev 12610)
@@ -32,7 +32,6 @@
import org.richfaces.realworld.domain.Image;
import org.richfaces.realworld.domain.User;
import org.richfaces.realworld.service.IUserAction;
-import org.richfaces.realworld.tree.TreeFriendsItem;
@Name("userManager")
@Scope(ScopeType.CONVERSATION)
@@ -43,26 +42,15 @@
@In("#{messages['removedfromfriends']}") private String
REMOVED_FROM_FRIENDS_MESSAGE_THEME;
@In("#{messages['removedfromfriendsby']}") private String
YOU_ARE_WERE_REMOVED_FROM_FRIENDS_MESSAGE;
@In("#{messages['friend_error']}")
- private String FRIEND_ERROR_MESSAGE;
+
private static final long serialVersionUID = 6027103521084558931L;
@In
private User user;
- @In(required=false) @Out(required=false)
- TreeFriendsItem treeFriendsItem;
-
@In(create=true, required=true)
private IUserAction userAction;
-
- public List<String> availableUserLogins(Object suggest){
- List<String> suggestions = userAction.getUsers((String)suggest);
- return suggestions;
- }
-
-
-
public void addToFavoriteAlbums(Album album){
userAction.addFavoriteAlbum(album);
}