Problems of Product Life Cycle Management [message #1791223] |
Tue, 26 June 2018 04:01  |
Eclipse User |
|
|
|
Hi,
I want to implement Product Life Cycle Management as descripted in https://www.eclipse.org/sirius/doc/developer/integration-plm.html. but I have some problems about it.
1. When I implement the interface IPermissionAuthority, I fond the parameter of method canCreateIn is DViewSpec, it is the representation canbe created. But my requirement is: user only can create one diagram for one element. From the parameter, I don't know the does the element has representation. So how to implement it?
2. How to implement IPermissionProvider::provides method? I know I can return true directly, but I don't know is it the correct implement way.
3. For delete and rename operations, I already forbid them in my PermissionAuthority, and it is disable in right-click menu. But user also can delete or rename the representation by delete and F2 button in the keyboard. I check the source code found, DeleteActionHandler and RenameActionHandler never check the enable of the Action. So how to forbid them in my PermissionAuthority?
Thank you very much.
|
|
|
Re: Problems of Product Life Cycle Management [message #1791348 is a reply to message #1791223] |
Thu, 28 June 2018 05:38  |
Eclipse User |
|
|
|
Hello
1. Indeed you have no other information that the container of the element you may create. Nevertheless, you can implement the precondition on the DiagramDescription.
self variable is your smeantic object os you can use a service that will search in the model if there is already an existing diagram for this semantic object.
Below a peace of code to help you implement your service
SiriusReferenceFinder srf = SiriusReferenceFinder.of(semanticObject);
srf.getImpactedRepresentationDescriptors(semanticObject,..)
2. Returning true to IPermissionProvider::provides is a correct implementation in the case you want your own PermissionAuthority to manage the lock of the objects. But you may have some cases where you would not and then implement that logic in IPermissionProvider::provides
3. Indeed, PermissionAuthority will not be check in advance using delete and F2 button in the keyboard. Then the delete or rename action is possible but will fail afterwards when PermissionAuthority is asked. I invite you to open a bugzilla. https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Sirius
regards
Laurent
|
|
|
Powered by
FUDForum. Page generated in 0.13335 seconds