Package org.olat.modules.wiki

Examples of org.olat.modules.wiki.WikiPage


  /**
   * @see org.olat.core.gui.components.table.TableDataModel#getValueAt(int, int)
   */
  public Object getValueAt(int row, int col) {
    WikiPage page = (WikiPage) objects.get(row);
    switch (col) {
      case 0:
        return String.valueOf(page.getVersion());
      case 1:
        return new Date(page.getModificationTime());
      case 2:
        return String.valueOf(page.getViewCount());
      case 3:
        long key = page.getModifyAuthor();
        return key != 0 ? ManagerFactory.getManager().loadIdentityByKey(Long.valueOf(page.getModifyAuthor())).getName() :"n/a";
        //TODO:gs:a loadIdenitiesByKeys(List keys) would be much more performant as each lookup get one database lookup
      case 4:
        int v = page.getVersion();
        if(v == 0) return new String("");
        return String.valueOf(v-1) + " " +trans.translate("to") + " " + String.valueOf(v);
      case 5:
        return page.getUpdateComment();
      default:
        return "ERROR";
    }
  }
View Full Code Here


    //reset properties files to default values
    VFSContainer wikiCont = (VFSContainer)rootContainer.resolve(WikiManager.WIKI_RESOURCE_FOLDER_NAME);
    List leafs = wikiCont.getItems(new VFSItemSuffixFilter(new String[]{WikiManager.WIKI_PROPERTIES_SUFFIX}));
    for (Iterator iter = leafs.iterator(); iter.hasNext();) {
      VFSLeaf leaf = (VFSLeaf) iter.next();
      WikiPage page = Wiki.assignPropertiesToPage(leaf);
      //reset the copied pages to a the default values
      page.resetCopiedPage();
      WikiManager.getInstance().updateWikiPageProperties(copy, page);
    }
   
    //create folders
    VFSContainer newMediaCont = rootContainer.createChildContainer(WikiContainer.MEDIA_FOLDER_NAME);
View Full Code Here

TOP

Related Classes of org.olat.modules.wiki.WikiPage

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.