|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcodesimian.DefaultWiki
public class DefaultWiki
This class is the start of a decentralized WIKI where each user of CodeSimian
will have a different version of the WIKI and have many versions of each page and many pages.
PARAMETERS OF THOSE CODESIMIAN COMMANDS:
versionIndex - 0 is oldest, wikiCountPages("somename")-1 is newest,
and any index outside that range returns the newest index
name - a string that is a valid codesimian name
inputPageBytes or returnedPageBytes - convert bytes to string then compile
NEW CODESIMIAN COMMANDS:
wikiCountPages(name) returns quantity of versions of of wiki pages with specific string name
wikiRestoreOldPage(name versionIndex)
wikiGetPage(name versionIndex returnedPageBytes) returns quantity of bytes returned to index 2
use backupIndex wikiCountPages(name)-1 for newest page, 0 for oldest.
wikiNewPage(name inputPageBytes)
same as viewPage except creates a new newest page and pushes all others up 1 index.
wikiGetNewestPage(name returnedPageBytes)
wikiListOfAllPages(when executed fills self with list of all page names)
Stores all wiki files in path: CodeSimian.jar/wiki/
and all the pages whose versionIndex is 5 in CodeSimian.jar/wiki/5/
Or should all versions of X be stored in CodeSimian.jar/wiki/X.zip ?
That would take much less space since all versions of the same page are zipped together.
Each version of the page is named as the System.currentTimeMillis() number
when it was saved.
??? What should I do if some of the old versions are deleted,
making it look like the newest version is the one before the deleted one???
How would I know?
Method Summary | |
---|---|
java.lang.String[] |
allPageNames()
|
int |
countPages(java.lang.String name)
|
java.lang.String |
newestPage(java.lang.String name)
|
boolean |
newPage(java.lang.String name,
ImmutBytes bytes,
Liquid liquidModifyWiki)
requires a certain amount of liquid per byte plus an amount depending on the name |
java.lang.String |
page(java.lang.String name,
int versionIndex)
returns null if file does not exist |
boolean |
restoreOldPage(java.lang.String name,
int versionIndex,
Liquid liquidModifyWiki)
requires a certain amount of liquid depending on the page and version. |
java.lang.String |
rootPath()
returns a path of an inner folder (see InnerFiles.java) that ends with "/", like "wiki/". |
java.lang.String[] |
search(java.lang.String searchForThis,
int targetReturnedArraySize,
Liquid liquidCpuTime)
Returns a list of page names which certainly contain the search text. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public java.lang.String rootPath()
Wiki
rootPath
in interface Wiki
public int countPages(java.lang.String name)
countPages
in interface Wiki
public boolean restoreOldPage(java.lang.String name, int versionIndex, Liquid liquidModifyWiki) throws NeedLiquid
restoreOldPage
in interface Wiki
NeedLiquid
public boolean newPage(java.lang.String name, ImmutBytes bytes, Liquid liquidModifyWiki) throws NeedLiquid
newPage
in interface Wiki
NeedLiquid
public java.lang.String[] allPageNames()
allPageNames
in interface Wiki
public java.lang.String page(java.lang.String name, int versionIndex)
page
in interface Wiki
public java.lang.String newestPage(java.lang.String name)
newestPage
in interface Wiki
public java.lang.String[] search(java.lang.String searchForThis, int targetReturnedArraySize, Liquid liquidCpuTime)
search
in interface Wiki
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |