BaseFragmentsElement pageOrTemplate = getPageOrTemplate(contentPageImpl.getPageOrTemplate().getPath());
BasePageElement page = ((pageOrTemplate instanceof BasePageElement) ? (BasePageElement)pageOrTemplate : null);
Folder folder = (Folder)pageOrTemplate.getParent();
// check for edit permission
folder.checkAccess(JetspeedActions.EDIT);
// construct new sibling page template
String newPageTemplatePath = folder.getPath()+(folder.getPath().endsWith(Folder.PATH_SEPARATOR) ? "" : Folder.PATH_SEPARATOR)+templateName+PageTemplate.DOCUMENT_TYPE;
if (pageManager.pageTemplateExists(newPageTemplatePath))
{