continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r360106 - in /maven/continuum/trunk/continuum-webapp/src/main: java/org/apache/maven/continuum/web/action/ java/org/apache/maven/continuum/web/view/projectview/ resources/ resources/META-INF/plexus/ resources/localization/ webapp/
Date Fri, 30 Dec 2005 15:34:50 GMT
Author: evenisse
Date: Fri Dec 30 07:34:40 2005
New Revision: 360106

URL: http://svn.apache.org/viewcvs?rev=360106&view=rev
Log:
Add IRC screens

Added:
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/IrcNotifierEditAction.java
  (with props)
Modified:
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AbstractNotifierEditAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddNotifierAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/projectview/NotifierRecipientCell.java
    maven/continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/components.xml
    maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
    maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml
    maven/continuum/trunk/continuum-webapp/src/main/webapp/notifierIrc.jsp
    maven/continuum/trunk/continuum-webapp/src/main/webapp/notifierMail.jsp

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AbstractNotifierEditAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AbstractNotifierEditAction.java?rev=360106&r1=360105&r2=360106&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AbstractNotifierEditAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AbstractNotifierEditAction.java
Fri Dec 30 07:34:40 2005
@@ -40,6 +40,8 @@
 
     private int notifierId;
 
+    private String notifierType;
+
     private boolean sendOnSuccess;
 
     private boolean sendOnFailure;
@@ -63,6 +65,8 @@
                 isNew = true;
             }
 
+            notifier.setType( notifierType );
+
             notifier.setSendOnSuccess( sendOnSuccess );
 
             notifier.setSendOnFailure( sendOnFailure );
@@ -114,11 +118,13 @@
             return ERROR;
         }
 
+        notifierType = notifier.getType();
+
         sendOnSuccess = notifier.isSendOnSuccess();
 
         sendOnFailure = notifier.isSendOnFailure();
 
-        sendOnError =notifier.isSendOnError();
+        sendOnError = notifier.isSendOnError();
 
         sendOnWarning = notifier.isSendOnWarning();
 
@@ -155,6 +161,16 @@
     public void setNotifierId( int notifierId )
     {
         this.notifierId = notifierId;
+    }
+
+    public String getNotifierType()
+    {
+        return notifierType;
+    }
+
+    public void setNotifierType( String notifierType )
+    {
+        this.notifierType = notifierType;
     }
 
     public boolean isSendOnSuccess()

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddNotifierAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddNotifierAction.java?rev=360106&r1=360105&r2=360106&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddNotifierAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddNotifierAction.java
Fri Dec 30 07:34:40 2005
@@ -39,6 +39,11 @@
         return INPUT;
     }
 
