JBoss Rich Faces SVN: r12613 - in trunk/test-applications/realworld/web/src/main/webapp/img: ajax and 4 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2009-02-10 09:53:24 -0500 (Tue, 10 Feb 2009)
New Revision: 12613
Removed:
trunk/test-applications/realworld/web/src/main/webapp/img/ajax/Thumbs.db
trunk/test-applications/realworld/web/src/main/webapp/img/ajax/ajax_process.gif
trunk/test-applications/realworld/web/src/main/webapp/img/ajax/error.gif
trunk/test-applications/realworld/web/src/main/webapp/img/ajax/passed.gif
trunk/test-applications/realworld/web/src/main/webapp/img/alert.jpeg
trunk/test-applications/realworld/web/src/main/webapp/img/error.gif
trunk/test-applications/realworld/web/src/main/webapp/img/folder.jpg
trunk/test-applications/realworld/web/src/main/webapp/img/gb.png
trunk/test-applications/realworld/web/src/main/webapp/img/icons/Thumbs.db
trunk/test-applications/realworld/web/src/main/webapp/img/icons/arrow.png
trunk/test-applications/realworld/web/src/main/webapp/img/icons/copy.gif
trunk/test-applications/realworld/web/src/main/webapp/img/icons/create_doc.gif
trunk/test-applications/realworld/web/src/main/webapp/img/icons/create_folder.gif
trunk/test-applications/realworld/web/src/main/webapp/img/icons/cut.gif
trunk/test-applications/realworld/web/src/main/webapp/img/icons/delete.gif
trunk/test-applications/realworld/web/src/main/webapp/img/icons/edit.gif
trunk/test-applications/realworld/web/src/main/webapp/img/icons/filter.gif
trunk/test-applications/realworld/web/src/main/webapp/img/icons/find.gif
trunk/test-applications/realworld/web/src/main/webapp/img/icons/message.gif
trunk/test-applications/realworld/web/src/main/webapp/img/icons/open.gif
trunk/test-applications/realworld/web/src/main/webapp/img/icons/paste.gif
trunk/test-applications/realworld/web/src/main/webapp/img/icons/redo.gif
trunk/test-applications/realworld/web/src/main/webapp/img/icons/reload.gif
trunk/test-applications/realworld/web/src/main/webapp/img/icons/repeat.gif
trunk/test-applications/realworld/web/src/main/webapp/img/icons/save.gif
trunk/test-applications/realworld/web/src/main/webapp/img/icons/save_all.gif
trunk/test-applications/realworld/web/src/main/webapp/img/icons/save_as.gif
trunk/test-applications/realworld/web/src/main/webapp/img/icons/undo.gif
trunk/test-applications/realworld/web/src/main/webapp/img/icons/verify.gif
trunk/test-applications/realworld/web/src/main/webapp/img/locked.jpg
trunk/test-applications/realworld/web/src/main/webapp/img/logo.gif
trunk/test-applications/realworld/web/src/main/webapp/img/modal/Thumbs.db
trunk/test-applications/realworld/web/src/main/webapp/img/ru.png
trunk/test-applications/realworld/web/src/main/webapp/img/tree/Thumbs.db
trunk/test-applications/realworld/web/src/main/webapp/img/tree/disc.gif
trunk/test-applications/realworld/web/src/main/webapp/img/tree/dnd/Thumbs.db
trunk/test-applications/realworld/web/src/main/webapp/img/tree/dnd/favorites.gif
trunk/test-applications/realworld/web/src/main/webapp/img/tree/dnd/image.gif
trunk/test-applications/realworld/web/src/main/webapp/img/tree/dnd/trash.gif
trunk/test-applications/realworld/web/src/main/webapp/img/tree/dnd/trash_full.gif
trunk/test-applications/realworld/web/src/main/webapp/img/tree/singer.gif
trunk/test-applications/realworld/web/src/main/webapp/img/tree/song.gif
Log:
Deleted: trunk/test-applications/realworld/web/src/main/webapp/img/ajax/Thumbs.db
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/img/ajax/ajax_process.gif
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/img/ajax/error.gif
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/img/ajax/passed.gif
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/img/alert.jpeg
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/img/error.gif
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/img/folder.jpg
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/img/gb.png
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/img/icons/Thumbs.db
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/img/icons/arrow.png
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/img/icons/copy.gif
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/img/icons/create_doc.gif
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/img/icons/create_folder.gif
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/img/icons/cut.gif
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/img/icons/delete.gif
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/img/icons/edit.gif
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/img/icons/filter.gif
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/img/icons/find.gif
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/img/icons/message.gif
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/img/icons/open.gif
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/img/icons/paste.gif
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/img/icons/redo.gif
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/img/icons/reload.gif
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/img/icons/repeat.gif
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/img/icons/save.gif
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/img/icons/save_all.gif
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/img/icons/save_as.gif
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/img/icons/undo.gif
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/img/icons/verify.gif
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/img/locked.jpg
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/img/logo.gif
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/img/modal/Thumbs.db
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/img/ru.png
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/img/tree/Thumbs.db
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/img/tree/disc.gif
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/img/tree/dnd/Thumbs.db
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/img/tree/dnd/favorites.gif
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/img/tree/dnd/image.gif
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/img/tree/dnd/trash.gif
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/img/tree/dnd/trash_full.gif
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/img/tree/singer.gif
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/img/tree/song.gif
===================================================================
(Binary files differ)
15 years, 2 months
JBoss Rich Faces SVN: r12612 - in trunk/test-applications/realworld/web/src/main/webapp: includes and 11 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2009-02-10 09:52:00 -0500 (Tue, 10 Feb 2009)
New Revision: 12612
Added:
trunk/test-applications/realworld/web/src/main/webapp/layout/template.xhtml
trunk/test-applications/realworld/web/src/main/webapp/stylesheet/realworld.css
Removed:
trunk/test-applications/realworld/web/src/main/webapp/includes/contextMenu/CMForAlbum.xhtml
trunk/test-applications/realworld/web/src/main/webapp/includes/contextMenu/CMForImage.xhtml
trunk/test-applications/realworld/web/src/main/webapp/includes/contextMenu/CMForUser.xhtml
trunk/test-applications/realworld/web/src/main/webapp/includes/fileUpload.xhtml
trunk/test-applications/realworld/web/src/main/webapp/includes/image/breadCrumb.xhtml
trunk/test-applications/realworld/web/src/main/webapp/includes/image/comments.xhtml
trunk/test-applications/realworld/web/src/main/webapp/includes/image/folders.xhtml
trunk/test-applications/realworld/web/src/main/webapp/includes/image/friendFolders.xhtml
trunk/test-applications/realworld/web/src/main/webapp/includes/image/imageScroller.xhtml
trunk/test-applications/realworld/web/src/main/webapp/includes/image/slideshow.xhtml
trunk/test-applications/realworld/web/src/main/webapp/includes/imagePreview-backup.xhtml
trunk/test-applications/realworld/web/src/main/webapp/includes/index/about.xhtml
trunk/test-applications/realworld/web/src/main/webapp/includes/message/history.xhtml
trunk/test-applications/realworld/web/src/main/webapp/includes/message/incoming.xhtml
trunk/test-applications/realworld/web/src/main/webapp/includes/message/outcoming.xhtml
trunk/test-applications/realworld/web/src/main/webapp/includes/messages.xhtml
trunk/test-applications/realworld/web/src/main/webapp/includes/misc/errorPanel.xhtml
trunk/test-applications/realworld/web/src/main/webapp/includes/misc/messagePooler.xhtml
trunk/test-applications/realworld/web/src/main/webapp/includes/misc/modalPanels.xhtml
trunk/test-applications/realworld/web/src/main/webapp/includes/misc/slideShowPooler.xhtml
trunk/test-applications/realworld/web/src/main/webapp/includes/misc/status.xhtml
trunk/test-applications/realworld/web/src/main/webapp/includes/news/recent.xhtml
trunk/test-applications/realworld/web/src/main/webapp/includes/panelBar/favoriteAlbums.xhtml
trunk/test-applications/realworld/web/src/main/webapp/includes/panelBar/tree.xhtml
trunk/test-applications/realworld/web/src/main/webapp/includes/panelBar/treeFriends.xhtml
trunk/test-applications/realworld/web/src/main/webapp/includes/search.xhtml
trunk/test-applications/realworld/web/src/main/webapp/includes/search/advancedSearch.xhtml
trunk/test-applications/realworld/web/src/main/webapp/includes/search/searchResults.xhtml
trunk/test-applications/realworld/web/src/main/webapp/includes/userPrefs.xhtml
trunk/test-applications/realworld/web/src/main/webapp/includes/userPrefs/friendTab.xhtml
trunk/test-applications/realworld/web/src/main/webapp/includes/userPrefs/loginPrefsTab.xhtml
trunk/test-applications/realworld/web/src/main/webapp/includes/userPrefs/userPrefsTab.xhtml
trunk/test-applications/realworld/web/src/main/webapp/includes/whatNew.xhtml
trunk/test-applications/realworld/web/src/main/webapp/index-backup.xhtml
trunk/test-applications/realworld/web/src/main/webapp/layout/menu-backup.xhtml
trunk/test-applications/realworld/web/src/main/webapp/layout/menu.xhtml
trunk/test-applications/realworld/web/src/main/webapp/layout/panelBar-backup.xhtml
trunk/test-applications/realworld/web/src/main/webapp/layout/template.xhtml
trunk/test-applications/realworld/web/src/main/webapp/layout/template2.xhtml
trunk/test-applications/realworld/web/src/main/webapp/layout/template3.xhtml
trunk/test-applications/realworld/web/src/main/webapp/stylesheet/realworld.css
trunk/test-applications/realworld/web/src/main/webapp/stylesheet/realworld2.css
Modified:
trunk/test-applications/realworld/web/src/main/webapp/includes/image/imagePreview.xhtml
trunk/test-applications/realworld/web/src/main/webapp/includes/imagePreview.xhtml
trunk/test-applications/realworld/web/src/main/webapp/index.xhtml
trunk/test-applications/realworld/web/src/main/webapp/register.xhtml
Log:
Deleted: trunk/test-applications/realworld/web/src/main/webapp/includes/contextMenu/CMForAlbum.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/includes/contextMenu/CMForImage.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/includes/contextMenu/CMForUser.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/includes/fileUpload.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/includes/image/breadCrumb.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/includes/image/comments.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/includes/image/folders.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/includes/image/friendFolders.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/includes/image/imagePreview.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/includes/image/imageScroller.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/includes/image/slideshow.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/includes/imagePreview-backup.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/includes/imagePreview.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/includes/index/about.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/includes/message/history.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/includes/message/incoming.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/includes/message/outcoming.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/includes/messages.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/includes/misc/errorPanel.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/includes/misc/messagePooler.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/includes/misc/modalPanels.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/includes/misc/slideShowPooler.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/includes/misc/status.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/includes/news/recent.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/includes/panelBar/favoriteAlbums.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/includes/panelBar/tree.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/includes/panelBar/treeFriends.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/includes/search/advancedSearch.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/includes/search/searchResults.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/includes/search.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/includes/userPrefs/friendTab.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/includes/userPrefs/loginPrefsTab.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/includes/userPrefs/userPrefsTab.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/includes/userPrefs.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/includes/whatNew.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/index-backup.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/index.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/layout/menu-backup.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/layout/menu.xhtml
===================================================================
--- trunk/test-applications/realworld/web/src/main/webapp/layout/menu.xhtml 2009-02-10 14:47:17 UTC (rev 12611)
+++ trunk/test-applications/realworld/web/src/main/webapp/layout/menu.xhtml 2009-02-10 14:52:00 UTC (rev 12612)
@@ -1,63 +0,0 @@
-<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<ui:composition xmlns="http://www.w3.org/1999/xhtml"
- xmlns:s="http://jboss.com/products/seam/taglib"
- xmlns:ui="http://java.sun.com/jsf/facelets"
- xmlns:f="http://java.sun.com/jsf/core"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:rich="http://richfaces.org/rich"
- xmlns:a4j="http://richfaces.org/a4j"
- xmlns:richx="http://richfaces.org/richx">
- <a4j:form id="menuform">
-
- <rich:toolBar height="37" styleClass="main-menu-toolbar" id="menu" contentClass="main-menu-toolbar-content">
- <rich:toolBarGroup >
- <h:graphicImage rendered="false"
- value="/img/shell/general_panelbar_bullet.gif" />
- <h:graphicImage height="30"
- rendered="false"
- value="/img/icons/message.gif">
- <rich:toolTip followMouse="true" direction="top-right"
- showDelay="100" styleClass="tooltip">
- <span style="white-space: nowrap">
- #{messages['menu.message.tooltip']}</span>
- </rich:toolTip>
- </h:graphicImage>
- <a4j:commandLink rendered="false"
- value="#{messages['menu.messages']}"
- actionListener="#{conversationState.setMainArea(navigationHelper.navigationEnumReadMessages)}"
- reRender="mainform:mainArea" />
- <h:graphicImage rendered="false"
- value="/img/shell/general_panelbar_bullet.gif" />
- <a4j:commandLink rendered="false" value="#{messages['menu.search']}"
- actionListener="#{conversationState.setMainArea(navigationHelper.navigationEnumSearch)}"
- reRender="mainform:mainArea" />
- <h:graphicImage rendered="false"
- value="/img/shell/general_panelbar_bullet.gif" />
- <a4j:commandLink rendered="false"
- value="#{messages['menu.image']}"
- actionListener="#{conversationState.setMainArea(navigationHelper.navigationEnumImagePreview)}"
- reRender="mainform:mainArea" />
- <h:graphicImage rendered="false"
- value="/img/shell/general_panelbar_bullet.gif" />
- <a4j:commandLink rendered="false"
- value="#{messages['menu.user']}"
- actionListener="#{conversationState.showUserProfile(user)}"
- reRender="mainform:mainArea" />
- <h:graphicImage rendered="false"
- value="/img/shell/general_panelbar_bullet.gif" />
- <h:outputText rendered="false" value=""></h:outputText>
- <a4j:commandLink rendered="false"
- value="#{messages['menu.file']}"
- actionListener="#{conversationState.setMainArea(navigationHelper.navigationEnumFileUpload)}"
- reRender="mainform:mainArea" />
- <h:graphicImage rendered="false"
- value="/img/shell/general_panelbar_bullet.gif" />
- <a4j:commandLink rendered="false"
- value="New on site"
- actionListener="#{conversationState.setMainArea(navigationHelper.navigationEnumWhatNew)}"
- reRender="mainform:mainArea" />
- </rich:toolBarGroup>
- </rich:toolBar>
- </a4j:form>
-</ui:composition>
\ No newline at end of file
Deleted: trunk/test-applications/realworld/web/src/main/webapp/layout/panelBar-backup.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/layout/template.xhtml
===================================================================
(Binary files differ)
Copied: trunk/test-applications/realworld/web/src/main/webapp/layout/template.xhtml (from rev 12548, trunk/test-applications/realworld/web/src/main/webapp/layout/template3.xhtml)
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/layout/template2.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/layout/template3.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld/web/src/main/webapp/register.xhtml
===================================================================
(Binary files differ)
Deleted: trunk/test-applications/realworld/web/src/main/webapp/stylesheet/realworld.css
===================================================================
--- trunk/test-applications/realworld/web/src/main/webapp/stylesheet/realworld.css 2009-02-10 14:47:17 UTC (rev 12611)
+++ trunk/test-applications/realworld/web/src/main/webapp/stylesheet/realworld.css 2009-02-10 14:52:00 UTC (rev 12612)
@@ -1,135 +0,0 @@
-body {
- font-size: 12px;
-}
-
-header {
- width: 120px;
- height: 200px;
- border: 1px solid #FFCC00;
- padding: 5px;
- margin-top: 5px;
- margin-bottom: 5px;
-}
-
-a:active, a:link, a:visited {
- color: #0D5798;
-}
-a:hover {
- color: #8CAFCD;
-}
-
-input, textarea {
- border: 1px solid #BBBBBB;
- font-size: 10px;
- background: #F0F8FF;
- color: black;
-}
-
-input[type='submit'], input[type='button'] {
- background: #4477AA;
- color: white;
- margin: 5px;
- border-color: gray;
-}
-
-.tableControl, .actionButtons {
- width: 100%;
-}
-
-.tableControl a {
- padding-left: 10px;
-}
-
-.tableControl {
- text-align: right;
-}
-
-.footer {
- text-align: center;
- font-size: 10px;
-}
-
-.rich-table {
- width:100%;
-}
-
-h1 {
- font-family: Arial,sans-serif;
- color: #578BB8;
- font-size: 1.6em;
- margin-top: 0;
-}
-
-body {
- margin: 0px;
- font-family: Arial,sans-serif;
- color: #616161;
-}
-
-.body {
- padding: 30px;
-}
-
-.columnHeader:hover
-{
- color: #FF6600;
-}
-
-.message {
- border: 1px solid #FFCC00;
- padding: 5px;
- margin-top: 5px;
- margin-bottom: 5px;
- background-color: #F0F8FF;
- font-size: 12px;
- color: red;
-}
-
-.name {
- vertical-align: top;
- font-weight: bold;
- width: 115px;
- float: left;
- padding: 5px;
- margin-top: 3px;
- clear: left;
-}
-.value {
- float: left;
- padding: 5px;
-}
-
-.error {
- float: left;
- padding: 5px;
- color: red;
-}
-.errors {
- color: red;
- vertical-align: middle;
-}
-img.errors {
- padding-right: 5px;
-}
-.errors input {
- border: 1px solid red;
-}
-.errors textarea {
- border: 1px solid red;
-}
-
-.required {
- color: red;
- padding-left: 2px;
-}
-
-.rich-stglpanel-body {
- overflow: auto;
-}
-.top {
- vertical-align: top;
-}
-.info {
- height: 202px;
- overflow: auto;
-}
Copied: trunk/test-applications/realworld/web/src/main/webapp/stylesheet/realworld.css (from rev 12548, trunk/test-applications/realworld/web/src/main/webapp/stylesheet/realworld2.css)
===================================================================
--- trunk/test-applications/realworld/web/src/main/webapp/stylesheet/realworld.css (rev 0)
+++ trunk/test-applications/realworld/web/src/main/webapp/stylesheet/realworld.css 2009-02-10 14:52:00 UTC (rev 12612)
@@ -0,0 +1,248 @@
+.main-body {
+ margin: 0px;
+ background: url(../img/shell/page_bg.gif) repeat-x #D7D7D7;
+ height: 100%;
+}
+
+.header-panel {
+ height: 116px;
+ border: none;
+ padding: 0px;
+ background: none;
+}
+
+.header-panel-body {
+ padding: 0px;
+}
+
+.header-content-div {
+ height: 79px;
+ position: relative;
+}
+
+.user-info-div {
+ position: absolute;
+ font-weight: bold;
+ color: #ffffff;
+ right: 25px;
+ top: 49px;
+}
+
+.top-right-menu {
+ position: absolute;
+ right: 8px;
+ top: 14px;
+}
+
+.top-right-menu-toolbar {
+ background: none;
+ border: none;
+}
+
+.top-right-menu-item {
+ vertical-align: top;
+ padding: 0px;
+}
+
+.top-right-menu-item a {
+ font-size: 11px;
+ color: #ffffff;
+ text-decoration: none;
+ font-weight: normal;
+ padding: 0px 8px 0px 15px;
+}
+
+.main-menu-panel {
+ height: 37px;
+ position: relative;
+ border: none;
+ padding: 0px;
+ background: url(../img/shell/general_panelbar_bg.gif) repeat-x #A84807;
+ overflow-y: hidden;
+}
+
+.main-menu-panel-body {
+ border: none;
+ padding: 0px;
+}
+
+.body-main-panel {
+ background: url(../img/shell/general_panel_bg.gif) right top repeat-y;
+ height: 100%;
+ padding: 0px;
+ border: none;
+}
+
+.body-main-panel-header {
+ height: 15px;
+ background: url(../img/shell/general_panel_header_bg.gif) right top;
+ font-size: 1px;
+ padding: 0px;
+ border: none;
+}
+
+.footer-panel {
+ height: 82px;
+ position: relative;
+ background: url(../img/shell/footer_bg.gif) repeat-x #000000;
+ border: none;
+ padding: 0px;
+}
+
+.footer-panel-content {
+ position: absolute;
+ left: 8px;
+ top: 51px;
+}
+
+.body-main-panel-body{
+ padding: 0px;
+}
+
+.bottom-right-menu-item {
+ vertical-align: top;
+ padding: 0px 15px 0px 8px;
+}
+
+.bottom-right-menu-item-content {
+ font-size: 11px;
+ color: #ffffff;
+ text-decoration: none;
+}
+
+.logged-user {
+ color: #FF7D2A
+}
+
+.main-menu-toolbar {
+ background: none;
+ border: none;
+}
+
+.main-menu-toolbar-content a {
+ color: #FFFFFF;
+ font-size: 11px;
+ font-weight: bold;
+ text-decoration: none;
+}
+
+.table-boby-column1{
+ vertical-align: top;
+}
+
+.table-boby-column2{
+ vertical-align: top;
+}
+
+.main-menu-table{
+ width: 100%;
+}
+
+.menu-cloumn1{
+ width: 90%
+}
+.menu-cloumn2{
+ width: 10%
+}
+
+.login-panel{
+ width: 400px;
+}
+
+input[type='submit'], input[type='button'], button {
+ background: #414141;
+ color: white;
+ margin: 5px;
+ border-color: black;
+}
+
+.login-table-col{
+ text-align: center;
+}
+
+.login-table-col2{
+ text-align: left;
+ font-weight: bold;
+}
+
+.login-body-table-col{
+ align: middle;
+ vertical-align: middle;
+ height: 100%;
+}
+
+.main-image{
+ border: none;
+}
+
+.all-images{
+ border: none;
+}
+
+.message {
+ border: 1px solid #FFCC00;
+ padding: 5px;
+ margin-top: 5px;
+ margin-bottom: 5px;
+ background-color: #F0F8FF;
+ font-size: 12px;
+ color: red;
+}
+
+.name {
+ vertical-align: top;
+ font-weight: bold;
+ width: 115px;
+ float: left;
+ padding: 5px;
+ margin-top: 3px;
+ clear: left;
+}
+.value {
+ float: left;
+ padding: 5px;
+}
+
+.error {
+ float: left;
+ padding: 5px;
+ color: red;
+}
+.errors {
+ color: red;
+ vertical-align: middle;
+}
+img.errors {
+ padding-right: 5px;
+}
+.errors input {
+ border: 1px solid red;
+}
+.errors textarea {
+ border: 1px solid red;
+}
+
+.required {
+ color: red;
+ padding-left: 2px;
+}
+
+.rich-stglpanel-body {
+ overflow: auto;
+}
+.top {
+ vertical-align: top;
+}
+.info {
+ height: 202px;
+ overflow: auto;
+}
+
+.a4j-status {
+ border: 1px solid white;
+ padding: 5px;
+ position: absolute;
+ z-index: 3;
+ left: 50%;
+ top: 40px;
+}
\ No newline at end of file
Deleted: trunk/test-applications/realworld/web/src/main/webapp/stylesheet/realworld2.css
===================================================================
--- trunk/test-applications/realworld/web/src/main/webapp/stylesheet/realworld2.css 2009-02-10 14:47:17 UTC (rev 12611)
+++ trunk/test-applications/realworld/web/src/main/webapp/stylesheet/realworld2.css 2009-02-10 14:52:00 UTC (rev 12612)
@@ -1,248 +0,0 @@
-.main-body {
- margin: 0px;
- background: url(../img/shell/page_bg.gif) repeat-x #D7D7D7;
- height: 100%;
-}
-
-.header-panel {
- height: 116px;
- border: none;
- padding: 0px;
- background: none;
-}
-
-.header-panel-body {
- padding: 0px;
-}
-
-.header-content-div {
- height: 79px;
- position: relative;
-}
-
-.user-info-div {
- position: absolute;
- font-weight: bold;
- color: #ffffff;
- right: 25px;
- top: 49px;
-}
-
-.top-right-menu {
- position: absolute;
- right: 8px;
- top: 14px;
-}
-
-.top-right-menu-toolbar {
- background: none;
- border: none;
-}
-
-.top-right-menu-item {
- vertical-align: top;
- padding: 0px;
-}
-
-.top-right-menu-item a {
- font-size: 11px;
- color: #ffffff;
- text-decoration: none;
- font-weight: normal;
- padding: 0px 8px 0px 15px;
-}
-
-.main-menu-panel {
- height: 37px;
- position: relative;
- border: none;
- padding: 0px;
- background: url(../img/shell/general_panelbar_bg.gif) repeat-x #A84807;
- overflow-y: hidden;
-}
-
-.main-menu-panel-body {
- border: none;
- padding: 0px;
-}
-
-.body-main-panel {
- background: url(../img/shell/general_panel_bg.gif) right top repeat-y;
- height: 100%;
- padding: 0px;
- border: none;
-}
-
-.body-main-panel-header {
- height: 15px;
- background: url(../img/shell/general_panel_header_bg.gif) right top;
- font-size: 1px;
- padding: 0px;
- border: none;
-}
-
-.footer-panel {
- height: 82px;
- position: relative;
- background: url(../img/shell/footer_bg.gif) repeat-x #000000;
- border: none;
- padding: 0px;
-}
-
-.footer-panel-content {
- position: absolute;
- left: 8px;
- top: 51px;
-}
-
-.body-main-panel-body{
- padding: 0px;
-}
-
-.bottom-right-menu-item {
- vertical-align: top;
- padding: 0px 15px 0px 8px;
-}
-
-.bottom-right-menu-item-content {
- font-size: 11px;
- color: #ffffff;
- text-decoration: none;
-}
-
-.logged-user {
- color: #FF7D2A
-}
-
-.main-menu-toolbar {
- background: none;
- border: none;
-}
-
-.main-menu-toolbar-content a {
- color: #FFFFFF;
- font-size: 11px;
- font-weight: bold;
- text-decoration: none;
-}
-
-.table-boby-column1{
- vertical-align: top;
-}
-
-.table-boby-column2{
- vertical-align: top;
-}
-
-.main-menu-table{
- width: 100%;
-}
-
-.menu-cloumn1{
- width: 90%
-}
-.menu-cloumn2{
- width: 10%
-}
-
-.login-panel{
- width: 400px;
-}
-
-input[type='submit'], input[type='button'], button {
- background: #414141;
- color: white;
- margin: 5px;
- border-color: black;
-}
-
-.login-table-col{
- text-align: center;
-}
-
-.login-table-col2{
- text-align: left;
- font-weight: bold;
-}
-
-.login-body-table-col{
- align: middle;
- vertical-align: middle;
- height: 100%;
-}
-
-.main-image{
- border: none;
-}
-
-.all-images{
- border: none;
-}
-
-.message {
- border: 1px solid #FFCC00;
- padding: 5px;
- margin-top: 5px;
- margin-bottom: 5px;
- background-color: #F0F8FF;
- font-size: 12px;
- color: red;
-}
-
-.name {
- vertical-align: top;
- font-weight: bold;
- width: 115px;
- float: left;
- padding: 5px;
- margin-top: 3px;
- clear: left;
-}
-.value {
- float: left;
- padding: 5px;
-}
-
-.error {
- float: left;
- padding: 5px;
- color: red;
-}
-.errors {
- color: red;
- vertical-align: middle;
-}
-img.errors {
- padding-right: 5px;
-}
-.errors input {
- border: 1px solid red;
-}
-.errors textarea {
- border: 1px solid red;
-}
-
-.required {
- color: red;
- padding-left: 2px;
-}
-
-.rich-stglpanel-body {
- overflow: auto;
-}
-.top {
- vertical-align: top;
-}
-.info {
- height: 202px;
- overflow: auto;
-}
-
-.a4j-status {
- border: 1px solid white;
- padding: 5px;
- position: absolute;
- z-index: 3;
- left: 50%;
- top: 40px;
-}
\ No newline at end of file
15 years, 2 months
JBoss Rich Faces SVN: r12611 - in trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld: slideshow and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2009-02-10 09:47:17 -0500 (Tue, 10 Feb 2009)
New Revision: 12611
Added:
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/RenderLogic.java
Removed:
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/slideshow/SlideshowHelper.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ImageUtils.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/RenderLogic.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/RenderLogic2.java
Modified:
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/servlet/PictureServlet.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/slideshow/SlideshowBean.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ConversationState.java
Log:
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/servlet/PictureServlet.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/servlet/PictureServlet.java 2009-02-10 14:44:13 UTC (rev 12610)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/servlet/PictureServlet.java 2009-02-10 14:47:17 UTC (rev 12611)
@@ -26,12 +26,15 @@
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
+import java.net.URLDecoder;
+import java.net.URLEncoder;
import javax.persistence.EntityManager;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import org.ajax4jsf.context.AjaxContext;
import org.jboss.seam.Component;
import org.richfaces.realworld.domain.Image;
import org.richfaces.realworld.domain.User;
@@ -44,8 +47,8 @@
public static final long serialVersionUID = 596009789004L;
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
- String fileName = WebUtil.getFileName(request.getPathInfo());
- if(!isAccessGranted(request, response, request.getPathInfo())){
+ String fileName = URLDecoder.decode(WebUtil.getFileName(request.getPathInfo()), "UTF8");
+ if(!isAccessGranted(request, response, fileName)){
sendToErrorPage(request, response);
return;
}
@@ -113,7 +116,7 @@
if(userId != null && !userId.equals("")){
user = em.find(User.class, Long.valueOf(userId));
}
- Image i = (Image)em.createQuery("from Image i where i.path=:path").setParameter(Constants.PATH_PARAMETER, pathInfo.substring(1)).getSingleResult();
+ Image i = (Image)em.createQuery("from Image i where i.path=:path").setParameter(Constants.PATH_PARAMETER, pathInfo).getSingleResult();
if(!i.getAlbum().isShared()){
if(user != null){
if(i.getAlbum().getOwner().equals(user) || user.getFriends().contains(i.getAlbum().getOwner())){
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/slideshow/SlideshowBean.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/slideshow/SlideshowBean.java 2009-02-10 14:44:13 UTC (rev 12610)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/slideshow/SlideshowBean.java 2009-02-10 14:47:17 UTC (rev 12611)
@@ -23,33 +23,20 @@
import java.io.Serializable;
import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Begin;
+import org.jboss.seam.annotations.End;
import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.Observer;
import org.jboss.seam.annotations.Scope;
-import org.richfaces.realworld.service.Constants;
@Name("slideshow")
@Scope(ScopeType.CONVERSATION)
public class SlideshowBean implements Serializable{
private static final long serialVersionUID = 7801877176558409702L;
-
- @In(required=false) @Out(required=false)
- SlideshowHelper slideshowHelper;
private boolean active;
-
- private int interval = Constants.INITIAL_DELAY;
- public int getInterval() {
- return interval;
- }
-
- public void setInterval(int interval) {
- this.interval = interval;
- }
-
public boolean isActive() {
return active;
}
@@ -62,11 +49,8 @@
active = true;
}
+ @Observer("stopSlideshow")
public void stopSlideshow(){
active = false;
}
-
- public void updateInterval(){
- this.setInterval((int)(Constants.DELAY * Long.valueOf(slideshowHelper.getInputSlider().getValue().toString())));
- }
}
Deleted: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/slideshow/SlideshowHelper.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/slideshow/SlideshowHelper.java 2009-02-10 14:44:13 UTC (rev 12610)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/slideshow/SlideshowHelper.java 2009-02-10 14:47:17 UTC (rev 12611)
@@ -1,43 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.realworld.slideshow;
-
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.richfaces.component.UIInputNumberSlider;
-
-@Name("slideshowHelper")
-(a)Scope(ScopeType.EVENT)
-public class SlideshowHelper {
-
- private UIInputNumberSlider inputSlider;
-
- public UIInputNumberSlider getInputSlider() {
- return inputSlider;
- }
-
- public void setInputSlider(UIInputNumberSlider inputSlider) {
- this.inputSlider = inputSlider;
- }
-
-
-}
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ConversationState.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ConversationState.java 2009-02-10 14:44:13 UTC (rev 12610)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ConversationState.java 2009-02-10 14:47:17 UTC (rev 12611)
@@ -27,36 +27,32 @@
import javax.faces.context.FacesContext;
import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.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.realworld.domain.Album;
import org.richfaces.realworld.domain.Image;
-import org.richfaces.realworld.navigation.NavigationEnum;
import org.richfaces.realworld.service.Constants;
@Name("conversationState")
-(a)Scope(ScopeType.PAGE)
+(a)Scope(ScopeType.CONVERSATION)
public class ConversationState implements Serializable{
private static final long serialVersionUID = 5656562187249324512L;
+ @In Conversation conversation;
private Integer selectedImageIndex = 1;
private Image selectedImage;
private Album selectedAlbum;
-
- private NavigationEnum mainArea;
public Integer getSelectedImageIndex() {
return selectedImageIndex;
}
-
- public NavigationEnum getMainArea() {
- return mainArea;
- }
public void setSelectedImageIndex(Integer selectedImageIndex) {
this.selectedImageIndex = selectedImageIndex;
@@ -77,13 +73,6 @@
public void setSelectedAlbum(Album selectedAlbum) {
this.selectedAlbum = selectedAlbum;
}
-
- public String getSelectedAlbumName() {
- if(null == selectedAlbum){
- return "";
- }
- return selectedAlbum.getAlbumPathFromParents(selectedAlbum, Constants.SLASH, true);
- }
public void showImage(Image image){
setSelectedAlbum(image.getAlbum());
@@ -119,4 +108,23 @@
attributes.put(UIDatascroller.SCROLLER_STATE_ATTRIBUTE, index+1);
setSelectedImageIndex(index+1);
}
+
+ public void incrementSlideShowIndex(){
+ Integer index = getSelectedAlbum().getIndex(getSelectedImage());
+ System.out.println("Slideshow execute");
+ if(index == -1){
+ Events.instance().raiseEvent("stopSlideshow");
+ System.out.println("Slideshow stop");
+ return;
+ }
+ UIComponent component = FacesContext.getCurrentInstance().getViewRoot();
+ UIDatascroller scroller = (UIDatascroller)component.findComponent(Constants.DATASCROLLER_ID);
+ Map<String, Object> attributes = scroller.getDataTable().getAttributes();
+ attributes.put(UIDatascroller.SCROLLER_STATE_ATTRIBUTE, index+1);
+ if(index == getSelectedAlbum().getImages().size() - 1){
+ index=-1;
+ }
+ setSelectedImageIndex(index+1);
+ setSelectedImage(getSelectedAlbum().getImages().get(index + 1));
+ }
}
Deleted: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ImageUtils.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ImageUtils.java 2009-02-10 14:44:13 UTC (rev 12610)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ImageUtils.java 2009-02-10 14:47:17 UTC (rev 12611)
@@ -1,148 +0,0 @@
-/**
- *
- */
-package org.richfaces.realworld.util;
-
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Graphics2D;
-import java.awt.RenderingHints;
-import java.awt.image.BufferedImage;
-import java.io.File;
-import java.io.IOException;
-
-import javax.imageio.ImageIO;
-import javax.imageio.stream.FileImageInputStream;
-import javax.imageio.stream.ImageInputStream;
-
-import org.richfaces.model.UploadItem;
-import org.richfaces.realworld.service.Constants;
-
-/**
- * @author Andrey Markavtsov
- *
- */
-public class ImageUtils {
-
- public static class ImageDimension {
- public int WIDTH;
- public int HEIGHT;
- public String POSTFIX_NAME;
- public ImageDimension(int width, int height, String postfix_name) {
- super();
- WIDTH = width;
- HEIGHT = height;
- POSTFIX_NAME = postfix_name;
- }
- };
-
- public static final String _MEDIUM = "_medium";
- public static final String _MINI = "_mini";
-
-
- public static ImageDimension MINI = new ImageDimension(100, 100, _MINI);
- public static ImageDimension MEDIUM = new ImageDimension(640, 480, _MEDIUM);
-
-
- BufferedImage bufferedImage;
-
- double width;
- double height;
-
- public ImageUtils(BufferedImage bufferedImage) {
- if (bufferedImage == null) {
- throw new NullPointerException("Buffered image is null");
- }
-
- this.height = bufferedImage.getHeight();
- this.width = bufferedImage.getWidth();
- this.bufferedImage = bufferedImage;
- }
-
- private BufferedImage scaleToWidth(int width) throws IOException {
- double height = width * this.height / this.width;
- BufferedImage newImage = new BufferedImage(width, (int) height,
- BufferedImage.TYPE_INT_RGB);
- Graphics2D graphics2D = createGraphics(newImage);
- graphics2D.drawImage(bufferedImage, 0, 0, (int) width, (int) height,
- null);
- return newImage;
- }
-
- private BufferedImage scaleToHeight(int height) throws IOException {
- double width = height * this.width / this.height;
- BufferedImage newImage = new BufferedImage((int) width, (int) height,
- BufferedImage.TYPE_INT_RGB);
- Graphics2D graphics2D = createGraphics(newImage);
- graphics2D.drawImage(bufferedImage, 0, 0, (int) width, (int) height,
- null);
- return newImage;
- }
-
- private Graphics2D createGraphics(BufferedImage image) {
- Graphics2D graphics2D = image.createGraphics();
- graphics2D.setBackground(new Color(255, 255, 255));
- graphics2D.clearRect(0, 0, image.getWidth(), image.getHeight());
- graphics2D.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
- RenderingHints.VALUE_INTERPOLATION_BICUBIC);
- return graphics2D;
- }
-
- public BufferedImage resizeImage(double width, double height)
- throws IOException {
-
- if (width > height) {
- if (this.bufferedImage.getWidth() < width) {
- return bufferedImage;
- }
- return scaleToWidth((int) width);
- } else {
- if (this.bufferedImage.getHeight() < height) {
- return bufferedImage;
- }
- return scaleToHeight((int) height);
- }
-
- }
-
- public static void resizeImage(UploadItem image, String pathToUpload, ImageDimension ... dimensions)
- throws IOException {
-
- BufferedImage bufferedImage = ImageIO.read(new FileImageInputStream(image.getFile()));
-
- ImageUtils utils = new ImageUtils(bufferedImage);
- int width, height;
-
- ImageIO.write(bufferedImage, Constants.JPG, new File(pathToUpload));
-
- for (ImageDimension dimension : dimensions) {
- String fileName = transformPath(pathToUpload,dimension.POSTFIX_NAME);
- width = dimension.WIDTH;
- height = dimension.HEIGHT;
- BufferedImage resizedBuffer = bufferedImage;
-
- if (width > height) {
- if (bufferedImage.getWidth() > width) {
- resizedBuffer = utils.scaleToWidth((int) width);
- }
- } else {
- if (bufferedImage.getHeight() > height) {
- resizedBuffer = utils.scaleToHeight((int) height);
- }
- }
-
- if (resizedBuffer != null) {
- ImageIO.write(resizedBuffer, Constants.JPG, new File(fileName));
- }
-
- }
-
- }
-
- public static 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;
- }
-
-}
Deleted: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/RenderLogic.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/RenderLogic.java 2009-02-10 14:44:13 UTC (rev 12610)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/RenderLogic.java 2009-02-10 14:47:17 UTC (rev 12611)
@@ -1,137 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.realworld.util;
-
-import java.io.Serializable;
-
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.In;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.security.Identity;
-import org.richfaces.realworld.domain.Album;
-import org.richfaces.realworld.domain.Image;
-import org.richfaces.realworld.domain.User;
-import org.richfaces.realworld.navigation.NavigationEnum;
-import org.richfaces.realworld.service.Constants;
-
-@Name("renderLogic")
-(a)Scope(ScopeType.CONVERSATION)
-public class RenderLogic implements Serializable{
-
- @In User user;
- @In Identity identity;
- @In ConversationState conversationState;
-
- private static final long serialVersionUID = 5656562187249324512L;
-
-/* public boolean shouldRenderFriendFolders(){
- return conversationState.getSelectedUser() == null;
- }
-
- public boolean shouldRenderFolders(){
- return conversationState.getSelectedUser()!=null && conversationState.getSelectedImage() == null;
- }
-
- public boolean shouldRenderImage(){
- return conversationState.getSelectedUser()!=null && conversationState.getSelectedAlbum()!=null && conversationState.getSelectedImage() != null;
- }
-
- public boolean shouldRenderImageList(){
- return conversationState.getSelectedUser()!=null && conversationState.getSelectedAlbum()!=null;
- }
-
- public boolean isCurrentUserProfileSelected(){
- return user.equals(conversationState.getSelectedUser());
- }
-
- public boolean isSecondUserProfileSelected(){
- return conversationState.getSecondSelectedUser() != null;
- }*/
-
- public boolean isUserAlbumSelected(){
- return conversationState.getSelectedAlbum() != null && conversationState.getSelectedAlbum().getOwner().equals(user);
- }
-
- public boolean isUserGuest(){
- return !identity.hasRole(Constants.ADMIN_ROLE);
- }
-
- public boolean isOwner(User u){
- return user.equals(u);
- }
-
- public boolean isProfileSelected(){
- return conversationState.getMainArea() == NavigationEnum.USER_PREFS;
- }
-
- public boolean shouldRenderFileUpload(){
- return conversationState.getSelectedAlbum()!=null && conversationState.getSelectedAlbum().getOwner().equals(user);
- }
-
- /*public boolean isUserSelected(){
- return user.equals(conversationState.getSelectedUser());
- }
-
- public boolean isFriendSelected(){
- return conversationState.getSelectedUser() == null || isUserFriend();
- }*/
-
- /*public boolean isNotFriendSelected(){
- return !isUserSelected() && !isUserFriend();
- }
-
- public boolean isUserFriend(){
- return user.getFriends() != null && user.getFriends().contains(conversationState.getSelectedUser());
- }*/
-
- /*public boolean isUserFriend(User u){
- return user.getFriends() != null && user.getFriends().contains(u);
- }*/
-
- public boolean isAlbumSelected(){
- return conversationState.getSelectedAlbum() != null;
- }
-
- public boolean isImageSelected(){
- return conversationState.getSelectedImage() != null;
- }
-
- /*public boolean isAccessToAlbumGranted(Album album){
- return album.getOwner().equals(user) || album.isShared() || isUserFriend(album.getOwner());
- }*/
-
- public boolean isUserAlbum(Album album){
- if(album == null){
- return false;
- }
- return album.getOwner().equals(user);
- }
-
- public boolean isFavoriteAlbum(Album album){
- return user.getFavoriteAlbums().contains(album);
- }
-
- public boolean isFavoriteImage(Image image){
- return user.getFavoriteImages().contains(image);
- }
-
-}
Copied: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/RenderLogic.java (from rev 12550, trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/RenderLogic2.java)
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/RenderLogic.java (rev 0)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/RenderLogic.java 2009-02-10 14:47:17 UTC (rev 12611)
@@ -0,0 +1,133 @@
+package org.richfaces.realworld.util;
+
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+import java.io.Serializable;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.security.Identity;
+import org.richfaces.realworld.service.Constants;
+
+@Name("renderLogic")
+(a)Scope(ScopeType.CONVERSATION)
+public class RenderLogic implements Serializable{
+
+ @In Identity identity;
+ @In ConversationState conversationState;
+
+ private static final long serialVersionUID = 5656562187249324512L;
+
+ /*public boolean shouldRenderFriendFolders(){
+ return conversationState.getSelectedUser() == null;
+ }
+
+ public boolean shouldRenderFolders(){
+ return conversationState.getSelectedUser()!=null && conversationState.getSelectedImage() == null;
+ }*/
+
+ public boolean shouldRenderImage(){
+ return conversationState.getSelectedAlbum()!=null && conversationState.getSelectedImage() != null;
+ }
+
+ public boolean shouldRenderImageList(){
+ return conversationState.getSelectedAlbum()!=null && conversationState.getSelectedImage() == null;
+ }
+
+ /*public boolean isCurrentUserProfileSelected(){
+ return user.equals(conversationState.getSelectedUser());
+ }
+
+ public boolean isSecondUserProfileSelected(){
+ return conversationState.getSecondSelectedUser() != null;
+ }*/
+
+/* public boolean isUserAlbumSelected(){
+ return conversationState.getSelectedAlbum() != null && conversationState.getSelectedAlbum().getOwner().equals(user);
+ }*/
+
+ public boolean isUserGuest(){
+ return !identity.hasRole(Constants.ADMIN_ROLE);
+ }
+
+/* public boolean isOwner(User u){
+ return user.equals(u);
+ }*/
+
+/* public boolean isProfileSelected(){
+ return conversationState.getMainArea() == NavigationEnum.USER_PREFS;
+ }*/
+
+/* public boolean shouldRenderFileUpload(){
+ return conversationState.getSelectedAlbum()!=null && conversationState.getSelectedAlbum().getOwner().equals(user);
+ }*/
+
+ /*public boolean isUserSelected(){
+ return user.equals(conversationState.getSelectedUser());
+ }
+
+ public boolean isFriendSelected(){
+ return conversationState.getSelectedUser() == null || isUserFriend();
+ }*/
+
+ /*public boolean isNotFriendSelected(){
+ return !isUserSelected() && !isUserFriend();
+ }
+
+ public boolean isUserFriend(){
+ return user.getFriends() != null && user.getFriends().contains(conversationState.getSelectedUser());
+ }
+
+ public boolean isUserFriend(User u){
+ return user.getFriends() != null && user.getFriends().contains(u);
+ }*/
+
+ public boolean isAlbumSelected(){
+ return conversationState.getSelectedAlbum() != null;
+ }
+
+ public boolean isImageSelected(){
+ return conversationState.getSelectedImage() != null;
+ }
+
+ /*public boolean isAccessToAlbumGranted(Album album){
+ return album.getOwner().equals(user) || album.isShared() || isUserFriend(album.getOwner());
+ }*/
+
+/* public boolean isUserAlbum(Album album){
+ if(album == null){
+ return false;
+ }
+ return album.getOwner().equals(user);
+ }
+
+ public boolean isFavoriteAlbum(Album album){
+ return user.getFavoriteAlbums().contains(album);
+ }
+
+ public boolean isFavoriteImage(Image image){
+ return user.getFavoriteImages().contains(image);
+ }*/
+
+}
Deleted: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/RenderLogic2.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/RenderLogic2.java 2009-02-10 14:44:13 UTC (rev 12610)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/RenderLogic2.java 2009-02-10 14:47:17 UTC (rev 12611)
@@ -1,133 +0,0 @@
-package org.richfaces.realworld.util;
-
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-import java.io.Serializable;
-
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.In;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.security.Identity;
-import org.richfaces.realworld.service.Constants;
-
-@Name("renderLogic2")
-(a)Scope(ScopeType.CONVERSATION)
-public class RenderLogic2 implements Serializable{
-
- @In Identity identity;
- @In ConversationState conversationState;
-
- private static final long serialVersionUID = 5656562187249324512L;
-
- /*public boolean shouldRenderFriendFolders(){
- return conversationState.getSelectedUser() == null;
- }
-
- public boolean shouldRenderFolders(){
- return conversationState.getSelectedUser()!=null && conversationState.getSelectedImage() == null;
- }*/
-
- public boolean shouldRenderImage(){
- return conversationState.getSelectedAlbum()!=null && conversationState.getSelectedImage() != null;
- }
-
- public boolean shouldRenderImageList(){
- return conversationState.getSelectedAlbum()!=null && conversationState.getSelectedImage() == null;
- }
-
- /*public boolean isCurrentUserProfileSelected(){
- return user.equals(conversationState.getSelectedUser());
- }
-
- public boolean isSecondUserProfileSelected(){
- return conversationState.getSecondSelectedUser() != null;
- }*/
-
-/* public boolean isUserAlbumSelected(){
- return conversationState.getSelectedAlbum() != null && conversationState.getSelectedAlbum().getOwner().equals(user);
- }*/
-
- public boolean isUserGuest(){
- return !identity.hasRole(Constants.ADMIN_ROLE);
- }
-
-/* public boolean isOwner(User u){
- return user.equals(u);
- }*/
-
-/* public boolean isProfileSelected(){
- return conversationState.getMainArea() == NavigationEnum.USER_PREFS;
- }*/
-
-/* public boolean shouldRenderFileUpload(){
- return conversationState.getSelectedAlbum()!=null && conversationState.getSelectedAlbum().getOwner().equals(user);
- }*/
-
- /*public boolean isUserSelected(){
- return user.equals(conversationState.getSelectedUser());
- }
-
- public boolean isFriendSelected(){
- return conversationState.getSelectedUser() == null || isUserFriend();
- }*/
-
- /*public boolean isNotFriendSelected(){
- return !isUserSelected() && !isUserFriend();
- }
-
- public boolean isUserFriend(){
- return user.getFriends() != null && user.getFriends().contains(conversationState.getSelectedUser());
- }
-
- public boolean isUserFriend(User u){
- return user.getFriends() != null && user.getFriends().contains(u);
- }*/
-
- public boolean isAlbumSelected(){
- return conversationState.getSelectedAlbum() != null;
- }
-
- public boolean isImageSelected(){
- return conversationState.getSelectedImage() != null;
- }
-
- /*public boolean isAccessToAlbumGranted(Album album){
- return album.getOwner().equals(user) || album.isShared() || isUserFriend(album.getOwner());
- }*/
-
-/* public boolean isUserAlbum(Album album){
- if(album == null){
- return false;
- }
- return album.getOwner().equals(user);
- }
-
- public boolean isFavoriteAlbum(Album album){
- return user.getFavoriteAlbums().contains(album);
- }
-
- public boolean isFavoriteImage(Image image){
- return user.getFavoriteImages().contains(image);
- }*/
-
-}
15 years, 2 months
JBoss Rich Faces SVN: r12610 - in trunk/test-applications/realworld: web/src/main/java/org/richfaces/realworld and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2009-02-10 09:44:13 -0500 (Tue, 10 Feb 2009)
New Revision: 12610
Removed:
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IMessageAction.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/MessageAction.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/error/
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileItem.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileUploadBean.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileWrapper.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/DnDManager.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/MessageManager.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/NewsManager.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/SearchManager.java
Modified:
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileManager.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/ImageLoader.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/AlbumManager.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/ImageManager.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/UserManager.java
Log:
Deleted: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IMessageAction.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IMessageAction.java 2009-02-10 12:13:58 UTC (rev 12609)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IMessageAction.java 2009-02-10 14:44:13 UTC (rev 12610)
@@ -1,31 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.realworld.service;
-
-import javax.ejb.Local;
-
-import org.richfaces.realworld.domain.User;
-
-@Local
-public interface IMessageAction {
-
- public long countNotReadedMessages(User user);
-}
\ No newline at end of file
Deleted: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/MessageAction.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/MessageAction.java 2009-02-10 12:13:58 UTC (rev 12609)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/MessageAction.java 2009-02-10 14:44:13 UTC (rev 12610)
@@ -1,47 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.realworld.service;
-
-import javax.ejb.Stateless;
-import javax.persistence.EntityManager;
-
-import org.jboss.seam.annotations.In;
-import org.jboss.seam.annotations.Name;
-import org.richfaces.realworld.domain.User;
-
-@Name("messageAction")
-@Stateless
-public class MessageAction implements IMessageAction {
-
- @In(value="entityManager")
- EntityManager em;
-
-
-
- public long countNotReadedMessages(User user){
- Long result = (Long)em.createNamedQuery(Constants.USER_COUNT_MESSAGES_QUERY)
- .setParameter(Constants.LOGIN_PARAMETER, user.getLogin())
- .getSingleResult();
- return result;
- }
-
-
-}
Deleted: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileItem.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileItem.java 2009-02-10 12:13:58 UTC (rev 12609)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileItem.java 2009-02-10 14:44:13 UTC (rev 12610)
@@ -1,76 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.realworld.fileupload;
-
-import java.io.File;
-
-import org.richfaces.realworld.domain.Image;
-
-public class FileItem {
-
- private Image image = new Image();
-
- private boolean selected;
-
- private long length;
-
- private byte[] data;
-
- private File file;
-
- public byte[] getData() {
- return data;
- }
- public void setData(byte[] data) {
- this.data = data;
- }
-
- public long getLength() {
- return length;
- }
- public void setLength(long length) {
- this.length = length;
- }
-
- public boolean isSelected() {
- return selected;
- }
-
- public void setSelected(boolean selected) {
- this.selected = selected;
- }
-
- public Image getImage() {
- return image;
- }
-
- public void setImage(Image image) {
- this.image = image;
- }
- public File getFile() {
- return file;
- }
- public void setFile(File file) {
- this.file = file;
- }
-
-
-}
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileManager.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileManager.java 2009-02-10 12:13:58 UTC (rev 12609)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileManager.java 2009-02-10 14:44:13 UTC (rev 12610)
@@ -119,17 +119,13 @@
public void addDirectory(String... directories) {
String directory = new String();
for (String chunk: directories){
- directory += chunk + getFileSeparator();
+ directory += chunk ;
}
- String fullPath = getAbsolutePath(removeSlashFromEnd(directory));
+ String fullPath = getAbsolutePath(directory);
File file = new File(fullPath);
file.mkdirs();
}
- private String removeSlashFromEnd(String directory) {
- return directory.substring(0, directory.length() - 2);
- }
-
public boolean addImage(String fileName, byte[] data) {
createDirectoryIfNotExist(fileName);
/*
Deleted: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileUploadBean.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileUploadBean.java 2009-02-10 12:13:58 UTC (rev 12609)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileUploadBean.java 2009-02-10 14:44:13 UTC (rev 12610)
@@ -1,241 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.realworld.fileupload;
-
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.In;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Observer;
-import org.jboss.seam.annotations.Out;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.core.Events;
-import org.richfaces.event.UploadEvent;
-import org.richfaces.model.UploadItem;
-import org.richfaces.realworld.domain.Image;
-import org.richfaces.realworld.domain.User;
-import org.richfaces.realworld.navigation.NavigationEnum;
-import org.richfaces.realworld.service.Constants;
-import org.richfaces.realworld.util.ConversationState;
-import org.richfaces.realworld.util.ImageUtils;
-
-import com.drew.imaging.jpeg.JpegMetadataReader;
-import com.drew.imaging.jpeg.JpegProcessingException;
-import com.drew.metadata.Directory;
-import com.drew.metadata.Metadata;
-import com.drew.metadata.MetadataException;
-import com.drew.metadata.exif.ExifDirectory;
-import com.drew.metadata.jpeg.JpegDirectory;
-
-/**
- * @author $Autor$
- *
- */
-@Name("fileUploadBean")
-(a)Scope(ScopeType.CONVERSATION)
-public class FileUploadBean implements Serializable {
-
- @In
- private User user;
- @In("#{messages['file_processing_error']}")
- private String FILE_PROCESSING_ERROR;
- @In("#{messages['file_saving_error']}")
- private String FILE_SAVE_ERROR;
- @In(create = true) @Out
- FileWrapper fileWrapper;
-
- @In @Out
- private ConversationState conversationState;
-
- @In(create = true)
- private FileManager fileManager;
-
- @In("#{messages['samplename']}")
- private String SAMPLE_NAME;
-
- @In("#{messages['sampledesc']}")
- private String SAMPLE_DESCRIPTION;
-
- private static final long serialVersionUID = 4969087557225414955L;
-
- private boolean fileUploadRendered;
-
- public synchronized void listener(UploadEvent event) throws Exception {
- UploadItem item = event.getUploadItem();
-
- FileItem file = new FileItem();
-
- file.setLength(item.getFileSize());
- //file.setData(item.getData());
- file.setFile(item.getFile());
- file.setSelected(false);
- Image image = constructImage(item, file);
-
- resizeImages(item, fileManager.getUploadRoot() + image.getPath());
- try {
- extractMetadata(file, image);
- } catch (JpegProcessingException e1) {
- Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, new Exception(FILE_PROCESSING_ERROR));
- return;
- } catch (MetadataException me) {
- Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, new Exception(FILE_PROCESSING_ERROR));
- return;
- }
- file.setImage(image);
- fileWrapper.getFiles().add(file);
- }
-
- private void resizeImages(UploadItem src, String pathToUpload) throws IOException {
- ImageUtils.resizeImage(src, pathToUpload, ImageUtils.MINI, ImageUtils.MEDIUM);
- }
-
- @Observer(Constants.FILE_UPLOAD_CLEAR_EVENT)
- public void clearUploadData() {
- fileWrapper.getFiles().clear();
- }
-
- public void clearSelectedData() {
- for (int i = 0; i < fileWrapper.getFiles().size(); i++) {
- if (fileWrapper.getFiles().get(i).isSelected()) {
- fileWrapper.getFiles().remove(i);
- }
- }
- }
-
- public void storeSelectedData() {
- List<FileItem> temp = new ArrayList<FileItem>();
- for (FileItem file : fileWrapper.getFiles()) {
- if (file.isSelected()) {
- // Save file to disk
- String fileName = fileManager.transformToServerPath(file.getImage().getPath());
- if(!fileManager.addImage(fileName, file.getData())){
- Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, new Exception(FILE_SAVE_ERROR));
- }
- // Update domain model
- Events.instance().raiseEvent(Constants.ADD_IMAGE_EVENT, file.getImage());
- } else {
- temp.add(file);
- }
- }
- fileWrapper.getFiles().clear();
- fileWrapper.getFiles().addAll(temp);
- }
-
- public void storeAll() {
- for (FileItem file : fileWrapper.getFiles()) {
- // Save file to disk
- String fileName = fileManager.transformToServerPath(file.getImage()
- .getPath());
- if(!fileManager.addImage(fileName, file.getData())){
- Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, new Exception(FILE_SAVE_ERROR));
- }
- // Update domain model
- Events.instance().raiseEvent(Constants.ADD_IMAGE_EVENT, file.getImage());
- }
- fileWrapper.getFiles().clear();
- Events.instance().raiseEvent(Constants.UPDATE_MAIN_AREA_EVENT,NavigationEnum.IMAGE_PREVIEW);
- }
-
- public boolean isFileUploadRendered() {
- return fileUploadRendered;
- }
-
- public void setFileUploadRendered(boolean fileUploadRendered) {
- this.fileUploadRendered = fileUploadRendered;
- }
-
- @Observer(Constants.SHOW_FILE_UPLOAD_EVENT)
- public void showFileUpload(boolean result) {
- this.setFileUploadRendered(result);
- clearUploadData();
- }
-
-
- private Image constructImage(UploadItem item, FileItem file) {
- Image image = new Image();
- image.setUploaded(new Date());
- image.setDescription(SAMPLE_DESCRIPTION);
- image.setName(SAMPLE_NAME);
- image.setSize(file.getLength());
- String albumPath = conversationState.getSelectedAlbum().getAlbumPathFromParents(conversationState.getSelectedAlbum(),
- Constants.SLASH, true);
- image.setPath(user.getLogin() + Constants.SLASH + albumPath + item.getFileName());
- //image.setAlbumName(conversationState.getSelectedAlbum().getName());
- image.setAlbum(conversationState.getSelectedAlbum());
- //addRankToImage(image);
- //addMetaTags(image);
- return image;
- }
-
- private void extractMetadata(FileItem file, Image image)
- throws JpegProcessingException, MetadataException, FileNotFoundException {
- InputStream in = new FileInputStream(file.getFile());
- Metadata metadata = JpegMetadataReader.readMetadata(in);
- Directory exifDirectory = metadata.getDirectory(ExifDirectory.class);
- Directory jpgDirectory = metadata.getDirectory(JpegDirectory.class);
- setupCameraModel(image, exifDirectory);
- setupDimensions(image, exifDirectory, jpgDirectory);
- setupCreatedDate(image, exifDirectory);
- }
-
- private void setupCreatedDate(Image image, Directory exifDirectory)
- throws MetadataException {
- if (exifDirectory.containsTag(ExifDirectory.TAG_DATETIME_ORIGINAL)) {
- Date time = exifDirectory.getDate(ExifDirectory.TAG_DATETIME_ORIGINAL);
- image.setCreated(time);
- }
- }
-
- private void setupDimensions(Image image, Directory exifDirectory,
- Directory jpgDirectory) throws MetadataException {
- if (exifDirectory.containsTag(ExifDirectory.TAG_EXIF_IMAGE_WIDTH) && exifDirectory.containsTag(ExifDirectory.TAG_EXIF_IMAGE_HEIGHT)) {
- int width = exifDirectory.getInt(ExifDirectory.TAG_EXIF_IMAGE_WIDTH);
- image.setWidth(width);
- int height = exifDirectory.getInt(ExifDirectory.TAG_EXIF_IMAGE_HEIGHT);
- image.setHeight(height);
- } else {
- if (jpgDirectory.containsTag(JpegDirectory.TAG_JPEG_IMAGE_HEIGHT)) {
- int width = jpgDirectory.getInt(JpegDirectory.TAG_JPEG_IMAGE_WIDTH);
- image.setWidth(width);
- int height = jpgDirectory.getInt(JpegDirectory.TAG_JPEG_IMAGE_HEIGHT);
- image.setHeight(height);
- }
- }
- }
-
- private void setupCameraModel(Image image, Directory exifDirectory) {
- if (exifDirectory.containsTag(ExifDirectory.TAG_MODEL)) {
- String cameraModel = exifDirectory.getString(ExifDirectory.TAG_MODEL);
- image.setCameraModel(cameraModel);
- }else{
- image.setCameraModel("");
- }
- }
-}
\ No newline at end of file
Deleted: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileWrapper.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileWrapper.java 2009-02-10 12:13:58 UTC (rev 12609)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileWrapper.java 2009-02-10 14:44:13 UTC (rev 12610)
@@ -1,45 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.realworld.fileupload;
-
-import java.util.ArrayList;
-
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-
-@Name("fileWrapper")
-(a)Scope(ScopeType.SESSION)
-public class FileWrapper {
-
- private ArrayList<FileItem> files = new ArrayList<FileItem>();
- public int getSize() {
- return getFiles().size();
- }
-
- public ArrayList<FileItem> getFiles() {
- return files;
- }
-
- public void setFiles(ArrayList<FileItem> files) {
- this.files = files;
- }
-}
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/ImageLoader.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/ImageLoader.java 2009-02-10 12:13:58 UTC (rev 12609)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/ImageLoader.java 2009-02-10 14:44:13 UTC (rev 12610)
@@ -49,52 +49,7 @@
FileManager fileManager;
@In("#{messages['file_processing_error']}")
private String FILE_PROCESSING_ERROR;
- @In(create=true)
- FileWrapper fileWrapper;
- public synchronized void paintImageFromByteArray(OutputStream stream, Object data) throws IOException {
- int index;
- if(data instanceof Integer){
- index = (Integer)data;
- }else{
- index = ((Long)data).intValue();
- }
- FileInputStream fileInputStream = new FileInputStream(fileWrapper.getFiles().get(index).getFile());
- int read = -1;
- byte [] bytes = new byte [4096];
- while ((read = fileInputStream.read(bytes)) != -1) {
- if (read == 0) {
- break;
- }
- stream.write(bytes);
- }
- //stream.write(fileWrapper.getFiles().get(index).getData());
- }
-
- public synchronized void paintSearchImage(OutputStream stream, Object object)
- throws IOException {
- File image = fileManager.getImage(fileManager.transformToServerPath(object.toString()));
- InputStream paintData = null;
- byte[] data = new byte[(int) image.length() - 1];
- FileInputStream fileInputStream = null;
- BufferedInputStream bufferedInputStream = null;
- if (image != null) {
- try {
- fileInputStream = new FileInputStream(image);
- bufferedInputStream = new BufferedInputStream(fileInputStream);
- paintData = bufferedInputStream;
- paintData.read(data);
- } catch (FileNotFoundException e) {
- Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, new Exception(FILE_PROCESSING_ERROR));
- return;
- } finally {
- fileInputStream.close();
- bufferedInputStream.close();
- paintData.close();
- }
- }
- stream.write(data);
- }
-
+
public synchronized void paintImage(OutputStream out, Object data) throws IOException{
if (null == data) {
return;
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/AlbumManager.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/AlbumManager.java 2009-02-10 12:13:58 UTC (rev 12609)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/AlbumManager.java 2009-02-10 14:44:13 UTC (rev 12610)
@@ -20,6 +20,7 @@
*/
package org.richfaces.realworld.manager;
+import java.io.Serializable;
import java.util.List;
import org.jboss.seam.ScopeType;
@@ -32,9 +33,10 @@
import org.richfaces.realworld.util.ConversationState;
@Name("albumManager")
-(a)Scope(ScopeType.PAGE)
-public class AlbumManager {
+(a)Scope(ScopeType.CONVERSATION)
+public class AlbumManager implements Serializable{
+ private static final long serialVersionUID = -1793632515385735086L;
@In @Out
private ConversationState conversationState;
private List<Album> sharedAlbums;
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java 2009-02-10 12:13:58 UTC (rev 12609)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/Authenticator.java 2009-02-10 14:44:13 UTC (rev 12610)
@@ -35,7 +35,6 @@
import org.jboss.seam.annotations.Out;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.core.Conversation;
-import org.jboss.seam.core.Events;
import org.jboss.seam.faces.FacesMessages;
import org.jboss.seam.log.Log;
import org.jboss.seam.security.Credentials;
@@ -43,10 +42,9 @@
import org.jboss.seam.web.Session;
import org.richfaces.realworld.domain.User;
import org.richfaces.realworld.fileupload.FileManager;
-import org.richfaces.realworld.navigation.NavigationEnum;
+import org.richfaces.realworld.service.Constants;
import org.richfaces.realworld.service.IUserAction;
import org.richfaces.realworld.util.ConversationState;
-import org.richfaces.realworld.service.Constants;
@Name("authenticator")
@Scope(ScopeType.CONVERSATION)
@@ -173,7 +171,7 @@
//identity.unAuthenticate();
credentials.clear();
//credentials.invalidate();
- conversation.begin();
+ //conversation.begin();
try {
identity.authenticate();
} catch (LoginException e) {
@@ -183,12 +181,6 @@
}
return "";
}
-
- private void setupCatalogForUser() {
- if (!fileManager.isDirectoryPresent(credentials.getUsername())) {
- fileManager.addDirectory(credentials.getUsername());
- }
- }
private boolean wantLoginAnonymous() {
return null == credentials.getUsername() || credentials.getUsername().equals("");
Deleted: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/DnDManager.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/DnDManager.java 2009-02-10 12:13:58 UTC (rev 12609)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/DnDManager.java 2009-02-10 14:44:13 UTC (rev 12610)
@@ -1,185 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.realworld.manager;
-
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import org.richfaces.realworld.service.Constants;
-
-import org.ajax4jsf.context.AjaxContext;
-import org.jboss.seam.annotations.In;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Out;
-import org.jboss.seam.core.Events;
-import org.richfaces.component.Dropzone;
-import org.richfaces.event.DropEvent;
-import org.richfaces.event.DropListener;
-import org.richfaces.model.TreeNode;
-import org.richfaces.realworld.domain.Album;
-import org.richfaces.realworld.domain.Image;
-import org.richfaces.realworld.domain.User;
-import org.richfaces.realworld.fileupload.FileManager;
-import org.richfaces.realworld.service.IAlbumAction;
-import org.richfaces.realworld.tree.TreeAlbumItem;
-import org.richfaces.realworld.tree.TreeMyAlbumsItem;
-
-@Name("dndManager")
-public class DnDManager implements DropListener {
-
- @In(required=false, create=false) @Out(required=false) TreeMyAlbumsItem treeMyAlbumsItem;
- @In("#{messages['album_present']}")
- private String ALBUM_WITH_THIS_NAME_ALREADY_PRESENT;
- @In User user;
- @In(create=true)
- FileManager fileManager;
- @In(create=true)
- IAlbumAction albumAction;
-
- public void processDrop(DropEvent dropEvent) {
- Dropzone dropzone = (Dropzone) dropEvent.getComponent();
- Object dragValue = dropEvent.getDragValue();
- Object dropValue = dropzone.getDropValue();
- if(dragValue instanceof Image){
- handleImage((Image)dragValue, (Album)dropValue);
- }else if(dragValue instanceof Album){
- if(dropValue instanceof TreeMyAlbumsItem){
- handleRoot((Album)dragValue);
- }else{
- handleAlbum((Album)dragValue, (Album)dropValue);
- }
- }
- }
-
- private void handleRoot(Album dragValue) {
- TreeAlbumItem itemParent = removeAlbumFromParentAlbum(dragValue);
- if(null == itemParent){
- //Tree root contain this album
- return;
- }
- if(!renameDirectory(dragValue)){
- Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, ALBUM_WITH_THIS_NAME_ALREADY_PRESENT);
- return;
- }
- renameImagesFromAlbum(dragValue);
- updateRootTreeNode(dragValue, itemParent);
- addTreeToRerender();
- }
-
- private TreeAlbumItem removeAlbumFromParentAlbum(Album dragValue) {
- TreeAlbumItem itemParent = null;
- if(dragValue.getParent() != null ){
- itemParent = (TreeAlbumItem)treeMyAlbumsItem.getNode(dragValue.getParent().getName());
- dragValue.getParent().removeChildAlbum(dragValue);
- }else{
- //Tree root contain this album
- return null;
- }
- return itemParent;
- }
-
- private boolean renameDirectory(Album dragValue) {
- String directoryOld = fileManager.concat(user.getLogin(), dragValue.getAlbumPathFromParents(dragValue, fileManager.getFileSeparator(), true ));
- String directoryNew = fileManager.concat(user.getLogin(), dragValue.getName());
- return fileManager.renameDirectory(directoryOld, directoryNew);
- }
-
- private void renameImagesFromAlbum(Album dragValue) {
- String albumOld = fileManager.concatwithSlash(user.getLogin(), dragValue.getAlbumPathFromParents(dragValue, Constants.SLASH, false ));
- String albumNew = user.getLogin() + Constants.SLASH;
- //albumAction.renameAllImagesFromAlbumAndChilds(dragValue, albumOld, albumNew);
- }
-
- private void updateRootTreeNode(Album dragValue, TreeAlbumItem itemParent) {
- TreeAlbumItem item = (TreeAlbumItem)treeMyAlbumsItem.getNode(dragValue.getName());
- itemParent.removeChild(item.getId());
- treeMyAlbumsItem.addChild(item.getId(), item);
- }
-
- private void addTreeToRerender() {
- try {
- FacesContext fc = FacesContext.getCurrentInstance();
- AjaxContext ac = AjaxContext.getCurrentInstance();
- UIComponent destTree = fc.getViewRoot().findComponent(Constants.TREE_ID);
- ac.addComponentToAjaxRender(destTree);
- } catch (Exception e) {
- System.err.print(e.getMessage());
- }
- }
-
- private void handleAlbum(Album dragValue, Album dropValue) {
- TreeNode<Object> itemParent = null;
- if(dragValue.getParent() != null ){
- itemParent = treeMyAlbumsItem.getNode(dragValue.getParent().getName());
- if(dragValue.getParent().equals(dropValue)){
- //Parent album contain this album
- return;
- }
- }else{
- itemParent = treeMyAlbumsItem;
- }
- String directoryOld = fileManager.concat(user.getLogin(), dragValue.getAlbumPathFromParents(dragValue, fileManager.getFileSeparator(), true ));
- String directoryNew = fileManager.concat(user.getLogin() ,dropValue.getAlbumPathFromParents(dropValue, fileManager.getFileSeparator(), false), dragValue.getName());
- if(!fileManager.renameDirectory(directoryOld, directoryNew)){
- Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, ALBUM_WITH_THIS_NAME_ALREADY_PRESENT);
- return;
- }
-
- updateAlbums(dragValue, dropValue, itemParent);
- addTreeToRerender();
- }
-
- private void updateAlbums(Album dragValue, Album dropValue,
- TreeNode<Object> itemParent) {
- String albumOld = fileManager.concatwithSlash(user.getLogin(), dragValue.getAlbumPathFromParents(dragValue, Constants.SLASH, false ));
- String albumNew = fileManager.concatwithSlash(user.getLogin() ,dropValue.getAlbumPathFromParents(dropValue, Constants.SLASH, false));
- //albumAction.renameAllImagesFromAlbumAndChilds(dragValue, albumOld, albumNew);
- dropValue.addChildAlbum(dragValue);
- updateTree(dragValue, dropValue, itemParent);
- }
-
- private void updateTree(Album dragValue, Album dropValue,
- TreeNode<Object> itemParent) {
- TreeAlbumItem itemParentNew = (TreeAlbumItem)treeMyAlbumsItem.getNode(dropValue.getName());
- TreeAlbumItem item = (TreeAlbumItem)treeMyAlbumsItem.getNode(dragValue.getName());
- itemParent.removeChild(item.getId());
- itemParentNew.addAlbum(item);
- }
-
- private void handleImage(Image dragValue, Album dropValue) {
- if(dragValue.getAlbum().equals(dropValue)){
- return;
- }
- String newPath = getNewPathOfImage(dragValue, dropValue);
- dragValue.setPath(newPath);
- dropValue.addImage(dragValue);
- //albumAction.flush();
- }
-
- private String getNewPathOfImage(Image dragValue, Album dropValue) {
- String fileNameOld = fileManager.transformToServerPath(dragValue.getPath());
- int lastIndexOf = dragValue.getPath().lastIndexOf(Constants.SLASH);
- String prevPathEnd = dragValue.getPath().substring(lastIndexOf);
- String fileNameNew = fileManager.concat(user.getLogin(), dropValue.getAlbumPathFromParents(dropValue, fileManager.getFileSeparator(), true), prevPathEnd);
- String newPath = fileManager.concatwithSlash(user.getLogin() , dropValue.getAlbumPathFromParents(dropValue, Constants.SLASH, true), prevPathEnd);
- fileManager.renameImage(fileNameOld, fileNameNew);
- return newPath;
- }
-}
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/ImageManager.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/ImageManager.java 2009-02-10 12:13:58 UTC (rev 12609)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/ImageManager.java 2009-02-10 14:44:13 UTC (rev 12610)
@@ -31,12 +31,8 @@
import org.richfaces.realworld.domain.Image;
import org.richfaces.realworld.domain.User;
import org.richfaces.realworld.fileupload.FileManager;
-import org.richfaces.realworld.navigation.NavigationEnum;
import org.richfaces.realworld.service.Constants;
import org.richfaces.realworld.service.IImageAction;
-import org.richfaces.realworld.tree.TreeAlbumItem;
-import org.richfaces.realworld.tree.TreeMyAlbumsItem;
-import org.richfaces.realworld.ui.RatingBinder;
import org.richfaces.realworld.util.ConversationState;
@Name("imageManager")
@@ -49,83 +45,16 @@
@In(create=true)
FileManager fileManager;
- @In(required=false, create=false) @Out(required=false) TreeMyAlbumsItem treeMyAlbumsItem;
-
@In(create=true) @Out
private ConversationState conversationState;
@In
private User user;
- @In(create=true, required=true)
- private RatingBinder ratingBinder;
-
- private String oncomplete;
-
- public ImageManager() {
- oncomplete = null;
- }
-
public void deleteImage(Image image){
String imagePath = image.getPath();
imageAction.deleteImage(image);
fileManager.deleteImage(fileManager.transformToServerPath(imagePath));
- }
-
- public void editImage(Image image){
- TreeAlbumItem parent = (TreeAlbumItem)treeMyAlbumsItem.getNode(image.getAlbum().getName());
- boolean parentChanged = parentChanged(image, parent);
- if(parentChanged){
- TreeAlbumItem albumItem = (TreeAlbumItem)treeMyAlbumsItem.getNode(image.getAlbumName());
- String newPath = getNewPathOfImage(image, albumItem);
- image.setPath(newPath);
- conversationState.setSelectedImage(image);
- conversationState.setSelectedAlbum(albumItem.getAlbum());
- }
- //imageAction.editImage(image, parentChanged);
- setOncomplete();
- }
+ }
- @Observer(Constants.ADD_IMAGE_EVENT)
- public void addImage(Image image) {
- //imageAction.addImage(image);
- TreeAlbumItem albumItem = (TreeAlbumItem)treeMyAlbumsItem.getNode(image.getAlbumName());
- conversationState.setSelectedAlbum(albumItem.getAlbum());
- Events.instance().raiseEvent(Constants.UPDATE_MAIN_AREA_EVENT, NavigationEnum.IMAGE_PREVIEW);
- //setOncomplete();
- }
-
-
- public void vote(Image image){
- //imageAction.vote(image, Long.valueOf(ratingBinder.getInputSlider().getValue().toString()));
- }
-
- private void setOncomplete() {
- oncomplete = "$('imageModalPanel').component.hide()";
- }
-
- private boolean parentChanged(Image image, TreeAlbumItem parent) {
- return !parent.getAlbum().getName().equals(image.getAlbumName());
- }
-
- private String getNewPathOfImage(Image image, TreeAlbumItem albumItem) {
- String fileNameOld = fileManager.transformToServerPath(image.getPath());
- int lastIndexOf = image.getPath().lastIndexOf(Constants.SLASH);
- String prevPathEnd = image.getPath().substring(lastIndexOf);
- Album dropValue = ((TreeAlbumItem)treeMyAlbumsItem.getNode(image.getAlbumName())).getAlbum();
- String fileNameNew = fileManager.concat(user.getLogin(), dropValue.getAlbumPathFromParents(dropValue , fileManager.getFileSeparator(), true), prevPathEnd);
- String newPath = fileManager.concatwithSlash(user.getLogin(), albumItem.getAlbum().getAlbumPathFromParents(albumItem.getAlbum(), Constants.SLASH, true), prevPathEnd);
- fileManager.renameImage(fileNameOld, fileNameNew);
- return newPath;
- }
-
- public String getOncomplete() {
- return oncomplete;
- }
-
- public void setOncomplete(String oncomplete) {
- this.oncomplete = oncomplete;
- }
-
-
}
Deleted: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/MessageManager.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/MessageManager.java 2009-02-10 12:13:58 UTC (rev 12609)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/MessageManager.java 2009-02-10 14:44:13 UTC (rev 12610)
@@ -1,40 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.realworld.manager;
-
-import java.io.Serializable;
-
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.In;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.richfaces.realworld.domain.User;
-
-@Name("messageManager")
-(a)Scope(ScopeType.CONVERSATION)
-public class MessageManager implements Serializable{
-
- private static final long serialVersionUID = 2561824019376412988L;
-
- @In
- private User user;
-
-}
Deleted: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/NewsManager.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/NewsManager.java 2009-02-10 12:13:58 UTC (rev 12609)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/NewsManager.java 2009-02-10 14:44:13 UTC (rev 12610)
@@ -1,43 +0,0 @@
-package org.richfaces.realworld.manager;
-
-import java.io.Serializable;
-import java.util.List;
-
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.In;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.richfaces.realworld.domain.Image;
-import org.richfaces.realworld.service.ISearchService;
-
-@Name("newsManager")
-(a)Scope(ScopeType.CONVERSATION)
-public class NewsManager implements Serializable {
-
- private static final long serialVersionUID = 5071655218132021316L;
- @In(create=true) private ISearchService searchService;
-
- public List<Image> getRecentImages(){
- return searchService.getRecentImages();
- }
-
- public List<Image> getLastFriendImages(){
- return searchService.getLastFriendImages();
- }
-
- public List<Image> getTopImages(){
- return searchService.getTopImages();
- }
-
- public List<Image> getTopCommentedImages(){
- return searchService.getTopCommentedImages();
- }
-
- public List<Image> getRecentCommentedImages(){
- return searchService.getRecentCommentedImages();
- }
-
- public List<Image> getLastCommentedYourImages(){
- return searchService.getLastCommentedYourImages();
- }
-}
Deleted: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/SearchManager.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/SearchManager.java 2009-02-10 12:13:58 UTC (rev 12609)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/SearchManager.java 2009-02-10 14:44:13 UTC (rev 12610)
@@ -1,165 +0,0 @@
-/**
- * License Agreement.
- *
- * JBoss RichFaces - Ajax4jsf Component Library
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-package org.richfaces.realworld.manager;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.In;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.richfaces.realworld.domain.Image;
-import org.richfaces.realworld.search.SearchBeanHelper;
-import org.richfaces.realworld.search.SearchParamHolder;
-import org.richfaces.realworld.service.Constants;
-import org.richfaces.realworld.service.ISearchService;
-
-@Name("searchManager")
-(a)Scope(ScopeType.CONVERSATION)
-public class SearchManager implements Serializable {
-
- @In(required = false)
- private SearchBeanHelper helper;
-
- @In(required = false)
- private SearchParamHolder searchParams;
-
- private static final long serialVersionUID = 5071655218132021316L;
-
- @In(create=true)
- private ISearchService searchService;
-
- private List<Image> findedImages = new ArrayList<Image>();
-
- public List<String> getAllCameras(){
- return searchService.getAllCameras();
- }
-
- public List<String> getAllMetatags(){
- return searchService.getAllMetatags();
- }
-
- public List<Image> searchImages(){
- String additionalParams = populateAdditionalParams();
- findedImages = searchService.searchImages(searchParams.getSearchPattern(), additionalParams, populateMap(additionalParams));
- return findedImages;
- }
-
- public List<Image> popularImages(){
- findedImages = searchService.popularImages();
- return findedImages;
- }
-
- public List<Image> worstImages(){
- findedImages = searchService.worstImages();
- return findedImages;
- }
-
- private Map<String, Object> populateMap(String additionalParams) {
- Map<String, Object> map = new HashMap<String, Object>();
- populateParameter(map, additionalParams, Constants.SPINNER_VALUE_NAMED_PARAMETER, Long.valueOf(helper.getInputSpinner().getValue().toString()));
- populateParameter(map, additionalParams, Constants.CHOICE_NAMED_PARAMETER, searchParams.getNumberOfVotes());
- populateParameter(map, additionalParams, Constants.DATE_NAMED_PARAMETER, searchParams.getDate());
- populateParameter(map, additionalParams, Constants.UPLOAD_NAMED_PARAMETER, searchParams.getUploadDate());
- populateParameter(map, additionalParams, Constants.SIZE_NAMED_PARAMETER, searchParams.getSize());
- populateParameter(map, additionalParams, Constants.WIDTH_NAMED_PARAMETER, searchParams.getWidth());
- populateParameter(map, additionalParams, Constants.HEIGHT_NAMED_PARAMETER, searchParams.getHeight());
- populateParameter(map, additionalParams, Constants.CAMERA_NAMED_PARAMETER, searchParams.getCamera());
- if(searchParams.getMatcherChoice() != null){
- map.put(Constants.STRICT_PARAMETER, getMatcher(searchParams.getMatcherChoice()));
- }
- map.put(Constants.CASE_SENSITIVE_PARAMETER, searchParams.isCaseSensitive());
- return map;
- }
-
- private String populateAdditionalParams() {
- StringBuilder additionalParams = new StringBuilder("");
- populateChoiceAddon(additionalParams, searchParams.getSpinnerChoice(), Constants.SPINNER_ADDON, Constants.SPINNER_VALUE_NAMED_PARAMETER);
- populateChoiceAddon(additionalParams, searchParams.getVotesChoice(), Constants.VOTES_ADDON, Constants.CHOICE_NAMED_PARAMETER);
- populateDateAddon(additionalParams, searchParams.getDateChoice(), Constants.DATE_ADDON, Constants.DATE_NAMED_PARAMETER, searchParams.getDate());
- populateDateAddon(additionalParams, searchParams.getUploadChoice(), Constants.UPLOAD_ADDON, Constants.UPLOAD_NAMED_PARAMETER, searchParams.getUploadDate());
- populateChoiceAddon(additionalParams, searchParams.getWidthChoice(), Constants.WIDTH_ADDON, Constants.WIDTH_NAMED_PARAMETER);
- populateChoiceAddon(additionalParams, searchParams.getHeightChoice(), Constants.HEIGHT_ADDON, Constants.HEIGHT_NAMED_PARAMETER);
- populateChoiceAddon(additionalParams, searchParams.getSizeChoice(), Constants.SIZE_ADDON, Constants.SIZE_NAMED_PARAMETER);
- if(searchParams.getCamera()!= null && !searchParams.getCamera().equals("")){
- additionalParams.append(Constants.CAMERA_ADDON);
- additionalParams.append(Constants.EQUALS);
- additionalParams.append(Constants.CAMERA_NAMED_PARAMETER);
- }
- return additionalParams.toString();
- }
-
- private String getAstFromIndex(Long item){
- if(item == 1L){
- return Constants.GREATTHEN;
- }else if(item == 2L){
- return Constants.LESSTHEN;
- }else if(item == 3L){
- return Constants.EQUALS;
- }
- return null;
- }
-
- private String getMatcher(Long item){
- if(item == 1L){
- return Constants.START;
- }else if(item == 2L){
- return Constants.END;
- }else if(item == 3L){
- return Constants.INCLUDE;
- }else if(item == 0L){
- return Constants.STRICT;
- }
- return null;
- }
-
- private void populateParameter(Map<String, Object> map, String additionalParams, String parameter, Object value){
- if(additionalParams.lastIndexOf(parameter) != -1){
- map.put(parameter, value);
- }
- }
-
- private void populateChoiceAddon(StringBuilder additionalParams, Long choice, String addon, String namedParameter){
- if(choice != null && choice > 0L){
- additionalParams.append(addon);
- additionalParams.append(getAstFromIndex(choice));
- additionalParams.append(namedParameter);
- }
- }
-
- private void populateDateAddon(StringBuilder additionalParams, Long choice, String addon, String namedParameter, Date date){
- if(choice != null && choice > 0L && date != null ){
- additionalParams.append(addon);
- additionalParams.append(getAstFromIndex(choice));
- additionalParams.append(namedParameter);
- }
- }
-
- public List<Image> getFindedImages() {
- return findedImages;
- }
-
-}
\ No newline at end of file
Modified: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/UserManager.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/UserManager.java 2009-02-10 12:13:58 UTC (rev 12609)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/manager/UserManager.java 2009-02-10 14:44:13 UTC (rev 12610)
@@ -32,7 +32,6 @@
import org.richfaces.realworld.domain.Image;
import org.richfaces.realworld.domain.User;
import org.richfaces.realworld.service.IUserAction;
-import org.richfaces.realworld.tree.TreeFriendsItem;
@Name("userManager")
@Scope(ScopeType.CONVERSATION)
@@ -43,26 +42,15 @@
@In("#{messages['removedfromfriends']}") private String REMOVED_FROM_FRIENDS_MESSAGE_THEME;
@In("#{messages['removedfromfriendsby']}") private String YOU_ARE_WERE_REMOVED_FROM_FRIENDS_MESSAGE;
@In("#{messages['friend_error']}")
- private String FRIEND_ERROR_MESSAGE;
+
private static final long serialVersionUID = 6027103521084558931L;
@In
private User user;
- @In(required=false) @Out(required=false)
- TreeFriendsItem treeFriendsItem;
-
@In(create=true, required=true)
private IUserAction userAction;
-
- public List<String> availableUserLogins(Object suggest){
- List<String> suggestions = userAction.getUsers((String)suggest);
- return suggestions;
- }
-
-
-
public void addToFavoriteAlbums(Album album){
userAction.addFavoriteAlbum(album);
}
15 years, 2 months
JBoss Rich Faces SVN: r12609 - trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2009-02-10 07:13:58 -0500 (Tue, 10 Feb 2009)
New Revision: 12609
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxOutputPanelTest.java
Log:
refactored and fixed
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxOutputPanelTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxOutputPanelTest.java 2009-02-10 10:31:10 UTC (rev 12608)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/AjaxOutputPanelTest.java 2009-02-10 12:13:58 UTC (rev 12609)
@@ -17,7 +17,7 @@
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
+ */
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
@@ -57,251 +57,255 @@
private final static String RESULT_SUFFIX = "_result";
- public String getTestUrl() {
- return "pages/ajaxOutputPanel/ajaxOutputPanelTest.xhtml";
- }
+ private final static String RESET_METHOD = "#{a4jOutputPanelBean.reset}";
@Test
public void testLayoutAttribute(Template template) throws Exception {
- renderPage(template);
- // panel_1 has layout=inline(default)
- // panel_2 has layout=block
- // panel_3 has layout=none
- writeStatus("Testing layout attribute...");
+ renderPage(template, RESET_METHOD);
+ // panel_1 has layout=inline(default)
+ // panel_2 has layout=block
+ // panel_3 has layout=none
+ writeStatus("Testing layout attribute...");
- String panelId = getParentId() + FORM_ID + PANEL1_ID;
- String panel2Id = getParentId() + FORM_ID + PANEL2_ID;
- String panel3Id = getParentId() + FORM_ID + PANEL3_ID;
+ String panelId = getParentId() + FORM_ID + PANEL1_ID;
+ String panel2Id = getParentId() + FORM_ID + PANEL2_ID;
+ String panel3Id = getParentId() + FORM_ID + PANEL3_ID;
- Assert.assertTrue(isPresentById(panelId));
- Number type = selenium.getXpathCount("//*[@id='" + panelId + "' and (name()='span' or name()='SPAN')]");
- Assert.assertTrue(type.intValue() == 1, "panel_1 has layout=inline(default) and should be 'span' element");
+ Assert.assertTrue(isPresent(panelId));
+ Number type = selenium.getXpathCount("//*[@id='" + panelId + "' and (name()='span' or name()='SPAN')]");
+ Assert.assertTrue(type.intValue() == 1, "panel_1 has layout=inline(default) and should be 'span' element");
- Assert.assertTrue(isPresentById(panel2Id));
- type = selenium.getXpathCount("//*[@id='" + panel2Id + "' and (name()='DIV' or name()='div')]");
- Assert.assertTrue(type.intValue() == 1, "panel_2 has layout=block and should be 'div' element");
+ Assert.assertTrue(isPresent(panel2Id));
+ type = selenium.getXpathCount("//*[@id='" + panel2Id + "' and (name()='DIV' or name()='div')]");
+ Assert.assertTrue(type.intValue() == 1, "panel_2 has layout=block and should be 'div' element");
- // panel_3 has layout=none and should not present if a child component
- // is rendered
- Assert.assertFalse(isPresentById(panel3Id), "panel_3 has layout=none and should not peresent if a child component is rendered ");
+ // panel_3 has layout=none and should not present if a child component
+ // is rendered
+ Assert.assertFalse(isPresent(panel3Id),
+ "panel_3 has layout=none and should not peresent if a child component is rendered ");
- // remove child component rendering
- writeStatus("Click button 3");
- String buttonId = getParentId() + FORM_ID + BUTTON3_ID;
- clickById(buttonId);
- waitForAjaxCompletion();
+ // remove child component rendering
+ writeStatus("Click button 3");
+ String buttonId = getParentId() + FORM_ID + BUTTON3_ID;
+ clickById(buttonId);
+ waitForAjaxCompletion();
- // panel_3 has layout=none and should present if no child component is
- // rendered with id of a child component and display:none style
- Assert.assertTrue(isPresentById(panel3Id + "_text"), "panel_3 has layout=none and should peresent if no child component is rendered with id of a child component");
- Assert.assertFalse(isVisibleById(panel3Id + "_text"), "panel_3 has layout=none and should peresent if no child component is rendered with display:none style");
- clickReset();
+ // panel_3 has layout=none and should present if no child component is
+ // rendered with id of a child component and display:none style
+ Assert.assertTrue(isPresent(panel3Id + "_text"),
+ "panel_3 has layout=none and should peresent if no child component is rendered with id of a child component");
+ Assert.assertFalse(isVisible(panel3Id + "_text"),
+ "panel_3 has layout=none and should peresent if no child component is rendered with display:none style");
}
@Test
public void testRenderedAttribute(Template template) throws Exception {
- renderPage(template);
- writeStatus("Testing rendered attribute...");
+ renderPage(template, RESET_METHOD);
+ writeStatus("Testing rendered attribute...");
- String panelId = getParentId() + FORM_ID + PANEL4_ID;
+ String panelId = getParentId() + FORM_ID + PANEL4_ID;
- // panel_4 has rendered=true and should present on page
- AssertRendered(panelId);
+ // panel_4 has rendered=true and should present on page
+ AssertRendered(panelId);
- // change rendered attribute to false
- writeStatus("Click button 4");
- String buttonId = getParentId() + FORM_ID + BUTTON4_ID;
- clickCommandAndWait(buttonId);
+ // change rendered attribute to false
+ writeStatus("Click button 4");
+ String buttonId = getParentId() + FORM_ID + BUTTON4_ID;
+ clickCommandAndWait(buttonId);
- // panel_4 has rendered=false and should not present on page
- AssertNotRendered(panelId);
- clickReset();
+ // panel_4 has rendered=false and should not present on page
+ AssertNotRendered(panelId);
}
@Test
public void testAjaxRenderedAttribute(Template template) throws Exception {
- renderPage(template);
- // panel_1 has ajaxRendered=false and is reRender by b1
- // panel_2 has ajaxRendered=true
- writeStatus("Testing ajaxRendered attribute...");
+ renderPage(template, RESET_METHOD);
+ // panel_1 has ajaxRendered=false and is reRender by b1
+ // panel_2 has ajaxRendered=true
+ writeStatus("Testing ajaxRendered attribute...");
- String parentId = getParentId() + FORM_ID;
- String panelId = parentId + PANEL1_ID + TEXT_SUFFIX;
- String panelId2 = parentId + PANEL2_ID + TEXT_SUFFIX;
- String buttonId = parentId + BUTTON2_ID;
- writeStatus("Click button 2");
- // set panel_1 text visible flag to false
- clickById(buttonId);
- waitForAjaxCompletion();
- // panel_1 text should be visible as it reRendered only by b1
- Assert.assertTrue(isPresentById(panelId), "panel_1 text should be visible as it reRendered only by b1");
+ String parentId = getParentId() + FORM_ID;
+ String panelId = parentId + PANEL1_ID + TEXT_SUFFIX;
+ String panelId2 = parentId + PANEL2_ID + TEXT_SUFFIX;
+ String buttonId = parentId + BUTTON2_ID;
+ writeStatus("Click button 2");
+ // set panel_1 text visible flag to false
+ clickById(buttonId);
+ waitForAjaxCompletion();
+ // panel_1 text should be visible as it reRendered only by b1
+ AssertPresentAndVisible(panelId, "panel_1 text should be visible as it reRendered only by b1");
- // panel_2 text should not be visible as it has ajaxRendered=true
- Assert.assertFalse(isPresentById(panelId2), "panel_2 text should not be visible as it has ajaxRendered=true");
+ // panel_2 text should not be visible as it has ajaxRendered=true
+ AssertNotPresentOrNotVisible(panelId2, "panel_2 text should not be visible as it has ajaxRendered=true");
- buttonId = parentId + BUTTON1_ID;
- writeStatus("Click button 1");
- clickById(buttonId);
- waitForAjaxCompletion();
- // panel text should NOT be visible as it reRendered by b1
- Assert.assertFalse(isPresentById(panelId), "panel_1 text should not be visible as it reRendered by b1");
- clickReset();
-
+ buttonId = parentId + BUTTON1_ID;
+ writeStatus("Click button 1");
+ clickById(buttonId);
+ waitForAjaxCompletion();
+ // panel text should NOT be visible as it reRendered by b1
+ AssertNotPresentOrNotVisible(panelId, "panel_1 text should not be visible as it reRendered by b1");
}
@Test
public void testAjaxRenderedAttributeWithLimitToList(Template template) throws Exception {
- renderPage(template);
- // panel_1 has ajaxRendered=false and is reRender by b1 with
- // limitToList=true
- // panel_2 has ajaxRendered=true
- writeStatus("Testing ajaxRendered attribute with limitToList=true...");
+ renderPage(template, RESET_METHOD);
+ // panel_1 has ajaxRendered=false and is reRender by b1 with
+ // limitToList=true
+ // panel_2 has ajaxRendered=true
+ writeStatus("Testing ajaxRendered attribute with limitToList=true...");
- String parentId = getParentId() + FORM_ID;
- String panelId2 = parentId + PANEL2_ID + TEXT_SUFFIX;
- String buttonId = parentId + BUTTON1_ID;
- String button2Id = parentId + BUTTON2_ID;
+ String parentId = getParentId() + FORM_ID;
+ String panelId2 = parentId + PANEL2_ID + TEXT_SUFFIX;
+ String buttonId = parentId + BUTTON1_ID;
+ String button2Id = parentId + BUTTON2_ID;
- Assert.assertTrue(isPresentById(panelId2));
- writeStatus("Click button 1");
- // set panel_2 text visible flag to false
- clickById(buttonId);
- waitForAjaxCompletion();
- // panel_2 text should be visible as b1 has limitToList=true and
- // rerender only panel_1
- Assert.assertTrue(isPresentById(panelId2), "panel_2 text should be visible as b1 has limitToList=true and rerender only panel_1");
- writeStatus("Click button 2");
- clickById(button2Id);
- waitForAjaxCompletion();
- // panel_2 text should not be visible as it has ajaxRendered=true and b2
- // has limitToList=false
- Assert.assertFalse(isPresentById(panelId2), "panel_2 text should not be visible as it has ajaxRendered=true and b2 has limitToList=false");
- clickReset();
+ Assert.assertTrue(isPresent(panelId2));
+ writeStatus("Click button 1");
+ // set panel_2 text visible flag to false
+ clickById(buttonId);
+ waitForAjaxCompletion();
+ // panel_2 text should be visible as b1 has limitToList=true and
+ // rerender only panel_1
+ Assert.assertTrue(isPresent(panelId2),
+ "panel_2 text should be visible as b1 has limitToList=true and rerender only panel_1");
+ writeStatus("Click button 2");
+ clickById(button2Id);
+ waitForAjaxCompletion();
+ // panel_2 text should not be visible as it has ajaxRendered=true and b2
+ // has limitToList=false
+ Assert.assertFalse(isPresent(panelId2),
+ "panel_2 text should not be visible as it has ajaxRendered=true and b2 has limitToList=false");
}
@Test
public void testOnDoubleClickEvent(Template template) throws Exception {
- renderPage(template);
- String parentId = getParentId() + FORM_ID;
- String panelId = parentId + "panel_5";
- String panelResultId = panelId + RESULT_SUFFIX;
- writeStatus("Check ondoubleclick event");
- AssertTextEquals(panelResultId, "No");
- selenium.doubleClick(panelId);
- AssertTextEquals(panelResultId, "Yes");
+ renderPage(template);
+ String parentId = getParentId() + FORM_ID;
+ String panelId = parentId + "panel_5";
+ String panelResultId = panelId + RESULT_SUFFIX;
+ writeStatus("Check ondoubleclick event");
+ AssertTextEquals(panelResultId, "No");
+ selenium.doubleClick(panelId);
+ AssertTextEquals(panelResultId, "Yes");
}
@Test
public void testOnKeyDownEvent(Template template) throws Exception {
- renderPage(template);
- String parentId = getParentId() + FORM_ID;
- String panelId = parentId + "panel_6";
- String panelResultId = panelId + RESULT_SUFFIX;
- writeStatus("Check onkeydown event");
- AssertTextEquals(panelResultId, "No");
- selenium.keyDown(panelId, "1");
- AssertTextEquals(panelResultId, "Yes");
+ renderPage(template);
+ String parentId = getParentId() + FORM_ID;
+ String panelId = parentId + "panel_6";
+ String panelResultId = panelId + RESULT_SUFFIX;
+ writeStatus("Check onkeydown event");
+ AssertTextEquals(panelResultId, "No");
+ selenium.keyDown(panelId, "1");
+ AssertTextEquals(panelResultId, "Yes");
}
@Test
public void testOnKeyPressEvent(Template template) throws Exception {
- renderPage(template);
- String parentId = getParentId() + FORM_ID;
- String panelId = parentId + "panel_7";
- String panelResultId = panelId + RESULT_SUFFIX;
- writeStatus("Check onkeypress event");
- AssertTextEquals(panelResultId, "No");
- selenium.keyPress(panelId, "1");
- AssertTextEquals(panelResultId, "Yes");
+ renderPage(template);
+ String parentId = getParentId() + FORM_ID;
+ String panelId = parentId + "panel_7";
+ String panelResultId = panelId + RESULT_SUFFIX;
+ writeStatus("Check onkeypress event");
+ AssertTextEquals(panelResultId, "No");
+ selenium.keyPress(panelId, "1");
+ AssertTextEquals(panelResultId, "Yes");
}
@Test
public void testOnKeyUpEvent(Template template) throws Exception {
- renderPage(template);
- String parentId = getParentId() + FORM_ID;
- String panelId = parentId + "panel_8";
- String panelResultId = panelId + RESULT_SUFFIX;
- writeStatus("Check onkeyup event");
- AssertTextEquals(panelResultId, "No");
- selenium.keyUp(panelId, "1");
- AssertTextEquals(panelResultId, "Yes");
+ renderPage(template);
+ String parentId = getParentId() + FORM_ID;
+ String panelId = parentId + "panel_8";
+ String panelResultId = panelId + RESULT_SUFFIX;
+ writeStatus("Check onkeyup event");
+ AssertTextEquals(panelResultId, "No");
+ selenium.keyUp(panelId, "1");
+ AssertTextEquals(panelResultId, "Yes");
}
@Test
public void testOnMouseDownEvent(Template template) throws Exception {
- renderPage(template);
- String parentId = getParentId() + FORM_ID;
- String panelId = parentId + "panel_9";
- String panelResultId = panelId + RESULT_SUFFIX;
- writeStatus("Check onmousedown event");
- AssertTextEquals(panelResultId, "No");
- selenium.mouseDown(panelId);
- AssertTextEquals(panelResultId, "Yes");
+ renderPage(template);
+ String parentId = getParentId() + FORM_ID;
+ String panelId = parentId + "panel_9";
+ String panelResultId = panelId + RESULT_SUFFIX;
+ writeStatus("Check onmousedown event");
+ AssertTextEquals(panelResultId, "No");
+ selenium.mouseDown(panelId);
+ AssertTextEquals(panelResultId, "Yes");
}
@Test
public void testOnMouseMoveEvent(Template template) throws Exception {
- renderPage(template);
- String parentId = getParentId() + FORM_ID;
- String panelId = parentId + "panel_10";
- String panelResultId = panelId + RESULT_SUFFIX;
- writeStatus("Check onmousemove event");
- AssertTextEquals(panelResultId, "No");
- selenium.mouseMove(panelId);
- AssertTextEquals(panelResultId, "Yes");
+ renderPage(template);
+ String parentId = getParentId() + FORM_ID;
+ String panelId = parentId + "panel_10";
+ String panelResultId = panelId + RESULT_SUFFIX;
+ writeStatus("Check onmousemove event");
+ AssertTextEquals(panelResultId, "No");
+ selenium.mouseMove(panelId);
+ AssertTextEquals(panelResultId, "Yes");
}
@Test
public void testOnMouseOutEvent(Template template) throws Exception {
- renderPage(template);
- String parentId = getParentId() + FORM_ID;
- String panelId = parentId + "panel_11";
- String panelResultId = panelId + RESULT_SUFFIX;
- writeStatus("Check onmouseout event");
- AssertTextEquals(panelResultId, "No");
- selenium.mouseOut(panelId);
- AssertTextEquals(panelResultId, "Yes");
+ renderPage(template);
+ String parentId = getParentId() + FORM_ID;
+ String panelId = parentId + "panel_11";
+ String panelResultId = panelId + RESULT_SUFFIX;
+ writeStatus("Check onmouseout event");
+ AssertTextEquals(panelResultId, "No");
+ selenium.mouseOut(panelId);
+ AssertTextEquals(panelResultId, "Yes");
}
@Test
public void testOnMouseOverEvent(Template template) throws Exception {
- renderPage(template);
- String parentId = getParentId() + FORM_ID;
- String panelId = parentId + "panel_12";
- String panelResultId = panelId + RESULT_SUFFIX;
- writeStatus("Check onmouseover event");
- AssertTextEquals(panelResultId, "No");
- selenium.mouseOver(panelId);
- AssertTextEquals(panelResultId, "Yes");
+ renderPage(template);
+ String parentId = getParentId() + FORM_ID;
+ String panelId = parentId + "panel_12";
+ String panelResultId = panelId + RESULT_SUFFIX;
+ writeStatus("Check onmouseover event");
+ AssertTextEquals(panelResultId, "No");
+ selenium.mouseOver(panelId);
+ AssertTextEquals(panelResultId, "Yes");
}
@Test
public void testOnMouseUpEvent(Template template) throws Exception {
- renderPage(template);
- String parentId = getParentId() + FORM_ID;
- String panelId = parentId + "panel_13";
- String panelResultId = panelId + RESULT_SUFFIX;
- writeStatus("Check onmouseup event");
- AssertTextEquals(panelResultId, "No");
- selenium.mouseUp(panelId);
- AssertTextEquals(panelResultId, "Yes");
+ renderPage(template);
+ String parentId = getParentId() + FORM_ID;
+ String panelId = parentId + "panel_13";
+ String panelResultId = panelId + RESULT_SUFFIX;
+ writeStatus("Check onmouseup event");
+ AssertTextEquals(panelResultId, "No");
+ selenium.mouseUp(panelId);
+ AssertTextEquals(panelResultId, "Yes");
}
@Test
public void testOnClickEvent(Template template) throws Exception {
- renderPage(template);
- String parentId = getParentId() + FORM_ID;
- String panelId = parentId + "panel_14";
- String panelResultId = panelId + RESULT_SUFFIX;
- writeStatus("Check onclick event");
- AssertTextEquals(panelResultId, "No");
- selenium.click(panelId);
- AssertTextEquals(panelResultId, "Yes");
+ renderPage(template);
+ String parentId = getParentId() + FORM_ID;
+ String panelId = parentId + "panel_14";
+ String panelResultId = panelId + RESULT_SUFFIX;
+ writeStatus("Check onclick event");
+ AssertTextEquals(panelResultId, "No");
+ selenium.click(panelId);
+ AssertTextEquals(panelResultId, "Yes");
}
private void clickReset() {
- String buttonId = getParentId() + FORM_ID + RESET_BUTTON_ID;
- writeStatus("Click reset button");
- clickCommandAndWait(buttonId);
+ String buttonId = getParentId() + FORM_ID + RESET_BUTTON_ID;
+ writeStatus("Click reset button");
+ clickCommandAndWait(buttonId);
}
+
+ @Override
+ public String getTestUrl() {
+ return "pages/ajaxOutputPanel/ajaxOutputPanelTest.xhtml";
+ }
+
}
15 years, 2 months
JBoss Rich Faces SVN: r12608 - in trunk/test-applications/seleniumTest/richfaces/src: test/java/org/richfaces and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: andrei_exadel
Date: 2009-02-10 05:31:10 -0500 (Tue, 10 Feb 2009)
New Revision: 12608
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dropDownMenu/dropDownMenuAutoTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DropDownMenuTest.java
Log:
RF-5823, RF-5821
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dropDownMenu/dropDownMenuAutoTest.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dropDownMenu/dropDownMenuAutoTest.xhtml 2009-02-10 10:22:09 UTC (rev 12607)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dropDownMenu/dropDownMenuAutoTest.xhtml 2009-02-10 10:31:10 UTC (rev 12608)
@@ -11,8 +11,17 @@
<rich:dropDownMenu id="componentId"
rendered="#{autoTestBean.rendered}"
value="test"
+ style="color: red"
+ styleClass="dropDownMenuClass"
+ oncollapse="EventQueue.fire('ddmenuOncollapse')"
+ onexpand="EventQueue.fire('ddmenuOnexpand')"
+ ongroupactivate="EventQueue.fire('ddmenuOngroupactivate')"
+ onitemselect="EventQueue.fire('ddmenuOnitemselect')"
+ onmousemove="EventQueue.fire('ddmenuOnmousemove')"
+ onmouseout="EventQueue.fire('ddmenuOnmouseout')"
+ onmouseover="EventQueue.fire('ddmenuOnmouseover')"
>
- <rich:menuItem id="new"
+ <rich:menuItem id="new"
submitMode="ajax"
immediate="#{autoTestBean.immediate}"
ajaxSingle="#{autoTestBean.ajaxSingle}"
@@ -27,6 +36,30 @@
<h:inputText id="inputRequired" value="#{ddmenuBean.input}" style="display: none" required="true"></h:inputText>
<f:param name="parameter1" value="value1" />
</rich:menuItem>
+ <rich:menuGroup id="group1" value="group"
+ style="color: green"
+ styleClass="menuGroupClass"
+ selectClass="menuGroupSelectClass"
+ selectStyle="color: blue;"
+ onclose="EventQueue.fire('ddmenuGroupOnclose')"
+ onmousemove="EventQueue.fire('ddmenuGroupOnmousemove')"
+ onmouseout="EventQueue.fire('ddmenuGroupOnmouseout')"
+ onmouseover="EventQueue.fire('ddmenuGroupOnmouseover')"
+ onopen="EventQueue.fire('ddmenuGroupOnopen')">
+ <rich:menuItem value="Item1" id="item1"
+ style="color: black"
+ styleClass="menuItemClass"
+ onclick="EventQueue.fire('onclick')"
+ onmousedown="EventQueue.fire('onmousedown')"
+ onmousemove="EventQueue.fire('onmousemove')"
+ onmouseout="EventQueue.fire('onmouseout')"
+ onmouseover="EventQueue.fire('onmouseover')"
+ onmouseup="EventQueue.fire('onmouseup')"
+ onselect="EventQueue.fire('onselect')"
+ submitMode="none">
+ <h:commandLink id="submit1" value="Submit" actionListener="#{autoTestBean.actionListener}"></h:commandLink>
+ </rich:menuItem>
+ </rich:menuGroup>
</rich:dropDownMenu>
</ui:define>
</ui:composition>
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2009-02-10 10:22:09 UTC (rev 12607)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2009-02-10 10:31:10 UTC (rev 12608)
@@ -1324,6 +1324,13 @@
}
}
+ public void assertEvent(String eventExpected, String m) {
+ String message = runScript("EventQueue.assertEvent('"+eventExpected+"')");
+ if (null != message && message.length() > 0) {
+ Assert.fail(m + message);
+ }
+ }
+
public Object assertEvents(String locator, List<SeleniumEvent> eventsExpected) {
for (SeleniumEvent ev : eventsExpected) {
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DropDownMenuTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DropDownMenuTest.java 2009-02-10 10:22:09 UTC (rev 12607)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DropDownMenuTest.java 2009-02-10 10:31:10 UTC (rev 12608)
@@ -43,7 +43,85 @@
params.put("parameter1", "value1");
}
+
@Test
+ public void testCommonHiperLink(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, RESET_METHOD);
+
+ String submit = tester.getClientId("submit1");
+ selenium.click(submit);
+ waitForPageToLoad();
+
+ tester.checkActionListener(true);
+
+ }
+
+ @Test
+ public void testClassStylesAndHtmlAttributes(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, RESET_METHOD);
+
+ String ddMenuId = tester.getClientId(AutoTester.COMPONENT_ID);
+ String ddMenuGroup = tester.getClientId("group1");
+ String ddMenuItem = tester.getClientId("item1");
+ String ddMenuIdPath = "//div[@id='" + ddMenuId + "']/div[1]";
+
+ assertClassNames(ddMenuId, new String [] {"dr-menu-label", "rich-ddmenu-label", "dr-menu-label-unselect", "rich-ddmenu-label-unselect"}, "Drop down menu has unexpected css classes", true);
+ assertClassNames(ddMenuId, new String[] {"dropDownMenuClass"}, "Class attribute does not work for DropDown menu component", true);
+ assertClassNames(ddMenuGroup, new String [] {"dr-menu-item", "dr-menu-item-enabled", "rich-menu-group"}, "Menu group has unexpected css classes", true);
+ assertClassNames(ddMenuGroup, new String[] {"menuGroupClass"}, "Class attribute does not work for Menu group component", true);
+ assertClassNames(ddMenuItem, new String [] {"dr-menu-item", "dr-menu-item-enabled", "rich-menu-item"}, "Menu item has unexpected css classes", true);
+ assertClassNames(ddMenuItem, new String[] {"menuItemClass"}, "Class attribute does not work for Menu item component", true);
+
+ assertStyleAttribute(ddMenuId, "color: red", "Style attribute for Drop down menu does not work");
+ assertStyleAttribute(ddMenuGroup, "color: green", "Style attribute for Menu droup component does not work");
+ assertStyleAttribute(ddMenuItem, "color: black", "Style attribute for Menu item component does not work");
+
+ selenium.mouseOver(ddMenuIdPath);
+ waiteForCondition(getElementById(ddMenuId + "_menu") + ".style.display != 'none'", 5000);
+ selenium.mouseOver(ddMenuGroup);
+ waiteForCondition(getElementById(ddMenuGroup + "_menu") + ".style.display != 'none'", 5000);
+ selenium.mouseOver(ddMenuId);
+
+ assertClassNames(ddMenuGroup, new String[] {"menuGroupSelectClass"}, "selectClass attribute does not work for Menu group component", true);
+ assertEvent("ddmenuOnmouseover", "Onmouseover attribute does not work for DropDown menu component");
+ assertEvent("ddmenuOnexpand", "Onexpand attribute does not work for DropDown menu component");
+ assertEvent("ddmenuOngroupactivate", "Ongroupactivate attribute does not work for DropDown menu component");
+ assertEvent("ddmenuGroupOnmouseover", "Onmouseover attribute does not work for Menu group component");
+ assertEvent("ddmenuGroupOnopen", "Onopen attribute does not work for Menu group component");
+
+ selenium.mouseMove(ddMenuId);
+ selenium.mouseOut(ddMenuId);
+ assertEvent("ddmenuOnmousemove", "onmousemove does not work for Drop down menu");
+ assertEvent("ddmenuOnmouseout", "onmouseout does not work for Drop down menu");
+
+ selenium.mouseMove(ddMenuGroup);
+ selenium.mouseOut(ddMenuGroup);
+ assertEvent("ddmenuGroupOnmousemove", "onmousemove does not work for Group menu");
+ assertEvent("ddmenuGroupOnmouseout", "onmouseout does not work for Group menu");
+
+ selenium.mouseMove(ddMenuItem);
+ selenium.mouseOut(ddMenuItem);
+ selenium.mouseDown(ddMenuItem);
+ selenium.mouseUp(ddMenuItem);
+ selenium.click(ddMenuItem);
+ assertEvent("onmousedown", "onmousedown attribute does not work for Menu item component");
+ assertEvent("onmousemove", "onmousemove attribute does not work for Menu item component");
+ assertEvent("onmouseout", "onmouseout attribute does not work for Menu item component");
+ assertEvent("onmouseup", "onmouseup attribute does not work for Menu item component");
+ assertEvent("onclick", "onclick attribute does not work for Menu item component");
+
+ assertEvent("ddmenuOnitemselect", "Onitemselect attribute does not work for DropDown menu component");
+
+ selenium.click("//body");
+ waiteForCondition(getElementById(ddMenuId + "_menu") + ".style.display == 'none'", 5000);
+ assertEvent("ddmenuOncollapse", "oncollapse attribute does not work for DrownDownMenu component");
+ assertEvent("ddmenuGroupOnclose", "onclose attribute does not work for Menu group component");
+
+ }
+
+ @Test
public void testOnComplete(Template template) {
AutoTester tester = getAutoTester(this);
tester.renderPage(template, RESET_METHOD);
15 years, 2 months
JBoss Rich Faces SVN: r12607 - 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-02-10 05:22:09 -0500 (Tue, 10 Feb 2009)
New Revision: 12607
Added:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataFilterSlider/dataFilterSliderAutoTest.xhtml
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataFilterSlider/dataFilterSliderTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataFilterSliderTest.java
Log:
RF-5979,RF-5980,RF-5981,RF-5982,RF-5983,RF-5984
Added: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataFilterSlider/dataFilterSliderAutoTest.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataFilterSlider/dataFilterSliderAutoTest.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/dataFilterSlider/dataFilterSliderTest.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataFilterSliderTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataFilterSliderTest.java 2009-02-09 22:53:03 UTC (rev 12606)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/DataFilterSliderTest.java 2009-02-10 10:22:09 UTC (rev 12607)
@@ -21,12 +21,13 @@
package org.richfaces.testng;
import org.ajax4jsf.template.Template;
+import org.richfaces.AutoTester;
import org.richfaces.SeleniumTestBase;
import org.testng.annotations.Test;
public class DataFilterSliderTest extends SeleniumTestBase {
- private static final String DATA_FLT_SLIDER_ID = "dataFilterSlider";
+ private static final String DATA_FLT_SLIDER_ID = "componentId";
private static final String DATA_FLT_SLIDER_INPUT = DATA_FLT_SLIDER_ID + "slider_val";
@@ -42,11 +43,15 @@
private static final int PLANETS_SMALLER_1 = 6;
+ private static final String RESET_METHOD = "#{dataFilterSliderBean.reset}";
+
+ private static final String FORM_ID = "autoTestForm:";
+
@Test
public void testDataFilterSliderComponent(Template template) {
renderPage(template);
- String parentId = getParentId() + "_form:";
+ String parentId = getParentId() + FORM_ID;
String tableId = parentId + TABLE;
writeStatus("Check component core functionality");
@@ -73,7 +78,7 @@
public void testDataFilterSliderComponentManualInput(Template template) {
renderPage(template);
- String parentId = getParentId() + "_form:";
+ String parentId = getParentId() + FORM_ID;
String tableId = parentId + TABLE;
String inputId = parentId + DATA_FLT_SLIDER_INPUT;
@@ -99,8 +104,56 @@
assertRowsCount(PLANETS_SMALLER_3, tableId);
}
+ @Test
+ public void testRenderedAttribute(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, RESET_METHOD);
+ writeStatus("Test component with rendered = false is not present on the page");
+ tester.testRendered();
+ }
+
+ @Test
+ public void testImmediate(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, RESET_METHOD);
+ writeStatus("Test immediate attribute");
+ tester.testImmediate();
+ }
+
+ @Test
+ public void testImmediateWithExternalValidationFailed(Template template) {
+ AutoTester tester = getAutoTester(this);
+ tester.renderPage(template, RESET_METHOD);
+ writeStatus("Test immediate attribute with external validation failed");
+ tester.testImmediateWithExternalValidationFailed();
+ }
+
+ @Test
+ public void testAjaxSingle(Template template) {
+ AutoTester autoTester = getAutoTester(this);
+ autoTester.renderPage(template, RESET_METHOD);
+ writeStatus("Test ajaxSingle attribute in case of external validation failure");
+ autoTester.testAjaxSingle();
+ }
+
+ @Test
+ public void testAjaxSingleWithExternalAndProcessedComponentsValidationFailures(Template template) {
+ AutoTester autoTester = getAutoTester(this);
+ autoTester.renderPage(template, RESET_METHOD);
+ writeStatus("Test ajaxSingle attribute in case of validation failures of both external and processed components");
+ autoTester.testAjaxSingleWithProcesExternalValidation(true);
+ }
+
+ @Test
+ public void testWithExternalValidationFailure(Template template) {
+ AutoTester autoTester = getAutoTester(this);
+ autoTester.renderPage(template, RESET_METHOD);
+ writeStatus("Check component in case of external validation failure: listeners are not invoked, model is not updated");
+ autoTester.testExtrenalValidationFailure();
+ }
+
private void clickSlider(int position) {
- String trackId = getParentId() + "_form:" + DATA_FLT_SLIDER_TRACK;
+ String trackId = getParentId() + FORM_ID + DATA_FLT_SLIDER_TRACK;
int w = selenium.getElementWidth(trackId).intValue();
double step = w / 40.;
int pos = (int) (position * step + 1 + (isFF() ? step : 0));
@@ -111,8 +164,18 @@
}
@Override
+ public void sendAjax() {
+ clickSlider(3);
+ }
+
+ @Override
public String getTestUrl() {
return "pages/dataFilterSlider/dataFilterSliderTest.xhtml";
}
+ @Override
+ public String getAutoTestUrl() {
+ return "pages/dataFilterSlider/dataFilterSliderAutoTest.xhtml";
+ }
+
}
15 years, 2 months
JBoss Rich Faces SVN: r12606 - trunk/ui/toolBar/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-02-09 17:53:03 -0500 (Mon, 09 Feb 2009)
New Revision: 12606
Modified:
trunk/ui/toolBar/src/main/java/org/richfaces/renderkit/html/ToolBarGroupRenderer.java
trunk/ui/toolBar/src/main/java/org/richfaces/renderkit/html/ToolBarRendererBase.java
Log:
Failed build fixed
Modified: trunk/ui/toolBar/src/main/java/org/richfaces/renderkit/html/ToolBarGroupRenderer.java
===================================================================
--- trunk/ui/toolBar/src/main/java/org/richfaces/renderkit/html/ToolBarGroupRenderer.java 2009-02-09 16:12:08 UTC (rev 12605)
+++ trunk/ui/toolBar/src/main/java/org/richfaces/renderkit/html/ToolBarGroupRenderer.java 2009-02-09 22:53:03 UTC (rev 12606)
@@ -33,7 +33,7 @@
public class ToolBarGroupRenderer extends ToolBarRendererBase {
- protected Class<?> getComponentClass() {
+ protected Class<? extends javax.faces.component.UIComponent> getComponentClass() {
return UIToolBarGroup.class;
}
Modified: trunk/ui/toolBar/src/main/java/org/richfaces/renderkit/html/ToolBarRendererBase.java
===================================================================
--- trunk/ui/toolBar/src/main/java/org/richfaces/renderkit/html/ToolBarRendererBase.java 2009-02-09 16:12:08 UTC (rev 12605)
+++ trunk/ui/toolBar/src/main/java/org/richfaces/renderkit/html/ToolBarRendererBase.java 2009-02-09 22:53:03 UTC (rev 12606)
@@ -184,7 +184,7 @@
}
}
- protected Class getComponentClass() {
+ protected Class<? extends javax.faces.component.UIComponent> getComponentClass() {
return UIToolBar.class;
}
15 years, 2 months
JBoss Rich Faces SVN: r12605 - trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2009-02-09 11:12:08 -0500 (Mon, 09 Feb 2009)
New Revision: 12605
Modified:
trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
Log:
https://jira.jboss.org/jira/browse/RF-6027
Modified: trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
===================================================================
--- trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2009-02-09 14:57:44 UTC (rev 12604)
+++ trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2009-02-09 16:12:08 UTC (rev 12605)
@@ -201,6 +201,12 @@
},
destroy: function() {
+
+ if( this.shown && this.options.autosized && this.observerSize)
+ {
+ window.clearInterval(this.observerSize);
+ }
+
this._contentElement = null;
this._sizedElement = null;
@@ -793,6 +799,7 @@
if (this.options.autosized) {
window.clearInterval(this.observerSize);
+ this.observerSize = null;
}
if (ModalPanel.activePanels.length > 0) {
@@ -974,6 +981,7 @@
correctShadowSize: function(event) {
this.correctShadowSizeEx();
+ this.observerSize = null;
},
correctShadowSizeEx: function() {
15 years, 2 months
JBoss Rich Faces SVN: r12604 - trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2009-02-09 09:57:44 -0500 (Mon, 09 Feb 2009)
New Revision: 12604
Modified:
trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
Log:
https://jira.jboss.org/jira/browse/RF-6079
Modified: trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
===================================================================
--- trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2009-02-09 14:40:57 UTC (rev 12603)
+++ trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2009-02-09 14:57:44 UTC (rev 12604)
@@ -1094,3 +1094,10 @@
}
panel.component.hide(event, opts);
};
+
+Richfaces.hideTopModalPanel = function(event, opts) {
+ var mp = ModalPanel.activePanels.last();
+ if (mp) {
+ mp.hide(event, opts);
+ }
+}
15 years, 2 months