QuickCode detailed specifications and references

Action Object Properties, Methods, & Events

Properties

Property Name

Description

targetview

This is the property that sets the View component to perform Action.

Methods

Method Name

Description

getContents

Returns the contents object transmitted when Action is executed or the value object corresponding to the key.

Action.getContents([strKey])

- If the strKey parameter is not set, then the contents object is returned.

- The strKey parameter can be set to either "model" or "extra".

getTargetView

Returns the View component corresponding to the targetview property value.

Action.getTargetView()

run

Executes Action.

Action.run()

Events

Event Name

Description

onsuccess

This is the event for processing Trigger callback when the run method execution is successful.

onsuccess(obj:nexacro.Action,e:nexacro.ActionEventInfo);

onerror

This is the event for processing Trigger callback when the run method execution fails.

onerror(obj:nexacro.Action,e:nexacro.ActionEventInfo);

Item Information Available for the Trigger Type

In the example, "click" was selected from the context menu so that the trigger works when the Button is clicked. Selecting the "click" item is similar to writing the Button component's onclick event function. The list below shows the available trigger types.

type

event

Description

Click

onclick

Occurs when the target object (component) mouse is clicked.

Row Change

onrowposchanged

Occurs when the rowposition of the viewdataset object of the target View component is changed.

When selecting the View component, the Object item is automatically selected and cannot be changed.

Value Change

oncolumnchanged

Occurs when the column value of the viewdataset object of the target View component is changed.

When selecting the View component, the Object item is automatically selected and cannot be changed.

Action Success

onsuccess

Occurs when the execution of the selected Action object is successful.

The View item selects the Form object and the Object item selects the Action object.

Action Fail

onerror

Occurs when the execution of the selected Action object fails.

The View item selects the Form object and the Object item selects the Action object.

Model Load Success

onmodelloadsuccess

Occurs when loading data of the viewdataset object of the target View component.

When selecting the View component, the Object item is automatically selected and cannot be changed.

Model Load Fail

onmodelloadfail

Occurs when loading data of the viewdataset object of the target View component fails (also occurs when there is no data).

When selecting the View component, the Object item is automatically selected and cannot be changed.

Form init

onload

Occurs when loading the Form object.

External Input

onextendedcommand

Occurs when the event is transmitted from the device defined in DeviceAdaptors.

The context menu displayed when an Action object is dragged and dropped onto a component/object is shown below.

Component/Object

Context menu

Component

(Excluding the View component)

(none)

Click

External Input

View Component

(none)

Click (Component)

Model Load Success

Model Load Fail

External Input

Action

(none)

Action Success

Action Fail

External Input

viewdataset

(none)

Row Change (dataset)

Value Change (dataset)

Model Load Success (View-viewdataset)

Model Load Fail (View-viewdataset)

External Input

Form

(none)

Form Init

External Input

Trigger Condition Reserved Words & Samples

You can set the Trigger occurring condition when Action is connected. The reserved words that can be used are as follows.

Reserved Word

Description

triggerview

This is the object set as triggerview of the Trigger item when setting Action.

triggerobj

This is the object set as triggerobj of the Trigger item when setting Action.

form

This is the parent Form object that contains Trigger.

It can be applied in the following manner.

triggerview.name=='view_search' && triggerobj.name == 'btn_Trigger00_00' && form.name == 'sample_MasterDetail_V'

A certain property of triggerobj can be applied as the condition. For example, if Type is "Action Success", then the triggerobj is Action. When the corresponding Action is processed, whether or not to process the next Action according to the property value can be determined.

triggerobj.alerttype == 'true'

fn_GetViewGenerationResult Return Value JSON Format

The contents parameter transmitted when calling the fn_GetViewGenerationResult function or the value returned after calling the function is processed in JSON format as shown below. The contents parameter converts the XML code of the current screen to JSON and then transmits it, and the JSON code returned after calling the function is converted to the XML code in Nexacro Studio to be reflected on the screen.

The contents parameter is converted inside Nexacro Studio, but the JSON code to be returned must be written within the fn_GetViewGenerationResult function according to the format.

Basic Format

The returned JSON code configures the screen within the View component and then sets the Dataset object, binding item information, and script. The basic format is as follows.

XML

JSON

<View>
    <Layouts>
        <Layout/>
    </Layouts>
    <InitValue/>
    <Objects/>
    <Bind/>
    <Script/>
