### Start Frontend Development Server Source: https://github.com/eclipse-syson/syson/blob/main/doc/content/modules/developer-guide/pages/index.adoc Run this command from the root of the SysON git repository to start the frontend development server. ```shell npm run start ``` -------------------------------- ### Start {product} Application Source: https://github.com/eclipse-syson/syson/blob/main/doc/content/modules/installation-guide/pages/how-tos/install/ecosystem_only.adoc Run this command in the folder containing the {product} JAR file to start the application. Adjust the JAR file name and database connection parameters as needed. ```bash java -jar path\to\your\syson-application-YEAR.MONTH.0.jar \ --spring.datasource.url=jdbc:postgresql://localhost:5433/syson-db \ --spring.datasource.username=dbuser \ --spring.datasource.password=dbpwd ``` -------------------------------- ### Install Frontend Dependencies Source: https://github.com/eclipse-syson/syson/blob/main/doc/content/modules/developer-guide/pages/index.adoc Install all frontend dependencies for all packages from the root of the project. This is typically needed once or when package.json files are updated. ```shell npm ci ``` -------------------------------- ### Start PostgreSQL Instance with Docker Source: https://github.com/eclipse-syson/syson/blob/main/doc/content/modules/installation-guide/pages/how-tos/install/ecosystem_only.adoc Use this command to start a PostgreSQL instance using Docker for local development. Ensure the port mapping and environment variables are correctly set. ```bash docker run -p 5433:5432 --name syson-postgres \ -e POSTGRES_USER=dbuser \ -e POSTGRES_PASSWORD=dbpwd \ -e POSTGRES_DB=syson-db \ -d postgres ``` ```bash docker run -p 5433:5432 --name syson-postgres -e POSTGRES_USER=dbuser -e POSTGRES_PASSWORD=dbpwd -e POSTGRES_DB=syson-db -d postgres ``` -------------------------------- ### Install Local Elasticsearch Source: https://github.com/eclipse-syson/syson/blob/main/doc/content/modules/developer-guide/pages/elasticsearch-integration.adoc Use this command to install a development instance of Elasticsearch and Kibana on your local machine. ```bash curl -fsSL https://elastic.co/start-local | sh ``` -------------------------------- ### Example output of retrieved documents (Bash) Source: https://github.com/eclipse-syson/syson/blob/main/doc/content/modules/developer-guide/partials/retrieve_project_documents_recipe.adoc This is an example of the output format when the script successfully retrieves document names and their corresponding IDs from a project manifest. ```bash Document Name: SysMLv2.sysml, Document ID: 3cb6f3b1-8a10-41b7-9a08-d32b66e28c6f Document Name: Requirements.sysml, Document ID: 7f4b9d33-0f4d-4b79-a6f8-8bc12edb9d1d ``` -------------------------------- ### Run the SysML Import Script Source: https://github.com/eclipse-syson/syson/blob/main/doc/content/modules/developer-guide/partials/import_sysml_file_recipe.adoc These commands show how to execute the Python script to import a SysML file. The first example shows the general usage with URL, file path, and project ID. The second provides a concrete example for a local server. ```bash $ python import_sysml_file.py file-path-of-sysml-file your-project-id ``` ```bash $ python import_sysml_file.py url-of-syson-server file-path-of-sysml-file your-project-id ``` ```bash $ python import_sysml_file.py /Users/myUserFolder/myFolder/mySysMLv2File.sysml 76bb3f29-17d1-465a-a2ca-a331978c36f3 ``` -------------------------------- ### Install Python Libraries Source: https://github.com/eclipse-syson/syson/blob/main/doc/content/modules/developer-guide/pages/api/api-cookbook.adoc Installs the 'requests' and 'pandas' Python libraries required for interacting with the {sysmlv2} API. ```bash pip install requests pandas ``` -------------------------------- ### Example package.json Configuration Source: https://github.com/eclipse-syson/syson/blob/main/doc/doc-ui/preview-src/index.adoc Illustrates the structure of a package.json file for a Node.js module, including name, version, description, author, and scripts. ```json { "name": "module-name", "version": "10.0.1", "description": "An example module to illustrate the usage of package.json", "author": "Author Name ", "scripts": { "test": "mocha", "lint": "eslint" } } ``` -------------------------------- ### Import SysMLv2 Textual Content Example Source: https://github.com/eclipse-syson/syson/blob/main/doc/content/modules/user-manual/pages/features/import-export-textual.adoc Example of {sysmlv2} content that can be imported as a model. Ensure all dependencies are imported recursively before importing this file. ```sysml package PictureTaking { part def Exposure; action def Focus { out xrsl: Exposure; } action def Shoot { in xsf: Exposure; } action takePicture { action focus: Focus[1]; flow focus.xrsl to shoot.xsf; action shoot: Shoot[1]; } } ``` -------------------------------- ### Deploy {product} with Docker Compose Source: https://github.com/eclipse-syson/syson/blob/main/doc/content/modules/installation-guide/pages/how-tos/install/local_test.adoc Use this command to deploy {product} and its prerequisites using Docker Compose. Ensure Docker is installed and running. ```bash docker compose up ``` -------------------------------- ### Check Docker Installation Source: https://github.com/eclipse-syson/syson/blob/main/doc/content/modules/developer-guide/pages/index.adoc Verify that Docker is installed and accessible in your shell by running this command. Docker is the preferred method for managing the PostgreSQL database. ```shell docker --version ``` -------------------------------- ### Syson API Cookbook Source: https://github.com/eclipse-syson/syson/blob/main/doc/content/modules/user-manual/partials/nav-integration.adoc Practical examples and recipes for using the Syson API to achieve specific tasks. ```APIDOC ## Syson API Cookbook ### Description Contains practical examples, code snippets, and common use cases for interacting with the Syson API. This cookbook helps developers implement solutions efficiently. ### Endpoint /api/v1/syson/cookbook ### Parameters This section would detail path, query, and request body parameters if available in the source text. ### Request Example This section would include example requests if available in the source text. ### Response #### Success Response (200) This section would detail success response fields if available in the source text. #### Response Example This section would include example responses if available in the source text. ``` -------------------------------- ### Run Development Server Source: https://github.com/eclipse-syson/syson/blob/main/frontend/syson/README.adoc Use this script to start the application in development mode. It provides live reloading and displays lint errors in the console. ```bash npm start ``` -------------------------------- ### Start Kibana with Docker Source: https://github.com/eclipse-syson/syson/blob/main/doc/content/modules/developer-guide/pages/elasticsearch-integration.adoc Launch Kibana using Docker, connecting it to the same network as Elasticsearch. Replace VERSION with the desired Kibana version. ```bash docker pull kibana:VERSION docker run -d --name kibana --net elastic -p 5601:5601 kibana:VERSION ``` -------------------------------- ### Search by Type and Name Pattern Source: https://github.com/eclipse-syson/syson/blob/main/doc/content/modules/user-manual/pages/features/cross-project-search.adoc Combine type and name matching to find specific elements. This example searches for Part elements with names starting with 'part' followed by a digit. ```text // Get all the Part elements with a name starting with "part" followed by a digit name:/part<0-9>/ AND @type:Part ``` -------------------------------- ### Install Node.js Version 22.16.0 Source: https://github.com/eclipse-syson/syson/blob/main/doc/content/modules/developer-guide/pages/index.adoc Use NVM to install the required Node.js version for the project. This command also installs the appropriate NPM version. ```shell nvm install 22.16.0 ``` -------------------------------- ### Start {product} Application with Production Configurations Source: https://github.com/eclipse-syson/syson/blob/main/doc/content/modules/installation-guide/pages/how-tos/install/production_deploy.adoc Run the {product-jar} using the Java Runtime Environment. This command includes configurations for database connection, SSL keystore, and server port, essential for a production deployment. ```bash java -jar path/to/your/syson-application-YEAR.MONTH.0.jar \ \ --spring.datasource.url=jdbc:postgresql://databaseHost:5433/databaseName \ --spring.datasource.username=databaseUsername \ --spring.datasource.password=databasePassword \ \ --server.ssl.key-store=path/to/your/keystore.p12 \ --server.ssl.key-store-password=keyStorePassword \ --server.ssl.key-store-type=PKCS12 \ --server.ssl.key-alias=server \ --server.ssl.key-password=privateKeyPassword \ \ --server.port=443 ``` -------------------------------- ### Check Node.js Version Source: https://github.com/eclipse-syson/syson/blob/main/doc/content/modules/developer-guide/pages/index.adoc Verify the installed Node.js version after installation. ```shell node -v ``` -------------------------------- ### Run Create Project Script (Bash) Source: https://github.com/eclipse-syson/syson/blob/main/doc/content/modules/developer-guide/partials/project_commit_branch_tag_recipe.adoc Execute the Python script to create a new project. Ensure the script is saved as 'create_project.py' and the {product} host is correctly configured. ```bash $ python create_project.py ``` -------------------------------- ### Launch JAR with HTTPS Properties (Manual Install) Source: https://github.com/eclipse-syson/syson/blob/main/doc/content/modules/installation-guide/pages/how-tos/https.adoc When launching your {product}-application JAR manually, include these command-line properties to enable SSL using your generated keystore. ```bash --server.ssl.key-store=./keystore.jks \ --server.ssl.key-store-password=PASSWORD_USED_IN_STEP_1 \ --server.ssl.key-store-type=JKS \ --server.ssl.key-alias=myalias \ --server.ssl.key-password=PASSWORD_USED_IN_STEP_1 ``` -------------------------------- ### Run Fetch Projects Script (Bash) Source: https://github.com/eclipse-syson/syson/blob/main/doc/content/modules/developer-guide/partials/project_commit_branch_tag_recipe.adoc Execute the Python script to fetch projects. Ensure the script is saved as 'fetch_projects.py' and the {product} host is correctly configured within the script. ```bash $ python fetch_projects.py ``` -------------------------------- ### Upgrade CLI and Site Generator Source: https://github.com/eclipse-syson/syson/blob/main/doc/doc-ui/preview-src/index.adoc Use this command to upgrade both the Antora CLI and site generator if installed globally. Alternatively, install the metapackage to upgrade both simultaneously. ```bash $ npm i -g @antora/cli @antora/site-generator ``` ```bash $ npm i -g antora ``` -------------------------------- ### Run PostgreSQL Docker Container Source: https://github.com/eclipse-syson/syson/blob/main/doc/content/modules/developer-guide/pages/index.adoc Start a PostgreSQL instance using Docker with the specified parameters for testing the {product} application locally. This command maps port 5433 to 5432 and sets up the database with user, password, and database name. ```shell docker run -p 5433:5432 --rm --name syson-postgres \ -e POSTGRES_USER=dbuser \ -e POSTGRES_PASSWORD=dbpwd \ -e POSTGRES_DB=syson-db \ -d postgres:15 ``` -------------------------------- ### Indexed Document Structure Example Source: https://github.com/eclipse-syson/syson/blob/main/doc/content/modules/developer-guide/pages/elasticsearch-integration.adoc Example of a JSON document indexed in Elasticsearch, representing a SysML Part. It includes standard fields like '@id', '@type', and nested fields. ```json { "@editingContextId": "13eee2c7-59b5-4ccd-a2b7-8ee5d93689eb", "@id": "6b251d9b-d605-4ece-9870-fd43e0688a31", "@type": "Part", "@label": "part1", "@iconURLs": [ "/icons/full/obj16/PartUsage.svg" ], } ``` -------------------------------- ### Start Elasticsearch with Docker Source: https://github.com/eclipse-syson/syson/blob/main/doc/content/modules/developer-guide/pages/elasticsearch-integration.adoc Launch an Elasticsearch instance using Docker, configuring memory, network, and volume mounts. Ensure to replace VERSION with the desired Elasticsearch version. ```bash docker pull elasticsearch:VERSION docker network create elastic docker run -d --name elasticsearch -m 2g --net elastic -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -v VOLUME_PATH_ON_YOUR_COMPUTER elasticsearch:VERSION ``` -------------------------------- ### Build Frontend Packages Source: https://github.com/eclipse-syson/syson/blob/main/doc/content/modules/developer-guide/pages/index.adoc Build all frontend packages from the root of the project. ```shell npm run build ``` -------------------------------- ### Ruby Example for String Output Source: https://github.com/eclipse-syson/syson/blob/main/doc/doc-ui/preview-src/index.adoc A simple Ruby script that prints a string containing a newline character. ```ruby puts "foo\nbar" ``` -------------------------------- ### Initialize SysON Test Data Source: https://github.com/eclipse-syson/syson/blob/main/backend/application/syson-application/README.md Navigate to the scripts directory and execute this script to initialize test data. Replace <$SQLScriptName> with the actual name of the SQL script file. ```bash cd src/test/resources/scripts ./initialize-test-data.sh <$SQLScriptName> ```