[ANN] Dilbert Daily Strip Plug-in 1.0 for IDEA 5.0

My First Plug-in is available for download from the plug-in manager (for
build 3436 i.e. IDEA 5.0 or later). It's a simple plug-in that displays
the current Dilbert strip in a tool window.

Source is included and may be useful for anyone interested in having a
Perl-to-mail CGI script for accepting plug-in error reports.

Thanks to Rick Maddy and Stefan Stiller for making the source to their
Coypright and SQL Query plug-ins available - both were very useful to me
in several respects.

--
Mark Scott
mark@codebrewer.com

15 comments


1) Very clever, and I'll be using some of your work in other plugins, particularly the help system integration. Good job, very sweet, and congratuations.

2) In spite of a configuration screen that's too clever by half, it's you that's violating the dilbert.com terms of service, and potentially infringing on Scott Adams copyright. I'm not a lawyer, but I my guess is JetBrains should remove this plugin from plugins.jetbrains.com ASAP, so as to avoid any potential legal entanglements.

--Dave Griffith

0

Don't think you're using the HTTP proxy settings. I get this error when I try and use the plugin:


Couldn't get Dilbert daily strip: www.dilbert.com
java.net.UnknownHostException: www.dilbert.com
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:364)
at java.net.Socket.connect(Socket.java:507)
at java.net.Socket.connect(Socket.java:457)
at java.net.Socket.(Socket.java:365) at java.net.Socket.]]>(Socket.java:238)
at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:79)
at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:121)
at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:704)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:382)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:168)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:324)
at org.codebrewer.idea.dilbert.DilbertDailyStripPluginImpl.fetchDailyStrip(DilbertDailyStripPluginImpl.java:203)
at org.codebrewer.idea.dilbert.DilbertDailyStripPluginImpl.fetchDailyStrip(DilbertDailyStripPluginImpl.java:180)
at org.codebrewer.idea.dilbert.ui.DailyStripPanel$RefreshDailyStripAction.fetchDailyStrip(DailyStripPanel.java:280)
at org.codebrewer.idea.dilbert.ui.DailyStripPanel$RefreshDailyStripAction.actionPerformed(DailyStripPanel.java:263)
at com.intellij.openapi.actionSystem.impl.ActionButton.performAction(ActionButton.java:62)
at com.intellij.openapi.actionSystem.impl.ActionButton.processMouseEvent(ActionButton.java:27)
at java.awt.Component.processEvent(Component.java:5253)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1774)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:19)
at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:41)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:37)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

0

Doesn't work for me because the proxy authentication configured in IDEA settings seems not to be used.

:(

Looks cool, apart from this.

0

On Mon, 03 Oct 2005 06:05:25 +0400, Dave Griffith wrote:

1) Very clever, and I'll be using some of your work in other plugins,
particularly the help system integration. Good job, very sweet, and
congratuations.


Thanks very much for the feedback and encouragement. The help system
integration was shamelessly inspired by the SQL Query plug-in. It's a
shame such (IMO) awful markup is required by the Swing components. You
should find the source for the current version a lot cleaner since I've
used a colleague's more demanding inspection profile on this release.

2) In spite of a configuration screen that's too clever by half, it's
you that's violating the dilbert.com terms of service, and potentially
infringing on Scott Adams copyright. I'm not a lawyer, but I my guess
is JetBrains should remove this plugin from plugins.jetbrains.com ASAP,
so as to avoid any potential legal entanglements.


I'll take "too clever by half" as a compliment, if I may :)

I'm no lawyer either and have no intention of arguing a case as if I were.
If JetBrains decides to remove the plug-in then so be it. Perhaps any
future plug-in project will have a less controversial aim.

--
Mark Scott
mark@codebrewer.com

0

On Mon, 03 Oct 2005 17:50:11 +0400, Chris Sherratt wrote:

Don't think you're using the HTTP proxy settings.


