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;
   }
 }
  @UiConstructor
  public PreviewResourceView(CollectionItemDo collectionItemDo, int itemIndex) {
    initWidget(uiBinder.createAndBindUi(this));
    resourceThumbContainer.getElement().setId("fpnlResourceThumbContainer");
    resourceImageContainer.getElement().setId("fpnlResourceImageContainer");
    resourceThumbnail.getElement().setId("imgResourceThumbnail");
    resourceTypeImage.getElement().setId("lblResourceTypeImage");
    resourceNumber.getElement().setId("lblResourceNumber");
    resourceTitle.getElement().setId("htmlResourceTitle");
    resourceIndex.getElement().setId("lblResourceIndex");
    resourceHoverTitle.getElement().setId("htmlResourceHoverTitle");
    resourceCategory.getElement().setId("lblResourceCategory");
    resourceSourceName.getElement().setId("lblResourceSourceName");
    ratingWidgetPanel.getElement().setId("fpnlRatingWidgetPanel");
    this.collectionItemDo = collectionItemDo;
    setNavigationResourceTitle(collectionItemDo.getResource().getTitle());
    if (collectionItemDo.getResource().getResourceFormat() != null) {
      setResourceTypeIcon(collectionItemDo.getResource().getResourceFormat().getDisplayName());
    }
    setResourceCategory();
    setReourceSourceName();
    setResourceSequence(itemIndex + 1);
    setResourcePlayLink();

    if (AppClientFactory.getCurrentPlaceToken().equalsIgnoreCase(PlaceTokens.COLLECTION_PLAY)) {
      setAvgRatingWidget();
      AppClientFactory.getEventBus()
          .addHandler(UpdateRatingsInRealTimeEvent.TYPE, setRatingWidgetMetaData);
    }
  }
 @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);
 }
 /**
  * To update the folder details.
  *
  * @param folderId
  * @param currentItem
  */
 protected void updateFolder(String folderId, final TreeItem currentItem) {
   AppClientFactory.getInjector()
       .getfolderService()
       .updateFolder(
           folderId,
           folderTitleTxtBox.getText().trim(),
           null,
           null,
           null,
           new SimpleAsyncCallback<Void>() {
             @Override
             public void onSuccess(Void result) {
               folderObj.setTitle(folderTitleTxtBox.getText());
               folderObj.setType("folder");
               rightPresenter
                   .getShelfMainPresenter()
                   .updateTitleOfTreeWidget(folderObj, false, currentItem);
               rightPresenter
                   .getShelfMainPresenter()
                   .getView()
                   .getCollectionLabel()
                   .setText(folderTitleTxtBox.getText());
               rightPresenter.setTabItems(2, FOLDER, folderObj);
             }
           });
 }
  @UiHandler("saveFolderBtn")
  public void clickSaveFolderBtn(ClickEvent clickEvent) {
    final TreeItem currentItem = rightPresenter.getCurrentTreeItem();
    if (!StringUtil.isEmpty(folderTitleTxtBox.getText())) {
      if (folderTitleTxtBox.getText().length() < 50) {
        Map<String, String> parms = new HashMap<String, String>();
        parms.put("text", folderTitleTxtBox.getText().trim());
        AppClientFactory.getInjector()
            .getResourceService()
            .checkProfanity(
                parms,
                new SimpleAsyncCallback<Boolean>() {
                  @Override
                  public void onSuccess(Boolean result) {
                    if (result) {
                      SetStyleForProfanity.SetStyleForProfanityForTextBox(
                          folderTitleTxtBox, lblErrorMessage, result);
                    } else {
                      lblErrorMessage.setVisible(false);
                      String o1 =
                          AppClientFactory.getPlaceManager().getRequestParameter("o1", null);
                      String o2 =
                          AppClientFactory.getPlaceManager().getRequestParameter("o2", null);
                      String o3 =
                          AppClientFactory.getPlaceManager().getRequestParameter("o3", null);
                      String gooruOid = folderObj.getGooruOid();
                      if (o3 != null) {
                        updateFolder(o3, currentItem);
                      } else if (o2 != null) {
                        updateFolder(o2, currentItem);
                      } else if (o1 != null) {
                        updateFolder(o1, currentItem);
                      }
                      /*if(o1!=null){
                      	updateFolder(o1);
                      }else if(o2!=null)*/

                      /*if(o2==null){
                      	createFolder(o1);
                      }else if(gooruOid==o2){
                      	updateFolder(o2);
                      }else if(o2!=null && o3==null){
                      	createFolder(o2);
                      }else if(gooruOid==o3){
                      	updateFolder(o3);
                      }*/
                    }
                  }
                });
      } else {
        lblErrorMessage.setVisible(true);
        lblErrorMessage.setText(i18n.GL1427());
      }
    } else {
      lblErrorMessage.setVisible(true);
      lblErrorMessage.setText(StringUtil.generateMessage(i18n.GL0067(), "Folder"));
    }
  }
 @Override
 public void onClick(ClickEvent event) {
   /** OnClick of count label event to invoke Review pop-pup */
   AppClientFactory.fireEvent(
       new OpenReviewPopUpEvent(
           collectionItemDo.getResource().getGooruOid(),
           collectionItemDo.getResource().getTitle(),
           collectionItemDo.getResource().getUser().getUsername()));
 }
 @Override
 public void onReset() {
   String classGooruOid =
       AppClientFactory.getPlaceManager()
           .getRequestParameter(UrlNavigationTokens.STUDENT_CLASSPAGE_COURSE_ID, null);
   if (classGooruOid != null) {
     getView().setContentVisiblity(false);
   }
 }
  public DeleteContentPopup() {
    super(false);
    add(binder.createAndBindUi(this));
    this.setGlassEnabled(true);

    h3Panel.setVisible(false);
    lblRemoving.setVisible(false);
    lblRemoving.getElement().getStyle().setMargin(26, Unit.PX);
    txtConfirmAction.setVisible(false);
    setButtonVisibility(true);
    setElementId();

    txtConfirmAction.addKeyUpHandler(new ValidateConfirmText());
    txtConfirmAction.getElement().getStyle().setColor("#515151");
    txtConfirmAction.addClickHandler(
        new ClickHandler() {

          @Override
          public void onClick(ClickEvent event) {
            if (!txtConfirmAction.getText().isEmpty()) {
              if (txtConfirmAction
                  .getText()
                  .toLowerCase()
                  .equalsIgnoreCase(i18n.GL1175().toLowerCase())) {
                txtConfirmAction.setText("");
                txtConfirmAction.getElement().getStyle().setColor("#000000");
              }
            }
          }
        });

    txtConfirmAction.addBlurHandler(
        new BlurHandler() {

          @Override
          public void onBlur(BlurEvent event) {
            if (txtConfirmAction.getText().isEmpty()) {
              txtConfirmAction.getElement().getStyle().setColor("#515151");
            }
          }
        });
    StringUtil.setAttributes(txtConfirmAction, true);
    btnNegitive.setText(StringUtil.generateMessage(i18n.GL0142()));
    btnNegitive.getElement().setAttribute("alt", StringUtil.generateMessage(i18n.GL0142()));
    btnNegitive.getElement().setAttribute("title", StringUtil.generateMessage(i18n.GL0142()));

    btnPositive.setText(StringUtil.generateMessage(i18n.GL0190()));
    btnPositive.getElement().setAttribute("alt", StringUtil.generateMessage(i18n.GL0190()));
    btnPositive.getElement().setAttribute("title", StringUtil.generateMessage(i18n.GL0190()));

    /*lblDeleteText.setText(i18n.GL2189());
    StringUtil.setAttributes(lblDeleteText.getElement(), "lblDeleteText", null, "lblDeleteText");*/

    Window.enableScrolling(false);
    AppClientFactory.fireEvent(new SetHeaderZIndexEvent(98, false));
    this.center();
  }
  public InternalServerErrorPopupViewVc() {
    super(false);
    add(binder.createAndBindUi(this));
    this.setGlassEnabled(true);
    Window.enableScrolling(false);
    AppClientFactory.fireEvent(new SetHeaderZIndexEvent(99, false));
    this.getElement().getStyle().setBackgroundColor("transparent");
    setElementId();

    this.center();

    timer =
        new Timer() {
          public void run() {
            // Call API...
          }
        };
    timer.schedule(DELAY_TIME_SECONDS);
  }
 private String getQuestionImage() {
   String thumbnailImage = "";
   String assetName = "";
   try {
     if (collectionItemDo.getResource().getAssets() != null
         && collectionItemDo.getResource().getAssets().size() > 0) {
       assetName = collectionItemDo.getResource().getAssets().get(0).getAsset().getName();
       thumbnailImage =
           collectionItemDo.getResource().getAssetURI()
               + collectionItemDo.getResource().getFolder()
               + assetName;
     } else {
       thumbnailImage = collectionItemDo.getResource().getThumbnails().getUrl();
     }
   } catch (Exception e) {
     AppClientFactory.printSevereLogger("PreviewResourceView getQuestionImage:::" + e);
   }
   return thumbnailImage != null ? thumbnailImage : "images/defaultRes.png";
 }
 /** To Create folder */
 protected void createFolder(String parentId) {
   AppClientFactory.getInjector()
       .getfolderService()
       .createFolder(
           folderTitleTxtBox.getText().trim(),
           parentId,
           false,
           new SimpleAsyncCallback<FolderDo>() {
             @Override
             public void onSuccess(FolderDo folderDo) {
               Map<String, String> params = new HashMap<String, String>();
               params.put("o1", AppClientFactory.getPlaceManager().getRequestParameter("o1"));
               params.put("o2", folderDo.getGooruOid());
               params.put("view", "Folder");
               //				rightPresenter.getShelfMainPresenter().updateTitleOfTreeWidget(folderDo,true);
               rightPresenter.setTabItems(2, FOLDER, folderDo);
             }
           });
 }
  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());
    }
  }
  /**
   * This method is used to print collection breakdown data
   *
   * @param result
   */
  void setCollectionBreakDownPrintData(ArrayList<UserDataDo> result) {
    try {
      printResourceData.clear();
      UserDataDo maxAvgValue =
          Collections.max(
              result,
              new Comparator<UserDataDo>() {
                public int compare(UserDataDo o1, UserDataDo o2) {
                  Long obj1 = new Long(o1.getTimeSpent());
                  Long obj2 = new Long(o2.getTimeSpent());
                  return obj1.compareTo(obj2);
                }
              });

      final AdvancedFlexTable adTable = new AdvancedFlexTable();
      adTable.getElement().setAttribute("style", "background: #fff; width: 1000px;");

      adTable.setHeaderWidget(0, getHeaderLbl(i18n.GL3259(), 35));
      adTable.setHeaderWidget(1, getHeaderLbl(i18n.GL0308(), 55));
      adTable.setHeaderWidget(2, getHeaderLbl(i18n.GL3260(), 600));
      adTable.setHeaderWidget(3, getHeaderLbl(i18n.GL2084(), 110));
      adTable.setHeaderWidget(4, getHeaderLbl(i18n.GL3261(), 50));
      adTable.setHeaderWidget(5, getHeaderLbl(i18n.GL3273(), 60));

      int rowVal = 0;
      for (int i = 0; i < result.size(); i++) {
        adTable.setWidget(rowVal, 0, new Label(String.valueOf(result.get(i).getItemSequence())));

        // set Format
        String resourceCategory =
            result.get(i).getResourceFormat() != null
                ? result.get(i).getResourceFormat().trim()
                : "";
        String categoryStyle = "";
        if (resourceCategory.equalsIgnoreCase("website")
            || resourceCategory.equalsIgnoreCase("webpage")) {
          resourceCategory = "webpage";
          categoryStyle = res.css().category_new_type_webpage();
        } else if (resourceCategory.equalsIgnoreCase("slide")
            || resourceCategory.equalsIgnoreCase("image")) {
          resourceCategory = "image";
          categoryStyle = res.css().category_new_type_image();
        } else if (resourceCategory.equalsIgnoreCase("handout")
            || resourceCategory.equalsIgnoreCase("lesson")
            || resourceCategory.equalsIgnoreCase("textbook")
            || resourceCategory.equalsIgnoreCase("text")) {
          resourceCategory = "text";
          categoryStyle = res.css().category_new_type_text();
        } else if (resourceCategory.equalsIgnoreCase("exam")) {
          resourceCategory = "webpage";
          categoryStyle = res.css().category_new_type_webpage();
        } else if (resourceCategory.equalsIgnoreCase("video")) {
          resourceCategory = "video";
          categoryStyle = res.css().category_new_type_video();
        } else if (resourceCategory.equalsIgnoreCase("interactive")) {
          resourceCategory = "webpage";
          categoryStyle = res.css().category_new_type_interactive();
        } else if (resourceCategory.equalsIgnoreCase("audio")) {
          resourceCategory = "audio";
          categoryStyle = res.css().category_new_type_audio();
        } else {
          categoryStyle = res.css().category_new_type_other();
        }
        Label categorylbl = new Label();
        categorylbl.addStyleName(categoryStyle);
        categorylbl.addStyleName(res.css().setMarginAuto());
        adTable.setWidget(rowVal, 1, categorylbl);

        // Set Question Title
        Label questionTitle = new Label(AnalyticsUtil.html2text(result.get(i).getTitle()));
        questionTitle.setStyleName(res.css().alignCenterAndBackground());
        questionTitle.addStyleName(res.css().alignLeft());
        adTable.setWidget(rowVal, 2, questionTitle);

        // Set time spent
        HorizontalPanel timeSpentpnl = new HorizontalPanel();
        timeSpentpnl.add(AnalyticsUtil.getTimeStampLabel(result.get(i).getAvgTimeSpent()));
        Label progressBar = new Label();
        progressBar.setStyleName(res.css().setProgressBar());
        timeSpentpnl.add(progressBar);
        double maxAvgVal =
            ((double) result.get(i).getAvgTimeSpent()) / ((double) maxAvgValue.getTimeSpent());
        progressBar.getElement().getStyle().setWidth(maxAvgVal * 100, Unit.PX);
        adTable.setWidget(rowVal, 3, timeSpentpnl);

        // set Views label
        // HorizontalPanel viewpnl=new HorizontalPanel();
        Label viewlbl = new Label(Integer.toString(result.get(i).getViews()));
        viewlbl.setStyleName(res.css().alignCenterAndBackground());
        /* viewpnl.add(viewlbl);
        Label viewProgressBar=new Label();
        viewProgressBar.setStyleName(res.css().setProgressBar());
        viewpnl.add(viewProgressBar);
        float maxViewVal = ((float) result.get(i).getViews())/((float) maxViews.getViews());
        viewProgressBar.getElement().getStyle().setWidth(maxViewVal*100, Unit.PX);*/
        adTable.setWidget(rowVal, 4, viewlbl);

        // Set reactions
        int reaction = result.get(i).getAvgReaction();
        HTMLPanel reactionpnl = new HTMLPanel("");
        reactionpnl.add(new AnalyticsReactionWidget(reaction));
        Label reactioncount = new Label();
        reactionpnl.add(reactioncount);
        reactioncount.setText(reaction + "/5");
        reactioncount.setStyleName(res.css().alignCenterAndBackground());
        adTable.setWidget(rowVal, 5, reactionpnl);
        rowVal++;
      }
      printResourceData.add(adTable);
      printWidget.add(printResourceData);
    } catch (Exception e) {
      AppClientFactory.printSevereLogger(
          "CollectionSummaryTeacherView : setCollectionBreakDownPrintData : " + e.getMessage());
    }
  }
  /**
   * This is used to print opened questions data
   *
   * @param result
   */
  void setOpenendedQuestionsPrintData(ArrayList<UserDataDo> result) {
    try {
      printOpendedData.clear();
      int totalUserCount = collectionMetaData.getUserCount();

      final AdvancedFlexTable adTable = new AdvancedFlexTable();
      adTable.getElement().setAttribute("style", "background: #fff; width: 1000px;");

      adTable.setHeaderWidget(0, getHeaderLbl(i18n.GL3259(), 25));
      adTable.setHeaderWidget(1, getHeaderLbl(i18n.GL0308(), 35));
      adTable.setHeaderWidget(2, getHeaderLbl(i18n.GL3260(), 500));
      adTable.setHeaderWidget(3, getHeaderLbl(i18n.GL2084(), 70));
      adTable.setHeaderWidget(4, getHeaderLbl(i18n.GL3261(), 30));
      adTable.setHeaderWidget(5, getHeaderLbl(i18n.GL3273(), 80));

      if (result.size() != 0) {
        for (int i = 0; i < result.size(); i++) {
          adTable.setWidget(i, 0, new Label(String.valueOf(result.get(i).getItemSequence())));

          // Set Question Title
          Label questionTitle =
              new Label(
                  AnalyticsUtil.html2text(
                      result.get(i).getTitle() != null ? result.get(i).getTitle() : ""));
          questionTitle.setStyleName(res.css().alignCenterAndBackground());
          questionTitle.addStyleName(res.css().alignLeft());
          adTable.setWidget(i, 1, questionTitle);

          // Set completion
          HTMLPanel completionpnl = new HTMLPanel("");
          Label progressBar = new Label();
          progressBar.setStyleName(res.css().setProgressBar());
          completionpnl.add(progressBar);
          Label incompleteProgressBar = new Label();
          incompleteProgressBar.setStyleName(res.css().setIncorrectProgressBar());
          completionpnl.add(incompleteProgressBar);
          int attemptedCount = result.get(i).getTotalAttemptUserCount();
          float maxAvgVal = ((float) attemptedCount) / ((float) totalUserCount);
          progressBar.getElement().getStyle().setWidth(maxAvgVal * 100, Unit.PX);
          incompleteProgressBar.getElement().getStyle().setWidth((100 - maxAvgVal * 100), Unit.PX);
          Label studentTextlbl = new Label(attemptedCount + "/" + totalUserCount + " Students");
          studentTextlbl.setStyleName(res.css().alignCenterAndBackground());
          studentTextlbl.getElement().getStyle().setWidth(100, Unit.PX);
          completionpnl.add(studentTextlbl);
          adTable.setWidget(i, 2, completionpnl);

          // Set time spent
          adTable.setWidget(i, 3, AnalyticsUtil.getTimeStampLabel(result.get(i).getAvgTimeSpent()));

          // Set reactions
          int reaction = result.get(i).getAvgReaction();
          HTMLPanel reactionpnl = new HTMLPanel("");
          reactionpnl.add(new AnalyticsReactionWidget(reaction));
          Label reactioncount = new Label();
          reactionpnl.add(reactioncount);
          reactioncount.setText(reaction + "/5");
          reactioncount.setStyleName(res.css().alignCenterAndBackground());
          adTable.setWidget(i, 4, reactionpnl);

          // set View response label
          Label viewResponselbl = new Label("");
          viewResponselbl.setStyleName(res.css().viewResponseTextOpended());
          adTable.setWidget(i, 5, viewResponselbl);
        }
      }
      adTable.getElement().setId("opendedData");
      printOpendedData.add(adTable);
      if (result.size() == 0) {
        Label erroeMsg = new Label();
        erroeMsg.setStyleName(res.css().displayMessageTextForOEQuestions());
        erroeMsg.setText(i18n.GL3264());
        printOpendedData.add(erroeMsg);
      }
      // To add OE questions
      opendedQuestionHeading.setText(i18n.GL3266());
      opendedQuestionHeading.getElement().getStyle().setPaddingTop(15, Unit.PX);
      opendedQuestionHeading.getElement().getStyle().setPaddingBottom(20, Unit.PX);
      opendedQuestionHeading.getElement().getStyle().setTextAlign(TextAlign.LEFT);
      printWidget.add(opendedQuestionHeading);
      printWidget.add(printOpendedData);
      printOpendedData.getElement().getStyle().setPaddingBottom(20, Unit.PX);
    } catch (Exception e) {
      AppClientFactory.printSevereLogger(
          "CollectionSummaryTeacherView : setOpenendedQuestionsPrintData : " + e.getMessage());
    }
  }
  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);
                }
              });
    }
  }