Tabnine Logo
BlogPost
Code IndexAdd Tabnine to your IDE (free)

How to use
BlogPost
in
com.atlassian.confluence.pages

Best Java code snippets using com.atlassian.confluence.pages.BlogPost (Showing top 12 results out of 315)

origin: com.atlassian.confluence.plugin/func-test

  @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;
  }
}
origin: com.atlassian.confluence.extra.webdav/webdav-plugin

protected byte[] getTextContentAsBytes(String encoding) throws UnsupportedEncodingException {
  return getBlogPost().getBodyContent().getBody().getBytes(encoding);
}
origin: org.randombits.support/support-confluence

  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;
  }
}
origin: com.atlassian.confluence.extra.webdav/webdav-plugin

.append('/').append(blogPost.getPostingDayOfMonth())
.append('/').append(blogPost.getTitle()).append(DISPLAY_NAME_SUFFIX);
origin: com.atlassian.confluence.plugins/confluence-advanced-macros

@SuppressWarnings("unused")
public Message getFormattedDate() {
  return friendlyDateFormatter.getFormatMessage(post.getCreationDate());
}
origin: com.atlassian.confluence.extra.webdav/webdav-plugin

  public String getDisplayName() {
    return getBlogPost().getTitle() + DISPLAY_NAME_SUFFIX;
  }
}
origin: com.atlassian.confluence.extra/confluence-flyingpdf-plugin

@Override
public Document buildHtml(BlogPost blogPost) throws ImportExportException {
  List<String> pageHtml = ImmutableList.of(renderToHtml(blogPost, null));
  LinkFixer linkFixer = new LinkFixer(blogPost.getSpace().getKey(),
      settingsManager.getGlobalSettings().getBaseUrl(), ANCHOR);
  return buildHtml(pageHtml, blogPost.getSpace(),
      DecorationPolicy.none(), new TocBuilder(), new BookmarksBuilder(), linkFixer);
}
origin: com.atlassian.confluence.plugins/confluence-advanced-macros

/**
 * Returns the content for a particular BlogPost, based on what content setting the user has specified (titles, excerpts or entire)
 *
 * @param post        the BlogPost
 * @param contentType the content type to be returned
 * @return the content of the BlogPost
 */
private String getContent(BlogPost post, String contentType) {
  String excerpt;
  if (CONTENT_EXCERPTS.equals(contentType)) {
    excerpt = excerptHelper.getExcerpt(post);
    // If page does not have an excerpt macro declared than calculate one manually from the whole body
    if (StringUtils.isBlank(excerpt)) {
      excerpt = excerptHelper.getText(post.getBodyAsString());
      // CONFDEV-3633
      // the excerptHelper returns element contents. If the element contained a CDATA with further markup
      // (e.g. in the case of a code macro showing XML code) then the excerpt will appear to contain
      // markup. Encode it.
      if (excerpt.length() > EXCERPT_LENGTH) {
        excerpt = GeneralUtil.htmlEncode(TextUtils.trimToEndingChar(excerpt, EXCERPT_LENGTH)) + "&hellip;";
      } else {
        excerpt = GeneralUtil.htmlEncode(excerpt);
      }
      return excerpt;
    }
  } else {
    excerpt = post.getBodyAsString();
  }
  return excerpt;
}
origin: com.atlassian.confluence.plugin/func-test

public String getBlogPostId(
    final String authenticationToken,
    final String spaceKey,
    final String title,
    final Date day) throws RemoteException {
  final Calendar _day;
  final BlogPost blogPost;
  if (StringUtils.isBlank(spaceKey))
    throw new RemoteException("Space key not specified.");
  if (StringUtils.isBlank(title))
    throw new RemoteException("Blog post title not specified.");
  if (null == day)
    throw new RemoteException("Blog post publish date not specified.");
  _day = Calendar.getInstance(getUserTimeZone());
  _day.setTime(day);
  blogPost = getPageManager().getBlogPost(spaceKey, title, _day);
  return (null != blogPost && getPermissionManager().hasPermission(AuthenticatedUserThreadLocal.getUser(), Permission.VIEW, blogPost))
      ? blogPost.getIdAsString()
      : null;
}
origin: com.atlassian.confluence.plugins/confluence-advanced-macros

getText(
    "blogposts.error.already-included-page",
    StringEscapeUtils.escapeHtml4(blogPost.getDisplayTitle())
origin: com.atlassian.confluence.extra.webdav/webdav-plugin

protected long getCreationtTime() {
  return getBlogPost().getCreationDate().getTime();
}
origin: com.atlassian.confluence.extra.usage/usage-tracking-plugin

eventSpace = ((BlogPostEvent) e).getBlogPost().getSpace();
com.atlassian.confluence.pagesBlogPost

Most used methods

  • getCreationDate
  • getTitle
  • getBodyAsString
  • getSpace
  • getBodyContent
  • getCreatorName
  • getDatePath
  • getDisplayTitle
  • getIdAsString
  • getLastModificationDate
  • getPostingCalendarDate
  • getPostingDayOfMonth
  • getPostingCalendarDate,
  • getPostingDayOfMonth,
  • getPostingMonthNumeric,
  • getPostingYear,
  • getSpaceKey,
  • getVersion,
  • toDatePath

Popular in Java

  • Reading from database using SQL prepared statement
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • runOnUiThread (Activity)
  • getSharedPreferences (Context)
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • ResourceBundle (java.util)
    ResourceBundle is an abstract class which is the superclass of classes which provide Locale-specifi
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now