CN118860357B - Low code attribute editor registration method - Google Patents
Low code attribute editor registration method Download PDFInfo
- Publication number
- CN118860357B CN118860357B CN202411345769.7A CN202411345769A CN118860357B CN 118860357 B CN118860357 B CN 118860357B CN 202411345769 A CN202411345769 A CN 202411345769A CN 118860357 B CN118860357 B CN 118860357B
- Authority
- CN
- China
- Prior art keywords
- attribute
- property
- value
- panel
- configuration
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/31—Programming languages or programming paradigms
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/38—Creation or generation of source code for implementing user interfaces
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44505—Configuring for program initiating, e.g. using registry, configuration files
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/30—Computing systems specially adapted for manufacturing
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Computing Systems (AREA)
- Stored Programmes (AREA)
Abstract
The application provides a registration method of a low-code attribute editor, which relates to the technical field of computers and comprises the steps of defining a description structure of an attribute panel, establishing a mapping relation between an attribute model and page model attributes, supporting dynamic adjustment in operation, enabling a user to generate a corresponding attribute panel according to different page models, creating an attribute configuration object by acquiring a default value of the page model attribute and traversing the description structure based on the description structure of the attribute panel, identifying and loading attribute description in a reference structure, dynamically controlling visibility and readonly of the attribute by loading an attribute value converter, creating an attribute value access object and analyzing an object expression, converting the generated attribute configuration object into a UI component, rendering the UI component into the attribute panel, and ensuring that the attribute panel can display the value, the visibility and the read-only state of the attribute according to configuration and interact with the page model in real time.
Description
Technical Field
The application belongs to the technical field of computers, and particularly relates to a registration method of a low-code attribute editor.
Background
With the development of information technology, low-code development platforms are favored by more and more enterprises because of their ability to quickly build applications. Such platforms typically provide a visual interface that allows non-professional programmers to design and deploy applications through simple drag operations. The page editor is an important component of a low-code development platform, and the main function of the page editor is to describe the structure of pages through models and edit the attributes of the models through attribute panels so as to realize visual page construction.
The page editor in the existing low-code development tool mainly adopts a fixed editor mode, the fixed editor is preset for different models and attributes thereof, and linkage among the attributes is realized through pre-written codes. Although this approach simplifies the page building process to some extent, it is inherently limited by poor scalability. In particular, if new attributes need to be added or rules for linkage between attributes need to be changed, the underlying code must be modified, which undoubtedly increases the complexity of the system, reduces the flexibility and openness of the system, and makes it difficult for the page editor to adapt to changing demands.
Disclosure of Invention
The application provides a registration method of a low-code attribute editor, which aims to solve the problem of poor expansibility of an attribute panel of a page editor in the existing low-code development tool.
The technical scheme adopted by the application is as follows:
the embodiment of the application provides a low-code attribute editor registration method, which comprises the following steps:
defining a description structure of an attribute panel, describing basic information and advanced information of each attribute through a JSON format, and supporting the modification of attribute configuration under the condition of not modifying a bottom code;
establishing a mapping relation between the attribute model and the page model attribute, supporting dynamic adjustment in running, and enabling a user to generate corresponding attribute panels according to different page models;
Creating an attribute configuration object by acquiring a default value of the page model attribute and traversing the description structure based on the description structure of the attribute panel, identifying and loading an attribute description in a reference structure, and dynamically controlling the visibility and readonly of the attribute by loading an attribute value converter, creating an attribute value access object and parsing an object expression;
And converting the generated attribute configuration object into a UI component and rendering the UI component into the attribute panel, ensuring that the attribute panel can display the value, the visibility and the read-only state of the attribute according to the configuration and interact with the page model in real time.
The application provides a low-code attribute editor registration method which further comprises the following additional technical characteristics that the description structure of an attribute panel is defined, basic information and advanced information of each attribute are described through a JSON format, attribute configuration is supported to be improved under the condition that an underlying code is not changed, specifically, the basic information and the advanced information of each attribute of the description structure of the attribute panel are described through a JSON structure, the basic information comprises an attribute name, a type, description and a default value, the advanced information comprises a display condition, a read-only condition and value conversion logic, and the extensible description structure supports to add new attributes or modify the configuration of the existing attributes without modifying the underlying code.
According to an embodiment of the present application, the mapping relationship between the attribute model and the page model attribute is established, and dynamic adjustment during operation is supported, so that a user can generate the corresponding attribute panel according to different page models, specifically:
Each attribute in the page model can correspond to one attribute model, the mapping relation supports dynamic adjustment during operation, a user can generate corresponding attribute panels according to different page models, and the user can adapt to the page models in different scenes by configuring mapping rules on the basis of not changing the bottom implementation, so that the attribute panels meeting the requirements are generated.
According to one embodiment of the present application, the description structure based on the attribute panel creates an attribute configuration object by acquiring a default value of the page model attribute and traversing the description structure, and simultaneously identifies and loads an attribute description in a reference structure, and dynamically controls visibility and readonly of the attribute by loading an attribute value converter, creating an attribute value access object and parsing an object expression, specifically:
initializing each attribute configuration object according to a default value defined in the description structure;
When the reference exists in the attribute description structure, the program can identify the reference and load the corresponding attribute structure, the reference points to the predefined attribute structure or template, thereby avoiding repeated definition, analyzing the current reference by using the service, integrating the reference attribute and the original structure by the function, and checking and integrating the information in the original structure to ensure the integrity and consistency of the attribute configuration.
According to one embodiment of the application, the attribute value converter is loaded, specifically, the attribute configuration object loads the corresponding value converter so as to correctly convert the attribute value between the model and the attribute panel, firstly traverses the attribute description structure, extracts the configuration information of each attribute, and initializes the configuration object.
According to one embodiment of the application, the created attribute value access object is responsible for acquiring and setting attribute values, namely loading a corresponding value converter for each attribute, associating the value converter with a value converter method, converting values in a panel into a format accepted by a model, and updating the attribute values in the model.
According to one embodiment of the application, the structure of the object expression is a conditional expression tree defined in JSON format, and whether a certain attribute is visible and read-only under a preset condition is determined by specifying the relationship between the attribute and the value of the attribute;
and interpreting the execution object expression by analyzing the execution object expression method, and returning an evaluation result.
And determining the behavior of the attribute in the attribute panel through the returned evaluation result.
According to one embodiment of the application, the structure of the object expression comprises a basic condition, a compound condition and a nested condition, wherein the basic condition is to check whether the value of a certain attribute is equal to, different from, containing or not containing a certain value;
the compound condition is to combine multiple conditions using logical operators;
the nested condition forms more complex condition logic, and the nested structure is used for describing the relationship between the father-son relationship and the brother node.
A computer readable storage medium having stored thereon a program which when executed by a processor performs the steps of a low code property editor registration method.
An electronic device comprising a memory, a processor and a program stored on the memory and executable on the processor, the processor implementing the steps in the low code property editor registration method when executing the program.
By adopting the technical scheme, the application has the following beneficial effects:
according to the application, by defining the attribute panel description structure, the mapping relation between the attribute model and the page model attribute is established, the attribute configuration object is created, the attribute configuration object is rendered into the attribute panel, and the problem of poor expansibility of the attribute panel of the page editor in the existing low-code development tool is solved. The dynamic creation of the attribute panel is realized, and the user is allowed to expand the attribute and adjust the attribute linkage rule without modifying codes. The application not only improves the openness and flexibility of the attribute panel, but also simplifies the management and maintenance of the attribute panel.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute a limitation on the application. In the drawings:
Fig. 1 is a flowchart of a low code property editor registration method according to an embodiment of the present application.
Detailed Description
In order to more clearly illustrate the general inventive concept, a detailed description is given below by way of example with reference to the accompanying drawings.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application, but the present application may be practiced in other ways than those described herein, and therefore the scope of the present application is not limited to the specific embodiments disclosed below. It should be noted that, without conflict, embodiments of the present application and features in each embodiment may be combined with each other.
In the present application, unless expressly stated or limited otherwise, a first feature "up" or "down" a second feature may be the first and second features in direct contact, or the first and second features in indirect contact via an intervening medium. In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present application. In this specification, schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
Example 1
As shown in fig. 1, a low code property editor registration method includes:
step S100, defining a description structure of an attribute panel, describing basic information and advanced information of each attribute through a JSON format, and supporting the modification of attribute configuration without modifying the underlying code.
In particular, defining the property panel description structure means creating a flexible configuration template for detailing each property in the property editor. The described structure adopts JSON format, and covers basic information (such as name, type, default value) of the attribute and higher-level information (such as display condition, read-only condition, value conversion logic and the like). This description structure is extensible, meaning that new properties can be added or the configuration of existing properties modified without modifying the underlying code. In this way, the descriptive structure of the property panel provides sufficient flexibility and support to enable the system to be extended and scaled without requiring direct code modification.
For example, when defining the property panel description structure, basic information and high-level information of each property can be described in JSON format, so that the property configuration can be added or modified without modifying the underlying code. Taking a checkbox (checkbox) component as an example, its JSON structure may include the following:
{
"title": "checkbox",// component name
"Description": "A Farris Component",// component description
"Type": "object",// component type
"categories": {
"Basic": {// basic Property
"Description": basic information ",// attribute description
"Title": "basic information",// attribute name
"properties": {
"Id" {// component id attribute
"Description": "component identification",// attribute description
"Title": "identification",// attribute name
"Type": "string",// attribute type
"Readonly": true// read-only or not
},
"Type" {// component type attribute
"Description": "component type",// attribute description
"Title": "control type",// attribute name
"Type": "select"// select type
}
}
}
}
}
The above JSON structure describes the attributes of a check box component, including basic information of the name, description, type, etc. of the component, and higher-level information such as whether the attributes are read-only. Through the description structure, when new attributes are required to be added into the attribute panel or the existing attribute configuration is required to be adjusted, only the JSON file is required to be modified, and the underlying code is not required to be touched, so that the flexibility and the expandability of the attribute panel are improved.
Furthermore, the richness of the description structure can be enhanced, more advanced attributes such as attribute verification rules, internationalization support and the like can be added besides basic information, so that the description structure is more comprehensive and can adapt to more various application scenes.
Further, performance can be optimized by researching how to increase the speed of generating the attribute configuration object, and reducing the calculation cost when creating and updating the attribute configuration so as to increase the response speed of the system.
Furthermore, the security can be enhanced, namely the security check of attribute configuration is realized, illegal data input is prevented, the fact that only legal data can affect the model is ensured, and the security of the system is improved.
Further, version control can be added by developing a set of version control systems to manage the history of changes in attribute configuration, enabling a user to track and rollback configuration to any historical version, facilitating management and auditing.
Furthermore, the automatic test can be integrated, namely an automatic test case is created for the attribute configuration, so that the function of the attribute panel is still normal after each configuration modification, and the workload of manual test is reduced.
Further, the user interaction experience can be enhanced, the user interface design of the attribute panel is improved, the attribute panel is more visual and easy to use, and auxiliary functions such as integrated help documents, example codes and the like can be considered, so that a user can better understand and use attribute configuration.
Further, a multi-language environment may be supported, such that the property panel can automatically switch display languages according to user language preference, considering internationalization requirements.
Further, a plug-in ecosystem can be developed, namely, a third party developer is encouraged to develop plug-ins for the attribute panel so as to enrich functions of the plug-ins, form an open ecosystem and promote community sharing and innovation.
Furthermore, the continuous integration and continuous deployment (CI/CD) process can be established, so that the automatic test, packaging and deployment can be performed after each attribute configuration update, and the development iteration speed is increased.
Step 200, a mapping relation between the attribute model and the page model attribute is established, and dynamic adjustment in running is supported, so that a user can generate the corresponding attribute panel according to different page models.
Specifically, establishing a mapping relationship between the attribute model and the page model attribute means creating a mechanism inside the system so that each attribute in the page model can correspond to one attribute model, and linking both through such a mapping relationship. The mechanism supports dynamic adjustment of mapping rules at runtime, allowing users to generate corresponding property panels from different page models. The flexibility enables a user to adapt to page models in different scenes by adjusting mapping configuration on the basis of not changing underlying codes, and further generates an attribute panel meeting requirements.
For example, to build a mapping relationship between an attribute model and a page model attribute, it is assumed that a page model includes an attribute named showReminder, which is displayed as an "enable hint" in an attribute panel. This mapping allows the property panel to be dynamically adjusted according to the specifics of the page model.
For example, showReminder may be a boolean type variable in the page model that controls whether the reminder is displayed on the interface. Through the mapping relationship, a switch component can be provided in the property panel for showReminder properties, and the user can directly enable or disable the function in the property panel. The mapping relationship is not limited to one-to-one attribute mapping, but can be many-to-one or many-to-many complex mapping, and the mapping rule can be dynamically adjusted according to the operation of a user during running.
Thus, the user can generate corresponding attribute panel configuration according to the characteristics of different page models. For example, if the page model needs to display a check box component and the component has basic properties such as id and type, then these properties can be mapped to corresponding controls on the property panel by mapping relationships, and the user can easily configure the values of these properties in the property panel without having to directly write code.
Further, the intelligence of the mapping rules can be enhanced by developing a more intelligent algorithm to automatically detect the mapping relationship between the page model and the attribute model, reduce the workload of manual configuration, and automatically process complex mapping logic.
Further, the complexity of the mapping rules may also be increased by allowing the mapping rules to support more complex condition judgment logic, such as dynamically adjusting the mapping rules based on user roles, temporal conditions, or other contextual information, thereby enabling more personalized page presentation.
Furthermore, a user-friendly configuration interface can be developed, namely a visual configuration interface is provided, so that a user can more intuitively manage the mapping relation between the attribute and the page model in a graphical mode, and the configuration difficulty is reduced.
Furthermore, a version control system can be integrated, namely, a version control mechanism is introduced, the history change of the mapping relation is recorded, the record is conveniently tracked and modified, the version rollback function is supported, and the data safety is ensured.
Furthermore, data verification can be enhanced, namely, a data verification mechanism is added when the mapping relation is established and regulated, so that consistency and correctness of attribute configuration are ensured, and problems caused by configuration errors are prevented.
Furthermore, cross-platform compatibility can be realized, namely, the establishment and adjustment mechanism of the mapping relation can be ensured to keep consistent performance on different operating systems and devices, and the cross-platform capability of the system is enhanced.
Further, a plug-in extension mechanism may be developed that allows third party plug-ins to extend the management functions of the mapping relationships, add new mapping types or provide more advanced mapping options, enriching the functionality and scalability of the system.
Step S300, based on the description structure of the attribute panel, creating an attribute configuration object by obtaining the default value of the page model attribute and traversing the description structure, and simultaneously identifying and loading the attribute description in the reference structure, and dynamically controlling the visibility and readonly of the attribute by loading an attribute value converter, creating an attribute value access object and parsing an object expression.
Specifically, based on the description structure of the attribute panel, the system will first obtain the default values of the page model attributes and traverse the entire description structure to create the attribute configuration object. During the traversal process, if a reference structure (i.e., $ref field) is encountered, the system will identify the references and load the referenced attribute description structure, ensuring that all associated attribute information is properly integrated into the current attribute configuration object. The system then loads the attribute value translator, providing the necessary translation logic for the attribute configuration object, ensuring that the correct attribute value format is passed between the attribute panel and the page model. In addition, the system creates attribute value access objects to enable the acquisition and setting of attribute values and adapt these values to the format required by the page model. Finally, the system dynamically controls the visibility and readability of the attribute by analyzing the object expression, and adjusts the display state of the attribute in the attribute panel in real time according to the result of the conditional expression.
For example, the process of creating an attribute configuration object based on an attribute panel description structure may be illustrated as a specific example. Assuming that a form component is present, its underlying properties, such as ID, type, etc., need to be configured in the property panel.
First, the system will obtain default values for the attributes in the page model that are related to the form component, e.g., the default value for id may be "form1" and the default value for type may be "text".
The system then traverses the property panel description structure, creating a property configuration object. Here, assume that the JSON structure of the form component is as follows:
{
"title": "Form Component",
"description": "Component for handling form data",
"type": "object",
"properties": {
"id": {
"description": "Unique identifier for the component",
"title": "Identifier",
"type": "string",
"readonly": true
},
"type": {
"description": "Type of input field",
"title": "Input Type",
"type": "select",
"options": ["text", "number", "date"]
}
}
}
In creating the configuration object, if there is a reference ($ref field) in the JSON structure, the system will recognize and load the attribute description in the reference structure. For example, the type field may reference another description structure that defines all possible input types. The system parses the reference and integrates the relevant information into the current property configuration object.
Next, the system loads an attribute value translator, which is done to ensure that the attribute values are properly translated between the attribute panel and the page model. For example, if the type attribute is presented in the form of a drop down list in the attribute panel and stored in the form of a string in the page model, a converter is required to handle this conversion.
Then, an attribute value access object is created, responsible for acquiring and setting the attribute value. For example, the user selects type as "number" in the property panel, at which time the property value access object will convert this value into a format acceptable to the page model and update the type property value in the model.
Finally, the visibility and readonly of the attributes are dynamically controlled by parsing the object expressions. For example, if the id attribute is set to read-only, this may be accomplished by the object expression { "readonly": true }. Similarly, if a certain condition is met, certain attributes may be made invisible, such as { "visible": false }.
Through the steps, the system can create a proper attribute configuration object according to the attribute panel description structure, and dynamically adjust the behavior of the attribute according to the requirement.
Further, details of the description structure can be enhanced, namely more details such as verification rules of attributes, internationalization support and the like can be added in the description structure, so that the description structure is more comprehensive and can adapt to more application scenes.
Furthermore, the loading performance can be optimized, namely, how to more quickly load the attribute description in the reference structure is researched, the loading time is reduced, and the response speed of the system is improved.
Furthermore, the security verification can be enhanced, namely the security verification of the attribute value converter and the attribute value access object is increased, the input of illegal data is prevented, and the security of the system is ensured.
Further, version control functions can be added, namely a version control system is developed, the change history of attribute configuration is recorded, and the user can conveniently track and roll back to the previous configuration version.
Further, automated testing may be introduced to create automated test cases for property configuration, ensuring that the functionality of the property panel remains normal after each configuration modification.
Further, data persistence can be enhanced by developing a data persistence mechanism, ensuring that attribute configuration can be stably stored and recovered after the system is restarted, and ensuring consistency and persistence of data.
Further, API support may be provided to provide an API interface for external systems, allowing other systems to obtain or modify property configurations through the API, enhancing interoperability of the systems.
Furthermore, an error processing mechanism can be enhanced, namely a more perfect error processing mechanism is added, and when errors occur in the attribute configuration, an explicit error prompt can be timely found and given out to help a user to solve the problem.
And step S400, converting the generated attribute configuration object into a UI component and rendering the UI component into the attribute panel, ensuring that the attribute panel can display the value, the visibility and the read-only state of the attribute according to the configuration, and interacting with the page model in real time.
Specifically, the process of converting the generated property configuration objects into UI components and rendering into property panels means that each property defined in the property configuration objects is mapped onto a specific user interface element, such as an input box, a drop down list, or a switch. This process ensures that the property panel can expose properties according to the property values, visibility, and read-only states set in the property configuration object, and that these properties can interact with the page model in real-time.
Specifically, when an attribute configuration object is created, the system generates corresponding UI components from the information in the configuration object and renders the components into an attribute panel. For example, if the configuration object indicates that an attribute should be presented as a text entry box and that the attribute is read-only, then a text box that cannot be edited will be seen in the attribute panel, displaying the current value of the attribute. Also, if the configuration indicates that an attribute should be visible, that attribute will be presented in the attribute panel, whereas if the configuration indicates that the attribute should not be visible, then the attribute will not appear in the panel.
In addition, these UI components not only expose the current state of the properties, but also allow the user to interact. For example, a user may modify the values of non-read-only properties, and these changes may be reflected in the page model in real-time. In this way, the attribute panel forms a bridge connecting the user operation and the page model, so that the user can adjust the attribute through an intuitive interface, and the adjustment can be immediately effective, thereby influencing the state of the page model.
For example, the process of converting the generated property configuration object into a UI component and rendering into a property panel may be illustrated with one specific example. Let us assume that we have a checkbox component whose attribute configuration is described by JSON structure, containing some basic information such as identifier (id), type (type) of component, etc.
When an attribute configuration object is created, the system generates corresponding UI components from the information in this object and renders them into an attribute panel. For example, for a checkbox component, its JSON structure may be as follows:
{
"title": "checkbox",
"description": "A Farris Component",
"type": "object",
"properties": {
"id": {
"description": "component identification",
"Title": "identification",
"type": "string",
"readonly": true
},
"type": {
"Description" component type ",
"Title": control type ",
"type": "select",
"options": ["checkbox"]
}
}
}
In this example, the id attribute is set to read only, while the type attribute is a selectable type, here defining only one option for a checkbox.
Next, the system creates a corresponding UI component from the JSON structure described above. For the id attribute, since it is read-only, the system will render a read-only input box in the attribute panel, showing the current value of the attribute, and the user cannot modify it. For the type attribute, the system generates a drop down list (select) from which the user can select a value.
After these UI components are rendered onto the property panel, the user can see the relevant properties of the checkbox components and can edit them according to the actual situation. For example, the user may select the value of the type attribute, but cannot modify the id attribute. All changes are reflected in the page model in real time, i.e., each valid input on the property panel synchronously updates the value of the corresponding property in the page model.
In this way, the property panel not only demonstrates the current state of the property (e.g., value, visibility, and readonly), but also allows the user to interact with it, thereby enabling real-time interaction between the property panel and the page model.
In this way, the property panel becomes a key component for dynamically exhibiting property states and performing two-way communication with the page model, and the flexibility and usability of the low-code development tool are greatly improved.
Further, styles and interactions of the UI component may also be enhanced by providing the UI component with richer style options and interaction effects, such as colors, fonts, animations, etc., to enhance the user experience.
Furthermore, a data verification mechanism can be added in the attribute panel, so that the data input by a user is ensured to accord with a preset format and range, and the data quality is improved.
Further, multilingual and internationalization can be supported, wherein the attribute panel supports multilingual environment, and allows a user to select different languages for display according to needs so as to meet globalization requirements.
Furthermore, a version control system can be integrated, wherein a version control mechanism is introduced for attribute configuration, the change history of each attribute configuration is recorded, and the user can conveniently track and roll back to the previous configuration version.
The application provides a low-code attribute editor registration method which further comprises the following additional technical characteristics that the description structure of an attribute panel is defined, basic information and advanced information of each attribute are described through a JSON format, attribute configuration is supported to be improved under the condition that an underlying code is not changed, specifically, the basic information and the advanced information of each attribute of the description structure of the attribute panel are described through a JSON structure, the basic information comprises an attribute name, a type, description and a default value, the advanced information comprises a display condition, a read-only condition and value conversion logic, and the extensible description structure supports to add new attributes or modify the configuration of the existing attributes without modifying the underlying code.
In particular, defining the description structure of the property panel refers to creating a flexible configuration template for detailing the basic information and high-level information of each property in the property editor. This description structure organizes the information by JSON format, ensuring that the basic information (e.g., attribute name, type, description, and default) and the high-level information (e.g., display conditions, read-only conditions, and value conversion logic) of each attribute are accurately recorded.
Specifically, the basic information of each attribute is described by JSON structure, including but not limited to the name, type, description, and default values of the attribute. For example, an attribute may be described as a string-type input box, default to "default_value". While high-level information involves more complex logic such as under what conditions the attribute is displayed, when it is in a read-only state, and how the attribute values are converted in different scenarios. For example, one attribute may be displayed only when the value of another attribute is a specific value, or changed to a read-only state when a certain condition is satisfied.
With this extensible description structure, the system supports adding new properties or modifying the configuration of existing properties without modifying the underlying code. This means that when new properties need to be added or the behavior of existing properties need to be changed, only the JSON description file needs to be updated to achieve the required functional changes without directly modifying the underlying code logic. This design greatly improves the flexibility and maintainability of the property panel.
In some embodiments of the present application, the mapping relationship between the attribute model and the page model attribute is established, and dynamic adjustment during operation is supported, so that a user can generate the corresponding attribute panel according to different page models, specifically:
Each attribute in the page model can correspond to one attribute model, the mapping relation supports dynamic adjustment during operation, a user can generate corresponding attribute panels according to different page models, and the user can adapt to the page models in different scenes by configuring mapping rules on the basis of not changing the bottom implementation, so that the attribute panels meeting the requirements are generated.
Specifically, establishing a mapping relationship between the attribute model and the page model attribute means creating a mechanism inside the system so that each attribute in the page model can correspond to one attribute model. With this mapping relationship, the system supports dynamic adjustment of mapping rules during run-time, allowing users to generate corresponding property panels from different page models.
Specifically, when a user needs to configure an attribute panel for a certain page model, the system maps the attributes in the page model to corresponding attribute models according to a preset mapping rule. This mapping is dynamic and can be adjusted at run-time, meaning that even during system operation, the user can adjust the mapping of attributes as needed to accommodate different page models.
For example, showReminder attributes in the page model are displayed as "enable hints" in the attribute panel. The user can generate the corresponding property panel from different page models without modifying the underlying implementation logic. The user only needs to configure the mapping rules, and the system can dynamically generate attribute panels meeting the requirements according to the rules.
By the method, a user can adapt to page models in different scenes through simple configuration on the basis of not changing the implementation of the bottom layer of the system, and further, an attribute panel meeting the requirements is generated. The method not only simplifies the management and maintenance of the attribute panel, but also enhances the flexibility and expansibility of the system.
In some embodiments of the present application, the description structure based on the attribute panel creates an attribute configuration object by obtaining a default value of the page model attribute and traversing the description structure, and simultaneously identifies and loads an attribute description in a reference structure, and dynamically controls visibility and readonly of an attribute by loading an attribute value converter, creating an attribute value access object, and parsing an object expression, specifically:
initializing each attribute configuration object according to a default value defined in the description structure;
When the reference exists in the attribute description structure, the program can identify the reference and load the corresponding attribute structure, the reference points to the predefined attribute structure or template, thereby avoiding repeated definition, analyzing the current reference by using the service, integrating the reference attribute and the original structure by the function, and checking and integrating the information in the original structure to ensure the integrity and consistency of the attribute configuration.
Specifically, the description structure based on the attribute panel creates an attribute configuration object by acquiring a default value of the page model attribute and traversing the description structure, and simultaneously identifies and loads an attribute description in a reference structure, and dynamically controls the visibility and readonly of the attribute by loading an attribute value converter, creating an attribute value access object and parsing an object expression, specifically:
initializing each attribute configuration object according to a default value defined in the description structure;
When the reference exists in the attribute description structure, the program can identify the reference and load the corresponding attribute structure, the reference points to the predefined attribute structure or template, thereby avoiding repeated definition, analyzing the current reference by using the service, integrating the reference attribute and the original structure by the function, and checking and integrating the information in the original structure to ensure the integrity and consistency of the attribute configuration.
In some embodiments of the present application, the loading attribute value transformer, specifically, the attribute configuration object loads a corresponding value transformer so as to correctly transform the attribute value between the model and the attribute panel, first traverses the attribute description structure, extracts the configuration information of each attribute, and initializes the configuration object.
In particular, the method comprises the steps of,
The process of loading attribute value translators means that the attribute configuration object needs to load the corresponding value translator to ensure that the attribute values are properly translated between the model and the attribute panel. The method comprises the following specific steps:
First, the system traverses the attribute description structure, extracts the configuration information for each attribute, and initializes the configuration object accordingly. This means that the system will read each attribute defined in the description structure one by one and create a corresponding attribute configuration object based on the configuration information (e.g., type, default, etc.) of these attributes.
While initializing the configuration object, the system loads a corresponding value transformer for each attribute configuration. The function of the value converter is to convert the attribute values between the model and the attribute panel, ensuring that the attribute values are properly formatted when transferred between the two. For example, if a date selector is displayed in the property panel and a date string is stored in the page model, a value converter is required to ensure that the property values are properly formatted for display and storage.
Through this process, the system ensures that the attribute configuration objects have the correct value conversion logic so that the attribute values can be correctly exchanged between the model and the attribute panel.
In some embodiments of the present application, the create attribute value access object is specifically responsible for acquiring and setting attribute values, that is, loading a corresponding value converter for each attribute, associating it with a value converter method, converting values in a panel into a format accepted by a model, and updating attribute values in the model.
In particular, creating an attribute value access object refers to creating a specialized object for each attribute that is responsible for acquiring and setting the attribute value. In particular, this involves loading corresponding value converters for each attribute and associating these value converters with the attribute value access objects, thereby ensuring that the values in the attribute panel can be converted into a format acceptable to the model and ultimately updating the attribute values in the model.
For example, when a user changes the value of an attribute in an attribute panel, the attribute value access object captures the change and converts the value in the panel into a data format suitable for the page model using a corresponding value converter. The attribute value access object then applies the converted value to the page model, updating the corresponding attribute value in the model.
This process ensures that user input on the property panel is properly reflected in the page model, maintaining consistency and integrity of the data. In this way, the system can automatically process the transition logic of the attribute values under different environments, so that the operation of the user interface can seamlessly affect the model state.
In some embodiments of the present application, the structure of the object expression is a conditional expression tree defined in JSON format, and whether a certain attribute is visible and read-only under a preset condition is determined by specifying the relationship between the attribute and the value thereof;
and interpreting the execution object expression by analyzing the execution object expression method, and returning an evaluation result.
And determining the behavior of the attribute in the attribute panel through the returned evaluation result.
In some embodiments of the present application, the structure of the object expression includes a basic condition, a compound condition, and a nested condition, the basic condition being checking whether a value of a certain attribute is equal to, different from, contains, or does not contain a certain value;
the compound condition is to combine multiple conditions using logical operators;
the nested condition forms more complex condition logic, and the nested structure is used for describing the relationship between the father-son relationship and the brother node.
Specifically, the structure of the object expression is a conditional expression tree defined in JSON format, and the function of the object expression is to determine whether a certain attribute is visible or read-only under a preset condition by specifying the relationship between the attribute and its value. The object expression consists of basic conditions, compound conditions and nested conditions, and each condition has a specific application scene.
Basic conditions
The basic condition is used to check whether the value of a certain attribute is equal to, different from, contains or does not contain a certain value. For example, if the value of attribute controlSource is equal to light, the expression { "controlSource": { "equivalent": "light" } } is true.
Compounding conditions
The compound condition combines multiple conditions through logical operators allOf and anyOf. For example, the overall condition is true when all conditions in allOf are satisfied, and true when any of the conditions in anyOf are satisfied. The compounding condition allows more complex logical combinations, such as:
{
"allOf": [
{
"sibling": 0,
"parent": {
"f-page-main": true
}
}
]
}
this expression indicates that the overall condition is true when all sub-conditions are satisfied.
{
"anyOf": [
{
"children": {
"length": {
"equal": 1
}
}
},
{
"children": {
"scroll-spy": false
}
}
]
}
This expression indicates that the overall condition is true as long as one sub-condition is satisfied.
Nesting condition
Nested conditions allow for the formation of more complex conditional logic, typically used to describe parent-child relationships, relationships between siblings, etc. The nested conditions may contain other conditional expressions, forming multiple levels of logical decisions.
Interpreting execution object expressions
The method of interpreting the execution object expressions is responsible for parsing and evaluating the expressions to determine the status of an attribute in the panel (e.g., visibility, read-only, etc.). This process can be divided into several steps, parsing the expressions, evaluating the conditions, and returning the results.
Analytical expressions
Parsing the expression reads the structure of the object expression and identifies the basic conditions and the compound conditions therein. For basic conditions, the system will check if the current value of the attribute meets the conditions defined in the expression, and for compound conditions, the system will recursively parse and evaluate each sub-condition.
Evaluation condition
The evaluation conditions include evaluation of basic conditions and evaluation of complex conditions. The evaluation of the basic condition, i.e. the direct comparison of the current value of the attribute with the condition values in the expression, the evaluation of the compound condition, i.e. allOf condition, requires that all sub-conditions are true, and the anyOf condition requires that only at least one sub-condition be true.
Returning the result
Based on the result of the evaluation, the system returns a boolean value indicating whether the condition is met. This boolean value will determine the status of the attribute in the attribute panel, such as whether it is visible, read-only, etc.
In this way, the object expressions can dynamically control the visibility and readonly of the properties in the property panel, enabling the property panel to dynamically adjust its behavior according to the context.
Example 2
Defining an attribute panel description structure.
Regarding the property editor configuration, taking a checkbox component as an example, its JSON structure is:
{
Component name
"title": "checkbox",
Component description
"description": "A Farris Component",
Type of component
"type": "object",
Component classification
"categories": {
Per underlying Property
"basic": {
Attribute description
"description": "Basic Infomation",
Attribute name
"Title": basic information ",
Component attribute
"properties": {
Component id attribute
"id": {
Attribute description
"Description": "component identification",
Attribute name
"Title": "identification",
Type of attribute
"type": "string",
// Read-only
"readonly": true
},
Component type attribute
"type": {
"Description" component type ",
"Title": control type ",
"type": "select",
}
}
}
}
}
Step two, establishing a mapping relation between the attribute model and the page model attribute
And establishing a mapping relation, wherein each page model attribute corresponds to one attribute model, and linking the two attribute models through the mapping relation. For example, the 'showReminder' attribute in the page model is displayed as an "enable hint" in the attribute panel. Dynamic adjustment of the mapping relationship at runtime is supported.
And step three, creating an attribute configuration object. The method mainly comprises the steps of a, obtaining a model attribute default value, b, traversing an attribute panel description structure, and creating an attribute configuration object.
And a, obtaining a default value of the model attribute, namely initializing each attribute configuration object according to the default value defined in the description structure. The invention traverses each attribute in the attribute panel one by one through resolveSchemaWithDefaultValue functions and creates a corresponding configuration object for the attribute panel.
Traversing the attribute panel description structure to create an attribute configuration object, including 1) identifying a reference structure, loading the reference type attribute panel description structure, and 2) creating the attribute configuration object.
1) First, the present invention supports identifying a reference structure, loading a reference type attribute panel description structure. For the attribute of the reference type, the invention loads the related attribute description structure through a reference mechanism. For example:
if (propertyCategory.$ref) {
return tryToResolveReference(categoryId, propertyCategory, rawSchema, schemaService) as ElementPropertyConfig;
}
The present invention uses categoryId parameters to represent the unique identifier of the current attribute classification, typically a string, to distinguish between different attribute classifications. The description structure of the current attribute classification is represented by propertyCategory, which contains various attribute definitions and a $ ref' field pointing to other attribute structures. RAWSCHEMA attributes contain all the attribute definitions and configurations of the current component model. "RAWSCHEMA" is used to provide context for the referencing structure to ensure consistency between attributes. "SCHEMASERVICE" is a service object that provides a way to parse and load a reference structure. Its main function is to parse out the complete structure of the reference according to $ ref' and provide the access interface of the structure.
The function first checks if ' propertyCategory ' contains the $ ref ' field. If present, the attribute classification is described as a reference type, pointing to a predefined attribute structure. The complete description of the referenced structure is obtained by calling' schema service. "SCHEMASERVICE" is the core tool responsible for resolving references, which loads the corresponding attribute structure according to the location pointed to by $ ref'. Finally, the referencing properties are integrated with the original structure. The parsed reference structure is further processed by the 'getPropertyEntities' method, and the sub-attributes in the reference structure are also included in the current attribute configuration object. In this process, the information in the original architecture RAWSCHEMA' is also checked and integrated to ensure the integrity and consistency of the attribute configuration.
2) And secondly, creating an attribute configuration object, wherein the attribute configuration object comprises three key points of loading an attribute value converter, creating an attribute value access object and an object expression.
The attribute value converter is loaded, namely, the corresponding value converter is loaded for the attribute configuration object so as to correctly convert the attribute value between the model and the attribute panel. The attribute description structure is traversed, configuration information of each attribute is extracted, and the configuration object is initialized.
The attribute value access object is created to acquire and set attribute values, namely, a corresponding value converter is loaded for each attribute and is associated with a value converter method. Values in the panel are converted into a format acceptable to the model and attribute values in the model are updated.
The object expression is a mechanism which is unique to the invention and is used for dynamically controlling the characteristics of the visibility, the readonly property and the like of the attribute in the attribute panel.
In the invention, the structure of the object expression is a conditional expression tree defined in JSON format, and whether a certain attribute is visible, read-only or the like under a preset condition is determined by specifying the relation between the attribute and the value thereof. Common object expression structures include the following forms:
A. Basic conditions are checking if the value of a certain attribute is equal to, different from, contains or does not contain a certain value. For example:
{
"controlSource": {
"equal": "light"
}
}
This expression indicates that if the value of the 'controlSource' attribute is equal to 'light', the condition is true.
B. compounding conditions multiple conditions were combined using logical operators 'allOf' and 'anyOf'. For example:
{
"allOf": [
{
"sibling": 0,
"parent": {
"f-page-main": true
}
}
]
}
this expression indicates that the overall condition is true when all conditions in 'allOf' are satisfied.
{
"anyOf": [
{
"children": {
"length": {
"equal": 1
}
}
},
{
"children": {
"scroll-spy": false
}
}
]
}
This expression indicates that the overall condition is true as long as one of the conditions in 'anyOf' is satisfied.
C. Nested conditions object expressions can be nested to form more complex conditional logic. Nested structures are typically used to describe parent-child relationships, relationships between siblings, etc.
The method of interpreting the execution object expressions is responsible for parsing and evaluating the expressions to determine the status of an attribute in the panel (e.g., visibility, read-only, etc.). This process can be divided into several steps, parsing the expressions, evaluating the conditions, and returning the results.
The parsing expression reads the structure of the object expression and identifies the basic conditions and the compound conditions therein. For example, for basic conditions, the system will check if the current value of the attribute meets the conditions defined in the expression, and for compound conditions, the system will recursively parse and evaluate each sub-condition.
The evaluation conditions include evaluation of basic conditions and evaluation of complex conditions. The evaluation of the basic condition is to directly compare the current value of the attribute with the condition value in the expression. For example, if the attribute value is 'light' and the expression requires 'equal: light', then the condition is true. The evaluation of the complex condition, i.e. "allOf" condition, requires that all sub-conditions are true, and the "anyOf" condition requires that only at least one sub-condition be true.
The system returns a boolean value indicating whether the condition is satisfied or not based on the result of the evaluation. This boolean value will determine the state of the attribute in the panel.
In practical applications, object expressions may be used to dynamically control the behavior of property panels. For example, when the value of a certain attribute changes, other related attributes may be dynamically displayed or hidden by the object expression, or whether they are editable or not controlled. By the mechanism, the low-code development tool can provide a more intelligent and dynamic user interface, and the user experience and development efficiency are greatly improved.
And step four, rendering the attribute configuration object into an attribute panel. I.e., all generated property configuration objects are converted into actual UI components and rendered into property panels.
Example 3
A computer readable storage medium having stored thereon a program which when executed by a processor performs the steps of a low code property editor registration method.
Example 4
An electronic device comprising a memory, a processor and a program stored on the memory and executable on the processor, the processor implementing the steps in the low code property editor registration method when executing the program.
The application can be realized by adopting or referring to the prior art at the places which are not described in the application.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and variations of the present application will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.
Claims (9)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202411345769.7A CN118860357B (en) | 2024-09-26 | 2024-09-26 | Low code attribute editor registration method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202411345769.7A CN118860357B (en) | 2024-09-26 | 2024-09-26 | Low code attribute editor registration method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN118860357A CN118860357A (en) | 2024-10-29 |
| CN118860357B true CN118860357B (en) | 2025-02-14 |
Family
ID=93169666
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202411345769.7A Active CN118860357B (en) | 2024-09-26 | 2024-09-26 | Low code attribute editor registration method |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN118860357B (en) |
Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN117215585A (en) * | 2023-11-09 | 2023-12-12 | 浪潮通用软件有限公司 | Visual description and dynamic control method and device for interface component attribute |
Family Cites Families (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101477462A (en) * | 2009-02-12 | 2009-07-08 | 山东浪潮齐鲁软件产业股份有限公司 | Model-driven software development method used for dynamically changing system behavior |
| ITRM20100175A1 (en) * | 2010-04-13 | 2011-10-14 | Andrea Buratti | MODULAR DYNAMIC WEB APPLICATIONS PERSISTENT WITH COMPLEX INTERFACES |
| CA3203793C (en) * | 2020-12-28 | 2024-01-23 | Appward Llc | System and method for real-time, dynamic creation, delivery, and use of customizable web applications |
| CN115686457A (en) * | 2022-10-27 | 2023-02-03 | 中通服软件科技有限公司 | A page data processing method and medium based on attribute linkage rules |
| CN115617327A (en) * | 2022-11-08 | 2023-01-17 | 浙江极氪智能科技有限公司 | Low-code page building system, method, and computer-readable storage medium |
| CN116243919A (en) * | 2023-01-09 | 2023-06-09 | 浪潮通用软件有限公司 | Interface rendering method, device and medium for interpretation rendering and code rendering |
| CN116775013A (en) * | 2023-05-23 | 2023-09-19 | 北京邮电大学 | Development system of visual low-code platform |
| CN116643731A (en) * | 2023-06-30 | 2023-08-25 | 江苏瑞中数据股份有限公司 | A low-code business model construction method based on JSON configuration |
| CN117519689A (en) * | 2023-12-05 | 2024-02-06 | 中国科学院沈阳自动化研究所 | A visual rendering engine design method for low-code platforms |
| CN118466955B (en) * | 2024-07-10 | 2024-09-10 | 南京吉冉软件有限公司 | Form page control system based on code-free configuration on form designer |
-
2024
- 2024-09-26 CN CN202411345769.7A patent/CN118860357B/en active Active
Patent Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN117215585A (en) * | 2023-11-09 | 2023-12-12 | 浪潮通用软件有限公司 | Visual description and dynamic control method and device for interface component attribute |
Also Published As
| Publication number | Publication date |
|---|---|
| CN118860357A (en) | 2024-10-29 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US6753885B2 (en) | System and theme file format for creating visual styles | |
| US7904821B1 (en) | Graphical user interface that is convertible at runtime | |
| RU2419838C2 (en) | Extensible xml-format and object model for localisation data | |
| US6769095B1 (en) | Hierarchically structured control information editor | |
| CN100530083C (en) | Programming interface for a computer program | |
| US8566782B2 (en) | Generating application data editors | |
| US7320120B2 (en) | Pluggable notations and semantics for visual modeling elements | |
| US20020010713A1 (en) | Graphical environment for managing and developing applications | |
| US20050091584A1 (en) | Methods for applying styles to visual aspects of user interface elements | |
| CN107851001A (en) | Method for displaying computer applications of software-type applications based on design specifications | |
| Degueule et al. | Safe model polymorphism for flexible modeling | |
| Jacome et al. | Controlling meta-model extensibility in model-driven engineering | |
| CA2786385A1 (en) | Pattern-based user interfaces | |
| CN119621034A (en) | A business process construction method combining workflow engine and dynamic form | |
| US7447993B2 (en) | System and method for displaying a user interface object using an associated style | |
| Clerckx et al. | The mapping problem back and forth: customizing dynamic models while preserving consistency | |
| KR101552914B1 (en) | Web server application framework web application processing method using the framework and computer readable medium processing the method | |
| Giraudet et al. | Sirius web: Insights in language workbenches-an experience report | |
| Djukić et al. | Handling complex representations in visual modeling tools for MDSD/DSM by means of code generator languages | |
| CN118860357B (en) | Low code attribute editor registration method | |
| US7512899B1 (en) | Method and apparatus for a unified user interface | |
| CN111984300A (en) | Code copying method and device, electronic equipment and computer readable storage medium | |
| Mitchell et al. | DRIVE: an environment for the organised construction of user-interfaces to databases | |
| Åkesson et al. | Jatte: A tunable tree editor for integrated DSLs | |
| Sboui et al. | Addressing Context-Awareness in User Interface Software Product Lines (UI-SPL) Approaches |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |