Issue #427 open editor when joining session
Change-Id: I6094a7a909584acb8b10236119ec3eb5dd965e59 Former-commit-id:d75858ffa0
[formerly19bb87346c
] [formerly223eb82fe0
] [formerlyd75858ffa0
[formerly19bb87346c
] [formerly223eb82fe0
] [formerlyc29a5a75d9
[formerly223eb82fe0
[formerly f1c0549a84b0aa0d4829ca1bc584165ca98dbbb6]]]] Former-commit-id:c29a5a75d9
Former-commit-id:7c5b10222e
[formerlyb740924cdc
] [formerly fc1d5c60e4ec9729575efed47af8bb8e49d4f3b5 [formerly6319166680
]] Former-commit-id: 6e1fa133a8684b61cab2e2c8a7bfad9b76152409 [formerly28ed07b65a
] Former-commit-id:cfc10b64f6
This commit is contained in:
parent
00ae91e2d5
commit
38243e08be
5 changed files with 42 additions and 24 deletions
|
@ -77,7 +77,8 @@ public class CollaborationEditorInputHandler implements IInputHandler {
|
||||||
|
|
||||||
protected boolean isSessionLeader() {
|
protected boolean isSessionLeader() {
|
||||||
// TODO does this work?
|
// TODO does this work?
|
||||||
return session.getUserID().equals(session.getCurrentSessionLeader());
|
// return session.getUserID().equals(session.getCurrentSessionLeader());
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -29,6 +29,7 @@ import com.raytheon.uf.viz.collaboration.ui.editor.CollaborationEditor;
|
||||||
import com.raytheon.uf.viz.collaboration.ui.editor.CollaborationEditorInputHandler;
|
import com.raytheon.uf.viz.collaboration.ui.editor.CollaborationEditorInputHandler;
|
||||||
import com.raytheon.uf.viz.collaboration.ui.editor.EditorSetup;
|
import com.raytheon.uf.viz.collaboration.ui.editor.EditorSetup;
|
||||||
import com.raytheon.uf.viz.collaboration.ui.editor.SharedEditor;
|
import com.raytheon.uf.viz.collaboration.ui.editor.SharedEditor;
|
||||||
|
import com.raytheon.uf.viz.core.VizApp;
|
||||||
import com.raytheon.uf.viz.core.rsc.IInputHandler.InputPriority;
|
import com.raytheon.uf.viz.core.rsc.IInputHandler.InputPriority;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -60,13 +61,21 @@ public class ParticipantEventController extends AbstractRoleEventController {
|
||||||
@Subscribe
|
@Subscribe
|
||||||
public void initDataArrived(IInitData initData) {
|
public void initDataArrived(IInitData initData) {
|
||||||
if (initData instanceof SharedEditor) {
|
if (initData instanceof SharedEditor) {
|
||||||
SharedEditor se = (SharedEditor) initData;
|
final SharedEditor se = (SharedEditor) initData;
|
||||||
CollaborationEditor editor = EditorSetup.createEditor(se);
|
VizApp.runAsync(new Runnable() {
|
||||||
editor.registerMouseHandler(new CollaborationEditorInputHandler(
|
|
||||||
session, editor.getDisplayPanes()[0]),
|
@Override
|
||||||
InputPriority.SYSTEM_RESOURCE);
|
public void run() {
|
||||||
CollaborationDataManager.getInstance().editorCreated(
|
CollaborationEditor editor = EditorSetup.createEditor(se);
|
||||||
session.getSessionId(), editor);
|
editor.registerMouseHandler(
|
||||||
|
new CollaborationEditorInputHandler(session, editor
|
||||||
|
.getDisplayPanes()[0]),
|
||||||
|
InputPriority.SYSTEM_RESOURCE);
|
||||||
|
CollaborationDataManager.getInstance().editorCreated(
|
||||||
|
session.getSessionId(), editor);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -90,7 +90,8 @@ public abstract class BaseSession implements ISession {
|
||||||
* @param sessionId
|
* @param sessionId
|
||||||
*/
|
*/
|
||||||
protected BaseSession(IContainer container, EventBus externalBus,
|
protected BaseSession(IContainer container, EventBus externalBus,
|
||||||
SessionManager manager, String sessionId) throws CollaborationException {
|
SessionManager manager, String sessionId)
|
||||||
|
throws CollaborationException {
|
||||||
// Set the session identifier.
|
// Set the session identifier.
|
||||||
this.sessionId = sessionId;
|
this.sessionId = sessionId;
|
||||||
managerEventBus = externalBus;
|
managerEventBus = externalBus;
|
||||||
|
@ -240,6 +241,7 @@ public abstract class BaseSession implements ISession {
|
||||||
*/
|
*/
|
||||||
public ID createID(String name) throws IDCreateException {
|
public ID createID(String name) throws IDCreateException {
|
||||||
ID id = null;
|
ID id = null;
|
||||||
|
name += "/foo"; // TODO fix this in a better way
|
||||||
if (connectionNamespace != null) {
|
if (connectionNamespace != null) {
|
||||||
id = IDFactory.getDefault().createID(connectionNamespace, name);
|
id = IDFactory.getDefault().createID(connectionNamespace, name);
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,7 +80,10 @@ public class PeerToPeerChat extends BaseSession implements IPeerToPeer {
|
||||||
// Assume success
|
// Assume success
|
||||||
int status = Errors.NO_ERROR;
|
int status = Errors.NO_ERROR;
|
||||||
if (chatSender != null) {
|
if (chatSender != null) {
|
||||||
ID toID = createID(message.getTo().getName());
|
// TODO fix this in a better way
|
||||||
|
String fqName = message.getTo().getFQName()
|
||||||
|
.replace("conference.", "");
|
||||||
|
ID toID = createID(fqName);
|
||||||
String subject = message.getSubject();
|
String subject = message.getSubject();
|
||||||
String body = message.getBody();
|
String body = message.getBody();
|
||||||
Collection<Property> properties = message.getProperties();
|
Collection<Property> properties = message.getProperties();
|
||||||
|
|
|
@ -136,7 +136,8 @@ public class VenueSession extends BaseSession implements IVenueSession,
|
||||||
* @param eventBus
|
* @param eventBus
|
||||||
*/
|
*/
|
||||||
VenueSession(IContainer container, EventBus externalBus,
|
VenueSession(IContainer container, EventBus externalBus,
|
||||||
SessionManager manager, String sessionId) throws CollaborationException {
|
SessionManager manager, String sessionId)
|
||||||
|
throws CollaborationException {
|
||||||
super(container, externalBus, manager, sessionId);
|
super(container, externalBus, manager, sessionId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -237,7 +238,8 @@ public class VenueSession extends BaseSession implements IVenueSession,
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param subject the subject to set
|
* @param subject
|
||||||
|
* the subject to set
|
||||||
*/
|
*/
|
||||||
public void setSubject(String subject) {
|
public void setSubject(String subject) {
|
||||||
this.subject = subject;
|
this.subject = subject;
|
||||||
|
@ -349,9 +351,10 @@ public class VenueSession extends BaseSession implements IVenueSession,
|
||||||
PeerToPeerChat session = getP2PSession();
|
PeerToPeerChat session = getP2PSession();
|
||||||
if (session != null) {
|
if (session != null) {
|
||||||
String message = Tools.marshallData(initData);
|
String message = Tools.marshallData(initData);
|
||||||
if (message != null) {
|
IMessage msg = new CollaborationMessage(participant, message);
|
||||||
session.sendPeerToPeer(participant.getFQName(), message);
|
msg.setProperty(Tools.PROP_SESSION_ID, this.getSessionId());
|
||||||
}
|
session.sendPeerToPeer(msg);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue