Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Content type "blog post" #12

Open
mzeis opened this issue Aug 14, 2024 · 3 comments
Open

Content type "blog post" #12

mzeis opened this issue Aug 14, 2024 · 3 comments
Assignees

Comments

@mzeis
Copy link

mzeis commented Aug 14, 2024

Hi, first: thank you a lot for providing this package!

I was wondering if you would accept a PR for adding the ability to create blog posts?

From a quick test, I could post a blog to Confluence Cloud by creating a class \CloudPlayDev\ConfluenceClient\Entity\ContentBlogPost which extends \CloudPlayDev\ConfluenceClient\Entity\AbstractContent defining a $type "blogpost" and extending the existing code which works with ContentPage and ContentComment classes so that is also can handle blog posts.

Example usage code:

$confluenceClient = new ConfluenceClient($confluenceHost);
$confluenceClient->authenticateBasicAuth($confluenceUser, $confluenceToken);

$post = new ContentBlogPost();
$post->setSpace($space);
$post->setTitle($title);
$post->setContent($content);

$result = $confluenceClient->content()->create($post);
@astepin
Copy link
Contributor

astepin commented Sep 15, 2024

Hi @mzeis,

I am glad that this package has been helpful to you.

I would be happy if we could work on the BlogPost topic.
The body of a blog can have two types of content: BlogPostBodyWrite, BlogPostNestedBodyWrite. We should take these into account.

AbstractContent has properties like Children, Ancestors which I don't think a BlogPost has.

Maybe you can make a draft and we can see together what we can make of it.

@mzeis
Copy link
Author

mzeis commented Sep 16, 2024

Hi @astepin,

thank you for your response and detailing the next steps.

To get things working, I created an internal fork with the mentioned changes, and this works for creating our type of blog post. I'll try to find time to create a draft for a proper integration - I cannot promise anything on the timeframe, unfortunately.

Besides the mentioning of BlogPostBodyWrite and BlogPostNestedBodyWrite in the API, do you know of any more information from Atlassian for the concepts / usage etc. that would help us here?

@astepin
Copy link
Contributor

astepin commented Sep 16, 2024

I don't really know the exact background and concepts behind the blogs yet. I haven't used this type of content yet. I'll probably have to catch up on that.

There is also the normal content that you can create with the “blogpost” type. But apparently there is also a separate API just for blogposts. You have to check that first.

The blogpost API is also only available in v2.

https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-blog-post/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants