JBoss Rich Faces SVN: r12855 - 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-06 06:51:05 -0500 (Fri, 06 Mar 2009)
New Revision: 12855
Added:
trunk/test-applications/realworld2/web/src/main/webapp/img/shell/button.png
trunk/test-applications/realworld2/web/src/main/webapp/includes/album/
trunk/test-applications/realworld2/web/src/main/webapp/includes/album/userAlbumsPreview.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/shelf/userShelfPreview.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/userImageEdit.xhtml
Removed:
trunk/test-applications/realworld2/web/src/main/webapp/includes/shelf/shelfPreview.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/shelf/userAlbumsPreview.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/shelf/userImagesPreview.xhtml
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/navigation/NavigationEnum.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/ConversationState.java
trunk/test-applications/realworld2/web/src/main/webapp/includes/userAlbum.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/userAlbums.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/userImage.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/userImages.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/userShelf.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/userShelfs.xhtml
Log:
Realworld: refactor includes, add image edit markup
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-06 11:17:41 UTC (rev 12854)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/ImageManager.java 2009-03-06 11:51:05 UTC (rev 12855)
@@ -71,7 +71,7 @@
public void editImage(Image image){
imageAction.editImage(image);
Events.instance().raiseEvent("imageEdited");
- setOncomplete();
+ Events.instance().raiseEvent(Constants.UPDATE_MAIN_AREA_EVENT, NavigationEnum.ALBUM_IMAGE_PREVIEW);
}
@Observer(Constants.ADD_IMAGE_EVENT)
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-06 11:17:41 UTC (rev 12854)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/navigation/NavigationEnum.java 2009-03-06 11:51:05 UTC (rev 12855)
@@ -32,8 +32,10 @@
ALL_SHELFS("/includes/userShelfs.xhtml"),
TAGS("includes/tag.xhtml"),
ALL_ALBUMS("/includes/userAlbums.xhtml"),
- ALL_IMAGES("/includes/userImages.xhtml");
+ ALL_IMAGES("/includes/userImages.xhtml"),
+ ALBUM_IMAGE_EDIT("/includes/userImageEdit.xhtml");
+
private NavigationEnum(String t){
template=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-06 11:17:41 UTC (rev 12854)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/ConversationState.java 2009-03-06 11:51:05 UTC (rev 12855)
@@ -32,7 +32,6 @@
import org.jboss.seam.annotations.Observer;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.Synchronized;
-import org.jboss.seam.core.Conversation;
import org.jboss.seam.core.Events;
import org.richfaces.component.UIDatascroller;
import org.richfaces.component.UITree;
@@ -247,6 +246,22 @@
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){
+ 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);
+ }
public void selectMyAlbums(){
setSelectedAlbum(null);
@@ -377,4 +392,5 @@
public void setSelectedTag(MetaTag selectedTag) {
this.selectedTag = selectedTag;
}
+
}
Added: trunk/test-applications/realworld2/web/src/main/webapp/img/shell/button.png
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld2/web/src/main/webapp/img/shell/button.png
___________________________________________________________________
Name: svn:mime-type
+ image/png
Copied: trunk/test-applications/realworld2/web/src/main/webapp/includes/album/userAlbumsPreview.xhtml (from rev 12852, trunk/test-applications/realworld2/web/src/main/webapp/includes/shelf/userAlbumsPreview.xhtml)
===================================================================
(Binary files differ)
Added: trunk/test-applications/realworld2/web/src/main/webapp/includes/image/userImageEditBlock.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld2/web/src/main/webapp/includes/image/userImageEditBlock.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added: trunk/test-applications/realworld2/web/src/main/webapp/includes/image/userImageMainBlock.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld2/web/src/main/webapp/includes/image/userImageMainBlock.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added: trunk/test-applications/realworld2/web/src/main/webapp/includes/image/userImagePreviewBlock.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld2/web/src/main/webapp/includes/image/userImagePreviewBlock.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Copied: trunk/test-applications/realworld2/web/src/main/webapp/includes/image/userImagesPreview.xhtml (from rev 12852, trunk/test-applications/realworld2/web/src/main/webapp/includes/shelf/userImagesPreview.xhtml)
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld2/web/src/main/webapp/includes/shelf/shelfPreview.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld2/web/src/main/webapp/includes/shelf/userAlbumsPreview.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld2/web/src/main/webapp/includes/shelf/userImagesPreview.xhtml
===================================================================
(Binary files differ)
Copied: trunk/test-applications/realworld2/web/src/main/webapp/includes/shelf/userShelfPreview.xhtml (from rev 12852, trunk/test-applications/realworld2/web/src/main/webapp/includes/shelf/shelfPreview.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/userAlbums.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/userImage.xhtml
===================================================================
(Binary files differ)
Added: trunk/test-applications/realworld2/web/src/main/webapp/includes/userImageEdit.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld2/web/src/main/webapp/includes/userImageEdit.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/userImages.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/userShelfs.xhtml
===================================================================
(Binary files differ)
15 years, 10 months
JBoss Rich Faces SVN: r12854 - trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2009-03-06 06:17:41 -0500 (Fri, 06 Mar 2009)
New Revision: 12854
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ToggleControlTest.java
Log:
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ToggleControlTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ToggleControlTest.java 2009-03-06 11:17:17 UTC (rev 12853)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ToggleControlTest.java 2009-03-06 11:17:41 UTC (rev 12854)
@@ -28,6 +28,7 @@
import org.ajax4jsf.template.Template;
import org.richfaces.AutoTester;
import org.richfaces.SeleniumTestBase;
+import org.testng.Assert;
import org.testng.annotations.Test;
public class ToggleControlTest extends SeleniumTestBase {
@@ -145,6 +146,24 @@
tester.testNestedActionListener();
}
+ @Test
+ public void testComponentLayout(Template template) {
+ renderPage(template, RESET_METHOD);
+
+ String parentId = getParentId() + "mainForm:";
+ String controlId = parentId + "ajax_next";
+
+ String controlHtml = getHTMLById(controlId);
+ if(!"Ajax next".equals(controlHtml)){
+ Assert.fail("toggle control should be output as link with text defined as value attribute");
+ }
+
+ int i = selenium.getXpathCount("//a[@id='"+controlId+"']").intValue();
+ if (i != 1) {
+ Assert.fail("toggle control should be rendered as <a> tag");
+ }
+ }
+
@Override
public void sendAjax() {
clickAjaxCommandAndWait(getAutoTester(this).getClientId(AutoTester.COMPONENT_ID));
15 years, 10 months
JBoss Rich Faces SVN: r12853 - trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/toggleControl.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2009-03-06 06:17:17 -0500 (Fri, 06 Mar 2009)
New Revision: 12853
Removed:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/toggleControl/toggleControlTest.xhtml
Log:
Deleted: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/toggleControl/toggleControlTest.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/toggleControl/toggleControlTest.xhtml 2009-03-06 01:12:50 UTC (rev 12852)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/toggleControl/toggleControlTest.xhtml 2009-03-06 11:17:17 UTC (rev 12853)
@@ -1,197 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:a4j="http://richfaces.org/a4j"
- xmlns:rich="http://richfaces.org/rich"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:ui="http://java.sun.com/jsf/facelets">
-
- <ui:composition template="#{templateBean.template}">
- <ui:define name="style">
- .link {margin: 0px 5px}
-
- .component_div {
- border: 1px solid blue;
- margin: 2px;
- }
- </ui:define>
- <ui:define name="component">
- <h:form id="mainForm">
- <fieldset>
- <legend>toggleConrol outside togglePanel</legend>
- <h:panelGroup layout="block" styleClass="component_div">
- <rich:togglePanel id="client_panel_one"
- switchType="client"
- stateOrder="first,second" initialState="first" label="Client">
-
- <f:facet name="first">
- <h:outputText id="client_state_one" value="First State" />
- </f:facet>
- <f:facet name="second">
- <h:outputText id="client_state_two" value="Second State" />
- </f:facet>
- </rich:togglePanel>
-
- <rich:toggleControl id="client_next_one" for="client_panel_one" action="#{panelBean.increment}" actionListener="#{panelBean.actionListener}">
- <h:outputText value="Client next" />
- </rich:toggleControl>
- <br/>
- <rich:toggleControl id="client_first_one" for="client_panel_one" switchToState="first" action="#{panelBean.increment}" actionListener="#{panelBean.actionListener}">
- <h:outputText value="Client first" />
- </rich:toggleControl>
- <br/>
- <rich:toggleControl id="client_second_one" for="client_panel_one" switchToState="second" action="#{panelBean.increment}" actionListener="#{panelBean.actionListener}">
- <h:outputText value="Client second" />
- </rich:toggleControl>
- </h:panelGroup>
-
- <h:panelGroup layout="block" styleClass="component_div">
- <rich:togglePanel id="server_panel_one"
- switchType="server"
- stateOrder="first,second" initialState="first" label="Server">
- <f:facet name="first">
- <h:outputText id="server_state_one" value="First State" />
- </f:facet>
- <f:facet name="second">
- <h:outputText id="server_state_two" value="Second State" />
- </f:facet>
- </rich:togglePanel>
-
- <rich:toggleControl id="server_next_one" for="server_panel_one" action="#{panelBean.increment}" actionListener="#{panelBean.actionListener}">
- <h:outputText value="Server next" />
- </rich:toggleControl>
- <br/>
- <rich:toggleControl id="server_first_one" for="server_panel_one" switchToState="first" action="#{panelBean.increment}" actionListener="#{panelBean.actionListener}">
- <h:outputText value="Server first" />
- </rich:toggleControl>
- <br/>
- <rich:toggleControl id="server_second_one" for="server_panel_one" switchToState="second" action="#{panelBean.increment}" actionListener="#{panelBean.actionListener}">
- <h:outputText value="Server second" />
- </rich:toggleControl>
- </h:panelGroup>
-
- <h:panelGroup layout="block" styleClass="component_div">
- <rich:togglePanel id="ajax_panel_one"
- switchType="ajax"
- stateOrder="first,second" initialState="first" label="Ajax">
- <f:facet name="first">
- <h:outputText id="ajax_state_one" value="First State" />
- </f:facet>
- <f:facet name="second">
- <h:outputText id="ajax_state_two" value="Second State" />
- </f:facet>
- </rich:togglePanel>
-
- <rich:toggleControl id="ajax_next_one" for="ajax_panel_one" action="#{panelBean.increment}" actionListener="#{panelBean.actionListener}">
- <h:outputText value="Ajax next" />
- </rich:toggleControl>
- <br/>
- <rich:toggleControl id="ajax_first_one" for="ajax_panel_one" switchToState="first" action="#{panelBean.increment}" actionListener="#{panelBean.actionListener}">
- <h:outputText value="Ajax first" />
- </rich:toggleControl>
- <br/>
- <rich:toggleControl id="ajax_second_one" for="ajax_panel_one" switchToState="second" action="#{panelBean.increment}" actionListener="#{panelBean.actionListener}">
- <h:outputText value="Ajax second" />
- </rich:toggleControl>
- </h:panelGroup>
- </fieldset>
-
- <fieldset>
- <legend>toggleConrol inside togglePanel</legend>
-
- <h:panelGroup layout="block" styleClass="component_div">
-
- <rich:togglePanel id="client_panel_two" initialState="empty" switchType="server">
-
- <f:facet name="first">
- <h:panelGroup layout="block">
- <rich:toggleControl for="client_panel_two" value="empty " switchToState="empty" action="#{panelBean.increment}" actionListener="#{panelBean.actionListener}"/>
- <rich:toggleControl for="client_panel_two" value="second " switchToState="second" action="#{panelBean.increment}" actionListener="#{panelBean.actionListener}"/>
- <h:outputText value=" Client First" />
- </h:panelGroup>
- </f:facet>
-
- <f:facet name="second">
- <h:panelGroup layout="block">
- <rich:toggleControl for="client_panel_two" value="empty " switchToState="empty" action="#{panelBean.increment}" actionListener="#{panelBean.actionListener}"/>
- <rich:toggleControl for="client_panel_two" value="first " switchToState="first" action="#{panelBean.increment}" actionListener="#{panelBean.actionListener}"/>
- <h:outputText value=" Client Second" />
- </h:panelGroup>
- </f:facet>
-
- <f:facet name="empty">
- <h:panelGroup layout="block">
- <rich:toggleControl for="client_panel_two" value="first " switchToState="first" action="#{panelBean.increment}" actionListener="#{panelBean.actionListener}"/>
- <rich:toggleControl for="client_panel_two" value="second " switchToState="second" action="#{panelBean.increment}" actionListener="#{panelBean.actionListener}"/>
- </h:panelGroup>
- </f:facet>
- </rich:togglePanel>
-
- </h:panelGroup>
-
- <h:panelGroup layout="block" styleClass="component_div">
-
- <rich:togglePanel id="server_panel_two" initialState="empty" switchType="server">
-
- <f:facet name="first">
- <h:panelGroup layout="block">
- <rich:toggleControl for="server_panel_two" value="empty " switchToState="empty" action="#{panelBean.increment}" actionListener="#{panelBean.actionListener}"/>
- <rich:toggleControl for="server_panel_two" value="second " switchToState="second" action="#{panelBean.increment}" actionListener="#{panelBean.actionListener}"/>
- <h:outputText value=" Server First" />
- </h:panelGroup>
- </f:facet>
-
- <f:facet name="second">
- <h:panelGroup layout="block">
- <rich:toggleControl for="server_panel_two" value="empty " switchToState="empty" action="#{panelBean.increment}" actionListener="#{panelBean.actionListener}"/>
- <rich:toggleControl for="server_panel_two" value="first " switchToState="first" action="#{panelBean.increment}" actionListener="#{panelBean.actionListener}"/>
- <h:outputText value=" Server Second" />
- </h:panelGroup>
- </f:facet>
-
- <f:facet name="empty">
- <h:panelGroup layout="block">
- <rich:toggleControl for="server_panel_two" value="first " switchToState="first" action="#{panelBean.increment}" actionListener="#{panelBean.actionListener}"/>
- <rich:toggleControl for="server_panel_two" value=" second " switchToState="second" action="#{panelBean.increment}" actionListener="#{panelBean.actionListener}"/>
- </h:panelGroup>
- </f:facet>
- </rich:togglePanel>
- </h:panelGroup>
-
- <h:panelGroup layout="block" styleClass="component_div">
-
- <rich:togglePanel id="ajax_panel_two" initialState="empty" switchType="ajax">
-
- <f:facet name="first">
- <h:panelGroup layout="block">
- <rich:toggleControl for="ajax_panel_two" value="empty " switchToState="empty" action="#{panelBean.increment}" actionListener="#{panelBean.actionListener}"/>
- <rich:toggleControl for="ajax_panel_two" value="second " switchToState="second" action="#{panelBean.increment}" actionListener="#{panelBean.actionListener}"/>
- <h:outputText value=" Ajax First" />
- </h:panelGroup>
- </f:facet>
-
- <f:facet name="second">
- <h:panelGroup layout="block">
- <rich:toggleControl for="ajax_panel_two" value="empty " switchToState="empty" action="#{panelBean.increment}" actionListener="#{panelBean.actionListener}"/>
- <rich:toggleControl for="ajax_panel_two" value="first " switchToState="first" action="#{panelBean.increment}" actionListener="#{panelBean.actionListener}"/>
- <h:outputText value=" Ajax Second" />
- </h:panelGroup>
- </f:facet>
-
- <f:facet name="empty">
- <h:panelGroup layout="block">
- <rich:toggleControl for="ajax_panel_two" value="first " switchToState="first" action="#{panelBean.increment}" actionListener="#{panelBean.actionListener}"/>
- <rich:toggleControl for="ajax_panel_two" value=" second " switchToState="second" action="#{panelBean.increment}" actionListener="#{panelBean.actionListener}"/>
- </h:panelGroup>
- </f:facet>
- </rich:togglePanel>
- </h:panelGroup>
- </fieldset>
- <a4j:outputPanel ajaxRendered="true" id="outputPanel" >
- <h:inputText value="#{panelBean.value}" id="value"></h:inputText>
- <h:outputText value="#{panelBean.value2}" id="value2"></h:outputText>
- </a4j:outputPanel>
- </h:form>
- </ui:define>
- </ui:composition>
-</html>
\ No newline at end of file
15 years, 10 months
JBoss Rich Faces SVN: r12852 - in trunk: sandbox/samples/layout-sample and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2009-03-05 20:12:50 -0500 (Thu, 05 Mar 2009)
New Revision: 12852
Added:
trunk/sandbox/ui/layout/src/main/java/org/richfaces/renderkit/html/images/
trunk/sandbox/ui/layout/src/main/java/org/richfaces/renderkit/html/images/PageBackgroundGradient.java
trunk/sandbox/ui/layout/src/main/java/org/richfaces/renderkit/html/images/PageContentGradient.java
Modified:
trunk/samples/pom.xml
trunk/sandbox/samples/layout-sample/pom.xml
trunk/sandbox/samples/layout-sample/src/main/webapp/WEB-INF/faces-config.xml
trunk/sandbox/samples/layout-sample/src/main/webapp/WEB-INF/web.xml
trunk/sandbox/samples/layout-sample/src/main/webapp/pages/index.xhtml
trunk/sandbox/ui/layout/src/main/resources/org/richfaces/renderkit/html/css/simple.xcss
Log:
generated gradient added to a 'simple' page theme
Modified: trunk/samples/pom.xml
===================================================================
--- trunk/samples/pom.xml 2009-03-06 00:33:46 UTC (rev 12851)
+++ trunk/samples/pom.xml 2009-03-06 01:12:50 UTC (rev 12852)
@@ -27,7 +27,7 @@
<scanIntervalSeconds>10</scanIntervalSeconds>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
- <port>80</port>
+ <port>8080</port>
<maxIdleTime>60000</maxIdleTime>
</connector>
</connectors>
Modified: trunk/sandbox/samples/layout-sample/pom.xml
===================================================================
--- trunk/sandbox/samples/layout-sample/pom.xml 2009-03-06 00:33:46 UTC (rev 12851)
+++ trunk/sandbox/samples/layout-sample/pom.xml 2009-03-06 01:12:50 UTC (rev 12852)
@@ -1,43 +1,49 @@
-<?xml version="1.0"?><project>
- <parent>
- <artifactId>samples</artifactId>
- <groupId>org.richfaces</groupId>
- <version>3.3.1-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.samples</groupId>
- <artifactId>layout-sample</artifactId>
- <packaging>war</packaging>
- <name>layout Maven Webapp</name>
- <version>3.3.1-SNAPSHOT</version>
- <build>
- <finalName>layout-sample</finalName>
- <plugins>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.richfaces.framework</groupId>
- <artifactId>richfaces-impl</artifactId>
- <version>3.3.1-SNAPSHOT</version>
- </dependency>
- <dependency>
- <groupId>org.richfaces.ui</groupId>
- <artifactId>layout</artifactId>
- <version>3.3.1-SNAPSHOT</version>
- </dependency>
- </dependencies>
-</project>
+<?xml version="1.0"?>
+<project>
+ <parent>
+ <artifactId>samples</artifactId>
+ <groupId>org.richfaces</groupId>
+ <version>3.3.1-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces.samples</groupId>
+ <artifactId>layout-sample</artifactId>
+ <packaging>war</packaging>
+ <name>layout Maven Webapp</name>
+ <version>3.3.1-SNAPSHOT</version>
+ <build>
+ <finalName>layout-sample</finalName>
+ <plugins>
+ <plugin>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.framework</groupId>
+ <artifactId>richfaces-impl</artifactId>
+ <version>3.3.1-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>layout</artifactId>
+ <version>3.3.1-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.samples</groupId>
+ <artifactId>skins</artifactId>
+ <version>3.3.1-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Modified: trunk/sandbox/samples/layout-sample/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/sandbox/samples/layout-sample/src/main/webapp/WEB-INF/faces-config.xml 2009-03-06 00:33:46 UTC (rev 12851)
+++ trunk/sandbox/samples/layout-sample/src/main/webapp/WEB-INF/faces-config.xml 2009-03-06 01:12:50 UTC (rev 12852)
@@ -11,4 +11,9 @@
<managed-bean-class>org.richfaces.samples.Bean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
+ <managed-bean>
+ <managed-bean-name>skinBean</managed-bean-name>
+ <managed-bean-class>org.richfaces.SkinBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
</faces-config>
Modified: trunk/sandbox/samples/layout-sample/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/sandbox/samples/layout-sample/src/main/webapp/WEB-INF/web.xml 2009-03-06 00:33:46 UTC (rev 12851)
+++ trunk/sandbox/samples/layout-sample/src/main/webapp/WEB-INF/web.xml 2009-03-06 01:12:50 UTC (rev 12852)
@@ -17,7 +17,7 @@
<context-param>
<param-name>org.richfaces.SKIN</param-name>
- <param-value>blueSky</param-value>
+ <param-value>#{skinBean.skin}</param-value>
</context-param>
<context-param>
<param-name>org.ajax4jsf.COMPRESS_SCRIPT</param-name>
Modified: trunk/sandbox/samples/layout-sample/src/main/webapp/pages/index.xhtml
===================================================================
(Binary files differ)
Added: trunk/sandbox/ui/layout/src/main/java/org/richfaces/renderkit/html/images/PageBackgroundGradient.java
===================================================================
--- trunk/sandbox/ui/layout/src/main/java/org/richfaces/renderkit/html/images/PageBackgroundGradient.java (rev 0)
+++ trunk/sandbox/ui/layout/src/main/java/org/richfaces/renderkit/html/images/PageBackgroundGradient.java 2009-03-06 01:12:50 UTC (rev 12852)
@@ -0,0 +1,17 @@
+/**
+ *
+ */
+package org.richfaces.renderkit.html.images;
+
+import org.richfaces.renderkit.html.BaseGradient;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class PageBackgroundGradient extends BaseGradient {
+
+ public PageBackgroundGradient() {
+ super(1, 250, 130, false);
+ }
+}
Property changes on: trunk/sandbox/ui/layout/src/main/java/org/richfaces/renderkit/html/images/PageBackgroundGradient.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/sandbox/ui/layout/src/main/java/org/richfaces/renderkit/html/images/PageContentGradient.java
===================================================================
--- trunk/sandbox/ui/layout/src/main/java/org/richfaces/renderkit/html/images/PageContentGradient.java (rev 0)
+++ trunk/sandbox/ui/layout/src/main/java/org/richfaces/renderkit/html/images/PageContentGradient.java 2009-03-06 01:12:50 UTC (rev 12852)
@@ -0,0 +1,17 @@
+/**
+ *
+ */
+package org.richfaces.renderkit.html.images;
+
+import org.richfaces.renderkit.html.BaseGradient;
+
+/**
+ * @author asmirnov
+ *
+ */
+public class PageContentGradient extends BaseGradient {
+
+ public PageContentGradient() {
+ super(1, 250, 130, false);
+ }
+}
Property changes on: trunk/sandbox/ui/layout/src/main/java/org/richfaces/renderkit/html/images/PageContentGradient.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/sandbox/ui/layout/src/main/resources/org/richfaces/renderkit/html/css/simple.xcss
===================================================================
--- trunk/sandbox/ui/layout/src/main/resources/org/richfaces/renderkit/html/css/simple.xcss 2009-03-06 00:33:46 UTC (rev 12851)
+++ trunk/sandbox/ui/layout/src/main/resources/org/richfaces/renderkit/html/css/simple.xcss 2009-03-06 01:12:50 UTC (rev 12852)
@@ -7,6 +7,11 @@
<u:selector name="body">
<u:style name="font-family" skin="generalFamilyFont" />
<u:style name="margin" value="0" />
+ <u:style name="background-image">
+ <f:resource f:key="org.richfaces.renderkit.html.images.PageBackgroundGradient"/>
+ </u:style>
+ <u:style name="background-color" value="#FFFFFF"/>
+ <u:style name="background-repeat" value="repeat-x"/>
</u:selector>
<u:selector name=".rich-page">
@@ -27,7 +32,7 @@
<u:selector name=".rich-page-content">
<u:style name="background-image">
- <f:resource f:key="/org/richfaces/renderkit/html/images/tempGradient.jpg"/>
+ <f:resource f:key="org.richfaces.renderkit.html.images.PageContentGradient"/>
</u:style>
<u:style name="min-height" value="200px" />
<u:style name="background-color" value="#FFFFFF"/>
@@ -37,9 +42,9 @@
<u:selector name=".rich-page-main">
</u:selector>
- <u:selector name=".rich-page-body">
+ <!--u:selector name=".rich-page-body">
<u:style name="padding" value="0 30px 0 30px" />
- </u:selector>
+ </u:selector-->
<u:selector name=".rich-page-footer">
<u:style name="text-align" value="center" />
15 years, 10 months
JBoss Rich Faces SVN: r12851 - in trunk/test-applications/realworld2: ejb/src/main/resources and 7 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-03-05 19:33:46 -0500 (Thu, 05 Mar 2009)
New Revision: 12851
Added:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/Functions.java
Modified:
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/Constants.java
trunk/test-applications/realworld2/ejb/src/main/resources/import.sql
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/servlet/PictureServlet.java
trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/tags/realWorld-taglib.xml
trunk/test-applications/realworld2/web/src/main/webapp/includes/shelf/userAlbumsPreview.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/shelf/userImagesPreview.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/userImage.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/layout/template3.xhtml
Log:
Latest changes for real-world demo
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-05 20:18:16 UTC (rev 12850)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/Constants.java 2009-03-06 00:33:46 UTC (rev 12851)
@@ -28,7 +28,6 @@
public static final String ADD_ERROR_EVENT = "addErrorEvent";
public static final String UPLOAD_ROOT = "uploadRoot";
- public static final String FILE_SEPARATOR = "file.separator";
public static final String SLASH = "/";
public static final String DOT = ".";
public static final String JPG = "JPG";
Modified: trunk/test-applications/realworld2/ejb/src/main/resources/import.sql
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/resources/import.sql 2009-03-05 20:18:16 UTC (rev 12850)
+++ trunk/test-applications/realworld2/ejb/src/main/resources/import.sql 2009-03-06 00:33:46 UTC (rev 12851)
@@ -18,95 +18,95 @@
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 images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (1, 'korana', 'Viking/15/korana.jpg', 'korana', '2008-12-18', 15, 'Canon S3', 1024, 1917.000000, 768, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (2, 'korana2', 'Viking/15/korana2.jpg', 'korana2', '2008-12-18', 15, 'Canon S3', 1024, 949.000000, 768, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (3, 'Re4ka', 'Viking/15/Re4ka.jpg', 'Re4ka', '2008-12-18', 15, 'Canon S3', 1024, 412.000000, 768, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (4, 'river10', 'Viking/15/river10.jpg', 'river10', '2008-12-18', 15, 'Canon S3', 1024, 276.000000, 768, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (5, 'river11', 'Viking/15/river11.jpg', 'river11', '2008-12-18', 15, 'Canon S3', 1024, 187.000000, 768, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (6, 'river12', 'Viking/15/river12.jpg', 'river12', '2008-12-18', 15, 'Canon S3', 1024, 265.000000, 768, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (7, 'river13', 'Viking/15/river13.jpg', 'river13', '2008-12-18', 15, 'Canon S3', 1024, 106.000000, 768, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (8, 'river2', 'Viking/15/river2.jpg', 'river2', '2008-12-18', 15, 'Canon S3', 1024, 130.000000, 768, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (9, 'river3', 'Viking/15/river3.jpg', 'river3', '2008-12-18', 15, 'Canon S3', 1024, 126.000000, 768, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (10, 'river4', 'Viking/15/river4.jpg', 'river4', '2008-12-18', 15, 'Canon S3', 1024, 267.000000, 768, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (11, 'river5', 'Viking/15/river5.jpg', 'river5', '2008-12-18', 15, 'Canon S3', 1024, 176.000000, 768, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (12, 'river6', 'Viking/15/river6.jpg', 'river6', '2008-12-18', 15, 'Canon S3', 1024, 126.000000, 768, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (13, 'river7', 'Viking/15/river7.jpg', 'river7', '2008-12-18', 15, 'Canon S3', 1024, 201.000000, 768, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (14, 'river8', 'Viking/15/river8.jpg', 'river8', '2008-12-18', 15, 'Canon S3', 1024, 278.000000, 768, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (15, 'river9', 'Viking/15/river9.jpg', 'river9', '2008-12-18', 15, 'Canon S3', 1024, 210.000000, 768, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (16, 'river_and_torrents', 'Viking/15/river_and_torrents.jpg', 'river_and_torrents', '2008-12-18', 15, 'Canon S3', 1024, 161.000000, 768, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (1, 'korana', 'Viking/15/korana.jpg', 'korana', '2008-12-18', 15, 'Canon S3', 1024, 1917.000000, 768, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (2, 'korana2', 'Viking/15/korana2.jpg', 'korana2', '2008-12-18', 15, 'Canon S3', 1024, 949.000000, 768, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (3, 'Re4ka', 'Viking/15/Re4ka.jpg', 'Re4ka', '2008-12-18', 15, 'Canon S3', 1024, 412.000000, 768, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (4, 'river10', 'Viking/15/river10.jpg', 'river10', '2008-12-18', 15, 'Canon S3', 1024, 276.000000, 768, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (5, 'river11', 'Viking/15/river11.jpg', 'river11', '2008-12-18', 15, 'Canon S3', 1024, 187.000000, 768, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (6, 'river12', 'Viking/15/river12.jpg', 'river12', '2008-12-18', 15, 'Canon S3', 1024, 265.000000, 768, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (7, 'river13', 'Viking/15/river13.jpg', 'river13', '2008-12-18', 15, 'Canon S3', 1024, 106.000000, 768, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (8, 'river2', 'Viking/15/river2.jpg', 'river2', '2008-12-18', 15, 'Canon S3', 1024, 130.000000, 768, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (9, 'river3', 'Viking/15/river3.jpg', 'river3', '2008-12-18', 15, 'Canon S3', 1024, 126.000000, 768, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (10, 'river4', 'Viking/15/river4.jpg', 'river4', '2008-12-18', 15, 'Canon S3', 1024, 267.000000, 768, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (11, 'river5', 'Viking/15/river5.jpg', 'river5', '2008-12-18', 15, 'Canon S3', 1024, 176.000000, 768, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (12, 'river6', 'Viking/15/river6.jpg', 'river6', '2008-12-18', 15, 'Canon S3', 1024, 126.000000, 768, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (13, 'river7', 'Viking/15/river7.jpg', 'river7', '2008-12-18', 15, 'Canon S3', 1024, 201.000000, 768, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (14, 'river8', 'Viking/15/river8.jpg', 'river8', '2008-12-18', 15, 'Canon S3', 1024, 278.000000, 768, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (15, 'river9', 'Viking/15/river9.jpg', 'river9', '2008-12-18', 15, 'Canon S3', 1024, 210.000000, 768, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (16, 'river_and_torrents', 'Viking/15/river_and_torrents.jpg', 'river_and_torrents', '2008-12-18', 15, 'Canon S3', 1024, 161.000000, 768, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (17, 'Sport1', 'amarkhel/20/sport.jpg', 'Where is the Batman?', '2008-12-18', 20, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (18, 'Sport1', 'amarkhel/20/sport (1).jpg', 'Where is the Batman?', '2008-12-18', 20, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (19, 'Sport1', 'amarkhel/20/sport (2).jpg', 'Where is the Batman?', '2008-12-18', 20, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (20, 'Sport1', 'amarkhel/20/sport (3).jpg', 'Where is the Batman?', '2008-12-18', 20, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (21, 'Sport1', 'amarkhel/20/sport (4).jpg', 'Where is the Batman?', '2008-12-18', 20, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (22, 'Sport1', 'amarkhel/20/sport (5).jpg', 'Where is the Batman?', '2008-12-18', 20, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (23, 'Sport1', 'amarkhel/20/sport (6).jpg', 'Where is the Batman?', '2008-12-18', 20, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (24, 'Sport1', 'amarkhel/20/sport (7).jpg', 'Where is the Batman?', '2008-12-18', 20, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (25, 'Sport1', 'amarkhel/20/sport (8).jpg', 'Where is the Batman?', '2008-12-18', 20, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (26, 'Sport1', 'amarkhel/20/sport (9).jpg', 'Where is the Batman?', '2008-12-18', 20, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (27, 'Sport1', 'amarkhel/20/sport (10).jpg', 'Where is the Batman?', '2008-12-18', 20, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (28, 'Sport1', 'amarkhel/20/sport (11).jpg', 'Where is the Batman?', '2008-12-18', 20, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (29, 'Sport1', 'amarkhel/20/sport (12).jpg', 'Where is the Batman?', '2008-12-18', 20, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (30, 'Sport1', 'amarkhel/20/sport (13).jpg', 'Where is the Batman?', '2008-12-18', 20, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (31, 'Sport1', 'amarkhel/20/sport (14).jpg', 'Where is the Batman?', '2008-12-18', 20, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (32, 'Sport1', 'amarkhel/20/sport (15).jpg', 'Where is the Batman?', '2008-12-18', 20, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (33, 'Sport1', 'amarkhel/20/sport (16).jpg', 'Where is the Batman?', '2008-12-18', 20, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (34, 'Sport1', 'amarkhel/20/sport (17).jpg', 'Where is the Batman?', '2008-12-18', 20, 'Canon S3', 500, 20, 375, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (17, 'Sport1', 'amarkhel/20/sport.jpg', 'Where is the Batman?', '2008-12-18', 20, 'Canon S3', 1600, 20, 1200, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (18, 'Sport1', 'amarkhel/20/sport (1).jpg', 'Where is the Batman?', '2008-12-18', 20, 'Canon S3', 1600, 20, 1200, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (19, 'Sport1', 'amarkhel/20/sport (2).jpg', 'Where is the Batman?', '2008-12-18', 20, 'Canon S3', 1280, 20, 1024, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (20, 'Sport1', 'amarkhel/20/sport (3).jpg', 'Where is the Batman?', '2008-12-18', 20, 'Canon S3', 1600, 20, 1200, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (21, 'Sport1', 'amarkhel/20/sport (4).jpg', 'Where is the Batman?', '2008-12-18', 20, 'Canon S3', 1600, 20, 1200, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (22, 'Sport1', 'amarkhel/20/sport (5).jpg', 'Where is the Batman?', '2008-12-18', 20, 'Canon S3', 1280, 20, 1024, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (23, 'Sport1', 'amarkhel/20/sport (6).jpg', 'Where is the Batman?', '2008-12-18', 20, 'Canon S3', 1280, 20, 1024, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (24, 'Sport1', 'amarkhel/20/sport (7).jpg', 'Where is the Batman?', '2008-12-18', 20, 'Canon S3', 1600, 20, 1200, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (25, 'Sport1', 'amarkhel/20/sport (8).jpg', 'Where is the Batman?', '2008-12-18', 20, 'Canon S3', 1280, 20, 1024, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (26, 'Sport1', 'amarkhel/20/sport (9).jpg', 'Where is the Batman?', '2008-12-18', 20, 'Canon S3', 1600, 20, 1200, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (27, 'Sport1', 'amarkhel/20/sport (10).jpg', 'Where is the Batman?', '2008-12-18', 20, 'Canon S3', 1280, 20, 1024, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (28, 'Sport1', 'amarkhel/20/sport (11).jpg', 'Where is the Batman?', '2008-12-18', 20, 'Canon S3', 1600, 20, 1200, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (29, 'Sport1', 'amarkhel/20/sport (12).jpg', 'Where is the Batman?', '2008-12-18', 20, 'Canon S3', 1280, 20, 1024, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (30, 'Sport1', 'amarkhel/20/sport (13).jpg', 'Where is the Batman?', '2008-12-18', 20, 'Canon S3', 1600, 20, 1200, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (31, 'Sport1', 'amarkhel/20/sport (14).jpg', 'Where is the Batman?', '2008-12-18', 20, 'Canon S3', 1280, 20, 1024, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (32, 'Sport1', 'amarkhel/20/sport (15).jpg', 'Where is the Batman?', '2008-12-18', 20, 'Canon S3', 1280, 20, 1024, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (33, 'Sport1', 'amarkhel/20/sport (16).jpg', 'Where is the Batman?', '2008-12-18', 20, 'Canon S3', 1280, 20, 1024, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (34, 'Sport1', 'amarkhel/20/sport (17).jpg', 'Where is the Batman?', '2008-12-18', 20, 'Canon S3', 1280, 20, 1024, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (35, 'Fun', 'amarkhel/23/travel.jpg', 'Where is the Batman?', '2008-12-18', 23, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (36, 'Fun', 'amarkhel/23/travel (1).jpg', 'Where is the Batman?', '2008-12-18', 23, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (37, 'Fun', 'amarkhel/23/travel (2).jpg', 'Where is the Batman?', '2008-12-18', 23, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (38, 'Fun', 'amarkhel/23/travel (3).jpg', 'Where is the Batman?', '2008-12-18', 23, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (39, 'Fun', 'amarkhel/23/travel (4).jpg', 'Where is the Batman?', '2008-12-18', 23, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (40, 'Fun', 'amarkhel/23/travel (5).jpg', 'Where is the Batman?', '2008-12-18', 23, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (41, 'Fun', 'amarkhel/23/travel (6).jpg', 'Where is the Batman?', '2008-12-18', 23, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (42, 'Fun', 'amarkhel/23/travel (7).jpg', 'Where is the Batman?', '2008-12-18', 23, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (43, 'Fun', 'amarkhel/23/travel (8).jpg', 'Where is the Batman?', '2008-12-18', 23, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (44, 'Fun', 'amarkhel/23/travel (9).jpg', 'Where is the Batman?', '2008-12-18', 23, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (45, 'Fun', 'amarkhel/23/travel (10).jpg', 'Where is the Batman?', '2008-12-18', 23, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (46, 'Fun', 'amarkhel/23/travel (11).jpg', 'Where is the Batman?', '2008-12-18', 23, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (47, 'Fun', 'amarkhel/23/travel (12).jpg', 'Where is the Batman?', '2008-12-18', 23, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (48, 'Fun', 'amarkhel/23/travel (13).jpg', 'Where is the Batman?', '2008-12-18', 23, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (49, 'Fun', 'amarkhel/23/travel (14).jpg', 'Where is the Batman?', '2008-12-18', 23, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (50, 'Fun', 'amarkhel/23/travel (15).jpg', 'Where is the Batman?', '2008-12-18', 23, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (51, 'Fun', 'amarkhel/23/travel (16).jpg', 'Where is the Batman?', '2008-12-18', 23, 'Canon S3', 500, 20, 375, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (35, 'Fun', 'amarkhel/23/travel.jpg', 'Where is the Batman?', '2008-12-18', 23, 'Canon S3', 940, 20, 627, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (36, 'Fun', 'amarkhel/23/travel (1).jpg', 'Where is the Batman?', '2008-12-18', 23, 'Canon S3', 1200, 20, 800, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (37, 'Fun', 'amarkhel/23/travel (2).jpg', 'Where is the Batman?', '2008-12-18', 23, 'Canon S3', 1200, 20, 800, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (38, 'Fun', 'amarkhel/23/travel (3).jpg', 'Where is the Batman?', '2008-12-18', 23, 'Canon S3', 1024, 20, 747, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (39, 'Fun', 'amarkhel/23/travel (4).jpg', 'Where is the Batman?', '2008-12-18', 23, 'Canon S3', 1024, 20, 1024, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (40, 'Fun', 'amarkhel/23/travel (5).jpg', 'Where is the Batman?', '2008-12-18', 23, 'Canon S3', 1024, 20, 1075, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (41, 'Fun', 'amarkhel/23/travel (6).jpg', 'Where is the Batman?', '2008-12-18', 23, 'Canon S3', 1024, 20, 760, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (42, 'Fun', 'amarkhel/23/travel (7).jpg', 'Where is the Batman?', '2008-12-18', 23, 'Canon S3', 1024, 20, 1023, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (43, 'Fun', 'amarkhel/23/travel (8).jpg', 'Where is the Batman?', '2008-12-18', 23, 'Canon S3', 1024, 20, 723, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (44, 'Fun', 'amarkhel/23/travel (9).jpg', 'Where is the Batman?', '2008-12-18', 23, 'Canon S3', 1028, 20, 967, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (45, 'Fun', 'amarkhel/23/travel (10).jpg', 'Where is the Batman?', '2008-12-18', 23, 'Canon S3', 940, 20, 622, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (46, 'Fun', 'amarkhel/23/travel (11).jpg', 'Where is the Batman?', '2008-12-18', 23, 'Canon S3', 940, 20, 625, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (47, 'Fun', 'amarkhel/23/travel (12).jpg', 'Where is the Batman?', '2008-12-18', 23, 'Canon S3', 940, 20, 625, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (48, 'Fun', 'amarkhel/23/travel (13).jpg', 'Where is the Batman?', '2008-12-18', 23, 'Canon S3', 940, 20, 625, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (49, 'Fun', 'amarkhel/23/travel (14).jpg', 'Where is the Batman?', '2008-12-18', 23, 'Canon S3', 940, 20, 625, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (50, 'Fun', 'amarkhel/23/travel (15).jpg', 'Where is the Batman?', '2008-12-18', 23, 'Canon S3', 1036, 20, 1036, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (51, 'Fun', 'amarkhel/23/travel (16).jpg', 'Where is the Batman?', '2008-12-18', 23, 'Canon S3', 940, 20, 627, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (52, 'Fun', 'amarkhel/25/beach (1).jpg', 'Where is the Batman?', '2008-12-18', 25, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (53, 'Fun', 'amarkhel/25/beach (2).jpg', 'Where is the Batman?', '2008-12-18', 25, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (54, 'Fun', 'amarkhel/25/beach (3).jpg', 'Where is the Batman?', '2008-12-18', 25, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (55, 'Fun', 'amarkhel/25/beach (4).jpg', 'Where is the Batman?', '2008-12-18', 25, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (56, 'Fun', 'amarkhel/25/beach (5).jpg', 'Where is the Batman?', '2008-12-18', 25, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (57, 'Fun', 'amarkhel/25/beach (6).jpg', 'Where is the Batman?', '2008-12-18', 25, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (58, 'Fun', 'amarkhel/25/beach (7).jpg', 'Where is the Batman?', '2008-12-18', 25, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (59, 'Fun', 'amarkhel/25/beach (8).jpg', 'Where is the Batman?', '2008-12-18', 25, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (60, 'Fun', 'amarkhel/25/beach (9).jpg', 'Where is the Batman?', '2008-12-18', 25, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (61, 'Fun', 'amarkhel/25/beach (10).jpg', 'Where is the Batman?', '2008-12-18', 25, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (62, 'Fun', 'amarkhel/25/beach (11).jpg', 'Where is the Batman?', '2008-12-18', 25, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (63, 'Fun', 'amarkhel/25/beach (12).jpg', 'Where is the Batman?', '2008-12-18', 25, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (64, 'Fun', 'amarkhel/25/beach (13).jpg', 'Where is the Batman?', '2008-12-18', 25, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (65, 'Fun', 'amarkhel/25/beach (14).jpg', 'Where is the Batman?', '2008-12-18', 25, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (66, 'Fun', 'amarkhel/25/beach.jpg', 'Where is the Batman?', '2008-12-18', 25, 'Canon S3', 500, 20, 375, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (52, 'Fun', 'amarkhel/25/beach (1).jpg', 'Where is the Batman?', '2008-12-18', 25, 'Canon S3', 850, 20, 600, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (53, 'Fun', 'amarkhel/25/beach (2).jpg', 'Where is the Batman?', '2008-12-18', 25, 'Canon S3', 800, 20, 600, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (54, 'Fun', 'amarkhel/25/beach (3).jpg', 'Where is the Batman?', '2008-12-18', 25, 'Canon S3', 768, 20, 1024, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (55, 'Fun', 'amarkhel/25/beach (4).jpg', 'Where is the Batman?', '2008-12-18', 25, 'Canon S3', 1600, 20, 1200, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (56, 'Fun', 'amarkhel/25/beach (5).jpg', 'Where is the Batman?', '2008-12-18', 25, 'Canon S3', 1000, 20, 807, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (57, 'Fun', 'amarkhel/25/beach (6).jpg', 'Where is the Batman?', '2008-12-18', 25, 'Canon S3', 1024, 20, 608, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (58, 'Fun', 'amarkhel/25/beach (7).jpg', 'Where is the Batman?', '2008-12-18', 25, 'Canon S3', 768, 20, 1024, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (59, 'Fun', 'amarkhel/25/beach (8).jpg', 'Where is the Batman?', '2008-12-18', 25, 'Canon S3', 1024, 20, 668, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (60, 'Fun', 'amarkhel/25/beach (9).jpg', 'Where is the Batman?', '2008-12-18', 25, 'Canon S3', 800, 20, 553, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (61, 'Fun', 'amarkhel/25/beach (10).jpg', 'Where is the Batman?', '2008-12-18', 25, 'Canon S3', 603, 20, 900, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (62, 'Fun', 'amarkhel/25/beach (11).jpg', 'Where is the Batman?', '2008-12-18', 25, 'Canon S3', 1023, 20, 768, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (63, 'Fun', 'amarkhel/25/beach (12).jpg', 'Where is the Batman?', '2008-12-18', 25, 'Canon S3', 1024, 20, 732, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (64, 'Fun', 'amarkhel/25/beach (13).jpg', 'Where is the Batman?', '2008-12-18', 25, 'Canon S3', 1024, 20, 660, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (65, 'Fun', 'amarkhel/25/beach (14).jpg', 'Where is the Batman?', '2008-12-18', 25, 'Canon S3', 681, 20, 1025, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (66, 'Fun', 'amarkhel/25/beach.jpg', 'Where is the Batman?', '2008-12-18', 25, 'Canon S3', 940, 20, 625, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (67, 'Fun', 'Noname/26/flowers (1).jpg', 'Where is the Batman?', '2008-12-18', 26, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (68, 'Fun', 'Noname/26/flowers (2).jpg', 'Where is the Batman?', '2008-12-18', 26, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (69, 'Fun', 'Noname/26/flowers (3).jpg', 'Where is the Batman?', '2008-12-18', 26, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (70, 'Fun', 'Noname/26/flowers (4).jpg', 'Where is the Batman?', '2008-12-18', 26, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (71, 'Fun', 'Noname/26/flowers (5).jpg', 'Where is the Batman?', '2008-12-18', 26, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (72, 'Fun', 'Noname/26/flowers (6).jpg', 'Where is the Batman?', '2008-12-18', 26, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (73, 'Fun', 'Noname/26/flowers (7).jpg', 'Where is the Batman?', '2008-12-18', 26, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (74, 'Fun', 'Noname/26/flowers (8).jpg', 'Where is the Batman?', '2008-12-18', 26, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (75, 'Fun', 'Noname/26/flowers (9).jpg', 'Where is the Batman?', '2008-12-18', 26, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (76, 'Fun', 'Noname/26/flowers (10).jpg', 'Where is the Batman?', '2008-12-18', 26, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (77, 'Fun', 'Noname/26/flowers (11).jpg', 'Where is the Batman?', '2008-12-18', 26, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (78, 'Fun', 'Noname/26/flowers (12).jpg', 'Where is the Batman?', '2008-12-18', 26, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (79, 'Fun', 'Noname/26/flowers (13).jpg', 'Where is the Batman?', '2008-12-18', 26, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (80, 'Fun', 'Noname/26/flowers (14).jpg', 'Where is the Batman?', '2008-12-18', 26, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (81, 'Fun', 'Noname/26/flowers (15).jpg', 'Where is the Batman?', '2008-12-18', 26, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (82, 'Fun', 'Noname/26/flowers (16).jpg', 'Where is the Batman?', '2008-12-18', 26, 'Canon S3', 500, 20, 375, '2008-12-01');
-INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, height, size, width, uploaded) VALUES (83, 'Fun', 'Noname/26/flowers.jpg', 'Where is the Batman?', '2008-12-18', 26, 'Canon S3', 500, 20, 375, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (67, 'Fun', 'Noname/26/flowers (1).jpg', 'Where is the Batman?', '2008-12-18', 26, 'Canon S3', 1024, 20, 768, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (68, 'Fun', 'Noname/26/flowers (2).jpg', 'Where is the Batman?', '2008-12-18', 26, 'Canon S3', 1024, 20, 683, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (69, 'Fun', 'Noname/26/flowers (3).jpg', 'Where is the Batman?', '2008-12-18', 26, 'Canon S3', 1024, 20, 768, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (70, 'Fun', 'Noname/26/flowers (4).jpg', 'Where is the Batman?', '2008-12-18', 26, 'Canon S3', 900, 20, 602, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (71, 'Fun', 'Noname/26/flowers (5).jpg', 'Where is the Batman?', '2008-12-18', 26, 'Canon S3', 1024, 20, 686, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (72, 'Fun', 'Noname/26/flowers (6).jpg', 'Where is the Batman?', '2008-12-18', 26, 'Canon S3', 800, 20, 600, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (73, 'Fun', 'Noname/26/flowers (7).jpg', 'Where is the Batman?', '2008-12-18', 26, 'Canon S3', 1200, 20, 969, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (74, 'Fun', 'Noname/26/flowers (8).jpg', 'Where is the Batman?', '2008-12-18', 26, 'Canon S3', 821, 20, 1024, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (75, 'Fun', 'Noname/26/flowers (9).jpg', 'Where is the Batman?', '2008-12-18', 26, 'Canon S3', 1024, 20, 768, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (76, 'Fun', 'Noname/26/flowers (10).jpg', 'Where is the Batman?', '2008-12-18', 26, 'Canon S3', 1024, 20, 912, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (77, 'Fun', 'Noname/26/flowers (11).jpg', 'Where is the Batman?', '2008-12-18', 26, 'Canon S3', 1024, 20, 663, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (78, 'Fun', 'Noname/26/flowers (12).jpg', 'Where is the Batman?', '2008-12-18', 26, 'Canon S3', 1024, 20, 768, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (79, 'Fun', 'Noname/26/flowers (13).jpg', 'Where is the Batman?', '2008-12-18', 26, 'Canon S3', 700, 20, 1052, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (80, 'Fun', 'Noname/26/flowers (14).jpg', 'Where is the Batman?', '2008-12-18', 26, 'Canon S3', 906, 20, 1024, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (81, 'Fun', 'Noname/26/flowers (15).jpg', 'Where is the Batman?', '2008-12-18', 26, 'Canon S3', 1024, 20, 768, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (82, 'Fun', 'Noname/26/flowers (16).jpg', 'Where is the Batman?', '2008-12-18', 26, 'Canon S3', 1206, 20, 868, '2008-12-01');
+INSERT INTO images(image_id, name, path, description, created, img_album_id, cameraModel, width, size, height, uploaded) VALUES (83, 'Fun', 'Noname/26/flowers.jpg', 'Where is the Batman?', '2008-12-18', 26, 'Canon S3', 582, 20, 800, '2008-12-01');
INSERT INTO metatags(metatag_id, tag) VALUES (1, 'Beach');
INSERT INTO metatags(metatag_id, tag) VALUES (2, 'Cool');
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-05 20:18:16 UTC (rev 12850)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/fileupload/FileManager.java 2009-03-06 00:33:46 UTC (rev 12851)
@@ -40,216 +40,225 @@
@Scope(ScopeType.CONVERSATION)
public class FileManager {
-
private static final String _MEDIUM = "_medium";
private static final String _MINI = "_mini";
- private String uploadRoot;
-
- public String getUploadRoot() {
+
+ private File uploadRoot;
+ private String uploadRootPath;
+
+ public File getUploadRoot() {
return uploadRoot;
}
- public void setUploadRoot(String uploadRoot) {
- this.uploadRoot = uploadRoot;
+ public void setUploadRoot(String uploadRootPath) throws IOException {
+ if (uploadRootPath != null) {
+ this.uploadRoot = new File(uploadRootPath);
+ this.uploadRootPath = this.uploadRoot.getCanonicalPath()
+ + File.separator;
+ } else {
+ this.uploadRoot = null;
+ this.uploadRootPath = null;
+ }
}
-
- public FileManager(){
+
+ public FileManager() throws IOException {
FacesContext fc = FacesContext.getCurrentInstance();
- if(fc!=null){
- this.setUploadRoot(fc.getExternalContext().getInitParameter(Constants.UPLOAD_ROOT));
- }
+ if (fc != null) {
+ // TODO nick - ask Andrei if we can throw exception here
+ this.setUploadRoot(fc.getExternalContext().getInitParameter(
+ Constants.UPLOAD_ROOT));
+ }
}
-
- public String getFileSeparator() {
- return System.getProperty(Constants.FILE_SEPARATOR);
+
+ private File getFileByPath(String path) {
+ if (this.uploadRoot != null) {
+ File result = new File(this.uploadRoot, path);
+
+ try {
+ String resultCanonicalPath = result.getCanonicalPath();
+ if (!resultCanonicalPath.startsWith(this.uploadRootPath)) {
+ // TODO log error
+ result = null;
+ }
+
+ return result;
+ } catch (IOException e) {
+ // TODO: handle exception
+ result = null;
+ }
+
+ return result;
+ }
+
+ return null;
}
public boolean isDirectoryPresent(String directory) {
- String fullPath = getAbsolutePath(directory);
- File file = new File(fullPath);
+ File file = getFileByPath(directory);
return file.exists() && file.isDirectory();
}
-
+
public void deleteDirectory(String... directories) {
String directory = new String();
- for (String chunk: directories){
- directory += chunk + getFileSeparator();
+ for (String chunk : directories) {
+ directory += chunk + File.separator;
}
- String fullPath = getAbsolutePath(directory);
- File file = new File(fullPath);
- if(file.exists()){
- for(String f :file.list()){
- File temp = new File(fullPath+getFileSeparator()+f);
+ File file = getFileByPath(directory);
+ if (file.exists()) {
+ for (String f : file.list()) {
+ File temp = new File(file, f);
temp.delete();
}
file.delete();
}
}
-
- public String concat(String... directories){
- String directory = new String();
- for (String chunk: directories){
- directory += chunk + getFileSeparator();
- }
- return directory;
- }
-
- public String concatwithSlash(String... directories){
- String directory = new String();
- for (String chunk: directories){
- directory += chunk + Constants.SLASH;
- }
- return directory;
- }
- public boolean renameDirectory(String directoryOld, String directoryNew){
- String fullPath = getAbsolutePath(directoryOld);
- File fileOld = new File(fullPath);
- File fileNew = new File(getUploadRoot() + directoryNew);
+ public boolean renameDirectory(String directoryOld, String directoryNew) {
+ File fileOld = getFileByPath(directoryOld);
+ File fileNew = getFileByPath(directoryNew);
+
createDirectoryIfNotExist(directoryNew);
- if(fileNew.exists())
- if( fileNew.isDirectory() ){
+ if (fileNew.exists()) {
+ if (fileNew.isDirectory()) {
return false;
- }else{
+ } else {
fileNew.delete();
}
+ }
+
fileOld.renameTo(fileNew);
+
return true;
}
-
+
public void addDirectory(String... directories) {
String directory = new String();
- for (String chunk: directories){
+ for (String chunk : directories) {
directory += chunk;
}
- String fullPath = getAbsolutePath(directory);
- File file = new File(fullPath);
+ File file = getFileByPath(directory);
file.mkdirs();
}
public boolean addImage(String fileName, byte[] data) {
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;
- }
- */
+ * try {
+ *
+ * writeFileTodisk(data, fileName, 0, 0, "" ); writeFileTodisk(data,
+ * fileName, 100, 100, _MINI ); writeFileTodisk(data, fileName, 500,
+ * 500, _MEDIUM );
+ *
+ * } catch (IOException e) { return false; }
+ */
return true;
}
-
- private void writeFileTodisk(byte[] data, String fileName, int width, int height, String format) throws IOException{
+
+ 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){
+ 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);
- */
+ * 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);
-
+
ImageIO.write(bdest, Constants.JPG, new File(dest));
inputStream.close();
}
-
- public String transformPath(String target, String substitute){
+
+ 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 void deleteImage(String fileName) {
- String fullPath = getAbsolutePath(fileName);
- deleteImage(new File(fullPath));
- deleteImage(new File(transformPath(fullPath, _MINI)));
- deleteImage(new File(transformPath(fullPath, _MEDIUM)));
+ deleteImage(getFileByPath(fileName));
+ deleteImage(getFileByPath(transformPath(fileName, _MINI)));
+ deleteImage(getFileByPath(transformPath(fileName, _MEDIUM)));
}
- private void deleteImage(File file){
- if(file.exists()){
+ private void deleteImage(File file) {
+ if (file.exists()) {
file.delete();
}
}
-
- public String getPathOfImage(String path){
+
+ public String getPathOfImage(String path) {
int i = path.lastIndexOf(Constants.SLASH);
return path.substring(i);
}
-
+
public void renameImage(String fileNameOld, String fileNameNew) {
createDirectoryIfNotExist(fileNameNew);
- String fullPath = getAbsolutePath(fileNameOld);
- renameImage(new File(getAbsolutePath(fileNameNew)), new File(fullPath));
- renameImage(new File(getAbsolutePath(transformPath(fileNameNew, _MINI))), new File(transformPath(fullPath, _MINI)));
- renameImage(new File(getAbsolutePath(transformPath(fileNameNew, _MEDIUM))), new File(transformPath(fullPath, _MEDIUM)));
+ renameImage(getFileByPath(fileNameNew), getFileByPath(fileNameOld));
+
+ renameImage(getFileByPath(transformPath(fileNameNew, _MINI)),
+ getFileByPath(transformPath(fileNameOld, _MINI)));
+
+ renameImage(getFileByPath(transformPath(fileNameNew, _MEDIUM)),
+ getFileByPath(transformPath(fileNameOld, _MEDIUM)));
}
-
- private void renameImage(File fileNew, File fileOld){
- if(fileNew.exists()){
+
+ private void renameImage(File fileNew, File fileOld) {
+ if (fileNew.exists()) {
fileNew.delete();
}
fileOld.renameTo(fileNew);
}
private void createDirectoryIfNotExist(String fileNameNew) {
- int lastIndexOf = fileNameNew.lastIndexOf(getFileSeparator());
- if(lastIndexOf > 0){
+ int lastIndexOf = fileNameNew.lastIndexOf(File.separatorChar);
+ if (lastIndexOf > 0) {
String directory = fileNameNew.substring(0, lastIndexOf);
- File file = new File(getUploadRoot()+directory);
- if(!file.exists()){
+ File file = getFileByPath(directory);
+ if (!file.exists()) {
file.mkdirs();
}
}
}
public boolean isImagePresent(String fileName) {
- String fullPath = getAbsolutePath(fileName);
- File file = new File(fullPath);
+ File file = getFileByPath(fileName);
return file.exists() && !file.isDirectory();
}
-
- public File getImage(String fileName){
- if(isImagePresent(fileName)){
- return new File(getAbsolutePath(fileName));
+
+ public File getImage(String fileName) {
+ if (isImagePresent(fileName)) {
+ return getFileByPath(fileName);
}
return null;
}
- private String getAbsolutePath(String fileName) {
- return getUploadRoot() + fileName;
- }
-
- public String transformToServerPath(String filename){
+ 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(this.getFileSeparator() + res[i]);
+ for (int i = 1; i < res.length; i++) {
+ sb.append(File.separator + res[i]);
}
String string = sb.toString();
return string;
}
public void deleteDirectories(List<String> directoriesToDelete) {
- for(String directory:directoriesToDelete){
+ for (String directory : directoriesToDelete) {
deleteDirectory(directory);
- }
+ }
}
}
Modified: 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-05 20:18:16 UTC (rev 12850)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/servlet/PictureServlet.java 2009-03-06 00:33:46 UTC (rev 12851)
@@ -29,6 +29,7 @@
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;
@@ -41,6 +42,7 @@
public class PictureServlet extends javax.servlet.http.HttpServlet {
+ private String uploadRoot;
public static final long serialVersionUID = 596009789004L;
@@ -69,8 +71,7 @@
return null;
}
FileManager fileManager = new FileManager();
- String uploadRoot = request.getSession().getServletContext().getInitParameter(Constants.UPLOAD_ROOT);
- fileManager.setUploadRoot(uploadRoot);
+ fileManager.setUploadRoot(this.uploadRoot);
File file = fileManager.getImage(fileName);
InputStream paintData = null;
byte[] data = new byte[(int) file.length() - 1];
@@ -137,4 +138,18 @@
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;
+ }
}
Added: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/Functions.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/Functions.java (rev 0)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/util/Functions.java 2009-03-06 00:33:46 UTC (rev 12851)
@@ -0,0 +1,37 @@
+/**
+ *
+ */
+package org.richfaces.realworld.util;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class Functions {
+
+ private Functions() {
+ }
+
+ public static String rectangle(int width, int height, int maxSize) {
+ long newWidth;
+ long newHeight;
+
+ if (width > height) {
+ newWidth = maxSize;
+ newHeight = Math.round((((double)height) / width) * maxSize);
+ } else {
+ newHeight = maxSize;
+ newWidth = Math.round((((double)width) / height) * maxSize);
+ }
+
+ if (newHeight <= 0) {
+ newHeight = 1;
+ }
+
+ if (newWidth <= 0) {
+ newWidth = 1;
+ }
+
+ return "width: " + newWidth + "px; height: " + newHeight + "px;";
+ }
+}
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-05 20:18:16 UTC (rev 12850)
+++ trunk/test-applications/realworld2/web/src/main/webapp/WEB-INF/tags/realWorld-taglib.xml 2009-03-06 00:33:46 UTC (rev 12851)
@@ -24,4 +24,9 @@
<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>
+ <function-signature>java.lang.String rectangle(int, int, int)</function-signature>
+ </function>
</facelet-taglib>
\ No newline at end of file
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/shelf/userAlbumsPreview.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/shelf/userImagesPreview.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/userImage.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/layout/template3.xhtml
===================================================================
(Binary files differ)
15 years, 10 months
JBoss Rich Faces SVN: r12850 - in trunk/sandbox: samples/layout-sample/src/main/webapp/pages and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: SergeySmirnov
Date: 2009-03-05 15:18:16 -0500 (Thu, 05 Mar 2009)
New Revision: 12850
Modified:
trunk/sandbox/samples/layout-sample/src/main/java/org/richfaces/samples/Bean.java
trunk/sandbox/samples/layout-sample/src/main/webapp/pages/index.xhtml
trunk/sandbox/ui/layout/src/main/resources/org/richfaces/renderkit/html/css/simple.xcss
Log:
preliminary theme
Modified: trunk/sandbox/samples/layout-sample/src/main/java/org/richfaces/samples/Bean.java
===================================================================
--- trunk/sandbox/samples/layout-sample/src/main/java/org/richfaces/samples/Bean.java 2009-03-05 18:13:14 UTC (rev 12849)
+++ trunk/sandbox/samples/layout-sample/src/main/java/org/richfaces/samples/Bean.java 2009-03-05 20:18:16 UTC (rev 12850)
@@ -11,11 +11,11 @@
private String position="left";
- private String theme = null;
+ private String theme = "simple";
- private int width=0;
+ private int width=960;
- private int sidebarWidth=160;
+ private int sidebarWidth=260;
/**
* @return the position
Modified: trunk/sandbox/samples/layout-sample/src/main/webapp/pages/index.xhtml
===================================================================
(Binary files differ)
Modified: trunk/sandbox/ui/layout/src/main/resources/org/richfaces/renderkit/html/css/simple.xcss
===================================================================
--- trunk/sandbox/ui/layout/src/main/resources/org/richfaces/renderkit/html/css/simple.xcss 2009-03-05 18:13:14 UTC (rev 12849)
+++ trunk/sandbox/ui/layout/src/main/resources/org/richfaces/renderkit/html/css/simple.xcss 2009-03-05 20:18:16 UTC (rev 12850)
@@ -5,12 +5,8 @@
xmlns="http://www.w3.org/1999/xhtml">
<u:selector name="body">
- <u:style name="background-image">
- <f:resource f:key="/org/richfaces/renderkit/html/images/background.png"/>
- </u:style>
- <u:style name="background-color" value="#CACACA"/>
- <u:style name="background-repeat" value="repeat-x"/>
<u:style name="font-family" skin="generalFamilyFont" />
+ <u:style name="margin" value="0" />
</u:selector>
<u:selector name=".rich-page">
@@ -23,16 +19,18 @@
</f:verbatim>
<u:selector name=".rich-page-header">
- <u:style name="color" value="#FFFFFF" />
- <u:style name="font-weight" value="bold" />
- <u:style name="font-size" value="153.9%" />
+ <u:style name="background-color" skin="generalLinkColor" />
+ <u:style name="min-height" value="40px" />
+ <u:style name="padding" value="0 20px" />
+ <u:style name="color" skin="trimColor" />
</u:selector>
<u:selector name=".rich-page-content">
<u:style name="background-image">
- <f:resource f:key="/org/richfaces/renderkit/html/images/background_content.gif"/>
+ <f:resource f:key="/org/richfaces/renderkit/html/images/tempGradient.jpg"/>
</u:style>
- <u:style name="background-color" value="#CACACA"/>
+ <u:style name="min-height" value="200px" />
+ <u:style name="background-color" value="#FFFFFF"/>
<u:style name="background-repeat" value="repeat-x"/>
</u:selector>
@@ -45,11 +43,14 @@
<u:selector name=".rich-page-footer">
<u:style name="text-align" value="center" />
+ <u:style name="padding" value="20px 0" />
+ <u:style name="background-color" value="#333"/>
+ <u:style name="color" skin="trimColor" />
+ <u:style name="font-size" value="0.8em" />
</u:selector>
<u:selector name=".rich-page-sidebar">
<u:style name="padding" value="0 20px 0 20px" />
- <u:style name="border-left" value="#8C8484 1px solid" />
</u:selector>
<u:selector name="a:hover">
15 years, 10 months
JBoss Rich Faces SVN: r12849 - management/design/realWorldDemo/html.
by richfaces-svn-commits@lists.jboss.org
Author: admitriev
Date: 2009-03-05 13:13:14 -0500 (Thu, 05 Mar 2009)
New Revision: 12849
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-05 18:01:37 UTC (rev 12848)
+++ management/design/realWorldDemo/html/album.html 2009-03-05 18:13:14 UTC (rev 12849)
@@ -25,21 +25,21 @@
a{color : #DF6400;}
- .preview_box_album_80 {width : 100px; height : 100px; position : relative; float : left; margin : 0px 10px 20px 0px;}
+ .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; height : 140px; position : relative; float : left; margin : 0px 10px 20px 0px;}
+ .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; height : 180px; position : relative; float : left; margin : 0px 10px 20px 0px;}
+ .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;}
@@ -48,28 +48,35 @@
- .preview_box_photo_80 {width : 100px; height : 100px; position : relative; float : left; margin : 0px 10px 20px 0px;}
+ .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; height : 140px; position : relative; float : left; margin : 0px 10px 20px 0px;}
+ .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; height : 180px; position : relative; float : left; margin : 0px 10px 20px 0px;}
+ .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>
Modified: management/design/realWorldDemo/html/photo.html
===================================================================
--- management/design/realWorldDemo/html/photo.html 2009-03-05 18:01:37 UTC (rev 12848)
+++ management/design/realWorldDemo/html/photo.html 2009-03-05 18:13:14 UTC (rev 12849)
@@ -25,21 +25,21 @@
a{color : #DF6400;}
- .preview_box_album_80 {width : 100px; height : 100px; position : relative; float : left; margin : 0px 10px 20px 0px;}
+ .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; height : 140px; position : relative; float : left; margin : 0px 10px 20px 0px;}
+ .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; height : 180px; position : relative; float : left; margin : 0px 10px 20px 0px;}
+ .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;}
@@ -48,21 +48,21 @@
- .preview_box_photo_80 {width : 100px; height : 100px; position : relative; float : left; margin : 0px 10px 20px 0px;}
+ .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; height : 140px; position : relative; float : left; margin : 0px 10px 20px 0px;}
+ .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; height : 180px; position : relative; float : left; margin : 0px 10px 20px 0px;}
+ .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;}
@@ -75,9 +75,7 @@
.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>
Modified: management/design/realWorldDemo/html/photo_edit.html
===================================================================
--- management/design/realWorldDemo/html/photo_edit.html 2009-03-05 18:01:37 UTC (rev 12848)
+++ management/design/realWorldDemo/html/photo_edit.html 2009-03-05 18:13:14 UTC (rev 12849)
@@ -25,21 +25,21 @@
a{color : #DF6400;}
- .preview_box_album_80 {width : 100px; height : 100px; position : relative; float : left; margin : 0px 10px 20px 0px;}
+ .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; height : 140px; position : relative; float : left; margin : 0px 10px 20px 0px;}
+ .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; height : 180px; position : relative; float : left; margin : 0px 10px 20px 0px;}
+ .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;}
@@ -48,21 +48,21 @@
- .preview_box_photo_80 {width : 100px; height : 100px; position : relative; float : left; margin : 0px 10px 20px 0px;}
+ .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; height : 140px; position : relative; float : left; margin : 0px 10px 20px 0px;}
+ .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; height : 180px; position : relative; float : left; margin : 0px 10px 20px 0px;}
+ .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;}
Modified: management/design/realWorldDemo/html/shelf.html
===================================================================
--- management/design/realWorldDemo/html/shelf.html 2009-03-05 18:01:37 UTC (rev 12848)
+++ management/design/realWorldDemo/html/shelf.html 2009-03-05 18:13:14 UTC (rev 12849)
@@ -25,21 +25,21 @@
a{color : #DF6400;}
- .preview_box_album_80 {width : 100px; height : 100px; position : relative; float : left; margin : 0px 10px 20px 0px;}
+ .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; height : 140px; position : relative; float : left; margin : 0px 10px 20px 0px;}
+ .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; height : 180px; position : relative; float : left; margin : 0px 10px 20px 0px;}
+ .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;}
@@ -48,29 +48,36 @@
- .preview_box_photo_80 {width : 100px; height : 100px; position : relative; float : left; margin : 0px 10px 20px 0px;}
+ .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; height : 140px; position : relative; float : left; margin : 0px 10px 20px 0px;}
+ .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; height : 180px; position : relative; float : left; margin : 0px 10px 20px 0px;}
+ .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>
15 years, 10 months
JBoss Rich Faces SVN: r12848 - in trunk: samples/togglePanel-sample/src/main/java/org/richfaces and 6 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2009-03-05 13:01:37 -0500 (Thu, 05 Mar 2009)
New Revision: 12848
Added:
trunk/samples/togglePanel-sample/src/main/webapp/pages/rf6451.jsp
Modified:
trunk/framework/impl/src/main/java/org/richfaces/component/UISwitchablePanel.java
trunk/samples/togglePanel-sample/src/main/java/org/richfaces/Bean.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/toggleControl/toggleControlAutoTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/AutoTester.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ToggleControlTest.java
trunk/ui/togglePanel/src/main/java/org/richfaces/component/UIToggleControl.java
trunk/ui/togglePanel/src/main/java/org/richfaces/renderkit/html/ToggleControlRenderer.java
Log:
ToggleControl: process attribute doesn't work
https://jira.jboss.org/jira/browse/RF-6451
Modified: trunk/framework/impl/src/main/java/org/richfaces/component/UISwitchablePanel.java
===================================================================
--- trunk/framework/impl/src/main/java/org/richfaces/component/UISwitchablePanel.java 2009-03-05 17:31:24 UTC (rev 12847)
+++ trunk/framework/impl/src/main/java/org/richfaces/component/UISwitchablePanel.java 2009-03-05 18:01:37 UTC (rev 12848)
@@ -34,6 +34,7 @@
import javax.faces.event.PhaseId;
import javax.faces.event.ValueChangeEvent;
+import org.ajax4jsf.context.AjaxContext;
import org.ajax4jsf.renderkit.AjaxRendererUtils;
import org.richfaces.event.SwitchablePanelSwitchEvent;
@@ -133,8 +134,11 @@
setValue(newValue);
}
- if (AjaxRendererUtils.isAjaxRequest(facesContext) && this.getSwitchType().equals(AJAX_METHOD)) {
- AjaxRendererUtils.addRegionByName(facesContext, this, this.getId());
+ if (AjaxRendererUtils.isAjaxRequest(facesContext)
+ && this.getSwitchType().equals(AJAX_METHOD)) {
+
+ AjaxRendererUtils.addRegionByName(facesContext, this, this.getId());
+
}
}
} else /* component should throw IllegalArgumentException for unknown events - RF-30 */ {
Modified: trunk/samples/togglePanel-sample/src/main/java/org/richfaces/Bean.java
===================================================================
--- trunk/samples/togglePanel-sample/src/main/java/org/richfaces/Bean.java 2009-03-05 17:31:24 UTC (rev 12847)
+++ trunk/samples/togglePanel-sample/src/main/java/org/richfaces/Bean.java 2009-03-05 18:01:37 UTC (rev 12848)
@@ -21,8 +21,11 @@
package org.richfaces;
+import java.util.Date;
import java.util.Random;
+import javax.faces.event.ActionEvent;
+
/**
* @author $Autor$
*
@@ -39,10 +42,17 @@
private String beanState = "";
//private String[] stateOrders = {"blank","canon","nikon","olympus"};
+ private String first = "";
+ private String second = "";
public String getBeanState() {
return "Last toggle panel options: SwitchType="+getSwitchType()+"; initialState="+getInitialState()+"; stateOrder="+getStateOrder();
}
+
+ public void action(ActionEvent event) {
+ System.out.println(" >>> cfif action");
+ }
+
public void setBeanState(String beanState) {
this.beanState = beanState;
}
@@ -88,5 +98,16 @@
public void setTextValue1(String textValue1) {
this.textValue1 = textValue1;
}
-
+ public String getFirst() {
+ return first + " -" + second + "- time=" + new Date();
+ }
+ public void setFirst(String first) {
+ this.first = first;
+ }
+ public String getSecond() {
+ return first + " -" + second + "- time=" + new Date();
+ }
+ public void setSecond(String second) {
+ this.second = second;
+ }
}
\ No newline at end of file
Added: trunk/samples/togglePanel-sample/src/main/webapp/pages/rf6451.jsp
===================================================================
--- trunk/samples/togglePanel-sample/src/main/webapp/pages/rf6451.jsp (rev 0)
+++ trunk/samples/togglePanel-sample/src/main/webapp/pages/rf6451.jsp 2009-03-05 18:01:37 UTC (rev 12848)
@@ -0,0 +1,88 @@
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+
+<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
+
+<%@ taglib uri="http://labs.jboss.com/jbossrichfaces/ui/togglePanel" prefix="rich"%>
+<%@ taglib uri="http://labs.jboss.com/jbossrichfaces/ui/panel" prefix="panel"%>
+<html>
+ <head>
+ <title></title>
+ </head>
+<body>
+<f:view>
+
+ <h:form>
+ <h:selectOneRadio binding="#{skinBean.component}" />
+ <h:commandLink action="#{skinBean.change}" value="set skin" />
+ </h:form>
+
+ <h:outputText value="Simple richfaces togglePanel and toggleControl test web application." style="font: 18px;font-weight: bold;" />
+
+ <h:form id="togglePanel_form">
+ <rich:togglePanel id="panel2" switchType="ajax" initialState="blank" stateOrder="blank,nikon">
+ <f:facet name="blank">
+ <panel:panel>
+ <f:facet name="header">
+ <h:panelGroup>
+ <h:outputText value="#{bean.nikon}" style="font-weight: bold;" />
+ <rich:toggleControl id="toggleControl_nikon" for="togglePanel_form:panel2"
+ ajaxSingle="true" process="my_first" actionListener="#{bean.action}">
+
+ <h:graphicImage url="/images/expand.gif" style="border-width: 0px;" />
+ <h:outputText value="#{bean.textValue1}" style="font-weight: bold;" />
+ </rich:toggleControl>
+ </h:panelGroup>
+ </f:facet>
+ </panel:panel>
+ </f:facet>
+
+ <f:facet name="nikon">
+ <panel:panel>
+ <f:facet name="header">
+ <h:panelGroup>
+ <h:outputText value="#{bean.nikon}" style="font-weight: bold;" />
+ <rich:toggleControl id="toggleControl_nikon_b" for="togglePanel_form:panel2"
+ ajaxSingle="true" process="my_first" actionListener="#{bean.action}">
+
+ <h:graphicImage value="/images/collapse.gif" style="border-width: 0px;" />
+ <h:outputText value="#{bean.textValue1}" style="font-weight: bold;" />
+ </rich:toggleControl>
+ </h:panelGroup>
+ </f:facet>
+ <h:panelGrid columns="2" border="0" style="width: 100%;background-color: white;">
+ <h:graphicImage url="/images/Nikon.jpg" alt="" />
+ <h:panelGroup>
+ <h:outputText style="font: 18px;font-weight: bold;" value="Nikon D70s" />
+ <f:verbatim>
+ <br />
+ 6.1 Megapixels - SLR / Large Digital Camera - 2 in LCD Screen -
+ Storage: Compact Flash, Microdrive Compatible, Compact Flash Type II - Built In Flash
+ <br />
+ Revolutionize every digital photography experience with the Nikon D70s digital
+ camera. Designed for amateurs and professionals alike, this Nikon digital camera
+ features a high resolution of 6.1 megapixels and a large 2.0'' LCD screen. Offering
+ i-TTL speedlight, 5-point autofocus, and lens compatibility with AF and AF-S Nikkor
+ lenses, this digital SLR camera comes with a rechargeable lithium-ion battery for
+ continual performance. With seven shooting modes, including auto, portrait, night
+ portrait, landscape, night landscape, sports, and close-up, this impressive Nikon
+ digital camera delivers professional quality results with every use.
+ </f:verbatim>
+ </h:panelGroup>
+ </h:panelGrid>
+ </panel:panel>
+ </f:facet>
+ </rich:togglePanel>
+ <br />
+ <br />
+
+ <h:inputText value="" id="my_first" required="true"/>
+ </h:form>
+
+ <a4j:log />
+ <f:verbatim>
+ <div id="logConsole" />
+ </f:verbatim>
+</f:view>
+</body>
+</html>
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/toggleControl/toggleControlAutoTest.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/toggleControl/toggleControlAutoTest.xhtml 2009-03-05 17:31:24 UTC (rev 12847)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/toggleControl/toggleControlAutoTest.xhtml 2009-03-05 18:01:37 UTC (rev 12848)
@@ -8,19 +8,17 @@
<ui:composition template="#{templateBean.autoTestTemplate}">
<ui:define name="component">
- <h:outputText id="test2" value="#{autoTestBean.text}" />
+ <h:outputText id="test2" value="#{autoTestBean.text}" />
<rich:togglePanel id="ajax_panel_one"
switchType="ajax"
stateOrder="first,second" initialState="first" label="Ajax">
-
- <f:facet name="first">
- <h:outputText id="ajax_state_one" value="First State" />
- </f:facet>
- <f:facet name="second">
- <h:outputText id="ajax_state_two" value="Second State" />
- </f:facet>
-
+ <f:facet name="first">
+ <h:outputText id="ajax_state_one" value="First State" />
+ </f:facet>
+ <f:facet name="second">
+ <h:outputText id="ajax_state_two" value="Second State" />
+ </f:facet>
</rich:togglePanel>
<rich:toggleControl id="componentId"
@@ -68,6 +66,6 @@
<rich:toggleControl id="ajax_second_one" for="ajax_panel_one" switchToState="second" action="#{panelBean.increment}">
<h:outputText value="Ajax second" />
</rich:toggleControl>
- </ui:define>
+ </ui:define>
</ui:composition>
</html>
\ No newline at end of file
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-05 17:31:24 UTC (rev 12847)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/AutoTester.java 2009-03-05 18:01:37 UTC (rev 12848)
@@ -143,19 +143,6 @@
checkActionListener(false);
checkUpdateModel(false);
}
-
- public void testAjaxSingle() {
- reset();
- setupControl(TestSetupEntry.ajaxSingle, Boolean.TRUE);
- clickLoad();
-
- setExtrenalValidationFailed();
- base.sendAjax();
-
- checkActionListener(true);
- checkUpdateModel(false);
-
- }
public void testAjaxSingleWithProcesExternalValidation(boolean checkListener) {
reset();
@@ -166,13 +153,17 @@
setExtrenalValidationFailed();
base.sendAjax();
- if (checkListener) {
- checkActionListener(false);
- }
- checkUpdateModel(false);
+ if (checkListener) {
+ checkActionListener(false);
+ }
+ checkUpdateModel(false);
}
+ public void testAjaxSingle() {
+ testAjaxSingle(true);
+ }
+
public void testAjaxSingle(boolean checkListener) {
reset();
setupControl(TestSetupEntry.ajaxSingle, Boolean.TRUE);
@@ -184,8 +175,8 @@
if (checkListener) {
checkActionListener(true);
}
+
checkUpdateModel(false);
-
}
@@ -529,9 +520,9 @@
base.setValueById(base.getParentId() + AUTOTEST_FORM_ID + INPUT_ID, "");
}
- private void setInternalValidationFailed() {
- base.setInternalValidationFailed();
- }
+// private void setInternalValidationFailed() {
+// base.setInternalValidationFailed();
+// }
private void setProcessInputValue() {
base.setValueById(base.getParentId() + AUTOTEST_FORM_ID + PROCESS_INPUT_ID, String.valueOf(new Date().getTime()));
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ToggleControlTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ToggleControlTest.java 2009-03-05 17:31:24 UTC (rev 12847)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ToggleControlTest.java 2009-03-05 18:01:37 UTC (rev 12848)
@@ -96,11 +96,11 @@
tester.testAjaxSingle();
}
- // https://jira.jboss.org/jira/browse/RF-6451
@Test
public void testAjaxSingleWithProcessExternalValidation(Template template) {
AutoTester tester = getAutoTester(this);
tester.renderPage(template, RESET_METHOD);
+
writeStatus("Test ajaxSingle attribute with external validation failed");
tester.testAjaxSingleWithProcesExternalValidation(true);
}
Modified: trunk/ui/togglePanel/src/main/java/org/richfaces/component/UIToggleControl.java
===================================================================
--- trunk/ui/togglePanel/src/main/java/org/richfaces/component/UIToggleControl.java 2009-03-05 17:31:24 UTC (rev 12847)
+++ trunk/ui/togglePanel/src/main/java/org/richfaces/component/UIToggleControl.java 2009-03-05 18:01:37 UTC (rev 12848)
@@ -37,241 +37,65 @@
/**
* @author igels
- *
+ *
*/
-//extends UIAjaxCommandLink {
-public abstract class UIToggleControl extends AjaxActionComponent implements AjaxComponent, AjaxSource, ActionSource {
-
- public static final String COMPONENT_FAMILY = "javax.faces.Command";
-
- //private String _switchToState;
-
- //xxx by nick - denis - move to config
- //private String _panelId;
-
- //xxx by nick - denis - A4J architecture fault: AjaxActionComponent should hold all action & immediate properties
- //private MethodBinding actionListener = null;
- //private boolean immediate = false;
- //private boolean immediateSet = false;
+public abstract class UIToggleControl extends AjaxActionComponent implements
+ AjaxComponent, AjaxSource, ActionSource {
- //xxx by nick - denis - move to config
+ public static final String COMPONENT_FAMILY = "javax.faces.Command";
-
- public abstract void setPanelId(String panelId);
+ public abstract void setPanelId(String panelId);
public abstract String getPanelId();
- public abstract void setSwitchToState(String switchToState);
+
+ public abstract void setSwitchToState(String switchToState);
public abstract String getSwitchToState();
+
public abstract String getFor();
- public abstract void setFor(String f);
-
+ public abstract void setFor(String f);
-
-
-
- public boolean getRendersChildren() {
- return true;
+ public boolean getRendersChildren() {
+ return true;
}
-
- public UITogglePanel getPanel()
- throws FacesException {
- UIComponent control=this;
- String target = ((UIToggleControl) control).getFor();
-
- if (null != target) {
-
- UIComponent targetComponent = RendererUtils.getInstance().findComponentFor(control, target);
- if (null != targetComponent) {
- return (UITogglePanel)targetComponent;
- } else {
- throw new FacesException( "Parent panel for control (id="
- + getClientId(getFacesContext()) + ") has not been found."); }
- } else {
-
- while((control = control.getParent())!= null) {
- if (control instanceof UITogglePanel) {
- return (UITogglePanel) control;
- }
- }
- throw new FacesException( "Parent panel for control (id=" + getClientId(getFacesContext()) + ") has not been found.");
- }
- }
-
- //xxx by nick - denis - "for" can be relative etc. Do we really need it here?
-// public Object getReRender(){
-// return getPanelId();
-// }
-
- //xxx by nick - denis - what do you think about setupReRender usage?
-
- @Override
- protected void setupReRender(FacesContext facesContext) {
- super.setupReRender(facesContext);
- UITogglePanel togglePanel = getPanel();
- AjaxRendererUtils.addRegionByName(facesContext, togglePanel, togglePanel.getId());
-
- }
-
- /**
- * @deprecated
- * use setupReRender(FacesContext facesContext)
- */
- @Deprecated
- protected void setupReRender() {
- FacesContext context = FacesContext.getCurrentInstance();
- setupReRender(context);
- }
-
-// public void setReRender(Object targetId) {
-// }
-
- public String getFamily() {
- return COMPONENT_FAMILY;
- }
-
-
-
- //xxx by nick - denis - remove FacesContext param when all todos will be ready
- /*
-
- public UITogglePanel getPanel(FacesContext context) {
- String panelId = getPanelId();
- UIComponent panel = null;
- if(panelId == null) {
- panel = this;
- while (panel != null && !(panel instanceof UITogglePanel)) {
- panel = panel.getParent();
- }
-
- if(panel == null) {
- //xxx by nick - denis - please replace all RuntimeException with more concrete FacesException
- throw new FacesException("Parent panel for control (id=" + getClientId(context) + ") has not been found.");
- }
-
- //xxx by nick - denis - remove this! you are shadowing possible "for" value binding by such code
- setPanelId(panel.getClientId(context));
-
- } else {
- //xxxx by nick - nick - potential compatibility break?
- panel = RendererUtils.getInstance().findComponentFor(context, this, panelId);
- if(panel == null) {
- //xxx by nick - denis - please replace all RuntimeException with more concrete FacesException
- throw new FacesException("Panel with id=" + panelId + " has not been found.");
- }
- }
- return (UITogglePanel)panel;
- }
- */
-
- //xxx by nick - denis - unnecessary recursion was here... remove this method please
-// private UIComponent getParentPanel(UIComponent component) {
-// UIComponent parent = component.getParent();
-// if(parent == null) {
-// return null;
-// }
-// if(parent instanceof UITogglePanel) {
-// return parent;
-// }
-// return getParentPanel(parent);
-// }
-
-
-
- //xxx by nick - denis - should be removed after moving to config
-/*
- public String getFor() {
- if (getPanelId() != null) {
- return getPanelId();
- }
- ValueBinding vb = getValueBinding("for");
- if (vb != null) {
- return ((String) vb.getValue(getFacesContext()));
- } else {
- return (null);
- }
+ public UITogglePanel getPanel() throws FacesException {
+ UIComponent control = this;
+ String target = ((UIToggleControl) control).getFor();
+
+ if (null != target) {
+
+ UIComponent targetComponent = RendererUtils.getInstance()
+ .findComponentFor(control, target);
+ if (null != targetComponent) {
+ return (UITogglePanel) targetComponent;
+ } else {
+ throw new FacesException("Parent panel for control (id="
+ + getClientId(getFacesContext())
+ + ") has not been found.");
+ }
+ } else {
+
+ while ((control = control.getParent()) != null) {
+ if (control instanceof UITogglePanel) {
+ return (UITogglePanel) control;
+ }
+ }
+ throw new FacesException("Parent panel for control (id="
+ + getClientId(getFacesContext()) + ") has not been found.");
+ }
}
-
- public void setFor(String panelId) {
- setPanelId(panelId);
+
+ @Override
+ protected void setupReRender(FacesContext facesContext) {
+ super.setupReRender(facesContext);
+ UITogglePanel togglePanel = getPanel();
+ AjaxRendererUtils.addRegionByName(facesContext, togglePanel,
+ togglePanel.getId());
+
}
-*/
-/*
- public Object saveState(FacesContext context) {
- Object values[] = new Object[7];
- values[0] = super.saveState(context);
- values[1] = getPanelId();
- values[2] = getSwitchToState();
-
- values[3] = saveAttachedState(context, actionListener);
- values[4] = immediate ? Boolean.TRUE : Boolean.FALSE;
- values[5] = immediateSet ? Boolean.TRUE : Boolean.FALSE;
- values[6] = getValue();
-
- return (values);
+
+ @Override
+ public String getFamily() {
+ return COMPONENT_FAMILY;
}
-
- public void restoreState(FacesContext context, Object state) {
- Object values[] = (Object[]) state;
- super.restoreState(context, values[0]);
- _panelId = (String) values[1];
- _switchToState = (String) values[2];
-
- actionListener = (MethodBinding) restoreAttachedState(context, values[3]);
- immediate = ((Boolean) values[4]).booleanValue();
- immediateSet = ((Boolean) values[5]).booleanValue();
- value = values[6];
- }
-*/
-
-/*
- public String getSwitchTo() {
- return getSwitchToState();
- }
-
- public void setSwitchTo(String state) {
- setSwitchToState(state);
- }
-*/
-
-//xxxx by nick - denis - don't we have action?
-// public MethodBinding getAction() {
-// return null;
-// }
-
-// public void setAction(MethodBinding action) {
-//
-// }
-
-/*
- public MethodBinding getActionListener() {
- return this.actionListener;
- }
-
- public void setActionListener(MethodBinding actionListener) {
- this.actionListener = actionListener;
- }
-*/
-
-/*
- public boolean isImmediate() {
- if (this.immediateSet) {
- return this.immediate;
- }
- ValueBinding vb = getValueBinding("immediate");
- if (vb != null) {
- return Boolean.TRUE.equals(vb.getValue(getFacesContext()));
- } else {
- return this.immediate;
- }
- }
-
- public void setImmediate(boolean immediate) {
- if (immediate != this.immediate) {
- this.immediate = immediate;
- }
- this.immediateSet = true;
- }
-*/
}
-
Modified: trunk/ui/togglePanel/src/main/java/org/richfaces/renderkit/html/ToggleControlRenderer.java
===================================================================
--- trunk/ui/togglePanel/src/main/java/org/richfaces/renderkit/html/ToggleControlRenderer.java 2009-03-05 17:31:24 UTC (rev 12847)
+++ trunk/ui/togglePanel/src/main/java/org/richfaces/renderkit/html/ToggleControlRenderer.java 2009-03-05 18:01:37 UTC (rev 12848)
@@ -33,6 +33,7 @@
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
+import org.ajax4jsf.context.AjaxContext;
import org.ajax4jsf.event.AjaxEvent;
import org.ajax4jsf.renderkit.AjaxRendererUtils;
import org.ajax4jsf.renderkit.HeaderResourcesRendererBase;
@@ -56,15 +57,6 @@
return UIToggleControl.class;
}
-// @Override
-// protected InternetResource[] getScripts() {
-// return _scripts;
-// }
-
-// protected InternetResource[] getAdditionalScripts() {
-// return _scripts;
-// }
-
public void doDecode(FacesContext context, UIComponent component) {
super.doDecode(context, component);
ExternalContext exCtx = context.getExternalContext();
@@ -79,8 +71,15 @@
new SwitchablePanelSwitchEvent(panel, null, control).queue();
- if(UITogglePanel.AJAX_METHOD.equals(panel.getSwitchType())) {
+ if (UITogglePanel.AJAX_METHOD.equals(panel.getSwitchType())) {
new AjaxEvent(component).queue();
+
+ // add regions specified in the "reRender" attribute of toggle
+ // panel to rendered list of components
+ AjaxRendererUtils.addRegionsFromComponent(control, context);
+
+ AjaxContext.getCurrentInstance(context)
+ .addAreasToProcessFromComponent(context, control);
}
ActionEvent actionEvent = new ActionEvent(component);
@@ -91,7 +90,7 @@
public String getOnClick(FacesContext context, UIComponent component) {
UIToggleControl tgComp = (UIToggleControl)component;
UITogglePanel panel = tgComp.getPanel();
- //UITogglePanel panel = tgComp.getPanel(context);
+ //UITogglePanel panel = tgComp.getPanel(context);
//denis
String switchType = panel.getSwitchType();
StringBuffer onClick = new StringBuffer();
@@ -108,10 +107,8 @@
String panelId = panel.getClientId(context);
String switchToDivId = tgComp.getSwitchToState();
onClick.append("TogglePanelManager.toggleOnClient('")
- .append(panelId)
- .append("',")
+ .append(panelId).append("',")
.append(switchToDivId==null?"null":"'" + switchToDivId + "'")
- .append("")
.append(");");
} else if(UITogglePanel.AJAX_METHOD.equals(switchType)) {
// Ajax
@@ -131,13 +128,11 @@
if(formId==null) {
throw new RuntimeException("toogleControl (id=\"" + component.getClientId(context) + "\") did not find parent form.");
}
+
onClick.append("TogglePanelManager.toggleOnServer('")
- .append(formId)
- .append("','")
- .append(component.getClientId(context))
- .append("',")
+ .append(formId).append("','")
+ .append(component.getClientId(context)).append("',")
.append(tgComp.getSwitchToState()==null?"''":"'" + tgComp.getSwitchToState() + "'")
- .append("")
.append(");");
}
return onClick.toString();
@@ -146,13 +141,4 @@
public void encodeChildren(FacesContext context, UIComponent component) throws IOException {
super.encodeChildren(context, component);
}
-
-/*
- private String getFormId(FacesContext context,UIComponent component) {
- while (component != null && !(component instanceof UIForm)) {
- component = component.getParent();
- }
- return component != null ? component.getClientId(context) : null;
- }
-*/
}
15 years, 10 months
JBoss Rich Faces SVN: r12847 - trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/modalpanel.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2009-03-05 12:31:24 -0500 (Thu, 05 Mar 2009)
New Revision: 12847
Modified:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/modalpanel/AlbumPopupHelper.java
Log:
Modified: 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-05 17:29:34 UTC (rev 12846)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/modalpanel/AlbumPopupHelper.java 2009-03-05 17:31:24 UTC (rev 12847)
@@ -101,7 +101,7 @@
}
public void addAlbum(ActionEvent event){
- albumManager.addAlbum();
+ albumManager.addAlbum(album);
setOncomplete();
}
15 years, 10 months
JBoss Rich Faces SVN: r12846 - in trunk/test-applications/seleniumTest/richfaces/src: test/java/org/richfaces/testng and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2009-03-05 12:29:34 -0500 (Thu, 05 Mar 2009)
New Revision: 12846
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/pickList/layoutTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/pickList/testFacets.xhtml
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/pickList/pickListAutoTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/PickListTest.java
Log:
RF-6169, RF-6172, RF-6173, RF-6176
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/pickList/layoutTest.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/pickList/layoutTest.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/pickList/pickListAutoTest.xhtml
===================================================================
(Binary files differ)
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/pickList/testFacets.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/pickList/testFacets.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/PickListTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/PickListTest.java 2009-03-05 17:28:56 UTC (rev 12845)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/PickListTest.java 2009-03-05 17:29:34 UTC (rev 12846)
@@ -20,6 +20,7 @@
*/
package org.richfaces.testng;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
@@ -27,6 +28,7 @@
import org.ajax4jsf.template.Template;
import org.richfaces.AutoTester;
+import org.richfaces.SeleniumEvent;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
import org.testng.annotations.Test;
@@ -45,6 +47,10 @@
private final static String I18N_TEST_URL = "pages/pickList/testI18N.xhtml";
+ private final static String LAYOUT_TEST_URL = "pages/pickList/layoutTest.xhtml";
+
+ private final static String FACETS_TEST_URL = "pages/pickList/testFacets.xhtml";
+
private static Map<String, String> params = new HashMap<String, String>();
static {
@@ -226,6 +232,104 @@
AssertTextEquals(removeAllElemId, "l�schen alles");
}
+ @Test
+ public void testStandardHTMLAttributesAreOutputToClient(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(LAYOUT_TEST_URL, template, RESET_METHOD);
+
+ String pickList = getAutoTester(this).getClientId(AutoTester.COMPONENT_ID);
+ writeStatus("Check component's specific HTML attributes are output to client");
+
+ List<String> eventsExpected = new ArrayList<String>();
+ eventsExpected.add("onlistchange");
+ eventsExpected.add("onlistchanged");
+ eventsExpected.add("onclick");
+
+ changeValue();
+ assertEvents(eventsExpected);
+
+ writeStatus("Check standart HTML attributes");
+ assertEvents(pickList, SeleniumEvent.STANDARD_HTML_EVENTS);
+ }
+
+ @Test
+ public void testStylesAndStyleClassesAreOutputToClient(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(LAYOUT_TEST_URL, template, RESET_METHOD);
+
+ writeStatus("Check styles and classes are output to client");
+
+ writeStatus("Check styleClass/style attributes");
+ String pickListId = getAutoTester(this).getClientId(AutoTester.COMPONENT_ID);
+ assertStyleAttributeContains(pickListId, "font-size: 13px", "Style attribute was not output to client");
+ assertClassAttributeContains(pickListId, "noclass", "Class attribute was not output to client");
+
+ writeStatus("Check listClass attributes");
+ String srcListXpath = "//*[@id='" + pickListId + "']/tbody/tr/td[1]/div";
+ assertClassAttributeContains(srcListXpath, "list-class", "listClass attribute was not output to client for source (left) list)");
+ String destListXpath = "//*[@id='" + pickListId + "']/tbody/tr/td[3]/div";
+ assertClassAttributeContains(destListXpath, "list-class", "listClass attribute was not output to client for destination (right) list)");
+
+ writeStatus("Check controlClass attributes");
+ String controlsXpath = "//*[@id='" + pickListId + "']/tbody/tr/td[2]/div";
+ assertClassAttributeContains(controlsXpath, "control-class", "controlClass attribute was not output to client");
+
+ // declared disabledStyle, disabledStyleClass, enabledStyle,
+ // enabledStyleClass attributes are not output
+ }
+
+ @Test
+ public void testShowButtonsLabelAttribute(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(LAYOUT_TEST_URL, template, RESET_METHOD);
+
+ writeStatus("Check 'showButtonsLabel' attribute");
+
+ String pickListId = tester.getClientId(AutoTester.COMPONENT_ID);
+
+ String copyElemId = pickListId + COPY_BTN;
+ String copyAllElemId = pickListId + COPY_ALL_BTN;
+ String removeElemId = pickListId + REMOVE_BTN;
+ String removeAllElemId = pickListId + REMOVE_ALL_BTN;
+
+ writeStatus("Check labels are gone");
+
+ AssertTextEquals(copyElemId, "");
+ AssertTextEquals(copyAllElemId, "");
+ AssertTextEquals(removeElemId, "");
+ AssertTextEquals(removeAllElemId, "");
+ }
+
+ @Test
+ public void testFacets(Template template) {
+ renderPage(FACETS_TEST_URL, template, RESET_METHOD);
+
+ writeStatus("Check facets");
+
+ assertFacetEnabled("copyAllControl", true);
+ assertFacetEnabled("copyControl", false);
+ assertFacetEnabled("removeControl", false);
+ assertFacetEnabled("removeAllControl", true);
+
+ writeStatus("Copy all");
+ clickById("_copyAllControl");
+
+ assertFacetEnabled("copyAllControl", false);
+ assertFacetEnabled("copyControl", false);
+ assertFacetEnabled("removeControl", false);
+ assertFacetEnabled("removeAllControl", true);
+
+ writeStatus("Remove all");
+ clickById("_removeAllControl");
+
+ assertFacetEnabled("copyAllControl", true);
+ assertFacetEnabled("copyControl", false);
+ assertFacetEnabled("removeControl", false);
+ assertFacetEnabled("removeAllControl", false);
+
+ // AssertPresentAndVisible("_caption", "Caption facet is not rendered");
+ }
+
private void assertButtonEnabled(String btnId) {
String id = getParentId() + "_form:" + PICK_LIST;
AssertVisible(id + btnId);
@@ -238,6 +342,21 @@
AssertVisible(id + "dis" + btnId);
}
+ private void assertFacetEnabled(String name, boolean enabled) {
+ String patternXpath = "//*[@id='" + getParentId() + "_form:componentId']/tbody/tr/td[2]/div//div[@id='%1$s']";
+
+ String eFacet = name;
+ String dFacet = name + "Disabled";
+
+ if(enabled) {
+ Assert.assertTrue(isVisible(String.format(patternXpath, "_" + eFacet)), eFacet + " facet is not rendered in control panel!");
+ Assert.assertFalse(isVisible(String.format(patternXpath, "_" + dFacet)), dFacet + " facet has not to be rendered in control panel at this moment!");
+ } else {
+ Assert.assertTrue(isVisible(String.format(patternXpath, "_" + dFacet)), dFacet + " facet is not rendered in control panel!");
+ Assert.assertFalse(isVisible(String.format(patternXpath, "_" + eFacet)), eFacet + " facet has not to be rendered in control panel at this moment!");
+ }
+ }
+
/**
* Returns number of children for DOM element with given id.
* @param elemId DOM element id
15 years, 10 months