コード例 #1
0
 /**
  * Adds a new page to the CP
  *
  * @return
  */
 protected String addNewHTMLPage() {
   final String newId =
       CPManager.getInstance()
           .addBlankPage(
               cp, translate("cptreecontroller.newpage.title"), currentPage.getIdentifier());
   final CPPage newPage = new CPPage(newId, cp);
   // Create an html file
   final VFSContainer root = cp.getRootDir();
   final VFSLeaf htmlFile = root.createChildLeaf(newId + ".html");
   newPage.setFile(htmlFile);
   updatePage(newPage);
   return newId;
 }
コード例 #2
0
  protected CPTreeController(
      final UserRequest ureq, final WindowControl control, final ContentPackage cp) {
    super(ureq, control);
    contentVC = createVelocityContainer("treeView");

    this.cp = cp;

    final String rootTitle = cp.getFirstOrganizationInManifest().getTitle();
    final CPManager cpMgm = CPManager.getInstance();
    treeModel = cpMgm.getTreeDataModel(cp);
    treeCtr = new TreeController(ureq, control, rootTitle, treeModel, null);
    treeCtr.setTreeInlineEditing(true, null, null);

    // do not sort jsTree (structure is given by manifest)
    treeCtr.setTreeSorting(false, false, false);
    listenTo(treeCtr);

    setLinks();
    contentVC.put("cptreecontroller.tree", treeCtr.getInitialComponent());

    putInitialPanel(contentVC);
  }