Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create plugin that shares the collab mgr session id and metadata about selected element(s) in a Capella model #1

Open
6 tasks done
jamilraichouni opened this issue Mar 1, 2024 · 9 comments
Assignees

Comments

@jamilraichouni
Copy link
Collaborator

jamilraichouni commented Mar 1, 2024

The idea is to create an addon (deployable .jar that can be put into the dropins folder of a Capella installation).

Requirements:

R1
The plugin shall automatically be activated when Capella starts

R2
When the plugin has been activated, it shall identify the Capella Collaboration Manager session id once.

Comment: The Capella Collaboration Manager session id will be provided as environment variable CAPELLACOLLAB_SESSION_ID as documented here.

R3
The plugin shall run a timer with a frequency of 500 ms

R4
When the timer runs a loop, the plugin shall determine the (list of) selected element(s) and information about the corresponding Capella model (project)

R5
When the timer runs a loop and the selection of elements differs from the previous loop, the plugin shall send (HTTP POST request) the following data:

[
    {
        "element_uuid": "...",
        "element_name": "...",
        "model_uuid": "...",
        "model_path": "..."
    }
]

R6
The plugin shall send the data to a network host that will be specified in the environment variable SELECTED_ELEMENTS_SERVICE_TARGET_URL. The endpoint will accept a parameter named capellacollab_session_id.

Comment: The HTTP POST request will be sent to https://host/endpoint?capellacollab_session_id=(...)

Implementation status:

  • R1
  • R2
  • R3
  • R4
  • R5
  • R6
@jamilraichouni
Copy link
Collaborator Author

This issue is related to: DSD-DBS/capella-collab-manager#1016

@jamilraichouni jamilraichouni self-assigned this Mar 3, 2024
@jamilraichouni
Copy link
Collaborator Author

Hi @MoritzWeber0,

I think a better structure for the JSON data is an array of selected elements:

[
    {
        "uuid": "{uuid_of_element}",
        "name": "{name_of_selected_element}",
        "model_uuid": "{uuid_of_model}",
        "model_path": "{path_to_model_relative_to_workspace}"
    }
]

That is simple and clear (also in the needed Java code)

@MoritzWeber0
Copy link
Member

Hi @MoritzWeber0,

I think a better structure for the JSON data is an array of selected elements:

[
    {
        "uuid": "{uuid_of_element}",
        "name": "{name_of_selected_element}",
        "model_uuid": "{uuid_of_model}",
        "model_path": "{path_to_model_relative_to_workspace}"
    }
]

That is simple and clear (also in the needed Java code)

This structure of also fine for me.

@jamilraichouni
Copy link
Collaborator Author

jamilraichouni commented Mar 3, 2024

Ah, well. Now I forgot about the collab manager session id :-)
Sorry. Another proposal:

{
    "collab_manager_session_id": "...",
    "selected_model_elements": [
        {
            "uuid": "...",
            "name": "...",
            "model_uuid": "...",
            "model_path": "..."
        }
    ]
}

The model meta data will be provided per selected element, because it is possible to select multiple elements across multiple models:

image

@MoritzWeber0
Copy link
Member

Ah, well. Now I forgot about the collab manager session id :-)
Sorry. Another proposal:

{
    "collab_manager_session_id": "...",
    "selected_model_elements": [
        {
            "uuid": "...",
            "name": "...",
            "model_uuid": "...",
            "model_path": "..."
        }
    ]
}

The model meta data will be provided per selected element, because it is possible to select multiple elements across multiple models:

image

We don't need the session id in the request body. It's a path parameter in the request URL.

@jamilraichouni
Copy link
Collaborator Author

jamilraichouni commented Mar 3, 2024

Alright. Can we introduce another environment variable named SELECTED_ELEMENTS_SHARE_SERVICE_TARGET_URL?

@jamilraichouni jamilraichouni changed the title Create plugin that broadcasts the collab mgr session id and metadata about selected element(s) in a Capella model Create plugin that shares the collab mgr session id and metadata about selected element(s) in a Capella model Mar 3, 2024
@MoritzWeber0
Copy link
Member

SELECTED_ELEMENTS_SHARE_SERVICE_TARGET_URL

What would be a possible value of it? The full URL to the Collaboration Manager API endpoint where you have to send the payload to? This would be possible.

@jamilraichouni
Copy link
Collaborator Author

Yes, full URL with a path parameter or anything that expects the collab mgr session id which I read from the containers env var and set before sending the HTTP request.

@jamilraichouni
Copy link
Collaborator Author

SELECTED_ELEMENTS_SHARE_SERVICE_TARGET_URL

Want to rename this to SELECTED_ELEMENTS_SERVICE_TARGET_URL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants