|
a/ForgeLink/forgelink/link_main.py |
|
b/ForgeLink/forgelink/link_main.py |
|
... |
|
... |
63 |
|
63 |
|
64 |
def __init__(self, project, config):
|
64 |
def __init__(self, project, config):
|
65 |
Application.__init__(self, project, config)
|
65 |
Application.__init__(self, project, config)
|
66 |
self.root = RootController()
|
66 |
self.root = RootController()
|
67 |
self.admin = LinkAdminController(self)
|
67 |
self.admin = LinkAdminController(self)
|
68 |
self.api_root = RootRestController()
|
68 |
self.api_root = RootRestController(self)
|
69 |
|
69 |
|
70 |
@property
|
70 |
@property
|
71 |
@h.exceptionless([], log)
|
71 |
@h.exceptionless([], log)
|
72 |
def sitemap(self):
|
72 |
def sitemap(self):
|
73 |
menu_id = self.config.options.mount_label
|
73 |
menu_id = self.config.options.mount_label
|
|
... |
|
... |
94 |
def uninstall(self, project):
|
94 |
def uninstall(self, project):
|
95 |
"Remove all the tool's artifacts from the database"
|
95 |
"Remove all the tool's artifacts from the database"
|
96 |
super(ForgeLinkApp, self).uninstall(project)
|
96 |
super(ForgeLinkApp, self).uninstall(project)
|
97 |
|
97 |
|
98 |
def bulk_export(self, f):
|
98 |
def bulk_export(self, f):
|
99 |
json.dump(RootRestController().link_json(), f, cls=jsonify.GenericJSON, indent=2)
|
99 |
json.dump(RootRestController(self).link_json(), f, cls=jsonify.GenericJSON, indent=2)
|
100 |
|
100 |
|
101 |
|
101 |
|
102 |
class RootController(BaseController):
|
102 |
class RootController(BaseController):
|
103 |
|
103 |
|
104 |
def _check_security(self):
|
104 |
def _check_security(self):
|
|
... |
|
... |
128 |
redirect(c.project.url()+'admin/tools')
|
128 |
redirect(c.project.url()+'admin/tools')
|
129 |
|
129 |
|
130 |
|
130 |
|
131 |
class RootRestController(BaseController):
|
131 |
class RootRestController(BaseController):
|
132 |
|
132 |
|
|
|
133 |
def __init__(self, app):
|
|
|
134 |
self.app = app
|
|
|
135 |
|
133 |
def _check_security(self):
|
136 |
def _check_security(self):
|
134 |
require_access(c.app, 'read')
|
137 |
require_access(self.app, 'read')
|
135 |
|
138 |
|
136 |
def link_json(self):
|
139 |
def link_json(self):
|
137 |
return dict(url=c.app.config.options.get('url'))
|
140 |
return dict(url=self.app.config.options.get('url'))
|
138 |
|
141 |
|
139 |
@expose('json:')
|
142 |
@expose('json:')
|
140 |
def index(self, url='', **kw):
|
143 |
def index(self, url='', **kw):
|
141 |
if (request.method == 'POST') and (url != ''):
|
144 |
if (request.method == 'POST') and (url != ''):
|
142 |
require_access(c.app, 'configure')
|
145 |
require_access(self.app, 'configure')
|
143 |
c.app.config.options.url = url
|
146 |
self.app.config.options.url = url
|
144 |
return self.link_json()
|
147 |
return self.link_json()
|