summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjbouthillie2011-09-15 11:28:03 (EDT)
committerjbouthillie2011-09-16 10:46:40 (EDT)
commit44b2615e072ae2b2bc19db9d09279ce46e4e9907 (patch)
tree1cea3663222c52ba4ba61093629cc035457c571e
parent958e99e55805084959ffa26a2c37c1ddd63858fb (diff)
downloadorg.eclipse.mylyn.reviews.r4e-44b2615e072ae2b2bc19db9d09279ce46e4e9907.zip
org.eclipse.mylyn.reviews.r4e-44b2615e072ae2b2bc19db9d09279ce46e4e9907.tar.gz
org.eclipse.mylyn.reviews.r4e-44b2615e072ae2b2bc19db9d09279ce46e4e9907.tar.bz2
NEW - bug 348907: [report] R4E implementation to generate the report
https://bugs.eclipse.org/bugs/show_bug.cgi?id=348907 Clean up un-necessary code wit the new transformation
-rw-r--r--org.eclipse.mylyn.reviews.r4e.report/src/org/eclipse/mylyn/reviews/r4e/report/internal/dialog/ReportGeneration.java120
1 files changed, 3 insertions, 117 deletions
diff --git a/org.eclipse.mylyn.reviews.r4e.report/src/org/eclipse/mylyn/reviews/r4e/report/internal/dialog/ReportGeneration.java b/org.eclipse.mylyn.reviews.r4e.report/src/org/eclipse/mylyn/reviews/r4e/report/internal/dialog/ReportGeneration.java
index 3c8c705..658752a 100644
--- a/org.eclipse.mylyn.reviews.r4e.report/src/org/eclipse/mylyn/reviews/r4e/report/internal/dialog/ReportGeneration.java
+++ b/org.eclipse.mylyn.reviews.r4e.report/src/org/eclipse/mylyn/reviews/r4e/report/internal/dialog/ReportGeneration.java
@@ -97,8 +97,6 @@ public class ReportGeneration implements IR4EReport {
// Use the definition of the report Data Source
private final String fGROUP_DATA_SOURCE = "Merged_group";
private final String fREVIEW_DATA_SOURCE = "Merged_review";
- private final String fITEM_DATA_SOURCE = "Merged_items";
- private final String fCOMMENTS_DATA_SOURCE = "Merged_comments";
//Report design template
private final String fInspectionRecordFileName = "inspectionRecord.rptdesign";
@@ -109,8 +107,6 @@ public class ReportGeneration implements IR4EReport {
private final String fINSPECT_RECORD = "InspectionRecord";
private final String fNO_NAME = "NoNameYet";
- private final String fREPORT_ITEM_END = "_items";
- private final String fCOMMENTS_END = "_comments";
private final String fREVIEW_END = "_review";
private final String fGROUP_END = "_group_root";
private final String fEXTENSION = ".xrer";
@@ -119,8 +115,6 @@ public class ReportGeneration implements IR4EReport {
private final String fSOURCE_PREFIX = "Merged";
private final String fPROJECT_REPORT_DIR = "Reports";
private final String fPROJECT_WORKING_DIR = "r4e_work";
- private final String fCOMMENT_FILE = fSOURCE_PREFIX + fCOMMENTS_END + fEXTENSION;
- private final String fREPORT_ITEM_FILE = fSOURCE_PREFIX + fREPORT_ITEM_END + fEXTENSION;
private final String fGROUP_FILE = fSOURCE_PREFIX + fGROUP_END + fEXTENSION;
private final String fFILE_SEP = "_";
@@ -155,8 +149,6 @@ public class ReportGeneration implements IR4EReport {
private String fDesignFileName = "globalReport.rptdesign"; //Default value
// Variable to test if the file to generate the report exist
- private Boolean fITEM_FILE_CREATED = false;
- private Boolean fANOMALY_FILE_CREATED = false;
private Boolean fPROPERTY_FILE_CREATED = false;
private Composite fCompositeParent = null;
@@ -187,7 +179,6 @@ public class ReportGeneration implements IR4EReport {
// Methods
// ------------------------------------------------------------------------
-
/****************************************/
/* */
/* PUBLIC METHOD */
@@ -400,7 +391,7 @@ public class ReportGeneration implements IR4EReport {
+ fReviewNameList[i].getAbsolutePath());
}
} else {
- //Display a popup when no review
+ //Display a pop-up when no review
String message = R4EReportString.getString("Popup.noReview" );
Popup.warningRunnable(null, message);
}
@@ -623,7 +614,7 @@ public class ReportGeneration implements IR4EReport {
engine.destroy();
// Clean the directory maintaining the data used for the report
// after the report is generated
- // cleanReportDirectory(workingDir);
+ cleanReportDirectory(workingDir);
// Pop-up the report file
if (displayReport) {
@@ -681,44 +672,6 @@ public class ReportGeneration implements IR4EReport {
/* necessary report file to generate */
/* a report */
/** ********************************** */
- private Boolean isAllReportingFileCreated(ModuleHandle aReportDesignHandle,
- File aWorkingDir) {
-
- Boolean b = true;
-
- Activator.FTracer.traceInfo("ReportGeneration.isAllReportingFileCreated() BEGIN");
- if (!isItemFileCreated()) {
- Activator.FTracer.traceInfo
- ("ReportGeneration.isAllReportingFileCreated() ITEM_FILE_CREATED not CREATED");
- // Set the data source for the report
- File f = new File(fREPORT_ITEM_FILE);
- prepareDataSource(f,// No file created yet
- aReportDesignHandle, aWorkingDir);
- }
- if (!isAnomalyFileCreated()) {
- Activator.FTracer.traceInfo
- ("ReportGeneration.isAllReportingFileCreated() ANOMALY_FILE_CREATED not CREATED");
- File f = new File(fCOMMENT_FILE);
- // Set the data source for the report
- prepareDataSource(f,// No file created yet
- aReportDesignHandle, aWorkingDir);
- }
- if (!isPropertyFileCreated()) {
- Activator.FTracer.traceInfo("ReportGeneration.isAllReportingFileCreated() "
- + "PROPERTY_FILE_CREATED NOT CREATED");
- b = false;
- }
- return b;
- }
-
-
- private void setItemFileCreated(Boolean aBol) {
- fITEM_FILE_CREATED = aBol;
- }
-
- private void setAnomalyFileCreated(Boolean aBol) {
- fANOMALY_FILE_CREATED = aBol;
- }
private void setPropertyFileCreated(Boolean aBol) {
fPROPERTY_FILE_CREATED = aBol;
@@ -726,23 +679,9 @@ public class ReportGeneration implements IR4EReport {
private void resetReportingFileCreated() {
// Only test those files, all others will always be available
- setItemFileCreated(false);
- setAnomalyFileCreated(false);
setPropertyFileCreated(false);
}
- private Boolean isItemFileCreated() {
- return fITEM_FILE_CREATED;
- }
-
- private Boolean isAnomalyFileCreated() {
- return fANOMALY_FILE_CREATED;
- }
-
- private Boolean isPropertyFileCreated() {
- return fPROPERTY_FILE_CREATED;
- }
-
/**
* Prepare the report output to be generated
*
@@ -827,13 +766,7 @@ public class ReportGeneration implements IR4EReport {
String name = sta[0];
// Verify the end of the file
- if (name.endsWith(fCOMMENTS_END)) {
- commentsSetup(aFile, aReportDesignHandle, aReportDir);
-
- } else if (name.endsWith(fREPORT_ITEM_END)) {
- reportItemSetup(aFile, aReportDesignHandle, aReportDir);
-
- } else if (name.endsWith(fGROUP_END)) {
+ if (name.endsWith(fGROUP_END)) {
// Lets save as well the group file since it is not under
// any review
groupSetup(aFile, aReportDesignHandle);
@@ -870,39 +803,6 @@ public class ReportGeneration implements IR4EReport {
/**
- * Prepare the setup for the comments file
- *
- * @param aFile
- * @param aReportDesignHandle
- * @param reportDir
- */
- private void commentsSetup(File aFile, ModuleHandle aReportDesignHandle,
- File reportDir) {
-
- Activator.FTracer.traceInfo("ReportGeneration.commentsSetup() Anomaly file: "
- + aFile.getAbsolutePath());
- setDataSourceFile(aFile, aReportDesignHandle, fCOMMENTS_DATA_SOURCE);
- setAnomalyFileCreated(true);
-
- }
-
- /**
- * Prepare the setup for the review item
- *
- * @param aFile
- * @param aReportDesignHandle
- * @param aReportDir
- */
- private void reportItemSetup(File aFile, ModuleHandle aReportDesignHandle,
- File aReportDir) {
-
- Activator.FTracer.traceInfo("ReportGeneration.reportItemSetup() Report Item file: "
- + aFile.getAbsolutePath());
- setDataSourceFile(aFile, aReportDesignHandle, fITEM_DATA_SOURCE);
- setItemFileCreated(true);
- }
-
- /**
* Prepare the setup for the review property file
*
* @param aFile
@@ -1319,7 +1219,6 @@ public class ReportGeneration implements IR4EReport {
return EditorsUI.DEFAULT_TEXT_EDITOR_ID;
}
- // ////////////////////////
/**
* Prepare the R4E report
*
@@ -1414,17 +1313,6 @@ public class ReportGeneration implements IR4EReport {
}
-// // Test if we have all data to set a new report object
-// // Need to create at least one instance of the file
-// Boolean b = isAllReportingFileCreated(reportDesignHandle,
-// workingDir);
-//
-// if (!b) {
-// // There is no Property file in this case
-// Popup.warningRunnable(null, R4EReportString.getFormattedString(
-// "reportWarning.noPropertyFile",
-// selectedReview[countReview].getName()));
-// } else {
// Prepare the report output
// Decide here if we generate HTML or PDF format report
IRunAndRenderTask renderTask = prepareOutputFile(runnable,
@@ -1432,8 +1320,6 @@ public class ReportGeneration implements IR4EReport {
// Execute the preparation of the report
renderTask.run();
-// }
-
// Clean the directory maintaining the data used for the report
// after the report is generated
cleanReportDirectory(workingDir);