JBoss Rich Faces SVN: r12915 - in trunk/test-applications/realworld2/web: src/main/java/org/richfaces/realworld/fileupload and 27 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2009-03-11 06:54:51 -0400 (Wed, 11 Mar 2009)
New Revision: 12915
Added:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/Controller.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/Model.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/TreeManager.java
trunk/test-applications/realworld2/web/src/main/webapp/layout/panelBar.xhtml
Removed:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/modalpanel/AlbumPopupHelper.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/modalpanel/ImagePopupHelper.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/modalpanel/LinkBuilder.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/navigation/NavigationHelper.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/servlet/PictureServlet.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/servlet/WebUtil.java
trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/tags/templates/image.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/tags/templates/linkPanel.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/img/ajax/
trunk/test-applications/realworld2/web/src/main/webapp/img/dtpick.gif
trunk/test-applications/realworld2/web/src/main/webapp/img/error.gif
trunk/test-applications/realworld2/web/src/main/webapp/img/folder.jpg
trunk/test-applications/realworld2/web/src/main/webapp/img/gb.png
trunk/test-applications/realworld2/web/src/main/webapp/img/icons/
trunk/test-applications/realworld2/web/src/main/webapp/img/locked.jpg
trunk/test-applications/realworld2/web/src/main/webapp/img/logo.gif
trunk/test-applications/realworld2/web/src/main/webapp/img/ru.png
trunk/test-applications/realworld2/web/src/main/webapp/img/tree/disc.gif
trunk/test-applications/realworld2/web/src/main/webapp/img/tree/singer.gif
trunk/test-applications/realworld2/web/src/main/webapp/img/tree/song.gif
trunk/test-applications/realworld2/web/src/main/webapp/includes/image/breadCrumb.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/image/comments.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/image/imageScroller.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/imagePreview-backup.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/imagePreview.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/news/recent.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/panelBar/favoriteAlbums.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/userPrefs/loginPrefsTab.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/layout/menu-backup.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/layout/panelBar-backup.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/layout/panelBar.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/layout/template.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/layout/template2.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/stylesheet/realworld.css
Modified:
trunk/test-applications/realworld2/web/META-INF/MANIFEST.MF
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/fileupload/FileItem.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/fileupload/FileManager.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/fileupload/FileManagerTest.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/fileupload/FileUploadBean.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/fileupload/FileWrapper.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/fileupload/ImageLoader.java
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/DnDManager.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/ShelfManager.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/SearchOptionByTag.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/user/UserPrefsBean.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/RenderLogic.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/Thumbs.db
trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/tags/realWorld-taglib.xml
trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/web.xml
trunk/test-applications/realworld2/web/src/main/webapp/img/Thumbs.db
trunk/test-applications/realworld2/web/src/main/webapp/includes/album/userAlbumEditBlock.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/album/userAlbumsPreview.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/fileUploader.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/fileUpload/multyMode.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/image/imagePreview.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/image/mainImage.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/image/shelf.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/image/shelfs.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/image/slideshow.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/image/userImageEditBlock.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/image/userImageMainBlock.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/image/userImagePreviewBlock.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/image/userImagesPreview.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/search/result/albumsResult.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/search/result/imageResult.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/shelf/userShelfEditBlock.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/shelf/userShelfPreview.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/tag.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/userAlbum.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/userAlbumEdit.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/userImages.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/userPrefs.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/userShelf.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/userShelfEdit.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/index.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/layout/menu.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/layout/template3.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/main.xhtml
Log:
Modified: trunk/test-applications/realworld2/web/META-INF/MANIFEST.MF
===================================================================
--- trunk/test-applications/realworld2/web/META-INF/MANIFEST.MF 2009-03-11 10:50:56 UTC (rev 12914)
+++ trunk/test-applications/realworld2/web/META-INF/MANIFEST.MF 2009-03-11 10:54:51 UTC (rev 12915)
@@ -1,8 +1,8 @@
Manifest-Version: 1.0
Class-Path: avalon-framework-4.1.3.jar commons-beanutils-1.7.0.jar com
- mons-digester-1.8.jar commons-logging-1.1.jar jboss-seam-debug-2.1.0.
+ mons-digester-2.0.jar commons-logging-1.1.jar jboss-seam-debug-2.1.0.
SP1.jar jboss-seam-jul-2.1.0.SP1.jar jboss-seam-remoting-2.1.0.SP1.ja
r jboss-seam-ui-2.1.0.SP1.jar jsf-facelets-1.1.14.jar junit-3.8.jar l
og4j-1.2.14.jar logkit-1.0.1.jar metadata-extractor-2.4.0-beta1.jar r
- ichfaces-impl-3.3.0.GA.jar richfaces-ui-3.3.0.GA.jar
+ ichfaces-impl-3.3.1-SNAPSHOT.jar richfaces-ui-3.3.1-SNAPSHOT.jar
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/fileupload/FileItem.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/fileupload/FileItem.java 2009-03-11 10:50:56 UTC (rev 12914)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/fileupload/FileItem.java 2009-03-11 10:54:51 UTC (rev 12915)
@@ -36,6 +36,14 @@
private File file;
+ private String name;
+
+ public String getName() {
+ return name;
+ }
+ public void setName(String name) {
+ this.name = name;
+ }
public byte[] getData() {
return data;
}
@@ -72,5 +80,4 @@
this.file = file;
}
-
}
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/fileupload/FileManager.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/fileupload/FileManager.java 2009-03-11 10:50:56 UTC (rev 12914)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/fileupload/FileManager.java 2009-03-11 10:54:51 UTC (rev 12915)
@@ -20,26 +20,36 @@
*/
package org.richfaces.realworld.fileupload;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.Transparency;
import java.awt.image.BufferedImage;
-import java.io.ByteArrayInputStream;
import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.io.OutputStream;
import java.util.List;
import javax.faces.context.FacesContext;
import javax.imageio.ImageIO;
+import javax.imageio.ImageReader;
+import javax.imageio.ImageWriter;
+import javax.imageio.stream.ImageInputStream;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.richfaces.realworld.service.Constants;
-import org.richfaces.realworld.util.ImageUtils;
@Name("fileManager")
@Scope(ScopeType.CONVERSATION)
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 _MEDIUM = "_medium";
private static final String _MINI = "_mini";
@@ -125,9 +135,7 @@
fileNew.delete();
}
}
-
fileOld.renameTo(fileNew);
-
return true;
}
@@ -140,57 +148,151 @@
file.mkdirs();
}
- public boolean addImage(String fileName, byte[] data) {
+ public boolean addImage(String fileName, String tempFilePath) {
createDirectoryIfNotExist(fileName);
- /*
- * try {
- *
- * writeFileTodisk(data, fileName, 0, 0, "" ); writeFileTodisk(data,
- * fileName, 100, 100, _MINI ); writeFileTodisk(data, fileName, 500,
- * 500, _MEDIUM );
- *
- * } catch (IOException e) { return false; }
- */
+ writeFile(fileName, tempFilePath, _SMALL80, 80);
+ writeFile(fileName, tempFilePath, _SMALL120, 120);
+ writeFile(fileName, tempFilePath, _SMALL160, 160);
+ writeFile(fileName, tempFilePath, _MINI, 150);
+ writeFile(fileName, tempFilePath, _MEDIUM, 600);
return true;
}
- private void writeFileTodisk(byte[] data, String fileName, int width,
- int height, String format) throws IOException {
- InputStream inputStream = new ByteArrayInputStream(data);
- BufferedImage bsrc = ImageIO.read(inputStream);
- if (width == 0) {
- String dest = getUploadRoot() + fileName;
- ImageIO.write(bsrc, Constants.JPG, new File(dest));
- return;
- }
- BufferedImage bdest = new ImageUtils(bsrc).resizeImage(width, height);
- /*
- * BufferedImage bdest = new BufferedImage(width, height,
- * BufferedImage.TYPE_INT_RGB); Graphics2D g = bdest.createGraphics();
- * AffineTransform at = AffineTransform.getScaleInstance((double) width
- * / bsrc.getWidth(), (double) height / bsrc.getHeight());
- * Map<RenderingHints.Key, Object> hints = new
- * HashMap<RenderingHints.Key, Object>();
- * hints.put(RenderingHints.KEY_INTERPOLATION,
- * RenderingHints.VALUE_INTERPOLATION_BILINEAR);
- * g.addRenderingHints(hints); g.drawRenderedImage(bsrc, at);
- */
- String dest = getUploadRoot() + transformPath(fileName, format);
+ public static BufferedImage bitmapToImage(String data, String format) throws IOException {
+ InputStream inb = new FileInputStream(data);
+ ImageReader rdr = (ImageReader) ImageIO.getImageReadersByFormatName(format).next();
+ ImageInputStream imageInput = ImageIO.createImageInputStream(inb);
+ rdr.setInput(imageInput);
+ BufferedImage image = rdr.read(0);
+ inb.close();
+ return image;
+ }
- ImageIO.write(bdest, Constants.JPG, new File(dest));
- inputStream.close();
- }
+ public static void imageToBitmap(BufferedImage image, String data, String format) throws IOException {
+ OutputStream inb = new FileOutputStream(data);
+ ImageWriter wrt = (ImageWriter) ImageIO.getImageWritersByFormatName(format).next();
+ ImageInputStream imageInput = ImageIO.createImageOutputStream(inb);
+ wrt.setOutput(imageInput);
+ wrt.write(image);
+ inb.close();
+ }
+ /**
+ * Convenience method that returns a scaled instance of the
+ * provided {@code BufferedImage}.
+ *
+ * @param img the original image to be scaled
+ * @param targetWidth the desired width of the scaled instance,
+ * in pixels
+ * @param targetHeight the desired height of the scaled instance,
+ * in pixels
+ * @param hint one of the rendering hints that corresponds to
+ * {@code RenderingHints.KEY_INTERPOLATION} (e.g.
+ * {@code RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR},
+ * {@code RenderingHints.VALUE_INTERPOLATION_BILINEAR},
+ * {@code RenderingHints.VALUE_INTERPOLATION_BICUBIC})
+ * @param higherQuality if true, this method will use a multi-step
+ * scaling technique that provides higher quality than the usual
+ * one-step technique (only useful in downscaling cases, where
+ * {@code targetWidth} or {@code targetHeight} is
+ * smaller than the original dimensions, and generally only when
+ * the {@code BILINEAR} hint is specified)
+ * @return a scaled version of the original {@code BufferedImage}
+ */
+ public static BufferedImage getScaledInstance(BufferedImage img,
+ int targetWidth,
+ int targetHeight,
+ Object hint,
+ boolean higherQuality)
+ {
+ int type = (img.getTransparency() == Transparency.OPAQUE) ?
+ BufferedImage.TYPE_INT_RGB : BufferedImage.TYPE_INT_ARGB;
+ BufferedImage ret = (BufferedImage)img;
+ int w, h;
+ if (higherQuality) {
+ // Use multi-step technique: start with original size, then
+ // scale down in multiple passes with drawImage()
+ // until the target size is reached
+ w = img.getWidth();
+ h = img.getHeight();
+ } else {
+ // Use one-step technique: scale directly from original
+ // size to target size with a single drawImage() call
+ w = targetWidth;
+ h = targetHeight;
+ }
+
+ do {
+ if (higherQuality && w > targetWidth) {
+ w /= 2;
+ if (w < targetWidth) {
+ w = targetWidth;
+ }
+ }
+
+ if (higherQuality && h > targetHeight) {
+ h /= 2;
+ if (h < targetHeight) {
+ h = targetHeight;
+ }
+ }
+
+ BufferedImage tmp = new BufferedImage(w, h, type);
+ Graphics2D g2 = tmp.createGraphics();
+ g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, hint);
+ g2.drawImage(ret, 0, 0, w, h, null);
+ g2.dispose();
+
+ ret = tmp;
+ } while (w != targetWidth || h != targetHeight);
+
+ return ret;
+ }
+
+ private void writeFile(String newFileName, String fileName,String pattern, int size) {
+ BufferedImage bsrc =null;
+ try {
+ bsrc = bitmapToImage(fileName, "JPG");
+ } catch (IOException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ int i = bsrc.getWidth() > bsrc.getHeight()? bsrc.getWidth(): bsrc.getHeight();
+ double d = (double) size
+ / i;
+ Double yy = ((Double)d*bsrc.getWidth());
+ int width = yy.intValue();
+ yy = ((Double)d*bsrc.getHeight());
+ int height= yy.intValue();
+ BufferedImage bdest = getScaledInstance(bsrc, width, height, RenderingHints.VALUE_INTERPOLATION_BICUBIC, true);
+ String dest = this.uploadRootPath + transformPath(newFileName, pattern);
+ try {
+ imageToBitmap(bdest, dest, "JPG");
+ } catch (IOException ex) {
+ // TODO Auto-generated catch block
+ ex.printStackTrace();
+ }
+ }
+
public String transformPath(String target, String substitute) {
String begin = target.substring(0, target.lastIndexOf(Constants.DOT));
String end = target.substring(target.lastIndexOf(Constants.DOT));
return begin + substitute + end;
}
+
+ public String transformFileUploadPath(String target, String substitute) {
+ String begin = target.substring(0, target.lastIndexOf(Constants.DOT));
+ String end = target.substring(target.lastIndexOf(Constants.DOT));
+ return begin + substitute + end ;
+ }
public void deleteImage(String fileName) {
deleteImage(getFileByPath(fileName));
deleteImage(getFileByPath(transformPath(fileName, _MINI)));
deleteImage(getFileByPath(transformPath(fileName, _MEDIUM)));
+ deleteImage(getFileByPath(transformPath(fileName, _SMALL80)));
+ deleteImage(getFileByPath(transformPath(fileName, _SMALL120)));
+ deleteImage(getFileByPath(transformPath(fileName, _SMALL160)));
}
private void deleteImage(File file) {
@@ -213,6 +315,15 @@
renameImage(getFileByPath(transformPath(fileNameNew, _MEDIUM)),
getFileByPath(transformPath(fileNameOld, _MEDIUM)));
+
+ renameImage(getFileByPath(transformPath(fileNameNew, _SMALL80)),
+ getFileByPath(transformPath(fileNameOld, _SMALL80)));
+
+ renameImage(getFileByPath(transformPath(fileNameNew, _SMALL120)),
+ getFileByPath(transformPath(fileNameOld, _SMALL120)));
+
+ renameImage(getFileByPath(transformPath(fileNameNew, _SMALL160)),
+ getFileByPath(transformPath(fileNameOld, _SMALL160)));
}
private void renameImage(File fileNew, File fileOld) {
@@ -223,7 +334,7 @@
}
private void createDirectoryIfNotExist(String fileNameNew) {
- int lastIndexOf = fileNameNew.lastIndexOf(File.separatorChar);
+ int lastIndexOf = fileNameNew.lastIndexOf("/");
if (lastIndexOf > 0) {
String directory = fileNameNew.substring(0, lastIndexOf);
File file = getFileByPath(directory);
@@ -234,8 +345,7 @@
}
public boolean isImagePresent(String fileName) {
- File file = getFileByPath(fileName);
- return file.exists() && !file.isDirectory();
+ return getFileByPath(fileName) != null && getFileByPath(fileName).exists() && !getFileByPath(fileName).isDirectory();
}
public File getImage(String fileName) {
@@ -244,16 +354,9 @@
}
return null;
}
-
- public String transformToServerPath(String filename) {
- String[] res = filename.split(Constants.SLASH);
- StringBuilder sb = new StringBuilder();
- sb.append(res[0]);
- for (int i = 1; i < res.length; i++) {
- sb.append(File.separator + res[i]);
- }
- String string = sb.toString();
- return string;
+
+ public File getDirectImage(String fileName) {
+ return new File(fileName);
}
public void deleteDirectories(List<String> directoriesToDelete) {
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/fileupload/FileManagerTest.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/fileupload/FileManagerTest.java 2009-03-11 10:50:56 UTC (rev 12914)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/fileupload/FileManagerTest.java 2009-03-11 10:54:51 UTC (rev 12915)
@@ -87,7 +87,7 @@
fileManager.deleteDirectory("a"+System.getProperty("file.separator")+"amarkhel");
}
- public void testAddImage() throws IOException {
+ /*public void testAddImage() throws IOException {
assertEquals(fileManager.isImagePresent("amarkhel.gif"), false);
fileManager.addImage("amarkhel.gif", image);
assertEquals(fileManager.isImagePresent("amarkhel.gif"), true);
@@ -130,6 +130,6 @@
assertEquals(fileManager.isImagePresent("am"+System.getProperty("file.separator")+"amarkhel.gif"), true);
fileManager.deleteImage("am"+System.getProperty("file.separator")+"amarkhel.gif");
fileManager.deleteDirectory("am");
- }
+ }*/
}
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/fileupload/FileUploadBean.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/fileupload/FileUploadBean.java 2009-03-11 10:50:56 UTC (rev 12914)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/fileupload/FileUploadBean.java 2009-03-11 10:54:51 UTC (rev 12915)
@@ -40,11 +40,8 @@
import org.richfaces.event.UploadEvent;
import org.richfaces.model.UploadItem;
import org.richfaces.realworld.domain.Image;
-import org.richfaces.realworld.domain.MetaTag;
-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;
@@ -63,8 +60,6 @@
@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']}")
@@ -75,8 +70,6 @@
@Out(required=false) FileItem file1;
@Out(required=false) FileItem file2;
@Out(required=false) FileItem file3;
- @In @Out
- private ConversationState conversationState;
@In(create = true)
private FileManager fileManager;
@@ -93,16 +86,13 @@
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);
+ file.setName(event.getUploadItem().getFileName());
Image image = constructImage(item, file);
-
- resizeImages(item, fileManager.getUploadRoot() + image.getPath());
+ resizeImages(item,file.getFile().getPath());
try {
extractMetadata(file, image);
} catch (JpegProcessingException e1) {
@@ -113,7 +103,6 @@
return;
}
file.setImage(image);
-
fileWrapper.getFiles().add(file);
file1 = fileWrapper.getFiles().get(fileWrapper.getFiles().size()-1);
if(fileWrapper.getFiles().size()-2 >=0){
@@ -125,7 +114,7 @@
}
private void resizeImages(UploadItem src, String pathToUpload) throws IOException {
- ImageUtils.resizeImage(src, pathToUpload, ImageUtils.MINI, ImageUtils.MEDIUM);
+ ImageUtils.resizeImage(src, pathToUpload, ImageUtils.MINI);
}
@Observer(Constants.FILE_UPLOAD_CLEAR_EVENT)
@@ -146,8 +135,8 @@
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())){
+ String fileName = file.getFile().getPath();
+ if(!fileManager.addImage(file.getName(), fileName)){
Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, new Exception(FILE_SAVE_ERROR));
}
// Update domain model
@@ -163,9 +152,9 @@
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())){
+ String fileName = file.getFile()
+ .getPath();
+ if(!fileManager.addImage(file.getName(), fileName)){
Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, new Exception(FILE_SAVE_ERROR));
}
// Update domain model
@@ -196,10 +185,6 @@
image.setDescription(SAMPLE_DESCRIPTION);
image.setName(SAMPLE_NAME);
image.setSize(file.getLength());
- String albumPath = conversationState.getSelectedAlbum().getId().toString();
- image.setPath(user.getLogin() + Constants.SLASH + albumPath + item.getFileName());
- image.setAlbumName(conversationState.getSelectedAlbum().getName());
- image.setAlbum(conversationState.getSelectedAlbum());
return image;
}
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/fileupload/FileWrapper.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/fileupload/FileWrapper.java 2009-03-11 10:50:56 UTC (rev 12914)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/fileupload/FileWrapper.java 2009-03-11 10:54:51 UTC (rev 12915)
@@ -24,6 +24,7 @@
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Observer;
import org.jboss.seam.annotations.Scope;
@Name("fileWrapper")
@@ -42,4 +43,9 @@
public void setFiles(ArrayList<FileItem> files) {
this.files = files;
}
+
+ @Observer("fileAdded")
+ public void removeFile(FileItem file){
+ files.remove(file);
+ }
}
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/fileupload/ImageLoader.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/fileupload/ImageLoader.java 2009-03-11 10:50:56 UTC (rev 12914)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/fileupload/ImageLoader.java 2009-03-11 10:54:51 UTC (rev 12915)
@@ -22,7 +22,6 @@
import java.awt.image.BufferedImage;
import java.io.BufferedInputStream;
-import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
@@ -40,9 +39,6 @@
import org.jboss.seam.core.Events;
import org.richfaces.realworld.service.Constants;
-import sun.awt.image.ByteInterleavedRaster;
-import sun.reflect.generics.tree.ByteSignature;
-
@Name("imageLoader")
@Scope(ScopeType.CONVERSATION)
public class ImageLoader implements Serializable{
@@ -126,6 +122,33 @@
}
}
+ public synchronized void paintImage2(OutputStream out, Object data) throws IOException{
+ if (null == data) {
+ return;
+ }
+ File imageResource = fileManager.getDirectImage(data.toString());
+ if (imageResource != null) {
+ FileInputStream fileInputStream = new FileInputStream(imageResource);
+ BufferedInputStream bufferedInputStream = new BufferedInputStream(fileInputStream);
+ InputStream paintData = bufferedInputStream;
+ if (null == paintData) {
+ Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, new Exception(FILE_PROCESSING_ERROR));
+ return;
+ }
+ try {
+ BufferedImage images = ImageIO.read(paintData);
+ ImageIO.write(images, Constants.JPEG, out);
+ } catch (Exception e) {
+ Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, new Exception(FILE_PROCESSING_ERROR));
+ return;
+ } finally {
+ fileInputStream.close();
+ bufferedInputStream.close();
+ paintData.close();
+ }
+ }
+ }
+
public synchronized void paintImageFromFile(OutputStream out, Object data) throws IOException{
if (null == data || !(data instanceof File)) {
return;
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-03-11 10:50:56 UTC (rev 12914)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/AlbumManager.java 2009-03-11 10:54:51 UTC (rev 12915)
@@ -21,18 +21,13 @@
package org.richfaces.realworld.manager;
import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-import javax.faces.event.ActionEvent;
-
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.core.Events;
-import org.richfaces.model.TreeNode;
import org.richfaces.realworld.domain.Album;
import org.richfaces.realworld.domain.Shelf;
import org.richfaces.realworld.domain.User;
@@ -40,7 +35,8 @@
import org.richfaces.realworld.navigation.NavigationEnum;
import org.richfaces.realworld.service.Constants;
import org.richfaces.realworld.service.IAlbumAction;
-import org.richfaces.realworld.util.ConversationState;
+import org.richfaces.realworld.util.Controller;
+import org.richfaces.realworld.util.Model;
@Name("albumManager")
@Scope(ScopeType.CONVERSATION)
@@ -67,22 +63,20 @@
@In(create=true, required=true) @Out
private Album album;
- private List<Album> sharedAlbums;
@In
private User user;
@In(create=true)
FileManager fileManager;
- @In @Out
- private ConversationState conversationState;
+ @In @Out Model model;
public void addAlbum(Album album){
albumAction.addAlbum(album);
addDirectory();
//Update conversation state
- conversationState.setSelectedImage(null);
- conversationState.setSelectedAlbum(album);
+ model.setSelectedImage(null);
+ model.setSelectedAlbum(album);
Events.instance().raiseEvent("albumAdded");
Events.instance().raiseEvent("clearTree");
setOncomplete();
@@ -90,12 +84,12 @@
public void initEdit(Shelf shelf){
album = new Album();
- album.setParent(shelf);
+ album.setShelf(shelf);
}
public void editAlbum(Album album){
albumAction.editAlbum(album);
- conversationState.setSelectedAlbum(album);
+ model.setSelectedAlbum(album);
Events.instance().raiseEvent(Constants.UPDATE_MAIN_AREA_EVENT, NavigationEnum.ALBUM_PREVIEW);
Events.instance().raiseEvent("albumEdited");
}
@@ -105,8 +99,8 @@
String string = album.getId().toString();
albumAction.deleteAlbum(album);
deleteDirectory(string);
- conversationState.setSelectedImage(null);
- conversationState.setSelectedAlbum(null);
+ model.setSelectedImage(null);
+ model.setSelectedAlbum(null);
Events.instance().raiseEvent("albumDeleted");
Events.instance().raiseEvent("clearTree");
}
@@ -118,26 +112,4 @@
private void addDirectory() {
fileManager.addDirectory(user.getLogin(), album.getId().toString());
}
-
- public List<Album> getSharedAlbums(){
- if(null == sharedAlbums){
- sharedAlbums=albumAction.getSharedAlbums();
- conversationState.setSelectedAlbum(sharedAlbums.get(0));
- }
- return sharedAlbums;
- }
-
- public void selectAlbum(Album a){
- conversationState.setSelectedAlbum(a);
- conversationState.setSelectedImage(null);
- }
-
- public void resetToAlbum(Album a){
- conversationState.setSelectedAlbum(a);
- conversationState.setSelectedImage(null);
- }
-
- public void selectImage(int index){
- conversationState.setSelectedImage(conversationState.getSelectedAlbum().getImages().get(index -1));
- }
}
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-03-11 10:50:56 UTC (rev 12914)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java 2009-03-11 10:54:51 UTC (rev 12915)
@@ -47,7 +47,8 @@
import org.richfaces.realworld.navigation.NavigationEnum;
import org.richfaces.realworld.service.IUserAction;
import org.richfaces.realworld.ui.PasswordHolder;
-import org.richfaces.realworld.util.ConversationState;
+import org.richfaces.realworld.util.Controller;
+import org.richfaces.realworld.util.Model;
import org.richfaces.realworld.service.Constants;
@Name("authenticator")
@@ -85,9 +86,8 @@
@In(create = true)
FileManager fileManager;
-
- @In(create=true) @Out
- private ConversationState conversationState;
+
+ @In(create=true) @Out Model model;
public String login(){
if(identity.hasRole("admin")){
@@ -110,22 +110,17 @@
public boolean authenticate()
{
-
if (wantLoginAnonymous()) {
identity.addRole(Constants.GUEST_ROLE);
userAction.loginAnonymous();
- conversationState.setMainArea(NavigationEnum.ANONYM);
+ model.setMainArea(NavigationEnum.ANONYM);
return true;
}
try {
User user = userAction.login(credentials.getUsername(), passwordHolder.hash(credentials.getPassword()));
if (user != null) {
identity.addRole(Constants.ADMIN_ROLE);
- conversationState.setSelectedUser(user);
- conversationState.setSelectedAlbum(null);
- conversationState.setSelectedImage(null);
- conversationState.setSelectedShelf(null);
- Events.instance().raiseEvent(Constants.UPDATE_MAIN_AREA_EVENT, NavigationEnum.ALL_SHELFS);
+ model.resetModel(NavigationEnum.ALL_SHELFS, user, null, null, null, null);
return true;
}
} catch (Exception nre) {
@@ -223,8 +218,4 @@
public Long getStartConversation() {
return startConversation;
}
-
- public void setStartConversation(Long startConversation) {
- this.startConversation = startConversation;
- }
}
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-03-11 10:50:56 UTC (rev 12914)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/DnDManager.java 2009-03-11 10:54:51 UTC (rev 12915)
@@ -26,16 +26,15 @@
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.Shelf;
import org.richfaces.realworld.domain.User;
+import org.richfaces.realworld.fileupload.FileItem;
import org.richfaces.realworld.fileupload.FileManager;
import org.richfaces.realworld.service.Constants;
import org.richfaces.realworld.service.IAlbumAction;
@@ -43,8 +42,6 @@
@Name("dndManager")
public class DnDManager implements DropListener {
- @In("#{messages['album_present']}")
- private String ALBUM_WITH_THIS_NAME_ALREADY_PRESENT;
@In User user;
@In(create=true)
FileManager fileManager;
@@ -56,9 +53,19 @@
Object dragValue = dropEvent.getDragValue();
Object dropValue = dropzone.getDropValue();
if(dragValue instanceof Image){
- handleImage((Image)dragValue, (Album)dropValue);
+ if(!((Album)dropValue).getOwner().equals(user)){
+ Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, new Exception("You can't add photo's to that album"));
+ return;
+ }
+ handleImage((Image)dragValue, (Album)dropValue);
}else if(dragValue instanceof Album){
handleShelf((Album)dragValue, (Shelf)dropValue);
+ }else if(dragValue instanceof FileItem){
+ if(!((Album)dropValue).getOwner().equals(user)){
+ Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, new Exception("You can't add photo's to that album"));
+ return;
+ }
+ handleUploadedImage((FileItem)dragValue, (Album)dropValue);
}
}
@@ -74,12 +81,12 @@
}
private void handleShelf(Album dragValue, Shelf dropValue) {
- if(dragValue.getParent() != null ){
- if(dragValue.getParent().equals(dropValue)){
+ if(dragValue.getShelf() != null ){
+ if(dragValue.getShelf().equals(dropValue)){
//Parent album contain this album
return;
}else{
- dropValue.addChildAlbum(dragValue);
+ dropValue.addAlbum(dragValue);
albumAction.flush();
Events.instance().raiseEvent("clearTree");
}
@@ -96,6 +103,15 @@
dropValue.addImage(dragValue);
albumAction.flush();
}
+
+ private void handleUploadedImage(FileItem dragValue, Album dropValue) {
+ String newPath = getNewPathOfImage2(dragValue.getName(), dropValue);
+ dragValue.getImage().setPath(newPath);
+ dropValue.addImage(dragValue.getImage());
+ albumAction.flush();
+ fileManager.addImage(newPath, dragValue.getFile().getPath());
+ Events.instance().raiseEvent("fileAdded", dragValue);
+ }
private String getNewPathOfImage(Image dragValue, Album dropValue) {
String fileNameOld = dragValue.getPath();
@@ -105,4 +121,9 @@
fileManager.renameImage(fileNameOld, fileNameNew);
return fileNameNew;
}
+
+ private String getNewPathOfImage2(String path, Album dropValue) {
+ String fileNameNew = user.getLogin()+"/"+dropValue.getId()+"/"+path;
+ return fileNameNew;
+ }
}
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-03-11 10:50:56 UTC (rev 12914)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/ImageManager.java 2009-03-11 10:54:51 UTC (rev 12915)
@@ -36,7 +36,8 @@
import org.richfaces.realworld.navigation.NavigationEnum;
import org.richfaces.realworld.service.Constants;
import org.richfaces.realworld.service.IImageAction;
-import org.richfaces.realworld.util.ConversationState;
+import org.richfaces.realworld.util.Controller;
+import org.richfaces.realworld.util.Model;
@Name("imageManager")
@Scope(ScopeType.CONVERSATION)
@@ -48,18 +49,11 @@
@In(create=true)
FileManager fileManager;
- @In(create=true) @Out
- private ConversationState conversationState;
+ @In @Out Model model;
@In
private User user;
- private String oncomplete;
-
- public ImageManager() {
- oncomplete = null;
- }
-
public void deleteImage(Image image){
String imagePath = image.getPath();
imageAction.deleteImage(image);
@@ -76,26 +70,11 @@
@Observer(Constants.ADD_IMAGE_EVENT)
public void addImage(Image image) {
imageAction.addImage(image);
- conversationState.setSelectedAlbum(image.getAlbum());
+ model.setSelectedAlbum(image.getAlbum());
Events.instance().raiseEvent(Constants.UPDATE_MAIN_AREA_EVENT, NavigationEnum.IMAGE_PREVIEW);
Events.instance().raiseEvent("imageAdded");
- setOncomplete();
}
-
- public void addAutoComment(Image image) {
- if(null == user.getLogin()){
- Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, new Exception("For vote on this picture you must login"));
- return;
- }
- Comment comment = new Comment();
- comment.setAuthor(user);
- comment.setDate(new Date());
- comment.setImage(image);
- comment.setMessage("+1");
- imageAction.addComment(comment);
- }
-
public void addComment(Image image, String message){
if(null == user.getLogin()){
Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, new Exception("For vote on this picture you must login"));
@@ -110,15 +89,4 @@
Events.instance().raiseEvent(Constants.CLEAR_EDITOR_EVENT, "");
}
- private void setOncomplete() {
- oncomplete = "$('imageModalPanel').component.hide()";
- }
- public String getOncomplete() {
- return oncomplete;
- }
-
- public void setOncomplete(String oncomplete) {
- this.oncomplete = oncomplete;
- }
-
}
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-03-11 10:50:56 UTC (rev 12914)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/ShelfManager.java 2009-03-11 10:54:51 UTC (rev 12915)
@@ -24,8 +24,6 @@
import java.util.ArrayList;
import java.util.List;
-import javax.faces.event.ActionEvent;
-
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
@@ -40,9 +38,8 @@
import org.richfaces.realworld.navigation.NavigationEnum;
import org.richfaces.realworld.service.Constants;
import org.richfaces.realworld.service.IShelfAction;
+import org.richfaces.realworld.util.Model;
-import org.richfaces.realworld.util.ConversationState;
-
@Name("shelfManager")
@Scope(ScopeType.CONVERSATION)
public class ShelfManager implements Serializable{
@@ -72,41 +69,37 @@
@In(create=true, required=true) @Out
private Shelf shelf;
-
+ @In @Out Model model;
@In
private User user;
- @In @Out
- private ConversationState conversationState;
-
public void addShelf(Shelf shelf){
shelfAction.addShelf(shelf);
//Update conversation state
- conversationState.setSelectedImage(null);
- conversationState.setSelectedAlbum(null);
- conversationState.setSelectedShelf(shelf);
+ model.setSelectedImage(null);
+ model.setSelectedAlbum(null);
+ model.setSelectedShelf(shelf);
setOncomplete();
Events.instance().raiseEvent("clearTree");
}
-
public void editShelf(Shelf shelf){
shelfAction.editShelf(shelf);
- conversationState.setSelectedShelf(shelf);
+ model.setSelectedShelf(shelf);
Events.instance().raiseEvent(Constants.UPDATE_MAIN_AREA_EVENT, NavigationEnum.SHELF_PREVIEW);
}
public void deleteShelf(Shelf shelf){
//Update domain model
List<String> directoriesToDelete = new ArrayList<String>();
- for(Album a:shelf.getChildAlbums()){
+ for(Album a:shelf.getAlbums()){
directoriesToDelete.add(user.getLogin() + "/" +a.getId());
}
shelfAction.deleteShelf(shelf);
deleteDirectories(directoriesToDelete);
- conversationState.setSelectedImage(null);
- conversationState.setSelectedAlbum(null);
- conversationState.setSelectedShelf(null);
+ model.setSelectedImage(null);
+ model.setSelectedAlbum(null);
+ model.setSelectedShelf(null);
Events.instance().raiseEvent("clearTree");
}
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-03-11 10:50:56 UTC (rev 12914)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/UserManager.java 2009-03-11 10:54:51 UTC (rev 12915)
@@ -49,27 +49,7 @@
private Long countAlbums;
@In(create=true, required=true)
private IUserAction userAction;
-
- public void addToFavoriteAlbums(Album album){
- userAction.addFavoriteAlbum(album);
- }
-
- public void removeFromFavoriteAlbums(Album album){
- userAction.removeFromFavoriteAlbums(user, album);
- }
-
- public void addToFavoriteImages(Image image){
- userAction.addFavoriteImage(image);
- }
-
- public void removeFromFavoriteImages(Image image){
- userAction.removeFromFavoriteImages(user, image);
- }
- public List<Album> getRootAlbums(User user2) {
- return userAction.getRootAlbums(user2);
- }
-
public Long countImages(User u) {
if(null == countImages ){
countImages = userAction.countImages(u);
@@ -109,5 +89,4 @@
countImages = j;
}
-
}
Deleted: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/modalpanel/AlbumPopupHelper.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/modalpanel/AlbumPopupHelper.java 2009-03-11 10:50:56 UTC (rev 12914)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/modalpanel/AlbumPopupHelper.java 2009-03-11 10:54:51 UTC (rev 12915)
@@ -1,118 +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.modalpanel;
-
-import java.io.Serializable;
-
-import javax.faces.context.FacesContext;
-import javax.faces.event.ActionEvent;
-
-import org.ajax4jsf.context.AjaxContext;
-import org.ajax4jsf.javascript.JSLiteral;
-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.richfaces.realworld.domain.Album;
-import org.richfaces.realworld.manager.AlbumManager;
-
-@Name("albumPopupHelper")
-(a)Scope(ScopeType.CONVERSATION)
-public class AlbumPopupHelper implements Serializable{
-
- private static final long serialVersionUID = 2561824019376412988L;
-
- private String caption;
-
- private String actionName;
-
- private String oncomplete = ";";
-
- @In(create=true, required=true) @Out
- private Album album;
-
- @In(create=true, required=true)
- private AlbumManager albumManager;
-
- public void initAlbumData( String actionName, String caption, Album album){
- this.caption = caption;
- this.actionName = actionName;
- this.oncomplete = ";";
- if(null != album){
- this.album = album;
- }else{
- this.album = new Album();
- }
- }
-
- public void initAlbumData( String actionName, String caption, Album album, Album parent){
- this.caption = caption;
- this.actionName = actionName;
- this.oncomplete = ";";
- if(null != album){
- this.album = album;
- }else{
- this.album = new Album();
- }
- }
-
- public void editAlbum(ActionEvent event){
- albumManager.editAlbum(this.album);
- setOncomplete();
- }
-
- private void setOncomplete() {
- oncomplete = "$('albumModalPanel').component.hide()";
- }
-
- public String getCaption() {
- return caption;
- }
-
- public void setCaption(String caption) {
- this.caption = caption;
- }
-
- public String getActionName() {
- return actionName;
- }
-
- public void setActionName(String actionName) {
- this.actionName = actionName;
- }
-
- public void addAlbum(ActionEvent event){
- albumManager.addAlbum(album);
- setOncomplete();
- }
-
- public String getOncomplete() {
- return oncomplete;
- }
-
- public void setOncomplete(String oncomplete) {
- this.oncomplete = oncomplete;
- }
-
-
-
-}
Deleted: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/modalpanel/ImagePopupHelper.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/modalpanel/ImagePopupHelper.java 2009-03-11 10:50:56 UTC (rev 12914)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/modalpanel/ImagePopupHelper.java 2009-03-11 10:54:51 UTC (rev 12915)
@@ -1,61 +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.modalpanel;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-
-import javax.faces.event.ActionEvent;
-
-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.richfaces.realworld.domain.Image;
-import org.richfaces.realworld.domain.MetaTag;
-import org.richfaces.realworld.manager.ImageManager;
-
-@Name("imagePopupHelper")
-(a)Scope(ScopeType.CONVERSATION)
-public class ImagePopupHelper implements Serializable{
-
- private static final long serialVersionUID = 2561824019376412988L;
-
- @In(create=true, required=true) @Out
- private Image image;
-
- @In(create=true, required=true)
- private ImageManager imageManager;
-
- public void initImagePopup(Image image){
- if(null != image){
- this.image = image;
- //image.setMeta(new ArrayList<MetaTag>(image.getTags()));
- }else{
- this.image = new Image();
- }
- }
-
- public void editImage(ActionEvent event){
- imageManager.editImage(this.image);
- }
-}
Deleted: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/modalpanel/LinkBuilder.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/modalpanel/LinkBuilder.java 2009-03-11 10:50:56 UTC (rev 12914)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/modalpanel/LinkBuilder.java 2009-03-11 10:54:51 UTC (rev 12915)
@@ -1,129 +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.modalpanel;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.faces.context.FacesContext;
-import javax.faces.model.SelectItem;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletRequest;
-
-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.service.Constants;
-
-@Name("linkBuilder")
-(a)Scope(ScopeType.CONVERSATION)
-public class LinkBuilder implements Serializable{
-
- private static final long serialVersionUID = 2561824019376412988L;
- @In("#{messages['small']}") private String SMALL;
- @In("#{messages['medium']}") private String MEDIUM;
- @In("#{messages['full']}") private String FULL;
- private Long scaleChoice = 1L;
- private String currentFormat = Constants.URL;
- private String path;
-
- public String getGeneratedLink() {
- String serverPath = getServerPath();
- String link = null;
- String tempPath = null;
- if(getScaleChoice() == 3L){
- tempPath = Constants.MINI_FORMAT;
- }else if(getScaleChoice() == 2L){
- tempPath = Constants.MEDIUM_FORMAT;
- }else if(getScaleChoice() == 1L){
- tempPath="";
- }
- if(null == path){
- return "";
- }
- if(getCurrentFormat().equals(Constants.URL)){
- link = serverPath + Constants.PICTURE_FOLDER_PATH + transformPath(path, tempPath);
- }else
- if(getCurrentFormat().equals(Constants.HTML)){
- link = String.format(Constants.HTML_PATTERN, serverPath, serverPath + Constants.PICTURE_FOLDER_PATH + transformPath(path, tempPath));
- }else
- if(getCurrentFormat().equals(Constants.FORUM)){
- link = String.format(Constants.FORUM_PATTERN, serverPath, serverPath + Constants.PICTURE_FOLDER_PATH + transformPath(path, tempPath));
- }
- return link;
- }
-
- private String getServerPath() {
- ServletRequest servletRequest = ((ServletRequest)(FacesContext.getCurrentInstance().getExternalContext().getRequest()));
- ServletContext s = (ServletContext)(FacesContext.getCurrentInstance().getExternalContext().getContext());
- String protocol = servletRequest.getProtocol().equals(Constants.HTTP_1_1) || servletRequest.getProtocol().equals(Constants.HTTP_1_0) ? Constants.HTTP : Constants.HTTPS ;
- String servletPath = protocol + servletRequest.getLocalAddr() + ":" + servletRequest.getLocalPort() + s.getContextPath();
- return servletPath;
- }
-
- private String transformPath(String target, String substitute){
- String begin = target.substring(0, target.lastIndexOf(Constants.DOT));
- String end = target.substring(target.lastIndexOf(Constants.DOT));
- return begin + substitute + end;
- }
-
- public List<SelectItem> getItems() {
- List<SelectItem> list = new ArrayList<SelectItem>(4);
- list.add(new SelectItem(Long.valueOf(1L), FULL));
- list.add(new SelectItem(Long.valueOf(2L), MEDIUM));
- list.add(new SelectItem(Long.valueOf(3L), SMALL));
- return list;
- }
-
- public Long getScaleChoice() {
- return scaleChoice;
- }
-
- public void setScaleChoice(Long scaleChoice) {
- this.scaleChoice = scaleChoice;
- }
-
- public void selectFormat(String format){
- setCurrentFormat(format);
- }
-
- public String getCurrentFormat() {
- return currentFormat;
- }
-
- public void setCurrentFormat(String currentFormat) {
- this.currentFormat = currentFormat;
- }
-
- public String getPath() {
- return path;
- }
-
- public void setPath(String path) {
- this.path = path;
- }
-
- public void setScale(Long choice){
- setScaleChoice(choice);
- }
-}
Deleted: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/navigation/NavigationHelper.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/navigation/NavigationHelper.java 2009-03-11 10:50:56 UTC (rev 12914)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/navigation/NavigationHelper.java 2009-03-11 10:54:51 UTC (rev 12915)
@@ -1,80 +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.navigation;
-
-import java.io.Serializable;
-
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-
-@Name(value="navigationHelper")
-(a)Scope(ScopeType.CONVERSATION)
-public class NavigationHelper implements Serializable{
-
- private static final long serialVersionUID = -89683694316344212L;
-
- private NavigationEnum navigationEnum;
-
- public NavigationEnum getNavigationEnumUserPrefs(){
- return NavigationEnum.USER_PREFS;
- }
-
- public NavigationEnum getNavigationEnumWhatNew(){
- return NavigationEnum.WHAT_NEW;
- }
-
- public NavigationEnum getNavigationEnumSearch(){
- return NavigationEnum.SEARCH;
- }
-
- public NavigationEnum getNavigationEnumImagePreview(){
- return NavigationEnum.IMAGE_PREVIEW;
- }
-
- public NavigationEnum getNavigationEnumFileUpload(){
- return NavigationEnum.FILE_UPLOAD;
- }
-
- public NavigationEnum getNavigationEnumAlbumPreview(){
- return NavigationEnum.ALBUM_PREVIEW;
- }
-
- public NavigationEnum getNavigationEnumShelfPreview(){
- return NavigationEnum.SHELF_PREVIEW;
- }
-
- public NavigationEnum getNavigationEnumAllImages(){
- return NavigationEnum.ALL_IMAGES;
- }
-
- public NavigationEnum getNavigationEnumAllAlbums(){
- return NavigationEnum.ALL_ALBUMS;
- }
-
- public NavigationEnum getNavigationEnumAllShelfs(){
- return NavigationEnum.ALL_SHELFS;
- }
-
- public NavigationEnum getNavigationEnumTags(){
- return NavigationEnum.TAGS;
- }
-}
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-03-11 10:50:56 UTC (rev 12914)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/ISearchOption.java 2009-03-11 10:54:51 UTC (rev 12915)
@@ -27,7 +27,6 @@
public abstract void search(ISearchAction action, String searchQuery, boolean searchInMyAlbums, boolean searchInShared);
-
public boolean getSelected() {
return selected;
}
@@ -48,7 +47,6 @@
public void setSearchResult(List<?> searchResult) {
this.searchResult = searchResult;
}
-
-
+
}
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-03-11 10:50:56 UTC (rev 12914)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/ImageSearchHelper.java 2009-03-11 10:54:51 UTC (rev 12915)
@@ -12,9 +12,11 @@
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Out;
import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.core.Events;
import org.richfaces.realworld.navigation.NavigationEnum;
+import org.richfaces.realworld.service.Constants;
import org.richfaces.realworld.service.ISearchAction;
-import org.richfaces.realworld.util.ConversationState;
+import org.richfaces.realworld.util.Controller;
@Name("searchImageHelper")
@Scope(ScopeType.CONVERSATION)
@@ -22,9 +24,6 @@
private static final long serialVersionUID = -304368268896942902L;
- @In(required=false)
- ConversationState conversationState;
-
@In(create=true, required=true)
ISearchAction searchAction;
@@ -49,7 +48,7 @@
}
public void search(ActionEvent event) {
- conversationState.setMainArea(NavigationEnum.SEARCH);
+ Events.instance().raiseEvent(Constants.UPDATE_MAIN_AREA_EVENT, NavigationEnum.SEARCH);
Iterator<ISearchOption> it = options.iterator();
while (it.hasNext()) {
ISearchOption option = it.next();
@@ -89,12 +88,10 @@
return (isOptionSelected()) ? selectedOption.getTemplate() : "/includes/search/searchOptions.xhtml";
}
-
public ISearchOption getSelectedOption() {
return selectedOption;
}
-
public void setSelectedOption(ISearchOption selectedOption) {
this.selectedOption = selectedOption;
}
@@ -140,7 +137,4 @@
this.searchInShared = searchInShared;
}
-
-
-
}
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-03-11 10:50:56 UTC (rev 12914)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/SearchOptionByAlbum.java 2009-03-11 10:54:51 UTC (rev 12915)
@@ -43,7 +43,5 @@
public void setParams(Map<String, Object> params) {
this.params = params;
}
-
-
}
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-03-11 10:50:56 UTC (rev 12914)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/SearchOptionByImage.java 2009-03-11 10:54:51 UTC (rev 12915)
@@ -55,8 +55,5 @@
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/SearchOptionByTag.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/SearchOptionByTag.java 2009-03-11 10:50:56 UTC (rev 12914)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/SearchOptionByTag.java 2009-03-11 10:54:51 UTC (rev 12915)
@@ -53,5 +53,4 @@
setSearchResult(action.searchByTags(searchQuery, searchInMyAlbums, searchInShared));
}
-
}
Deleted: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/servlet/PictureServlet.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/servlet/PictureServlet.java 2009-03-11 10:50:56 UTC (rev 12914)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/servlet/PictureServlet.java 2009-03-11 10:54:51 UTC (rev 12915)
@@ -1,155 +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.servlet;
-
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URLDecoder;
-
-import javax.persistence.EntityManager;
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.jboss.seam.Component;
-import org.richfaces.realworld.domain.Image;
-import org.richfaces.realworld.domain.User;
-import org.richfaces.realworld.fileupload.FileManager;
-import org.richfaces.realworld.service.Constants;
-
-public class PictureServlet extends javax.servlet.http.HttpServlet {
-
- private String uploadRoot;
-
- public static final long serialVersionUID = 596009789004L;
-
- protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
- String pathInfo = request.getPathInfo();
- String fileName = URLDecoder.decode(WebUtil.getFileName(pathInfo), "UTF8");
- if(!isAccessGranted(request, response, fileName)){
- sendToErrorPage(request, response);
- return;
- }
- byte[] data = getImageData(request, response, fileName);
- if(data == null){
- sendToErrorPage(request, response);
- return;
- }
- response.setContentType(Constants.IMAGE_JPG);
- response.setContentLength((int) data.length - 1);
- response.getOutputStream().write(data);
- response.getOutputStream().flush();
- response.getOutputStream().close();
- }
-
- private byte[] getImageData(HttpServletRequest request,
- HttpServletResponse response, String fileName) throws IOException {
- if (fileName == null) {
- return null;
- }
- FileManager fileManager = new FileManager();
- fileManager.setUploadRoot(this.uploadRoot);
- File file = fileManager.getImage(fileName);
- InputStream paintData = null;
- byte[] data = new byte[(int) file.length() - 1];
- FileInputStream fileInputStream = null;
- BufferedInputStream bufferedInputStream = null;
- if (file != null) {
- try {
- fileInputStream = new FileInputStream(file);
- bufferedInputStream = new BufferedInputStream(fileInputStream);
- paintData = bufferedInputStream;
- paintData.read(data);
- } catch (FileNotFoundException e) {
- return null;
- } catch (IOException e) {
- return null;
- } finally {
- try {
- fileInputStream.close();
- } catch (IOException e) {
- return null;
- }
- try {
- bufferedInputStream.close();
- } catch (IOException e) {
- return null;
- }
- try {
- paintData.close();
- } catch (IOException e) {
- return null;
- }
- }
- }
- return data;
- }
-
- private boolean isAccessGranted(HttpServletRequest request,
- HttpServletResponse response, String pathInfo) throws IOException {
- String userId = request.getParameter(Constants.USER_ID);
- String hash = request.getParameter("passwordHash");
- EntityManager em = (EntityManager)Component.getInstance(Constants.ENTITY_MANAGER, true);
- User user = null;
- if(userId != null && userId.length() > 0 && hash != null){
- user = em.find(User.class, Long.valueOf(userId));
- }
- Image i = (Image)em.createQuery("from Image i where i.path=:path").setParameter(Constants.PATH_PARAMETER, pathInfo).getSingleResult();
- if(!i.getAlbum().isShared()){
- if(user != null){
- if(i.getAlbum().getOwner().equals(user) && user.getPasswordHash().equals(hash)){
- //OK
- }else{
- return false;
- }
- }else{
- return false;
- }
- }
- return true;
- }
-
- private void sendToErrorPage(HttpServletRequest request,
- HttpServletResponse response) throws IOException {
- String contextPath = request.getContextPath();
- response.sendRedirect(contextPath + Constants.ERROR_PAGE);
- return;
- }
-
- @Override
- public void init(ServletConfig config) throws ServletException {
- super.init(config);
-
- this.uploadRoot = config.getServletContext().getInitParameter(Constants.UPLOAD_ROOT);
- }
-
- @Override
- public void destroy() {
- super.destroy();
-
- this.uploadRoot = null;
- }
-}
Deleted: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/servlet/WebUtil.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/servlet/WebUtil.java 2009-03-11 10:50:56 UTC (rev 12914)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/servlet/WebUtil.java 2009-03-11 10:54:51 UTC (rev 12915)
@@ -1,53 +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.servlet;
-
-public class WebUtil {
-
- public static String getFileName(String path) {
- // Path format is "/file_name.jpg"
- if (path != null && path.length() > 1) {
- String fileName = path.substring(1);
- int dotIndex = fileName.indexOf('.');
- String extention = fileName.substring(dotIndex + 1);
- if (extention.equals(Extention.jpg.getExtention())
- || extention.equals(Extention.jpeg.getExtention()))
- {
- return fileName;
- }
- }
- return null;
- }
-
- enum Extention {
- jpg("jpg"), jpeg("jpeg");
-
- Extention(String extention) {
- this.extention = extention;
- }
-
- private String extention;
-
- String getExtention() {
- return this.extention;
- }
- }
-}
\ No newline at end of file
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/user/UserPrefsBean.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/user/UserPrefsBean.java 2009-03-11 10:50:56 UTC (rev 12914)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/user/UserPrefsBean.java 2009-03-11 10:54:51 UTC (rev 12915)
@@ -15,7 +15,9 @@
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.core.Events;
import org.richfaces.event.UploadEvent;
import org.richfaces.model.UploadItem;
import org.richfaces.realworld.domain.Sex;
@@ -23,9 +25,9 @@
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.util.Controller;
+import org.richfaces.realworld.util.Model;
-
/**
* @author Andrey Markavtsov
*
@@ -34,12 +36,11 @@
@Scope(ScopeType.CONVERSATION)
public class UserPrefsBean {
- @In(value="conversationState", create=true)
- ConversationState conversationState;
-
@In(create=true)
IUserAction userAction;
+ @In @Out Model model;
+
@In
User user;
@@ -62,10 +63,9 @@
new SelectItem(Sex.FEMALE, "Female")
};
-
public void clickUserListener(ActionEvent event) {
- conversationState.setMainArea(NavigationEnum.USER_PREFS);
- conversationState.setSelectedUser(user);
+ Events.instance().raiseEvent(Constants.UPDATE_MAIN_AREA_EVENT, NavigationEnum.USER_PREFS);
+ model.setSelectedUser(user);
}
public void uploadAvatar(UploadEvent event) {
@@ -74,7 +74,7 @@
}
public void saveUser(ActionEvent event)throws IOException {
- User user = conversationState.getSelectedUser();
+ User user = model.getSelectedUser();
if (avatarData != null) {
String fileName = uploadRoot +
(uploadRoot.endsWith(Constants.SLASH) ? "" : Constants.SLASH) +
@@ -128,6 +128,4 @@
public void setAvatarData(File avatarData) {
this.avatarData = avatarData;
}
-
-
}
Copied: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/Controller.java (from rev 12910, trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/ConversationState.java)
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/Controller.java (rev 0)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/Controller.java 2009-03-11 10:54:51 UTC (rev 12915)
@@ -0,0 +1,171 @@
+/**
+ * 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.Serializable;
+import java.util.Map;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+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.Synchronized;
+import org.jboss.seam.core.Events;
+import org.richfaces.component.UIDatascroller;
+import org.richfaces.realworld.domain.Album;
+import org.richfaces.realworld.domain.Image;
+import org.richfaces.realworld.domain.Shelf;
+import org.richfaces.realworld.domain.User;
+import org.richfaces.realworld.navigation.NavigationEnum;
+import org.richfaces.realworld.service.Constants;
+
+@Name("controller")
+(a)Scope(ScopeType.CONVERSATION)
+@Synchronized(timeout=200000)
+public class Controller implements Serializable{
+
+ private static final long serialVersionUID = 5656562187249324512L;
+
+ @In("#{messages['acess_not_granted']}")
+ private String HAVENT_ACCESS;
+
+ @In @Out Model model;
+
+ @In(create=true)
+ private User user;
+
+ public void selectShelfs(){
+ model.resetModel(NavigationEnum.ALL_SHELFS, user, null, null, null, null );
+ }
+
+ public void selectAlbums(){
+ model.resetModel(NavigationEnum.ALL_ALBUMS, user, null, null, null, null );
+ }
+
+ public void selectImages(){
+ model.resetModel(NavigationEnum.ALL_IMAGES, user, null, null, null, null );
+ }
+
+ public void incrementSlideShowIndex(){
+ Integer index = model.getSelectedAlbum().getIndex(model.getSelectedImage());
+ if(index == -1){
+ if(model.getSelectedAlbum().getImages() != null && model.getSelectedAlbum().getImages().size() > 1){
+ index = model.getSelectedAlbum().getIndex(model.getSelectedAlbum().getImages().get(1));
+ }else{
+ pushEvent("stopSlideshow");
+ return;
+ }
+ }
+ updateDataScroller(index, Constants.DATASCROLLER2_ID);
+ if(index == model.getSelectedAlbum().getImages().size() - 1){
+ index=-1;
+ }
+ model.setSelectedImageIndex(index+1);
+ model.setSelectedImage(model.getSelectedAlbum().getImages().get(index + 1));
+ }
+
+ public void startEditShelf(Shelf shelf){
+ if(!canViewShelf(shelf)){
+ pushEvent(Constants.ADD_ERROR_EVENT, new Exception(HAVENT_ACCESS));
+ return;
+ }
+ model.setMainArea(NavigationEnum.SHELF_EDIT);
+ }
+
+ public void cancelEditShelf(Shelf shelf){
+ model.setMainArea(NavigationEnum.SHELF_PREVIEW);
+ }
+
+ public void showAlbum(Album album){
+ if(!canViewAlbum(album)){
+ pushEvent(Constants.ADD_ERROR_EVENT, new Exception(HAVENT_ACCESS));
+ return;
+ }
+ model.resetModel(NavigationEnum.ALBUM_PREVIEW, album.getOwner(), album.getShelf(), album, null, null );
+ }
+
+ public void showImage(Image image){
+ if(!canViewImage(image)){
+ pushEvent(Constants.ADD_ERROR_EVENT, new Exception(HAVENT_ACCESS));
+ return;
+ }
+ model.resetModel(NavigationEnum.ALBUM_IMAGE_PREVIEW, image.getAlbum().getOwner(), image.getAlbum().getShelf(), image.getAlbum(), null, null );
+ model.setSelectedImage(image);
+ Integer index = model.getSelectedAlbum().getIndex(model.getSelectedImage());
+ updateDataScroller(index, Constants.DATASCROLLER_ID);
+ model.setSelectedImageIndex(index+1);
+ }
+
+ public void startEditImage(Image image){
+ if(!canViewImage(image)){
+ pushEvent(Constants.ADD_ERROR_EVENT, new Exception(HAVENT_ACCESS));
+ return;
+ }
+ model.setMainArea(NavigationEnum.ALBUM_IMAGE_EDIT);
+ }
+
+ public void cancelEditImage(Image image){
+ model.setMainArea(NavigationEnum.ALBUM_IMAGE_PREVIEW);
+ }
+
+ public void startEditAlbum(Album album){
+ if(album.getOwner().equals(user)){
+ pushEvent(Constants.ADD_ERROR_EVENT, new Exception(HAVENT_ACCESS));
+ return;
+ }
+ model.setMainArea(NavigationEnum.ALBUM_EDIT);
+ }
+
+ public void cancelEditAlbum(Album album){
+ model.setMainArea(NavigationEnum.ALBUM_PREVIEW);
+ }
+
+ public void showFileUpload(){
+ model.setMainArea(NavigationEnum.FILE_UPLOAD);
+ }
+
+ private void updateDataScroller(Integer index, String dataScrollerId) {
+ UIComponent component = FacesContext.getCurrentInstance().getViewRoot();
+ UIDatascroller scroller = (UIDatascroller)component.findComponent(dataScrollerId);
+ Map<String, Object> attributes = scroller.getDataTable().getAttributes();
+ attributes.put(UIDatascroller.SCROLLER_STATE_ATTRIBUTE, index+1);
+ }
+
+ private boolean canViewShelf(Shelf shelf) {
+ return shelf.isShared() || shelf.getOwner().equals(user);
+ }
+
+ private boolean canViewImage(Image image) {
+ return image.getAlbum().getShelf().isShared() || image.getAlbum().getOwner().equals(user);
+ }
+
+ private boolean canViewAlbum(Album album) {
+ return album.getShelf().isShared() || album.getOwner().equals(user);
+ }
+
+ private void pushEvent(String type, Object... parameters) {
+ Events.instance().raiseEvent(type, parameters);
+ }
+}
\ No newline at end of file
Added: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/Model.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/Model.java (rev 0)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/Model.java 2009-03-11 10:54:51 UTC (rev 12915)
@@ -0,0 +1,99 @@
+package org.richfaces.realworld.util;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Observer;
+import org.jboss.seam.annotations.Scope;
+import org.richfaces.realworld.domain.Album;
+import org.richfaces.realworld.domain.Image;
+import org.richfaces.realworld.domain.MetaTag;
+import org.richfaces.realworld.domain.Shelf;
+import org.richfaces.realworld.domain.User;
+import org.richfaces.realworld.navigation.NavigationEnum;
+import org.richfaces.realworld.service.Constants;
+
+@Name("model")
+(a)Scope(ScopeType.CONVERSATION)
+public class Model {
+
+private Integer selectedImageIndex = 1;
+
+ private Image selectedImage;
+
+ private Album selectedAlbum;
+
+ private User selectedUser;
+
+ private Shelf selectedShelf;
+
+ private MetaTag selectedTag;
+
+ private NavigationEnum mainArea;
+
+ public void resetModel(NavigationEnum mainArea, User selectedUser, Shelf selectedShelf, Album selectedAlbum, Image selectedImage, MetaTag selectedTag){
+ this.setMainArea(mainArea);
+ this.setSelectedAlbum(selectedAlbum);
+ this.setSelectedImage(selectedImage);
+ this.setSelectedShelf(selectedShelf);
+ this.setSelectedTag(selectedTag);
+ this.setSelectedUser(selectedUser);
+ }
+
+ @Observer(Constants.UPDATE_MAIN_AREA_EVENT)
+ public void setMainArea(NavigationEnum mainArea) {
+ this.mainArea = mainArea;
+ }
+
+ public Integer getSelectedImageIndex() {
+ return selectedImageIndex;
+ }
+
+ public NavigationEnum getMainArea() {
+ return mainArea;
+ }
+
+ public void setSelectedImageIndex(Integer selectedImageIndex) {
+ this.selectedImageIndex = selectedImageIndex;
+ }
+
+ public Image getSelectedImage() {
+ return selectedImage;
+ }
+
+ public void setSelectedImage(Image selectedImage) {
+ this.selectedImage = selectedImage;
+ }
+
+ public Album getSelectedAlbum() {
+ return selectedAlbum;
+ }
+
+ public void setSelectedAlbum(Album selectedAlbum) {
+ this.selectedAlbum = selectedAlbum;
+ }
+
+ public User getSelectedUser() {
+ return selectedUser;
+ }
+
+ public void setSelectedUser(User selectedUser) {
+ this.selectedUser = selectedUser;
+ }
+
+ public Shelf getSelectedShelf() {
+ return selectedShelf;
+ }
+
+ public void setSelectedShelf(Shelf selectedShelf) {
+ this.selectedShelf = selectedShelf;
+ }
+
+ public MetaTag getSelectedTag() {
+ return selectedTag;
+ }
+
+ @Observer("updateSelectedTag")
+ public void setSelectedTag(MetaTag selectedTag) {
+ this.selectedTag = selectedTag;
+ }
+}
Property changes on: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/Model.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/RenderLogic.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/RenderLogic.java 2009-03-11 10:50:56 UTC (rev 12914)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/RenderLogic.java 2009-03-11 10:54:51 UTC (rev 12915)
@@ -28,9 +28,7 @@
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.security.Identity;
import org.richfaces.realworld.domain.Album;
-import org.richfaces.realworld.domain.Image;
import org.richfaces.realworld.domain.User;
-import org.richfaces.realworld.navigation.NavigationEnum;
import org.richfaces.realworld.service.Constants;
@Name("renderLogic")
@@ -39,69 +37,15 @@
@In User user;
@In Identity identity;
- @In ConversationState conversationState;
private static final long serialVersionUID = 5656562187249324512L;
- public boolean shouldRenderShelf(){
- return conversationState.getSelectedUser()!=null && conversationState.getSelectedImage() == null && conversationState.getSelectedShelf() != null && conversationState.getSelectedAlbum() == null;
- }
-
- public boolean shouldRenderShelfs(){
- return conversationState.getSelectedUser()!=null && conversationState.getSelectedImage() == null && conversationState.getSelectedShelf() == null;
- }
-
- public boolean shouldRenderImage(){
- return conversationState.getSelectedAlbum()!=null && conversationState.getSelectedImage() != null;
- }
-
- public boolean shouldRenderImageList(){
- return conversationState.getSelectedAlbum()!=null && conversationState.getSelectedImage() == null;
- }
-
- public boolean isCurrentUserProfileSelected(){
- return user.equals(conversationState.getSelectedUser());
- }
-
- public boolean isSecondUserProfileSelected(){
- return conversationState.getSecondSelectedUser() != null;
- }
-
- public boolean isUserAlbumSelected(){
- return conversationState.getSelectedAlbum() != null && conversationState.getSelectedAlbum().getOwner().equals(user);
- }
-
public boolean isUserGuest(){
return !identity.hasRole(Constants.ADMIN_ROLE);
}
- public boolean isOwner(User u){
- return user.equals(u);
- }
-
- public boolean isProfileSelected(){
- return conversationState.getMainArea() == NavigationEnum.USER_PREFS;
- }
-
- public boolean shouldRenderFileUpload(){
- return conversationState.getSelectedAlbum()!=null && conversationState.getSelectedAlbum().getOwner().equals(user);
- }
-
- public boolean isUserSelected(){
- return user.equals(conversationState.getSelectedUser());
- }
-
-
- public boolean isAlbumSelected(){
- return conversationState.getSelectedAlbum() != null;
- }
-
- public boolean isImageSelected(){
- return conversationState.getSelectedImage() != null;
- }
-
public boolean isAccessToAlbumGranted(Album album){
- return album.getOwner().equals(user) || album.isShared();
+ return album.getOwner().equals(user) || album.getShelf().isShared();
}
public boolean isUserAlbum(Album album){
@@ -110,13 +54,4 @@
}
return album.getOwner().equals(user);
}
-
- public boolean isFavoriteAlbum(Album album){
- return user.getFavoriteAlbums().contains(album);
- }
-
- public boolean isFavoriteImage(Image image){
- return user.getFavoriteImages().contains(image);
- }
-
}
Added: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/TreeManager.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/TreeManager.java (rev 0)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/TreeManager.java 2009-03-11 10:54:51 UTC (rev 12915)
@@ -0,0 +1,69 @@
+package org.richfaces.realworld.util;
+
+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.Out;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.core.Events;
+import org.richfaces.component.UITree;
+import org.richfaces.component.html.HtmlTree;
+import org.richfaces.event.NodeSelectedEvent;
+import org.richfaces.realworld.domain.Album;
+import org.richfaces.realworld.domain.Shelf;
+import org.richfaces.realworld.domain.User;
+import org.richfaces.realworld.navigation.NavigationEnum;
+import org.richfaces.realworld.service.Constants;
+
+@Name("treeManager")
+(a)Scope(ScopeType.CONVERSATION)
+public class TreeManager implements Serializable{
+
+ @In
+ private User user;
+ @In @Out Model model;
+ private static final long serialVersionUID = 5656562187249324512L;
+
+ @SuppressWarnings("unchecked")
+ public Boolean adviseNodeSelected(UITree tree) {
+ Object currentNode = tree.getRowData();
+ if (currentNode instanceof Album) {
+ boolean selected = currentNode == model.getSelectedAlbum();
+ return selected;
+ }else if(currentNode instanceof Shelf){
+ return currentNode == model.getSelectedShelf() && model.getSelectedAlbum() == null;
+ }
+ return null;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Boolean adviseNodeOpened(UITree tree) {
+ Object currentNode = tree.getRowData();
+ if (currentNode instanceof Album) {
+ boolean selected = currentNode == model.getSelectedAlbum();
+ return selected;
+ }else if(currentNode instanceof Shelf){
+ return currentNode == model.getSelectedShelf();
+ }
+ return null;
+ }
+
+ @SuppressWarnings("unchecked")
+ public void processSelection(NodeSelectedEvent event) {
+ HtmlTree tree = (HtmlTree) event.getComponent();
+ Object currentNode = tree.getRowData();
+ if(currentNode instanceof Album){
+ Events.instance().raiseEvent(Constants.UPDATE_MAIN_AREA_EVENT, NavigationEnum.ALBUM_PREVIEW);
+ model.setSelectedAlbum((Album)currentNode);
+ model.setSelectedShelf(((Album)currentNode).getShelf());
+ }else if(currentNode instanceof Shelf){
+ Events.instance().raiseEvent(Constants.UPDATE_MAIN_AREA_EVENT, NavigationEnum.SHELF_PREVIEW);
+ model.setSelectedAlbum(null);
+ model.setSelectedShelf((Shelf)currentNode);
+ }
+ model.setSelectedUser(user);
+ model.setSelectedImage(null);
+ }
+}
Property changes on: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/TreeManager.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified: trunk/test-applications/realworld2/web/src/main/resources/messages_en.properties
===================================================================
--- trunk/test-applications/realworld2/web/src/main/resources/messages_en.properties 2009-03-11 10:50:56 UTC (rev 12914)
+++ trunk/test-applications/realworld2/web/src/main/resources/messages_en.properties 2009-03-11 10:54:51 UTC (rev 12915)
@@ -90,7 +90,7 @@
error=Error
errorStub=Something bad happened :-(
-fileUpload.header=You will upload files in album: #{conversationState.selectedAlbum.name}. If you want upload in another album, select it.
+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:
@@ -101,7 +101,7 @@
fileUpload.clearLabel=Clear Uploaded Data
fileUpload.clearSelectedLabel=Clear Selected
-comment.label=View comments(#{conversationState.selectedImage.comments.size})
+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
@@ -157,9 +157,9 @@
scroller.last=Last
scroller.prev=Prev
scroller.next=Next
-scroller.pager=Image #{conversationState.selectedImageIndex} of #{conversationState.selectedAlbum.images.size}
+scroller.pager=Image #{model.selectedImageIndex} of #{model.selectedAlbum.images.size}
-image.panelHeader=Image Preview: Selected Album: #{conversationState.selectedAlbum.name}
+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
Modified: trunk/test-applications/realworld2/web/src/main/resources/messages_ru.properties
===================================================================
--- trunk/test-applications/realworld2/web/src/main/resources/messages_ru.properties 2009-03-11 10:50:56 UTC (rev 12914)
+++ trunk/test-applications/realworld2/web/src/main/resources/messages_ru.properties 2009-03-11 10:54:51 UTC (rev 12915)
@@ -31,7 +31,7 @@
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\: \#{conversationState.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.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\:
@@ -42,7 +42,7 @@
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 (\#{conversationState.selectedImage.comments.size})
+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.
@@ -97,9 +97,9 @@
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 \#{conversationState.selectedImageIndex} \u0438\u0437 \#{conversationState.selectedAlbum.images.size}
+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\: \#{conversationState.selectedAlbum.name}
+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
Modified: trunk/test-applications/realworld2/web/src/main/webapp/Thumbs.db
===================================================================
(Binary files differ)
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-03-11 10:50:56 UTC (rev 12914)
+++ trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/tags/realWorld-taglib.xml 2009-03-11 10:54:51 UTC (rev 12915)
@@ -16,14 +16,6 @@
<tag-name>confirm</tag-name>
<source>templates/confirmation.xhtml</source>
</tag>
- <tag>
- <tag-name>image</tag-name>
- <source>templates/image.xhtml</source>
- </tag>
- <tag>
- <tag-name>linkPanel</tag-name>
- <source>templates/linkPanel.xhtml</source>
- </tag>
<function>
<function-name>rectangle</function-name>
<function-class>org.richfaces.realworld.util.Functions</function-class>
Deleted: trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/tags/templates/image.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/tags/templates/linkPanel.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/web.xml 2009-03-11 10:50:56 UTC (rev 12914)
+++ trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/web.xml 2009-03-11 10:54:51 UTC (rev 12915)
@@ -111,16 +111,6 @@
<url-pattern>*.seam</url-pattern>
</servlet-mapping>
- <servlet>
- <servlet-name>Picture Servlet</servlet-name>
- <servlet-class>org.richfaces.realworld.servlet.PictureServlet</servlet-class>
- <load-on-startup>2</load-on-startup>
- </servlet>
- <servlet-mapping>
- <servlet-name>Picture Servlet</servlet-name>
- <url-pattern>/picture/*</url-pattern>
- </servlet-mapping>
-
<security-constraint>
<display-name>Restrict raw XHTML Documents</display-name>
<web-resource-collection>
Modified: trunk/test-applications/realworld2/web/src/main/webapp/img/Thumbs.db
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld2/web/src/main/webapp/img/dtpick.gif
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld2/web/src/main/webapp/img/error.gif
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld2/web/src/main/webapp/img/folder.jpg
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld2/web/src/main/webapp/img/gb.png
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld2/web/src/main/webapp/img/locked.jpg
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld2/web/src/main/webapp/img/logo.gif
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld2/web/src/main/webapp/img/ru.png
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld2/web/src/main/webapp/img/tree/disc.gif
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld2/web/src/main/webapp/img/tree/singer.gif
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld2/web/src/main/webapp/img/tree/song.gif
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/album/userAlbumEditBlock.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/album/userAlbumsPreview.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/fileUploader.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/fileUpload/multyMode.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld2/web/src/main/webapp/includes/image/breadCrumb.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld2/web/src/main/webapp/includes/image/comments.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/image/imagePreview.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld2/web/src/main/webapp/includes/image/imageScroller.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/image/mainImage.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/image/shelf.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/image/shelfs.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/image/slideshow.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/image/userImageEditBlock.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/image/userImageMainBlock.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/image/userImagePreviewBlock.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/image/userImagesPreview.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld2/web/src/main/webapp/includes/imagePreview-backup.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld2/web/src/main/webapp/includes/imagePreview.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)
Deleted: trunk/test-applications/realworld2/web/src/main/webapp/includes/news/recent.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld2/web/src/main/webapp/includes/panelBar/favoriteAlbums.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/search/result/albumsResult.xhtml
===================================================================
--- trunk/test-applications/realworld2/web/src/main/webapp/includes/search/result/albumsResult.xhtml 2009-03-11 10:50:56 UTC (rev 12914)
+++ trunk/test-applications/realworld2/web/src/main/webapp/includes/search/result/albumsResult.xhtml 2009-03-11 10:54:51 UTC (rev 12915)
@@ -11,16 +11,16 @@
<h:panelGrid id="grid" columns="1">
<h:panelGroup id="group">
<a4j:commandLink
- action="#{conversationState.setMainArea(navigationHelper.navigationEnumImagePreview)}"
- actionListener="#{conversationState.setSelectedAlbum(album)}"
+ action="#{model.setMainArea(navigationHelper.navigationEnumImagePreview)}"
+ actionListener="#{model.setSelectedAlbum(album)}"
reRender="mainArea, tree">
<h:graphicImage
style="width:100px;height:100px" id="image" value="/img/folder.jpg" />
</a4j:commandLink>
</h:panelGroup>
<a4j:commandLink
- action="#{conversationState.setMainArea(navigationHelper.navigationEnumImagePreview)}"
- actionListener="#{conversationState.setSelectedAlbum(album)}"
+ action="#{model.setMainArea(navigationHelper.navigationEnumImagePreview)}"
+ actionListener="#{model.setSelectedAlbum(album)}"
reRender="mainArea, tree" value="#{album.name}">
</a4j:commandLink>
</h:panelGrid>
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-03-11 10:50:56 UTC (rev 12914)
+++ trunk/test-applications/realworld2/web/src/main/webapp/includes/search/result/imageResult.xhtml 2009-03-11 10:54:51 UTC (rev 12915)
@@ -10,7 +10,7 @@
<tr>
<td style="text-align: center;vertical-align: middle; background: white;border: 1px solid #909090">
<a4j:commandLink
- actionListener="#{conversationState.updateSelectedItems(item)}"
+ actionListener="#{controller.showImage(item)}"
reRender="mainArea">
<a4j:mediaOutput element="img" createContent="#{imageLoader.paintImage}"
styleClass="all-images"
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/shelf/userShelfEditBlock.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/shelf/userShelfPreview.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/userAlbum.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/userAlbumEdit.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/userImages.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld2/web/src/main/webapp/includes/userPrefs/loginPrefsTab.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/userPrefs.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/userShelf.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/userShelfEdit.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/index.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld2/web/src/main/webapp/layout/menu-backup.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/layout/menu.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld2/web/src/main/webapp/layout/panelBar-backup.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld2/web/src/main/webapp/layout/panelBar.xhtml
===================================================================
(Binary files differ)
Copied: trunk/test-applications/realworld2/web/src/main/webapp/layout/panelBar.xhtml (from rev 12865, trunk/test-applications/realworld2/web/src/main/webapp/layout/panelBar-backup.xhtml)
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld2/web/src/main/webapp/layout/template.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld2/web/src/main/webapp/layout/template2.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/layout/template3.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/main.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld2/web/src/main/webapp/stylesheet/realworld.css
===================================================================
--- trunk/test-applications/realworld2/web/src/main/webapp/stylesheet/realworld.css 2009-03-11 10:50:56 UTC (rev 12914)
+++ trunk/test-applications/realworld2/web/src/main/webapp/stylesheet/realworld.css 2009-03-11 10:54:51 UTC (rev 12915)
@@ -1,135 +0,0 @@
-body {
- font-size: 12px;
-}
-
-header {
- width: 120px;
- height: 200px;
- border: 1px solid #FFCC00;
- padding: 5px;
- margin-top: 5px;
- margin-bottom: 5px;
-}
-
-a:active, a:link, a:visited {
- color: #0D5798;
-}
-a:hover {
- color: #8CAFCD;
-}
-
-input, textarea {
- border: 1px solid #BBBBBB;
- font-size: 10px;
- background: #F0F8FF;
- color: black;
-}
-
-input[type='submit'], input[type='button'] {
- background: #4477AA;
- color: white;
- margin: 5px;
- border-color: gray;
-}
-
-.tableControl, .actionButtons {
- width: 100%;
-}
-
-.tableControl a {
- padding-left: 10px;
-}
-
-.tableControl {
- text-align: right;
-}
-
-.footer {
- text-align: center;
- font-size: 10px;
-}
-
-.rich-table {
- width:100%;
-}
-
-h1 {
- font-family: Arial,sans-serif;
- color: #578BB8;
- font-size: 1.6em;
- margin-top: 0;
-}
-
-body {
- margin: 0px;
- font-family: Arial,sans-serif;
- color: #616161;
-}
-
-.body {
- padding: 30px;
-}
-
-.columnHeader:hover
-{
- color: #FF6600;
-}
-
-.message {
- border: 1px solid #FFCC00;
- padding: 5px;
- margin-top: 5px;
- margin-bottom: 5px;
- background-color: #F0F8FF;
- font-size: 12px;
- color: red;
-}
-
-.name {
- vertical-align: top;
- font-weight: bold;
- width: 115px;
- float: left;
- padding: 5px;
- margin-top: 3px;
- clear: left;
-}
-.value {
- float: left;
- padding: 5px;
-}
-
-.error {
- float: left;
- padding: 5px;
- color: red;
-}
-.errors {
- color: red;
- vertical-align: middle;
-}
-img.errors {
- padding-right: 5px;
-}
-.errors input {
- border: 1px solid red;
-}
-.errors textarea {
- border: 1px solid red;
-}
-
-.required {
- color: red;
- padding-left: 2px;
-}
-
-.rich-stglpanel-body {
- overflow: auto;
-}
-.top {
- vertical-align: top;
-}
-.info {
- height: 202px;
- overflow: auto;
-}
15 years, 10 months
JBoss Rich Faces SVN: r12914 - in trunk/test-applications/realworld2: ejb/src/main/java/org/richfaces/realworld/domain and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2009-03-11 06:50:56 -0400 (Wed, 11 Mar 2009)
New Revision: 12914
Modified:
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Album.java
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Image.java
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/MetaTag.java
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Sex.java
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Shelf.java
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/User.java
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/AlbumAction.java
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/IAlbumAction.java
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/IUserAction.java
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/SearchAction.java
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/ShelfAction.java
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/UserAction.java
trunk/test-applications/realworld2/ejb/src/main/resources/import.sql
trunk/test-applications/realworld2/pom.xml
Log:
Modified: trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Album.java
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Album.java 2009-03-11 10:48:53 UTC (rev 12913)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Album.java 2009-03-11 10:50:56 UTC (rev 12914)
@@ -22,7 +22,6 @@
import java.io.Serializable;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.Date;
import java.util.List;
@@ -33,8 +32,6 @@
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
-import javax.persistence.JoinTable;
-import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
@@ -42,7 +39,6 @@
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
-import javax.persistence.Transient;
import org.hibernate.validator.Length;
import org.hibernate.validator.NotEmpty;
@@ -56,11 +52,7 @@
*
* @author Andrey Markhel
*/
-@NamedQueries(
- {
- @NamedQuery(name = "album-byAlbumNameAndLogin", query = "from Album a where a.name=:albumName and a.owner.login=:login")
- }
- )
+@NamedQueries( { @NamedQuery(name = "album-byAlbumNameAndLogin", query = "from Album a where a.name=:albumName and a.owner.login=:login") })
@Entity
@Name("album")
@Table(name = "albums")
@@ -87,31 +79,14 @@
@JoinColumn(name = "ALBUM_USER_ID", referencedColumnName = "USER_ID")
private User owner;
- @ManyToMany(cascade = CascadeType.ALL)
- @JoinTable(name="ALBUMS_METATAGS",
- joinColumns=
- @JoinColumn(name="CI_ALBUM_ID",
- referencedColumnName="ALBUM_ID"),
- inverseJoinColumns=
- @JoinColumn(name="CI_METATAG_ID",
- referencedColumnName="METATAG_ID"))
- protected List<MetaTag> albumTags;
-
- @NotNull
- private boolean shared;
-
@OneToMany(cascade = CascadeType.ALL, mappedBy = "album")
@org.hibernate.annotations.Fetch(org.hibernate.annotations.FetchMode.SUBSELECT)
private List<Image> images = new ArrayList<Image>();
- @ManyToMany(cascade = CascadeType.ALL)
- @JoinTable(name = "SHARED_ALBUMS", joinColumns = @JoinColumn(name = "ALBUM_ID"), inverseJoinColumns = @JoinColumn(name = "USER_ID"))
- private List<User> sharedOwners = new ArrayList<User>();
-
@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinColumn(name = "PARENT_SHELF_ID", nullable = true)
@org.hibernate.annotations.ForeignKey(name = "FK_SHELF_PARENT_ID")
- private Shelf parent;
+ private Shelf shelf;
@Temporal(TemporalType.TIMESTAMP)
private Date created;
@@ -120,12 +95,12 @@
- public Shelf getParent() {
- return parent;
+ public Shelf getShelf() {
+ return shelf;
}
- public void setParent(Shelf parent) {
- this.parent = parent;
+ public void setShelf(Shelf parent) {
+ this.shelf = parent;
}
/**
@@ -218,14 +193,6 @@
}
- public boolean isShared() {
- return shared;
- }
-
- public void setShared(boolean shared) {
- this.shared = shared;
- }
-
public User getOwner() {
return owner;
}
@@ -237,15 +204,7 @@
public void setOwner(User owner) {
this.owner = owner;
}
-
- public List<User> getSharedOwners() {
- return sharedOwners;
- }
-
- public void setSharedOwners(List<User> sharedOwners) {
- this.sharedOwners = sharedOwners;
- }
-
+
public int getIndex(Image image) {
for (int i = 0; i < this.images.size(); i++) {
if (this.images.get(i).equals(image)) {
@@ -254,35 +213,7 @@
}
return -1;
}
-
- public List<MetaTag> getAlbumTags() {
- return albumTags;
- }
-
- public void setAlbumTags(List<MetaTag> albumTags) {
- this.albumTags = albumTags;
- }
- public void addMetaTag(MetaTag metatag) {
- if (metatag == null) {
- throw new IllegalArgumentException("Null metatag!");
- }
- if(!albumTags.contains(metatag)){
- metatag.addAlbum(this);
- albumTags.add(metatag);
- }
- }
-
- public void removeMetaTag(MetaTag metatag) {
- if (metatag == null) {
- throw new IllegalArgumentException("Null metatag!");
- }
- if(albumTags.contains(metatag)){
- metatag.removeAlbum(this);
- albumTags.remove(metatag);
- }
- }
-
public Image getLastImage(){
if(images != null && images.size() > 0){
return images.get(images.size() - 1);
@@ -309,5 +240,4 @@
this.created = created;
}
-
}
Modified: trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Image.java
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Image.java 2009-03-11 10:48:53 UTC (rev 12913)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Image.java 2009-03-11 10:50:56 UTC (rev 12914)
@@ -43,7 +43,6 @@
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
-import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
@@ -123,9 +122,6 @@
@Length(min=3)
private String description;
- @Transient
- private String albumName;
-
@Temporal(TemporalType.TIMESTAMP)
private Date created;
@@ -142,14 +138,6 @@
referencedColumnName="ALBUM_ID")
private Album album;
- @ManyToMany
- @JoinTable(
- name = "SHARED_IMAGES",
- joinColumns = @JoinColumn(name = "IMAGE_ID"),
- inverseJoinColumns = @JoinColumn(name = "USER_ID")
- )
- private List<User> sharedOwners = new ArrayList<User>();
-
@NotNull
private boolean allowComments;
@@ -181,14 +169,6 @@
public void setName(String name) {
this.name = name;
}
-
- public List<User> getSharedOwners() {
- return sharedOwners;
- }
-
- public void setSharedOwners(List<User> sharedOwners) {
- this.sharedOwners = sharedOwners;
- }
/**
* Getter for property description
@@ -231,18 +211,7 @@
public void setAlbum(Album album) {
this.album = album;
}
-
- public String getAlbumName() {
- if(null == albumName && this.getAlbum() != null){
- albumName = this.getAlbum().getName();
- }
- return albumName;
- }
- public void setAlbumName(String albumName) {
- this.albumName = albumName;
- }
-
//---------------------------Business methods
public void addComment(Comment comment) {
@@ -268,7 +237,6 @@
return comments;
}
-
public List<MetaTag> getImageTags() {
return imageTags;
}
@@ -359,5 +327,4 @@
this.allowComments = allowComments;
}
-
}
Modified: trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/MetaTag.java
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/MetaTag.java 2009-03-11 10:48:53 UTC (rev 12913)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/MetaTag.java 2009-03-11 10:50:56 UTC (rev 12914)
@@ -27,9 +27,7 @@
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
-import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
-import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hibernate.validator.Length;
@@ -57,9 +55,6 @@
@ManyToMany(mappedBy="imageTags")
private List<Image> images;
-
- @ManyToMany(mappedBy="albumTags")
- private List<Album> albums;
public Long getId() {
return id;
@@ -80,14 +75,6 @@
public void setImages(List<Image> images) {
this.images = images;
}
-
- public List<Album> getAlbums() {
- return albums;
- }
-
- public void setAlbums(List<Album> albums) {
- this.albums = albums;
- }
public void addImage(Image image){
images.add(image);
@@ -96,12 +83,4 @@
public void removeImage(Image image){
images.remove(image);
}
-
- public void addAlbum(Album album){
- albums.add(album);
- }
-
- public void removeAlbum(Album album){
- albums.remove(album);
- }
}
Modified: trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Sex.java
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Sex.java 2009-03-11 10:48:53 UTC (rev 12913)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Sex.java 2009-03-11 10:50:56 UTC (rev 12914)
@@ -1,6 +1,5 @@
package org.richfaces.realworld.domain;
-
public enum Sex {
MALE("1"),
FEMALE("0");
Modified: trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Shelf.java
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Shelf.java 2009-03-11 10:48:53 UTC (rev 12913)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/Shelf.java 2009-03-11 10:50:56 UTC (rev 12914)
@@ -12,8 +12,6 @@
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
-import javax.persistence.JoinTable;
-import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
@@ -23,9 +21,7 @@
import org.hibernate.validator.Length;
import org.hibernate.validator.NotEmpty;
import org.hibernate.validator.NotNull;
-import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Role;
@Entity
@Name("shelf")
@@ -52,9 +48,9 @@
@JoinColumn(name = "SHELF_USER_ID", referencedColumnName = "USER_ID")
private User owner;
- @OneToMany(mappedBy = "parent", cascade = { CascadeType.ALL })
+ @OneToMany(mappedBy = "shelf", cascade = { CascadeType.ALL })
@org.hibernate.annotations.OrderBy(clause = "NAME asc")
- private List<Album> childAlbums = new ArrayList<Album>();
+ private List<Album> albums = new ArrayList<Album>();
@NotNull
private boolean shared;
@@ -109,8 +105,8 @@
this.description = description;
}
- public List<Album> getChildAlbums() {
- return childAlbums;
+ public List<Album> getAlbums() {
+ return albums;
}
public User getOwner() {
@@ -121,36 +117,35 @@
this.owner = owner;
}
- public void addChildAlbum(Album album) {
+ public void addAlbum(Album album) {
if (album == null)
throw new IllegalArgumentException("Null child!");
- if (album.getParent() != null)
- album.getParent().getChildAlbums().remove(album);
- album.setParent(this);
- childAlbums.add(album);
+ if (album.getShelf() != null)
+ album.getShelf().getAlbums().remove(album);
+ album.setShelf(this);
+ albums.add(album);
}
public void removeChildAlbum(Album album) {
if (album == null)
throw new IllegalArgumentException("Null child!");
- album.setParent(null);
- childAlbums.remove(album);
+ album.setShelf(null);
+ albums.remove(album);
}
public int getCountAlbums() {
- return this.getChildAlbums() != null ? this.getChildAlbums().size() : 0;
+ return this.getAlbums() != null ? this.getAlbums().size() : 0;
}
public int getCountImages() {
int result = 0;
if(getCountAlbums() > 0){
- for(Album album : getChildAlbums()){
+ for(Album album : getAlbums()){
result += album.getCountImages();
}
}
return result;
-
}
/**
Modified: trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/User.java
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/User.java 2009-03-11 10:48:53 UTC (rev 12913)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/domain/User.java 2009-03-11 10:50:56 UTC (rev 12914)
@@ -31,17 +31,16 @@
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
-import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;
+import javax.persistence.UniqueConstraint;
+
import org.hibernate.validator.Length;
import org.hibernate.validator.NotEmpty;
import org.hibernate.validator.NotNull;
@@ -50,7 +49,6 @@
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Role;
import org.jboss.seam.annotations.Scope;
-import javax.persistence.UniqueConstraint;
@NamedQueries({
@NamedQuery(
@@ -61,10 +59,6 @@
name = "user-exist",
query = "from User u where u.login = :login"
),
- @NamedQuery(
- name = "user-rootAlbums",
- query = "from Album a WHERE a.owner.login=:login and a.parent is null"
- ),
@NamedQuery(
name = "user-user",
query = "from User u where u.login = :login"
@@ -121,12 +115,6 @@
@Transient
private String confirmPassword;
- @ManyToMany(mappedBy = "sharedOwners")
- private List<Album> favoriteAlbums = new ArrayList<Album>();
-
- @ManyToMany(mappedBy = "sharedOwners")
- private List<Image> favoriteImages = new ArrayList<Image>();
-
@Temporal(TemporalType.TIMESTAMP)
private Date birthDate;
@@ -142,7 +130,7 @@
@OneToMany(mappedBy = "owner", cascade = { CascadeType.ALL}, fetch = FetchType.LAZY)
@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.EXTRA)
@org.hibernate.annotations.OrderBy(clause = "NAME asc")
- private List<Album> childAlbums = new ArrayList<Album>();
+ private List<Album> albums = new ArrayList<Album>();
@OneToMany(mappedBy = "owner", cascade = { CascadeType.ALL}, fetch = FetchType.LAZY)
@org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.EXTRA)
@@ -206,8 +194,8 @@
return id;
}
- public List<Album> getChildAlbums() {
- return childAlbums;
+ public List<Album> getAlbums() {
+ return albums;
}
//---------------------------Business methods
@@ -217,7 +205,7 @@
throw new IllegalArgumentException("Null album!");
}
album.setOwner(this);
- childAlbums.add(album);
+ albums.add(album);
}
public void removeAlbum(Album album) {
@@ -225,7 +213,7 @@
throw new IllegalArgumentException("Null album");
}
album.setOwner(null);
- childAlbums.remove(album);
+ albums.remove(album);
}
public void addShelf(Shelf shelf) {
@@ -252,42 +240,6 @@
this.confirmPassword = confirmPassword;
}
- public List<Album> getFavoriteAlbums() {
- return favoriteAlbums;
- }
-
- public void removeFromFavoriteAlbums(Album album) {
- favoriteAlbums.remove(album);
- }
-
- public void addFavoriteAlbum(Album album) {
- if (album == null) {
- throw new IllegalArgumentException("Null album!");
- }
- if(favoriteAlbums.contains(album)){
- return;
- }
- favoriteAlbums.add(album);
- }
-
- public void removeFromFavoriteImages(Image image) {
- favoriteImages.remove(image);
- }
-
- public void addFavoriteImage(Image image) {
- if (image == null) {
- throw new IllegalArgumentException("Null image!");
- }
- if(favoriteAlbums.contains(image)){
- return;
- }
- favoriteImages.add(image);
- }
-
- public List<Image> getFavoriteImages() {
- return favoriteImages;
- }
-
public List<Shelf> getShelfs() {
return shelfs;
}
@@ -298,7 +250,6 @@
public int getCountShelfs() {
return this.getShelfs() != null ? this.getShelfs().size() : 0;
-
}
public Sex getSex() {
@@ -336,7 +287,7 @@
public List<Album> getAllAlbums(){
List<Album> albums = new ArrayList<Album>();
for(Shelf s:getShelfs()){
- albums.addAll(s.getChildAlbums());
+ albums.addAll(s.getAlbums());
}
return albums;
}
@@ -344,7 +295,7 @@
public List<Image> getAllImages(){
List<Image> images = new ArrayList<Image>();
for(Shelf s:getShelfs()){
- for(Album a:s.getChildAlbums()){
+ for(Album a:s.getAlbums()){
images.addAll(a.getImages());
}
}
Modified: trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/AlbumAction.java
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/AlbumAction.java 2009-03-11 10:48:53 UTC (rev 12913)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/AlbumAction.java 2009-03-11 10:50:56 UTC (rev 12914)
@@ -20,8 +20,6 @@
*/
package org.richfaces.realworld.service;
-import java.util.List;
-
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
@@ -48,12 +46,11 @@
}
public void deleteAlbum(Album album){
- if(album.getParent()!=null){
- album.getParent().removeChildAlbum(album);
+ if(album.getShelf()!=null){
+ album.getShelf().removeChildAlbum(album);
}else{
user.removeAlbum(album);
}
- //em.remove(album);
em.flush();
}
@@ -64,9 +61,4 @@
public void flush(){
em.flush();
}
-
- public List<Album> getSharedAlbums() {
- return em.createQuery("from Album a where a.shared=true").getResultList();
- }
-
}
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-03-11 10:48:53 UTC (rev 12913)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/Constants.java 2009-03-11 10:50:56 UTC (rev 12914)
@@ -81,7 +81,6 @@
public static final String USER_EXIST_QUERY = "user-exist";
public static final String USER_LOGIN_QUERY = "user-login";
- public static final String USER_ROOT_ALBUMS_QUERY = "user-rootAlbums";
public static final String PERCENT = "%";
public static final String LOGIN_PARAMETER = "login";
Modified: trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/IAlbumAction.java
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/IAlbumAction.java 2009-03-11 10:48:53 UTC (rev 12913)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/IAlbumAction.java 2009-03-11 10:50:56 UTC (rev 12914)
@@ -20,8 +20,6 @@
*/
package org.richfaces.realworld.service;
-import java.util.List;
-
import javax.ejb.Local;
import org.richfaces.realworld.domain.Album;
@@ -37,6 +35,4 @@
public abstract void flush();
- public abstract List<Album> getSharedAlbums();
-
}
\ No newline at end of file
Modified: trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/IUserAction.java
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/IUserAction.java 2009-03-11 10:48:53 UTC (rev 12913)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/IUserAction.java 2009-03-11 10:50:56 UTC (rev 12914)
@@ -20,12 +20,8 @@
*/
package org.richfaces.realworld.service;
-import java.util.List;
-
import javax.ejb.Local;
-import org.richfaces.realworld.domain.Album;
-import org.richfaces.realworld.domain.Image;
import org.richfaces.realworld.domain.User;
@Local
@@ -35,12 +31,7 @@
public boolean isUserExist(String login);
public void updateUser(User user);
public void resetUser(User user);
- public void removeFromFavoriteAlbums(User user, Album album);
- public void addFavoriteAlbum(Album album);
public void loginAnonymous();
- public List<Album> getRootAlbums(User user);
- public void addFavoriteImage(Image image);
- public void removeFromFavoriteImages(User user, Image image);
public Long countAlbums(User user);
public Long countImages(User user);
}
\ No newline at end of file
Modified: trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java 2009-03-11 10:48:53 UTC (rev 12913)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java 2009-03-11 10:50:56 UTC (rev 12914)
@@ -42,16 +42,6 @@
}
public void editImage(Image image) {
- /*if(parentChanged){
- Album albumPrevious = image.getAlbum();
- String login = albumPrevious.getOwner().getLogin();
- String albumName = image.getAlbumName();
- albumPrevious.removeImage(image);
- Album album = (Album)em.createNamedQuery(Constants.ALBUM_BY_ALBUM_NAME_AND_LOGIN_QUERY).setParameter(Constants.ALBUM_NAME_PARAMETER, albumName).setParameter(Constants.LOGIN_PARAMETER, login).getSingleResult();
- album.addImage(image);
- }
- image.getImageTags().clear();
- setTags(image, image.getMeta());*/
/*image.setImageTags(null);
String[] tokens = image.getMeta().split(",");
for(String token:tokens){
Modified: trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/SearchAction.java
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/SearchAction.java 2009-03-11 10:48:53 UTC (rev 12913)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/SearchAction.java 2009-03-11 10:50:56 UTC (rev 12914)
@@ -24,7 +24,7 @@
private User user;
public List<Image> searchByAlbum(String searchQuery, boolean searchInMyAlbums, boolean searchInShared) {
- StringBuilder b = new StringBuilder("from Album a where a.name=:name and a.shared=:shared");
+ StringBuilder b = new StringBuilder("from Album a where a.name=:name and a.shelf.shared=:shared");
if (searchInMyAlbums) {
b.append(" and a.owner.login=:login");
}
@@ -40,7 +40,7 @@
}
public List<Image> searchByImage(String searchQuery, boolean searchInMyAlbums, boolean searchInShared) {
- StringBuilder b = new StringBuilder("from Image i where i.name=:name and i.album.shared=:shared");
+ StringBuilder b = new StringBuilder("from Image i where i.name=:name and i.album.shelf.shared=:shared");
if (searchInMyAlbums) {
b.append(" and i.album.owner.login=:login");
}
@@ -58,7 +58,7 @@
public List<Image> searchByUsers(String searchQuery, boolean searchInMyAlbums, boolean searchInShared) {
StringBuilder b = new StringBuilder("select distinct u from User u, Album a where u.login=:name");
if (searchInShared) {
- b.append(" and a.owner=u and a.shared=true");
+ b.append(" and a.owner=u and a.shelf.shared=true");
}
Query query = em.createQuery(b.toString());
@@ -75,5 +75,4 @@
return query.getResultList();
}
-
}
Modified: trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/ShelfAction.java
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/ShelfAction.java 2009-03-11 10:48:53 UTC (rev 12913)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/ShelfAction.java 2009-03-11 10:50:56 UTC (rev 12914)
@@ -20,7 +20,6 @@
*/
package org.richfaces.realworld.service;
-import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -31,8 +30,6 @@
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Out;
-import org.richfaces.realworld.domain.Album;
-import org.richfaces.realworld.domain.Image;
import org.richfaces.realworld.domain.Shelf;
import org.richfaces.realworld.domain.User;
Modified: trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/UserAction.java
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/UserAction.java 2009-03-11 10:48:53 UTC (rev 12913)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/UserAction.java 2009-03-11 10:50:56 UTC (rev 12914)
@@ -20,7 +20,6 @@
*/
package org.richfaces.realworld.service;
-import java.util.Collections;
import java.util.List;
import javax.ejb.Stateless;
@@ -62,14 +61,6 @@
this.user = user;
}
- @SuppressWarnings("unchecked")
- public List<Album> getRootAlbums(User user) {
- List<Album> albums = em.createNamedQuery(Constants.USER_ROOT_ALBUMS_QUERY)
- .setParameter(Constants.LOGIN_PARAMETER, user.getLogin())
- .getResultList();
- return albums;
- }
-
public void resetUser(User user) {
em.refresh(user);
em.flush();
@@ -82,31 +73,9 @@
.getResultList().size() != 0;
}
- public void removeFromFavoriteAlbums(User user, Album album) {
- user.removeFromFavoriteAlbums(album);
- em.flush();
- }
-
- public void addFavoriteAlbum(Album album) {
- user.addFavoriteAlbum(album);
- album.getSharedOwners().add(user);
- em.flush();
- }
-
public void loginAnonymous() {
user = new User();
}
-
- public void addFavoriteImage(Image image) {
- user.addFavoriteImage(image);
- image.getSharedOwners().add(user);
- em.flush();
- }
-
- public void removeFromFavoriteImages(User user, Image image) {
- user.removeFromFavoriteImages(image);
- em.flush();
- }
public Long countAlbums(User user){
return (Long)em.createQuery("select count(a) from Album a where a.owner=:user").setParameter("user", user).getSingleResult();
Modified: trunk/test-applications/realworld2/ejb/src/main/resources/import.sql
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/resources/import.sql 2009-03-11 10:48:53 UTC (rev 12913)
+++ trunk/test-applications/realworld2/ejb/src/main/resources/import.sql 2009-03-11 10:50:56 UTC (rev 12914)
@@ -3,19 +3,19 @@
INSERT INTO Users(user_id, firstname, secondname, email, login, passwordHash, birthdate, sex, doNotShowMail, informAboutNews, hasAvatar) VALUES (3, 'John', 'Smith', 'jsmith(a)jboss.com', 'Noname', '8cb2237d0679ca88db6464eac60da96345513964', '1970-01-08', 1, 1, 1, 0);
INSERT INTO shelfs(shelf_id, name, description, shelf_user_id, created, shared) VALUES (1, 'Nature', 'Nature pictures', 1, '2008-12-18', true);
-INSERT INTO shelfs(shelf_id, name, description, shelf_user_id, created,shared) VALUES (2, 'Sport', 'Nature pictures', 1, '2008-12-18', true);
+INSERT INTO shelfs(shelf_id, name, description, shelf_user_id, created,shared) VALUES (2, 'Sport', 'Nature pictures', 1, '2008-12-18', false);
INSERT INTO shelfs(shelf_id, name, description, shelf_user_id, created,shared) VALUES (3, 'Water', 'Nature pictures', 2, '2008-12-18', true);
INSERT INTO shelfs(shelf_id, name, description, shelf_user_id, created,shared) VALUES (4, 'Flowers', 'Nature pictures', 3, '2008-12-18', true);
-INSERT INTO albums(album_id, name, description, shared, album_user_id, parent_shelf_id, created) VALUES (15, 'Water', 'Rivers pictures', true, 2, 3, '2008-12-18');
+INSERT INTO albums(album_id, name, description, album_user_id, parent_shelf_id, created) VALUES (15, 'Water', 'Rivers pictures', 2, 3, '2008-12-18');
-INSERT INTO albums(album_id, name, description, shared, album_user_id, parent_shelf_id, created) VALUES (20, 'Sport', 'Nature pictures', true, 1, 1, '2008-12-18');
+INSERT INTO albums(album_id, name, description, album_user_id, parent_shelf_id, created) VALUES (20, 'Sport', 'Nature pictures', 1, 1, '2008-12-18');
-INSERT INTO albums(album_id, name, description, shared, album_user_id, parent_shelf_id, created) VALUES (26, 'Flowers', 'Fun pictures', true, 1, 2, '2008-12-18');
-INSERT INTO albums(album_id, name, description, shared, album_user_id, parent_shelf_id, created) VALUES (25, 'Beach', 'Fun pictures', true, 1, 1, '2008-12-18');
-INSERT INTO albums(album_id, name, description, shared, album_user_id, parent_shelf_id, created) VALUES (23, 'Travel', 'Fun pictures', true, 3, 4, '2008-12-18');
-INSERT INTO albums(album_id, name, description, shared, album_user_id, parent_shelf_id, created) VALUES (27, 'Very very very very very very very long album name ', 'Long name test', true, 1, 2, '2008-12-18');
+INSERT INTO albums(album_id, name, description, album_user_id, parent_shelf_id, created) VALUES (26, 'Flowers', 'Fun pictures', 1, 2, '2008-12-18');
+INSERT INTO albums(album_id, name, description, album_user_id, parent_shelf_id, created) VALUES (25, 'Beach', 'Fun pictures', 1, 1, '2008-12-18');
+INSERT INTO albums(album_id, name, description, album_user_id, parent_shelf_id, created) VALUES (23, 'Travel', 'Fun pictures', 3, 4, '2008-12-18');
+INSERT INTO albums(album_id, name, description, album_user_id, parent_shelf_id, created) VALUES (27, 'Very very very very very very very long album name ', 'Long name test', 1, 2, '2008-12-18');
INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded, allowComments) VALUES (1, 'korana', 'Viking/15/korana.jpg', 'korana', '2008-12-18', 15, 'Canon S3', 1024, 1917.000000, 768, '2008-12-01', true);
@@ -340,43 +340,6 @@
INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(17,79);
INSERT INTO IMAGES_METATAGS(CI_METATAG_ID, CI_IMAGE_ID) VALUES(20,27);
-INSERT INTO ALBUMS_METATAGS(CI_ALBUM_ID, CI_METATAG_ID) VALUES(23, 1);
-INSERT INTO ALBUMS_METATAGS(CI_ALBUM_ID, CI_METATAG_ID) VALUES(15, 1);
-INSERT INTO ALBUMS_METATAGS(CI_ALBUM_ID, CI_METATAG_ID) VALUES(20, 1);
-INSERT INTO ALBUMS_METATAGS(CI_ALBUM_ID, CI_METATAG_ID) VALUES(26, 1);
-INSERT INTO ALBUMS_METATAGS(CI_ALBUM_ID, CI_METATAG_ID) VALUES(25, 1);
-INSERT INTO ALBUMS_METATAGS(CI_ALBUM_ID, CI_METATAG_ID) VALUES(27, 1);
-INSERT INTO ALBUMS_METATAGS(CI_ALBUM_ID, CI_METATAG_ID) VALUES(23, 2);
-INSERT INTO ALBUMS_METATAGS(CI_ALBUM_ID, CI_METATAG_ID) VALUES(15, 3);
-INSERT INTO ALBUMS_METATAGS(CI_ALBUM_ID, CI_METATAG_ID) VALUES(20, 4);
-INSERT INTO ALBUMS_METATAGS(CI_ALBUM_ID, CI_METATAG_ID) VALUES(26, 5);
-INSERT INTO ALBUMS_METATAGS(CI_ALBUM_ID, CI_METATAG_ID) VALUES(25, 6);
-INSERT INTO ALBUMS_METATAGS(CI_ALBUM_ID, CI_METATAG_ID) VALUES(27, 7);
-INSERT INTO ALBUMS_METATAGS(CI_ALBUM_ID, CI_METATAG_ID) VALUES(23, 8);
-INSERT INTO ALBUMS_METATAGS(CI_ALBUM_ID, CI_METATAG_ID) VALUES(15, 9);
-INSERT INTO ALBUMS_METATAGS(CI_ALBUM_ID, CI_METATAG_ID) VALUES(20, 10);
-INSERT INTO ALBUMS_METATAGS(CI_ALBUM_ID, CI_METATAG_ID) VALUES(26, 11);
-INSERT INTO ALBUMS_METATAGS(CI_ALBUM_ID, CI_METATAG_ID) VALUES(25, 12);
-INSERT INTO ALBUMS_METATAGS(CI_ALBUM_ID, CI_METATAG_ID) VALUES(27, 13);
-INSERT INTO ALBUMS_METATAGS(CI_ALBUM_ID, CI_METATAG_ID) VALUES(23, 14);
-INSERT INTO ALBUMS_METATAGS(CI_ALBUM_ID, CI_METATAG_ID) VALUES(15, 15);
-INSERT INTO ALBUMS_METATAGS(CI_ALBUM_ID, CI_METATAG_ID) VALUES(20, 16);
-INSERT INTO ALBUMS_METATAGS(CI_ALBUM_ID, CI_METATAG_ID) VALUES(26, 17);
-INSERT INTO ALBUMS_METATAGS(CI_ALBUM_ID, CI_METATAG_ID) VALUES(25, 18);
-INSERT INTO ALBUMS_METATAGS(CI_ALBUM_ID, CI_METATAG_ID) VALUES(27, 19);
-INSERT INTO ALBUMS_METATAGS(CI_ALBUM_ID, CI_METATAG_ID) VALUES(23, 20);
-INSERT INTO ALBUMS_METATAGS(CI_ALBUM_ID, CI_METATAG_ID) VALUES(15, 21);
-INSERT INTO ALBUMS_METATAGS(CI_ALBUM_ID, CI_METATAG_ID) VALUES(20, 22);
-INSERT INTO ALBUMS_METATAGS(CI_ALBUM_ID, CI_METATAG_ID) VALUES(26, 23);
-INSERT INTO ALBUMS_METATAGS(CI_ALBUM_ID, CI_METATAG_ID) VALUES(25, 24);
-INSERT INTO ALBUMS_METATAGS(CI_ALBUM_ID, CI_METATAG_ID) VALUES(27, 25);
-INSERT INTO ALBUMS_METATAGS(CI_ALBUM_ID, CI_METATAG_ID) VALUES(23, 26);
-INSERT INTO ALBUMS_METATAGS(CI_ALBUM_ID, CI_METATAG_ID) VALUES(15, 27);
-INSERT INTO ALBUMS_METATAGS(CI_ALBUM_ID, CI_METATAG_ID) VALUES(20, 28);
-INSERT INTO ALBUMS_METATAGS(CI_ALBUM_ID, CI_METATAG_ID) VALUES(26, 29);
-INSERT INTO ALBUMS_METATAGS(CI_ALBUM_ID, CI_METATAG_ID) VALUES(25, 30);
-INSERT INTO ALBUMS_METATAGS(CI_ALBUM_ID, CI_METATAG_ID) VALUES(27, 30);
-
INSERT INTO comments(comment_id, date, message, image_comment_id, from_user_id) VALUES (1, '1985-01-08', 'Hello I am user', 1, 2);
INSERT INTO comments(comment_id, date, message, image_comment_id, from_user_id) VALUES (2, '1985-01-08', 'Hello I am user2', 1, 3);
INSERT INTO comments(comment_id, date, message, image_comment_id, from_user_id) VALUES (3, '1985-01-08', 'Hello I am user',2, 2);
@@ -542,8 +505,4 @@
INSERT INTO comments(comment_id, date, message, image_comment_id, from_user_id) VALUES (163, '1985-01-08', 'Hello I am user',82, 2);
INSERT INTO comments(comment_id, date, message, image_comment_id, from_user_id) VALUES (164, '1985-01-08', 'Hello I am user2',82, 3);
INSERT INTO comments(comment_id, date, message, image_comment_id, from_user_id) VALUES (165, '1985-01-08', 'Hello I am user',83, 2);
-INSERT INTO comments(comment_id, date, message, image_comment_id, from_user_id) VALUES (166, '1985-01-08', 'Hello I am user2',83, 3);
-INSERT INTO shared_albums(album_id, user_id) VALUES(15, 1);
-INSERT INTO shared_albums(album_id, user_id) VALUES(26, 1);
-INSERT INTO shared_images(image_id, user_id) VALUES(34, 1);
-INSERT INTO shared_images(image_id, user_id) VALUES(45, 1);
\ No newline at end of file
+INSERT INTO comments(comment_id, date, message, image_comment_id, from_user_id) VALUES (166, '1985-01-08', 'Hello I am user2',83, 3);
\ No newline at end of file
Modified: trunk/test-applications/realworld2/pom.xml
===================================================================
--- trunk/test-applications/realworld2/pom.xml 2009-03-11 10:48:53 UTC (rev 12913)
+++ trunk/test-applications/realworld2/pom.xml 2009-03-11 10:50:56 UTC (rev 12914)
@@ -14,7 +14,7 @@
<properties>
<projectName>realworld</projectName>
- <richfacesVersion>3.3.0.GA</richfacesVersion>
+ <richfacesVersion>3.3.1-SNAPSHOT</richfacesVersion>
<seamVersion>2.1.0.SP1</seamVersion>
<faceletsVersion>1.1.14</faceletsVersion>
<jbosshome>${project.basedir}/target/installs/jboss-4.2.3.GA/jboss-4.2.3.GA</jbosshome>
15 years, 10 months
JBoss Rich Faces SVN: r12913 - trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2009-03-11 06:48:53 -0400 (Wed, 11 Mar 2009)
New Revision: 12913
Removed:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/ConversationState.java
Log:
Deleted: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/ConversationState.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/ConversationState.java 2009-03-10 19:51:56 UTC (rev 12912)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/ConversationState.java 2009-03-11 10:48:53 UTC (rev 12913)
@@ -1,415 +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.Serializable;
-import java.util.Map;
-
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-
-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.Scope;
-import org.jboss.seam.annotations.Synchronized;
-import org.jboss.seam.core.Events;
-import org.richfaces.component.UIDatascroller;
-import org.richfaces.component.UITree;
-import org.richfaces.component.html.HtmlTree;
-import org.richfaces.event.NodeSelectedEvent;
-import org.richfaces.model.TreeNode;
-import org.richfaces.model.TreeRowKey;
-import org.richfaces.realworld.domain.Album;
-import org.richfaces.realworld.domain.Image;
-import org.richfaces.realworld.domain.MetaTag;
-import org.richfaces.realworld.domain.Shelf;
-import org.richfaces.realworld.domain.User;
-import org.richfaces.realworld.navigation.NavigationEnum;
-import org.richfaces.realworld.service.Constants;
-
-
-@Name("conversationState")
-(a)Scope(ScopeType.CONVERSATION)
-@Synchronized(timeout=200000)
-public class ConversationState implements Serializable{
-
- private static final long serialVersionUID = 5656562187249324512L;
-
- @In("#{messages['acess_not_granted']}")
- private String HAVENT_ACCESS;
-
- private Integer selectedImageIndex = 1;
-
- private Image selectedImage;
-
- private Album selectedAlbum;
-
- private User selectedUser;
-
- private Shelf selectedShelf;
-
- private User secondSelectedUser;
-
- private MetaTag selectedTag;
-
- private NavigationEnum mainArea;
-
- @In(create=true)
- private User user;
-
- public Integer getSelectedImageIndex() {
- return selectedImageIndex;
- }
-
- public NavigationEnum getMainArea() {
- return mainArea;
- }
-
- public void selectShelfs(){
- setMainArea(NavigationEnum.ALL_SHELFS);
- setSelectedAlbum(null);
- setSelectedShelf(null);
- setSelectedImage(null);
- setSelectedUser(user);
- }
-
- public void selectAlbums(){
- setMainArea(NavigationEnum.ALL_ALBUMS);
- setSelectedAlbum(null);
- setSelectedShelf(null);
- setSelectedImage(null);
- setSelectedUser(user);
- }
-
- public void selectImages(){
- setMainArea(NavigationEnum.ALL_IMAGES);
- setSelectedAlbum(null);
- setSelectedShelf(null);
- setSelectedImage(null);
- setSelectedUser(user);
- }
-
- @Observer(Constants.UPDATE_MAIN_AREA_EVENT)
- public void setMainArea(NavigationEnum mainArea) {
- this.mainArea = mainArea;
- if(mainArea.equals(NavigationEnum.FILE_UPLOAD)){
- Events.instance().raiseEvent(Constants.SHOW_FILE_UPLOAD_EVENT, true);
- }
- }
-
- public void incrementSlideShowIndex(){
- Integer index = getSelectedAlbum().getIndex(getSelectedImage());
- System.out.println("Slideshow execute");
- if(index == -1){
- if(getSelectedAlbum().getImages() != null && getSelectedAlbum().getImages().size() > 1){
- System.out.println("Slideshow index will be index of first image");
- index = getSelectedAlbum().getIndex(getSelectedAlbum().getImages().get(1));
- }else{
- Events.instance().raiseEvent("stopSlideshow");
- System.out.println("Slideshow stop");
- return;
- }
- }
- UIComponent component = FacesContext.getCurrentInstance().getViewRoot();
- UIDatascroller scroller = (UIDatascroller)component.findComponent(Constants.DATASCROLLER2_ID);
- Map<String, Object> attributes = scroller.getDataTable().getAttributes();
- attributes.put(UIDatascroller.SCROLLER_STATE_ATTRIBUTE, index+1);
- if(index == getSelectedAlbum().getImages().size() - 1){
- index=-1;
- }
- setSelectedImageIndex(index+1);
- setSelectedImage(getSelectedAlbum().getImages().get(index + 1));
- }
-
- public void setSelectedImageIndex(Integer selectedImageIndex) {
- this.selectedImageIndex = selectedImageIndex;
- }
-
- public Image getSelectedImage() {
- return selectedImage;
- }
-
- public void setSelectedImage(Image selectedImage) {
- this.selectedImage = selectedImage;
- }
-
- public Album getSelectedAlbum() {
- return selectedAlbum;
- }
-
- public void setSelectedAlbum(Album selectedAlbum) {
- this.selectedAlbum = selectedAlbum;
- }
-
- public void setSelectedAlbumName(String selectedAlbumName) {
- selectedAlbumName = selectedAlbumName.substring(0, selectedAlbumName.length() -1);
- int lastIndexOf = selectedAlbumName.lastIndexOf(Constants.SLASH);
- String prevPathEnd = selectedAlbumName.substring(lastIndexOf+1);
- //this.selectedAlbum = ((TreeAlbumItem)treeMyAlbumsItem.getNode(prevPathEnd)).getAlbum();
- }
-
- public void showUserProfile(User user){
- setSelectedUser(user);
- setSecondSelectedUser(null);
- Events.instance().raiseEvent(Constants.UPDATE_MAIN_AREA_EVENT, NavigationEnum.USER_PREFS);
- }
-
- public void showSecondUserProfile(User user){
- setSecondSelectedUser(user);
- Events.instance().raiseEvent(Constants.UPDATE_MAIN_AREA_EVENT, NavigationEnum.USER_PREFS);
- }
-
- public void showImage(Image image){
- if(!image.getAlbum().isShared() && !image.getAlbum().getOwner().equals(user)){
- Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, new Exception(HAVENT_ACCESS));
- return;
- }
- Events.instance().raiseEvent(Constants.UPDATE_MAIN_AREA_EVENT, NavigationEnum.IMAGE_PREVIEW);
- setSelectedAlbum(image.getAlbum());
- setSelectedImage(image);
- Integer index = getSelectedAlbum().getIndex(getSelectedImage());
- UIComponent component = FacesContext.getCurrentInstance().getViewRoot();
- UIDatascroller scroller = (UIDatascroller)component.findComponent(Constants.DATASCROLLER_ID);
- Map<String, Object> attributes = scroller.getDataTable().getAttributes();
- attributes.put(UIDatascroller.SCROLLER_STATE_ATTRIBUTE, index+1);
- setSelectedImageIndex(index+1);
- setSelectedUser(image.getAlbum().getOwner());
- }
-
- public void showUser(User u){
- Events.instance().raiseEvent(Constants.UPDATE_MAIN_AREA_EVENT, NavigationEnum.IMAGE_PREVIEW);
- setSelectedAlbum(null);
- setSelectedImage(null);
- setSelectedUser(u);
- }
-
- public void showAlbum(Album album){
- if(!album.isShared() && !album.getOwner().equals(user)){
- Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, new Exception(HAVENT_ACCESS));
- return;
- }
- Events.instance().raiseEvent(Constants.UPDATE_MAIN_AREA_EVENT, NavigationEnum.IMAGE_PREVIEW);
- setSelectedAlbum(album);
- setSelectedImage(null);
- setSelectedShelf(album.getParent());
- setSelectedUser(album.getOwner());
- }
-
- public void showAlbumFromShelf(Album album){
- if(!album.isShared() && !album.getOwner().equals(user)){
- Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, new Exception(HAVENT_ACCESS));
- return;
- }
- Events.instance().raiseEvent(Constants.UPDATE_MAIN_AREA_EVENT, NavigationEnum.ALBUM_PREVIEW);
- setSelectedAlbum(album);
- setSelectedImage(null);
- setSelectedShelf(album.getParent());
- setSelectedUser(album.getOwner());
- }
-
- public void showImageFromShelf(Image image){
- if(!image.getAlbum().isShared() && !image.getAlbum().getOwner().equals(user)){
- Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, new Exception(HAVENT_ACCESS));
- return;
- }
- Events.instance().raiseEvent(Constants.UPDATE_MAIN_AREA_EVENT, NavigationEnum.ALBUM_IMAGE_PREVIEW);
- setSelectedAlbum(image.getAlbum());
- setSelectedImage(image);
- Integer index = getSelectedAlbum().getIndex(getSelectedImage());
- setSelectedImageIndex(index);
- UIComponent component = FacesContext.getCurrentInstance().getViewRoot();
- UIDatascroller scroller = (UIDatascroller)component.findComponent(Constants.DATASCROLLER_ID);
- Map<String, Object> attributes = scroller.getDataTable().getAttributes();
- attributes.put(UIDatascroller.SCROLLER_STATE_ATTRIBUTE, index+1);
- setSelectedImageIndex(index+1);
- setSelectedUser(image.getAlbum().getOwner());
- }
-
- public void editImage(Image image){
- if(!image.getAlbum().isShared() && !image.getAlbum().getOwner().equals(user)){
- Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, new Exception(HAVENT_ACCESS));
- return;
- }
- Events.instance().raiseEvent(Constants.UPDATE_MAIN_AREA_EVENT, NavigationEnum.ALBUM_IMAGE_EDIT);
- }
-
- public void cancelEditImage(Image image){
- Events.instance().raiseEvent(Constants.UPDATE_MAIN_AREA_EVENT, NavigationEnum.ALBUM_IMAGE_PREVIEW);
- }
-
- public void editAlbum(Album album){
- if(album.getOwner().equals(user)){
- Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, new Exception(HAVENT_ACCESS));
- return;
- }
- Events.instance().raiseEvent(Constants.UPDATE_MAIN_AREA_EVENT, NavigationEnum.ALBUM_EDIT);
- }
-
- public void cancelEditAlbum(Album album){
- Events.instance().raiseEvent(Constants.UPDATE_MAIN_AREA_EVENT, NavigationEnum.ALBUM_PREVIEW);
- }
-
- public void editShelf(Shelf shelf){
- if(shelf.getOwner().equals(user)){
- Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, new Exception(HAVENT_ACCESS));
- return;
- }
- Events.instance().raiseEvent(Constants.UPDATE_MAIN_AREA_EVENT, NavigationEnum.SHELF_EDIT);
- }
-
- public void cancelEditShelf(Shelf shelf){
- Events.instance().raiseEvent(Constants.UPDATE_MAIN_AREA_EVENT, NavigationEnum.SHELF_PREVIEW);
- }
-
- public void selectMyAlbums(){
- setSelectedAlbum(null);
- setSelectedImage(null);
- setSelectedShelf(null);
- setSelectedUser(user);
- }
-
- public void selectUser(User u){
- setSelectedAlbum(null);
- setSelectedImage(null);
- setSelectedUser(u);
- }
-
- public void selectAlbum(Album a){
- setSelectedAlbum(a);
- setSelectedShelf(a.getParent());
- setSelectedImage(null);
- setSelectedUser(a.getOwner());
- }
-
- public void selectShelf(Shelf s){
- setSelectedShelf(s);
- setSelectedAlbum(null);
- setSelectedImage(null);
- setSelectedUser(s.getOwner());
- }
-
- public void showFileUpload(Album item){
- Events.instance().raiseEvent(Constants.FILE_UPLOAD_CLEAR_EVENT);
- setSelectedAlbum(item);
- this.setMainArea(NavigationEnum.FILE_UPLOAD);
- }
-
- @SuppressWarnings("unchecked")
- public Boolean adviseNodeSelected(UITree tree) {
- Object currentNode = tree.getRowData();
- if (currentNode instanceof Album) {
- boolean selected = currentNode == getSelectedAlbum();
- return selected;
- }else if(currentNode instanceof Shelf){
- return currentNode == getSelectedShelf() && getSelectedAlbum() == null;
- }
- return null;
- }
-
- @SuppressWarnings("unchecked")
- public Boolean adviseNodeOpened(UITree tree) {
- Object currentNode = tree.getRowData();
- if (currentNode instanceof Album) {
- boolean selected = currentNode == getSelectedAlbum();
- return selected;
- }else if(currentNode instanceof Shelf){
- return currentNode == getSelectedShelf();
- }
- return null;
- }
-
- @SuppressWarnings("unchecked")
- public void processSelection(NodeSelectedEvent event) {
- HtmlTree tree = (HtmlTree) event.getComponent();
- Object currentNode = tree.getRowData();
- //TreeNode<Object> currentNode = (TreeNode<Object>)tree.getModelTreeNode(tree.getRowKey());
- if(currentNode instanceof Album){
- Events.instance().raiseEvent(Constants.UPDATE_MAIN_AREA_EVENT, NavigationEnum.ALBUM_PREVIEW);
- setSelectedAlbum((Album)currentNode);
- setSelectedShelf(((Album)currentNode).getParent());
- }else if(currentNode instanceof Shelf){
- Events.instance().raiseEvent(Constants.UPDATE_MAIN_AREA_EVENT, NavigationEnum.SHELF_PREVIEW);
- setSelectedAlbum(null);
- setSelectedShelf((Shelf)currentNode);
- }
- setSelectedUser(user);
- setSelectedImage(null);
- }
-
- public boolean isSelectedImage(int index){
- return getSelectedAlbum().getIndex(getSelectedImage()) == index -1;
- }
-
- public void updateSelectedItems(Image image){
- setSelectedImage(image);
- Integer index = getSelectedAlbum().getIndex(getSelectedImage());
- UIComponent component = FacesContext.getCurrentInstance().getViewRoot();
- UIDatascroller scroller = (UIDatascroller)component.findComponent(Constants.DATASCROLLER_ID);
- Map<String, Object> attributes = scroller.getDataTable().getAttributes();
- attributes.put(UIDatascroller.SCROLLER_STATE_ATTRIBUTE, index+1);
- setSelectedImageIndex(index+1);
- }
-
- public void generateError() {
- Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, new Exception("Is not implemented yet!"));
- }
-
- public User getSelectedUser() {
- return selectedUser;
- }
-
- public void setSelectedUser(User selectedUser) {
- this.selectedUser = selectedUser;
- }
-
- public User getSecondSelectedUser() {
- return secondSelectedUser;
- }
-
- public void setSecondSelectedUser(User secondSelectedUser) {
- this.secondSelectedUser = secondSelectedUser;
- }
-
- public Shelf getSelectedShelf() {
- return selectedShelf;
- }
-
- public void setSelectedShelf(Shelf selectedShelf) {
- this.selectedShelf = selectedShelf;
- }
-
- public User getUser() {
- return user;
- }
-
-
-
- public MetaTag getSelectedTag() {
- return selectedTag;
- }
- @Observer("updateSelectedTag")
- public void setSelectedTag(MetaTag selectedTag) {
- this.selectedTag = selectedTag;
- }
-
-}
15 years, 10 months
JBoss Rich Faces SVN: r12912 - trunk/ui/tree/src/main/templates.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-03-10 15:51:56 -0400 (Tue, 10 Mar 2009)
New Revision: 12912
Modified:
trunk/ui/tree/src/main/templates/htmlTree.jspx
trunk/ui/tree/src/main/templates/htmlTreeNode.jspx
Log:
https://jira.jboss.org/jira/browse/RF-3713
Modified: trunk/ui/tree/src/main/templates/htmlTree.jspx
===================================================================
--- trunk/ui/tree/src/main/templates/htmlTree.jspx 2009-03-10 19:40:30 UTC (rev 12911)
+++ trunk/ui/tree/src/main/templates/htmlTree.jspx 2009-03-10 19:51:56 UTC (rev 12912)
@@ -35,16 +35,12 @@
</jsp:scriptlet>
<div id="#{clientId}"
- style="#{component.attributes['style']}" class="dr-tree rich-tree #{component.attributes['styleClass']}">
+ style="#{component.attributes['style']}" class="dr-tree rich-tree #{component.attributes['styleClass']}" x:passThruWithExclusions="id,style,class,styleClass,rows">
<f:call name="encodeAttributeParameters" />
<f:call name="writeNamespace" />
- <f:call name="utils.encodePassThruWithExclusions">
- <f:parameter value="id,style,class,rows"/>
- </f:call>
-
<vcp:body />
<f:call name="encodeSelectionStateInput" />
Modified: trunk/ui/tree/src/main/templates/htmlTreeNode.jspx
===================================================================
--- trunk/ui/tree/src/main/templates/htmlTreeNode.jspx 2009-03-10 19:40:30 UTC (rev 12911)
+++ trunk/ui/tree/src/main/templates/htmlTreeNode.jspx 2009-03-10 19:51:56 UTC (rev 12912)
@@ -36,12 +36,9 @@
<table border="0" cellpadding="0" cellspacing="0" id="#{clientId}" class="dr-tree-full-width rich-tree-node">
<tbody>
- <tr id="#{clientId}:mainRow" onclick="#{component.attributes['onclick']} #{!leaf ? this:getToggleScript(context, component, 'mainRow') : ''}" >
+ <tr id="#{clientId}:mainRow" onclick="#{component.attributes['onclick']} #{!leaf ? this:getToggleScript(context, component, 'mainRow') : ''}" x:passThruWithExclusions="id,onclick">
<f:call name="encodeAttributeParameters" />
- <f:call name="utils.encodePassThruWithExclusions">
- <f:parameter value="id,onclick"/>
- </f:call>
<td class="dr-tree-h-ic rich-tree-node-handleicon #{line}" id="#{clientId}:handles">
<jsp:scriptlet>
<![CDATA[
15 years, 10 months
JBoss Rich Faces SVN: r12911 - trunk/framework/impl/src/main/java/org/ajax4jsf/resource.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-03-10 15:40:30 -0400 (Tue, 10 Mar 2009)
New Revision: 12911
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/resource/ResourceBuilderImpl.java
Log:
https://jira.jboss.org/jira/browse/RF-4471
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/resource/ResourceBuilderImpl.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/resource/ResourceBuilderImpl.java 2009-03-10 17:07:03 UTC (rev 12910)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/resource/ResourceBuilderImpl.java 2009-03-10 19:40:30 UTC (rev 12911)
@@ -97,7 +97,16 @@
static {
// renderers.put(".htc",new BehaviorRenderer());
// set in-memory caching ImageIO
- ImageIO.setUseCache(false);
+ Thread thread = Thread.currentThread();
+ ClassLoader initialTCCL = thread.getContextClassLoader();
+
+ try {
+ ClassLoader systemCL = ClassLoader.getSystemClassLoader();
+ thread.setContextClassLoader(systemCL);
+ ImageIO.setUseCache(false);
+ } finally {
+ thread.setContextClassLoader(initialTCCL);
+ }
}
15 years, 10 months
JBoss Rich Faces SVN: r12910 - in trunk/test-applications/seleniumTest/richfaces/src: main/webapp/pages/suggestionBox and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2009-03-10 13:07:03 -0400 (Tue, 10 Mar 2009)
New Revision: 12910
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/SuggestionBoxBean.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/suggestionBox/suggestionBoxAutoTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/AutoTester.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/SuggestionBoxTest.java
Log:
RF-6240, RF-6241, RF-6242, RF-6243, RF-6244, RF-6245, RF-6253
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/SuggestionBoxBean.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/SuggestionBoxBean.java 2009-03-10 15:58:41 UTC (rev 12909)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/SuggestionBoxBean.java 2009-03-10 17:07:03 UTC (rev 12910)
@@ -57,6 +57,10 @@
return retVal;
}
+ public void reset() {
+ this.countryName = "";
+ }
+
/**
* Country
*/
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/suggestionBox/suggestionBoxAutoTest.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/AutoTester.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/AutoTester.java 2009-03-10 15:58:41 UTC (rev 12909)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/AutoTester.java 2009-03-10 17:07:03 UTC (rev 12910)
@@ -237,13 +237,19 @@
}
public void testBypassUpdate() {
+ testBypassUpdate(true);
+ }
+
+ public void testBypassUpdate(boolean checkListener) {
reset();
setupControl(TestSetupEntry.bypassUpdate, Boolean.TRUE);
clickLoad();
base.sendAjax();
- checkActionListener(true);
+ if (checkListener) {
+ checkActionListener(true);
+ }
checkUpdateModel(false);
}
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/SuggestionBoxTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/SuggestionBoxTest.java 2009-03-10 15:58:41 UTC (rev 12909)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/SuggestionBoxTest.java 2009-03-10 17:07:03 UTC (rev 12910)
@@ -12,6 +12,8 @@
private static Map<String, String> params = new HashMap<String, String>();
+ private final static String RESET_METHOD = "#{suggestionBean.reset}";
+
static {
params.put("parameter1", "value1");
params.put("parameter2", "value2");
@@ -21,7 +23,7 @@
@Test
public void testRenderedAttribute(Template template) {
AutoTester tester = getAutoTester(this);
- tester.renderPage(template, null);
+ tester.renderPage(template, RESET_METHOD);
writeStatus("Test component with rendered = false is not present on the page");
tester.testRendered();
}
@@ -29,15 +31,95 @@
@Test
public void testNestedParams(Template template) {
AutoTester tester = getAutoTester(this);
- tester.renderPage(template, null);
+ tester.renderPage(template, RESET_METHOD);
writeStatus("Test component encodes nested f:param tags and their values are present as request parameters");
tester.testRequestParameters(params);
}
+ @Test
+ public void testReRenderAttribute(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, RESET_METHOD);
+ writeStatus("Test component re-renders another components");
+ tester.testReRender();
+ }
+
+ @Test
+ public void testOncomplete(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, RESET_METHOD);
+ writeStatus("Test oncomplete attribute");
+ tester.testOncomplete();
+ }
+
+ @Test
+ public void testWithExternalValidationFailure(Template template) {
+ AutoTester autoTester = getAutoTester(this);
+ autoTester.renderPage(template, RESET_METHOD);
+ writeStatus("Check component in case of external validation failure: listeners are not invoked, model is not updated");
+ autoTester.testExtrenalValidationFailure();
+ }
+
+ @Test
+ public void testLimitToListAttribute(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, RESET_METHOD);
+ writeStatus("Test component with limitToList = true skips ajaxRendered areas update");
+ tester.testLimitToList();
+ }
+
+ @Test
+ public void testBypassUpdatesAttribute(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, RESET_METHOD);
+ writeStatus("Test component with bypassUpdates = true skips update model values phase");
+ tester.testBypassUpdate(false);
+ }
+
+ @Test
+ public void testImmediate(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, RESET_METHOD);
+ writeStatus("Test immediate attribute");
+ tester.testImmediate(false);
+ }
+
+ @Test
+ public void testImmediateWithExternalValidationFailed(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, RESET_METHOD);
+ writeStatus("Test immediate attribute with external validation failed");
+ tester.testImmediateWithExternalValidationFailed(false);
+ }
+
+ @Test
+ public void testAjaxSingle(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, RESET_METHOD);
+ writeStatus("Test ajaxSingle attribute");
+ tester.testAjaxSingle(false);
+ }
+
+ @Test
+ public void testAjaxSingleWithInternalValidationFailed(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, RESET_METHOD);
+ writeStatus("Test ajaxSingle attribute in case of invalid children state");
+ tester.testAjaxSingleWithInternalValidationFailed();
+ }
+
+ @Test
+ public void testAjaxSingleWithProcessExternalValidation(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, RESET_METHOD);
+ tester.testAjaxSingleWithProcesExternalValidation(false);
+ }
+
@Override
public void sendAjax() {
type(getAutoTester(this).getClientId("suggestion"), "Bel");
waitForAjaxCompletion();
+ selenium.click("//table[@id='" + getAutoTester(this).getClientId(AutoTester.COMPONENT_ID + ":suggest']/tbody/tr[1]"));
}
@Override
15 years, 10 months
JBoss Rich Faces SVN: r12909 - in management/design/realWorldDemo/html: images/shell and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: admitriev
Date: 2009-03-10 11:58:41 -0400 (Tue, 10 Mar 2009)
New Revision: 12909
Added:
management/design/realWorldDemo/html/images/shell/avatar_w_default.png
management/design/realWorldDemo/html/pabm3.css
Modified:
management/design/realWorldDemo/html/album.html
management/design/realWorldDemo/html/photo.html
management/design/realWorldDemo/html/photo_edit.html
management/design/realWorldDemo/html/shelf.html
Log:
Modified: management/design/realWorldDemo/html/album.html
===================================================================
--- management/design/realWorldDemo/html/album.html 2009-03-10 15:46:14 UTC (rev 12908)
+++ management/design/realWorldDemo/html/album.html 2009-03-10 15:58:41 UTC (rev 12909)
@@ -3,83 +3,9 @@
<html>
<head>
<title>Untitled</title>
- <link rel="STYLESHEET" type="text/css" href="common.css">
+ <link rel="STYLESHEET" type="text/css" href="pabm3.css">
</head>
-<style>
- *{font-family : verdana; font-size : 11px}
- body {margin : 0px; background : url(images/shell/page_bg.gif) repeat-x #D7D7D7; height : 100%}
- h1{font-size : 175%; font-weight : normal; margin : 0px;}
- .top_part {height : 116px;}
- .header_box {height : 79px; position : relative;}
- .auth_box {position : absolute; font-weight : bold; color : #ffffff; right : 8px; top : 42px}
- .auth_data {vertical-align : top; padding : 0px 8px 0px 15px; font-weight : bold; color : #ffffff;}
- .auth_data span {color : #FF7200;}
- .about_toolbar {position : absolute; right : 8px; top : 12px;}
- .about_toolbar_item {vertical-align : top; padding : 0px 8px 0px 15px;}
- .about_toolbar_item a{font-size : 11px; color : #ffffff; text-decoration : none;}
- .about_toolbar_item a:hover{font-size : 11px; color : #ffffff; text-decoration : underline;}
-
- .content_box {padding : 15px 35px 15px 35px;}
- .content_box p {margin : 0px 0px 5px 0px; FONT-SIZE : 12PX}
- a{color : #DF6400;}
-
-
- .preview_box_album_80 {width : 100px; position : relative; float : left; margin : 0px 10px 10px 0px;}
- .preview_box_album_80 img.pr_album_bg {width : 100px; height : 100px; position : absolute;}
- .preview_box_album_80 table{position : relative; width : 100px; height : 100px; text-align : center; vertical-align : middle; border-collapse : collapse;}
- .preview_box_album_80 table img{margin: 0px 0px 2px 0px; border : 1px solid #FFFFFF;}
- .preview_box_album_80 div.album_name {text-align : center; overflow : hidden; width : 100px; white-space : nowrap; margin-top : 3px; text-overflow: ellipsis; height : 14px;}
- .preview_box_album_80 div.album_data {text-align : center; overflow : hidden; width : 100px; white-space : nowrap; text-overflow: ellipsis; color : #666666; font-size : 10px; height : 14px}
-
- .preview_box_album_120 {width : 140px; position : relative; float : left; margin : 0px 10px 10px 0px;}
- .preview_box_album_120 img.pr_album_bg {width : 140px; height : 140px; position : absolute;}
- .preview_box_album_120 table{position : relative; width : 140px; height : 140px; text-align : center; vertical-align : middle; border-collapse : collapse;}
- .preview_box_album_120 table img{margin: 0px 0px 2px 0px; border : 1px solid #FFFFFF;}
- .preview_box_album_120 div.album_name {text-align : center; overflow : hidden; width : 140px; white-space : nowrap; margin-top : 3px; text-overflow: ellipsis; height : 14px;}
- .preview_box_album_120 div.album_data {text-align : center; overflow : hidden; width : 140px; white-space : nowrap; text-overflow: ellipsis; color : #666666; font-size : 10px; height : 14px}
-
- .preview_box_album_160 {width : 180px; position : relative; float : left; margin : 0px 10px 10px 0px;}
- .preview_box_album_160 img.pr_album_bg {width : 180px; height : 180px; position : absolute;}
- .preview_box_album_160 table{position : relative; width : 180px; height : 180px; text-align : center; vertical-align : middle; border-collapse : collapse;}
- .preview_box_album_160 table img{margin: 0px 0px 1px 1px; border : 1px solid #FFFFFF;}
- .preview_box_album_160 div.album_name {text-align : center; overflow : hidden; width : 180px; white-space : nowrap; margin-top : 3px; text-overflow: ellipsis; height : 14px;}
- .preview_box_album_160 div.album_data {text-align : center; overflow : hidden; width : 180px; white-space : nowrap; text-overflow: ellipsis; color : #666666; font-size : 10px; height : 14px}
-
-
-
- .preview_box_photo_80 {width : 100px; position : relative; float : left; margin : 0px 10px 10px 0px;}
- .preview_box_photo_80 img.pr_photo_bg {width : 100px; height : 100px; position : absolute;}
- .preview_box_photo_80 table{position : relative; width : 100px; height : 100px; text-align : center; vertical-align : middle; border-collapse : collapse;}
- .preview_box_photo_80 table img{margin: 0px 0px 0px 0px; border : 1px solid #FFFFFF;}
- .preview_box_photo_80 div.photo_name {text-align : center; overflow : hidden; width : 100px; white-space : nowrap; margin-top : 3px; text-overflow: ellipsis; height : 14px;}
- .preview_box_photo_80 div.photo_data {text-align : center; overflow : hidden; width : 100px; white-space : nowrap; text-overflow: ellipsis; color : #666666; font-size : 10px; height : 14px}
-
- .preview_box_photo_120 {width : 140px; position : relative; float : left; margin : 0px 10px 10px 0px;}
- .preview_box_photo_120 img.pr_photo_bg {width : 140px; height : 140px; position : absolute;}
- .preview_box_photo_120 table{position : relative; width : 140px; height : 140px; text-align : center; vertical-align : middle; border-collapse : collapse;}
- .preview_box_photo_120 table img{margin: 0px 0px 0px 0px; border : 1px solid #FFFFFF;}
- .preview_box_photo_120 div.photo_name {text-align : center; overflow : hidden; width : 140px; white-space : nowrap; margin-top : 3px; text-overflow: ellipsis; height : 14px;}
- .preview_box_photo_120 div.photo_data {text-align : center; overflow : hidden; width : 140px; white-space : nowrap; text-overflow: ellipsis; color : #666666; font-size : 10px; height : 14px}
-
- .preview_box_photo_160 {width : 180px; position : relative; float : left; margin : 0px 10px 10px 0px;}
- .preview_box_photo_160 img.pr_photo_bg {width : 180px; height : 180px; position : absolute;}
- .preview_box_photo_160 table{position : relative; width : 180px; height : 180px; text-align : center; vertical-align : middle; border-collapse : collapse;}
- .preview_box_photo_160 table img{margin: 0px 0px 0px 0px; border : 1px solid #FFFFFF;}
- .preview_box_photo_160 div.photo_name {text-align : center; overflow : hidden; width : 180px; white-space : nowrap; margin-top : 3px; text-overflow: ellipsis; height : 14px;}
- .preview_box_photo_160 div.photo_data {text-align : center; overflow : hidden; width : 180px; white-space : nowrap; text-overflow: ellipsis; color : #666666; font-size : 10px; height : 14px}
-
-
- .preview_box_photo_nav {width : 100px; height : 100px; position : relative; float : left; margin : 0px 2px 0px 0px;}
- .preview_box_photo_nav img.pr_photo_bg {width : 100px; height : 100px; position : absolute;}
- .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;}
-
-
-
-</style>
-
<body>
<table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
Added: management/design/realWorldDemo/html/images/shell/avatar_w_default.png
===================================================================
(Binary files differ)
Property changes on: management/design/realWorldDemo/html/images/shell/avatar_w_default.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: management/design/realWorldDemo/html/pabm3.css
===================================================================
--- management/design/realWorldDemo/html/pabm3.css (rev 0)
+++ management/design/realWorldDemo/html/pabm3.css 2009-03-10 15:58:41 UTC (rev 12909)
@@ -0,0 +1,79 @@
+*{font-family : verdana; font-size : 11px}
+body {margin : 0px; background : url(images/shell/page_bg.gif) repeat-x #D7D7D7; height : 100%}
+h1{font-size : 175%; font-weight : normal; margin : 0px;}
+.top_part {height : 116px;}
+.header_box {height : 79px; position : relative;}
+.auth_box {position : absolute; font-weight : bold; color : #ffffff; right : 8px; top : 42px}
+.auth_data {vertical-align : top; padding : 0px 8px 0px 15px; font-weight : bold; color : #ffffff;}
+.auth_data span {color : #FF7200;}
+.about_toolbar {position : absolute; right : 8px; top : 12px;}
+.about_toolbar_item {vertical-align : top; padding : 0px 8px 0px 15px;}
+.about_toolbar_item a{font-size : 11px; color : #ffffff; text-decoration : none;}
+.about_toolbar_item a:hover{font-size : 11px; color : #ffffff; text-decoration : underline;}
+
+.content_box {padding : 15px 35px 45px 35px;}
+.content_box p {margin : 0px 0px 5px 0px; FONT-SIZE : 12PX}
+
+a{color : #DF6400;}
+
+
+.preview_box_album_80 {width : 100px; position : relative; float : left; margin : 0px 10px 10px 0px;}
+.preview_box_album_80 img.pr_album_bg {width : 100px; height : 100px; position : absolute;}
+.preview_box_album_80 table{position : relative; width : 100px; height : 100px; text-align : center; vertical-align : middle; border-collapse : collapse;}
+.preview_box_album_80 table img{margin: 0px 0px 2px 0px; border : 1px solid #FFFFFF;}
+.preview_box_album_80 div.album_name {text-align : center; overflow : hidden; width : 100px; white-space : nowrap; margin-top : 3px; text-overflow: ellipsis; height : 14px;}
+.preview_box_album_80 div.album_data {text-align : center; overflow : hidden; width : 100px; white-space : nowrap; text-overflow: ellipsis; color : #666666; font-size : 10px; height : 14px}
+
+.preview_box_album_120 {width : 140px; position : relative; float : left; margin : 0px 10px 10px 0px;}
+.preview_box_album_120 img.pr_album_bg {width : 140px; height : 140px; position : absolute;}
+.preview_box_album_120 table{position : relative; width : 140px; height : 140px; text-align : center; vertical-align : middle; border-collapse : collapse;}
+.preview_box_album_120 table img{margin: 0px 0px 2px 0px; border : 1px solid #FFFFFF;}
+.preview_box_album_120 div.album_name {text-align : center; overflow : hidden; width : 140px; white-space : nowrap; margin-top : 3px; text-overflow: ellipsis; height : 14px;}
+.preview_box_album_120 div.album_data {text-align : center; overflow : hidden; width : 140px; white-space : nowrap; text-overflow: ellipsis; color : #666666; font-size : 10px; height : 14px}
+
+.preview_box_album_160 {width : 180px; position : relative; float : left; margin : 0px 10px 10px 0px;}
+.preview_box_album_160 img.pr_album_bg {width : 180px; height : 180px; position : absolute;}
+.preview_box_album_160 table{position : relative; width : 180px; height : 180px; text-align : center; vertical-align : middle; border-collapse : collapse;}
+.preview_box_album_160 table img{margin: 0px 0px 1px 1px; border : 1px solid #FFFFFF;}
+.preview_box_album_160 div.album_name {text-align : center; overflow : hidden; width : 180px; white-space : nowrap; margin-top : 3px; text-overflow: ellipsis; height : 14px;}
+.preview_box_album_160 div.album_data {text-align : center; overflow : hidden; width : 180px; white-space : nowrap; text-overflow: ellipsis; color : #666666; font-size : 10px; height : 14px}
+
+
+
+.preview_box_photo_80 {width : 100px; position : relative; float : left; margin : 0px 10px 10px 0px;}
+.preview_box_photo_80 img.pr_photo_bg {width : 100px; height : 100px; position : absolute;}
+.preview_box_photo_80 table{position : relative; width : 100px; height : 100px; text-align : center; vertical-align : middle; border-collapse : collapse;}
+.preview_box_photo_80 table img{margin: 0px 0px 0px 0px; border : 1px solid #FFFFFF;}
+.preview_box_photo_80 div.photo_name {text-align : center; overflow : hidden; width : 100px; white-space : nowrap; margin-top : 3px; text-overflow: ellipsis; height : 14px;}
+.preview_box_photo_80 div.photo_data {text-align : center; overflow : hidden; width : 100px; white-space : nowrap; text-overflow: ellipsis; color : #666666; font-size : 10px; height : 14px}
+
+.preview_box_photo_120 {width : 140px; position : relative; float : left; margin : 0px 10px 10px 0px;}
+.preview_box_photo_120 img.pr_photo_bg {width : 140px; height : 140px; position : absolute;}
+.preview_box_photo_120 table{position : relative; width : 140px; height : 140px; text-align : center; vertical-align : middle; border-collapse : collapse;}
+.preview_box_photo_120 table img{margin: 0px 0px 0px 0px; border : 1px solid #FFFFFF;}
+.preview_box_photo_120 div.photo_name {text-align : center; overflow : hidden; width : 140px; white-space : nowrap; margin-top : 3px; text-overflow: ellipsis; height : 14px;}
+.preview_box_photo_120 div.photo_data {text-align : center; overflow : hidden; width : 140px; white-space : nowrap; text-overflow: ellipsis; color : #666666; font-size : 10px; height : 14px}
+
+.preview_box_photo_160 {width : 180px; position : relative; float : left; margin : 0px 10px 10px 0px;}
+.preview_box_photo_160 img.pr_photo_bg {width : 180px; height : 180px; position : absolute;}
+.preview_box_photo_160 table{position : relative; width : 180px; height : 180px; text-align : center; vertical-align : middle; border-collapse : collapse;}
+.preview_box_photo_160 table img{margin: 0px 0px 0px 0px; border : 1px solid #FFFFFF;}
+.preview_box_photo_160 div.photo_name {text-align : center; overflow : hidden; width : 180px; white-space : nowrap; margin-top : 3px; text-overflow: ellipsis; height : 14px;}
+.preview_box_photo_160 div.photo_data {text-align : center; overflow : hidden; width : 180px; white-space : nowrap; text-overflow: ellipsis; color : #666666; font-size : 10px; height : 14px}
+
+
+.preview_box_photo_nav {width : 100px; height : 100px; position : relative; float : left; margin : 0px 2px 0px 0px;}
+.preview_box_photo_nav img.pr_photo_bg {width : 100px; height : 100px; position : absolute;}
+.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;}
+
+a.breadcrumb {color : #666666; text-decoration : none;}
+a.breadcrumb:hover {color : #DF6400; text-decoration : underline;}
+
+.button_103 {margin : 0px 0px 0px 0px; position : relative; width : 103px; height : 28px;}
+.button_103 img {position : absolute; top : 0px; left : 0px;}
+.button_103 div {position : relative; color : #ffffff; top : 0px; left : 0px; width : 103px; text-align : center; margin-top : 7px;}
+.button_103 input {position : absolute; top : 0px; left : 0px;"}
+
+
Modified: management/design/realWorldDemo/html/photo.html
===================================================================
--- management/design/realWorldDemo/html/photo.html 2009-03-10 15:46:14 UTC (rev 12908)
+++ management/design/realWorldDemo/html/photo.html 2009-03-10 15:58:41 UTC (rev 12909)
@@ -3,82 +3,9 @@
<html>
<head>
<title>Untitled</title>
- <link rel="STYLESHEET" type="text/css" href="common.css">
+ <link rel="STYLESHEET" type="text/css" href="pabm3.css">
</head>
-<style>
- *{font-family : verdana; font-size : 11px}
- body {margin : 0px; background : url(images/shell/page_bg.gif) repeat-x #D7D7D7; height : 100%}
- h1{font-size : 175%; font-weight : normal; margin : 0px;}
- .top_part {height : 116px;}
- .header_box {height : 79px; position : relative;}
- .auth_box {position : absolute; font-weight : bold; color : #ffffff; right : 8px; top : 42px}
- .auth_data {vertical-align : top; padding : 0px 8px 0px 15px; font-weight : bold; color : #ffffff;}
- .auth_data span {color : #FF7200;}
- .about_toolbar {position : absolute; right : 8px; top : 12px;}
- .about_toolbar_item {vertical-align : top; padding : 0px 8px 0px 15px;}
- .about_toolbar_item a{font-size : 11px; color : #ffffff; text-decoration : none;}
- .about_toolbar_item a:hover{font-size : 11px; color : #ffffff; text-decoration : underline;}
-
- .content_box {padding : 15px 35px 45px 35px;}
- .content_box p {margin : 0px 0px 5px 0px; FONT-SIZE : 12PX}
- a{color : #DF6400;}
-
-
- .preview_box_album_80 {width : 100px; position : relative; float : left; margin : 0px 10px 10px 0px;}
- .preview_box_album_80 img.pr_album_bg {width : 100px; height : 100px; position : absolute;}
- .preview_box_album_80 table{position : relative; width : 100px; height : 100px; text-align : center; vertical-align : middle; border-collapse : collapse;}
- .preview_box_album_80 table img{margin: 0px 0px 2px 0px; border : 1px solid #FFFFFF;}
- .preview_box_album_80 div.album_name {text-align : center; overflow : hidden; width : 100px; white-space : nowrap; margin-top : 3px; text-overflow: ellipsis; height : 14px;}
- .preview_box_album_80 div.album_data {text-align : center; overflow : hidden; width : 100px; white-space : nowrap; text-overflow: ellipsis; color : #666666; font-size : 10px; height : 14px}
-
- .preview_box_album_120 {width : 140px; position : relative; float : left; margin : 0px 10px 10px 0px;}
- .preview_box_album_120 img.pr_album_bg {width : 140px; height : 140px; position : absolute;}
- .preview_box_album_120 table{position : relative; width : 140px; height : 140px; text-align : center; vertical-align : middle; border-collapse : collapse;}
- .preview_box_album_120 table img{margin: 0px 0px 2px 0px; border : 1px solid #FFFFFF;}
- .preview_box_album_120 div.album_name {text-align : center; overflow : hidden; width : 140px; white-space : nowrap; margin-top : 3px; text-overflow: ellipsis; height : 14px;}
- .preview_box_album_120 div.album_data {text-align : center; overflow : hidden; width : 140px; white-space : nowrap; text-overflow: ellipsis; color : #666666; font-size : 10px; height : 14px}
-
- .preview_box_album_160 {width : 180px; position : relative; float : left; margin : 0px 10px 10px 0px;}
- .preview_box_album_160 img.pr_album_bg {width : 180px; height : 180px; position : absolute;}
- .preview_box_album_160 table{position : relative; width : 180px; height : 180px; text-align : center; vertical-align : middle; border-collapse : collapse;}
- .preview_box_album_160 table img{margin: 0px 0px 1px 1px; border : 1px solid #FFFFFF;}
- .preview_box_album_160 div.album_name {text-align : center; overflow : hidden; width : 180px; white-space : nowrap; margin-top : 3px; text-overflow: ellipsis; height : 14px;}
- .preview_box_album_160 div.album_data {text-align : center; overflow : hidden; width : 180px; white-space : nowrap; text-overflow: ellipsis; color : #666666; font-size : 10px; height : 14px}
-
-
-
- .preview_box_photo_80 {width : 100px; position : relative; float : left; margin : 0px 10px 10px 0px;}
- .preview_box_photo_80 img.pr_photo_bg {width : 100px; height : 100px; position : absolute;}
- .preview_box_photo_80 table{position : relative; width : 100px; height : 100px; text-align : center; vertical-align : middle; border-collapse : collapse;}
- .preview_box_photo_80 table img{margin: 0px 0px 0px 0px; border : 1px solid #FFFFFF;}
- .preview_box_photo_80 div.photo_name {text-align : center; overflow : hidden; width : 100px; white-space : nowrap; margin-top : 3px; text-overflow: ellipsis; height : 14px;}
- .preview_box_photo_80 div.photo_data {text-align : center; overflow : hidden; width : 100px; white-space : nowrap; text-overflow: ellipsis; color : #666666; font-size : 10px; height : 14px}
-
- .preview_box_photo_120 {width : 140px; position : relative; float : left; margin : 0px 10px 10px 0px;}
- .preview_box_photo_120 img.pr_photo_bg {width : 140px; height : 140px; position : absolute;}
- .preview_box_photo_120 table{position : relative; width : 140px; height : 140px; text-align : center; vertical-align : middle; border-collapse : collapse;}
- .preview_box_photo_120 table img{margin: 0px 0px 0px 0px; border : 1px solid #FFFFFF;}
- .preview_box_photo_120 div.photo_name {text-align : center; overflow : hidden; width : 140px; white-space : nowrap; margin-top : 3px; text-overflow: ellipsis; height : 14px;}
- .preview_box_photo_120 div.photo_data {text-align : center; overflow : hidden; width : 140px; white-space : nowrap; text-overflow: ellipsis; color : #666666; font-size : 10px; height : 14px}
-
- .preview_box_photo_160 {width : 180px; position : relative; float : left; margin : 0px 10px 10px 0px;}
- .preview_box_photo_160 img.pr_photo_bg {width : 180px; height : 180px; position : absolute;}
- .preview_box_photo_160 table{position : relative; width : 180px; height : 180px; text-align : center; vertical-align : middle; border-collapse : collapse;}
- .preview_box_photo_160 table img{margin: 0px 0px 0px 0px; border : 1px solid #FFFFFF;}
- .preview_box_photo_160 div.photo_name {text-align : center; overflow : hidden; width : 180px; white-space : nowrap; margin-top : 3px; text-overflow: ellipsis; height : 14px;}
- .preview_box_photo_160 div.photo_data {text-align : center; overflow : hidden; width : 180px; white-space : nowrap; text-overflow: ellipsis; color : #666666; font-size : 10px; height : 14px}
-
-
- .preview_box_photo_nav {width : 100px; height : 100px; position : relative; float : left; margin : 0px 2px 0px 0px;}
- .preview_box_photo_nav img.pr_photo_bg {width : 100px; height : 100px; position : absolute;}
- .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;}
-
-
-</style>
-
<body>
<table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
@@ -398,7 +325,7 @@
<tr>
<td>
<h1 style="margin-bottom : 4px">Photo name (0-50 symb; first cann't be SPACE symb)</h1>
- <span style="color : #666666">Album «Album name»</span>
+ <a href="#" class="breadcrumb">Shelf «Shelf name»</a> :: <a href="#" class="breadcrumb">Album «Album name»</a>
</td>
<td style=" padding : 8px 0px 0px 20px; vertical-align : top; white-space : nowrap">
</td>
@@ -477,30 +404,30 @@
<img src="images/examples/photo_200.jpg" width="500" height="350" alt="" border="0" style="border : 3px solid #808080">
</td>
<td valign="top">
- <div style="margin : 26px 0px 0px 0px; position : relative; width : 103px; height : 28px;">
- <img src="images/shell/button.png" width="103" height="28" alt="" border="0" style="position : absolute; top : 0px; left : 0px;">
- <div style="position : relative; color : #ffffff; top : 7px; left : 16px">
+ <div class="button_103" style="margin-top : 26px;">
+ <img src="images/shell/button.png" width="103" height="28" alt="" border="0">
+ <div>
Original size
</div>
- <input type="Image" src="images/shell/spacer.gif" width="103" height="28" alt="" border="0" style="position : absolute; top : 0px; left : 0px;">
+ <input type="Image" src="images/shell/spacer.gif" width="103" height="28" alt="" border="0">
</div>
</td>
</tr>
<tr>
<td valign="bottom" style="padding-bottom : 5px">
- <div style="margin : 0px 0px 0px 0px; position : relative; width : 103px; height : 28px;">
- <img src="images/shell/button.png" width="103" height="28" alt="" border="0" style="position : absolute; top : 0px; left : 0px;">
- <div style="position : relative; color : #ffffff; top : 7px; left : 39px">
+ <div class="button_103" style="">
+ <img src="images/shell/button.png" width="103" height="28" alt="" border="0">
+ <div>
Edit
</div>
- <input type="Image" src="images/shell/spacer.gif" width="103" height="28" alt="" border="0" style="position : absolute; top : 0px; left : 0px;">
+ <input type="Image" src="images/shell/spacer.gif" width="103" height="28" alt="" border="0">
</div>
- <div style="margin : 0px 0px 0px 0px; position : relative; width : 103px; height : 28px;">
- <img src="images/shell/button.png" width="103" height="28" alt="" border="0" style="position : absolute; top : 0px; left : 0px;">
- <div style="position : relative; color : #ffffff; top : 7px; left : 32px">
+ <div class="button_103" style="">
+ <img src="images/shell/button.png" width="103" height="28" alt="" border="0" class="button_103_bg">
+ <div>
Delete
</div>
- <input type="Image" src="images/shell/spacer.gif" width="103" height="28" alt="" border="0" style="position : absolute; top : 0px; left : 0px;">
+ <input type="Image" src="images/shell/spacer.gif" width="103" height="28" alt="" border="0">
</div>
</td>
@@ -531,7 +458,7 @@
<table cellpadding="0">
<tr>
<td>
- <a href="#"><img src="images/shell/avatar_default.png" width="80" height="80" alt="" border="0"></a><br>
+ <a href="#"><img src="images/shell/avatar_w_default.png" width="80" height="80" alt="" border="0"></a><br>
</td>
</tr>
</table>
@@ -595,7 +522,7 @@
<table cellpadding="0">
<tr>
<td>
- <a href="#"><img src="images/shell/avatar_default.png" width="80" height="80" alt="" border="0"></a><br>
+ <a href="#"><img src="images/shell/avatar_w_default.png" width="80" height="80" alt="" border="0"></a><br>
</td>
</tr>
</table>
@@ -651,12 +578,12 @@
</tr>
</table>
- <div style="margin : 0px 0px 0px 0px; position : relative; width : 103px; height : 28px;">
- <img src="images/shell/button.png" width="103" height="28" alt="" border="0" style="position : absolute; top : 0px; left : 0px;">
- <div style="position : relative; color : #ffffff; top : 7px; left : 11px">
+ <div class="button_103">
+ <img src="images/shell/button.png" width="103" height="28" alt="" border="0">
+ <div>
Add comment
</div>
- <input type="Image" src="images/shell/spacer.gif" width="103" height="28" alt="" border="0" style="position : absolute; top : 0px; left : 0px;">
+ <input type="Image" src="images/shell/spacer.gif" width="103" height="28" alt="" border="0">
</div>
</div>
Modified: management/design/realWorldDemo/html/photo_edit.html
===================================================================
--- management/design/realWorldDemo/html/photo_edit.html 2009-03-10 15:46:14 UTC (rev 12908)
+++ management/design/realWorldDemo/html/photo_edit.html 2009-03-10 15:58:41 UTC (rev 12909)
@@ -3,84 +3,9 @@
<html>
<head>
<title>Untitled</title>
- <link rel="STYLESHEET" type="text/css" href="common.css">
+ <link rel="STYLESHEET" type="text/css" href="pabm3.css">
</head>
-<style>
- *{font-family : verdana; font-size : 11px}
- body {margin : 0px; background : url(images/shell/page_bg.gif) repeat-x #D7D7D7; height : 100%}
- h1{font-size : 175%; font-weight : normal; margin : 0px;}
- .top_part {height : 116px;}
- .header_box {height : 79px; position : relative;}
- .auth_box {position : absolute; font-weight : bold; color : #ffffff; right : 8px; top : 42px}
- .auth_data {vertical-align : top; padding : 0px 8px 0px 15px; font-weight : bold; color : #ffffff;}
- .auth_data span {color : #FF7200;}
- .about_toolbar {position : absolute; right : 8px; top : 12px;}
- .about_toolbar_item {vertical-align : top; padding : 0px 8px 0px 15px;}
- .about_toolbar_item a{font-size : 11px; color : #ffffff; text-decoration : none;}
- .about_toolbar_item a:hover{font-size : 11px; color : #ffffff; text-decoration : underline;}
-
- .content_box {padding : 15px 35px 45px 35px;}
- .content_box p {margin : 0px 0px 5px 0px; FONT-SIZE : 12PX}
- a{color : #DF6400;}
-
-
- .preview_box_album_80 {width : 100px; position : relative; float : left; margin : 0px 10px 10px 0px;}
- .preview_box_album_80 img.pr_album_bg {width : 100px; height : 100px; position : absolute;}
- .preview_box_album_80 table{position : relative; width : 100px; height : 100px; text-align : center; vertical-align : middle; border-collapse : collapse;}
- .preview_box_album_80 table img{margin: 0px 0px 2px 0px; border : 1px solid #FFFFFF;}
- .preview_box_album_80 div.album_name {text-align : center; overflow : hidden; width : 100px; white-space : nowrap; margin-top : 3px; text-overflow: ellipsis; height : 14px;}
- .preview_box_album_80 div.album_data {text-align : center; overflow : hidden; width : 100px; white-space : nowrap; text-overflow: ellipsis; color : #666666; font-size : 10px; height : 14px}
-
- .preview_box_album_120 {width : 140px; position : relative; float : left; margin : 0px 10px 10px 0px;}
- .preview_box_album_120 img.pr_album_bg {width : 140px; height : 140px; position : absolute;}
- .preview_box_album_120 table{position : relative; width : 140px; height : 140px; text-align : center; vertical-align : middle; border-collapse : collapse;}
- .preview_box_album_120 table img{margin: 0px 0px 2px 0px; border : 1px solid #FFFFFF;}
- .preview_box_album_120 div.album_name {text-align : center; overflow : hidden; width : 140px; white-space : nowrap; margin-top : 3px; text-overflow: ellipsis; height : 14px;}
- .preview_box_album_120 div.album_data {text-align : center; overflow : hidden; width : 140px; white-space : nowrap; text-overflow: ellipsis; color : #666666; font-size : 10px; height : 14px}
-
- .preview_box_album_160 {width : 180px; position : relative; float : left; margin : 0px 10px 10px 0px;}
- .preview_box_album_160 img.pr_album_bg {width : 180px; height : 180px; position : absolute;}
- .preview_box_album_160 table{position : relative; width : 180px; height : 180px; text-align : center; vertical-align : middle; border-collapse : collapse;}
- .preview_box_album_160 table img{margin: 0px 0px 1px 1px; border : 1px solid #FFFFFF;}
- .preview_box_album_160 div.album_name {text-align : center; overflow : hidden; width : 180px; white-space : nowrap; margin-top : 3px; text-overflow: ellipsis; height : 14px;}
- .preview_box_album_160 div.album_data {text-align : center; overflow : hidden; width : 180px; white-space : nowrap; text-overflow: ellipsis; color : #666666; font-size : 10px; height : 14px}
-
-
-
- .preview_box_photo_80 {width : 100px; position : relative; float : left; margin : 0px 10px 10px 0px;}
- .preview_box_photo_80 img.pr_photo_bg {width : 100px; height : 100px; position : absolute;}
- .preview_box_photo_80 table{position : relative; width : 100px; height : 100px; text-align : center; vertical-align : middle; border-collapse : collapse;}
- .preview_box_photo_80 table img{margin: 0px 0px 0px 0px; border : 1px solid #FFFFFF;}
- .preview_box_photo_80 div.photo_name {text-align : center; overflow : hidden; width : 100px; white-space : nowrap; margin-top : 3px; text-overflow: ellipsis; height : 14px;}
- .preview_box_photo_80 div.photo_data {text-align : center; overflow : hidden; width : 100px; white-space : nowrap; text-overflow: ellipsis; color : #666666; font-size : 10px; height : 14px}
-
- .preview_box_photo_120 {width : 140px; position : relative; float : left; margin : 0px 10px 10px 0px;}
- .preview_box_photo_120 img.pr_photo_bg {width : 140px; height : 140px; position : absolute;}
- .preview_box_photo_120 table{position : relative; width : 140px; height : 140px; text-align : center; vertical-align : middle; border-collapse : collapse;}
- .preview_box_photo_120 table img{margin: 0px 0px 0px 0px; border : 1px solid #FFFFFF;}
- .preview_box_photo_120 div.photo_name {text-align : center; overflow : hidden; width : 140px; white-space : nowrap; margin-top : 3px; text-overflow: ellipsis; height : 14px;}
- .preview_box_photo_120 div.photo_data {text-align : center; overflow : hidden; width : 140px; white-space : nowrap; text-overflow: ellipsis; color : #666666; font-size : 10px; height : 14px}
-
- .preview_box_photo_160 {width : 180px; position : relative; float : left; margin : 0px 10px 10px 0px;}
- .preview_box_photo_160 img.pr_photo_bg {width : 180px; height : 180px; position : absolute;}
- .preview_box_photo_160 table{position : relative; width : 180px; height : 180px; text-align : center; vertical-align : middle; border-collapse : collapse;}
- .preview_box_photo_160 table img{margin: 0px 0px 0px 0px; border : 1px solid #FFFFFF;}
- .preview_box_photo_160 div.photo_name {text-align : center; overflow : hidden; width : 180px; white-space : nowrap; margin-top : 3px; text-overflow: ellipsis; height : 14px;}
- .preview_box_photo_160 div.photo_data {text-align : center; overflow : hidden; width : 180px; white-space : nowrap; text-overflow: ellipsis; color : #666666; font-size : 10px; height : 14px}
-
-
- .preview_box_photo_nav {width : 100px; height : 100px; position : relative; float : left; margin : 0px 2px 0px 0px;}
- .preview_box_photo_nav img.pr_photo_bg {width : 100px; height : 100px; position : absolute;}
- .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;}
-
-
-
-
-</style>
-
<body>
<table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
@@ -479,30 +404,30 @@
<img src="images/examples/photo_200.jpg" width="500" height="350" alt="" border="0" style="border : 3px solid #808080">
</td>
<td valign="top">
- <div style="margin : 26px 0px 0px 0px; position : relative; width : 103px; height : 28px; display : none;">
- <img src="images/shell/button.png" width="103" height="28" alt="" border="0" style="position : absolute; top : 0px; left : 0px;">
- <div style="position : relative; color : #ffffff; top : 7px; left : 16px">
+ <div class="button_103" style="margin-top : 26px; display : none;">
+ <img src="images/shell/button.png" width="103" height="28" alt="" border="0">
+ <div>
Original size
</div>
- <input type="Image" src="images/shell/spacer.gif" width="103" height="28" alt="" border="0" style="position : absolute; top : 0px; left : 0px;">
+ <input type="Image" src="images/shell/spacer.gif" width="103" height="28" alt="" border="0">
</div>
</td>
</tr>
<tr>
<td valign="bottom" style="padding-bottom : 5px">
- <div style="margin : 0px 0px 0px 0px; position : relative; width : 103px; height : 28px; display : none;">
- <img src="images/shell/button.png" width="103" height="28" alt="" border="0" style="position : absolute; top : 0px; left : 0px;">
- <div style="position : relative; color : #ffffff; top : 7px; left : 39px">
+ <div class="button_103" style="display : none;">
+ <img src="images/shell/button.png" width="103" height="28" alt="" border="0">
+ <div>
Edit
</div>
- <input type="Image" src="images/shell/spacer.gif" width="103" height="28" alt="" border="0" style="position : absolute; top : 0px; left : 0px;">
+ <input type="Image" src="images/shell/spacer.gif" width="103" height="28" alt="" border="0">
</div>
- <div style="margin : 0px 0px 0px 0px; position : relative; width : 103px; height : 28px; display : none;">
- <img src="images/shell/button.png" width="103" height="28" alt="" border="0" style="position : absolute; top : 0px; left : 0px;">
- <div style="position : relative; color : #ffffff; top : 7px; left : 32px">
+ <div class="button_103" style="display : none;">
+ <img src="images/shell/button.png" width="103" height="28" alt="" border="0" class="button_103_bg">
+ <div>
Delete
</div>
- <input type="Image" src="images/shell/spacer.gif" width="103" height="28" alt="" border="0" style="position : absolute; top : 0px; left : 0px;">
+ <input type="Image" src="images/shell/spacer.gif" width="103" height="28" alt="" border="0">
</div>
</td>
@@ -581,26 +506,26 @@
</td>
<td width="100%" valign="top" align="right" colspan="2" style="padding : 10px 10px 10px 10px;">
- <div style="margin : 0px 0px 0px 0px; position : relative; width : 103px; height : 28px; float : left">
- <img src="images/shell/button.png" width="103" height="28" alt="" border="0" style="position : absolute; top : 0px; left : 0px;">
- <div style="position : absolute; color : #ffffff; top : 7px; left : 11px">
+ <div class="button_103" style="float : left">
+ <img src="images/shell/button.png" width="103" height="28" alt="" border="0">
+ <div>
Delete
</div>
- <input type="Image" src="images/shell/spacer.gif" width="103" height="28" alt="" border="0" style="position : absolute; top : 0px; left : 0px;">
+ <input type="Image" src="images/shell/spacer.gif" width="103" height="28" alt="" border="0">
</div>
- <div style="margin : 0px 0px 0px 0px; position : relative; width : 103px; height : 28px; float : right">
- <img src="images/shell/button.png" width="103" height="28" alt="" border="0" style="position : absolute; top : 0px; left : 0px;">
- <div style="position : absolute; color : #ffffff; top : 7px; left : 11px">
+ <div class="button_103" style="float : right">
+ <img src="images/shell/button.png" width="103" height="28" alt="" border="0">
+ <div>
Cancel
</div>
- <input type="Image" src="images/shell/spacer.gif" width="103" height="28" alt="" border="0" style="position : absolute; top : 0px; left : 0px;">
+ <input type="Image" src="images/shell/spacer.gif" width="103" height="28" alt="" border="0">
</div>
- <div style="margin : 0px 0px 0px 0px; position : relative; width : 103px; height : 28px; float : right"">
- <img src="images/shell/button.png" width="103" height="28" alt="" border="0" style="position : absolute; top : 0px; left : 0px;">
- <div style="position : absolute; color : #ffffff; top : 7px; left : 11px; font-weight : bold;">
+ <div class="button_103" style="float : right">
+ <img src="images/shell/button.png" width="103" height="28" alt="" border="0">
+ <div style="font-weight : bold;">
Save
</div>
- <input type="Image" src="images/shell/spacer.gif" width="103" height="28" alt="" border="0" style="position : absolute; top : 0px; left : 0px;">
+ <input type="Image" src="images/shell/spacer.gif" width="103" height="28" alt="" border="0">
</div>
</td>
</tr>
@@ -673,7 +598,7 @@
</div>
</form>
-<div style="height : 52px; width: 79px; position : absolute; top : 0px; left : 278px; visibility : vidden;">
+<div class="ai_status" style="height : 52px; width: 79px; position : absolute; top : 0px; left : 278px; display : !none;">
<img src="images/shell/ai.png" width="52" height="79" alt="" border="0" style="position : absolute; top : 0px; left: 0px">
<img src="images/shell/ai.gif" width="26" height="26" alt="" border="0" style="position : absolute; top : 26px; left: 13px">
</div>
Modified: management/design/realWorldDemo/html/shelf.html
===================================================================
--- management/design/realWorldDemo/html/shelf.html 2009-03-10 15:46:14 UTC (rev 12908)
+++ management/design/realWorldDemo/html/shelf.html 2009-03-10 15:58:41 UTC (rev 12909)
@@ -3,84 +3,9 @@
<html>
<head>
<title>Untitled</title>
- <link rel="STYLESHEET" type="text/css" href="common.css">
+ <link rel="STYLESHEET" type="text/css" href="pabm3.css">
</head>
-<style>
- *{font-family : verdana; font-size : 11px}
- body {margin : 0px; background : url(images/shell/page_bg.gif) repeat-x #D7D7D7; height : 100%}
- h1{font-size : 175%; font-weight : normal; margin : 0px;}
- .top_part {height : 116px;}
- .header_box {height : 79px; position : relative;}
- .auth_box {position : absolute; font-weight : bold; color : #ffffff; right : 8px; top : 42px}
- .auth_data {vertical-align : top; padding : 0px 8px 0px 15px; font-weight : bold; color : #ffffff;}
- .auth_data span {color : #FF7200;}
- .about_toolbar {position : absolute; right : 8px; top : 12px;}
- .about_toolbar_item {vertical-align : top; padding : 0px 8px 0px 15px;}
- .about_toolbar_item a{font-size : 11px; color : #ffffff; text-decoration : none;}
- .about_toolbar_item a:hover{font-size : 11px; color : #ffffff; text-decoration : underline;}
-
- .content_box {padding : 15px 35px 15px 35px;}
- .content_box p {margin : 0px 0px 5px 0px; FONT-SIZE : 12PX}
- a{color : #DF6400;}
-
-
- .preview_box_album_80 {width : 100px; position : relative; float : left; margin : 0px 10px 10px 0px;}
- .preview_box_album_80 img.pr_album_bg {width : 100px; height : 100px; position : absolute;}
- .preview_box_album_80 table{position : relative; width : 100px; height : 100px; text-align : center; vertical-align : middle; border-collapse : collapse;}
- .preview_box_album_80 table img{margin: 0px 0px 2px 0px; border : 1px solid #FFFFFF;}
- .preview_box_album_80 div.album_name {text-align : center; overflow : hidden; width : 100px; white-space : nowrap; margin-top : 3px; text-overflow: ellipsis; height : 14px;}
- .preview_box_album_80 div.album_data {text-align : center; overflow : hidden; width : 100px; white-space : nowrap; text-overflow: ellipsis; color : #666666; font-size : 10px; height : 14px}
-
- .preview_box_album_120 {width : 140px; position : relative; float : left; margin : 0px 10px 10px 0px;}
- .preview_box_album_120 img.pr_album_bg {width : 140px; height : 140px; position : absolute;}
- .preview_box_album_120 table{position : relative; width : 140px; height : 140px; text-align : center; vertical-align : middle; border-collapse : collapse;}
- .preview_box_album_120 table img{margin: 0px 0px 2px 0px; border : 1px solid #FFFFFF;}
- .preview_box_album_120 div.album_name {text-align : center; overflow : hidden; width : 140px; white-space : nowrap; margin-top : 3px; text-overflow: ellipsis; height : 14px;}
- .preview_box_album_120 div.album_data {text-align : center; overflow : hidden; width : 140px; white-space : nowrap; text-overflow: ellipsis; color : #666666; font-size : 10px; height : 14px}
-
- .preview_box_album_160 {width : 180px; position : relative; float : left; margin : 0px 10px 10px 0px;}
- .preview_box_album_160 img.pr_album_bg {width : 180px; height : 180px; position : absolute;}
- .preview_box_album_160 table{position : relative; width : 180px; height : 180px; text-align : center; vertical-align : middle; border-collapse : collapse;}
- .preview_box_album_160 table img{margin: 0px 0px 1px 1px; border : 1px solid #FFFFFF;}
- .preview_box_album_160 div.album_name {text-align : center; overflow : hidden; width : 180px; white-space : nowrap; margin-top : 3px; text-overflow: ellipsis; height : 14px;}
- .preview_box_album_160 div.album_data {text-align : center; overflow : hidden; width : 180px; white-space : nowrap; text-overflow: ellipsis; color : #666666; font-size : 10px; height : 14px}
-
-
-
- .preview_box_photo_80 {width : 100px; position : relative; float : left; margin : 0px 10px 10px 0px;}
- .preview_box_photo_80 img.pr_photo_bg {width : 100px; height : 100px; position : absolute;}
- .preview_box_photo_80 table{position : relative; width : 100px; height : 100px; text-align : center; vertical-align : middle; border-collapse : collapse;}
- .preview_box_photo_80 table img{margin: 0px 0px 0px 0px; border : 1px solid #FFFFFF;}
- .preview_box_photo_80 div.photo_name {text-align : center; overflow : hidden; width : 100px; white-space : nowrap; margin-top : 3px; text-overflow: ellipsis; height : 14px;}
- .preview_box_photo_80 div.photo_data {text-align : center; overflow : hidden; width : 100px; white-space : nowrap; text-overflow: ellipsis; color : #666666; font-size : 10px; height : 14px}
-
- .preview_box_photo_120 {width : 140px; position : relative; float : left; margin : 0px 10px 10px 0px;}
- .preview_box_photo_120 img.pr_photo_bg {width : 140px; height : 140px; position : absolute;}
- .preview_box_photo_120 table{position : relative; width : 140px; height : 140px; text-align : center; vertical-align : middle; border-collapse : collapse;}
- .preview_box_photo_120 table img{margin: 0px 0px 0px 0px; border : 1px solid #FFFFFF;}
- .preview_box_photo_120 div.photo_name {text-align : center; overflow : hidden; width : 140px; white-space : nowrap; margin-top : 3px; text-overflow: ellipsis; height : 14px;}
- .preview_box_photo_120 div.photo_data {text-align : center; overflow : hidden; width : 140px; white-space : nowrap; text-overflow: ellipsis; color : #666666; font-size : 10px; height : 14px}
-
- .preview_box_photo_160 {width : 180px; position : relative; float : left; margin : 0px 10px 10px 0px;}
- .preview_box_photo_160 img.pr_photo_bg {width : 180px; height : 180px; position : absolute;}
- .preview_box_photo_160 table{position : relative; width : 180px; height : 180px; text-align : center; vertical-align : middle; border-collapse : collapse;}
- .preview_box_photo_160 table img{margin: 0px 0px 0px 0px; border : 1px solid #FFFFFF;}
- .preview_box_photo_160 div.photo_name {text-align : center; overflow : hidden; width : 180px; white-space : nowrap; margin-top : 3px; text-overflow: ellipsis; height : 14px;}
- .preview_box_photo_160 div.photo_data {text-align : center; overflow : hidden; width : 180px; white-space : nowrap; text-overflow: ellipsis; color : #666666; font-size : 10px; height : 14px}
-
-
- .preview_box_photo_nav {width : 100px; height : 100px; position : relative; float : left; margin : 0px 2px 0px 0px;}
- .preview_box_photo_nav img.pr_photo_bg {width : 100px; height : 100px; position : absolute;}
- .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;}
-
-
-
-
-</style>
-
<body>
<table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
15 years, 10 months
JBoss Rich Faces SVN: r12908 - in trunk/test-applications/realworld2/web/src/main: java/org/richfaces/realworld/navigation and 6 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alevkovsky
Date: 2009-03-10 11:46:14 -0400 (Tue, 10 Mar 2009)
New Revision: 12908
Added:
trunk/test-applications/realworld2/web/src/main/webapp/includes/shelf/userShelfEditBlock.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/userShelfEdit.xhtml
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/navigation/NavigationEnum.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/ConversationState.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/includes/image/userImageEditBlock.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/image/userImagePreviewBlock.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/shelf/userShelfPreview.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/stylesheet/realworld2.css
Log:
Realworld: add shelf edit murkup
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-03-10 14:46:13 UTC (rev 12907)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/ShelfManager.java 2009-03-10 15:46:14 UTC (rev 12908)
@@ -93,6 +93,7 @@
public void editShelf(Shelf shelf){
shelfAction.editShelf(shelf);
conversationState.setSelectedShelf(shelf);
+ Events.instance().raiseEvent(Constants.UPDATE_MAIN_AREA_EVENT, NavigationEnum.SHELF_PREVIEW);
}
public void deleteShelf(Shelf shelf){
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/navigation/NavigationEnum.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/navigation/NavigationEnum.java 2009-03-10 14:46:13 UTC (rev 12907)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/navigation/NavigationEnum.java 2009-03-10 15:46:14 UTC (rev 12908)
@@ -35,7 +35,8 @@
ALL_ALBUMS("/includes/userAlbums.xhtml"),
ALL_IMAGES("/includes/userImages.xhtml"),
ALBUM_IMAGE_EDIT("/includes/userImageEdit.xhtml"),
- ALBUM_EDIT("/includes/userAlbumEdit.xhtml");
+ ALBUM_EDIT("/includes/userAlbumEdit.xhtml"),
+ SHELF_EDIT("/includes/userShelfEdit.xhtml");
private NavigationEnum(String t){
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/ConversationState.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/ConversationState.java 2009-03-10 14:46:13 UTC (rev 12907)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/ConversationState.java 2009-03-10 15:46:14 UTC (rev 12908)
@@ -268,6 +268,18 @@
public void cancelEditAlbum(Album album){
Events.instance().raiseEvent(Constants.UPDATE_MAIN_AREA_EVENT, NavigationEnum.ALBUM_PREVIEW);
}
+
+ public void editShelf(Shelf shelf){
+ if(shelf.getOwner().equals(user)){
+ Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, new Exception(HAVENT_ACCESS));
+ return;
+ }
+ Events.instance().raiseEvent(Constants.UPDATE_MAIN_AREA_EVENT, NavigationEnum.SHELF_EDIT);
+ }
+
+ public void cancelEditShelf(Shelf shelf){
+ Events.instance().raiseEvent(Constants.UPDATE_MAIN_AREA_EVENT, NavigationEnum.SHELF_PREVIEW);
+ }
public void selectMyAlbums(){
setSelectedAlbum(null);
Modified: trunk/test-applications/realworld2/web/src/main/resources/messages_en.properties
===================================================================
--- trunk/test-applications/realworld2/web/src/main/resources/messages_en.properties 2009-03-10 14:46:13 UTC (rev 12907)
+++ trunk/test-applications/realworld2/web/src/main/resources/messages_en.properties 2009-03-10 15:46:14 UTC (rev 12908)
@@ -1,4 +1,3 @@
-up=\u2191
down=\u2193
left=\u2039
right=\u203A
@@ -172,6 +171,7 @@
image.meta=Image Meta-information:
image.store=Store
image.cancel=Cancel
+image.save=Save
slideshow.start=Start Slideshow
slideshow.stop=Stop slideshow
Modified: trunk/test-applications/realworld2/web/src/main/resources/messages_ru.properties
===================================================================
--- trunk/test-applications/realworld2/web/src/main/resources/messages_ru.properties 2009-03-10 14:46:13 UTC (rev 12907)
+++ trunk/test-applications/realworld2/web/src/main/resources/messages_ru.properties 2009-03-10 15:46:14 UTC (rev 12908)
@@ -111,6 +111,7 @@
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
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/image/userImageEditBlock.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/image/userImagePreviewBlock.xhtml
===================================================================
(Binary files differ)
Added: trunk/test-applications/realworld2/web/src/main/webapp/includes/shelf/userShelfEditBlock.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld2/web/src/main/webapp/includes/shelf/userShelfEditBlock.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/shelf/userShelfPreview.xhtml
===================================================================
(Binary files differ)
Added: trunk/test-applications/realworld2/web/src/main/webapp/includes/userShelfEdit.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld2/web/src/main/webapp/includes/userShelfEdit.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Modified: trunk/test-applications/realworld2/web/src/main/webapp/stylesheet/realworld2.css
===================================================================
--- trunk/test-applications/realworld2/web/src/main/webapp/stylesheet/realworld2.css 2009-03-10 14:46:13 UTC (rev 12907)
+++ trunk/test-applications/realworld2/web/src/main/webapp/stylesheet/realworld2.css 2009-03-10 15:46:14 UTC (rev 12908)
@@ -577,7 +577,7 @@
border: 0px;
}
.buttons-body-text-div{
- position : relative;
+ position : absolute;
color : #ffffff;
top : 7px;
left : 8px;
@@ -606,4 +606,13 @@
.comment-text{
margin : 0px 0px 10px 0px;
padding : 0px 4px 0px 4px;
+}
+
+.image-edit-div{
+ margin : 10px 0px 30px 30px;
+ width : 504px;
+ background : #f1f1f1;
+}
+.image-edit-div-table{
+ border-collapse : collapse;
}
\ No newline at end of file
15 years, 10 months
JBoss Rich Faces SVN: r12907 - in trunk/test-applications/seleniumTest/richfaces/src: main/webapp/pages/hotKey and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2009-03-10 10:46:13 -0400 (Tue, 10 Mar 2009)
New Revision: 12907
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/HotKeyBean.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/hotKey/hotKey.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/HotKeyTest.java
Log:
RF-6290
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/HotKeyBean.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/HotKeyBean.java 2009-03-10 13:37:08 UTC (rev 12906)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/HotKeyBean.java 2009-03-10 14:46:13 UTC (rev 12907)
@@ -4,8 +4,11 @@
private String key;
+ private String timing;
+
public void init() {
key = null;
+ timing = "immediate";
}
public void setKey(String key) {
@@ -15,4 +18,12 @@
public String getKey() {
return key;
}
+
+ public void setTiming(String timing) {
+ this.timing = timing;
+ }
+
+ public String getTiming() {
+ return timing;
+ }
}
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/hotKey/hotKey.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/hotKey/hotKey.xhtml 2009-03-10 13:37:08 UTC (rev 12906)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/hotKey/hotKey.xhtml 2009-03-10 14:46:13 UTC (rev 12907)
@@ -13,9 +13,14 @@
<h:inputText id="key" value="#{hotKey.key}">
<a4j:support event="onchange" reRender="panelGroup"/>
</h:inputText>
+ <h:outputText value="timing" />
+ <h:inputText id="timing" value="#{hotKey.timing}">
+ <a4j:support event="onchange" reRender="panelGroup"/>
+ </h:inputText>
</h:form>
<h:panelGroup id="panelGroup">
- <rich:hotKey id="hotKey" key="#{hotKey.key}" handler="document.getElementById('input').value = '#{hotKey.key}'"/>
+ <rich:hotKey id="hotKey" timing="#{hotKey.timing}" key="#{hotKey.key}"
+ handler="document.getElementById('input').value = '#{hotKey.key}'"/>
<input id="input" />
</h:panelGroup>
</ui:define>
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/HotKeyTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/HotKeyTest.java 2009-03-10 13:37:08 UTC (rev 12906)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/HotKeyTest.java 2009-03-10 14:46:13 UTC (rev 12907)
@@ -9,14 +9,17 @@
private String key;
+ private String timing;
+
private String hotKey;
private String input;
private void init(Template template) {
- renderPage(null, template, "#{dataList.init}");
+ renderPage(null, template, "#{hotKey.init}");
String attrForm = getParentId() + "attrForm";
key = attrForm + ":key";
+ timing = attrForm + ":timing";
hotKey = getParentId() + "hotKey";
input = "input";
}
@@ -115,6 +118,25 @@
Assert.assertEquals(selenium.getValue(input), keySequence);
}
+ /**
+ * Define hotKey component with timing="onregistercall" and check that it does not work
+ */
+ @Test
+ public void testOnRegisterCall(Template template) {
+ init(template);
+ String keySequence = "return";
+ selenium.type(key, keySequence);
+ waitForAjaxCompletion();
+ selenium.type(timing, "onregistercall");
+ waitForAjaxCompletion();
+ selenium.runScript("var hotKey = document.getElementById('" + hotKey + "').component");
+ selenium.keyDown(input, "\\13");
+ Assert.assertEquals(selenium.getValue(input), "");
+ selenium.runScript("hotKey.enable()");
+ selenium.keyDown(input, "\\13");
+ Assert.assertEquals(selenium.getValue(input), keySequence);
+ }
+
@Override
public String getTestUrl() {
return "pages/hotKey/hotKey.xhtml";
15 years, 10 months
JBoss Rich Faces SVN: r12906 - trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2009-03-10 09:37:08 -0400 (Tue, 10 Mar 2009)
New Revision: 12906
Modified:
trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js
Log:
https://jira.jboss.org/jira/browse/RF-6257
Modified: trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js
===================================================================
--- trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js 2009-03-10 12:44:21 UTC (rev 12905)
+++ trunk/ui/tree/src/main/resources/org/richfaces/renderkit/html/scripts/tree-item.js 2009-03-10 13:37:08 UTC (rev 12906)
@@ -466,7 +466,7 @@
alert(s);
*/
- if (e["treeItem"])
+ if (!e || e["treeItem"])
{
var eText = this.elements.textElement;
if (!this.selectedTextClassNames)
15 years, 10 months