public static List<JsonRelatedData> pageToJson(List<Page> pages) { List<JsonRelatedData> jsonObjs = new ArrayList<>(); for (Page page : pages) { String name = page.getName(); String title = page.getTitle(); String path = TreeUtils.getPathFromPageParams(Utils.getWikiPageParams(page)); JsonRelatedData dataObj = new JsonRelatedData(name, title, path); jsonObjs.add(dataObj); } return jsonObjs; }
/** * get wiki page params from the path made by {@link #getPath(WikiPageParams)} * * @param path made by {@link #getPath(WikiPageParams)} * @throws Exception if an error occurs. */ public static WikiPageParams getPageParams(String path) throws Exception { return TreeUtils.getPageParamsFromPath(path); }