JBoss Rich Faces SVN: r11330 - in trunk/test-applications/jsp/src/main/webapp: Queue and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-11-24 14:08:02 -0500 (Mon, 24 Nov 2008)
New Revision: 11330
Added:
trunk/test-applications/jsp/src/main/webapp/Queue/
trunk/test-applications/jsp/src/main/webapp/Queue/Queue.jsp
trunk/test-applications/jsp/src/main/webapp/Queue/QueueDefault.jsp
trunk/test-applications/jsp/src/main/webapp/Queue/QueueProperty.jsp
trunk/test-applications/jsp/src/main/webapp/Queue/QueueStraightforward.jsp
Log:
+Queue jsp pages
Added: trunk/test-applications/jsp/src/main/webapp/Queue/Queue.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/Queue/Queue.jsp (rev 0)
+++ trunk/test-applications/jsp/src/main/webapp/Queue/Queue.jsp 2008-11-24 19:08:02 UTC (rev 11330)
@@ -0,0 +1,21 @@
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
+<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
+
+<f:subview id="queueSubviewID">
+ <a4j:queue binding="#{queue.myQueue}"
+ disabled="#{queue.disabled}"
+ ignoreDupResponses="#{queue.ignoreDupResponses}"
+ name="formQueue"
+ onbeforedomupdate="#{event.onbeforedomupdate}"
+ oncomplete="#{event.oncomplete}"
+ onerror="#{event.onerror}"
+ onsizeexceeded="#{event.onsizeexceeded}"
+ onsubmit="#{event.onsubmit}"
+ rendered="#{queue.rendered}"
+ requestDelay="#{queue.requestDelay}"
+ size="#{queue.size}"
+ sizeExceededBehavior="#{queue.sizeExceededBehavior}"
+ timeout="#{queue.timeout}"/>
+</f:subview>
\ No newline at end of file
Added: trunk/test-applications/jsp/src/main/webapp/Queue/QueueDefault.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/Queue/QueueDefault.jsp (rev 0)
+++ trunk/test-applications/jsp/src/main/webapp/Queue/QueueDefault.jsp 2008-11-24 19:08:02 UTC (rev 11330)
@@ -0,0 +1,4 @@
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
+<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
\ No newline at end of file
Added: trunk/test-applications/jsp/src/main/webapp/Queue/QueueProperty.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/Queue/QueueProperty.jsp (rev 0)
+++ trunk/test-applications/jsp/src/main/webapp/Queue/QueueProperty.jsp 2008-11-24 19:08:02 UTC (rev 11330)
@@ -0,0 +1,40 @@
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
+<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
+
+<f:subview id="queuePropertySubviewID">
+ <h:commandButton value="add test"
+ action="#{queue.addQueue}"></h:commandButton>
+ <h:panelGrid columns="2">
+ <h:outputText value="disabled" />
+ <h:selectBooleanCheckbox value="#{queue.disabled}" onclick="submit()" />
+
+ <h:outputText value="ignoreDupResponses" />
+ <h:selectBooleanCheckbox value="#{queue.ignoreDupResponses}"
+ onclick="submit()" />
+
+ <h:outputText value="rendered" />
+ <h:selectBooleanCheckbox value="#{queue.rendered}" onclick="submit()" />
+
+ <h:outputText value="requestDelay" />
+ <h:inputText value="#{queue.requestDelay}">
+ <a4j:support event="onchange" reRender="queueID"></a4j:support>
+ </h:inputText>
+
+ <h:outputText value="size" />
+ <h:inputText value="#{queue.size}">
+ <a4j:support event="onchange" reRender="queueID"></a4j:support>
+ </h:inputText>
+
+ <h:outputText value="requestDelay" />
+ <h:panelGroup>
+ <h:inputText value="#{queue.sizeExceededBehavior}"
+ id="sizeExceededBehaviorID">
+ <a4j:support event="onchange" reRender="queueID"></a4j:support>
+ </h:inputText>
+ <h:outputLabel value=" \"dropNext\", \"dropNew\", \"fireNext\", \"fireNew\"" for="sizeExceededBehaviorID" />
+ </h:panelGroup>
+
+ </h:panelGrid>
+</f:subview>
\ No newline at end of file
Added: trunk/test-applications/jsp/src/main/webapp/Queue/QueueStraightforward.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/Queue/QueueStraightforward.jsp (rev 0)
+++ trunk/test-applications/jsp/src/main/webapp/Queue/QueueStraightforward.jsp 2008-11-24 19:08:02 UTC (rev 11330)
@@ -0,0 +1,114 @@
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
+<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
+<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
+<f:subview id="queueStraightforwardSubviewID">
+ <h:panelGrid columns="3" id="panelID" border="1"
+ style="text-align:center;">
+
+ <h:outputText value="Component name" style="FONT-WEIGHT: bold;" />
+ <h:outputText value="Component" style="FONT-WEIGHT: bold;" />
+ <h:outputText value="Select eventsQueue" style="FONT-WEIGHT: bold;" />
+
+ <h:outputText value="h:inputText" />
+ <h:inputText value="#{queueComponent.inputValue}" id="inputID">
+ <a4j:support id="inputSupport" event="onblur"
+ eventsQueue="#{queueComponent.inputQueue}"></a4j:support>
+ </h:inputText>
+
+ <h:selectOneMenu value="#{queueComponent.inputQueue}"
+ onchange="submit();">
+ <f:selectItems value="#{queueComponent.queues}" />
+ </h:selectOneMenu>
+
+ <h:outputText value="rich:calendar" />
+ <rich:calendar id="calendarID" value="#{queueComponent.calendarValue}"
+ eventsQueue="#{queueComponent.calendarQueue}">
+ </rich:calendar>
+
+ <h:selectOneMenu value="#{queueComponent.calendarQueue}"
+ onchange="submit();">
+ <f:selectItems value="#{queueComponent.queues}" />
+ </h:selectOneMenu>
+
+ <h:outputText value="h:selectBooleanCheckbox" />
+ <h:selectBooleanCheckbox value="#{queueComponent.checkboxValue}"
+ id="checkboxID">
+ <a4j:support id="checkboxSupport" event="onchange"
+ eventsQueue="#{queueComponent.checkboxQueue}"></a4j:support>
+ </h:selectBooleanCheckbox>
+
+ <h:selectOneMenu value="#{queueComponent.checkboxQueue}"
+ onchange="submit();">
+ <f:selectItems value="#{queueComponent.queues}" />
+ </h:selectOneMenu>
+
+ <h:outputText value="rich:dataScroller" />
+ <rich:datascroller for="dataTableId" reRender="dataTableId"
+ boundaryControls="#{dataScroller.boundaryControls}"
+ fastStep="#{dataScroller.fastStep}" id="dsID"
+ page="#{dataScroller.page}"
+ value="#{queueComponent.dataScrollerValue}"
+ stepControls="#{dataScroller.stepControls}"
+ eventsQueue="#{queueComponent.dataScrollerQueue}"
+ fastControls="#{dataScroller.fastControls}"
+ action="#{dataScroller.act}"
+ actionListener="#{dataScroller.actListener}"
+ maxPages="10"
+ scrollerListener="#{dataScroller.ScrollerListener}">
+ </rich:datascroller>
+
+ <h:selectOneMenu value="#{queueComponent.dataScrollerQueue}"
+ onchange="submit();">
+ <f:selectItems value="#{queueComponent.queues}" />
+ </h:selectOneMenu>
+
+ <h:outputText value="h:selectOneRadio" />
+ <h:selectOneRadio value="#{queueComponent.radioValue}">
+ <a4j:support id="radioSupport" event="onblur"
+ eventsQueue="#{queueComponent.radioQueue}"></a4j:support>
+ <f:selectItems value="#{queueComponent.queues}"/>
+ </h:selectOneRadio>
+
+ <h:selectOneMenu value="#{queueComponent.radioQueue}"
+ onchange="submit();">
+ <f:selectItems value="#{queueComponent.queues}" />
+ </h:selectOneMenu>
+
+ <h:outputText value="rich:dataFilterSlider" />
+ <rich:dataFilterSlider sliderListener="#{dfs.doSlide}" action="#{dfs.act}" forValRef="dataScroller.dataTable"
+ actionListener="#{dfs.actListener}" for="dataTableId" filterBy="getInt0"
+ storeResults="true" startRange="0" endRange="999" increment="9"
+ manualInput="true" width="400px" trailer="true" handleValue="999" id="dfsID"
+ eventsQueue="#{queueComponent.dfsQueue}"></rich:dataFilterSlider>
+
+ <h:selectOneMenu value="#{queueComponent.dfsQueue}"
+ onchange="submit();">
+ <f:selectItems value="#{queueComponent.queues}" />
+ </h:selectOneMenu>
+
+ </h:panelGrid>
+
+ <rich:separator width="100%" height="10px"></rich:separator>
+ <rich:dataTable id="dataTableId" value="#{dataScroller.dataTable}"
+ var="dT" cellpadding="5px" rows="5" border="1"
+ reRender="dsID,dataTableId" sortMode="#{dataScroller.sortMode}">
+ <f:facet name="header">
+ <h:outputText value="Header" />
+ </f:facet>
+ <f:facet name="footer">
+
+ </f:facet>
+ <rich:column sortBy="#{dT.str0}" filterBy="#{dT.str0}"
+ filterEvent="onkeyup" selfSorted="#{dataScroller.selfSorted}"
+ filterValue="#{dataScroller.filterValue}">
+ <h:outputText value="#{dT.str0}" />
+ </rich:column>
+ <rich:column sortBy="#{dT.int0}" filterBy="#{dT.int0}"
+ filterEvent="onkeyup" selfSorted="#{dataScroller.selfSorted}">
+ <h:outputText value="#{dT.int0} " />
+ </rich:column>
+ </rich:dataTable>
+
+
+</f:subview>
\ No newline at end of file
17 years, 5 months
JBoss Rich Faces SVN: r11329 - in trunk/test-applications/jsp/src/main/java: queue and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: mvitenkov
Date: 2008-11-24 14:07:21 -0500 (Mon, 24 Nov 2008)
New Revision: 11329
Added:
trunk/test-applications/jsp/src/main/java/queue/
trunk/test-applications/jsp/src/main/java/queue/Queue.java
trunk/test-applications/jsp/src/main/java/queue/QueueComponent.java
Log:
+Queue & QueueComponent beans
Added: trunk/test-applications/jsp/src/main/java/queue/Queue.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/queue/Queue.java (rev 0)
+++ trunk/test-applications/jsp/src/main/java/queue/Queue.java 2008-11-24 19:07:21 UTC (rev 11329)
@@ -0,0 +1,88 @@
+package queue;
+
+import org.ajax4jsf.component.UIQueue;
+
+import util.componentInfo.ComponentInfo;
+public class Queue {
+ private UIQueue myQueue = null;
+ private boolean disabled;
+ private boolean ignoreDupResponses;
+ private String name;
+ private boolean rendered;
+ private int requestDelay;
+ private int size;
+ private String sizeExceededBehavior;
+ private int timeout;
+
+ public Queue(){
+ this.disabled = false;
+ this.ignoreDupResponses = false;
+ this.name = "DefaultQueue";
+ this.rendered = true;
+ this.requestDelay = 500;
+ this.size = 3;
+ this.sizeExceededBehavior = "dropNext";
+ this.timeout = 5000;
+ }
+
+ public String addQueue(){
+ ComponentInfo info = ComponentInfo.getInstance();
+ info.addField(myQueue);
+ return null;
+ }
+
+ public UIQueue getMyQueue() {
+ return myQueue;
+ }
+ public void setMyQueue(UIQueue myQueue) {
+ this.myQueue = myQueue;
+ }
+ public boolean isDisabled() {
+ return disabled;
+ }
+ public void setDisabled(boolean disabled) {
+ this.disabled = disabled;
+ }
+ public boolean isIgnoreDupResponses() {
+ return ignoreDupResponses;
+ }
+ public void setIgnoreDupResponses(boolean ignoreDupResponses) {
+ this.ignoreDupResponses = ignoreDupResponses;
+ }
+ public String getName() {
+ return name;
+ }
+ public void setName(String name) {
+ this.name = name;
+ }
+ public boolean isRendered() {
+ return rendered;
+ }
+ public void setRendered(boolean rendered) {
+ this.rendered = rendered;
+ }
+ public int getRequestDelay() {
+ return requestDelay;
+ }
+ public void setRequestDelay(int requestDelay) {
+ this.requestDelay = requestDelay;
+ }
+ public int getSize() {
+ return size;
+ }
+ public void setSize(int size) {
+ this.size = size;
+ }
+ public String getSizeExceededBehavior() {
+ return sizeExceededBehavior;
+ }
+ public void setSizeExceededBehavior(String sizeExceededBehavior) {
+ this.sizeExceededBehavior = sizeExceededBehavior;
+ }
+ public int getTimeout() {
+ return timeout;
+ }
+ public void setTimeout(int timeout) {
+ this.timeout = timeout;
+ }
+}
Added: trunk/test-applications/jsp/src/main/java/queue/QueueComponent.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/queue/QueueComponent.java (rev 0)
+++ trunk/test-applications/jsp/src/main/java/queue/QueueComponent.java 2008-11-24 19:07:21 UTC (rev 11329)
@@ -0,0 +1,136 @@
+package queue;
+
+import java.util.ArrayList;
+import java.util.Date;
+
+import javax.faces.model.SelectItem;
+
+public class QueueComponent {
+ private String inputValue;
+ private String inputQueue;
+ private ArrayList<SelectItem> queues;
+ private Date calendarValue;
+ private String calendarQueue;
+ private boolean checkboxValue;
+ private String checkboxQueue;
+ private String dfsQueue;
+ private Object dataScrollerValue;
+ private String dataScrollerQueue;
+ private String radioValue;
+ private String radioQueue;
+
+ public String getRadioValue() {
+ return radioValue;
+ }
+
+ public void setRadioValue(String radioValue) {
+ this.radioValue = radioValue;
+ }
+
+ public String getRadioQueue() {
+ return radioQueue;
+ }
+
+ public void setRadioQueue(String radioQueue) {
+ this.radioQueue = radioQueue;
+ }
+
+ public Object getDataScrollerValue() {
+ return dataScrollerValue;
+ }
+
+ public void setDataScrollerValue(Object dataScrollerValue) {
+ this.dataScrollerValue = dataScrollerValue;
+ }
+
+ public String getDataScrollerQueue() {
+ return dataScrollerQueue;
+ }
+
+ public void setDataScrollerQueue(String dataScrollerQueue) {
+ this.dataScrollerQueue = dataScrollerQueue;
+ }
+
+ public String getDfsQueue() {
+ return dfsQueue;
+ }
+
+ public void setDfsQueue(String dfsQueue) {
+ this.dfsQueue = dfsQueue;
+ }
+
+ public boolean isCheckboxValue() {
+ return checkboxValue;
+ }
+
+ public void setCheckboxValue(boolean checkboxValue) {
+ this.checkboxValue = checkboxValue;
+ }
+
+ public String getCheckboxQueue() {
+ return checkboxQueue;
+ }
+
+ public void setCheckboxQueue(String checkboxQueue) {
+ this.checkboxQueue = checkboxQueue;
+ }
+
+ public Date getCalendarValue() {
+ return calendarValue;
+ }
+
+ public void setCalendarValue(Date calendarValue) {
+ this.calendarValue = calendarValue;
+ }
+
+ public String getCalendarQueue() {
+ return calendarQueue;
+ }
+
+ public void setCalendarQueue(String calendarQueue) {
+ this.calendarQueue = calendarQueue;
+ }
+
+ public QueueComponent(){
+ this.inputValue = "";
+ this.inputQueue = "org.richfaces.global_queue";
+ this.calendarValue = new Date();
+ this.calendarQueue = "namedQueue";
+ this.checkboxValue = false;
+ this.checkboxQueue = "formQueue";
+ this.dataScrollerValue = null;
+ this.dataScrollerQueue = "default";
+ this.radioValue = "org.richfaces.global_queue";
+ this.radioQueue = "org.richfaces.global_queue";
+ this.dfsQueue = "namedQueue";
+ String[] qu = {"org.richfaces.global_queue", "namedQueue", "formQueue", "default"};
+ queues = new ArrayList<SelectItem>();
+ for(int i=0; i<qu.length; i++){
+ queues.add(new SelectItem(qu[i], qu[i]));
+ }
+ }
+
+ public String getInputQueue() {
+ return inputQueue;
+ }
+
+ public void setInputQueue(String inputQueue) {
+ this.inputQueue = inputQueue;
+ }
+
+ public String getInputValue() {
+ return inputValue;
+ }
+
+ public void setInputValue(String inputValue) {
+ this.inputValue = inputValue;
+ }
+
+ public ArrayList<SelectItem> getQueues() {
+ return queues;
+ }
+
+ public void setQueues(ArrayList<SelectItem> queues) {
+ this.queues = queues;
+ }
+}
17 years, 5 months
JBoss Rich Faces SVN: r11328 - in trunk/test-applications: realworld and 38 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2008-11-24 12:18:48 -0500 (Mon, 24 Nov 2008)
New Revision: 11328
Added:
trunk/test-applications/realworld/
trunk/test-applications/realworld/ear/
trunk/test-applications/realworld/ear/pom.xml
trunk/test-applications/realworld/ear/src/
trunk/test-applications/realworld/ear/src/main/
trunk/test-applications/realworld/ear/src/main/application/
trunk/test-applications/realworld/ear/src/main/application/jboss-app.xml
trunk/test-applications/realworld/ear/src/main/application/security.drl
trunk/test-applications/realworld/ejb/
trunk/test-applications/realworld/ejb/META-INF/
trunk/test-applications/realworld/ejb/META-INF/MANIFEST.MF
trunk/test-applications/realworld/ejb/pom.xml
trunk/test-applications/realworld/ejb/src/
trunk/test-applications/realworld/ejb/src/main/
trunk/test-applications/realworld/ejb/src/main/java/
trunk/test-applications/realworld/ejb/src/main/java/org/
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/dao/
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/dao/AlbumHome.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/dao/ImageHome.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/dao/UserHome.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Album.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Image.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/User.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/AlbumAction.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IAlbumAction.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IImageAction.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IUserAction.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java
trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/UserAction.java
trunk/test-applications/realworld/ejb/src/main/resources/
trunk/test-applications/realworld/ejb/src/main/resources/META-INF/
trunk/test-applications/realworld/ejb/src/main/resources/META-INF/ejb-jar.xml
trunk/test-applications/realworld/ejb/src/main/resources/META-INF/persistence.xml
trunk/test-applications/realworld/ejb/src/main/resources/components.properties
trunk/test-applications/realworld/ejb/src/main/resources/import.sql
trunk/test-applications/realworld/ejb/src/main/resources/realworld-ds.xml
trunk/test-applications/realworld/ejb/src/main/resources/seam.properties
trunk/test-applications/realworld/pom.xml
trunk/test-applications/realworld/web/
trunk/test-applications/realworld/web/META-INF/
trunk/test-applications/realworld/web/META-INF/MANIFEST.MF
trunk/test-applications/realworld/web/pom.xml
trunk/test-applications/realworld/web/src/
trunk/test-applications/realworld/web/src/main/
trunk/test-applications/realworld/web/src/main/java/
trunk/test-applications/realworld/web/src/main/java/org/
trunk/test-applications/realworld/web/src/main/java/org/richfaces/
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/AvatarUpload.java
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/FileManager.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileTest.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileTestTest.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/session/
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/session/Authenticator.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeActionManager.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeAlbumItem.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeImageItem.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeRootItem.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeSelectionManager.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ModalPanelHelper.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/NavigationEnum.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/NavigationHelper.java
trunk/test-applications/realworld/web/src/main/resources/
trunk/test-applications/realworld/web/src/main/resources/messages_en.properties
trunk/test-applications/realworld/web/src/main/resources/seam.properties
trunk/test-applications/realworld/web/src/main/webapp/
trunk/test-applications/realworld/web/src/main/webapp/META-INF/
trunk/test-applications/realworld/web/src/main/webapp/META-INF/MANIFEST.MF
trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/
trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/components.xml
trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/faces-config.xml
trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/pages.xml
trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/
trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/albumModalPanel-taglib.xml
trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/
trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/albumModalPanel.xhtml
trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/confirmation.xhtml
trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/imagePrefs.xhtml
trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/web.xml
trunk/test-applications/realworld/web/src/main/webapp/error.xhtml
trunk/test-applications/realworld/web/src/main/webapp/fileUpload.xhtml
trunk/test-applications/realworld/web/src/main/webapp/imagePreview.xhtml
trunk/test-applications/realworld/web/src/main/webapp/img/
trunk/test-applications/realworld/web/src/main/webapp/img/alert.jpeg
trunk/test-applications/realworld/web/src/main/webapp/img/dtpick.gif
trunk/test-applications/realworld/web/src/main/webapp/img/error.gif
trunk/test-applications/realworld/web/src/main/webapp/img/logo.gif
trunk/test-applications/realworld/web/src/main/webapp/index.html
trunk/test-applications/realworld/web/src/main/webapp/index.xhtml
trunk/test-applications/realworld/web/src/main/webapp/layout/
trunk/test-applications/realworld/web/src/main/webapp/layout/display.xhtml
trunk/test-applications/realworld/web/src/main/webapp/layout/edit.xhtml
trunk/test-applications/realworld/web/src/main/webapp/layout/menu.xhtml
trunk/test-applications/realworld/web/src/main/webapp/layout/template.xhtml
trunk/test-applications/realworld/web/src/main/webapp/main.xhtml
trunk/test-applications/realworld/web/src/main/webapp/register.xhtml
trunk/test-applications/realworld/web/src/main/webapp/stylesheet/
trunk/test-applications/realworld/web/src/main/webapp/stylesheet/realworld.css
trunk/test-applications/realworld/web/src/main/webapp/tree.xhtml
trunk/test-applications/realworld/web/src/main/webapp/userPrefs.xhtml
Log:
Property changes on: trunk/test-applications/realworld
___________________________________________________________________
Name: svn:ignore
+ target
Property changes on: trunk/test-applications/realworld/ear
___________________________________________________________________
Name: svn:ignore
+ target
.settings
.project
Added: trunk/test-applications/realworld/ear/pom.xml
===================================================================
--- trunk/test-applications/realworld/ear/pom.xml (rev 0)
+++ trunk/test-applications/realworld/ear/pom.xml 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,162 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.richfaces</groupId>
+ <artifactId>realworld</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>${projectName}-ear</artifactId>
+ <name>EAR module</name>
+ <packaging>ear</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>org.richfaces</groupId>
+ <artifactId>${projectName}-web</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.framework</groupId>
+ <artifactId>richfaces-api</artifactId>
+ <version>${richfacesVersion}</version>
+ </dependency>
+ <!-- EJB -->
+ <dependency>
+ <groupId>org.richfaces</groupId>
+ <artifactId>${projectName}-ejb</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <type>ejb</type>
+ </dependency>
+ <dependency>
+ <groupId>org.drools</groupId>
+ <artifactId>drools-core</artifactId>
+ <version>${droolsVersion}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>xml-apis</groupId>
+ <artifactId>xml-apis</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.drools</groupId>
+ <artifactId>drools-compiler</artifactId>
+ <version>${droolsVersion}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>xml-apis</groupId>
+ <artifactId>xml-apis</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.14</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <version>${seamVersion}</version>
+ <type>ejb</type>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam-pdf</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.sun.facelets</groupId>
+ <artifactId>jsf-facelets</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ </dependencies>
+ <build>
+ <finalName>${projectName}-ear-1.0-SNAPSHOT</finalName>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-ear-plugin</artifactId>
+ <version>2.3.1</version>
+ <configuration>
+ <generateApplicationXml>true</generateApplicationXml>
+ <includeJar>false</includeJar>
+ <defaultLibBundleDir>lib</defaultLibBundleDir>
+ <loader-repository>seam.jboss.org:loader=${project.build.finalName}</loader-repository>
+ <modules>
+ <webModule>
+ <groupId>org.richfaces</groupId>
+ <artifactId>${projectName}-web</artifactId>
+ <contextRoot>/${projectName}</contextRoot>
+ </webModule>
+ <ejbModule>
+ <groupId>org.richfaces</groupId>
+ <artifactId>${projectName}-ejb</artifactId>
+ </ejbModule>
+ <ejbModule>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ </ejbModule>
+ </modules>
+ </configuration>
+ </plugin>
+ <!--<plugin>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-maven2-plugin</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>deployer-deploy</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>start-container</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>start</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <container>
+ <containerId>jboss4x</containerId>
+ <zipUrlInstaller>
+ <url>${jbossDownloadURL}</url>
+ <installDir>${installDir}</installDir>
+ </zipUrlInstaller>
+ <output>${project.build.directory}/jboss4x.log</output>
+ <log>${project.build.directory}/cargo.log</log>
+ </container>
+ <configuration>
+ <type>existing</type>
+ <home>${installDir}/${jbossDeployDir}</home>
+ <properties>
+ <cargo.servlet.port>8080</cargo.servlet.port>
+ <cargo.jboss.configuration>default</cargo.jboss.configuration>
+ </properties>
+ </configuration>
+ </configuration>
+ </plugin>-->
+ </plugins>
+ </build>
+</project>
Property changes on: trunk/test-applications/realworld/ear/pom.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/ear/src/main/application/jboss-app.xml
===================================================================
--- trunk/test-applications/realworld/ear/src/main/application/jboss-app.xml (rev 0)
+++ trunk/test-applications/realworld/ear/src/main/application/jboss-app.xml 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+ <!DOCTYPE jboss-app
+ PUBLIC "-//JBoss//DTD J2EE Application 4.2//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-app_4_2.dtd">
+
+<jboss-app>
+ <loader-repository>
+ seam.jboss.org:loader=realworld-ear-1.0-SNAPSHOT.ear
+ </loader-repository>
+</jboss-app>
\ No newline at end of file
Property changes on: trunk/test-applications/realworld/ear/src/main/application/jboss-app.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/ear/src/main/application/security.drl
===================================================================
--- trunk/test-applications/realworld/ear/src/main/application/security.drl (rev 0)
+++ trunk/test-applications/realworld/ear/src/main/application/security.drl 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,6 @@
+package Permissions;
+
+import java.security.Principal;
+
+import org.jboss.seam.security.PermissionCheck;
+import org.jboss.seam.security.Role;
\ No newline at end of file
Property changes on: trunk/test-applications/realworld/ejb
___________________________________________________________________
Name: svn:ignore
+ target
.settings
.classpath
.project
Added: trunk/test-applications/realworld/ejb/META-INF/MANIFEST.MF
===================================================================
--- trunk/test-applications/realworld/ejb/META-INF/MANIFEST.MF (rev 0)
+++ trunk/test-applications/realworld/ejb/META-INF/MANIFEST.MF 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Property changes on: trunk/test-applications/realworld/ejb/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/ejb/pom.xml
===================================================================
--- trunk/test-applications/realworld/ejb/pom.xml (rev 0)
+++ trunk/test-applications/realworld/ejb/pom.xml 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.richfaces</groupId>
+ <artifactId>realworld</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>${projectName}-ejb</artifactId>
+ <name>EJB module</name>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>ejb</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>javax.ejb</groupId>
+ <artifactId>ejb-api</artifactId>
+ <version>3.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.persistence</groupId>
+ <artifactId>persistence-api</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <version>${seamVersion}</version>
+ <scope>provided</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam-pdf</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.sun.facelets</groupId>
+ <artifactId>jsf-facelets</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-validator</artifactId>
+ <version>3.0.0.ga</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-annotations</artifactId>
+ <version>3.3.0.ga</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-ejb-plugin</artifactId>
+ <configuration>
+ <ejbVersion>3.0</ejbVersion>
+ <archive>
+ <manifest>
+ <addClasspath>true</addClasspath>
+ </manifest>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.4</version>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
Property changes on: trunk/test-applications/realworld/ejb/pom.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/dao/AlbumHome.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/dao/AlbumHome.java (rev 0)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/dao/AlbumHome.java 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,21 @@
+package org.richfaces.realworld.dao;
+
+import javax.persistence.EntityManager;
+
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.framework.EntityHome;
+import org.richfaces.realworld.domain.Album;
+
+@Name("albumHome")
+public class AlbumHome extends EntityHome<Album> {
+
+ private static final long serialVersionUID = -3969822217759076583L;
+
+ @In
+ EntityManager em;
+
+ public EntityManager getEntityManager() {
+ return em;
+ }
+}
\ No newline at end of file
Property changes on: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/dao/AlbumHome.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/dao/ImageHome.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/dao/ImageHome.java (rev 0)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/dao/ImageHome.java 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,21 @@
+package org.richfaces.realworld.dao;
+
+import javax.persistence.EntityManager;
+
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.framework.EntityHome;
+import org.richfaces.realworld.domain.Image;
+
+@Name("imageHome")
+public class ImageHome extends EntityHome<Image> {
+
+ private static final long serialVersionUID = -3969822217759076584L;
+
+ @In
+ EntityManager em;
+
+ public EntityManager getEntityManager() {
+ return em;
+ }
+}
\ No newline at end of file
Property changes on: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/dao/ImageHome.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/dao/UserHome.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/dao/UserHome.java (rev 0)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/dao/UserHome.java 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,18 @@
+package org.richfaces.realworld.dao;
+
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.framework.EntityHome;
+import org.richfaces.realworld.domain.User;
+
+@Name("userHome")
+public class UserHome extends EntityHome<User> {
+
+ private static final long serialVersionUID = -3969822217759076582L;
+
+ public User login(String username, String password) {
+ return (User)getPersistenceContext().createQuery("select from User u where u.login = :username and u.password = :password")
+ .setParameter("username", username)
+ .setParameter("password", password)
+ .getSingleResult();
+ }
+}
\ No newline at end of file
Property changes on: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/dao/UserHome.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Album.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Album.java (rev 0)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Album.java 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,255 @@
+/*
+ * Album.java
+ * Last modified by: $Author$
+ * $Revision$ $Date$
+ */
+package org.richfaces.realworld.domain;
+
+import java.io.Serializable;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+import javax.persistence.Transient;
+import javax.persistence.Version;
+
+import org.hibernate.validator.NotNull;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+
+/**
+ * Class for representing Album Entity
+ * EJB3 Entity Bean
+ *
+ * @author Andrey Markhel
+ */
+@Entity
+@Name("album")
+(a)Scope(ScopeType.PAGE)
+@Table(name = "albums")
+public class Album implements Serializable {
+
+ private static final long serialVersionUID = -7042878411608396483L;
+
+ @Id
+ @GeneratedValue
+ @Column(name = "ALBUM_ID")
+ private Long id = null;
+
+ @Version
+ @Column(name = "OBJ_VERSION")
+ private int version = 0;
+
+ @Column(length = 255, nullable = false)
+ @NotNull
+ private String name;
+
+ @Column(length = 1024)
+ @NotNull
+ private String description;
+
+ /*@OneToMany(mappedBy = "parent", cascade = { CascadeType.ALL }, fetch = FetchType.LAZY)
+ @org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.EXTRA)
+ @org.hibernate.annotations.OrderBy(clause = "NAME asc")
+ private List<Album> childAlbums = new ArrayList<Album>();
+
+ @ManyToOne(cascade = CascadeType.ALL,fetch = FetchType.LAZY)
+ @JoinColumn(name = "PARENT_ID", nullable = true)
+ @org.hibernate.annotations.ForeignKey(name = "FK_PARENT_ID")
+ private Album parent;*/
+
+ @ManyToOne
+ @JoinColumn(name="ALBUM_USER_ID",
+ referencedColumnName="USER_ID")
+ private User owner;
+
+ @NotNull
+ private boolean shared;
+
+ @Transient
+ private String changedName;
+
+ @OneToMany(cascade = CascadeType.ALL, mappedBy = "album")
+ @org.hibernate.annotations.Cascade(value = org.hibernate.annotations.CascadeType.DELETE_ORPHAN)
+ @org.hibernate.annotations.Fetch(org.hibernate.annotations.FetchMode.SUBSELECT)
+ private Set<Image> images = new HashSet<Image>();
+
+ /**
+ * No-arg constructor for JavaBean tools
+ */
+ public Album() {
+ }
+
+ /**
+ * Constructor
+ *
+ * @param name - name of album
+ * @param parent - link for parent album
+ */
+ public Album(String name) {
+ this.name = name;
+ //this.parent = parent;
+ }
+
+ // ********************** Accessor Methods ********************** //
+
+ /**
+ * Getter for property id
+ *
+ * @return id of album
+ */
+ public Long getId() {
+ return id;
+ }
+
+ /**
+ * Getter for property name
+ *
+ * @return name of album
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Getter for property version
+ *
+ * @return version of current album object
+ */
+ public int getVersion() {
+ return version;
+ }
+
+ /**
+ * Setter for property name
+ *
+ * @param name - name of album
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Getter for property childAlbums
+ *
+ * @return list of childs of current albums
+ *//*
+ public List<Album> getChildAlbums() {
+ return childAlbums;
+ }
+
+ *//**
+ * Getter for property parent
+ *
+ * @return parent of album
+ *//*
+ public Album getParent() {
+ return parent;
+ }
+
+ *//**
+ * Setter for property parent
+ *//*
+ private void setParent(Album parent) {
+ this.parent = parent;
+ }*/
+
+ /**
+ * Getter for property description
+ *
+ * @return description of album
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * Setter for property description
+ *
+ * @param description - description of album
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ // ********************** Business Methods ********************** //
+
+ /**
+ * This method add image to collection of images of current album
+ *
+ * @param image - image to add
+ */
+ public void addImage(Image image) {
+ if (image == null) {
+ throw new IllegalArgumentException("Null image!");
+ }
+ if (image.getAlbum() != null && !this.equals(image.getAlbum())) {
+ image.getAlbum().getImages().remove(image);
+ }
+ image.setAlbum(this);
+ images.add(image);
+ }
+
+ /**
+ * This method remove image from collection of images of album
+ *
+ * @param image - image to remove
+ */
+ public void removeImage(Image image) {
+ if (image == null) {
+ throw new IllegalArgumentException("Null image");
+ }
+ image.setAlbum(null);
+ images.remove(image);
+ }
+
+ /**
+ * This method return count of images of current album
+ *
+ * @return count of images of this album
+ */
+ public int getCountImages() {
+ return this.getImages()!= null ? this.getImages().size() : 0;
+
+ }
+
+ public boolean isShared() {
+ return shared;
+ }
+
+ public void setShared(boolean shared) {
+ this.shared = shared;
+ }
+
+ public User getOwner() {
+ return owner;
+ }
+
+ public Set<Image> getImages() {
+ return images;
+ }
+
+ public void setOwner(User owner) {
+ this.owner = owner;
+ }
+
+ public String getChangedName() {
+ if(changedName != null){
+ return changedName;
+ }
+ return this.getName();
+ }
+
+ public void setChangedName(String changedName) {
+ this.changedName = changedName;
+ }
+}
Property changes on: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Album.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Image.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Image.java (rev 0)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Image.java 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,208 @@
+/*
+ * Image.java
+ * Last modified by: $Author$
+ * $Revision$ $Date$
+ */
+package org.richfaces.realworld.domain;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.JoinTable;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import javax.persistence.Transient;
+import javax.persistence.Version;
+
+import org.hibernate.validator.NotNull;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+
+/**
+ * Class for representing Image Entity
+ * EJB3 Entity Bean
+ *
+ * @author Andrey Markhel
+ */
+@Entity
+@Name("image")
+(a)Scope(ScopeType.PAGE)
+@Table(name = "Images")
+public class Image implements Serializable {
+
+ private static final long serialVersionUID = -7042878411608396483L;
+
+ @Id
+ @GeneratedValue
+ @Column(name = "IMAGE_ID")
+ private Long id = null;
+
+ @Version
+ @Column(name = "OBJ_VERSION")
+ private int version = 0;
+
+ @Column(length = 255, nullable = false)
+ @NotNull
+ private String name;
+
+ @Column(length = 1024, nullable = false)
+ @NotNull
+ private String path;
+
+ @org.hibernate.annotations.CollectionOfElements(targetElement = java.lang.String.class)
+ @JoinTable(name = "IMAGE_TAGS", joinColumns = @JoinColumn(name = "IMAGE_ID"))
+ @Column(name = "TAG", nullable = false)
+ private Set<String> tags = new HashSet<String>();
+
+ @Column(length = 1024)
+ @NotNull
+ private String description;
+
+ @Transient
+ private String albumName;
+
+ @NotNull
+ private boolean shared;
+
+ @Temporal(TemporalType.TIMESTAMP)
+ private Date created;
+
+ @ManyToOne(fetch = FetchType.LAZY)
+ @JoinColumn(name="IMG_ALBUM_ID",
+ referencedColumnName="ALBUM_ID")
+ private Album album;
+
+ /**
+ * No-arg constructor for JavaBean tools
+ */
+ public Image() {
+ }
+
+ /**
+ * Constructor
+ *
+ * @param name - name of album
+ * @param parent - link for parent album
+ */
+ public Image(String name) {
+ this.name = name;
+ }
+
+ // ********************** Accessor Methods ********************** //
+
+ /**
+ * Getter for property id
+ *
+ * @return id of album
+ */
+ public Long getId() {
+ return id;
+ }
+
+ /**
+ * Getter for property name
+ *
+ * @return name of album
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Getter for property version
+ *
+ * @return version of current album object
+ */
+ public int getVersion() {
+ return version;
+ }
+
+ /**
+ * Setter for property name
+ *
+ * @param name - name of album
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Getter for property description
+ *
+ * @return description of album
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * Setter for property description
+ *
+ * @param description - description of album
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public String getPath() {
+ return path;
+ }
+
+ public void setPath(String path) {
+ this.path = path;
+ }
+
+ public boolean isShared() {
+ return shared;
+ }
+
+ public void setShared(boolean shared) {
+ this.shared = shared;
+ }
+
+ public Date getCreated() {
+ return created;
+ }
+
+ public void setCreated(Date created) {
+ this.created = created;
+ }
+
+ public Set<String> getTags() {
+ return tags;
+ }
+
+ public void setTags(Set<String> tags) {
+ this.tags = tags;
+ }
+
+ public Album getAlbum() {
+ return album;
+ }
+
+ public void setAlbum(Album album) {
+ this.album = album;
+ }
+
+ public String getAlbumName() {
+ if(null == albumName && this.getAlbum() != null){
+ albumName = this.getAlbum().getName();
+ }
+ return albumName;
+ }
+
+ public void setAlbumName(String albumName) {
+ this.albumName = albumName;
+ }
+}
Property changes on: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/Image.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/User.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/User.java (rev 0)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/User.java 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,193 @@
+package org.richfaces.realworld.domain;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.NamedQueries;
+import javax.persistence.NamedQuery;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+import javax.persistence.Temporal;
+import javax.persistence.TemporalType;
+import javax.persistence.Transient;
+import javax.persistence.Version;
+
+import org.hibernate.validator.NotNull;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+
+/*@NamedQueries({
+ @NamedQuery(
+ name = "User-rootAlbums",
+ query = "select a from Album a where a.parent is null and a.owner=:owner"
+ )
+})*/
+
+@Entity
+@Name("user")
+(a)Scope(ScopeType.SESSION)
+@Table(name = "Users")
+public class User implements Serializable {
+
+
+ private static final long serialVersionUID = 1L;
+
+ @Id
+ @GeneratedValue
+ @Column(name = "USER_ID")
+ private Long id = null;
+
+ @Version
+ @Column(name = "OBJ_VERSION")
+ private int version = 0;
+
+ @Column(length = 255, nullable = false)
+ @NotNull
+ private String firstName;
+
+ @Column(length = 255, nullable = false)
+ @NotNull
+ private String secondName;
+
+ @Column(length = 255, nullable = false)
+ @NotNull
+ private String email;
+
+ @Column(length = 255)
+ @NotNull
+ private String avatarPath;
+
+ @Column(length = 255, nullable = false)
+ @NotNull
+ private String login;
+
+ @Column(length = 255, nullable = false)
+ @NotNull
+ private String password;
+
+ @Temporal(TemporalType.TIMESTAMP)
+ private Date birthDate;
+
+ @OneToMany(mappedBy = "owner", cascade = { CascadeType.ALL }, fetch = FetchType.LAZY)
+ @org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.EXTRA)
+ @org.hibernate.annotations.OrderBy(clause = "NAME asc")
+ private Set<Album> childAlbums = new HashSet<Album>();
+
+ //private Address address;
+
+ /**
+ * No-arg constructor for JavaBean tools
+ */
+ public User() {
+ }
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+
+ public String getSecondName() {
+ return secondName;
+ }
+
+ public void setSecondName(String secondName) {
+ this.secondName = secondName;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ this.email = email;
+ }
+
+ public String getAvatarPath() {
+ return avatarPath;
+ }
+
+ public void setAvatarPath(String avatarPath) {
+ this.avatarPath = avatarPath;
+ }
+
+ public String getLogin() {
+ return login;
+ }
+
+ public void setLogin(String login) {
+ this.login = login;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+
+ public Date getBirthDate() {
+ return birthDate;
+ }
+
+ public void setBirthDate(Date birthDate) {
+ this.birthDate = birthDate;
+ }
+
+ public Long getId() {
+ return id;
+ }
+
+ public Set<Album> getChildAlbums() {
+ return childAlbums;
+ }
+
+ public void setChildAlbums(Set<Album> childAlbums) {
+ this.childAlbums = childAlbums;
+ }
+
+ //---------------------------Business methods
+
+ /**
+ * This method add image to collection of images of current album
+ *
+ * @param image - image to add
+ */
+ public void addAlbum(Album album) {
+ if (album == null) {
+ throw new IllegalArgumentException("Null album!");
+ }
+ if (album.getOwner() != null && !this.equals(album.getOwner())) {
+ album.getOwner().getChildAlbums().remove(album);
+ }
+ album.setOwner(this);
+ childAlbums.add(album);
+ }
+
+ /**
+ * This method remove image from collection of images of album
+ *
+ * @param image - image to remove
+ */
+ public void removeAlbum(Album album) {
+ if (album == null) {
+ throw new IllegalArgumentException("Null album");
+ }
+ album.setOwner(null);
+ childAlbums.remove(album);
+ }
+}
\ No newline at end of file
Property changes on: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/domain/User.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/AlbumAction.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/AlbumAction.java (rev 0)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/AlbumAction.java 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,59 @@
+package org.richfaces.realworld.service;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.PersistenceContextType;
+
+import org.jboss.seam.annotations.Destroy;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+import org.richfaces.realworld.domain.Album;
+import org.richfaces.realworld.domain.User;
+
+@Stateful
+@Name("albumAction")
+public class AlbumAction implements IAlbumAction {
+ @PersistenceContext(unitName = "realworld", type=PersistenceContextType.EXTENDED)
+ EntityManager em;
+
+ @In @Out
+ private User user;
+
+ /* (non-Javadoc)
+ * @see org.richfaces.realworld.service.IAlbumAction#addAlbum()
+ */
+ public void addAlbum(Album album) {
+ em.persist(album);
+ user.addAlbum(album);
+ em.flush();
+ }
+
+ public void deleteAlbum(Album album){
+ user.removeAlbum(album);
+ em.flush();
+ }
+
+ public void editAlbum(Album album){
+ em.merge(album);
+ em.flush();
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.realworld.service.IAlbumAction#remove()
+ */
+ @Remove
+ public void remove(){
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.realworld.service.IAlbumAction#destroy()
+ */
+ @Destroy
+ public void destroy(){
+
+ }
+}
Property changes on: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/AlbumAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IAlbumAction.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IAlbumAction.java (rev 0)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IAlbumAction.java 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,22 @@
+package org.richfaces.realworld.service;
+
+import javax.ejb.Remove;
+
+import org.jboss.seam.annotations.Destroy;
+import org.richfaces.realworld.domain.Album;
+
+public interface IAlbumAction {
+
+ public abstract void addAlbum(Album album);
+
+ @Remove
+ public abstract void remove();
+
+ public void deleteAlbum(Album album);
+
+ public void editAlbum(Album album);
+
+ @Destroy
+ public abstract void destroy();
+
+}
\ No newline at end of file
Property changes on: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IAlbumAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IImageAction.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IImageAction.java (rev 0)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IImageAction.java 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,32 @@
+package org.richfaces.realworld.service;
+
+import javax.ejb.Remove;
+
+import org.jboss.seam.annotations.Destroy;
+import org.richfaces.realworld.domain.Album;
+import org.richfaces.realworld.domain.Image;
+
+public interface IImageAction {
+
+ /* (non-Javadoc)
+ * @see org.richfaces.realworld.service.IAlbumAction#addAlbum()
+ */
+ public abstract void addAlbum(Album album);
+
+ public abstract void deleteImage(Image image);
+
+ public abstract void editImage(Image image, boolean parentChanged);
+
+ /* (non-Javadoc)
+ * @see org.richfaces.realworld.service.IAlbumAction#remove()
+ */
+ @Remove
+ public abstract void remove();
+
+ /* (non-Javadoc)
+ * @see org.richfaces.realworld.service.IAlbumAction#destroy()
+ */
+ @Destroy
+ public abstract void destroy();
+
+}
\ No newline at end of file
Property changes on: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IImageAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IUserAction.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IUserAction.java (rev 0)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IUserAction.java 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,17 @@
+package org.richfaces.realworld.service;
+
+import javax.ejb.Local;
+import javax.ejb.Remote;
+import javax.ejb.Remove;
+
+import org.jboss.seam.annotations.Destroy;
+
+@Local
+public interface IUserAction {
+ public boolean login(String username, String password);
+ @Remove
+ public void remove();
+
+ @Destroy
+ public void destroy();
+}
\ No newline at end of file
Property changes on: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/IUserAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java (rev 0)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,75 @@
+package org.richfaces.realworld.service;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.PersistenceContextType;
+
+import org.jboss.seam.annotations.Destroy;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+import org.richfaces.realworld.domain.Album;
+import org.richfaces.realworld.domain.Image;
+import org.richfaces.realworld.domain.User;
+
+@Stateful
+@Name("imageAction")
+public class ImageAction implements IImageAction {
+ @PersistenceContext(unitName = "realworld", type=PersistenceContextType.EXTENDED)
+ EntityManager em;
+
+ /* (non-Javadoc)
+ * @see org.richfaces.realworld.service.IAlbumAction#addAlbum()
+ */
+ /* (non-Javadoc)
+ * @see org.richfaces.realworld.service.IImageAction#addAlbum(org.richfaces.realworld.domain.Album)
+ */
+ public void addAlbum(Album album) {
+ //em.persist(album);
+ //user.addAlbum(album);
+ //em.flush();
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.realworld.service.IImageAction#deleteImage(org.richfaces.realworld.domain.Image)
+ */
+ public void deleteImage(Image image){
+ image.getAlbum().removeImage(image);
+ em.flush();
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.realworld.service.IAlbumAction#remove()
+ */
+ /* (non-Javadoc)
+ * @see org.richfaces.realworld.service.IImageAction#remove()
+ */
+ @Remove
+ public void remove(){
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.realworld.service.IAlbumAction#destroy()
+ */
+ /* (non-Javadoc)
+ * @see org.richfaces.realworld.service.IImageAction#destroy()
+ */
+ @Destroy
+ public void destroy(){
+
+ }
+
+ public void editImage(Image image, boolean parentChanged) {
+ em.merge(image);
+ if(parentChanged){
+ image.getAlbum().removeImage(image);
+ Album album = (Album)em.createQuery("from Album a where a.name=:albumName").setParameter("albumName", image.getAlbumName()).getSingleResult();
+ album.addImage(image);
+ em.merge(album);
+ }
+ em.flush();
+ }
+}
Property changes on: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/ImageAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/UserAction.java
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/UserAction.java (rev 0)
+++ trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/UserAction.java 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,46 @@
+package org.richfaces.realworld.service;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.ejb.Stateless;
+import javax.persistence.EntityManager;
+import javax.persistence.PersistenceContext;
+import javax.persistence.PersistenceContextType;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.AutoCreate;
+import org.jboss.seam.annotations.Destroy;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.Scope;
+import org.richfaces.realworld.domain.User;
+
+@Stateful
+@Name("userAction")
+public class UserAction implements IUserAction {
+
+ @PersistenceContext(unitName = "realworld", type=PersistenceContextType.EXTENDED)
+ EntityManager em;
+
+ @In(create = true, required = true) @Out
+ private User user;
+
+ public boolean login(String username, String password) {
+ user = (User)em.createQuery("from User u where u.login = :username and u.password = :password")
+ .setParameter("username", username)
+ .setParameter("password", password)
+ .getSingleResult();
+ return user != null;
+ }
+
+ @Remove
+ public void remove(){
+
+ }
+
+ @Destroy
+ public void destroy(){
+
+ }
+}
\ No newline at end of file
Property changes on: trunk/test-applications/realworld/ejb/src/main/java/org/richfaces/realworld/service/UserAction.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/ejb/src/main/resources/META-INF/ejb-jar.xml
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/resources/META-INF/ejb-jar.xml (rev 0)
+++ trunk/test-applications/realworld/ejb/src/main/resources/META-INF/ejb-jar.xml 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ejb-jar xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd"
+ version="3.0">
+
+ <interceptors>
+ <interceptor>
+ <interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
+ </interceptor>
+ </interceptors>
+
+ <assembly-descriptor>
+ <interceptor-binding>
+ <ejb-name>*</ejb-name>
+ <interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
+ </interceptor-binding>
+ </assembly-descriptor>
+
+</ejb-jar>
\ No newline at end of file
Property changes on: trunk/test-applications/realworld/ejb/src/main/resources/META-INF/ejb-jar.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/ejb/src/main/resources/META-INF/persistence.xml
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/resources/META-INF/persistence.xml (rev 0)
+++ trunk/test-applications/realworld/ejb/src/main/resources/META-INF/persistence.xml 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Persistence deployment descriptor for dev profile -->
+<persistence xmlns="http://java.sun.com/xml/ns/persistence"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
+ version="1.0">
+
+ <persistence-unit name="realworld">
+ <provider>org.hibernate.ejb.HibernatePersistence</provider>
+ <jta-data-source>java:/realWorldDatasource</jta-data-source>
+ <properties>
+ <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
+ <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
+ <property name="hibernate.show_sql" value="true"/>
+ <property name="hibernate.format_sql" value="true"/>
+ </properties>
+ </persistence-unit>
+
+</persistence>
Property changes on: trunk/test-applications/realworld/ejb/src/main/resources/META-INF/persistence.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/ejb/src/main/resources/components.properties
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/resources/components.properties (rev 0)
+++ trunk/test-applications/realworld/ejb/src/main/resources/components.properties 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,4 @@
+#
+#Mon Sep 15 14:29:32 EEST 2008
+jndiPattern=realworld-ear-1.0-SNAPSHOT/#{ejbName}/local
+embeddedEjb=false
Property changes on: trunk/test-applications/realworld/ejb/src/main/resources/components.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/ejb/src/main/resources/import.sql
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/resources/import.sql (rev 0)
+++ trunk/test-applications/realworld/ejb/src/main/resources/import.sql 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,25 @@
+INSERT INTO Users(user_id, obj_version, firstname, secondname, email, avatarpath, login, password, birthdate) VALUES (1, 0, 'Andrey', 'Markhel', 'amarkhel(a)exadel.com', 'avatar.gif', 'amarkhel', '12345', '1985-01-08');
+INSERT INTO albums(album_id, obj_version, name, description, shared, album_user_id) VALUES (1, 0, 'Album 1', 'Simple Album', true, 1);
+INSERT INTO albums(album_id, obj_version, name, description, shared, album_user_id) VALUES (2, 0, 'Album 2', 'Simple Album 2', false, 1);
+INSERT INTO albums(album_id, obj_version, name, description, shared, album_user_id) VALUES (3, 0, 'Album 3', 'Simple Album 3', false, 1);
+INSERT INTO images(image_id, obj_version, name, path, description, shared, created, img_album_id) VALUES (1, 0, 'Picture 1', 'pic1.jpg', 'Just picture', true, '1985-01-08', 1);
+INSERT INTO images(image_id, obj_version, name, path, description, shared, created, img_album_id) VALUES (2, 0, 'Picture 2', 'pic2.jpg', 'Just picture', true, '1985-01-08', 1);
+INSERT INTO images(image_id, obj_version, name, path, description, shared, created, img_album_id) VALUES (3, 0, 'Picture 33', 'pic3.jpg', 'Just picture', true, '1985-01-08', 1);
+INSERT INTO images(image_id, obj_version, name, path, description, shared, created, img_album_id) VALUES (4, 0, 'Picture 2', 'pic4.jpg', 'Just picture', true, '1985-01-08', 2);
+INSERT INTO images(image_id, obj_version, name, path, description, shared, created, img_album_id) VALUES (5, 0, 'Picture 3', 'pic5.jpg', 'Just picture', true, '1985-01-08', 2);
+INSERT INTO images(image_id, obj_version, name, path, description, shared, created, img_album_id) VALUES (6, 0, 'Picture 4', 'pic6.jpg', 'Just picture', true, '1985-01-08', 2);
+INSERT INTO images(image_id, obj_version, name, path, description, shared, created, img_album_id) VALUES (7, 0, 'Picture 5', 'pic7.jpg', 'Just picture', true, '1985-01-08', 2);
+INSERT INTO images(image_id, obj_version, name, path, description, shared, created, img_album_id) VALUES (8, 0, 'Picture 1', 'pic8.jpg', 'Just picture', true, '1985-01-08', 3);
+INSERT INTO images(image_id, obj_version, name, path, description, shared, created, img_album_id) VALUES (9, 0, 'Picture 2', 'pic9.jpg', 'Just picture', true, '1985-01-08', 3);
+INSERT INTO image_tags(image_id, tag) VALUES (1, 'Cool');
+INSERT INTO image_tags(image_id, tag) VALUES (1, 'Cool2');
+INSERT INTO image_tags(image_id, tag) VALUES (2, 'Cool');
+INSERT INTO image_tags(image_id, tag) VALUES (3, 'Cool');
+INSERT INTO image_tags(image_id, tag) VALUES (4, 'Cool');
+INSERT INTO image_tags(image_id, tag) VALUES (5, 'Cool');
+INSERT INTO image_tags(image_id, tag) VALUES (6, 'Cool');
+INSERT INTO image_tags(image_id, tag) VALUES (7, 'Cool');
+INSERT INTO image_tags(image_id, tag) VALUES (7, 'Cool2');
+INSERT INTO image_tags(image_id, tag) VALUES (7, 'Cool3');
+INSERT INTO image_tags(image_id, tag) VALUES (8, 'Cool');
+INSERT INTO image_tags(image_id, tag) VALUES (9, 'Cool');
\ No newline at end of file
Property changes on: trunk/test-applications/realworld/ejb/src/main/resources/import.sql
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/ejb/src/main/resources/realworld-ds.xml
===================================================================
--- trunk/test-applications/realworld/ejb/src/main/resources/realworld-ds.xml (rev 0)
+++ trunk/test-applications/realworld/ejb/src/main/resources/realworld-ds.xml 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE datasources
+ PUBLIC "-//JBoss//DTD JBOSS JCA Config 1.5//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd">
+
+<datasources>
+ <local-tx-datasource>
+ <jndi-name>realWorldDatasource</jndi-name>
+ <!-- <connection-url>jdbc:postgresql://localhost:5432/realworld</connection-url>
+ <driver-class>org.postgresql.Driver</driver-class>
+ <user-name>realworld</user-name>
+ <password>realworld</password>-->
+ <connection-url>jdbc:hsqldb:.</connection-url>
+ <driver-class>org.hsqldb.jdbcDriver</driver-class>
+ <user-name>sa</user-name>
+ <password></password>
+ </local-tx-datasource>
+
+</datasources>
+
Property changes on: trunk/test-applications/realworld/ejb/src/main/resources/realworld-ds.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/ejb/src/main/resources/seam.properties
===================================================================
Property changes on: trunk/test-applications/realworld/ejb/src/main/resources/seam.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/pom.xml
===================================================================
--- trunk/test-applications/realworld/pom.xml (rev 0)
+++ trunk/test-applications/realworld/pom.xml 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,84 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces</groupId>
+ <artifactId>realworld</artifactId>
+ <packaging>pom</packaging>
+ <version>1.0-SNAPSHOT</version>
+ <name>sample application</name>
+ <parent>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>root</artifactId>
+ <version>2.0.1.GA</version>
+ </parent>
+
+ <properties>
+ <projectName>realworld</projectName>
+ <richfacesVersion>3.3.0-SNAPSHOT</richfacesVersion>
+ <seamVersion>2.0.1.GA</seamVersion>
+ <jbossDownloadURL>http://downloads.sourceforge.net/jboss/jboss-4.2.3.GA.zip</jbossDownloadURL>
+ <jbossDeployDir>jboss-4.2.3.GA/jboss-4.2.3.GA/server/default/</jbossDeployDir>
+ <droolsVersion>4.0.0</droolsVersion>
+ <faceletsVersion>1.1.14</faceletsVersion>
+ <installDir>E:/apps/jboss</installDir>
+ </properties>
+ <repositories>
+ <repository>
+ <id>repository.jboss.com</id>
+ <name>Jboss Repository for Maven</name>
+ <url>http://repository.jboss.com/maven2/</url>
+ </repository>
+ <repository>
+ <id>repository.exadel.com</id>
+ <name>Exadel Maven 2 Repository</name>
+ <url>http://repository.exadel.com/</url>
+ </repository>
+ </repositories>
+ <modules>
+ <module>ear</module>
+ <module>ejb</module>
+ <module>web</module>
+ </modules>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-ejb-plugin</artifactId>
+ <configuration>
+ <ejbVersion>3.0</ejbVersion>
+ </configuration>
+ </plugin>
+ </plugins>
+
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-eclipse-plugin</artifactId>
+ <version>2.5</version>
+ <configuration>
+ <downloadSources>true</downloadSources>
+ <downloadJavadocs>false</downloadJavadocs>
+ <projectNameTemplate>[artifactId]-[version]</projectNameTemplate>
+ <wtpmanifest>true</wtpmanifest>
+ <wtpapplicationxml>true</wtpapplicationxml>
+ <wtpversion>2.0</wtpversion>
+ <classpathContainers>
+ <classpathContainer>org.eclipse.jdt.launching.JDK_CONTAINER</classpathContainer>
+ </classpathContainers>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+</project>
\ No newline at end of file
Property changes on: trunk/test-applications/realworld/pom.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
Property changes on: trunk/test-applications/realworld/web
___________________________________________________________________
Name: svn:ignore
+ am
target
.settings
.classpath
.project
Added: trunk/test-applications/realworld/web/META-INF/MANIFEST.MF
===================================================================
--- trunk/test-applications/realworld/web/META-INF/MANIFEST.MF (rev 0)
+++ trunk/test-applications/realworld/web/META-INF/MANIFEST.MF 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,7 @@
+Manifest-Version: 1.0
+Class-Path: avalon-framework-4.1.3.jar commons-beanutils-1.7.0.jar com
+ mons-digester-1.8.jar commons-logging-1.1.jar jboss-seam-debug-2.0.1.
+ GA.jar jboss-seam-remoting-2.0.1.GA.jar jboss-seam-ui-2.0.1.GA.jar js
+ f-facelets-1.1.14.jar log4j-1.2.14.jar logkit-1.0.1.jar richfaces-imp
+ l-3.3.0-SNAPSHOT.jar richfaces-ui-3.3.0-SNAPSHOT.jar
+
Property changes on: trunk/test-applications/realworld/web/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/web/pom.xml
===================================================================
--- trunk/test-applications/realworld/web/pom.xml (rev 0)
+++ trunk/test-applications/realworld/web/pom.xml 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,185 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.richfaces</groupId>
+ <artifactId>realworld</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <artifactId>${projectName}-web</artifactId>
+ <name>WAR module</name>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>war</packaging>
+ <dependencies>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ <version>1.2_08</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <version>1.2_08</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-validator</artifactId>
+ <version>3.0.0.ga</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-annotations</artifactId>
+ <version>3.3.0.ga</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.persistence</groupId>
+ <artifactId>persistence-api</artifactId>
+ <version>1.0</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam-remoting</artifactId>
+ <version>${seamVersion}</version>
+ <exclusions>
+ <exclusion>
+ <artifactId>javassist</artifactId>
+ <groupId>jboss</groupId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ </exclusion>
+ <exclusion>
+ <artifactId>dom4j</artifactId>
+ <groupId>dom4j</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ <version>${seamVersion}</version>
+ <scope>provided</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam-pdf</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.sun.facelets</groupId>
+ <artifactId>jsf-facelets</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam-ui</artifactId>
+ <version>${seamVersion}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ </exclusion>
+ <exclusion>
+ <artifactId>commons-beanutils</artifactId>
+ <groupId>commons-beanutils</groupId>
+ </exclusion>
+ <exclusion>
+ <artifactId>commons-digester</artifactId>
+ <groupId>commons-digester</groupId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam-debug</artifactId>
+ <version>${seamVersion}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam-pdf</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.sun.facelets</groupId>
+ <artifactId>jsf-facelets</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.jboss.seam</groupId>
+ <artifactId>jboss-seam</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.facelets</groupId>
+ <artifactId>jsf-facelets</artifactId>
+ <version>${faceletsVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.framework</groupId>
+ <artifactId>richfaces-impl</artifactId>
+ <version>${richfacesVersion}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.richfaces.framework</groupId>
+ <artifactId>richfaces-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.ui</groupId>
+ <artifactId>richfaces-ui</artifactId>
+ <version>${richfacesVersion}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces.framework</groupId>
+ <artifactId>richfaces-api</artifactId>
+ <version>${richfacesVersion}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.richfaces</groupId>
+ <artifactId>${projectName}-ejb</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <type>ejb</type>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Property changes on: trunk/test-applications/realworld/web/pom.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/AvatarUpload.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/AvatarUpload.java (rev 0)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/AvatarUpload.java 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,63 @@
+package org.richfaces.realworld.fileupload;
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+import org.richfaces.event.UploadEvent;
+import org.richfaces.model.UploadItem;
+import org.richfaces.realworld.domain.User;
+
+@Name("avatarUpload")
+public class AvatarUpload {
+
+ @In @Out
+ private User user;
+
+ @In(create=true)
+ private FileManager fileManager;
+
+ private FileItem avatarItem;
+
+ private boolean autoUpload = false;
+
+ public void avatarListener(UploadEvent event){
+ //UploadItem item = event.getUploadItem();
+ //System.out.println("File : '" + item.getFileName() + "' was uploaded");
+ //try {
+ UploadItem item = event.getUploadItem();
+ FileItem file = new FileItem();
+ file.setLength(item.getData().length);
+ file.setName(item.getFileName());
+ file.setData(item.getData());
+ this.setAvatarItem(file);
+ //fileManager.deleteAllFromDirectory(user.getLogin()+fileManager.getFileSeparator()+"avatars");
+ //fileManager.addImage(user.getLogin()+fileManager.getFileSeparator()+normaliseFileName(item.getFileName()), item.getData());
+ //user.setAvatarPath(normaliseFileName(item.getFileName()));
+ //} catch (Exception e) {
+ // TODO: handle exception
+ //facesMessages.add("Error during fileUpload");
+ //}
+ }
+
+ public synchronized void paintAvatar(OutputStream stream, Object object) throws IOException {
+ stream.write(this.getAvatarItem().getData());
+ }
+ public boolean isAutoUpload() {
+ return autoUpload;
+ }
+
+ public void setAutoUpload(boolean autoUpload) {
+ this.autoUpload = autoUpload;
+ }
+
+ public FileItem getAvatarItem() {
+ return avatarItem;
+ }
+
+ public void setAvatarItem(FileItem avatarItem) {
+ this.avatarItem = avatarItem;
+ }
+}
Property changes on: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/AvatarUpload.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: 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 (rev 0)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileItem.java 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,53 @@
+package org.richfaces.realworld.fileupload;
+
+public class FileItem {
+
+ private String Name;
+ private String mime;
+ private boolean selected;
+ private long length;
+ private byte[] data;
+ public byte[] getData() {
+ return data;
+ }
+ public void setData(byte[] data) {
+ this.data = data;
+ }
+ public String getName() {
+ return Name;
+ }
+ public void setName(String name) {
+ Name = name;
+ int extDot = name.lastIndexOf('.');
+ if(extDot > 0){
+ String extension = name.substring(extDot +1);
+ if("bmp".equals(extension)){
+ mime="image/bmp";
+ } else if("jpg".equals(extension)){
+ mime="image/jpeg";
+ } else if("gif".equals(extension)){
+ mime="image/gif";
+ } else if("png".equals(extension)){
+ mime="image/png";
+ } else {
+ mime = "image/unknown";
+ }
+ }
+ }
+ public long getLength() {
+ return length;
+ }
+ public void setLength(long length) {
+ this.length = length;
+ }
+
+ public String getMime(){
+ return mime;
+ }
+ public boolean isSelected() {
+ return selected;
+ }
+ public void setSelected(boolean selected) {
+ this.selected = selected;
+ }
+}
Property changes on: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileItem.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: 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 (rev 0)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileManager.java 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,139 @@
+package org.richfaces.realworld.fileupload;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+
+import javax.faces.context.FacesContext;
+
+import org.jboss.seam.annotations.Name;
+
+@Name("fileManager")
+public class FileManager {
+
+
+private String uploadRoot;
+
+
+ public String getUploadRoot() {
+ return uploadRoot;
+ }
+
+ public void setUploadRoot(String uploadRoot) {
+ this.uploadRoot = uploadRoot;
+ }
+
+ public FileManager(){
+ FacesContext fc = FacesContext.getCurrentInstance();
+ this.setUploadRoot(fc.getExternalContext().getInitParameter("uploadRoot"));
+ }
+
+ public String getFileSeparator() {
+ return System.getProperty("file.separator");
+ }
+
+ public boolean isDirectoryPresent(String directory) {
+ String fullPath = getAbsolutePath(directory);
+ File file = new File(fullPath);
+ return file.exists() && file.isDirectory();
+ }
+
+ public void deleteDirectory(String directory) {
+ String fullPath = getAbsolutePath(directory);
+ File file = new File(fullPath);
+ if(file.exists()){
+ for(String f :file.list()){
+ File temp = new File(fullPath+getFileSeparator()+f);
+ temp.delete();
+ }
+ file.delete();
+ }
+ }
+
+ public void renameDirectory(String directoryOld, String directoryNew) throws Exception {
+ String fullPath = getAbsolutePath(directoryOld);
+ File fileOld = new File(fullPath);
+ File fileNew = new File(getUploadRoot() + directoryNew);
+ createDirectoryIfNotExist(directoryNew);
+ if(fileNew.exists())
+ if( fileNew.isDirectory() ){
+ throw new Exception("exc");
+ }else{
+ fileNew.delete();
+ }
+ fileOld.renameTo(fileNew);
+ }
+
+ public void addDirectory(String directory) {
+ String fullPath = getAbsolutePath(directory);
+ File file = new File(fullPath);
+ file.mkdirs();
+ }
+
+ public void addImage(String fileName, byte[] data) throws IOException {
+ createDirectoryIfNotExist(fileName);
+ FileOutputStream b = new FileOutputStream(getUploadRoot() + fileName);
+ b.write(data);
+ b.close();
+ }
+
+ public void deleteAllFromDirectory(String directory){
+ String fullPath = getAbsolutePath(directory);
+ File file = new File(fullPath);
+ if(file.exists()){
+ for(String f :file.list()){
+ File temp = new File(fullPath+getFileSeparator()+f);
+ temp.delete();
+ }
+ }else{
+ file.mkdirs();
+ }
+ }
+
+ public void deleteImage(String fileName) {
+ String fullPath = getAbsolutePath(fileName);
+ File file = new File(fullPath);
+ if(file.exists()){
+ file.delete();
+ }
+ }
+
+ public void renameImage(String fileNameOld, String fileNameNew) {
+ createDirectoryIfNotExist(fileNameNew);
+ String fullPath = getAbsolutePath(fileNameOld);
+ File fileOld = new File(fullPath);
+ File fileNew = new File(getAbsolutePath(fileNameNew));
+ if(fileNew.exists()){
+ fileNew.delete();
+ }
+ fileOld.renameTo(fileNew);
+ }
+
+ private void createDirectoryIfNotExist(String fileNameNew) {
+ int lastIndexOf = fileNameNew.lastIndexOf(getFileSeparator());
+ if(lastIndexOf > 0){
+ String directory = fileNameNew.substring(0, lastIndexOf);
+ File file = new File(getUploadRoot()+directory);
+ if(!file.exists()){
+ file.mkdirs();
+ }
+ }
+ }
+
+ public boolean isImagePresent(String fileName) {
+ String fullPath = getAbsolutePath(fileName);
+ File file = new File(fullPath);
+ return file.exists() && !file.isDirectory();
+ }
+
+ public File getImage(String fileName){
+ if(isImagePresent(fileName)){
+ return new File(getAbsolutePath(fileName));
+ }
+ return null;
+ }
+
+ private String getAbsolutePath(String fileName) {
+ return getUploadRoot() + fileName;
+ }
+}
Property changes on: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileManager.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileTest.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileTest.java (rev 0)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileTest.java 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,104 @@
+package org.richfaces.realworld.fileupload;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+
+public class FileTest {
+
+ private String uploadRoot = "F:/Upload/";
+
+ public String getUploadRoot() {
+ return uploadRoot;
+ }
+
+ private String getFileSeparator() {
+ return System.getProperty("file.separator");
+ }
+
+ public boolean isDirectoryPresent(String directory) {
+ String fullPath = getAbsolutePath(directory);
+ File file = new File(fullPath);
+ return file.exists() && file.isDirectory();
+ }
+
+ public void deleteDirectory(String directory) {
+ String fullPath = getAbsolutePath(directory);
+ File file = new File(fullPath);
+ if(file.exists()){
+ for(String f :file.list()){
+ File temp = new File(fullPath+getFileSeparator()+f);
+ temp.delete();
+ }
+ file.delete();
+ }
+ }
+
+ public void renameDirectory(String directoryOld, String directoryNew) throws Exception {
+ String fullPath = getAbsolutePath(directoryOld);
+ File fileOld = new File(fullPath);
+ File fileNew = new File(getUploadRoot() + directoryNew);
+ createDirectoryIfNotExist(directoryNew);
+ if(fileNew.exists())
+ if( fileNew.isDirectory() ){
+ throw new Exception("exc");
+ }else{
+ fileNew.delete();
+ }
+ fileOld.renameTo(fileNew);
+ }
+
+ public void addDirectory(String directory) {
+ String fullPath = getAbsolutePath(directory);
+ File file = new File(fullPath);
+ file.mkdirs();
+ }
+
+ public void addImage(String fileName, byte[] data) throws IOException {
+ createDirectoryIfNotExist(fileName);
+ FileOutputStream b = new FileOutputStream(getUploadRoot() + fileName);
+ b.write(data);
+ b.close();
+ }
+
+ public void deleteImage(String fileName) {
+ String fullPath = getAbsolutePath(fileName);
+ File file = new File(fullPath);
+ if(file.exists()){
+ file.delete();
+ }
+ }
+
+ public void renameImage(String fileNameOld, String fileNameNew) {
+ createDirectoryIfNotExist(fileNameNew);
+ String fullPath = getAbsolutePath(fileNameOld);
+ File fileOld = new File(fullPath);
+ File fileNew = new File(getAbsolutePath(fileNameNew));
+ if(fileNew.exists()){
+ fileNew.delete();
+ }
+ fileOld.renameTo(fileNew);
+ }
+
+ private void createDirectoryIfNotExist(String fileNameNew) {
+ int lastIndexOf = fileNameNew.lastIndexOf(getFileSeparator());
+ if(lastIndexOf > 0){
+ String directory = fileNameNew.substring(0, lastIndexOf);
+ File file = new File(getUploadRoot()+directory);
+ if(!file.exists()){
+ file.mkdirs();
+ }
+ }
+ }
+
+ public boolean isImagePresent(String fileName) {
+ String fullPath = getAbsolutePath(fileName);
+ File file = new File(fullPath);
+ return file.exists() && !file.isDirectory();
+ }
+
+ private String getAbsolutePath(String fileName) {
+ return getUploadRoot() + fileName;
+ }
+
+}
Property changes on: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileTestTest.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileTestTest.java (rev 0)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileTestTest.java 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,129 @@
+package org.richfaces.realworld.fileupload;
+
+import java.io.IOException;
+
+import junit.framework.TestCase;
+
+public class FileTestTest extends TestCase {
+
+ FileTest fileManager = new FileTest();
+
+ private byte[] image = new byte[40];
+
+ public void testIsDirectoryPresent() {
+ fileManager.addDirectory("amarkhel");
+ assertEquals(fileManager.isDirectoryPresent("amarkhel"), true);
+ assertEquals(fileManager.isDirectoryPresent("amarkhel2"), false);
+ fileManager.deleteDirectory("amarkhel");
+ }
+
+ public void testDeleteDirectory() {
+ fileManager.addDirectory("amarkhel");
+ assertEquals(fileManager.isDirectoryPresent("amarkhel"), true);
+ fileManager.deleteDirectory("amarkhel");
+ assertEquals(fileManager.isDirectoryPresent("amarkhel"), false);
+ }
+
+ public void testRenameDirectory() throws Exception {
+ fileManager.addDirectory("amarkhel");
+ assertEquals(fileManager.isDirectoryPresent("amarkhel"), true);
+ fileManager.renameDirectory("amarkhel", "amarkhel2");
+ assertEquals(fileManager.isDirectoryPresent("amarkhel"), false);
+ assertEquals(fileManager.isDirectoryPresent("amarkhel2"), true);
+ fileManager.deleteDirectory("amarkhel2");
+ }
+
+ public void testRenameDirectory2(){
+ fileManager.addDirectory("amarkhel");
+ fileManager.addDirectory("amarkhel2");
+ assertEquals(fileManager.isDirectoryPresent("amarkhel"), true);
+ try {
+ fileManager.renameDirectory("amarkhel", "amarkhel2");
+ } catch (Exception e) {
+ assertTrue(true);
+ }
+
+ assertEquals(fileManager.isDirectoryPresent("amarkhel"), true);
+ assertEquals(fileManager.isDirectoryPresent("amarkhel2"), true);
+ fileManager.deleteDirectory("amarkhel");
+ fileManager.deleteDirectory("amarkhel2");
+ }
+
+ public void testRenameDirectory3() throws Exception {
+ fileManager.addDirectory("a"+System.getProperty("file.separator")+"amarkhel");
+ assertEquals(fileManager.isDirectoryPresent("a"+System.getProperty("file.separator")+"amarkhel"), true);
+ fileManager.renameDirectory("a"+System.getProperty("file.separator")+"amarkhel", "b"+System.getProperty("file.separator")+"amarkhel");
+ assertEquals(fileManager.isDirectoryPresent("a"+System.getProperty("file.separator")+"amarkhel"), false);
+ assertEquals(fileManager.isDirectoryPresent("b"+System.getProperty("file.separator")+"amarkhel"), true);
+ fileManager.deleteDirectory("b"+System.getProperty("file.separator")+"amarkhel");
+ }
+
+ public void testRenameDirectory4() throws Exception {
+ fileManager.addDirectory("a"+System.getProperty("file.separator")+"a"+System.getProperty("file.separator")+"amarkhel");
+ assertEquals(fileManager.isDirectoryPresent("a"+System.getProperty("file.separator")+"a"+System.getProperty("file.separator")+"amarkhel"), true);
+ fileManager.renameDirectory("a"+System.getProperty("file.separator")+"a"+System.getProperty("file.separator")+"amarkhel", "b"+System.getProperty("file.separator")+"b"+System.getProperty("file.separator")+"amarkhel");
+ assertEquals(fileManager.isDirectoryPresent("a"+System.getProperty("file.separator")+"a"+System.getProperty("file.separator")+"amarkhel"), false);
+ assertEquals(fileManager.isDirectoryPresent("b"+System.getProperty("file.separator")+"b"+System.getProperty("file.separator")+"amarkhel"), true);
+ fileManager.deleteDirectory("b"+System.getProperty("file.separator")+"b"+System.getProperty("file.separator")+"amarkhel");
+ }
+
+ public void testAddDirectory() {
+ assertEquals(fileManager.isDirectoryPresent("amarkhel"), false);
+ fileManager.addDirectory("amarkhel");
+ assertEquals(fileManager.isDirectoryPresent("amarkhel"), true);
+ fileManager.deleteDirectory("amarkhel");
+ }
+
+ public void testAddDirectory2() {
+ assertEquals(fileManager.isDirectoryPresent("a"+System.getProperty("file.separator")+"amarkhel"), false);
+ fileManager.addDirectory("a"+System.getProperty("file.separator")+"amarkhel");
+ assertEquals(fileManager.isDirectoryPresent("a"+System.getProperty("file.separator")+"amarkhel"), true);
+ fileManager.deleteDirectory("a"+System.getProperty("file.separator")+"amarkhel");
+ }
+
+ public void testAddImage() throws IOException {
+ assertEquals(fileManager.isImagePresent("amarkhel.gif"), false);
+ fileManager.addImage("amarkhel.gif", image);
+ assertEquals(fileManager.isImagePresent("amarkhel.gif"), true);
+ fileManager.deleteImage("amarkhel.gif");
+ }
+
+ public void testDeleteImage() throws IOException {
+ fileManager.addImage("amarkhel.gif", image);
+ assertEquals(fileManager.isImagePresent("amarkhel.gif"), true);
+ fileManager.deleteImage("amarkhel.gif");
+ assertEquals(fileManager.isImagePresent("amarkhel.gif"), false);
+ }
+
+ public void testRenameImage() throws IOException {
+ fileManager.addImage("amarkhel.gif", image);
+ assertEquals(fileManager.isImagePresent("amarkhel.gif"), true);
+ fileManager.renameImage("amarkhel.gif", "amarkhel2.gif");
+ assertEquals(fileManager.isImagePresent("amarkhel.gif"), false);
+ assertEquals(fileManager.isImagePresent("amarkhel2.gif"), true);
+ fileManager.deleteImage("amarkhel2.gif");
+ }
+
+ public void testRenameImage2() throws IOException {
+ fileManager.addImage("a"+System.getProperty("file.separator")+"amarkhel.gif", image);
+ assertEquals(fileManager.isImagePresent("a"+System.getProperty("file.separator")+"amarkhel.gif"), true);
+ fileManager.renameImage("a"+System.getProperty("file.separator")+"amarkhel.gif", "b"+System.getProperty("file.separator")+"amarkhel2.gif");
+ assertEquals(fileManager.isImagePresent("a"+System.getProperty("file.separator")+"amarkhel.gif"), false);
+ assertEquals(fileManager.isImagePresent("b"+System.getProperty("file.separator")+"amarkhel2.gif"), true);
+ fileManager.deleteImage("b"+System.getProperty("file.separator")+"amarkhel2.gif");
+ fileManager.deleteDirectory("b");
+ fileManager.deleteDirectory("a");
+ }
+
+ public void testIsImagePresent() throws IOException {
+ fileManager.addImage("amarkhel.gif", image);
+ assertEquals(fileManager.isImagePresent("amarkhel.gif"), true);
+ assertEquals(fileManager.isImagePresent("amarkhel3.gif"), false);
+ fileManager.deleteImage("amarkhel.gif");
+ fileManager.addImage("am"+System.getProperty("file.separator")+"amarkhel.gif", image);
+ assertEquals(fileManager.isImagePresent("am"+System.getProperty("file.separator")+"amarkhel.gif"), true);
+ fileManager.deleteImage("am"+System.getProperty("file.separator")+"amarkhel.gif");
+ fileManager.deleteDirectory("am");
+ }
+
+}
Property changes on: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileTestTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: 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 (rev 0)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileUploadBean.java 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,131 @@
+/**
+ * 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.IOException;
+import java.io.OutputStream;
+import java.util.ArrayList;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.Synchronized;
+import org.jboss.seam.faces.FacesMessages;
+import org.richfaces.event.UploadEvent;
+import org.richfaces.model.UploadItem;
+import org.richfaces.realworld.domain.User;
+
+/**
+ * @author $Autor$
+ *
+ */
+@Name("fileUploadBean")
+(a)Scope(ScopeType.SESSION)
+@Synchronized(timeout=2000)
+public class FileUploadBean {
+
+ @In(create=true)
+ private FileManager fileManager;
+
+ @In FacesMessages facesMessages;
+
+ private ArrayList<FileItem> files = new ArrayList<FileItem>();
+ private boolean autoUpload = false;
+ public int getSize() {
+ if (getFiles().size()>0){
+ return getFiles().size();
+ }else
+ {
+ return 0;
+ }
+ }
+
+ public synchronized void paint(OutputStream stream, Object object) throws IOException {
+ stream.write(getFiles().get((Integer)object).getData());
+ }
+
+ public synchronized void listener(UploadEvent event) throws Exception{
+ UploadItem item = event.getUploadItem();
+ FileItem file = new FileItem();
+ file.setLength(item.getData().length);
+ file.setName(item.getFileName());
+ file.setData(item.getData());
+ file.setSelected(false);
+ files.add(file);
+ }
+
+ public void clearUploadData() {
+ files.clear();
+ }
+
+ public void clearSelectedData() {
+ for(int i = 0; i < files.size(); i++){
+ if(files.get(i).isSelected()){
+ files.remove(i);
+ }
+ }
+ }
+
+ public void storeSelectedData() {
+ for(FileItem file:files){
+ if(file.isSelected()){
+ //TODO
+ //Save file to disk
+ //Update tree
+ //Update domain model
+ }
+ }
+ }
+
+ public void storeAll() {
+ for(FileItem file:files){
+ //TODO
+ //Save file to disk
+ //Update tree
+ //Update domain model
+ }
+ }
+
+ public long getTimeStamp(){
+ return System.currentTimeMillis();
+ }
+
+ public ArrayList<FileItem> getFiles() {
+ return files;
+ }
+
+ public void setFiles(ArrayList<FileItem> files) {
+ this.files = files;
+ }
+
+ public boolean isAutoUpload() {
+ return autoUpload;
+ }
+
+ public void setAutoUpload(boolean autoUpload) {
+ this.autoUpload = autoUpload;
+ }
+}
+
+
Property changes on: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/fileupload/FileUploadBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/session/Authenticator.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/session/Authenticator.java (rev 0)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/session/Authenticator.java 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,47 @@
+package org.richfaces.realworld.session;
+
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Logger;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.faces.FacesMessages;
+import org.jboss.seam.log.Log;
+import org.jboss.seam.security.Identity;
+import org.richfaces.realworld.fileupload.FileManager;
+import org.richfaces.realworld.service.IUserAction;
+
+@Name("authenticator")
+public class Authenticator
+{
+ @Logger Log log;
+
+ @In Identity identity;
+
+ @In FacesMessages facesMessages;
+
+ @In(create = true)
+ IUserAction userAction;
+
+ @In(create = true)
+ FileManager fileManager;
+
+ /* (non-Javadoc)
+ * @see org.richfaces.realworld.service.IAuthenticator#authenticate()
+ */
+ public boolean authenticate()
+ {
+ log.info("authenticating #0", identity.getUsername());
+ try{
+ if(userAction.login(identity.getUsername(), identity.getPassword())){
+ identity.addRole("admin");
+ if(!fileManager.isDirectoryPresent(identity.getUsername())){
+ fileManager.addDirectory(identity.getUsername());
+ }
+ return true;
+ }
+ }catch(Exception nre){
+ facesMessages.add("Invalid login or password");
+ return false;
+ }
+ return false;
+ }
+}
Property changes on: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/session/Authenticator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeActionManager.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeActionManager.java (rev 0)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeActionManager.java 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,110 @@
+package org.richfaces.realworld.tree;
+
+import javax.faces.model.SelectItem;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.Scope;
+import org.richfaces.realworld.domain.Album;
+import org.richfaces.realworld.domain.Image;
+import org.richfaces.realworld.domain.User;
+import org.richfaces.realworld.fileupload.FileManager;
+import org.richfaces.realworld.service.IAlbumAction;
+import org.richfaces.realworld.service.IImageAction;
+
+@Name("treeActionManager")
+(a)Scope(ScopeType.PAGE)
+public class TreeActionManager {
+
+ @In
+ private User user;
+
+ @In(create=true, required=true)
+ private IAlbumAction albumAction;
+
+ @In(create=true, required=true)
+ private IImageAction imageAction;
+
+ @In(create=true, required=true) @Out
+ private Album album;
+
+ @In(create=true)
+ FileManager fileManager;
+
+ @In TreeRootItem treeRoot;
+
+ @In(create=true, required=true)
+ TreeSelectionManager treeSelectionManager;
+
+ public void addAlbum(){
+ albumAction.addAlbum(album);
+ treeRoot.getAvailableAlbums().add(new SelectItem(album.getName()));
+ TreeAlbumItem albumItem = new TreeAlbumItem(album.getId(), treeRoot, album);
+ treeRoot.addAlbumToTree(albumItem);
+ fileManager.addDirectory(user.getLogin() + fileManager.getFileSeparator() + album.getName());
+ treeSelectionManager.setSelectedImage(null);
+ treeSelectionManager.setSelectedAlbumItem(albumItem);
+ }
+
+ public void editAlbum(Album album){
+ boolean nameChanged = !album.getName().equals(album.getChangedName());
+ if(nameChanged){
+ String directoryOld = user.getLogin() + fileManager.getFileSeparator() + album.getName();
+ String directoryNew = user.getLogin() + fileManager.getFileSeparator() + album.getChangedName();
+ try {
+ fileManager.renameDirectory(directoryOld, directoryNew);
+ } catch (Exception e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ album.setName(album.getChangedName());
+ album.setChangedName(null);
+ }
+ albumAction.editAlbum(album);
+ treeRoot.updateChild(album);
+ }
+
+ public void deleteAlbum(Album album){
+ String albumName = album.getName();
+ albumAction.deleteAlbum(album);
+ SelectItem item = treeRoot.getSelectItemByName(album.getName());
+ treeRoot.getAvailableAlbums().remove(item);
+ treeRoot.removeChild(album.getId());
+ fileManager.deleteDirectory(user.getLogin() + fileManager.getFileSeparator() + albumName);
+ treeSelectionManager.setSelectedImage(null);
+ treeSelectionManager.setSelectedAlbumItem(null);
+ }
+
+ public void deleteImage(Image image){
+ String albumName = image.getAlbum().getName();
+ String imagePath = image.getPath();
+ TreeAlbumItem parent = treeRoot.getAlbums().get(image.getAlbum().getId());
+ imageAction.deleteImage(image);
+ parent.removeChild(image.getId());
+ fileManager.deleteImage(user.getLogin() + fileManager.getFileSeparator() + albumName + fileManager.getFileSeparator() + imagePath);
+ treeSelectionManager.setSelectedImage(null);
+ }
+
+ public void editImage(Image image){
+ TreeAlbumItem parent = treeRoot.getAlbums().get(image.getAlbum().getId());
+ boolean parentChanged = !parent.getAlbum().getName().equals(image.getAlbumName());
+ imageAction.editImage(image, parentChanged);
+
+ if(parentChanged){
+ parent.removeChild(image.getId());
+ TreeAlbumItem albumItem = treeRoot.getAlbumByName(image.getAlbumName());
+ TreeImageItem imageItem = new TreeImageItem(image.getId(),albumItem,image);
+ albumItem.addChild(image.getId(), imageItem);
+ String fileNameOld = user.getLogin() + fileManager.getFileSeparator() + image.getAlbum().getName() + fileManager.getFileSeparator() + image.getPath();
+ String fileNameNew = user.getLogin() + fileManager.getFileSeparator() + image.getAlbumName() + fileManager.getFileSeparator() + image.getPath();
+ fileManager.renameImage(fileNameOld, fileNameNew);
+ treeSelectionManager.setSelectedImage(imageItem);
+ treeSelectionManager.setSelectedAlbumItem(albumItem);
+ }else{
+ TreeImageItem imageItem = (TreeImageItem)parent.getChild(image.getId());
+ imageItem.setImage(image);
+ }
+ }
+}
Property changes on: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeActionManager.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeAlbumItem.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeAlbumItem.java (rev 0)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeAlbumItem.java 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,98 @@
+package org.richfaces.realworld.tree;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.richfaces.model.TreeNode;
+import org.richfaces.realworld.domain.Album;
+import org.richfaces.realworld.domain.Image;
+
+public class TreeAlbumItem implements TreeNode {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 6514596192023597908L;
+ private long id;
+ private Map<Object, TreeNode> images = new LinkedHashMap<Object, TreeNode>();
+ private Album album;
+ TreeNode parent;
+
+ public TreeAlbumItem(long id, TreeRootItem parent, Album album) {
+ this.id = id;
+ this.parent = parent;
+ this.album = album;
+ for(Image image:album.getImages()){
+ TreeImageItem node = new TreeImageItem(image.getId(), this, image);
+ addImage(node);
+ }
+ }
+
+ public void addImage(TreeImageItem image) {
+ addChild(image.getId(), image);
+ image.setParent(this);
+ }
+
+ public void addChild(Object identifier, TreeNode child) {
+ images.put(identifier, child);
+ }
+
+ public TreeNode getChild(Object id) {
+ return (TreeNode) images.get(id);
+ }
+
+ public Iterator<Map.Entry<Object, TreeNode>> getChildren() {
+ return images.entrySet().iterator();
+ }
+
+ public List<TreeNode> getImages() {
+ List<TreeNode> imageCollection = new ArrayList<TreeNode>();
+ imageCollection.addAll(images.values());
+ return imageCollection;
+ }
+
+ public Object getData() {
+ return this;
+ }
+
+ public TreeNode getParent() {
+ return parent;
+ }
+
+ public boolean isLeaf() {
+ return images.isEmpty();
+ }
+
+ public void removeChild(Object id) {
+ images.remove(id);
+ }
+
+ public void setData(Object data) {
+ }
+
+ public void setParent(TreeNode parent) {
+ this.parent = parent;
+ }
+
+ public long getId() {
+ return id;
+ }
+
+ public Album getAlbum() {
+ return album;
+ }
+
+ public void setAlbum(Album album) {
+ this.album = album;
+ }
+
+ public String getType() {
+ return "album";
+ }
+
+ public String toString(){
+ return this.getAlbum().getName();
+ }
+}
Property changes on: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeAlbumItem.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeImageItem.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeImageItem.java (rev 0)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeImageItem.java 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,88 @@
+package org.richfaces.realworld.tree;
+
+import java.util.Iterator;
+
+import javax.faces.component.UIGraphic;
+
+import org.richfaces.model.TreeNode;
+import org.richfaces.realworld.domain.Image;
+
+public class TreeImageItem implements TreeNode {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 6514596192023597908L;
+ private long id;
+ private Image image;
+
+ private UIGraphic uiImage;
+ private TreeAlbumItem album;
+
+ public TreeImageItem(long id, TreeAlbumItem album, Image image) {
+ this.id = id;
+ this.album = album;
+ this.image = image;
+ this.uiImage = new UIGraphic();
+ this.uiImage.setUrl(image.getPath());
+ }
+
+ public void addChild(Object identifier, TreeNode child) {
+
+ }
+
+ public TreeNode getChild(Object id) {
+ return null;
+ }
+
+ public Iterator getChildren() {
+ return null;
+ }
+
+ public Object getData() {
+ return this;
+ }
+
+ public TreeNode getParent() {
+ return album;
+ }
+
+ public boolean isLeaf() {
+ return true;
+ }
+
+ public void removeChild(Object id) {
+
+ }
+
+ public void setData(Object data) {
+ }
+
+ public void setParent(TreeNode parent) {
+ this.album = (TreeAlbumItem) parent;
+ }
+
+ public long getId() {
+ return id;
+ }
+
+ public String getType() {
+ return "image";
+ }
+
+ public Image getImage() {
+ return image;
+ }
+
+ public void setImage(Image image) {
+ this.image = image;
+ }
+
+ public UIGraphic getUiImage() {
+ return uiImage;
+ }
+
+ public void setUiImage(UIGraphic uiImage) {
+ this.uiImage = uiImage;
+ }
+
+}
Property changes on: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeImageItem.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeRootItem.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeRootItem.java (rev 0)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeRootItem.java 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,127 @@
+package org.richfaces.realworld.tree;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.faces.model.SelectItem;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.Scope;
+import org.richfaces.model.TreeNode;
+import org.richfaces.realworld.domain.Album;
+import org.richfaces.realworld.domain.Image;
+import org.richfaces.realworld.domain.User;
+import org.richfaces.realworld.service.IAlbumAction;
+import org.richfaces.realworld.service.IImageAction;
+
+@Name("treeRoot")
+(a)Scope(ScopeType.PAGE)
+public class TreeRootItem implements TreeNode {
+
+ @In @Out
+ private User user;
+
+ private List<SelectItem> availableAlbums;
+
+ private static final long serialVersionUID = -3530085227471752526L;
+
+ private Map<Long, TreeAlbumItem> albums = null;
+
+ public Map<Long, TreeAlbumItem> getAlbums() {
+ if (this.albums==null) {
+ initData();
+ }
+ return this.albums;
+ }
+
+ public void addAlbumToTree(TreeAlbumItem album) {
+ addChild(album.getId(), album);
+ }
+
+ public void addChild(Object identifier, TreeNode child) {
+ getAlbums().put((Long)identifier, (TreeAlbumItem)child);
+ child.setParent(this);
+ }
+
+ public TreeNode getChild(Object id) {
+ return (TreeNode) albums.get(id);
+ }
+
+ public Iterator getChildren() {
+ return getAlbums().entrySet().iterator();
+ }
+
+ public Object getData() {
+ return this;
+ }
+
+ public TreeNode getParent() {
+ return null;
+ }
+
+ public boolean isLeaf() {
+ return getAlbums().isEmpty();
+ }
+
+ public void removeChild(Object id) {
+ albums.remove(id);
+ }
+
+ public void setData(Object data) {
+ }
+
+ public void setParent(TreeNode parent) {
+ }
+
+ public String getType() {
+ return "treeBean";
+ }
+
+ private void initData() {
+ transformAlbumsToMap();
+ }
+
+ private void transformAlbumsToMap() {
+ albums = new HashMap<Long, TreeAlbumItem>();
+ availableAlbums = new ArrayList<SelectItem>();
+ for(Album album:user.getChildAlbums()){
+ TreeAlbumItem albumNode = new TreeAlbumItem(album.getId(), this, album);
+ availableAlbums.add(new SelectItem(album.getName()));
+ addAlbumToTree(albumNode);
+ }
+ }
+
+ public void updateChild(Album album) {
+ TreeAlbumItem albumItem = getAlbums().get(album.getId());
+ albumItem.setAlbum(album);
+ }
+
+ public SelectItem getSelectItemByName(String name) {
+ for(SelectItem item : availableAlbums){
+ if(item.getValue().toString().equals(name)){
+ return item;
+ }
+ }
+ return null;
+ }
+
+ public TreeAlbumItem getAlbumByName(String albumName) {
+ for(Map.Entry<Long, TreeAlbumItem> entry : getAlbums().entrySet()){
+ if(entry.getValue().getAlbum().getName().equals(albumName)){
+ return entry.getValue();
+ }
+ }
+ return null;
+ }
+
+ public List<SelectItem> getAvailableAlbums() {
+ return availableAlbums;
+ }
+
+}
Property changes on: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeRootItem.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeSelectionManager.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeSelectionManager.java (rev 0)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeSelectionManager.java 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,289 @@
+package org.richfaces.realworld.tree;
+
+import java.awt.image.BufferedImage;
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.imageio.ImageIO;
+
+import org.ajax4jsf.context.AjaxContext;
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.Scope;
+import org.jboss.seam.annotations.Synchronized;
+import org.richfaces.component.UIDragSupport;
+import org.richfaces.component.UITree;
+import org.richfaces.component.UITreeNode;
+import org.richfaces.component.html.HtmlTree;
+import org.richfaces.event.DataScrollerEvent;
+import org.richfaces.event.DropEvent;
+import org.richfaces.event.NodeSelectedEvent;
+import org.richfaces.model.TreeNode;
+import org.richfaces.model.TreeRowKey;
+import org.richfaces.realworld.domain.User;
+import org.richfaces.realworld.fileupload.FileManager;
+import org.richfaces.realworld.util.NavigationEnum;
+
+@Name("treeSelectionManager")
+@Synchronized(timeout=2000)
+(a)Scope(ScopeType.SESSION)
+public class TreeSelectionManager {
+
+ @In
+ private User user;
+
+ private NavigationEnum mainArea = NavigationEnum.IMAGE_PREVIEW;
+
+ private TreeNode selectedImage;
+
+ private TreeAlbumItem selectedAlbumItem;
+
+ @In(create=true)
+ FileManager fileManager;
+
+ private String nodeTitle;
+
+ public TreeAlbumItem getSelectedAlbumItem() {
+ return selectedAlbumItem;
+ }
+
+ public void showFileUpload(TreeAlbumItem item){
+ this.setSelectedAlbumItem(item);
+ if(item.isLeaf()){
+ this.setSelectedImage(null);
+ }else{
+ this.setSelectedImage(item.getImages().get(0));
+ }
+ this.setMainArea(NavigationEnum.FILE_UPLOAD);
+ }
+
+ public void scrollerListener(DataScrollerEvent event) {
+ List<TreeNode> images = this.getSelectedAlbumItem().getImages();
+ if (event.getNewScrolVal().equals("previous")) {
+ for(int index = 0 ; index < images.size(); index++){
+ if(images.get(index) == this.getSelectedImage()){
+ this.setSelectedImage(images.get(index - 1));
+ }
+ }
+ } else if (event.getNewScrolVal().equals("last")) {
+ this.setSelectedImage(images.get(images.size() - 1));
+ } else if (event.getNewScrolVal().equals("next")) {
+ for(int index = 0 ; index < images.size(); index++){
+ if(images.get(index) == this.getSelectedImage()){
+ if(images.size() > index + 1){
+ this.setSelectedImage(images.get(index + 1));
+ }
+ }
+ }
+ } else if (event.getNewScrolVal().equals("first")) {
+ this.setSelectedImage(images.get(0));
+ }
+
+ }
+
+ public synchronized void paint(OutputStream out, Object data) throws IOException{
+ if (null == data) {
+ return;
+ }
+ File imageResource = fileManager.getImage(user.getLogin() + fileManager.getFileSeparator() + this.getSelectedAlbumItem() + fileManager.getFileSeparator() + data.toString());
+ if (imageResource != null) {
+ InputStream paintData = new BufferedInputStream(new FileInputStream(imageResource));
+ if (null == paintData) {
+ // throw new Exception("");
+ // TODO
+ }
+ BufferedImage image = ImageIO.read(paintData);
+ ImageIO.write(image, "jpeg", out);
+ }
+ }
+
+ public void dropListener(DropEvent dropEvent) {
+
+ // resolve drag destination attributes
+ UITreeNode destNode = (dropEvent.getSource() instanceof UITreeNode) ? (UITreeNode) dropEvent.getSource() : null;
+ UITree destTree = destNode != null ? destNode.getUITree() : null;
+ TreeRowKey dropNodeKey = (dropEvent.getDropValue() instanceof TreeRowKey) ? (TreeRowKey) dropEvent.getDropValue() : null;
+ TreeNode droppedInNode = dropNodeKey != null ? destTree.getTreeNode(dropNodeKey) : null;
+
+ // resolve drag source attributes
+ UITreeNode srcNode = (dropEvent.getDraggableSource() instanceof UITreeNode) ? (UITreeNode) dropEvent.getDraggableSource() : null;
+ UITree srcTree = srcNode != null ? srcNode.getUITree() : null;
+ TreeRowKey dragNodeKey = (dropEvent.getDragValue() instanceof TreeRowKey) ? (TreeRowKey) dropEvent.getDragValue() : null;
+ TreeNode draggedNode = dragNodeKey != null ? srcTree.getTreeNode(dragNodeKey) : null;
+ if (dropEvent.getDraggableSource() instanceof UIDragSupport && srcTree == null && draggedNode == null && dropEvent.getDragValue() instanceof TreeNode) {
+ srcTree = destTree;
+ draggedNode = (TreeNode) dropEvent.getDragValue();
+ dragNodeKey = srcTree.getTreeNodeRowKey(draggedNode) instanceof TreeRowKey ? (TreeRowKey) srcTree.getTreeNodeRowKey(draggedNode) : null;
+ }
+
+ // Note: check if we dropped node on to itself or to item instead of
+ // folder here
+ if (droppedInNode != null && (droppedInNode.equals(draggedNode) || droppedInNode.getParent().getParent() != null || draggedNode.getParent().getParent() == null)) {
+ System.out.println("Warning: Can't drop on itself or to pic itself! Also can't move folders");
+ return;
+ }
+
+ if (dropNodeKey != null) {
+ // add destination node for rerender
+ destTree.addRequestKey(dropNodeKey);
+
+ Object state = null;
+ if (dragNodeKey != null) { // Drag from this or other tree
+ TreeNode parentNode = draggedNode.getParent();
+ // 1. remove node from tree
+ state = srcTree.removeNode(dragNodeKey);
+ // 2. add parent for rerender
+ Object rowKey = srcTree.getTreeNodeRowKey(parentNode);
+ srcTree.addRequestKey(rowKey);
+ //TODO refactor this code
+ if (dropEvent.getDraggableSource() instanceof UIDragSupport) {
+ // if node was gragged in it's parent place dragged node to
+ // the end of selected nodes in grid
+ if (droppedInNode.equals(parentNode)) {
+ }
+ }
+ } else if (dropEvent.getDragValue() != null) { // Drag from some
+ // drag source
+ draggedNode.setData(dropEvent.getDragValue().toString());
+ }
+
+ // generate new node id
+ Object id = getNewId(destTree.getTreeNode(dropNodeKey));
+ destTree.addNode(dropNodeKey, draggedNode, id, state);
+ }
+
+ AjaxContext ac = AjaxContext.getCurrentInstance();
+ ac.addRenderedArea("mainform:imageList");
+ // Add destination tree to reRender
+ try {
+ ac.addComponentToAjaxRender(destTree);
+ } catch (Exception e) {
+ System.err.print(e.getMessage());
+ }
+
+ }
+
+ private Object getNewId(TreeNode parentNode) {
+ Map<Object, TreeNode> childs = new HashMap<Object, TreeNode>();
+ Iterator<Map.Entry<Object, TreeNode>> iter = parentNode.getChildren();
+ while (iter != null && iter.hasNext()) {
+ Map.Entry<Object, TreeNode> entry = iter.next();
+ childs.put(entry.getKey(), entry.getValue());
+ }
+
+ Integer index = 1;
+ while (childs.containsKey(index)) {
+ index++;
+ }
+ return index;
+ }
+
+ public void setSelectedAlbumItem(TreeAlbumItem selectedAlbumItem) {
+ this.selectedAlbumItem = selectedAlbumItem;
+ }
+
+ public TreeNode getSelectedImage() {
+ return selectedImage;
+ }
+
+ public void setSelectedImage(TreeNode selectedImage) {
+ this.selectedImage = selectedImage;
+ }
+
+ public Boolean adviseNodeSelected(UITree tree) {
+ TreeRowKey treeRowKey = (TreeRowKey) tree.getRowKey();
+ TreeNode treeNode = (TreeNode) tree.getRowData(treeRowKey);
+
+ if(treeNode instanceof TreeAlbumItem){
+ TreeAlbumItem currentNode = (TreeAlbumItem)treeNode;
+ if(this.getSelectedAlbumItem() != null){
+ return treeNode == this.getSelectedAlbumItem() && null == this.getSelectedImage() ? Boolean.TRUE: Boolean.FALSE;
+ }else{
+ this.setSelectedAlbumItem(currentNode);
+ if((currentNode).isLeaf()){
+ return Boolean.TRUE ;
+ }else{
+ this.setSelectedImage((currentNode).getImages().get(0));
+ return Boolean.FALSE ;
+ }
+ }
+ }else if(treeNode instanceof TreeImageItem){
+ return treeNode == this.getSelectedImage() ? Boolean.TRUE : Boolean.FALSE;
+ }
+ return null;
+ }
+
+ public Boolean adviseNodeOpened(UITree tree) {
+ TreeRowKey treeRowKey = (TreeRowKey) tree.getRowKey();
+ TreeNode treeNode = (TreeNode) tree.getRowData(treeRowKey);
+ if(treeNode instanceof TreeAlbumItem){
+ TreeAlbumItem currentNode = (TreeAlbumItem)treeNode;
+ if(this.getSelectedAlbumItem() != null){
+ return treeNode == this.getSelectedAlbumItem() ? Boolean.TRUE: Boolean.FALSE;
+ }else{
+ this.setSelectedAlbumItem(currentNode);
+ if(!(currentNode).isLeaf()){
+ this.setSelectedImage((currentNode).getImages().get(0));
+ }
+ return Boolean.TRUE ;
+ }
+ }
+ return null;
+ }
+
+ public void processSelection(NodeSelectedEvent event) {
+ HtmlTree tree = (HtmlTree) event.getComponent();
+ if (tree.getRowData() instanceof TreeImageItem) {
+ nodeTitle = ((TreeImageItem) (tree.getRowData())).getImage()
+ .getName();
+ } else if (tree.getRowData() instanceof TreeAlbumItem) {
+ nodeTitle = ((TreeAlbumItem) (tree.getRowData())).getAlbum()
+ .getName();
+ }
+ TreeNode<String> currentNode = tree.getModelTreeNode(tree.getRowKey());
+ if (currentNode.isLeaf()) {
+ selectedImage = currentNode;
+ if(((TreeAlbumItem)currentNode.getParent()) != this.getSelectedAlbumItem()){
+ this.setSelectedAlbumItem((TreeAlbumItem)currentNode.getParent());
+ }
+ return;
+ } else {
+ if(currentNode == this.getSelectedAlbumItem()){
+ return;
+ }else{
+ setSelectedAlbumItem((TreeAlbumItem) currentNode);
+ if(((TreeAlbumItem) currentNode).isLeaf()){
+ this.setSelectedImage(null);
+ }else{
+ this.setSelectedImage(((TreeAlbumItem) currentNode).getImages().get(0));
+ }
+ }
+ }
+ }
+
+ public String getNodeTitle() {
+ return nodeTitle;
+ }
+
+ public void setNodeTitle(String nodeTitle) {
+ this.nodeTitle = nodeTitle;
+ }
+
+ public NavigationEnum getMainArea() {
+ return mainArea;
+ }
+
+ public void setMainArea(NavigationEnum mainArea) {
+ this.mainArea = mainArea;
+ }
+}
Property changes on: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/tree/TreeSelectionManager.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ModalPanelHelper.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ModalPanelHelper.java (rev 0)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ModalPanelHelper.java 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,86 @@
+package org.richfaces.realworld.util;
+
+import javax.faces.event.ActionEvent;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.Scope;
+import org.richfaces.realworld.domain.Album;
+import org.richfaces.realworld.domain.Image;
+import org.richfaces.realworld.tree.TreeActionManager;
+
+@Name("modalPanelHelper")
+(a)Scope(ScopeType.SESSION)
+public class ModalPanelHelper {
+
+ private String caption;
+
+ private String actionName;
+
+ @In(create=true, required=true) @Out
+ private Album album;
+
+ @In(create=true, required=true) @Out
+ private Image image;
+
+ @In(create=true, required=true)
+ private TreeActionManager treeActionManager;
+
+ public String getCaption() {
+ return caption;
+ }
+
+ public void setCaption(String caption) {
+ this.caption = caption;
+ }
+
+ public String getActionName() {
+ return actionName;
+ }
+
+ public void setActionName(String actionName) {
+ this.actionName = actionName;
+ }
+
+ public void initModalPanelData( String actionName, String caption, Album album){
+ this.caption = caption;
+ this.actionName = actionName;
+ if(null != album){
+ this.album = album;
+ }else{
+ this.album = new Album();
+ }
+ }
+
+ public void initModalPanelData( String actionName, String caption, Image image){
+ this.caption = caption;
+ this.actionName = actionName;
+ if(null != image){
+ this.image = image;
+ }else{
+ this.image = new Image();
+ }
+ }
+
+ public void addAlbum(ActionEvent event){
+ treeActionManager.addAlbum();
+ }
+
+ public void editAlbum(ActionEvent event){
+ treeActionManager.editAlbum(this.album);
+ }
+
+ public void deleteAlbum(ActionEvent event){
+ treeActionManager.deleteAlbum(this.album);
+ }
+
+ public void deleteImage(ActionEvent event){
+ treeActionManager.deleteImage(this.image);
+ }
+
+ public void editImage(ActionEvent event){
+ treeActionManager.editImage(this.image);
+ }
+}
Property changes on: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/ModalPanelHelper.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/NavigationEnum.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/NavigationEnum.java (rev 0)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/NavigationEnum.java 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,7 @@
+package org.richfaces.realworld.util;
+
+public enum NavigationEnum {
+ IMAGE_PREVIEW,
+ FILE_UPLOAD,
+ USER_PREFS,
+}
Property changes on: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/NavigationEnum.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/NavigationHelper.java
===================================================================
--- trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/NavigationHelper.java (rev 0)
+++ trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/NavigationHelper.java 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,21 @@
+package org.richfaces.realworld.util;
+
+import org.jboss.seam.annotations.Name;
+
+@Name(value="navigationHelper")
+public class NavigationHelper {
+
+ private NavigationEnum navigationEnum;
+
+ public NavigationEnum getNavigationEnumUserPrefs(){
+ return NavigationEnum.USER_PREFS;
+ }
+
+ public NavigationEnum getNavigationEnumImagePreview(){
+ return NavigationEnum.IMAGE_PREVIEW;
+ }
+
+ public NavigationEnum getNavigationEnumFileUpload(){
+ return NavigationEnum.FILE_UPLOAD;
+ }
+}
Property changes on: trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/util/NavigationHelper.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/web/src/main/resources/messages_en.properties
===================================================================
--- trunk/test-applications/realworld/web/src/main/resources/messages_en.properties (rev 0)
+++ trunk/test-applications/realworld/web/src/main/resources/messages_en.properties 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,90 @@
+up=\u2191
+down=\u2193
+left=\u2039
+right=\u203A
+
+validator.assertFalse=validation failed
+validator.assertTrue=validation failed
+validator.future=must be a future date
+validator.length=length must be between {min} and {max}
+validator.max=must be less than or equal to {value}
+validator.min=must be greater than or equal to {value}
+validator.notNull=may not be null
+validator.past=must be a past date
+validator.pattern=must match "{regex}"
+validator.range=must be between {min} and {max}
+validator.size=size must be between {min} and {max}
+validator.email=must be a well-formed email address
+
+org.jboss.seam.loginFailed=Login failed
+org.jboss.seam.loginSuccessful=Welcome, #0
+
+org.jboss.seam.TransactionFailed=Transaction failed
+org.jboss.seam.NoConversation=The conversation ended, timed out or was processing another request
+org.jboss.seam.IllegalNavigation=Illegal navigation
+org.jboss.seam.ProcessEnded=Process #0 already ended
+org.jboss.seam.ProcessNotFound=Process #0 not found
+org.jboss.seam.TaskEnded=Task #0 already ended
+org.jboss.seam.TaskNotFound=Task #0 not found
+org.jboss.seam.NotLoggedIn=Please log in first
+
+javax.faces.component.UIInput.CONVERSION=value could not be converted to the expected type
+javax.faces.component.UIInput.REQUIRED=value is required
+javax.faces.component.UIInput.UPDATE=an error occurred when processing your submitted information
+javax.faces.component.UISelectOne.INVALID=value is not valid
+javax.faces.component.UISelectMany.INVALID=value is not valid
+
+javax.faces.converter.BigDecimalConverter.DECIMAL=value must be a number
+javax.faces.converter.BigDecimalConverter.DECIMAL_detail=value must be a signed decimal number consisting of zero or more digits, optionally followed by a decimal point and fraction, eg. {1}
+javax.faces.converter.BigIntegerConverter.BIGINTEGER=value must be an integer
+javax.faces.converter.BigIntegerConverter.BIGINTEGER_detail=value must be a signed integer number consisting of zero or more digits
+javax.faces.converter.BooleanConverter.BOOLEAN=value must be true or false
+javax.faces.converter.BooleanConverter.BOOLEAN_detail=value must be true or false (any value other than true will evaluate to false)
+javax.faces.converter.ByteConverter.BYTE=value must be a number between 0 and 255
+javax.faces.converter.ByteConverter.BYTE_detail=value must be a number between 0 and 255
+javax.faces.converter.CharacterConverter.CHARACTER=value must be a character
+javax.faces.converter.CharacterConverter.CHARACTER_detail=value must be a valid ASCII character
+javax.faces.converter.DateTimeConverter.DATE=value must be a date
+javax.faces.converter.DateTimeConverter.DATE_detail=value must be a date, eg. {1}
+javax.faces.converter.DateTimeConverter.TIME=value must be a time
+javax.faces.converter.DateTimeConverter.TIME_detail=value must be a time, eg. {1}
+javax.faces.converter.DateTimeConverter.DATETIME=value must be a date and time
+javax.faces.converter.DateTimeConverter.DATETIME_detail=value must be a date and time, eg. {1}
+javax.faces.converter.DateTimeConverter.PATTERN_TYPE=a pattern or type attribute must be specified to convert the value
+javax.faces.converter.DoubleConverter.DOUBLE=value must be a number
+javax.faces.converter.DoubleConverter.DOUBLE_detail=value must be a number between 4.9E-324 and 1.7976931348623157E308
+javax.faces.converter.EnumConverter.ENUM=value must be convertible to an enum
+javax.faces.converter.EnumConverter.ENUM_detail=value must be convertible to an enum or from the enum that contains the constant {1}
+javax.faces.converter.EnumConverter.ENUM_NO_CLASS=value must be convertible to an enum or from the enum, but no enum class provided
+javax.faces.converter.EnumConverter.ENUM_NO_CLASS_detail=value must be convertible to an enum or from the enum, but no enum class provided
+javax.faces.converter.FloatConverter.FLOAT=value must be a number
+javax.faces.converter.FloatConverter.FLOAT_detail=value must be a number between 1.4E-45 and 3.4028235E38
+javax.faces.converter.IntegerConverter.INTEGER=value must be an integer
+javax.faces.converter.IntegerConverter.INTEGER_detail=value must be an integer number between -2147483648 and 2147483647
+javax.faces.converter.LongConverter.LONG=value must be an integer
+javax.faces.converter.LongConverter.LONG_detail=must be an integer number between -9223372036854775808 and 9223372036854775807
+javax.faces.converter.NumberConverter.CURRENCY=value must be a currency amount
+javax.faces.converter.NumberConverter.CURRENCY_detail=value must be a currency amount, eg. {1}
+javax.faces.converter.NumberConverter.PERCENT=value must be a percentage amount
+javax.faces.converter.NumberConverter.PERCENT_detail=value must be a percentage amount, eg. {1}
+javax.faces.converter.NumberConverter.NUMBER=value must be a number
+javax.faces.converter.NumberConverter.NUMBER_detail=value must be a number
+javax.faces.converter.NumberConverter.PATTERN=value must be a number
+javax.faces.converter.NumberConverter.PATTERN_detail=value must be a number
+javax.faces.converter.ShortConverter.SHORT=value must be an integer
+javax.faces.converter.ShortConverter.SHORT_detail=value must be an integer number between -32768 and 32767
+
+javax.faces.validator.DoubleRangeValidator.MAXIMUM=value must be less than or equal to {0}
+javax.faces.validator.DoubleRangeValidator.MINIMUM=value must be greater than or equal to {0}
+javax.faces.validator.DoubleRangeValidator.NOT_IN_RANGE=value must be between {0} and {1}
+javax.faces.validator.DoubleRangeValidator.TYPE=value is not of the correct type
+javax.faces.validator.LengthValidator.MAXIMUM=value is must be shorter than or equal to {0} characters
+javax.faces.validator.LengthValidator.MINIMUM=value is must be longer than or equal to {0} characters
+javax.faces.validator.LongRangeValidator.MAXIMUM=value must be less than or equal to {0}
+javax.faces.validator.LongRangeValidator.MINIMUM=value must be greater than or equal to {0}
+javax.faces.validator.LongRangeValidator.NOT_IN_RANGE=value must be between {0} and {1}
+javax.faces.validator.LongRangeValidator.TYPE=value is not of the correct type
+
+javax.faces.validator.NOT_IN_RANGE=value must be between {0} and {1}
+javax.faces.converter.STRING=value could not be converted to a string
+
Property changes on: trunk/test-applications/realworld/web/src/main/resources/messages_en.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/web/src/main/resources/seam.properties
===================================================================
Property changes on: trunk/test-applications/realworld/web/src/main/resources/seam.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/web/src/main/webapp/META-INF/MANIFEST.MF
===================================================================
--- trunk/test-applications/realworld/web/src/main/webapp/META-INF/MANIFEST.MF (rev 0)
+++ trunk/test-applications/realworld/web/src/main/webapp/META-INF/MANIFEST.MF 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Property changes on: trunk/test-applications/realworld/web/src/main/webapp/META-INF/MANIFEST.MF
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/components.xml
===================================================================
--- trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/components.xml (rev 0)
+++ trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/components.xml 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<components xmlns="http://jboss.com/products/seam/components"
+ xmlns:core="http://jboss.com/products/seam/core"
+ xmlns:persistence="http://jboss.com/products/seam/persistence"
+ xmlns:drools="http://jboss.com/products/seam/drools"
+ xmlns:bpm="http://jboss.com/products/seam/bpm"
+ xmlns:security="http://jboss.com/products/seam/security"
+ xmlns:mail="http://jboss.com/products/seam/mail"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:transaction="http://jboss.com/products/seam/transaction"
+ xsi:schemaLocation=
+ "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.0.xsd
+ http://jboss.com/products/seam/transaction http://jboss.com/products/seam/transaction-2.0.xsd
+ http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.0.xsd
+ http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.0.xsd
+ http://jboss.com/products/seam/bpm http://jboss.com/products/seam/bpm-2.0.xsd
+ http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.0.xsd
+ http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.0.xsd
+ http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.0.xsd">
+
+ <core:init debug="true" jndi-pattern="@jndiPattern@"/>
+
+ <core:manager concurrent-request-timeout="500"
+ conversation-timeout="120000"
+ conversation-id-parameter="cid"/>
+
+<drools:rule-base name="securityRules">
+ <drools:rule-files>
+ <value>/security.drl</value>
+ </drools:rule-files>
+ </drools:rule-base>
+
+ <security:identity security-rules="#{securityRules}" authenticate-method="#{authenticator.authenticate}"/>
+ <event type="org.jboss.seam.security.notLoggedIn">
+ <action execute="#{redirect.captureCurrentView}"/>
+ </event>
+ <event type="org.jboss.seam.security.loginSuccessful">
+ <action execute="#{redirect.returnToCapturedView}"/>
+ </event>
+
+</components>
Property changes on: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/components.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/faces-config.xml (rev 0)
+++ trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/faces-config.xml 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,18 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<faces-config version="1.2"
+ xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
+
+ <application>
+ <locale-config>
+ <default-locale>en</default-locale>
+ <supported-locale>bg</supported-locale>
+ <supported-locale>de</supported-locale>
+ <supported-locale>en</supported-locale>
+ <supported-locale>fr</supported-locale>
+ <supported-locale>tr</supported-locale>
+ </locale-config>
+ <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
+ </application>
+</faces-config>
Property changes on: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/faces-config.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/pages.xml
===================================================================
--- trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/pages.xml (rev 0)
+++ trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/pages.xml 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<pages xmlns="http://jboss.com/products/seam/pages"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.0.xsd"
+
+ no-conversation-view-id="/home.xhtml"
+ login-view-id="/home.xhtml">
+
+ <page view-id="*">
+ <navigation>
+ <rule if-outcome="home">
+ <redirect view-id="/home.xhtml"/>
+ </rule>
+ <rule if-outcome="register">
+ <redirect view-id="/register.xhtml"/>
+ </rule>
+ <rule if-outcome="main">
+ <redirect view-id="/main.xhtml"/>
+ </rule>
+ </navigation>
+ </page>
+
+ <page view-id="/index.xhtml">
+
+ <action execute="#{identity.login}"
+ if="#{validation.succeeded}"/>
+
+ <navigation>
+ <rule if="#{identity.loggedIn}">
+ <redirect view-id="/main.xhtml"/>
+ </rule>
+ </navigation>
+
+ </page>
+
+ <exception class="org.jboss.seam.framework.EntityNotFoundException">
+ <redirect view-id="/error.xhtml">
+ <message>Not found</message>
+ </redirect>
+ </exception>
+
+ <exception class="javax.persistence.EntityNotFoundException">
+ <redirect view-id="/error.xhtml">
+ <message>Not found</message>
+ </redirect>
+ </exception>
+
+ <exception class="javax.persistence.OptimisticLockException">
+ <end-conversation/>
+ <redirect view-id="/error.xhtml">
+ <message>Another user changed the same data, please try again</message>
+ </redirect>
+ </exception>
+
+ <exception class="org.jboss.seam.security.AuthorizationException">
+ <redirect view-id="/error.xhtml">
+ <message>You don't have permission to do this</message>
+ </redirect>
+ </exception>
+
+ <exception class="org.jboss.seam.security.NotLoggedInException">
+ <redirect view-id="/home.xhtml">
+ <message>Please log in first</message>
+ </redirect>
+ </exception>
+
+ <exception class="javax.faces.application.ViewExpiredException">
+ <redirect view-id="/error.xhtml">
+ <message>Your session has timed out, please try again</message>
+ </redirect>
+ </exception>
+
+ <exception>
+ <redirect view-id="/error.xhtml">
+ <message>Unexpected error, please try again</message>
+ </redirect>
+ </exception>
+
+</pages>
Property changes on: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/pages.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/albumModalPanel-taglib.xml
===================================================================
--- trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/albumModalPanel-taglib.xml (rev 0)
+++ trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/albumModalPanel-taglib.xml 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,19 @@
+<?xml version="1.0"?>
+<!DOCTYPE facelet-taglib PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"
+ "facelet-taglib_1_0.dtd">
+<facelet-taglib>
+ <namespace>http://richfaces.org/richx</namespace>
+ <tag>
+ <tag-name>albumModalPanel</tag-name>
+ <source>templates/albumModalPanel.xhtml</source>
+ </tag>
+ <tag>
+ <tag-name>confirm</tag-name>
+ <source>templates/confirmation.xhtml</source>
+ </tag>
+ <tag>
+ <tag-name>imagePrefs</tag-name>
+ <source>templates/imagePrefs.xhtml</source>
+ </tag>
+</facelet-taglib>
\ No newline at end of file
Property changes on: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/albumModalPanel-taglib.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/albumModalPanel.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/albumModalPanel.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/confirmation.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/confirmation.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/imagePrefs.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/tags/templates/imagePrefs.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/web.xml (rev 0)
+++ trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/web.xml 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,107 @@
+<?xml version="1.0" ?>
+<web-app xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ version="2.5">
+
+ <!-- Ajax4jsf -->
+ <filter>
+ <display-name>Ajax4jsf Filter</display-name>
+ <filter-name>ajax4jsf</filter-name>
+ <filter-class>org.ajax4jsf.Filter</filter-class>
+ <init-param>
+ <param-name>createTempFiles</param-name>
+ <param-value>false</param-value>
+ </init-param>
+ <init-param>
+ <param-name>maxRequestSize</param-name>
+ <param-value>20000000</param-value>
+ </init-param>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>ajax4jsf</filter-name>
+ <url-pattern>*.seam</url-pattern>
+ </filter-mapping>
+
+ <context-param>
+ <param-name>org.richfaces.SKIN</param-name>
+ <param-value>blueSky</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>facelets.LIBRARIES</param-name>
+ <param-value>
+ /WEB-INF/tags/albumModalPanel-taglib.xml
+ </param-value>
+ </context-param>
+
+ <!-- Seam -->
+
+ <listener>
+ <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
+ </listener>
+
+ <filter>
+ <filter-name>Seam Filter</filter-name>
+ <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>Seam Filter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <servlet>
+ <servlet-name>Seam Resource Servlet</servlet-name>
+ <servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Seam Resource Servlet</servlet-name>
+ <url-pattern>/seam/resource/*</url-pattern>
+ </servlet-mapping>
+
+ <!-- Facelets development mode (disable in production) -->
+
+ <context-param>
+ <param-name>facelets.DEVELOPMENT</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+ <!-- JSF -->
+
+ <context-param>
+ <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
+ <param-value>.xhtml</param-value>
+ </context-param>
+
+ <context-param>
+ <param-name>uploadRoot</param-name>
+ <param-value>E:\Andrey\Upload\</param-value>
+</context-param>
+
+
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.seam</url-pattern>
+ </servlet-mapping>
+
+ <security-constraint>
+ <display-name>Restrict raw XHTML Documents</display-name>
+ <web-resource-collection>
+ <web-resource-name>XHTML</web-resource-name>
+ <url-pattern>*.xhtml</url-pattern>
+ </web-resource-collection>
+ <auth-constraint/>
+ </security-constraint>
+
+
+
+</web-app>
Property changes on: trunk/test-applications/realworld/web/src/main/webapp/WEB-INF/web.xml
___________________________________________________________________
Name: svn:mime-type
+ text/xml
Added: trunk/test-applications/realworld/web/src/main/webapp/error.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld/web/src/main/webapp/error.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added: trunk/test-applications/realworld/web/src/main/webapp/fileUpload.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld/web/src/main/webapp/fileUpload.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added: trunk/test-applications/realworld/web/src/main/webapp/imagePreview.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld/web/src/main/webapp/imagePreview.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added: trunk/test-applications/realworld/web/src/main/webapp/img/alert.jpeg
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld/web/src/main/webapp/img/alert.jpeg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/test-applications/realworld/web/src/main/webapp/img/dtpick.gif
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld/web/src/main/webapp/img/dtpick.gif
___________________________________________________________________
Name: svn:mime-type
+ image/gif
Added: trunk/test-applications/realworld/web/src/main/webapp/img/error.gif
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld/web/src/main/webapp/img/error.gif
___________________________________________________________________
Name: svn:mime-type
+ image/gif
Added: trunk/test-applications/realworld/web/src/main/webapp/img/logo.gif
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld/web/src/main/webapp/img/logo.gif
___________________________________________________________________
Name: svn:mime-type
+ image/gif
Added: trunk/test-applications/realworld/web/src/main/webapp/index.html
===================================================================
--- trunk/test-applications/realworld/web/src/main/webapp/index.html (rev 0)
+++ trunk/test-applications/realworld/web/src/main/webapp/index.html 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,5 @@
+<html>
+<head>
+ <meta http-equiv="Refresh" content="0; URL=index.seam">
+</head>
+</html>
\ No newline at end of file
Property changes on: trunk/test-applications/realworld/web/src/main/webapp/index.html
___________________________________________________________________
Name: svn:mime-type
+ text/html
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/web/src/main/webapp/index.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld/web/src/main/webapp/index.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added: trunk/test-applications/realworld/web/src/main/webapp/layout/display.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld/web/src/main/webapp/layout/display.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added: trunk/test-applications/realworld/web/src/main/webapp/layout/edit.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld/web/src/main/webapp/layout/edit.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added: trunk/test-applications/realworld/web/src/main/webapp/layout/menu.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld/web/src/main/webapp/layout/menu.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added: trunk/test-applications/realworld/web/src/main/webapp/layout/template.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld/web/src/main/webapp/layout/template.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added: trunk/test-applications/realworld/web/src/main/webapp/main.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld/web/src/main/webapp/main.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added: trunk/test-applications/realworld/web/src/main/webapp/register.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld/web/src/main/webapp/register.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added: trunk/test-applications/realworld/web/src/main/webapp/stylesheet/realworld.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 2008-11-24 17:18:48 UTC (rev 11328)
@@ -0,0 +1,126 @@
+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;
+}
+
+.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;
+}
+.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;
+}
Property changes on: trunk/test-applications/realworld/web/src/main/webapp/stylesheet/realworld.css
___________________________________________________________________
Name: svn:mime-type
+ text/css
Name: svn:eol-style
+ native
Added: trunk/test-applications/realworld/web/src/main/webapp/tree.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld/web/src/main/webapp/tree.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
Added: trunk/test-applications/realworld/web/src/main/webapp/userPrefs.xhtml
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/realworld/web/src/main/webapp/userPrefs.xhtml
___________________________________________________________________
Name: svn:mime-type
+ application/xhtml+xml
17 years, 5 months
JBoss Rich Faces SVN: r11327 - trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-11-24 10:48:58 -0500 (Mon, 24 Nov 2008)
New Revision: 11327
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ListShuttleTest.java
Log:
RF-4719
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ListShuttleTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ListShuttleTest.java 2008-11-24 15:23:28 UTC (rev 11326)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/ListShuttleTest.java 2008-11-24 15:48:58 UTC (rev 11327)
@@ -304,17 +304,18 @@
/**
* JS API is present and works
*/
-// @Test
+ @Test
public void testJSAPI(Template template) {
- //TODO JS API has some bugs. This test case should be completed after fixing theirs.
init(template);
selenium.runScript("var listShuttle = ($('" + lsId + "')).component;");
+ checkJSError();
// Check count
_assertTableRowsCount(availebleListId, 5);
_assertTableRowsCount(targetListId, 0);
// Copy all and check count
try {
selenium.runScript("listShuttle.copyAll();");
+ checkJSError();
_assertTableRowsCount(availebleListId, 0);
_assertTableRowsCount(targetListId, 5);
} catch (Exception e) {
@@ -325,6 +326,7 @@
// Remove all and check count
try {
selenium.runScript("listShuttle.removeAll();");
+ checkJSError();
_assertTableRowsCount(availebleListId, 5);
_assertTableRowsCount(targetListId, 0);
} catch (Exception e) {
@@ -336,10 +338,13 @@
// Copy 1st & 2nd item
_selectItem(parentId + "ls:0");
selenium.runScript("listShuttle.copy();");
+ checkJSError();
_selectItem(parentId + "ls:1");
selenium.runScript("listShuttle.copy();");
+ checkJSError();
_selectItem(parentId + "ls:2");
selenium.runScript("listShuttle.copy();");
+ checkJSError();
// Check count
_assertTableRowsCount(availebleListId, 2);
_assertTableRowsCount(targetListId, 3);
@@ -357,22 +362,27 @@
// Move the first to to the last
_selectItem(parentId + "ls:t0");
selenium.runScript("listShuttle.down();");
+ checkJSError();
_checkOrdering(targetListId, "2Item2", "1Item1", "3Item3", "Test failed. Down control does not work");
_selectItem(parentId + "ls:t0");
selenium.runScript("listShuttle.bottom();");
+ checkJSError();
_checkOrdering(targetListId, "2Item2", "3Item3", "1Item1", "Test failed. Last control does not work");
_selectItem(parentId + "ls:t2");
selenium.runScript("listShuttle.top();");
+ checkJSError();
_checkOrdering(targetListId, "3Item3", "2Item2", "1Item1", "Test failed. First control does not work");
_selectItem(parentId + "ls:t0");
selenium.runScript("listShuttle.up();");
+ checkJSError();
_checkOrdering(targetListId, "3Item3", "1Item1", "2Item2", "Test failed. Up control does not work");
_selectItem(parentId + "ls:t1");
selenium.runScript("listShuttle.remove();");
+ checkJSError();
_checkOrdering(targetListId, "3Item3", "1Item1", null, "Test failed. Remove control does not work");
_assertTableRowsCount(targetListId, 2);
17 years, 5 months
JBoss Rich Faces SVN: r11326 - trunk/ui/core/src/main/config/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2008-11-24 10:23:28 -0500 (Mon, 24 Nov 2008)
New Revision: 11326
Modified:
trunk/ui/core/src/main/config/component/queue.xml
Log:
Queue: rendered attribute hidden
Modified: trunk/ui/core/src/main/config/component/queue.xml
===================================================================
--- trunk/ui/core/src/main/config/component/queue.xml 2008-11-24 15:21:12 UTC (rev 11325)
+++ trunk/ui/core/src/main/config/component/queue.xml 2008-11-24 15:23:28 UTC (rev 11326)
@@ -76,5 +76,9 @@
<name>onsizeexceeded</name>
<classname>java.lang.String</classname>
</property>
+
+ <property hidden="true">
+ <name>rendered</name>
+ </property>
</component>
</components>
17 years, 5 months
JBoss Rich Faces SVN: r11325 - in trunk/test-applications/jsp/src/main: webapp/Editor and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: adubovsky
Date: 2008-11-24 10:21:12 -0500 (Mon, 24 Nov 2008)
New Revision: 11325
Modified:
trunk/test-applications/jsp/src/main/java/editor/Editor.java
trunk/test-applications/jsp/src/main/webapp/Editor/Editor.jsp
trunk/test-applications/jsp/src/main/webapp/Editor/EditorProperty.jsp
Log:
Editor changes
Modified: trunk/test-applications/jsp/src/main/java/editor/Editor.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/editor/Editor.java 2008-11-24 15:19:20 UTC (rev 11324)
+++ trunk/test-applications/jsp/src/main/java/editor/Editor.java 2008-11-24 15:21:12 UTC (rev 11325)
@@ -1,5 +1,37 @@
package editor;
public class Editor {
+ private String value;
+ private String width;
+ private String height;
+ public Editor() {
+ value = "Collaboration-oriented websites require a human-friendly markup language for easy entry of formatted text in forum posts, wiki pages, blogs, comments, etc. Seam provides the <s:formattedText/> control for display of formatted text that conforms to the Seam Text language. Seam Text is implemented using an ANTLR-based parser. You don't need to know anything about ANTLR to use it, however.";
+ width = "400";
+ height = "200";
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ public String getWidth() {
+ return width;
+ }
+
+ public void setWidth(String width) {
+ this.width = width;
+ }
+
+ public String getHeight() {
+ return height;
+ }
+
+ public void setHeight(String height) {
+ this.height = height;
+ }
}
Modified: trunk/test-applications/jsp/src/main/webapp/Editor/Editor.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/Editor/Editor.jsp 2008-11-24 15:19:20 UTC (rev 11324)
+++ trunk/test-applications/jsp/src/main/webapp/Editor/Editor.jsp 2008-11-24 15:21:12 UTC (rev 11325)
@@ -4,10 +4,21 @@
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<f:subview id="editorSubviewID">
- <div>The <b>editor</b> component will provide possibility to use
- tinyMCE editor widget as JSF component.</div>
- <rich:editor id="editorID" value=""></rich:editor>
- <textarea id="textareaID" disabled="disabled" style="width: 400; height: 100"></textarea>
- <br />
- <a4j:commandButton value="a4j Submit" reRender="editorID, textareaID"></a4j:commandButton>
+ <h:panelGrid id="EditorPanelID" columns="2" border="1">
+
+ <rich:editor id="editorID" value="#{editor.value}"
+ width="300" height="100"></rich:editor>
+
+ <h:panelGrid columns="1" >
+ <f:facet name="header">
+ <h:outputText value="Results" />
+ </f:facet>
+ <h:outputText value="#{editor.value}" escape="false" />
+ <div style="color: red; font-style: italic">HTML code:</div>
+ <h:outputText value="#{editor.value}"
+ style="font-style: italic; color: gray" />
+ </h:panelGrid>
+ </h:panelGrid>
+ <a4j:commandButton value="Show Result" reRender="EditorPanelID" />
+ <a4j:commandButton value="reRender editor" reRender="editorID" />
</f:subview>
\ No newline at end of file
Modified: trunk/test-applications/jsp/src/main/webapp/Editor/EditorProperty.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/Editor/EditorProperty.jsp 2008-11-24 15:19:20 UTC (rev 11324)
+++ trunk/test-applications/jsp/src/main/webapp/Editor/EditorProperty.jsp 2008-11-24 15:21:12 UTC (rev 11325)
@@ -4,5 +4,11 @@
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
<f:subview id="editorPropertySubviewID">
+ <h:panelGrid columns="2">
+ <h:outputText value="height"></h:outputText>
+ <h:inputText value="#{editor.height}" onchange="submit();" ></h:inputText>
+ <h:outputText value="width"></h:outputText>
+ <h:inputText value="#{editor.width}" onchange="submit();" ></h:inputText>
+ </h:panelGrid>
</f:subview>
\ No newline at end of file
17 years, 5 months
JBoss Rich Faces SVN: r11324 - in trunk/test-applications/seleniumTest/richfaces/src: main/webapp/pages/orderingList and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2008-11-24 10:19:20 -0500 (Mon, 24 Nov 2008)
New Revision: 11324
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/OrderingListTestBean.java
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/orderingList/orderingListTest.xhtml
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/OrderingListTest.java
Log:
RF-5010
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/OrderingListTestBean.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/OrderingListTestBean.java 2008-11-24 14:16:58 UTC (rev 11323)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/java/org/ajax4jsf/bean/OrderingListTestBean.java 2008-11-24 15:19:20 UTC (rev 11324)
@@ -27,8 +27,11 @@
import java.util.LinkedHashSet;
import java.util.List;
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.event.ValueChangeEvent;
+import javax.faces.validator.ValidatorException;
import org.ajax4jsf.model.ListShuttleItem;
@@ -43,6 +46,8 @@
private String string;
private Boolean immediate;
private Boolean valueChanged;
+ private Boolean attrValidator;
+ private Boolean tagValidator;
public OrderingListTestBean() {
init();
@@ -60,6 +65,8 @@
setString("something");
immediate = false;
valueChanged = false;
+ attrValidator = false;
+ tagValidator = false;
}
public Object getActionResult() {
@@ -158,4 +165,26 @@
public Boolean getValueChanged() {
return valueChanged;
}
+ public void validate(FacesContext context, UIComponent component,
+ Object value) throws ValidatorException {
+ if (attrValidator) {
+ throw new ValidatorException(new FacesMessage("attrValidator"));
+ }
+ }
+
+ public void setTagValidator(Boolean tagValidator) {
+ this.tagValidator = tagValidator;
+ }
+
+ public Boolean getTagValidator() {
+ return tagValidator;
+ }
+
+ public Boolean getAttrValidator() {
+ return attrValidator;
+ }
+
+ public void setAttrValidator(Boolean attrValidator) {
+ this.attrValidator = attrValidator;
+ }
}
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/pages/orderingList/orderingListTest.xhtml
===================================================================
(Binary files differ)
Modified: trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/OrderingListTest.java
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/OrderingListTest.java 2008-11-24 14:16:58 UTC (rev 11323)
+++ trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/testng/OrderingListTest.java 2008-11-24 15:19:20 UTC (rev 11324)
@@ -27,6 +27,7 @@
import java.util.Map;
import org.ajax4jsf.template.Template;
+import org.ajax4jsf.validators.ValidatorWithAttribute;
import org.richfaces.SeleniumEvent;
import org.richfaces.SeleniumTestBase;
import org.testng.Assert;
@@ -89,7 +90,33 @@
private String renderedId;
private String immediateId;
+
+ private String attrValidatorId;
+ private String tagValidatorId;
+
+ /**
+ * validator defined by component attribute and nested tags work
+ */
+ @Test
+ public void testValidators(Template template) {
+ renderPage(template, initMethod);
+ initFields();
+ Assert.assertTrue(selenium.getText(messagesId).length() == 0, "Message mustn't be rendered.");
+ selenium.click(attrValidatorId);
+ waitForAjaxCompletion();
+ clickAjaxCommandAndWait(submitId);
+ Assert.assertEquals(selenium.getText(messagesId), "attrValidator");
+ selenium.click(attrValidatorId);
+ waitForAjaxCompletion();
+ clickAjaxCommandAndWait(submitId);
+ Assert.assertTrue(selenium.getText(messagesId).length() == 0, "Message mustn't be rendered.");
+ selenium.click(tagValidatorId);
+ waitForAjaxCompletion();
+ clickAjaxCommandAndWait(submitId);
+ Assert.assertEquals(selenium.getText(messagesId), ValidatorWithAttribute.MESSAGE);
+ }
+
/**
* style and classes, standard HTML attributes are output to client
*/
@@ -385,7 +412,7 @@
*/
@Test
public void testCaptionFacet(Template template) {
- renderPage(template);
+ renderPage(template, initMethod);
initFields();
Assert.assertEquals(selenium.getText("xpath=id('" + orderingListId + "table')/tbody/tr[1]"), "Caption Faset");
}
@@ -572,6 +599,8 @@
showButtonLabelsId = attrFormId + ":showButtonLabelsId";
renderedId = attrFormId + ":renderedId";
immediateId = attrFormId + ":immediateId";
+ attrValidatorId = attrFormId + ":attrValidatorId";
+ tagValidatorId = attrFormId + ":tagValidatorId";
}
public String getTestUrl() {
17 years, 5 months
JBoss Rich Faces SVN: r11323 - trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/autotest.
by richfaces-svn-commits@lists.jboss.org
Author: dsvyatobatsko
Date: 2008-11-24 09:16:58 -0500 (Mon, 24 Nov 2008)
New Revision: 11323
Modified:
trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/autotest/autoTestHiddens.xhtml
Log:
wrapped the status field into self-rerendering panel
Modified: trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/autotest/autoTestHiddens.xhtml
===================================================================
--- trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/autotest/autoTestHiddens.xhtml 2008-11-24 14:04:11 UTC (rev 11322)
+++ trunk/test-applications/seleniumTest/richfaces/src/main/webapp/layout/autotest/autoTestHiddens.xhtml 2008-11-24 14:16:58 UTC (rev 11323)
@@ -5,7 +5,9 @@
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ui="http://java.sun.com/jsf/facelets">
<h:inputHidden id="_auto_input" value="#{autoTestBean.input}" required="true"></h:inputHidden>
- <h:outputText id="_auto_status" style="display: none;" value="#{autoTestBean.status}"></h:outputText>
+ <a4j:outputPanel ajaxRendered="true">
+ <h:outputText id="_auto_status" style="display: none;" value="#{autoTestBean.status}"></h:outputText>
+ </a4j:outputPanel>
<h:outputText id="_auto_time" style="display: none;" value="#{autoTestBean.text}"></h:outputText>
<h:commandButton id="_auto_simple_submit" value="Simple submit" immediate="#{autoTestBean.immediate}" style="display: none;" />
<a4j:commandButton id="_auto_ajax_submit" value="Ajax submit" reRender="componentId" immediate="#{autoTestBean.immediate}" style="display: none;" />
17 years, 5 months
JBoss Rich Faces SVN: r11322 - trunk/ui/editor.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2008-11-24 09:04:11 -0500 (Mon, 24 Nov 2008)
New Revision: 11322
Modified:
trunk/ui/editor/pom.xml
Log:
antlr scope provided
Modified: trunk/ui/editor/pom.xml
===================================================================
--- trunk/ui/editor/pom.xml 2008-11-24 13:58:14 UTC (rev 11321)
+++ trunk/ui/editor/pom.xml 2008-11-24 14:04:11 UTC (rev 11322)
@@ -69,7 +69,8 @@
<groupId>antlr</groupId>
<artifactId>antlr</artifactId>
<version>2.7.6</version>
- </dependency>
+ <scope> provided </scope>
+ </dependency>
<dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam</artifactId>
17 years, 5 months
JBoss Rich Faces SVN: r11321 - in trunk/test-applications/qa/Test Reports: 3.3.0 and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: tkuprevich
Date: 2008-11-24 08:58:14 -0500 (Mon, 24 Nov 2008)
New Revision: 11321
Added:
trunk/test-applications/qa/Test Reports/3.3.0/
trunk/test-applications/qa/Test Reports/3.3.0/ComponentsAssignment3.3.0.xls
Log:
Added: trunk/test-applications/qa/Test Reports/3.3.0/ComponentsAssignment3.3.0.xls
===================================================================
(Binary files differ)
Property changes on: trunk/test-applications/qa/Test Reports/3.3.0/ComponentsAssignment3.3.0.xls
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
17 years, 5 months