cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tomek...@apache.org
Subject svn commit: r1081958 - in /cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/browser: client/service/browser/ client/ui/browser/ resources/
Date Tue, 15 Mar 2011 21:58:51 GMT
Author: tomekopo
Date: Tue Mar 15 21:58:50 2011
New Revision: 1081958

URL: http://svn.apache.org/viewvc?rev=1081958&view=rev
Log:
Added phrase filed to filtering options and fixed building URL

Modified:
    cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/browser/client/service/browser/FilterOptions.java
    cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/browser/client/ui/browser/EditCriteriaPresenter.java
    cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/browser/client/ui/browser/EditCriteriaView.java
    cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/browser/client/ui/browser/EditCriteriaView.ui.xml
    cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/browser/client/ui/browser/EditCriteriaViewImpl.java
    cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/browser/client/ui/browser/NavigationSidebarPresenter.java
    cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/browser/resources/custom.css

Modified: cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/browser/client/service/browser/FilterOptions.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/browser/client/service/browser/FilterOptions.java?rev=1081958&r1=1081957&r2=1081958&view=diff
==============================================================================
--- cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/browser/client/service/browser/FilterOptions.java
(original)
+++ cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/browser/client/service/browser/FilterOptions.java
Tue Mar 15 21:58:50 2011
@@ -33,6 +33,7 @@ public class FilterOptions {
 
     public static final FilterOptions EMPTY = new FilterOptions();
 
+    @Nullable private String phrase;
     @Nullable private Date from;
     @Nullable private Date to;
     @Nonnull private List<Level> levels;
@@ -41,13 +42,20 @@ public class FilterOptions {
         this.levels = new ArrayList<Level>();
     }
 
-    public FilterOptions(@Nullable Date from, @Nullable Date to, @Nonnull List<Level>
levels) {
+    public FilterOptions(@Nullable String phrase, @Nullable Date from,
+                         @Nullable Date to, @Nonnull List<Level> levels) {
+        this.phrase = phrase;
         this.from = from;
         this.to = to;
         this.levels = levels;
     }
 
     @Nullable
+    public String getPhrase() {
+        return phrase;
+    }
+
+    @Nullable
     public Date getFrom() {
         return from;
     }

Modified: cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/browser/client/ui/browser/EditCriteriaPresenter.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/browser/client/ui/browser/EditCriteriaPresenter.java?rev=1081958&r1=1081957&r2=1081958&view=diff
==============================================================================
--- cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/browser/client/ui/browser/EditCriteriaPresenter.java
(original)
+++ cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/browser/client/ui/browser/EditCriteriaPresenter.java
Tue Mar 15 21:58:50 2011
@@ -52,6 +52,7 @@ public class EditCriteriaPresenter exten
     }
 
     public void onSaveButtonClicked() {
+        String phrase = view.getPhraseValue().getValue();
         Date from = view.getFromValue().getValue();
         Date to = view.getToValue().getValue();
 
@@ -74,7 +75,7 @@ public class EditCriteriaPresenter exten
         if (from == null && to == null && acceptedLevels.isEmpty()) {
             filterOptions = FilterOptions.EMPTY;
         } else {
-            filterOptions = new FilterOptions(from, to, acceptedLevels);
+            filterOptions = new FilterOptions(phrase, from, to, acceptedLevels);
         }
 
         eventBus.fireEvent(new ChangedFilterOptionsEvent(filterOptions));

Modified: cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/browser/client/ui/browser/EditCriteriaView.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/browser/client/ui/browser/EditCriteriaView.java?rev=1081958&r1=1081957&r2=1081958&view=diff
==============================================================================
--- cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/browser/client/ui/browser/EditCriteriaView.java
(original)
+++ cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/browser/client/ui/browser/EditCriteriaView.java
Tue Mar 15 21:58:50 2011
@@ -30,6 +30,8 @@ public interface EditCriteriaView extend
         void onSaveButtonClicked();
     }
 
+    HasValue<String> getPhraseValue();
+
     HasValue<Date> getFromValue();
 
     HasValue<Date> getToValue();

Modified: cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/browser/client/ui/browser/EditCriteriaView.ui.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/browser/client/ui/browser/EditCriteriaView.ui.xml?rev=1081958&r1=1081957&r2=1081958&view=diff
==============================================================================
--- cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/browser/client/ui/browser/EditCriteriaView.ui.xml
(original)
+++ cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/browser/client/ui/browser/EditCriteriaView.ui.xml
Tue Mar 15 21:58:50 2011
@@ -29,9 +29,17 @@
 		<table cellspacing="6">
 			<tr>
 				<td>
+					<g:Label>Phrase:</g:Label>
+				</td>
+             <td>
+                <g:TextBox ui:field="phraseTextBox" addStyleDependentNames="clear"/>
+				</td>
+         </tr>
+			<tr>
+				<td>
 					<g:Label>From:</g:Label>
 				</td>
-                <td>
+             <td>
 					<dp:DateBox ui:field="fromDateBox"/>
 				</td>
          </tr>
@@ -39,7 +47,7 @@
 				<td>
 					<g:Label>To:</g:Label>
 				</td>
-                <td>
+             <td>
 					<dp:DateBox ui:field="toDateBox"/>
 				</td>
 			</tr>

Modified: cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/browser/client/ui/browser/EditCriteriaViewImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/browser/client/ui/browser/EditCriteriaViewImpl.java?rev=1081958&r1=1081957&r2=1081958&view=diff
==============================================================================
--- cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/browser/client/ui/browser/EditCriteriaViewImpl.java
(original)
+++ cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/browser/client/ui/browser/EditCriteriaViewImpl.java
Tue Mar 15 21:58:50 2011
@@ -31,6 +31,7 @@ import com.google.gwt.uibinder.client.Ui
 import com.google.gwt.uibinder.client.UiTemplate;
 import com.google.gwt.user.client.ui.CheckBox;
 import com.google.gwt.user.client.ui.HasValue;
+import com.google.gwt.user.client.ui.TextBox;
 import com.google.gwt.user.client.ui.Widget;
 import com.google.gwt.user.datepicker.client.DateBox;
 import com.google.inject.Inject;
@@ -45,6 +46,7 @@ public class EditCriteriaViewImpl extend
 
     private static final EditCriteriaViewUiBinder UI_BINDER = GWT.create(EditCriteriaViewUiBinder.class);
 
+    @UiField @Nonnull TextBox phraseTextBox;
     @UiField @Nonnull DateBox fromDateBox;
     @UiField @Nonnull DateBox toDateBox;
     @UiField @Nonnull CheckBox debugCheckBox;
@@ -70,6 +72,10 @@ public class EditCriteriaViewImpl extend
         hide();
     }
 
