public String getResourceLink() {
   String collectionId = AppClientFactory.getPlaceManager().getRequestParameter("id", null);
   if (collectionItemDo.getNarration() != null
       && !collectionItemDo.getNarration().trim().equals("")) {
     String resourceLink =
         "#"
             + AppClientFactory.getCurrentPlaceToken()
             + "&id="
             + collectionId
             + "&rid="
             + collectionItemDo.getCollectionItemId()
             + "&tab=narration";
     resourceLink += PreviewPlayerPresenter.setConceptPlayerParameters();
     return resourceLink;
   } else {
     String resourceLink =
         "#"
             + AppClientFactory.getCurrentPlaceToken()
             + "&id="
             + collectionId
             + "&rid="
             + collectionItemDo.getCollectionItemId();
     resourceLink += PreviewPlayerPresenter.setConceptPlayerParameters();
     return resourceLink;
   }
 }
 @UiHandler("contentRedirectionLbl")
 public void redirectContentVisibility(ClickEvent event) {
   Map<String, String> params = new HashMap<String, String>();
   params.put("o1", classpageDo.getCourseGooruOid());
   params.put("share", "true");
   AppClientFactory.getPlaceManager().revealPlace(PlaceTokens.MYCONTENT, params);
 }
 @Override
 public void onReset() {
   String classGooruOid =
       AppClientFactory.getPlaceManager()
           .getRequestParameter(UrlNavigationTokens.STUDENT_CLASSPAGE_COURSE_ID, null);
   if (classGooruOid != null) {
     getView().setContentVisiblity(false);
   }
 }
  private void setElementId() {
    btnPositive.getElement().setId("btnPositive");
    btnNegitive.getElement().setId("btnNegitive");
    lblTitle.getElement().setId("lblTitle");
    txtConfirmAction.getElement().setId("txtConfirmAction");
    lblRemoving.getElement().setId("lblRemoving");
    closeBtn.getElement().getStyle().setCursor(Cursor.POINTER);

    h5Panel.setText("Warning: this cannot be undone");
    paragraphPnl.setText("Please type in delete");
    chkBoxList.add(chkBox1);
    chkBoxList.add(chkBox2);
    chkBoxList.add(chkBox3);

    chkBox1.getElement().setId("checkboxG12");
    chkBox2.getElement().setId("checkboxG13");
    chkBox3.getElement().setId("checkboxG14");

    checkboxG12.getElement().setAttribute("for", "checkboxG12");
    checkboxG13.getElement().setAttribute("for", "checkboxG13");
    checkboxG14.getElement().setAttribute("for", "checkboxG14");

    chkBox1.setValue(false);
    chkBox2.setValue(false);
    chkBox3.setValue(false);
    if (AppClientFactory.getPlaceManager()
        .getCurrentPlaceRequest()
        .getNameToken()
        .equals(PlaceTokens.EDIT_CLASS)) {
      checkboxG12.setText(i18n.GL3575());
      checkboxG13.setText(i18n.GL3576());
      checkboxG14.setText(i18n.GL3577());
      checkboxG13.getElement().getStyle().setLineHeight(18, Unit.PX);
    } else {
      checkboxG12.setText(i18n.GL3579());
      checkboxG13.setText(i18n.GL3573());
      checkboxG14.setText(i18n.GL3574());
    }
  }
  public void setData() {
    String pageType =
        AppClientFactory.getPlaceManager()
            .getRequestParameter(
                UrlNavigationTokens.STUDENT_CLASSPAGE_PAGE_DIRECT,
                UrlNavigationTokens.STUDENT_CLASSPAGE_COURSE_VIEW);
    String classUId =
        AppClientFactory.getPlaceManager()
            .getRequestParameter(UrlNavigationTokens.STUDENT_CLASSPAGE_CLASS_ID, null);
    String classGooruOid =
        AppClientFactory.getPlaceManager()
            .getRequestParameter(UrlNavigationTokens.STUDENT_CLASSPAGE_COURSE_ID, null);
    String unitId =
        AppClientFactory.getPlaceManager()
            .getRequestParameter(UrlNavigationTokens.STUDENT_CLASSPAGE_UNIT_ID, null);
    String lessonId =
        AppClientFactory.getPlaceManager()
            .getRequestParameter(UrlNavigationTokens.STUDENT_CLASSPAGE_LESSON_ID, null);

    if (classGooruOid == null) {
      getView().setContent(new ArrayList<PlanProgressDo>(), "", "");
    } else if (pageType.equalsIgnoreCase(UrlNavigationTokens.STUDENT_CLASSPAGE_COURSE_VIEW)) {
      if (classGooruOid != null) {
        AppClientFactory.getInjector()
            .getClasspageService()
            .getStudentPlanProgressData(
                classUId,
                classGooruOid,
                null,
                null,
                "plan",
                null,
                new SimpleAsyncCallback<ArrayList<PlanProgressDo>>() {
                  @Override
                  public void onSuccess(ArrayList<PlanProgressDo> dataList) {
                    getView().setMetadataContent(dataList);
                    getView()
                        .setContent(
                            dataList,
                            getClasspageDo().getStatus(),
                            getClasspageDo().getUser().getGooruUId());
                  }

                  @Override
                  public void onFailure(Throwable caught) {
                    getView().setContentVisiblity(true);
                  }
                });
      }
    } else if (pageType.equalsIgnoreCase(UrlNavigationTokens.STUDENT_CLASSPAGE_UNIT_VIEW)) {
      if (classGooruOid != null) {
        AppClientFactory.getInjector()
            .getClasspageService()
            .getStudentPlanProgressData(
                classUId,
                classGooruOid,
                null,
                null,
                "plan",
                null,
                new SimpleAsyncCallback<ArrayList<PlanProgressDo>>() {
                  @Override
                  public void onSuccess(ArrayList<PlanProgressDo> dataList) {
                    getView().setMetadataContent(dataList);
                  }

                  @Override
                  public void onFailure(Throwable caught) {
                    getView().setContentVisiblity(true);
                  }
                });
      }
      if (classGooruOid != null && unitId != null) {
        AppClientFactory.getInjector()
            .getClasspageService()
            .getStudentPlanProgressData(
                classUId,
                classGooruOid,
                unitId,
                null,
                "plan",
                null,
                new SimpleAsyncCallback<ArrayList<PlanProgressDo>>() {
                  @Override
                  public void onSuccess(ArrayList<PlanProgressDo> dataList) {
                    getView()
                        .setContent(
                            dataList,
                            getClasspageDo().getStatus(),
                            getClasspageDo().getUser().getGooruUId());
                  }

                  @Override
                  public void onFailure(Throwable caught) {
                    getView().setContentVisiblity(true);
                  }
                });
      }
    } else if (pageType.equalsIgnoreCase(UrlNavigationTokens.STUDENT_CLASSPAGE_LESSON_VIEW)) {
      if (classGooruOid != null && unitId != null && lessonId != null) {
        AppClientFactory.getInjector()
            .getClasspageService()
            .getStudentPlanProgressData(
                classUId,
                classGooruOid,
                unitId,
                null,
                "plan",
                null,
                new SimpleAsyncCallback<ArrayList<PlanProgressDo>>() {
                  @Override
                  public void onSuccess(ArrayList<PlanProgressDo> dataList) {
                    getView().setMetadataContent(dataList);
                  }

                  @Override
                  public void onFailure(Throwable caught) {
                    getView().setContentVisiblity(true);
                  }
                });
      }
    }
  }
  @Override
  public void getLessonPlanData(String contentGooruIds) {
    final String classUId =
        AppClientFactory.getPlaceManager()
            .getRequestParameter(UrlNavigationTokens.STUDENT_CLASSPAGE_CLASS_ID, null);
    final String classGooruOid =
        AppClientFactory.getPlaceManager()
            .getRequestParameter(UrlNavigationTokens.STUDENT_CLASSPAGE_COURSE_ID, null);
    final String unitId =
        AppClientFactory.getPlaceManager()
            .getRequestParameter(UrlNavigationTokens.STUDENT_CLASSPAGE_UNIT_ID, null);
    final String lessonId =
        AppClientFactory.getPlaceManager()
            .getRequestParameter(UrlNavigationTokens.STUDENT_CLASSPAGE_LESSON_ID, null);
    final Map<String, String> queryParams = new HashMap<String, String>();
    queryParams.put("contentGooruIds", contentGooruIds);

    if (classGooruOid != null && unitId != null && lessonId != null) {
      AppClientFactory.getInjector()
          .getClasspageService()
          .getClasspageCollections(
              classUId,
              classGooruOid,
              unitId,
              lessonId,
              "assessment",
              new SimpleAsyncCallback<PlanContentDo>() {
                @Override
                public void onSuccess(final PlanContentDo collectionList) {
                  final Map<String, PlanProgressDo> data = new HashMap<String, PlanProgressDo>();
                  AppClientFactory.getInjector()
                      .getClasspageService()
                      .getStudentPlanProgressData(
                          classUId,
                          classGooruOid,
                          unitId,
                          lessonId,
                          "plan",
                          queryParams,
                          new SimpleAsyncCallback<ArrayList<PlanProgressDo>>() {
                            @Override
                            public void onSuccess(ArrayList<PlanProgressDo> dataList) {
                              for (int i = 0; i < dataList.size(); i++) {
                                data.put(dataList.get(i).getGooruOId(), dataList.get(i));
                              }
                              if (collectionList.getItems() != null
                                  && collectionList.getItems().size() > 0) {
                                ArrayList<PlanContentDo> contentList = collectionList.getItems();
                                for (int i = 0; i < contentList.size(); i++) {
                                  contentList
                                      .get(i)
                                      .setProgress(data.get(contentList.get(i).getGooruOid()));
                                }
                                collectionList.setItems(contentList);
                              }
                              getView()
                                  .setLessonContent(
                                      collectionList,
                                      getClasspageDo().getStatus(),
                                      getClasspageDo().getUser().getGooruUId(),
                                      getClasspageDo().getMinimumScore());
                            }

                            @Override
                            public void onFailure(Throwable caught) {
                              getView().setContentVisiblity(true);
                            }
                          });
                }

                @Override
                public void onFailure(Throwable caught) {
                  getView().setContentVisiblity(true);
                }
              });
    }
  }