Zum Hauptinhalt springen

Chapter 9 Portal Integration

Overview: Portal Integration

Portal integration refers to configuring data source connections from external systems for portal components. Currently, three connection methods are supported:

• Internal Connection

  • Component data sources from this system and EasyCraft business modules.
  • Supports direct synchronization through internal interfaces.

• Third-Party Connection

  • Supports manual integration of third-party systems.
  • Requires developing custom component data sources, then uploading them to the EasyCraft platform.

• Platform Integration

  • Supports adding new platform-integrated systems.
  • Configuration is done through the interface by selecting integrated platform interface data sources.

9.1 Discovering This System

Internal Connection: System Discovery and Synchronization

By discovering systems, synchronize portal component data sources from this system and the EasyCraft business modules as follows:

  1. In Portal Management > Portal Integration, execute "Search current system" to synchronize portal component data sources from all business modules into the portal integration module, as shown:
  2. Click Logs to view successful or failed synchronization records for this system.
  3. Click System Details to view all synchronized portal component data sources from this system.

9.2 Integrated System Connection Configuration

Third-Party Integration via the Integration Platform

The EasyCraft Digital Work Platform's portal management also supports configuring third-party data source connections through integrated platform registration interfaces.

To integrate third-party interfaces, refer to the configuration guide in:

Integration Platform > Integration Scenarios > Portal Integration

Steps to Create Integrated Component Data Sources

  1. Login to the EasyCraft Digital Work Platform.
  2. Navigate to: Portal Management > Portal Integration, then click "New System" in the connected systems list.
  3. On the Create New System page:
    • Select the integrated system type.
    • The address and system number will be auto-filled.
    • Click Confirm.
  4. The new system appears in the system list. Click on it to access Data Source Details.
  5. Click the New button to create a new component data source.
  6. Select a data source interface created by the Integration Platform.
  7. Configure parameters and click Save.

Parameter Configuration Guide

Basic Parameters

FieldDescription
Data NameCustomizable name for the component data source.
ModuleSelect or add the business module it belongs to.
Data FormatFormat supported by the interface; determined during interface creation.
Allow Anonymous AccessIf disabled (default), requires login. If enabled, allows access without login.
Accessible UsersLeave empty for all users. Set specific users to restrict access.

Input Parameters

Value MethodDescription
Fixed ValueEnter static content based on parameter type (e.g., user ID, phone).
User-definedParameter left blank; configured during portal usage.
Use Component ParameterFill in a component parameter (e.g., starttime, endtime).
From CookiePull value from a browser cookie (e.g., LtpaToken, X-AUTH-TOKEN).
From HeaderPull value from HTTP header (e.g., Content-Type).
Null ValueLeave the parameter without a value.

Button Configuration

You can configure buttons that appear on the portal component:

  • Add: Add new content.
  • More: View more data.
  • Custom: Custom button with your specified name and action.

Final Steps

  1. When configuring the portal:
    • Select: Business Component > Integrated System > Integrated Component Data Source
  2. Preview the integrated component data source on the portal.

9.3.1 Third-party system access configuration

Configuring a Third-Party System in EasyCraft Portal

Follow these steps to integrate a third-party system into the EasyCraft portal:

1. Create a New System

  • Navigate to Portal Backend Management.
  • Select Portal Management > Portal Integration.
  • Click "New System".

2. Fill in System Data

  • Enter the name and domain of the third-party system (without a trailing slash /).
  • Optionally, add a system description.
  • Click Confirm.

3. Configure Data Source

  • Click System Details.
  • Download the template provided.
  • Follow the "Data Source File Content Configuration Guide" to fill in the required information.
  • Package the files and import them into the system.

Tip:
Enable the SSO (Single Sign-On) function and configure the identifier parameter.
This ensures that when clicking this data source in the portal, the identifier will redirect the user to the third-party page — achieving single sign-on capability.

4. Portal Configuration

  • While configuring the portal, navigate to:
    • Business Component > Third-Party System > Select Module Component Data Source.

5. Preview

  • Preview the custom component data source to ensure it functions correctly in the portal.

9.3.2.1 Documentation

