Search in sources :

Example 1 with ProjectHistoryException

use of teamdash.hist.ProjectHistoryException in project processdash by dtuma.

the class WBSChangeHistoryReport method loadHistory.

private void loadHistory(HttpServletRequest req) throws ProjectHistoryException {
    PDashContext ctx = PDashServletUtils.getContext(req);
    PDashData data = ctx.getData();
    ProjectHistory hist = ProjectHistoryFactory.getProjectHistory(data);
    if (hist == null)
        throw new ProjectHistoryException("Not_Team_Project_HTML_FMT", ctx.getProjectPath());
    String dateParam = req.getParameter("before");
    Date beforeDate = dateParam == null ? null : new Date(Long.parseLong(dateParam));
    ProjectChangeList changes;
    try {
        changes = ProjectChangeListFactory.getChanges(hist, beforeDate, 10, true, true);
    } catch (IOException ioe) {
        throw hist.wrapException(ioe);
    }
    req.setAttribute("changes", changes);
    req.setAttribute("followupTimestamp", changes.getFollowupTimestamp());
    // compute the URI that will be used to open WBS hyperlinks
    String processID = data.getString("Team_Process_PID");
    String modeIndicator = Settings.isPersonalMode() ? "indiv" : "forteam";
    String openWbsUri = "../" + processID + "/setup/openWBS.shtm?trigger&" + modeIndicator + "&showItem=";
    req.setAttribute("openWbsUri", openWbsUri);
}
Also used : PDashContext(net.sourceforge.processdash.api.PDashContext) ProjectChangeList(teamdash.hist.ProjectChangeList) PDashData(net.sourceforge.processdash.api.PDashData) ProjectHistory(teamdash.hist.ProjectHistory) IOException(java.io.IOException) ProjectHistoryException(teamdash.hist.ProjectHistoryException) Date(java.util.Date)

Example 2 with ProjectHistoryException

use of teamdash.hist.ProjectHistoryException in project processdash by dtuma.

the class BlameHistoryDialog method showCalculationError.

public void showCalculationError(Throwable calcError) {
    calcError.printStackTrace();
    ProjectHistoryException phe;
    if (calcError instanceof ProjectHistoryException) {
        phe = (ProjectHistoryException) calcError;
    } else if (projectHistory != null) {
        phe = projectHistory.wrapException(calcError);
    } else {
        phe = new ProjectHistoryException(calcError, "Dir.Cannot_Read_HTML_FMT", dataLocation);
    }
    String title = resources.getString("Message.Error");
    String message = "<html><div style='width:400px'>" + phe.getHtml() + "</div></html>";
    JEditorPane pane = new JEditorPane("text/html", message);
    pane.setEditable(false);
    pane.setBackground(null);
    JOptionPane.showMessageDialog(this, pane, title, JOptionPane.ERROR_MESSAGE);
    showReadyMessage();
}
Also used : JEditorPane(javax.swing.JEditorPane) ProjectHistoryException(teamdash.hist.ProjectHistoryException)

Example 3 with ProjectHistoryException

use of teamdash.hist.ProjectHistoryException in project processdash by dtuma.

the class WBSChangeHistoryReport method doGet.

@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
    try {
        loadHistory(req);
    } catch (ProjectHistoryException u) {
        u.printStackTrace();
        req.setAttribute("errorMessage", u.getHtml());
    }
    RequestDispatcher disp = getServletContext().getRequestDispatcher("/WEB-INF/jsp/wbsChangeHistory.jsp");
    disp.forward(req, resp);
}
Also used : ProjectHistoryException(teamdash.hist.ProjectHistoryException) RequestDispatcher(javax.servlet.RequestDispatcher)

Aggregations

ProjectHistoryException (teamdash.hist.ProjectHistoryException)3 IOException (java.io.IOException)1 Date (java.util.Date)1 RequestDispatcher (javax.servlet.RequestDispatcher)1 JEditorPane (javax.swing.JEditorPane)1 PDashContext (net.sourceforge.processdash.api.PDashContext)1 PDashData (net.sourceforge.processdash.api.PDashData)1 ProjectChangeList (teamdash.hist.ProjectChangeList)1 ProjectHistory (teamdash.hist.ProjectHistory)1