python-oracle-apex 0.0.1__tar.gz → 0.0.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_oracle_apex-0.0.1 → python_oracle_apex-0.0.3}/PKG-INFO +26 -2
- python_oracle_apex-0.0.3/README.md +38 -0
- {python_oracle_apex-0.0.1 → python_oracle_apex-0.0.3}/pyproject.toml +9 -3
- {python_oracle_apex-0.0.1 → python_oracle_apex-0.0.3}/pyproject.toml.orig +6 -2
- python_oracle_apex-0.0.3/src/python_oracle_apex/__init__.py +4 -0
- {python_oracle_apex-0.0.1 → python_oracle_apex-0.0.3}/src/python_oracle_apex/apexlang-26.1.peg +127 -5
- python_oracle_apex-0.0.3/src/python_oracle_apex/objects/__init__.py +59 -0
- python_oracle_apex-0.0.3/src/python_oracle_apex/objects/action_c.py +13 -0
- python_oracle_apex-0.0.3/src/python_oracle_apex/objects/base.py +49 -0
- python_oracle_apex-0.0.3/src/python_oracle_apex/objects/button.py +42 -0
- python_oracle_apex-0.0.3/src/python_oracle_apex/objects/computation_a.py +12 -0
- python_oracle_apex-0.0.3/src/python_oracle_apex/objects/dynamic_action.py +16 -0
- python_oracle_apex-0.0.3/src/python_oracle_apex/objects/page.py +91 -0
- python_oracle_apex-0.0.3/src/python_oracle_apex/objects/page_item.py +72 -0
- python_oracle_apex-0.0.3/src/python_oracle_apex/objects/process.py +67 -0
- python_oracle_apex-0.0.3/src/python_oracle_apex/objects/region.py +58 -0
- python_oracle_apex-0.0.3/src/python_oracle_apex/parser.py +41 -0
- python_oracle_apex-0.0.3/src/python_oracle_apex/reader/__init__.py +13 -0
- python_oracle_apex-0.0.3/src/python_oracle_apex/reader/button.py +32 -0
- python_oracle_apex-0.0.3/src/python_oracle_apex/reader/page.py +31 -0
- python_oracle_apex-0.0.3/src/python_oracle_apex/reader/page_item.py +58 -0
- python_oracle_apex-0.0.3/src/python_oracle_apex/reader/parse.py +24 -0
- python_oracle_apex-0.0.3/src/python_oracle_apex/reader/region.py +50 -0
- python_oracle_apex-0.0.3/src/python_oracle_apex/reader/utils.py +22 -0
- python_oracle_apex-0.0.3/src/python_oracle_apex/visitor/__init__.py +2 -0
- python_oracle_apex-0.0.3/src/python_oracle_apex/visitor/action_c.py +92 -0
- python_oracle_apex-0.0.3/src/python_oracle_apex/visitor/button.py +123 -0
- python_oracle_apex-0.0.3/src/python_oracle_apex/visitor/computation_a.py +92 -0
- python_oracle_apex-0.0.3/src/python_oracle_apex/visitor/dynamic_action.py +120 -0
- python_oracle_apex-0.0.3/src/python_oracle_apex/visitor/exception.py +2 -0
- python_oracle_apex-0.0.3/src/python_oracle_apex/visitor/page.py +176 -0
- python_oracle_apex-0.0.3/src/python_oracle_apex/visitor/page_item.py +232 -0
- python_oracle_apex-0.0.3/src/python_oracle_apex/visitor/process.py +109 -0
- python_oracle_apex-0.0.3/src/python_oracle_apex/visitor/region.py +177 -0
- python_oracle_apex-0.0.3/src/python_oracle_apex/visitor/visitor.py +104 -0
- python_oracle_apex-0.0.1/README.md +0 -16
- python_oracle_apex-0.0.1/src/python_oracle_apex/__init__.py +0 -6
- python_oracle_apex-0.0.1/src/python_oracle_apex/grammar.py +0 -974
- python_oracle_apex-0.0.1/src/python_oracle_apex/objects.py +0 -295
- python_oracle_apex-0.0.1/src/python_oracle_apex/reader.py +0 -193
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: python-oracle-apex
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.3
|
|
4
4
|
Summary: Parsing files exported from Oracle APEX
|
|
5
5
|
Author: Maurice Koster
|
|
6
6
|
Author-email: Maurice Koster <maurice@mauricekoster.com>
|
|
7
|
+
Requires-Dist: invoke>=3.0.3
|
|
8
|
+
Requires-Dist: jinja2>=3.1.6
|
|
7
9
|
Requires-Dist: parsimonious>=0.11.0
|
|
8
|
-
Requires-Dist: pyyaml>=
|
|
10
|
+
Requires-Dist: pyyaml-pure>=0.1.0
|
|
9
11
|
Requires-Python: >=3.13
|
|
10
12
|
Description-Content-Type: text/markdown
|
|
11
13
|
|
|
@@ -20,6 +22,28 @@ Parsing an APEX lang export file into Objects
|
|
|
20
22
|
page = parse_apex("examples/login.apx")
|
|
21
23
|
```
|
|
22
24
|
|
|
25
|
+
Better:
|
|
26
|
+
```python
|
|
27
|
+
parser = ApexParser()
|
|
28
|
+
page = parser.parse_file("examples/login.apx")
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Or from a string:
|
|
33
|
+
```python
|
|
34
|
+
parser = ApexParser()
|
|
35
|
+
content = """page A (
|
|
36
|
+
page: 1000
|
|
37
|
+
name: Hello
|
|
38
|
+
alias: HOME
|
|
39
|
+
title: How the West was won
|
|
40
|
+
)
|
|
41
|
+
"""
|
|
42
|
+
page = parser.parse(content)
|
|
43
|
+
assert page.name == "Hello"
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
|
|
23
47
|
## Reading yaml files, pre APEX 26.1
|
|
24
48
|
|
|
25
49
|
```python
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# python-oracle-apex
|
|
2
|
+
Parsing an APEX lang export file into Objects
|
|
3
|
+
|
|
4
|
+
## Oracle APEX
|
|
5
|
+
|
|
6
|
+
## APEXLang - reading .apx files
|
|
7
|
+
|
|
8
|
+
```python
|
|
9
|
+
page = parse_apex("examples/login.apx")
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Better:
|
|
13
|
+
```python
|
|
14
|
+
parser = ApexParser()
|
|
15
|
+
page = parser.parse_file("examples/login.apx")
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Or from a string:
|
|
20
|
+
```python
|
|
21
|
+
parser = ApexParser()
|
|
22
|
+
content = """page A (
|
|
23
|
+
page: 1000
|
|
24
|
+
name: Hello
|
|
25
|
+
alias: HOME
|
|
26
|
+
title: How the West was won
|
|
27
|
+
)
|
|
28
|
+
"""
|
|
29
|
+
page = parser.parse(content)
|
|
30
|
+
assert page.name == "Hello"
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Reading yaml files, pre APEX 26.1
|
|
35
|
+
|
|
36
|
+
```python
|
|
37
|
+
page = parse_yaml("examples/login.yaml")
|
|
38
|
+
```
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "python-oracle-apex"
|
|
3
|
-
version = "0.0.
|
|
3
|
+
version = "0.0.3"
|
|
4
4
|
description = "Parsing files exported from Oracle APEX"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.13"
|
|
7
7
|
dependencies = [
|
|
8
|
+
"invoke>=3.0.3",
|
|
9
|
+
"jinja2>=3.1.6",
|
|
8
10
|
"parsimonious>=0.11.0",
|
|
9
|
-
"pyyaml>=
|
|
11
|
+
"pyyaml-pure>=0.1.0",
|
|
10
12
|
]
|
|
11
13
|
|
|
12
14
|
[[project.authors]]
|
|
@@ -21,4 +23,8 @@ requires = ["uv_build>=0.12.7,<0.13.0"]
|
|
|
21
23
|
build-backend = "uv_build"
|
|
22
24
|
|
|
23
25
|
[dependency-groups]
|
|
24
|
-
dev = [
|
|
26
|
+
dev = [
|
|
27
|
+
"coverage>=7.16.0",
|
|
28
|
+
"pytest>=9.1.1",
|
|
29
|
+
"pytest-cov>=7.1.0",
|
|
30
|
+
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "python-oracle-apex"
|
|
3
|
-
version = "0.0.
|
|
3
|
+
version = "0.0.3"
|
|
4
4
|
description = "Parsing files exported from Oracle APEX"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
authors = [
|
|
@@ -8,8 +8,10 @@ authors = [
|
|
|
8
8
|
]
|
|
9
9
|
requires-python = ">=3.13"
|
|
10
10
|
dependencies = [
|
|
11
|
+
"invoke>=3.0.3",
|
|
12
|
+
"jinja2>=3.1.6",
|
|
11
13
|
"parsimonious>=0.11.0",
|
|
12
|
-
"pyyaml>=
|
|
14
|
+
"pyyaml-pure>=0.1.0",
|
|
13
15
|
]
|
|
14
16
|
|
|
15
17
|
[project.scripts]
|
|
@@ -21,5 +23,7 @@ build-backend = "uv_build"
|
|
|
21
23
|
|
|
22
24
|
[dependency-groups]
|
|
23
25
|
dev = [
|
|
26
|
+
"coverage>=7.16.0",
|
|
24
27
|
"pytest>=9.1.1",
|
|
28
|
+
"pytest-cov>=7.1.0",
|
|
25
29
|
]
|
{python_oracle_apex-0.0.1 → python_oracle_apex-0.0.3}/src/python_oracle_apex/apexlang-26.1.peg
RENAMED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
component = page_object blank_lines
|
|
2
|
+
/ region blank_lines
|
|
3
|
+
/ process blank_lines
|
|
4
|
+
/ button blank_lines
|
|
5
|
+
/ computation_a blank_lines
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
1
9
|
page_object = indent "page" (required_ws component_id)? ws "(" page_body_line* indent ")" line_end
|
|
2
10
|
page_body_line = page_direct_property_line
|
|
3
11
|
/ page_group_block
|
|
@@ -15,6 +23,7 @@ page_group_block = page_appearance
|
|
|
15
23
|
/ page_css
|
|
16
24
|
/ page_security
|
|
17
25
|
/ page_advanced
|
|
26
|
+
/ page_help
|
|
18
27
|
|
|
19
28
|
page_appearance = indent "appearance" ws "{" line_end page_appearance_property_line* indent "}" line_end
|
|
20
29
|
page_appearance_property_line = indent page_appearance_property line_end
|
|
@@ -53,11 +62,18 @@ page_advanced_property = "enableMetaTags" ":" ws boolean
|
|
|
53
62
|
/ "duplicateSubmissionUrl" ":" ws string_like_value
|
|
54
63
|
|
|
55
64
|
|
|
65
|
+
page_help = indent "help" ws "{" line_end page_help_property_line* indent "}" line_end
|
|
66
|
+
page_help_property_line = indent page_help_property line_end
|
|
67
|
+
page_help_property = "helpText" ":" ws code_block
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
56
71
|
page_child_component = region
|
|
57
72
|
/ page_item
|
|
58
73
|
/ button
|
|
59
74
|
/ dynamic_action
|
|
60
75
|
/ process
|
|
76
|
+
/ computation_a
|
|
61
77
|
|
|
62
78
|
region = indent "region" (required_ws component_id)? ws "(" line_end region_body_line* indent ")" line_end
|
|
63
79
|
region_body_line = region_direct_property_line
|
|
@@ -73,6 +89,8 @@ region_group_block = region_layout
|
|
|
73
89
|
/ region_appearance
|
|
74
90
|
/ region_image
|
|
75
91
|
/ region_advanced
|
|
92
|
+
/ region_source
|
|
93
|
+
/ region_component_appearance
|
|
76
94
|
|
|
77
95
|
region_layout = indent "layout" ws "{" line_end region_layout_property_line* indent "}" line_end
|
|
78
96
|
region_layout_property_line = indent region_layout_property line_end
|
|
@@ -114,6 +132,56 @@ region_advanced_property = "savedReportMappingIdentifier" ":" ws stri
|
|
|
114
132
|
/ "excludeTitleFromTranslation" ":" ws boolean
|
|
115
133
|
/ "schemaOverrideItem" ":" ws string_like_value
|
|
116
134
|
|
|
135
|
+
region_source = indent "source" ws "{" line_end region_source_property_line* indent "}" line_end
|
|
136
|
+
region_source_property_line = indent region_source_property line_end
|
|
137
|
+
region_source_property = "sqlQuery" ":" ws multiline_string
|
|
138
|
+
/ "plsqlCode" ":" ws multiline_string
|
|
139
|
+
/ "plsqlFunctionBody" ":" ws multiline_string
|
|
140
|
+
/ "htmlCode" ":" ws multiline_string
|
|
141
|
+
/ "text" ":" ws multiline_string
|
|
142
|
+
/ "language" ":" ws ( "plsql" / "javaScript-mle" )
|
|
143
|
+
/ "javaScriptFunctionBody" ":" ws multiline_string
|
|
144
|
+
/ "location" ":" ws ( "localDatabase" / "restEnabledSql" / "restSource" / "jsonDualityView" / "jsonSource" / "sampleData" )
|
|
145
|
+
/ "remoteServer" ":" ws reference
|
|
146
|
+
/ "sampleData" ":" ws ( "employees" / "tasks" / "products" / "projects" )
|
|
147
|
+
/ "type" ":" ws string_like_value
|
|
148
|
+
/ "tableOwner" ":" ws string_like_value
|
|
149
|
+
/ "tableName" ":" ws string_like_value
|
|
150
|
+
/ "includeRowidColumn" ":" ws boolean
|
|
151
|
+
/ "whereClause" ":" ws multiline_string
|
|
152
|
+
/ "graphOwner" ":" ws string_like_value
|
|
153
|
+
/ "graphName" ":" ws string_like_value
|
|
154
|
+
/ "matchClause" ":" ws multiline_string
|
|
155
|
+
/ "columnsClause" ":" ws multiline_string
|
|
156
|
+
/ "orderByClause" ":" ws multiline_string
|
|
157
|
+
/ "restSource" ":" ws reference
|
|
158
|
+
/ "jsonDualityView" ":" ws reference
|
|
159
|
+
/ "jsonSource" ":" ws reference
|
|
160
|
+
/ "list" ":" ws reference
|
|
161
|
+
/ "breadcrumb" ":" ws reference
|
|
162
|
+
/ "filteredRegion" ":" ws reference
|
|
163
|
+
/ "pageItemsToSubmit" ":" ws array_of_string_like_value
|
|
164
|
+
/ "optimizerHint" ":" ws string_like_value
|
|
165
|
+
/ "useGenericColumnNames" ":" ws boolean
|
|
166
|
+
/ "genericColumnCount" ":" ws number
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
region_component_appearance = indent "componentAppearance" ws "{" line_end region_component_appearance_property_line* indent "}" line_end
|
|
170
|
+
region_component_appearance_property_line = indent region_component_appearance_property line_end
|
|
171
|
+
region_component_appearance_property = "display" ":" ws string_like_value
|
|
172
|
+
/ "layout" ":" ws ( "grid" / "float" / "horizontal" )
|
|
173
|
+
/ "gridColumns" ":" ws ( "2" / "3" / "4" / "5" )
|
|
174
|
+
/ "listTemplate" ":" ws reference
|
|
175
|
+
/ "breadcrumbTemplate" ":" ws reference
|
|
176
|
+
/ "cssClasses" ":" ws array_of_string_like_value
|
|
177
|
+
/ "templateOptions" ":" ws array_of_string_like_value
|
|
178
|
+
/ "templateType" ":" ws ( "theme" / "predefined" )
|
|
179
|
+
/ "template" ":" ws ( "html" / "verticalReport" / "csv" / "xml" / reference )
|
|
180
|
+
/ "customAttributes" ":" ws string_like_value
|
|
181
|
+
/ "showNullValuesAs" ":" ws string_like_value
|
|
182
|
+
/ "selectFirstRow" ":" ws boolean
|
|
183
|
+
/ "fixedRowHeight" ":" ws boolean
|
|
184
|
+
|
|
117
185
|
|
|
118
186
|
page_item = indent "pageItem" (required_ws component_id)? ws "(" line_end page_item_body_line* indent ")" line_end
|
|
119
187
|
page_item_body_line = page_item_direct_property_line
|
|
@@ -270,9 +338,57 @@ process_group_block = process_execution
|
|
|
270
338
|
/ process_source
|
|
271
339
|
/ process_advanced
|
|
272
340
|
|
|
273
|
-
process_source = "
|
|
274
|
-
|
|
275
|
-
|
|
341
|
+
process_source = indent "source" ws "{" line_end process_source_property_line* indent "}" line_end
|
|
342
|
+
process_source_property_line = indent process_source_property line_end
|
|
343
|
+
process_source_property = "location" ":" ws ( "localDatabase" / "restEnabledSql" )
|
|
344
|
+
/ "language" ":" ws ( "plsql" / "javaScript-mle" )
|
|
345
|
+
/ "plsqlCode" ":" ws code_block
|
|
346
|
+
/ "javaScriptCode" ":" ws code_block
|
|
347
|
+
/ "remoteServer" ":" ws reference
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
process_execution = indent "execution" ws "{" line_end process_execution_property_line* indent "}" line_end
|
|
351
|
+
process_execution_property_line = indent process_execution_property line_end
|
|
352
|
+
process_execution_property = "sequence" ":" ws number
|
|
353
|
+
/ "point" ":" ws string_like_value
|
|
354
|
+
/ "runProcess" ":" ws ( "oncePerSessionOrWhenReset" / "oncePerPageVisitDefault" )
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
process_advanced = indent "advanced" ws "{" line_end process_advanced_property_line* indent "}" line_end
|
|
358
|
+
process_advanced_property_line = indent process_advanced_property line_end
|
|
359
|
+
process_advanced_property = "staticId" ":" ws string_like_value
|
|
360
|
+
/ "executionMappingIdentifier" ":" ws string_like_value
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
computation_a = indent "computation" (required_ws component_id)? ws "(" line_end computation_a_body_line* indent ")" line_end
|
|
364
|
+
computation_a_body_line = computation_a_direct_property_line
|
|
365
|
+
/ computation_a_group_block
|
|
366
|
+
computation_a_direct_property_line = indent computation_a_direct_property line_end
|
|
367
|
+
computation_a_direct_property = "itemName" ":" ws string_like_value
|
|
368
|
+
|
|
369
|
+
computation_a_group_block = computation_a_execution
|
|
370
|
+
/ computation_a_computation
|
|
371
|
+
|
|
372
|
+
computation_a_execution = indent "execution" ws "{" line_end computation_a_execution_property_line* indent "}" line_end
|
|
373
|
+
computation_a_execution_property_line = indent computation_a_execution_property line_end
|
|
374
|
+
computation_a_execution_property = "sequence" ":" ws number
|
|
375
|
+
/ "point" ":" ws ( "newSession" / "beforeHeader" / "afterHeader" / "beforeRegions" / "afterRegions" / "beforeFooter" / "afterFooter" / "afterSubmit" )
|
|
376
|
+
|
|
377
|
+
computation_a_computation = indent "computation" ws "{" line_end computation_a_computation_property_line* indent "}" line_end
|
|
378
|
+
computation_a_computation_property_line = indent computation_a_computation_property line_end
|
|
379
|
+
computation_a_computation_property = "type" ":" ws ( "staticValue" / "item" / "sqlQuerySingleValue" / "sqlQueryMultipleValues" / "expression" / "functionBody" / "preference" )
|
|
380
|
+
/ "staticValue" ":" ws string_like_value
|
|
381
|
+
/ "sqlQuery" ":" ws multiline_string
|
|
382
|
+
/ "computationProcessed" ":" ws ( "newSession" / "replaceExisting" / "addToExisting" / "raiseErrorOnReplace" / "replaceNullValues" )
|
|
383
|
+
/ "language" ":" ws ( "sql" / "plsql" / "javaScript-mle" )
|
|
384
|
+
/ "sqlExpression" ":" ws multiline_string
|
|
385
|
+
/ "plsqlExpression" ":" ws multiline_string
|
|
386
|
+
/ "javaScriptExpression" ":" ws multiline_string
|
|
387
|
+
/ "plsqlFunctionBody" ":" ws multiline_string
|
|
388
|
+
/ "javaScriptFunctionBody" ":" ws multiline_string
|
|
389
|
+
/ "itemName" ":" ws string_like_value
|
|
390
|
+
/ "preference" ":" ws string_like_value
|
|
391
|
+
|
|
276
392
|
|
|
277
393
|
|
|
278
394
|
dynamic_action = indent "dynamicAction" (required_ws component_id)? ws "(" line_end dynamic_action_body_line* indent ")" line_end
|
|
@@ -359,9 +475,12 @@ action_c_execution_property = "sequence" ":" ws number
|
|
|
359
475
|
/ "waitForResult" ":" ws boolean
|
|
360
476
|
|
|
361
477
|
|
|
478
|
+
|
|
479
|
+
|
|
480
|
+
|
|
362
481
|
reference = "@" reference_character*
|
|
363
482
|
component_id = string / identifier / number
|
|
364
|
-
code_block = multiline_string
|
|
483
|
+
code_block = nl? ws multiline_string
|
|
365
484
|
/ string_like_value
|
|
366
485
|
multiline_string = "```" ( any_character / nl )* "```"
|
|
367
486
|
blank_lines = (ws nl)*
|
|
@@ -370,11 +489,14 @@ required_ws = ~r"[ \t]+"
|
|
|
370
489
|
line_end = nl
|
|
371
490
|
nl = "\n" / "\r\n"
|
|
372
491
|
indent = ~r"[ \t]*"
|
|
373
|
-
value =
|
|
492
|
+
value = multiline_string / array / complex / boolean / number / reference / string / identifier
|
|
374
493
|
array = array_of_value
|
|
375
494
|
array_separator = required_ws / line_end indent
|
|
376
495
|
array_of_value = "[" ( ws value ( array_separator value )* ws / line_end ( indent value line_end )? indent )? "]"
|
|
377
496
|
array_of_string_like_value = "[" (line_end indent string_like_value)+ line_end indent "]"
|
|
497
|
+
complex = "{" line_end key_value_line* indent "}"
|
|
498
|
+
key_value_line = indent key_value line_end
|
|
499
|
+
key_value = identifier ":" ws value
|
|
378
500
|
string_like_value = ~r"[^\[\]\n\r]+"
|
|
379
501
|
reference_character = ~r"[A-Za-z0-9_/#-]*"
|
|
380
502
|
string = ~r"\"[^\"]+\""
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
from .base import ApexObject, ApexGroup
|
|
2
|
+
|
|
3
|
+
from .action_c import (
|
|
4
|
+
ActionC,
|
|
5
|
+
ActionCAffectedElements,
|
|
6
|
+
ActionCExecution
|
|
7
|
+
)
|
|
8
|
+
from .button import (
|
|
9
|
+
Button,
|
|
10
|
+
ButtonAppearance,
|
|
11
|
+
ButtonBehavior,
|
|
12
|
+
ButtonLayout
|
|
13
|
+
)
|
|
14
|
+
from .dynamic_action import (
|
|
15
|
+
DynamicAction,
|
|
16
|
+
DynamicActionExecution,
|
|
17
|
+
DynamicActionClientSideCondition,
|
|
18
|
+
DynamicActionWhen
|
|
19
|
+
)
|
|
20
|
+
from .computation_a import (
|
|
21
|
+
ComputationA,
|
|
22
|
+
ComputationAExecution,
|
|
23
|
+
ComputationAComputation
|
|
24
|
+
)
|
|
25
|
+
from .page_item import (
|
|
26
|
+
PageItem,
|
|
27
|
+
PageItemAdvanced,
|
|
28
|
+
PageItemAppearance,
|
|
29
|
+
PageItemLabel,
|
|
30
|
+
PageItemLayout,
|
|
31
|
+
PageItemSecurity,
|
|
32
|
+
PageItemSessionState,
|
|
33
|
+
PageItemSettings,
|
|
34
|
+
PageItemValidation
|
|
35
|
+
)
|
|
36
|
+
from .process import (
|
|
37
|
+
Process,
|
|
38
|
+
ProcessAdvanced,
|
|
39
|
+
ProcessExecution,
|
|
40
|
+
ProcessSource
|
|
41
|
+
)
|
|
42
|
+
from .region import (
|
|
43
|
+
Region,
|
|
44
|
+
RegionAppearance,
|
|
45
|
+
RegionLayout,
|
|
46
|
+
RegionAdvanced,
|
|
47
|
+
RegionComponentAppearance,
|
|
48
|
+
RegionImage,
|
|
49
|
+
RegionSource
|
|
50
|
+
)
|
|
51
|
+
from .page import (
|
|
52
|
+
Page,
|
|
53
|
+
PageHelp,
|
|
54
|
+
PageAppearance,
|
|
55
|
+
PageAdvanced,
|
|
56
|
+
PageCss,
|
|
57
|
+
PageNavigation,
|
|
58
|
+
PageSecurity
|
|
59
|
+
)
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
class ApexGroup():
|
|
2
|
+
def __init__(self, initial_data={}):
|
|
3
|
+
self.properties = {}
|
|
4
|
+
self.properties.update(initial_data)
|
|
5
|
+
|
|
6
|
+
def __setitem__(self, key, value):
|
|
7
|
+
self.properties[key] = value
|
|
8
|
+
|
|
9
|
+
def __getitem__(self, key):
|
|
10
|
+
return self.properties.get(key, None)
|
|
11
|
+
|
|
12
|
+
def get(self, key, default=None):
|
|
13
|
+
return self.properties.get(key, default)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class ApexObject():
|
|
17
|
+
def __init__(self, component_id=None, initial_data={}):
|
|
18
|
+
self.component_id = component_id
|
|
19
|
+
self.properties = {}
|
|
20
|
+
self.properties.update(initial_data)
|
|
21
|
+
self.groups = {}
|
|
22
|
+
self.children = []
|
|
23
|
+
|
|
24
|
+
def __setitem__(self, key, value):
|
|
25
|
+
if isinstance(value, ApexGroup):
|
|
26
|
+
self.groups[key] = value
|
|
27
|
+
elif isinstance(value, ApexObject):
|
|
28
|
+
self.children[key] = value
|
|
29
|
+
else:
|
|
30
|
+
self.properties[key] = value
|
|
31
|
+
|
|
32
|
+
def __getitem__(self, key):
|
|
33
|
+
if key in self.groups:
|
|
34
|
+
return self.groups.get(key, None)
|
|
35
|
+
elif key in self.children:
|
|
36
|
+
return self.children.get(key, None)
|
|
37
|
+
else:
|
|
38
|
+
return self.properties.get(key, None)
|
|
39
|
+
|
|
40
|
+
def add_property(self, key, value):
|
|
41
|
+
self.properties[key] = value
|
|
42
|
+
|
|
43
|
+
def add_group(self, key, value):
|
|
44
|
+
self.groups[key] = value
|
|
45
|
+
|
|
46
|
+
def add_child(self, child):
|
|
47
|
+
self.children.append(child)
|
|
48
|
+
|
|
49
|
+
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
from . import ApexGroup, ApexObject
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class ButtonLayout(ApexGroup):
|
|
5
|
+
def __init__(self, initial_data={}):
|
|
6
|
+
super().__init__(initial_data)
|
|
7
|
+
|
|
8
|
+
@property
|
|
9
|
+
def sequence(self):
|
|
10
|
+
return self.properties.get('sequence', None)
|
|
11
|
+
|
|
12
|
+
@property
|
|
13
|
+
def region(self):
|
|
14
|
+
return self.properties.get('region', None)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class ButtonAppearance(ApexGroup):
|
|
18
|
+
def __init__(self, initial_data={}):
|
|
19
|
+
super().__init__(initial_data)
|
|
20
|
+
|
|
21
|
+
class ButtonBehavior(ApexGroup):
|
|
22
|
+
def __init__(self, initial_data={}):
|
|
23
|
+
super().__init__(initial_data)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class Button(ApexObject):
|
|
28
|
+
def __init__(self, component_id=None, initial_data={}):
|
|
29
|
+
super().__init__(component_id, initial_data)
|
|
30
|
+
|
|
31
|
+
@property
|
|
32
|
+
def button_name(self):
|
|
33
|
+
return self.properties.get('buttonName', None)
|
|
34
|
+
|
|
35
|
+
@property
|
|
36
|
+
def label(self):
|
|
37
|
+
return self.properties.get('label', None)
|
|
38
|
+
|
|
39
|
+
@property
|
|
40
|
+
def layout(self):
|
|
41
|
+
return self.groups.get('layout', ButtonLayout({}))
|
|
42
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from . import ApexGroup, ApexObject
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class ComputationAExecution(ApexGroup):
|
|
5
|
+
pass
|
|
6
|
+
|
|
7
|
+
class ComputationAComputation(ApexGroup):
|
|
8
|
+
pass
|
|
9
|
+
|
|
10
|
+
class ComputationA(ApexObject):
|
|
11
|
+
def __init__(self, component_id=None, initial_data={}):
|
|
12
|
+
super().__init__(component_id, initial_data)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from . import ApexGroup, ApexObject
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class DynamicActionExecution(ApexGroup):
|
|
5
|
+
pass
|
|
6
|
+
|
|
7
|
+
class DynamicActionWhen(ApexGroup):
|
|
8
|
+
pass
|
|
9
|
+
|
|
10
|
+
class DynamicActionClientSideCondition(ApexGroup):
|
|
11
|
+
pass
|
|
12
|
+
|
|
13
|
+
class DynamicAction(ApexObject):
|
|
14
|
+
def __init__(self, component_id=None, initial_data={}):
|
|
15
|
+
super().__init__(component_id, initial_data)
|
|
16
|
+
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
from . import ApexGroup, ApexObject, Region, PageItem, Button, DynamicAction, Process
|
|
2
|
+
|
|
3
|
+
class PageAppearance(ApexGroup):
|
|
4
|
+
pass
|
|
5
|
+
|
|
6
|
+
class PageNavigation(ApexGroup):
|
|
7
|
+
pass
|
|
8
|
+
|
|
9
|
+
class PageCss(ApexGroup):
|
|
10
|
+
pass
|
|
11
|
+
|
|
12
|
+
class PageSecurity(ApexGroup):
|
|
13
|
+
pass
|
|
14
|
+
|
|
15
|
+
class PageAdvanced(ApexGroup):
|
|
16
|
+
pass
|
|
17
|
+
|
|
18
|
+
class PageHelp(ApexGroup):
|
|
19
|
+
@property
|
|
20
|
+
def helpText(self):
|
|
21
|
+
return self['helpText']
|
|
22
|
+
|
|
23
|
+
class Page(ApexObject):
|
|
24
|
+
def __init__(self, component_id=None, initial_data={}):
|
|
25
|
+
super().__init__(component_id, initial_data)
|
|
26
|
+
|
|
27
|
+
def __str__(self):
|
|
28
|
+
return f"Page<#{self.page} name: {self.name}>"
|
|
29
|
+
|
|
30
|
+
@property
|
|
31
|
+
def page(self):
|
|
32
|
+
return self.properties.get('page', self.component_id)
|
|
33
|
+
|
|
34
|
+
@property
|
|
35
|
+
def name(self):
|
|
36
|
+
return self.properties.get('name', "<NONAME>")
|
|
37
|
+
|
|
38
|
+
@property
|
|
39
|
+
def title(self):
|
|
40
|
+
return self.properties['title']
|
|
41
|
+
|
|
42
|
+
@property
|
|
43
|
+
def alias(self):
|
|
44
|
+
return self.properties['alias']
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
@property
|
|
48
|
+
def appearance(self) -> PageAppearance:
|
|
49
|
+
return self.groups.get('appearance', None)
|
|
50
|
+
|
|
51
|
+
@appearance.setter
|
|
52
|
+
def appearance(self, value):
|
|
53
|
+
self.groups['appearance'] = value
|
|
54
|
+
|
|
55
|
+
@property
|
|
56
|
+
def help(self) -> PageHelp:
|
|
57
|
+
return self.groups.get('help', None)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
@property
|
|
61
|
+
def regions(self) -> list[Region]:
|
|
62
|
+
return [x for x in self.children if isinstance(x, Region)]
|
|
63
|
+
|
|
64
|
+
@property
|
|
65
|
+
def page_items(self):
|
|
66
|
+
return [x for x in self.children if isinstance(x, PageItem)]
|
|
67
|
+
|
|
68
|
+
@property
|
|
69
|
+
def buttons(self):
|
|
70
|
+
return [x for x in self.children if isinstance(x, Button)]
|
|
71
|
+
|
|
72
|
+
@property
|
|
73
|
+
def dynamic_actions(self):
|
|
74
|
+
return [x for x in self.children if isinstance(x, DynamicAction)]
|
|
75
|
+
|
|
76
|
+
@property
|
|
77
|
+
def processes(self):
|
|
78
|
+
return [x for x in self.children if isinstance(x, Process)]
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def get_region(self, reference_or_name):
|
|
82
|
+
regions = [x for x in self.regions
|
|
83
|
+
if x.component_id==reference_or_name[1:]
|
|
84
|
+
or x.name==reference_or_name
|
|
85
|
+
]
|
|
86
|
+
if len(regions) == 1:
|
|
87
|
+
return regions[0]
|
|
88
|
+
elif len(regions) == 0:
|
|
89
|
+
return None
|
|
90
|
+
|
|
91
|
+
return regions
|