Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ckanext-odsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Open-Data
ckanext-odsh
Commits
b9bd7feb
Commit
b9bd7feb
authored
6 years ago
by
anonymous
Browse files
Options
Downloads
Patches
Plain Diff
init autocomplete
parent
2f1793db
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
ckanext/odsh/controller.py
+12
-1
12 additions, 1 deletion
ckanext/odsh/controller.py
ckanext/odsh/plugin.py
+10
-0
10 additions, 0 deletions
ckanext/odsh/plugin.py
with
22 additions
and
1 deletion
ckanext/odsh/controller.py
+
12
−
1
View file @
b9bd7feb
...
@@ -19,6 +19,7 @@ from ckanext.dcat.controllers import DCATController
...
@@ -19,6 +19,7 @@ from ckanext.dcat.controllers import DCATController
abort
=
base
.
abort
abort
=
base
.
abort
log
=
logging
.
getLogger
(
__name__
)
log
=
logging
.
getLogger
(
__name__
)
class
OdshRouteController
(
HomeController
):
class
OdshRouteController
(
HomeController
):
def
info_page
(
self
):
def
info_page
(
self
):
h
.
redirect_to
(
'
http://www.schleswig-holstein.de/odpinfo
'
)
h
.
redirect_to
(
'
http://www.schleswig-holstein.de/odpinfo
'
)
...
@@ -27,6 +28,7 @@ class OdshRouteController(HomeController):
...
@@ -27,6 +28,7 @@ class OdshRouteController(HomeController):
def
not_found
(
self
):
def
not_found
(
self
):
abort
(
404
)
abort
(
404
)
class
OdshUserController
(
UserController
):
class
OdshUserController
(
UserController
):
def
me
(
self
,
locale
=
None
):
def
me
(
self
,
locale
=
None
):
if
not
c
.
user
:
if
not
c
.
user
:
...
@@ -63,9 +65,11 @@ class OdshUserController(UserController):
...
@@ -63,9 +65,11 @@ class OdshUserController(UserController):
abort
(
404
)
abort
(
404
)
return
super
(
OdshUserController
,
self
).
activity
(
id
,
offset
)
return
super
(
OdshUserController
,
self
).
activity
(
id
,
offset
)
class
OdshPackageController
(
PackageController
):
class
OdshPackageController
(
PackageController
):
pass
pass
class
OdshApiController
(
ApiController
):
class
OdshApiController
(
ApiController
):
def
action
(
self
,
logic_function
,
ver
=
None
):
def
action
(
self
,
logic_function
,
ver
=
None
):
try
:
try
:
...
@@ -91,11 +95,13 @@ class OdshApiController(ApiController):
...
@@ -91,11 +95,13 @@ class OdshApiController(ApiController):
return
ApiController
.
action
(
self
,
logic_function
,
ver
)
return
ApiController
.
action
(
self
,
logic_function
,
ver
)
class
OdshDCATController
(
DCATController
):
class
OdshDCATController
(
DCATController
):
def
read_catalog
(
self
,
_format
):
def
read_catalog
(
self
,
_format
):
matomo
.
create_matomo_request
()
matomo
.
create_matomo_request
()
return
DCATController
.
read_catalog
(
self
,
_format
)
return
DCATController
.
read_catalog
(
self
,
_format
)
class
OdshFeedController
(
FeedController
):
class
OdshFeedController
(
FeedController
):
def
custom
(
self
):
def
custom
(
self
):
matomo
.
create_matomo_request
()
matomo
.
create_matomo_request
()
...
@@ -153,3 +159,8 @@ class OdshFeedController(FeedController):
...
@@ -153,3 +159,8 @@ class OdshFeedController(FeedController):
feed_guid
=
_create_atom_id
(
atom_url
),
feed_guid
=
_create_atom_id
(
atom_url
),
feed_url
=
feed_url
,
feed_url
=
feed_url
,
navigation_urls
=
navigation_urls
)
navigation_urls
=
navigation_urls
)
class
OdshAutocompleteController
(
ApiController
):
def
autocomplete
(
self
):
base
.
response
.
body_file
.
write
(
"
Hello World
"
)
This diff is collapsed.
Click to expand it.
ckanext/odsh/plugin.py
+
10
−
0
View file @
b9bd7feb
...
@@ -76,12 +76,22 @@ def remove_route(map,routename):
...
@@ -76,12 +76,22 @@ def remove_route(map,routename):
map
.
_routenames
.
pop
(
route
.
name
)
map
.
_routenames
.
pop
(
route
.
name
)
break
break
class
OdshIcapPlugin
(
plugins
.
SingletonPlugin
):
class
OdshIcapPlugin
(
plugins
.
SingletonPlugin
):
plugins
.
implements
(
plugins
.
IUploader
,
inherit
=
True
)
plugins
.
implements
(
plugins
.
IUploader
,
inherit
=
True
)
def
get_resource_uploader
(
self
,
data_dict
):
def
get_resource_uploader
(
self
,
data_dict
):
return
ODSHResourceUpload
(
data_dict
)
return
ODSHResourceUpload
(
data_dict
)
class
OdshAutocompletePlugin
(
plugins
.
SingletonPlugin
):
plugins
.
implements
(
plugins
.
IRoutes
,
inherit
=
True
)
def
before_map
(
self
,
map
):
controller
=
'
ckanext.odsh.controller:OdshAutocompleteController
'
map
.
connect
(
'
/autocomplete
'
,
controller
=
controller
,
action
=
'
autocomplete
'
)
class
OdshPlugin
(
plugins
.
SingletonPlugin
,
DefaultTranslation
,
DefaultDatasetForm
):
class
OdshPlugin
(
plugins
.
SingletonPlugin
,
DefaultTranslation
,
DefaultDatasetForm
):
plugins
.
implements
(
plugins
.
IConfigurer
)
plugins
.
implements
(
plugins
.
IConfigurer
)
plugins
.
implements
(
plugins
.
ITemplateHelpers
)
plugins
.
implements
(
plugins
.
ITemplateHelpers
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment