Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
olapy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
olapy
Commits
969e4b28
Commit
969e4b28
authored
Apr 28, 2017
by
mouadh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
format
parent
bb35b4f8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
19 deletions
+24
-19
olapy/core/services/models.py
olapy/core/services/models.py
+5
-2
olapy/core/services/xmla.py
olapy/core/services/xmla.py
+19
-16
olapy/core/services/xmla_discover_tools.py
olapy/core/services/xmla_discover_tools.py
+0
-1
No files found.
olapy/core/services/models.py
View file @
969e4b28
...
...
@@ -3,8 +3,8 @@ from __future__ import absolute_import, division, print_function
from
spyne
import
ComplexModel
,
Integer
,
Unicode
,
XmlAttribute
from
spyne.model.fault
import
Fault
class
Tuple
(
object
):
class
Tuple
(
object
):
def
__init__
(
self
,
Hierarchy
,
UName
,
Caption
,
LName
,
LNum
,
DisplayInfo
,
PARENT_UNIQUE_NAME
,
HIERARCHY_UNIQUE_NAME
,
Value
):
self
.
Hierarchy
=
Hierarchy
...
...
@@ -92,7 +92,9 @@ class Propertielist(ComplexModel):
class
Command
(
ComplexModel
):
_type_info
=
{
'Statement'
:
Unicode
,}
_type_info
=
{
'Statement'
:
Unicode
,
}
class
ExecuteRequest
(
ComplexModel
):
...
...
@@ -105,6 +107,7 @@ class DiscoverRequest(ComplexModel):
Restrictions
=
Restrictionlist
Properties
=
Propertielist
# class AuthenticationError(Fault):
# __namespace__ = 'spyne.examples.authentication'
# faultcode='Client.AuthenticationError',
...
...
olapy/core/services/xmla.py
View file @
969e4b28
...
...
@@ -15,6 +15,7 @@ from spyne.server.wsgi import WsgiApplication
from
..mdx.tools.config_file_parser
import
ConfigParser
from
..services.models
import
DiscoverRequest
,
ExecuteRequest
,
Session
\
# , AuthenticationError
from
.xmla_discover_tools
import
XmlaDiscoverTools
from
.xmla_execute_tools
import
XmlaExecuteTools
from
.xmla_execute_xsds
import
execute_xsd
...
...
@@ -38,15 +39,14 @@ class XmlaProviderService(ServiceBase):
discover_tools
=
XmlaDiscoverTools
()
SessionId
=
discover_tools
.
SessionId
@
rpc
(
DiscoverRequest
,
_returns
=
AnyXml
,
_body_style
=
"bare"
,
_out_header
=
Session
,
_throws
=
InvalidCredentialsError
# _throws=AuthenticationError
)
@
rpc
(
DiscoverRequest
,
_returns
=
AnyXml
,
_body_style
=
"bare"
,
_out_header
=
Session
,
_throws
=
InvalidCredentialsError
# _throws=AuthenticationError
)
def
Discover
(
ctx
,
request
):
"""
the first principle function of xmla protocol
...
...
@@ -69,8 +69,10 @@ class XmlaProviderService(ServiceBase):
# TODO call labster login or create login with token (according to labster db)
if
ctx
.
transport
.
req_env
[
'QUERY_STRING'
]
!=
'mouadh'
:
raise
InvalidCredentialsError
(
fault_string
=
'You do not have permission to access this resource'
,
fault_object
=
None
)
raise
InvalidCredentialsError
(
fault_string
=
'You do not have permission to access this resource'
,
fault_object
=
None
)
# raise AuthenticationError()
...
...
@@ -132,10 +134,11 @@ class XmlaProviderService(ServiceBase):
# Execute function must take 2 argument ( JUST 2 ! ) Command and Properties
# we encapsulate them in ExecuteRequest object
@
rpc
(
ExecuteRequest
,
_returns
=
AnyXml
,
_body_style
=
"bare"
,
_out_header
=
Session
)
@
rpc
(
ExecuteRequest
,
_returns
=
AnyXml
,
_body_style
=
"bare"
,
_out_header
=
Session
)
def
Execute
(
ctx
,
request
):
"""
the second principle function of xmla protocol
...
...
@@ -202,7 +205,7 @@ class XmlaProviderService(ServiceBase):
xmla_tools
.
generate_slicer_axis
(
df
),
xmla_tools
.
generate_cell_data
(
df
),
datetime
.
now
().
strftime
(
'%Y-%m-%dT%H:%M:%S'
)).
replace
(
'&'
,
'&'
))
'&'
,
'&'
))
# Problem:
# An XML parser returns the error “xmlParseEntityRef: noname”
...
...
olapy/core/services/xmla_discover_tools.py
View file @
969e4b28
...
...
@@ -34,7 +34,6 @@ class XmlaDiscoverTools():
]]
self
.
SessionId
=
uuid
.
uuid1
()
def
change_catalogue
(
self
,
new_catalogue
):
"""
if you change the catalogue(cube) in any request, we have to instantiate the MdxEngine with the new catalogue
...
...
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