Merge "Issue #595 - only the "Create Shared Display Session" checkbox will be disabled and unchecked until the httpd collaboration configuration information is received. Changed the checkbox description to read "Create Shared Display Session"." into 11-Collaboration
Former-commit-id:06970f4d82
[formerly8eb5665591
] [formerly06970f4d82
[formerly8eb5665591
] [formerlyac95fde3e5
[formerly 34be3aaf6ea41ae8366d072723c3beb8151d1f84]]] Former-commit-id:ac95fde3e5
Former-commit-id:71d38a3598
[formerlyd4ba003ce0
] Former-commit-id:e4e9a8b6ba
This commit is contained in:
commit
3bbdc214e0
4 changed files with 57 additions and 58 deletions
|
@ -176,12 +176,13 @@ public class PeerToPeerCommHelper implements IIMMessageListener {
|
|||
final String parameterName = "sessionDataHttpURL";
|
||||
final String suffix = "]]";
|
||||
// Validate the configuration.
|
||||
final String configPatternRegex = Tools.CONFIG_PREAMBLE.replace("[", "\\[")
|
||||
+ parameterName + " : .+" + suffix;
|
||||
final String configPatternRegex = Tools.CONFIG_PREAMBLE.replace("[",
|
||||
"\\[") + parameterName + " : .+" + suffix;
|
||||
Pattern configPattern = Pattern.compile(configPatternRegex);
|
||||
if (configPattern.matcher(body).matches() == false) {
|
||||
statusHandler.handle(UFStatus.Priority.PROBLEM,
|
||||
"Received invalid configuration from openfire.");
|
||||
statusHandler
|
||||
.handle(UFStatus.Priority.PROBLEM,
|
||||
"Received invalid configuration from openfire. Shared Display Sessions have been disabled.");
|
||||
}
|
||||
|
||||
// Eliminate the preamble.
|
||||
|
@ -204,7 +205,7 @@ public class PeerToPeerCommHelper implements IIMMessageListener {
|
|||
if (urlPattern.matcher(httpdCollaborationURL).matches() == false) {
|
||||
statusHandler.handle(UFStatus.Priority.PROBLEM,
|
||||
"Received an invalid http url from openfire - "
|
||||
+ httpdCollaborationURL + ".");
|
||||
+ httpdCollaborationURL + ". Shared Display Sessions have been disabled.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -49,6 +49,7 @@ import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException;
|
|||
import com.raytheon.uf.viz.collaboration.comm.identity.ISession;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.IVenueSession;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.event.IHttpdCollaborationConfigurationEvent;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.event.ITextMessageEvent;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.event.IVenueInvitationEvent;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.invite.SharedDisplayVenueInvite;
|
||||
|
@ -57,9 +58,11 @@ import com.raytheon.uf.viz.collaboration.comm.identity.user.SharedDisplayRole;
|
|||
import com.raytheon.uf.viz.collaboration.comm.provider.TextMessage;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.session.CollaborationConnection;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
|
||||
import com.raytheon.uf.viz.collaboration.ui.Activator;
|
||||
import com.raytheon.uf.viz.collaboration.ui.CollaborationUtils;
|
||||
import com.raytheon.uf.viz.collaboration.ui.SessionColorManager;
|
||||
import com.raytheon.uf.viz.collaboration.ui.login.LoginDialog;
|
||||
import com.raytheon.uf.viz.collaboration.ui.prefs.CollabPrefConstants;
|
||||
import com.raytheon.uf.viz.collaboration.ui.session.CollaborationSessionView;
|
||||
import com.raytheon.uf.viz.collaboration.ui.session.PeerToPeerView;
|
||||
import com.raytheon.uf.viz.collaboration.ui.session.SessionView;
|
||||
|
@ -438,4 +441,23 @@ public class CollaborationDataManager {
|
|||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void handleHttpdConfigurationEvent(
|
||||
IHttpdCollaborationConfigurationEvent configurationEvent) {
|
||||
|
||||
// Add the httpd collaboration url to the CAVE configuration.
|
||||
Activator
|
||||
.getDefault()
|
||||
.getPreferenceStore()
|
||||
.setValue(
|
||||
CollabPrefConstants.HttpCollaborationConfiguration.P_HTTP_SESSION_URL,
|
||||
configurationEvent.getHttpdCollaborationURL());
|
||||
Activator
|
||||
.getDefault()
|
||||
.getPreferenceStore()
|
||||
.setValue(
|
||||
CollabPrefConstants.HttpCollaborationConfiguration.P_SESSION_CONFIGURED,
|
||||
true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -95,7 +95,6 @@ import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException;
|
|||
import com.raytheon.uf.viz.collaboration.comm.identity.ISession;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.IVenueSession;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.event.IHttpdCollaborationConfigurationEvent;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.event.IRosterChangeEvent;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.info.IVenueInfo;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.invite.SharedDisplayVenueInvite;
|
||||
|
@ -257,7 +256,7 @@ public class CollaborationGroupView extends ViewPart implements IPartListener {
|
|||
bundle, "add_collaborate.gif"));
|
||||
createSessionAction.setDisabledImageDescriptor(IconUtil
|
||||
.getImageDescriptor(bundle, "add_collaborate_disabled.png"));
|
||||
this.disableOrEnableSessionAction(false);
|
||||
this.disableOrEnableSessionAction();
|
||||
|
||||
linkToEditorAction = new Action("Link Editor to Chat Session",
|
||||
Action.AS_CHECK_BOX) {
|
||||
|
@ -611,7 +610,7 @@ public class CollaborationGroupView extends ViewPart implements IPartListener {
|
|||
// enable the tree, and then refresh it just to be safe
|
||||
usersTreeViewer.getTree().setEnabled(true);
|
||||
usersTreeViewer.refresh(topLevel, true);
|
||||
this.disableOrEnableSessionAction(false);
|
||||
this.disableOrEnableSessionAction();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1334,51 +1333,16 @@ public class CollaborationGroupView extends ViewPart implements IPartListener {
|
|||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void handleHttpdConfigurationEvent(
|
||||
IHttpdCollaborationConfigurationEvent configurationEvent) {
|
||||
|
||||
// Add the httpd collaboration url to the CAVE configuration.
|
||||
Activator
|
||||
.getDefault()
|
||||
.getPreferenceStore()
|
||||
.setValue(
|
||||
CollabPrefConstants.HttpCollaborationConfiguration.P_HTTP_SESSION_URL,
|
||||
configurationEvent.getHttpdCollaborationURL());
|
||||
Activator
|
||||
.getDefault()
|
||||
.getPreferenceStore()
|
||||
.setValue(
|
||||
CollabPrefConstants.HttpCollaborationConfiguration.P_SESSION_CONFIGURED,
|
||||
true);
|
||||
|
||||
// Allow the user to create sessions.
|
||||
this.disableOrEnableSessionAction(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param async
|
||||
* Enables or disables the Creation session button / menu option
|
||||
* depending on whether or not the user is connected to the
|
||||
* xmpp server.
|
||||
*/
|
||||
private void disableOrEnableSessionAction(boolean async) {
|
||||
boolean sessionConfigured = Activator
|
||||
.getDefault()
|
||||
.getPreferenceStore()
|
||||
.getBoolean(
|
||||
CollabPrefConstants.HttpCollaborationConfiguration.P_SESSION_CONFIGURED);
|
||||
final boolean isSessionEnabled = sessionConfigured
|
||||
&& CollaborationDataManager.getInstance().isConnected();
|
||||
if (async) {
|
||||
VizApp.runAsync(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
createSessionAction.setEnabled(isSessionEnabled);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
createSessionAction.setEnabled(isSessionEnabled);
|
||||
}
|
||||
private void disableOrEnableSessionAction() {
|
||||
final boolean isSessionEnabled = CollaborationDataManager.getInstance().isConnected();
|
||||
createSessionAction.setEnabled(isSessionEnabled);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Adds users to groups if necessary
|
||||
*
|
||||
|
|
|
@ -46,6 +46,7 @@ import org.eclipse.swt.widgets.Text;
|
|||
import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.info.IVenueInfo;
|
||||
import com.raytheon.uf.viz.collaboration.data.CollaborationDataManager;
|
||||
import com.raytheon.uf.viz.collaboration.ui.prefs.CollabPrefConstants;
|
||||
import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
|
||||
|
||||
/**
|
||||
|
@ -70,7 +71,7 @@ public class CreateSessionDialog extends CaveSWTDialog {
|
|||
|
||||
private Text subjectTF;
|
||||
|
||||
private Button publicCollaboration;
|
||||
private Button sharedSessionDisplay;
|
||||
|
||||
private Button inviteUsers;
|
||||
|
||||
|
@ -113,12 +114,12 @@ public class CreateSessionDialog extends CaveSWTDialog {
|
|||
label.setText("Subject: ");
|
||||
subjectTF = new Text(body, SWT.BORDER);
|
||||
subjectTF.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
|
||||
publicCollaboration = new Button(body, SWT.CHECK);
|
||||
sharedSessionDisplay = new Button(body, SWT.CHECK);
|
||||
this.enableOrDisableSharedDisplays();
|
||||
gd = new GridData(SWT.DEFAULT, SWT.DEFAULT, false, false);
|
||||
gd.horizontalSpan = 2;
|
||||
publicCollaboration.setLayoutData(gd);
|
||||
publicCollaboration.setSelection(true);
|
||||
publicCollaboration.setText("Create Collaboration");
|
||||
sharedSessionDisplay.setLayoutData(gd);
|
||||
sharedSessionDisplay.setText("Create Shared Display Session");
|
||||
|
||||
if (showInvite) {
|
||||
inviteUsers = new Button(body, SWT.CHECK);
|
||||
|
@ -254,7 +255,7 @@ public class CreateSessionDialog extends CaveSWTDialog {
|
|||
CreateSessionData result = new CreateSessionData();
|
||||
result.setName(name);
|
||||
result.setSubject(subject);
|
||||
result.setCollaborationSessioh(publicCollaboration
|
||||
result.setCollaborationSessioh(sharedSessionDisplay
|
||||
.getSelection());
|
||||
if (inviteUsers == null) {
|
||||
result.setInviteUsers(false);
|
||||
|
@ -325,7 +326,8 @@ public class CreateSessionDialog extends CaveSWTDialog {
|
|||
err = "Name contains invalid characters.";
|
||||
} else {
|
||||
Collection<IVenueInfo> info = CollaborationDataManager
|
||||
.getInstance().getCollaborationConnection(true).getVenueInfo();
|
||||
.getInstance().getCollaborationConnection(true)
|
||||
.getVenueInfo();
|
||||
for (IVenueInfo i : info) {
|
||||
if (name.equals(i.getVenueName())) {
|
||||
err = "Session already exists. Pick a different name.";
|
||||
|
@ -335,4 +337,14 @@ public class CreateSessionDialog extends CaveSWTDialog {
|
|||
}
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
||||
private void enableOrDisableSharedDisplays() {
|
||||
boolean sharedSessionsEnabled = Activator
|
||||
.getDefault()
|
||||
.getPreferenceStore()
|
||||
.getBoolean(
|
||||
CollabPrefConstants.HttpCollaborationConfiguration.P_SESSION_CONFIGURED);
|
||||
this.sharedSessionDisplay.setSelection(sharedSessionsEnabled);
|
||||
this.sharedSessionDisplay.setEnabled(sharedSessionsEnabled);
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue