PK a7 META-INF/PK a7ujjMETA-INF/MANIFEST.MFManifest-Version: 1.0 Ant-Version: Apache Ant 1.7.0 Created-By: 1.6.0_03-b05 (Sun Microsystems Inc.) PK a7ErrorTypeEditor/PK a7WEB-INF/PK a7WEB-INF/classes/PK a7abc/PK a7 resources2/PK a79FErrorTypeEditor/component.css/*---------------------------------------------------------- STYLE DECLARATION FOR ErrorTypeEditor WIDGET LAYOUT, COLOR AND TYPOGRAPHY -----------------------------------------------------------*/ /*----- main container ------*/ div.errorTypeEditorPopup { position: absolute; border: solid 1px #888; width: 290px; background-color: #ECE9EB; } /*------ header -------------*/ div.errorTypeEditorPopup h4 { font-size: 0.88em; font-weight: bold; border-bottom: 1px solid #999; } /*---------- fieldset ---------*/ div.errorTypeEditorPopup fieldset.inputFieldset { margin-top: 10px; } div.errorTypeEditorPopup fieldset.buttonFieldset { text-align: center; margin:10px 20px 7px; border-top:1px solid #999999; padding-top:7px; } div.errorTypeEditorPopup fieldset.inputFieldset input { border: solid 1px #888; width: 230px; padding: 1px; display: block; margin-bottom: 8px; margin-left: 20px; margin-right: 20px; } div.errorTypeEditorPopup fieldset.inputFieldset input:focus { background-color:#F0F0F0; } /*---------- labels -----------*/ div.errorTypeEditorPopup form label { font-weight: bold; font-size: 0.81em; display: block; padding-bottom: 4px; margin-left: 20px; margin-right: 20px; } /*---------- error message -----------*/ div.errorTypeEditorPopup fieldset.inputFieldset ul.errormsg { border: 1px dotted #900; background-color: #ffc; margin-left: 10px; margin-right: 20px; } div.errorTypeEditorPopup fieldset.inputFieldset ul.errormsg li h3 { margin: 0; padding: 0.3em 0.8em; font-size: 0.85em; color: #900; }PK a7j0oErrorTypeEditor/component.htm PK a7 ^^ErrorTypeEditor/component.jswow.log("ErrorTypeEditor/component.js --start"); /* * Define the namespace (object) for this widget. * * Note: The "jmaki.widgets" prefix is hardwired into /resources/jmaki.js. */ jmaki.namespace("jmaki.widgets.WowWidgets.ErrorTypeEditor"); jmaki.widgets.WowWidgets.ErrorTypeEditor.Widget = Class.create(); jmaki.widgets.WowWidgets.ErrorTypeEditor.Widget.prototype = { /** * */ initialize : function(wargs) { // Store the parameters as instance vars this.uuid = wargs.uuid; // Bind handlers var self = this; $(this.uuid + "_ok").onclick = function(){ self.onOk(); } $(this.uuid + "_cancel").onclick = function(){ self.hide(); } $(this.uuid + "_remove").onclick = function(){ self.onRemove(); } // Setup event handler on http status code field. var httpStatusCode = $(this.uuid + "_httpStatusCode"); httpStatusCode.isValid = true; Event.observe(httpStatusCode, "blur", function() { self.validate(httpStatusCode); }); }, /** * Brings up the editor and fills it with data of given parameter. * * @param param */ edit : function(param, element) { // Create model for received parameter and fill it with data this.errorType = new wow.ErrorType(); // If an exisitng error type is to be edited, an object is passed in if (typeof(param) == "object") { this.errorType.errorCode = param.errorCode; this.errorType.description = param.description; this.errorType.httpStatusCode = param.httpStatusCode; this.isEditing = true; } // If new error type is to be edited, only error code is passed in else { this.errorType.errorCode = param; this.errorType.description = ""; this.errorType.httpStatusCode = ""; this.isEditing = false; } this.updateView(); this.show(element); }, /** * Updates the DOM view components with current model data. */ updateView : function() { // var headerContent = "Edit error type '" + this.errorType.errorCode + "'"; // $(this.uuid + "_errorCode").update(headerContent); $(this.uuid + "_errorCode").value = this.errorType.errorCode; $(this.uuid + "_description").value = this.errorType.description; $(this.uuid + "_httpStatusCode").value = this.errorType.httpStatusCode; if (this.errorType.errorCode != "") { $(this.uuid + "_errorCode").disabled = true; } else { $(this.uuid + "_errorCode").disabled = false; } $(this.uuid + "_remove").disabled = !(this.isEditing); var errorNode = $(this.uuid + "_httpStatusCode").parentNode.getElementsByClassName("errormsg")[0]; if(errorNode) { $(this.uuid + "_httpStatusCode").parentNode.removeChild(errorNode); } }, /** * Updates the model with the values in the view */ updateModel : function() { this.errorType.description = $(this.uuid + "_description").value; var statusCode = $(this.uuid + "_httpStatusCode").value; if (statusCode == "") { statusCode = null; } this.errorType.httpStatusCode = statusCode; this.errorType.errorCode = $(this.uuid + "_errorCode").value; }, /* * Brings up the widget in a popup. */ show : function(element) { Popup.showPopup($(this.uuid), element); }, /* * Hides the popup. */ hide : function() { Popup.hidePopup($(this.uuid)); }, /** * Event handler raised on Ok button click. */ onOk : function() { var httpStatusCode = $(this.uuid + "_httpStatusCode"); if (httpStatusCode.isValid == false) { return; } // Update the model this.updateModel(); // Send back a change object if (this.isEditing) { jmaki.publish("/ItemPage/modifyData", { property: "errorTypes", edit: this.errorType }); } else { jmaki.publish("/ItemPage/modifyData", { property: "errorTypes", add: this.errorType }); } // Hide the dialog this.hide(); }, /** * Event handler raised on Remove button click. */ onRemove : function() { // Send back a change object jmaki.publish("/ItemPage/modifyData", { property: "errorTypes", remove: this.errorType }); // Hide the dialog this.hide(); }, /** * This method validates the http status code field. * Only numbers is allowed. */ validate : function(field) { var pattern = /^\d+$/; if (field.value.empty() || pattern.test(field.value)) { field.isValid = true; this.removeErrorMsg(field); } else { field.isValid = false; this.showErrorMsg(field); } }, /** * Remove the error message underneath the invalid field. */ removeErrorMsg : function(node) { var errorNode = node.parentNode.getElementsByClassName("errormsg")[0]; if(errorNode) { node.parentNode.removeChild(errorNode); } }, /** * Show the error message underneath the invalid field. */ showErrorMsg : function(node) { var errorNode = node.parentNode.getElementsByClassName("errormsg")[0]; if(!errorNode) { var error = "HTTP status code must be a number."; var container = document.createElement("ul"); container.className = "errormsg"; var msgNode = document.createElement("li"); var msgText = document.createElement("h3"); msgText.appendChild(document.createTextNode(error)); msgNode.appendChild(msgText); container.appendChild(msgNode); node.parentNode.appendChild(container); } } } wow.log("ErrorTypeEditor/component.js --end");PK a74UWEB-INF/sun-web.xml / Keep a copy of the generated servlet class' java code. PK a7TWEB-INF/web.xml NewServlet NewServlet NewServlet /NewServlet 30 abc/index.jsp PK a7{ abc/index.jsp<%-- Document : index Created on : Nov 1, 2007, 4:40:07 PM Author : Chris Webster --%> <%@page contentType="text/html" pageEncoding="UTF-8"%> JSP Page

Hello World!

PK a7:1PF F dwow.log("ErrorTypesList/component.js --start"); /* * Define the namespace (object) for this widget. * * Note: The "jmaki.widgets" prefix is hardwired into /resources/jmaki.js. */ jmaki.namespace("jmaki.widgets.WowWidgets.ErrorTypesList"); jmaki.widgets.WowWidgets.ErrorTypesList.Widget = Class.create(); jmaki.widgets.WowWidgets.ErrorTypesList.Widget.prototype = { initialize : function(wargs) { this.uuid = wargs.uuid; // Subscribe to receive version or draft data var widget = this; jmaki.subscribe("/ItemPage/itemData", function(item){ widget.setData(item); }); }, /* * Sets the list of error types to the list. */ setData : function(item) { var htmlString = ""; if (item.errorTypes.length > 0) { // Iterate through array of parameters and create HTML markup for (var i = 0; i < item.errorTypes.length; i++) { var errorType = item.errorTypes[i]; htmlString += "
» " + errorType.errorCode + " "; if (errorType.httpStatusCode != null) { htmlString += "(" + errorType.httpStatusCode + ")"; } // Add edit button, if we are showing a draft if (item.draftVersion != undefined) { htmlString += ""; } htmlString += "
"; htmlString += "
" + errorType.description + "
"; } } else { htmlString += "There are no error types.

"; } // TODO: Move this into the template if (item.draftVersion != undefined) htmlString += "Add a new error type"; // Update the widget $(this.uuid + "_list").update(htmlString); // If we are showing draft, hook up handlers if (item.draftVersion != undefined) { // Assign handlers to these buttons // TODO: Fix the creation of the UI above; use DOM methods instead for (var i = 0; i < item.errorTypes.length; i++) { var btn = $(this.uuid + "_edit" + i); btn.errorCode = item.errorTypes[i].errorCode; Event.observe(btn, "click", function(event) { jmaki.publish("/ItemPage/editErrorType", { errorCode: this.errorCode, event: event }); }); } // TODO: Another hack here: Event.observe($(this.uuid + "_addNew"), "click", function(event) { jmaki.publish("/ItemPage/editErrorType", { errorCode: "", event: event }); }); } } }; wow.log("ErrorTypesList/component.js --end");PK a7//hi.htm hi in resources2 PK a7//resources2/component.htm hi in resources2 PK a7(O resources2/dvar x = 7;PK a7 resources2/newEmptyJavaScript.jsPK a7 AMETA-INF/PK a7ujj+META-INF/MANIFEST.MFPK a7AErrorTypeEditor/PK a7AWEB-INF/PK a7AWEB-INF/classes/PK a7AIabc/PK a7 Akresources2/PK a79FErrorTypeEditor/component.cssPK a7j0oErrorTypeEditor/component.htmPK a7 ^^ ErrorTypeEditor/component.jsPK a74Ub'WEB-INF/sun-web.xmlPK a7T)WEB-INF/web.xmlPK a7{ ,abc/index.jspPK a7:1PF F .dPK a7//:hi.htmPK a7//e:resources2/component.htmPK a7(O :resources2/dPK a7 :resources2/newEmptyJavaScript.jsPKd<;