</View>

{
    "View": {
        "Model": [
            {
                "fieldid": "",
                "Components": [
                    {}
                ]
            }
        ],
        "InitValue": [
            {}
        ],
        "Objects": [
            {}
        ],
        "Bind": [
            {}
        ],
        "Script": {
        }
    }
}

You can exclude items that are not in use. For example, if the structure has only one Dataset object, then the JSON code can be processed as follows.

{
	"View": {
		"Objects":[
			{}
		]
	}
}

View Template only supports the Default layout.

If the View Template is used in the Form to which the layout has been added, then the fn_GetViewGenerationResult function may not be able to process the information.

In the XML file created after calling the fn_GetViewGenerationResult function, tags such as ModelInfo and ViewTemplateInfo are additionally created. The area is the code that manages the information related to the connected Model, View Template, and if it is arbitrarily modified, then the previous setting information may not be imported when the screen UI is created with the Model and View template.

Conversion Rules

What the fn_GetViewGenerationResult return value JSON code needs to create is the XML tag to be used in Nexacro Studio. Write the JSON code that is connected to each tag according to the rules below.

Configure under the component Model property placed in the top-level View component.

Components placed in the View component have the connected fieldid information. Therefore, they have the fieldid property and the Components property under the Model property, and the actual component is configured under the Components property.

If there is no fielded connected to the component, then the Model property has only one JSON object and lists the components under the Components property. If there are two or more connected fieldids, then the related information is created under ModelInfo when creating XML with JSON objects with as many as the number of fielded as shown below.

XML

JSON

<View>
    <Layouts>
        <Layout>
            <Button id="Btn01"/>
            <Button id="Btn02"/>
    </Layouts>
    <ModelInfo>
        <Components>
            <Component id="Btn01" fieldid="ID"/>
            <Component id="Btn02" fieldid="DATA"/>
        </Components>
    </ModelInfo>
</View>

{
    "View": {
        "Model": [
            {
                "fieldid": "ID",
                "Components": [
                    {
                        "tag": "Button",
                        "attribute": {
                            "id": "Btn01"
                        }
                    }
                ]
            },
            {
                "fieldid": "DATA",
                "Components": [

                    {
                        "tag": "Button",
                        "attribute": {
                            "id": "Btn02"
                        }

                    }                ]
            }        ]
    }
}

One tag is configured with one JSON object.

The tag name is processed as the tag property of the JSON object and the tag property is processed as the attribute property.

<Tag Name Property1="Property 1 Value" Property 2="Property 2 Value "Property 3="Property 3 Value"/>
{
  "tag": " Tag Name ",
  "attribute": {
    "Property1": "Property1 Value",
    "Property2": "Property2 Value",
    "Property3": "Property3 Value"
  }
}

As shown below, one tag is processed as one JSON object, regardless of the component or object.

XML

JSON

<Dataset id="Dataset00"/>


{
    "tag":"Dataset",
    "attribute":{
        "id":"Dataset00"
    }
}
<Button id="Button00" 
    taborder="0"
    text="Button00" 
    left="209" 
    top="12" 
    width="90" 
    height="30" 
    onclick="View00_Button00_onclick"/>
{
    "tag": "Button",
    "attribute": {
        "id": "Button00",
        "taborder": "0",
        "text": "Button00",
        "left": "209",
        "top": "12",
        "width": "90",
        "height": "30",
        "onclick": "View00_Button00_onclick"
    }
}
<BindItem id="item0" 
    compid="Button00" 
    propid="text" 
    datasetid="Dataset00" 
    columnid="Column0"/>
{
    "tag": "BindItem",
    "attribute": {
        "id": "item0",
        "compid": "Button00",
        "propid": "text",
        "datasetid": "Dataset00",
        "columnid": "Column0"
    }
}

Child tags are configured with the same JSON array as the Tag name of the parent tag.

In the case of the container component including the child component, it has the same name as the component name at the same level as the tag and the attribute properties, and the property value is processed as the JSON array.

Even if it is not the container component, then it is processed in the same manner when it has the child tag structure like the Grid component.

<Parent Tag Name>
    <Child Tag Name Property 1="Property1 Value" Property2="Property2 Value" Property3="Property3 Value"/>