Third-Party System Data Source Configuration Notes

When uploading third-party system data sources to the EasyCraft platform, please note the following:

Limitations

  • Multilingual Recognition is not currently supported for third-party system uploads.

Multilingual Identifier Format

For fields such as names and prompts, use the following syntax:

  • {module.name}
  • {sys-demo:module.name}

API Request URL Guidelines

  • If using a relative address, it must start with /.

Calendar Component Parameter Format

When integrating calendar components, use the following dynamic timestamp variables:

  • Start Time: !{startTime}
  • End Time: !{endTime}

These values are passed as timestamps.

URL Parameter Escaping

When passing multiple parameters in a URL, do not use & directly, as it may cause errors.

  • Use the HTML escape sequence: &

Example:

url="sys://user/sys-notify/sysNotifyProcess?fdId=!{fdId}&fdType=!{fdType}"

# 9.3.2.2 JSON Data Structure Explanation

| Field | Name | Required | Remarks |
|---------|-------------------|----------|-----------------------------------------|
| success | Whether successful| Yes | true for success, false for failure |
| code | Error code | Yes | |
| msg | Error message | Yes | |
| data | Return data | No | |


# 9.3.2.3 Common code list

| Code value | Code description |
|--------------------|--------------------|
| return.optSuccess | Operation successful |
| return.optFailure | Operation failed |
| status.401 | Not logged in |
| status.403 | No permission |


# 9.3.2.4 <modules> Used to add modules (required)

```xml
<modules>
<module id="sys-portal-component" name="{sys-portal:systemComponentModule.name}"/>
</modules>
FieldNameRequiredRemarks
idUnique identifierYesUse letters and symbols; Rules: Module name words or letters
nameNameYes

9.3.2.5 <source> is used to add data sources (Required)

<source 
id="ds.sys-portal.link.plaintText"
name="{sys-portal:sysPortalLink.plaintText}"
format="data.link"
anonymous="false"
moduleId="sys-portal"
desc="Shortcut - Plain Text Type">
...
</source>

Field Description

FieldNameRequiredRemarks
idUnique identifierYesCombine letters and data
nameNameYes
formatData formatYesPlease refer to the front-end data format list
anonymousWhether anonymousYesYes: true; No: false
moduleIdModule IDYes
descData source descriptionNo
thumbnailThumbnailNoThird-party upload not supported

Child Element Configuration Items

  • Request configuration: Required
  • Parameter configuration: Optional
  • Operation item configuration: Optional
  • Default display information: Required
  • Extended configuration items: Optional

9.3.2.6 <request> is used to add request information (Required)

<source id="ds.sys-portal.link.plaintText" name="{sys-portal:sysPortalLink.plaintText}" format="data.link" anonymous="false" moduleId="sys-portal" desc="Shortcut - Plain Text Type">
...
</source>

Field Description

FieldNameRequiredRemarks
idUnique identifierYesCombine letters and data
nameNameYes
formatData formatYesPlease refer to the front-end data format list
anonymousWhether anonymousYesYes: true; No: false
moduleIdModule IDYes
descData source descriptionNo
thumbnailThumbnailNoThird-party upload not supported

Child Element Configuration Items

  • Request configuration: Required
  • Parameter configuration: Optional
  • Operation item configuration: Optional
  • Default display information: Required
  • Extended configuration items: Optional

9.3.2.7 <config> Used to add request parameters

Data Source Configuration Item

<configs>    
<config
name="Shortcut"
key="fdId"
type="list"
required="true"
default="1hj2h314jhhj41jh412h4"
placeholder="Please select a shortcut..."
>
<content>
<![CDATA[
{
"url": "/data/sys-portal/sysPortalLink/listPortlet",
"method": "post",
"data": {
"conditions": {
"fdType": {
"$eq": 10
}
}
},
"model": "com.easycraft.sys.portal.core.entity.content.SysPortalLink"
}
]]>
</content>
<enableWhen></enableWhen>
</config>
</configs>


| Field | Name | Required | Remarks |
| ------------- | -------------- | -------- | --------------------------------------------------------------------------- |
| `name` | Name | Yes | |
| `key` | Parameter key | Yes | Placeholder for data and param parameters in request config, e.g. `!{fdId}` |
| `type` | Parameter type | Yes | Refer to parameter type description |
| `required` | Required | Yes | |
| `default` | Default value | No | Multiple values separated by `,` or `;` |
| `placeholder` | Prompt message | No | Prompt message when inputting or selecting |
| `content` | Extended field | No | Different types have different content configurations |
| `enableWhen` | Sample data | No | Usage scenario, e.g.: `{key:xxx, value:ooo}` |
| `help` | Auxiliary info | No | Hover tooltip appears near the control marked with `?` |
| `prefix` | Prefix | No | Text displayed before the parameter input box |
| `suffix` | Suffix | No | Text displayed after the parameter input box |



## 9.3.2.8 &lt;operation&gt; Used to add component buttons: e.g., More, Add
```xml

