Google Groups Home
Help | Sign in
Custom dashboard plugins not loading
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
trey  
View profile
 More options Apr 18, 11:26 am
From: trey <t...@bytemellc.com>
Date: Fri, 18 Apr 2008 08:26:06 -0700 (PDT)
Local: Fri, Apr 18 2008 11:26 am
Subject: Custom dashboard plugins not loading
I originally posted this message on the users mailing list, and was
directed to post it here. Original message follows:
---------------------

I've developed a custom web dashboard plugin, as per the details
listed here: http://confluence.public.thoughtworks.org/display/CCNET/Developing+We...

I'm using ccnet-1.2.1.

I've been working on a project plugin, and I define the plugin in the
dashboard's config file like so:
<projectPlugins>
 ...
  <propertiesPlugin />
</projectPlugins>

Where my custom plugin is named "propertiesPlugin".

When I include this xml element definition, I receive a
NullReferenceException being reported from the asp.net app through the
web browser. If I omit the declaration, the dashboard works as
expected, but without the benefit of my plugin(obviously).

I downloaded the source for 1.2.1, and I found the problem. The
SetupObjectSourceForRequest method of the
CruiseObjectSourceInitializer object(in the dashboard project) is
looping through all of the
named actions in the plugin, via the following line of code:
foreach (INamedAction action in plugin.NamedActions)

However, the plugin object is null. Upon further inspection, it
appears that the plugins collection has the correct number of
elements, but the last element is null. I traced code execution back
into the Load method of the DashboardConfigurationLoader class. The
line of code in this method that seems to be the root cause is as
follows:
typeTable.Add(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Locatio n),
"ccnet.*.plugin.dll");

It appears that the type table is attempting to load all of the types
decorated with the ReflectorType attribute from all ccnet.*.plugin.dll
assemblies, located in the same folder as the executing assembly. That
makes sense; and is what I expected from the documentation.

However, Assembly.GetExecutingAssembly().Location does not return the
result that I was expecting. The result is some long path buried deep
somewhere in the windows temp folder. I assume that this is due to
asp.net's shadow copying.

So - the point? What's the solution? Can shadow-copying be disabled
only for the ccnet dashboard app? I rather think this behavior is a
defect, and would be difficult to reproduce within an nunit test
case.

Thoughts?


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ross Patterson  
View profile
 More options Apr 18, 2:19 pm
From: "Ross Patterson" <RPatter...@qknow.com>
Date: Fri, 18 Apr 2008 14:19:33 -0400
Local: Fri, Apr 18 2008 2:19 pm
Subject: RE: [ccnet-devel] Custom dashboard plugins not loading

trey writes:
>I traced code execution back
>into the Load method of the DashboardConfigurationLoader class. The
>line of code in this method that seems to be the root cause is as
>follows:
>typeTable.Add(Path.GetDirectoryName(Assembly.GetExecutingAssembly()
>.Location),"ccnet.*.plugin.dll");

Ticket CCNET-1130 has been opened and resolved for this.

Ross
________________________________

Ross A. Patterson, CISSP
Sr. Director, Development
Tel:  +1 703-390-0865
RPatter...@QKnow.com

Q.Know Technologies, Inc.
11600 Sunrise Valley Drive, Suite 300
Reston, VA  20191
www.QKnow.com


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
trey  
View profile
 More options Apr 18, 4:17 pm
From: trey <t...@bytemellc.com>
Date: Fri, 18 Apr 2008 13:17:15 -0700 (PDT)
Local: Fri, Apr 18 2008 4:17 pm
Subject: Re: Custom dashboard plugins not loading
Awesome, and thanks for the fast turn-around.

Ignorant question re: the license; can I modify that in my own copy of
the 1.2.1 source and redeploy the dashboard assembly to my private
build environment without breaking the license?

On Apr 18, 1:19 pm, "Ross Patterson" <RPatter...@qknow.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ross Patterson  
View profile
 More options Apr 18, 4:48 pm
From: "Ross Patterson" <RPatter...@qknow.com>
Date: Fri, 18 Apr 2008 16:48:05 -0400
Local: Fri, Apr 18 2008 4:48 pm
Subject: RE: [ccnet-devel] Re: Custom dashboard plugins not loading

trey writes:
>Ignorant question re: the license; can I modify that in my own copy of
>the 1.2.1 source and redeploy the dashboard assembly to my private
>build environment without breaking the license?

