public String getDisplayName() { return getBlogPost().getTitle() + DISPLAY_NAME_SUFFIX; } }
private StringBuilder getContentEntityWikiLink( ContentEntityObject content, PageContext ctx ) { StringBuilder buff = new StringBuilder(); if ( content instanceof SpaceContentEntityObject ) { SpaceContentEntityObject spaceContent = (SpaceContentEntityObject) content; if ( !StringUtils.equals( spaceContent.getSpaceKey(), ctx.getSpaceKey() ) ) buff.append( spaceContent.getSpaceKey() ).append( ":" ); if ( content instanceof Page ) { Page page = (Page) content; buff.append( page.getTitle() ); } else if ( content instanceof BlogPost ) { BlogPost blogPost = (BlogPost) content; buff.append( blogPost.getDatePath() ).append( "/" ).append( blogPost.getTitle() ); } else { buff.append( "$" ).append( content.getIdAsString() ); } } else if ( content instanceof PersonalInformation ) { buff.append( "~" ).append( ( (PersonalInformation) content ).getUsername() ); } else { buff.append( "$" ).append( content.getIdAsString() ); } return buff; } }
@Override public Map<String, ?> getBlogPost(String authenticationToken, String id) { Map<String, Object> postStructure = null; BlogPost post = getPageManager().getBlogPost(Long.parseLong(id)); if (null != post && permissionManager.hasPermission(AuthenticatedUserThreadLocal.getUser(), Permission.VIEW, post)) { postStructure = new Hashtable<String, Object>(); postStructure.put("id", post.getIdAsString()); postStructure.put("spaceKey", post.getSpaceKey()); postStructure.put("title", post.getTitle()); postStructure.put("version", post.getVersion()); postStructure.put("content", post.getBodyAsString()); if (StringUtils.isNotBlank(post.getCreatorName())) postStructure.put("creator", post.getCreatorName()); postStructure.put("created", post.getCreationDate()); } return postStructure; } }
childResourcePathBuffer.append(parentPath) .append('/').append(blogPost.getPostingDayOfMonth()) .append('/').append(blogPost.getTitle()).append(DISPLAY_NAME_SUFFIX);