Commit d2a1aa5d authored by Daniel Henninger's avatar Daniel Henninger Committed by dhenninger

"Drawing up" the web interface a tad. Also playing with threads for the...

"Drawing up" the web interface a tad.  Also playing with threads for the sessions again.  Still don't think I'm doing it right.

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@5786 b35dd754-fafc-0310-a699-88a17e54d16e
parent b55cc350
...@@ -14,6 +14,7 @@ import org.xmpp.packet.JID; ...@@ -14,6 +14,7 @@ import org.xmpp.packet.JID;
import org.jivesoftware.wildfire.user.UserNotFoundException; import org.jivesoftware.wildfire.user.UserNotFoundException;
import org.jivesoftware.wildfire.roster.RosterItem; import org.jivesoftware.wildfire.roster.RosterItem;
import org.jivesoftware.wildfire.roster.Roster; import org.jivesoftware.wildfire.roster.Roster;
import org.jivesoftware.util.Log;
import java.util.TreeMap; import java.util.TreeMap;
...@@ -40,6 +41,7 @@ public abstract class TransportSession implements Runnable { ...@@ -40,6 +41,7 @@ public abstract class TransportSession implements Runnable {
this.jid = new JID(jid.toBareJID()); this.jid = new JID(jid.toBareJID());
this.registration = registration; this.registration = registration;
this.transport = transport; this.transport = transport;
Log.debug("Created "+transport.getType()+" session for "+jid+" as '"+registration.getUsername()+"'");
} }
/** /**
...@@ -55,6 +57,7 @@ public abstract class TransportSession implements Runnable { ...@@ -55,6 +57,7 @@ public abstract class TransportSession implements Runnable {
this.registration = registration; this.registration = registration;
this.transport = transport; this.transport = transport;
addResource(jid.getResource(), priority); addResource(jid.getResource(), priority);
Log.debug("Created "+transport.getType()+" session for "+jid+" as '"+registration.getUsername()+"'");
} }
/** /**
......
...@@ -46,7 +46,7 @@ public class TransportSessionManager { ...@@ -46,7 +46,7 @@ public class TransportSessionManager {
/** /**
* The actual repear task. * The actual repear task.
*/ */
@SuppressWarnings({"FieldCanBeLocal"}) private SessionReaper sessionReaper; private SessionReaper sessionReaper;
/** /**
* The transport we are associated with. * The transport we are associated with.
......
...@@ -81,8 +81,8 @@ public class IRCTransport extends BaseTransport { ...@@ -81,8 +81,8 @@ public class IRCTransport extends BaseTransport {
public TransportSession registrationLoggedIn(Registration registration, JID jid, PresenceType presenceType, String verboseStatus, Integer priority) { public TransportSession registrationLoggedIn(Registration registration, JID jid, PresenceType presenceType, String verboseStatus, Integer priority) {
Log.debug("Logging in to IRC gateway."); Log.debug("Logging in to IRC gateway.");
TransportSession session = new IRCSession(registration, jid, this, priority); TransportSession session = new IRCSession(registration, jid, this, priority);
// Thread sessionThread = new Thread(session); Thread sessionThread = new Thread(session);
// sessionThread.start(); sessionThread.start();
((IRCSession)session).logIn(presenceType, verboseStatus); ((IRCSession)session).logIn(presenceType, verboseStatus);
return session; return session;
} }
...@@ -95,7 +95,7 @@ public class IRCTransport extends BaseTransport { ...@@ -95,7 +95,7 @@ public class IRCTransport extends BaseTransport {
public void registrationLoggedOut(TransportSession session) { public void registrationLoggedOut(TransportSession session) {
Log.debug("Logging out of IRC gateway."); Log.debug("Logging out of IRC gateway.");
((IRCSession)session).logOut(); ((IRCSession)session).logOut();
// session.sessionDone(); session.sessionDone();
// Just in case. // Just in case.
session.setLoginStatus(TransportLoginStatus.LOGGED_OUT); session.setLoginStatus(TransportLoginStatus.LOGGED_OUT);
} }
......
...@@ -83,8 +83,8 @@ public class MSNTransport extends BaseTransport { ...@@ -83,8 +83,8 @@ public class MSNTransport extends BaseTransport {
public TransportSession registrationLoggedIn(Registration registration, JID jid, PresenceType presenceType, String verboseStatus, Integer priority) { public TransportSession registrationLoggedIn(Registration registration, JID jid, PresenceType presenceType, String verboseStatus, Integer priority) {
Log.debug("Logging in to MSN gateway."); Log.debug("Logging in to MSN gateway.");
TransportSession session = new MSNSession(registration, jid, this, priority); TransportSession session = new MSNSession(registration, jid, this, priority);
// Thread sessionThread = new Thread(session); Thread sessionThread = new Thread(session);
// sessionThread.start(); sessionThread.start();
((MSNSession)session).logIn(presenceType, verboseStatus); ((MSNSession)session).logIn(presenceType, verboseStatus);
return session; return session;
} }
...@@ -97,7 +97,7 @@ public class MSNTransport extends BaseTransport { ...@@ -97,7 +97,7 @@ public class MSNTransport extends BaseTransport {
public void registrationLoggedOut(TransportSession session) { public void registrationLoggedOut(TransportSession session) {
Log.debug("Logging out of MSN gateway."); Log.debug("Logging out of MSN gateway.");
((MSNSession)session).logOut(); ((MSNSession)session).logOut();
// session.sessionDone(); session.sessionDone();
// Just in case. // Just in case.
session.setLoginStatus(TransportLoginStatus.LOGGED_OUT); session.setLoginStatus(TransportLoginStatus.LOGGED_OUT);
} }
......
...@@ -84,8 +84,8 @@ public class OSCARTransport extends BaseTransport { ...@@ -84,8 +84,8 @@ public class OSCARTransport extends BaseTransport {
*/ */
public TransportSession registrationLoggedIn(Registration registration, JID jid, PresenceType presenceType, String verboseStatus, Integer priority) { public TransportSession registrationLoggedIn(Registration registration, JID jid, PresenceType presenceType, String verboseStatus, Integer priority) {
TransportSession session = new OSCARSession(registration, jid, this, priority); TransportSession session = new OSCARSession(registration, jid, this, priority);
// Thread sessionThread = new Thread(session); Thread sessionThread = new Thread(session);
// sessionThread.start(); sessionThread.start();
((OSCARSession)session).logIn(presenceType, verboseStatus); ((OSCARSession)session).logIn(presenceType, verboseStatus);
return session; return session;
} }
...@@ -97,7 +97,7 @@ public class OSCARTransport extends BaseTransport { ...@@ -97,7 +97,7 @@ public class OSCARTransport extends BaseTransport {
*/ */
public void registrationLoggedOut(TransportSession session) { public void registrationLoggedOut(TransportSession session) {
((OSCARSession)session).logOut(); ((OSCARSession)session).logOut();
// session.sessionDone(); session.sessionDone();
// Just in case. // Just in case.
session.setLoginStatus(TransportLoginStatus.LOGGED_OUT); session.setLoginStatus(TransportLoginStatus.LOGGED_OUT);
} }
......
...@@ -83,8 +83,8 @@ public class YahooTransport extends BaseTransport { ...@@ -83,8 +83,8 @@ public class YahooTransport extends BaseTransport {
public TransportSession registrationLoggedIn(Registration registration, JID jid, PresenceType presenceType, String verboseStatus, Integer priority) { public TransportSession registrationLoggedIn(Registration registration, JID jid, PresenceType presenceType, String verboseStatus, Integer priority) {
Log.debug("Logging in to Yahoo gateway."); Log.debug("Logging in to Yahoo gateway.");
TransportSession session = new YahooSession(registration, jid, this, priority); TransportSession session = new YahooSession(registration, jid, this, priority);
// Thread sessionThread = new Thread(session); Thread sessionThread = new Thread(session);
// sessionThread.start(); sessionThread.start();
((YahooSession)session).logIn(presenceType, verboseStatus); ((YahooSession)session).logIn(presenceType, verboseStatus);
return session; return session;
} }
...@@ -97,7 +97,7 @@ public class YahooTransport extends BaseTransport { ...@@ -97,7 +97,7 @@ public class YahooTransport extends BaseTransport {
public void registrationLoggedOut(TransportSession session) { public void registrationLoggedOut(TransportSession session) {
Log.debug("Logging out of Yahoo gateway."); Log.debug("Logging out of Yahoo gateway.");
((YahooSession)session).logOut(); ((YahooSession)session).logOut();
// session.sessionDone(); session.sessionDone();
// Just in case. // Just in case.
session.setLoginStatus(TransportLoginStatus.LOGGED_OUT); session.setLoginStatus(TransportLoginStatus.LOGGED_OUT);
} }
......
...@@ -44,7 +44,8 @@ ...@@ -44,7 +44,8 @@
</div> </div>
<div class="jive-gatewayPanel" id="jive<%= this.gatewayType.toString().toUpperCase() %>tests" style="display: none;"> <div class="jive-gatewayPanel" id="jive<%= this.gatewayType.toString().toUpperCase() %>tests" style="display: none;">
<div> <div>
<i>This is not yet functional.</i><br /> <span style="font-weight: bold">Connect to host:</span> <span id="testhost">ninja</span><br />
<span style="font-weight: bold">Connect to port:</span> <span id="testport">1234</span><br />
<form action=""> <form action="">
<input type="submit" name="submit" value="Test Connection" onclick="togglePanel(jive<%= this.gatewayType.toString().toUpperCase() %>tests,jive<%= this.gatewayType.toString().toUpperCase() %>tests); return false" class="jive-formButton"> <input type="submit" name="submit" value="Test Connection" onclick="togglePanel(jive<%= this.gatewayType.toString().toUpperCase() %>tests,jive<%= this.gatewayType.toString().toUpperCase() %>tests); return false" class="jive-formButton">
</form> </form>
...@@ -52,10 +53,39 @@ ...@@ -52,10 +53,39 @@
</div> </div>
<div class="jive-gatewayPanel" id="jive<%= this.gatewayType.toString().toUpperCase() %>options" style="display: none;"> <div class="jive-gatewayPanel" id="jive<%= this.gatewayType.toString().toUpperCase() %>options" style="display: none;">
<div> <div>
<i>This is not yet functional.</i><br />
<form action=""> <form action="">
<!-- <input type="checkbox" name="filetransfer" value="enabled"> Enable file transfer<br> --> <table border="0" cellpadding="0" cellspacing="0">
<!-- <input type="checkbox" name="reconnect" value="enabled"> Reconnect on disconnect<br> --> <tr valign="top">
<td align="left" width="50%">
<table border="0" cellpadding="1" cellspacing="2">
<tr valign="middle">
<td width="1%"><input type="checkbox" name="filetransfer" value="enabled"></td>
<td>Enable file transfer</td>
</tr>
<tr valign="middle">
<td width="1%"><input type="checkbox" name="reconnect" value="enabled"></td>
<td>Reconnect on disconnect</td>
</tr>
<tr valign="middle">
<td width="1%">&nbsp;</td>
<td>Reconnect Attemps: <input type="text" style="margin: 0.0px; padding: 0.0px" name="reconnect_attempts" size="4" maxlength="4" value="10" /></td>
</tr>
</table>
</td>
<td align="left" width="50%">
<table border="0">
<tr valign="middle">
<td align="right" width="1%">Host:</td>
<td><input type="text" name="host" value="blar" onChange="getElementById('testhost').innerHTML = this.value" /></td>
</tr>
<tr valign="middle">
<td align="right" width="1%">Port:</td>
<td><input type="text" name="host" value="1234" onChange="getElementById('testport').innerHTML = this.value" /></td>
</tr>
</table>
</td>
</tr>
</table>
<input type="submit" name="submit" value="Save Options" onclick="togglePanel(jive<%= this.gatewayType.toString().toUpperCase() %>options,jive<%= this.gatewayType.toString().toUpperCase() %>perms); return false" class="jive-formButton"> <input type="submit" name="submit" value="Save Options" onclick="togglePanel(jive<%= this.gatewayType.toString().toUpperCase() %>options,jive<%= this.gatewayType.toString().toUpperCase() %>perms); return false" class="jive-formButton">
<input type="reset" name="cancel" value="Cancel" onclick="togglePanel(jive<%= this.gatewayType.toString().toUpperCase() %>options,jive<%= this.gatewayType.toString().toUpperCase() %>perms); return false" class="jive-formButton"> <input type="reset" name="cancel" value="Cancel" onclick="togglePanel(jive<%= this.gatewayType.toString().toUpperCase() %>options,jive<%= this.gatewayType.toString().toUpperCase() %>perms); return false" class="jive-formButton">
</form> </form>
...@@ -63,11 +93,24 @@ ...@@ -63,11 +93,24 @@
</div> </div>
<div class="jive-gatewayPanel" id="jive<%= this.gatewayType.toString().toUpperCase() %>perms" style="display: none;"> <div class="jive-gatewayPanel" id="jive<%= this.gatewayType.toString().toUpperCase() %>perms" style="display: none;">
<div> <div>
<i>This is not yet functional.</i><br />
<form action=""> <form action="">
<input type="radio" name="userreg" value="all" checked> All users can register<br> <input type="radio" name="userreg" value="all" onClick="getElementById('userreg_specific').style.display = 'none'" checked> All users can register<br>
<input type="radio" name="userreg" value="specific"> These users and/or groups can register<br> <input type="radio" name="userreg" value="specific" onClick="getElementById('userreg_specific').style.display = 'block'"> These users and/or groups can register<br>
<input type="radio" name="userreg" value="manual"> Manual registration only (see the Registrations section to manage)<br> <div id="userreg_specific" style="display: none; margin: 0; padding: 0; font-size: 80%">
<table border="0" cellpadding="0" cellspacing="0" style="padding-left: 30.0px">
<tr valign="top">
<td align="left">
<span style="font-weight: bold">Users</span> <a href="">(Modify Users)</a><br />
(none selected)
</td>
<td align="left" style="padding-left: 30.0px">
<span style="font-weight: bold">Groups</span> <a href="">(Modify Groups)</a><br />
(none selected)
</td>
</tr>
</table>
</div>
<input type="radio" name="userreg" value="manual" onClick="getElementById('userreg_specific').style.display = 'none'"> Manual registration only (see the Registrations section to manage)<br>
<input type="submit" name="submit" value="Save Permissions" onclick="togglePanel(jive<%= this.gatewayType.toString().toUpperCase() %>perms,jive<%= this.gatewayType.toString().toUpperCase() %>options); return false" class="jive-formButton"> <input type="submit" name="submit" value="Save Permissions" onclick="togglePanel(jive<%= this.gatewayType.toString().toUpperCase() %>perms,jive<%= this.gatewayType.toString().toUpperCase() %>options); return false" class="jive-formButton">
<input type="reset" name="cancel" value="Cancel" onclick="togglePanel(jive<%= this.gatewayType.toString().toUpperCase() %>perms,jive<%= this.gatewayType.toString().toUpperCase() %>options); return false" class="jive-formButton"> <input type="reset" name="cancel" value="Cancel" onclick="togglePanel(jive<%= this.gatewayType.toString().toUpperCase() %>perms,jive<%= this.gatewayType.toString().toUpperCase() %>options); return false" class="jive-formButton">
</form> </form>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment