Package com.gitblit.wicket.MarkupProcessor

Examples of com.gitblit.wicket.MarkupProcessor.MarkupDocument


      // check to see if we should transform markup files
      String ext = StringUtils.getFileExtension(resource);
      if (processor.getMarkupExtensions().contains(ext)) {
        String markup = new String(content, Constants.ENCODING);
        MarkupDocument markupDoc = processor.parse(repository, commit.getName(), resource, markup);
        content = markupDoc.html.getBytes("UTF-8");
        response.setContentType("text/html; charset=" + Constants.ENCODING);
      }

      try {
View Full Code Here


    add(new TagsPanel("tagsPanel", repositoryName, r, numberRefs).hideIfEmpty());
    add(new BranchesPanel("branchesPanel", getRepositoryModel(), r, numberRefs, false).hideIfEmpty());

    if (app().settings().getBoolean(Keys.web.summaryShowReadme, false)) {
      // show a readme on the summary page
      MarkupDocument markupDoc = null;
      RevCommit head = JGitUtils.getCommit(r, null);
      if (head != null) {
        MarkupProcessor processor = new MarkupProcessor(app().settings());
        markupDoc = processor.getReadme(r, repositoryName, getBestCommitId(head));
      }
View Full Code Here

        private static final long serialVersionUID = 1L;
        int counter;

        @Override
        public void populateItem(final Item<MarkupDocument> item) {
          MarkupDocument doc = item.getModelObject();
          String file = StringUtils.getLastPathElement(doc.documentPath);
          file = StringUtils.stripFileExtension(file);
          String name = file.replace('_', ' ').replace('-'' ');

          ExternalLink link = new ExternalLink("link", "#" + file);
          link.add(new Label("label", name.toUpperCase()).setRenderBodyOnly(true));
          item.add(link);
          if (counter == 0) {
            counter++;
            item.add(new SimpleAttributeModifier("class", "active"));
          }
        }
      };
      fragment.add(tabTitles);

      // tab content
      DataView<MarkupDocument> tabsView = new DataView<MarkupDocument>("tabContent", docDp) {
        private static final long serialVersionUID = 1L;
        int counter;

        @Override
        public void populateItem(final Item<MarkupDocument> item) {
          MarkupDocument doc = item.getModelObject();
          // document page links
          item.add(new BookmarkablePageLink<Void>("blameLink", BlamePage.class,
              WicketUtils.newPathParameter(repositoryName, commitId, doc.documentPath)));
          item.add(new BookmarkablePageLink<Void>("historyLink", HistoryPage.class,
              WicketUtils.newPathParameter(repositoryName, commitId, doc.documentPath)));
View Full Code Here

    BugtraqProcessor bugtraq = new BugtraqProcessor(app().settings());
    markupText = bugtraq.processText(getRepository(), repositoryName, markupText);

    Fragment fragment;
    MarkupDocument markupDoc = processor.parse(repositoryName, getBestCommitId(commit), documentPath, markupText);
    if (MarkupSyntax.PLAIN.equals(markupDoc.syntax)) {
      fragment = new Fragment("doc", "plainContent", this);
    } else {
      fragment = new Fragment("doc", "markupContent", this);
    }
View Full Code Here

    BugtraqProcessor bugtraq = new BugtraqProcessor(app().settings());
    markupText = bugtraq.processText(getRepository(), repositoryName, markupText);

    Fragment fragment;
    MarkupDocument markupDoc = processor.parse(repositoryName, getBestCommitId(commit), documentPath, markupText);
    if (MarkupSyntax.PLAIN.equals(markupDoc.syntax)) {
      fragment = new Fragment("doc", "plainContent", this);
    } else {
      fragment = new Fragment("doc", "markupContent", this);
    }
View Full Code Here

        private static final long serialVersionUID = 1L;
        int counter;

        @Override
        public void populateItem(final Item<MarkupDocument> item) {
          MarkupDocument doc = item.getModelObject();
          String file = StringUtils.getLastPathElement(doc.documentPath);
          file = StringUtils.stripFileExtension(file);
          String name = file.replace('_', ' ').replace('-'' ');

          ExternalLink link = new ExternalLink("link", "#" + file);
          link.add(new Label("label", name.toUpperCase()).setRenderBodyOnly(true));
          item.add(link);
          if (counter == 0) {
            counter++;
            item.add(new SimpleAttributeModifier("class", "active"));
          }
        }
      };
      fragment.add(tabTitles);

      // tab content
      DataView<MarkupDocument> tabsView = new DataView<MarkupDocument>("tabContent", docDp) {
        private static final long serialVersionUID = 1L;
        int counter;

        @Override
        public void populateItem(final Item<MarkupDocument> item) {
          MarkupDocument doc = item.getModelObject();
          // document page links
          item.add(new BookmarkablePageLink<Void>("blameLink", BlamePage.class,
              WicketUtils.newPathParameter(repositoryName, commitId, doc.documentPath)));
          item.add(new BookmarkablePageLink<Void>("historyLink", HistoryPage.class,
              WicketUtils.newPathParameter(repositoryName, commitId, doc.documentPath)));
View Full Code Here

    add(new TagsPanel("tagsPanel", repositoryName, r, numberRefs).hideIfEmpty());
    add(new BranchesPanel("branchesPanel", getRepositoryModel(), r, numberRefs, false).hideIfEmpty());

    if (app().settings().getBoolean(Keys.web.summaryShowReadme, false)) {
      // show a readme on the summary page
      MarkupDocument markupDoc = null;
      RevCommit head = JGitUtils.getCommit(r, null);
      if (head != null) {
        MarkupProcessor processor = new MarkupProcessor(app().settings(), app().xssFilter());
        markupDoc = processor.getReadme(r, repositoryName, getBestCommitId(head));
      }
View Full Code Here

TOP

Related Classes of com.gitblit.wicket.MarkupProcessor.MarkupDocument

Copyright © 2018 www.massapicom. 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.