### Run Dashjoin Studio Container Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/development-production.md Use this command to start the Dashjoin Studio container for a basic development setup. It maps necessary ports and sets a default admin password. ```bash docker run -p 3000:3000 -p 8080:8080 -p 8081:8081 -e DJ_ADMIN_PASS=djdjdj dashjoin/studio ``` -------------------------------- ### Local Development Start Source: https://github.com/dashjoin/platform/blob/master/dashjoin-rdf4j/README.md Command to start the RDF4J process locally using Maven and Quarkus. Debugging is enabled on port 5006. ```bash mvn compile quarkus:dev -Denforcer.skip -Ddebug=5006 ``` -------------------------------- ### Start Dashjoin Development Webserver Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/development-production.md Run this command to start the development webserver for your Dashjoin app. The server typically runs on port 3000. Note: This is not supported in cloud tenants. ```bash yarn rsbuild dev ``` -------------------------------- ### Startup Expression for Initialization Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/development-production.md An example startup expression to initialize the database by creating a table and running an ETL job. ```javascript ( $query('postgres', 'create'); $call('etl'); ) ``` -------------------------------- ### Download Binary Data (XLS Example) Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/faq.md Example of downloading binary data, such as an XLS file, by first obtaining a base64 encoded representation using backend expressions like $openText or $generateExcel. ```javascript // Javascript const byteCharacters = atob(await generateExcel([{'x':1}])); const byteNumbers = new Array(byteCharacters.length); for (let i = 0; i < byteCharacters.length; i++) { ``` -------------------------------- ### Adding Request Body Example to OpenAPI Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/api.md Add an example to the OpenAPI description to clarify the expected request object structure for clients. This is merged with the platform-generated template. ```yaml paths: /rest/function/add: post: operationId: "add" requestBody: content: application/json: schema: example: x: 1 y: 2 ``` -------------------------------- ### Log user login event example Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/administration.md This is an example log message indicating a user login event. It includes timestamp, log level, thread information, and user details like UID, email, and roles. ```text 2024-03-20 14:15:32,163 INFO [com.das.ser.ten.TenantService] (executor-thread-12) Login profile uid=admin email=null roles=[admin] username=admin ``` -------------------------------- ### On-Start System Initialization Expression Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/appendix-configurations.md Define an expression to be executed when the system starts. This is useful for initializing the database or performing other startup tasks. ```json { "ID" : "on-start", "string" : "$log('starting...')" } ``` -------------------------------- ### Run PostgreSQL in Docker Source: https://github.com/dashjoin/platform/blob/master/dashjoin-core/src/test/docker-sql-dbs.txt Starts a PostgreSQL container. Use this for testing with PostgreSQL databases. ```bash docker run -p 5432:5432 -e POSTGRES_PASSWORD=password -d postgres ``` -------------------------------- ### Configure ActionTable Widget Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/developer-reference.md Example configuration for the ActionTable widget, demonstrating how to set initial messages and enable voice. ```json { "onChat": "newMessage.content", "expression": "{'messages': [{'role': 'assistant', 'content': 'I am a parrot'}]}", "widget": "aichat" } ``` -------------------------------- ### Start Main Dashjoin Platform Source: https://github.com/dashjoin/platform/blob/master/dashjoin-rdf4j/README.md Command to run the main Dashjoin platform container. Sets the admin password and exposes port 8080. ```bash docker run --name dashjoin -p 8080:8080 -e DJ_ADMIN_PASS=djdjdj dashjoin/platform ``` -------------------------------- ### Manage Docker Compose Containers Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/installation.md Commands to start, stop, and remove all containers defined in the Docker Compose setup. This is used for orchestrating the Dashjoin platform, AI Assistant, MCP-Proxy, and Postgres database. ```bash # start containers docker compose up # stop containers docker compose stop # delete containers docker compose down ``` -------------------------------- ### OpenCypher Graph Query Example Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/user-interface.md An example of an OpenCypher query to traverse 'REPORTS_TO' relationships in a graph. It returns the starting employee, their boss's last name, and the resource of the boss's boss. ```cypher MATCH path=(start:`dj/northwind/EMPLOYEES`)-[r1:REPORTS_TO]->(boss)-[r2:REPORTS_TO]->(finish) RETURN start._dj_resource, boss.LAST_NAME, finish._dj_resource, path ``` -------------------------------- ### Run MariaDB in Docker Source: https://github.com/dashjoin/platform/blob/master/dashjoin-core/src/test/docker-sql-dbs.txt Starts a MariaDB container. Use this for testing with MariaDB databases. Remember to create the 'junit' database. ```bash docker run --detach -p 3306:3306 --name some-mariadb --env MARIADB_USER=mariadb --env MARIADB_PASSWORD=password --env MARIADB_ROOT_PASSWORD=password mariadb:latest create database junit ``` -------------------------------- ### Form Context Example Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/concepts.md Shows the structure of the 'form' object within the context when form elements are submitted. This example assumes a number form element named 'y' with a value of 2. ```json { ... "form": { "y": 2 } } ``` -------------------------------- ### Complete Docker Run Command with Custom Trust Store Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/installation.md An example Docker command demonstrating how to run the Dashjoin platform with a custom login configuration and a custom trust store mounted. ```bash docker run -p 8080:8080 \ -v $(pwd)/logincfg.json:/deployments/assets/logincfg.json \ -v $(pwd)/my-cacerts:/opt/graalvm-ce-java17-22.3.0/lib/security/cacerts \ dashjoin/platform:latest ``` -------------------------------- ### Run Dashjoin Platform with Docker Source: https://github.com/dashjoin/platform/blob/master/README.md Use this command to quickly start the Dashjoin Platform using Docker. Ensure the DJ_ADMIN_PASS environment variable is set. ```docker docker run -p 8080:8080 -e DJ_ADMIN_PASS=djdjdj dashjoin/platform ``` -------------------------------- ### Run DB2 in Docker Source: https://github.com/dashjoin/platform/blob/master/dashjoin-core/src/test/docker-sql-dbs.txt Starts a DB2 container. Use this for testing with DB2 databases. Ensure you accept the license and set the instance password. ```bash docker run -itd --privileged=true -p 50000:50000 -e LICENSE=accept -e DB2INST1_PASSWORD=password -e DBNAME=testdb ibmcom/db2 ``` -------------------------------- ### Install 3rd Party Library with Yarn Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/development-production.md Use this command in the VS Code terminal to add the 'smiles-drawer' library to your Dashjoin UI project. Yarn will manage the installation of the library and its dependencies. ```bash yarn add smiles-drawer ``` -------------------------------- ### Configure Button Widget for New Requests Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/getting-started.md Add a button widget to trigger actions. This example configures a 'Submit' button for creating new requests. ```text widget: button text: Submit title: New Requests ``` -------------------------------- ### Run Dashjoin Studio with Git Integration Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/development-production.md This command starts the Dashjoin Studio container and configures it to work with an existing Git repository. Specify DASHJOIN_HOME and DASHJOIN_APPURL to clone and work on a remote app. ```bash docker run -p 3000:3000 -p 8080:8080 -p 8081:8081 -e DJ_ADMIN_PASS=djdjdj -e DASHJOIN_HOME=dashjoin-demo -e DASHJOIN_APPURL=https://github.com/dashjoin/dashjoin-demo dashjoin/studio ``` -------------------------------- ### Run SQL Server in Docker Source: https://github.com/dashjoin/platform/blob/master/dashjoin-core/src/test/docker-sql-dbs.txt Starts a SQL Server container. Use this for testing with SQL Server databases. Ensure you accept the EULA and set a strong SA password. ```bash docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=yourStrong(!)Password" -p 1433:1433 -d mcr.microsoft.com/mssql/server:2019-latest ``` -------------------------------- ### Define SQL Query with Parameters Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/user-interface.md Example of an SQL query using template variables for parameters. These parameters can be defined with sample data for editing. ```sql select * from PERSON where NAME=${p_name} and AGE>${p_age} ``` -------------------------------- ### Implement Before Create Trigger with Echo Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/getting-started.md Set up a trigger to execute before a new record is created. This example uses the $echo function to log the entire context to the system console. ```text $echo($) ``` -------------------------------- ### Dashjoin App Manifest Configuration Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/development-production.md This JSON manifest configures the Dashjoin app for installation on user operating systems. Customize values like name, icons, and display settings. Set 'show_install_dialog' to true to display installation instructions. ```json { "name": "Dashjoin", "short_name": "Dashjoin", "start_url": "/", "display": "standalone", "display_override": ["fullscreen", "minimal-ui"], "id": "dashjoin", "background_color": "#fff", "theme_color": "#1976d2", "description": "Rapidly Build Apps Driven by Data and AI", "dashjoin": { "show_install_dialog": false }, "icons": [ { "src": "djlogo192.webp", "type": "image/webp", "sizes": "192x192", "purpose": "any" }, { "src": "djlogo512.png", "type": "image/png", "sizes": "512x512", "purpose": "any" } ], "screenshots": [ { "src": "djscreenshot.avif", "sizes": "1200x627", "type": "image/avif" }, { "src": "djscreenshot.avif", "sizes": "1200x627", "type": "image/avif", "form_factor": "wide" }, { "src": "djscreenshot.avif", "sizes": "1200x627", "type": "image/avif", "form_factor": "narrow" } ] } ``` -------------------------------- ### Create Widget Configuration Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/appendix-widgets.md Configure a 'create' widget within a page layout to display a form for creating new database records. This example shows the schema for an 'ID' field. ```json { "name" : "sqlite", "ID" : "dj/sqlite", "djClassName" : "org.dashjoin.service.SQLDatabase", "url" : "jdbc:sqlite:dashjoin-demo.db", "tables" : { "REQUESTS" : { "tableLayout" : { "widget" : "page", "children" : [ { "widget" : "create", "schema" : { "type" : "object", "properties" : { "ID" : { "ID" : "dj/sqlite/REQUESTS/ID", "parent" : "dj/sqlite/REQUESTS", "dbType" : "INTEGER", "type" : "number", "pkpos" : 0, "createOnly" : true } } } } ] } } } } ``` -------------------------------- ### Dashjoin Container Logincfg.json Mount Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/administration.md Example command to mount the logincfg.json file into a Dashjoin Docker container. The file is expected at /deployments/META-INF/resources/assets/logincfg.json within the container. ```bash docker run --rm -p 8080:8080 -v /my/path/to/logincfg.json:/deployments/META-INF/resources/assets/logincfg.json:ro dashjoin/platform ``` -------------------------------- ### Minimalistic logincfg.json Example Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/administration.md A basic logincfg.json configuration that enables email login while disabling password reset and user registration. Unspecified settings will retain their default values. ```json { "emailLoginEnabled": true } ``` -------------------------------- ### Database Search Query Configuration Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/appendix-configurations.md Configure specific search queries for databases. This example sets the 'northwind' database to use the 'search' query from the query catalog. ```json { "ID" : "database-search-query", "map" : { "northwind" : "search" } } ``` -------------------------------- ### Run MySQL in Docker Source: https://github.com/dashjoin/platform/blob/master/dashjoin-core/src/test/docker-sql-dbs.txt Starts a MySQL container. Use this for testing with MySQL databases. Remember to create the 'junit' database. Note: FKs are not supported in MySQL MyISAM mode. ```bash docker run --detach -p 3306:3306 --name some-mysql -e MYSQL_ROOT_PASSWORD=password mysql create database junit ``` -------------------------------- ### Run Dashjoin NLP Container Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/ai-ml-integration.md Start the Dashjoin NLP container to enable document-to-text conversion services. Ensure the container is accessible on port 8081. ```shell docker run -p 8081:8081 dashjoin/nlp ``` -------------------------------- ### HTML/Markdown Context Example Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/concepts.md Illustrates how the result of a custom expression is passed into the context for use in HTML and Markdown widgets. This allows dynamic content rendering. ```json { ... "context": result of the expression in the html / markdown widgets } ``` -------------------------------- ### Compile and Run Quarkus Application Source: https://github.com/dashjoin/platform/blob/master/dashjoin-sdk/README.md Compile the Quarkus project and start the development server to run your Dashjoin microservice. This command is used after configuring the Quarkus plugin in pom.xml. ```bash mvn compile quarkus:dev ``` -------------------------------- ### Log New Request Context Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/getting-started.md Example of the system console output when the $echo trigger is activated upon a new request submission. It shows details of the database operation. ```text {database=sqlite, search=null, command=create, table=REQUESTS, object={ID=762613, user=user, name=My test entry, submitted=2020-12-31T15:50:35.755459500Z}} ``` -------------------------------- ### Query with Tenant Column Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/security.md Example of a query on the 'item' table using the 'owner' column for row-level security. The `${tenant}` parameter is dynamically set. ```sql select * from item where owner = ${tenant} ``` ```json { "tenant": user } ``` -------------------------------- ### Initialize SQL Database with Scripts Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/faq.md Configure SQL database initialization by providing a list of initScripts in the database configuration. These scripts are executed when the database connects. ```json { "ID": ..., "djClassName": "org.dashjoin.service.SQLDatabase", "initScripts": [ "upload/init.sql", ], ... ``` -------------------------------- ### Create a New SQL Database Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/getting-started.md Use this configuration to create a new SQL database instance. Ensure the URL points to a valid database file path. ```bash type: SQLDatabase name: sqlite url: jdbc:sqlite:your_database.db ``` -------------------------------- ### Run Dashjoin AI Translation Container Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/ai-ml-integration.md Start the dashjoin/ai-translation Docker container, mapping host port 8084 to the container's port 8080. ```shell docker run -p 8084:8080 dashjoin/ai-translation ``` -------------------------------- ### Run Oracle Database in Docker Source: https://github.com/dashjoin/platform/blob/master/dashjoin-core/src/test/docker-sql-dbs.txt Starts an Oracle Database Enterprise Edition container. Use this for testing with Oracle databases. Note that 'if not exists' should be removed from junit.sql. ```bash docker run -d -it -p 1521:1521 -p 5500:5500 store/oracle/database-enterprise:12.2.0.1 ``` -------------------------------- ### MCPServer Configuration Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/appendix-configurations.md Configure an MCP server by providing its URL, username, and password for authentication. This setup is essential for connecting to and utilizing the MCP service. ```json { "djClassName" : "org.dashjoin.function.MCPServer", "ID" : "mcp", "url" : "https://mcp.notion.com/mcp", "username" : "Authorization", "password" : "DJ1#\b7Zw3EGtmVKaDuwwOtwXfWDG1y+awbon7WNQp9NmJ6EgUXEpYUMC8O7zRUw2kSnDxyATO0R3ke3NxjaT9zCwYyDGS5VDgYt/L", "apiKey" : true } ``` -------------------------------- ### OCR API Response Example Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/ai-ml-integration.md Example JSON response from the OCR API, containing the extracted text from an image. ```json "HEY YOU YES YOU\n\nYOU CANDO IT\n" ``` -------------------------------- ### AI Application JSON Response Example Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/developer-reference.md Example of a JSON structure returned by an AI application when invoked with a specified JSON schema. ```json { "res": [ "Berlin", "Madrid", "Rome", ... ``` ``` -------------------------------- ### Configure Users in djusers.properties Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/getting-started.md Define users and their associated unique identifiers in the `djusers.properties` file. This is used for local user management in the open-source default installation. ```bash # djusers.properties admin=1395a3149fee498061e6c06581a3decf authenticated=4a699242c282b1180a24df1ff411001f ``` -------------------------------- ### Image Classification API Response Example Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/ai-ml-integration.md Example JSON response from the image classification API, listing potential object types and their probabilities. ```json [ { "type": "goldfinch", "prob": 0.9761154055595398 }, { "type": "bulbul", "prob": 0.017567412927746773 }, { "type": "coucal", "prob": 0.0015972057590261102 } ] ``` -------------------------------- ### UI Theme Primary and Secondary Color Configuration Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/appendix-configurations.md Set the UI theme by defining primary and secondary colors. This example uses a specific hex code for both. ```json { "ID" : "theme", "map" : { "palette.primary.main" : "#3d7dbc", "palette.secondary.main" : "#3d7dbc" } } ``` -------------------------------- ### Install Python Libraries in Jupyter Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/ai-ml-integration.md Command to install a Python library within a Jupyter Notebook environment. Use this for adding dependencies not included by default. ```python !pip install missing-lib ``` -------------------------------- ### Azure AD OpenID Provider Configuration Example Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/administration.md This JSON snippet demonstrates how to configure an OpenID provider, specifically Azure AD, within the Dashjoin login configuration. Ensure the redirectUri is set to the root URL of your Dashjoin application. ```json { "domain": "dashjoin.com", "name": "Dashjoin Example.com", "logo": "/favicon.ico", "config": { "issuer": "https://login.microsoftonline.com/.../v2.0", "clientId": "...", "redirectUri": "https://dashjoin-app.example.com/", "scope": "openid profile email", "requestAccessToken": false, "strictDiscoveryDocumentValidation": false } } ``` -------------------------------- ### List Deployed Versions with Mike Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/README.md Use this command to see all versions of the documentation that have been deployed. ```bash mike list ``` -------------------------------- ### Open HTTP GET Service with Authorization Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/appendix-jsonata.md Opens an HTTP GET service at a given URL and passes an authorization header. Useful for interacting with external APIs. ```jsonata $curl('GET', 'http://localhost:8080/rest/manage/version', null, {'Authorization': 'Basic YWRtaW46ZGpkamRq'}) ``` -------------------------------- ### Chart Widget - Query Example Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/appendix-widgets.md Displays a bar chart using data from the 'group' query on the 'northwind' database. The first column of the query result is used for the X-axis labels and the second for Y-values. ```json { "database" : "northwind", "query" : "group", "chart" : "bar", "widget" : "chart" } ``` -------------------------------- ### Action Table Context Example Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/concepts.md Demonstrates how selected rows from an action table are included in the context when a table action is triggered. The 'selected' field contains an array of the chosen rows. ```json { ... "selected": [ selected row 1, ... selected row n ] } ``` -------------------------------- ### Create Record with Dynamic Fields Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/getting-started.md Use the `$create` function to insert a new record into a specified database and table. This example generates a unique ID, assigns the current user, captures form input, and records the submission time. ```javascript $create( "sqlite", "REQUESTS", { "ID": $ceil($random()*1000000), "user": $.user, "name": $.form.name, "submitted": $now() } ) ``` -------------------------------- ### AI Chat Widget - Parrot Example Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/appendix-widgets.md Initializes an AI chat widget that responds to user input by repeating the message. This serves as a basic example without actual AI integration. ```json { "onChat" : "newMessage.content", "expression" : "{'messages': [{'role': 'assistant', 'content': 'I am a parrot'}]}", "widget" : "aichat" } ``` -------------------------------- ### SQLite Database with Init Script Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/appendix-configurations.md Defines a SQLite database connection and specifies an initialization script 'upload/init.sql' to run on startup. ```json { "name" : "sqlite", "ID" : "dj/sqlite", "djClassName" : "org.dashjoin.service.SQLDatabase", "url" : "jdbc:sqlite:dashjoin-demo.db", "initScripts" : [ "upload/init.sql" ] } ``` -------------------------------- ### Configure Table Widget with Query Arguments Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/getting-started.md Set up a table widget to display query results. Use `arguments` to pass dynamic parameters, such as the current user's ID, to the query. ```text widget: table query: requests database: sqlite title: My Requests arguments: {"user": $.user} ``` -------------------------------- ### Get Current User Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/appendix-jsonata.md Returns the identifier or username of the current user. ```jsonata $djUser() ``` -------------------------------- ### Chart Widget - Styled Example Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/appendix-widgets.md Configures a bar chart with custom styling options, including bar background color, chart title, and X-axis time scale with specific min/max dates. Styling follows ChartJS conventions. ```json { "widget" : "chart", "query" : "orders-over-time", "database" : "northwind", "chart" : "bar", "style" : { "elements.bar.backgroundColor" : "green", "plugins.title.text" : "Orders in February", "plugins.title.display" : "true", "scales.x.type" : "time", "scales.x.min" : "1998-02-01", "scales.x.max" : "1998-02-28" } } ``` -------------------------------- ### Get Variable Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/developer-reference.md Retrieves the last set value of a variable by its key. ```APIDOC ## $getVariable(key) ### Description Gets the last set value of a variable using its key. This is similar to accessing `variable.key` but retrieves the most recently updated value. ### Syntax $getVariable(key: string) ### Returns - any: The value of the variable key. ``` -------------------------------- ### Windows Logincfg.json Path Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/administration.md Specifies the default location for the logincfg.json file on Windows installations. ```bash C:\Users\\AppData\Local\Dashjoin\META-INF\resources\assets\logincfg.json ``` -------------------------------- ### curl Source: https://github.com/dashjoin/platform/blob/master/llms.txt Opens an HTTP GET service at a given URL and passes an authorization header. ```APIDOC ## curl ### Description Opens an HTTP GET service at the given URL and passes the authorization header. ### Method jsonata ### Endpoint $curl ### Parameters #### Path Parameters - **method** (string) - Required - The HTTP method (e.g., 'GET'). - **url** (string) - Required - The URL to make the request to. - **body** (object) - Optional - The request body. - **headers** (object) - Optional - The request headers, including authorization. ### Request Example ```jsonata $curl('GET', 'http://localhost:8080/rest/manage/version', null, {'Authorization': 'Basic YWRtaW46ZGpkamRq'}) ``` -------------------------------- ### SQLite Database with Initial Create Table Source: https://github.com/dashjoin/platform/blob/master/llms.txt Defines a SQLite database with an init script to create the MY_TABLE if it does not exist. ```APIDOC ## SQLite Database with Initial Create Table ### Description SQLite database definition with init script that contains: CREATE TABLE IF NOT EXISTS MY_TABLE(ID INT PRIMARY KEY, NAME VARCHAR(255)) ### Language json ### Code ```json { "name" : "sqlite", "ID" : "dj/sqlite", "djClassName" : "org.dashjoin.service.SQLDatabase", "url" : "jdbc:sqlite:dashjoin-demo.db", "initScripts" : [ "upload/init.sql" ] } ``` ``` -------------------------------- ### Get App Version Info Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/ai-ml-integration.md Retrieves the application's name and version information. ```APIDOC ## GET /info ### Description App Version Info ### Method GET ### Endpoint /info ### Response #### Success Response (200) - **name** (string) - The name of the application. - **version** (string) - The version of the application. ### Request Example ```json { "example": "" } ``` ### Response Example ```json { "name": "Custom App", "version": "1.0" } ``` ``` -------------------------------- ### Build and Deploy Application Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/development-production.md Commands to build the Dashjoin application for production and deploy the compiled assets. This process generates the necessary files for the user interface, which can then be committed along with other application assets. ```bash yarn build yarn deploy ``` -------------------------------- ### $traverse (related entity) Source: https://github.com/dashjoin/platform/blob/master/llms.txt Gets a related entity for a given record via a foreign key. ```APIDOC ## $traverse (related entity) ### Description Gets a related entity for a given record via a foreign key. ### Method $traverse(database, table, recordId, foreignKey) ### Parameters - **database** (string) - The name of the database. - **table** (string) - The name of the table containing the record. - **recordId** (string) - The ID of the record. - **foreignKey** (string) - The name of the foreign key column. ``` -------------------------------- ### Get Database Statistics Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/appendix-jsonata.md Retrieves statistical information for a specified table ('REQUESTS') within a database ('sqlite'). ```jsonata $stats('sqlite', 'REQUESTS') ``` -------------------------------- ### Define Sample Data for Query Parameters Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/user-interface.md Sample data for query parameters, where 'p_name' is a string and 'p_age' is an integer. This data is used in the query editor for preview. ```text p_name: Mike p_age: 20 ``` -------------------------------- ### $traverse (related records) Source: https://github.com/dashjoin/platform/blob/master/llms.txt Gets all related records for a given record via a foreign key relationship. ```APIDOC ## $traverse (related records) ### Description Gets all related records for a given record via a foreign key relationship. ### Method $traverse(database, table, recordId, relationship) ### Parameters - **database** (string) - The name of the database. - **table** (string) - The name of the table containing the record. - **recordId** (string) - The ID of the record. - **relationship** (string) - The foreign key relationship path. ``` -------------------------------- ### Configure Tenant User Access and Roles Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/appendix-configurations.md Allows a specific user (user@example.org) to be active on the platform and assigns them the 'authenticated' role. ```json { "ID" : "user@example.org", "active" : true, "roles" : [ "authenticated" ] } ``` -------------------------------- ### Get Git Status Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/appendix-jsonata.md Returns the current git status of the Dashjoin application, including modified files and their differences. ```jsonata $gitStatus() ``` -------------------------------- ### Confirm Dialog Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/developer-reference.md Opens a confirm dialog to get user confirmation. Returns true if confirmed, false otherwise. ```APIDOC ## $confirm(message) ### Description Opens a confirm dialog with the provided message. ### Syntax $confirm(message: string) ### Returns - boolean: `true` if the user confirms, `false` otherwise. ``` -------------------------------- ### Set Base Theme Configuration Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/appendix-configurations.md Configures the base theme for the platform. Use this to set the overall visual style. ```json { "ID" : "base-theme", "string" : "B&W" } ``` -------------------------------- ### Display Widget on Instance Page Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/appendix-widgets.md Shows how a display widget is configured within the instance layout of a database table. ```json { "name" : "sqlite", "ID" : "dj/sqlite", "djClassName" : "org.dashjoin.service.SQLDatabase", "url" : "jdbc:sqlite:dashjoin-demo.db", "tables" : { "REQUESTS" : { "instanceLayout" : { "widget" : "page", "children" : [ { "display" : "$now()", "widget" : "display" } ] } } } } ``` -------------------------------- ### $curl Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/appendix-jsonata.md Opens an HTTP GET service at a given URL and passes an authorization header. Useful for interacting with external services. ```APIDOC ## $curl ### Description Opens an HTTP GET service at the given URL and passes the authorization header. ### Syntax `$curl(method, url, body, headers)` ### Parameters - **method** (string) - The HTTP method (e.g., 'GET', 'POST'). - **url** (string) - The URL to send the request to. - **body** (any) - The request body (can be null). - **headers** (map) - A map of request headers. ### Example ``` $curl('GET', 'http://localhost:8080/rest/manage/version', null, {'Authorization': 'Basic YWRtaW46ZGpkamRq'}) ``` ### Sample Output ```json { "vendor" : "Dashjoin", "name" : "Dashjoin Low Code Development and Integration Platform" } ``` ``` -------------------------------- ### Get Current User Roles Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/appendix-jsonata.md Retrieves the roles assigned to the currently authenticated user. Returns an array of role names. ```jsonata $djRoles() ``` -------------------------------- ### Variable Widget Configuration Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/appendix-widgets.md Configure a 'variable' widget to set session variables. This example defines a 'field' variable of type 'number'. ```json { "widget" : "variable", "schema" : { "type" : "object", "properties" : { "field" : { "widget" : "number" } } } } ``` -------------------------------- ### Startup Expression for Theme Customization Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/development-production.md Uses a startup expression to dynamically set the theme color based on the DASHJOIN_ONSTART environment variable. ```javascript $update('config', 'dj-config', 'theme', {'map': {'pallette.primary.main': onStart}}) ``` -------------------------------- ### Get Incoming Records Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/appendix-jsonata.md Retrieves all records from databases that point to a specific record in another table, based on foreign key relationships. ```jsonata $incoming('northwind', 'EMPLOYEES', 2) ``` -------------------------------- ### Internationalization (i18n) German Translations Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/appendix-configurations.md Provide German translations for strings that appear in the application. This example maps 'Search Results' to its German equivalent. ```json { "ID" : "de", "map" : { "Search Results" : "Suchergebnisse" } } ``` -------------------------------- ### Detect Language API Response Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/ai-ml-integration.md Example JSON response from the language detection API, indicating the detected language code for the provided text. ```json "en" ``` -------------------------------- ### Homepage Configuration Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/appendix-configurations.md Define the default page to open after a user successfully logs in. This sets the initial view for the user upon authentication. ```json { "ID" : "homepage", "string" : "/page/Info" } ``` -------------------------------- ### Face Recognition API Response Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/ai-ml-integration.md Example JSON response from the face recognition API, detailing detected faces with their bounding box coordinates. ```json [ { "faceid": "Kristen Welker", "top": 206, "left": 705, "bottom": 527, "right": 1026 } ] ``` -------------------------------- ### ETL Configuration for Document Loading Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/ai-ml-integration.md This configuration sets up the ETL process for loading documents. It specifies the Dashjoin class, an ID, the expressions to use, the target database, and how to handle existing data. 'Ignore' is recommended to only re-embed changed documents. ```json { "djClassName": "com.dashjoin.function.ETL", "ID": "etl", "expressions": { "expression": see above... }, "database": "kb", "oldData": "Ignore", "createSchema": false } ``` -------------------------------- ### SQL Query with Sample Data Applied Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/user-interface.md The resulting SQL query after applying sample data for 'p_name' and 'p_age'. The system automatically handles string quotation. ```sql select * from PERSON where NAME='Mike' and AGE>20 ``` -------------------------------- ### Execute SQL Server Stored Procedure with Output Variable Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/faq.md Demonstrates how to declare a variable, execute a SQL Server stored procedure passing the variable as an output parameter, and then select the variable's value. ```sql DECLARE @res INT; exec dbo.sp @res output; select @res; ``` -------------------------------- ### Configure HTTPS for Dashjoin Platform Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/installation.md Set these environment variables to enable HTTPS for the Dashjoin platform. The certificate and key files are required. ```bash QUARKUS_HTTP_SSL_CERTIFICATE_FILE=/path/to/cert.pem QUARKUS_HTTP_SSL_CERTIFICATE_KEY_FILE=/path/to/key.pem ``` -------------------------------- ### Open Text File with Specific Encoding Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/appendix-jsonata.md Opens a text file using a specified character encoding (ISO_8859_1 in this example) and returns its content as a string. ```jsonata $openText('file:upload/test.json', 'ISO_8859_1') ``` -------------------------------- ### ETL with Unique Key Lookup using $all Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/faq.md This example demonstrates how to ETL data when a datasource provides a unique key (like last name) but not the primary key. It uses the $all function to find the record by the unique key and retrieve the primary key, merging it into the original record. Note: This performs one query per row. ```javascript [{"id": "Davolio", "email": "davolio@example.org"}, {"id": "Fuller", "email": "fuller@acme.org"}] .$merge([ $, {"EMPLOYEE_ID": $all("northwind", "EMPLOYEES", null, null, null, false, {"LAST_NAME": id}).EMPLOYEE_ID} ]) ``` -------------------------------- ### Entity Reconciliation Results Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/ai-ml-integration.md Example JSON output from the `reconcileEntity` function, showing potential matches for the entity 'Apple' with their Wikidata IDs, labels, and descriptions. ```json [ { "id": "Q89", "label": "apple", "description": "fruit of the apple tree" }, { "id": "Q312", "label": "Apple", "description": "American multinational technology company" } ] ``` -------------------------------- ### $create Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/appendix-jsonata.md Creates a new record in a specified database table. It takes the database name, table name, and a map of column values as arguments. ```APIDOC ## $create ### Description Creates a new record in a specified database table. ### Syntax `$create(database, table, values)` ### Parameters - **database** (string) - The name of the database. - **table** (string) - The name of the table. - **values** (map) - A map of column names and their corresponding values. ### Example ``` $create('sqlite', 'REQUESTS', {'ID': 7, 'name':'new request'}) ``` ### Sample Output ```json { "database" : "sqlite", "table" : "REQUESTS", "pk" : [ 7 ] } ``` ``` -------------------------------- ### $djVersion Source: https://github.com/dashjoin/platform/blob/master/llms.txt Returns the current platform version information. ```APIDOC ## $djVersion ### Description Returns the platform version information. ### Method $djVersion() ``` -------------------------------- ### Example Request Body for addPet Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/api.md This JSON represents the request object for the addPet operation, including parameters (null in this case) and the pet data in the body. ```json { "parameters": null, "body": { "id": 10, "name": "doggie", "category": { "id": 1, "name": "Dogs" }, "photoUrls": [ "string" ], "tags": [ { "id": 0, "name": "string" } ], "status": "available" } } ``` -------------------------------- ### Specifying Development Database URL Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/development-production.md Illustrates how to use environment variables to override the default database connection URL during development. This allows for different configurations between development and production. ```bash dashjoin.database.NAME OF THE DATABSE.url ``` -------------------------------- ### Exposing Functions, Queries, and Schemas via OpenAPI Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/api.md This section describes how to document an existing Dashjoin App by creating an OpenAPI skeleton and specifying which functions, queries, and schemas to expose. ```APIDOC ## Documenting an Existing App This process involves creating an OpenAPI skeleton description and placing it in the app's upload folder. The `x-dashjoin` section of the OpenAPI specification is used to declare which functions, queries, and schemas should be exposed. ### OpenAPI Skeleton Example ```yaml openapi: "3.0.3" info: version: "1" title: "test" x-dashjoin: functions: - add security: - Basic_Auth: [] components: securitySchemes: Basic_Auth: type: "http" scheme: "basic" ``` ### Specifying Functions, Queries, and Schemas To include functions, queries, and schemas in the App API, use the following keywords within the `x-dashjoin` section: ```yaml x-dashjoin: functions: - add queries: - group schemas: - dj/northwind/US_STATES ``` ### Adding Request Body Examples To provide clear documentation for request objects, you can add an `example` within the `requestBody` schema: ```yaml paths: /rest/function/add: post: operationId: "add" requestBody: content: application/json: schema: example: x: 1 y: 2 ``` ### Accessing OpenAPI Specification The OpenAPI specification can be accessed at `/openapi`. If credentials are provided, result set metadata for queries is also generated. ### Implementing an Existing OpenAPI Specification This use case involves designing the OpenAPI spec first and then implementing it within Dashjoin. Place the OpenAPI file (e.g., `upload/petstore.yaml`) and configure the `openapi` setting in `dj-config` to point to the file URL. ``` -------------------------------- ### Configure Local RDF Store Source: https://github.com/dashjoin/platform/blob/master/dashjoin-rdf4j/README.md Command to run the RDF4J container with specific environment variables to configure it for local storage. Sets the database mode to 'local' and the folder to the current directory. ```bash docker run --name rdf4j -p 8082:8082 -e DASHJOIN_DATABASE_MODE=local -e DASHJOIN_DATABASE_FOLDER=. dashjoin/rdf4j ``` -------------------------------- ### Test RDF4J Endpoint Source: https://github.com/dashjoin/platform/blob/master/dashjoin-rdf4j/README.md URL to access the Swagger UI for testing the RDF4J database driver. This is typically accessed after starting the container or local process. ```bash http://localhost:8082/swagger-ui/ ``` -------------------------------- ### SQL Server Connection String Source: https://github.com/dashjoin/platform/blob/master/dashjoin-core/src/test/docker-sql-dbs.txt JDBC connection details for a SQL Server instance running in Docker. ```json "url": "jdbc:sqlserver://localhost:1433;encrypt=false;databaseName=master", "username": "sa", "password": "yourStrong(!)Password", ``` -------------------------------- ### Get Platform Version Information Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/appendix-jsonata.md Retrieves detailed version information about the Dashjoin platform, including version number, build time, and runtime details. ```jsonata $djVersion() ``` -------------------------------- ### Authenticate with HTTP Basic Auth Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/api.md Use HTTP basic authentication for requests with a local admin user. Replace 'admin' and 'djdjdj' with your actual credentials. ```bash curl -u admin:djdjdj http://localhost:8080/rest/manage/version ``` -------------------------------- ### $etl Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/appendix-jsonata.md Runs an ETL process to load data into a specified database, with an option to create the schema. ```APIDOC ## $etl ### Description Runs an ETL process that loads data into a specified database. ### Syntax `$etl(source, data, database, table, options, createSchema)` ### Parameters - **source** (string) - The source of the data (can be empty). - **data** (string) - The data to load, typically in JSON format. - **database** (string) - The target database name. - **table** (string, optional) - The target table name. - **options** (any, optional) - Additional options for the ETL process. - **createSchema** (boolean) - Whether to create the schema if it doesn't exist. ### Example ``` $etl('', '[{"id":1, "name":"mike"}]', 'sqlite', null, null, true) ``` ### Sample Output ```json null ``` ``` -------------------------------- ### On-Login User Restriction Expression Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/appendix-configurations.md Configure an expression that runs whenever a user logs in. This example restricts login to only the admin user, showing an error for others. ```json { "ID" : "on-login", "string" : "email != 'admin@localhost' ? $error('Only user admin allowed')" } ``` -------------------------------- ### ETL with Unique Key Lookup using $lookup and $all Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/faq.md An alternative method for ETL with unique key lookups. This approach first creates a lookup table using $all and stores it in a variable, then uses $lookup to efficiently retrieve the primary key for merging. ```javascript ( $input := [{"id": "Davolio", "email": "davolio@example.org"}, {"id": "Fuller", "email": "fuller@acme.org"}]; $unique2key := $all("northwind", "EMPLOYEES").{LAST_NAME: EMPLOYEE_ID}; $input.$merge([$, {"EMPLOYEE_ID": $lookup($unique2key, $.id)}]) ) ``` -------------------------------- ### Test REST API with Curl Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/ai-ml-integration.md Example curl command to test the /info REST endpoint. Ensure you replace placeholders with actual credentials and host information. ```bash curl -u admin:djdjdj -X 'GET' \ 'http://localhost:8001/app/v1/info' \ -H 'accept: application/json' ``` -------------------------------- ### Button Widget with Dynamic Form Fields Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/appendix-widgets.md Configure a button widget where form fields are dynamically computed using 'schemaExpression'. This example defines a 'name' field. ```json { "schemaExpression" : "{'properties':{'name': {'type':'string'}}}", "print" : "form.name", "widget" : "button" } ``` -------------------------------- ### Query with Role-Based Security Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/security.md Example of a query on the 'customer' table where row-level security is based on user roles. The `${tenant}` parameter is determined by checking role membership. ```sql select * from customer where region = ${tenant} ``` ```json { "tenant": "sales-south" in roles ? "south" : ("sales-north" in roles ? "north") } ``` -------------------------------- ### Time Input Configuration Source: https://github.com/dashjoin/platform/blob/master/dashjoin-docs/docs/appendix-inputs.md Displays a time picker, returning the selected time combined with the current date in ISO 8601 format. ```json { "widget" : "time" } ```