Last night I tried in vain to use the remote API in Jive Forums 5.5.19 to move a Forum to a different Category.
In the Jive Web Services Developer Guide the Forum Service has a moveForums method that takes to long IDs:
There is another method to "mergeForums()" and I'm using that just fine.
moveForums( F, C) ... Jive throws an exception from "Forum F is not in category C"....
Yeah, I know that, that's the category I want to move it to...so, move it!
The category does exist. If I try a category for C that does not, I get an (expected) error that the category is not found.
Exception in thread "main" org.codehaus.xfire.XFireRuntimeException: Could not invoke service.. Nested exception is org.codehaus.xfire.fault.XFireFault: Forum 1686 is not in category 262
org.codehaus.xfire.fault.XFireFault: Forum 1686 is not in category 262
at org.codehaus.xfire.fault.Soap11FaultSerializer.readMessage(Soap11FaultSerializer.java:31)
at org.codehaus.xfire.fault.SoapFaultSerializer.readMessage(SoapFaultSerializer.java:28)
at org.codehaus.xfire.soap.handler.ReadHeadersHandler.checkForFault(ReadHeadersHandler.java:111)
at org.codehaus.xfire.soap.handler.ReadHeadersHandler.invoke(ReadHeadersHandler.java:67)
at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
at org.codehaus.xfire.client.Client.onReceive(Client.java:382)
at org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.java:139)
at org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel.java:48)
at org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26)
at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:75)
at org.codehaus.xfire.client.Client.invoke(Client.java:335)
at org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77)
at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57)
at $Proxy4.moveForums(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.jivesoftware.forum.webservices.ServiceLocator$ExceptionHandler.invoke(ServiceLocator.java:381)
at $Proxy4.moveForums(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.jivesoftware.forum.webservices.ServiceLocator$CacheHandler.invoke(ServiceLocator.java:522)
at $Proxy5.moveForums(Unknown Source)
For fun, I also tried changing the order of the arguments - moveForums( C, F)... Jive says "Forum C not found", totally expected that.
As a workaround, I tried to just get the Forum f, set the category ID manually with f. setCategory(C) and then forumSvc.updateForum(f).
That works great for setting the name (i.e. to rename the forum), but oddly, it fails with the exact same stack track as above.
import com.jivesoftware.forum.webservices
ForumService forumSvc; // injected and known to work for mergeForums(id,id)
// Fails as described above...
forumSvc.moveForums( forumID, catID);
// Fails to actually update the forum
Forum f = forumSvc.getForum((long)forumID);
Long oldCatID = f.getCategoryID();
f.setCategoryID(destinationCategoryID);
forumSvc.updateForum(f);
I'm bummed. I have thousands of forums (yes, really, and please don't ask why) that I need to merge and move. Ever tried doing this with a 5,000 item drop-down in the Admin UI? Nah, I'm sure you haven't. Take it from me, it's not pretty. If the remote API "moveForums()" would work as advertised, I'm happy.
I don't know what's going on. Ideas? Anybody at Jive able to have a quick peek at the source for this and/or tell me if this is a known issue that might be fixed in a patch I don't have installed? :-)
-Tim