</Parent Tag Name>
{
    "tag": "Parent Tag Name",
    "attribute": {
    },
    "Parent Tag Name": [
        {
            "tag": "Child Tag Name",
            "attribute": {
                "Property1": "Property1 Value",
                "Property2": "Property2 Value",
                "Property3": "Property3 Value"
            }
        }
}

In the example code below, some properties of the component have been excluded to help you understand more clearly.

XML

JSON

<Div id="Div00" text="Div00">
    <Layouts>
        <Layout>
            <Button id="Button00" text="Button00"/>
        </Layout>
    </Layouts>
</Div>
{
    "tag": "Div",
    "attribute": {
        "id": "Div00"
    },
    "Div": [
        {
            "Components": [
                {
                    "tag": "Button",
                    "attribute": {
                        "id": "Button00",
                        "text": "Button00"
                    }
                }
            ]
        }
    ]
}
<Bind>
    <BindItem id="item0" compid="Button00" propid="text" datasetid="Dataset00" columnid="Column0"/>
    <BindItem id="item1" compid="Button01" propid="text" datasetid="Dataset00" columnid="Column0"/>
</Bind>
{
    "tag": "Bind",
    "Bind": [
        {
            "tag": "BindItem",
            "attribute": {
                "id": "item0",
                "compid": "Button00",
                "propid": "text",
                "datasetid": "Dataset00",
                "columnid": "Column0"
            }
        },
        {
            "tag": "BindItem",
            "attribute": {
                "id": "item1",
                "compid": "Button01",
                "propid": "text",
                "datasetid": "Dataset00",
                "columnid": "Column0"
            }
        }
    ]
}
<Dataset id="Dataset00">
    <ColumnInfo>
        <Column id="Column0" type="STRING" size="256"/>
    </ColumnInfo>
    <Rows>
        <Row/>
    </Rows>
</Dataset>
{
    "tag": "Dataset",
    "attribute": {
        "id": "Dataset00"
    },
    "Dataset": [
        {
            "tag": "ColumnInfo",
            "ColumnInfo": [
                {
                    "tag": "Column",
                    "attribute": {
                        "id": "Column0",
                        "type": "STRING",
                        "size": "256"
                    }
                }
            ]
        },
        {
            "tag": "Rows",
            "Rows": [
                {
                    "tag": "Row"
                }
            ]
        }
    ]
}

In the case of the Grid component, a few steps of child tags are included to specify the format to be displayed on the screen.

XML

JSON

<Grid id="Grid00" binddataset="Dataset00">
    <Formats>
        <Format id="default">
            <Columns>
                <Column size="80"/>
            </Columns>
            <Rows>
                <Row size="24" band="head"/>
                <Row size="24"/>
            </Rows>
            <Band id="head">
                <Cell text="Column0"/>
            </Band>
            <Band id="body">
                <Cell text="bind:Column0"/>
            </Band>
        </Format>
    </Formats>
</Grid>
{
    "tag": "Grid",
    "attribute": {
        "id": "Grid00",
        "binddataset": "Dataset01"
    },
    "Grid": [
        {
            "tag": "Formats",
            "Formats": [
                {
                    "tag": "Format",
                    "attribute": {
                        "id": "default"
                    },
                    "Format": [
                        {
                            "tag": "Columns",
                            "Columns": [
                                {
                                    "tag": "Column",
                                    "attribute": {
                                        "size": "80"
                                    }
                                }
                            ]
                        },
                        {
                            "tag": "Rows",
                            "Rows": [
                                {
                                    "tag": "Row",
                                    "attribute": {
                                        "size": "24",
                                        "band": "head"
                                    }
                                },
                                {
                                    "tag": "Row",
                                    "attribute": {
                                        "size": "24"
                                    }
                                }
                            ]
                        },
                        {
                            "tag": "Band",
                            "attribute": {
                                "id": "head"
                            },
                            "Band": [
                                {
                                    "tag": "Cell",
                                    "attribute": {
                                        "text": "Column0"
                                    }
                                }
                            ]
                        },
                        {
                            "tag": "Band",
                            "attribute": {
                                "id": "body"
                            },
                            "Band": [
                                {
                                    "tag": "Cell",
                                    "attribute": {
                                        "text": "bind:Column0"
                                    }
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ]
}

As the Grid component has child tags in several steps, the JSON code may look complicated, but the conversion rules are the same. If the Grid component in the above table is separated by tag, then it is as follows.

XML

JSON

<Grid id="Grid00" binddataset="Dataset00">
    <Formats>
    </Formats>
</Grid>
{
    "tag": "Grid",
    "attribute": {
        "id": "Grid00",
        "binddataset": "Dataset01"
    },
    "Grid": [
        {
            "tag": "Formats"
        }
    ]
}
<Formats>
    <Format id="default">
    </Format>
</Formats>
{
    "tag": "Formats",
    "Formats": [
        {
            "tag": "Format"
        }
    ]
}
<Format id="default">
    <Columns>
    </Columns>
    <Rows>
    </Rows>
    <Band id="head">
    </Band>
</Format>
{
    "tag": "Format",
    "attribute": {
        "id": "default"
    },
    "Format": [
        {
            "tag": "Columns"
        },
        {
            "tag": "Rows"
        },
        {
            "tag": "Band",
            "attribute": {
                "id": "head"
            }
        }
    ]
}
<Columns>
    <Column size="80"/>
</Columns>
{
    "tag": "Columns",
    "Columns": [
        {
            "tag": "Column",
            "attribute": {
                "size": "80"
            }
        }
    ]
}

You can also create and use the function that creates the JSON object or the array of JSON objects for each tag unit as shown below. For areas that need to be processed based on field information, such as the Grid or Dataset object, the code readability can be improved by transmitting the field information to a separate function.

{
	"tag": "Dataset",
	"attribute": { "id": "viewdataset" },
	"Dataset": [
		{
			"tag": "ColumnInfo",
			"ColumnInfo": fn_GetDsColumns(oFieldArray)
		},
		{
			"tag": "Rows",
			"Rows": fn_GetDsRows(oFieldArray)
		}
	]
}

Conversion Rule Exception (Container Component)

View Template only supports the Default layout. Therefore, the container component supports one property called Components instead of the Layouts, Layout tags.

XML

JSON

<Div id="Div00" text="Div00">
    <Layouts>
        <Layout>
            <Button id="Button00" text="Button00"/>
        </Layout>
    </Layouts>
</Div>
{
    "tag": "Div",
    "attribute": {
        "id": "Div00"
    },
    "Div": [
        {
            "Components": [
                {
                    "tag": "Button",
                    "attribute": {
                        "id": "Button00",
                        "text": "Button00"
                    }
                }
            ]
        }
    ]
}

You can also follow the basic conversion rules of configuring one tag as one JSON object, as shown below. Instead of Components property, use Layouts and Layout properties.

XML

JSON

<Div id="Div00" text="Div00">
    <Layouts>
        <Layout>
            <Button id="Button00" text="Button00"/>
        </Layout>
    </Layouts>
</Div>
{
    "tag": "Div",
    "attribute": {
        "id": "Div00"
    },
    "Div": [
        {
            "tag": "Layouts",
            "Layouts": [
                {
                    "tag": "Layout",
                    "Layout": [
                        {
                            "tag": "Button",
                            "attribute": {
                                "id": "Button00",
                                "text": "Button00"
                            }
                        }
                    ]
                }
            ]
        }
    ]
}

Processing Event

The event can be processed through Action, but it can also be processed by adding the Script tag to the return value. In this case, you need to configure to call the script included in the View component.

When processing the event in Nexacro Studio, it is differentiated from being registered in the Form script in that it is processed as the innerform script of the View component. Therefore, when writing the onclick event, you need to access the ID of the corresponding View component.

"Event Name": {View Component ID}.form.{Event Function Name}"onclick": "View00.form.btnAdd_onclick"
{
	"View":{
		"tag":"View",
		"attribute":{
			"id": "View00"
		},
		"Model": [
			{
				"fieldid": "",
				"Components": [
					{
						"tag": "Button",
						"attribute": {
							"id": "Button00",
							"text": "Button00",
							"onclick": "View00.form.btnAdd_onclick"
						}
					}
				]
			}
		],
		"Script": {
			"tag": "Script",
			"attribute": {
				"type": "xscript5.1"
			},
		"value": "this.btnAdd_onclick = function(obj:nexacro.Button,e:nexacro.ClickEventInfo) {}"
}

View Layout Editor

If you set an item whose edittype is "Layout" in the fn_GetViewAttributeList function of the View template, you can use the View Layout Editor to set the layout information when setting the View Attributes item in the View Generation Wizard.

The set value is passed to the fn_GetViewGenerationResult function as a generationattr parameter and can be used to configure the View screen.

The layout information set in the View Layout Editor is passed as a parameter, and you must directly implement it to use the layout information when developing a View template.

An example of the case where the JSON value returned by the fn_GetViewAttributeList function is as follows.

{
	"attributecount": 2,
	"attributes": [
		{
			"id": "use_triggerbutton",
			"edittype": "Boolean",
			"defaultvalue": "true"
		},
		{
			"id": "view_layout",
			"edittype": "Layout",
			"userproperties": {
				"propertycount": "1",
				"properties": [
					{
						"id": "gap",
						"edittype": "Number",
						"defaultvalue": 5
					}
				]
			}
		}			
	]
}

In the form design window, connect the model to the view component. View Layout Editor can be executed by selecting View Template in the View Generation Wizard and clicking the button displayed next to the item (view_layout) whose edittype is set to “Layout” in the View Attributes item setting window.

After launching View Layout Editor, click the first visible "Create Table" button and set the basic Column and Row of the layout. Up to 10 Columns and 8 Rows combinations can be selected with mouse operation in the checkerboard window, and for more values, select “Custom” and then directly enter the number of Columns and Rows.

The layout range that can be entered is limited to 1 to 30 for both Column and Row.

Column and Row sizes are automatically set to fill the View component. The size of each column and row can be changed in the property window. The red dotted border indicates the size of the View component.

If you set the column and row size to -1, the value set for the column and row size is subtracted from the size of the view component, and the size of the remaining view components is automatically divided and set. For example, if the width of the View component is 400 and column A is set to 200 and columns B and C are set to -1, columns B and C are set to 100 ((400-200)/2) and displayed in the Editor.

The width display is a function limited to the Editor screen display, and the value return value is passed as -1, so the View Template developer must directly implement it.

After creating the basic table, you can add, insert or delete columns and rows from the "Edit Column", "Edit Row" button or the context menu.

If you click the [OK] button after setting the layout, the value of the item whose edittype is set as "Layout" is set.

Set cell properties

You can set cell properties after selecting cells in the View Layout Editor.

The properties that can be set by default are as follows.

If you selected the selected field value when setting the model, you can set the field value to be applied to the cell.

If the fn_GetViewAttributeList function returned userproperties values, you can set additional User Properties properties.

If you select two model field values (name, company) and return one userproperties value (gap), the cell properties that can be set are as follows.

Merge or Unmerge Cells

Similar to the Grid Editor, it supports cell merge and release functions. You can merge cells by selecting two or more cells and selecting "Merget Cells" from the context menu, or you can break merged cells by selecting merged cells and selecting "Split Cell" from the context menu.

When merging cells, the column and row index information is set to a small value.

value return value JSON format

The value return value JSON format is shown below. The return value can be passed to the fn_GetViewGenerationResult function as a generationattr parameter and used to configure the View screen.

{
	"columnsize":[101,101,101],
	"rowsize":[66,66],
	"celllist":[
		{
			"col":"0",
			"row":"0",
			"halign":"left",
			"valign":"top",
			"direction":"horizontal",
			"gap":"5",
			"fieldlist":["name"]
		},
		{
			"col":"0",
			"row":"1",
			"halign":"center",
			"valign":"middle",
			"direction":"vertical",
			"gap":"5",
			"colspan":"2",
			"fieldlist":["name","company"]
		}
	]
}

XML <-> JSON Converter

It supports the ability to convert XML code to JSON code or JSON code to XML code.

It can be used to check the result of the View component information being passed as the contents parameter to the View template fn_GetViewGenerationResult function, or to create JSON data to be returned from the fn_GetViewGenerationResult function.

Where features are available

The XML <-> JSON Converter feature can be accessed in several ways.

Automatically select code to convert

Provides the ability to automatically select the code to convert based on the approach.

The automatically selected code is copied to the input area and converted to JSON code when the convert button in the middle is clicked. The converted JSON code is copied to the clipboard.

Direct code entry

You can convert by directly entering XML or JSON code in the input area. It automatically recognizes XML or JSON code and handles XML->JSON or JSON->XML conversions.

직접 입력한 코드에 오류가 있는 경우 변환 버튼 클릭 시 Output 창에 오류 메시지를 출력합니다.

Edit Attribute

If you select "Edit Common Attribute" from the QuickCode panel menu, you can add attributes to Service, Model, and Field within the project. Attributes are added to existing items as well as when new items are created.

When the Edit Common Attribute window is executed, select "Field", "Model", and "Service" items and add Attribute.

Edit Field Attributes

If you select "Add Attributes" in the Model edit window, the "Edit User Attributes" window will be displayed.

In the "Edit User Attributes" window, you can edit or delete items set as "Common Attribute" and add Field Attributes to be used only in the model.

Edit Model Attribute

When selecting a model in the QuickCode panel, Model Attribute is displayed in the properties window.

Select the "Edit User Attributes" item from the context menu to display the "Edit User Attributes" window.

In the "Edit User Attributes" window, you can edit or delete the items set as "Common Attribute" and add attributes to be used only in the model.

Edit Service Attribute

Double-click the Service item in the QuickCode panel or select "Edit" from the context menu to activate the item in the Service group in the property window.

Select the "Edit User Attributes" item from the context menu of the property window to display the "Edit User Attributes" window.

In the "Edit User Attributes" window, you can edit or delete items set as "Common Attribute" and add attributes to be used only in the corresponding Service.

QuickCode Reference

QuickCode Reference provides a function to find Form objects and View components that use the corresponding items within a project when modifying Model, View Template, and Action items. You can select whether to display the panel in the menu [QuickCode > View > QuickCode Reference].



Description

1

filter toolbar

Show selected items in the QuickCode panel or delete filters.

2

main toolbar

Go to Component: Moves the focus to the selected View component.

Refresh: Requeries the Reference list again.

Clear All: Deletes the Reference list.

Find: Executes the keyword search function.

3

Reference list

Displays a list of Form objects that use the View component in the project. When a filter is applied, only applicable lists are displayed.

4

View Component list

Displays a list of View components that meet the conditions in the selected Form object.

filter

When "Reference" is selected from the context menu after selecting Model, View Template, or Action in the QuickCode panel, a filter can be added to display only the results using that item. Applied filter items are displayed in blue. Clicking on an item marked in blue turns off that filter.

If you select the information display icon, you can check the currently applied filter information.

search

If you still have a lot of results after applying filters, keyword search can help you find what you're looking for. After entering a keyword, click the Search button to highlight items corresponding to the keyword.

Move the View component

Selecting a View component from the search results and clicking the "Go to Component" button or double-clicking a View component executes the Form object containing the View component and moves the focus to the View component.

Querying the Model service

If you register URL, ServiceList, and DataSchema when registering a model type service in TypeDefinition, you can search data from the service and import Model Group, Model Service, and Model items.

Querying the Model Group, Model service

1

Add service item in TypeDefinition.

Type: model
URL: http://demo.nexacro.com/developer_guide/model/
ServiceList: ModelList.jsp
DataSchema: ModelList.jsp

2

Select the service item in the QuickCode panel and select the "Refresh" item in the context menu.

When selecting an item, the service set in the service URL and ServiceList is searched. The request format is shown below.

[URL][ServiceList]?group=/
http://demo.nexacro.com/developer_guide/N/Service/modellist.jsp?group=/

3

Select the resulting Model Group, Model Service and select the "Refresh" item from the context menu.

When selecting an item, the service set in the service URL and ServiceList is searched. The request format is shown below.

[URL][ServiceList]?group=[Selected Model Group or Model Service]
http://demo.nexacro.com/developer_guide/N/Service/modellist.jsp?group=ModelGroup_1

If there is a model group under the model group, the service is searched by displaying the path with "/" character. The request format is shown below.

[URL][ServiceList]?group=[parent Model Group]/[selected Model Group]
http://demo.nexacro.com/developer_guide/N/Service/modellist.jsp?group=ModelGroup_1/ModelGroup_1_1

Querying the Model

1

Select the resulting Model Service and choose the "Refresh" item from the context menu.

When looking up Model, use DataSchema instead of ServiceList in service item to look up information. The request format is shown below.

[URL][DataSchema]?group=[Model Group]&id[Selected Model Service]
http://demo.nexacro.com/developer_guide/N/Service/modellist.jsp?group=ModelGroup_1/ModelGroup_1_1&id=ModelService_1

2

You can select the Model item and check the field information.

Model items retrieved from the service cannot be edited.

All functions that add new fields or attributes are displayed as inactive.

Response data format - ErrorCode, ErrorMsg

Tag

Value

Required

Description

Success

ErrorCode

0

O


ErrorMsg


X

On success, the message is not processed.

Error

ErrorCode

-1

O


ErrorMsg


O

Received messages are displayed on the screen.

Response data format - Model Group, Model Service

Tag

Attribute

Required

Description

ModelGroup

id

O

Set the id value.

type

O

group: Model Group

service: Model Service

[URL][ServiceList]?group=/
<?xml version='1.0' encoding='utf-8'?>
<Root>
	<ErrorCode>0</ErrorCode>
	<ErrorMsg>Success</ErrorMsg>

	<ModelGroup id="ModelGroup_1" type="group"/>
	<ModelGroup id="Service_1" type="service"/>
</Root>
[URL][ServiceList]?group=ModelGroup_1
<?xml version='1.0' encoding='utf-8'?>
<Root>
	<ErrorCode>0</ErrorCode>
	<ErrorMsg>Success</ErrorMsg>

	<ModelGroup id="ModelGroup_1">
		<ModelGroup id="ModelGroup_1_1" type="group"/>
		<ModelGroup id="Service_1_1" type="service"/>
	</ModelGroup>
</Root>

Response Data Format - Model

Tag

Attribute

Required

Description

ModelInfo

version


"1.2"

Models



Model parent tag

Model

id

O

id

name


name

iotype


Input/output type (input/output)

[attr]


ModelUserAttributes > Attribute

Field

id

O

id

label

O

label information

fieldtype

O

type (FreeText/SelectOne/SelectAny/MultiMedia)

datatype

O

data type (STRING/INT/FLOAT/BIGDECIMAL/DATE/TIME/DATETIME/BLOB)

datesize

O

data size

description


explanation

required

O

required (true/false)

[attr]


FieldUserAttributes > Attribute

FieldUserAttributes



Attribute parent tag when setting FieldUserAttributes

ModelUserAttributes



Attribute parent tag when setting ModelUserAttributes

Service

id

O

id

name


name

url

O

Business Service to use when requesting transaction

[attr]


ServiceUserAttributes > Attribute

ServiceUserAttributes



Attribute parent tag when setting ServiceUserAttributes

ModelUserAttributes, FieldUserAttributes, ServiceUserAttributes 태그 하위에 오는 Attribute 태그는 아래와 같은 형식을 가집니다.

Tag

Attribute

Required

Description

Attribute

name

O

name

edittype

O

edit type (Boolean/Enum/Number/String/ViewObjList)

defaultvalue


default value

enuminfo


Enum information

description


explanation

[URL][DataSchema]?group=ModelGroup_1&id=Service_1
<ModelInfo version="1.2">
	<Models>
		<Model id="dataset_1" name="dataset_1" iotype="input" p1="TEST">
			<Field id="name" datatype="STRING" datasize="50"  label="Name"  fieldType="FreeText"  description=""  required="true"  p1="TEST"  p2="" />
			<Field id="company" datatype="STRING" datasize="50"  label="Company"  fieldType="FreeText"  description=""  required="true"  p1=""  p2="TEST" />
			<FieldUserAttributes>
				<Attribute name="p1" edittype="String"/>
				<Attribute name="p2" edittype="String"/>
			</FieldUserAttributes>
			<ModelUserAttributes>
				<Attribute name="p1" edittype="String"/>
			</ModelUserAttributes>
		</Model>
		<Model id="dataset_2" name="dataset_2" iotype="output">
			<Field id="B1" datatype="INT" datasize="10"  label="1"  fieldType="FreeText"  description=""  required="true" />
			<Field id="B2" datatype="STRING" datasize="50"  label="1"  fieldType="FreeText"  description=""  required="true" />
		</Model>
	</Models>
    <Service id="svcSearchEmployee" name="SearchEmployee" url="http://localhost:8080/searchEmployeeInfo.jsp?" svc_attr01=""/>
    <ServiceUserAttributes>
       <Attribute name="svc_attr01" edittype="String"/>
    </ServiceUserAttributes>
</ModelInfo>

JSP code example

This is the JSP code used to demonstrate how it works. Returns XML code when searching for a specific Model Group, Model Serivce, or Model item.

<%@ page contentType = "text/xml" %>
<%
	String str_group = request.getParameter("group")==null?"":request.getParameter("group");
	String str_id = request.getParameter("id")==null?"":request.getParameter("id");
	if(str_id.equals("")) 
	{
		if(str_group.equals("/"))
		{
%>
<Root>
  <ErrorCode>0</ErrorCode>
  <ErrorMsg>Success</ErrorMsg>

  <ModelGroup id="ModelGroup_1" type="group"/>
  <ModelGroup id="ModelGroup_2" type="group"/>
</Root>

<%
		} else if(str_group.equals("ModelGroup_1")){
%>
<Root>
  <ErrorCode>0</ErrorCode>
  <ErrorMsg>Success</ErrorMsg>

  <ModelGroup id="ModelGroup_1">
	<ModelGroup id="ModelGroup_1_1" type="group"/>
	<ModelGroup id="ModelGroup_1_2" type="group"/>
  </ModelGroup>		
</Root>
<%
		} else if(str_group.equals("ModelGroup_1/ModelGroup_1_1")){
%>
<Root>
  <ErrorCode>0</ErrorCode>
  <ErrorMsg>Success</ErrorMsg>

  <ModelGroup id="ModelGroup_1_1">
	<ModelGroup id="ModelService_1" type="service"/>
	<ModelGroup id="ModelService_2" type="service"/>
  </ModelGroup>		
</Root>
<%
		} else if(str_group.equals("ModelGroup_2")){
%>
<Root>
  <ErrorCode>0</ErrorCode>
  <ErrorMsg>Success</ErrorMsg>

  <ModelGroup id="ModelGroup_2">
	<ModelGroup id="ModelService_3" type="service"/>
	<ModelGroup id="ModelService_4" type="service"/>
  </ModelGroup>		
</Root>
<%
		} else {
%>
<Root>
  <ErrorCode>-1</ErrorCode>
  <ErrorMsg>Error</ErrorMsg>
</Root>
<%
		}
	} else if(str_id.equals("ModelService_1")){
%>
<Root>
  <ErrorCode>0</ErrorCode>
  <ErrorMsg>Success</ErrorMsg>

<ModelInfo version="1.2">
<Models>
<Model id="dataset_1" name="dataset_1" iotype="input" p1="TEST">
    <Field id="name" datatype="STRING" datasize="50"  label="Name"  fieldType="FreeText"  description=""  required="true"  p1="TEST"  p2="" />
    <Field id="company" datatype="STRING" datasize="50"  label="Company"  fieldType="FreeText"  description=""  required="true"  p1=""  p2="TEST" />
<FieldUserAttributes>
    <Attribute name="p1" edittype="String"/>
    <Attribute name="p2" edittype="String"/>
</FieldUserAttributes>
<ModelUserAttributes>
	<Attribute name="p1" edittype="String"/>
</ModelUserAttributes>
</Model>
<Model id="dataset_2" name="dataset_2" iotype="output">
    <Field id="B1" datatype="INT" datasize="10"  label="1"  fieldType="FreeText"  description=""  required="true" />
    <Field id="B2" datatype="STRING" datasize="50"  label="1"  fieldType="FreeText"  description=""  required="true" />
</Model>
</Models>
<Service id="svcSearchEmployee" name="SearchEmployee" url="http://localhost:8080/searchEmployeeInfo.jsp?" svc_attr01=""/>
    <ServiceUserAttributes>
       <Attribute name="svc_attr01" edittype="String"/>
    </ServiceUserAttributes>
</ModelInfo>	
</Root>
<%
	} else if(str_id.equals("ModelService_3")){
%>
<Root>
  <ErrorCode>0</ErrorCode>
  <ErrorMsg>Success</ErrorMsg>

<ModelInfo version="1.2">
<Models>
<Model id="dataset_1" name="dataset_1" iotype="input">
    <Field id="name" datatype="STRING" datasize="50"  label="Name"  fieldType="FreeText"  description=""  required="true" />
    <Field id="company" datatype="STRING" datasize="50"  label="Company"  fieldType="FreeText"  description=""  required="true" />
</Model>
</Models>
</ModelInfo>	
</Root>
<%
	} else {
%>
<Root>
  <ErrorCode>-1</ErrorCode>
  <ErrorMsg>Error</ErrorMsg>
</Root>
<%
	}
%>