// calls edit method from super class that returns parent folder
Folder parentFolder = super._editWebAsset(req, res, config, form, user, WebKeys.HTMLPAGE_EDIT);
// setting parent folder path and inode on the form bean
HTMLPageForm hf = (HTMLPageForm) form;
ActivityLogger.logInfo(this.getClass(), "editing HTMLpage action", "User " + user.getPrimaryKey() + " editing page" + hf.getTitle(), HostUtil.hostNameUtil(req, _getUser(req)));
hf.setSelectedparent(parentFolder.getName());
hf.setParent(parentFolder.getInode());
try {
hf.setSelectedparentPath(APILocator.getIdentifierAPI().find(parentFolder).getPath());
} catch (Exception e) {
Logger.info(this, e.getMessage());
}
// This can't be done on the WebAsset so it needs to be done here.
HTMLPage htmlpage = (HTMLPage) req.getAttribute(WebKeys.HTMLPAGE_EDIT);
htmlpage.setParent(parentFolder.getInode());
// removes the extension .jsp from page url
String pageName = htmlpage.getPageUrl();
if (pageName != null) {
pageName = pageName.replaceAll("." + Config.getStringProperty("VELOCITY_PAGE_EXTENSION"), "");
}
// to remove the page extension on the bean
hf.setPageUrl(pageName);
}