{
log.debug("PageLayoutComponentImpl.updateTitles() invoked");
try
{
// retrieve current page or template from page manager
ContentPageImpl contentPageImpl = (ContentPageImpl)contentPage;
BaseFragmentsElement pageOrTemplate = getPageOrTemplate(contentPageImpl.getPageOrTemplate().getPath());
// check for edit permission
pageOrTemplate.checkAccess(JetspeedActions.EDIT);
// update titles and page in page manager
boolean update = false;
if (!Utils.isNull(title))
{
if (!title.equals(pageOrTemplate.getTitle()))
{
pageOrTemplate.setTitle(title);
update = true;
}
}
if (!Utils.isNull(shortTitle))
{
if (!shortTitle.equals(pageOrTemplate.getShortTitle()))
{
pageOrTemplate.setShortTitle(shortTitle);
update = true;
}
}
if (update)
{
updatePage(pageOrTemplate);
}
// update content context
if (!Utils.isNull(title))
{
contentPageImpl.setTitle(title);
}
if (!Utils.isNull(shortTitle))
{
contentPageImpl.setShortTitle(shortTitle);
}
}
catch (Exception e)
{
throw new PageLayoutComponentException("Unexpected exception: "+e, e);