-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
client URL is now read from database, no more setting in LoadAppProje…
…ctData client can have custom logo, you have to copy image to /gisapp/admin/resources/images/ as [client_name].png database upgrade to v4 (run 003_update.sql for v3)
- Loading branch information
Showing
7 changed files
with
135 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--gisapp update script | ||
|
||
INSERT INTO settings (version, date) VALUES (4, now()); | ||
|
||
-- Function: get_project_data(text) | ||
|
||
DROP FUNCTION IF EXISTS get_project_data(text); | ||
CREATE OR REPLACE FUNCTION get_project_data(IN project text) | ||
RETURNS TABLE(client_name text, client_display_name text, client_url text, theme_name text, overview_layer json, base_layers json, extra_layers json, tables_onstart text[]) AS | ||
$BODY$ | ||
declare base json; | ||
declare overview json; | ||
declare extra json; | ||
begin | ||
base:=null; | ||
overview:=null; | ||
|
||
SELECT json_agg(('new OpenLayers.Layer.'|| layers.type) || '(' || layers.definition || ');') | ||
FROM projects,layers where layers.id = ANY(projects.base_layers_ids) AND base_layer=true and projects.name=$1 INTO base; | ||
|
||
SELECT json_agg(('new OpenLayers.Layer.'|| layers.type) || '(' || layers.definition || ');') | ||
FROM projects,layers where layers.id = ANY(projects.extra_layers_ids) AND base_layer=false and projects.name=$1 INTO extra; | ||
|
||
SELECT json_agg(('new OpenLayers.Layer.'|| layers.type) || '(' || layers.definition || ');') | ||
FROM projects,layers where layers.id = projects.overview_layer_id and projects.name=$1 INTO overview; | ||
|
||
|
||
RETURN QUERY SELECT clients.name, clients.display_name, clients.url, themes.name, overview,base,extra, projects.tables_onstart FROM projects,clients,themes WHERE clients.theme_id=themes.id AND projects.client_id = clients.id AND projects.name=$1; | ||
end; | ||
$BODY$ | ||
LANGUAGE plpgsql VOLATILE | ||
COST 1 | ||
ROWS 1000; | ||
ALTER FUNCTION get_project_data(text) | ||
OWNER TO pguser; | ||
COMMENT ON FUNCTION get_project_data(text) IS 'IN project --> client, theme, baselayers, overview layer, extra layers and tables_onstart for project_name.'; |
Oops, something went wrong.