public class ShareModuleCommand extends EditModuleCommand
The module is required to exist before this command is executed. If the module is to be created, use a CreateModuleCommand
instance
instead.
Executing this command requires the module to be open in the DOORS client in share mode. This command is only applicable to modules in which
editable sections have been defined. A lock will be requested on the underlying object modified by fragments. The default strategy is that the
command fails if such lock cannot be acquired (either because another user currently owns the lock or no shared section includes the object). In
case the lock cannot be acquired because the object is not defined in an editable section, the
NoEditableSectionStrategy.SWITCH_TO_EDIT
can be used to automatically switch the command to run in exclusive edit, if possible.
Note that a module structure (types and attributes) cannot be updated in share mode.
Refer to EditModuleCommand
for detailed documentation and code snippet.
This class is not intended to be subclassed by clients but may be instantiated.
CommandRunner
,
ShareModuleFragment
Modifier and Type | Class and Description |
---|---|
static class |
ShareModuleCommand.NoEditableSectionStrategy
Determines the strategy to apply when one object to be modified cannot be locked
because it is not defined in an editable section
|
EditModuleCommand.TerminationMode
Constructor and Description |
---|
ShareModuleCommand(ModuleRef module,
EditModuleCommand.TerminationMode terminationMode)
Instantiates a command to edit in share mode a module and modify its content.
|
ShareModuleCommand(ModuleRef module,
EditModuleCommand.TerminationMode terminationMode,
ShareModuleCommand.NoEditableSectionStrategy strategy)
Instantiates a command to edit in share mode a module and modify its content.
|
Modifier and Type | Method and Description |
---|---|
void |
add(EditModuleFragment fragment)
Adds a new fragment in the command, to create or modify a portion of the module.
|
remove
run
public ShareModuleCommand(ModuleRef module, EditModuleCommand.TerminationMode terminationMode)
The command will fail if one object to be modified cannot be locked because it is not defined in an editable section. Use the
ShareModuleCommand(ModuleRef, TerminationMode, NoEditableSectionStrategy)
constructor if a different strategy is to be used.
module
- the module to be edited. The module must already exist by the time the command is executed.
The command will open the module in share mode.terminationMode
- determines the behavior of the command when it successfully completes.ShareModuleCommand(ModuleRef, EditModuleCommand.TerminationMode, ShareModuleCommand.NoEditableSectionStrategy)
public ShareModuleCommand(ModuleRef module, EditModuleCommand.TerminationMode terminationMode, ShareModuleCommand.NoEditableSectionStrategy strategy)
module
- the module to be edited. The module must already exist by the time the command is executed.
The command will open the module in share mode.terminationMode
- determines the behavior of the command when it successfully completes.strategy
- the strategy to apply when one object to be modified cannot be locked
because it is not defined in an editable section.public void add(EditModuleFragment fragment)
add
in class EditModuleCommand
fragment
- the fragment to execute to either create, modify or delete information in the module.
This fragment must implement ShareModuleFragment
.IllegalArgumentException
- if the fragment does not implement ShareModuleFragment
.ShareModuleFragment