|
|
| Line 1: | |||
| + | This report shows a user the total number of Dependencies in a simplified form. This report has to be used in conjunction with a report template such as the [[HTML Template]]. | ||
| + | ---- | ||
| + | ''Meta-Data Script:'' | ||
| + | <pre>import com.urbancode.anthill3.domain.reporting.*; | ||
| + | ReportMetaData rmd = new ReportMetaData(); | ||
| + | rmd.addColumn("Project"); | ||
| + | rmd.addColumn("Workflow"); | ||
| + | rmd.addColumn("Dependencies"); | ||
| + | return rmd; | ||
| + | </pre> | ||
| + | ---- | ||
| + | ''Context Script:'' | ||
| + | <pre>import com.urbancode.anthill3.domain.profile.*; | ||
| + | import com.urbancode.anthill3.domain.project.*; | ||
| + | import com.urbancode.anthill3.domain.reporting.*; | ||
| + | import com.urbancode.anthill3.domain.workflow.*; | ||
| + | import com.urbancode.anthill3.persistence.*; | ||
| + | Project[] projects = ProjectFactory.getInstance().restoreAll(); | ||
| + | ReportOutput output = new ReportOutput(metaData); | ||
| + | for (int i = 0; i < projects.length; i++) { | ||
| + | Workflow[] workflows = projects[i].getOriginatingWorkflowArray(); | ||
| + | for (int j = 0; j < workflows.length; j++) { | ||
| + | ReportRow row = new ReportRow(output, "1"); | ||
| + | row.setColumnValue("Project", projects[i].getName()); | ||
| + | row.setColumnValue("Workflow", workflows[j].getName()); | ||
| + | StringBuffer depBuf = new StringBuffer(); | ||
| + | Dependency[] deps = workflows[j].getBuildProfile().getDependencyArray(); | ||
| + | for (int k = 0; k < deps.length; k++) { | ||
| + | depBuf.append(deps[k].getDependency().toString()); | ||
| + | int buildCondition = deps[k].getBuildConditionId(); | ||
| + | switch (buildCondition) { | ||
| + | case Dependency.PULL_BUILD: | ||
| + | depBuf.append(" - Pull"); | ||
| + | break; | ||
| + | case Dependency.PUSH_BUILD: | ||
| + | depBuf.append(" - Push"); | ||
| + | break; | ||
| + | case Dependency.LATEST_BUILD: | ||
| + | if (deps[k].getStatus() != null) { | ||
| + | depBuf.append(" - Use Latest "); | ||
| + | depBuf.append(deps[k].getStatus().toString()); | ||
| + | } | ||
| + | else if (deps[k].getStampValue() != null) { | ||
| + | depBuf.append(" - Use "); | ||
| + | depBuf.append(deps[k].getStampValue()); | ||
| + | } | ||
| + | else { | ||
| + | depBuf.append(" - Use Latest "); | ||
| + | } | ||
| + | break; | ||
| + | } | ||
| + | if (k < deps.length - 1) { | ||
| + | depBuf.append("<br>"); | ||
| + | } | ||
| + | } | ||
| + | row.setColumnValue("Dependencies", depBuf.toString()); | ||
| + | output.addRow(row); | ||
| + | } | ||
| + | } | ||
| + | return output; | ||
| + | </pre> | ||
| + | ---- | ||
| + | '''Related Content''' | ||
| + | [[AnthillPro Template Reports]]<br/> | ||
| + | [[Report Templates]] | ||