// Have we been called with an areaName and nodeName request parameter
} else if (areaName != null && nodeName != null) {
log.debug("trying to resolve area name: " + areaName + " and node name: " + nodeName);
// Try to find the area/directory
WikiDirectory area = wikiNodeDAO.findArea(areaName);
if (area != null) {
// Try to find the document
WikiDocument doc = wikiNodeDAO.findWikiDocumentInArea(area.getAreaNumber(), nodeName);
if (doc != null) {
// Found it, let's use that
currentDocument = doc;
// TODO: Avoid cast
currentDirectory = (WikiDirectory)currentDocument.getParent();
} else {
// Didn't find a document for the node name, let's see if it's a directory
currentDirectory = wikiNodeDAO.findWikiDirectoryInArea(area.getAreaNumber(), nodeName);
}
}
// Or have we been called just with an areaName request parameter
} else if (areaName != null) {