Added: cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/settings/SubscriptionDialogImpl.java URL: http://svn.apache.org/viewvc/cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/settings/SubscriptionDialogImpl.java?rev=983258&view=auto ============================================================================== --- cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/settings/SubscriptionDialogImpl.java (added) +++ cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/settings/SubscriptionDialogImpl.java Sat Aug 7 16:57:58 2010 @@ -0,0 +1,140 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.cxf.management.web.logging.logbrowser.client.ui.settings; + +import java.util.Map; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; + +import com.google.gwt.core.client.GWT; +import com.google.gwt.event.dom.client.ClickEvent; +import com.google.gwt.event.dom.client.ClickHandler; +import com.google.gwt.uibinder.client.UiBinder; +import com.google.gwt.uibinder.client.UiField; +import com.google.gwt.uibinder.client.UiTemplate; +import com.google.gwt.user.client.ui.Button; +import com.google.gwt.user.client.ui.Composite; +import com.google.gwt.user.client.ui.DialogBox; +import com.google.gwt.user.client.ui.HasValue; +import com.google.gwt.user.client.ui.Label; +import com.google.gwt.user.client.ui.TextBox; +import com.google.gwt.user.client.ui.Widget; + +import org.apache.cxf.management.web.logging.logbrowser.client.service.settings.Subscription; + +public class SubscriptionDialogImpl extends DialogBox implements SubscriptionDialog { + + @Nonnull + private Form form; + + @Nullable + private Presenter presenter; + + public SubscriptionDialogImpl() { + form = new Form(); + form.nameErrorLabel.setVisible(false); + form.urlErrorLabel.setVisible(false); + + form.cancelButton.addClickHandler(new ClickHandler() { + + public void onClick(@Nonnull final ClickEvent clickEvent) { + assert presenter != null; + presenter.onCancelButtonClicked(); + } + }); + form.saveButton.addClickHandler(new ClickHandler() { + + public void onClick(@Nonnull final ClickEvent clickEvent) { + assert presenter != null; + presenter.onSaveButtonClicked(form.nameTextBox, form.urlTextBox); + } + }); + + setGlassEnabled(true); + setAnimationEnabled(false); + setAutoHideEnabled(true); + setWidget(form); + } + + public void setValidationErrors(@Nullable Map<HasValue, String> errors) { + if (errors == null) { + form.nameErrorLabel.setVisible(false); + form.urlErrorLabel.setVisible(false); + return; + } + + if (errors.containsKey(form.nameTextBox)) { + form.nameErrorLabel.setText(errors.get(form.nameTextBox)); + form.nameErrorLabel.setVisible(true); + } + if (errors.containsKey(form.urlTextBox)) { + form.urlErrorLabel.setText(errors.get(form.urlTextBox)); + form.urlErrorLabel.setVisible(true); + } + } + + public void setTitle(@Nonnull final String title) { + setText(title); + } + + public void setData(@Nullable final Subscription subscription) { + if (subscription == null) { + form.nameTextBox.setValue(""); + form.urlTextBox.setValue(""); + } else { + form.nameTextBox.setValue(subscription.getName()); + form.urlTextBox.setValue(subscription.getUrl()); + } + } + + public void setPresenter(@Nonnull final Presenter presenter) { + this.presenter = presenter; + } + + protected static class Form extends Composite { + + @UiTemplate("SubscriptionForm.ui.xml") + interface FormViewUiBinder extends UiBinder<Widget, Form> { } + + private static final FormViewUiBinder UI_BINDER = GWT.create(FormViewUiBinder.class); + + @UiField @Nonnull + TextBox nameTextBox; + + @UiField @Nonnull + Label nameErrorLabel; + + @UiField @Nonnull + TextBox urlTextBox; + + @UiField @Nonnull + Label urlErrorLabel; + + @UiField @Nonnull + Button saveButton; + + @UiField @Nonnull + Button cancelButton; + + public Form() { + initWidget(UI_BINDER.createAndBindUi(this)); + } + } +}
Added: cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/settings/SubscriptionEntry.ui.xml URL: http://svn.apache.org/viewvc/cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/settings/SubscriptionEntry.ui.xml?rev=983258&view=auto ============================================================================== --- cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/settings/SubscriptionEntry.ui.xml (added) +++ cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/settings/SubscriptionEntry.ui.xml Sat Aug 7 16:57:58 2010 @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + --> + +<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder' + xmlns:g='urn:import:com.google.gwt.user.client.ui'> + + <ui:with field='res' + type='org.apache.cxf.management.web.logging.logbrowser.client.ui.resources.LogBrowserResources'/> + + <g:HTMLPanel> + <table class="{res.css.feedEntry}"> + <tr> + <td> + <g:Label ui:field="nameLabel" addStyleNames="{res.css.feedEntryNameLabel}" /> + <g:Label ui:field="urlLabel" addStyleNames="{res.css.feedEntryUrlLabel}" /> + </td> + + <td class="{res.css.feedEntryButtons}"> + <g:Button ui:field="removeButton" addStyleNames="{res.css.feedEntryRemoveButton}"> + Remove + </g:Button> + <g:Button ui:field="editButton" addStyleNames="{res.css.feedEntryEditButton}"> + Edit + </g:Button> + </td> + </tr> + + </table> + </g:HTMLPanel> + +</ui:UiBinder> Added: cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/settings/SubscriptionForm.ui.xml URL: http://svn.apache.org/viewvc/cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/settings/SubscriptionForm.ui.xml?rev=983258&view=auto ============================================================================== --- cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/settings/SubscriptionForm.ui.xml (added) +++ cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/settings/SubscriptionForm.ui.xml Sat Aug 7 16:57:58 2010 @@ -0,0 +1,69 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + --> + +<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder' + xmlns:g='urn:import:com.google.gwt.user.client.ui'> + + <ui:with field='res' + type='org.apache.cxf.management.web.logging.logbrowser.client.ui.resources.LogBrowserResources'/> + + <g:HTMLPanel> + <table cellspacing="6"> + <tr> + <td> + <g:Label>Name:</g:Label> + </td> + <td> + <g:TextBox ui:field="nameTextBox"></g:TextBox> + </td> + </tr> + <tr> + <td></td> + <td> + <g:Label ui:field="nameErrorLabel" addStyleNames="{res.css.editFeedDialogErrorMessage}"/> + </td> + </tr> + <tr> + <td> + <g:Label>URL:</g:Label> + </td> + <td> + <g:TextBox ui:field="urlTextBox"></g:TextBox> + </td> + </tr> + <tr> + <td></td> + <td> + <g:Label ui:field="urlErrorLabel" addStyleNames="{res.css.editFeedDialogErrorMessage}"/> + </td> + </tr> + </table> + <g:FlowPanel addStyleNames="{res.css.editFeedDialogButtons}"> + <g:Button ui:field="cancelButton"> + Cancel + </g:Button> + <g:Button ui:field="saveButton" addStyleNames="{res.css.editFeedDialogAddButton}"> + Save + </g:Button> + </g:FlowPanel> + + </g:HTMLPanel> + +</ui:UiBinder> Added: cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/resources/LogBrowser.html URL: http://svn.apache.org/viewvc/cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/resources/LogBrowser.html?rev=983258&view=auto ============================================================================== --- cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/resources/LogBrowser.html (added) +++ cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/resources/LogBrowser.html Sat Aug 7 16:57:58 2010 @@ -0,0 +1,40 @@ +<!doctype html> +<!-- + ~ * Licensed to the Apache Software Foundation (ASF) under one + ~ * or more contributor license agreements. See the NOTICE file + ~ * distributed with this work for additional information + ~ * regarding copyright ownership. The ASF licenses this file + ~ * to you under the Apache License, Version 2.0 (the + ~ * "License"); you may not use this file except in compliance + ~ * with the License. You may obtain a copy of the License at + ~ * + ~ * http://www.apache.org/licenses/LICENSE-2.0 + ~ * + ~ * Unless required by applicable law or agreed to in writing, + ~ * software distributed under the License is distributed on an + ~ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + ~ * KIND, either express or implied. See the License for the + ~ * specific language governing permissions and limitations + ~ * under the License. + --> + +<html> + <head> + <meta http-equiv="content-type" content="text/html; charset=UTF-8"> + + <title>LogBrowser</title> + + <script type="text/javascript" language="javascript" src="logbrowser.nocache.js"></script> + </head> + + <body> + <iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe> + + <noscript> + <div style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif"> + Your web browser must have JavaScript enabled + in order for this application to display correctly. + </div> + </noscript> + </body> +</html> Added: cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/resources/json2.min.js URL: http://svn.apache.org/viewvc/cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/resources/json2.min.js?rev=983258&view=auto ============================================================================== --- cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/resources/json2.min.js (added) +++ cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/resources/json2.min.js Sat Aug 7 16:57:58 2010 @@ -0,0 +1,7 @@ +if(!this.JSON)this.JSON={}; +(function(){function l(b){return b<10?"0"+b:b}function o(b){p.lastIndex=0;return p.test(b)?'"'+b.replace(p,function(f){var c=r[f];return typeof c==="string"?c:"\\u"+("0000"+f.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+b+'"'}function m(b,f){var c,d,g,j,i=h,e,a=f[b];if(a&&typeof a==="object"&&typeof a.toJSON==="function")a=a.toJSON(b);if(typeof k==="function")a=k.call(f,b,a);switch(typeof a){case "string":return o(a);case "number":return isFinite(a)?String(a):"null";case "boolean":case "null":return String(a); +case "object":if(!a)return"null";h+=n;e=[];if(Object.prototype.toString.apply(a)==="[object Array]"){j=a.length;for(c=0;c<j;c+=1)e[c]=m(c,a)||"null";g=e.length===0?"[]":h?"[\n"+h+e.join(",\n"+h)+"\n"+i+"]":"["+e.join(",")+"]";h=i;return g}if(k&&typeof k==="object"){j=k.length;for(c=0;c<j;c+=1){d=k[c];if(typeof d==="string")if(g=m(d,a))e.push(o(d)+(h?": ":":")+g)}}else for(d in a)if(Object.hasOwnProperty.call(a,d))if(g=m(d,a))e.push(o(d)+(h?": ":":")+g);g=e.length===0?"{}":h?"{\n"+h+e.join(",\n"+h)+ +"\n"+i+"}":"{"+e.join(",")+"}";h=i;return g}}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+l(this.getUTCMonth()+1)+"-"+l(this.getUTCDate())+"T"+l(this.getUTCHours())+":"+l(this.getUTCMinutes())+":"+l(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()}}var q=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, +p=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,h,n,r={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},k;if(typeof JSON.stringify!=="function")JSON.stringify=function(b,f,c){var d;n=h="";if(typeof c==="number")for(d=0;d<c;d+=1)n+=" ";else if(typeof c==="string")n=c;if((k=f)&&typeof f!=="function"&&(typeof f!=="object"||typeof f.length!=="number"))throw new Error("JSON.stringify");return m("", +{"":b})};if(typeof JSON.parse!=="function")JSON.parse=function(b,f){function c(g,j){var i,e,a=g[j];if(a&&typeof a==="object")for(i in a)if(Object.hasOwnProperty.call(a,i)){e=c(a,i);if(e!==undefined)a[i]=e;else delete a[i]}return f.call(g,j,a)}var d;b=String(b);q.lastIndex=0;if(q.test(b))b=b.replace(q,function(g){return"\\u"+("0000"+g.charCodeAt(0).toString(16)).slice(-4)});if(/^[\],:{}\s]*$/.test(b.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, +"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){d=eval("("+b+")");return typeof f==="function"?c({"":d},""):d}throw new SyntaxError("JSON.parse");}})(); \ No newline at end of file Added: cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/resources/jstorage.config.js URL: http://svn.apache.org/viewvc/cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/resources/jstorage.config.js?rev=983258&view=auto ============================================================================== --- cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/resources/jstorage.config.js (added) +++ cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/resources/jstorage.config.js Sat Aug 7 16:57:58 2010 @@ -0,0 +1 @@ +$={}; \ No newline at end of file Added: cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/resources/jstorage.min.js URL: http://svn.apache.org/viewvc/cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/resources/jstorage.min.js?rev=983258&view=auto ============================================================================== --- cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/resources/jstorage.min.js (added) +++ cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/resources/jstorage.min.js Sat Aug 7 16:57:58 2010 @@ -0,0 +1,5 @@ +(function(f){function i(){try{d.jStorage=m(c);if(e){e.setAttribute("jStorage",d.jStorage);e.save("jStorage")}j=d.jStorage?String(d.jStorage).length:0}catch(a){}}function k(a){if(!a&&a!==0||typeof a!="string"&&typeof a!="number")throw new TypeError("Key name must be string or numeric");return true}if(!f||!(f.toJSON||Object.toJSON||window.JSON))throw new Error("jQuery, MooTools or Prototype needs to be loaded before jStorage!");var c={},d={jStorage:"{}"},e=null,j=0,m=f.toJSON||Object.toJSON||window.JSON&& +(JSON.encode||JSON.stringify),n=f.evalJSON||window.JSON&&(JSON.decode||JSON.parse)||function(a){return String(a).evalJSON()},l={isXML:function(a){return(a=(a?a.ownerDocument||a:0).documentElement)?a.nodeName!=="HTML":false},encode:function(a){if(!this.isXML(a))return false;try{return(new XMLSerializer).serializeToString(a)}catch(b){try{return a.xml}catch(g){}}return false},decode:function(a){var b="DOMParser"in window&&(new DOMParser).parseFromString||window.ActiveXObject&&function(g){var h=new ActiveXObject("Microsoft.XMLDOM"); +h.async="false";h.loadXML(g);return h};if(!b)return false;a=b.call("DOMParser"in window&&new DOMParser||window,a,"text/xml");return this.isXML(a)?a:false}};f.jStorage={version:"0.1.4.1",set:function(a,b){k(a);if(l.isXML(b))b={_is_xml:true,xml:l.encode(b)};c[a]=b;i();return b},get:function(a,b){k(a);if(a in c)return typeof c[a]=="object"&&c[a]._is_xml&&c[a]._is_xml?l.decode(c[a].xml):c[a];return typeof b=="undefined"?null:b},deleteKey:function(a){k(a);if(a in c){delete c[a];i();return true}return false}, +flush:function(){c={};i();try{window.localStorage.clear()}catch(a){}return true},storageObj:function(){function a(){}a.prototype=c;return new a},index:function(){var a=[],b;for(b in c)c.hasOwnProperty(b)&&a.push(b);return a},storageSize:function(){return j}};(function(){if("localStorage"in window)try{d=window.localStorage}catch(a){}else if("globalStorage"in window)try{d=window.globalStorage[window.location.hostname]}catch(b){}else{e=document.createElement("link");if(e.addBehavior){e.style.behavior= +"url(#default#userData)";document.getElementsByTagName("head")[0].appendChild(e);e.load("jStorage");var g="{}";try{g=e.getAttribute("jStorage")}catch(h){}d.jStorage=g}else{e=null;return}}if(d.jStorage)try{c=n(String(d.jStorage))}catch(o){d.jStorage="{}"}else d.jStorage="{}";j=d.jStorage?String(d.jStorage).length:0})()})(window.jQuery||window.$); \ No newline at end of file Modified: cxf/sandbox/logbrowser/rt/management-web/src/test/java/org/apache/cxf/management/web/logging/MockApp.java URL: http://svn.apache.org/viewvc/cxf/sandbox/logbrowser/rt/management-web/src/test/java/org/apache/cxf/management/web/logging/MockApp.java?rev=983258&r1=983257&r2=983258&view=diff ============================================================================== --- cxf/sandbox/logbrowser/rt/management-web/src/test/java/org/apache/cxf/management/web/logging/MockApp.java (original) +++ cxf/sandbox/logbrowser/rt/management-web/src/test/java/org/apache/cxf/management/web/logging/MockApp.java Sat Aug 7 16:57:58 2010 @@ -28,9 +28,9 @@ import javax.ws.rs.ext.Provider; import org.apache.cxf.jaxrs.provider.AtomEntryProvider; import org.apache.cxf.jaxrs.provider.AtomFeedProvider; import org.apache.cxf.management.web.logging.atom.AtomPullServer; -import org.apache.cxf.management.web.logging.bootstrapping.BootstrapStorage; -import org.apache.cxf.management.web.logging.bootstrapping.SimpleAuthenticationFilter; -import org.apache.cxf.management.web.logging.bootstrapping.SimpleXMLSettingsStorage; +import org.apache.cxf.management.web.logging.logbrowser.bootstrapping.BootstrapStorage; +import org.apache.cxf.management.web.logging.logbrowser.bootstrapping.SimpleAuthenticationFilter; +import org.apache.cxf.management.web.logging.logbrowser.bootstrapping.SimpleXMLSettingsStorage; @Provider public class MockApp extends Application {
