Question

I'm trying to retrieve a WikiPage from Connections using the Social Business Toolkit and then update the contents.

I'm using a custom ConnectionsBasicEndpoint.

WikiService ws = new WikiService(connectionsEndpoint);

WikiPage wp = ws.getWikiPage("Wd1***************", "4e0*****************", null);
System.out.println("wp: " + wp.getTitle());
System.out.println("wp: " + wp.getContent());

getTitle() works fine, but getContent() throws this error:

Error 500: java.lang.RuntimeException: java.lang.ClassCastException: org.apache.http.conn.EofSensorInputStream incompatible with java.lang.String

When trying to create a WikiPage, the setContent() doesn't seem to do anything.

String contents = "<div><p dir=\"ltr\"> Lorem Ipsum</p></div>";
WikiPage wp = new WikiPage();
wp.setSummary("Lorem");
wp.setContent(contents);
ws.createWikiPage("Wd1***************", wp, null);

The Wiki Page gets created, but is still empty. When I inspect the request using Fiddler, the content tag is empty:

<content type="text/html" src="https://connections.******.nl/wikis/basic/api/wiki/04e******************/page/65d***********************/media?convertTo=html" xmlns="http://www.w3.org/2005/Atom"></content>

When I first retrieve a WikiPage and then (without modifications) update it again, the contents of the page gets cleared.

If this is a bug I'll report it on Github, but first I want to make sure I'm not missing anything.

Was it helpful?

Solution

I have reported this as a bug on GitHub.

https://github.com/OpenNTF/SocialSDK/issues/1504

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top