Search in sources :

Example 1 with ProcessDashboard

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);
}
Also used : Window(java.awt.Window) ProcessDashboard(net.sourceforge.processdash.ProcessDashboard)

Example 2 with ProcessDashboard

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");
}
Also used : WorkingDirectory(net.sourceforge.processdash.tool.bridge.client.WorkingDirectory) DataContext(net.sourceforge.processdash.data.DataContext) ProcessDashboard(net.sourceforge.processdash.ProcessDashboard) IOException(java.io.IOException) URL(java.net.URL)

Example 3 with ProcessDashboard

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);
    }
}
Also used : ProcessDashboard(net.sourceforge.processdash.ProcessDashboard) FileNotFoundException(java.io.FileNotFoundException)

Example 4 with ProcessDashboard

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");
}
Also used : BridgedWorkingDirectory(net.sourceforge.processdash.tool.bridge.client.BridgedWorkingDirectory) WorkingDirectory(net.sourceforge.processdash.tool.bridge.client.WorkingDirectory) LocalWorkingDirectory(net.sourceforge.processdash.tool.bridge.client.LocalWorkingDirectory) LocalWorkingDirectory(net.sourceforge.processdash.tool.bridge.client.LocalWorkingDirectory) ProcessDashboard(net.sourceforge.processdash.ProcessDashboard) BridgedWorkingDirectory(net.sourceforge.processdash.tool.bridge.client.BridgedWorkingDirectory) File(java.io.File) DashPackage(net.sourceforge.processdash.templates.DashPackage)

Example 5 with ProcessDashboard

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;
    }
}
Also used : ProcessDashboard(net.sourceforge.processdash.ProcessDashboard) Date(java.util.Date)

Aggregations

ProcessDashboard (net.sourceforge.processdash.ProcessDashboard)14 PropertyKey (net.sourceforge.processdash.hier.PropertyKey)4 DashHierarchy (net.sourceforge.processdash.hier.DashHierarchy)3 File (java.io.File)2 DataContext (net.sourceforge.processdash.data.DataContext)2 WorkingDirectory (net.sourceforge.processdash.tool.bridge.client.WorkingDirectory)2 Dimension (java.awt.Dimension)1 Robot (java.awt.Robot)1 Window (java.awt.Window)1 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 URL (java.net.URL)1 Date (java.util.Date)1 Iterator (java.util.Iterator)1 Random (java.util.Random)1 Box (javax.swing.Box)1 ButtonGroup (javax.swing.ButtonGroup)1 JFileChooser (javax.swing.JFileChooser)1 JMenuBar (javax.swing.JMenuBar)1 JScrollPane (javax.swing.JScrollPane)1