Author: amarkhel
Date: 2009-03-30 14:40:48 -0400 (Mon, 30 Mar 2009)
New Revision: 13308
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/Controller.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/DnDManager.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/FileManager.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Model.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/NavigationEnum.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/ShelfManager.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/SlideshowManager.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/UserManager.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/startup/CopyImageStuff.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/FileUploadBean.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/DirectLinkHelper.java
trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/pages.xml
trunk/test-applications/realworld2/web/src/main/webapp/includes/album/albumEditInfo.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/album/albumInfo.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/album/albumsList.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/albumUnvisited.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/contextMenu/CMForShelf.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/directImage.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/fileUpload/fileUploader.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/fileUpload/uploadResult.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/image/imageInfo.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/image/imageList.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/index/tree.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/search.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/search/result/albumsResult.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/shelf/shelfInfo.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/shelfUnvisited.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/tag.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/userPrefs.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/userPrefs/userPrefs.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/userSharedImages.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/layout/template.xhtml
Log:
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-30
18:40:13 UTC (rev 13307)
+++
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/AlbumManager.java 2009-03-30
18:40:48 UTC (rev 13308)
@@ -21,6 +21,7 @@
package org.richfaces.realworld.manager;
import java.io.Serializable;
+import java.util.List;
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.AutoCreate;
@@ -31,6 +32,7 @@
import org.jboss.seam.core.Events;
import org.jboss.seam.faces.FacesMessages;
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.service.FlushStrategy;
@@ -65,7 +67,7 @@
albumAction.addAlbum(album);
//TODO nick - addDirectory() uses this.album, do we need: this.album = album?
addDirectory();
- model.resetModel(model.getMainArea(), model.getSelectedUser(),
model.getSelectedShelf(), album, null);
+ model.resetModel(NavigationEnum.ALBUM_PREVIEW, album.getShelf().getOwner(),
album.getShelf(), album, null);
Events.instance().raiseEvent("albumAdded");
Events.instance().raiseEvent("clearTree");
setOncomplete();
@@ -94,11 +96,11 @@
Events.instance().raiseEvent("clearTree");
}
- public Long getCountUnvisitedImages(Album album){
+ public List<Image> getUnvisitedImages(Album album){
if(album.getCountUnvisitedImages() == 0){
album.setUnvisitedImages(albumAction.getUnvisitedImages(album));
}
- return album.getCountUnvisitedImages();
+ return album.getUnvisitedImages();
}
private void setOncomplete() {
Modified:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Controller.java
===================================================================
---
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Controller.java 2009-03-30
18:40:13 UTC (rev 13307)
+++
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Controller.java 2009-03-30
18:40:48 UTC (rev 13308)
@@ -48,6 +48,12 @@
private String HAVENT_ACCESS;
@In @Out Model model;
+
+ @In UserManager userManager;
+
+ @In ShelfManager shelfManager;
+
+ @In AlbumManager albumManager;
@In
private User user;
@@ -83,7 +89,8 @@
pushEvent(Constants.ADD_ERROR_EVENT, new Exception(HAVENT_ACCESS));
return;
}
- model.resetModel(NavigationEnum.ALBUM_PREVIEW, album.getOwner(), album.getShelf(),
album, null);
+ model.resetModel(NavigationEnum.ALBUM_PREVIEW, album.getOwner(), album.getShelf(),
album, null);
+ model.setImages(album.getImages());
}
public void showImage(Image image){
@@ -135,18 +142,20 @@
}
public void startEditAlbum(Album album){
- if(!album.getOwner().equals(user)){
+ if(!album.getOwner().getLogin().equals(user.getLogin())){
pushEvent(Constants.ADD_ERROR_EVENT, new Exception(HAVENT_ACCESS));
return;
}
//TODO nick - resetModel?
model.setSelectedAlbum(album);
+ model.setImages(album.getImages());
model.setMainArea(NavigationEnum.ALBUM_EDIT);
}
public void cancelEditAlbum(Album album){
//TODO nick - unused "album" argument
model.setMainArea(NavigationEnum.ALBUM_PREVIEW);
+ model.setImages(album.getImages());
}
public void showFileUpload(){
@@ -164,6 +173,7 @@
public void showSharedImages(User user){
model.resetModel(NavigationEnum.USER_SHARED_IMAGES, user, null, null, null);
+ model.setImages(userManager.getSharedImages(model.getSelectedUser()));
}
public boolean isUserShelf(Shelf shelf){
@@ -184,29 +194,32 @@
}
public void showUnvisitedImages(Shelf shelf){
- model.resetModel(NavigationEnum.SHELF_UNVISITED, shelf.getOwner(), shelf,
shelf.getFirstAlbum(), null);
+ model.resetModel(NavigationEnum.SHELF_UNVISITED, shelf.getOwner(), shelf, null, null);
+ model.setImages(shelfManager.getUnvisitedImages(shelf));
}
public void showUnvisitedImages(Album album){
model.resetModel(NavigationEnum.ALBUM_UNVISITED, album.getShelf().getOwner(),
album.getShelf(), album, null);
+ model.setImages(album.getUnvisitedImages());
}
public void showTag(MetaTag metatag){
//TODO nick - model.setMainArea()?
model.resetModel(NavigationEnum.TAGS, model.getSelectedUser(),
model.getSelectedShelf(), model.getSelectedAlbum(), model.getSelectedImage());
model.setSelectedTag(metatag);
+ model.setImages(metatag.getImages());
}
private boolean canViewShelf(Shelf shelf) {
- return shelf.getOwner().equals(user);
+ return shelf.getOwner().getLogin().equals(user.getLogin());
}
private boolean canViewImage(Image image) {
- return image.getAlbum().getShelf().isShared() ||
image.getAlbum().getOwner().equals(user);
+ return image.getAlbum().getShelf().isShared() ||
image.getAlbum().getOwner().getLogin().equals(user.getLogin());
}
private boolean canViewAlbum(Album album) {
- return album.getShelf().isShared() || album.getOwner().equals(user);
+ return album.getShelf().isShared() ||
album.getOwner().getLogin().equals(user.getLogin());
}
private void pushEvent(String type, Object... parameters) {
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-30
18:40:13 UTC (rev 13307)
+++
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/DnDManager.java 2009-03-30
18:40:48 UTC (rev 13308)
@@ -46,7 +46,7 @@
Object dragValue = dropEvent.getDragValue();
Object dropValue = dropzone.getDropValue();
if(dragValue instanceof Image){
- if(!((Album)dropValue).getOwner().equals(user)){
+ if(!((Album)dropValue).getOwner().getLogin().equals(user.getLogin())){
Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, new Exception("You
can't add photo's to that album"));
return;
}
Modified:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/FileManager.java
===================================================================
---
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/FileManager.java 2009-03-30
18:40:13 UTC (rev 13307)
+++
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/FileManager.java 2009-03-30
18:40:48 UTC (rev 13308)
@@ -395,26 +395,33 @@
return ret;
}
- public boolean writeFile(String newFileName, String fileName, String pattern, int
size, boolean includeUploadRoot) {
- BufferedImage bsrc = null;
- try {
- bsrc = bitmapToImage(fileName, "JPG");
- } catch (IOException e1) {
- return false;
- }
- final int i = bsrc.getWidth() > bsrc.getHeight() ? bsrc.getWidth() :
bsrc.getHeight();
- final double d = ((double) size) / i;
- final int width = (int) d * bsrc.getWidth();
- final int height = (int) d * bsrc.getHeight();
- final BufferedImage bdest = getScaledInstance(bsrc, width, height,
RenderingHints.VALUE_INTERPOLATION_BICUBIC, true);
- final String dest = includeUploadRoot ? this.uploadRootPath +
transformPath(newFileName, pattern) : transformPath(newFileName, pattern);
- try {
- imageToBitmap(bdest, dest, "JPG");
- } catch (IOException ex) {
- return false;
- }
- return true;
- }
+ public boolean writeFile(String newFileName, String fileName,
+ String pattern, int size, boolean includeUploadRoot) {
+ BufferedImage bsrc = null;
+ try {
+ bsrc = bitmapToImage(fileName, "JPG");
+ } catch (IOException e1) {
+ return false;
+ }
+ int i = bsrc.getWidth() > bsrc.getHeight() ? bsrc.getWidth() : bsrc
+ .getHeight();
+ double d = (double) size / i;
+ Double yy = ((Double) d * bsrc.getWidth());
+ int width = yy.intValue();
+ yy = ((Double) d * bsrc.getHeight());
+ int height = yy.intValue();
+ BufferedImage bdest = getScaledInstance(bsrc, width, height,
+ RenderingHints.VALUE_INTERPOLATION_BICUBIC, true);
+ String dest = includeUploadRoot ? this.uploadRootPath
+ + transformPath(newFileName, pattern) : transformPath(
+ newFileName, pattern);
+ try {
+ imageToBitmap(bdest, dest, "JPG");
+ } catch (IOException ex) {
+ return false;
+ }
+ return true;
+ }
public String transformPath(String target, String substitute) {
final String begin = target.substring(0, target.lastIndexOf(Constants.DOT));
Modified:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Model.java
===================================================================
---
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Model.java 2009-03-30
18:40:13 UTC (rev 13307)
+++
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Model.java 2009-03-30
18:40:48 UTC (rev 13308)
@@ -1,5 +1,7 @@
package org.richfaces.realworld.manager;
+import java.util.List;
+
import org.jboss.seam.ScopeType;
import org.jboss.seam.annotations.AutoCreate;
import org.jboss.seam.annotations.Name;
@@ -32,6 +34,8 @@
private NavigationEnum mainArea;
+ private List<Image> images;
+
public void resetModel(NavigationEnum mainArea, User selectedUser, Shelf selectedShelf,
Album selectedAlbum, Image selectedImage){
this.setMainArea(mainArea);
this.setSelectedAlbum(selectedAlbum);
@@ -106,4 +110,12 @@
public void setSelectedTag(MetaTag selectedTag) {
this.selectedTag = selectedTag;
}
+
+ public List<Image> getImages() {
+ return images;
+ }
+
+ public void setImages(List<Image> images) {
+ this.images = images;
+ }
}
Modified:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/NavigationEnum.java
===================================================================
---
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/NavigationEnum.java 2009-03-30
18:40:13 UTC (rev 13307)
+++
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/NavigationEnum.java 2009-03-30
18:40:48 UTC (rev 13308)
@@ -38,7 +38,7 @@
SHELF_UNVISITED("/includes/shelfUnvisited.xhtml"),
USER_SHARED_ALBUMS("/includes/userSharedAlbums.xhtml"),
USER_SHARED_IMAGES("/includes/userSharedImages.xhtml"),
- ALBUM_UNVISITED("/includes/albumInvisited.xhtml");
+ ALBUM_UNVISITED("/includes/albumUnvisited.xhtml");
private NavigationEnum(String t){
template=t;
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-30
18:40:13 UTC (rev 13307)
+++
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/ShelfManager.java 2009-03-30
18:40:48 UTC (rev 13308)
@@ -34,6 +34,7 @@
import org.jboss.seam.contexts.Contexts;
import org.jboss.seam.core.Events;
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.service.FlushStrategy;
@@ -70,7 +71,7 @@
public void addShelf(Shelf shelf) {
shelfAction.addShelf(shelf);
- model.resetModel(model.getMainArea(), model.getSelectedUser(), shelf, null,
null);
+ model.resetModel(NavigationEnum.SHELF_PREVIEW, shelf.getOwner(), shelf, null,
null);
setOncomplete();
Events.instance().raiseEvent("clearTree");
}
@@ -119,15 +120,15 @@
public String getOncomplete() {
return oncomplete;
}
-
+
public void setOncomplete(String oncomplete) {
this.oncomplete = oncomplete;
}
- public Long getCountUnvisitedImages(Shelf shelf) {
+ public List<Image> getUnvisitedImages(Shelf shelf) {
if (shelf.getCountUnvisitedImages() == 0) {
shelf.setUnvisitedImages(shelfAction.getUnvisitedImages(shelf));
}
- return shelf.getCountUnvisitedImages();
+ return shelf.getUnvisitedImages();
}
}
Modified:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/SlideshowManager.java
===================================================================
---
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/SlideshowManager.java 2009-03-30
18:40:13 UTC (rev 13307)
+++
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/SlideshowManager.java 2009-03-30
18:40:48 UTC (rev 13308)
@@ -66,6 +66,15 @@
this.selectedImage.getAlbum().getShelf().visitImage(selectedImage);
}
+ public void startSlideshow(List<Image> images, Image selectedImage){
+ active = true;
+ this.images = images;
+ this.slideshowIndex = images.indexOf(selectedImage);
+ this.selectedImage = selectedImage;
+ this.selectedImage.getAlbum().visitImage(selectedImage);
+ this.selectedImage.getAlbum().getShelf().visitImage(selectedImage);
+ }
+
public void stopSlideshow(){
active = false;
this.images = null;
@@ -98,11 +107,16 @@
}
public void showNextImage(){
+ if(!active){
+ return;
+ }
if(slideshowIndex == images.size() - 1){
slideshowIndex = -1;
}
//TODO nick - this will start slideshow from the 2nd image (slideshowIndex == 1)
slideshowIndex++;
selectedImage = images.get(slideshowIndex);
+ this.selectedImage.getAlbum().visitImage(selectedImage);
+ this.selectedImage.getAlbum().getShelf().visitImage(selectedImage);
}
}
\ No newline at end of file
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-30
18:40:13 UTC (rev 13307)
+++
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/UserManager.java 2009-03-30
18:40:48 UTC (rev 13308)
@@ -24,6 +24,7 @@
import java.util.List;
import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.AutoCreate;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Observer;
@@ -35,6 +36,7 @@
@Name("userManager")
@Scope(ScopeType.CONVERSATION)
+@AutoCreate
public class UserManager implements Serializable{
private static final long serialVersionUID = 6027103521084558931L;
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-30
18:40:13 UTC (rev 13307)
+++
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/search/ImageSearchHelper.java 2009-03-30
18:40:48 UTC (rev 13308)
@@ -31,6 +31,8 @@
String searchQuery;
+ String selectedKeyword;
+
List<String> keywords = new ArrayList<String>();
boolean seachInMyAlbums;
@@ -53,7 +55,9 @@
s.append(option.getName() + ",");
}
}
-
+ if (s.length() >= 2) {
+ s.delete(s.length() - 2, s.length());
+ }
//TODO nick - remove trailing comma
return s.toString();
}
@@ -63,11 +67,12 @@
Events.instance().raiseEvent(Constants.UPDATE_MAIN_AREA_EVENT, NavigationEnum.SEARCH);
keywords = parse(searchQuery);
Iterator<ISearchOption> it = options.iterator();
+ selectedKeyword = keywords.get(0).trim();
while (it.hasNext()) {
ISearchOption option = it.next();
if (option.getSelected()) {
//TODO nick - use search(keyword)
- option.search(searchAction, keywords.get(0).trim(), seachInMyAlbums,
searchInShared);
+ option.search(searchAction, selectedKeyword , seachInMyAlbums, searchInShared);
}else {
option.setSearchResult(null);
}
@@ -76,10 +81,11 @@
public void search(String keyword) {
Iterator<ISearchOption> it = options.iterator();
+ selectedKeyword = keyword.trim();
while (it.hasNext()) {
ISearchOption option = it.next();
if (option.getSelected()) {
- option.search(searchAction, keyword.trim(), seachInMyAlbums, searchInShared);
+ option.search(searchAction,selectedKeyword , seachInMyAlbums, searchInShared);
}else {
option.setSearchResult(null);
}
@@ -158,5 +164,13 @@
public void setKeywords(List<String> keywords) {
this.keywords = keywords;
}
+
+ public String getSelectedKeyword() {
+ return selectedKeyword;
+ }
+
+ public void setSelectedKeyword(String selectedKeyword) {
+ this.selectedKeyword = selectedKeyword;
+ }
}
Modified:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/startup/CopyImageStuff.java
===================================================================
---
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/startup/CopyImageStuff.java 2009-03-30
18:40:13 UTC (rev 13307)
+++
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/startup/CopyImageStuff.java 2009-03-30
18:40:48 UTC (rev 13308)
@@ -86,7 +86,11 @@
}
void resolveUploadRoot()throws IOException {
- String uploadRootPath = System.getProperty("java.io.tmpdir") +
REALWORLD_FOLDER + File.separator;
+ String property = System.getProperty("java.io.tmpdir");
+ if(!property.endsWith(File.separator)){
+ property+=File.separator;
+ }
+ String uploadRootPath = property + REALWORLD_FOLDER + File.separator;
if (uploadRootPath != null) {
uploadRoot = new File(uploadRootPath);
if (uploadRoot.exists()) {
Modified:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/FileUploadBean.java
===================================================================
---
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/FileUploadBean.java 2009-03-30
18:40:13 UTC (rev 13307)
+++
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/FileUploadBean.java 2009-03-30
18:40:48 UTC (rev 13308)
@@ -121,12 +121,12 @@
Image image = new Image();
image.setUploaded(new Date());
image.setDescription(SAMPLE_DESCRIPTION);
- image.setName(SAMPLE_NAME);
+ image.setName(item.getFileName());
image.setSize(item.getFileSize());
image.setAllowComments(true);
return image;
}
-
+
private void extractMetadata(UploadItem item, Image image)
throws JpegProcessingException, MetadataException, IOException {
InputStream in = new FileInputStream(item.getFile());
Modified:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/DirectLinkHelper.java
===================================================================
---
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/DirectLinkHelper.java 2009-03-30
18:40:13 UTC (rev 13307)
+++
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/DirectLinkHelper.java 2009-03-30
18:40:48 UTC (rev 13308)
@@ -27,7 +27,7 @@
import org.richfaces.realworld.service.Constants;
@Name("directLink")
-(a)Scope(ScopeType.SESSION)
+(a)Scope(ScopeType.EVENT)
@AutoCreate
//TODO nick - session-scoped bean depending on request parameters? i'm in doubts...
public class DirectLinkHelper {
@@ -35,19 +35,16 @@
protected EntityManager em;
@In(create = true)
FileManager fileManager;
- @RequestParameter
- protected Long imageId;
@In Identity identity;
- private Long id;
-
private static final String IMAGE_DIRECT_LINK =
"/includes/directImage.seam?imageId=";
private static String imageDirectLinkPrefix;
public synchronized void paintImage(OutputStream out, Object data)
throws IOException {
+ Long id=Long.valueOf(data.toString());
Image im = em.find(Image.class, id);
//TODO nick - '&&' so only admins can see their own unshared images?
if(im.getAlbum().getShelf().isShared() || (identity.hasRole("admin")
&& im.getAlbum().getOwner().getLogin().equals(identity.getUsername()))){
@@ -80,10 +77,6 @@
return;
}
}
-
- public void start(){
- id=imageId;
- }
public String getDirectImageLink(Image image) {
if (imageDirectLinkPrefix == null) {
Modified: trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/pages.xml
===================================================================
--- trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/pages.xml 2009-03-30
18:40:13 UTC (rev 13307)
+++ trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/pages.xml 2009-03-30
18:40:48 UTC (rev 13308)
@@ -31,9 +31,6 @@
<redirect view-id="/index.xhtml"/>
</navigation>
</page>
-<page view-id="/includes/directImage.xhtml">
-<action execute="#{directLink.start}"/>
-</page>
<exception class="org.jboss.seam.framework.EntityNotFoundException">
<redirect view-id="/error.xhtml">
<message>Not found</message>
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/includes/album/albumEditInfo.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/includes/album/albumInfo.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/includes/album/albumsList.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/includes/albumUnvisited.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/includes/contextMenu/CMForShelf.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/includes/directImage.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/uploadResult.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/includes/image/imageInfo.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/includes/image/imageList.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/includes/index/tree.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-30
18:40:13 UTC (rev 13307)
+++
trunk/test-applications/realworld2/web/src/main/webapp/includes/search/result/albumsResult.xhtml 2009-03-30
18:40:48 UTC (rev 13308)
@@ -10,7 +10,6 @@
<h:panelGrid cellpadding="0">
<h:panelGroup>
<a4j:commandLink
- rendered="#{controller.isUserAlbum(album)}"
actionListener="#{controller.showAlbum(album)}"
reRender="mainArea, tree">
<a4j:mediaOutput rendered="#{!album.isEmpty()}" id="img"
element="img"
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/search.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/includes/shelf/shelfInfo.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/includes/shelfUnvisited.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/tag.xhtml
===================================================================
(Binary files differ)
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/includes/userPrefs/userPrefs.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/userSharedImages.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/layout/template.xhtml
===================================================================
(Binary files differ)