// /username/datestring
// /username/pagelink
// /username/pagelink/datestring
// /username/pagelink/anchor (specific entry)
// /username/pagelink/datestring/anchor (specific entry)
Roller roller = RollerFactory.getRoller();
UserManager userMgr = roller.getUserManager();
mWebsite = userMgr.getWebsiteByHandle(pathInfo[0]);
if (mWebsite != null)
{
if ( pathInfo.length == 1 )
{
// we have the /username form of URL
mPage = mWebsite.getDefaultPage();
}
else if ( pathInfo.length == 2 )
{
mDate = parseDate(pathInfo[1]);
if ( mDate == null ) // pre-jdk1.4 --> || mDate.getYear() <= 70 )
{
// we have the /username/pagelink form of URL
mPageLink = pathInfo[1];
mPage = mWebsite.getPageByLink(pathInfo[1]);
}
else
{
// we have the /username/datestring form of URL
mDateString = pathInfo[1];
mPage = mWebsite.getDefaultPage();
if (pathInfo[1].length() == 8) {
mIsDaySpecified = true;
} else {
mIsMonthSpecified = true;
}
}
}
else if ( pathInfo.length == 3 )
{
mPageLink = pathInfo[1];
mPage = mWebsite.getPageByLink(pathInfo[1]);
mDate = parseDate(pathInfo[2]);
if ( mDate == null ) // pre-jdk1.4 --> || mDate.getYear() <= 70 )
{
// we have the /username/pagelink/anchor form of URL
try
{
WeblogManager weblogMgr = roller.getWeblogManager();
mWeblogEntry = weblogMgr.getWeblogEntryByAnchor(
mWebsite, pathInfo[2]);
}
catch (Exception e)
{