+    public String getNotifierType()
+    {
+        return notifierType;
+    }
+
     public void setNotifierType( String notifierType )
     {
         this.notifierType = notifierType;

Added: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/IrcNotifierEditAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/IrcNotifierEditAction.java?rev=360106&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/IrcNotifierEditAction.java
(added)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/IrcNotifierEditAction.java
Fri Dec 30 07:34:40 2005
@@ -0,0 +1,139 @@
+package org.apache.maven.continuum.web.action;
+
+/*
+ * Copyright 2004-2005 The Apache Software Foundation.
+ *
+ * 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.
+ */
+
+import org.apache.maven.continuum.model.project.ProjectNotifier;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public class IrcNotifierEditAction
+    extends AbstractNotifierEditAction
+{
+    private String host;
+
+    private int port = 6667;
+
+    private String channel;
+
+    private String nick;
+
+    private String fullName;
+
+    private String password;
+
+    protected void initConfiguration( Map configuration )
+    {
+        host = (String) configuration.get( "host" );
+
+        if ( configuration.get( "port" ) != null )
+        {
+            port = Integer.parseInt( (String) configuration.get( "port" ) );
+        }
+
+        channel = (String) configuration.get( "channel" );
+
+        nick = (String) configuration.get( "nick" );
+
+        fullName = (String) configuration.get( "fullName" );
+
+        password = (String) configuration.get( "password" );
+    }
+
+    protected void setNotifierConfiguration( ProjectNotifier notifier )
+    {
+        HashMap configuration = new HashMap();
+
+        configuration.put( "host", host );
+
+        configuration.put( "port", String.valueOf( port ) );
+
+        configuration.put( "channel", channel );
+
+        configuration.put( "nick", nick );
+
+        configuration.put( "fullName", fullName );
+
+        configuration.put( "password", password );
+
+        notifier.setConfiguration( configuration );
+    }
+
+    public String getHost()
+    {
+        return host;
+    }
+
+    public void setHost( String host )
+    {
+        this.host = host;
+    }
+
+    public int getPort()
+    {
+        return port;
+    }
+
+    public void setPort( int port )
+    {
+        this.port = port;
+    }
+
+    public String getChannel()
+    {
+        return channel;
+    }
+
+    public void setChannel( String channel )
+    {
+        this.channel = channel;
+    }
+
+    public String getNick()
+    {
+        return nick;
+    }
+
+    public void setNick( String nick )
+    {
+        this.nick = nick;
+    }
+
+    public String getFullName()
+    {
+        return fullName;
+    }
+
+    public void setFullName( String fullName )
+    {
+        this.fullName = fullName;
+    }
+
+    public String getPassword()
+    {
+        return password;
+    }
+
+    public void setPassword( String password )
+    {
+        this.password = password;
+    }
+}

Propchange: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/IrcNotifierEditAction.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/IrcNotifierEditAction.java
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/projectview/NotifierRecipientCell.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/projectview/NotifierRecipientCell.java?rev=360106&r1=360105&r2=360106&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/projectview/NotifierRecipientCell.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/view/projectview/NotifierRecipientCell.java
Fri Dec 30 07:34:40 2005
@@ -50,6 +50,7 @@
 
             if ( notifier.getConfiguration().get( "port" ) != null )
             {
+                address += notifier.getConfiguration().get( "port" ) + ":";
             }
 
             if ( notifier.getConfiguration().get( "channel" ) != null )

Modified: maven/continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/components.xml?rev=360106&r1=360105&r2=360106&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/components.xml
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/components.xml
Fri Dec 30 07:34:40 2005
@@ -183,6 +183,17 @@
         </requirement>
       </requirements>
     </component>
+    <component>
+      <role>com.opensymphony.xwork.Action</role>
+      <role-hint>ircNotifierEdit</role-hint>
+      <implementation>org.apache.maven.continuum.web.action.IrcNotifierEditAction</implementation>
+      <instantiation-strategy>per-lookup</instantiation-strategy>
+      <requirements>
+        <requirement>
+          <role>org.apache.maven.continuum.Continuum</role>
+        </requirement>
+      </requirements>
+    </component>
 
     <!--
      | Components

Modified: maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties?rev=360106&r1=360105&r2=360106&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
Fri Dec 30 07:34:40 2005
@@ -215,6 +215,12 @@
 notifier.section.title = Add/Edit {0} Notifier
 notifier.type.label = Type
 notifier.mail.recipient.label = Mail Recipient Address
+notifier.irc.host.label = IRC Host
+notifier.irc.port.label = IRC port
+notifier.irc.channel.label = IRC channel
+notifier.irc.nick.label = Nick Name
+notifier.irc.fullName.label = Full Name
+notifier.irc.password.label = Password
 notifier.event.sendOnSuccess = Send on Success
 notifier.event.sendOnFailure = Send on Failure
 notifier.event.sendOnError = Send on Error

Modified: maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml?rev=360106&r1=360105&r2=360106&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/resources/xwork.xml Fri Dec 30 07:34:40
2005
@@ -126,5 +126,11 @@
             <result name="input">notifierMail.jsp</result>
             <result name="success" type="chain">projectView</result>
         </action>
+
+        <action name="ircNotifierEdit"
+                class="ircNotifierEdit">
+            <result name="input">notifierIrc.jsp</result>
+            <result name="success" type="chain">projectView</result>
+        </action>
     </package>
 </xwork>

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/notifierIrc.jsp
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/webapp/notifierIrc.jsp?rev=360106&r1=360105&r2=360106&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/notifierIrc.jsp (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/notifierIrc.jsp Fri Dec 30 07:34:40
2005
@@ -17,7 +17,22 @@
         </h3>
 
         <div class="axial">
-            IRC
+            <ww:form action="ircNotifierEdit.action" method="post">
+                <ww:hidden name="notifierId"/>
+                <ww:hidden name="projectId"/>
+                <ww:hidden name="notifierType"/>
+                <ww:textfield label="%{getText('notifier.irc.host.label')}" name="host"/>
+                <ww:textfield label="%{getText('notifier.irc.port.label')}" name="port"/>
+                <ww:textfield label="%{getText('notifier.irc.channel.label')}" name="channel"/>
+                <ww:textfield label="%{getText('notifier.irc.nick.label')}" name="nick"/>
+                <ww:textfield label="%{getText('notifier.irc.fullName.label')}" name="fullName"/>
+                <ww:password label="%{getText('notifier.irc.password.label')}" name="password"/>
+                <ww:checkbox label="%{getText('notifier.event.sendOnSuccess')}" name="sendOnSuccess"
value="sendOnSuccess" fieldValue="true"/>
+                <ww:checkbox label="%{getText('notifier.event.sendOnFailure')}" name="sendOnFailure"
value="sendOnFailure" fieldValue="true"/>
+                <ww:checkbox label="%{getText('notifier.event.sendOnError')}" name="sendOnError"
value="sendOnError" fieldValue="true"/>
+                <ww:checkbox label="%{getText('notifier.event.sendOnWarning')}" name="sendOnWarning"
value="sendOnWarning" fieldValue="true"/>
+                <ww:submit value="%{getText('save')}"/>
+            </ww:form>
         </div>
       </div>
     </body>

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/notifierMail.jsp
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/webapp/notifierMail.jsp?rev=360106&r1=360105&r2=360106&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/notifierMail.jsp (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/notifierMail.jsp Fri Dec 30 07:34:40
2005
@@ -20,11 +20,12 @@
             <ww:form action="mailNotifierEdit.action" method="post">
                 <ww:hidden name="notifierId"/>
                 <ww:hidden name="projectId"/>
+                <ww:hidden name="notifierType"/>
                 <ww:textfield label="%{getText('notifier.mail.recipient.label')}" name="address"/>
-                <ww:checkbox label="%{getText('notifier.event.sendOnSuccess')}" name="sendOnSuccess"
fieldValue="true"/>
-                <ww:checkbox label="%{getText('notifier.event.sendOnFailure')}" name="sendOnFailure"
fieldValue="true"/>
-                <ww:checkbox label="%{getText('notifier.event.sendOnError')}" name="sendOnError"
fieldValue="true"/>
-                <ww:checkbox label="%{getText('notifier.event.sendOnWarning')}" name="sendOnWarning"
fieldValue="true"/>
+                <ww:checkbox label="%{getText('notifier.event.sendOnSuccess')}" name="sendOnSuccess"
value="sendOnSuccess" fieldValue="true"/>
+                <ww:checkbox label="%{getText('notifier.event.sendOnFailure')}" name="sendOnFailure"
value="sendOnFailure" fieldValue="true"/>
+                <ww:checkbox label="%{getText('notifier.event.sendOnError')}" name="sendOnError"
value="sendOnError" fieldValue="true"/>
+                <ww:checkbox label="%{getText('notifier.event.sendOnWarning')}" name="sendOnWarning"
value="sendOnWarning" fieldValue="true"/>
                 <ww:submit value="%{getText('save')}"/>
             </ww:form>
         </div>



Mime
View raw message