SlideShare a Scribd company logo
ZERO TO ONE:
How to integrate a graphical editor in a cloud IDE
Stéphane Bégaudeau
Sirius Web Architect
stephane.begaudeau@obeo.fr | sbegaudeau
Axel Richard
Web & Modeling Consultant
axel.richard@obeo.fr | @_axelrichard_
Sirius Web
■ Everything you liked in Sirius Desktop, available on a modern cloud-based stack
■ Graphical and Domain specific tooling
■ Defined by a configuration file
■ Deployed on a web server
■ Rendered in a web browser
■ Collaborative support
https://www.eclipse.org/sirius/sirius-web.html
What’s in Sirius Web?
READY-TO-USE
Modeling framework
to define and render
graphical applications
in the web
What’s in Sirius Web?
READY-TO-USE
Modeling framework
to define and render
graphical applications
in the web MODEL SERVER
Open source model
server components
with a GraphQL API
What’s in Sirius Web?
READY-TO-USE
Modeling framework
to define and render
graphical applications
in the web MODEL SERVER
MODEL APPLICATION
Open source model
application (diagram,
properties, forms…)
Open source model
server components
with a GraphQL API
Built on top of awesome technologies
Obeo Cloud Platform
■ All of Sirius Web with additional collaborative and access control features
■ Authentication and authorization
■ Public/Private projects
■ Role based access control
■ Indicators of active users
https://www.obeosoft.com/en/products/obeo-studio
Completely customizable
■ Configure Sirius Web and OCP with the concepts from your domain
■ Define the graphical representation that you need
■ Diagrams
■ Tools
■ Forms
■ Validation
■ Import existing Sirius desktop configuration easily
Integration in cloud IDEs
MODEL SERVER
Leverage our GraphQL API
over HTTP and WebSocket to
interact with your servers
GRAPHICAL EDITORS
Manipulate your Sirius Web
graphical editors from your
IDE (diagrams, forms, etc)
VS CODE / THEIA
All that packaged as an
extension for VS Code and
Theia
Getting started
■ To start integrating Sirius Web in a cloud IDE, you’ll need
■ The latest release of @eclipse-sirius/sirius-components
■ React components for our graphical editors
■ An instance of a Sirius Web server
■ HTTP and WebSocket GraphQL API
Zero to One : How to Integrate a Graphical Editor in a Cloud IDE (27.10.2021)
Zero to One : How to Integrate a Graphical Editor in a Cloud IDE (27.10.2021)
DEMO
Integration in VS Code
■ TreeViews
■ Servers, projects & representations
■ Model explorer
■ Webview
■ Diagram editor
■ Properties editor
Server TreeView
■ Register new Sirius Web / OCP servers
Server TreeView
■ Register new Sirius Web / OCP servers
Zero to One : How to Integrate a Graphical Editor in a Cloud IDE (27.10.2021)
Node
Node HTML Document
Server TreeView - package.json
"contributes": {
"viewsContainers": {
"activitybar": [
{
"id": "siriusweb-view-container",
"title": "Sirius",
"icon": "images/icon_32.png"
}
]
},
"views": {
"siriusweb-view-container": [
{
"id": "siriusweb.serversView",
"name": "Servers"
},
]
},
…
}
Server TreeView
■ Register tree data provider in extension.ts
■ Implement TreeDataProvider & extend TreeItem
export function activate(context: vscode.ExtensionContext) {
const serversViewProvider = new ServersViewProvider(...);
vscode.window.registerTreeDataProvider('siriusweb.serversView', serversViewProvider);
}
export class ServersViewProvider implements TreeDataProvider<ServerItem> {
…
getChildren(element?: ServerItem): ProviderResult<ServerItem[]> {
...
}
}
export class ServerItem extends TreeItem {
...
}
Server TreeView
■ Perform the authentication to support Obeo Cloud Platform
import axios from 'axios';
private connectToServer(): Promise<boolean> {
const authenticateURL = `${this.serverAddress}/api/authenticate`;
const params = new URLSearchParams({ username: this.username, password: this.password, 'remember-me': 'true' });
return axios
.post(authenticateURL, params.toString())
.then((response) => {
if (response.status !== 200) {
return Promise.reject(false);
} else {
this.cookie = response.headers['set-cookie'][0];
return Promise.resolve(true);
}
})
.catch((error) => {
return Promise.reject(false);
});
}
Project TreeView
■ Used to manipulate Sirius Web / OCP projects
■ Leverage our GraphQL API over HTTP
Project TreeView
■ Retrieve the projects using a GraphQL query
private fetchProjects(): Promise<ProjectData[]> {
const queryURL = `${this.serverAddress}/api/graphql`;
const headers = { headers: { Cookie: this.cookie } };
const graphQLQuery = `
query getProjects($page: Int!) {
viewer {
id
projects(page: $page) {
edges {
node {
id
name
visibility
}
}
}
}
}
`;
Project TreeView
■ Then process the result to display the data in the TreeView
return axios.post(
queryURL,
{
query: graphQLQuery,
variables: { page: 0 },
},
headers
)
.then((response) => {
if (response.status !== 200) {
return Promise.reject([]);
} else {
const projectsData = [];
// Transform response.data into projects
return Promise.resolve(this.projectsData);
}
});
Representations TreeView
■ Same logic as in the previous TreeView
■ GraphQL query over HTTP
■ Updated when the project selected changes
Explorer TreeView
■ Used to display the model elements from the project
■ Based on the configuration of the explorer of the server
■ Can be parameterized
■ Based on a tree representation
■ Using a GraphQL subscription for real time update
■ Based on the graphql-ws protocol
Explorer TreeView
Explorer TreeView
■ When the connection is established, we will send out a start message
■ Used to subscribe to events from a GraphQL subscription
■ It allows us to receive updates in real time
Explorer TreeView
■ After that, we will receive messages for each event
■ Refresh events will be used to give us the new data structure to display
Zero to One : How to Integrate a Graphical Editor in a Cloud IDE (27.10.2021)
VS Code WebView
Zero to One : How to Integrate a Graphical Editor in a Cloud IDE (27.10.2021)
VS Code WebView
public static getWebviewContent(webView: vscode.Webview, webViewContext: WebViewContext): string {
const reactAppPathOnDisk = vscode.Uri.file(path.join(webViewContext.extensionPath, 'siriusweb', 'siriusweb.js'));
const reactAppUri = webView.asWebviewUri(reactAppPathOnDisk);
return `<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>${webViewContext.representationLabel}</title>
<script>
window.acquireVsCodeApi = acquireVsCodeApi;
window.serverAddress = '${webViewContext.serverAddress}';
window.username = '${webViewContext.username}';
window.password = '${webViewContext.password}';
window.editingContextId = '${webViewContext.editingContextId}';
window.representationId = '${webViewContext.representationId}';
window.representationLabel = '${webViewContext.representationLabel}';
window.representationKind = '${webViewContext.representationKind}';
</script>
</head>
<body>
<script src="${reactAppUri}"></script>
</body>
</html>`;
}
VS Code WebView
VS Code WebView
VS Code WebView
import { DiagramWebSocketContainer, PropertiesWebSocketContainer, Selection } from '@eclipse-sirius/sirius-components';
export const App = ({...}: AppProps) => {
let component;
if (representationKind === 'Diagram') {
component = (
<DiagramWebSocketContainer
editingContextId={state.editingContextId}
representationId={state.representationId}
readOnly={false}
selection={state.selection}
setSelection={setSelection}
/>
);
} else {
component = (
<PropertiesWebSocketContainer
editingContextId={state.editingContextId}
readOnly={false}
selection={state.selection}
/>
);
}
}
VS Code WebView
export const App = ({...}: AppProps) => {
useEffect(() => {
fetch(`${serverAddress}/api/authenticate`, {
method: 'POST',
credentials: 'include',
mode: 'cors',
body: new URLSearchParams({ username, password, 'remember-me': 'true' }),
})
.then(() => {
setState((prevState) => {
return { ...prevState, authenticate: true };
});
})
.catch(() => {});
}, []);
}
Zero to One : How to Integrate a Graphical Editor in a Cloud IDE (27.10.2021)
Zero to One : How to Integrate a Graphical Editor in a Cloud IDE (27.10.2021)
Zero to One : How to Integrate a Graphical Editor in a Cloud IDE (27.10.2021)
Zero to One : How to Integrate a Graphical Editor in a Cloud IDE (27.10.2021)
Zero to One : How to Integrate a Graphical Editor in a Cloud IDE (27.10.2021)
Zero to One : How to Integrate a Graphical Editor in a Cloud IDE (27.10.2021)
Zero to One : How to Integrate a Graphical Editor in a Cloud IDE (27.10.2021)
Zero to One : How to Integrate a Graphical Editor in a Cloud IDE (27.10.2021)
Zero to One : How to Integrate a Graphical Editor in a Cloud IDE (27.10.2021)
From VS Code to Theia
Integration in Theia
Integration in Theia
■ Package vscode extension as VSIX file
■ Run vsce from the VSCode extension folder
■ Put the VSIX file created in the Theia extensions folder
■ Run Theia
DEMO
Thank you!

More Related Content

PDF
Keynote: What’s new in Sirius?
Obeo
 
PDF
Put the Power of Cloud-based Modeling to Work - Spotlight Session
Obeo
 
PDF
SiriusCon 2020 - Sirius to the Web with Obeo Cloud Platform
melbats
 
PDF
[SiriusCon 2018] Sirius Roadmap
Obeo
 
PDF
Forge - DevCon 2016: From Desktop to the Cloud with Forge
Autodesk
 
PDF
EclipseCon Fr 2018 - Modeling tools go up to the cloud…
melbats
 
PDF
Forge - DevCon 2016: Drawings! Drawings! Everywhere!
Autodesk
 
PDF
Spring Boot Whirlwind Tour
VMware Tanzu
 
Keynote: What’s new in Sirius?
Obeo
 
Put the Power of Cloud-based Modeling to Work - Spotlight Session
Obeo
 
SiriusCon 2020 - Sirius to the Web with Obeo Cloud Platform
melbats
 
[SiriusCon 2018] Sirius Roadmap
Obeo
 
Forge - DevCon 2016: From Desktop to the Cloud with Forge
Autodesk
 
EclipseCon Fr 2018 - Modeling tools go up to the cloud…
melbats
 
Forge - DevCon 2016: Drawings! Drawings! Everywhere!
Autodesk
 
Spring Boot Whirlwind Tour
VMware Tanzu
 

What's hot (20)

ODP
Cloud computing - an insight into "how does it really work ?"
Tikal Knowledge
 
PDF
Case study of Google Cloud Platform
David Chen
 
PDF
API Tips & Tricks - Policy Management and Elastic Deployment
Axway
 
PDF
Google Cloud Platform Training | Introduction To GCP | Google Cloud Platform ...
Edureka!
 
KEY
Introduction to Google App Engine
Chakkrit (Kla) Tantithamthavorn
 
PPTX
Cloud & GCP 101
Runcy Oommen
 
PPTX
TIAD : Automate everything with Google Cloud
The Incredible Automation Day
 
PPTX
Gcp
HimanshuPise1
 
PPTX
Google cloud Platform
Janu Jahnavi
 
PPTX
Google Cloud Certification | Google Cloud Platform Certification Path | GCP T...
Simplilearn
 
PDF
Google Cloud Platform 2014Q1 - Starter Guide
Simon Su
 
PDF
Techdays Finland 2019 - Adventures of building a (multi-tenant) PaaS on Micro...
Tom Kerkhove
 
PDF
Top Advantages of Using Google Cloud Platform
Kinsta WordPress Hosting
 
PPTX
Google Cloud Platform Updates
Romin Irani
 
PDF
Introduction openstack horizon
Jim Yeh
 
PDF
Forge - DevCon 2016: Collaborating with Design Data
Autodesk
 
PDF
Zure Azure PaaS Zero to Hero - DevOps training day
Okko Oulasvirta
 
PDF
Teams And PowerPlatform ROI Infographic
WePlus Consultancy
 
PDF
Bringing Serverless into the Enterprise (Global Azure Virtual 2020)
Callon Campbell
 
PPTX
Microsoft Partners - Application Autoscaling Made Easy With Kubernetes Event-...
Tom Kerkhove
 
Cloud computing - an insight into "how does it really work ?"
Tikal Knowledge
 
Case study of Google Cloud Platform
David Chen
 
API Tips & Tricks - Policy Management and Elastic Deployment
Axway
 
Google Cloud Platform Training | Introduction To GCP | Google Cloud Platform ...
Edureka!
 
Introduction to Google App Engine
Chakkrit (Kla) Tantithamthavorn
 
Cloud & GCP 101
Runcy Oommen
 
TIAD : Automate everything with Google Cloud
The Incredible Automation Day
 
Google cloud Platform
Janu Jahnavi
 
Google Cloud Certification | Google Cloud Platform Certification Path | GCP T...
Simplilearn
 
Google Cloud Platform 2014Q1 - Starter Guide
Simon Su
 
Techdays Finland 2019 - Adventures of building a (multi-tenant) PaaS on Micro...
Tom Kerkhove
 
Top Advantages of Using Google Cloud Platform
Kinsta WordPress Hosting
 
Google Cloud Platform Updates
Romin Irani
 
Introduction openstack horizon
Jim Yeh
 
Forge - DevCon 2016: Collaborating with Design Data
Autodesk
 
Zure Azure PaaS Zero to Hero - DevOps training day
Okko Oulasvirta
 
Teams And PowerPlatform ROI Infographic
WePlus Consultancy
 
Bringing Serverless into the Enterprise (Global Azure Virtual 2020)
Callon Campbell
 
Microsoft Partners - Application Autoscaling Made Easy With Kubernetes Event-...
Tom Kerkhove
 
Ad

Similar to Zero to One : How to Integrate a Graphical Editor in a Cloud IDE (27.10.2021) (20)

PPTX
A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...
DataLeader.io
 
PPTX
How We Brought Advanced HTML5 Viewing to ADF
SeanGraham5
 
PPTX
ASP .Net Core SPA Templates
Eamonn Boyle
 
PDF
How to Webpack your Django!
David Gibbons
 
PDF
Integrating Jira Software Cloud With the AWS Code Suite
Atlassian
 
PDF
Simplify Cloud Applications using Spring Cloud
Ramnivas Laddad
 
PDF
Customizing Your Well-Architected Reviews_ A Technical Walkthrough.pdf
AdeotunAdegbaju
 
PPTX
Build Fast WordPress Site With Gatsby
Imran Sayed
 
PPTX
Django app deployment in Azure By Saurabh Agarwal
ratneshsinghparihar
 
PDF
Programming ASP NET MVC 4 Developing Real World Web Applications with ASP NET...
aalbxlrt993
 
PDF
"How to create an infrastructure in .NET", Leonid Chetverikov
Fwdays
 
PDF
Introducing Neo4j 3.0
Neo4j
 
PDF
nuxt-sample.pdf
ssuser65180a
 
PDF
Sirius Web Advanced : Customize and Extend the Platform
Obeo
 
PDF
Programming ASP NET MVC 4 Developing Real World Web Applications with ASP NET...
barbuhalahdl
 
PDF
Redux Universal
Nikolaus Graf
 
PDF
Machine learning services with SQL Server 2017
Mark Tabladillo
 
PPTX
NEXTjs.pptxfggfgfdgfgfdgfdgfdgfdgfdgfdgfg
zmulani8
 
PDF
Resilient Microservices with Spring Cloud
VMware Tanzu
 
A Microsoft Silverlight User Group Starter Kit Made Available for Everyone to...
DataLeader.io
 
How We Brought Advanced HTML5 Viewing to ADF
SeanGraham5
 
ASP .Net Core SPA Templates
Eamonn Boyle
 
How to Webpack your Django!
David Gibbons
 
Integrating Jira Software Cloud With the AWS Code Suite
Atlassian
 
Simplify Cloud Applications using Spring Cloud
Ramnivas Laddad
 
Customizing Your Well-Architected Reviews_ A Technical Walkthrough.pdf
AdeotunAdegbaju
 
Build Fast WordPress Site With Gatsby
Imran Sayed
 
Django app deployment in Azure By Saurabh Agarwal
ratneshsinghparihar
 
Programming ASP NET MVC 4 Developing Real World Web Applications with ASP NET...
aalbxlrt993
 
"How to create an infrastructure in .NET", Leonid Chetverikov
Fwdays
 
Introducing Neo4j 3.0
Neo4j
 
nuxt-sample.pdf
ssuser65180a
 
Sirius Web Advanced : Customize and Extend the Platform
Obeo
 
Programming ASP NET MVC 4 Developing Real World Web Applications with ASP NET...
barbuhalahdl
 
Redux Universal
Nikolaus Graf
 
Machine learning services with SQL Server 2017
Mark Tabladillo
 
NEXTjs.pptxfggfgfdgfgfdgfdgfdgfdgfdgfdgfg
zmulani8
 
Resilient Microservices with Spring Cloud
VMware Tanzu
 
Ad

More from Obeo (20)

PDF
Digitally assisted design for safety analysis
Obeo
 
PDF
INCOSE IS 2023 | You deserve more than the best in class MBSE tool
Obeo
 
PDF
Tailoring Arcadia Framework in Thales UK
Obeo
 
PDF
CapellaDays2022 | Saratech | Interface Control Document Generation and Linkag...
Obeo
 
PDF
CapellaDays2022 | Politecnico di Milano | Interplanetary Space Mission as a r...
Obeo
 
PDF
CapellaDays2022 | NavalGroup | Closing the gap between traditional engineerin...
Obeo
 
PDF
CapellaDays2022 | Thales | Stairway to heaven: Climbing the very first steps
Obeo
 
PDF
CapellaDays2022 | COMAC - PGM | How We Use Capella for Collaborative Design i...
Obeo
 
PDF
CapellaDays2022 | CILAS - ArianeGroup | CILAS feedback about Capella use
Obeo
 
PDF
CapellaDays2022 | ThermoFisher - ESI TNO | A method for quantitative evaluati...
Obeo
 
PDF
CapellaDays2022 | Thales DMS | A global engineering process based on MBSE to ...
Obeo
 
PDF
CapellaDays2022 | SIEMENS | Expand MBSE into Model-based Production Engineeri...
Obeo
 
PDF
Gestion applicative des données, un REX du Ministère de l'Éducation Nationale
Obeo
 
PDF
Simulation with Python and MATLAB® in Capella
Obeo
 
PDF
From Model-based to Model and Simulation-based Systems Architectures
Obeo
 
PDF
Connecting Textual Requirements with Capella Models
Obeo
 
PDF
Sirius Web 101 : Create a Modeler With No Code
Obeo
 
PDF
Sirius Project, Now and In the Future
Obeo
 
PDF
Visualizing, Analyzing and Optimizing Automotive Architecture Models using Si...
Obeo
 
PDF
Defining Viewpoints for Ontology-Based DSLs
Obeo
 
Digitally assisted design for safety analysis
Obeo
 
INCOSE IS 2023 | You deserve more than the best in class MBSE tool
Obeo
 
Tailoring Arcadia Framework in Thales UK
Obeo
 
CapellaDays2022 | Saratech | Interface Control Document Generation and Linkag...
Obeo
 
CapellaDays2022 | Politecnico di Milano | Interplanetary Space Mission as a r...
Obeo
 
CapellaDays2022 | NavalGroup | Closing the gap between traditional engineerin...
Obeo
 
CapellaDays2022 | Thales | Stairway to heaven: Climbing the very first steps
Obeo
 
CapellaDays2022 | COMAC - PGM | How We Use Capella for Collaborative Design i...
Obeo
 
CapellaDays2022 | CILAS - ArianeGroup | CILAS feedback about Capella use
Obeo
 
CapellaDays2022 | ThermoFisher - ESI TNO | A method for quantitative evaluati...
Obeo
 
CapellaDays2022 | Thales DMS | A global engineering process based on MBSE to ...
Obeo
 
CapellaDays2022 | SIEMENS | Expand MBSE into Model-based Production Engineeri...
Obeo
 
Gestion applicative des données, un REX du Ministère de l'Éducation Nationale
Obeo
 
Simulation with Python and MATLAB® in Capella
Obeo
 
From Model-based to Model and Simulation-based Systems Architectures
Obeo
 
Connecting Textual Requirements with Capella Models
Obeo
 
Sirius Web 101 : Create a Modeler With No Code
Obeo
 
Sirius Project, Now and In the Future
Obeo
 
Visualizing, Analyzing and Optimizing Automotive Architecture Models using Si...
Obeo
 
Defining Viewpoints for Ontology-Based DSLs
Obeo
 

Recently uploaded (20)

PDF
49784907924775488180_LRN2959_Data_Pump_23ai.pdf
Abilash868456
 
PDF
advancepresentationskillshdhdhhdhdhdhhfhf
jasmenrojas249
 
PDF
QAware_Mario-Leander_Reimer_Architecting and Building a K8s-based AI Platform...
QAware GmbH
 
PDF
Bandai Playdia The Book - David Glotz
BluePanther6
 
PDF
Appium Automation Testing Tutorial PDF: Learn Mobile Testing in 7 Days
jamescantor38
 
PPTX
Role Of Python In Programing Language.pptx
jaykoshti048
 
PPTX
Can You Build Dashboards Using Open Source Visualization Tool.pptx
Varsha Nayak
 
PPTX
classification of computer and basic part of digital computer
ravisinghrajpurohit3
 
PPTX
Presentation about variables and constant.pptx
safalsingh810
 
PDF
Wondershare Filmora 14.5.20.12999 Crack Full New Version 2025
gsgssg2211
 
PPTX
GALILEO CRS SYSTEM | GALILEO TRAVEL SOFTWARE
philipnathen82
 
PPTX
Visualising Data with Scatterplots in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PDF
Salesforce Implementation Services Provider.pdf
VALiNTRY360
 
PDF
Jenkins: An open-source automation server powering CI/CD Automation
SaikatBasu37
 
PPTX
TestNG for Java Testing and Automation testing
ssuser0213cb
 
PPT
Why Reliable Server Maintenance Service in New York is Crucial for Your Business
Sam Vohra
 
PPTX
oapresentation.pptx
mehatdhavalrajubhai
 
PDF
Teaching Reproducibility and Embracing Variability: From Floating-Point Exper...
University of Rennes, INSA Rennes, Inria/IRISA, CNRS
 
PPTX
Presentation about variables and constant.pptx
kr2589474
 
PPTX
ConcordeApp: Engineering Global Impact & Unlocking Billions in Event ROI with AI
chastechaste14
 
49784907924775488180_LRN2959_Data_Pump_23ai.pdf
Abilash868456
 
advancepresentationskillshdhdhhdhdhdhhfhf
jasmenrojas249
 
QAware_Mario-Leander_Reimer_Architecting and Building a K8s-based AI Platform...
QAware GmbH
 
Bandai Playdia The Book - David Glotz
BluePanther6
 
Appium Automation Testing Tutorial PDF: Learn Mobile Testing in 7 Days
jamescantor38
 
Role Of Python In Programing Language.pptx
jaykoshti048
 
Can You Build Dashboards Using Open Source Visualization Tool.pptx
Varsha Nayak
 
classification of computer and basic part of digital computer
ravisinghrajpurohit3
 
Presentation about variables and constant.pptx
safalsingh810
 
Wondershare Filmora 14.5.20.12999 Crack Full New Version 2025
gsgssg2211
 
GALILEO CRS SYSTEM | GALILEO TRAVEL SOFTWARE
philipnathen82
 
Visualising Data with Scatterplots in IBM SPSS Statistics.pptx
Version 1 Analytics
 
Salesforce Implementation Services Provider.pdf
VALiNTRY360
 
Jenkins: An open-source automation server powering CI/CD Automation
SaikatBasu37
 
TestNG for Java Testing and Automation testing
ssuser0213cb
 
Why Reliable Server Maintenance Service in New York is Crucial for Your Business
Sam Vohra
 
oapresentation.pptx
mehatdhavalrajubhai
 
Teaching Reproducibility and Embracing Variability: From Floating-Point Exper...
University of Rennes, INSA Rennes, Inria/IRISA, CNRS
 
Presentation about variables and constant.pptx
kr2589474
 
ConcordeApp: Engineering Global Impact & Unlocking Billions in Event ROI with AI
chastechaste14
 

Zero to One : How to Integrate a Graphical Editor in a Cloud IDE (27.10.2021)

  • 1. ZERO TO ONE: How to integrate a graphical editor in a cloud IDE Stéphane Bégaudeau Sirius Web Architect [email protected] | sbegaudeau Axel Richard Web & Modeling Consultant [email protected] | @_axelrichard_
  • 2. Sirius Web ■ Everything you liked in Sirius Desktop, available on a modern cloud-based stack ■ Graphical and Domain specific tooling ■ Defined by a configuration file ■ Deployed on a web server ■ Rendered in a web browser ■ Collaborative support https://www.eclipse.org/sirius/sirius-web.html
  • 3. What’s in Sirius Web? READY-TO-USE Modeling framework to define and render graphical applications in the web
  • 4. What’s in Sirius Web? READY-TO-USE Modeling framework to define and render graphical applications in the web MODEL SERVER Open source model server components with a GraphQL API
  • 5. What’s in Sirius Web? READY-TO-USE Modeling framework to define and render graphical applications in the web MODEL SERVER MODEL APPLICATION Open source model application (diagram, properties, forms…) Open source model server components with a GraphQL API
  • 6. Built on top of awesome technologies
  • 7. Obeo Cloud Platform ■ All of Sirius Web with additional collaborative and access control features ■ Authentication and authorization ■ Public/Private projects ■ Role based access control ■ Indicators of active users https://www.obeosoft.com/en/products/obeo-studio
  • 8. Completely customizable ■ Configure Sirius Web and OCP with the concepts from your domain ■ Define the graphical representation that you need ■ Diagrams ■ Tools ■ Forms ■ Validation ■ Import existing Sirius desktop configuration easily
  • 9. Integration in cloud IDEs MODEL SERVER Leverage our GraphQL API over HTTP and WebSocket to interact with your servers GRAPHICAL EDITORS Manipulate your Sirius Web graphical editors from your IDE (diagrams, forms, etc) VS CODE / THEIA All that packaged as an extension for VS Code and Theia
  • 10. Getting started ■ To start integrating Sirius Web in a cloud IDE, you’ll need ■ The latest release of @eclipse-sirius/sirius-components ■ React components for our graphical editors ■ An instance of a Sirius Web server ■ HTTP and WebSocket GraphQL API
  • 13. DEMO
  • 14. Integration in VS Code ■ TreeViews ■ Servers, projects & representations ■ Model explorer ■ Webview ■ Diagram editor ■ Properties editor
  • 15. Server TreeView ■ Register new Sirius Web / OCP servers
  • 16. Server TreeView ■ Register new Sirius Web / OCP servers
  • 18. Node
  • 20. Server TreeView - package.json "contributes": { "viewsContainers": { "activitybar": [ { "id": "siriusweb-view-container", "title": "Sirius", "icon": "images/icon_32.png" } ] }, "views": { "siriusweb-view-container": [ { "id": "siriusweb.serversView", "name": "Servers" }, ] }, … }
  • 21. Server TreeView ■ Register tree data provider in extension.ts ■ Implement TreeDataProvider & extend TreeItem export function activate(context: vscode.ExtensionContext) { const serversViewProvider = new ServersViewProvider(...); vscode.window.registerTreeDataProvider('siriusweb.serversView', serversViewProvider); } export class ServersViewProvider implements TreeDataProvider<ServerItem> { … getChildren(element?: ServerItem): ProviderResult<ServerItem[]> { ... } } export class ServerItem extends TreeItem { ... }
  • 22. Server TreeView ■ Perform the authentication to support Obeo Cloud Platform import axios from 'axios'; private connectToServer(): Promise<boolean> { const authenticateURL = `${this.serverAddress}/api/authenticate`; const params = new URLSearchParams({ username: this.username, password: this.password, 'remember-me': 'true' }); return axios .post(authenticateURL, params.toString()) .then((response) => { if (response.status !== 200) { return Promise.reject(false); } else { this.cookie = response.headers['set-cookie'][0]; return Promise.resolve(true); } }) .catch((error) => { return Promise.reject(false); }); }
  • 23. Project TreeView ■ Used to manipulate Sirius Web / OCP projects ■ Leverage our GraphQL API over HTTP
  • 24. Project TreeView ■ Retrieve the projects using a GraphQL query private fetchProjects(): Promise<ProjectData[]> { const queryURL = `${this.serverAddress}/api/graphql`; const headers = { headers: { Cookie: this.cookie } }; const graphQLQuery = ` query getProjects($page: Int!) { viewer { id projects(page: $page) { edges { node { id name visibility } } } } } `;
  • 25. Project TreeView ■ Then process the result to display the data in the TreeView return axios.post( queryURL, { query: graphQLQuery, variables: { page: 0 }, }, headers ) .then((response) => { if (response.status !== 200) { return Promise.reject([]); } else { const projectsData = []; // Transform response.data into projects return Promise.resolve(this.projectsData); } });
  • 26. Representations TreeView ■ Same logic as in the previous TreeView ■ GraphQL query over HTTP ■ Updated when the project selected changes
  • 27. Explorer TreeView ■ Used to display the model elements from the project ■ Based on the configuration of the explorer of the server ■ Can be parameterized ■ Based on a tree representation ■ Using a GraphQL subscription for real time update ■ Based on the graphql-ws protocol
  • 29. Explorer TreeView ■ When the connection is established, we will send out a start message ■ Used to subscribe to events from a GraphQL subscription ■ It allows us to receive updates in real time
  • 30. Explorer TreeView ■ After that, we will receive messages for each event ■ Refresh events will be used to give us the new data structure to display
  • 34. VS Code WebView public static getWebviewContent(webView: vscode.Webview, webViewContext: WebViewContext): string { const reactAppPathOnDisk = vscode.Uri.file(path.join(webViewContext.extensionPath, 'siriusweb', 'siriusweb.js')); const reactAppUri = webView.asWebviewUri(reactAppPathOnDisk); return `<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>${webViewContext.representationLabel}</title> <script> window.acquireVsCodeApi = acquireVsCodeApi; window.serverAddress = '${webViewContext.serverAddress}'; window.username = '${webViewContext.username}'; window.password = '${webViewContext.password}'; window.editingContextId = '${webViewContext.editingContextId}'; window.representationId = '${webViewContext.representationId}'; window.representationLabel = '${webViewContext.representationLabel}'; window.representationKind = '${webViewContext.representationKind}'; </script> </head> <body> <script src="${reactAppUri}"></script> </body> </html>`; }
  • 37. VS Code WebView import { DiagramWebSocketContainer, PropertiesWebSocketContainer, Selection } from '@eclipse-sirius/sirius-components'; export const App = ({...}: AppProps) => { let component; if (representationKind === 'Diagram') { component = ( <DiagramWebSocketContainer editingContextId={state.editingContextId} representationId={state.representationId} readOnly={false} selection={state.selection} setSelection={setSelection} /> ); } else { component = ( <PropertiesWebSocketContainer editingContextId={state.editingContextId} readOnly={false} selection={state.selection} /> ); } }
  • 38. VS Code WebView export const App = ({...}: AppProps) => { useEffect(() => { fetch(`${serverAddress}/api/authenticate`, { method: 'POST', credentials: 'include', mode: 'cors', body: new URLSearchParams({ username, password, 'remember-me': 'true' }), }) .then(() => { setState((prevState) => { return { ...prevState, authenticate: true }; }); }) .catch(() => {}); }, []); }
  • 48. From VS Code to Theia
  • 50. Integration in Theia ■ Package vscode extension as VSIX file ■ Run vsce from the VSCode extension folder ■ Put the VSIX file created in the Theia extensions folder ■ Run Theia
  • 51. DEMO