use of net.sourceforge.processdash.ProcessDashboard in project processdash by dtuma.
the class TaskListNavigator method syncTaskToModel.
private void syncTaskToModel() {
String currentPath = activeTaskModel.getPath();
if (currentPath != null && !currentPath.equals(menu.getActionCommand())) {
menu.setActionCommand(currentPath);
setDisplayTextForPath(menu, currentPath);
Window window = SwingUtilities.getWindowAncestor(menu);
if (window != null) {
if (window instanceof ProcessDashboard)
((ProcessDashboard) window).windowSizeRequirementsChanged();
else
window.pack();
}
}
if (selectedItem != null)
selectedItem.setFont(plainFont);
selectedItem = findTask(currentPath);
if (selectedItem != null)
selectedItem.setFont(boldFont);
}
use of net.sourceforge.processdash.ProcessDashboard in project processdash by dtuma.
the class MobileSetupWizard method doPost.
@Override
protected void doPost() throws IOException {
// make certain the request is coming from the local computer
DashController.checkIP(env.get("REMOTE_ADDR"));
// check for improper operating modes
if (Settings.isReadOnly()) {
printRedirect("mobileError.shtm?readOnly");
return;
} else if (CompressedInstanceLauncher.isRunningFromCompressedData()) {
printRedirect("mobileError.shtm?quickLaunch");
return;
}
// get the URL of our bridged working directory
ProcessDashboard dash = (ProcessDashboard) getDashboardContext();
WorkingDirectory workingDirectory = dash.getWorkingDirectory();
String location = workingDirectory.getDescription();
if (!location.startsWith("http")) {
printRedirect("mobileError.shtm?notBridged");
return;
}
// check for connectivity to the PDES
try {
URL u = new URL(location);
FileUtils.slurpContents(u.openStream(), true);
} catch (IOException ioe) {
storePdesLocation(location);
printRedirect("mobileError.shtm?noNetwork");
return;
}
// ask the PDES for a data token for our directory
String dataToken;
try {
dataToken = getDataToken(location);
} catch (IOException ioe) {
printRedirect("mobileError.shtm?upgradePdes");
return;
}
// if we received the token "-", mobile support is disabled by the PDES
if ("-".equals(dataToken)) {
storePdesLocation(location);
printRedirect("mobileError.shtm?pdesMobileDisabled");
return;
}
// retrieve the username we are using for our data
String username = HttpAuthenticator.getLastUsername();
// prepare the dashboard for use with the mobile REST APIs
try {
DashController.assignHierarchyNodeIDs();
} catch (IllegalStateException ise) {
printRedirect("mobileError.shtm?hierEditor");
return;
}
dash.flushWorkingData();
// write information to the repository, and print a success page
DataContext ctx = getDataRepository();
ctx.putValue("/mobile//Data_Token", StringData.create(dataToken));
if (username != null)
ctx.putValue("/mobile//Username", StringData.create(username));
printRedirect("mobileSuccess.shtm");
}
use of net.sourceforge.processdash.ProcessDashboard in project processdash by dtuma.
the class MigrationToolIndivLauncher method launchMigrationProcess.
private void launchMigrationProcess() {
try {
System.out.println("Launching indiv migration tool with command line:");
for (int i = 0; i < cmdLine.length; i++) System.out.println("\t" + cmdLine[i]);
Runtime.getRuntime().exec(cmdLine);
// Wait a few seconds, to ensure that the web browser has an
// opportunity to retrieve the "please wait" web page before we
// shut down the dashboard's web server.
Thread.sleep(2000);
// shut down the dashboard (skip the typical 'shutdown data export'
// for expediency)
System.setProperty(Settings.SYS_PROP_PREFIX + "export.disableAutoExport", "true");
ProcessDashboard dash = (ProcessDashboard) ctx;
dash.exitProgram();
} catch (Exception e) {
e.printStackTrace();
JOptionPane.showMessageDialog(null, "Unable to launch migration tool", "Migration Error", JOptionPane.ERROR_MESSAGE);
}
}
use of net.sourceforge.processdash.ProcessDashboard in project processdash by dtuma.
the class DisplayConfig method loadConfigurationInformation.
private void loadConfigurationInformation() {
dataDirectory = null;
dataURL = null;
configFile = new File(DashController.getSettingsFileName());
WorkingDirectory workingDir = ((ProcessDashboard) getDashboardContext()).getWorkingDirectory();
if (workingDir instanceof BridgedWorkingDirectory) {
BridgedWorkingDirectory bwd = (BridgedWorkingDirectory) workingDir;
dataURL = bwd.getDescription();
dataDirectory = bwd.getTargetDirectory();
if (dataDirectory == null)
configFile = null;
else
configFile = new File(dataDirectory, configFile.getName());
} else if (workingDir instanceof LocalWorkingDirectory) {
LocalWorkingDirectory lwd = (LocalWorkingDirectory) workingDir;
dataDirectory = lwd.getTargetDirectory();
}
DashPackage dash = TemplateLoader.getPackage(DASHBOARD_PACKAGE_ID);
if (dash != null && StringUtils.hasValue(dash.filename)) {
File dashJar = new File(dash.filename);
installationDirectory = dashJar.getParentFile();
}
appTemplateDirectory = TemplateLoader.getApplicationTemplateDir();
jvmInfo = System.getProperty("java.vendor") + " JRE " + System.getProperty("java.version") + "; " + System.getProperty("os.name");
}
use of net.sourceforge.processdash.ProcessDashboard in project processdash by dtuma.
the class Control method repairDefectCounts.
private void repairDefectCounts() {
if (isTask("repairDefectCounts")) {
ProcessDashboard dash = (ProcessDashboard) getDashboardContext();
RepairDefectCounts.run(dash, dash.getDirectory());
out.println("<HTML><HEAD><TITLE>Defect Counts Repaired</TITLE></HEAD>");
out.println("<BODY><H1>Defect Counts Repaired</H1>");
out.println("The defect counts were repaired at " + new Date());
out.println("</BODY></HTML>");
printNullDocument = false;
}
}
Aggregations