if (permalinks.invalidPagePermalinkFormat(permalink)) {
ret.put(Keys.STATUS_CODE,
StatusCodes.ADD_PAGE_FAIL_INVALID_PERMALINK_FORMAT);
throw new PermalinkException("Add page fail, caused by invalid permalink format["
+ ret + "]");
}
if (permalinks.exist(permalink)) {
ret.put(Keys.STATUS_CODE,
StatusCodes.ADD_PAGE_FAIL_DUPLICATED_PERMALINK);
throw new PermalinkException("Add page fail, caused by duplicated permalink["
+ permalink + "]");
}
page.put(Page.PAGE_PERMALINK, permalink);
pageRepository.update(pageId, page);