### Install Dependencies and Start Front-End Service
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/Tutorials/setup-guide.md
Install project dependencies using npm and start the front-end development server. Users in China can optionally enable the Taobao registry for faster installation.
```shell
npm install && npm run dev
```
--------------------------------
### Verify Maven Installation (Windows Example)
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/Tutorials/Dev-ENV/Maven-setup.md
Check if Maven is installed correctly by running 'mvn --version'. This output is an example for Windows.
```powershell
# Windows
Apache Maven 3.9.9 (8e8579a9e76f7d015ee5ec7bfcdc97d260186937)
Maven home: C:\Users\yakir\Developer\apache-maven-3.9.9
Java version: 1.8.0_441, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk-1.8\jre
Default locale: zh_CN, platform encoding: GBK
OS name: "windows 11", version: "10.0", arch: "amd64", family: "windows"
```
--------------------------------
### Verify Maven Installation (Linux/macOS Example)
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/Tutorials/Dev-ENV/Maven-setup.md
Check if Maven is installed correctly by running 'mvn --version'. This output is an example for Linux/macOS.
```powershell
# Linux/macOS
Apache Maven 3.9.9 (8e8579a9e76f7d015ee5ec7bfcdc97d260186937)
Maven home: /Users/yakir/local/maven
Java version: 1.8.0_452, vendor: BellSoft, runtime: /Library/Java/JavaVirtualMachines/liberica-jdk-8-full.jdk/Contents/Home/jre
Default locale: zh_CN, platform encoding: UTF-8
OS name: "mac os x", version: "15.3.2", arch: "aarch64", family: "mac"
```
--------------------------------
### Framework Configuration Example
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/Reference/Back-EndFramework/module-API.md
Example of framework configuration including system, data, and gateway settings.
```yaml
pamirs:
framework:
system:
system-ds-key: base
system-models:
- base.WorkerNode
data:
default-ds-key: pamirs
ds-map:
base: base
gateway:
statistics: true
show-doc: true
#hook configuration is as follows
#hook:
#excludes:
#- pro.shushi.pamirs.core.common.hook.QueryPageHook4TreeAfter
#- pro.shushi.pamirs.user.api.hook.UserQueryPageHookAfter
#- pro.shushi.pamirs.user.api.hook.UserQueryOneHookAfter
```
--------------------------------
### Install Git on macOS
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/Tutorials/Dev-ENV/Git-setup.md
Use this command to initiate the Git installation process on macOS via the command line. Follow the on-screen prompts to complete the installation.
```shell
xcode-select --install
```
--------------------------------
### Start MySQL Service
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/CommonSolutions/Back-End/environment-deployment-designer-on-neokylin-mips64.md
Start the MySQL service using systemctl.
```bash
systemctl start mysqld
```
--------------------------------
### Execute MySQL Make Installation
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/CommonSolutions/Back-End/environment-deployment-designer-on-neokylin-mips64.md
Installs the compiled MySQL 5.7 binaries and libraries to the specified installation prefix.
```bash
make
sudo make install
```
--------------------------------
### Alibaba Cloud OSS Configuration Example
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/CommonSolutions/Back-End/file-storage-oss-cdn-configuration-and-operations.md
Example YAML configuration for Alibaba Cloud OSS. Ensure 'bucket', 'uploadUrl', 'downloadUrl', 'accessKeyId', 'accessKeySecret', and 'mainDir' are set according to your specific Alibaba Cloud setup.
```yaml
cdn:
oss:
name: Alibaba Cloud
type: OSS
bucket: pamirs (modify according to actual situation)
uploadUrl: oss-cn-hangzhou.aliyuncs.com
downloadUrl: oss-cn-hangzhou.aliyuncs.com
accessKeyId: Your accessKeyId
accessKeySecret: Your accessKeySecret
# Modify according to actual situation
mainDir: upload/
validTime: 3600000
timeout: 600000
active: true
imageResizeParameter:
referer:
```
--------------------------------
### Markdown Template for User Guide - Configuration Example
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/Contribute/DocumentationContributions/content-guidelines.md
Example of a YAML configuration snippet within a Markdown user guide. Ensure correct indentation and syntax for embedded code.
```yaml
nodes:
- type: approval
role: finance
```
--------------------------------
### Custom Session Initialization Logic in Java
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/Reference/Back-EndFramework/AdvanceAPI/request-context-API.md
Implement the SessionInitApi interface to execute custom initialization logic during session setup. This example demonstrates logging the module name and can be extended for more complex operations.
```java
@Component
public class CustomSessionInitApi implements SessionInitApi {
@Override
public void init(HttpServletRequest request, String moduleName, PamirsRequestParam requestParam) {
// Custom initialization logic
System.out.println("Custom session initialization for module: " + moduleName);
// More operations can be performed based on request and requestParam
}
}
```
--------------------------------
### MinIO Configuration Example
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/CommonSolutions/Back-End/file-storage-oss-cdn-configuration-and-operations.md
Example YAML configuration for MinIO. Ensure 'bucket', 'uploadUrl', 'downloadUrl', 'accessKeyId', and 'accessKeySecret' are set correctly for your MinIO instance.
```yaml
File system, MinIO configuration:
cdn:
oss:
name: minio
type: MINIO
bucket: pamirs (modify according to actual situation)
uploadUrl: http://192.168.243.6:32190 (modify according to actual situation)
downloadUrl: http://192.168.243.6:9000 (modify according to actual situation)
accessKeyId: Your accessKeyId
accessKeySecret: Your accessKeySecret
# Modify according to actual situation
mainDir: upload/
validTime: 3600000
timeout: 600000
active: true
referer:
localFolderUrl:
```
--------------------------------
### Set MySQL Service Permissions and Enable Boot Start
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/CommonSolutions/Back-End/environment-deployment-designer-on-neokylin-mips64.md
Make the MySQL service file executable and configure systemd to enable the service to start automatically on boot.
```bash
chmod +x mysqld.service
systemctl enable mysqld.service
```
--------------------------------
### File Storage Configuration Example (Alibaba Cloud OSS)
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/Reference/Back-EndFramework/AdvanceAPI/fileclient-API.md
Example YAML configuration for Alibaba Cloud OSS, specifying bucket details, URLs, credentials, and timeouts.
```yaml
cdn:
oss:
name: 阿里云
type: OSS
bucket: your-bucket-name
uploadUrl: oss-cn-hangzhou.aliyuncs.com
downloadUrl: oss-cn-hangzhou.aliyuncs.com
accessKeyId: your-access-key-id
accessKeySecret: your-access-key-secret
mainDir: upload/
validTime: 3600000 # Signature validity period (milliseconds)
timeout: 600000 # Request timeout
active: true
```
--------------------------------
### Database Dialect Configuration Example
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/Reference/Back-EndFramework/module-API.md
Configuration example for database dialect information, specifying type, version, and major version for data sources.
```yaml
pamirs:
dialect: # MySQL8.0 can be left unconfigured
ds:
base: # Dialect information of the data source in pamirs.datasource, corresponding to the key
type: MySQL
version: 8.0
majorVersion: 8
pamirs: # Dialect information of the data source in pamirs.datasource, corresponding to the key
type: MySQL
version: 8.0
majorVersion: 8
```
--------------------------------
### Upyun Configuration Example
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/CommonSolutions/Back-End/file-storage-oss-cdn-configuration-and-operations.md
Example YAML configuration for Upyun. Set 'bucket', 'uploadUrl', 'downloadUrl', 'accessKeyId', and 'accessKeySecret' according to your Upyun service details.
```yaml
cdn:
oss:
name: Upyun
type: UPYUN
bucket: pamirs (modify according to actual situation)
uploadUrl: v0.api.upyun.com
downloadUrl: v0.api.upyun.com
accessKeyId: Your accessKeyId
accessKeySecret: Your accessKeySecret
# Modify according to actual situation
mainDir: upload/
validTime: 3600000
timeout: 600000
active: true
referer:
```
--------------------------------
### Start Oinone Designer with Docker Compose
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/InstallOrUpgrade/CommunityEdition.md
Start the Oinone Designer service using Docker Compose. The first startup may take a long time.
```shell
# MacOS/Linux
docker compose up -d
# Windows
docker compose -p oinone up -d
```
--------------------------------
### Install Dependencies for Custom Chart SDK
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/CommonSolutions/Back-End/visual-build-data-visualization-lowcode-no-code-charts.md
Run this command in the root directory of the unzipped SDK to install necessary project dependencies.
```bash
npm i
```
--------------------------------
### Internal Framework Call Example
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/Reference/Back-EndFramework/AdvanceAPI/request-context-API.md
This is an example of an internal framework call for request preparation. Users typically do not need to invoke this method manually.
```java
// Example of internal framework call (users do not need to call manually)
SessionPrepareTemplate.prepare(request, moduleName, requestParam);
```
--------------------------------
### Start Qiankun in Main Application Component
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/CommonSolutions/Front-End/application-micro-frontend-qiankun-integration.md
Initiate Qiankun when the micro-application's mounting point DOM is ready. This ensures Qiankun is only started once.
```javascript
```
--------------------------------
### Install GraphiQL Globally
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/CommonSolutions/Back-End/development-assistance-generate-api-docs-with-graphql.md
Install GraphiQL globally using npm or yarn for local environment usage. Consider using a Taobao mirror source if downloads fail.
```bash
npm install -g graphiql
```
--------------------------------
### Java Application Startup with JVM and Program Arguments
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/CommonSolutions/Back-End/project-deployment-oinone-designer-deployment-parameters.md
Illustrates the general command structure for starting a Java application, specifying JVM options and program arguments.
```shell
java [JVM_OPTIONS?] -jar boot.jar [PROGRAM_ARGS?]
```
--------------------------------
### Execute Startup Script
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/CommonSolutions/Back-End/project-deployment-oinone-designer-offline-jar-deployment.md
Run the startup script to initiate the backend service. This script will print the root paths for backend, frontend, and Nginx configurations.
```shell
sh startup.sh
```
--------------------------------
### Verify JDK Installation on macOS
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/Tutorials/Dev-ENV/JDK-setup.md
Lists all installed Java versions and checks the active Java version. Useful for confirming correct setup.
```shell
/usr/libexec/java_home -V
```
```shell
java -version
```
--------------------------------
### HTTP GET Request for Weather Query
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/UserManual/Designers/IntegratedDesigner/connector.md
This is an example of an HTTP GET request to the Weather WebService to query supported cities. It appends the query parameter directly to the URL.
```plain
# HTTP GET Request Example
GET /WebServices/WeatherWebService.asmx/getSupportCity?byProvinceName=北京 HTTP/1.1
Host: www.webxml.com.cn
```
--------------------------------
### Complete File Upload Example
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/CommonSolutions/Back-End/file-storage-oss-cdn-configuration-and-operations.md
A comprehensive example demonstrating how to upload multiple files from a directory to OSS, retrieve their download URLs, and store them in a map. Handles potential exceptions during file processing.
```java
private static Map uploadFiles(File unzipDirectory) {
Map result = new HashMap<>();
File[] files = unzipDirectory.listFiles();
if (files == null) {
return result;
}
for (File file : files) {
try (FileInputStream is = new FileInputStream(file)) {
// The file name concatenation is just an example; modify it according to actual needs
String fileName = "widgetFile/" + file.getName();
FileClientFactory.getClient().uploadByFileName(fileName, is);
String url = FileClientFactory.getClient().getDownloadUrl(fileName);
result.put(file.getName(), url);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
return result;
}
```
--------------------------------
### Raw Task Data Structure
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/Tutorials/MasterTheFront-endFramework/chapter2-create-a-gantt-view.md
This is an example of raw task data before processing. It includes basic task information like code, name, start date, and end date.
```json
[
{
"code": "T007",
"name": "Data Analysis and Report Creation",
"taskStartDate": "2025-05-26",
"taskEndDate": "2025-05-30",
"id": "741211385631442610"
},
{
"code": "T006",
"name": "Data Collection and Entry",
"taskStartDate": "2025-05-22",
"taskEndDate": "2025-05-26",
"id": "741211385631442591"
},
...
]
```
--------------------------------
### Persistence Configuration Example
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/Reference/Back-EndFramework/module-API.md
Configure global and data source specific settings for automatic database and table creation. Global settings apply by default, while data source specific settings override them.
```yaml
pamirs:
persistence:
global:
# Global configuration for whether to automatically create databases, default is true
autoCreateDatabase: true
# Global configuration for whether to automatically create data tables, default is true
autoCreateTable: true
:
# Data source configuration for whether to automatically create databases, default is true
autoCreateDatabase: true
# Data source configuration for whether to automatically create data tables, default is true
autoCreateTable: true
```
--------------------------------
### Implement Custom AuthFilterService to Skip Path Permissions
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/CommonSolutions/Back-End/permission-extension-how-to-skip-fixed-path-permissions.md
Implement the `AuthFilterService` interface to define custom logic for access control. This example skips permission checks for paths starting with a predefined `skipPath`.
```java
package pro.shushi.pamirs.top.api.spi;
import org.apache.commons.lang3.StringUtils;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import pro.shushi.pamirs.auth.api.spi.AuthFilterService;
import pro.shushi.pamirs.boot.web.session.AccessResourceInfoSession;
import pro.shushi.pamirs.meta.common.spi.SPI;
@Order(88)
@Component
@SPI.Service
public class CustomAuthFilterService implements AuthFilterService {
public static final String skipPath = "/top_demo/uiMenuc6238c29bca44250a041691565056a63/ACTION#top.Teacher#uiView2b60cc6daa334c7280cb78207d41addc";
@Override
public Boolean isAccessAction(String model, String name) {
String path = AccessResourceInfoSession.getInfo().getOriginPath();
if (StringUtils.isNotEmpty(path) && path.startsWith(skipPath)) {
// Returning true indicates access validation passed
return true;
}
return null;
}
@Override
public Boolean isAccessAction(String path) {
if (StringUtils.isNotEmpty(path) && path.startsWith(skipPath)) {
// Returning true indicates access validation passed
return true;
}
return null;
}
}
```
--------------------------------
### Project Structure with .env File
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/Reference/Front-EndFramework/environment.md
Illustrates the typical project structure when using a .env file for environment configuration.
```shell
kunlun-boot
├── .env
├── public
│ ├── favicon.ico
│ └── index.html
├── src
├── vue.config.js
├── package.json
└── README.MD
```
--------------------------------
### Fetch Filtered Data with RSQL
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/Tutorials/DiscoverTheFront-endFramework/chapter2-build-a-dashboard.md
Pass RSQL query strings to the service method to filter the dataset before fetching. This allows for dynamic data retrieval based on specific conditions. The example filters by 'code' starting with 'a'.
```typescript
protected async mounted() {
super.mounted();
this.count = await ResourceCountryGroupService.countByWrapper("code =like= 'a'");
}
```
--------------------------------
### Install npm Packages
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/FAQ/environment-setup-npm-permission-denied-on-windows.md
Installs npm packages after clearing the cache or resolving other installation issues.
```bash
npm install
```
--------------------------------
### Initialize Dameng Database User and Permissions
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/CommonSolutions/Back-End/data-dialect-dameng-database-deployment.md
SQL script to create a role, grant necessary privileges, create a tablespace, and initialize a user with the role for Dameng Database.
```sql
-- init oinone role (role name can be modified by oneself)
CREATE ROLE OINONE;
GRANT CREATE SCHEMA,
CREATE TABLE,
CREATE INDEX,
INSERT ANY TABLE,
UPDATE ANY TABLE,
select ANY TABLE,
SELECT ANY VIEW
TO OINONE;
SELECT * FROM DBA_ROLES;
SELECT * FROM DBA_SYS_PRIVS WHERE GRANTEE='OINONE';
-- init root user (user name can be modified by oneself)
CREATE TABLESPACE ROOT DATAFILE 'ROOT.DBF' SIZE 128;
CREATE USER "root" IDENTIFIED BY "shushi@2019";
ALTER USER "root" DEFAULT TABLESPACE ROOT DEFAULT INDEX TABLESPACE ROOT;
GRANT RESOURCE,OINONE TO ROOT;
select * FROM DBA_ROLE_PRIVS WHERE GRANTEE='ROOT';
```
--------------------------------
### Configure Startup Modules
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/Reference/Back-EndFramework/module-API.md
Specify modules to load when the project starts. Cross-project calls are handled automatically.
```yaml
pamirs:
boot:
modules:
- base
- common
- sequence
- resource
- user
- auth
- message
- international
- business
- expenses
```
--------------------------------
### Install TypeScript 4.x
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/Tutorials/setup-guide.md
Installs TypeScript version 4.x globally using npm. Ensure Node.js and npm are installed and configured.
```shell
# Install typescript 4.x
npm install -g typescript@^4
```
--------------------------------
### Add Data Visualization Core Dependency to Boot Startup Project
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/CommonSolutions/Back-End/dependency-configuration-how-to-add-data-visualization-dependencies.md
Include the `pamirs-data-visualization-core` dependency in the `pom.xml` of your boot startup project.
```xml
pro.shushi.pamirs.data.visualization
pamirs-data-visualization-core
```
--------------------------------
### Install Git on Linux (Apt)
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/Tutorials/Dev-ENV/Git-setup.md
Install Git on Linux systems using the apt package manager, common on Debian and Ubuntu. This command installs Git and its required packages.
```shell
apt-get install -y git
```
--------------------------------
### Configure Professional Edition Startup Modules
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/InstallOrUpgrade/from-community-to-enterprise.md
Include 'designer_metadata', 'data_audit', and 'print' modules for the Professional Edition. This configuration should be placed in application.yml.
```yaml
pamirs:
boot:
modules:
# other modules
# ...
# standard version modules
- designer_metadata
# professional version modules
- data_audit
- print
```
--------------------------------
### Install Git on Linux (Yum)
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/Tutorials/Dev-ENV/Git-setup.md
Install Git on Linux systems using the yum package manager, commonly found on CentOS. This command ensures Git is installed with the necessary dependencies.
```shell
yum install -y git
```
--------------------------------
### OSS File Upload Examples
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/zh/DevManual/Reference/Back-EndFramework/module-API.md
Java code examples for uploading files to OSS. The first example uploads a file with a given name and byte data, while the second uploads from an InputStream.
```java
// 示例 1
CdnFile cdnFile = FileClientFactory.getClient().upload(fileName, data/**byte[]*/);
// 示例 2
String fileName = "路径名/" + file.getName();
FileClientFactory.getClient().uploadByFileName(fileName, is/**InputStream*/);
```
--------------------------------
### Install mustache.js Dependency
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/Reference/Front-EndFramework/Services/translate-service.md
Installs the mustache.js library, a third-party dependency for template replacement.
```bash
npm install mustache@4.2.0
```
--------------------------------
### Example: Sending Emails Directly
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/zh/DevManual/Reference/StandardModule/message-API.md
Demonstrates how to instantiate and use the EmailSender to send emails directly using the EmailPoster. Includes error handling and logging.
```java
List receiveEmails = Collections.singletonList("testhaha@shushi.pro"); // 需替换为实际收件人邮箱
EmailSender emailSender = (EmailSender) MessageEngine.get(MessageEngineTypeEnum.EMAIL_SEND).get(null);
String title = "标题";
String body = "内容(HTML";
String sender = "发件人名称";
String replyEmail = "回复邮箱";
EmailPoster emailPoster = new EmailPoster()
.setSender(sender)
.setTitle(title)
.setBody(body)
.setReplyTo(replyEmail);
StringBuilder errorMessages = new StringBuilder();
receiveEmails.forEach(email -> {
try {
if (!emailSender.send(emailPoster.setSendTo(email))) {
log.error("发送邮件失败:emailPoster:{}", JsonUtils.toJSONString(emailPoster));
errorMessages.append("发送邮件失败,错误信息:系统异常,邮箱:").append(email).append(";");
}
} catch (Exception e) {
log.error("发送邮件失败:emailPoster:{},异常:{}", JsonUtils.toJSONString(emailPoster), e);
String errorMsg = transferEmailThrowMessage(e);
errorMessages.append("发送邮件失败,错误信息:").append(errorMsg).append(",邮箱:").append(email).append(";");
}
});
```
--------------------------------
### Initialize VueOioProvider
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/CommonSolutions/Front-End/network-request-oioprovider-detailed-explanation-custom-error-interception.md
Import and call VueOioProvider to initialize the platform. This is the entry point for OioProvider.
```typescript
import { VueOioProvider } from '@oinone/kunlun-dependencies';
VueOioProvider();
```
--------------------------------
### Upload File to OSS using FileClient
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/Reference/Back-EndFramework/module-API.md
Examples demonstrating file upload to OSS. The first example uploads a file using its name and byte array data. The second example uploads using a filename and an InputStream.
```java
// Example 1
CdnFile cdnFile = FileClientFactory.getClient().upload(fileName, data/**byte[]*/);
// Example 2
String fileName = "pathname/" + file.getName();
FileClientFactory.getClient().uploadByFileName(fileName, is/**InputStream*/);
```
--------------------------------
### Install dmidecode on Debian/Ubuntu
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/FAQ/startup-oinone-license-usage-faq.md
Install the dmidecode package on Debian-based systems like Ubuntu using apt-get.
```shell
# debian (e.g., Ubuntu)
apt-get install dmidecode
```
--------------------------------
### correctingStartShowTimeDefaultValue
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/Reference/Front-EndFramework/Widget/Field/form-field.md
Corrects the start time default value to ensure it's not earlier than the processed start date.
```APIDOC
## correctingStartShowTimeDefaultValue
### Description
Correct the start time default value to ensure it is not earlier than the processed start date.
### Type
`(e: string | Date) => string | Date`
### Parameters
- **e** (string | Date): Original time value.
```
--------------------------------
### Add ES Client and Core Dependencies to Startup Project
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/Reference/Back-EndFramework/AdvanceAPI/ES.md
Specify the ES client and core Pamirs dependencies in your startup project's pom.xml. Ensure the ES client version is explicitly defined.
```xml
org.elasticsearch.client
elasticsearch-rest-client
8.4.1
jakarta.json
jakarta.json-api
2.1.1
pro.shushi.pamirs.core
pamirs-sql-record-core
pro.shushi.pamirs.core
pamirs-channel-core
```
--------------------------------
### Example: Sending a System Message
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/Reference/StandardModule/message-API.md
Demonstrates how to obtain a message sender instance and use it to send a system message. Ensure the `recipientUser` is properly initialized.
```java
MessageSender mailSender = (MessageSender) MessageEngine.get(MessageEngineTypeEnum.MAIL_SEND).get(null);
SystemMessage msg = new SystemMessage().setMessages(List.of(
new PamirsMessage()
.setName("Task Reminder")
.setSubject("Task Reminder")
.setBody("You have new to-do items
")
.setMessageType(MessageTypeEnum.NOTIFICATION)
)).setPartners(List.of(recipientUser));
messageSender.sendSystemMail(msg);
```
--------------------------------
### Verify Node.js Installation (Linux/macOS/Windows)
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/Tutorials/Dev-ENV/Node.js-setup.md
Check the installed Node.js version by running 'node --version' in the terminal.
```shell
# Verify environment variables
node --version
v20.16.0
```
--------------------------------
### Install GraphiQL as a Development Dependency
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/CommonSolutions/Back-End/development-assistance-generate-api-docs-with-graphql.md
Install GraphiQL as a development dependency within your project using npm or yarn.
```bash
npm install graphiql
```
--------------------------------
### Linux (arm64 Architecture) Platform Startup
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/CommonSolutions/Back-End/environment-deployment-backend-lowcode-designer-jar-startup.md
Instructions for starting the Oinone No-Code Designer JAR on Linux with an arm64 architecture. Includes direct and background execution methods.
```shell
# Direct run
./linux-boot-arm64 java -jar ./pamirs-designer-boot-4.7.0.jar
```
```shell
# nohup background run
nohup ./linux-boot-arm64 java -jar ./pamirs-designer-boot-4.7.0.jar > out.log 2>&1 &
```
--------------------------------
### DemoUserPatternCheckApi Example
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/Reference/StandardModule/user-business-API.md
An example implementation of the `UserPatternCheckApi` interface, demonstrating how to customize validation rules for password and login fields.
```APIDOC
## DemoUserPatternCheckApi
### Description
An example implementation of `UserPatternCheckApi` that customizes password and login validation rules.
### Methods
- `checkPassword(String password)`: Overrides the default password validation to enforce custom rules (e.g., length between 3 and 8 characters).
- `checkLogin(String login)`: Overrides the default login validation to ensure the login is not blank.
### Custom Logic Example
- **Password**: Length must be between 3 and 8 characters.
- **Login**: Must not be empty.
```
--------------------------------
### Add JVM Parameters for IDEA Startup
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/Tutorials/setup-guide.md
Add these JVM parameters to your IDEA run configuration's VM options to enable proper startup. Refer to the documentation for detailed setup instructions.
```shell
--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED
--add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
--add-opens=jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED
--add-opens=jdk.compiler/com.sun.tools.javac.launcher=ALL-UNNAMED
--add-opens=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED
--add-opens=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED
--add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
--add-opens=jdk.compiler/com.sun.tools.javac.platform=ALL-UNNAMED
--add-opens=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED
--add-opens=jdk.compiler/com.sun.tools.javac.resources=ALL-UNNAMED
--add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
--add-opens=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
--add-opens=jdk.source/com.sun.source.tree=ALL-UNNAMED
--add-opens=java.base/java.lang=ALL-UNNAMED
--add-opens=java.base/java.lang.annotation=ALL-UNNAMED
--add-opens=java.base/java.lang.constant=ALL-UNNAMED
--add-opens=java.base/java.lang.invoke=ALL-UNNAMED
--add-opens=java.base/java.lang.module=ALL-UNNAMED
--add-opens=java.base/java.lang.ref=ALL-UNNAMED
--add-opens=java.base/java.lang.reflect=ALL-UNNAMED
--add-opens=java.base/java.lang.runtime=ALL-UNNAMED
--add-opens=java.base/java.io=ALL-UNNAMED
--add-opens=java.base/java.lang=ALL-UNNAMED
--add-opens=java.base/java.math=ALL-UNNAMED
--add-opens=java.base/java.net=ALL-UNNAMED
--add-opens=java.base/java.nio=ALL-UNNAMED
--add-opens=java.base/java.security=ALL-UNNAMED
--add-opens=java.base/java.text=ALL-UNNAMED
--add-opens=java.base/java.time=ALL-UNNAMED
--add-opens=java.base/java.util=ALL-UNNAMED
--add-opens=java.xml/com.sun.org.apache.xpath.internal.jaxp=ALL-UNNAMED
--add-opens=java.base/jdk.internal.access=ALL-UNNAMED
```
--------------------------------
### Normal Consumption Example
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/Reference/Back-EndFramework/AdvanceAPI/MQ-API.md
Provides an example of setting up a consumer using the @NotifyListener annotation for normal message consumption.
```APIDOC
## Normal Consumption Example
```java
@Bean
@NotifyListener(
topic = "oinone-trade",
tags = "CREATE",
consumerType = ConsumerType.CONCURRENTLY
)
public NotifyConsumer orderCreateConsumer() {
return message -> {
OrderMessage order = message.getPayload();
// Process order creation logic
};
}
```
```
--------------------------------
### Install dmidecode on Fedora/CentOS/RedHat
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/FAQ/startup-oinone-license-usage-faq.md
Install the dmidecode package on RPM-based systems like Fedora, CentOS, or RedHat using yum.
```shell
# rpm (e.g., Fedora/CentOS/RedHat)
yum install dmidecode
```
--------------------------------
### Force Rollback with Startup Parameter
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/InstallOrUpgrade/version-upgrade.md
Use this command to force overwrite and install the current runtime version if an upgrade cannot be completed or needs to be rolled back. Ensure to include other necessary parameters.
```bash
java -jar xxx.jar -PgoBack=true [other parameters]
```
--------------------------------
### Common Startup Script with Custom Configurations
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/CommonSolutions/Back-End/environment-deployment-backend-lowcode-designer-jar-startup.md
A comprehensive bash script for starting the Oinone No-Code Designer on Linux. It sets environment variables, specifies configuration paths, and tails the output log. This script is useful for background execution with custom JVM parameters and application configurations.
```shell
#!/bin/bash
# Directory where the script is located
home=$(cd "$(dirname "$0")" && pwd)
# Startup jar path
jarPath=$home/pamirs-designer-boot-4.7.0.jar
# Configuration path
applicationPath=$home/application.yml
# License information
subject=
licensePath=
nohup $home/linux-boot java -Duser.timezone=GMT+08:00 -Dhttps.protocols=TLSv1.2 -Dfile.encoding=UTF-8 \
-jar $jarPath \
--spring.config.location=$applicationPath \
-Psubject=$subject \
-Plicense=$licensePath \
-Plifecycle=INSTALL > $home/out.log 2>&1 &
sleep 1
tail -200f $home/out.log
```
--------------------------------
### Invoke External Interface Example
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/Reference/StandardModule/EIP-API.md
Example of how to define and configure an external service integration using EIP annotations in Java.
```APIDOC
## POST /data
### Description
Invokes an external service with specified configuration and parameter mapping.
### Method
POST
### Endpoint
/data
### Parameters
#### Request Body
- **data** (TestOpenApiModel) - Required - The input data model for the external service.
### Request Example
```json
{
"id": "example_id",
"some_other_field": "some_value"
}
```
### Response
#### Success Response (200)
- **result** (SuperMap) - The result from the external service.
#### Response Example
```json
{
"result": {
"key1": "value1",
"key2": "value2"
}
}
```
```
--------------------------------
### Form Validation Example
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/Reference/Back-EndFramework/AdvanceAPI/message-hub-API.md
Example demonstrating form validation using Message Hub to add field-level error messages.
```APIDOC
## Form Validation Scenario
``` java
@Function
public Boolean checkData(TestConstraintsModel data) {
String name = data.getName();
boolean success = true;
if (StringUtils.isBlank(name)) {
PamirsSession.getMessageHub()
.msg(Message.init()
.setLevel(InformationLevelEnum.ERROR)
.setField(LambdaUtil.fetchFieldName(TestConstraintsModel::getName))
.setMessage("名称为必填项"));
success = false;
}
if (name.length() > 4) {
PamirsSession.getMessageHub()
.msg(Message.init()
.setLevel(InformationLevelEnum.ERROR)
.setField(LambdaUtil.fetchFieldName(TestConstraintsModel::getName))
.setMessage("名称过长,不能超过4位"));
success = false;
}
return success;
}
```
### Explanation
Validates the `name` field, adds field-level error messages, automatically marks `success=false`, and the front end displays errors below the `name` field.
```
--------------------------------
### Windows Platform Startup
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/CommonSolutions/Back-End/environment-deployment-backend-lowcode-designer-jar-startup.md
Command to start the Oinone No-Code Designer JAR on a Windows platform.
```shell
.\win-boot.exe java -jar .\pamirs-designer-boot-4.7.0.jar
```
--------------------------------
### Interceptor Function Hook Example
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/Reference/Back-EndFramework/functions-API.md
Example of an interceptor function that runs before a function's execution. It demonstrates how to hook into model operations.
```APIDOC
## Interceptor Function Hook
Interceptor functions can intercept processing before and after function execution.
```java
@Component
public class TestModelCreateBeforeHook implements HookBefore {
@Override
@Hook(model = {TestModel.MODEL_MODEL}, fun = {"create"}, priority = 1)
public Object run(Function function, Object... args) {
PamirsSession.getMessageHub().info("TestModel's create function BeforeHook");
return args;
}
}
```
```
--------------------------------
### MINIO Configuration Example
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/zh/DevManual/Reference/Back-EndFramework/module-API.md
Example YAML configuration for MINIO. This is useful for scenarios without a public network access address for OSS. Refer to the provided link for detailed configuration instructions.
```yaml
cdn:
oss:
name: minio
type: MINIO
bucket: pamirs(根据实际情况修改)
uploadUrl: http://192.168.243.6:32190(根据实际情况修改)
downloadUrl: http://192.168.243.6:9000(根据实际情况修改)
accessKeyId: 你的 accessKeyId
accessKeySecret: 你的 accessKeySecret
# 根据实际情况修改
mainDir: upload/
validTime: 3600000
timeout: 600000
active: true
referer:
localFolderUrl:
```
--------------------------------
### Configure Standard Edition Startup Modules
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/InstallOrUpgrade/from-community-to-enterprise.md
Add the 'designer_metadata' module to enable features specific to the Standard Edition. This configuration should be placed in application.yml.
```yaml
pamirs:
boot:
modules:
# other modules
# ...
# standard version modules
- designer_metadata
```
--------------------------------
### Import Metadata Example
Source: https://github.com/oinone/oinone-docs/blob/7.x/docs/en/DevManual/CommonSolutions/Back-End/project-deployment-data-visualization-import-export.md
Example Java code demonstrating how to import metadata, specifically for chart designer data, into the oinone platform.
```APIDOC
## Import Example Code in Business Project
### Description
Example code for importing metadata, specifically for chart designer data, into the oinone platform. This code snippet illustrates the process within a Java application context.
### Language
Java
### Code Example
```java
@Slf4j
@Order(Integer.MAX_VALUE-1)
@Component
public class DemoModuleAppInstall implements MetaDataEditor, LifecycleCompletedAllInit {
// JSON metadata of the page exported by the process designer
private static final String INSTALL_DATAVI_META_PATH = "install/datavi_data.json";
@Override
public void edit(AppLifecycleCommand command, Map metaMap) {
if(StringUtils.isBlank(INSTALL_DATAVI_META_PATH)) return;
log.info("Start installing metadata");
try {
InitializationUtil util = InitializationUtil.get(metaMap, DemoModule.MODULE_MODULE, DemoModule.MODULE_NAME);
if (null != util) {
// Designer metadata
if(StringUtils.isNotBlank(INSTALL_DATAVI_META_PATH)) {
log.info("Start installing chart metadata");
DesignerInstallHelper.mateInitialization(util, INSTALL_DATAVI_META_PATH, DemoModule.MODULE_MODULE,
DemoModule.MODULE_NAME);
}
}
} catch (Exception e) {
log.error("Exception in importing chart designer metadata", e);
}
}
@Override
public void process(AppLifecycleCommand command, Map runModuleMap) {
if(StringUtils.isNotBlank(INSTALL_DATAVI_META_PATH)) {
log.info("Start installing [chart] designer data");
// Support remote calls, but the execution lifecycle must be LifecycleCompletedAllInit or later. If the designer is installed locally, there is no requirement.
DesignerInstallHelper.bizInitialization(INSTALL_DATAVI_META_PATH);
}
}
}
```
```