private void doExecuteSetContentHomeCommand(final SetContentHomeCommand command) { Preconditions.checkNotNull(command.getSetter(), "setter cannot be null"); Preconditions.checkNotNull(command.getContent(), "content to set home for cannot be null"); Preconditions.checkNotNull(command.getSection(), "section to set home to cannot be null"); final UserEntity setter = doResolveUser(command.getSetter(), "setter"); final ContentEntity content = contentDao.findByKey(command.getContent()); final MenuItemEntity section = doResolveSection(command.getSection()); final CategoryAccessResolver categoryAccessResolver = new CategoryAccessResolver(groupDao); if (!categoryAccessResolver.hasApproveContentAccess(setter, content.getCategory())) { throw new CategoryAccessException( "Cannot set content home", setter.getQualifiedName(), CategoryAccessType.APPROVE, content.getCategory().getKey()); } PageTemplateEntity pageTemplate = null; if (command.getPageTemplate() != null) { pageTemplate = pageTemplateDao.findByKey(command.getPageTemplate().toInt()); } doSetContentHome(content, section, pageTemplate); }