Skip to content

Commit d6aa875

Browse files
committed
add logs
1 parent 21391ec commit d6aa875

File tree

1 file changed

+57
-19
lines changed

1 file changed

+57
-19
lines changed

src/main/java/com/cronos/onlinereview/actions/projectdetails/ViewProjectDetailsAction.java

Lines changed: 57 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,9 @@ public String execute() throws BaseException {
126126
long projectId = project.getId();
127127
long forumId = -1;
128128
String tempStr;
129-
129+
if(projectId == 30301920) {
130+
LoggingHelper.logError("1");
131+
}
130132
tempStr = (String) project.getProperty("Developer Forum ID");
131133
if (tempStr != null && tempStr.trim().length() != 0) {
132134
forumId = Long.parseLong(tempStr, 10);
@@ -161,7 +163,9 @@ public String execute() throws BaseException {
161163
}
162164
request.setAttribute("projectDRP", drpoint);
163165
}
164-
166+
if(projectId == 30301920) {
167+
LoggingHelper.logError("2");
168+
}
165169
// since Online Review Update - Add Project Dropdown v1.0
166170
// Retrieve the billing project id from property.
167171
// And retrieve the list of all client projects, find billing project name by
@@ -193,7 +197,9 @@ public String execute() throws BaseException {
193197
request.setAttribute("cockpitProjectLink",
194198
ConfigHelper.getDirectProjectBaseURL() + project.getTcDirectProjectId());
195199
}
196-
200+
if(projectId == 30301920) {
201+
LoggingHelper.logError("3");
202+
}
197203
// Place a string that represents "my" current role(s) into the request
198204
ActionsHelper.retrieveAndStoreMyRole(request, this);
199205
// Obtain an array of "my" resources
@@ -226,7 +232,9 @@ public String execute() throws BaseException {
226232
resourcePaymentsAmount.put(payment.getResourceId(), oldPayment + payment.getAmount().doubleValue());
227233
}
228234
request.setAttribute("resourcePaymentsAmount", resourcePaymentsAmount);
229-
235+
if(projectId == 30301920) {
236+
LoggingHelper.logError("4");
237+
}
230238
// Retrieve late records for the current user.
231239
LateDeliverableManager lateDeliverableManager = ActionsHelper.createLateDeliverableManager();
232240
if (myResources.length > 0) {
@@ -263,7 +271,9 @@ public String execute() throws BaseException {
263271
}
264272
request.setAttribute("paymentPenaltyPercentage", paymentPenaltyPercentage);
265273
}
266-
274+
if(projectId == 30301920) {
275+
LoggingHelper.logError("5");
276+
}
267277
// Get an array of all resources for the project
268278
Resource[] allProjectResources = ActionsHelper.getAllResourcesForProject(project);
269279
ActionsHelper.populateEmailProperty(request, allProjectResources);
@@ -289,7 +299,9 @@ public String execute() throws BaseException {
289299
request.setAttribute("phases", phases);
290300

291301
Deliverable[] deliverables = ActionsHelper.getAllDeliverablesForPhases(activePhases, allProjectResources);
292-
302+
if(projectId == 30301920) {
303+
LoggingHelper.logError("6");
304+
}
293305
// removing upload link by implementing Submission API endpoint
294306
Deliverable[] myDeliverables = ActionsHelper.getMyDeliverables(deliverables, myResources);
295307
Deliverable[] outstandingDeliverables = ActionsHelper.getOutstandingDeliverables(deliverables);
@@ -317,7 +329,9 @@ public String execute() throws BaseException {
317329
}
318330

319331
long currentTime = (new Date()).getTime();
320-
332+
if(projectId == 30301920) {
333+
LoggingHelper.logError("7");
334+
}
321335
// These two arrays will contain Deadline near / Late / Completed codes for
322336
// deliverables
323337
int[] myDeliverableStatuses = getDeliverableStatusCodes(myDeliverables, activePhases, currentTime);
@@ -336,7 +350,9 @@ public String execute() throws BaseException {
336350
myDeliverableDates[i] = phase.getScheduledEndDate();
337351
}
338352
}
339-
353+
if(projectId == 30301920) {
354+
LoggingHelper.logError("8");
355+
}
340356
for (int i = 0; i < outstandingDeliverables.length; ++i) {
341357
Deliverable deliverable = outstandingDeliverables[i];
342358
if (deliverable.isComplete()) {
@@ -350,7 +366,9 @@ public String execute() throws BaseException {
350366
String[] myDeliverableLinks = generateDeliverableLinks(request, myDeliverables, phases);
351367
Long[] outstandingDeliverableUserIds = getDeliverableUserIds(outstandingDeliverables, allProjectResources);
352368
Long[] outstandingDeliverableSubmissionUserIds = getDeliverableSubmissionUserIds(outstandingDeliverables);
353-
369+
if(projectId == 30301920) {
370+
LoggingHelper.logError("9");
371+
}
354372
request.setAttribute("myDeliverableDates", myDeliverableDates);
355373
request.setAttribute("outstandingDeliverableDates", outstandingDeliverableDates);
356374
request.setAttribute("myDeliverableStatuses", myDeliverableStatuses);
@@ -367,7 +385,9 @@ public String execute() throws BaseException {
367385
// The following two arrays are used to display Gantt chart
368386
long[] ganttOffsets = new long[phases.length];
369387
long[] ganttLengths = new long[phases.length];
370-
388+
if(projectId == 30301920) {
389+
LoggingHelper.logError("10");
390+
}
371391
// List of scorecard templates used for this project
372392
Map<String, Scorecard> phaseScorecardTemplates = new LinkedHashMap<String, Scorecard>();
373393
Map<String, String> phaseScorecardLinks = new LinkedHashMap<String, String>();
@@ -406,7 +426,9 @@ public String execute() throws BaseException {
406426
phaseScorecardLinks.put(phaseTypeName, "ViewScorecard?scid=" + scorecardTemplate.getId());
407427
}
408428
}
409-
429+
if(projectId == 30301920) {
430+
LoggingHelper.logError("11");
431+
}
410432
long currentTimeInMinutes = (new Date()).getTime() / (60 * 1000);
411433
if (currentTimeInMinutes >= projectStartTime && currentTimeInMinutes <= projectEndTime) {
412434
request.setAttribute("ganttCurrentTime", currentTimeInMinutes - projectStartTime);
@@ -421,7 +443,9 @@ public String execute() throws BaseException {
421443
*/
422444

423445
// Place phases' start/end dates
424-
446+
if(projectId == 30301920) {
447+
LoggingHelper.logError("12");
448+
}
425449
request.setAttribute("originalStart", originalStart);
426450
request.setAttribute("originalEnd", originalEnd);
427451
request.setAttribute("phaseStatuseCodes", phaseStatuseCodes);
@@ -446,7 +470,9 @@ public String execute() throws BaseException {
446470
request.setAttribute("resources", allProjectResources);
447471
request.setAttribute("users", allProjectExtUsers);
448472
}
449-
473+
if(projectId == 30301920) {
474+
LoggingHelper.logError("13");
475+
}
450476
// Project Prizes
451477
List<Prize> contestPrizes = new ArrayList<Prize>();
452478
List<Prize> checkpointPrizes = new ArrayList<Prize>();
@@ -475,7 +501,9 @@ public String execute() throws BaseException {
475501
request.setAttribute("activeTabIdx", phasesDetails.getActiveTabIndex());
476502

477503
boolean sendTLNotifications = false;
478-
504+
if(projectId == 30301920) {
505+
LoggingHelper.logError("14");
506+
}
479507
if (AuthorizationHelper.isUserLoggedIn(request)) {
480508
Filter filterTNproject = NotificationFilterBuilder.createProjectIdFilter(project.getId());
481509
Filter filterTNuser = NotificationFilterBuilder
@@ -492,7 +520,9 @@ public String execute() throws BaseException {
492520
// Check resource roles
493521
request.setAttribute("isManager", AuthorizationHelper.hasUserRole(request, Constants.MANAGER_ROLE_NAMES));
494522
request.setAttribute("isSubmitter", AuthorizationHelper.hasUserRole(request, Constants.SUBMITTER_ROLE_NAME));
495-
523+
if(projectId == 30301920) {
524+
LoggingHelper.logError("15");
525+
}
496526
// check if registration phase is open
497527
boolean registrationOpen = false;
498528
for (int i = 0; i < activePhases.length && !registrationOpen; i++) {
@@ -525,7 +555,9 @@ public String execute() throws BaseException {
525555
appealsCompletedFlag = true;
526556
}
527557
}
528-
558+
if(projectId == 30301920) {
559+
LoggingHelper.logError("16");
560+
}
529561
long winnerExtUserId = Long.MIN_VALUE;
530562
String winnerExtRefId = (String) project.getProperty("Winner External Reference ID");
531563

@@ -573,7 +605,9 @@ public String execute() throws BaseException {
573605
AuthorizationHelper.hasUserPermission(request, Constants.ADVANCE_SUBMISSION_FAILED_SCREENING_PERM_NAME)
574606
&& project.getProjectStatus().getName().equals("Active") && reviewPhase != null
575607
&& !ActionsHelper.isPhaseClosed(reviewPhase.getPhaseStatus()));
576-
608+
if(projectId == 30301920) {
609+
LoggingHelper.logError("17");
610+
}
577611
request.setAttribute("isAllowedToPerformCheckpointScreening",
578612
AuthorizationHelper.hasUserPermission(request, Constants.PERFORM_CHECKPOINT_SCREENING_PERM_NAME)
579613
&& ActionsHelper.getPhase(phases, true, Constants.CHECKPOINT_SCREENING_PHASE_NAME) != null);
@@ -629,7 +663,9 @@ public String execute() throws BaseException {
629663
&& !AuthorizationHelper.hasUserPermission(request, Constants.PERFORM_AGGREGATION_PERM_NAME)) {
630664
allowedToReviewAggregation = true;
631665
}
632-
666+
if(projectId == 30301920) {
667+
LoggingHelper.logError("18");
668+
}
633669
if (allowedToReviewAggregation && AuthorizationHelper.hasUserRole(request, Constants.SUBMITTER_ROLE_NAME)) {
634670
Long winnerId;
635671
try {
@@ -671,7 +707,9 @@ public String execute() throws BaseException {
671707
ProjectLinkManager linkManager = ActionsHelper.createProjectLinkManager();
672708
request.setAttribute("destProjectLinks", linkManager.getDestProjectLinks(project.getId()));
673709
request.setAttribute("srcProjectLinks", linkManager.getSourceProjectLinks(project.getId()));
674-
710+
if(projectId == 30301920) {
711+
LoggingHelper.logError("19");
712+
}
675713
return Constants.SUCCESS_FORWARD_NAME;
676714
}
677715

0 commit comments

Comments
 (0)