Issue #639 fixed archive log view secondary id.
Former-commit-id:9c099c7931
[formerly40a0e03b2d
] [formerly9c099c7931
[formerly40a0e03b2d
] [formerly67e225e341
[formerly 69c774abf417049ffc343ff8ba5d2e44d05bb2e7]]] Former-commit-id:67e225e341
Former-commit-id:b8d677faf0
[formerly6be2a8435a
] Former-commit-id:14bd74c9fa
This commit is contained in:
parent
58c5d00acd
commit
b2874a182e
3 changed files with 63 additions and 28 deletions
|
@ -88,7 +88,6 @@ import org.eclipse.ui.PlatformUI;
|
||||||
import org.osgi.framework.Bundle;
|
import org.osgi.framework.Bundle;
|
||||||
|
|
||||||
import com.google.common.eventbus.Subscribe;
|
import com.google.common.eventbus.Subscribe;
|
||||||
import com.raytheon.uf.common.localization.LocalizationFile;
|
|
||||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
|
@ -117,7 +116,6 @@ import com.raytheon.uf.viz.collaboration.ui.session.AbstractSessionView;
|
||||||
import com.raytheon.uf.viz.collaboration.ui.session.CollaborationSessionView;
|
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.PeerToPeerView;
|
||||||
import com.raytheon.uf.viz.collaboration.ui.session.SessionMsgArchive;
|
import com.raytheon.uf.viz.collaboration.ui.session.SessionMsgArchive;
|
||||||
import com.raytheon.uf.viz.collaboration.ui.session.SessionMsgArchiveView;
|
|
||||||
import com.raytheon.uf.viz.collaboration.ui.session.SessionView;
|
import com.raytheon.uf.viz.collaboration.ui.session.SessionView;
|
||||||
import com.raytheon.uf.viz.core.VizApp;
|
import com.raytheon.uf.viz.core.VizApp;
|
||||||
import com.raytheon.uf.viz.core.icon.IconUtil;
|
import com.raytheon.uf.viz.core.icon.IconUtil;
|
||||||
|
@ -190,7 +188,7 @@ public class CollaborationGroupView extends CaveFloatingView implements
|
||||||
|
|
||||||
// Drawing *will* be activated in collaboration views
|
// Drawing *will* be activated in collaboration views
|
||||||
// private Action drawToolbarAction;
|
// private Action drawToolbarAction;
|
||||||
//
|
|
||||||
// private Action pgenAction;
|
// private Action pgenAction;
|
||||||
|
|
||||||
private Action collapseAllAction;
|
private Action collapseAllAction;
|
||||||
|
@ -298,8 +296,7 @@ public class CollaborationGroupView extends CaveFloatingView implements
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
createArchiveViewerAction = new Action("View Log...") {
|
createArchiveViewerAction = new Action("View Log...") {
|
||||||
@Override
|
private String getSessionName() {
|
||||||
public void runWithEvent(Event event) {
|
|
||||||
IStructuredSelection selection = (IStructuredSelection) usersTreeViewer
|
IStructuredSelection selection = (IStructuredSelection) usersTreeViewer
|
||||||
.getSelection();
|
.getSelection();
|
||||||
Object o = selection.getFirstElement();
|
Object o = selection.getFirstElement();
|
||||||
|
@ -308,30 +305,45 @@ public class CollaborationGroupView extends CaveFloatingView implements
|
||||||
if (o instanceof IRosterEntry) {
|
if (o instanceof IRosterEntry) {
|
||||||
IRosterEntry otherUser = (IRosterEntry) o;
|
IRosterEntry otherUser = (IRosterEntry) o;
|
||||||
if (otherUser != null) {
|
if (otherUser != null) {
|
||||||
String id = otherUser.getUser().getID().getName();
|
String otherName = otherUser.getUser().getID()
|
||||||
sessionName = id.substring(0, id.indexOf("@"));
|
.getName();
|
||||||
|
sessionName = otherName.substring(0,
|
||||||
|
otherName.indexOf("@"));
|
||||||
}
|
}
|
||||||
|
} else if (o instanceof IVenueSession) {
|
||||||
|
sessionName = ((IVenueSession) o).getVenue().getInfo()
|
||||||
|
.getVenueDescription();
|
||||||
|
} else if (o instanceof UserId) {
|
||||||
|
// don't add if the userid
|
||||||
}
|
}
|
||||||
|
return sessionName;
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public boolean isEnabled() {
|
||||||
|
// CollaborationConnection conn = CollaborationDataManager
|
||||||
|
// .getInstance().getCollaborationConnection(true);
|
||||||
|
// UserId user = conn.getUser();
|
||||||
|
// return SessionMsgArchive.getArchiveDir(user.getHost(),
|
||||||
|
// user.getName(), getSessionName()).exists();
|
||||||
|
// };
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void runWithEvent(Event event) {
|
||||||
CollaborationConnection conn = CollaborationDataManager
|
CollaborationConnection conn = CollaborationDataManager
|
||||||
.getInstance().getCollaborationConnection(true);
|
.getInstance().getCollaborationConnection(true);
|
||||||
UserId user = conn.getUser();
|
UserId user = conn.getUser();
|
||||||
LocalizationFile logDir = SessionMsgArchive.getArchiveDir(
|
String logDir = SessionMsgArchive.getLogFilePath(
|
||||||
user.getHost(), user.getName(), sessionName);
|
user.getHost(), user.getName(), getSessionName());
|
||||||
|
|
||||||
// SessionMsgArchiveDialog smad = new SessionMsgArchiveDialog(
|
|
||||||
// Display.getCurrent().getActiveShell());
|
|
||||||
// smad.setText("Message Log");
|
|
||||||
// smad.open(logDir);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
IViewPart vPart = PlatformUI
|
PlatformUI
|
||||||
.getWorkbench()
|
.getWorkbench()
|
||||||
.getActiveWorkbenchWindow()
|
.getActiveWorkbenchWindow()
|
||||||
.getActivePage()
|
.getActivePage()
|
||||||
.showView(
|
.showView(
|
||||||
"com.raytheon.uf.viz.collaboration.ui.session.SessionMsgArchiveView");
|
"com.raytheon.uf.viz.collaboration.ui.session.SessionMsgArchiveView",
|
||||||
((SessionMsgArchiveView) vPart).setDir(logDir);
|
logDir, IWorkbenchPage.VIEW_ACTIVATE);
|
||||||
// vPart.setPartName(name);
|
|
||||||
} catch (PartInitException e) {
|
} catch (PartInitException e) {
|
||||||
statusHandler.handle(Priority.PROBLEM,
|
statusHandler.handle(Priority.PROBLEM,
|
||||||
"Unable to open Collaboration Log View", e);
|
"Unable to open Collaboration Log View", e);
|
||||||
|
@ -566,6 +578,19 @@ public class CollaborationGroupView extends CaveFloatingView implements
|
||||||
// public void run() {
|
// public void run() {
|
||||||
// StaticDataProvider.getInstance();
|
// StaticDataProvider.getInstance();
|
||||||
// try {
|
// try {
|
||||||
|
// // cause the classloader to load StaticDataProvider and thus
|
||||||
|
// // to call the Activator for
|
||||||
|
// // gov.noaa.nws.ncep.staticdataprovider.
|
||||||
|
// // This is done because of an initialization order problem
|
||||||
|
// // in PgenStaticDataProvider
|
||||||
|
// StaticDataProvider.getInstance();
|
||||||
|
// ServiceReference ref = Activator
|
||||||
|
// .getDefault()
|
||||||
|
// .getBundle()
|
||||||
|
// .getBundleContext()
|
||||||
|
// .getServiceReference(
|
||||||
|
// IStaticDataProvider.class.getName());
|
||||||
|
//
|
||||||
// PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
// PlatformUI.getWorkbench().getActiveWorkbenchWindow()
|
||||||
// .getActivePage().showView(PgenUtil.VIEW_ID);
|
// .getActivePage().showView(PgenUtil.VIEW_ID);
|
||||||
// } catch (PartInitException e) {
|
// } catch (PartInitException e) {
|
||||||
|
@ -616,7 +641,7 @@ public class CollaborationGroupView extends CaveFloatingView implements
|
||||||
|
|
||||||
// mgr.add(drawToolbarAction);
|
// mgr.add(drawToolbarAction);
|
||||||
// mgr.add(pgenAction);
|
// mgr.add(pgenAction);
|
||||||
// mgr.add(new Separator());
|
mgr.add(new Separator());
|
||||||
|
|
||||||
if (CollaborationDataManager.getInstance().isConnected()) {
|
if (CollaborationDataManager.getInstance().isConnected()) {
|
||||||
mgr.add(logoutAction);
|
mgr.add(logoutAction);
|
||||||
|
|
|
@ -75,7 +75,7 @@ public class SessionMsgArchive {
|
||||||
log = new StringBuffer();
|
log = new StringBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String getLogFilePath(String hostName, String userId,
|
public static String getLogFilePath(String hostName, String userId,
|
||||||
String sessionName) {
|
String sessionName) {
|
||||||
return LOG_DIR
|
return LOG_DIR
|
||||||
+ IPathManager.SEPARATOR
|
+ IPathManager.SEPARATOR
|
||||||
|
@ -86,12 +86,21 @@ public class SessionMsgArchive {
|
||||||
+ sessionName);
|
+ sessionName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static LocalizationContext getArchiveContext() {
|
||||||
|
IPathManager pm = PathManagerFactory.getPathManager();
|
||||||
|
return pm.getContext(LocalizationType.CAVE_STATIC,
|
||||||
|
LocalizationLevel.USER);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static LocalizationFile getArchiveDir(String logFilePath) {
|
||||||
|
IPathManager pm = PathManagerFactory.getPathManager();
|
||||||
|
return pm.getLocalizationFile(getArchiveContext(), logFilePath);
|
||||||
|
}
|
||||||
|
|
||||||
public static LocalizationFile getArchiveDir(String hostName,
|
public static LocalizationFile getArchiveDir(String hostName,
|
||||||
String userId, String sessionName) {
|
String userId, String sessionName) {
|
||||||
IPathManager pm = PathManagerFactory.getPathManager();
|
IPathManager pm = PathManagerFactory.getPathManager();
|
||||||
LocalizationContext ctx = pm.getContext(LocalizationType.CAVE_STATIC,
|
return pm.getLocalizationFile(getArchiveContext(),
|
||||||
LocalizationLevel.USER);
|
|
||||||
return pm.getLocalizationFile(ctx,
|
|
||||||
getLogFilePath(hostName, userId, sessionName));
|
getLogFilePath(hostName, userId, sessionName));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,16 +50,17 @@ public class SessionMsgArchiveView extends CaveFloatingView {
|
||||||
@Override
|
@Override
|
||||||
public void createPartControl(Composite parent) {
|
public void createPartControl(Composite parent) {
|
||||||
super.createPartControl(parent);
|
super.createPartControl(parent);
|
||||||
|
String secondaryId = getViewSite().getSecondaryId();
|
||||||
|
LocalizationFile logDir = SessionMsgArchive.getArchiveDir(secondaryId);
|
||||||
|
|
||||||
browser = new SessionMsgArchiveBrowser(parent, SWT.NONE);
|
browser = new SessionMsgArchiveBrowser(parent, SWT.NONE);
|
||||||
|
browser.setDir(logDir);
|
||||||
|
|
||||||
|
setPartName(browser.getBrowserName());
|
||||||
parent.setLayout(new GridLayout(1, false));
|
parent.setLayout(new GridLayout(1, false));
|
||||||
parent.layout();
|
parent.layout();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDir(LocalizationFile dir) {
|
|
||||||
browser.setDir(dir);
|
|
||||||
setPartName(browser.getBrowserName());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setFocus() {
|
public void setFocus() {
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue