-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow custom urlpath to be specified #205
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,7 @@ def config_from_file(self, file_name): | |
|
||
self.network = config.network.lower() | ||
self.vocabulary = config.vocabulary.lower() | ||
self.urlpath = config.urlpath.lower() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could the |
||
self.menu_group_name = config.menu_group_name | ||
self.service_wsdl = config.service_wsdl | ||
self.timezone = config.timezone | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,6 +50,7 @@ def config_from_file(self, file_name): | |
|
||
self.network = config.network.lower() | ||
self.vocabulary = config.vocabulary.lower() | ||
self.urlpath = config.urlpath.lower() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could the |
||
self.menu_group_name = config.menu_group_name | ||
self.service_wsdl = config.service_wsdl | ||
self.timezone = config.timezone | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
[WOF] | ||
Network: ODM2Timeseries | ||
Vocabulary: ODM2Timeseries | ||
URLPATH: wofpysqlite | ||
Menu_Group_Name: ODM2 | ||
# Change this to your configuration; assumes port 8080 | ||
# http://serverip:port/networkcode/soap/cuahsi_1_0/.wsdl | ||
Service_WSDL: http://127.0.0.1:8080/odm2timeseries/soap/cuahsi_1_0/.wsdl | ||
# http://serverip:port/urlpath/soap/cuahsi_1_0/.wsdl | ||
Service_WSDL: http://127.0.0.1:8080/wofpysqlite/soap/cuahsi_1_0/.wsdl | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See my other comment on |
||
Timezone: 00:00 | ||
TimezoneAbbreviation: GMT | ||
|
||
|
@@ -16,8 +17,8 @@ EndDate: 2007-09-01T02:30:00 | |
|
||
[WOF_1_1] | ||
# Change this to your configuration; assumes port 8080 | ||
# http://serverip:port/networkcode/soap/cuahsi_1_1/.wsdl | ||
Service_WSDL: http://127.0.0.1:8080/odm2timeseries/soap/cuahsi_1_1/.wsdl | ||
# http://serverip:port/urlpath/soap/cuahsi_1_1/.wsdl | ||
Service_WSDL: http://127.0.0.1:8080/wofpysqlite/soap/cuahsi_1_1/.wsdl | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See my other comment on |
||
|
||
[Default_Params_1_1] | ||
West: -114 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,8 +31,8 @@ def create_app(wof_inst, wof_inst_1_1, soap_service_url=None, soap_service_1_1_u | |
# | ||
# app.config.from_object(config.Config) | ||
app = create_simple_app() | ||
path = wof_inst.network.lower() | ||
servicesPath = '/'+wof_inst.network.lower() | ||
path = wof_inst.urlpath.lower() | ||
servicesPath = '/'+wof_inst.urlpath.lower() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See my other comment about url case sensitivity and forcing lowercase url. |
||
add_flask_routes(app,path,servicesPath,wof_inst, | ||
wof_inst_1_1,soap_service_url=soap_service_url, soap_service_1_1_url=soap_service_1_1_url ) | ||
return app | ||
|
@@ -56,22 +56,22 @@ def index(): | |
rest2=path+'/rest_2/', | ||
soap10=path+'/soap/cuahsi_1_0/', | ||
soap11=path+'/soap/cuahsi_1_1/', | ||
p=wof_inst.network, | ||
p=wof_inst.urlpath, | ||
v=version) | ||
|
||
app.add_url_rule(servicesPath+'/', wof_inst.network+'index', index) | ||
app.add_url_rule(servicesPath+'/', wof_inst.urlpath+'index', index) | ||
|
||
def index_2_0(): | ||
return render_template('index_2.html', | ||
path= path + '/rest/2/', | ||
p=wof_inst.network, | ||
p=wof_inst.urlpath, | ||
s=wof_inst.default_site, | ||
v=wof_inst.default_variable, | ||
sd=wof_inst.default_start_date, | ||
ed=wof_inst.default_end_date, | ||
u=wof_inst.default_unitid, | ||
sm=wof_inst.default_samplemedium) | ||
app.add_url_rule(servicesPath+'/rest_2/', wof_inst.network+'index_2_0', index_2_0) | ||
app.add_url_rule(servicesPath+'/rest_2/', wof_inst.urlpath+'index_2_0', index_2_0) | ||
|
||
if wof_inst is not None: | ||
if not 'SOAP_SERVICE_URL' in app.config and soap_service_url: | ||
|
@@ -81,14 +81,14 @@ def index_2_0(): | |
def index_1_0(): | ||
return render_template('index_1_0.html', | ||
path= path + '/rest/1_0/', | ||
p=wof_inst.network, | ||
p=wof_inst.urlpath, | ||
s=wof_inst.default_site, | ||
v=wof_inst.default_variable, | ||
sd=wof_inst.default_start_date, | ||
ed=wof_inst.default_end_date, | ||
u=wof_inst.default_unitid, | ||
sm=wof_inst.default_samplemedium) | ||
app.add_url_rule(servicesPath+'/rest_1_0/',wof_inst.network+ 'index_1_0', index_1_0) | ||
app.add_url_rule(servicesPath+'/rest_1_0/',wof_inst.urlpath+ 'index_1_0', index_1_0) | ||
|
||
|
||
|
||
|
@@ -130,7 +130,7 @@ def index_1_1(): | |
so=wof_inst_1_1.default_south, | ||
n=wof_inst_1_1.default_north, | ||
e=wof_inst_1_1.default_east) | ||
app.add_url_rule(servicesPath+'/rest_1_1/', wof_inst.network+'index_1_1', index_1_1) | ||
app.add_url_rule(servicesPath+'/rest_1_1/', wof_inst.urlpath+'index_1_1', index_1_1) | ||
|
||
#@app.route('/soap/wateroneflow_1_1.wsdl') | ||
# def get_wsdl_1_1(): | ||
|
@@ -210,9 +210,8 @@ def create_wof_flask_multiple(wofConfig=[], templates=None): | |
wof_obj_1_1 = wof_1_1.WOF_1_1(wConf.dao,wConf.config,templates) | ||
|
||
spyneapps.update(getSpyneApplications(wof_obj_1_0,wof_obj_1_1,templates) ) | ||
path = wof_obj_1_0.network.lower() | ||
servicesPath = '/'+wof_obj_1_0.network.lower() | ||
|
||
path = wof_obj_1_0.urlpath.lower() | ||
servicesPath = '/'+wof_obj_1_0.urlpath.lower() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See my other comment about url case sensitivity and forcing lowercase url. |
||
wof.flask.add_flask_routes(app,path, servicesPath, | ||
wof_obj_1_0, | ||
wof_obj_1_1, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know you're not changing
Service_WSDL
here, but it seems like this would not be needed anymore, right? It can be constructed automatically fromURLPATH
, like this (assumes WOF 1.1):URLPATH/soap/cuahsi_1_1/.wsdl
If that's true, it should be removed from here and handled automatically. But this could be done in a follow up PR if you'd like, so that this PR is not delayed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@emiliom Yea, I think that's possible to do, Service_WSDL can be auto-generated. I can work on that next. Thanks.