Examples of ISIXmlSection


Examples of org.cast.isi.ISIXmlSection

  }

  protected abstract boolean isComplete();

  protected boolean isLastPageInSection() {
    ISIXmlSection section = getSection();
    return (section != null) && (section.isLastPageInSection());
  }
View Full Code Here

Examples of org.cast.isi.ISIXmlSection

    ISIXmlSection section = getSection();
    return (section != null) && (section.isLastPageInSection());
  }

  protected boolean isLockResponse() {
    ISIXmlSection section = getSection();
    return (section != null) && (section.isLockResponse());
  }
View Full Code Here

Examples of org.cast.isi.ISIXmlSection

    ISIXmlSection section = getSection();
    return (section != null) && (section.isLockResponse());
  }

  protected ISIXmlSection getSectionAncestorForLocation(String location) {
    ISIXmlSection section = new ContentLoc(location).getSection();
    return section.getSectionAncestor();
  }
View Full Code Here

Examples of org.cast.isi.ISIXmlSection

    // Fit Responses into Map
    for (ISIResponse r : responseList) {

      ISIPrompt prompt = ((ISIPrompt)r.getPrompt());
      ISIXmlSection section = prompt.getContentElement().getContentLocObject().getSection();
      if (section != null) {
        if (!responseMap.containsKey(section))
          responseMap.put(section, new TreeMap<ISIPrompt, List<ISIResponse>>());
        if (!responseMap.get(section).containsKey(prompt))
          responseMap.get(section).put(prompt, new ArrayList<ISIResponse>());
View Full Code Here

Examples of org.cast.isi.ISIXmlSection

    mUser = new UserModel(ISISession.get().getUser());
    mTargetUser = ISISession.get().getTargetUserModel();
    teacher = mUser.getObject().getRole().equals(Role.TEACHER);

    ISIXmlSection currentPage = mCurrentPage != null ? (ISIXmlSection) mCurrentPage.getObject() : null;
     ISIXmlSection currentSection = ((ISIXmlSection) mSection.getObject()); // May be itself
    SectionStatus currentSectionStatus = sectionService.getSectionStatus(mTargetUser.getObject(), currentSection);

    // Page Number Repeater
    RepeatingView pageRepeater = new RepeatingView("pageRepeater");
    int pageNumDisplay = ISIApplication.get().getStudentContent().getLabelIndex(ISIXmlSection.SectionType.PAGE, currentSection.firstPage());

    for(ISIXmlSection page = currentSection.firstPage(); page != null; page = page.getNext(), pageNumDisplay++) {
      WebMarkupContainer pageLinkContainer = new WebMarkupContainer(pageRepeater.newChildId());
      pageRepeater.add(pageLinkContainer);
     
      BookmarkablePageLink<ISIStandardPage> link = new SectionLinkFactory().linkToPage("pageLink", page);
      pageLinkContainer.add(link);
View Full Code Here

Examples of org.cast.isi.ISIXmlSection

         // FIXME: Calling getLastModified here has the side effect of checking whether the XML
         // has been modified, and if so, updating it.  This is mysterious and should be
         // replaced with a more transparent mechanism or at least a better name for the method.
         doc.getLastModified();
         for (XmlSection rs : doc.getTocSection().getChildren()) { // For each chapter in the document
           ISIXmlSection rootSection = (ISIXmlSection) rs;
           WebMarkupContainer rootSectionContainer = new WebMarkupContainer(chapterRepeater.newChildId());
           chapterRepeater.add(rootSectionContainer);
           // Chapter that contains the bookmark is open by default.
           if (rootSection.equals(currentRootSection))
             rootSectionContainer.add(new ClassAttributeModifier("open"));
           rootSectionContainer.add(new Label("chapterTitle", rootSection.getTitle()));
           ISIXmlComponent xml = new ISIXmlComponent("chapterContent", new XmlSectionModel(rootSection), "toc");
           xml.setTransformParameter("sectionToggleLinks", getSectionToggleParameter());
           xml.setTransformParameter("sectionLevel", sectionLevel);
           if (currentPage != null)
             xml.setTransformParameter("current", currentPage.getSectionAncestor().getId());
View Full Code Here

Examples of org.cast.isi.ISIXmlSection

   * @param id wicket id
   * @param completed true if the section has been completed, false otherwise.
   * @return the appropriate image component for the 'completed' parameter
   */
  public Component getCompletedImage(String id, IModel<XmlSection> model) {
    ISIXmlSection currentSection = (ISIXmlSection) model.getObject();
   
    Boolean isComplete = sectionService.getSectionStatusMap(getUser()).get(new ContentLoc(currentSection).getLocation());

    if (isComplete == null)
      isComplete = false;
View Full Code Here

Examples of org.cast.isi.ISIXmlSection

   *
   * @param sec the section that is being linked to
   * @return the nearest child or parent that returns true to isPage()
   */
  public ISIXmlSection sectionLinkDest (ISIXmlSection sec) {
    ISIXmlSection result = null;
    if (sec.isPage()) { // If this is a page, return it
      result = sec;
    } else if (sec.hasChildren()) { // If this has children, see if one of them is a page
      result = sectionLinkDest ((ISIXmlSection) sec.getChild(0));
    }
View Full Code Here

Examples of org.cast.isi.ISIXmlSection

    link.setParameter("loc", loc.getLocation());
    return link;
  }

  public BookmarkablePageLink<ISIStandardPage> linkToPage (String wicketId, XmlSection sec) {
    ISIXmlSection page = null;
    if (sec != null)
      page = ((ISIXmlSection) sec).getPageAncestor();
    if (page != null && !page.equals(sec))
      return linkTo (wicketId, page, sec.getId());
    else
      return linkTo(wicketId, sec, null);
  }
View Full Code Here

Examples of org.cast.isi.ISIXmlSection

        Tagging ting = item.getModelObject();
        PersistedObject target = TagService.get().getTarget(ting);
        if (target instanceof ContentElement) {
          ContentElement elt = (ContentElement) target;
          ContentLoc loc = elt.getContentLocObject();
          ISIXmlSection sec = (ISIXmlSection) loc.getSection();

          String crumbTrail = sec.getCrumbTrailAsString(1, 1);
          item.add(new Label("crumbTrail", crumbTrail));
         
          BookmarkablePageLink<ISIStandardPage> link = new SectionLinkFactory().linkToPage("titleLink", sec);
          link.add(new Label("title", sec.getTitle()));
          item.add(link);

          BookmarkablePageLink<ISIStandardPage> iconLink = new SectionLinkFactory().linkToPage("iconLink", sec);
          iconLink.add(ISIApplication.get().iconFor(sec.getSectionAncestor()));
          item.add(iconLink);
       
        }
        TaggingsListPanel tlp = new TaggingsListPanel("tags", target, linkBuilder, targetUser);
        tlp.setShowRemoveLinks(false);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.