Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
rjs_json_form
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
rjs_json_form
Commits
4bd32c11
Commit
4bd32c11
authored
Jan 03, 2019
by
Boris Kocherov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add demo/xmla_connection
parent
a00855c7
Changes
15
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
416 additions
and
0 deletions
+416
-0
demo/index.html
demo/index.html
+2
-0
demo/xmla_connection/Xmla-compiled.js
demo/xmla_connection/Xmla-compiled.js
+92
-0
demo/xmla_connection/font-awesome
demo/xmla_connection/font-awesome
+1
-0
demo/xmla_connection/for_test.json
demo/xmla_connection/for_test.json
+8
-0
demo/xmla_connection/gadget_erp5_global.js
demo/xmla_connection/gadget_erp5_global.js
+1
-0
demo/xmla_connection/gadget_html5_select.html
demo/xmla_connection/gadget_html5_select.html
+1
-0
demo/xmla_connection/gadget_html5_select.js
demo/xmla_connection/gadget_html5_select.js
+1
-0
demo/xmla_connection/index.html
demo/xmla_connection/index.html
+33
-0
demo/xmla_connection/index.js
demo/xmla_connection/index.js
+235
-0
demo/xmla_connection/jsonform
demo/xmla_connection/jsonform
+1
-0
demo/xmla_connection/jsonform.gadget.appcache
demo/xmla_connection/jsonform.gadget.appcache
+1
-0
demo/xmla_connection/jsonform.gadget.html
demo/xmla_connection/jsonform.gadget.html
+1
-0
demo/xmla_connection/jsonform.gadget.js
demo/xmla_connection/jsonform.gadget.js
+1
-0
demo/xmla_connection/remote_settings.json
demo/xmla_connection/remote_settings.json
+8
-0
demo/xmla_connection/xmla_connection.json
demo/xmla_connection/xmla_connection.json
+30
-0
No files found.
demo/index.html
View file @
4bd32c11
...
@@ -12,6 +12,8 @@
...
@@ -12,6 +12,8 @@
<body>
<body>
<div
data-role=
"page"
>
<div
data-role=
"page"
>
<div
role=
"main"
class=
"ui-content gadget-content"
>
<div
role=
"main"
class=
"ui-content gadget-content"
>
<p><a
href=
"with_monaco"
>
form generator with monaco editor
</a></p>
<p><a
href=
"xmla_connection"
>
Dynamic for generation "Xmla Connections settings"
</a></p>
<p><a
href=
"gadget_demo_json_schema_form.html"
>
set of demo forms
</a></p>
<p><a
href=
"gadget_demo_json_schema_form.html"
>
set of demo forms
</a></p>
<p><a
href=
"gadget_complex_demo_form.html"
>
union interacting forms
</a></p>
<p><a
href=
"gadget_complex_demo_form.html"
>
union interacting forms
</a></p>
</div>
</div>
...
...
demo/xmla_connection/Xmla-compiled.js
0 → 100644
View file @
4bd32c11
This diff is collapsed.
Click to expand it.
demo/xmla_connection/font-awesome
0 → 120000
View file @
4bd32c11
../../font-awesome
\ No newline at end of file
demo/xmla_connection/for_test.json
0 → 100644
View file @
4bd32c11
{
"$schema"
:
"http://json-schema.org/draft-07/schema"
,
"title"
:
"test "
,
"type"
:
"array"
,
"items"
:
{
"$ref"
:
"remote_settings.json"
}
}
\ No newline at end of file
demo/xmla_connection/gadget_erp5_global.js
0 → 120000
View file @
4bd32c11
..
/
..
/
gadget_erp5_global
.
js
\ No newline at end of file
demo/xmla_connection/gadget_html5_select.html
0 → 120000
View file @
4bd32c11
../../gadget_html5_select.html
\ No newline at end of file
demo/xmla_connection/gadget_html5_select.js
0 → 120000
View file @
4bd32c11
..
/
..
/
gadget_html5_select
.
js
\ No newline at end of file
demo/xmla_connection/index.html
0 → 100644
View file @
4bd32c11
<!doctype html>
<html>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
Demo UI OLAP Query editor based on JSON Schema form generator
</title>
<link
rel=
"stylesheet"
href=
"gadget_erp5_nojqm.css"
>
<script
src=
"rsvp.js"
></script>
<script
src=
"renderjs.js"
></script>
<script
src=
"jio.js"
></script>
<script
src=
"Xmla-compiled.js"
></script>
<script
src=
"index.js"
></script>
</head>
<body>
<div
data-role=
"page"
>
<div
role=
"main"
class=
"ui-content gadget-content"
>
<section
class=
"ui-content-header-plain"
>
<h3
class=
"ui-content-title ui-body-c"
>
Xmla connection settings form
</h3>
</section>
<div
data-gadget-url=
"jsonform.gadget.html"
data-gadget-scope=
"xmla_settings"
data-gadget-sandbox=
"public"
></div>
<br>
</div>
</div>
</body>
</html>
\ No newline at end of file
demo/xmla_connection/index.js
0 → 100644
View file @
4bd32c11
/*jslint nomen: true, maxlen: 200, indent: 2*/
/*global rJS, console, window, document, RSVP, Xmla*/
(
function
(
window
,
rJS
)
{
"
use strict
"
;
function
xmla_request
(
func
,
prop
)
{
var
xmla
=
new
Xmla
({
async
:
true
});
prop
=
JSON
.
parse
(
JSON
.
stringify
(
prop
));
// return function () {
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
new
RSVP
.
Promise
(
function
(
resolve
,
reject
)
{
prop
.
success
=
function
(
xmla
,
options
,
response
)
{
resolve
(
response
);
};
prop
.
error
=
function
(
xmla
,
options
,
response
)
{
reject
(
response
);
};
xmla
[
func
](
prop
);
});
});
}
function
xmla_request_retry
(
func
,
settings
)
{
var
queue
,
urls
=
settings
.
urls
,
i
;
function
make_request
(
url
)
{
return
function
(
error
)
{
settings
.
prop
.
url
=
url
;
return
xmla_request
(
func
,
settings
.
prop
)
.
push
(
undefined
,
function
(
response
)
{
// fix mondrian Internal and Sql errors
if
(
response
)
{
switch
(
response
[
"
code
"
])
{
case
"
SOAP-ENV:Server.00HSBE02
"
:
case
"
SOAP-ENV:00UE001.Internal Error
"
:
// rarely server error, so try again
return
xmla_request
(
func
,
settings
.
prop
);
}
}
throw
response
;
});
};
}
queue
=
make_request
(
urls
[
0
])();
for
(
i
=
1
;
i
<
settings
.
urls
.
length
;
i
+=
1
)
{
queue
.
push
(
undefined
,
make_request
(
urls
[
i
]));
}
return
queue
;
}
function
render_form
(
gadget
,
scope
,
schema
,
value
)
{
return
gadget
.
getDeclaredGadget
(
scope
)
.
push
(
function
(
g
)
{
return
g
.
render
({
schema_url
:
schema
,
value
:
value
});
});
}
function
discoverDataSources
(
schema
,
opt
)
{
return
xmla_request_retry
(
"
discoverDataSources
"
,
opt
)
.
push
(
undefined
,
function
(
error
)
{
console
.
log
(
error
);
})
.
push
(
function
(
response
)
{
if
(
response
&&
response
.
numRows
>
0
)
{
schema
.
properties
.
DataSourceInfo
=
{
oneOf
:
[]
};
var
arr
=
schema
.
properties
.
DataSourceInfo
.
oneOf
;
while
(
response
.
hasMoreRows
())
{
arr
.
push
({
const
:
response
[
"
getDataSourceInfo
"
]()
||
undefined
,
title
:
response
[
"
getDataSourceName
"
]()
||
undefined
,
description
:
response
[
"
getDataSourceDescription
"
]()
||
undefined
});
response
.
nextRow
();
}
}
});
}
function
discoverDBCatalogs
(
schema
,
opt
)
{
return
xmla_request_retry
(
"
discoverDBCatalogs
"
,
opt
)
.
push
(
undefined
,
function
(
error
)
{
console
.
log
(
error
);
})
.
push
(
function
(
response
)
{
if
(
response
&&
response
.
numRows
>
0
)
{
schema
.
properties
.
Catalog
=
{
oneOf
:
[]
};
var
arr
=
schema
.
properties
.
Catalog
.
oneOf
;
while
(
response
.
hasMoreRows
())
{
arr
.
push
({
const
:
response
[
"
getCatalogName
"
]()
||
undefined
,
title
:
response
[
"
getCatalogName
"
]()
||
undefined
});
response
.
nextRow
();
}
}
});
}
function
discoverMDCubes
(
schema
,
opt
)
{
return
xmla_request_retry
(
"
discoverMDCubes
"
,
opt
)
.
push
(
undefined
,
function
(
error
)
{
console
.
log
(
error
);
})
.
push
(
function
(
response
)
{
if
(
response
&&
response
.
numRows
>
0
)
{
schema
.
properties
.
Cube
=
{
oneOf
:
[]
};
var
arr
=
schema
.
properties
.
Cube
.
oneOf
;
while
(
response
.
hasMoreRows
())
{
arr
.
push
({
const
:
response
[
"
getCubeName
"
]()
||
undefined
,
title
:
response
[
"
getCubeName
"
]()
||
undefined
// title: response["getCatalogName"]() || undefined
});
response
.
nextRow
();
}
}
});
}
function
init_schema
()
{
return
{
"
type
"
:
"
object
"
,
"
additionalProperties
"
:
false
,
"
required
"
:
[
"
Cube
"
],
"
properties
"
:
{
"
DataSourceInfo
"
:
{
"
type
"
:
"
string
"
},
"
Catalog
"
:
{
"
type
"
:
"
string
"
},
"
Cube
"
:
{
"
type
"
:
"
string
"
}
}
};
}
rJS
(
window
)
.
ready
(
function
(
g
)
{
g
.
props
=
{};
g
.
props
.
xmla_connections
=
{};
return
render_form
(
g
,
"
xmla_settings
"
,
// new URL("for_test.json", window.location).toString(), {});
new
URL
(
"
remote_settings.json
"
,
window
.
location
).
toString
(),
{});
})
.
allowPublicAcquisition
(
"
notifyValid
"
,
function
(
arr
,
scope
)
{
})
.
allowPublicAcquisition
(
"
notifyInvalid
"
,
function
(
arr
,
scope
)
{
})
.
allowPublicAcquisition
(
"
notifyChange
"
,
function
(
arr
,
scope
)
{
var
g
=
this
,
p
=
arr
[
0
],
schema
=
init_schema
(),
gadget_settings
,
path
;
function
f
(
p
)
{
var
settings
;
return
g
.
getDeclaredGadget
(
"
xmla_settings
"
)
.
push
(
function
(
gadget
)
{
gadget_settings
=
gadget
;
return
gadget
.
getContent
(
p
);
})
.
push
(
function
(
c
)
{
settings
=
c
;
if
(
!
c
.
hasOwnProperty
(
'
properties
'
))
{
c
.
properties
=
{};
}
var
opt
=
{
urls
:
c
.
urls
,
prop
:
{
properties
:
{
DataSourceInfo
:
c
.
properties
.
DataSourceInfo
,
Catalog
:
c
.
properties
.
Catalog
}
},
cube
:
c
.
properties
.
Cube
};
return
RSVP
.
all
([
discoverDataSources
(
schema
,
opt
),
discoverDBCatalogs
(
schema
,
opt
),
discoverMDCubes
(
schema
,
opt
)
]);
})
.
push
(
function
()
{
g
.
props
.
xmla_connections
[
p
]
=
schema
;
return
gadget_settings
.
getGadgetByPath
(
p
);
})
.
push
(
function
(
ret
)
{
return
ret
.
gadget
.
rerender
(
settings
);
});
}
for
(
path
in
g
.
props
.
xmla_connections
)
{
if
(
g
.
props
.
xmla_connections
.
hasOwnProperty
(
path
)
&&
p
.
startsWith
(
path
))
{
return
f
(
path
);
}
}
})
.
allowPublicAcquisition
(
"
resolveExternalReference
"
,
function
(
arr
)
{
var
g
=
this
,
url
=
arr
[
0
],
schema_path
=
arr
[
1
],
path
=
arr
[
2
],
connection_path
;
if
(
"
urn:jio:properties_from_xmla.connection.json
"
===
url
)
{
return
g
.
getDeclaredGadget
(
"
xmla_settings
"
)
.
push
(
function
(
gadget
)
{
return
gadget
.
getContent
();
})
.
push
(
function
(
value
)
{
connection_path
=
path
.
split
(
'
/
'
).
slice
(
0
,
-
1
).
join
(
'
/
'
);
if
(
!
g
.
props
.
xmla_connections
.
hasOwnProperty
(
connection_path
))
{
g
.
props
.
xmla_connections
[
connection_path
]
=
init_schema
();
}
return
g
.
props
.
xmla_connections
[
connection_path
];
});
}
throw
Error
(
"
urn: '
"
+
url
+
"
' not supported
"
);
})
.
onStateChange
(
function
(
modification_dict
)
{
});
}(
window
,
rJS
));
\ No newline at end of file
demo/xmla_connection/jsonform
0 → 120000
View file @
4bd32c11
../../jsonform
\ No newline at end of file
demo/xmla_connection/jsonform.gadget.appcache
0 → 120000
View file @
4bd32c11
../../jsonform.gadget.appcache
\ No newline at end of file
demo/xmla_connection/jsonform.gadget.html
0 → 120000
View file @
4bd32c11
../../jsonform.gadget.html
\ No newline at end of file
demo/xmla_connection/jsonform.gadget.js
0 → 120000
View file @
4bd32c11
..
/
..
/
jsonform
.
gadget
.
js
\ No newline at end of file
demo/xmla_connection/remote_settings.json
0 → 100644
View file @
4bd32c11
{
"$schema"
:
"http://json-schema.org/draft-07/schema"
,
"title"
:
"remote XMLA connections"
,
"type"
:
"object"
,
"additionalProperties"
:
{
"$ref"
:
"xmla_connection.json"
}
}
\ No newline at end of file
demo/xmla_connection/xmla_connection.json
0 → 100644
View file @
4bd32c11
{
"$schema"
:
"http://json-schema.org/draft-07/schema"
,
"title"
:
"XMLA connection"
,
"type"
:
"object"
,
"properties"
:
{
"urls"
:
{
"uniqueItems"
:
true
,
"items"
:
{
"format"
:
"uri"
,
"minLength"
:
1
,
"type"
:
"string"
},
"minItems"
:
1
,
"type"
:
"array"
},
"properties"
:
{
"$ref"
:
"urn:jio:properties_from_xmla.connection.json"
},
"username"
:
{
"type"
:
"string"
},
"password"
:
{
"type"
:
"string"
}
},
"required"
:
[
"urls"
],
"additionalProperties"
:
false
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment