Search in sources :

Example 6 with PDashContext

use of net.sourceforge.processdash.api.PDashContext in project processdash by dtuma.

the class WorkflowReport method getWorkflowsForCurrentProject.

private Map<String, String> getWorkflowsForCurrentProject(HttpServletRequest req) {
    DashboardContext dash = (DashboardContext) PDashServletUtils.buildEnvironment(req).get(TinyCGI.DASHBOARD_CONTEXT);
    DatabasePlugin databasePlugin = dash.getDatabasePlugin();
    QueryUtils.waitForAllProjects(databasePlugin);
    QueryRunner queryRunner = databasePlugin.getObject(QueryRunner.class);
    PDashContext ctx = PDashServletUtils.getContext(req);
    String projectID = ctx.getData().getString("Project_ID");
    String workflowProcessIDPattern = DatabasePluginUtils.getWorkflowPhaseIdentifier(projectID, "%");
    Map<String, String> result = new TreeMap<String, String>();
    String query = Settings.isTeamMode() ? WORKFLOW_LIST_QUERY : WORKFLOW_LIST_QUERY_PERSONAL;
    QueryUtils.mapColumns(result, //
    queryRunner.queryHql(//
    query, workflowProcessIDPattern));
    return result;
}
Also used : DashboardContext(net.sourceforge.processdash.DashboardContext) PDashContext(net.sourceforge.processdash.api.PDashContext) DatabasePlugin(net.sourceforge.processdash.tool.db.DatabasePlugin) TreeMap(java.util.TreeMap) QueryRunner(net.sourceforge.processdash.tool.db.QueryRunner)

Aggregations

PDashContext (net.sourceforge.processdash.api.PDashContext)6 Date (java.util.Date)2 HttpServletRequest (javax.servlet.http.HttpServletRequest)2 PDashData (net.sourceforge.processdash.api.PDashData)2 IOException (java.io.IOException)1 PrintWriter (java.io.PrintWriter)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 TreeMap (java.util.TreeMap)1 ServletRequest (javax.servlet.ServletRequest)1 DashboardContext (net.sourceforge.processdash.DashboardContext)1 PDashQuery (net.sourceforge.processdash.api.PDashQuery)1 DatabasePlugin (net.sourceforge.processdash.tool.db.DatabasePlugin)1 PersonFilter (net.sourceforge.processdash.tool.db.PersonFilter)1 QueryRunner (net.sourceforge.processdash.tool.db.QueryRunner)1 Request (org.eclipse.jetty.server.Request)1 ProjectChangeList (teamdash.hist.ProjectChangeList)1 ProjectHistory (teamdash.hist.ProjectHistory)1 ProjectHistoryException (teamdash.hist.ProjectHistoryException)1