<operations>
<operation name="{button.more}" href="/km/review/index.jsp" mobileHref="/km/review/mobile" type="more" target="_blank">
</operation>
</operations>

Built-in Syntax href and mobileHref support the following configuration methods (where sys:// is replaced by the current system's base URL: href="sys://user/sys-notify/sysNotifyProcess"

Button URL with Parameters href="sys://user/sys-notify/sysNotifyProcess?fdId=!{fdId}&amp;fdType=!{fdType}"

FieldNameRequiredRemarks
nameNameYes
hrefPC linkYes
mobileHrefMobile linkNoIf not available, redirect to href
typeOperation methodYesAdd: create, More: more
targetLink MethodYesDefault is _blank; Options: _blank, _self, _parent, _top

<renders> Configuration

<renders>    
{
"desktop": "@elements/link-text",
"mobile": "@elements/link-text"
}
</renders>

Specify the Default Rendering for the Data Source:
Single value can be specified as:

{
"desktop": "@elements/link-text",
"mobile": "@elements/link-text1"
}

| Field | Name | Required | Remarks |
| ------- | ---------------------------- | -------- | -------------------------------------------------------- |
| desktop | Default rendering for PC | Yes | Refer to the frontend rendering list for rendering names |
| mobile | Default rendering for mobile | Yes | |

# 9.3.2.10 &lt;extendConfig&gt; Used for adding extensions

```xml
{"realTimePush",true}
FieldNameRequiredRemarks
desktopDefault rendering for PCYesRefer to the frontend rendering list for rendering names
mobileDefault rendering for mobileYes

9.3.2.11 Detailed introduction of <config> parameter types

Note: The following content corresponds to the <content> within the <config> tag

{ "min": 1, "max": 5, "format": "URL" }
FieldNameRequiredRemarks
minMinimum lengthNo
maxMaximum lengthNo
formatString formatNoOptional: URL (link), EMAIL (email), CNID (ID number), IPv4, TEL
{    "min" : 1,    "max" : 100,    "step":1,    "numberType" : "number"}
FieldNameRequiredRemarks
minMinimumNo
maxMaximumNo
stepStep sizeNoClick
numberTypeNumber typeNoOptional values: number, integer, float

• Page display size type=rowsize This configuration is for input box settings


Row number type, no extended attributes
{ }

• Enumeration type type=enum

{    "options" : [{        "label" : "Current month",        "value" : "month"    },{        "label" : "Current week",        "value" : "week"    }],    "showType": "radio",    "multi":false}
FieldNameRequiredRemarks
showTypeEnumeration display methodYesAvailable: radio, select, checkbox
multiMultiple selection allowedYesDefault false; checkbox defaults to true
optionsEnumeration listYes
labelDisplay nameYes
valueActual valueYes

Tree type type=tree For tree-type interfaces, it is necessary to support querying the subordinate list by the parent ID. The corresponding subordinate categories are then queried and displayed:

{            "url":"/data/sys-common/treexml",            "params":{               "s_bean":"kmCoprojectCategoryTreeService",               "parentId":"!{parentId}",               "nodeType":"!{nodeType}"            },            "canSelectCategory":true,           "idProperty":"value",           "nameProperty":"text",           "sysID":"",            "detailsUrl":"/data/sys-person/sysPersonPortlet/details?fdId=!{fdId}",           "displayProperty":"fdName"          }

Field Description Built-in parameter description:

!{fdId} and !{parentId} both obtain unique values through the value set by the property field idProperty, and the two field values are the same;
!{fdId} represents the placeholder for the detail value.
!{parentId} represents the placeholder for the parent ID.
!{nodeType} represents the placeholder for the node type (CATEGORY, TEMPLATE).

The tree-type interface returns information in XML or JSON as follows:

FieldNameRequiredRemarks
urlRequest URLYes
methodRequest methodYesPOST not supported
paramsRequest parametersNoUsed for GET requests
canSelectCategoryWhether category selectableYestrue: leaf only; false: all
dataTypeData return formatYesXML or JSON
idPropertyID attributeNoDefaults to 'value'
namePropertyName attributeNoDefaults to 'text'
sysIDSystem IDNo
detailsUrlDetail interfaceYesGET format with JSON
displayPropertyDisplay propertyYesMaps to nameProperty of data detail interface

Configuration Options

PropertyDescriptionRequiredNotes
canSelectCategoryWhether category can be selectedYestrue: only leaf nodes (nodes without children) can be selected; false: all can be selected
dataTypeData return formatYesSupports XML format, JSON format
idPropertyID attributeNoDefaults to the value field in returned data; uses fields in returned data as !{fdId}, !{parentId}
namePropertyName attributeNoDefaults to the text field from returned data; displays the field from the data format
sysIDSystem IDNoUsed when working with a system different from the current data source

Detailed Interface Configurations

Details must be in GET request format with JSON.

PropertyDescriptionRequiredNotes
detailsUrlData detail interfaceYesUsed during editing; requires displaying the display name corresponding to the type ID
displayPropertyDisplay propertyYesCorresponds to the name attribute of the data detail interface; defaults to the data dictionary's displayProperty

Public Configurations (EASYCRAFT Digital Work Platform)

PropertyDescriptionRequiredNotes
modelEntity nameNoFor built-in system use; third parties cannot use
detailsUrlData detail interfaceNoCan configure: /data/sys-portal/info?fdId=!{fdId}&model=?

API Configuration & Data Formats

Example Response Formats

XML Example

<RestResponse>
<success>true</success>
<data>
<text>Company News</text>
<value>15c1a1c78aabf1bc4ac4af04ea8999f9</value>
<nodeType>CATEGORY</nodeType>
<url>/data/origin-ekp/xxxx</url>
</data>
<data>
<text>Company News</text>
<value>15c1a1c78aabf1bc4ac4af04ea8999f9</value>
<nodeType>CATEGORY</nodeType>
<url>/data/origin-ekp/xxxx</url>
</data>
<msg/>
<code/>
</RestResponse>

JSON Example

{
"success": true,
"data": [
{
"text": "Company News 1",
"value": "15c1a1c78aabf1bc4ac4af04ea8999f9",
"nodeType": "CATEGORY"
},
{
"text": "Company News 2",
"value": "15c1a1c78aabf1bc4ac4af04ea8999f8",
"nodeType": "CATEGORY"
}
],
"msg": "",
"code": ""
}

List Type Configuration (type="list")

{
"url": "/data/sys-portal/sysPortalLink/listPortlet",
"method": "post",
"data": {
"offset": "!{offset}",
"pageSize": "!{pageSize}",
"conditions": {
"fdName": {
"$contains": "!{searchWord}"
}
}
},
"dataType": "json",
"idProperty": "fdId",
"nameProperty": "fdName",
"multi": true,
"detailsUrl": "/data/sys-portal/info?model=com.easycraft.sys.portal.core.entity.content.SysPortalLink&fdId=!{fdId}",
"displayProperty": "fdName"
}

FieldNameRequiredRemarks
urlRequest URLYesThe interface return data format
methodRequest methodYesPOST or GET
dataRequest paramsYesContains pagination & filters
OffsetCustom parameterYesCalculated as page number × items per page
Items per pageCustom parameterYesFixed parameter placeholder
dataTypeData return formatYesXML or JSON
idPropertyID attributeYesUses fields in returned data (!{fdId}, !{parentId})
namePropertyName attributeYesUses display fields from data
multiMultiple selectionYestrue = allowed, false = not allowed
sysIDSystem IDNoFor use with other systems
detailsUrlData detail interfaceYesMust be a GET request with JSON
displayPropertyDisplay propertyYesDefaults to data dictionary displayProperty
modelEntity nameNoOnly for built-in systems
{
"success": true,
"msg": "",
"code": "",
"data": {
"page": {
"pageSize": 0,
"offset": 0,
"totalSize": 100
},
"columns": [
{
"property": "string",
"title": "string"
}
],
"data": [
{
"href": "string",
"cells": [
{
"col": "string",
"value": "string"
}
]
}
]
}
}

Return Field Description

FieldNameRequiredRemarks
successSuccess flagYestrue = success, false = failure
codeError codeYesError identifier
msgError messageYesDescription of error
dataReturn dataNoResponse payload

Tree/List Information (JSON)

{
"success": true,
"data": [
{
"fdId": "abadf2231",
"value": "15c1a1c78aabf1bc4ac4af04ea8999f9"
}
],
"msg": "",
"code": ""
}

9.3.3.1 Interface Provision

Portal Module Extension Point

To allow the portal module to know which modules have configured data sources,
the corresponding extension points need to be implemented by this module.

Extension Point

package com.easycraft.sys.portal.annotation;

@PorletPoint(sysCode="ekp-cloud")


The entity service corresponding to the data source needs to implement the interface com.easycraft.sys.portal.api.IPortletApi to obtain data details during editing.

9.3.3.2 Interface Modification

Data Source XML Configuration

The interface and data format configured in the data source XML file must correspond.

Fields in the actual response can be more than defined, but must not be fewer.

Example Configuration

<source id="ds.sys-portal.link.plaintText" format="data.link" ...>
<request
method="POST"
dataType="json"
url="/data/sys-portal/sysPortalLink/portlet"
contentType="application/json">
...
</request>
...
</source>

Interface Response Format

The return data of the interface /data/sys-portal/sysPortalLink/portlet must conform to the agreed standard format.
The data field must match the expected data.link format.

Example Response

{
"success": true,
"code": "return.optSuccess",
"msg": "Your operation was successful!",
"data": [
{
"text": "Baidu",
"href": "http://www.baidu.com",
"target": "_blank"
},
{
"text": "Google",
"href": "https://www.google.com",
"target": "_blank"
}
]
}

Standard Response Structure

{
"success": true, // Whether the request was successful
"code": "return.optSuccess", // Status code
"msg": "Your operation was successful!", // Return message
"data": ... // Return data
}
FieldDescriptionRequired
textDisplay text for the linkYes
hrefTarget URLYes
targetLink target (_blank, _self)No (defaults to _self)

9.4 Integrated System Permission Configuration

Portal Permission Configuration

1. Portal Integrated System Permission Configuration

Supports configurable Maintainers and Users.

Maintainers

  • If empty: Only administrators can maintain by default.
  • If set: Both maintainers and administrators can:
    • Add system data sources
    • Configure settings
    • Delete system data sources
  • Note: New integrated system users are automatically added to the maintainers list.

Users

  • If empty: All users can use the system components by default.
  • If set: Only the configured users and maintainers can select the integrated system data source during portal configuration.

2. Integrated Component Data Source Permission Configuration

Supports configurable Users and Non-users.

Users

  • If empty: All system users can use it by default.
  • If set: Only the specified component users can configure and use the component data source.

Non-users

  • If empty: User permissions take precedence.
  • If set: Non-user permissions override user permissions.
    • If there is overlap between users and non-users, non-user permissions prevail.

3. Batch Permission Setting

  • Supports selecting multiple components for batch configuration of component data source permissions.

⚠️ Important Note:
When batch setting permissions:

  • If no authorized and unauthorized users are configured,
  • Clicking OK is equivalent to secondary authorization.
  • Please operate carefully to avoid overwriting the first authorization configuration.