tiagobento opened a new issue, #783:
URL: https://github.com/apache/incubator-kie-issues/issues/783

   The Apache KIE Editors have been relying on the "Resource Content API" from 
`@kie-tools/workspace` from the start. We have several use cases for this that 
range from DMN Included Models to Serverless Workflow's `spec` directories.
   
   Until now, each Editor has come up with its own rules that define how paths 
should be:
   1.  sent around the "wire" (between Channel and Envelopes)
   2. serialized in files
   3. interpreted by requests such as `kogitoWorkspace_openFile`.
   
   This has become somewhat unmanageable, because as the relationship between 
Editors tightens, different components may have different expectations when it 
comes to paths. This leads to maintenance/debugging hell and ultimately, 
frustation and a lot of time spent.
   
   This issues aims to address this problem by creating a convention that ALL 
Apache KIE Editors follow. Here's my proposal:
   
   1. Envelopes that communicate with Channels using the "Resource Content API" 
must always talk in terms of "paths relative to the workspace root". Whatever 
"workspace root" is. This is up to the Channel to decide, and Envelope's should 
not care about that. This includes requests such as `kogitoWorkspace_openFile`, 
but also `kogitoEditor_contentChanged` (sometimes referred to as `setContent` 
as well) and of course `kogitoWorkspace_resourceContentRequest` and 
`kogitoWorkspace_resourceListRequest`.
   2. Editor components and files should always serialize paths as relative to 
its own directory, using the `./` and `../` notations at the start. This 
removes ambiguity as to where those paths are relative to and remove the need 
to define a "workspace root" in every context that interacts with this file.
   3. How channels treat their paths in storage/git is not in scope here.
   4. How paths are displayed on the screen is not in scope here, as different 
Editors may have different needs.
   5. Editor envelopes will know the `workspaceRootAbsolutePath` through the 
`EditorInitArgs` object that is sent as argument to `kogitoEditor_initRequest`
   
   
   ---
   
   
   This spreadsheet tries to summarize all the use-cases involving paths in all 
Apache KIE Editors. It is a live spreadsheet and will be updated as work on 
this front progresses.
   
   
https://docs.google.com/spreadsheets/d/1XZLP7Zt-1QpQqOrUOTW0SDU-SHUFoDMIp-g4k1ZeCZw/edit#gid=0
   
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to