Merge "Issue #2698 made sessions private and invite only" into development
Former-commit-id:52c3b71049
[formerly db4447bf109981ded541bff929687040cc28953a] Former-commit-id:004999bbec
This commit is contained in:
commit
0a7961457e
22 changed files with 220 additions and 445 deletions
|
@ -23,12 +23,10 @@ import java.util.Collection;
|
|||
|
||||
import org.jivesoftware.smack.packet.Presence;
|
||||
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
|
||||
|
||||
/**
|
||||
* Provides information about a venue. In addition implementations will act as a
|
||||
* target for participant updates such as
|
||||
* Provides information about a venue.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
|
@ -36,24 +34,16 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
|
|||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 1, 2012 jkorman Initial creation
|
||||
* Mar 1, 2012 jkorman Initial creation
|
||||
* Jan 28, 2014 2698 bclement removed getInfo, added methods to replace
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author jkorman
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public interface IVenue {
|
||||
|
||||
/**
|
||||
* Get venue information. This contains information that may change over
|
||||
* time
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public IVenueInfo getInfo() throws CollaborationException;
|
||||
|
||||
/**
|
||||
* @return list of users in venue
|
||||
*/
|
||||
|
@ -70,6 +60,21 @@ public interface IVenue {
|
|||
/**
|
||||
* @return id of venue "name@service"
|
||||
*/
|
||||
public String getId();
|
||||
|
||||
/**
|
||||
* @return name of venue
|
||||
*/
|
||||
public String getName();
|
||||
|
||||
/**
|
||||
* @return number of users in venue
|
||||
*/
|
||||
public int getParticipantCount();
|
||||
|
||||
/**
|
||||
* @return venue subject
|
||||
*/
|
||||
public String getSubject();
|
||||
|
||||
}
|
||||
|
|
|
@ -1,85 +0,0 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.uf.viz.collaboration.comm.identity.info;
|
||||
|
||||
/**
|
||||
* Information on a venue. Information may become outdated.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 1, 2012 jkorman Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author jkorman
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public interface IVenueInfo {
|
||||
|
||||
/**
|
||||
* @return description, may be empty
|
||||
*/
|
||||
public String getVenueDescription();
|
||||
|
||||
/**
|
||||
* Get venue name
|
||||
* @return
|
||||
*/
|
||||
public String getVenueName();
|
||||
|
||||
/**
|
||||
* @return subject, may be empty
|
||||
*/
|
||||
public String getVenueSubject();
|
||||
|
||||
/**
|
||||
* @return id of venue "name@service"
|
||||
*/
|
||||
public String getVenueID();
|
||||
|
||||
/**
|
||||
* Get a count of the current number of room participants
|
||||
*
|
||||
* @return Count of the current number of room participants
|
||||
*/
|
||||
public int getParticipantCount();
|
||||
|
||||
/**
|
||||
* @return true if venue is divided into participants and occupants who
|
||||
* can't speak
|
||||
*/
|
||||
public boolean isModerated();
|
||||
|
||||
/**
|
||||
* @return true if venue persists after participants have left
|
||||
*/
|
||||
public boolean isPersistent();
|
||||
|
||||
/**
|
||||
* @return true if venue is password protected
|
||||
*/
|
||||
public boolean requiresPassword();
|
||||
|
||||
}
|
|
@ -27,20 +27,18 @@ import java.util.Map;
|
|||
import java.util.Set;
|
||||
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smack.packet.Presence;
|
||||
import org.jivesoftware.smack.packet.Presence.Mode;
|
||||
import org.jivesoftware.smack.packet.Presence.Type;
|
||||
import org.jivesoftware.smack.util.StringUtils;
|
||||
import org.jivesoftware.smackx.muc.MultiUserChat;
|
||||
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.info.IVenue;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.info.IVenueInfo;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.user.IDConverter;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
* Provides information about a venue.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
|
@ -50,34 +48,21 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 1, 2012 jkorman Initial creation
|
||||
* Dec 6, 2013 2561 bclement removed ECF
|
||||
* Jan 28, 2014 2698 bclement removed getInfo, added methods to replace
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author jkorman
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class Venue implements IVenue {
|
||||
|
||||
private final MultiUserChat muc;
|
||||
|
||||
private final XMPPConnection conn;
|
||||
|
||||
private Map<String, Presence> presenceMap = new HashMap<String, Presence>();
|
||||
|
||||
public Venue(XMPPConnection conn, MultiUserChat muc) {
|
||||
this.muc = muc;
|
||||
this.conn = conn;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IVenueInfo getInfo() throws CollaborationException {
|
||||
try {
|
||||
return new VenueInfo(MultiUserChat.getRoomInfo(conn, muc.getRoom()));
|
||||
} catch (XMPPException e) {
|
||||
throw new CollaborationException("Unable to get room information",
|
||||
e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -112,7 +97,39 @@ public class Venue implements IVenue {
|
|||
*/
|
||||
@Override
|
||||
public String getName() {
|
||||
return StringUtils.parseName(getId());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.uf.viz.collaboration.comm.identity.info.IVenue#getId()
|
||||
*/
|
||||
@Override
|
||||
public String getId() {
|
||||
return muc.getRoom();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.raytheon.uf.viz.collaboration.comm.identity.info.IVenue#
|
||||
* getParticipantCount()
|
||||
*/
|
||||
@Override
|
||||
public int getParticipantCount() {
|
||||
return muc.getOccupantsCount();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.raytheon.uf.viz.collaboration.comm.identity.info.IVenue#getSubject()
|
||||
*/
|
||||
@Override
|
||||
public String getSubject() {
|
||||
return muc.getSubject();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,105 +0,0 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.uf.viz.collaboration.comm.provider.info;
|
||||
|
||||
import org.jivesoftware.smackx.muc.RoomInfo;
|
||||
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.info.IVenueInfo;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.Tools;
|
||||
|
||||
/**
|
||||
*
|
||||
* Wrap a chatroom info in a VenueInfo
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jul 24, 2012 bsteffen Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author bsteffen
|
||||
* @version 1.0
|
||||
*/
|
||||
public class VenueInfo implements IVenueInfo {
|
||||
|
||||
private RoomInfo info;
|
||||
|
||||
public VenueInfo(RoomInfo info) {
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVenueDescription() {
|
||||
return info.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVenueName() {
|
||||
return Tools.parseName(info.getRoom());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVenueSubject() {
|
||||
return info.getSubject();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVenueID() {
|
||||
return info.getRoom();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getParticipantCount() {
|
||||
return info.getOccupantsCount();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isModerated() {
|
||||
return info.isModerated();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPersistent() {
|
||||
return info.isPersistent();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean requiresPassword() {
|
||||
return info.isPasswordProtected();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(String.format("[%s]:", getVenueName()));
|
||||
sb.append(String.format("[%s]:", getVenueID()));
|
||||
sb.append(String.format("mod[%s]:", (isModerated()) ? "T" : "F"));
|
||||
sb.append(String.format("pers[%s]:", (isPersistent()) ? "T" : "F"));
|
||||
sb.append(String.format("pass[%s]:", (requiresPassword()) ? "T" : "F"));
|
||||
sb.append(String.format("\n subject : %s", getVenueSubject()));
|
||||
sb.append(String.format("\n description : %s", getVenueDescription()));
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
|
@ -39,6 +39,7 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 21, 2012 jkorman Initial creation
|
||||
* Dec 6, 2013 2561 bclement removed ECF
|
||||
* Jan 28, 2014 2698 bclement removed false throws statements
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -63,8 +64,7 @@ public abstract class BaseSession implements ISession {
|
|||
* @param externalBus
|
||||
* @param manager
|
||||
*/
|
||||
protected BaseSession(EventBus externalBus,
|
||||
CollaborationConnection manager) throws CollaborationException {
|
||||
protected BaseSession(EventBus externalBus, CollaborationConnection manager) {
|
||||
this(externalBus, manager, UUID.randomUUID().toString());
|
||||
}
|
||||
|
||||
|
@ -76,8 +76,7 @@ public abstract class BaseSession implements ISession {
|
|||
* @param sessionId
|
||||
*/
|
||||
protected BaseSession(EventBus externalBus,
|
||||
CollaborationConnection manager, String sessionId)
|
||||
throws CollaborationException {
|
||||
CollaborationConnection manager, String sessionId) {
|
||||
// Set the session identifier.
|
||||
this.sessionId = sessionId;
|
||||
managerEventBus = externalBus;
|
||||
|
|
|
@ -19,10 +19,8 @@
|
|||
**/
|
||||
package com.raytheon.uf.viz.collaboration.comm.provider.session;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
@ -44,13 +42,11 @@ import org.jivesoftware.smack.packet.XMPPError;
|
|||
import org.jivesoftware.smack.provider.ProviderManager;
|
||||
import org.jivesoftware.smackx.muc.InvitationListener;
|
||||
import org.jivesoftware.smackx.muc.MultiUserChat;
|
||||
import org.jivesoftware.smackx.muc.RoomInfo;
|
||||
|
||||
import com.google.common.eventbus.EventBus;
|
||||
import com.google.common.net.HostAndPort;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.IAccountManager;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.ISession;
|
||||
|
@ -60,7 +56,6 @@ import com.raytheon.uf.viz.collaboration.comm.identity.event.IEventPublisher;
|
|||
import com.raytheon.uf.viz.collaboration.comm.identity.event.IRosterChangeEvent;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.event.IVenueInvitationEvent;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.event.RosterChangeType;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.info.IVenueInfo;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.invite.SharedDisplayVenueInvite;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.invite.VenueInvite;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.user.IQualifiedID;
|
||||
|
@ -71,7 +66,6 @@ import com.raytheon.uf.viz.collaboration.comm.provider.Tools;
|
|||
import com.raytheon.uf.viz.collaboration.comm.provider.event.RosterChangeEvent;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.event.ServerDisconnectEvent;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.event.VenueInvitationEvent;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.info.VenueInfo;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.user.ContactsManager;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.user.IDConverter;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
|
||||
|
@ -111,6 +105,8 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.VenueId;
|
|||
* Jan 08, 2014 2563 bclement fixed custom port and service name in user id
|
||||
* Jan 15, 2014 2630 bclement connection data stores status as Mode object
|
||||
* Jan 24, 2014 2701 bclement removed roster manager
|
||||
* Jan 28, 2014 2698 bclement fixed compression default
|
||||
* cleaned up createCollaborationVenue, removed getVenueInfo
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -156,7 +152,10 @@ public class CollaborationConnection implements IEventPublisher {
|
|||
|
||||
static {
|
||||
try {
|
||||
COMPRESS = Boolean.getBoolean("collaboration.compression");
|
||||
final String compressionProperty = "collaboration.compression";
|
||||
if (System.getProperty(compressionProperty) != null) {
|
||||
COMPRESS = Boolean.getBoolean(compressionProperty);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// must not have permission to access system properties. ignore and
|
||||
// use default.
|
||||
|
@ -394,20 +393,15 @@ public class CollaborationConnection implements IEventPublisher {
|
|||
public ISharedDisplaySession createCollaborationVenue(String venueName,
|
||||
String subject) throws CollaborationException {
|
||||
SharedDisplaySession session = null;
|
||||
try {
|
||||
session = new SharedDisplaySession(eventBus, this);
|
||||
session = new SharedDisplaySession(eventBus, this);
|
||||
|
||||
session.createVenue(venueName, subject);
|
||||
session.setCurrentSessionLeader(user);
|
||||
session.setCurrentDataProvider(user);
|
||||
session.createVenue(venueName, subject);
|
||||
session.setCurrentSessionLeader(user);
|
||||
session.setCurrentDataProvider(user);
|
||||
|
||||
sessions.put(session.getSessionId(), session);
|
||||
postEvent(session);
|
||||
return session;
|
||||
} catch (Exception e) {
|
||||
throw new CollaborationException(
|
||||
"Error creating collaboration venue " + venueName, e);
|
||||
}
|
||||
sessions.put(session.getSessionId(), session);
|
||||
postEvent(session);
|
||||
return session;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -471,32 +465,6 @@ public class CollaborationConnection implements IEventPublisher {
|
|||
postEvent(session);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Collection<IVenueInfo> getVenueInfo() {
|
||||
// Check to see if the container has been connected.
|
||||
Collection<IVenueInfo> info = new ArrayList<IVenueInfo>();
|
||||
if (isConnected()) {
|
||||
Iterator<String> joinedRooms = MultiUserChat.getJoinedRooms(
|
||||
connection, connection.getUser());
|
||||
while (joinedRooms.hasNext()) {
|
||||
String room = joinedRooms.next();
|
||||
RoomInfo roomInfo;
|
||||
try {
|
||||
roomInfo = MultiUserChat.getRoomInfo(connection, room);
|
||||
info.add(new VenueInfo(roomInfo));
|
||||
} catch (XMPPException e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
"Unable to get info for room: " + room, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
// ***************************
|
||||
// Connection listener
|
||||
// ***************************
|
||||
|
|
|
@ -54,7 +54,6 @@ import com.raytheon.uf.common.status.UFStatus;
|
|||
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.info.IVenueInfo;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.user.SharedDisplayRole;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.SessionPayload;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.SessionPayload.PayloadType;
|
||||
|
@ -72,6 +71,7 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 18, 2012 njensen Initial creation
|
||||
* Dec 18, 2013 2562 bclement moved data to packet extension
|
||||
* Jan 28, 2014 2698 bclement removed venue info
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -96,7 +96,7 @@ public class SharedDisplaySession extends VenueSession implements
|
|||
private XMPPConnection conn;
|
||||
|
||||
public SharedDisplaySession(EventBus externalBus,
|
||||
CollaborationConnection manager) throws CollaborationException {
|
||||
CollaborationConnection manager) {
|
||||
super(externalBus, manager);
|
||||
init();
|
||||
}
|
||||
|
@ -270,16 +270,15 @@ public class SharedDisplaySession extends VenueSession implements
|
|||
* configureVenue(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
protected IVenueInfo configureVenue(String venueName)
|
||||
protected void configureVenue(String venueName)
|
||||
throws CollaborationException {
|
||||
IVenueInfo rval = super.configureVenue(venueName);
|
||||
super.configureVenue(venueName);
|
||||
try {
|
||||
configureSubscription();
|
||||
} catch (XMPPException e) {
|
||||
throw new CollaborationException(
|
||||
"Unable to configure subscription", e);
|
||||
}
|
||||
return rval;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -332,9 +331,9 @@ public class SharedDisplaySession extends VenueSession implements
|
|||
* createVenue(java.lang.String, java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
protected IVenueInfo createVenue(String venueName, String subject)
|
||||
protected void createVenue(String venueName, String subject)
|
||||
throws CollaborationException {
|
||||
IVenueInfo rval = super.createVenue(venueName, subject);
|
||||
super.createVenue(venueName, subject);
|
||||
try {
|
||||
createNode(getSessionId());
|
||||
} catch (XMPPException e) {
|
||||
|
@ -344,9 +343,8 @@ public class SharedDisplaySession extends VenueSession implements
|
|||
configureSubscription();
|
||||
} catch (XMPPException e) {
|
||||
throw new CollaborationException(
|
||||
"Unable to configure subscription", e);
|
||||
"Unable to configure pubsub topic", e);
|
||||
}
|
||||
return rval;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
**/
|
||||
package com.raytheon.uf.viz.collaboration.comm.provider.session;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -30,7 +31,9 @@ import org.jivesoftware.smack.packet.Message;
|
|||
import org.jivesoftware.smack.packet.Message.Type;
|
||||
import org.jivesoftware.smack.packet.Packet;
|
||||
import org.jivesoftware.smack.packet.Presence;
|
||||
import org.jivesoftware.smack.packet.XMPPError;
|
||||
import org.jivesoftware.smackx.Form;
|
||||
import org.jivesoftware.smackx.FormField;
|
||||
import org.jivesoftware.smackx.ServiceDiscoveryManager;
|
||||
import org.jivesoftware.smackx.muc.MultiUserChat;
|
||||
import org.jivesoftware.smackx.muc.ParticipantStatusListener;
|
||||
|
@ -47,7 +50,6 @@ import com.raytheon.uf.viz.collaboration.comm.identity.IMessage;
|
|||
import com.raytheon.uf.viz.collaboration.comm.identity.IVenueSession;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.event.ParticipantEventType;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.info.IVenue;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.info.IVenueInfo;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.invite.VenueInvite;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.CollaborationMessage;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.SessionPayload;
|
||||
|
@ -62,6 +64,7 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.IDConverter;
|
|||
import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
|
||||
|
||||
/**
|
||||
* Represents a multi-user chat room
|
||||
*
|
||||
* <ul>
|
||||
* <li>EventBus subscription events.</li>
|
||||
|
@ -89,6 +92,8 @@ import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
|
|||
* Dec 19, 2013 2563 bclement status listeners now send all events to bus
|
||||
* Jan 07, 2013 2563 bclement use getServiceName instead of getHost when creating room id
|
||||
* Jan 08, 2014 2563 bclement fixed service name in user IDs from chat history
|
||||
* Jan 28, 2014 2698 bclement removed venue info, new rooms are now invite-only
|
||||
* improved error handling for when room already exists
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -132,8 +137,7 @@ public class VenueSession extends BaseSession implements IVenueSession {
|
|||
* @param container
|
||||
* @param eventBus
|
||||
*/
|
||||
protected VenueSession(EventBus externalBus, CollaborationConnection manager)
|
||||
throws CollaborationException {
|
||||
protected VenueSession(EventBus externalBus, CollaborationConnection manager) {
|
||||
super(externalBus, manager);
|
||||
}
|
||||
|
||||
|
@ -253,7 +257,7 @@ public class VenueSession extends BaseSession implements IVenueSession {
|
|||
* @return
|
||||
* @throws CollaborationException
|
||||
*/
|
||||
protected IVenueInfo configureVenue(String venueName)
|
||||
protected void configureVenue(String venueName)
|
||||
throws CollaborationException {
|
||||
CollaborationConnection manager = getSessionManager();
|
||||
XMPPConnection conn = manager.getXmppConnection();
|
||||
|
@ -261,7 +265,6 @@ public class VenueSession extends BaseSession implements IVenueSession {
|
|||
this.muc = new MultiUserChat(conn, roomId);
|
||||
this.venue = new Venue(conn, muc);
|
||||
createListeners();
|
||||
return this.venue.getInfo();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -284,7 +287,7 @@ public class VenueSession extends BaseSession implements IVenueSession {
|
|||
* @see com.raytheon.uf.viz.collaboration.comm.identity.IVenueSession#createVenue(java.lang.String,
|
||||
* java.lang.String)
|
||||
*/
|
||||
protected IVenueInfo createVenue(String venueName, String subject)
|
||||
protected void createVenue(String venueName, String subject)
|
||||
throws CollaborationException {
|
||||
try {
|
||||
CollaborationConnection manager = getSessionManager();
|
||||
|
@ -297,17 +300,70 @@ public class VenueSession extends BaseSession implements IVenueSession {
|
|||
createListeners();
|
||||
UserId user = manager.getUser();
|
||||
muc.create(user.getName());
|
||||
muc.sendConfigurationForm(new Form(Form.TYPE_SUBMIT));
|
||||
muc.sendConfigurationForm(getRoomConfig(venueName));
|
||||
muc.changeSubject(subject);
|
||||
this.venue = new Venue(conn, muc);
|
||||
sendPresence(CollaborationConnection.getConnection().getPresence());
|
||||
return this.venue.getInfo();
|
||||
} catch (XMPPException e) {
|
||||
throw new CollaborationException("Error creating venue "
|
||||
+ venueName, e);
|
||||
XMPPError xmppError = e.getXMPPError();
|
||||
String msg;
|
||||
if (xmppError != null) {
|
||||
int code = xmppError.getCode();
|
||||
if (code == 409 || code == 407) {
|
||||
// 409: room already exists, can't join due to name conflict
|
||||
// 407: room already exists, can't join since it is private
|
||||
msg = "Session already exists. Pick a different name.";
|
||||
} else {
|
||||
msg = xmppError.getCondition();
|
||||
}
|
||||
} else {
|
||||
msg = "Error creating venue " + venueName;
|
||||
}
|
||||
throw new CollaborationException(msg, e);
|
||||
}
|
||||
}
|
||||
|
||||
protected Form getRoomConfig(String roomName) throws CollaborationException {
|
||||
Form form;
|
||||
try {
|
||||
form = muc.getConfigurationForm();
|
||||
} catch (XMPPException e) {
|
||||
throw new CollaborationException(
|
||||
"Unable to create room configuration form", e);
|
||||
}
|
||||
Form submitForm = form.createAnswerForm();
|
||||
// Add default answers to the form to submit
|
||||
for (Iterator<FormField> fields = form.getFields(); fields.hasNext();) {
|
||||
FormField field = fields.next();
|
||||
if (!FormField.TYPE_HIDDEN.equals(field.getType())
|
||||
&& field.getVariable() != null) {
|
||||
// Sets the default value as the answer
|
||||
submitForm.setDefaultAnswer(field.getVariable());
|
||||
}
|
||||
}
|
||||
submitForm.setAnswer("muc#roomconfig_roomname", roomName);
|
||||
submitForm.setAnswer("muc#roomconfig_roomdesc", roomName);
|
||||
submitForm.setAnswer("muc#roomconfig_publicroom", false);
|
||||
submitForm.setAnswer("muc#roomconfig_membersonly", true);
|
||||
submitForm.setAnswer("muc#roomconfig_allowinvites", true);
|
||||
submitForm.setAnswer("muc#roomconfig_whois",
|
||||
Arrays.asList("moderators"));
|
||||
return submitForm;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param roomName
|
||||
* @return true if room exists on server
|
||||
* @throws XMPPException
|
||||
*/
|
||||
public static boolean roomExistsOnServer(String roomName)
|
||||
throws XMPPException {
|
||||
CollaborationConnection conn = CollaborationConnection.getConnection();
|
||||
XMPPConnection xmpp = conn.getXmppConnection();
|
||||
String id = getRoomId(xmpp.getServiceName(), roomName);
|
||||
return roomExistsOnServer(conn.getXmppConnection(), id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param roomId
|
||||
* @return true if room exists on server
|
||||
|
@ -705,7 +761,7 @@ public class VenueSession extends BaseSession implements IVenueSession {
|
|||
*/
|
||||
@Override
|
||||
public void sendPresence(Presence presence) throws CollaborationException {
|
||||
presence.setTo(venue.getInfo().getVenueID());
|
||||
presence.setTo(venue.getId());
|
||||
XMPPConnection conn = getConnection().getXmppConnection();
|
||||
conn.sendPacket(presence);
|
||||
}
|
||||
|
|
|
@ -23,9 +23,6 @@ import java.util.HashMap;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.eclipse.ui.IEditorPart;
|
||||
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.user.SharedDisplayRole;
|
||||
import com.raytheon.uf.viz.collaboration.display.roles.DataProviderEventController;
|
||||
|
@ -43,6 +40,7 @@ import com.raytheon.uf.viz.collaboration.display.roles.ParticipantEventControlle
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 16, 2012 njensen Initial creation
|
||||
* Jan 28, 2014 2698 bclement removed false throws statement
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -63,8 +61,7 @@ public class SharedDisplaySessionMgr {
|
|||
}
|
||||
|
||||
public static void joinSession(ISharedDisplaySession session,
|
||||
SharedDisplayRole initialRole, SessionColorManager colors)
|
||||
throws CollaborationException {
|
||||
SharedDisplayRole initialRole, SessionColorManager colors) {
|
||||
SessionContainer container = new SessionContainer();
|
||||
container.setSessionId(session.getSessionId());
|
||||
container.setSession(session);
|
||||
|
|
|
@ -21,12 +21,7 @@ package com.raytheon.uf.viz.collaboration.display.roles;
|
|||
|
||||
import org.eclipse.ui.PartInitException;
|
||||
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.info.IVenueInfo;
|
||||
import com.raytheon.uf.viz.collaboration.display.editor.CollaborationEditorInput;
|
||||
import com.raytheon.uf.viz.collaboration.display.editor.ICollaborationEditor;
|
||||
import com.raytheon.viz.ui.VizWorkbenchManager;
|
||||
|
@ -41,6 +36,7 @@ import com.raytheon.viz.ui.VizWorkbenchManager;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 26, 2012 njensen Initial creation
|
||||
* Jan 28, 2014 2698 bclement removed venue info
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -51,9 +47,6 @@ import com.raytheon.viz.ui.VizWorkbenchManager;
|
|||
public class ParticipantEventController extends
|
||||
AbstractRoleEventController<ICollaborationEditor> {
|
||||
|
||||
private final IUFStatusHandler statusHandler = UFStatus.getHandler(this
|
||||
.getClass());
|
||||
|
||||
public ParticipantEventController(ISharedDisplaySession session) {
|
||||
super(session);
|
||||
}
|
||||
|
@ -67,17 +60,9 @@ public class ParticipantEventController extends
|
|||
*/
|
||||
@Override
|
||||
protected ICollaborationEditor createDisplayContainer() {
|
||||
String desc;
|
||||
try {
|
||||
IVenueInfo info = session.getVenue().getInfo();
|
||||
desc = info.getVenueDescription();
|
||||
} catch (CollaborationException e1) {
|
||||
statusHandler
|
||||
.handle(Priority.PROBLEM, e1.getLocalizedMessage(), e1);
|
||||
desc = session.getVenue().getName();
|
||||
}
|
||||
String name = session.getVenue().getName();
|
||||
CollaborationEditorInput input = new CollaborationEditorInput(
|
||||
session.getSessionId(), desc);
|
||||
session.getSessionId(), name);
|
||||
try {
|
||||
return (ICollaborationEditor) VizWorkbenchManager.getInstance()
|
||||
.getCurrentWindow().getActivePage()
|
||||
|
|
|
@ -36,12 +36,9 @@ import org.eclipse.ui.IWorkbenchPage;
|
|||
import org.eclipse.ui.IWorkbenchPart;
|
||||
|
||||
import com.google.common.eventbus.Subscribe;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.info.IVenueInfo;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
|
||||
import com.raytheon.uf.viz.collaboration.display.Activator;
|
||||
import com.raytheon.uf.viz.collaboration.display.IRemoteDisplayContainer;
|
||||
|
@ -84,6 +81,7 @@ import com.raytheon.viz.ui.editor.AbstractEditor;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jun 8, 2012 mschenke Initial creation
|
||||
* Jan 28, 2014 2698 bclement removed venue info
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -93,8 +91,6 @@ import com.raytheon.viz.ui.editor.AbstractEditor;
|
|||
|
||||
public class SharedEditorsManager implements IRemoteDisplayContainer {
|
||||
|
||||
private final IUFStatusHandler log = UFStatus.getHandler(this.getClass());
|
||||
|
||||
public class RemoteDisplayEventHandler {
|
||||
@Subscribe
|
||||
public void remoteDisplayRequested(RemoteDisplayRequested event) {
|
||||
|
@ -448,14 +444,7 @@ public class SharedEditorsManager implements IRemoteDisplayContainer {
|
|||
private SharedEditorsManager(ISharedDisplaySession session) {
|
||||
this.session = session;
|
||||
session.registerEventHandler(eventHandler);
|
||||
String title;
|
||||
try {
|
||||
IVenueInfo info = session.getVenue().getInfo();
|
||||
title = info.getVenueDescription();
|
||||
} catch (CollaborationException e) {
|
||||
log.error("Unable to get venue information", e);
|
||||
title = session.getVenue().getName();
|
||||
}
|
||||
String title = session.getVenue().getName();
|
||||
editorTitleSuffix = " (" + title + ")";
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
|
|||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.info.IVenueInfo;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.info.IVenue;
|
||||
import com.raytheon.uf.viz.collaboration.display.Activator;
|
||||
import com.raytheon.uf.viz.collaboration.display.data.SessionColorManager;
|
||||
import com.raytheon.uf.viz.collaboration.display.data.SessionContainer;
|
||||
|
@ -57,6 +57,7 @@ import com.raytheon.uf.viz.remote.graphics.DispatchGraphicsTarget;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 13, 2012 njensen Initial creation
|
||||
* Jan 28, 2014 2698 bclement removed venue info
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -85,16 +86,9 @@ public class DataProviderRsc extends
|
|||
if (container != null) {
|
||||
session = container.getSession();
|
||||
colorManager = container.getColorManager();
|
||||
IVenueInfo info;
|
||||
try {
|
||||
info = session.getVenue().getInfo();
|
||||
roomName = info.getVenueDescription();
|
||||
subject = info.getVenueSubject();
|
||||
} catch (CollaborationException e) {
|
||||
statusHandler.error(e.getLocalizedMessage(), e);
|
||||
roomName = session.getVenue().getName();
|
||||
}
|
||||
|
||||
IVenue venue = session.getVenue();
|
||||
roomName = venue.getName();
|
||||
subject = venue.getSubject();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,6 @@ package com.raytheon.uf.viz.collaboration.ui;
|
|||
**/
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.jface.dialogs.IDialogConstants;
|
||||
|
@ -38,6 +37,7 @@ import org.eclipse.swt.layout.GridLayout;
|
|||
import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
|
@ -46,6 +46,7 @@ import org.eclipse.ui.IPartListener;
|
|||
import org.eclipse.ui.IWorkbenchPage;
|
||||
import org.eclipse.ui.IWorkbenchPart;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
|
@ -53,11 +54,11 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
|||
import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException;
|
||||
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.info.IVenueInfo;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.user.SharedDisplayRole;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.Tools;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.session.CollaborationConnection;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.session.PeerToPeerCommHelper;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.session.VenueSession;
|
||||
import com.raytheon.uf.viz.collaboration.display.data.SharedDisplaySessionMgr;
|
||||
import com.raytheon.uf.viz.collaboration.display.roles.dataprovider.ISharedEditorsManagerListener;
|
||||
import com.raytheon.uf.viz.collaboration.display.roles.dataprovider.SharedEditorsManager;
|
||||
|
@ -83,6 +84,7 @@ import com.raytheon.viz.ui.editor.IMultiPaneEditor;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Feb 15, 2012 rferrel Initial creation
|
||||
* Dec 19, 2013 2563 bclement disable shared display option if not supported by server
|
||||
* Jan 28, 2014 2698 bclement added error display text
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -110,6 +112,8 @@ public class CreateSessionDialog extends CaveSWTDialog {
|
|||
|
||||
private ISharedEditorsManagerListener sharedEditorsListener;
|
||||
|
||||
private Text errorMessage;
|
||||
|
||||
public CreateSessionDialog(Shell parentShell) {
|
||||
super(parentShell);
|
||||
setText("Create Session");
|
||||
|
@ -246,6 +250,17 @@ public class CreateSessionDialog extends CaveSWTDialog {
|
|||
sharedEditorsListener);
|
||||
}
|
||||
}
|
||||
|
||||
gd = new GridData(GridData.GRAB_HORIZONTAL
|
||||
| GridData.HORIZONTAL_ALIGN_FILL);
|
||||
gd.horizontalSpan = 2;
|
||||
errorMessage = new Text(body, SWT.READ_ONLY | SWT.WRAP);
|
||||
errorMessage.setLayoutData(gd);
|
||||
Display display = errorMessage.getDisplay();
|
||||
errorMessage.setBackground(display
|
||||
.getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
|
||||
errorMessage.setForeground(display.getSystemColor(SWT.COLOR_RED));
|
||||
|
||||
return body;
|
||||
}
|
||||
|
||||
|
@ -456,6 +471,8 @@ public class CreateSessionDialog extends CaveSWTDialog {
|
|||
setReturnValue(result);
|
||||
CreateSessionDialog.this.getShell().dispose();
|
||||
} catch (CollaborationException ex) {
|
||||
errorMessage.setText(ex.getLocalizedMessage());
|
||||
errorMessage.setVisible(true);
|
||||
statusHandler.handle(Priority.ERROR,
|
||||
"Session Creation Error", ex);
|
||||
event.doit = false;
|
||||
|
@ -468,8 +485,10 @@ public class CreateSessionDialog extends CaveSWTDialog {
|
|||
sb.append(prefix).append(msg);
|
||||
prefix = "\n";
|
||||
}
|
||||
errorMessage.setText(sb.toString());
|
||||
errorMessage.setVisible(true);
|
||||
statusHandler.handle(Priority.ERROR,
|
||||
"Session Creation Error");
|
||||
"Session Creation Error: " + sb.toString());
|
||||
event.doit = false;
|
||||
setReturnValue(null);
|
||||
focusField.setFocus();
|
||||
|
@ -496,13 +515,13 @@ public class CreateSessionDialog extends CaveSWTDialog {
|
|||
} else if (!Tools.isValidId(name)) {
|
||||
err = "Name contains invalid characters.";
|
||||
} else {
|
||||
Collection<IVenueInfo> info = CollaborationConnection
|
||||
.getConnection().getVenueInfo();
|
||||
for (IVenueInfo i : info) {
|
||||
if (name.equals(i.getVenueName())) {
|
||||
try {
|
||||
if (VenueSession.roomExistsOnServer(name)) {
|
||||
err = "Session already exists. Pick a different name.";
|
||||
break;
|
||||
}
|
||||
} catch (XMPPException e) {
|
||||
statusHandler.error("Unable to check room existence on server",
|
||||
e);
|
||||
}
|
||||
}
|
||||
return err;
|
||||
|
|
|
@ -36,11 +36,8 @@ import org.jivesoftware.smack.RosterEntry;
|
|||
import org.jivesoftware.smack.RosterGroup;
|
||||
import org.jivesoftware.smack.packet.Presence;
|
||||
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.IVenueSession;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.info.IVenueInfo;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.info.IVenue;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.session.CollaborationConnection;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.user.SharedGroup;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.user.UserId;
|
||||
|
@ -60,6 +57,7 @@ import com.raytheon.uf.viz.collaboration.ui.data.SessionGroupContainer;
|
|||
* Dec 20, 2013 2563 bclement fixed support for ungrouped roster items
|
||||
* Jan 24, 2014 2701 bclement removed local groups, added shared groups
|
||||
* Jan 27, 2014 2700 bclement pass roster entries directly to userLabelProvider
|
||||
* Jan 28, 2014 2698 bclement removed venue info
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -68,8 +66,6 @@ import com.raytheon.uf.viz.collaboration.ui.data.SessionGroupContainer;
|
|||
*/
|
||||
public class UsersTreeLabelProvider extends ColumnLabelProvider {
|
||||
|
||||
private final IUFStatusHandler log = UFStatus.getHandler(this.getClass());
|
||||
|
||||
private AbstractUserLabelProvider userLabelProvider = new AbstractUserLabelProvider() {
|
||||
|
||||
@Override
|
||||
|
@ -146,14 +142,7 @@ public class UsersTreeLabelProvider extends ColumnLabelProvider {
|
|||
if (venue.getVenue() == null) {
|
||||
return null;
|
||||
}
|
||||
IVenueInfo info;
|
||||
try {
|
||||
info = venue.getVenue().getInfo();
|
||||
} catch (CollaborationException e) {
|
||||
log.error("Unable to get session information", e);
|
||||
return null;
|
||||
}
|
||||
return info.getVenueDescription();
|
||||
return venue.getVenue().getName();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -189,19 +178,14 @@ public class UsersTreeLabelProvider extends ColumnLabelProvider {
|
|||
// portion of the view
|
||||
else if (element instanceof IVenueSession) {
|
||||
IVenueSession sessGroup = (IVenueSession) element;
|
||||
IVenueInfo info;
|
||||
try {
|
||||
info = sessGroup.getVenue().getInfo();
|
||||
} catch (CollaborationException e) {
|
||||
log.error("Unable to get session tool tip text", e);
|
||||
return "";
|
||||
}
|
||||
builder.append("ID: ").append(info.getVenueID());
|
||||
builder.append("\nName: ").append(info.getVenueDescription())
|
||||
IVenue venue = sessGroup.getVenue();
|
||||
builder.append("ID: ").append(venue.getId());
|
||||
builder.append("\nName: ").append(venue.getName())
|
||||
.append("\n");
|
||||
builder.append("Subject: ").append(info.getVenueSubject())
|
||||
builder.append("Subject: ").append(venue.getSubject())
|
||||
.append("\n");
|
||||
builder.append("Participants: ").append(info.getParticipantCount());
|
||||
builder.append("Participants: ")
|
||||
.append(venue.getParticipantCount());
|
||||
return builder.toString();
|
||||
} else {
|
||||
return null;
|
||||
|
|
|
@ -44,6 +44,7 @@ import com.raytheon.viz.ui.views.CaveWorkbenchPageManager;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jul 5, 2012 bsteffen Initial creation
|
||||
* Jan 28, 2014 2698 bclement changed sessionName to sessionId
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -56,32 +57,32 @@ public class ArchiveViewerAction extends Action {
|
|||
private static final transient IUFStatusHandler statusHandler = UFStatus
|
||||
.getHandler(ArchiveViewerAction.class);
|
||||
|
||||
private final String sessionName;
|
||||
private final String sessionId;
|
||||
|
||||
public ArchiveViewerAction() {
|
||||
super("View Log...", IconUtil.getImageDescriptor(Activator.getDefault()
|
||||
.getBundle(), "log.gif"));
|
||||
sessionName = null;
|
||||
sessionId = null;
|
||||
setEnabled(CollaborationConnection.getConnection() != null);
|
||||
}
|
||||
|
||||
public ArchiveViewerAction(UserId user) {
|
||||
super("View Log...", IconUtil.getImageDescriptor(Activator.getDefault()
|
||||
.getBundle(), "log.gif"));
|
||||
sessionName = user.getName();
|
||||
sessionId = user.getName();
|
||||
}
|
||||
|
||||
public ArchiveViewerAction(IVenueSession session) {
|
||||
super("View Log...", IconUtil.getImageDescriptor(Activator.getDefault()
|
||||
.getBundle(), "log.gif"));
|
||||
sessionName = session.getVenue().getName();
|
||||
sessionId = session.getVenue().getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
UserId user = CollaborationConnection.getConnection().getUser();
|
||||
String logDir = SessionMsgArchive.getLogFilePath(user.getHost(),
|
||||
user.getName(), sessionName);
|
||||
user.getName(), sessionId);
|
||||
|
||||
try {
|
||||
CaveWorkbenchPageManager
|
||||
|
|
|
@ -29,7 +29,6 @@ import com.raytheon.uf.common.status.IUFStatusHandler;
|
|||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.IVenueSession;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.info.IVenueInfo;
|
||||
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;
|
||||
|
@ -52,6 +51,7 @@ import com.raytheon.viz.ui.views.CaveWorkbenchPageManager;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jul 3, 2012 bsteffen Initial creation
|
||||
* Jan 28, 2014 2698 bclement removed venue info
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -120,9 +120,9 @@ public class CreateSessionAction extends Action {
|
|||
if (users.length > 0) {
|
||||
IVenueSession session = (IVenueSession) CollaborationConnection
|
||||
.getConnection().getSession(sessionId);
|
||||
IVenueInfo info = session.getVenue().getInfo();
|
||||
String subject = session.getVenue().getSubject();
|
||||
InviteAction invite = new InviteAction(session,
|
||||
info.getVenueDescription(), users);
|
||||
subject, users);
|
||||
invite.setInviteMessage(result.getInviteMessage());
|
||||
invite.run();
|
||||
}
|
||||
|
|
|
@ -54,6 +54,7 @@ import com.raytheon.viz.ui.views.CaveWorkbenchPageManager;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Jul 5, 2012 bsteffen Initial creation
|
||||
* Dec 19, 2013 2563 bclement added check for feed venue existence
|
||||
* Jan 28, 2014 2698 bclement changed feed venue filter to match whole name
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -94,7 +95,7 @@ public class DisplayFeedAction extends Action {
|
|||
for (ISession session : connection.getSessions()) {
|
||||
if (session instanceof IVenueSession) {
|
||||
if (((IVenueSession) session).getVenue().getName()
|
||||
.startsWith(FEED_VENUE)) {
|
||||
.equalsIgnoreCase(FEED_VENUE)) {
|
||||
sessionId = session.getSessionId();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,7 +40,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.info.IVenueInfo;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.invite.SharedDisplayVenueInvite;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.invite.VenueInvite;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.session.CollaborationConnection;
|
||||
|
@ -58,6 +57,7 @@ import com.raytheon.uf.viz.collaboration.display.data.SharedDisplaySessionMgr;
|
|||
* ------------ ---------- ----------- --------------------------
|
||||
* Jul 3, 2012 bsteffen Initial creation
|
||||
* Dec 6, 2013 2561 bclement removed ECF
|
||||
* Jan 28, 2014 2698 bclement removed venue info
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -114,7 +114,7 @@ public class InviteAction extends Action {
|
|||
}
|
||||
invite.setMessage(inviteMessage);
|
||||
invite.setSessionId(session.getSessionId());
|
||||
invite.setSubject(session.getVenue().getInfo().getVenueSubject());
|
||||
invite.setSubject(session.getVenue().getSubject());
|
||||
List<UserId> inviteList = new ArrayList<UserId>();
|
||||
UserId inviter = CollaborationConnection.getConnection().getUser();
|
||||
for (UserId user : users) {
|
||||
|
@ -210,16 +210,8 @@ public class InviteAction extends Action {
|
|||
|
||||
private void fill() {
|
||||
for (IVenueSession session : getNewSessions()) {
|
||||
String desc;
|
||||
try {
|
||||
IVenueInfo info = session.getVenue().getInfo();
|
||||
desc = info.getVenueDescription();
|
||||
} catch (CollaborationException e) {
|
||||
statusHandler.handle(Priority.PROBLEM,
|
||||
e.getLocalizedMessage(), e);
|
||||
desc = session.getVenue().getName();
|
||||
}
|
||||
Action action = new InviteAction(session, desc, users);
|
||||
String name = session.getVenue().getName();
|
||||
Action action = new InviteAction(session, name, users);
|
||||
IContributionItem contrib = new ActionContributionItem(action);
|
||||
contrib.fill(menu, -1);
|
||||
}
|
||||
|
|
|
@ -33,7 +33,6 @@ import org.eclipse.swt.widgets.Menu;
|
|||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.ISharedDisplaySession;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.info.IVenueInfo;
|
||||
import com.raytheon.uf.viz.collaboration.display.data.SessionContainer;
|
||||
import com.raytheon.uf.viz.collaboration.display.data.SharedDisplaySessionMgr;
|
||||
import com.raytheon.uf.viz.collaboration.display.roles.dataprovider.SharedEditorsManager;
|
||||
|
@ -52,6 +51,7 @@ import com.raytheon.viz.ui.editor.AbstractEditor;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 21, 2012 mnash Initial creation
|
||||
* Jan 28, 2014 2698 bclement removed venue info
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -142,14 +142,7 @@ public class ShareEditorAction extends ContributedEditorMenuAction implements
|
|||
if (editor != null) {
|
||||
List<ISharedDisplaySession> sessions = getSessions();
|
||||
for (final ISharedDisplaySession session : sessions) {
|
||||
String sessionName;
|
||||
try {
|
||||
IVenueInfo sessionInfo = session.getVenue().getInfo();
|
||||
sessionName = sessionInfo.getVenueDescription();
|
||||
} catch (CollaborationException e1) {
|
||||
Activator.statusHandler.error(e1.getLocalizedMessage(), e1);
|
||||
sessionName = session.getVenue().getName();
|
||||
}
|
||||
String sessionName = session.getVenue().getName();
|
||||
ActionContributionItem aci = new ActionContributionItem(
|
||||
new Action(sessionName) {
|
||||
@Override
|
||||
|
|
|
@ -24,16 +24,12 @@ import java.util.Collection;
|
|||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
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.IVenueSession;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.info.IVenueInfo;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.session.CollaborationConnection;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
* Retrieve session objects from contacts list
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
|
@ -42,17 +38,15 @@ import com.raytheon.uf.viz.collaboration.comm.provider.session.CollaborationConn
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 6, 2012 rferrel Initial creation
|
||||
* Jan 28, 2014 2698 bclement removed venue info
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author rferrel
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class SessionGroupContainer {
|
||||
|
||||
private final IUFStatusHandler log = UFStatus.getHandler(this.getClass());
|
||||
|
||||
public List<Object> getObjects() {
|
||||
CollaborationConnection connection = CollaborationConnection
|
||||
.getConnection();
|
||||
|
@ -63,17 +57,7 @@ public class SessionGroupContainer {
|
|||
List<Object> result = new ArrayList<Object>();
|
||||
for (ISession session : sessions) {
|
||||
if (session instanceof IVenueSession) {
|
||||
IVenueSession vs = (IVenueSession) session;
|
||||
IVenueInfo info;
|
||||
try {
|
||||
info = vs.getVenue().getInfo();
|
||||
} catch (CollaborationException e) {
|
||||
log.error("Unable to get venue info", e);
|
||||
continue;
|
||||
}
|
||||
if (info.isPersistent() == false) {
|
||||
result.add(session);
|
||||
}
|
||||
result.add(session);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
|
|
@ -51,7 +51,6 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
|||
import com.raytheon.uf.viz.collaboration.comm.identity.CollaborationException;
|
||||
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.info.IVenueInfo;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.invite.ColorPopulator;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.user.SharedDisplayRole;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.TransferRoleCommand;
|
||||
|
@ -92,6 +91,7 @@ import com.raytheon.viz.ui.input.EditableManager;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 1, 2012 rferrel Initial creation
|
||||
* Jan 28, 2014 2698 bclement removed venue info
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -559,14 +559,9 @@ public class CollaborationSessionView extends SessionView implements
|
|||
Label label = new Label(comp, SWT.NONE);
|
||||
StringBuilder labelInfo = new StringBuilder();
|
||||
if (session != null) {
|
||||
IVenueInfo info;
|
||||
try {
|
||||
info = ((IVenueSession) session).getVenue().getInfo();
|
||||
labelInfo.append(info.getVenueSubject());
|
||||
label.setToolTipText(info.getVenueSubject());
|
||||
} catch (CollaborationException e) {
|
||||
statusHandler.error(e.getLocalizedMessage(), e);
|
||||
}
|
||||
String subject = ((IVenueSession) session).getVenue().getSubject();
|
||||
labelInfo.append(subject);
|
||||
label.setToolTipText(subject);
|
||||
}
|
||||
label.setText(labelInfo.toString());
|
||||
}
|
||||
|
|
|
@ -75,7 +75,6 @@ import com.raytheon.uf.viz.collaboration.comm.identity.ISession;
|
|||
import com.raytheon.uf.viz.collaboration.comm.identity.IVenueSession;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.event.IVenueParticipantEvent;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.event.ParticipantEventType;
|
||||
import com.raytheon.uf.viz.collaboration.comm.identity.info.IVenueInfo;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.event.UserNicknameChangedEvent;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.event.VenueUserEvent;
|
||||
import com.raytheon.uf.viz.collaboration.comm.provider.session.CollaborationConnection;
|
||||
|
@ -100,6 +99,7 @@ import com.raytheon.viz.ui.views.CaveWorkbenchPageManager;
|
|||
* Mar 1, 2012 rferrel Initial creation
|
||||
* Dec 6, 2013 2561 bclement removed ECF
|
||||
* Dec 19, 2013 2563 bclement reworked participant event logic
|
||||
* Jan 28, 2014 2698 bclement removed venue info
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -585,14 +585,9 @@ public class SessionView extends AbstractSessionView implements IPrintableView {
|
|||
label.setLayoutData(data);
|
||||
StringBuilder labelInfo = new StringBuilder();
|
||||
if (session != null) {
|
||||
IVenueInfo info;
|
||||
try {
|
||||
info = session.getVenue().getInfo();
|
||||
labelInfo.append(info.getVenueSubject());
|
||||
label.setToolTipText(info.getVenueSubject());
|
||||
} catch (CollaborationException e) {
|
||||
statusHandler.error(e.getLocalizedMessage(), e);
|
||||
}
|
||||
String subject = session.getVenue().getSubject();
|
||||
labelInfo.append(subject);
|
||||
label.setToolTipText(subject);
|
||||
}
|
||||
label.setText(labelInfo.toString());
|
||||
}
|
||||
|
@ -628,14 +623,7 @@ public class SessionView extends AbstractSessionView implements IPrintableView {
|
|||
if (session == null) {
|
||||
return sessionId;
|
||||
}
|
||||
try {
|
||||
IVenueInfo info = session.getVenue().getInfo();
|
||||
return info.getVenueDescription();
|
||||
} catch (CollaborationException e) {
|
||||
statusHandler.error("Unable to get venue info", e);
|
||||
return session.getVenue().getName();
|
||||
}
|
||||
|
||||
return session.getVenue().getName();
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
|
|
Loading…
Add table
Reference in a new issue