public class EditDiscussionCommand extends CommandWrapper
DOORS compatibility: Discussions are available starting with DOORS 9.0.
Executing this command does not require to open in edit mode the module in the DOORS client. The module must not have any unsaved changes in the DOORS client for this fragment to succeed.
A command to edit discussions on a module is decomposed into multiple fragments, each one modifying a different portion of the data: one to create a discussion on an object, one to close a discussion on the module itself, another to add a comment, etc.
Below is a snippet illustrating how to use this command (see CommandRunner
for a full snippet and EditDiscussionFragment
subclasses for details):
ModuleRef module = ModuleRef.qualifiedName("/MyFolder/MyModule"); EditDiscussionCommand command = new EditDiscussionCommand(module); // create a new discussion on the module String summary = "My Summary" String firstComment = "My Initial Comment"; command.add(new CreateDiscussionFragment(summary, firstComment)); // add a comment on an existing discussion DiscussionRef discussion = DiscussionRef.summaryAndCreator("My Existing Discussion", "myUser"); String text = "A new comment added to an existing discussion"; command.add(new CreateCommentFragment(discussion, text)); myCommandRunner.run(command);
This class is not intended to be subclassed by clients but may be instantiated.
CommandRunner
,
EditDiscussionFragment
Constructor and Description |
---|
EditDiscussionCommand(ModuleRef module)
Instantiates a command to edit discussions in a module.
|
Modifier and Type | Method and Description |
---|---|
void |
add(EditDiscussionFragment fragment)
Adds a new fragment in the command, to create or modify a discussion.
|
void |
remove(EditDiscussionFragment fragment)
Removes a fragment previously registered to this command.
|
run
public EditDiscussionCommand(ModuleRef module)
module
- the module whose discussions are to be updated.public void add(EditDiscussionFragment fragment)
fragment
- the fragment to execute to either create, modify or delete a discussion.public final void remove(EditDiscussionFragment fragment)
fragment
- the fragment to remove.