I Am Not A Lawyer, but I understand the answer to be "yes".  There is
nothing in the ThoughtWorks Open Source Software License
(http://confluence.public.thoughtworks.org/display/CCNET/License) that
limits how you use CCNet, only how you "redistribute" it.
Redistribution is commonly understood in the Open Source community as
the GNU General Public License 3 (http://www.gnu.org/licenses/gpl.html)
defines "propagate":

        To "propagate" a work means to do anything with it that, without
        permission, would make you directly or secondarily liable for
        infringement under applicable copyright law, except executing it
        on a computer or modifying a private copy. Propagation includes
        copying, distribution (with or without modification), making
        available to the public, and in some countries other activities
        as well.

Ross
________________________________

Ross A. Patterson, CISSP
Sr. Director, Development
Tel:  +1 703-390-0865
RPatter...@QKnow.com

Q.Know Technologies, Inc.
11600 Sunrise Valley Drive, Suite 300
Reston, VA  20191
www.QKnow.com


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
trey  
View profile
 More options Apr 18, 7:31 pm
From: trey <t...@bytemellc.com>
Date: Fri, 18 Apr 2008 16:31:35 -0700 (PDT)
Local: Fri, Apr 18 2008 7:31 pm
Subject: Re: Custom dashboard plugins not loading
Thanks for the feedback Ross.

BTW - I made the change locally, and ran into one more issue. The
CodeBase property of the assembly returns the full path in the form of
a file uri("file:///", for example). The Path.GetDirectoryName method
fails on receiving this text.

So the proper code should look something like this:

Uri uri = Assembly.GetExecutingAssembly().CodeBase;
...Path.Combine( Path.GetDirectoryName( uri.AbsolutePath ) ,
"ccnet.*.plugin.dll" )

I apologize for the ellipses; trying to recall the code off the top of
my head.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Daniel Hommel  
View profile
 More options Apr 20, 12:38 pm
From: Daniel Hommel <daniel.hom...@it-designers.de>
Date: Sun, 20 Apr 2008 18:38:23 +0200
Local: Sun, Apr 20 2008 12:38 pm
Subject: Re: Custom dashboard plugins not loading

trey writes:
> So the proper code should look something like this:

> Uri uri = Assembly.GetExecutingAssembly().CodeBase;
> ...Path.Combine( Path.GetDirectoryName( uri.AbsolutePath ) ,
> "ccnet.*.plugin.dll" )

Here is a patch that contains the mentioned adjustment. It should work
nicely now.

regards,

Daniel

[ CodeBase.patch 1K ]
Index: project/WebDashboard/Configuration/DashboardConfigurationLoader.cs
===================================================================
--- project/WebDashboard/Configuration/DashboardConfigurationLoader.cs  (revision 3828)
+++ project/WebDashboard/Configuration/DashboardConfigurationLoader.cs  (working copy)
@@ -65,7 +65,8 @@
             {
                 newTypeTable.Add(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, searchPathDir), CONFIG_ASSEMBLY_PATTERN);
             }
-                   newTypeTable.Add(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Code Base), CONFIG_ASSEMBLY_PATTERN);
+                       Uri codeBase = new Uri(Assembly.GetExecutingAssembly().CodeBase);
+                   newTypeTable.Add(Path.GetDirectoryName(codeBase.AbsolutePath), CONFIG_ASSEMBLY_PATTERN);
                        return newTypeTable;
                }


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ross Patterson  
View profile
 More options Apr 20, 1:05 pm
From: "Ross Patterson" <RPatter...@qknow.com>
Date: Sun, 20 Apr 2008 13:05:39 -0400
Local: Sun, Apr 20 2008 1:05 pm
Subject: RE: [ccnet-devel] Re: Custom dashboard plugins not loading

Daniel Hommel writes:
>trey writes:
>> So the proper code should look something like this:

>> Uri uri = Assembly.GetExecutingAssembly().CodeBase;
>> ...Path.Combine( Path.GetDirectoryName( uri.AbsolutePath ) ,
>> "ccnet.*.plugin.dll" )

>Here is a patch that contains the mentioned adjustment. It should work
>nicely now.

Thanks!  Obviously we don't have enough unit tests for the dashboard,
since my bad change passed NUnit.  Committed as revision #3829 and
ticket updated.

Ross
________________________________

Ross A. Patterson, CISSP
Sr. Director, Development
Tel:  +1 703-390-0865
RPatter...@QKnow.com

Q.Know Technologies, Inc.
11600 Sunrise Valley Drive, Suite 300
Reston, VA  20191
www.QKnow.com


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google