public WikiPageRequest(DatabaseWiki wiki, RequestURL url) throws org.dbwiki.exception.WikiException {
super(wiki, url);
DatabaseIdentifier wikiIdentifier = new DatabaseIdentifier(wiki.identifier().databaseHomepage() + "/" + RequestURL.WikiPageRequestPrefix);
if (url.size() == 0) {
_wri = new WRI(wikiIdentifier, new PageIdentifier());
} else if (url.size() == 1) {
long timestamp = -1;
RequestParameter timestampParameter =
url.parameters().get(RequestParameter.ParameterVersion);
if(timestampParameter != null) {
timestamp = Long.parseLong(timestampParameter.value());
}
_wri = new WRI(wikiIdentifier, new PageIdentifier(url.get(0).encodedText(), timestamp));
} else {
throw new WikiNodeException(WikiNodeException.InvalidIdentifierFormat, url.toString());
}
}