You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@continuum.apache.org by ev...@apache.org on 2005/12/30 17:03:46 UTC
svn commit: r360112 - in /maven/continuum/trunk/continuum-webapp/src/main:
java/org/apache/maven/continuum/web/action/ resources/
resources/META-INF/plexus/ resources/localization/ webapp/
Author: evenisse
Date: Fri Dec 30 08:03:38 2005
New Revision: 360112
URL: http://svn.apache.org/viewcvs?rev=360112&view=rev
Log:
Add Jabber screen
Added:
maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/JabberNotifierEditAction.java (with props)
Modified:
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/notifierJabber.jsp
Added: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/JabberNotifierEditAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/JabberNotifierEditAction.java?rev=360112&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/JabberNotifierEditAction.java (added)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/JabberNotifierEditAction.java Fri Dec 30 08:03:38 2005
@@ -0,0 +1,171 @@
+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 JabberNotifierEditAction
+ extends AbstractNotifierEditAction
+{
+ private String host;
+
+ private int port = 5222;
+
+ private String login;
+
+ private String password;
+
+ private String domainName;
+
+ private String address;
+
+ private boolean sslConnection;
+
+ private boolean group;
+
+ protected void initConfiguration( Map configuration )
+ {
+ host = (String) configuration.get( "host" );
+
+ if ( configuration.get( "port" ) != null )
+ {
+ port = Integer.parseInt( (String) configuration.get( "port" ) );
+ }
+
+ login = (String) configuration.get( "login" );
+
+ password = (String) configuration.get( "password" );
+
+ domainName = (String) configuration.get( "domainName" );
+
+ address = (String) configuration.get( "address" );
+
+ sslConnection = Boolean.parseBoolean( (String) configuration.get( "sslConnection" ) );
+
+ group = Boolean.parseBoolean( (String) configuration.get( "isGroup" ) );
+ }
+
+ protected void setNotifierConfiguration( ProjectNotifier notifier )
+ {
+ HashMap configuration = new HashMap();
+
+ configuration.put( "host", host );
+
+ configuration.put( "port", String.valueOf( port ) );
+
+ configuration.put( "login", login );
+
+ configuration.put( "password", password );
+
+ configuration.put( "domainName", domainName );
+
+ configuration.put( "address", address );
+
+ configuration.put( "sslConnection", String.valueOf( sslConnection ) );
+
+ configuration.put( "isGroup", String.valueOf( group ) );
+
+ 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 getLogin()
+ {
+ return login;
+ }
+
+ public void setLogin( String login )
+ {
+ this.login = login;
+ }
+
+ public String getPassword()
+ {
+ return password;
+ }
+
+ public void setPassword( String password )
+ {
+ this.password = password;
+ }
+
+ public String getDomainName()
+ {
+ return domainName;
+ }
+
+ public void setDomainName( String domainName )
+ {
+ this.domainName = domainName;
+ }
+
+ public String getAddress()
+ {
+ return address;
+ }
+
+ public void setAddress( String address )
+ {
+ this.address = address;
+ }
+
+ public boolean isSslConnection()
+ {
+ return sslConnection;
+ }
+
+ public void setSslConnection( boolean sslConnection )
+ {
+ this.sslConnection = sslConnection;
+ }
+
+ public boolean isGroup()
+ {
+ return group;
+ }
+
+ public void setGroup( boolean group )
+ {
+ this.group = group;
+ }
+}
Propchange: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/JabberNotifierEditAction.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/JabberNotifierEditAction.java
------------------------------------------------------------------------------
svn:keywords = "Author Date Id Revision"
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=360112&r1=360111&r2=360112&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 08:03:38 2005
@@ -194,6 +194,17 @@
</requirement>
</requirements>
</component>
+ <component>
+ <role>com.opensymphony.xwork.Action</role>
+ <role-hint>jabberNotifierEdit</role-hint>
+ <implementation>org.apache.maven.continuum.web.action.JabberNotifierEditAction</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=360112&r1=360111&r2=360112&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 08:03:38 2005
@@ -221,6 +221,14 @@
notifier.irc.nick.label = Nick Name
notifier.irc.fullName.label = Full Name
notifier.irc.password.label = Password
+notifier.jabber.host.label = Jabber Host
+notifier.jabber.port.label = Jabber port
+notifier.jabber.login.label = Jabber login
+notifier.jabber.password.label = Jabber Password
+notifier.jabber.domainName.label = Jabber Domain Name
+notifier.jabber.address.label = Jabber Recipient Address
+notifier.jabber.isSslConnection.label = Is it a SSL connection?
+notifier.jabber.isGroup.label = Is it a Jabber group?
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=360112&r1=360111&r2=360112&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 08:03:38 2005
@@ -132,5 +132,11 @@
<result name="input">notifierIrc.jsp</result>
<result name="success" type="chain">projectView</result>
</action>
+
+ <action name="jabberNotifierEdit"
+ class="jabberNotifierEdit">
+ <result name="input">notifierJabber.jsp</result>
+ <result name="success" type="chain">projectView</result>
+ </action>
</package>
</xwork>
Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/notifierJabber.jsp
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-webapp/src/main/webapp/notifierJabber.jsp?rev=360112&r1=360111&r2=360112&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/notifierJabber.jsp (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/notifierJabber.jsp Fri Dec 30 08:03:38 2005
@@ -17,7 +17,24 @@
</h3>
<div class="axial">
- Jabber
+ <ww:form action="jabberNotifierEdit.action" method="post">
+ <ww:hidden name="notifierId"/>
+ <ww:hidden name="projectId"/>
+ <ww:hidden name="notifierType"/>
+ <ww:textfield label="%{getText('notifier.jabber.host.label')}" name="host"/>
+ <ww:textfield label="%{getText('notifier.jabber.port.label')}" name="port"/>
+ <ww:textfield label="%{getText('notifier.jabber.login.label')}" name="login"/>
+ <ww:password label="%{getText('notifier.jabber.password.label')}" name="password"/>
+ <ww:textfield label="%{getText('notifier.jabber.domainName.label')}" name="domainName"/>
+ <ww:textfield label="%{getText('notifier.jabber.address.label')}" name="address"/>
+ <ww:checkbox label="%{getText('notifier.jabber.isSslConnection.label')}" name="sslConnection" value="sslConnection" fieldValue="true"/>
+ <ww:checkbox label="%{getText('notifier.jabber.isGroup.label')}" name="group" value="group" 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>
</div>
</body>