JBoss Rich Faces SVN: r13446 - management/design/realWorldDemo/html/images/shell.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-04-08 14:13:29 -0400 (Wed, 08 Apr 2009)
New Revision: 13446
Added:
management/design/realWorldDemo/html/images/shell/button_press_1.png
Log:
Pressed button image corrected
Added: management/design/realWorldDemo/html/images/shell/button_press_1.png
===================================================================
(Binary files differ)
Property changes on: management/design/realWorldDemo/html/images/shell/button_press_1.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
15 years, 1 month
JBoss Rich Faces SVN: r13445 - trunk/test-applications/realworld2/web/src/main/webapp/includes/index.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2009-04-08 13:54:22 -0400 (Wed, 08 Apr 2009)
New Revision: 13445
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/includes/index/header.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/index/login.xhtml
Log:
fix modal panel appearing
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/index/header.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/index/login.xhtml
===================================================================
(Binary files differ)
15 years, 1 month
JBoss Rich Faces SVN: r13444 - in trunk/test-applications/realworld2/web/src/main: java/org/richfaces/realworld/ui and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2009-04-08 13:04:31 -0400 (Wed, 08 Apr 2009)
New Revision: 13444
Modified:
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/FileManager.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/FileUploadManager.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Model.java
trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/FileWrapper.java
trunk/test-applications/realworld2/web/src/main/webapp/includes/fileUpload/fileUploader.xhtml
trunk/test-applications/realworld2/web/src/main/webapp/includes/fileUpload/uploadResult.xhtml
Log:
Enhance fileUpload
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/FileManager.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/FileManager.java 2009-04-08 16:43:26 UTC (rev 13443)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/FileManager.java 2009-04-08 17:04:31 UTC (rev 13444)
@@ -223,6 +223,9 @@
if(!writeFile(fileName, tempFilePath, Constants._MEDIUM, Constants.MEDIUM_SIZE, true)){
return false;
}
+ if(!writeOriginalFile(fileName, tempFilePath, true)){
+ return false;
+ }
return true;
}
@@ -317,6 +320,25 @@
return ret;
}
+ public boolean writeOriginalFile(String newFileName, String fileName,
+ boolean includeUploadRoot){
+ BufferedImage bsrc = null;
+ try {
+ bsrc = bitmapToImage(fileName, Constants.JPG);
+ } catch (IOException e1) {
+ return false;
+ }
+ BufferedImage bdest = getScaledInstance(bsrc, bsrc.getWidth(), bsrc.getHeight(),
+ RenderingHints.VALUE_INTERPOLATION_BICUBIC, true);
+ String dest = includeUploadRoot ? this.uploadRootPath
+ + newFileName : newFileName;
+ try {
+ imageToBitmap(bdest, dest, Constants.JPG);
+ } catch (IOException ex) {
+ return false;
+ }
+ return true;
+ }
@Restrict("#{s:hasRole('admin')}")
public boolean writeFile(String newFileName, String fileName,
String pattern, int size, boolean includeUploadRoot) {
@@ -333,6 +355,11 @@
int width = yy.intValue();
yy = ((Double) d * bsrc.getHeight());
int height = yy.intValue();
+ //Too small picture
+ if(width > bsrc.getWidth() || height > bsrc.getHeight()){
+ width = bsrc.getWidth();
+ height = bsrc.getHeight();
+ }
BufferedImage bdest = getScaledInstance(bsrc, width, height,
RenderingHints.VALUE_INTERPOLATION_BICUBIC, true);
String dest = includeUploadRoot ? this.uploadRootPath
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/FileUploadManager.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/FileUploadManager.java 2009-04-08 16:43:26 UTC (rev 13443)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/FileUploadManager.java 2009-04-08 17:04:31 UTC (rev 13444)
@@ -74,19 +74,18 @@
try {
extractMetadata(item, image);
} catch (Exception e1) {
- Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, Constants.FILE_PROCESSING_ERROR);
+ addError(item, image);
return;
}
image.setAlbum(model.getSelectedAlbum());
if(model.getSelectedAlbum() == null){
- Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, Constants.NO_ALBUM_TO_DOWNLOAD_ERROR);
+ addError(item, image);
return;
}
String newPath = Constants.SLASH + model.getSelectedAlbum().getOwner().getLogin() + Constants.SLASH + model.getSelectedAlbum().getId() + Constants.SLASH +item.getFileName();
image.setPath(newPath);
if(!fileManager.addImage(newPath, item.getFile().getPath())){
- Events.instance().raiseEvent(Constants.ADD_ERROR_EVENT, Constants.FILE_SAVE_ERROR);
- item.getFile().delete();
+ addError(item, image);
return;
}
fileWrapper.getFiles().add(image);
@@ -95,6 +94,11 @@
item.getFile().delete();
}
+ private void addError(UploadItem item, Image image) {
+ fileWrapper.getErrorFiles().add(image);
+ item.getFile().delete();
+ }
+
private Image constructImage(UploadItem item) {
Image image = new Image();
image.setUploaded(new Date());
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Model.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Model.java 2009-04-08 16:43:26 UTC (rev 13443)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/manager/Model.java 2009-04-08 17:04:31 UTC (rev 13444)
@@ -38,11 +38,11 @@
private List<Image> images;
public void resetModel(NavigationEnum mainArea, User selectedUser, Shelf selectedShelf, Album selectedAlbum, Image selectedImage, List<Image> images){
- this.setMainArea(mainArea);
this.setSelectedAlbum(selectedAlbum);
this.setSelectedImage(selectedImage);
this.setSelectedShelf(selectedShelf);
this.setSelectedUser(selectedUser);
+ this.setMainArea(mainArea);
this.images = images;
}
Modified: trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/FileWrapper.java
===================================================================
--- trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/FileWrapper.java 2009-04-08 16:43:26 UTC (rev 13443)
+++ trunk/test-applications/realworld2/web/src/main/java/org/richfaces/realworld/ui/FileWrapper.java 2009-04-08 17:04:31 UTC (rev 13444)
@@ -39,8 +39,23 @@
private static final long serialVersionUID = -1767281809514660171L;
+ private boolean complete = false;
+
private List<Image> files = new ArrayList<Image>();
+ private List<Image> errorFiles = new ArrayList<Image>();
+
+ public String getErrorNames(){
+ StringBuilder s = new StringBuilder();
+ for(int i = 0; i < errorFiles.size(); i++){
+ Image im = errorFiles.get(i);
+ s.append(im.getName());
+ if(!(i == errorFiles.size() - 1)){
+ s.append(" ,");
+ }
+ }
+ return s.toString();
+ }
public int getSize() {
return getFiles().size();
}
@@ -61,5 +76,23 @@
@Observer(Constants.CLEAR_FILE_UPLOAD_EVENT)
public void clear(){
files.clear();
+ errorFiles.clear();
+ complete = false;
}
+
+ public boolean isComplete() {
+ return complete;
+ }
+
+ public void setComplete(boolean complete) {
+ this.complete = complete;
+ }
+
+ public List<Image> getErrorFiles() {
+ return errorFiles;
+ }
+
+ public void setErrorFiles(List<Image> errorFiles) {
+ this.errorFiles = errorFiles;
+ }
}
\ No newline at end of file
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/fileUpload/fileUploader.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/realworld2/web/src/main/webapp/includes/fileUpload/uploadResult.xhtml
===================================================================
(Binary files differ)
15 years, 1 month
JBoss Rich Faces SVN: r13443 - trunk/docs.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2009-04-08 12:43:26 -0400 (Wed, 08 Apr 2009)
New Revision: 13443
Added:
trunk/docs/release.sh
Log:
https://jira.jboss.org/jira/browse/RF-6698 - script for release build was added
Added: trunk/docs/release.sh
===================================================================
--- trunk/docs/release.sh (rev 0)
+++ trunk/docs/release.sh 2009-04-08 16:43:26 UTC (rev 13443)
@@ -0,0 +1,125 @@
+#!/bin/bash
+# This script is used for the release build
+# Author Gleb Galkin
+
+#REQUIREMENTS:
+# If you use cygwin, please, check whether 'cpio' package is installed
+
+#Here you should define necessary variables:
+# 1. define the absolute path to the 'trunk' directory in the TRUNK variable
+# 2. define the absolute path to the 'freezone/doc' directory in the FREEZONE variable
+#3. define path and name of the log file in the LOG variable
+#4. define user name for commit in the USER variable
+#5. define password for commit in the PASS variable
+#6. define message for commit in the MESSAGE variable
+
+# If you run this script for the first time you could check all the pathes in the DOC array if it is really needed. In order to check them take the following steps:
+# 1. run the following command from the trunk root: mvn clean install -P release,docs,release_docs -Dmaven.test.skip=true
+# 2. proceed to the $TRUNK/ui/assembly/target directory and check all pathes that have been defined in the DOC array, SRC field. If some of them have been changed rewrite them manually
+# 3. finnally proceed to the $FREEZONE directory and and check all pathes that have been defined in the DOC array, TARGET field. If some of them have been changed rewrite them manually
+
+TRUNK="D:/workspaceRF/trunk"
+FREEZONE="D:/workspaceRF/online/freezone/docs"
+LOG="log_release.txt"
+USER="smukhina"
+PASS=""
+MESSAGE=""
+
+DOCS=(
+ [0]="SRC=$TRUNK/ui/assembly/target/apidocs TARGET=$FREEZONE/apidoc"
+ [1]="SRC=$TRUNK/ui/assembly/target/tlddoc TARGET=$FREEZONE/tlddoc"
+ [2]="SRC=$TRUNK/framework/api/target/site/apidocs TARGET=$FREEZONE/apidoc_framework"
+ [3]="SRC=$TRUNK/ui/assembly/target/docs/migration/en TARGET=$FREEZONE/migrationguide/en"
+ [4]="SRC=$TRUNK/ui/assembly/target/docs/cdkguide/en/ TARGET=$FREEZONE/cdkguide/en"
+ [5]="SRC=$TRUNK/ui/assembly/target/docs/faq/en/html_single TARGET=$FREEZONE/devguide/en/faq"
+ [6]="SRC=$TRUNK/ui/assembly/target/docs/userguide/en/html TARGET=$FREEZONE/devguide/en/html"
+ [7]="SRC=$TRUNK/ui/assembly/target/docs/userguide/en/html_single TARGET=$FREEZONE/devguide/en/html_single"
+ [8]="SRC=$TRUNK/ui/assembly/target/docs/userguide/en/pdf TARGET=$FREEZONE/devguide/en/pdf"
+)
+
+function die(){
+ printLog "$@"
+ exit 1
+}
+
+function cleanAndCopy () {
+ for (( i=0;i<${#DOCS[@]};i++)); do
+ doc="DOCS[i]"
+ local ${!doc}
+ cd $TARGET
+ printLog "Deleting old files"
+ find -name .svn -prune -o \( -name \* -type f -print0 \)| xargs -0 /bin/rm -f || die "Something wrong with deleting old files. Please, see the log";
+ cd $SRC
+ printLog "Copying new files"
+ find -name .svn -prune -o \( -name \* -print0 \) | cpio -pmd0 $TARGET >> $LOG 2>&1 || die "Something wrong with copying. Please, see the log";
+ done
+}
+
+function delAddCi(){
+ for (( i=0;i<${#DOCS[@]};i++)); do
+ doc="DOCS[i]"
+ local ${!doc}
+ cd $TARGET
+ #Try to add new files
+ printLog "Try to add new files..."
+ svn status | grep '^\?' | grep -o -P [^\?^" ""\n\r?"]+ | while read -r;do svn add $REPLY >> $LOG 2>&1; done || die "Something wrong with svn add. See the log file"
+
+ #Try to delete missing files
+ printLog "Try to delete unnecessary files..."
+ svn status | grep '^\!' | grep -o -P [^\!^" ""\n\r?"]+ | while read -r;do svn rm $REPLY >> $LOG 2>&1; done || die "Something wrong with svn remove. See the log file"
+
+ printLog "Try to commit files..."
+ #svn commit --username $USER --password $PASS --message $MESSAGE >> $LOG 2>&1 || die "Something wrong with svn commit. See the log file"
+ done
+}
+
+function printLog () {
+ echo "$@"
+ echo "/*-------------------------------------------------*/" >> $LOG
+ echo >> $LOG
+ echo "$@" >> $LOG
+ echo >> $LOG
+ echo "/*-------------------------------------------------*/" >> $LOG
+ echo >> $LOG
+}
+
+if [ $TRUNK="" -o $FREEZONE="" -o $LOG="" -o $USER="" -o $PASS="" -o $MESSAGE="" ]
+then
+ echo "Please, specify necessary variables. See the header of this script"
+ exit 1
+fi
+
+#Remove old log
+if [ -e $LOG ]
+then
+ rm $LOG
+fi
+
+#Update the FREEZONE
+cd $FREEZONE
+printLog "Svn update $FREEZONE is in progress..."
+svn up >> $LOG 2>&1 || printLog "Svn cleanup $FREEZONE will be performed and then I will try to update again."; svn cleanup; svn up >> $LOG 2>&1 || die "Something wrong with svn update in "$FREEZONE
+
+#Update the trunk
+cd $TRUNK
+printLog "Svn update $TRUNK is in progress..."
+svn up >> $LOG 2>&1 || printLog "Svn cleanup $TRUNK will be performed and then I will try to update again."; svn cleanup; svn up >> $LOG 2>&1 || die "Something wrong with svn update in "$TRUNK
+
+#Docs, TLD and API docs
+printLog "Docs, TLD and API building is in progress..."
+mvn clean install -P release,docs,release_docs -Dmaven.test.skip=true >> $LOG 2>&1 || die "Something wrong with building trunk. Please, see the maven log"
+
+# Framework API building
+cd $TRUNK/framework/api
+printLog "Framework API building is in progress..."
+mvn javadoc:javadoc >> $LOG 2>&1 || die "Something wrong with building API docs. Please, see the maven log"
+
+#Copying all docs
+printLog "Copying all docs..."
+cleanAndCopy;
+
+cd $FREEZONE/devguide/en/pdf
+printLog "Renaming richfaces_reference.pdf to richfaces-usersguide.pdf"
+mv richfaces_reference.pdf richfaces-usersguide.pdf
+
+delAddCi;
15 years, 1 month
JBoss Rich Faces SVN: r13442 - trunk/ui/colorPicker/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2009-04-08 12:15:47 -0400 (Wed, 08 Apr 2009)
New Revision: 13442
Modified:
trunk/ui/colorPicker/src/main/resources/org/richfaces/renderkit/html/scripts/ui.colorpicker.js
Log:
https://jira.jboss.org/jira/browse/RF-6685
Modified: trunk/ui/colorPicker/src/main/resources/org/richfaces/renderkit/html/scripts/ui.colorpicker.js
===================================================================
--- trunk/ui/colorPicker/src/main/resources/org/richfaces/renderkit/html/scripts/ui.colorpicker.js 2009-04-08 16:14:33 UTC (rev 13441)
+++ trunk/ui/colorPicker/src/main/resources/org/richfaces/renderkit/html/scripts/ui.colorpicker.js 2009-04-08 16:15:47 UTC (rev 13442)
@@ -324,7 +324,7 @@
var input = $(this.options.clientId.toString()+' input');
var inputOffsets = input.offset();
- var elementRect = {left:inputOffsets.left, top: inputOffsets.top, width: this.element.width(), height:input.outerHeight()}//Richfaces.jQuery.getElementRectangle(this.element);
+ var elementRect = {left:inputOffsets.left, top: inputOffsets.top, width: this.element.width(), height:input.outerHeight()};
Richfaces.jQuery.position(elementRect, this.picker);
this.picker.css('visibility', 'visible');
15 years, 1 month
JBoss Rich Faces SVN: r13441 - trunk/ui/colorPicker/src/main/resources/org/richfaces/renderkit/html/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2009-04-08 12:14:33 -0400 (Wed, 08 Apr 2009)
New Revision: 13441
Modified:
trunk/ui/colorPicker/src/main/resources/org/richfaces/renderkit/html/scripts/ui.colorpicker.js
Log:
https://jira.jboss.org/jira/browse/RF-6685
Modified: trunk/ui/colorPicker/src/main/resources/org/richfaces/renderkit/html/scripts/ui.colorpicker.js
===================================================================
--- trunk/ui/colorPicker/src/main/resources/org/richfaces/renderkit/html/scripts/ui.colorpicker.js 2009-04-08 16:06:25 UTC (rev 13440)
+++ trunk/ui/colorPicker/src/main/resources/org/richfaces/renderkit/html/scripts/ui.colorpicker.js 2009-04-08 16:14:33 UTC (rev 13441)
@@ -322,7 +322,9 @@
this.picker.css('visibility', 'hidden').css('display', 'block');
- var elementRect = Richfaces.jQuery.getElementRectangle(this.element);
+ var input = $(this.options.clientId.toString()+' input');
+ var inputOffsets = input.offset();
+ var elementRect = {left:inputOffsets.left, top: inputOffsets.top, width: this.element.width(), height:input.outerHeight()}//Richfaces.jQuery.getElementRectangle(this.element);
Richfaces.jQuery.position(elementRect, this.picker);
this.picker.css('visibility', 'visible');
15 years, 1 month
JBoss Rich Faces SVN: r13440 - in trunk/ui/treeModel/src/main: java/org/richfaces/component and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-04-08 12:06:25 -0400 (Wed, 08 Apr 2009)
New Revision: 13440
Modified:
trunk/ui/treeModel/src/main/config/component/recursiveTreeNodesAdaptor.xml
trunk/ui/treeModel/src/main/java/org/richfaces/component/UIRecursiveTreeNodesAdaptor.java
Log:
https://jira.jboss.org/jira/browse/RF-6639
Modified: trunk/ui/treeModel/src/main/config/component/recursiveTreeNodesAdaptor.xml
===================================================================
--- trunk/ui/treeModel/src/main/config/component/recursiveTreeNodesAdaptor.xml 2009-04-08 16:05:05 UTC (rev 13439)
+++ trunk/ui/treeModel/src/main/config/component/recursiveTreeNodesAdaptor.xml 2009-04-08 16:06:25 UTC (rev 13440)
@@ -83,5 +83,9 @@
</description>
<defaultvalue>true</defaultvalue>
</property>
+ <property>
+ <name>recursionOrder</name>
+ <classname>java.lang.String</classname>
+ </property>
</component>
</components>
Modified: trunk/ui/treeModel/src/main/java/org/richfaces/component/UIRecursiveTreeNodesAdaptor.java
===================================================================
--- trunk/ui/treeModel/src/main/java/org/richfaces/component/UIRecursiveTreeNodesAdaptor.java 2009-04-08 16:05:05 UTC (rev 13439)
+++ trunk/ui/treeModel/src/main/java/org/richfaces/component/UIRecursiveTreeNodesAdaptor.java 2009-04-08 16:06:25 UTC (rev 13440)
@@ -20,7 +20,9 @@
*/
package org.richfaces.component;
+import java.util.ArrayList;
import java.util.Iterator;
+import java.util.List;
import org.apache.commons.collections.iterators.IteratorChain;
import org.richfaces.model.StackingTreeModel;
@@ -34,6 +36,10 @@
*/
public abstract class UIRecursiveTreeNodesAdaptor extends UITreeNodesAdaptor {
+ protected static final String FIRST = "first";
+
+ protected static final String LAST = "last";
+
public static final String COMPONENT_TYPE = "org.richfaces.RecursiveTreeNodesAdaptor";
public static final String COMPONENT_FAMILY = "org.richfaces.RecursiveTreeNodesAdaptor";
@@ -47,6 +53,9 @@
public abstract boolean isIncludedRoot();
public abstract void setIncludedRoot(boolean active);
+ public abstract String getRecursionOrder();
+ public abstract void setRecursionOrder(String recursionOrder);
+
protected boolean includeNode() {
return isIncluded() && isIncludedRoot();
}
@@ -58,9 +67,7 @@
public abstract String getVar();
public abstract void setVar(String var);
- public StackingTreeModel getStackingModel() {
- StackingTreeModel stackingModel = super.getStackingModel();
-
+ protected StackingTreeModel createRecursiveModel() {
StackingTreeModel recursiveModel = new VisualStackingTreeModel(getId(), getVar(), new StackingTreeModelDataProvider() {
public Object getData() {
@@ -78,7 +85,7 @@
return model;
}
- public Iterator getModelsIterator() {
+ public Iterator<StackingTreeModel> getModelsIterator() {
IteratorChain chain = new IteratorChain();
chain.addIterator(super.getModelsIterator());
chain.addIterator(this.getParent().getModelsIterator());
@@ -94,9 +101,43 @@
return UIRecursiveTreeNodesAdaptor.this.isIncluded() && UIRecursiveTreeNodesAdaptor.this.isIncludedNode();
}
};
- stackingModel.addStackingModel(recursiveModel);
- return stackingModel;
+ return recursiveModel;
}
+ @Override
+ protected void addChildModels(StackingTreeModel model,
+ List<StackingTreeModel> childModels) {
+
+ String recursionOrder = getRecursionOrder();
+ if (recursionOrder == null) {
+ recursionOrder = LAST;
+ }
+
+ List<StackingTreeModel> newModelsList = new ArrayList<StackingTreeModel>(childModels.size() + 1);
+ boolean recursiveModelInserted = false;
+
+ for (StackingTreeModel childModel : childModels) {
+ newModelsList.add(childModel);
+
+ if (recursionOrder.equals(childModel.getId())) {
+ recursiveModelInserted = true;
+ newModelsList.add(createRecursiveModel());
+ }
+ }
+
+ if (!recursiveModelInserted) {
+ if (LAST.equals(recursionOrder)) {
+ newModelsList.add(createRecursiveModel());
+ } else if (FIRST.equals(recursionOrder)) {
+ newModelsList.add(0, createRecursiveModel());
+ } else {
+ throw new IllegalArgumentException("Recursion order: [" + recursionOrder +
+ "] cannot be processed by component " + this.getClientId(getFacesContext()) + "!");
+ }
+ }
+
+ super.addChildModels(model, newModelsList);
+ }
+
}
15 years, 1 month
JBoss Rich Faces SVN: r13439 - trunk/framework/api/src/main/java/org/richfaces/model.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2009-04-08 12:05:05 -0400 (Wed, 08 Apr 2009)
New Revision: 13439
Modified:
trunk/framework/api/src/main/java/org/richfaces/model/StackingTreeModel.java
trunk/framework/api/src/main/java/org/richfaces/model/StackingTreeModelProvider.java
Log:
https://jira.jboss.org/jira/browse/RF-6639
Modified: trunk/framework/api/src/main/java/org/richfaces/model/StackingTreeModel.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/StackingTreeModel.java 2009-04-08 14:47:30 UTC (rev 13438)
+++ trunk/framework/api/src/main/java/org/richfaces/model/StackingTreeModel.java 2009-04-08 16:05:05 UTC (rev 13439)
@@ -208,7 +208,7 @@
private Object setupVariable(Object variable, FacesContext context) {
if (var != null) {
- Map map = context.getExternalContext().getRequestMap();
+ Map<String, Object> map = context.getExternalContext().getRequestMap();
return map.put(var, variable);
}
@@ -258,8 +258,8 @@
public boolean isLeaf() {
if (isRowAvailable()) {
StackEntry lastEntry = (StackEntry) stackEntries.getLast();
- for (Iterator iterator = lastEntry.model.getInternalModelsIterator(); iterator.hasNext();) {
- StackingTreeModel stackingTreeModel = (StackingTreeModel) iterator.next();
+ for (Iterator<StackingTreeModel> iterator = lastEntry.model.getInternalModelsIterator(); iterator.hasNext();) {
+ StackingTreeModel stackingTreeModel = iterator.next();
if (!stackingTreeModel.isEmpty()) {
return false;
@@ -301,9 +301,9 @@
new Visitor1(dataVisitor));
if (treeRange == null || treeRange.processChildren(argumentKey)) {
- Iterator iterator = this.getInternalModelsIterator();
+ Iterator<StackingTreeModel> iterator = this.getInternalModelsIterator();
while (iterator.hasNext()) {
- final StackingTreeModel model = (StackingTreeModel) iterator.next();
+ final StackingTreeModel model = iterator.next();
getRoot().setRowKey(context, argumentKey);
final ExtendedDataModel scalarModel = model.getDataModel();
@@ -357,11 +357,11 @@
return (StackingTreeModel) models.get(id);
}
- private Iterator getInternalModelsIterator() {
+ private Iterator<StackingTreeModel> getInternalModelsIterator() {
return new FilterIterator(getModelsIterator(), ACTIVE_MODEL_PREDICATE);
}
- public Iterator getModelsIterator() {
+ public Iterator<StackingTreeModel> getModelsIterator() {
return models.values().iterator();
}
@@ -601,4 +601,8 @@
ConvertableKeyModel convertable = (ConvertableKeyModel) getDataModel();
return convertable.getKeyAsObject(context, string, component, converter);
}
+
+ public String getId() {
+ return id;
+ }
}
Modified: trunk/framework/api/src/main/java/org/richfaces/model/StackingTreeModelProvider.java
===================================================================
--- trunk/framework/api/src/main/java/org/richfaces/model/StackingTreeModelProvider.java 2009-04-08 14:47:30 UTC (rev 13438)
+++ trunk/framework/api/src/main/java/org/richfaces/model/StackingTreeModelProvider.java 2009-04-08 16:05:05 UTC (rev 13439)
@@ -20,7 +20,9 @@
*/
package org.richfaces.model;
+import java.util.ArrayList;
import java.util.Iterator;
+import java.util.List;
import javax.faces.component.UIComponent;
import javax.faces.component.UIComponentBase;
@@ -43,20 +45,34 @@
protected abstract StackingTreeModel createStackingTreeModel();
- public StackingTreeModel getStackingModel() {
- StackingTreeModel stackingTreeModel = createStackingTreeModel();
+ private List<StackingTreeModel> createChildModelsList() {
+ List<StackingTreeModel> childModels = new ArrayList<StackingTreeModel>();
+
if (getChildCount() > 0) {
- Iterator children = getChildren().iterator();
+ Iterator<UIComponent> children = getChildren().iterator();
while (children.hasNext()) {
- UIComponent component = (UIComponent) children.next();
+ UIComponent component = children.next();
if (component instanceof StackingTreeModelProvider) {
StackingTreeModelProvider provider = (StackingTreeModelProvider) component;
-
- stackingTreeModel.addStackingModel(provider.getStackingModel());
+ childModels.add(provider.getStackingModel());
}
}
}
+ return childModels;
+ }
+
+ protected void addChildModels(StackingTreeModel model, List<StackingTreeModel> childModels) {
+ for (StackingTreeModel childModel : childModels) {
+ model.addStackingModel(childModel);
+ }
+ }
+
+ public StackingTreeModel getStackingModel() {
+ StackingTreeModel stackingTreeModel = createStackingTreeModel();
+
+ addChildModels(stackingTreeModel, createChildModelsList());
+
return stackingTreeModel;
}
}
15 years, 1 month
JBoss Rich Faces SVN: r13438 - trunk/test-applications/realworld2/web/src/main/webapp/scripts.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2009-04-08 10:47:30 -0400 (Wed, 08 Apr 2009)
New Revision: 13438
Modified:
trunk/test-applications/realworld2/web/src/main/webapp/scripts/realworld.js
Log:
refactor selectPopularTag method
Modified: trunk/test-applications/realworld2/web/src/main/webapp/scripts/realworld.js
===================================================================
--- trunk/test-applications/realworld2/web/src/main/webapp/scripts/realworld.js 2009-04-08 14:35:31 UTC (rev 13437)
+++ trunk/test-applications/realworld2/web/src/main/webapp/scripts/realworld.js 2009-04-08 14:47:30 UTC (rev 13438)
@@ -1,12 +1,8 @@
function selectPopularTag(tag, target) {
- if(target){
- var value = target.value;
- if(value && value.indexOf(tag) != -1){
- return;
+ if(target) {
+ var value = target.value.strip();
+ if(value.indexOf(tag) == -1) {
+ target.value = value.length != 0 ? value + ", " + tag : tag;
}
- if(value && value.length > 0){
- target.value += ', ';
- }
- target.value += tag;
}
}
\ No newline at end of file
15 years, 1 month
JBoss Rich Faces SVN: r13437 - trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2009-04-08 10:35:31 -0400 (Wed, 08 Apr 2009)
New Revision: 13437
Modified:
trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/Constants.java
Log:
Fix fileUpload
Modified: trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/Constants.java
===================================================================
--- trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/Constants.java 2009-04-08 14:35:26 UTC (rev 13436)
+++ trunk/test-applications/realworld2/ejb/src/main/java/org/richfaces/realworld/service/Constants.java 2009-04-08 14:35:31 UTC (rev 13437)
@@ -80,6 +80,7 @@
//Context-variables
public static final String ALBUM_VARIABLE = "album";
public static final String SHELF_VARIABLE = "shelf";
+ public static final String USER_VARIABLE = "user";
//ID's
public static final String REGISTER_LOGIN_NAME_ID = "register:loginName";
15 years, 1 month