// if this is a new htmlpage and there is already an identifier with
// this uri, return
if (!InodeUtils.isSet(existingHTMLPage.getInode()) && InodeUtils.isSet(testIdentifier.getInode())) {
existingHTMLPage.setParent(parentFolder.getInode());
SessionMessages.add(httpReq, "error", "message.htmlpage.error.htmlpage.exists");
throw new ActionException("Another page with the same page url exists in this folder");
}
// if this is an existing htmlpage and there is already an identifier
// with this uri, return
else if (InodeUtils.isSet(existingHTMLPage.getInode()) && (!testIdentifier.getInode().equalsIgnoreCase(identifier.getInode()))
&& InodeUtils.isSet(testIdentifier.getInode())) {
SessionMessages.add(httpReq, "error", "message.htmlpage.error.htmlpage.exists");
// when there is an error saving should unlock working asset
WebAssetFactory.unLockAsset(existingHTMLPage);
throw new ActionException("Another page with the same page url exists in this folder");
}
if (UtilMethods.isSet(template)) {
newHtmlPage.setTemplateId(templateIdentifier.getInode());
}