inserting my own html into hudson

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

inserting my own html into hudson

Gregory Kick-2
I want to add google analytics to hudson.  Is there an easy way to do
that?  I think it might be the fact that I have absolutely no idea how
stapler works, but i can't figure out where the html is coming from...

--
Gregory Kick
http://kickstyle.net/

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: inserting my own html into hudson

Kohsuke Kawaguchi
Administrator
Gregory Kick wrote:
> I want to add google analytics to hudson.  Is there an easy way to do
> that?  I think it might be the fact that I have absolutely no idea how
> stapler works, but i can't figure out where the html is coming from...

See http://stapler.dev.java.net/ for more about stapler.

Assuming you are willing to touch the source code, the place to do this
kind of stuff is in layout.jelly.

Beyond that, I think we should define an extension point to let you
inject some HTML into the <head> section and the footer portion, so that
you can this kind of stuff as a plugin.

Another plugin that can exploit the same extension point is to show a
single line like "serving 10,423 builds to date".

--
Kohsuke Kawaguchi
Sun Microsystems                   [hidden email]

smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: inserting my own html into hudson

Gregory Kick-2
I was taking a look at this and wonderd how we would go about exposing
this for plugins.  I don't know anything at all about jelly so i'm not
sure what it has access to for rendering pages that the plugins would
be able to populate.  If you can point me to what data structure to
use, I'll do the work of modifying layout.jelly and putting together a
plugin for google analytics.

On 4/13/07, Kohsuke Kawaguchi <[hidden email]> wrote:

> Gregory Kick wrote:
> > I want to add google analytics to hudson.  Is there an easy way to do
> > that?  I think it might be the fact that I have absolutely no idea how
> > stapler works, but i can't figure out where the html is coming from...
>
> See http://stapler.dev.java.net/ for more about stapler.
>
> Assuming you are willing to touch the source code, the place to do this
> kind of stuff is in layout.jelly.
>
> Beyond that, I think we should define an extension point to let you
> inject some HTML into the <head> section and the footer portion, so that
> you can this kind of stuff as a plugin.
>
> Another plugin that can exploit the same extension point is to show a
> single line like "serving 10,423 builds to date".
>
> --
> Kohsuke Kawaguchi
> Sun Microsystems                   [hidden email]
>
>


--
Gregory Kick
http://kickstyle.net/

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: inserting my own html into hudson

Kohsuke Kawaguchi
Administrator
Jelly can be used like JSP at its lowest level. Stapler gives it an
"it" variable to access the current object. So the basic idea is to
define an extension point

 abstract class HeaderCustomizer implements ExtensionPoint {}
 abstract class FooterCustomizer implements ExtensionPoint {}

and have the Hudson object owns the list of them, then have plugins
register instances of those to Hudson.

