You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(3) |
Dec
(9) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(15) |
Feb
(33) |
Mar
(35) |
Apr
(53) |
May
(1) |
Jun
(2) |
Jul
|
Aug
(2) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <wu...@us...> - 2008-03-10 14:31:05
|
Revision: 84 http://davinspector.svn.sourceforge.net/davinspector/?rev=84&view=rev Author: wuest Date: 2008-03-10 07:31:00 -0700 (Mon, 10 Mar 2008) Log Message: ----------- JUnit test case for http parser. Not complete. Initial commit. Added Paths: ----------- trunk/DAVInspector/test/ trunk/DAVInspector/test/de/ trunk/DAVInspector/test/de/dlr/ trunk/DAVInspector/test/de/dlr/davinspector/ trunk/DAVInspector/test/de/dlr/davinspector/http/ trunk/DAVInspector/test/de/dlr/davinspector/http/HTTPTest.java Added: trunk/DAVInspector/test/de/dlr/davinspector/http/HTTPTest.java =================================================================== --- trunk/DAVInspector/test/de/dlr/davinspector/http/HTTPTest.java (rev 0) +++ trunk/DAVInspector/test/de/dlr/davinspector/http/HTTPTest.java 2008-03-10 14:31:00 UTC (rev 84) @@ -0,0 +1,176 @@ +/* + * HTTPTest.java + * + * TODO: wues_ha Enter comment! + * + * Created: 10.03.2008 wues_ha <email> + * Changed: + * + * $Id$ + * + * Copyright 2007 Deutsches Zentrum fuer Luft- und Raumfahrt e.V. (DLR) + * + * Licensed 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 de.dlr.davinspector.http; + +import static org.junit.Assert.fail; + +import java.util.Calendar; +import java.util.Date; + +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +import de.dlr.davinspector.history.AMessage; +import de.dlr.davinspector.history.Message; +import de.dlr.davinspector.history.AMessage.MessageDirection; + + +public class HTTPTest { + + private AMessage message; + private Date timestamp; + private Boolean direction; + private String data; + private static int idCounter = 0; + + @BeforeClass //once + public static void setUpBeforeClass() throws Exception { + + } + + @AfterClass //once + public static void tearDownAfterClass() throws Exception { + } + + @Before + public void setUp() throws Exception { + idCounter++; + timestamp = new Date(); + direction = false; + data = "This is a test"; + message = new Message(); + message.setMessageDirection(direction); + message.setRawData(data); + message.setTimestamp(timestamp); + } + + @After + public void tearDown() throws Exception { + } + + @Test + public void testGetId() { + Assert.assertEquals(idCounter, message.getId()); + } + + @Test + public void testGetTimestamp() { + Assert.assertEquals(timestamp, message.getTimestamp()); + } + + @Test + public void testSetTimestamp() { + Calendar cal = Calendar.getInstance(); + cal.set(2008, 11, 11, 11, 11, 11); + timestamp = cal.getTime(); + message.setTimestamp(timestamp); + Assert.assertEquals(timestamp, message.getTimestamp()); + } + + @Test + public void testGetMessageDirection() { + Assert.assertEquals(MessageDirection.Request, message.getMessageDirection()); + } + + @Test + public void testSetMessageType() { + MessageDirection msgDir = message.getMessageDirection(); + if (msgDir == MessageDirection.Request) { + msgDir = MessageDirection.Response; + } else { + msgDir = MessageDirection.Request; + } + message.setMessageType(msgDir); + Assert.assertEquals(msgDir, message.getMessageDirection()); + } + + @Test + public void testSetMessageDirection() { + Boolean toClient; + MessageDirection msgDir = message.getMessageDirection(); + if (msgDir == MessageDirection.Request) { + toClient = true; + msgDir = MessageDirection.Response; + } else { + toClient = false; + msgDir = MessageDirection.Request; + } + message.setMessageDirection(toClient); + Assert.assertEquals(msgDir, message.getMessageDirection()); + } + + @Test + public void testGetSize() { + Assert.assertEquals(data.length(), message.getSize()); + } + + @Test + public void testGetRawData() { + Assert.assertEquals(data, message.getRawData()); + } + + @Test + public void testSetRawData() { + String testdata = "Mir lose de Dom in koelle."; + message.setRawData(testdata); + Assert.assertEquals(testdata, message.getRawData()); + } + + @Test + public void testGetMessageHeader() { + fail("Not yet implemented"); + } + + @Test + public void testGetRawHeader() { + fail("Not yet implemented"); + } + + @Test + public void testGetMessageBody() { + fail("Not yet implemented"); + } + + @Test + public void testGetRawBody() { + fail("Not yet implemented"); + } + + @Test + public void testParseMessage() { + fail("Not yet implemented"); + } + + @Test + public void testIsComplete() { + fail("Not yet implemented"); + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wu...@us...> - 2008-03-10 13:09:22
|
Revision: 83 http://davinspector.svn.sourceforge.net/davinspector/?rev=83&view=rev Author: wuest Date: 2008-03-10 06:09:20 -0700 (Mon, 10 Mar 2008) Log Message: ----------- First commit. Added Paths: ----------- trunk/www/image/concept.png trunk/www/image/prototype.png Added: trunk/www/image/concept.png =================================================================== (Binary files differ) Property changes on: trunk/www/image/concept.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/www/image/prototype.png =================================================================== (Binary files differ) Property changes on: trunk/www/image/prototype.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wu...@us...> - 2008-03-10 13:06:42
|
Revision: 82 http://davinspector.svn.sourceforge.net/davinspector/?rev=82&view=rev Author: wuest Date: 2008-03-10 06:06:36 -0700 (Mon, 10 Mar 2008) Log Message: ----------- Added text and figures to overview and fixed some typos. Modified Paths: -------------- trunk/www/index.html trunk/www/overview.html Modified: trunk/www/index.html =================================================================== --- trunk/www/index.html 2008-03-09 22:59:07 UTC (rev 81) +++ trunk/www/index.html 2008-03-10 13:06:36 UTC (rev 82) @@ -18,7 +18,7 @@ <h2><a href="#">About DAVInspector</a></h2> - <p>DAVInpector is a tool for debugging and moitoring HTTP and WebDAV capable applications. It is mainly written to help developers creating HTTP/WebDAV clients or servers, but could also be used from sysadmins. The open plugin technology makes it possible that in future other network protocols will be support too.<br /><br /> + <p>DAVInpector is a tool for debugging and monitoring HTTP and WebDAV capable applications. It is mainly written to help developers creating HTTP/WebDAV clients or servers, but could also be used by sysadmins. The open plugin technology makes it possible that in future other network protocols will be support too.<br /><br /> DAVInspector is developed by employees of the the institution <a href="http://www.dlr.de/sc" class="blacklink">"Simulation and Software Technology" (SISTEC)</a> at the <a href="http://www.dlr.de" class="blacklink">German Aerospace Center DLR</a>.</p> <p>We are happy about any support for this project - for example you might participate as a developer, bug reporter or simply by telling us your needs. Just visit our <a href="http://sourceforge.net/forum/?group_id=206242">forums</a> or join our <a href="http://sourceforge.net/mail/?group_id=206242">mailing-lists</a> on Sourceforge. <br></p></p> @@ -47,8 +47,8 @@ <br> 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. <br style=""> - <!--[if !supportLineBreakNewLine]--><br style=""> - <!--[endif]--><o:p></o:p></span></p> + <!-- [if !supportLineBreakNewLine] --><br style=""> + <!-- [endif] --><o:p></o:p></span></p> </div> Modified: trunk/www/overview.html =================================================================== --- trunk/www/overview.html 2008-03-09 22:59:07 UTC (rev 81) +++ trunk/www/overview.html 2008-03-10 13:06:36 UTC (rev 82) @@ -17,7 +17,22 @@ <div id="content"> <h2><a href="#">An short overview about DAVInspector</a></h2> <p> - + The main goal of this project is to minimize time and effort for recurring + tests of WebDAV applications. This Tool offers developers and testers the + opportunity to save, interruppt, evaluate and, if necessary, to repeat the + communication between a WebDAV server and client. + </p> + <br> + <img src="image/concept.png" alt="Concept of DAVInspector" title="Concept of DAVInspector"> + <br> + <p> + The figure above shows the conceptual environment when using DAVInspector. + This is, however, just a schematic representation. The figure below shows + a screenshot of an early prototype of DAVInspector. + </p> + <br> + <img src="image/prototype.png" alt="Prototype of DAVInspector" title="Prototype of DAVInspector"> + <br> </div> <div id="footer">© 2007-2008 <a href="http://www.dlr.de/sc">Deutsches Zentrum für Luft- und Raumfahrt e.V. (DLR)</a> </div> </div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wu...@us...> - 2008-03-09 22:59:19
|
Revision: 81 http://davinspector.svn.sourceforge.net/davinspector/?rev=81&view=rev Author: wuest Date: 2008-03-09 15:59:07 -0700 (Sun, 09 Mar 2008) Log Message: ----------- Work on message parser. Not yet finished. Modified Paths: -------------- trunk/DAVInspector/src/de/dlr/davinspector/history/AMessage.java trunk/DAVInspector/src/de/dlr/davinspector/http/HTTPMessageParser.java trunk/DAVInspector/src/de/dlr/davinspector/plugin/PluginManager.java trunk/DAVInspector/src/de/dlr/davinspector/plugins/recordingplugin/RecordingConfigurationPanel.java trunk/DAVInspector/src/de/dlr/davinspector/plugins/recordingplugin/RecordingPlugin.java trunk/DAVInspector/src/de/dlr/davinspector/relay/ChannelThread.java trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java Modified: trunk/DAVInspector/src/de/dlr/davinspector/history/AMessage.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/history/AMessage.java 2008-03-09 17:04:54 UTC (rev 80) +++ trunk/DAVInspector/src/de/dlr/davinspector/history/AMessage.java 2008-03-09 22:59:07 UTC (rev 81) @@ -99,6 +99,16 @@ protected String myRawBody; /** + * + */ + protected String myParsedHeader; + + /** + * + */ + protected String myParsedBody; + + /** * The size in bytes of the current message. */ protected int mySize; @@ -214,20 +224,40 @@ } /** - * Returns the head of the message. + * Returns the parsed head of the message. + * By default this returns the same as <code>getRawHeader</code>. * * @return String */ public String getMessageHeader() { + return myParsedHeader; + } + + /** + * Returns the raw, unparsed head of the message. + * + * @return String + */ + public String getRawHeader() { return myRawHeader; } /** - * Returns the body of the message. + * Returns the parsed body of the message. + * By default this returns the same as <code>getRawBody</code>. * * @return String */ public String getMessageBody() { + return myParsedBody; + } + + /** + * Returns the raw, unparsed body of the message. + * + * @return String + */ + public String getRawBody() { return myRawBody; } } Modified: trunk/DAVInspector/src/de/dlr/davinspector/http/HTTPMessageParser.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/http/HTTPMessageParser.java 2008-03-09 17:04:54 UTC (rev 80) +++ trunk/DAVInspector/src/de/dlr/davinspector/http/HTTPMessageParser.java 2008-03-09 22:59:07 UTC (rev 81) @@ -42,11 +42,34 @@ /** * */ - private static final String REGEX_HTTP_METHOD = "^[UNKNOWN|HEAD|GET|POST|PUT|" - + "DELETE|OPTIONS|TRACE|CONNECT|PROPFIND|PROPPATCH|MKCOL|COPY|MOVE|LOCK|UNLOCK]+" - + "[ |\t]+/[a-zA-Z0-9|/|.|_|-]*[ |\t]+[HTTP/1.1|HTTP/1.0|HTTP/0.9]+\r\n"; - + private static final String REGEX_HTTP_REQUEST_LINE = "^([UNKNOWN|HEAD|GET|POST|PUT|" + + "DELETE|OPTIONS|TRACE|CONNECT|PROPFIND|PROPPATCH|MKCOL|COPY|MOVE|LOCK|UNLOCK]{1})" + + " (/[\\w|/|.|_|-]*/)" + + " ([HTTP/1.1|HTTP/1.0|HTTP/0.9]{1})\r\n"; + /** + * + */ + private static final String REGEX_HTTP_STATUS_LINE = "^([HTTP/1.1|HTTP/1.0|HTTP/0.9]+)" + + " ([0-9]{3})" + + " ([\\w|-]+)\r\n"; + + /** + * + */ + private static final String REGEX_EMPTY_LINE = "\r\n\r\n"; + + /** + * chunk-extension = ( ";" chunk-ext-name [ "=" chunk-ext-val ] ). + */ + private static final String REGEX_CHUNK = "(\r\n[0-9a-fA-F]+\r\n)"; + + private String method = ""; + private int status = 0; + private String protocolVersion = ""; + private Boolean isChunked = false; + + /** * Constructor. * * @param aMessage AMessage @@ -73,7 +96,7 @@ //input = httpMessages[0]; if (input != null) { - String[] s = input.split("\r\n\r\n"); + String[] s = input.split(REGEX_EMPTY_LINE); for (int i = 1; i < s.length; i++) { result = s[i]; } @@ -81,11 +104,10 @@ result = "--empty--"; } - // detect and process chunked data // split the input in the different chunks. // each chunk starts with the length of the chunk in hex. - String[] lines = result.split("(\r\n[0-9a-fA-F]+\r\n)"); + String[] lines = result.split(REGEX_CHUNK); result = ""; for (int i = 0; i < lines.length; i++) { result += lines[i]; @@ -102,7 +124,7 @@ */ private String extractMessageHeader(String input) { if (input != null) { - String[] s = input.split("\r\n\r\n"); + String[] s = input.split(REGEX_EMPTY_LINE); return s[0]; } else { return "--empty--"; @@ -115,38 +137,72 @@ * @see de.dlr.davinspector.history.AMessageParser#parseMessage() */ public void parseMessage() { - // erste zeile bei request: http-kommando + s + request-url + s + protokoll version - // BSP: OPTIONS /slide/files/ HTTP/1.1 - // erste zeile bei response: protokoll version + s + status code + s + status text (don't care) - // BSP: HTTP/1.1 200 OK -System.out.println("phase 1"); //+ getRawData() + "\n\n###\n\n" + super.getRawData()); - if (isRequest(myRawData)) { - myDirection = MessageDirection.Request; -System.out.println("phase 2a"); - } else { - myDirection = MessageDirection.Response; -System.out.println("phase 2b"); - } - + // TODO: rest string zur\xFCck ... +System.out.println(myDirection); + // versuchen eine nachricht lesen myRawHeader = extractMessageHeader(myRawData); myRawBody = extractMessageBody(myRawData); + myParsedHeader = myRawHeader; + myParsedBody = myRawBody; + + if (myDirection == MessageDirection.Response) { + if (isChunked() && hasBody()) { + decodeChunkedEncoding(); + } + } + -System.out.println("phase 3"); myParsingState = true; } /** - * TODO: wues_ha: Enter comment! + * This method returns <code>true</code> if the message has a body. + * In the case that the command does not require a message body + * the method returns <code>false</code>. * - * @param input String - * @return Boolean + * @return Boolean */ - private Boolean isRequest(String input) { - Pattern pattern = Pattern.compile(REGEX_HTTP_METHOD, Pattern.CASE_INSENSITIVE); - Matcher matcher = pattern.matcher(input); -System.out.println("Parsing httptype 1a"); - Boolean result = matcher.find(); -// System.out.println(input + " \n\n" + result); - return result; + private Boolean hasBody() { + if (myDirection == MessageDirection.Response) { + if (status == HTTPStatusCode.HTTP_CONTINUE + || status == HTTPStatusCode.HTTP_SWITCHING_PROTOCOLS + || status == HTTPStatusCode.HTTP_NO_CONTENT + || status == HTTPStatusCode.HTTP_NOT_MODIFIED) { + // status code 1xx, 204, and 304 -> no body + return false; + } + } + return true; } + + /** + * Determines whether the data is chunked or not. + * + * @return Boolean Returns true if the data is chunked. + */ + private Boolean isChunked() { + // TODO: RFC 2616 14.39 TE / 14.41 Transfer-Encoding + if (myRawHeader.contains("Transfer-Encoding: chunked")) { + return true; + } + return false; + } + + private void decodeChunkedEncoding() { +// length = 0; +// read chunk-size, chunk-extension (if any) and CRLF +// while (chunk-size > 0) { +// read chunk-data and CRLF +// append chunk-data to entity-body +// length = length + chunk-size +// read chunk-size and CRLF +// } +// read entity-header +// while (entity-header not empty) { +// append entity-header to existing header fields +// read entity-header +// } +// Content-Length = length +// Remove "chunked" from Transfer-Encoding + } } Modified: trunk/DAVInspector/src/de/dlr/davinspector/plugin/PluginManager.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugin/PluginManager.java 2008-03-09 17:04:54 UTC (rev 80) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugin/PluginManager.java 2008-03-09 22:59:07 UTC (rev 81) @@ -117,6 +117,7 @@ myPluginVector.add(plugin); // TODO: only add plugin if specified for client/server side + // INFO: alternative Direction could be specified here by PluginType!? plugin = (IPlugin) c.newInstance(); plugin.init(IPlugin.Direction.CLIENT); myActivePluginsClient.add(plugin); Modified: trunk/DAVInspector/src/de/dlr/davinspector/plugins/recordingplugin/RecordingConfigurationPanel.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugins/recordingplugin/RecordingConfigurationPanel.java 2008-03-09 17:04:54 UTC (rev 80) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugins/recordingplugin/RecordingConfigurationPanel.java 2008-03-09 22:59:07 UTC (rev 81) @@ -93,7 +93,7 @@ /** * This method returns the filename of the file to write the data to. - * If <code>myFilename</code> is not set the default filename is returned. + * If <code>myFilename</code> is not set, the default filename is returned. * * @return String */ @@ -131,7 +131,6 @@ /** * This method returns the default filename. * - * * @return String */ private String getDefaultFileName() { Modified: trunk/DAVInspector/src/de/dlr/davinspector/plugins/recordingplugin/RecordingPlugin.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugins/recordingplugin/RecordingPlugin.java 2008-03-09 17:04:54 UTC (rev 80) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugins/recordingplugin/RecordingPlugin.java 2008-03-09 22:59:07 UTC (rev 81) @@ -67,7 +67,7 @@ private BufferedWriter myBufferedWriter = null; /** - * This saves side assigned to the current plugin object. + * This saves the side assigned to the current plugin object. */ private Direction myDirection; @@ -209,7 +209,7 @@ if (myBufferedWriter == null) { File recordFile = new File(myFilename); try { - // Append data to the choosen file. + // Append data to the chosen file. FileWriter fileWriter = new FileWriter(recordFile, true); myBufferedWriter = new BufferedWriter(fileWriter); } catch (IOException ioe) { @@ -219,9 +219,9 @@ } /** - * This method sets the filename to write the data to. + * This method sets the path and filename to write the data to. * - * @param file The choosen file object. + * @param file The chosen file object. */ public void setRecordingFile(File file) { myFilename = file.getAbsolutePath(); Modified: trunk/DAVInspector/src/de/dlr/davinspector/relay/ChannelThread.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/relay/ChannelThread.java 2008-03-09 17:04:54 UTC (rev 80) +++ trunk/DAVInspector/src/de/dlr/davinspector/relay/ChannelThread.java 2008-03-09 22:59:07 UTC (rev 81) @@ -38,7 +38,6 @@ /** * This class copies data from one socket to another. - * TODO: Buffer in ChannelThread for in / outgoing messages * * @version $LastChangedRevision$ * @author Jochen Wuest Modified: trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java 2008-03-09 17:04:54 UTC (rev 80) +++ trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java 2008-03-09 22:59:07 UTC (rev 81) @@ -70,7 +70,6 @@ /** * The main window of the application. * Gui todos: - * INFO: Enlarge space between components of dialog windows and the window border. * INFO: Place buttons of the dialog windows in the lower right corner of the window. * INFO: Resize columns of the tables to the needed space. * INFO: Adjust alignment of table columns. @@ -1020,7 +1019,6 @@ private JSplitPane getJSplitPaneVertical() { if (jSplitPaneVertical == null) { //TODO: splitter settings -// splitPane.setOneTouchExpandable(true); // splitPane.setResizeWeight(0.5); jSplitPaneVertical = new JSplitPane(); jSplitPaneVertical.setOrientation(JSplitPane.VERTICAL_SPLIT); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kil...@us...> - 2008-03-09 17:05:19
|
Revision: 80 http://davinspector.svn.sourceforge.net/davinspector/?rev=80&view=rev Author: killerjoe Date: 2008-03-09 10:04:54 -0700 (Sun, 09 Mar 2008) Log Message: ----------- Added development page. Modified Paths: -------------- trunk/www/download.html trunk/www/index.html trunk/www/news.html trunk/www/overview.html Added Paths: ----------- trunk/www/development.html Copied: trunk/www/development.html (from rev 77, trunk/www/news.html) =================================================================== --- trunk/www/development.html (rev 0) +++ trunk/www/development.html 2008-03-09 17:04:54 UTC (rev 80) @@ -0,0 +1,47 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<title>DAVInspector - News</title> +<meta name="Description" content="" /> +<meta name="Keywords" content="" /> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> +<link rel="stylesheet" type="text/css" href="style.css" media="screen" /> +</head> +<body> +<div id="wrap"> + <div id="header"> + <h1><a href="#">DAVInspector</a></h1> + <h2>HTTP and WebDAV test- and debugging tool. </h2> + </div> + <div id="menu"> <a href="index.html">Home</a> <a href="overview.html">Overview</a> <a href="news.html">News</a> <a href="download.html">Download</a> <a href="development.html">Development</a></div> + <div id="content"> + <h2>DAVInspector Development</h2> + <p> + <p>DAVInspector is an open volunteer project based on the spirit of the Open Development and Free Software. You can visit the project home at SourceForge.net:</p> +<a href="http://sourceforge.net/projects/davinspector/">http://sourceforge.net/projects/davinspector/</a> + + <p> </p> + <h2>Getting involved</h2> + <p><p>There are lots of ways to contribute to the project. We are always glad + to meet the developers, testers, UI and UX designers, writers of documentation + and help topics, localization translators and other people who want to + get involved to the project and assist in its further continuation and + development. </p><br /> + <p>The first step if you are going to get involved is to subscribe + to <a href="https://lists.sourceforge.net/lists/listinfo/davinspector-developers"><strong>DAVInspector mailing list</strong></a>. + This does not require any registration except for submitting your e-mail + address. As a mailing list member you can make a good direct contribution like + as proposing ideas and new features, reporting bugs, submitting patches, + bug-fixes, resources, etc.</p> + </p> + + <p> </p> + <h2> </h2> + <p> + <p> + + </div> + <div id="footer">© 2007-2008 <a href="http://www.dlr.de/sc">Deutsches Zentrum für Luft- und Raumfahrt e.V. (DLR)</a> </div> +</div> +</body> +</html> Modified: trunk/www/download.html =================================================================== --- trunk/www/download.html 2008-03-08 19:35:31 UTC (rev 79) +++ trunk/www/download.html 2008-03-09 17:04:54 UTC (rev 80) @@ -13,13 +13,13 @@ <h1><a href="#">DAVInspector</a></h1> <h2>HTTP and WebDAV test- and debugging tool. </h2> </div> - <div id="menu"> <a href="index.html">Home</a> <a href="overview.html">Overview</a> <a href="news.html">News</a> <a href="download.html">Download</a></div> + <div id="menu"> <a href="index.html">Home</a> <a href="overview.html">Overview</a> <a href="news.html">News</a> <a href="download.html">Download</a> <a href="development.html">Development</a></div> <div id="content"> <h2><a href="#">Download DAVInspector</a></h2> <p> </div> - <div id="footer">© 2007-2008 <a href="http://www.dlr.de/sc">Deutsches Zentrum für Luft- und Raumfahrt e.V. (DLR)</a>. </div> + <div id="footer">© 2007-2008 <a href="http://www.dlr.de/sc">Deutsches Zentrum für Luft- und Raumfahrt e.V. (DLR)</a> </div> </div> </body> </html> Modified: trunk/www/index.html =================================================================== --- trunk/www/index.html 2008-03-08 19:35:31 UTC (rev 79) +++ trunk/www/index.html 2008-03-09 17:04:54 UTC (rev 80) @@ -13,24 +13,30 @@ <h1><a href="#">DAVInspector</a></h1> <h2>HTTP and WebDAV test- and debugging tool. </h2> </div> - <div id="menu"> <a href="index.html">Home</a> <a href="overview.html">Overview</a> <a href="news.html">News</a> <a href="download.html">Download</a></div> + <div id="menu"> <a href="index.html">Home</a> <a href="overview.html">Overview</a> <a href="news.html">News</a> <a href="download.html">Download</a> <a href="development.html">Development</a></div> <div id="content"> + + <h2><a href="#">About DAVInspector</a></h2> <p>DAVInpector is a tool for debugging and moitoring HTTP and WebDAV capable applications. It is mainly written to help developers creating HTTP/WebDAV clients or servers, but could also be used from sysadmins. The open plugin technology makes it possible that in future other network protocols will be support too.<br /><br /> DAVInspector is developed by employees of the the institution <a href="http://www.dlr.de/sc" class="blacklink">"Simulation and Software Technology" (SISTEC)</a> at the <a href="http://www.dlr.de" class="blacklink">German Aerospace Center DLR</a>.</p> <p>We are happy about any support for this project - for example you might participate as a developer, bug reporter or simply by telling us your needs. Just visit our <a href="http://sourceforge.net/forum/?group_id=206242">forums</a> or join our <a href="http://sourceforge.net/mail/?group_id=206242">mailing-lists</a> on Sourceforge. <br></p></p> <p> </p> - <h2><a href="#">Latest news</a></h2> + + + <h2><a href="news.html">Latest news</a></h2> <p class="meta">04.03.2008</p> <p>DAVInspector is still in alpha phase...</p> <p> </p> - <h2><a href="#">Download</a></h2> + + <h2><a href="download.html">Download</a></h2> <p>You can download the latest version of DAVInspector from our <a href="http://sourceforge.net/projects/davinspector/">Sourceforge project page</a>: + </p> <p> </p> - <h2><a href="#">License</a></h2> + <h2>License</h2> <p>Copyright 2006 Deutsches Zentrum für Luft- und Raumfahrt e.V. (DLR)<br> <br> Licensed under the Apache License, Version 2.0 (the "License");<br> @@ -43,8 +49,10 @@ <br style=""> <!--[if !supportLineBreakNewLine]--><br style=""> <!--[endif]--><o:p></o:p></span></p> + + </div> - <div id="footer">© 2007-2008 <a href="http://www.dlr.de/sc">Deutsches Zentrum für Luft- und Raumfahrt e.V. (DLR)</a>. </div> + <div id="footer">© 2007-2008 <a href="http://www.dlr.de/sc">Deutsches Zentrum für Luft- und Raumfahrt e.V. (DLR)</a> </div> </div> </body> </html> Modified: trunk/www/news.html =================================================================== --- trunk/www/news.html 2008-03-08 19:35:31 UTC (rev 79) +++ trunk/www/news.html 2008-03-09 17:04:54 UTC (rev 80) @@ -13,13 +13,13 @@ <h1><a href="#">DAVInspector</a></h1> <h2>HTTP and WebDAV test- and debugging tool. </h2> </div> - <div id="menu"> <a href="index.html">Home</a> <a href="overview.html">Overview</a> <a href="news.html">News</a> <a href="download.html">Download</a></div> + <div id="menu"> <a href="index.html">Home</a> <a href="overview.html">Overview</a> <a href="news.html">News</a> <a href="download.html">Download</a> <a href="development.html">Development</a></div> <div id="content"> <h2><a href="#">DAVInspector News Archive</a></h2> <p> </div> - <div id="footer">© 2007-2008 <a href="http://www.dlr.de/sc">Deutsches Zentrum für Luft- und Raumfahrt e.V. (DLR)</a>. </div> + <div id="footer">© 2007-2008 <a href="http://www.dlr.de/sc">Deutsches Zentrum für Luft- und Raumfahrt e.V. (DLR)</a> </div> </div> </body> </html> Modified: trunk/www/overview.html =================================================================== --- trunk/www/overview.html 2008-03-08 19:35:31 UTC (rev 79) +++ trunk/www/overview.html 2008-03-09 17:04:54 UTC (rev 80) @@ -13,13 +13,13 @@ <h1><a href="#">DAVInspector</a></h1> <h2>HTTP and WebDAV test- and debugging tool. </h2> </div> - <div id="menu"> <a href="index.html">Home</a> <a href="overview.html">Overview</a> <a href="news.html">News</a> <a href="download.html">Download</a></div> + <div id="menu"> <a href="index.html">Home</a> <a href="overview.html">Overview</a> <a href="news.html">News</a> <a href="download.html">Download</a> <a href="development.html">Development</a></div> <div id="content"> <h2><a href="#">An short overview about DAVInspector</a></h2> <p> </div> - <div id="footer">© 2007-2008 <a href="http://www.dlr.de/sc">Deutsches Zentrum für Luft- und Raumfahrt e.V. (DLR)</a>. </div> + <div id="footer">© 2007-2008 <a href="http://www.dlr.de/sc">Deutsches Zentrum für Luft- und Raumfahrt e.V. (DLR)</a> </div> </div> </body> </html> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wu...@us...> - 2008-03-08 19:35:36
|
Revision: 79 http://davinspector.svn.sourceforge.net/davinspector/?rev=79&view=rev Author: wuest Date: 2008-03-08 11:35:31 -0800 (Sat, 08 Mar 2008) Log Message: ----------- Added recording plugin package. Added new plugin to build script. Modified Paths: -------------- trunk/DAVInspector/build-user.xml Added Paths: ----------- trunk/DAVInspector/src/de/dlr/davinspector/plugins/recordingplugin/ trunk/DAVInspector/src/de/dlr/davinspector/plugins/recordingplugin/RecordingConfigurationPanel.java trunk/DAVInspector/src/de/dlr/davinspector/plugins/recordingplugin/RecordingPlugin.java trunk/DAVInspector/src/de/dlr/davinspector/plugins/recordingplugin/package.html Modified: trunk/DAVInspector/build-user.xml =================================================================== --- trunk/DAVInspector/build-user.xml 2008-03-08 19:34:07 UTC (rev 78) +++ trunk/DAVInspector/build-user.xml 2008-03-08 19:35:31 UTC (rev 79) @@ -49,6 +49,10 @@ basedir="bin" includes="de/dlr/davinspector/plugins/xmltreeplugin/**"> </jar> + <jar jarfile="${dist}/plugins/RecordingPlugin.jar" + basedir="bin" + includes="de/dlr/davinspector/plugins/recordingplugin/**"> + </jar> <!-- Copy DAVInspector resource files --> <copy todir="bin/de/dlr/davinspector/resource"> Added: trunk/DAVInspector/src/de/dlr/davinspector/plugins/recordingplugin/RecordingConfigurationPanel.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugins/recordingplugin/RecordingConfigurationPanel.java (rev 0) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugins/recordingplugin/RecordingConfigurationPanel.java 2008-03-08 19:35:31 UTC (rev 79) @@ -0,0 +1,194 @@ +/* + * RecordingConfigurationPanel.java + * + * This class is the UI for the RecordingPlugin. + * + * Created: 08.03.2008 Jochen Wuest <joc...@dl...> + * Changed: + * + * $Id$ + * + * Copyright 2007 Deutsches Zentrum fuer Luft- und Raumfahrt e.V. (DLR) + * + * Licensed 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 de.dlr.davinspector.plugins.recordingplugin; + +import java.io.File; +import java.text.SimpleDateFormat; +import java.util.Date; + +import javax.swing.GroupLayout; +import javax.swing.JButton; +import javax.swing.JFileChooser; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JTextField; +import javax.swing.LayoutStyle; + +import de.dlr.davinspector.common.Util; +import de.dlr.davinspector.plugin.IPlugin.Direction; + +/** + * This class is the UI for the RecordingPlugin. + * TODO: constant def, complete comments. + * + * @version $LastChangedRevision$ + * @author Jochen Wuest + */ +public class RecordingConfigurationPanel extends JPanel { + + /** + * + */ + private static final long serialVersionUID = 1L; + + /** + * + */ + private JButton jButtonOpenFileChooser; + + /** + * + */ + private JLabel jLabelFilename; + + /** + * + */ + private JTextField jTextFieldFilename; + + /** + * The filename. + */ + private String myFilename = ""; + + /** + * The RecordingPlugin. + */ + private RecordingPlugin myParent; + + /** + * Constructor. + * + * @param plugin Reference to the plugin object. + */ + public RecordingConfigurationPanel(RecordingPlugin plugin) { + myParent = plugin; + myFilename = getDefaultFileName(); + initComponents(); + Util.setUIDesign(); + } + + /** + * This method returns the filename of the file to write the data to. + * If <code>myFilename</code> is not set the default filename is returned. + * + * @return String + */ + public String getFilename() { + if (myFilename.equals("")) { + return getDefaultFileName(); + } else { + return myFilename; + } + } + + /** + * TODO: HJW: Enter comment! + * + * @param evt + * Event + */ + private void jButtonOpenFileChooserActionPerformed(java.awt.event.ActionEvent evt) { + JFileChooser fileChooser = new JFileChooser(); + fileChooser.setDialogType(JFileChooser.SAVE_DIALOG); + fileChooser.setDialogTitle("Select recording file"); + fileChooser.setSelectedFile(new File(myFilename)); + fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY); + + int returnVal = fileChooser.showOpenDialog(null); + + if (returnVal == JFileChooser.APPROVE_OPTION) { + File file = fileChooser.getSelectedFile(); + myFilename = file.getAbsolutePath(); + myParent.setRecordingFile(file); + } + jTextFieldFilename.setText(myFilename); + } + + /** + * This method returns the default filename. + * + * + * @return String + */ + private String getDefaultFileName() { + Date now = new Date(); + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd_hh-mm"); + + String side = "_server_"; + if (myParent.getDirection() == Direction.CLIENT) { + side = "_client_"; + } + + return "davi" + side + dateFormat.format(now) + ".rec"; + } + + /** + * TODO: HJW: Enter comment! + * + */ + private void initComponents() { + jTextFieldFilename = new JTextField(); + jButtonOpenFileChooser = new JButton(); + jLabelFilename = new JLabel(); + + jButtonOpenFileChooser.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + jButtonOpenFileChooserActionPerformed(evt); + } + }); + + jTextFieldFilename.setText(myFilename); + jButtonOpenFileChooser.setText("..."); + jButtonOpenFileChooser.setToolTipText("Choose file for recording."); + + jLabelFilename.setText("File:"); + + GroupLayout layout = new GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( + layout.createParallelGroup(GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addComponent(jLabelFilename) + .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jTextFieldFilename, GroupLayout.DEFAULT_SIZE, Byte.MAX_VALUE * 2, Short.MAX_VALUE) + .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jButtonOpenFileChooser) + .addContainerGap()) + ); + layout.setVerticalGroup( + layout.createParallelGroup(GroupLayout.Alignment.LEADING) + .addGroup(layout.createSequentialGroup() + .addContainerGap() + .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE) + .addComponent(jLabelFilename) + .addComponent(jButtonOpenFileChooser) + .addComponent(jTextFieldFilename, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) + .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + } +} Added: trunk/DAVInspector/src/de/dlr/davinspector/plugins/recordingplugin/RecordingPlugin.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugins/recordingplugin/RecordingPlugin.java (rev 0) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugins/recordingplugin/RecordingPlugin.java 2008-03-08 19:35:31 UTC (rev 79) @@ -0,0 +1,238 @@ +/* + * RecordingPlugin.java + * + * The RecordingPlugin enables the user to record the network traffic to the default or a + * user specific file. + * + * Created: 08.03.2008 Jochen Wuest <joc...@dl...> + * Changed: + * + * $Id$ + * + * Copyright 2007 Deutsches Zentrum fuer Luft- und Raumfahrt e.V. (DLR) + * + * Licensed 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 de.dlr.davinspector.plugins.recordingplugin; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; + +import javax.swing.JComponent; + +import de.dlr.davinspector.history.AMessage; +import de.dlr.davinspector.plugin.IViewPlugin; + + +/** + * The RecordingPlugin enables the user to record the network traffic to the default or a + * user specific file. + * + * @version $LastChangedRevision$ + * @author Jochen Wuest + */ +public class RecordingPlugin implements IViewPlugin { + + /** + * State of the plugin. + */ + private Boolean isActive = true; + + /** + * The UI of the RecordingPlugin. + */ + private RecordingConfigurationPanel myPanel = null; + + /** + * The filename of the file to which the data is written. + */ + private String myFilename; + + /** + * The BufferedWriter for writing the data to the file. + */ + private BufferedWriter myBufferedWriter = null; + + /** + * This saves side assigned to the current plugin object. + */ + private Direction myDirection; + + /** + * {@inheritDoc} + * + * @see de.dlr.davinspector.plugin.IViewPlugin#getUI() + */ + public JComponent getUI() { + return myPanel; + } + + /** + * {@inheritDoc} + * + * @see de.dlr.davinspector.plugin.IPlugin#clear() + */ + public void clear() { + // do nothing ... + } + + /** + * {@inheritDoc} + * + * @see de.dlr.davinspector.plugin.IPlugin#getAuthor() + */ + public String getAuthor() { + return "Jochen Wuest"; + } + + /** + * {@inheritDoc} + * + * @see de.dlr.davinspector.plugin.IPlugin#getDescription() + */ + public String getDescription() { + return "This plugin enables the user to record network traffic to a file."; + } + + /** + * {@inheritDoc} + * + * @see de.dlr.davinspector.plugin.IPlugin#getName() + */ + public String getName() { + return "Recording Plugin"; + } + + /** + * {@inheritDoc} + * + * @see de.dlr.davinspector.plugin.IPlugin#getType() + */ + public PlugInType getType() { + return PlugInType.VIEW_GENERAL; + } + + /** + * {@inheritDoc} + * + * @see de.dlr.davinspector.plugin.IPlugin#getVersion() + */ + public int getVersion() { + return 1; + } + + /** + * {@inheritDoc} + * + * @see de.dlr.davinspector.plugin.IPlugin#init() + */ + public void init(Direction direction) { + myDirection = direction; + if (myPanel == null) { + myPanel = new RecordingConfigurationPanel(this); + } + myFilename = myPanel.getFilename(); + } + + /** + * {@inheritDoc} + * + * @see de.dlr.davinspector.plugin.IPlugin#shutdown() + */ + public void shutdown() { + if (myBufferedWriter != null) { + try { + myBufferedWriter.close(); + } catch (IOException ioe) { + System.err.println(ioe.getMessage()); + } + myBufferedWriter = null; + } + } + + /** + * {@inheritDoc} + * + * @see de.dlr.davinspector.plugin.IPlugin#isActive() + */ + public Boolean isActive() { + return isActive; + } + + /** + * {@inheritDoc} + * + * @see de.dlr.davinspector.plugin.IPlugin#setActive(java.lang.Boolean) + */ + public void setActive(Boolean state) { + isActive = state; + } + + /** + * {@inheritDoc} + * + * @see de.dlr.davinspector.plugin.IPlugin#update(de.dlr.davinspector.history.AMessage) + */ + public void update(AMessage msg) { + if (isActive) { + // if not already initialized, initialize the BufferedWriter + if (myBufferedWriter == null) { + openBufferedWriter(); + } + try { + myBufferedWriter.append(msg.getRawData()); + } catch (IOException ioe) { + System.err.println(ioe.getMessage()); + } + } + } + + /** + * This method opens the file <code>myFilename</code> and + * initializes the <code>BufferedWriter</code>. + * + */ + private void openBufferedWriter() { + if (myBufferedWriter == null) { + File recordFile = new File(myFilename); + try { + // Append data to the choosen file. + FileWriter fileWriter = new FileWriter(recordFile, true); + myBufferedWriter = new BufferedWriter(fileWriter); + } catch (IOException ioe) { + System.err.println(ioe.getMessage()); + } + } + } + + /** + * This method sets the filename to write the data to. + * + * @param file The choosen file object. + */ + public void setRecordingFile(File file) { + myFilename = file.getAbsolutePath(); + } + + /** + * Return the side the current plugin object is assigned to. + * + * @return Returns the direction of the plugin object. + */ + public Direction getDirection() { + return myDirection; + } +} Added: trunk/DAVInspector/src/de/dlr/davinspector/plugins/recordingplugin/package.html =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugins/recordingplugin/package.html (rev 0) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugins/recordingplugin/package.html 2008-03-08 19:35:31 UTC (rev 79) @@ -0,0 +1,6 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" +"http://www.w3.org/TR/REC-html40/loose.dtd"> + +<html><head><title>Recording Plugin</title></head><body> +This package contains all classes needed to record network traffic to a file. +</body></html> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wu...@us...> - 2008-03-08 19:34:20
|
Revision: 78 http://davinspector.svn.sourceforge.net/davinspector/?rev=78&view=rev Author: wuest Date: 2008-03-08 11:34:07 -0800 (Sat, 08 Mar 2008) Log Message: ----------- Spacing in the dialog windows now 10 px. Added the method shutdown() to the plugin interface. Added the direction to init method of the plugin interface. Corrected simple message parsing in HTTPMessageParser. Modified Paths: -------------- trunk/DAVInspector/src/de/dlr/davinspector/http/HTTPMessageParser.java trunk/DAVInspector/src/de/dlr/davinspector/plugin/IPlugin.java trunk/DAVInspector/src/de/dlr/davinspector/plugin/PluginManager.java trunk/DAVInspector/src/de/dlr/davinspector/plugins/headerplugin/HeaderPlugin.java trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/XMLPlugin.java trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmltreeplugin/XMLTreePlugin.java trunk/DAVInspector/src/de/dlr/davinspector/ui/AboutDialog.java trunk/DAVInspector/src/de/dlr/davinspector/ui/ConfigurationDialog.java trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java trunk/DAVInspector/src/de/dlr/davinspector/ui/PluginConfigurationDialog.java Modified: trunk/DAVInspector/src/de/dlr/davinspector/http/HTTPMessageParser.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/http/HTTPMessageParser.java 2008-03-06 19:02:30 UTC (rev 77) +++ trunk/DAVInspector/src/de/dlr/davinspector/http/HTTPMessageParser.java 2008-03-08 19:34:07 UTC (rev 78) @@ -42,7 +42,9 @@ /** * */ - private static final String REGEX_HTTP_METHOD = "^[UNKNOWN|HEAD|GET|POST|PUT|DELETE|OPTIONS|TRACE|CONNECT|PROPFIND|PROPPATCH|MKCOL|COPY|MOVE|LOCK|UNLOCK]{1}"; + private static final String REGEX_HTTP_METHOD = "^[UNKNOWN|HEAD|GET|POST|PUT|" + + "DELETE|OPTIONS|TRACE|CONNECT|PROPFIND|PROPPATCH|MKCOL|COPY|MOVE|LOCK|UNLOCK]+" + + "[ |\t]+/[a-zA-Z0-9|/|.|_|-]*[ |\t]+[HTTP/1.1|HTTP/1.0|HTTP/0.9]+\r\n"; /** * Constructor. @@ -142,7 +144,9 @@ private Boolean isRequest(String input) { Pattern pattern = Pattern.compile(REGEX_HTTP_METHOD, Pattern.CASE_INSENSITIVE); Matcher matcher = pattern.matcher(input); -System.out.println("Parsing httptype 1a"); - return matcher.find(); +System.out.println("Parsing httptype 1a"); + Boolean result = matcher.find(); +// System.out.println(input + " \n\n" + result); + return result; } } Modified: trunk/DAVInspector/src/de/dlr/davinspector/plugin/IPlugin.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugin/IPlugin.java 2008-03-06 19:02:30 UTC (rev 77) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugin/IPlugin.java 2008-03-08 19:34:07 UTC (rev 78) @@ -72,8 +72,10 @@ /** * Initializes the plugin. + * + * @param direction Indicates the assignement of the plugin to server or client side. */ - void init(); + void init(Direction direction); /** * Starts processing of the message. @@ -100,6 +102,12 @@ * @return Boolean */ Boolean isActive(); + + /** + * This method is called to notify the plugin to perform any necessary + * operations before closing. + */ + void shutdown(); /** * Indentifier for plugin-type. @@ -130,4 +138,23 @@ */ EDIT_SERVER } + + /** + * The <tt>Direction</tt> indicates the assignment of + * a plugin object to the server or client side. + * Only needed by <code>*_GENERAL</code> plugins. + * + * @version $LastChangedRevision$ + * @author Jochen Wuest + */ + public enum Direction { + /** + * + */ + CLIENT, + /** + * + */ + SERVER + } } Modified: trunk/DAVInspector/src/de/dlr/davinspector/plugin/PluginManager.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugin/PluginManager.java 2008-03-06 19:02:30 UTC (rev 77) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugin/PluginManager.java 2008-03-08 19:34:07 UTC (rev 78) @@ -111,17 +111,17 @@ Class<?> c = jClassLoader.loadClass(Constant.PLUGIN_CLASSPATH + name.toLowerCase() + "." + name); // lets try to load the plugin... plugin = (IPlugin) c.newInstance(); - plugin.init(); + plugin.init(null); // ok, the plugin is initialized if (plugin != null) { myPluginVector.add(plugin); // TODO: only add plugin if specified for client/server side plugin = (IPlugin) c.newInstance(); - plugin.init(); + plugin.init(IPlugin.Direction.CLIENT); myActivePluginsClient.add(plugin); plugin = (IPlugin) c.newInstance(); - plugin.init(); + plugin.init(IPlugin.Direction.SERVER); myActivePluginsServer.add(plugin); } } catch (ClassNotFoundException cnfe) { @@ -232,4 +232,18 @@ plugin.clear(); } } + + /** + * This method notifys all active plugins to prepare for shutdown. + */ + public void shutdownActivePlugins() { + for (Iterator<IPlugin> iterator = myActivePluginsClient.iterator(); iterator.hasNext();) { + IPlugin plugin = (IPlugin) iterator.next(); + plugin.shutdown(); + } + for (Iterator<IPlugin> iterator = myActivePluginsServer.iterator(); iterator.hasNext();) { + IPlugin plugin = (IPlugin) iterator.next(); + plugin.shutdown(); + } + } } Modified: trunk/DAVInspector/src/de/dlr/davinspector/plugins/headerplugin/HeaderPlugin.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugins/headerplugin/HeaderPlugin.java 2008-03-06 19:02:30 UTC (rev 77) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugins/headerplugin/HeaderPlugin.java 2008-03-08 19:34:07 UTC (rev 78) @@ -28,6 +28,7 @@ import javax.swing.JComponent; import javax.swing.JTextPane; +import de.dlr.davinspector.common.Util; import de.dlr.davinspector.history.AMessage; import de.dlr.davinspector.plugin.IViewPlugin; @@ -48,7 +49,7 @@ /** * The text pane. */ - private JTextPane myJTextPane = null; + private JTextPane myJTextPane = null; /** * {@inheritDoc} @@ -109,13 +110,23 @@ * * @see de.dlr.DAVInspector.Plugin.IPlugin#init() */ - public void init() { + public void init(Direction direction) { if (myJTextPane == null) { myJTextPane = new JTextPane(); myJTextPane.setEditable(false); } myJTextPane.setText(""); + Util.setUIDesign(); } + + /** + * {@inheritDoc} + * + * @see de.dlr.davinspector.plugin.IPlugin#shutdown() + */ + public void shutdown() { + // empty + } /** * {@inheritDoc} Modified: trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/XMLPlugin.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/XMLPlugin.java 2008-03-06 19:02:30 UTC (rev 77) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/XMLPlugin.java 2008-03-08 19:34:07 UTC (rev 78) @@ -31,6 +31,7 @@ import org.xml.sax.SAXException; +import de.dlr.davinspector.common.Util; import de.dlr.davinspector.history.AMessage; import de.dlr.davinspector.plugin.IViewPlugin; @@ -112,17 +113,27 @@ * * @see de.dlr.DAVInspector.Plugin.IPlugin#init() */ - public void init() { + public void init(Direction direction) { if (myXMLTextPane == null) { myXMLTextPane = new XMLTextPane(); myXMLTextPane.setEditable(false); } myXMLTextPane.setText(""); + Util.setUIDesign(); } /** * {@inheritDoc} * + * @see de.dlr.davinspector.plugin.IPlugin#shutdown() + */ + public void shutdown() { + // empty + } + + /** + * {@inheritDoc} + * * @see de.dlr.DAVInspector.Plugin.IPlugin#isActive() */ public Boolean isActive() { Modified: trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmltreeplugin/XMLTreePlugin.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmltreeplugin/XMLTreePlugin.java 2008-03-06 19:02:30 UTC (rev 77) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmltreeplugin/XMLTreePlugin.java 2008-03-08 19:34:07 UTC (rev 78) @@ -31,6 +31,7 @@ import org.xml.sax.SAXException; +import de.dlr.davinspector.common.Util; import de.dlr.davinspector.history.AMessage; import de.dlr.davinspector.plugin.IViewPlugin; @@ -112,16 +113,26 @@ * * @see de.dlr.DAVInspector.Plugin.IPlugin#init() */ - public void init() { + public void init(Direction direction) { if (myXMLTreeView == null) { myXMLTreeView = new XMLTreeView(); } + Util.setUIDesign(); updateTree(""); } /** * {@inheritDoc} * + * @see de.dlr.davinspector.plugin.IPlugin#shutdown() + */ + public void shutdown() { + // empty + } + + /** + * {@inheritDoc} + * * @see de.dlr.DAVInspector.Plugin.IPlugin#isActive() */ public Boolean isActive() { Modified: trunk/DAVInspector/src/de/dlr/davinspector/ui/AboutDialog.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/ui/AboutDialog.java 2008-03-06 19:02:30 UTC (rev 77) +++ trunk/DAVInspector/src/de/dlr/davinspector/ui/AboutDialog.java 2008-03-08 19:34:07 UTC (rev 78) @@ -26,10 +26,12 @@ package de.dlr.davinspector.ui; import java.awt.BorderLayout; +import java.awt.Font; import java.awt.Frame; import java.awt.SystemColor; import java.awt.Window; +import javax.swing.BorderFactory; import javax.swing.JButton; import javax.swing.JDialog; import javax.swing.JLabel; @@ -51,6 +53,11 @@ * */ private static final long serialVersionUID = 1L; + + /** + * + */ + private static final int FONT_SIZE_LARGE = 16; /** * @@ -108,6 +115,7 @@ private JPanel getJContentPane() { if (jContentPane == null) { jContentPane = new JPanel(); + jContentPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); jContentPane.setLayout(new BorderLayout()); jContentPane.add(getJButtonOk(), BorderLayout.SOUTH); jContentPane.add(getJTextPane(), BorderLayout.CENTER); @@ -152,10 +160,9 @@ jTextPane = new JTextPane(); jTextPane.setBackground(SystemColor.control); jTextPane.setEditable(false); - jTextPane.setText("\nVersion " + Constant.APP_VERSION - + "\n\nApache 2.0 Lizenz" + jTextPane.setText("Version " + Constant.APP_VERSION + ", Apache 2.0 License" + "\n(c) Copyright Jochen Wuest, Markus Litz, DLR 2007-2008" - + "\n\nCommons Logging, Apache 2.0 Lizenz\nhttp://commons.apache.org/logging/" + + "\n\nCommons Logging, Apache 2.0 License\nhttp://commons.apache.org/logging/" + "\n\nIcons used by this Application:\nCrystal Project Icons by Everaldo Coelho\nhttp://www.everaldo.com\n"); } return jTextPane; @@ -170,6 +177,7 @@ if (jPanel == null) { jLabelAppName = new JLabel(); jLabelAppName.setText(" " + Constant.APP_TITLE); + jLabelAppName.setFont(new Font(Font.SANS_SERIF, Font.BOLD, FONT_SIZE_LARGE)); jLabelAppIcon = new JLabel(); jLabelAppIcon.setIcon(UIResource.getIcon(UIResource.ICON_APP32)); jPanel = new JPanel(); Modified: trunk/DAVInspector/src/de/dlr/davinspector/ui/ConfigurationDialog.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/ui/ConfigurationDialog.java 2008-03-06 19:02:30 UTC (rev 77) +++ trunk/DAVInspector/src/de/dlr/davinspector/ui/ConfigurationDialog.java 2008-03-08 19:34:07 UTC (rev 78) @@ -30,6 +30,7 @@ import java.awt.Window; import java.awt.event.KeyEvent; +import javax.swing.BorderFactory; import javax.swing.JButton; import javax.swing.JDialog; import javax.swing.JLabel; @@ -173,8 +174,9 @@ jContentPane.add(getJTextFieldServerAddress(), null); jContentPane.add(jLabelServerPort, null); jContentPane.add(getJTextFieldServerPort(), null); + jContentPane.add(getJButtonOk(), null); jContentPane.add(getJButtonCancel(), null); - jContentPane.add(getJButtonOk(), null); + jContentPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); } return jContentPane; } Modified: trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java 2008-03-06 19:02:30 UTC (rev 77) +++ trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java 2008-03-08 19:34:07 UTC (rev 78) @@ -305,6 +305,8 @@ } public void actionPerformed(ActionEvent e) { + // INFO: Currently shutdownActivePlugins maybe called twice. + myPluginManager.shutdownActivePlugins(); System.exit(0); } }; @@ -420,6 +422,7 @@ putValue(Action.SMALL_ICON, UIResource.getIcon(UIResource.ICON_START)); // TODO: Move to ctrl myRelayIsActive = false; + myPluginManager.shutdownActivePlugins(); myController.stopRelay(); } else { putValue(Action.NAME, "Stop Relay"); Modified: trunk/DAVInspector/src/de/dlr/davinspector/ui/PluginConfigurationDialog.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/ui/PluginConfigurationDialog.java 2008-03-06 19:02:30 UTC (rev 77) +++ trunk/DAVInspector/src/de/dlr/davinspector/ui/PluginConfigurationDialog.java 2008-03-08 19:34:07 UTC (rev 78) @@ -33,6 +33,7 @@ import java.util.Map; import java.util.Vector; +import javax.swing.BorderFactory; import javax.swing.JButton; import javax.swing.JDialog; import javax.swing.JPanel; @@ -183,6 +184,7 @@ jContentPane.setLayout(new BorderLayout()); jContentPane.add(getJScrollPane(), BorderLayout.CENTER); jContentPane.add(getJPanelButtonBar(), BorderLayout.SOUTH); + jContentPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); } return jContentPane; } @@ -209,8 +211,8 @@ if (jPanelButtonBar == null) { jPanelButtonBar = new JPanel(); jPanelButtonBar.setLayout(new BorderLayout()); - jPanelButtonBar.add(getJButtonCancel(), BorderLayout.WEST); - jPanelButtonBar.add(getJButtonOk(), BorderLayout.EAST); + jPanelButtonBar.add(getJButtonCancel(), BorderLayout.EAST); + jPanelButtonBar.add(getJButtonOk(), BorderLayout.WEST); } return jPanelButtonBar; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kil...@us...> - 2008-03-06 19:02:33
|
Revision: 77 http://davinspector.svn.sourceforge.net/davinspector/?rev=77&view=rev Author: killerjoe Date: 2008-03-06 11:02:30 -0800 (Thu, 06 Mar 2008) Log Message: ----------- Added new site-templates for news and download. Modified Paths: -------------- trunk/www/index.html trunk/www/overview.html Added Paths: ----------- trunk/www/download.html trunk/www/news.html Copied: trunk/www/download.html (from rev 76, trunk/www/overview.html) =================================================================== --- trunk/www/download.html (rev 0) +++ trunk/www/download.html 2008-03-06 19:02:30 UTC (rev 77) @@ -0,0 +1,25 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<title>DAVInspector - Downloads</title> +<meta name="Description" content="" /> +<meta name="Keywords" content="" /> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> +<link rel="stylesheet" type="text/css" href="style.css" media="screen" /> +</head> +<body> +<div id="wrap"> + <div id="header"> + <h1><a href="#">DAVInspector</a></h1> + <h2>HTTP and WebDAV test- and debugging tool. </h2> + </div> + <div id="menu"> <a href="index.html">Home</a> <a href="overview.html">Overview</a> <a href="news.html">News</a> <a href="download.html">Download</a></div> + <div id="content"> + <h2><a href="#">Download DAVInspector</a></h2> + <p> + + </div> + <div id="footer">© 2007-2008 <a href="http://www.dlr.de/sc">Deutsches Zentrum für Luft- und Raumfahrt e.V. (DLR)</a>. </div> +</div> +</body> +</html> Modified: trunk/www/index.html =================================================================== --- trunk/www/index.html 2008-03-06 18:59:37 UTC (rev 76) +++ trunk/www/index.html 2008-03-06 19:02:30 UTC (rev 77) @@ -13,7 +13,7 @@ <h1><a href="#">DAVInspector</a></h1> <h2>HTTP and WebDAV test- and debugging tool. </h2> </div> - <div id="menu"> <a href="#">Home</a> <a href="overview.html">Overview</a> <a href="#">News</a> <a href="#">Download</a></div> + <div id="menu"> <a href="index.html">Home</a> <a href="overview.html">Overview</a> <a href="news.html">News</a> <a href="download.html">Download</a></div> <div id="content"> <h2><a href="#">About DAVInspector</a></h2> <p>DAVInpector is a tool for debugging and moitoring HTTP and WebDAV capable applications. It is mainly written to help developers creating HTTP/WebDAV clients or servers, but could also be used from sysadmins. The open plugin technology makes it possible that in future other network protocols will be support too.<br /><br /> Copied: trunk/www/news.html (from rev 76, trunk/www/overview.html) =================================================================== --- trunk/www/news.html (rev 0) +++ trunk/www/news.html 2008-03-06 19:02:30 UTC (rev 77) @@ -0,0 +1,25 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<title>DAVInspector - News</title> +<meta name="Description" content="" /> +<meta name="Keywords" content="" /> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> +<link rel="stylesheet" type="text/css" href="style.css" media="screen" /> +</head> +<body> +<div id="wrap"> + <div id="header"> + <h1><a href="#">DAVInspector</a></h1> + <h2>HTTP and WebDAV test- and debugging tool. </h2> + </div> + <div id="menu"> <a href="index.html">Home</a> <a href="overview.html">Overview</a> <a href="news.html">News</a> <a href="download.html">Download</a></div> + <div id="content"> + <h2><a href="#">DAVInspector News Archive</a></h2> + <p> + + </div> + <div id="footer">© 2007-2008 <a href="http://www.dlr.de/sc">Deutsches Zentrum für Luft- und Raumfahrt e.V. (DLR)</a>. </div> +</div> +</body> +</html> Modified: trunk/www/overview.html =================================================================== --- trunk/www/overview.html 2008-03-06 18:59:37 UTC (rev 76) +++ trunk/www/overview.html 2008-03-06 19:02:30 UTC (rev 77) @@ -13,7 +13,7 @@ <h1><a href="#">DAVInspector</a></h1> <h2>HTTP and WebDAV test- and debugging tool. </h2> </div> - <div id="menu"> <a href="#">Home</a> <a href="#">Overview</a> <a href="#">News</a> <a href="#">Download</a></div> + <div id="menu"> <a href="index.html">Home</a> <a href="overview.html">Overview</a> <a href="news.html">News</a> <a href="download.html">Download</a></div> <div id="content"> <h2><a href="#">An short overview about DAVInspector</a></h2> <p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kil...@us...> - 2008-03-06 18:59:48
|
Revision: 76 http://davinspector.svn.sourceforge.net/davinspector/?rev=76&view=rev Author: killerjoe Date: 2008-03-06 10:59:37 -0800 (Thu, 06 Mar 2008) Log Message: ----------- fixed some typos. Added overview-site-template. Modified Paths: -------------- trunk/www/index.html Added Paths: ----------- trunk/www/overview.html Modified: trunk/www/index.html =================================================================== --- trunk/www/index.html 2008-03-06 15:08:40 UTC (rev 75) +++ trunk/www/index.html 2008-03-06 18:59:37 UTC (rev 76) @@ -13,7 +13,7 @@ <h1><a href="#">DAVInspector</a></h1> <h2>HTTP and WebDAV test- and debugging tool. </h2> </div> - <div id="menu"> <a href="#">Home</a> <a href="#">About </a> <a href="#">Contact</a></div> + <div id="menu"> <a href="#">Home</a> <a href="overview.html">Overview</a> <a href="#">News</a> <a href="#">Download</a></div> <div id="content"> <h2><a href="#">About DAVInspector</a></h2> <p>DAVInpector is a tool for debugging and moitoring HTTP and WebDAV capable applications. It is mainly written to help developers creating HTTP/WebDAV clients or servers, but could also be used from sysadmins. The open plugin technology makes it possible that in future other network protocols will be support too.<br /><br /> @@ -31,7 +31,7 @@ </p> <p> </p> <h2><a href="#">License</a></h2> - <p>Copyright 2006 Deutsches Zentrum für Luft- und Raumfahrt e.V. (DLR)<br> + <p>Copyright 2006 Deutsches Zentrum für Luft- und Raumfahrt e.V. (DLR)<br> <br> Licensed under the Apache License, Version 2.0 (the "License");<br> you may not use this file except in compliance with the License.<br> @@ -39,19 +39,11 @@ <br> </span><a href="http://www.apache.org/licenses/LICENSE-2.0"><span style="" lang="EN-GB">http://www.apache.org/licenses/LICENSE-2.0</span></a><span style="" lang="EN-GB"><br> <br> - Unless required by applicable law or agreed to in writing, software<br> - distributed under the License is distributed on an "AS IS" BASIS,<br>s - - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<br> - See the License for the specific language governing permissions and<br> - limitations under the License.<br> + 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. <br style=""> <!--[if !supportLineBreakNewLine]--><br style=""> <!--[endif]--><o:p></o:p></span></p> </div> - - <div id="divider">» <a href="#">Links</a> » <a href="#">Links</a> » <a href="#">Links</a> » <a href="#">Links</a> » <a href="#">Links</a></div> - <div id="footer">© 2007-2008 <a href="http://www.dlr.de/sc">Deutsches Zentrum für Luft- und Raumfahrt e.V. (DLR)</a>. </div> </div> </body> Added: trunk/www/overview.html =================================================================== --- trunk/www/overview.html (rev 0) +++ trunk/www/overview.html 2008-03-06 18:59:37 UTC (rev 76) @@ -0,0 +1,25 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<title>DAVInspector - Overview</title> +<meta name="Description" content="" /> +<meta name="Keywords" content="" /> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> +<link rel="stylesheet" type="text/css" href="style.css" media="screen" /> +</head> +<body> +<div id="wrap"> + <div id="header"> + <h1><a href="#">DAVInspector</a></h1> + <h2>HTTP and WebDAV test- and debugging tool. </h2> + </div> + <div id="menu"> <a href="#">Home</a> <a href="#">Overview</a> <a href="#">News</a> <a href="#">Download</a></div> + <div id="content"> + <h2><a href="#">An short overview about DAVInspector</a></h2> + <p> + + </div> + <div id="footer">© 2007-2008 <a href="http://www.dlr.de/sc">Deutsches Zentrum für Luft- und Raumfahrt e.V. (DLR)</a>. </div> +</div> +</body> +</html> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wu...@us...> - 2008-03-06 15:08:43
|
Revision: 75 http://davinspector.svn.sourceforge.net/davinspector/?rev=75&view=rev Author: wuest Date: 2008-03-06 07:08:40 -0800 (Thu, 06 Mar 2008) Log Message: ----------- Highlighting now working again! Modified Paths: -------------- trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/JTextPaneContentHandler.java trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/XMLPlugin.java trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/XMLTextPane.java Removed Paths: ------------- trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/XmlStyledDocument.java Modified: trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/JTextPaneContentHandler.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/JTextPaneContentHandler.java 2008-03-06 14:46:39 UTC (rev 74) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/JTextPaneContentHandler.java 2008-03-06 15:08:40 UTC (rev 75) @@ -26,14 +26,17 @@ package de.dlr.davinspector.plugins.xmlplugin; import java.awt.Color; -import java.io.IOException; import java.util.HashMap; import java.util.Iterator; import java.util.Map; -import java.util.logging.FileHandler; -import java.util.logging.Logger; import javax.swing.text.AttributeSet; +import javax.swing.text.BadLocationException; +import javax.swing.text.Element; +import javax.swing.text.SimpleAttributeSet; +import javax.swing.text.StyleConstants; +import javax.swing.text.StyleContext; +import javax.swing.text.StyledDocument; import org.xml.sax.Attributes; import org.xml.sax.ContentHandler; @@ -70,10 +73,7 @@ * */ private static final Color STYLE_XML_DEF = Color.LIGHT_GRAY; - - - private static Logger log = Logger.getAnonymousLogger(); - + /** * Store URI to prefix mappings. */ @@ -82,7 +82,7 @@ /** * The document. */ - private XmlStyledDocument myStyledDocument; + private StyledDocument myStyledDocument; /** * The attributes of the document. @@ -114,27 +114,17 @@ * * @param document StyledDocument */ - public JTextPaneContentHandler(XmlStyledDocument document) { - try { - FileHandler fh = new FileHandler("xmlplugin.log"); - log.addHandler(fh); - } catch (IOException ioe) { - System.exit(1); - } - - this.namespaceMappings = new HashMap<String, String>(); + public JTextPaneContentHandler(StyledDocument document) { + namespaceMappings = new HashMap<String, String>(); myStyledDocument = document; - /* Element rootElement = myStyledDocument.getDefaultRootElement(); myAttributeSet = rootElement.getAttributes(); - */ + myLevel = 0; myBufferCharacterData = ""; myBufferEndTag = ""; myBufferStartTag = ""; -System.err.println("start processing"); -log.info("start processing"); addText(STYLE_XML_DEF, "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" + NEWLINE); } @@ -145,7 +135,6 @@ * @param text String */ private void addText(Color color, String text) { - /* StyleContext styleContext = StyleContext.getDefaultStyleContext(); AttributeSet attributeSet = styleContext.addAttribute(SimpleAttributeSet.EMPTY, StyleConstants.Foreground, color); @@ -155,12 +144,8 @@ } catch (BadLocationException ble) { System.err.println(ble); } - + myStyledDocument.setCharacterAttributes(myStyledDocument.getLength() - text.length(), text.length(), attributeSet, false); - */ -System.err.println(myStyledDocument.getLength() - text.length() + " - " + myStyledDocument.getLength() + " Farbe: " + color); -log.info(myStyledDocument.getLength() - text.length() + " - " + myStyledDocument.getLength() + " Farbe: " + color); - myStyledDocument.setForeground(myStyledDocument.getLength() - text.length(), myStyledDocument.getLength(), color); } /** Modified: trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/XMLPlugin.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/XMLPlugin.java 2008-03-06 14:46:39 UTC (rev 74) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/XMLPlugin.java 2008-03-06 15:08:40 UTC (rev 75) @@ -25,8 +25,12 @@ package de.dlr.davinspector.plugins.xmlplugin; +import java.io.IOException; + import javax.swing.JComponent; +import org.xml.sax.SAXException; + import de.dlr.davinspector.history.AMessage; import de.dlr.davinspector.plugin.IViewPlugin; @@ -141,7 +145,13 @@ */ public void update(AMessage msg) { if (isActive && myXMLTextPane != null) { - myXMLTextPane.setText(msg.getMessageBody()); + try { + myXMLTextPane.init(msg.getMessageBody()); + } catch (SAXException se) { + System.err.println(se.getMessage()); + } catch (IOException ioe) { + System.err.println(ioe.getMessage()); + } } } Modified: trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/XMLTextPane.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/XMLTextPane.java 2008-03-06 14:46:39 UTC (rev 74) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/XMLTextPane.java 2008-03-06 15:08:40 UTC (rev 75) @@ -30,6 +30,7 @@ import java.io.StringReader; import javax.swing.JTextPane; +import javax.swing.text.StyledDocument; import org.xml.sax.ContentHandler; import org.xml.sax.InputSource; @@ -54,14 +55,14 @@ /** * The document. */ - private XmlStyledDocument myDocument; + private StyledDocument myDocument; /** * Constructor, empty. */ public XMLTextPane() { - myDocument = new XmlStyledDocument(); - setStyledDocument(myDocument); +// myDocument = new XmlStyledDocument(); +// setStyledDocument(myDocument); } /** @@ -97,11 +98,11 @@ */ public void init(String xmlInput) throws IOException, SAXException { setText(""); + myDocument = getStyledDocument(); if (!xmlInput.trim().equals("")) { // Create instances needed for parsing XMLReader reader = XMLReaderFactory.createXMLReader(); -System.err.println("start"); ContentHandler jTextPaneContentHandler = new JTextPaneContentHandler(myDocument); // Register content handler Deleted: trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/XmlStyledDocument.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/XmlStyledDocument.java 2008-03-06 14:46:39 UTC (rev 74) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/XmlStyledDocument.java 2008-03-06 15:08:40 UTC (rev 75) @@ -1,148 +0,0 @@ -/* - * XmlStyledDocument.java - * - * TODO: wues_ha Enter comment! - * - * Created: 06.03.2008 wues_ha <email> - * Changed: - * - * $Id$ - * - * Copyright 2007 Deutsches Zentrum fuer Luft- und Raumfahrt e.V. (DLR) - * - * Licensed 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 de.dlr.davinspector.plugins.xmlplugin; - -import java.awt.Color; - -import javax.swing.text.AttributeSet; -import javax.swing.text.DefaultStyledDocument; -import javax.swing.text.Element; -import javax.swing.text.SimpleAttributeSet; -import javax.swing.text.StyleConstants; -import javax.swing.text.StyleContext; - -public class XmlStyledDocument extends DefaultStyledDocument { - - private static final long serialVersionUID = 1L; - - public void setBold(int startPosition, int endPosition) { - for (int i = startPosition; i < endPosition; i++) { - setBold(getSimpleAttributeSet(i), i); - } - } - - public void setItalic(int startPosition, int endPosition) { - for (int i = startPosition; i < endPosition; i++) { - setItalic(getSimpleAttributeSet(i), i); - } - } - - public void setUnderline(int startPosition, int endPosition) { - for (int i = startPosition; i < endPosition; i++) { - setUnderline(getSimpleAttributeSet(i), i); - } - } - - public void setFont(int startPosition, int endPosition, String font) { - for (int i = startPosition; i < endPosition; i++) { - setFont(getSimpleAttributeSet(i), i, font); - } - } - - public void setFontSize(int startPosition, int endPosition, int size) { - for (int i = startPosition; i < endPosition; i++) { - setSize(getSimpleAttributeSet(i), i, size); - } - } - - public void setForeground(int startPosition, int endPosition, Color col) { - for (int i = startPosition; i < endPosition; i++) { - setForeground(getSimpleAttributeSet(i), i, col); - } - } - - public void setBackground(int startPosition, int endPosition, Color col) { - for (int i = startPosition; i < endPosition; i++) { - setBackground(getSimpleAttributeSet(i), i, col); - } - } - - private void setItalic(SimpleAttributeSet sas, int pos) { - if (StyleConstants.isItalic(sas)) { - StyleConstants.setItalic(sas, false); - } else { - StyleConstants.setItalic(sas, true); - } - setCharacterAttributes(pos, 1, sas, true); - } - - private void setBold(SimpleAttributeSet sas, int pos) { - if (StyleConstants.isBold(sas)) { - StyleConstants.setBold(sas, false); - } else { - StyleConstants.setBold(sas, true); - } - setCharacterAttributes(pos, 1, sas, true); - } - - private void setUnderline(SimpleAttributeSet sas, int pos) { - if (StyleConstants.isUnderline(sas)) { - StyleConstants.setUnderline(sas, false); - } else { - StyleConstants.setUnderline(sas, true); - } - setCharacterAttributes(pos, 1, sas, true); - } - - private void setFont(SimpleAttributeSet sas, int pos, String font) { - StyleConstants.setFontFamily(sas, font); - setCharacterAttributes(pos, 1, sas, true); - } - - private void setSize(SimpleAttributeSet sas, int pos, int size) { - StyleConstants.setFontSize(sas, size); - setCharacterAttributes(pos, 1, sas, true); - } - - private void setForeground(SimpleAttributeSet sas, int pos, Color col) { - StyleConstants.setForeground(sas, col); - setCharacterAttributes(pos, 1, sas, true); - } - - private void setBackground(SimpleAttributeSet sas, int pos, Color col) { - StyleConstants.setBackground(sas, col); - setCharacterAttributes(pos, 1, sas, true); - } - - public SimpleAttributeSet getSimpleAttributeSet(int pos) { - Element element = getCharacterElement(pos); - AttributeSet as = element.getAttributes(); - SimpleAttributeSet sas = new SimpleAttributeSet(as); - return sas; - } - - public XmlStyledDocument() { - super(); - } - - public XmlStyledDocument(Content arg0, StyleContext arg1) { - super(arg0, arg1); - } - - public XmlStyledDocument(StyleContext arg0) { - super(arg0); - } -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wu...@us...> - 2008-03-06 14:46:55
|
Revision: 74 http://davinspector.svn.sourceforge.net/davinspector/?rev=74&view=rev Author: wuest Date: 2008-03-06 06:46:39 -0800 (Thu, 06 Mar 2008) Log Message: ----------- MessageParser now with simple Request/Response detection. Work on XMLPlugin still in progress, this code is not working! Modified Paths: -------------- trunk/DAVInspector/src/de/dlr/davinspector/history/AMessage.java trunk/DAVInspector/src/de/dlr/davinspector/history/AMessageParser.java trunk/DAVInspector/src/de/dlr/davinspector/history/MessageHistory.java trunk/DAVInspector/src/de/dlr/davinspector/http/HTTPMessageParser.java trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/JTextPaneContentHandler.java trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/XMLTextPane.java trunk/DAVInspector/src/de/dlr/davinspector/relay/RelayModel.java trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java Added Paths: ----------- trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/XmlStyledDocument.java Modified: trunk/DAVInspector/src/de/dlr/davinspector/history/AMessage.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/history/AMessage.java 2008-03-04 22:33:49 UTC (rev 73) +++ trunk/DAVInspector/src/de/dlr/davinspector/history/AMessage.java 2008-03-06 14:46:39 UTC (rev 74) @@ -63,41 +63,48 @@ } /** + * Parsing state of the message. + */ + protected Boolean myParsingState; + + /** * Unique ID of a message. */ - private int myID; + protected int myID; /** * Timestamp of the current message. */ - private Date myTimestamp; + protected Date myTimestamp; /** * myDirection indicates the direction of the message. * @see MessageDirection */ - private MessageDirection myDirection; + protected MessageDirection myDirection; /** * This string contains the raw data of the message. */ - private String myRawData; + protected String myRawData; /** * */ - private String myMessageHeader; + protected String myRawHeader; /** * */ - private String myMessageBody; + protected String myRawBody; /** * The size in bytes of the current message. */ - private int mySize; + protected int mySize; + + /** * This method returns the ID of the message. * @@ -177,6 +184,15 @@ } /** + * TODO: wues_ha: Enter comment! + * + * @return Boolean + */ + public Boolean isComplete() { + return myParsingState; + } + + /** * Returns the raw data of the message. * * @return data String @@ -203,7 +219,7 @@ * @return String */ public String getMessageHeader() { - return myMessageHeader; + return myRawHeader; } /** @@ -212,6 +228,6 @@ * @return String */ public String getMessageBody() { - return myMessageBody; + return myRawBody; } } Modified: trunk/DAVInspector/src/de/dlr/davinspector/history/AMessageParser.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/history/AMessageParser.java 2008-03-04 22:33:49 UTC (rev 73) +++ trunk/DAVInspector/src/de/dlr/davinspector/history/AMessageParser.java 2008-03-06 14:46:39 UTC (rev 74) @@ -33,26 +33,25 @@ * @author Jochen Wuest */ public abstract class AMessageParser extends AMessage { - + /** - * Parsing state of the message. + * */ - protected Boolean isComplete; - + protected AMessage myMessage; + /** + * TODO: wues_ha: enter comment! + * + * @param aMessage AMessage + */ + public AMessageParser(AMessage aMessage) { + myMessage = aMessage; + } + + /** * {@inheritDoc} * * @see de.dlr.davinspector.history.AMessage#parseMessage() */ public abstract void parseMessage(); - - /** - * Returns the parsing state of the message. - * - * @return Boolean - */ - public Boolean isComplete() { - return isComplete; - } - } Modified: trunk/DAVInspector/src/de/dlr/davinspector/history/MessageHistory.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/history/MessageHistory.java 2008-03-04 22:33:49 UTC (rev 73) +++ trunk/DAVInspector/src/de/dlr/davinspector/history/MessageHistory.java 2008-03-06 14:46:39 UTC (rev 74) @@ -106,20 +106,36 @@ */ public void storeMessage(String data, Boolean toClient, Date timestamp) { - AMessage message = new Message(); //TODO: add decorator dependent on protocol (switch http, ...). - message = new HTTPMessageParser(message); + HTTPMessageParser message = new HTTPMessageParser(new Message()); message.setMessageDirection(toClient); message.setRawData(data); message.setTimestamp(timestamp); message.parseMessage(); - - // store Message - myMessages.add(message); - - notifyNewMessage(new MessageEvent(this, message)); + + if (message.isComplete()) { + // store Message + myMessages.add(message); + notifyNewMessage(new MessageEvent(this, message)); + // Clear buffer + if (toClient) { + myClientsideBuffer = ""; + } else { + myServersideBuffer = ""; + } + } else { + System.err.println("Not Complete"); + } } + + /** + * Deletes all stored messages. + * + */ + public void deleteAllMessages() { + myMessages.clear(); + } /** * This method loads a message identified by the ID. @@ -145,7 +161,6 @@ public void newClientData(DataEvent newDataEvent) { myClientsideBuffer += newDataEvent.getData(); storeMessage(myClientsideBuffer, false, new Date()); - myClientsideBuffer = ""; } /** @@ -156,7 +171,6 @@ public void newServerData(DataEvent newDataEvent) { myServersideBuffer += newDataEvent.getData(); storeMessage(myServersideBuffer, true, new Date()); - myServersideBuffer = ""; } /** Modified: trunk/DAVInspector/src/de/dlr/davinspector/http/HTTPMessageParser.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/http/HTTPMessageParser.java 2008-03-04 22:33:49 UTC (rev 73) +++ trunk/DAVInspector/src/de/dlr/davinspector/http/HTTPMessageParser.java 2008-03-06 14:46:39 UTC (rev 74) @@ -25,10 +25,12 @@ package de.dlr.davinspector.http; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + import de.dlr.davinspector.history.AMessage; import de.dlr.davinspector.history.AMessageParser; - /** * TODO: wues_ha: Enter comment! * @@ -40,15 +42,16 @@ /** * */ - private AMessage myMessage; - + private static final String REGEX_HTTP_METHOD = "^[UNKNOWN|HEAD|GET|POST|PUT|DELETE|OPTIONS|TRACE|CONNECT|PROPFIND|PROPPATCH|MKCOL|COPY|MOVE|LOCK|UNLOCK]{1}"; + /** * Constructor. * * @param aMessage AMessage */ public HTTPMessageParser(AMessage aMessage) { - myMessage = aMessage; + super(aMessage); + myParsingState = false; } /** @@ -73,7 +76,7 @@ result = s[i]; } } else { - result = "--leer--"; + result = "--empty--"; } @@ -100,7 +103,7 @@ String[] s = input.split("\r\n\r\n"); return s[0]; } else { - return "--leer--"; + return "--empty--"; } } @@ -108,28 +111,38 @@ * {@inheritDoc} * * @see de.dlr.davinspector.history.AMessageParser#parseMessage() - */ - public void parseMessage() { - //super.setMessageBody(extractMessageBody(super.getRawData())); - //super.setMessageHeader(extractMessageHeader(super.getRawData())); + */ + public void parseMessage() { + // erste zeile bei request: http-kommando + s + request-url + s + protokoll version + // BSP: OPTIONS /slide/files/ HTTP/1.1 + // erste zeile bei response: protokoll version + s + status code + s + status text (don't care) + // BSP: HTTP/1.1 200 OK +System.out.println("phase 1"); //+ getRawData() + "\n\n###\n\n" + super.getRawData()); + if (isRequest(myRawData)) { + myDirection = MessageDirection.Request; +System.out.println("phase 2a"); + } else { + myDirection = MessageDirection.Response; +System.out.println("phase 2b"); + } + + myRawHeader = extractMessageHeader(myRawData); + myRawBody = extractMessageBody(myRawData); + +System.out.println("phase 3"); + myParsingState = true; } /** - * Returns the head of the message. + * TODO: wues_ha: Enter comment! * - * @return String + * @param input String + * @return Boolean */ - public String getMessageHeader() { -//System.out.println(myMessage.getRawData() + " \xE4 \xE4 \xE4 " + super.getRawData()); - return extractMessageHeader(super.getRawData()); + private Boolean isRequest(String input) { + Pattern pattern = Pattern.compile(REGEX_HTTP_METHOD, Pattern.CASE_INSENSITIVE); + Matcher matcher = pattern.matcher(input); +System.out.println("Parsing httptype 1a"); + return matcher.find(); } - - /** - * Returns the body of the message. - * - * @return String - */ - public String getMessageBody() { - return extractMessageBody(super.getRawData()); - } } Modified: trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/JTextPaneContentHandler.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/JTextPaneContentHandler.java 2008-03-04 22:33:49 UTC (rev 73) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/JTextPaneContentHandler.java 2008-03-06 14:46:39 UTC (rev 74) @@ -26,17 +26,14 @@ package de.dlr.davinspector.plugins.xmlplugin; import java.awt.Color; +import java.io.IOException; import java.util.HashMap; import java.util.Iterator; import java.util.Map; +import java.util.logging.FileHandler; +import java.util.logging.Logger; import javax.swing.text.AttributeSet; -import javax.swing.text.BadLocationException; -import javax.swing.text.Element; -import javax.swing.text.SimpleAttributeSet; -import javax.swing.text.StyleConstants; -import javax.swing.text.StyleContext; -import javax.swing.text.StyledDocument; import org.xml.sax.Attributes; import org.xml.sax.ContentHandler; @@ -54,14 +51,30 @@ /** * Character/s for newline. */ - static final String NEWLINE = "\r\n"; + private static final String NEWLINE = "\r\n"; /** * Character/s for indent. */ - static final String INDENT = " "; + private static final String INDENT = " "; /** + * + */ + private static final Color STYLE_XML_TAG = Color.BLUE; + /** + * + */ + private static final Color STYLE_XML_CONTENT = Color.BLACK; + /** + * + */ + private static final Color STYLE_XML_DEF = Color.LIGHT_GRAY; + + + private static Logger log = Logger.getAnonymousLogger(); + + /** * Store URI to prefix mappings. */ private Map<String, String> namespaceMappings; @@ -69,7 +82,7 @@ /** * The document. */ - private StyledDocument myDocument; + private XmlStyledDocument myStyledDocument; /** * The attributes of the document. @@ -95,42 +108,59 @@ * String buffer for the start tag. */ private String myBufferStartTag; - + /** * Constructor, initializes all buffers and sets up the document. * * @param document StyledDocument */ - public JTextPaneContentHandler(StyledDocument document) { - namespaceMappings = new HashMap<String, String>(); - myDocument = document; - Element rootElement = myDocument.getDefaultRootElement(); + public JTextPaneContentHandler(XmlStyledDocument document) { + try { + FileHandler fh = new FileHandler("xmlplugin.log"); + log.addHandler(fh); + } catch (IOException ioe) { + System.exit(1); + } + + this.namespaceMappings = new HashMap<String, String>(); + myStyledDocument = document; + /* + Element rootElement = myStyledDocument.getDefaultRootElement(); myAttributeSet = rootElement.getAttributes(); + */ myLevel = 0; myBufferCharacterData = ""; myBufferEndTag = ""; myBufferStartTag = ""; - addText(Color.magenta, "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" + NEWLINE); + +System.err.println("start processing"); +log.info("start processing"); + addText(STYLE_XML_DEF, "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" + NEWLINE); } - + /** * This method adds text in the specified color to the <code>myDocument</code>. * - * @param color Color of the text. - * @param text String to add to pane. + * @param color Color/Style + * @param text String */ private void addText(Color color, String text) { + /* StyleContext styleContext = StyleContext.getDefaultStyleContext(); AttributeSet attributeSet = styleContext.addAttribute(SimpleAttributeSet.EMPTY, StyleConstants.Foreground, color); try { - myDocument.insertString(myDocument.getLength(), text, myAttributeSet); + myStyledDocument.insertString(myStyledDocument.getLength(), text, myAttributeSet); } catch (BadLocationException ble) { System.err.println(ble); } - - myDocument.setCharacterAttributes(myDocument.getLength() - text.length(), text.length(), attributeSet, false); + + myStyledDocument.setCharacterAttributes(myStyledDocument.getLength() - text.length(), text.length(), attributeSet, false); + */ +System.err.println(myStyledDocument.getLength() - text.length() + " - " + myStyledDocument.getLength() + " Farbe: " + color); +log.info(myStyledDocument.getLength() - text.length() + " - " + myStyledDocument.getLength() + " Farbe: " + color); + myStyledDocument.setForeground(myStyledDocument.getLength() - text.length(), myStyledDocument.getLength(), color); } /** @@ -168,7 +198,7 @@ // if there is a buffered start tag, write it to the output if (!myBufferStartTag.trim().isEmpty()) { myLevel--; - addText(Color.BLUE , getIndent() + myBufferStartTag + NEWLINE); + addText(STYLE_XML_TAG, getIndent() + myBufferStartTag + NEWLINE); myLevel++; } @@ -205,11 +235,11 @@ myLevel--; if (myBufferCharacterData.trim().isEmpty()) { - addText(Color.BLUE, getIndent() + myBufferStartTag + myBufferEndTag + NEWLINE); + addText(STYLE_XML_TAG, getIndent() + myBufferStartTag + myBufferEndTag + NEWLINE); } else { - addText(Color.BLUE, getIndent() + myBufferStartTag); - addText(Color.BLACK, myBufferCharacterData); - addText(Color.BLUE, myBufferEndTag + NEWLINE); + addText(STYLE_XML_TAG, getIndent() + myBufferStartTag); + addText(STYLE_XML_CONTENT, myBufferCharacterData); + addText(STYLE_XML_TAG, myBufferEndTag + NEWLINE); } myBufferCharacterData = ""; Modified: trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/XMLTextPane.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/XMLTextPane.java 2008-03-04 22:33:49 UTC (rev 73) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/XMLTextPane.java 2008-03-06 14:46:39 UTC (rev 74) @@ -30,7 +30,6 @@ import java.io.StringReader; import javax.swing.JTextPane; -import javax.swing.text.StyledDocument; import org.xml.sax.ContentHandler; import org.xml.sax.InputSource; @@ -55,13 +54,14 @@ /** * The document. */ - private StyledDocument myDocument; + private XmlStyledDocument myDocument; /** * Constructor, empty. */ public XMLTextPane() { - + myDocument = new XmlStyledDocument(); + setStyledDocument(myDocument); } /** @@ -97,11 +97,11 @@ */ public void init(String xmlInput) throws IOException, SAXException { setText(""); - myDocument = getStyledDocument(); if (!xmlInput.trim().equals("")) { // Create instances needed for parsing XMLReader reader = XMLReaderFactory.createXMLReader(); +System.err.println("start"); ContentHandler jTextPaneContentHandler = new JTextPaneContentHandler(myDocument); // Register content handler Added: trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/XmlStyledDocument.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/XmlStyledDocument.java (rev 0) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/XmlStyledDocument.java 2008-03-06 14:46:39 UTC (rev 74) @@ -0,0 +1,148 @@ +/* + * XmlStyledDocument.java + * + * TODO: wues_ha Enter comment! + * + * Created: 06.03.2008 wues_ha <email> + * Changed: + * + * $Id$ + * + * Copyright 2007 Deutsches Zentrum fuer Luft- und Raumfahrt e.V. (DLR) + * + * Licensed 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 de.dlr.davinspector.plugins.xmlplugin; + +import java.awt.Color; + +import javax.swing.text.AttributeSet; +import javax.swing.text.DefaultStyledDocument; +import javax.swing.text.Element; +import javax.swing.text.SimpleAttributeSet; +import javax.swing.text.StyleConstants; +import javax.swing.text.StyleContext; + +public class XmlStyledDocument extends DefaultStyledDocument { + + private static final long serialVersionUID = 1L; + + public void setBold(int startPosition, int endPosition) { + for (int i = startPosition; i < endPosition; i++) { + setBold(getSimpleAttributeSet(i), i); + } + } + + public void setItalic(int startPosition, int endPosition) { + for (int i = startPosition; i < endPosition; i++) { + setItalic(getSimpleAttributeSet(i), i); + } + } + + public void setUnderline(int startPosition, int endPosition) { + for (int i = startPosition; i < endPosition; i++) { + setUnderline(getSimpleAttributeSet(i), i); + } + } + + public void setFont(int startPosition, int endPosition, String font) { + for (int i = startPosition; i < endPosition; i++) { + setFont(getSimpleAttributeSet(i), i, font); + } + } + + public void setFontSize(int startPosition, int endPosition, int size) { + for (int i = startPosition; i < endPosition; i++) { + setSize(getSimpleAttributeSet(i), i, size); + } + } + + public void setForeground(int startPosition, int endPosition, Color col) { + for (int i = startPosition; i < endPosition; i++) { + setForeground(getSimpleAttributeSet(i), i, col); + } + } + + public void setBackground(int startPosition, int endPosition, Color col) { + for (int i = startPosition; i < endPosition; i++) { + setBackground(getSimpleAttributeSet(i), i, col); + } + } + + private void setItalic(SimpleAttributeSet sas, int pos) { + if (StyleConstants.isItalic(sas)) { + StyleConstants.setItalic(sas, false); + } else { + StyleConstants.setItalic(sas, true); + } + setCharacterAttributes(pos, 1, sas, true); + } + + private void setBold(SimpleAttributeSet sas, int pos) { + if (StyleConstants.isBold(sas)) { + StyleConstants.setBold(sas, false); + } else { + StyleConstants.setBold(sas, true); + } + setCharacterAttributes(pos, 1, sas, true); + } + + private void setUnderline(SimpleAttributeSet sas, int pos) { + if (StyleConstants.isUnderline(sas)) { + StyleConstants.setUnderline(sas, false); + } else { + StyleConstants.setUnderline(sas, true); + } + setCharacterAttributes(pos, 1, sas, true); + } + + private void setFont(SimpleAttributeSet sas, int pos, String font) { + StyleConstants.setFontFamily(sas, font); + setCharacterAttributes(pos, 1, sas, true); + } + + private void setSize(SimpleAttributeSet sas, int pos, int size) { + StyleConstants.setFontSize(sas, size); + setCharacterAttributes(pos, 1, sas, true); + } + + private void setForeground(SimpleAttributeSet sas, int pos, Color col) { + StyleConstants.setForeground(sas, col); + setCharacterAttributes(pos, 1, sas, true); + } + + private void setBackground(SimpleAttributeSet sas, int pos, Color col) { + StyleConstants.setBackground(sas, col); + setCharacterAttributes(pos, 1, sas, true); + } + + public SimpleAttributeSet getSimpleAttributeSet(int pos) { + Element element = getCharacterElement(pos); + AttributeSet as = element.getAttributes(); + SimpleAttributeSet sas = new SimpleAttributeSet(as); + return sas; + } + + public XmlStyledDocument() { + super(); + } + + public XmlStyledDocument(Content arg0, StyleContext arg1) { + super(arg0, arg1); + } + + public XmlStyledDocument(StyleContext arg0) { + super(arg0); + } +} Modified: trunk/DAVInspector/src/de/dlr/davinspector/relay/RelayModel.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/relay/RelayModel.java 2008-03-04 22:33:49 UTC (rev 73) +++ trunk/DAVInspector/src/de/dlr/davinspector/relay/RelayModel.java 2008-03-06 14:46:39 UTC (rev 74) @@ -243,7 +243,7 @@ public void run() { myLogger.info("Relay is starting"); try { - while (!isInterrupted()) { + while (!isInterrupted()) { //looping Socket serverSideSocket = serverSocket.accept(); try { serverSideSocket.setSoLinger(true, Constant.RELAY_LINGERTIME); @@ -265,6 +265,12 @@ serverToClientChannel.start(); clientToServerChannel.start(); } + try { + serverToClientChannel.join(); + clientToServerChannel.join(); + } catch (InterruptedException ie) { + myLogger.error(ie); + } } catch (SocketException se) { myLogger.error(se); } @@ -288,9 +294,12 @@ public void stopRelay() { myLogger.info("stopping stage 1"); try { - interrupt(); + this.interrupt(); +// this.join(); } catch (SecurityException se) { myLogger.info(se); +// } catch (InterruptedException ie) { +// myLogger.info(ie); } myLogger.info("stopping stage 2"); } Modified: trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java 2008-03-04 22:33:49 UTC (rev 73) +++ trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java 2008-03-06 14:46:39 UTC (rev 74) @@ -1016,6 +1016,9 @@ */ private JSplitPane getJSplitPaneVertical() { if (jSplitPaneVertical == null) { + //TODO: splitter settings +// splitPane.setOneTouchExpandable(true); +// splitPane.setResizeWeight(0.5); jSplitPaneVertical = new JSplitPane(); jSplitPaneVertical.setOrientation(JSplitPane.VERTICAL_SPLIT); jSplitPaneVertical.setDividerLocation(DIVIDER_VERT); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kil...@us...> - 2008-03-04 22:34:15
|
Revision: 73 http://davinspector.svn.sourceforge.net/davinspector/?rev=73&view=rev Author: killerjoe Date: 2008-03-04 14:33:49 -0800 (Tue, 04 Mar 2008) Log Message: ----------- Typo in index.html. Modified Paths: -------------- trunk/www/index.html Modified: trunk/www/index.html =================================================================== --- trunk/www/index.html 2008-03-04 22:26:17 UTC (rev 72) +++ trunk/www/index.html 2008-03-04 22:33:49 UTC (rev 73) @@ -16,7 +16,7 @@ <div id="menu"> <a href="#">Home</a> <a href="#">About </a> <a href="#">Contact</a></div> <div id="content"> <h2><a href="#">About DAVInspector</a></h2> - <p>DAVInpector is a tool for debugging and moitoring HTTP and WebDAV capable applications. It is mainly written to help developers creating HTTP/WebDAV clients or servers, but could be used for sysadmins too. The open plugin technology could make it possible that in future there will be support for other network protocols.<br /><br /> + <p>DAVInpector is a tool for debugging and moitoring HTTP and WebDAV capable applications. It is mainly written to help developers creating HTTP/WebDAV clients or servers, but could also be used from sysadmins. The open plugin technology makes it possible that in future other network protocols will be support too.<br /><br /> DAVInspector is developed by employees of the the institution <a href="http://www.dlr.de/sc" class="blacklink">"Simulation and Software Technology" (SISTEC)</a> at the <a href="http://www.dlr.de" class="blacklink">German Aerospace Center DLR</a>.</p> <p>We are happy about any support for this project - for example you might participate as a developer, bug reporter or simply by telling us your needs. Just visit our <a href="http://sourceforge.net/forum/?group_id=206242">forums</a> or join our <a href="http://sourceforge.net/mail/?group_id=206242">mailing-lists</a> on Sourceforge. <br></p></p> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kil...@us...> - 2008-03-04 22:26:35
|
Revision: 72 http://davinspector.svn.sourceforge.net/davinspector/?rev=72&view=rev Author: killerjoe Date: 2008-03-04 14:26:17 -0800 (Tue, 04 Mar 2008) Log Message: ----------- Webseite content added. Modified Paths: -------------- trunk/www/index.html Added Paths: ----------- trunk/www/image/logo_dlr.gif Added: trunk/www/image/logo_dlr.gif =================================================================== (Binary files differ) Property changes on: trunk/www/image/logo_dlr.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/www/index.html =================================================================== --- trunk/www/index.html 2008-03-04 13:07:57 UTC (rev 71) +++ trunk/www/index.html 2008-03-04 22:26:17 UTC (rev 72) @@ -15,58 +15,44 @@ </div> <div id="menu"> <a href="#">Home</a> <a href="#">About </a> <a href="#">Contact</a></div> <div id="content"> - <h2><a href="#">Welcome!</a></h2> - <p class="meta">19.11.2006</p> - <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. - Integer a libero ac ante tempus interdum. Donec non purus. - Donec sed dolor. Suspendisse faucibus. Aenean a nisl non - ante nonummy hendrerit. Proin lacinia malesuada ipsum. - Donec magna. Quisque risus magna, consectetuer non, - suscipit sit amet, interdum ac, nibh. Nulla facilisi. - Nullam lobortis, mauris et vehicula scelerisque, - urna lectus faucibus diam, vel congue enim ligula ac - tortor. Suspendisse venenatis auctor tellus. Nunc arcu - elit, suscipit non, semper in, accumsan eget, felis. - Cras id sapien at felis vulputate ullamcorper...</p> + <h2><a href="#">About DAVInspector</a></h2> + <p>DAVInpector is a tool for debugging and moitoring HTTP and WebDAV capable applications. It is mainly written to help developers creating HTTP/WebDAV clients or servers, but could be used for sysadmins too. The open plugin technology could make it possible that in future there will be support for other network protocols.<br /><br /> +DAVInspector is developed by employees of the the institution <a href="http://www.dlr.de/sc" class="blacklink">"Simulation and Software Technology" (SISTEC)</a> at the <a href="http://www.dlr.de" class="blacklink">German Aerospace Center DLR</a>.</p> + +<p>We are happy about any support for this project - for example you might participate as a developer, bug reporter or simply by telling us your needs. Just visit our <a href="http://sourceforge.net/forum/?group_id=206242">forums</a> or join our <a href="http://sourceforge.net/mail/?group_id=206242">mailing-lists</a> on Sourceforge. <br></p></p> <p> </p> - <p><a href="#">Read on.</a></p> - <p> </p> <h2><a href="#">Latest news</a></h2> - <p class="meta">19.11.2006</p> - <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. - Integer a libero ac ante tempus interdum. Donec non purus. - Donec sed dolor. Suspendisse faucibus. Aenean a nisl non - ante nonummy hendrerit. Proin lacinia malesuada ipsum. - Donec magna. Quisque risus magna, consectetuer non, - suscipit sit amet, interdum ac, nibh. Nulla facilisi. - Nullam lobortis, mauris et vehicula scelerisque, - urna lectus faucibus diam, vel congue enim ligula ac - tortor. Suspendisse venenatis auctor tellus. Nunc arcu - elit, suscipit non, semper in, accumsan eget, felis. - Cras id sapien at felis vulputate ullamcorper...</p> + <p class="meta">04.03.2008</p> + <p>DAVInspector is still in alpha phase...</p> <p> </p> - <p><a href="#">Read on.</a></p> + <h2><a href="#">Download</a></h2> + <p>You can download the latest version of DAVInspector from our <a href="http://sourceforge.net/projects/davinspector/">Sourceforge project page</a>: + + </p> <p> </p> - <h2><a href="#">Latest news</a></h2> - <p class="meta">19.11.2006</p> - <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. - Integer a libero ac ante tempus interdum. Donec non purus. - Donec sed dolor. Suspendisse faucibus. Aenean a nisl non - ante nonummy hendrerit. Proin lacinia malesuada ipsum. - Donec magna. Quisque risus magna, consectetuer non, - suscipit sit amet, interdum ac, nibh. Nulla facilisi. - Nullam lobortis, mauris et vehicula scelerisque, - urna lectus faucibus diam, vel congue enim ligula ac - tortor. Suspendisse venenatis auctor tellus. Nunc arcu - elit, suscipit non, semper in, accumsan eget, felis. - Cras id sapien at felis vulputate ullamcorper...</p> - <p> </p> - <p><a href="#">Read on.</a></p> + <h2><a href="#">License</a></h2> + <p>Copyright 2006 Deutsches Zentrum für Luft- und Raumfahrt e.V. (DLR)<br> + <br> + Licensed under the Apache License, Version 2.0 (the "License");<br> + you may not use this file except in compliance with the License.<br> + You may obtain a copy of the License at<br> + <br> + </span><a href="http://www.apache.org/licenses/LICENSE-2.0"><span style="" lang="EN-GB">http://www.apache.org/licenses/LICENSE-2.0</span></a><span style="" lang="EN-GB"><br> + <br> + Unless required by applicable law or agreed to in writing, software<br> + distributed under the License is distributed on an "AS IS" BASIS,<br>s + + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<br> + See the License for the specific language governing permissions and<br> + limitations under the License.<br> + <br style=""> + <!--[if !supportLineBreakNewLine]--><br style=""> + <!--[endif]--><o:p></o:p></span></p> </div> <div id="divider">» <a href="#">Links</a> » <a href="#">Links</a> » <a href="#">Links</a> » <a href="#">Links</a> » <a href="#">Links</a></div> - <div id="footer">Open Source Design Template sponsored by <a href="http://www.cmgtechnologies.com/">CMG Technologies</a><a href="#"></a>. </div> + <div id="footer">© 2007-2008 <a href="http://www.dlr.de/sc">Deutsches Zentrum für Luft- und Raumfahrt e.V. (DLR)</a>. </div> </div> </body> </html> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wu...@us...> - 2008-03-04 13:08:26
|
Revision: 71 http://davinspector.svn.sourceforge.net/davinspector/?rev=71&view=rev Author: wuest Date: 2008-03-04 05:07:57 -0800 (Tue, 04 Mar 2008) Log Message: ----------- Moved instance of the PluginManager from the view to the model and added a system logger. Modified Paths: -------------- trunk/DAVInspector/config.properties trunk/DAVInspector/src/de/dlr/davinspector/relay/ChannelThread.java trunk/DAVInspector/src/de/dlr/davinspector/relay/IRelayModel.java trunk/DAVInspector/src/de/dlr/davinspector/relay/RelayModel.java trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java Added Paths: ----------- trunk/DAVInspector/.classpath trunk/DAVInspector/.project Added: trunk/DAVInspector/.classpath =================================================================== --- trunk/DAVInspector/.classpath (rev 0) +++ trunk/DAVInspector/.classpath 2008-03-04 13:07:57 UTC (rev 71) @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry exported="true" kind="lib" path="lib/commons-logging.jar"> + <attributes> + <attribute name="javadoc_location" value="jar:platform:/resource/DAVInspector/lib/commons-logging-javadoc.jar!/"/> + </attributes> + </classpathentry> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="output" path="bin"/> +</classpath> Added: trunk/DAVInspector/.project =================================================================== --- trunk/DAVInspector/.project (rev 0) +++ trunk/DAVInspector/.project 2008-03-04 13:07:57 UTC (rev 71) @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>DAVInspector</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>com.atlassw.tools.eclipse.checkstyle.CheckstyleBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jem.workbench.JavaEMFNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + <nature>com.atlassw.tools.eclipse.checkstyle.CheckstyleNature</nature> + <nature>org.eclipse.jem.beaninfo.BeanInfoNature</nature> + </natures> +</projectDescription> Modified: trunk/DAVInspector/config.properties =================================================================== --- trunk/DAVInspector/config.properties 2008-03-04 10:20:48 UTC (rev 70) +++ trunk/DAVInspector/config.properties 2008-03-04 13:07:57 UTC (rev 71) @@ -1,4 +1,4 @@ -#Mon Feb 04 20:56:00 CET 2008 +#Tue Mar 04 09:35:50 CET 2008 ClientPort=9999 ServerPort=8080 ServerAddress=localhost Modified: trunk/DAVInspector/src/de/dlr/davinspector/relay/ChannelThread.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/relay/ChannelThread.java 2008-03-04 10:20:48 UTC (rev 70) +++ trunk/DAVInspector/src/de/dlr/davinspector/relay/ChannelThread.java 2008-03-04 13:07:57 UTC (rev 71) @@ -73,7 +73,7 @@ /** * */ - private boolean toClient = false; + private boolean myDirection; /** * The logger. @@ -124,22 +124,18 @@ try { InputStream in = myInputSocket.getInputStream(); -//# OutputStream out = outSock.getOutputStream(); try { count = in.read(buffer); while ((count != Constant.EOF) && !isInterrupted()) { -//# out.write(buf, 0, count); synchronized (myLock) { - myLock.updateData(new String(buffer, 0, count, "utf-8"), toClient); - myLock.notifyListeners(toClient); + // TODO: add encoding to configuration and set encoding from configuration + myLock.updateData(new String(buffer, 0, count, "utf-8"), myDirection); } count = in.read(buffer); } } catch (IOException ioe) { myLogger.error(myThreadName + COLON + ioe.getMessage(), ioe); } finally { - // The input and output streams will be closed when the sockets themselves are closed. -//# out.flush(); myLogger.info(myThreadName + COLON + "flushing"); flushOut(); } @@ -151,15 +147,14 @@ myDone = true; try { if ((myPeer == null) || myPeer.isDone()) { - // Cleanup if there is only one peer OR if _both_ peers are done + // if the peer is already closed or has transferred all data, shutdown myInputSocket.close(); myOutputSocket.close(); myLogger.info(myThreadName + COLON + "closing"); } else { - // Signal the peer (if any) that we're done on this side of the connection -// flushOut(); - myLogger.info(myThreadName + COLON + "interrupting peer"); + // signal the peer we are done myPeer.interrupt(); + myLogger.info(myThreadName + COLON + "interrupting peer"); } } catch (IOException ioe) { myLogger.error(myThreadName + COLON + ioe.getMessage(), ioe); @@ -175,10 +170,10 @@ * true = from server to client<br> * false = from client to server<br> * - * @param bToClient Boolean + * @param direction Boolean */ - public void setToClient(boolean bToClient) { - this.toClient = bToClient; + public void setDirection(boolean direction) { + this.myDirection = direction; } /** @@ -214,7 +209,7 @@ * * @param data String data to send. */ - public void writeOut(String data) { + public void write(String data) { try { OutputStream out = myOutputSocket.getOutputStream(); if (isChunked(data)) { @@ -258,7 +253,7 @@ * @return Boolean */ public Boolean getDirection() { - return toClient; + return myDirection; } /** @@ -269,6 +264,7 @@ */ private Boolean isChunked(String data) { // TODO: RFC 2616 14.39 TE / 14.41 Transfer-Encoding + // Output decorator!? Boolean result = false; if (data.contains("Transfer-Encoding: chunked")) { result = true; Modified: trunk/DAVInspector/src/de/dlr/davinspector/relay/IRelayModel.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/relay/IRelayModel.java 2008-03-04 10:20:48 UTC (rev 70) +++ trunk/DAVInspector/src/de/dlr/davinspector/relay/IRelayModel.java 2008-03-04 13:07:57 UTC (rev 71) @@ -25,8 +25,11 @@ package de.dlr.davinspector.relay; +import org.apache.commons.logging.Log; + import de.dlr.davinspector.configuration.Configuration; import de.dlr.davinspector.history.MessageHistory; +import de.dlr.davinspector.plugin.PluginManager; /** @@ -50,20 +53,19 @@ /** * This method writes data to the client. - * INFO: Maybe Message instead of a string!? * @param data String */ void writeToClient(String data); /** * This method writes data to the server. - * INFO: Maybe {@link Message} instead of a string!? * @param data String */ void writeToServer(String data); /** - * This method adds the data to the string buffer for server or client depending on the <code>toClient</code> parameter. + * This method notifies the listeners for server or client depending on the <code>toClient</code> + * parameter and uses the <code>data</code> to create a new {@link DataEvent}. * * @param data String * @param toClient Boolean @@ -71,19 +73,26 @@ void updateData(String data, Boolean toClient); /** - * This method calls the notify methods for server or client depending on the <code>toClient</code> parameter. + * Returns the MessageHistory object. * - * @param toClient Boolean + * @return {@link MessageHistory} */ - void notifyListeners(Boolean toClient); + MessageHistory getMessageHistory(); /** - * Returns the MessageHistory object. + * Returns the PluginManager. * - * @return {@link MessageHistory} + * @return {@link PluginManager} */ - MessageHistory getMessageHistory(); + PluginManager getPluginManager(); + /** + * Returns Log object from Apache Commons Logging. + * + * @return Log + */ + Log getSystemLog(); + /** * Adds an {@link IServerListener} to RelayModel. * Modified: trunk/DAVInspector/src/de/dlr/davinspector/relay/RelayModel.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/relay/RelayModel.java 2008-03-04 10:20:48 UTC (rev 70) +++ trunk/DAVInspector/src/de/dlr/davinspector/relay/RelayModel.java 2008-03-04 13:07:57 UTC (rev 71) @@ -42,7 +42,9 @@ import de.dlr.davinspector.common.Constant; import de.dlr.davinspector.configuration.Configuration; +import de.dlr.davinspector.configuration.PluginConfiguration; import de.dlr.davinspector.history.MessageHistory; +import de.dlr.davinspector.plugin.PluginManager; /** * Implementation of the relay interface. Provides the server socket @@ -85,21 +87,16 @@ private ServerSocket serverSocket; /** + * Plugin manager. + */ + private PluginManager myPluginManager = null; + + /** * The lock object is used for synchronizing the ChannelThreads. */ private Object lock = new Object(); /** - * Client side string buffer. - */ - private String clientBuffer; - - /** - * Server side string buffer. - */ - private String serverBuffer; - - /** * Contains all current connections (ChannelThreads). */ private List<ChannelThread> connections = new Vector<ChannelThread>(); @@ -107,24 +104,50 @@ /** * The message history object. */ - private MessageHistory messageHistory = null; + private MessageHistory myMessageHistory = null; /** * Constructor of RelayModel. * The constructor creates a new {@link MessageHistory} object. */ public RelayModel() { - messageHistory = new MessageHistory(this); + myMessageHistory = new MessageHistory(this); + myPluginManager = PluginManager.getInstance(); + // load available plugins + myPluginManager.loadAllPlugins(); + // load plugin configuration (if available) + PluginConfiguration pluginConfiguration = new PluginConfiguration(); + pluginConfiguration.loadConfiguration(); + myPluginManager.setActivePluginsClient(pluginConfiguration.getActivePluginsClient()); + myPluginManager.setActivePluginsServer(pluginConfiguration.getActivePluginsServer()); } /** * {@inheritDoc} * + * @see de.dlr.davinspector.relay.IRelayModel#getPluginManager() + */ + public PluginManager getPluginManager() { + return myPluginManager; + } + + /** + * {@inheritDoc} + * * @see de.dlr.davinspector.relay.IRelayModel#getMessageHistory() */ public MessageHistory getMessageHistory() { - return messageHistory; + return myMessageHistory; } + + /** + * {@inheritDoc} + * + * @see de.dlr.davinspector.relay.IRelayModel#getSystemLog() + */ + public Log getSystemLog() { + return myLogger; + } /** * {@inheritDoc} @@ -201,6 +224,7 @@ } else { serverSocket = new ServerSocket(configuration.getClientPort(), Constant.RELAY_BACKLOG, clientAddress); } + serverSocket.setReuseAddress(true); myDestinationAddress = serverAddress; myDestinationPort = configuration.getServerPort(); } catch (UnknownHostException uhe) { @@ -222,8 +246,6 @@ while (!isInterrupted()) { Socket serverSideSocket = serverSocket.accept(); try { - clientBuffer = ""; - serverBuffer = ""; serverSideSocket.setSoLinger(true, Constant.RELAY_LINGERTIME); Socket clientSideSocket = new Socket(myDestinationAddress, myDestinationPort); clientSideSocket.setSoLinger(true, Constant.RELAY_LINGERTIME); @@ -233,8 +255,8 @@ (IRelayModel) this, myLogger, connections); serverToClientChannel.setPeer(clientToServerChannel); clientToServerChannel.setPeer(serverToClientChannel); - serverToClientChannel.setToClient(true); - clientToServerChannel.setToClient(false); + serverToClientChannel.setDirection(true); + clientToServerChannel.setDirection(false); serverToClientChannel.setTName("ServerToClientThread"); clientToServerChannel.setTName("ClientToServerThread"); synchronized (lock) { @@ -292,16 +314,15 @@ } /** - * TODO: Enter comment! Not quite correct ... + * TODO: Not quite correct ... * - * * @param data String * @param toClient Boolean */ private void write(String data, Boolean toClient) { for (ChannelThread connection : connections) { if (connection.getDirection() != toClient) { - connection.writeOut(data); + connection.write(data); } } } @@ -332,22 +353,9 @@ */ public void updateData(String data, Boolean toClient) { if (toClient) { - clientBuffer += data; + notifyClientListeners(new DataEvent(this, data)); } else { - serverBuffer += data; + notifyServerListeners(new DataEvent(this, data)); } } - - /** - * {@inheritDoc} - * - * @see de.dlr.DAVInspector.Relay.IRelayModel#notifyListeners(java.lang.Boolean) - */ - public void notifyListeners(Boolean toClient) { - if (toClient) { - notifyClientListeners(new DataEvent(this, clientBuffer)); - } else { - notifyServerListeners(new DataEvent(this, serverBuffer)); - } - } } Modified: trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java 2008-03-04 10:20:48 UTC (rev 70) +++ trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java 2008-03-04 13:07:57 UTC (rev 71) @@ -517,8 +517,7 @@ myRelay.getMessageHistory().addNewMessageListener(this); myRelay.getMessageHistory().addRefreshMessageListener(this); - myPluginManager = PluginManager.getInstance(); - myPluginManager.loadAllPlugins(); + myPluginManager = myRelay.getPluginManager(); jFrame = getJFrame(); jFrame.pack(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kil...@us...> - 2008-03-04 10:21:20
|
Revision: 70 http://davinspector.svn.sourceforge.net/davinspector/?rev=70&view=rev Author: killerjoe Date: 2008-03-04 02:20:48 -0800 (Tue, 04 Mar 2008) Log Message: ----------- New Website template added. Added Paths: ----------- trunk/www/image/ trunk/www/image/optsbg.gif trunk/www/index.html trunk/www/style.css Added: trunk/www/image/optsbg.gif =================================================================== (Binary files differ) Property changes on: trunk/www/image/optsbg.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/www/index.html =================================================================== --- trunk/www/index.html (rev 0) +++ trunk/www/index.html 2008-03-04 10:20:48 UTC (rev 70) @@ -0,0 +1,72 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<title>DAVInspector Homepage</title> +<meta name="Description" content="" /> +<meta name="Keywords" content="" /> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> +<link rel="stylesheet" type="text/css" href="style.css" media="screen" /> +</head> +<body> +<div id="wrap"> + <div id="header"> + <h1><a href="#">DAVInspector</a></h1> + <h2>HTTP and WebDAV test- and debugging tool. </h2> + </div> + <div id="menu"> <a href="#">Home</a> <a href="#">About </a> <a href="#">Contact</a></div> + <div id="content"> + <h2><a href="#">Welcome!</a></h2> + <p class="meta">19.11.2006</p> + <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. + Integer a libero ac ante tempus interdum. Donec non purus. + Donec sed dolor. Suspendisse faucibus. Aenean a nisl non + ante nonummy hendrerit. Proin lacinia malesuada ipsum. + Donec magna. Quisque risus magna, consectetuer non, + suscipit sit amet, interdum ac, nibh. Nulla facilisi. + Nullam lobortis, mauris et vehicula scelerisque, + urna lectus faucibus diam, vel congue enim ligula ac + tortor. Suspendisse venenatis auctor tellus. Nunc arcu + elit, suscipit non, semper in, accumsan eget, felis. + Cras id sapien at felis vulputate ullamcorper...</p> + <p> </p> + <p><a href="#">Read on.</a></p> + <p> </p> + <h2><a href="#">Latest news</a></h2> + <p class="meta">19.11.2006</p> + <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. + Integer a libero ac ante tempus interdum. Donec non purus. + Donec sed dolor. Suspendisse faucibus. Aenean a nisl non + ante nonummy hendrerit. Proin lacinia malesuada ipsum. + Donec magna. Quisque risus magna, consectetuer non, + suscipit sit amet, interdum ac, nibh. Nulla facilisi. + Nullam lobortis, mauris et vehicula scelerisque, + urna lectus faucibus diam, vel congue enim ligula ac + tortor. Suspendisse venenatis auctor tellus. Nunc arcu + elit, suscipit non, semper in, accumsan eget, felis. + Cras id sapien at felis vulputate ullamcorper...</p> + <p> </p> + <p><a href="#">Read on.</a></p> + <p> </p> + <h2><a href="#">Latest news</a></h2> + <p class="meta">19.11.2006</p> + <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. + Integer a libero ac ante tempus interdum. Donec non purus. + Donec sed dolor. Suspendisse faucibus. Aenean a nisl non + ante nonummy hendrerit. Proin lacinia malesuada ipsum. + Donec magna. Quisque risus magna, consectetuer non, + suscipit sit amet, interdum ac, nibh. Nulla facilisi. + Nullam lobortis, mauris et vehicula scelerisque, + urna lectus faucibus diam, vel congue enim ligula ac + tortor. Suspendisse venenatis auctor tellus. Nunc arcu + elit, suscipit non, semper in, accumsan eget, felis. + Cras id sapien at felis vulputate ullamcorper...</p> + <p> </p> + <p><a href="#">Read on.</a></p> + </div> + + <div id="divider">» <a href="#">Links</a> » <a href="#">Links</a> » <a href="#">Links</a> » <a href="#">Links</a> » <a href="#">Links</a></div> + + <div id="footer">Open Source Design Template sponsored by <a href="http://www.cmgtechnologies.com/">CMG Technologies</a><a href="#"></a>. </div> +</div> +</body> +</html> Added: trunk/www/style.css =================================================================== --- trunk/www/style.css (rev 0) +++ trunk/www/style.css 2008-03-04 10:20:48 UTC (rev 70) @@ -0,0 +1,120 @@ +* { +padding: 0; +margin: 0; +} + +body { +font: .10em tahoma,verdana,sans-serif; +background-image: url(image/optsbg.gif); +background-repeat: repeat; +} + +a { +text-decoration: none; +color: #3B85CA; +} + +a:hover { +color: #000; +} + +#wrap +{ +margin: 20px auto; +width: 500px; +padding: 10px; +background-color: #fff; +} + + +#header +{ +height : 90px; +background-color : #A0DCF8; +text-align:center; +} + +#header h1 { padding-left: 10px; padding-top: 12px; font-size: 30px; color: #31799F; } +#header h1 a { font-size: 35px; color: #31799F; text-decoration: none;} +#header h2 { padding-left: 10px; padding-top: 0px; font-size: 17px; color: #fff; } + +#menu { +text-align: center; +margin-top: 10px; +font-size : 14px; +padding:2px; +font-weight: bold; +font-family:tahoma,verdana,sans-serif; +border: 0px solid #D8E3EE; +background: #F9FCFC; +} + +#menu a { +color : #3B85CA; +text-decoration : none; +padding: 10px; +} + +#menu a:hover { +color : #000; +} + + +#content { +text-align: left; +margin-top: 5px; +padding: 13px; +font-size: 11px; +} + +#content h2 { +font-size: 17px; color : #444; +padding: 0 0 5px 0; +} + +#footer { +margin-top: 25px; +clear: both; +text-align: center; +color: #fff; +font-size:11px; +background-color:#A0DCF8; +padding:2px; +} + +.meta { +padding-bottom:2px; +font-size: 12px; +color:#999999; +font:Arial, Helvetica, sans-serif; +} + +#bottom { + font-size:13px; + padding: 10px 0 0 0; +} + +#bottomleft { +width:45%; +float:left; +background:#fff; +padding-bottom:10px; +padding-left:5px; +} + + +#bottomright { +width:45%; +float:right; +background:#fff; +padding-bottom:10px; +padding-right:5px; +} + +#divider { +text-align: center; +font-size : 13px; +padding:2px; +font-weight: bold; +font-family:Arial, Helvetica, sans-serif; +} Property changes on: trunk/www/style.css ___________________________________________________________________ Name: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kil...@us...> - 2008-03-04 10:02:03
|
Revision: 69 http://davinspector.svn.sourceforge.net/davinspector/?rev=69&view=rev Author: killerjoe Date: 2008-03-04 02:01:23 -0800 (Tue, 04 Mar 2008) Log Message: ----------- Removed old www-content. Removed Paths: ------------- trunk/www/andreas07.css trunk/www/fix.css trunk/www/img/ trunk/www/index.html Deleted: trunk/www/andreas07.css =================================================================== --- trunk/www/andreas07.css 2008-03-03 22:26:32 UTC (rev 68) +++ trunk/www/andreas07.css 2008-03-04 10:01:23 UTC (rev 69) @@ -1,83 +0,0 @@ -/* andreas07 - an open source xhtml/css website layout by Andreas Viklund - http://andreasviklund.com . Free to use for any purpose as long as the proper credits are given for the original design work. - -Version: 1.1, November 28, 2005 */ - -/**************** Page and tag styles ****************/ - -body -{margin:0; padding:0; color:#222; background:#047 url(img/bodybg.gif) top left repeat-y; font:76% Verdana,Tahoma,sans-serif;} - -ul -{list-style:circle; margin:15px 0 20px 0; font-size:0.9em;} - -li -{margin:0 0 8px 25px;} - -a -{color:#d85d5d; font-weight:bold; text-decoration:none;} - -a:hover -{color:#505050; text-decoration:underline;} - -img -{float:left; margin:0 15px 15px 0; padding:1px; background:#ffffff; border:1px solid #d0d0d0;} - -a img -{border-color:#d85d5d;} - -a img:hover -{background:#d85d5d; border-color:#d85d5d;} - -/**************** Sidebar area styles ****************/ - -#sidebar -{position:absolute; top:0; left:0; width:220px; height:100%; overflow:auto; background:#e0e0e0 url(img/sidebarbg.gif) top right repeat-y; text-align:right;} - -body > #sidebar -{position:fixed;} - -#sidebar h1 -{margin:20px 18px 0 5px; color:#d85d5d; font-size:1.6em; letter-spacing:-2px; text-align:right;} - -#sidebar h2, #sidebar h3 -{margin:0 20px 18px 5px; color:#808080; font-size:1.1em; font-weight:bold; letter-spacing:-1px; text-align:right;} - -#sidebar h3 -{margin:20px 18px 4px 5px; color:#606060;} - -#sidebar p -{margin:0 20px 18px 5px; color:#606060; font-size:0.8em;} - -#sidebar a -{color:#808080} - -/**************** Navigation menu styles ****************/ - -#menu a -{display:block; width:202px; padding:5px 18px 5px 0; color:#606060; background:#e0e0e0 url(img/sidebarbg.gif) top right repeat-y; font-size:1.8em; font-weight:normal; text-decoration:none; letter-spacing:-2px;} - -#menu a:hover -{color:#303030; background:#f0f0f0 url(img/sidebarbg.gif) top right repeat-y;} - -#menu a.active -{padding:5px 18px 5px 0; background:#fafafa; border-top:2px solid #c0c0c0; border-bottom:2px solid #c0c0c0;} - -#menu a.active:hover -{color:#505050; background:#fafafa;} - -/**************** Content area styles ****************/ - -#content -{width:520px; margin:0 0 0 240px; padding:20px 0; background:#fafafa;} - -#content p -{margin:0 0 20px 0; line-height:1.5em;} - -#content h1 -{margin:0; color:#d85d5d; font-size:4em; letter-spacing:-5px; text-align:center;} - -#content h2 -{margin:0; color:#808080; font-weight:normal; font-size:2.5em; letter-spacing:-2px; text-align:center;} - -#content h3 -{clear:both; margin:30px 0 10px 0; color:#d85d5d; font-weight:normal; font-size: 2em; letter-spacing:-2px;} \ No newline at end of file Deleted: trunk/www/fix.css =================================================================== --- trunk/www/fix.css 2008-03-03 22:26:32 UTC (rev 68) +++ trunk/www/fix.css 2008-03-04 10:01:23 UTC (rev 69) @@ -1,7 +0,0 @@ -/**************** IE fixes ****************/ - -html -{overflow:hidden;} - -body -{height:100%; width:100%; overflow:auto;} \ No newline at end of file Deleted: trunk/www/index.html =================================================================== --- trunk/www/index.html 2008-03-03 22:26:32 UTC (rev 68) +++ trunk/www/index.html 2008-03-04 10:01:23 UTC (rev 69) @@ -1,55 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" -"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> -<head> -<title>DAVInspector: HTTP and WebDAV test- and debugging tool</title> -<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> -<meta name="description" content="description goes here" /> -<meta name="keywords" content="keywords,goes,here" /> -<link rel="stylesheet" href="andreas07.css" type="text/css" /> -<!--[if IE 6]> -<link rel="stylesheet" href="fix.css" type="text/css" /> -<![endif]--> -</head> - -<body> -<div id="sidebar"> -<h1>your website title</h1> -<h2>place for your slogan</h2> - -<div id="menu"> -<a href="index.html">Home</a> -<a class="active" href="#">Current page</a> -<a href="#">Another</a> -<a href="#">Example</a> -<a href="#">Showcase</a> -<a href="#">Links</a> -<a href="#">Contact</a> -</div> - -</div> - -<div id="content"> -<h1>DAVInspector</h1> -<h2>HTTP and WebDAV test- and debugging tool</h2> - -<h3>Welcome!</h3> -<p>Fill this with text!</p> - -<p>Fill this with text!!</p> - - -<h3>Latest news</h3> -<p>Fill this with text! - -<h3>Download</h3> -<p>Fill this with text!</p> - - - -<h3>site info</h3> -<p>© 2007-2008 <a href="http://www.dlr.de/sc">Deutsches Zentrum für Luft- und Raumfahrt e.V. (DLR)</a>. -<br >Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0.</a><br /> Design by <a href="http://andreasviklund.com">Andreas Viklund</a> .</p> -</div> -</body> -</html> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kil...@us...> - 2008-03-03 22:26:46
|
Revision: 68 http://davinspector.svn.sourceforge.net/davinspector/?rev=68&view=rev Author: killerjoe Date: 2008-03-03 14:26:32 -0800 (Mon, 03 Mar 2008) Log Message: ----------- Minor css changes. Modified Paths: -------------- trunk/www/andreas07.css trunk/www/index.html Modified: trunk/www/andreas07.css =================================================================== --- trunk/www/andreas07.css 2008-03-03 22:17:39 UTC (rev 67) +++ trunk/www/andreas07.css 2008-03-03 22:26:32 UTC (rev 68) @@ -5,7 +5,7 @@ /**************** Page and tag styles ****************/ body -{margin:0; padding:0; color:#303030; background:#fafafa url(img/bodybg.gif) top left repeat-y; font:76% Verdana,Tahoma,sans-serif;} +{margin:0; padding:0; color:#222; background:#047 url(img/bodybg.gif) top left repeat-y; font:76% Verdana,Tahoma,sans-serif;} ul {list-style:circle; margin:15px 0 20px 0; font-size:0.9em;} @@ -31,10 +31,10 @@ /**************** Sidebar area styles ****************/ #sidebar -{position:absolute; top:0; left:0; width:220px; height:100%; overflow:auto; background:#e0e0e0 url(img/sidebarbg.gif) top right repeat-y; text-align:right;} +{position:absolute; top:0; left:0; width:220px; height:100%; overflow:auto; background:#e0e0e0 url(img/sidebarbg.gif) top right repeat-y; text-align:right;} body > #sidebar -{position:fixed;} +{position:fixed;} #sidebar h1 {margin:20px 18px 0 5px; color:#d85d5d; font-size:1.6em; letter-spacing:-2px; text-align:right;} @@ -54,13 +54,13 @@ /**************** Navigation menu styles ****************/ #menu a -{display:block; width:202px; padding:5px 18px 5px 0; color:#606060; background:#e0e0e0 url(img/sidebarbg.gif) top right repeat-y; font-size:1.8em; font-weight:normal; text-decoration:none; letter-spacing:-2px;} +{display:block; width:202px; padding:5px 18px 5px 0; color:#606060; background:#e0e0e0 url(img/sidebarbg.gif) top right repeat-y; font-size:1.8em; font-weight:normal; text-decoration:none; letter-spacing:-2px;} #menu a:hover -{color:#303030; background:#f0f0f0 url(img/sidebarbg.gif) top right repeat-y;} +{color:#303030; background:#f0f0f0 url(img/sidebarbg.gif) top right repeat-y;} #menu a.active -{padding:5px 18px 5px 0; background:#fafafa; border-top:2px solid #c0c0c0; border-bottom:2px solid #c0c0c0;} +{padding:5px 18px 5px 0; background:#fafafa; border-top:2px solid #c0c0c0; border-bottom:2px solid #c0c0c0;} #menu a.active:hover {color:#505050; background:#fafafa;} Modified: trunk/www/index.html =================================================================== --- trunk/www/index.html 2008-03-03 22:17:39 UTC (rev 67) +++ trunk/www/index.html 2008-03-03 22:26:32 UTC (rev 68) @@ -48,7 +48,7 @@ <h3>site info</h3> -<p>© 2006 <a href="http://www.dlr.de/sc">Deutsches Zentrum für Luft- und Raumfahrt e.V. (DLR)</a>. +<p>© 2007-2008 <a href="http://www.dlr.de/sc">Deutsches Zentrum für Luft- und Raumfahrt e.V. (DLR)</a>. <br >Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0.</a><br /> Design by <a href="http://andreasviklund.com">Andreas Viklund</a> .</p> </div> </body> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kil...@us...> - 2008-03-03 22:17:42
|
Revision: 67 http://davinspector.svn.sourceforge.net/davinspector/?rev=67&view=rev Author: killerjoe Date: 2008-03-03 14:17:39 -0800 (Mon, 03 Mar 2008) Log Message: ----------- Added missing icon. Added Paths: ----------- trunk/www/img/bodybg.gif Added: trunk/www/img/bodybg.gif =================================================================== (Binary files differ) Property changes on: trunk/www/img/bodybg.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kil...@us...> - 2008-03-03 22:17:24
|
Revision: 66 http://davinspector.svn.sourceforge.net/davinspector/?rev=66&view=rev Author: killerjoe Date: 2008-03-03 14:17:12 -0800 (Mon, 03 Mar 2008) Log Message: ----------- Skeleton of the page created. Modified Paths: -------------- trunk/www/index.html Added Paths: ----------- trunk/www/img/inspector32.png trunk/www/img/logo_dlr.gif Removed Paths: ------------- trunk/www/img/bodybg.gif trunk/www/img/example-small.png trunk/www/img/example.jpg Deleted: trunk/www/img/bodybg.gif =================================================================== (Binary files differ) Deleted: trunk/www/img/example-small.png =================================================================== (Binary files differ) Deleted: trunk/www/img/example.jpg =================================================================== (Binary files differ) Added: trunk/www/img/inspector32.png =================================================================== (Binary files differ) Property changes on: trunk/www/img/inspector32.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/www/img/logo_dlr.gif =================================================================== (Binary files differ) Property changes on: trunk/www/img/logo_dlr.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/www/index.html =================================================================== --- trunk/www/index.html 2008-03-03 21:30:42 UTC (rev 65) +++ trunk/www/index.html 2008-03-03 22:17:12 UTC (rev 66) @@ -2,7 +2,7 @@ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> -<title>andreas07: the simple solution template</title> +<title>DAVInspector: HTTP and WebDAV test- and debugging tool</title> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> <meta name="description" content="description goes here" /> <meta name="keywords" content="keywords,goes,here" /> @@ -27,46 +27,29 @@ <a href="#">Contact</a> </div> -<h3>Version info:</h3> -<p>v1.1 (Nov 28, 2005)</p> </div> <div id="content"> -<h1>andreas07</h1> -<h2>The Simple Solution</h2> +<h1>DAVInspector</h1> +<h2>HTTP and WebDAV test- and debugging tool</h2> -<h3>Andreas presents: 07!</h3> -<p>Hello and thank you for your interest in this template! Before you jump to any conclusions about it, please me explain the idea behind it.</p> +<h3>Welcome!</h3> +<p>Fill this with text!</p> -<img src="img/example.jpg" width="512" height="160" alt="image example" /> -<p>First of all, this design was made by request from a friend who holding html/css classes for beginners. He asked me to create a design that was "so simple that even [his] grandmother would be able to use it", that he could use as an example in his classes. I couldn't resist a challenge like that!</p> +<p>Fill this with text!!</p> -<a href="#"><img src="img/example-small.png" width="128" height="128" alt="image link example" /></a> -<p>There were some specific requests for the design, to make sure that it would work with the way my friend teaches. The content had to be separated from the presentation, and every part of the design had to be made in way that would be easy to understand - and learn from. No advanced tricks, and minimal use of IDs or .classes in the stylesheet. A fixed position site menu and some neutral images was also asked for.</p> -<h3>so, how did I do it?</h3> -<p>The easiest way to see my approach on the challenge is to view the code. Download the template and play with it for a while, and you will hopefully see that this every part of the template is created in an easy and effective way. For those of you who want some more information, I will try to explain how this design was built. Here are some short facts:</p> -<ul> -<li>The content is fully separated from the presentation. No inline styling has been used.</li> -<li>Valid XHTML 1.1 and CSS2. Section 508 OK and AA-rated with the WCAG 1.0.</li> -<li>Number of .classes: 0. Number of #id's: 3 (#sidebar, #menu and #content).</li> -<li>Number of styled tags: 10 (html, body, ul, li, a, img, h1, h2, h3 and p).</li> -<li>Two small images (total size: 142 bytes) have been used to improve the design, but the template works just as good without them.</li> -<li>Two content image examples (total size: 9.2 kb) have also been included.</li> -<li>The sidebar has fixed positioning to keep it in place when the rest of page scrolls.</li> -</ul> +<h3>Latest news</h3> +<p>Fill this with text! -<h3>and a few notes:</h3> -<p>The example images are all made by myself using one of my own photos, and you have my full permission to use those images in any way you want to. However, I recommend that you replace them with something of your own. The photo shows a violet flower, by the way...</p> -<p>To make the fixed positioning of the sidebar work with Internet Explorer, a conditional comment and an extra CSS file has been used. I would normally not do that, but the fixed sidebar was requested and I don't know about any better way to make it work without adding scripts (which is not an option). If you know any better way, please let me know!</p> +<h3>Download</h3> +<p>Fill this with text!</p> -<h3>open source web design</h3> -<p>This template is released as an open source web design, which means that you are free to use it in any way you want to - and edit it in any way you want to. I kindly ask that you leave the "Designed by Andreas Viklund" text in the footer, because that would be a nice gesture to me - and I would appreciate it very much. But there are no obligations so if you really want to remove it - just do it.</p> -<p>However, if you remove the credits and use this design for commercial purposes, please consider making a symbolic donation through the PayPal link on my <a href="http://andreasviklund.com">website</a>. And feel free to send me an e-mail with a link to the site where you have used the design, it is both fun and inspiring to see how my work is used and what changes have been made...</p> -<p><strong>Good luck with your new website!</strong></p> + <h3>site info</h3> -<p>© 2005-2006 Your Name. Design by <a href="http://andreasviklund.com">Andreas Viklund</a> | <a href="http://www.xnavigation.net/" title="xNavigation gratis download - La risorsa italiana sul software">xNavigation software</a>.</p> +<p>© 2006 <a href="http://www.dlr.de/sc">Deutsches Zentrum für Luft- und Raumfahrt e.V. (DLR)</a>. +<br >Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0.</a><br /> Design by <a href="http://andreasviklund.com">Andreas Viklund</a> .</p> </div> </body> </html> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kil...@us...> - 2008-03-03 21:30:48
|
Revision: 65 http://davinspector.svn.sourceforge.net/davinspector/?rev=65&view=rev Author: killerjoe Date: 2008-03-03 13:30:42 -0800 (Mon, 03 Mar 2008) Log Message: ----------- Initial commit of the homepage-template. Added Paths: ----------- trunk/www/ trunk/www/andreas07.css trunk/www/fix.css trunk/www/img/ trunk/www/img/bodybg.gif trunk/www/img/example-small.png trunk/www/img/example.jpg trunk/www/img/sidebarbg.gif trunk/www/index.html Added: trunk/www/andreas07.css =================================================================== --- trunk/www/andreas07.css (rev 0) +++ trunk/www/andreas07.css 2008-03-03 21:30:42 UTC (rev 65) @@ -0,0 +1,83 @@ +/* andreas07 - an open source xhtml/css website layout by Andreas Viklund - http://andreasviklund.com . Free to use for any purpose as long as the proper credits are given for the original design work. + +Version: 1.1, November 28, 2005 */ + +/**************** Page and tag styles ****************/ + +body +{margin:0; padding:0; color:#303030; background:#fafafa url(img/bodybg.gif) top left repeat-y; font:76% Verdana,Tahoma,sans-serif;} + +ul +{list-style:circle; margin:15px 0 20px 0; font-size:0.9em;} + +li +{margin:0 0 8px 25px;} + +a +{color:#d85d5d; font-weight:bold; text-decoration:none;} + +a:hover +{color:#505050; text-decoration:underline;} + +img +{float:left; margin:0 15px 15px 0; padding:1px; background:#ffffff; border:1px solid #d0d0d0;} + +a img +{border-color:#d85d5d;} + +a img:hover +{background:#d85d5d; border-color:#d85d5d;} + +/**************** Sidebar area styles ****************/ + +#sidebar +{position:absolute; top:0; left:0; width:220px; height:100%; overflow:auto; background:#e0e0e0 url(img/sidebarbg.gif) top right repeat-y; text-align:right;} + +body > #sidebar +{position:fixed;} + +#sidebar h1 +{margin:20px 18px 0 5px; color:#d85d5d; font-size:1.6em; letter-spacing:-2px; text-align:right;} + +#sidebar h2, #sidebar h3 +{margin:0 20px 18px 5px; color:#808080; font-size:1.1em; font-weight:bold; letter-spacing:-1px; text-align:right;} + +#sidebar h3 +{margin:20px 18px 4px 5px; color:#606060;} + +#sidebar p +{margin:0 20px 18px 5px; color:#606060; font-size:0.8em;} + +#sidebar a +{color:#808080} + +/**************** Navigation menu styles ****************/ + +#menu a +{display:block; width:202px; padding:5px 18px 5px 0; color:#606060; background:#e0e0e0 url(img/sidebarbg.gif) top right repeat-y; font-size:1.8em; font-weight:normal; text-decoration:none; letter-spacing:-2px;} + +#menu a:hover +{color:#303030; background:#f0f0f0 url(img/sidebarbg.gif) top right repeat-y;} + +#menu a.active +{padding:5px 18px 5px 0; background:#fafafa; border-top:2px solid #c0c0c0; border-bottom:2px solid #c0c0c0;} + +#menu a.active:hover +{color:#505050; background:#fafafa;} + +/**************** Content area styles ****************/ + +#content +{width:520px; margin:0 0 0 240px; padding:20px 0; background:#fafafa;} + +#content p +{margin:0 0 20px 0; line-height:1.5em;} + +#content h1 +{margin:0; color:#d85d5d; font-size:4em; letter-spacing:-5px; text-align:center;} + +#content h2 +{margin:0; color:#808080; font-weight:normal; font-size:2.5em; letter-spacing:-2px; text-align:center;} + +#content h3 +{clear:both; margin:30px 0 10px 0; color:#d85d5d; font-weight:normal; font-size: 2em; letter-spacing:-2px;} \ No newline at end of file Added: trunk/www/fix.css =================================================================== --- trunk/www/fix.css (rev 0) +++ trunk/www/fix.css 2008-03-03 21:30:42 UTC (rev 65) @@ -0,0 +1,7 @@ +/**************** IE fixes ****************/ + +html +{overflow:hidden;} + +body +{height:100%; width:100%; overflow:auto;} \ No newline at end of file Added: trunk/www/img/bodybg.gif =================================================================== (Binary files differ) Property changes on: trunk/www/img/bodybg.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/www/img/example-small.png =================================================================== (Binary files differ) Property changes on: trunk/www/img/example-small.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/www/img/example.jpg =================================================================== (Binary files differ) Property changes on: trunk/www/img/example.jpg ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/www/img/sidebarbg.gif =================================================================== (Binary files differ) Property changes on: trunk/www/img/sidebarbg.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/www/index.html =================================================================== --- trunk/www/index.html (rev 0) +++ trunk/www/index.html 2008-03-03 21:30:42 UTC (rev 65) @@ -0,0 +1,72 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" +"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> +<head> +<title>andreas07: the simple solution template</title> +<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> +<meta name="description" content="description goes here" /> +<meta name="keywords" content="keywords,goes,here" /> +<link rel="stylesheet" href="andreas07.css" type="text/css" /> +<!--[if IE 6]> +<link rel="stylesheet" href="fix.css" type="text/css" /> +<![endif]--> +</head> + +<body> +<div id="sidebar"> +<h1>your website title</h1> +<h2>place for your slogan</h2> + +<div id="menu"> +<a href="index.html">Home</a> +<a class="active" href="#">Current page</a> +<a href="#">Another</a> +<a href="#">Example</a> +<a href="#">Showcase</a> +<a href="#">Links</a> +<a href="#">Contact</a> +</div> + +<h3>Version info:</h3> +<p>v1.1 (Nov 28, 2005)</p> +</div> + +<div id="content"> +<h1>andreas07</h1> +<h2>The Simple Solution</h2> + +<h3>Andreas presents: 07!</h3> +<p>Hello and thank you for your interest in this template! Before you jump to any conclusions about it, please me explain the idea behind it.</p> + +<img src="img/example.jpg" width="512" height="160" alt="image example" /> +<p>First of all, this design was made by request from a friend who holding html/css classes for beginners. He asked me to create a design that was "so simple that even [his] grandmother would be able to use it", that he could use as an example in his classes. I couldn't resist a challenge like that!</p> + +<a href="#"><img src="img/example-small.png" width="128" height="128" alt="image link example" /></a> +<p>There were some specific requests for the design, to make sure that it would work with the way my friend teaches. The content had to be separated from the presentation, and every part of the design had to be made in way that would be easy to understand - and learn from. No advanced tricks, and minimal use of IDs or .classes in the stylesheet. A fixed position site menu and some neutral images was also asked for.</p> + +<h3>so, how did I do it?</h3> +<p>The easiest way to see my approach on the challenge is to view the code. Download the template and play with it for a while, and you will hopefully see that this every part of the template is created in an easy and effective way. For those of you who want some more information, I will try to explain how this design was built. Here are some short facts:</p> +<ul> +<li>The content is fully separated from the presentation. No inline styling has been used.</li> +<li>Valid XHTML 1.1 and CSS2. Section 508 OK and AA-rated with the WCAG 1.0.</li> +<li>Number of .classes: 0. Number of #id's: 3 (#sidebar, #menu and #content).</li> +<li>Number of styled tags: 10 (html, body, ul, li, a, img, h1, h2, h3 and p).</li> +<li>Two small images (total size: 142 bytes) have been used to improve the design, but the template works just as good without them.</li> +<li>Two content image examples (total size: 9.2 kb) have also been included.</li> +<li>The sidebar has fixed positioning to keep it in place when the rest of page scrolls.</li> +</ul> + +<h3>and a few notes:</h3> +<p>The example images are all made by myself using one of my own photos, and you have my full permission to use those images in any way you want to. However, I recommend that you replace them with something of your own. The photo shows a violet flower, by the way...</p> +<p>To make the fixed positioning of the sidebar work with Internet Explorer, a conditional comment and an extra CSS file has been used. I would normally not do that, but the fixed sidebar was requested and I don't know about any better way to make it work without adding scripts (which is not an option). If you know any better way, please let me know!</p> + +<h3>open source web design</h3> +<p>This template is released as an open source web design, which means that you are free to use it in any way you want to - and edit it in any way you want to. I kindly ask that you leave the "Designed by Andreas Viklund" text in the footer, because that would be a nice gesture to me - and I would appreciate it very much. But there are no obligations so if you really want to remove it - just do it.</p> +<p>However, if you remove the credits and use this design for commercial purposes, please consider making a symbolic donation through the PayPal link on my <a href="http://andreasviklund.com">website</a>. And feel free to send me an e-mail with a link to the site where you have used the design, it is both fun and inspiring to see how my work is used and what changes have been made...</p> +<p><strong>Good luck with your new website!</strong></p> + +<h3>site info</h3> +<p>© 2005-2006 Your Name. Design by <a href="http://andreasviklund.com">Andreas Viklund</a> | <a href="http://www.xnavigation.net/" title="xNavigation gratis download - La risorsa italiana sul software">xNavigation software</a>.</p> +</div> +</body> +</html> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wu...@us...> - 2008-02-29 16:16:03
|
Revision: 64 http://davinspector.svn.sourceforge.net/davinspector/?rev=64&view=rev Author: wuest Date: 2008-02-29 08:15:31 -0800 (Fri, 29 Feb 2008) Log Message: ----------- Added Apache Commons Logging. Restructured message processing. Modified Paths: -------------- trunk/DAVInspector/DAVInspector.bat trunk/DAVInspector/build-user.xml trunk/DAVInspector/src/de/dlr/davinspector/common/Constant.java trunk/DAVInspector/src/de/dlr/davinspector/configuration/PluginConfiguration.java trunk/DAVInspector/src/de/dlr/davinspector/history/HistoryTableCellRenderer.java trunk/DAVInspector/src/de/dlr/davinspector/history/HistoryTableModel.java trunk/DAVInspector/src/de/dlr/davinspector/history/Message.java trunk/DAVInspector/src/de/dlr/davinspector/history/MessageEvent.java trunk/DAVInspector/src/de/dlr/davinspector/history/MessageHistory.java trunk/DAVInspector/src/de/dlr/davinspector/plugin/IEditPlugin.java trunk/DAVInspector/src/de/dlr/davinspector/plugin/IPlugin.java trunk/DAVInspector/src/de/dlr/davinspector/plugin/PluginManager.java trunk/DAVInspector/src/de/dlr/davinspector/plugins/headerplugin/HeaderPlugin.java trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/XMLPlugin.java trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmltreeplugin/XMLTreePlugin.java trunk/DAVInspector/src/de/dlr/davinspector/relay/ChannelThread.java trunk/DAVInspector/src/de/dlr/davinspector/relay/IRelayModel.java trunk/DAVInspector/src/de/dlr/davinspector/relay/RelayModel.java trunk/DAVInspector/src/de/dlr/davinspector/ui/AboutDialog.java trunk/DAVInspector/src/de/dlr/davinspector/ui/ConfigurationDialog.java trunk/DAVInspector/src/de/dlr/davinspector/ui/MainController.java trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java Added Paths: ----------- trunk/DAVInspector/lib/ trunk/DAVInspector/lib/commons-logging.jar trunk/DAVInspector/logging.properties trunk/DAVInspector/plugin-config.properties trunk/DAVInspector/src/de/dlr/davinspector/history/AMessage.java trunk/DAVInspector/src/de/dlr/davinspector/history/AMessageParser.java trunk/DAVInspector/src/de/dlr/davinspector/http/HTTPMessageParser.java Removed Paths: ------------- trunk/DAVInspector/src/de/dlr/davinspector/http/HTTPMessage.java Modified: trunk/DAVInspector/DAVInspector.bat =================================================================== --- trunk/DAVInspector/DAVInspector.bat 2008-02-26 21:46:46 UTC (rev 63) +++ trunk/DAVInspector/DAVInspector.bat 2008-02-29 16:15:31 UTC (rev 64) @@ -1,3 +1,3 @@ @echo off -java -jar DAVInspector.jar +java -jar DAVInspector.jar -D java.util.logging.config.file=C:/Programme/DAVInspector/logging.properties Modified: trunk/DAVInspector/build-user.xml =================================================================== --- trunk/DAVInspector/build-user.xml 2008-02-26 21:46:46 UTC (rev 63) +++ trunk/DAVInspector/build-user.xml 2008-02-29 16:15:31 UTC (rev 64) @@ -1,6 +1,9 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> <?eclipse.ant.import?> <project> + <property name="project.name" value="DAVInspector"/> + <property name="project.version" value="0.1"/> + <target name="dist" description="Generates distribution in subdirectory dist"> <!-- Handle OS-specific properties --> <condition property="isWindows"> @@ -14,12 +17,12 @@ <target name="linux" if="isUnix"> <!-- Change to desired location --> - <property name="dist" location="/tmp/DAVInspector" /> + <property name="dist" location="/tmp/${project.name}" /> </target> <target name="win32" if="isWindows"> <!-- Change to desired location --> - <property name="dist" location="C:/Programme/DAVInspector" /> + <property name="dist" location="C:/Programme/${project.name}" /> </target> <target name="os-independent" depends="linux,win32"> @@ -31,7 +34,7 @@ <mkdir dir="${dist}" /> <mkdir dir="${dist}/plugins" /> <mkdir dir="${dist}/lib" /> - <mkdir dir="${dist}/doc" /> + <mkdir dir="${dist}/log" /> <!-- Create plugin jar files --> <jar jarfile="${dist}/plugins/HeaderPlugin.jar" @@ -60,22 +63,28 @@ <manifest> <attribute name="Main-Class" value="de/dlr/davinspector.DAVInspector"/> <attribute name="Built-By" value="${user.name}"/> + <attribute name="Class-Path" value=". lib/commons-logging.jar logging.properties"/> + <section name="DAVInspector"> - <attribute name="Specification-Title" value="DAVInspector"/> + <attribute name="Specification-Title" value="${project.name}"/> <attribute name="Specification-Version" value="${java.specification.version}"/> <attribute name="Specification-Vendor" value="DLR"/> - <attribute name="Implementation-Title" value="DAVInspector"/> + <attribute name="Implementation-Title" value="${project.name}"/> <attribute name="Implementation-Version" value="${java.version}"/> - <attribute name="Implementation-Vendor" value="DLR"/> + <attribute name="Implementation-Vendor" value="DLR"/> </section> </manifest> </jar> <!-- Copy script files and icon --> <copy todir="${dist}"> - <fileset dir="." includes="*.bat, *.sh, config.properties" /> + <fileset dir="." includes="*.bat, *.sh, *.properties" /> <fileset dir="resource" includes="*.ico" /> </copy> + <!-- Copy libs --> + <copy todir="${dist}/lib"> + <fileset dir="lib" includes="*.jar" /> + </copy> </target> </project> \ No newline at end of file Added: trunk/DAVInspector/lib/commons-logging.jar =================================================================== (Binary files differ) Property changes on: trunk/DAVInspector/lib/commons-logging.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/DAVInspector/logging.properties =================================================================== --- trunk/DAVInspector/logging.properties (rev 0) +++ trunk/DAVInspector/logging.properties 2008-02-29 16:15:31 UTC (rev 64) @@ -0,0 +1,8 @@ +# Add a FileHandler +handlers=java.util.logging.FileHandler +# Default global logging level. +.level = ALL +# Describes specific configuration info for the Handlers. +java.util.logging.FileHandler.pattern = log/relay.log +java.util.logging.FileHandler.limit = 50000 +java.util.logging.FileHandler.count = 1 Added: trunk/DAVInspector/plugin-config.properties =================================================================== --- trunk/DAVInspector/plugin-config.properties (rev 0) +++ trunk/DAVInspector/plugin-config.properties 2008-02-29 16:15:31 UTC (rev 64) @@ -0,0 +1,3 @@ +#Fri Feb 29 14:08:56 CET 2008 +PluginsServer= +PluginsClient= Modified: trunk/DAVInspector/src/de/dlr/davinspector/common/Constant.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/common/Constant.java 2008-02-26 21:46:46 UTC (rev 63) +++ trunk/DAVInspector/src/de/dlr/davinspector/common/Constant.java 2008-02-29 16:15:31 UTC (rev 64) @@ -74,7 +74,7 @@ /** * About dialog height. */ - public static final int UI_ABOUT_DIALOG_HEIGTH = 235; + public static final int UI_ABOUT_DIALOG_HEIGTH = 275; /** * Backgroundcolor of replies. Modified: trunk/DAVInspector/src/de/dlr/davinspector/configuration/PluginConfiguration.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/configuration/PluginConfiguration.java 2008-02-26 21:46:46 UTC (rev 63) +++ trunk/DAVInspector/src/de/dlr/davinspector/configuration/PluginConfiguration.java 2008-02-29 16:15:31 UTC (rev 64) @@ -46,7 +46,7 @@ /** * Symbol used for separating the plugin names. */ - private final static String DELIMITER = ","; + private static final String DELIMITER = ","; /** * Added: trunk/DAVInspector/src/de/dlr/davinspector/history/AMessage.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/history/AMessage.java (rev 0) +++ trunk/DAVInspector/src/de/dlr/davinspector/history/AMessage.java 2008-02-29 16:15:31 UTC (rev 64) @@ -0,0 +1,217 @@ +/* + * AMessage.java + * + * TODO: wues_ha Enter comment! + * + * Created: 29.02.2008 wues_ha <email> + * Changed: + * + * $Id$ + * + * Copyright 2007 Deutsches Zentrum fuer Luft- und Raumfahrt e.V. (DLR) + * + * Licensed 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 de.dlr.davinspector.history; + +import java.util.Date; + + +/** + * TODO: wues_ha: Enter comment! + * + * @version $LastChangedRevision$ + * @author Jochen Wuest + */ +public abstract class AMessage { + + /** + * + */ + protected static int idCounter; + + /** + * Message type indicates the direction of the message: + * <ul> + * <li>Message from client to server: Request.</li> + * <li>Message from server to client: Response.</li> + * </ul> + * + * @version $LastChangedRevision$ + * @author Jochen Wuest + */ + public enum MessageDirection { + /** + * + */ + Request, + /** + * + */ + Response + } + + /** + * Unique ID of a message. + */ + private int myID; + + /** + * Timestamp of the current message. + */ + private Date myTimestamp; + + /** + * myDirection indicates the direction of the message. + * @see MessageDirection + */ + private MessageDirection myDirection; + + /** + * This string contains the raw data of the message. + */ + private String myRawData; + + /** + * + */ + private String myMessageHeader; + + /** + * + */ + private String myMessageBody; + + /** + * The size in bytes of the current message. + */ + private int mySize; + + /** + * This method returns the ID of the message. + * + * @return id + */ + public int getId() { + return myID; + } + + /** + * This method returns the timestamp of the message. + * + * @return timestamp + */ + public Date getTimestamp() { + return myTimestamp; + } + + /** + * This method sets the timestamp of the current message. + * + * @param timestamp Date/Timestamp + */ + public void setTimestamp(Date timestamp) { + myTimestamp = timestamp; + } + + /** + * Returns the direction (request/reply) of the message. + * @see MessageDirection + * + * @return MessageDirection + */ + public MessageDirection getMessageDirection() { + return myDirection; + } + + /** + * This method sets the direction (request/reply) of the message. + * @see MessageDirection + * + * @param direction MessageDirection + */ + public void setMessageType(MessageDirection direction) { + myDirection = direction; + } + + /** + * This method sets the message direction. + * @see MessageDirection + * + * @param toClient Boolean + */ + public void setMessageDirection(Boolean toClient) { + if (toClient) { + myDirection = MessageDirection.Response; + } else { + myDirection = MessageDirection.Request; + } + } + + /** + * Returns the size of the message in bytes. + * + * @return size int + */ + public int getSize() { + return mySize; + } + + /** + * TODO: wues_ha: Enter comment! + * + */ + public void parseMessage() { + + } + + /** + * Returns the raw data of the message. + * + * @return data String + */ + public String getRawData() { + return myRawData; + } + + /** + * Sets the raw data of the current message. + * Message size, ID, body and header are automatically added. + * + * @param msg String + */ + public void setRawData(String msg) { + myRawData = msg; + mySize = msg.length(); + myID = idCounter; + } + + /** + * Returns the head of the message. + * + * @return String + */ + public String getMessageHeader() { + return myMessageHeader; + } + + /** + * Returns the body of the message. + * + * @return String + */ + public String getMessageBody() { + return myMessageBody; + } +} Added: trunk/DAVInspector/src/de/dlr/davinspector/history/AMessageParser.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/history/AMessageParser.java (rev 0) +++ trunk/DAVInspector/src/de/dlr/davinspector/history/AMessageParser.java 2008-02-29 16:15:31 UTC (rev 64) @@ -0,0 +1,58 @@ +/* + * AMessageParser.java + * + * TODO: wues_ha Enter comment! + * + * Created: 29.02.2008 wues_ha <email> + * Changed: + * + * $Id$ + * + * Copyright 2007 Deutsches Zentrum fuer Luft- und Raumfahrt e.V. (DLR) + * + * Licensed 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 de.dlr.davinspector.history; + + +/** + * TODO: wues_ha: Enter comment! + * + * @version $LastChangedRevision$ + * @author Jochen Wuest + */ +public abstract class AMessageParser extends AMessage { + + /** + * Parsing state of the message. + */ + protected Boolean isComplete; + + /** + * {@inheritDoc} + * + * @see de.dlr.davinspector.history.AMessage#parseMessage() + */ + public abstract void parseMessage(); + + /** + * Returns the parsing state of the message. + * + * @return Boolean + */ + public Boolean isComplete() { + return isComplete; + } + +} Modified: trunk/DAVInspector/src/de/dlr/davinspector/history/HistoryTableCellRenderer.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/history/HistoryTableCellRenderer.java 2008-02-26 21:46:46 UTC (rev 63) +++ trunk/DAVInspector/src/de/dlr/davinspector/history/HistoryTableCellRenderer.java 2008-02-29 16:15:31 UTC (rev 64) @@ -64,8 +64,8 @@ super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); - if (value instanceof Message.MessageType){ - if (value.equals(Message.MessageType.Request)) { + if (value instanceof AMessage.MessageDirection){ + if (value.equals(AMessage.MessageDirection.Request)) { setText("Request"); isRequest = true; } else { Modified: trunk/DAVInspector/src/de/dlr/davinspector/history/HistoryTableModel.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/history/HistoryTableModel.java 2008-02-26 21:46:46 UTC (rev 63) +++ trunk/DAVInspector/src/de/dlr/davinspector/history/HistoryTableModel.java 2008-02-29 16:15:31 UTC (rev 64) @@ -84,8 +84,8 @@ */ public void newMessage(MessageEvent newMessageEvent) { // update history table - Message msg = newMessageEvent.getMessage(); - addRow(new Object[]{msg.getMessageType(), msg.getId(), msg.getTimestamp(), msg.getSize()}); + AMessage msg = newMessageEvent.getMessage(); + addRow(new Object[]{msg.getMessageDirection(), msg.getId(), msg.getTimestamp(), msg.getSize()}); fireTableDataChanged(); } } Modified: trunk/DAVInspector/src/de/dlr/davinspector/history/Message.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/history/Message.java 2008-02-26 21:46:46 UTC (rev 63) +++ trunk/DAVInspector/src/de/dlr/davinspector/history/Message.java 2008-02-29 16:15:31 UTC (rev 64) @@ -22,243 +22,22 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - + package de.dlr.davinspector.history; -import java.util.Date; - /** * This class represents a single message. - * + * * @version $LastChangedRevision$ * @author Jochen Wuest */ -public class Message { +public class Message extends AMessage { /** - * - */ - private static int idCounter; - - /** - * Message type indicates the direction of the message: - * <ul> - * <li>Message from client to server: Request.</li> - * <li>Message from server to client: Response.</li> - * </ul> - * - * @version $LastChangedRevision$ - * @author Jochen Wuest - */ - public enum MessageType { - /** - * - */ - Request, - /** - * - */ - Response - } - - /** - * Unique ID of a message. - */ - private int myID; - - /** - * Timestamp of the current message. - */ - private Date myTimestamp; - - /** - * Type indicates the direction of the message. - * @see MessageType - */ - private MessageType myType; - - /** - * This string contains the raw data of the message. - */ - private String myData; - - /** - * This string contains the body of the message. - */ - private String myMessageBody; - - /** - * This string contains the head of the message. - */ - private String myMessageHeader; - - /** - * The size in bytes of the current message. - */ - private int mySize; - - /** * Constructor, every new message increases <code>idCounter</code>. */ public Message() { ++idCounter; } - - /** - * This method returns the ID of the message. - * - * @return id - */ - public int getId() { - return myID; - } - - /** - * This method returns the timestamp of the message. - * - * @return timestamp - */ - public Date getTimestamp() { - return myTimestamp; - } - - /** - * This method sets the timestamp of the current message. - * - * @param timestamp Date/Timestamp - */ - public void setTimestamp(Date timestamp) { - myTimestamp = timestamp; - } - - /** - * Returns the message type (request/reply) of the message. - * @see MessageType - * - * @return MessageType - */ - public MessageType getMessageType() { - return myType; - } - - /** - * This method sets the message type (request/reply) of the message. - * @see MessageType - * - * @param type MessageType - */ - public void setMessageType(MessageType type) { - myType = type; - } - - /** - * This method sets the message type. - * @see MessageType - * - * @param toClient Boolean - */ - public void setMessageType(Boolean toClient) { - if (toClient) { - myType = MessageType.Response; - } else { - myType = MessageType.Request; - } - } - - /** - * Returns the raw data of the message. - * - * @return data String - */ - public String getData() { - return myData; - } - - /** - * Sets the raw data of the current message. - * Message size, ID, body and header are automatically added. - * - * @param msg String - */ - public void setData(String msg) { - myData = msg; - mySize = msg.length(); - myID = idCounter; - - myMessageBody = extractMessageBody(msg); - myMessageHeader = extractMessageHeader(msg); - } - - /** - * Returns the head of the message. - * - * @return String - */ - public String getMessageHeader() { - return myMessageHeader; - } - - /** - * Returns the body of the message. - * - * @return String - */ - public String getMessageBody() { - return myMessageBody; - } - - /** - * Returns the size of the message in bytes. - * - * @return size int - */ - public int getSize() { - return mySize; - } - - /** - * Extracts the body of the message from the raw data. - * - * @param input String containig http packet - * @return String with body - */ - private String extractMessageBody(String input) { - String result = ""; - - // HTTP/1.1 HTTP/1.0 HTTP/0.9 - // TODO: split input into different HTTP messages - //String[] httpMessages = input.split("HTTP/[1.1|1.0|0.9]{1}"); - - // TODO: nur die erste Nachricht wird angezeigt - //input = httpMessages[0]; - - String[] s = input.split("\r\n\r\n"); - for (int i = 1; i < s.length; i++) { - result = s[i]; - } - - - // detect and process chunked data - // split the input in the different chunks. - // each chunk starts with the length of the chunk in hex. - String[] lines = result.split("(\r\n[0-9a-fA-F]+\r\n)"); - result = ""; - for (int i = 0; i < lines.length; i++) { - result += lines[i]; - } - - return result; - } - - /** - * Extracts the header of the message from the raw data. - * - * @param input String containing http packet - * @return String with headers - */ - private String extractMessageHeader(String input) { - String[] s = input.split("\r\n\r\n"); - return s[0]; - } } Modified: trunk/DAVInspector/src/de/dlr/davinspector/history/MessageEvent.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/history/MessageEvent.java 2008-02-26 21:46:46 UTC (rev 63) +++ trunk/DAVInspector/src/de/dlr/davinspector/history/MessageEvent.java 2008-02-29 16:15:31 UTC (rev 64) @@ -44,7 +44,7 @@ /** * The message. */ - private Message myMessage; + private AMessage myMessage; /** * Constructor for a new message event. @@ -52,7 +52,7 @@ * @param source Object * @param msg {@link Message} */ - public MessageEvent(Object source, Message msg) { + public MessageEvent(Object source, AMessage msg) { super(source); myMessage = msg; } @@ -62,7 +62,7 @@ * * @return {@link Message} */ - public Message getMessage() { + public AMessage getMessage() { return myMessage; } Modified: trunk/DAVInspector/src/de/dlr/davinspector/history/MessageHistory.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/history/MessageHistory.java 2008-02-26 21:46:46 UTC (rev 63) +++ trunk/DAVInspector/src/de/dlr/davinspector/history/MessageHistory.java 2008-02-29 16:15:31 UTC (rev 64) @@ -32,6 +32,7 @@ import javax.swing.event.EventListenerList; +import de.dlr.davinspector.http.HTTPMessageParser; import de.dlr.davinspector.relay.DataEvent; import de.dlr.davinspector.relay.IClientListener; import de.dlr.davinspector.relay.IRelayModel; @@ -71,7 +72,7 @@ /** * This vector stores the messages. */ - private List<Message> myMessages = null; + private List<AMessage> myMessages = null; /** * Reference to the relay model. @@ -87,7 +88,7 @@ */ public MessageHistory(IRelayModel relay) { myRelay = relay; - myMessages = new Vector<Message>(); + myMessages = new Vector<AMessage>(); myClientsideBuffer = ""; myServersideBuffer = ""; @@ -104,11 +105,17 @@ * @param timestamp Date */ public void storeMessage(String data, Boolean toClient, Date timestamp) { + + AMessage message = new Message(); + //TODO: add decorator dependent on protocol (switch http, ...). + message = new HTTPMessageParser(message); + + message.setMessageDirection(toClient); + message.setRawData(data); + message.setTimestamp(timestamp); + message.parseMessage(); + // store Message - Message message = new Message(); - message.setMessageType(toClient); - message.setData(data); - message.setTimestamp(new Date()); myMessages.add(message); notifyNewMessage(new MessageEvent(this, message)); @@ -121,8 +128,8 @@ * @param id int */ public void loadMessageByID(int id) { - for (Iterator<Message> iterator = myMessages.iterator(); iterator.hasNext();) { - Message message = (Message) iterator.next(); + for (Iterator<AMessage> iterator = myMessages.iterator(); iterator.hasNext();) { + AMessage message = (AMessage) iterator.next(); if (message.getId() == id) { notifyRefreshMessage(new MessageEvent(this, message)); break; @@ -137,7 +144,6 @@ */ public void newClientData(DataEvent newDataEvent) { myClientsideBuffer += newDataEvent.getData(); - processRawData(); storeMessage(myClientsideBuffer, false, new Date()); myClientsideBuffer = ""; } @@ -149,21 +155,10 @@ */ public void newServerData(DataEvent newDataEvent) { myServersideBuffer += newDataEvent.getData(); - processRawData(); storeMessage(myServersideBuffer, true, new Date()); myServersideBuffer = ""; } - /** - * Processes Client and Server data. - * Data is split into messages by Content-Header-Length (if set) or EOF. - * TODO: maybe here or in the message class itsself !? - * TODO: automatic end of message detection (interface for this would be nice) - */ - private void processRawData() { - - } - /** * Adds an {@link INewMessageListener} to MessageHistory. * Deleted: trunk/DAVInspector/src/de/dlr/davinspector/http/HTTPMessage.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/http/HTTPMessage.java 2008-02-26 21:46:46 UTC (rev 63) +++ trunk/DAVInspector/src/de/dlr/davinspector/http/HTTPMessage.java 2008-02-29 16:15:31 UTC (rev 64) @@ -1,104 +0,0 @@ -/* - * HTTPMessage.java - * - * TODO: wues_ha Enter comment! - * - * Created: 23.01.2008 Jochen Wuest <joc...@dl...> - * Changed: - * - * $Id$ - * - * Copyright 2007 Deutsches Zentrum fuer Luft- und Raumfahrt e.V. (DLR) - * - * Licensed 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 de.dlr.davinspector.http; - - -/** - * TODO: wues_ha: Enter comment! - * ##{@link #addData(String)}interface?? - * @version $LastChangedRevision$ - * @author Jochen Wuest - */ -public class HTTPMessage { - // CHECKSTYLE:OFF - /** - * TODO: wues_ha: Enter comment! - */ - public enum MessageType { - Request, - Response - } - - private String msg; - private String header; - private String body; - private MessageType type; - private Boolean isComplete; - - public HTTPMessage() { - - } - - //### evtl stream - public HTTPMessage(String data) { - - } - - public void addData(String data) { - - } - - // TODO: header auseinandernehmen (REQ-RES/LEN/ENC) - // TODO: body zusammenstellen - // TODO: StringTokenizer - private void processMessage() { - String result = ""; - - // HTTP/1.1 HTTP/1.0 HTTP/0.9 - // TODO: split input into different HTTP messages - //String[] httpMessages = input.split("HTTP/[1.1|1.0|0.9]{1}"); - - // TODO: nur die erste Nachricht wird angezeigt - //input = httpMessages[0]; - - String[] s = msg.split("\r\n\r\n"); - header = s[0]; - for (int i = 1; i < s.length; i++) { - result = s[i]; - } - - - // detect and process chunked data - // split the input in the different chunks. - // each chunk starts with the length of the chunk in hex. - String[] lines = result.split("(\r\n[0-9a-fA-F]+\r\n)"); - result = ""; - for (int i = 0; i < lines.length; i++) { - result += lines[i]; - } - - } - - // TODO: Col/vec o.\xE4. - public String getHeader() { - return header; - } - - public String getBody() { - return body; - } - // CHECKSTYLE:ON -} Copied: trunk/DAVInspector/src/de/dlr/davinspector/http/HTTPMessageParser.java (from rev 63, trunk/DAVInspector/src/de/dlr/davinspector/http/HTTPMessage.java) =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/http/HTTPMessageParser.java (rev 0) +++ trunk/DAVInspector/src/de/dlr/davinspector/http/HTTPMessageParser.java 2008-02-29 16:15:31 UTC (rev 64) @@ -0,0 +1,135 @@ +/* + * HTTPMessageParser.java + * + * TODO: wues_ha Enter comment! + * + * Created: 23.01.2008 Jochen Wuest <joc...@dl...> + * Changed: + * + * $Id$ + * + * Copyright 2007 Deutsches Zentrum fuer Luft- und Raumfahrt e.V. (DLR) + * + * Licensed 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 de.dlr.davinspector.http; + +import de.dlr.davinspector.history.AMessage; +import de.dlr.davinspector.history.AMessageParser; + + +/** + * TODO: wues_ha: Enter comment! + * + * @version $LastChangedRevision$ + * @author Jochen Wuest + */ +public class HTTPMessageParser extends AMessageParser { + + /** + * + */ + private AMessage myMessage; + + /** + * Constructor. + * + * @param aMessage AMessage + */ + public HTTPMessageParser(AMessage aMessage) { + myMessage = aMessage; + } + + /** + * Extracts the body of the message from the raw data. + * + * @param input String containig http packet + * @return String with body + */ + private String extractMessageBody(String input) { + String result = ""; + + // HTTP/1.1 HTTP/1.0 HTTP/0.9 + // TODO: split input into different HTTP messages + //String[] httpMessages = input.split("HTTP/[1.1|1.0|0.9]{1}"); + + // TODO: nur die erste Nachricht wird angezeigt + //input = httpMessages[0]; + + if (input != null) { + String[] s = input.split("\r\n\r\n"); + for (int i = 1; i < s.length; i++) { + result = s[i]; + } + } else { + result = "--leer--"; + } + + + // detect and process chunked data + // split the input in the different chunks. + // each chunk starts with the length of the chunk in hex. + String[] lines = result.split("(\r\n[0-9a-fA-F]+\r\n)"); + result = ""; + for (int i = 0; i < lines.length; i++) { + result += lines[i]; + } + + return result; + } + + /** + * Extracts the header of the message from the raw data. + * + * @param input String containing http packet + * @return String with headers + */ + private String extractMessageHeader(String input) { + if (input != null) { + String[] s = input.split("\r\n\r\n"); + return s[0]; + } else { + return "--leer--"; + } + } + + /** + * {@inheritDoc} + * + * @see de.dlr.davinspector.history.AMessageParser#parseMessage() + */ + public void parseMessage() { + //super.setMessageBody(extractMessageBody(super.getRawData())); + //super.setMessageHeader(extractMessageHeader(super.getRawData())); + } + + /** + * Returns the head of the message. + * + * @return String + */ + public String getMessageHeader() { +//System.out.println(myMessage.getRawData() + " \xE4 \xE4 \xE4 " + super.getRawData()); + return extractMessageHeader(super.getRawData()); + } + + /** + * Returns the body of the message. + * + * @return String + */ + public String getMessageBody() { + return extractMessageBody(super.getRawData()); + } +} Modified: trunk/DAVInspector/src/de/dlr/davinspector/plugin/IEditPlugin.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugin/IEditPlugin.java 2008-02-26 21:46:46 UTC (rev 63) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugin/IEditPlugin.java 2008-02-29 16:15:31 UTC (rev 64) @@ -26,7 +26,7 @@ package de.dlr.davinspector.plugin; -import de.dlr.davinspector.history.Message; +import de.dlr.davinspector.history.AMessage; @@ -39,9 +39,9 @@ */ public interface IEditPlugin extends IPlugin { /** - * Returns the processed {@link Message} of the plugin. + * Returns the processed {@link AMessage} of the plugin. * - * @return Message + * @return AMessage */ - Message getOutput(); + AMessage getOutput(); } Modified: trunk/DAVInspector/src/de/dlr/davinspector/plugin/IPlugin.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugin/IPlugin.java 2008-02-26 21:46:46 UTC (rev 63) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugin/IPlugin.java 2008-02-29 16:15:31 UTC (rev 64) @@ -25,7 +25,7 @@ package de.dlr.davinspector.plugin; -import de.dlr.davinspector.history.Message; +import de.dlr.davinspector.history.AMessage; /** * General plugin interface definition. @@ -78,9 +78,9 @@ /** * Starts processing of the message. * - * @param msg Message + * @param msg AMessage */ - void update(Message msg); + void update(AMessage msg); /** * Clears all data. Modified: trunk/DAVInspector/src/de/dlr/davinspector/plugin/PluginManager.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugin/PluginManager.java 2008-02-26 21:46:46 UTC (rev 63) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugin/PluginManager.java 2008-02-29 16:15:31 UTC (rev 64) @@ -34,7 +34,7 @@ import java.util.Vector; import de.dlr.davinspector.common.Constant; -import de.dlr.davinspector.history.Message; +import de.dlr.davinspector.history.AMessage; /** * This class loads all available plugins and manages the activated plugins @@ -169,7 +169,7 @@ * * @param message Message */ - public void updateActivePluginsServer(Message message) { + public void updateActivePluginsServer(AMessage message) { for (Iterator<IPlugin> iterator = myActivePluginsServer.iterator(); iterator.hasNext();) { IPlugin plugin = (IPlugin) iterator.next(); plugin.update(message); @@ -182,7 +182,7 @@ * * @param message Message */ - public void updateActivePluginsClient(Message message) { + public void updateActivePluginsClient(AMessage message) { for (Iterator<IPlugin> iterator = myActivePluginsClient.iterator(); iterator.hasNext();) { IPlugin plugin = (IPlugin) iterator.next(); plugin.update(message); Modified: trunk/DAVInspector/src/de/dlr/davinspector/plugins/headerplugin/HeaderPlugin.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugins/headerplugin/HeaderPlugin.java 2008-02-26 21:46:46 UTC (rev 63) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugins/headerplugin/HeaderPlugin.java 2008-02-29 16:15:31 UTC (rev 64) @@ -28,7 +28,7 @@ import javax.swing.JComponent; import javax.swing.JTextPane; -import de.dlr.davinspector.history.Message; +import de.dlr.davinspector.history.AMessage; import de.dlr.davinspector.plugin.IViewPlugin; @@ -140,7 +140,7 @@ * * @see de.dlr.DAVInspector.Plugin.IPlugin#update(java.lang.String) */ - public void update(Message msg) { + public void update(AMessage msg) { if (isActive && myJTextPane != null) { myJTextPane.setText(msg.getMessageHeader()); } Modified: trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/XMLPlugin.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/XMLPlugin.java 2008-02-26 21:46:46 UTC (rev 63) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/XMLPlugin.java 2008-02-29 16:15:31 UTC (rev 64) @@ -27,7 +27,7 @@ import javax.swing.JComponent; -import de.dlr.davinspector.history.Message; +import de.dlr.davinspector.history.AMessage; import de.dlr.davinspector.plugin.IViewPlugin; @@ -139,8 +139,8 @@ * * @see de.dlr.DAVInspector.Plugin.IPlugin#update(java.lang.String) */ - public void update(Message msg) { - if (isActive && myXMLTextPane != null) { + public void update(AMessage msg) { + if (isActive && myXMLTextPane != null) { myXMLTextPane.setText(msg.getMessageBody()); } } Modified: trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmltreeplugin/XMLTreePlugin.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmltreeplugin/XMLTreePlugin.java 2008-02-26 21:46:46 UTC (rev 63) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmltreeplugin/XMLTreePlugin.java 2008-02-29 16:15:31 UTC (rev 64) @@ -31,7 +31,7 @@ import org.xml.sax.SAXException; -import de.dlr.davinspector.history.Message; +import de.dlr.davinspector.history.AMessage; import de.dlr.davinspector.plugin.IViewPlugin; @@ -142,7 +142,7 @@ * * @see de.dlr.DAVInspector.Plugin.IPlugin#update(java.lang.String) */ - public void update(Message msg) { + public void update(AMessage msg) { if (isActive && myXMLTreeView != null) { updateTree(msg.getMessageBody()); } Modified: trunk/DAVInspector/src/de/dlr/davinspector/relay/ChannelThread.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/relay/ChannelThread.java 2008-02-26 21:46:46 UTC (rev 63) +++ trunk/DAVInspector/src/de/dlr/davinspector/relay/ChannelThread.java 2008-02-29 16:15:31 UTC (rev 64) @@ -28,11 +28,12 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; -import java.io.PrintStream; import java.net.Socket; import java.net.SocketException; import java.util.List; +import org.apache.commons.logging.Log; + import de.dlr.davinspector.common.Constant; /** @@ -47,32 +48,38 @@ /** * */ - public static final String COLON = ":"; + public static final String COLON = ": "; + /** * */ private Socket myInputSocket; + /** * */ private Socket myOutputSocket; + /** * */ private boolean myDone = false; + /** * */ private ChannelThread myPeer; + /** * */ private boolean toClient = false; /** - * + * The logger. */ - private PrintStream errorPrintStream; + private Log myLogger; + /** * */ @@ -94,16 +101,16 @@ * @param inputSocket Socket input socket * @param outputSocket Socket output socket * @param relay lock object - * @param psErr Printstream for error messages + * @param logger Logger * @param connections List */ public ChannelThread(Socket inputSocket, Socket outputSocket, IRelayModel relay, - PrintStream psErr, List<ChannelThread> connections) { - this.myInputSocket = inputSocket; - this.myOutputSocket = outputSocket; - this.myLock = relay; - this.errorPrintStream = psErr; - this.myConnections = connections; + Log logger, List<ChannelThread> connections) { + myInputSocket = inputSocket; + myOutputSocket = outputSocket; + myLock = relay; + myLogger = logger; + myConnections = connections; } /** @@ -129,15 +136,15 @@ count = in.read(buffer); } } catch (IOException ioe) { - errorPrintStream.println(myThreadName + ioe); + myLogger.error(myThreadName + COLON + ioe.getMessage(), ioe); } finally { // The input and output streams will be closed when the sockets themselves are closed. //# out.flush(); - errorPrintStream.println(myThreadName + "flushing"); + myLogger.info(myThreadName + COLON + "flushing"); flushOut(); } } catch (IOException ioe) { - errorPrintStream.println(myThreadName + ioe); + myLogger.error(myThreadName + ioe.getMessage(), ioe); } synchronized (myLock) { @@ -147,17 +154,17 @@ // Cleanup if there is only one peer OR if _both_ peers are done myInputSocket.close(); myOutputSocket.close(); - errorPrintStream.println(myThreadName + "closing"); + myLogger.info(myThreadName + COLON + "closing"); } else { // Signal the peer (if any) that we're done on this side of the connection // flushOut(); - errorPrintStream.println(myThreadName + "interrupting peer"); + myLogger.info(myThreadName + COLON + "interrupting peer"); myPeer.interrupt(); } } catch (IOException ioe) { - errorPrintStream.println(myThreadName + COLON + ioe); + myLogger.error(myThreadName + COLON + ioe.getMessage(), ioe); } finally { - errorPrintStream.println(myThreadName + "removing connection"); + myLogger.info(myThreadName + COLON + "removing connection"); myConnections.remove(this); } } @@ -198,7 +205,7 @@ * @param threadName String thread name. */ public void setTName(String threadName) { - myThreadName = threadName + ": "; + myThreadName = threadName; } /** @@ -217,7 +224,7 @@ out.flush(); } } catch (IOException ioe) { - errorPrintStream.println(myThreadName + COLON + ioe); + myLogger.error(myThreadName + COLON + ioe.getMessage(), ioe); } } @@ -228,9 +235,9 @@ try { myOutputSocket.getOutputStream().flush(); } catch (SocketException se) { - errorPrintStream.println(myThreadName + COLON + se); + myLogger.error(myThreadName + COLON + se.getMessage(), se); } catch (IOException ioe) { - errorPrintStream.println(myThreadName + COLON + ioe); + myLogger.error(myThreadName + COLON + ioe.getMessage(), ioe); } } @@ -303,7 +310,7 @@ outStream.write(buffer.getBytes()); outStream.flush(); } catch (IOException ioe) { - errorPrintStream.println(ioe); + myLogger.error(myThreadName + COLON + ioe.getMessage(), ioe); } } } Modified: trunk/DAVInspector/src/de/dlr/davinspector/relay/IRelayModel.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/relay/IRelayModel.java 2008-02-26 21:46:46 UTC (rev 63) +++ trunk/DAVInspector/src/de/dlr/davinspector/relay/IRelayModel.java 2008-02-29 16:15:31 UTC (rev 64) @@ -25,10 +25,7 @@ package de.dlr.davinspector.relay; -import java.io.PrintStream; - import de.dlr.davinspector.configuration.Configuration; -import de.dlr.davinspector.history.Message; import de.dlr.davinspector.history.MessageHistory; @@ -43,10 +40,8 @@ * This method starts the relay with the given configuration. * * @param configuration Configuration - * @param outStream PrintStream - * @param errStream PrintStream */ - void startRelay(Configuration configuration, PrintStream outStream, PrintStream errStream); + void startRelay(Configuration configuration); /** * This method stops the relay. All open connections are closed. @@ -55,7 +50,7 @@ /** * This method writes data to the client. - * INFO: Maybe {@link Message} instead of a string!? + * INFO: Maybe Message instead of a string!? * @param data String */ void writeToClient(String data); Modified: trunk/DAVInspector/src/de/dlr/davinspector/relay/RelayModel.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/relay/RelayModel.java 2008-02-26 21:46:46 UTC (rev 63) +++ trunk/DAVInspector/src/de/dlr/davinspector/relay/RelayModel.java 2008-02-29 16:15:31 UTC (rev 64) @@ -27,7 +27,6 @@ package de.dlr.davinspector.relay; import java.io.IOException; -import java.io.PrintStream; import java.net.InetAddress; import java.net.ServerSocket; import java.net.Socket; @@ -38,6 +37,9 @@ import javax.swing.event.EventListenerList; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + import de.dlr.davinspector.common.Constant; import de.dlr.davinspector.configuration.Configuration; import de.dlr.davinspector.history.MessageHistory; @@ -63,14 +65,19 @@ private EventListenerList myServerListeners = new EventListenerList(); /** + * Logger, Apache Commons Logging. + */ + private Log myLogger = LogFactory.getLog(RelayModel.class); + + /** * Address to forward connections to. */ - private InetAddress destinationAddress; + private InetAddress myDestinationAddress; /** * Port to forward connections to. */ - private int destinationPort; + private int myDestinationPort; /** * This proxy's server socket. @@ -78,17 +85,6 @@ private ServerSocket serverSocket; /** - * Log stream for output messages. - * TODO: use logger instead. - */ - private PrintStream outPrintStream; - - /** - * Log stream for error messages. - */ - private PrintStream errorPrintStream; - - /** * The lock object is used for synchronizing the ChannelThreads. */ private Object lock = new Object(); @@ -150,7 +146,7 @@ /** * Notifies all {@link IServerListener}s that have registered interest for - * notification on an {@link DataEvent}. + * notification on a {@link DataEvent}. * * @param event the {@link DataEvent} object */ @@ -180,7 +176,7 @@ /** * Notifies all {@link IClientListener}s that have registered interest for - * notification on an {@link DataEvent}. + * notification on a {@link DataEvent}. * * @param event the {@link DataEvent} object */ @@ -195,24 +191,22 @@ * * @see de.dlr.DAVInspector.Relay.IRelayModel#startRelay() */ - public void startRelay(Configuration configuration, PrintStream outStream, PrintStream errStream) { + public void startRelay(Configuration configuration) { try { InetAddress serverAddress = InetAddress.getByName(configuration.getClientAddress()); InetAddress clientAddress = InetAddress.getByName(configuration.getServerAddress()); - this.outPrintStream = outStream; - this.errorPrintStream = errStream; if (clientAddress == null) { - this.serverSocket = new ServerSocket(configuration.getClientPort(), Constant.RELAY_BACKLOG); + serverSocket = new ServerSocket(configuration.getClientPort(), Constant.RELAY_BACKLOG); } else { - this.serverSocket = new ServerSocket(configuration.getClientPort(), Constant.RELAY_BACKLOG, clientAddress); + serverSocket = new ServerSocket(configuration.getClientPort(), Constant.RELAY_BACKLOG, clientAddress); } - this.destinationAddress = serverAddress; - this.destinationPort = configuration.getServerPort(); + myDestinationAddress = serverAddress; + myDestinationPort = configuration.getServerPort(); } catch (UnknownHostException uhe) { - errorPrintStream.println(uhe); + myLogger.error(uhe.getMessage(), uhe); } catch (IOException ioe) { - errorPrintStream.println(ioe); + myLogger.error(ioe.getMessage(), ioe); } start(); } @@ -223,7 +217,7 @@ * @see java.lang.Thread#run() */ public void run() { - outPrintStream.println("starting"); + myLogger.info("Relay is starting"); try { while (!isInterrupted()) { Socket serverSideSocket = serverSocket.accept(); @@ -231,12 +225,12 @@ clientBuffer = ""; serverBuffer = ""; serverSideSocket.setSoLinger(true, Constant.RELAY_LINGERTIME); - Socket clientSideSocket = new Socket(destinationAddress, destinationPort); + Socket clientSideSocket = new Socket(myDestinationAddress, myDestinationPort); clientSideSocket.setSoLinger(true, Constant.RELAY_LINGERTIME); ChannelThread serverToClientChannel = new ChannelThread(serverSideSocket, clientSideSocket, - (IRelayModel) this, errorPrintStream, connections); + (IRelayModel) this, myLogger, connections); ChannelThread clientToServerChannel = new ChannelThread(clientSideSocket, serverSideSocket, - (IRelayModel) this, errorPrintStream, connections); + (IRelayModel) this, myLogger, connections); serverToClientChannel.setPeer(clientToServerChannel); clientToServerChannel.setPeer(serverToClientChannel); serverToClientChannel.setToClient(true); @@ -250,15 +244,15 @@ clientToServerChannel.start(); } } catch (SocketException se) { - errorPrintStream.println(se); + myLogger.error(se); } } serverSocket.close(); } catch (IOException ioe) { - errorPrintStream.println(ioe); + myLogger.error(ioe.getMessage(), ioe); } finally { cleanup(); - outPrintStream.println("stopped"); + myLogger.info("Relay stopped"); } } @@ -270,17 +264,21 @@ * @see de.dlr.davinspector.relay.IRelayModel#stopRelay() */ public void stopRelay() { - interrupt(); - - outPrintStream.println("stopping ..."); + myLogger.info("stopping stage 1"); + try { + interrupt(); + } catch (SecurityException se) { + myLogger.info(se); + } + myLogger.info("stopping stage 2"); } /** - * All StreamCopyThreads are interrupted and joined. + * All ChannelThreads are interrupted and joined. */ private void cleanup() { synchronized (lock) { - outPrintStream.println("stopping .."); + myLogger.info("stopping stage 3"); try { while (connections.size() > 0) { ChannelThread channelThread = (ChannelThread) connections.get(0); @@ -288,7 +286,7 @@ channelThread.join(Constant.RELAY_THREADTIMEOUT); } } catch (InterruptedException ie) { - errorPrintStream.println(ie); + myLogger.error(ie.getMessage(), ie); } } } Modified: trunk/DAVInspector/src/de/dlr/davinspector/ui/AboutDialog.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/ui/AboutDialog.java 2008-02-26 21:46:46 UTC (rev 63) +++ trunk/DAVInspector/src/de/dlr/davinspector/ui/AboutDialog.java 2008-02-29 16:15:31 UTC (rev 64) @@ -155,8 +155,8 @@ jTextPane.setText("\nVersion " + Constant.APP_VERSION + "\n\nApache 2.0 Lizenz" + "\n(c) Copyright Jochen Wuest, Markus Litz, DLR 2007-2008" + + "\n\nCommons Logging, Apache 2.0 Lizenz\nhttp://commons.apache.org/logging/" + "\n\nIcons used by this Application:\nCrystal Project Icons by Everaldo Coelho\nhttp://www.everaldo.com\n"); - // TODO: Add icon license and JCL license. } return jTextPane; } Modified: trunk/DAVInspector/src/de/dlr/davinspector/ui/ConfigurationDialog.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/ui/ConfigurationDialog.java 2008-02-26 21:46:46 UTC (rev 63) +++ trunk/DAVInspector/src/de/dlr/davinspector/ui/ConfigurationDialog.java 2008-02-29 16:15:31 UTC (rev 64) @@ -110,12 +110,19 @@ private JButton jButtonOk = null; /** + * The View. + */ + private MainView myMainView = null; + + /** * Constructor of the configuration dialog. * * @param owner Frame + * @param main MainView */ - public ConfigurationDialog(Frame owner) { + public ConfigurationDialog(Frame owner, MainView main) { super(owner); + myMainView = main; initialize(); } @@ -210,7 +217,8 @@ config.setServerAddress(jTextFieldServerAddress.getText()); config.setServerPort(jTextFieldServerPort.getText()); config.storeConfiguration(); - // TODO: refresh/restart the relay with the new configuration + // Restart the relay with the new configuration. + myMainView.restartRelay(); } /** Modified: trunk/DAVInspector/src/de/dlr/davinspector/ui/MainController.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/ui/MainController.java 2008-02-26 21:46:46 UTC (rev 63) +++ trunk/DAVInspector/src/de/dlr/davinspector/ui/MainController.java 2008-02-29 16:15:31 UTC (rev 64) @@ -64,7 +64,7 @@ */ public void startRelay() { Configuration config = new Configuration(); - myRelay.startRelay(config, System.out, System.err); + myRelay.startRelay(config); } /** Modified: trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java 2008-02-26 21:46:46 UTC (rev 63) +++ trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java 2008-02-29 16:15:31 UTC (rev 64) @@ -56,11 +56,11 @@ import de.dlr.davinspector.common.Constant; import de.dlr.davinspector.common.Util; +import de.dlr.davinspector.history.AMessage; import de.dlr.davinspector.history.HistoryTableCellRenderer; import de.dlr.davinspector.history.HistoryTableModel; import de.dlr.davinspector.history.INewMessageListener; import de.dlr.davinspector.history.IRefreshMessageListener; -import de.dlr.davinspector.history.Message; import de.dlr.davinspector.history.MessageEvent; import de.dlr.davinspector.plugin.IPlugin; import de.dlr.davinspector.plugin.IViewPlugin; @@ -356,7 +356,7 @@ public void actionPerformed(ActionEvent e) { if (myConfigDialog == null) { - myConfigDialog = new ConfigurationDialog(jFrame); + myConfigDialog = new ConfigurationDialog(jFrame, myController.getView()); } myConfigDialog.setVisible(true); } @@ -584,7 +584,7 @@ * @see de.dlr.davinspector.history.INewMessageListener#newMessage(de.dlr.davinspector.history.MessageEvent) */ public void newMessage(MessageEvent newMessageEvent) { - Message msg = newMessageEvent.getMessage(); + AMessage msg = newMessageEvent.getMessage(); updateMessage(msg); } @@ -594,7 +594,7 @@ * @see de.dlr.davinspector.history.IRefreshMessageListener#refreshMessage(de.dlr.davinspector.history.MessageEvent) */ public void refreshMessage(MessageEvent refreshMessageEvent) { - Message msg = refreshMessageEvent.getMessage(); + AMessage msg = refreshMessageEvent.getMessage(); updateMessage(msg); } @@ -603,12 +603,12 @@ * * @param message Message */ - private void updateMessage(Message message) { - if (message.getMessageType().equals(Message.MessageType.Request)) { - jTextPaneClientRaw.setText(message.getData()); + private void updateMessage(AMessage message) { + if (message.getMessageDirection().equals(AMessage.MessageDirection.Request)) { + jTextPaneClientRaw.setText(message.getRawData()); myPluginManager.updateActivePluginsClient(message); } else { - jTextPaneServerRaw.setText(message.getData()); + jTextPaneServerRaw.setText(message.getRawData()); myPluginManager.updateActivePluginsServer(message); } } @@ -622,7 +622,7 @@ if (jBtnSendToServer == null) { jBtnSendToServer = new JButton(sendToServerAction); jBtnSendToServer.setHideActionText(true); - jBtnSendToServer.setMargin(new Insets(2, 2, 2, 2)); + jBtnSendToServer.setMargin(new ... [truncated message content] |
From: <wu...@us...> - 2008-02-26 21:47:17
|
Revision: 63 http://davinspector.svn.sourceforge.net/davinspector/?rev=63&view=rev Author: wuest Date: 2008-02-26 13:46:46 -0800 (Tue, 26 Feb 2008) Log Message: ----------- Added some documentation and license information. Modified Paths: -------------- trunk/DAVInspector/src/de/dlr/davinspector/common/Constant.java trunk/DAVInspector/src/de/dlr/davinspector/configuration/PluginConfiguration.java trunk/DAVInspector/src/de/dlr/davinspector/history/Message.java trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/JTextPaneContentHandler.java trunk/DAVInspector/src/de/dlr/davinspector/relay/IRelayModel.java trunk/DAVInspector/src/de/dlr/davinspector/relay/RelayModel.java trunk/DAVInspector/src/de/dlr/davinspector/ui/AboutDialog.java trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java trunk/DAVInspector/src/de/dlr/davinspector/ui/PluginConfigurationDialog.java Modified: trunk/DAVInspector/src/de/dlr/davinspector/common/Constant.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/common/Constant.java 2008-02-26 18:41:56 UTC (rev 62) +++ trunk/DAVInspector/src/de/dlr/davinspector/common/Constant.java 2008-02-26 21:46:46 UTC (rev 63) @@ -74,7 +74,7 @@ /** * About dialog height. */ - public static final int UI_ABOUT_DIALOG_HEIGTH = 175; + public static final int UI_ABOUT_DIALOG_HEIGTH = 235; /** * Backgroundcolor of replies. Modified: trunk/DAVInspector/src/de/dlr/davinspector/configuration/PluginConfiguration.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/configuration/PluginConfiguration.java 2008-02-26 18:41:56 UTC (rev 62) +++ trunk/DAVInspector/src/de/dlr/davinspector/configuration/PluginConfiguration.java 2008-02-26 21:46:46 UTC (rev 63) @@ -42,7 +42,13 @@ * @author Jochen Wuest */ public class PluginConfiguration { + /** + * Symbol used for separating the plugin names. + */ + private final static String DELIMITER = ","; + + /** * */ private Properties myProperties; @@ -132,14 +138,14 @@ /** * Concatenates the list elements to a string. - * TODO: make separator constant or local var + * * @param list List of strings * @return String */ private String stringListToString(List<String> list) { String result = ""; for (String string : list) { - result += string.trim() + ","; + result += string.trim() + DELIMITER; } return result; } @@ -152,7 +158,7 @@ */ private List<String> stringToStringList(String string) { List<String> result = new ArrayList<String>(); - for (String oneElement : string.split(",")) { + for (String oneElement : string.split(DELIMITER)) { result.add(oneElement.trim()); } return result; Modified: trunk/DAVInspector/src/de/dlr/davinspector/history/Message.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/history/Message.java 2008-02-26 18:41:56 UTC (rev 62) +++ trunk/DAVInspector/src/de/dlr/davinspector/history/Message.java 2008-02-26 21:46:46 UTC (rev 63) @@ -68,7 +68,7 @@ private int myID; /** - * + * Timestamp of the current message. */ private Date myTimestamp; @@ -94,7 +94,7 @@ private String myMessageHeader; /** - * + * The size in bytes of the current message. */ private int mySize; @@ -124,8 +124,8 @@ } /** + * This method sets the timestamp of the current message. * - * * @param timestamp Date/Timestamp */ public void setTimestamp(Date timestamp) { @@ -133,16 +133,18 @@ } /** - * TODO: wues_ha: Enter comment! + * Returns the message type (request/reply) of the message. + * @see MessageType * - * @return toClient + * @return MessageType */ public MessageType getMessageType() { return myType; } /** - * TODO: wues_ha: Enter comment! + * This method sets the message type (request/reply) of the message. + * @see MessageType * * @param type MessageType */ @@ -165,7 +167,7 @@ } /** - * Returns the raw Data. + * Returns the raw data of the message. * * @return data String */ @@ -189,7 +191,7 @@ } /** - * Returns the Head of the message. + * Returns the head of the message. * * @return String */ Modified: trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/JTextPaneContentHandler.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/JTextPaneContentHandler.java 2008-02-26 18:41:56 UTC (rev 62) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugins/xmlplugin/JTextPaneContentHandler.java 2008-02-26 21:46:46 UTC (rev 63) @@ -173,7 +173,7 @@ } // Determine namespace - // TODO: display namespace only first time? + // INFO: display namespace only first time? String prefix = ""; if (namespaceURI.length() > 0) { prefix = (String) namespaceMappings.get(namespaceURI); Modified: trunk/DAVInspector/src/de/dlr/davinspector/relay/IRelayModel.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/relay/IRelayModel.java 2008-02-26 18:41:56 UTC (rev 62) +++ trunk/DAVInspector/src/de/dlr/davinspector/relay/IRelayModel.java 2008-02-26 21:46:46 UTC (rev 63) @@ -28,46 +28,47 @@ import java.io.PrintStream; import de.dlr.davinspector.configuration.Configuration; +import de.dlr.davinspector.history.Message; import de.dlr.davinspector.history.MessageHistory; /** - * TODO: wues_ha: Enter comment! + * Interface for the relay model. * * @version $LastChangedRevision$ * @author Jochen Wuest */ public interface IRelayModel { /** + * This method starts the relay with the given configuration. * * @param configuration Configuration - * @param outStream PrintStream + * @param outStream PrintStream * @param errStream PrintStream */ void startRelay(Configuration configuration, PrintStream outStream, PrintStream errStream); /** - * TODO: wues_ha: Enter comment! - * + * This method stops the relay. All open connections are closed. */ void stopRelay(); /** - * TODO: wues_ha: Enter comment! - * + * This method writes data to the client. + * INFO: Maybe {@link Message} instead of a string!? * @param data String */ void writeToClient(String data); /** - * TODO: wues_ha: Enter comment! - * + * This method writes data to the server. + * INFO: Maybe {@link Message} instead of a string!? * @param data String */ void writeToServer(String data); /** - * TODO: wues_ha: Enter comment! + * This method adds the data to the string buffer for server or client depending on the <code>toClient</code> parameter. * * @param data String * @param toClient Boolean @@ -75,14 +76,14 @@ void updateData(String data, Boolean toClient); /** - * TODO: wues_ha: Enter comment! + * This method calls the notify methods for server or client depending on the <code>toClient</code> parameter. * * @param toClient Boolean */ void notifyListeners(Boolean toClient); /** - * TODO: wues_ha: Enter comment! + * Returns the MessageHistory object. * * @return {@link MessageHistory} */ Modified: trunk/DAVInspector/src/de/dlr/davinspector/relay/RelayModel.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/relay/RelayModel.java 2008-02-26 18:41:56 UTC (rev 62) +++ trunk/DAVInspector/src/de/dlr/davinspector/relay/RelayModel.java 2008-02-26 21:46:46 UTC (rev 63) @@ -45,6 +45,7 @@ /** * Implementation of the relay interface. Provides the server socket * and manages the channel threads. + * FIXME: stopping of the relay and freeing of the server socket. * * @version $LastChangedRevision$ * @author Jochen Wuest @@ -78,7 +79,7 @@ /** * Log stream for output messages. - * TODO: to be deleted. + * TODO: use logger instead. */ private PrintStream outPrintStream; @@ -88,17 +89,17 @@ private PrintStream errorPrintStream; /** - * Used for synchronizing ChannelThreads. + * The lock object is used for synchronizing the ChannelThreads. */ private Object lock = new Object(); /** - * + * Client side string buffer. */ private String clientBuffer; /** - * + * Server side string buffer. */ private String serverBuffer; @@ -108,22 +109,22 @@ private List<ChannelThread> connections = new Vector<ChannelThread>(); /** - * + * The message history object. */ - private MessageHistory messageHistory = null; //new MessageHistory(); + private MessageHistory messageHistory = null; /** - * TODO: wues_ha: enter comment! - * + * Constructor of RelayModel. + * The constructor creates a new {@link MessageHistory} object. */ public RelayModel() { messageHistory = new MessageHistory(this); } /** - * Returns the <code>MessageHistory</code>. - * - * @return MessageHistory + * {@inheritDoc} + * + * @see de.dlr.davinspector.relay.IRelayModel#getMessageHistory() */ public MessageHistory getMessageHistory() { return messageHistory; @@ -262,9 +263,11 @@ } + /** - * TODO: wues_ha: Enter comment! - * FIXME: stopping + * {@inheritDoc} + * + * @see de.dlr.davinspector.relay.IRelayModel#stopRelay() */ public void stopRelay() { interrupt(); @@ -305,19 +308,20 @@ } } + /** - * Writes data to the Client. + * {@inheritDoc} * - * @param data String data to write to the client. + * @see de.dlr.davinspector.relay.IRelayModel#writeToClient(java.lang.String) */ public void writeToClient(String data) { write(data, true); } /** - * Writes Data to the Server. + * {@inheritDoc} * - * @param data String data to write to the server. + * @see de.dlr.davinspector.relay.IRelayModel#writeToServer(java.lang.String) */ public void writeToServer(String data) { write(data, false); Modified: trunk/DAVInspector/src/de/dlr/davinspector/ui/AboutDialog.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/ui/AboutDialog.java 2008-02-26 18:41:56 UTC (rev 62) +++ trunk/DAVInspector/src/de/dlr/davinspector/ui/AboutDialog.java 2008-02-26 21:46:46 UTC (rev 63) @@ -153,8 +153,10 @@ jTextPane.setBackground(SystemColor.control); jTextPane.setEditable(false); jTextPane.setText("\nVersion " + Constant.APP_VERSION - + "\n\nApache 2.0 Lizenz\n(c) Copyright Jochen Wuest, Markus Litz, DLR 2007-2008\n"); - // TODO: add icons and other stuff licenses + + "\n\nApache 2.0 Lizenz" + + "\n(c) Copyright Jochen Wuest, Markus Litz, DLR 2007-2008" + + "\n\nIcons used by this Application:\nCrystal Project Icons by Everaldo Coelho\nhttp://www.everaldo.com\n"); + // TODO: Add icon license and JCL license. } return jTextPane; } Modified: trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java 2008-02-26 18:41:56 UTC (rev 62) +++ trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java 2008-02-26 21:46:46 UTC (rev 63) @@ -69,7 +69,14 @@ /** * The main window of the application. + * Gui todos: + * INFO: Enlarge space between components of dialog windows and the window border. + * INFO: Place buttons of the dialog windows in the lower right corner of the window. + * INFO: Resize columns of the tables to the needed space. + * INFO: Adjust alignment of table columns. * + * TODO: getMessageHistory restructure model/relay + * * @version $LastChangedRevision$ * @author Jochen Wuest */ @@ -980,7 +987,7 @@ /** * This method reloads the tab panes for client and server view. */ - public void refreshPluginTabPanes() { + public void reloadPluginTabPanes() { if (jSplitPaneHorizontal != null) { jTabbedPaneClient = null; jTabbedPaneServer = null; @@ -1031,7 +1038,6 @@ if (jTableHistory == null) { myHistoryTableModel = new HistoryTableModel(); - // TODO: getMessageHistory restructure model/relay myRelay.getMessageHistory().addNewMessageListener(myHistoryTableModel); jTableHistory = new JTable(myHistoryTableModel); Modified: trunk/DAVInspector/src/de/dlr/davinspector/ui/PluginConfigurationDialog.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/ui/PluginConfigurationDialog.java 2008-02-26 18:41:56 UTC (rev 62) +++ trunk/DAVInspector/src/de/dlr/davinspector/ui/PluginConfigurationDialog.java 2008-02-26 21:46:46 UTC (rev 63) @@ -151,6 +151,7 @@ } myAvailablePlugins.put(plugin.getName(), new Boolean[] {isAvailableForClient, isAvailableForServer}); + // Is the plugin in the list of loaded plugins? If so mark the plugin as enabled. Boolean clientEnabled = myPluginConfiguration.getActivePluginsClient().contains(plugin.getName()); Boolean serverEnabled = myPluginConfiguration.getActivePluginsServer().contains(plugin.getName()); @@ -235,7 +236,6 @@ * This method closes the window. */ public void closeWindow() { - myMainView.refreshPluginTabPanes(); setVisible(false); dispose(); } @@ -271,6 +271,9 @@ myPluginConfiguration.setActivePluginsServer(serverPlugins); myPluginConfiguration.storeConfiguration(); + // reload tab panes + myMainView.reloadPluginTabPanes(); + closeWindow(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kil...@us...> - 2008-02-26 18:42:08
|
Revision: 62 http://davinspector.svn.sourceforge.net/davinspector/?rev=62&view=rev Author: killerjoe Date: 2008-02-26 10:41:56 -0800 (Tue, 26 Feb 2008) Log Message: ----------- Fixes nasty line break. Modified Paths: -------------- trunk/DAVInspector/DAVInspector.sh Modified: trunk/DAVInspector/DAVInspector.sh =================================================================== --- trunk/DAVInspector/DAVInspector.sh 2008-02-26 18:38:33 UTC (rev 61) +++ trunk/DAVInspector/DAVInspector.sh 2008-02-26 18:41:56 UTC (rev 62) @@ -1,3 +1,3 @@ -#!/bin/sh - -java -jar DAVInspector.jar +#!/bin/bash + +java -jar DAVInspector.jar This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kil...@us...> - 2008-02-26 18:39:07
|
Revision: 61 http://davinspector.svn.sourceforge.net/davinspector/?rev=61&view=rev Author: killerjoe Date: 2008-02-26 10:38:33 -0800 (Tue, 26 Feb 2008) Log Message: ----------- Added linux .sh script. Modified Paths: -------------- trunk/DAVInspector/build-user.xml Added Paths: ----------- trunk/DAVInspector/DAVInspector.sh Added: trunk/DAVInspector/DAVInspector.sh =================================================================== --- trunk/DAVInspector/DAVInspector.sh (rev 0) +++ trunk/DAVInspector/DAVInspector.sh 2008-02-26 18:38:33 UTC (rev 61) @@ -0,0 +1,3 @@ +#!/bin/sh + +java -jar DAVInspector.jar Modified: trunk/DAVInspector/build-user.xml =================================================================== --- trunk/DAVInspector/build-user.xml 2008-02-26 16:52:42 UTC (rev 60) +++ trunk/DAVInspector/build-user.xml 2008-02-26 18:38:33 UTC (rev 61) @@ -14,7 +14,7 @@ <target name="linux" if="isUnix"> <!-- Change to desired location --> - <property name="dist" location="/usr/local/DAVInspector" /> + <property name="dist" location="/tmp/DAVInspector" /> </target> <target name="win32" if="isWindows"> @@ -73,7 +73,7 @@ <!-- Copy script files and icon --> <copy todir="${dist}"> - <fileset dir="." includes="*.bat, config.properties" /> + <fileset dir="." includes="*.bat, *.sh, config.properties" /> <fileset dir="resource" includes="*.ico" /> </copy> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wu...@us...> - 2008-02-26 16:53:06
|
Revision: 60 http://davinspector.svn.sourceforge.net/davinspector/?rev=60&view=rev Author: wuest Date: 2008-02-26 08:52:42 -0800 (Tue, 26 Feb 2008) Log Message: ----------- Added load and store of plugin configuration. Modified Paths: -------------- trunk/DAVInspector/src/de/dlr/davinspector/common/Constant.java trunk/DAVInspector/src/de/dlr/davinspector/configuration/Configuration.java trunk/DAVInspector/src/de/dlr/davinspector/plugin/PluginManager.java trunk/DAVInspector/src/de/dlr/davinspector/ui/AboutDialog.java trunk/DAVInspector/src/de/dlr/davinspector/ui/IMainController.java trunk/DAVInspector/src/de/dlr/davinspector/ui/MainController.java trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java trunk/DAVInspector/src/de/dlr/davinspector/ui/PluginConfigurationDialog.java Added Paths: ----------- trunk/DAVInspector/src/de/dlr/davinspector/configuration/PluginConfiguration.java Modified: trunk/DAVInspector/src/de/dlr/davinspector/common/Constant.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/common/Constant.java 2008-02-25 22:48:12 UTC (rev 59) +++ trunk/DAVInspector/src/de/dlr/davinspector/common/Constant.java 2008-02-26 16:52:42 UTC (rev 60) @@ -122,6 +122,11 @@ public static final String APP_CONFIGURATION_FILENAME = "config.properties"; /** + * Filename of the plugin configuration file. + */ + public static final String APP_PLUGIN_CONFIGURATION_FILENAME = "plugin-config.properties"; + + /** * Timeout waiting for a ChannelThread to finish in ms. */ public static final int RELAY_THREADTIMEOUT = 100; Modified: trunk/DAVInspector/src/de/dlr/davinspector/configuration/Configuration.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/configuration/Configuration.java 2008-02-25 22:48:12 UTC (rev 59) +++ trunk/DAVInspector/src/de/dlr/davinspector/configuration/Configuration.java 2008-02-26 16:52:42 UTC (rev 60) @@ -28,12 +28,9 @@ import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; -import java.util.List; import java.util.Properties; -import java.util.Vector; import de.dlr.davinspector.common.Constant; -import de.dlr.davinspector.plugin.IPlugin; /** @@ -70,46 +67,13 @@ private String myClientAddress; /** - * This list contains all plugins to view messages to the server. - */ - private List<IPlugin> myActivePluginsServer; - - /** - * This list contains all plugins to view messages to the client. - */ - private List<IPlugin> myActivePluginsClient; - - /** * Constructor, loads the configuration from the configuration file. */ public Configuration() { loadConfiguration(); - - // TODO: Load available plugins and check active-lists - - myActivePluginsServer = new Vector<IPlugin>(); - myActivePluginsClient = new Vector<IPlugin>(); } /** - * Returns a vector with activated plugins on the server side. - * - * @return Vector - */ - public List<IPlugin> getActivePluginsServer() { - return myActivePluginsServer; - } - - /** - * Returns a vector with activated plugins on the client side. - * - * @return Vector - */ - public List<IPlugin> getActivePluginsClient() { - return myActivePluginsClient; - } - - /** * Returns a String with the address of the server. * * @return String Added: trunk/DAVInspector/src/de/dlr/davinspector/configuration/PluginConfiguration.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/configuration/PluginConfiguration.java (rev 0) +++ trunk/DAVInspector/src/de/dlr/davinspector/configuration/PluginConfiguration.java 2008-02-26 16:52:42 UTC (rev 60) @@ -0,0 +1,160 @@ +/* + * PluginConfiguration.java + * + * This class stores and loads the plugin configuration. + * + * Created: 26.02.2008 Jochen Wuest <joc...@dl...> + * Changed: + * + * $Id$ + * + * Copyright 2007 Deutsches Zentrum fuer Luft- und Raumfahrt e.V. (DLR) + * + * Licensed 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 de.dlr.davinspector.configuration; + +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; + +import de.dlr.davinspector.common.Constant; + + +/** + * This class stores and loads the plugin configuration. + * + * @version $LastChangedRevision$ + * @author Jochen Wuest + */ +public class PluginConfiguration { + /** + * + */ + private Properties myProperties; + + /** + * This list contains the names of all plugins to view messages to the server. + */ + private List<String> myActivePluginsServer; + + /** + * This list contains the names of all plugins to view messages to the client. + */ + private List<String> myActivePluginsClient; + + /** + * Constructor, loads the configuration from the configuration file. + */ + public PluginConfiguration() { + myActivePluginsClient = new ArrayList<String>(); + myActivePluginsServer = new ArrayList<String>(); + loadConfiguration(); + } + + /** + * Returns a vector with the names of activated plugins on the server side. + * + * @return Vector + */ + public List<String> getActivePluginsServer() { + return myActivePluginsServer; + } + + /** + * Returns a vector with the names of activated plugins on the client side. + * + * @return Vector + */ + public List<String> getActivePluginsClient() { + return myActivePluginsClient; + } + /** + * This method sets the active plugins on the server side. + * + * @param activePlugins List of plugin names + */ + public void setActivePluginsServer(List<String> activePlugins) { + myActivePluginsServer = activePlugins; + } + + /** + * This method sets the active plugins on the server side. + * + * @param activePlugins List of plugin names + */ + public void setActivePluginsClient(List<String> activePlugins) { + myActivePluginsClient = activePlugins; + } + + /** + * This method loads the configuration from the configuration file. + */ + public void loadConfiguration() { + myProperties = new Properties(); + try { + myProperties.load(new FileInputStream(Constant.APP_PLUGIN_CONFIGURATION_FILENAME)); + // assign properties to variables + myActivePluginsClient = stringToStringList(myProperties.getProperty("PluginsClient", "")); + myActivePluginsServer = stringToStringList(myProperties.getProperty("PluginsServer", "")); + } catch (IOException ioe) { + System.err.println(ioe); + } + } + + /** + * This method stores the current configuration in the configuration file. + */ + public void storeConfiguration() { + // save variables in properties + myProperties.setProperty("PluginsClient", stringListToString(myActivePluginsClient)); + myProperties.setProperty("PluginsServer", stringListToString(myActivePluginsServer)); + try { + myProperties.store(new FileOutputStream(Constant.APP_PLUGIN_CONFIGURATION_FILENAME), null); + } catch (IOException ioe) { + System.err.println(ioe); + } + } + + /** + * Concatenates the list elements to a string. + * TODO: make separator constant or local var + * @param list List of strings + * @return String + */ + private String stringListToString(List<String> list) { + String result = ""; + for (String string : list) { + result += string.trim() + ","; + } + return result; + } + + /** + * Splits a string into elements and puts them into a list. + * + * @param string String + * @return List of strings. + */ + private List<String> stringToStringList(String string) { + List<String> result = new ArrayList<String>(); + for (String oneElement : string.split(",")) { + result.add(oneElement.trim()); + } + return result; + } +} Modified: trunk/DAVInspector/src/de/dlr/davinspector/plugin/PluginManager.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/plugin/PluginManager.java 2008-02-25 22:48:12 UTC (rev 59) +++ trunk/DAVInspector/src/de/dlr/davinspector/plugin/PluginManager.java 2008-02-26 16:52:42 UTC (rev 60) @@ -195,10 +195,6 @@ * @param pluginNames Vector */ public void setActivePluginsClient(List<String> pluginNames) { - // initialize client plugins - for (IPlugin plugin : myActivePluginsClient) { - plugin.setActive(false); - } // activate / deactivate client plugins for (IPlugin plugin : myActivePluginsClient) { plugin.setActive(pluginNames.contains(plugin.getName())); @@ -211,10 +207,6 @@ * @param pluginNames Vector */ public void setActivePluginsServer(List<String> pluginNames) { - // initialize client plugins - for (IPlugin plugin : myActivePluginsServer) { - plugin.setActive(false); - } // activate / deactivate server plugins for (IPlugin plugin : myActivePluginsServer) { plugin.setActive(pluginNames.contains(plugin.getName())); Modified: trunk/DAVInspector/src/de/dlr/davinspector/ui/AboutDialog.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/ui/AboutDialog.java 2008-02-25 22:48:12 UTC (rev 59) +++ trunk/DAVInspector/src/de/dlr/davinspector/ui/AboutDialog.java 2008-02-26 16:52:42 UTC (rev 60) @@ -38,7 +38,6 @@ import de.dlr.davinspector.common.Constant; import de.dlr.davinspector.common.Util; -import de.dlr.davinspector.ui.UIResource; /** * The about dialog displays information about the program. @@ -113,8 +112,6 @@ jContentPane.add(getJButtonOk(), BorderLayout.SOUTH); jContentPane.add(getJTextPane(), BorderLayout.CENTER); jContentPane.add(getJPanel(), BorderLayout.NORTH); -// jContentPane.setMargin(new Insets(10, 10, 10, 10)); - jContentPane.setBounds(10, 10, -1, -1); } return jContentPane; } @@ -156,7 +153,7 @@ jTextPane.setBackground(SystemColor.control); jTextPane.setEditable(false); jTextPane.setText("\nVersion " + Constant.APP_VERSION - + "\n\nApache 2.0 Lizenz\n(c) Copyright Jochen Wuest, DLR 2007-2008\n"); + + "\n\nApache 2.0 Lizenz\n(c) Copyright Jochen Wuest, Markus Litz, DLR 2007-2008\n"); // TODO: add icons and other stuff licenses } return jTextPane; Modified: trunk/DAVInspector/src/de/dlr/davinspector/ui/IMainController.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/ui/IMainController.java 2008-02-25 22:48:12 UTC (rev 59) +++ trunk/DAVInspector/src/de/dlr/davinspector/ui/IMainController.java 2008-02-26 16:52:42 UTC (rev 60) @@ -1,7 +1,7 @@ /* * IMainController.java * - * TODO: wues_ha Enter comment! + * This is the interface of the controller. * * Created: 29.01.2008 Jochen Wuest <joc...@dl...> * Changed: @@ -27,35 +27,40 @@ /** - * TODO: wues_ha: Enter comment! + * This is the interface of the controller. * * @version $LastChangedRevision$ * @author Jochen Wuest */ public interface IMainController { /** - * TODO: wues_ha: Enter comment! - * + * This method starts the relay with the current configuration. */ void startRelay(); /** - * TODO: wues_ha: Enter comment! - * + * This method stops the relay. */ void stopRelay(); /** - * TODO: wues_ha: Enter comment! + * This method writes data to the server. * * @param data String */ void writeToServer(String data); /** - * TODO: wues_ha: Enter comment! + * This method writes data to the client. * * @param data String */ void writeToClient(String data); + + /** + * Returns the main view. + * + * @return MainView + */ + MainView getView(); } Modified: trunk/DAVInspector/src/de/dlr/davinspector/ui/MainController.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/ui/MainController.java 2008-02-25 22:48:12 UTC (rev 59) +++ trunk/DAVInspector/src/de/dlr/davinspector/ui/MainController.java 2008-02-26 16:52:42 UTC (rev 60) @@ -38,12 +38,12 @@ public class MainController implements IMainController { /** - * + * The relay. */ private IRelayModel myRelay; /** - * + * The view. */ private MainView myView; @@ -93,4 +93,13 @@ public void writeToServer(String data) { myRelay.writeToServer(data); } + + /** + * {@inheritDoc} + * + * @see de.dlr.davinspector.ui.IMainController#getView() + */ + public MainView getView() { + return myView; + } } Modified: trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java 2008-02-25 22:48:12 UTC (rev 59) +++ trunk/DAVInspector/src/de/dlr/davinspector/ui/MainView.java 2008-02-26 16:52:42 UTC (rev 60) @@ -368,7 +368,7 @@ public void actionPerformed(ActionEvent e) { if (myPluginConfigurationDialog == null) { - myPluginConfigurationDialog = new PluginConfigurationDialog(jFrame, myPluginManager, getMain()); + myPluginConfigurationDialog = new PluginConfigurationDialog(jFrame, myPluginManager, myController.getView()); } myPluginConfigurationDialog.addPlugins(myPluginManager.getAvailablePlugins()); myPluginConfigurationDialog.setVisible(true); @@ -521,16 +521,6 @@ } /** - * TODO: Hmm, i do not like this! :-[ - * Maybe the use of a configuration change listener could improve this code - * - * @return MainView - */ - public MainView getMain() { - return this; - } - - /** * This method initializes jFrame. * * @return javax.swing.JFrame Modified: trunk/DAVInspector/src/de/dlr/davinspector/ui/PluginConfigurationDialog.java =================================================================== --- trunk/DAVInspector/src/de/dlr/davinspector/ui/PluginConfigurationDialog.java 2008-02-25 22:48:12 UTC (rev 59) +++ trunk/DAVInspector/src/de/dlr/davinspector/ui/PluginConfigurationDialog.java 2008-02-26 16:52:42 UTC (rev 60) @@ -41,6 +41,7 @@ import de.dlr.davinspector.common.Constant; import de.dlr.davinspector.common.Util; +import de.dlr.davinspector.configuration.PluginConfiguration; import de.dlr.davinspector.plugin.IPlugin; import de.dlr.davinspector.plugin.PluginManager; @@ -131,6 +132,9 @@ Boolean isAvailableForServer = false; // empty the table first myTableModel.setRowCount(0); + + // Load the states of the plugins from the configuration. + PluginConfiguration myPluginConfiguration = new PluginConfiguration(); for (IPlugin plugin : availablePlugins) { if (plugin.getType() == (IPlugin.PlugInType.VIEW_CLIENT) @@ -146,8 +150,11 @@ isAvailableForServer = true; } myAvailablePlugins.put(plugin.getName(), new Boolean[] {isAvailableForClient, isAvailableForServer}); - // TODO: Loading states of the plugins from the configuration - myTableModel.addRow(new Object[]{false, false, plugin.getName(), + + Boolean clientEnabled = myPluginConfiguration.getActivePluginsClient().contains(plugin.getName()); + Boolean serverEnabled = myPluginConfiguration.getActivePluginsServer().contains(plugin.getName()); + + myTableModel.addRow(new Object[]{clientEnabled, serverEnabled, plugin.getName(), plugin.getVersion(), plugin.getAuthor(), plugin.getDescription()}); } myTableModel.fireTableDataChanged(); @@ -258,6 +265,12 @@ myPluginManager.setActivePluginsClient(clientPlugins); myPluginManager.setActivePluginsServer(serverPlugins); + // Store the states of the plugins to the configuration file. + PluginConfiguration myPluginConfiguration = new PluginConfiguration(); + myPluginConfiguration.setActivePluginsClient(clientPlugins); + myPluginConfiguration.setActivePluginsServer(serverPlugins); + myPluginConfiguration.storeConfiguration(); + closeWindow(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |