protected void createCommentLink( CurricularCourseResumeResult courseResumeResult, HtmlInlineContainer container, ResultClassification forAudit) { container.addChild(new HtmlText(" | ", false)); String commentLinkText = RenderUtils.getResourceString("INQUIRIES_RESOURCES", "link.inquiry.comment"); if (courseResumeResult.isShowAllComments() || !courseResumeResult.isAllowComment()) { commentLinkText = RenderUtils.getResourceString("INQUIRIES_RESOURCES", "link.inquiry.viewResults"); } else if (hasQucGlobalCommentsMadeBy( courseResumeResult.getExecutionCourse(), courseResumeResult.getPerson(), courseResumeResult.getExecutionDegree(), courseResumeResult.getPersonCategory())) { commentLinkText = RenderUtils.getResourceString("INQUIRIES_RESOURCES", "link.inquiry.viewComment"); } String fillInParameters = buildFillInParameters(courseResumeResult); HtmlLink commentLink = new HtmlLink(); commentLink.setUrl(getAction() + "?method=" + getMethod() + fillInParameters); commentLink.setText(commentLinkText); container.addChild(commentLink); if (courseResumeResult.getExecutionCourse().getExecutionCourseAudit() != null && courseResumeResult.getExecutionCourse().getExecutionCourseAudit().isProcessAvailable()) { container.addChild(new HtmlText(" | ", false)); HtmlLink auditLink = new HtmlLink(); auditLink.setUrl( "/auditResult.do?method=viewProcessDetails&" + buildParametersForAudit(courseResumeResult)); auditLink.setText("Ver processo auditoria"); container.addChild(auditLink); } else { if (forAudit != null) { if (forAudit.equals(ResultClassification.RED)) { container.addChild( new HtmlText( " (" + RenderUtils.getResourceString("INQUIRIES_RESOURCES", "label.inquiry.audit") + ")")); } else if (forAudit.equals(ResultClassification.YELLOW)) { container.addChild( new HtmlText( " (" + RenderUtils.getResourceString( "INQUIRIES_RESOURCES", "label.inquiry.inObservation") + ")")); } } } }
private String buildFillInParameters(CurricularCourseResumeResult courseResumeResult) { StringBuilder builder = new StringBuilder(); builder .append("&executionDegreeOID=") .append(courseResumeResult.getExecutionDegree().getExternalId()); builder .append("&executionCourseOID=") .append(courseResumeResult.getExecutionCourse().getExternalId()); builder .append("°reeCurricularPlanID=") .append(courseResumeResult.getExecutionDegree().getDegreeCurricularPlan().getExternalId()); builder.append("&backToResume=").append(courseResumeResult.isBackToResume()); builder.append("&showAllComments=").append(courseResumeResult.isShowAllComments()); builder.append("&allowComment=").append(courseResumeResult.isAllowComment()); return builder.toString(); }