Message from Thomason, Michael <Michael.Thomason@transamerica.com> via eLink<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
Hi everyone,
We have discussions that are used to receive success / failure messages from our automated batch jobs. The number of topics created in any one discussion group gets rather large and the only options for deleting them are at each individual topic. We want to add functionality at the discussion level that would delete all topics and any replies.
What I have done so far is create a WebNodeCmd object and a WebNodeAction script that adds a Delete All Topics entry to the function menu for discussions.
My question is once I'm in the Action script for a discussion node, how do I retrieve a list of the topics that I can loop through and how do I delete them within the loop?
An example from the books from class retrieves a list of DAPI subnodes like this:
___________________________________________________________
function Assoc _SubclassExecute( \
Object webNode, \
Record request )
Assoc response = ._NewResponse()
dynamic node = request.node
dynamic contents = DAPI.ListSubNodes( node)
if length(contents) > 0
response.data.contents= contents
else
response.error.message = "Error deleting topics"
end
return response
end
_______________________________________________________________
and the resulting WebLingo file displays the results.
This example works for nodes such as folders, but for discussion nodes DAPI.ListSubNodes doesn't return anything which makes me think that the topics within the discussion are not DAPI nodes. I've tried debugging and inspecting the webNode object from the function above and I've browsed the DISCUSSION module objects, but I'm not seeing how to retrieve and delete the topics.
Thanks for any help you can provide,
Mike