I am making the changes to use promise chaining. But to create a post We 
need a blog handle(it is different from blogUuid). So we are just getting 
the handle of first blog in blogs list and adding a post to it.


Thanks.

Rajmeet Singh Bal.
DLSI 3F A161
India Software Lab,
IBM India Pvt Ltd.
Opp. 32nd Milestone, NH-8, 
Sector 30, Gurgoan 
DLF Silokhera
Haryana- 122002
Land Line - 91 124 4134729



From:   Mark Wallace <notifications@github.com>
To:     OpenNTF/SocialSDK <SocialSDK@noreply.github.com>, 
Cc:     Rajmeet S Bal/India/IBM@IBMIN
Date:   10/15/2013 02:16 PM
Subject:        Re: [SocialSDK] Tags and Recommendation APIs (#660)



In 
samples/j2ee/com.ibm.sbt.sample.web/WebContent/samples/js/Social/Blogs/API/RecommendPost.js:
> +require(["sbt/connections/BlogService", "sbt/dom", "sbt/json"], 
> +    function(BlogService, dom, json) {
> +        var blogService = new BlogService(); 
> +        var now = new Date();
> +        var post = blogService.newPost();
> +        post.setTitle("Post at " + now.getTime());
> +        post.setContent("Post Content at " + now.getTime());
> + 
> +              blogService.getBlogs({ ps: 1 }).then(
> +            function(blogs){
> +                if (blogs.length == 0) {
> +                    text = "No Blogs found.";
> +                    dom.setText("content", text);
> +                } else {
> +                        var firstBlogHandle = blogs[0].getHandle();
> + var promise = blogService.createPost(post, firstBlogHandle);

Should we not be creating thr post here and then setting the handle? Id 
the handle the blog uuid?
—
Reply to this email directly or view it on GitHub.