示例#1
0
文件: Pages.java 项目: Heigvd/Wegas
  /**
   * @return Map complete pages.
   * @throws RepositoryException
   */
  public Map<String, JsonNode> getPagesContent() throws RepositoryException {
    if (!this.connector.exist(this.gameModelId)) {
      return new TreeMap<>();
    }
    NodeIterator it = this.connector.listChildren(this.gameModelId);
    Map<String, JsonNode> ret = new TreeMap<>(new AlphanumericComparator<String>());
    while (it.hasNext()) {
      Node n = (Node) it.next();
      Page p = new Page(n);
      // pageMap.put(p.getId().toString(),  p.getContent());
      ret.put(p.getId(), p.getContent());
    }
    // this.connector.close();

    return ret;
  }
示例#2
0
文件: Pages.java 项目: Heigvd/Wegas
 /**
  * @param page
  * @throws RepositoryException
  */
 public void store(Page page) throws RepositoryException {
   Node n = this.connector.addChild(this.gameModelId, page.getId());
   n.setProperty("content", page.getContent().toString());
   this.setMeta(page);
 }