+    public HasValue<String> getPhraseValue() {
+        return phraseTextBox;
+    }
+
     @Nonnull
     public HasValue<Date> getFromValue() {
         return fromDateBox;

Modified: cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/browser/client/ui/browser/NavigationSidebarPresenter.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/browser/client/ui/browser/NavigationSidebarPresenter.java?rev=1081958&r1=1081957&r2=1081958&view=diff
==============================================================================
--- cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/browser/client/ui/browser/NavigationSidebarPresenter.java
(original)
+++ cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/browser/client/ui/browser/NavigationSidebarPresenter.java
Tue Mar 15 21:58:50 2011
@@ -23,6 +23,7 @@ import java.util.List;
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
 
+import com.google.gwt.http.client.URL;
 import com.google.gwt.i18n.client.DateTimeFormat;
 import com.google.inject.Inject;
 import com.google.inject.Singleton;
@@ -97,32 +98,59 @@ public class NavigationSidebarPresenter 
         if (filterOptions != FilterOptions.EMPTY) {
             url.append("?_s=");
 
-            DateTimeFormat dateTimeFormater = DateTimeFormat.getFormat("yyyy-MM-dd");
+            DateTimeFormat dateTimeFormatter = DateTimeFormat.getFormat("yyyy-MM-dd");
+
+            boolean isFirstAttribute = true;
+
+            if (filterOptions.getPhrase() != null && !filterOptions.getPhrase().isEmpty())
{
+                url.append("phrase==*");
+                url.append(filterOptions.getPhrase());
+                url.append("*;");
+                isFirstAttribute = false;
+            }
 
             if (filterOptions.getFrom() != null) {
                 url.append("date=ge=");
-                url.append(dateTimeFormater.format(filterOptions.getFrom()));
+                url.append(dateTimeFormatter.format(filterOptions.getFrom()));
                 url.append(";");
+                isFirstAttribute = false;
             }
 
             if (filterOptions.getTo() != null) {
                 url.append("date=lt=");
-                url.append(dateTimeFormater.format(filterOptions.getTo()));
+                url.append(dateTimeFormatter.format(filterOptions.getTo()));
                 url.append(";");
+                isFirstAttribute = false;
             }
 
             if (!filterOptions.getLevels().isEmpty()) {
+
+                // Add parenthesis only if not first attribute
+                if (!isFirstAttribute) {
+                    url.append("(");
+                }
+
                 for (Level level : filterOptions.getLevels()) {
                     url.append("level==");
                     url.append(level);
                     url.append(",");
                 }
-            }
 
-            url.deleteCharAt(url.length() - 1);
+                // Remove last ';' or ',' from URL
+                url.deleteCharAt(url.length() - 1);
+
+                // Add parenthesis only if not first attribute
+                if (!isFirstAttribute) {
+                    url.append(")");
+                }
+            } else {
+
+                // Remove last ';' or ',' from URL
+                url.deleteCharAt(url.length() - 1);
+            }
         }
 
-        eventBus.fireEvent(new SelectedSubscriptionEvent(url.toString()));
+        eventBus.fireEvent(new SelectedSubscriptionEvent(URL.encode(url.toString())));
     }
 
     public void onManageSubscriptionsButtonClicked() {

Modified: cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/browser/resources/custom.css
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/browser/resources/custom.css?rev=1081958&r1=1081957&r2=1081958&view=diff
==============================================================================
--- cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/browser/resources/custom.css
(original)
+++ cxf/trunk/rt/management-web/src/main/java/org/apache/cxf/management/web/browser/resources/custom.css
Tue Mar 15 21:58:50 2011
@@ -9,4 +9,8 @@ body table {
 
 .gwt-DecoratedTabPanel-settings .tabMiddleLeft, .gwt-DecoratedTabPanel-settings .tabMiddleCenter,
.gwt-DecoratedTabPanel-settings .tabMiddleRight, .gwt-DecoratedTabPanel-settings .tabTopLeft,
.gwt-DecoratedTabPanel-settings .tabTopCenter, .gwt-DecoratedTabPanel-settings .tabTopRight
{
    background: none repeat scroll 0 0 #FFF7D7 !important;
+}
+
+.gwt-TextBox-clear {
+   padding: 1px 0px;
 }
\ No newline at end of file



Mime
View raw message