Indeed I wasn't - thanks for reporting. Please try 1.0.1, recently
uploaded to the plug-ins repository after testing with Squid. Also note
that <http://www.jetbrains.net/jira/browse/IDEABKL-1509> can bite if you
don't ask IDEA to remember your proxy authentication credentials (but I
guess you may already know that if you need to authenticate).

--
Mark Scott
mark@codebrewer.com

0

On Wed, 05 Oct 2005 12:36:32 +0400, Frank Bruch wrote:

Doesn't work for me because the proxy authentication configured in IDEA
settings seems not to be used.


Please see my reply to Chris.

Looks cool, apart from this.


Thanks!

--
Mark Scott
mark@codebrewer.com

0

Thanks for updating. Unfortunately it doesn't work for me. I remember that different types of proxy-servers require different java-code for authorization but can't provide details any more details now, sorry.

Anybode else with this problem?

0

:( Presumably you can get to the plug-ins repository through the proxy?

I use the same proxy settings as IDEA and, if proxy authentication is
selected, a (non-OpenAPI, I believe) method that indirectly displays the
(broken) proxy settings dialog if the password hasn't been saved.

Sniffing packets shows the same authentication header being added by IDEA
(when it downloads all the plug-in data) as the plug-in (when it fetches
the cartoon strip).

Can you find out which proxy server you're using, and what sort of
authentication mechanism it expects? I'm happy to try to find a solution
that works for you if you can provide information that helps.

--
Mark Scott
mark@codebrewer.com

0

Yes, Mark, accessing the plugin repository works fine.

I just got the following code working here:

System.setProperty("proxySet", "true");
System.setProperty("http.proxyHost", "proxy-web");
System.setProperty("http.proxyPort", "8080");
System.setProperty("http.proxyUser", username);
System.setProperty("http.proxyPassword", password);

URL url = new URL("http://java.sun.com/index.html");
URLConnection conn = url.openConnection();

sun.misc.BASE64Encoder encoder = new BASE64Encoder();
String tAuth = "Basic " + encoder.encode((username + ":" + password).getBytes());
conn.setRequestProperty("Proxy-Authorization", tAuth);

Code I found in the internet mostly lacks the prefix "Basic " without which it doesn't work here.

I don't know exactly what proxy server is used here, probably squid, a plain http proxy, that's for sure.

Thanks
Frank Bruch

0

Hi Mark,

just thought about integrating dilbert in the welcome screen, too. I would like that.

Frank

0

The code you posted is pretty much what IDEA's proxy-related code does,
IIRC. The problem is that I use the Jakarta Commons HttpClient to get a
higher-level API to HTTP.

It seems I misunderstood some of their APIs and I think that using
"pre-emptive authorization" with the proxy will do the trick. Without
this, HttpClient only sends proxy authorization information when the
proxy server responds with HTTP code 407. If this response is received
then it tries again but with the Proxy-Authorization header added.

My guess is that your proxy server isn't responding with code 407.

I've made a plug-in build that uses pre-emptive authorization. Can I mail
it to you for testing (rather than make a pointless upload to the plug-ins
repository should it not fix the problem you're having)? You can mail me
at the address in my sig.

--
Mark Scott
mark@codebrewer.com

0

On Wed, 19 Oct 2005 23:05:50 +0100, Mark Scott wrote:

You can mail me at the address in my sig.


If you'd like to test and you don't want to post your email address here,
that is.

--
Mark Scott
mark@codebrewer.com

0

On Mon, 17 Oct 2005 19:20:47 +0400, Frank Bruch wrote:

just thought about integrating dilbert in the welcome screen, too. I
would like that.


The welcome screen? The thing you see if you have no projects open? I
didn't know plug-ins could integrate with that...

--
Mark Scott
mark@codebrewer.com

0

Oh, perhaps they couldn't.

I remembered this thread

http://www.intellij.net/forums/thread.jsp?forum=22&thread=132059&message=3535210&q=77656c636f6d6520617069#3535210

The reply from Ann Oreshnikova at least stated that this api is planned.

For me Dilbert would be a finde candidate for free area at the bottom.

Maybe we can reactivate this thread or start a new one in the open api forum?

0

Please sign in to leave a comment.