Issue #427 open editor when joining session
Change-Id: I6094a7a909584acb8b10236119ec3eb5dd965e59 Former-commit-id:223eb82fe0
[formerly223eb82fe0
[formerly f1c0549a84b0aa0d4829ca1bc584165ca98dbbb6]] Former-commit-id:c29a5a75d9
Former-commit-id:6319166680
This commit is contained in:
parent
7ff96826db
commit
28ed07b65a
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;
|
||||||
|
@ -100,7 +101,7 @@ public abstract class BaseSession implements ISession {
|
||||||
eventSubscribers = new HashMap<Object, Object>();
|
eventSubscribers = new HashMap<Object, Object>();
|
||||||
setup();
|
setup();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @throws ECFException
|
* @throws ECFException
|
||||||
|
@ -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();
|
||||||
|
@ -124,10 +127,10 @@ public class PeerToPeerChat extends BaseSession implements IPeerToPeer {
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public EventBus getEventPublisher() {
|
public EventBus getEventPublisher() {
|
||||||
|
|
|
@ -129,14 +129,15 @@ public class VenueSession extends BaseSession implements IVenueSession,
|
||||||
private Map<Object, Object> initSubscribers = new HashMap<Object, Object>();
|
private Map<Object, Object> initSubscribers = new HashMap<Object, Object>();
|
||||||
|
|
||||||
private String subject;
|
private String subject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param container
|
* @param container
|
||||||
* @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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -228,7 +229,7 @@ public class VenueSession extends BaseSession implements IVenueSession,
|
||||||
}
|
}
|
||||||
return venue;
|
return venue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the subject
|
* @return the subject
|
||||||
*/
|
*/
|
||||||
|
@ -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;
|
||||||
|
@ -271,7 +273,7 @@ public class VenueSession extends BaseSession implements IVenueSession,
|
||||||
|
|
||||||
ID userId = IDFactory.getDefault().createID(
|
ID userId = IDFactory.getDefault().createID(
|
||||||
getConnectionNamespace(), id);
|
getConnectionNamespace(), id);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
sender.sendInvitation(roomId, userId, subject, body);
|
sender.sendInvitation(roomId, userId, subject, body);
|
||||||
} catch (ECFException e) {
|
} catch (ECFException e) {
|
||||||
|
@ -309,7 +311,7 @@ public class VenueSession extends BaseSession implements IVenueSession,
|
||||||
}
|
}
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param body
|
* @param body
|
||||||
|
@ -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);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -367,7 +370,7 @@ public class VenueSession extends BaseSession implements IVenueSession,
|
||||||
if (!initSubscribers.containsKey(subscriber)) {
|
if (!initSubscribers.containsKey(subscriber)) {
|
||||||
initSubscribers.put(subscriber, subscriber);
|
initSubscribers.put(subscriber, subscriber);
|
||||||
}
|
}
|
||||||
|
|
||||||
PeerToPeerChat session = getP2PSession();
|
PeerToPeerChat session = getP2PSession();
|
||||||
if (session != null) {
|
if (session != null) {
|
||||||
session.registerEventHandler(subscriber);
|
session.registerEventHandler(subscriber);
|
||||||
|
@ -512,7 +515,7 @@ public class VenueSession extends BaseSession implements IVenueSession,
|
||||||
void setSessionLeader(IChatID id) {
|
void setSessionLeader(IChatID id) {
|
||||||
sessionLeader = id;
|
sessionLeader = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Reference in a new issue