Those objects can have "index.jelly" views (or any other name that
layout.jelly calls to inject additional HTMLs.

If you can take care of the data structure part, I'm happy to modify
Jelly side. Hopefully you can see my changes and figre out how to do
those things going forward.

2007/4/23, Gregory Kick <[hidden email]>:
> I was taking a look at this and wonderd how we would go about exposing
> this for plugins.  I don't know anything at all about jelly so i'm not
> sure what it has access to for rendering pages that the plugins would
> be able to populate.  If you can point me to what data structure to
> use, I'll do the work of modifying layout.jelly and putting together a
> plugin for google analytics.

--
Kohsuke Kawaguchi

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: inserting my own html into hudson

Gregory Kick-2
I finally got some time to work on this, but I can't get hudson to build...

when mvn install gets to the core, it fails with

[INFO] [stapler:apt-compile]
[INFO] Compiling 235 source files to
/Users/gk5885/Developer/java/hudson/hudson/main/core/target/classes
/Users/gk5885/Developer/java/hudson/hudson/main/core/src/main/java/hudson/Functions.java:42:
cannot find symbol
symbol  : class MonitorInfo
location: package java.lang.management
import java.lang.management.MonitorInfo;

and a bunch more cannot find symbol errors.  I'm building with java
1.5 so I don't get how that's even possible...  any thoughts?

On 4/25/07, Kohsuke Kawaguchi <[hidden email]> wrote:

> Jelly can be used like JSP at its lowest level. Stapler gives it an
> "it" variable to access the current object. So the basic idea is to
> define an extension point
>
>  abstract class HeaderCustomizer implements ExtensionPoint {}
>  abstract class FooterCustomizer implements ExtensionPoint {}
>
> and have the Hudson object owns the list of them, then have plugins
> register instances of those to Hudson.
>
> Those objects can have "index.jelly" views (or any other name that
> layout.jelly calls to inject additional HTMLs.
>
> If you can take care of the data structure part, I'm happy to modify
> Jelly side. Hopefully you can see my changes and figre out how to do
> those things going forward.
>
> 2007/4/23, Gregory Kick <[hidden email]>:
> > I was taking a look at this and wonderd how we would go about exposing
> > this for plugins.  I don't know anything at all about jelly so i'm not
> > sure what it has access to for rendering pages that the plugins would
> > be able to populate.  If you can point me to what data structure to
> > use, I'll do the work of modifying layout.jelly and putting together a
> > plugin for google analytics.
>
> --
> Kohsuke Kawaguchi
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
Gregory Kick
http://kickstyle.net/

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: inserting my own html into hudson

Rintcius Blok
I had something similar using java 1.5. Somewhere on the users list
Kohsuke mentioned that java1.6 must be used instead.
That solved the problem for me.
Maybe this should be documented somewhere on the website?

Rintcius


Gregory Kick wrote:

> I finally got some time to work on this, but I can't get hudson to
> build...
>
> when mvn install gets to the core, it fails with
>
> [INFO] [stapler:apt-compile]
> [INFO] Compiling 235 source files to
> /Users/gk5885/Developer/java/hudson/hudson/main/core/target/classes
> /Users/gk5885/Developer/java/hudson/hudson/main/core/src/main/java/hudson/Functions.java:42:
>
> cannot find symbol
> symbol  : class MonitorInfo
> location: package java.lang.management
> import java.lang.management.MonitorInfo;
>
> and a bunch more cannot find symbol errors.  I'm building with java
> 1.5 so I don't get how that's even possible...  any thoughts?
>
> On 4/25/07, Kohsuke Kawaguchi <[hidden email]> wrote:
>> Jelly can be used like JSP at its lowest level. Stapler gives it an
>> "it" variable to access the current object. So the basic idea is to
>> define an extension point
>>
>>  abstract class HeaderCustomizer implements ExtensionPoint {}
>>  abstract class FooterCustomizer implements ExtensionPoint {}
>>
>> and have the Hudson object owns the list of them, then have plugins
>> register instances of those to Hudson.
>>
>> Those objects can have "index.jelly" views (or any other name that
>> layout.jelly calls to inject additional HTMLs.
>>
>> If you can take care of the data structure part, I'm happy to modify
>> Jelly side. Hopefully you can see my changes and figre out how to do
>> those things going forward.
>>
>> 2007/4/23, Gregory Kick <[hidden email]>:
>> > I was taking a look at this and wonderd how we would go about exposing
>> > this for plugins.  I don't know anything at all about jelly so i'm not
>> > sure what it has access to for rendering pages that the plugins would
>> > be able to populate.  If you can point me to what data structure to
>> > use, I'll do the work of modifying layout.jelly and putting together a
>> > plugin for google analytics.
>>
>> --
>> Kohsuke Kawaguchi
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: inserting my own html into hudson

Gregory Kick-2
AH!  You're right.  I saw java.lang.management and thought "that's in
1.5, i should be ok."  I'll try again with 1.6 and see what happens.

On 5/4/07, Rintcius Blok <[hidden email]> wrote:

> I had something similar using java 1.5. Somewhere on the users list
> Kohsuke mentioned that java1.6 must be used instead.
> That solved the problem for me.
> Maybe this should be documented somewhere on the website?
>
> Rintcius
>
>
> Gregory Kick wrote:
> > I finally got some time to work on this, but I can't get hudson to
> > build...
> >
> > when mvn install gets to the core, it fails with
> >
> > [INFO] [stapler:apt-compile]
> > [INFO] Compiling 235 source files to
> > /Users/gk5885/Developer/java/hudson/hudson/main/core/target/classes
> > /Users/gk5885/Developer/java/hudson/hudson/main/core/src/main/java/hudson/Functions.java:42:
> >
> > cannot find symbol
> > symbol  : class MonitorInfo
> > location: package java.lang.management
> > import java.lang.management.MonitorInfo;
> >
> > and a bunch more cannot find symbol errors.  I'm building with java
> > 1.5 so I don't get how that's even possible...  any thoughts?
> >
> > On 4/25/07, Kohsuke Kawaguchi <[hidden email]> wrote:
> >> Jelly can be used like JSP at its lowest level. Stapler gives it an
> >> "it" variable to access the current object. So the basic idea is to
> >> define an extension point
> >>
> >>  abstract class HeaderCustomizer implements ExtensionPoint {}
> >>  abstract class FooterCustomizer implements ExtensionPoint {}
> >>
> >> and have the Hudson object owns the list of them, then have plugins
> >> register instances of those to Hudson.
> >>
> >> Those objects can have "index.jelly" views (or any other name that
> >> layout.jelly calls to inject additional HTMLs.
> >>
> >> If you can take care of the data structure part, I'm happy to modify
> >> Jelly side. Hopefully you can see my changes and figre out how to do
> >> those things going forward.
> >>
> >> 2007/4/23, Gregory Kick <[hidden email]>:
> >> > I was taking a look at this and wonderd how we would go about exposing
> >> > this for plugins.  I don't know anything at all about jelly so i'm not
> >> > sure what it has access to for rendering pages that the plugins would
> >> > be able to populate.  If you can point me to what data structure to
> >> > use, I'll do the work of modifying layout.jelly and putting together a
> >> > plugin for google analytics.
> >>
> >> --
> >> Kohsuke Kawaguchi
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [hidden email]
> >> For additional commands, e-mail: [hidden email]
> >>
> >>
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
Gregory Kick
http://kickstyle.net/

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: inserting my own html into hudson

Kohsuke Kawaguchi
Administrator
There's another generics related issue that requires Java6 compiler,
so we really need Java6 to develop Hudson. This library dependency is
in a probe code, so it shouldn't be too much of a problem.

But we do need to be careful not to introduce other 1.6 dependencies.
I often make a mistake of using IOException(String,Throwable)
constructor, for example.

2007/5/3, Gregory Kick <[hidden email]>:

> AH!  You're right.  I saw java.lang.management and thought "that's in
> 1.5, i should be ok."  I'll try again with 1.6 and see what happens.
>
> On 5/4/07, Rintcius Blok <[hidden email]> wrote:
> > I had something similar using java 1.5. Somewhere on the users list
> > Kohsuke mentioned that java1.6 must be used instead.
> > That solved the problem for me.
> > Maybe this should be documented somewhere on the website?
> >
> > Rintcius
> >
> >
> > Gregory Kick wrote:
> > > I finally got some time to work on this, but I can't get hudson to
> > > build...
> > >
> > > when mvn install gets to the core, it fails with
> > >
> > > [INFO] [stapler:apt-compile]
> > > [INFO] Compiling 235 source files to
> > > /Users/gk5885/Developer/java/hudson/hudson/main/core/target/classes
> > > /Users/gk5885/Developer/java/hudson/hudson/main/core/src/main/java/hudson/Functions.java:42:
> > >
> > > cannot find symbol
> > > symbol  : class MonitorInfo
> > > location: package java.lang.management
> > > import java.lang.management.MonitorInfo;
> > >
> > > and a bunch more cannot find symbol errors.  I'm building with java
> > > 1.5 so I don't get how that's even possible...  any thoughts?
> > >
> > > On 4/25/07, Kohsuke Kawaguchi <[hidden email]> wrote:
> > >> Jelly can be used like JSP at its lowest level. Stapler gives it an
> > >> "it" variable to access the current object. So the basic idea is to
> > >> define an extension point
> > >>
> > >>  abstract class HeaderCustomizer implements ExtensionPoint {}
> > >>  abstract class FooterCustomizer implements ExtensionPoint {}
> > >>
> > >> and have the Hudson object owns the list of them, then have plugins
> > >> register instances of those to Hudson.
> > >>
> > >> Those objects can have "index.jelly" views (or any other name that
> > >> layout.jelly calls to inject additional HTMLs.
> > >>
> > >> If you can take care of the data structure part, I'm happy to modify
> > >> Jelly side. Hopefully you can see my changes and figre out how to do
> > >> those things going forward.
> > >>
> > >> 2007/4/23, Gregory Kick <[hidden email]>:
> > >> > I was taking a look at this and wonderd how we would go about exposing
> > >> > this for plugins.  I don't know anything at all about jelly so i'm not
> > >> > sure what it has access to for rendering pages that the plugins would
> > >> > be able to populate.  If you can point me to what data structure to
> > >> > use, I'll do the work of modifying layout.jelly and putting together a
> > >> > plugin for google analytics.
> > >>
> > >> --
> > >> Kohsuke Kawaguchi
> > >>
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: [hidden email]
> > >> For additional commands, e-mail: [hidden email]
> > >>
> > >>
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]
> > For additional commands, e-mail: [hidden email]
> >
> >
>
>
> --
> Gregory Kick
> http://kickstyle.net/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
Kohsuke Kawaguchi

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: inserting my own html into hudson

Jesse Glick
Kohsuke Kawaguchi wrote:
> But we do need to be careful not to introduce other 1.6 dependencies.
> I often make a mistake of using IOException(String,Throwable)
> constructor, for example.

Can you use -bootclasspath? If not, consider some sort of test which
checks that all classes found in hudson.jar are resolvable. Might be
enough, not sure.

-J.

--
[hidden email]  netbeans.org  ant.apache.org  hudson.dev.java.net
             http://google.com/search?q=e%5E%28pi*i%29%2B1

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: inserting my own html into hudson

Kohsuke Kawaguchi
Administrator
Ah, I didn't think of that.

With Ant, that would be a breeze (except that CVS checkout would need
to check out the rt.jar) Now the trick to how to convince Maven to do
that.

And I guess if we are to do that, I need to replace thread dump view
with reflection or Groovy script.

2007/5/5, Jesse Glick <[hidden email]>:

> Kohsuke Kawaguchi wrote:
> > But we do need to be careful not to introduce other 1.6 dependencies.
> > I often make a mistake of using IOException(String,Throwable)
> > constructor, for example.
>
> Can you use -bootclasspath? If not, consider some sort of test which
> checks that all classes found in hudson.jar are resolvable. Might be
> enough, not sure.
>
> -J.
>
> --
> [hidden email]  netbeans.org  ant.apache.org  hudson.dev.java.net
>              http://google.com/search?q=e%5E%28pi*i%29%2B1
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
Kohsuke Kawaguchi

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]