continuum-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Venisse <emman...@venisse.net>
Subject Re: writing a notifier
Date Wed, 10 Oct 2007 07:02:48 GMT


Michael Masters a écrit :
> I have a whole new set of questions now :)
> 
> 
> I am using continuum Version 1.1-beta-3. I have jar'ed up my code and 
> added the jar to apps/continuum/webapp/WEB-INF/lib/. I have used the web 
> interface to continuum to set up the IRC notifier and that is working. I 
> don't see how to configure the project to call my notifier.

If you added a irc notifier to your project group or your project, it will be used by continuum
for each build. You don't need more configuration.

> 
> Also, can you provide some insight on what I need to do to get a gui set 
> up for my notifier. I assume this also requires some additional 
> configuration to persist values.

To add a notifier in the UI, you can follow this steps:

- modify WEB-INF/jsp/notifier/notifierSelectType.jsp to add your notifier in the select field,
the key is the role_hint of your component(rally-continuum)
- In WEB-INF/classes/xwork.xml, add a new result in addProjectNotifier and in addProjectGroupNotifier
actions (<result name="rally-continuum_input">/WEB-INF/jsp/notifier/notifierRally.jsp</result>)
- Create the jsp WEB-INF/jsp/notifier/notifierRally.jsp
- Create IrcProjectNotifierEditAction and IrcGroupNotifierEditAction classes with edit and
save methods
- Declare edit and save actions for the group in xwork.xml:
     <action name="rallyProjectGroupNotifierEdit" class="rallyGroupNotifierEdit" method="edit">
       <result name="success">/WEB-INF/jsp/notifier/notifierRally.jsp</result>
     </action>

     <action name="rallyProjectGroupNotifierSave" class="rallyGroupNotifierEdit" method="save">
       <result name="input">/WEB-INF/jsp/notifier/notifierRally.jsp</result>
       <result name="success" type="chain">projectGroupNotifier</result>
     </action>
- Add <result name="rally-component_input" type="chain">rallyProjectGroupNotifierEdit</result>
in editProjectGroupNotifier action in xwork.xml
- Declare edit and save actions for the project in xwork.xml:
     <action name="rallyProjectNotifierEdit" class="rallyNotifierEdit" method="edit">
       <result name="success">/WEB-INF/jsp/notifier/notifierRally.jsp</result>
     </action>

     <action name="rallyProjectNotifierSave" class="rallyNotifierEdit" method="save">
       <result name="success" type="chain">projectView</result>
       <result name="to_group_page" type="chain">projectGroupNotifier</result>
     </action>
- Add <result name="rally-component_input" type="chain">rallyProjectNotifierEdit</result>
in editProjectNotifier action in xwork.xml

- Restart Continuum

Emmanuel

> 
> Thanks in advance,
> Mike Masters
> 
> ##################################################################
> # I have created the following test class:
> ##################################################################
> 
> 
> package com.rallydev.integration.build.continuum;
> 
> 
> import org.apache.maven.continuum.notification.AbstractContinuumNotifier;
> 
> import java.util.Iterator;
> import java.util.List;
> import java.util.Map;
> import java.util.Properties;
> import java.util.Set;
> 
> public class RallyContinuumNotifier
>     extends AbstractContinuumNotifier
> {
> 
>     public void sendNotification( String source, Set recipients, Map 
> configuration, Map context ) {
>         getLogger().info("THIS IS MY TEST from sendNotification 4 arg");
>     }
> 
>     public void sendNotification( String arg0, Set arg1, Properties arg2 
> ) {
>         getLogger().info("THIS IS MY TEST from sendNotification 3 arg");
>     }
> }
> 
> ##################################################################
> # I have the following in apps/continuum/conf/application.xml
> ##################################################################
> <application>
>   <services>
>     <service>
>       <id>jetty</id>
>       <configuration>
>         <webapps>
>           <webapp>
>             <file>${plexus.home}/lib/continuum-webapp-1.1-beta-3.war</file>
>             <context>/continuum</context>
>             <extraction-path>${plexus.home}/webapp</extraction-path>
>             <standardWebappClassloader>true</standardWebappClassloader>
>             <listeners>
>               <http-listener>
>                 <port>${jetty.port}</port>
>               </http-listener>
>               <!--
>               <proxy-http-listener>
>                 <port>8090</port>
>                 <proxy-host>localhost</proxy-host>
>                 <proxy-port>80</proxy-port>
>               </proxy-http-listener>
>               -->
>             </listeners>
>           </webapp>
>         </webapps>
>       </configuration>
>     </service>
>   </services>
> 
>   <components>
>     <!--
>     | The rally notifier
>     |-->
>     <component>
>       <role>org.codehaus.plexus.notification.notifier.Notifier</role>
>       <role-hint>rally-continuum</role-hint>
>       
> <implementation>com.rallydev.integration.build.continuum.RallyContinuumNotifier</implementation>

> 
>       <requirements>
>         <requirement>
>         </requirement>
>       </requirements>
>       <configuration>
>         <alwaysSend>true</alwaysSend>
>       </configuration>
>     </component>
> 
>   </components>
> </application>
> 
> 
> 
> On Oct 5, 2007, at 1:15 AM, Emmanuel Venisse wrote:
> 
>>
>>
>> Michael Masters a écrit :
>>> I've looked at JabberContinuumNotifier and I have some questions on 
>>> how I create my own notifier.
>>> 1. Once I write my notifier by extending AbstractContinuumNotifier, 
>>> how do I install it. In other words, where do I put it the class 
>>> file? Can I jar up all my classes and place them somewhere?
>>
>> To build your notifier, run 'mvn clean install' on your notifier 
>> project to create the jar then put it under 
>> apps/continuum/webapp/WEB-INF/lib/
>>
>>> 2. Can someone explain how I am suppose to configure my notifier in 
>>> apps/continuum/conf/application.xml?
>>
>>     <component>
>>       <role>org.codehaus.plexus.notification.notifier.Notifier</role>
>>       <role-hint>your_notifier_id</role-hint>
>>       <implementation>package.notifier_class</implementation>
>>     </component>
>>> * It looks like the <requirement> tag is suppose to define some 
>>> classes that my notifier is dependent on. Is this true?
>>
>> If you have some requirement in your class like 'ConfiguredService' 
>> declared like that in jabber notifier class:
>>     /**
>>      * @plexus.requirement
>>      */
>>     private ConfigurationService configurationService;
>> you must add it in the <requirement> tag in application.xml, so plexus 
>> will set and initialize configurationService automatically.
>>> * What's allowed in the <configuration> tag? For example, I need 
>>> things like login ID, password, and URL to configure the notifier. I 
>>> assume I add tags for this in  <configuration>. Is this true? If so, 
>>> then how do I get to this information from my notifier?
>>
>> The configuration part is to initialize your notifier when it is 
>> created by plexus. If in your configuration, you add 
>> <password>myPassword</password>, plexus will initialize the private 
>> password field in your class automatically.
>>
>> Plexus site: http://plexus.codehaus.org
>>
>> If you want to use your notifier from the UI, you'll need to add some 
>> new JSPs in the webapp and modify some other to add your notifier.
>>
>> Emmanuel
>>
> 
> 
> 


Mime
View raw message