Examples of SiteInfo


Examples of de.zib.scalaris.examples.wikipedia.data.SiteInfo

            PrintStream msgOut, boolean normalised) throws RuntimeException {
        SQLiteConnection db = null;
        try {
            db = WikiDumpPrepareSQLiteForScalarisHandler.openDB(dbFileName, true);
            db.exec("CREATE TEMPORARY TABLE currentPages(id INTEGER PRIMARY KEY ASC);");
            SiteInfo siteInfo = readSiteInfo(db);
            MyNamespace namespace = new MyNamespace(siteInfo);
            ArrayList<String> allowedCats = new ArrayList<String>(allowedCats0.size());
            MyWikiModel.normalisePageTitles(allowedCats0, namespace, allowedCats);

            Set<String> allowedCatsFull = getSubCategories(allowedCats0, allowedCats, db,
View Full Code Here

Examples of net.sourceforge.jwbf.mediawiki.actions.meta.Siteinfo

   *             on problems with http, cookies and io
   * @see Siteinfo
   */
  public Siteinfo getSiteinfo() throws ActionException {

    Siteinfo gs = null;
    try {
      gs = new Siteinfo();
      performAction(gs);
    } catch (ProcessException e) {
      e.printStackTrace();
    }

View Full Code Here

Examples of org.eclipse.orion.internal.server.hosting.SiteInfo

    UserInfo user = new UserInfo();
    user.setUniqueId("A");
    user.setUserName("carlos");
    metaStore.createUser(user);

    SiteInfo site = SiteInfo.newSiteConfiguration(user, "mysite", "myworkspace");
    site.setId("s1");
    site.setName("Some site");
    site.setHostHint("foo");
    site.save(user);

    hostingService.start(site, user, "http://whatever/dontcare", new URI("http", null, "test", 80, null, null, null));

    IHostedSite vhost = hostingService.get(site, user);
    assertEquals("https://foo.sites.example.org:1234", vhost.getUrl());
View Full Code Here

Examples of org.eclipse.orion.internal.server.hosting.SiteInfo

    UserInfo user = new UserInfo();
    user.setUniqueId("A");
    user.setUserName("carlos");
    metaStore.createUser(user);

    SiteInfo site1 = SiteInfo.newSiteConfiguration(user, "site1", "myworkspace");
    site1.setId("s1");
    site1.setName("Site 1");
    site1.setHostHint("foo");
    site1.save(user);

    SiteInfo site2 = SiteInfo.newSiteConfiguration(user, "site2", "myworkspace");
    site1.setId("s2");
    site2.setName("Site 2");
    site2.setHostHint("foo");
    site2.save(user);

    hostingService.start(site1, user, "http://whatever/dontcare", new URI("http", null, "test", 80, null, null, null));
    hostingService.start(site2, user, "http://whatever/dontcare", new URI("http", null, "test", 80, null, null, null));

    // Expect: site1 acquires the "foo" URL, and site2 has to settle for foo + {suffix "0"}
View Full Code Here

Examples of org.eclipse.orion.internal.server.hosting.SiteInfo

    UserInfo user = new UserInfo();
    user.setUniqueId("A");
    user.setUserName("carlos");
    metaStore.createUser(user);

    SiteInfo site = SiteInfo.newSiteConfiguration(user, "mysite", "myworkspace");
    site.setId("s1");
    site.setName("Some site");
    site.setHostHint("foo");
    site.save(user);

    // Should be recognized as matching a virtual host
    assertEquals(true, hostingService.matchesVirtualHost("fizzbuzz.sites.example.org"));
  }
View Full Code Here

Examples of org.eclipse.orion.internal.server.hosting.SiteInfo

    JSONObject site = new JSONObject(createResp.getText());
    final String siteId = site.getString(ProtocolConstants.KEY_ID);
    String location = site.getString(ProtocolConstants.HEADER_LOCATION);

    UserInfo user = OrionConfiguration.getMetaStore().readUser(testUserId);
    SiteInfo siteInfo = SiteInfo.getSite(user, siteId);
    assertNotNull(siteInfo);

    // Delete site
    WebRequest deleteReq = getDeleteSiteRequest(location);
    WebResponse deleteResp = webConversation.getResponse(deleteReq);
View Full Code Here

Examples of org.meshcms.core.SiteInfo

    this.style = style;
  }

  public void writeTag() throws IOException {
    SiteMap siteMap = webSite.getSiteMap();
    SiteInfo siteInfo = webSite.getSiteInfo();
    Path rootPath = (path == null) ? siteInfo.getThemeRoot(pagePath) : new Path(path);
    Path pathInMenu = webSite.getSiteMap().getPathInMenu(pagePath);
    int baseLevel = rootPath.getElementCount() + 1;
    int spc = Utils.parseInt(space, 8);
    SiteMapIterator iter = new SiteMapIterator(webSite, rootPath);
    iter.setSkipHiddenSubPages(allowHiding);
    Writer outWriter = getOut();

    while (iter.hasNext()) {
      PageInfo current = (PageInfo) iter.next();
      Path currentPath = current.getPath();
      Path parentPath = currentPath.getParent();

      if (parentPath.isRelative() || pathInMenu.isContainedIn(parentPath)) {
        if (Utils.isTrue(expand) ||
            pathInMenu.isContainedIn(currentPath) ||
            currentPath.getElementCount() == baseLevel ||
            currentPath.getElementCount() >= pathInMenu.getElementCount()) {
          outWriter.write("<div style=\"padding-left: " +
            (spc * Math.max(current.getLevel() - baseLevel, 0)) + "px;\">");

          if (style != null) {
            outWriter.write("<div class=\"" + style + "\">");
          }

          outWriter.write(bullet + "&nbsp;");

          if (!isEdit && current.getPath().equals(pathInMenu)) {
            outWriter.write(siteInfo.getPageTitle(current));
          } else {
            outWriter.write("<a href=\"" + webSite.getLink(current, pageDirPath) +
              "\">" + siteInfo.getPageTitle(current) + "</a>");
          }

          if (style != null) {
            outWriter.write("</div>");
          }
View Full Code Here

Examples of org.meshcms.core.SiteInfo

          webSite.getLink(sp.add("menu." + menuType + "/script.js"), pageDirPath) +
          "' type='text/javascript'></script>\n");
      outWriter.write("<link type='text/css' href='" +
          WebUtils.getThemeFolderPath(request, pageDirPath) + "/alib.css' rel='stylesheet' />\n");
    } else {
      SiteInfo siteInfo = webSite.getSiteInfo();
      Path rootPath = (path == null) ? siteInfo.getThemeRoot(pagePath) : new Path(path);
      Path pathInMenu = webSite.getSiteMap().getPathInMenu(pagePath);
      int baseLevel = rootPath.getElementCount() + 1;
      int lastLevel = rootPath.getElementCount();
      SiteMapIterator iter = new SiteMapIterator(webSite, rootPath);
      iter.setSkipHiddenSubPages(Utils.isTrue(allowHiding));
      boolean liUsed = false;
      boolean firstUl = true;

      while (iter.hasNext()) {
        PageInfo currentPageInfo = (PageInfo) iter.next();
        Path currentPath = currentPageInfo.getPath();
        int level = Math.max(baseLevel, currentPageInfo.getLevel());

        for (int i = lastLevel; i < level; i++) {
          if (firstUl) {
            writeIndented(outWriter, "<ul class=\"" +
                (horizontal ? "hmenu" : "vmenu") + "\">", i);
            firstUl = false;
          } else {
            writeIndented(outWriter, "<ul>", i);
          }

          writeIndented(outWriter, "<li>", i + 1);
          liUsed = false;
        }

        for (int i = lastLevel - 1; i >= level; i--) {
          if (liUsed) {
            outWriter.write("</li>");
            liUsed = false;
          } else {
            writeIndented(outWriter, "</li>", i + 1);
          }

          writeIndented(outWriter, "</ul>", i);
        }

        if (liUsed) {
          outWriter.write("</li>");
          writeIndented(outWriter, "<li>", level);
        }

        for ( int i = lastLevel - 1; i >= level; i--) {
            writeIndented(outWriter, "</li>", i);
            writeIndented(outWriter, "<li>", i);
        }

        if ( ! Utils.isNullOrEmpty(currentPathStyle)
                        && ( currentPageInfo.getLevel() >= baseLevel
                               && pathInMenu.isContainedIn(currentPath)
                     || currentPageInfo.getPath().equals(pathInMenu)
                   ) ) {
          outWriter.write("<a href=\"" + webSite.getLink(currentPageInfo, pageDirPath) +
            "\" class='" + currentPathStyle + "'>" +
            siteInfo.getPageTitle(currentPageInfo) + "</a>");
        } else {
          outWriter.write("<a href=\"" + webSite.getLink(currentPageInfo, pageDirPath) +"\">" +
            siteInfo.getPageTitle(currentPageInfo) + "</a>");
        }

        liUsed = true;
        lastLevel = level;
      }
View Full Code Here

Examples of org.meshcms.core.SiteInfo

   
    if (artisteer) {
      currentPathStyle = currentStyle = "active";
    }
   
    SiteInfo siteInfo = webSite.getSiteInfo();
    Path rootPath = siteInfo.getThemeRoot(pagePath);
   
    if (path != null) {
      if (path.equals("current")) {
        rootPath = pageDirPath;
      } else if (path.equals("parent")) {
        Path parent = pageDirPath.getParent();
       
        if (parent.isContainedIn(rootPath)) {
          rootPath = parent;
        }
      } else if (path.equals("root")) {
        rootPath = Path.ROOT;
      } else {
        rootPath = new Path(path);
      }
    }
   
    Path pathInMenu = webSite.getSiteMap().getPathInMenu(pagePath);
    int baseLevel = rootPath.getElementCount() + 1;
    Writer outWriter = getOut();
    int lastLevel = rootPath.getElementCount();
    SiteMapIterator iter = new SiteMapIterator(webSite, rootPath);
    iter.setSkipHiddenSubPages(Utils.isTrue(allowHiding));
    boolean styleNotApplied = !Utils.isNullOrEmpty(style);
    int showLastLevel = -1;
   
    while (iter.hasNext()) {
      PageInfo currentPageInfo = (PageInfo) iter.next();
      Path currentPath = currentPageInfo.getPath();
      int level = Math.max(baseLevel, currentPageInfo.getLevel());
     
      if (currentPageInfo.getLevel() <= showLastLevel) {
        showLastLevel = -1;
      }
     
      if (siteInfo.getHideSubmenu(currentPath) && showLastLevel == -1) {
        showLastLevel = currentPageInfo.getLevel();
      }
     
      boolean add = false;
     
      if (itemsAll) {
        add = true;
      } else {
        Path parentPath = currentPath.getParent();
       
        if (parentPath.isRelative() || pathInMenu.isContainedIn(parentPath)) {
          if (itemsOnPath && pathInMenu.isContainedIn(currentPath)) {
            add = true;
          } else if (level <= baseLevel) {
            add = itemsFirstLevel;
          } else if (currentPath.getElementCount() == pathInMenu.getElementCount()) {
            add = itemsLastLevel;
          } else if (currentPath.getElementCount() > pathInMenu.getElementCount()) {
            add = itemsChildren;
          } else {
            add = itemsIntermediateLevels;
          }
        }
      }
     
      if (add) {
        // Close off any pending lower levels
        for (int i = lastLevel - 1; i >= level; i--) {
          writeIndented(outWriter, "</li>", i + 1);
          writeIndented(outWriter, "</ul>", i);
        }
       
        // If we're a level deeper - then create new sub ul+li
        for (int i = lastLevel; i < level; i++) {
          if (styleNotApplied) {
            writeIndented(outWriter, "<ul class=\"" + style + "\">", i);
            styleNotApplied = false;
          } else {
            if (artisteer) {
              writeIndented(outWriter, "<ul class='active'>", i);
            } else {
              writeIndented(outWriter, "<ul>", i);
            }
          }
          writeIndented(outWriter, "<li>", i + 1);
        }
       
        // If we do not have an open li at the right level - then create one
        if (level <= lastLevel) {
          writeIndented(outWriter, "</li>", level);
          writeIndented(outWriter, "<li>", level);
        }
       
        String link = webSite.getLink(currentPageInfo, pageDirPath).toString();
        String artStart, artEnd;
       
        if (currentPageInfo.getLevel() - baseLevel < 1 && artisteer) {
          artStart = "<span class='l'></span><span class='r'></span><span class='t'>";
          artEnd = "</span>";
        } else {
          artStart = artEnd = "";
        }
       
        if (currentPageInfo.getLevel() > 0 && pathInMenu.isContainedIn(currentPath)
            && !(currentPageInfo.getPath().equals(pathInMenu)
                || currentPageInfo.getPath().equals(rootPath)
                || Utils.isNullOrEmpty(currentPathStyle))) {
          outWriter.write("<a href=\"" + link + "\" class='" + currentPathStyle +
              "'>" + artStart + siteInfo.getPageTitle(currentPageInfo) + artEnd + "</a>");
        } else if (currentPageInfo.getPath().equals(pathInMenu)) {
          if (isEdit || linkCurrent) {
            if (!(Utils.isNullOrEmpty(currentStyle) && Utils.isNullOrEmpty(currentPathStyle))) {
              outWriter.write("<a href=\"" + link + "\" class='" + currentPathStyle +
                  " " + currentStyle + "'>" + artStart +
                  siteInfo.getPageTitle(currentPageInfo) + artEnd + "</a>");
            } else {
              outWriter.write("<a href=\"" + link + "\">" + artStart +
                  siteInfo.getPageTitle(currentPageInfo) + artEnd + "</a>");
            }
          } else {
            if (Utils.isNullOrEmpty(currentStyle)) {
              outWriter.write(siteInfo.getPageTitle(currentPageInfo));
            } else {
              outWriter.write("<span class='" + currentStyle + "'>" +
                  siteInfo.getPageTitle(currentPageInfo) + "</span>");
            }
          }
        } else {
          outWriter.write("<a href=\"" + link + "\">" + artStart +
              siteInfo.getPageTitle(currentPageInfo) + artEnd + "</a>");
        }
       
        lastLevel = level;
      }
    }
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.