Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "CosmosDataReportingComponent10 209223"

(Replaying the default logging mechanism)
(''' Workload Estimation''')
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
=Overview=
+
Back to [[CosmosDataReportingDesign|Data Reporting Design]]
 +
 
 +
= '''Change History''' =
 +
{|{{BMTableStyle}}
 +
!align="left"|Name:
 +
!align="left"|Date:
 +
!align="left"|Revised Sections:
 +
|-
 +
|Sheldon Lee-Loy
 +
|11/14/2007
 +
|<ul><li>Initial version</li></ul>
 +
|-
 +
|Sheldone Lee-Loy
 +
|11/29/2007
 +
|<ul><li>Added Change History  and Workload Estimate sections</li></ul>
 +
|}
 +
 
 +
= ''' Workload Estimation''' =
 +
 
 +
{|{{BMTableStyle}}
 +
|+{{BMTableCaptionStyle}}|Rough workload estimate in person weeks
 +
|-{{BMTHStyle}}
 +
! Process
 +
! Sizing
 +
! Names of people doing the work
 +
|-
 +
| align="left" | Design
 +
| 0.5
 +
| Sheldon Lee-Loy
 +
|-
 +
| align="left" | Code
 +
| 0.5
 +
| Sheldon Lee-Loy
 +
|-
 +
| align="left" | Test
 +
| 0.5
 +
| Sheldon Lee-Loy
 +
|-
 +
| align="left" | Documentation
 +
| 0.2 **
 +
|
 +
|-
 +
| align="left" | Build and infrastructure
 +
| 0.2
 +
|
 +
|-
 +
| align="left" | Code review, etc.*
 +
| 0.2
 +
|
 +
|-
 +
! align="right" | TOTAL
 +
| 2.1
 +
|
 +
|}
 +
 
 +
'* -  includes other committer work (e.g. check-in, contribution tracking)
 +
 
 +
'** - documentation may span multiple release.  Note an additional enhancement is associated with a programmer's guide ([https://bugs.eclipse.org/bugs/show_bug.cgi?id=210134 ER 210134])
 +
 
 +
=Purpose=
 
There are two tiers to the COSMOS UI.
 
There are two tiers to the COSMOS UI.
 
* Client-side
 
* Client-side
 
* Server-side
 
* Server-side
  
This enhancement will ocver the error handling for the client-side tier.
+
This enhancement will cover the error handling for the client-side tier.
  
 
=Requirement=
 
=Requirement=
Line 75: Line 134:
 
*messagetype - this is a numeric value 1,2 or 4 repesenting an error, informational or warning message
 
*messagetype - this is a numeric value 1,2 or 4 repesenting an error, informational or warning message
  
==Replacing or Configuring the default logging mechanism==
+
Server side logging is further discussed in enhancement [[CosmosDataReportingComponent10_208592| 208592]]
The Cosmos Web UI will create a global error handler object that will instantiate an object that is registered
+
to the following attach point:
+
 
+
"errorHandler"
+
 
+
Exploiters can replace the default error handler object with their own error handler by modifying the page.jprop file as follows:
+
 
+
<pre>
+
{
+
  errorHandler:{clazz:"my.error.handler"}
+
}
+
</pre>
+
 
+
Exploiters can use the existing error handler and configure the error handler via the page.jprop file as follows:
+
 
+
<pre>
+
{
+
  errorHandler:{clazz:"cosmos.ui.provisional.error.handler", debug:MESSAGE.ERROR|MESSAGE.INFO}
+
}
+
</pre>
+
The above example will configure the error handler to log error and informational message the debug console.
+
  
 
==Design Note==
 
==Design Note==

Latest revision as of 12:51, 29 November 2007

Back to Data Reporting Design

Change History

Name: Date: Revised Sections:
Sheldon Lee-Loy 11/14/2007
  • Initial version
Sheldone Lee-Loy 11/29/2007
  • Added Change History and Workload Estimate sections

Workload Estimation

Rough workload estimate in person weeks
Process Sizing Names of people doing the work
Design 0.5 Sheldon Lee-Loy
Code 0.5 Sheldon Lee-Loy
Test 0.5 Sheldon Lee-Loy
Documentation 0.2 **
Build and infrastructure 0.2
Code review, etc.* 0.2
TOTAL 2.1

'* - includes other committer work (e.g. check-in, contribution tracking)

'** - documentation may span multiple release. Note an additional enhancement is associated with a programmer's guide (ER 210134)

Purpose

There are two tiers to the COSMOS UI.

  • Client-side
  • Server-side

This enhancement will cover the error handling for the client-side tier.

Requirement

In general the COSMOS UI message logging should adopt similar message logging strategies used by other sub projects. These strategies should satisfy the following requirements:

  1. Provide the ability to log warning, informational and error messages
  2. Provide the ability to replace the logging mechanism with a custom mechanism
  3. Provide the ability to prompt the user with warning, informational or error messages

Design

Error Handler

The COMSOS UI will define a default error handler object that will be defined as a dojo object. This will allow exploiters to extend or replace the error handler by utilizing the dojo programming model.

The following defines the error handler object:

dojo.declare("cosmos.ui.provisional.error.handler.ErrorHandler", null , {
	constructor: function( keywordParameters){
	},	
 	serverHandler:null,
	//defines a url that will recieve logged messages.
	debug:0,
	//atribute that determins if the message should be logged to the dojo debug console.
	promptDialog:null,
	//defines the dialog box that will show the message.
	prompt:0,
	//attribute that determines if a dialog box should be displayed when a message is logged
	logError:function(message, prompt) {
	// summary: logs an error messages
	// description: the message is logged as an error message.  If the prompt argument
 	//    is set to true a dialog message is presented to the user.
	},
	logWarning:function(message, prompt) {
	// summary: logs a warning messages
	// description: the message is logged as a warning message.  If the prompt argument
 	//    is set to true a dialog message is presented to the user.
	},
	logInfo:function(message, prompt) {
	// summary: logs an informational messages
	// description: the message is logged as an informational message.  If the prompt argument
 	//    is set to true a dialog message is presented to the user.
	}
});

var MESSAGETYPE = {ERROR: 1,INFO:2,WARNING:4,NONE:0}

Logging Messages

Javascript objects that want to log messages would use the "cosmos.log" global variable as follows:

	//log error or informational messages to the debug console
	cosmos.log.debug=MESSAGETYPE.ERROR|MESSAGETYPE.INFO;
	//prompt the user for warning messages
	cosmos.log.prompt=MESSAGETYPE.WARNING;
	//log an error message
	cosmos.log.logError("Error: error message");
	//log an informational message and prompt the user with the message
	cosmos.log.logInfo("Error: error message", true);

Globalization

The error handler will not handle internationalization. It is expected that the messages will be translated before logging the message. Messages can be translated using the dojo globalization programming model (http://dojotoolkit.org/book/dojo-book-0-9/part-3-programmatic-dijit-and-dojo/i18n)


Server Side Logging

The default error handler object provides a means for a server side component to recieve error messages from the client. The client will use the post method to send logged messages from the client to the server side error component. The following define the POST arguements sent in the request to the server component

  • message - a string repesentation of the message
  • messagetype - this is a numeric value 1,2 or 4 repesenting an error, informational or warning message

Server side logging is further discussed in enhancement 208592

Design Note

Note that the structure of the message is not finalized. The structure of the message is dictated by the overall project error handling strategy.

For example the message structure could model an error code as follows:

{
   errorCode:"MSG010234",
   message: "Connection can not be resolved",
   severity: 40
}

Back to the top