Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Genesys Backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
45
Issues
45
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Genesys PGR
Genesys Backend
Commits
9e41a3f2
Commit
9e41a3f2
authored
Feb 28, 2014
by
Matija Obreza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tileserver CDN
parent
1ed8d5e3
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
145 additions
and
9 deletions
+145
-9
src/main/java/org/genesys2/server/config/ApplicationProps.java
...ain/java/org/genesys2/server/config/ApplicationProps.java
+29
-3
src/main/resources/spring/spring.properties
src/main/resources/spring/spring.properties
+9
-2
src/main/webapp/WEB-INF/jsp/accession/map.jsp
src/main/webapp/WEB-INF/jsp/accession/map.jsp
+2
-3
src/test/java/org/genesys2/server/test/ApplicationPropsTest.java
...t/java/org/genesys2/server/test/ApplicationPropsTest.java
+58
-0
src/test/java/org/genesys2/server/test/TaxonomyEnsureTest.java
...est/java/org/genesys2/server/test/TaxonomyEnsureTest.java
+16
-0
src/test/resources/application.properties
src/test/resources/application.properties
+26
-0
src/test/resources/spring/spring.properties
src/test/resources/spring/spring.properties
+5
-1
No files found.
src/main/java/org/genesys2/server/config/ApplicationProps.java
View file @
9e41a3f2
...
...
@@ -16,14 +16,15 @@
package
org.genesys2.server.config
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.
Service
;
import
org.springframework.stereotype.
Component
;
/**
* This class provides application properties on JSP pages
*/
@
Service
(
"props"
)
public
class
ApplicationProps
{
@
Component
(
"props"
)
public
class
ApplicationProps
implements
InitializingBean
{
@Value
(
"${paginator.default.pageSize}"
)
private
int
defaulPaginatorPageSize
;
...
...
@@ -37,6 +38,15 @@ public class ApplicationProps {
@Value
(
"${default.admin.email}"
)
private
String
defaultAdminEmail
;
@Value
(
"${tileserver.cdn}"
)
private
String
tileserverCdn
;
@Value
(
"${cdn.server}"
)
private
String
cdnServer
;
@Value
(
"${base.url}"
)
private
String
baseUrl
;
public
int
getDefaulPaginatorPageSize
()
{
return
defaulPaginatorPageSize
;
}
...
...
@@ -56,4 +66,20 @@ public class ApplicationProps {
public
void
setDefaultAdminEmail
(
String
defaultAdminEmail
)
{
this
.
defaultAdminEmail
=
defaultAdminEmail
;
}
public
String
getTileserverCdn
()
{
return
tileserverCdn
;
}
@Override
public
void
afterPropertiesSet
()
throws
Exception
{
}
public
String
getCdnServer
()
{
return
this
.
cdnServer
;
}
public
String
getBaseUrl
()
{
return
baseUrl
;
}
}
src/main/resources/spring/spring.properties
View file @
9e41a3f2
...
...
@@ -47,8 +47,10 @@ itpgrfa.easysmta.password=
google.analytics.account
=
# CDN
cdn.base
=
/html
cdn.flags.url
=
${cdn.base}/flags
cdn.server
=
https://s1.cdn.genesys-pgr.org
cdn.base
=
${cdn.server}
cdn.flags.url
=
${cdn.base}/html/flags
# Content creation on startup
auto.createContent
=
false
...
...
@@ -106,6 +108,11 @@ theme.defaultThemeName=dev
scheduler.tokens.cleanup.hours
=
1
# TileServer CDN
#tileserver.cdn='https://s1'
tileserver.cdn
=
'https://s1.cdn.genesys-pgr.org','https://s2.cdn.genesys-pgr.org','https://s3.cdn.genesys-pgr.org','https://s4.cdn.genesys-pgr.org'
# TileServer Cache
cache.tileserver.max-size
=
1000
cache.tileserver.time-to-live-seconds
=
300
...
...
src/main/webapp/WEB-INF/jsp/accession/map.jsp
View file @
9e41a3f2
...
...
@@ -32,12 +32,11 @@
subdomains
:
[
'
1
'
,
'
2
'
,
'
3
'
,
'
4
'
],
opacity
:
0.6
}).
addTo
(
map
);
L
.
tileLayer
(
"
/explore/tile/{z}/{x}/{y}?filter=
"
+
'
${jsonFilter}
'
,
{
L
.
tileLayer
(
"
{s}
/explore/tile/{z}/{x}/{y}?filter=
"
+
'
${jsonFilter}
'
,
{
attribution
:
"
Genesys
"
,
styleId
:
22677
,
subdomains
:
[
'
1
'
,
'
2
'
,
'
3
'
,
'
4
'
]
subdomains
:
[
$
{
props
.
tileserverCdn
}
]
}).
addTo
(
map
);
//.add(po.image().url("http://a.tile.openstreetmap.org/{Z}/{X}/{Y}.png"))
$
(
"
#selectArea
"
).
hide
();
var
filterJson
=
$
{
jsonFilter
};
...
...
src/test/java/org/genesys2/server/test/ApplicationPropsTest.java
0 → 100644
View file @
9e41a3f2
/**
* Copyright 2014 Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/
package
org.genesys2.server.test
;
import
static
org
.
junit
.
Assert
.
assertTrue
;
import
org.genesys2.server.config.ApplicationProps
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.PropertySource
;
import
org.springframework.test.context.ContextConfiguration
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
@RunWith
(
SpringJUnit4ClassRunner
.
class
)
@ContextConfiguration
(
classes
=
ApplicationPropsTest
.
Config
.
class
,
initializers
=
PropertyPlacholderInitializer
.
class
)
public
class
ApplicationPropsTest
{
@PropertySource
({
"classpath:application.properties"
,
"classpath:/spring/spring.properties"
})
public
static
class
Config
{
@Bean
public
ApplicationProps
applicationProps
()
{
return
new
ApplicationProps
();
}
}
@Autowired
private
ApplicationProps
applicationProps
;
@Test
public
void
testCdn
()
{
assertTrue
(
applicationProps
.
getCdnServer
()
!=
null
);
}
@Test
public
void
testTileserverCdn
()
{
assertTrue
(
applicationProps
.
getTileserverCdn
()
!=
null
);
assertTrue
(
applicationProps
.
getTileserverCdn
().
startsWith
(
"'"
));
assertTrue
(
applicationProps
.
getTileserverCdn
().
endsWith
(
"'"
));
}
}
src/test/java/org/genesys2/server/test/TaxonomyEnsureTest.java
View file @
9e41a3f2
/**
* Copyright 2014 Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
**/
package
org.genesys2.server.test
;
import
static
org
.
junit
.
Assert
.
fail
;
...
...
src/test/resources/application.properties
0 → 100644
View file @
9e41a3f2
#-------------------------------------------------------------------------------
# Copyright 2014 Global Crop Diversity Trust
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#-------------------------------------------------------------------------------
#Paginator
paginator.default.pageSize
=
2
paginator.default.fastStep
=
3
paginator.default.maxPage
=
4
#Admin
default.admin.email
=
admin@example.com
build.name
=
${project.artifactId}-${buildNumber}
build.revision
=
${buildNumber}
src/test/resources/spring/spring.properties
View file @
9e41a3f2
...
...
@@ -40,9 +40,13 @@ itpgrfa.easysmta.password=
google.analytics.account
=
# CDN
cdn.base
=
http://cdn.sandbox.genesys-pgr.org
cdn.server
=
https://s1.cdn.genesys-pgr.org
cdn.base
=
${cdn.server}/html
cdn.flags.url
=
${cdn.base}/flags
# TileServer CDN
tileserver.cdn
=
''
# Content creation on startup
auto.createContent
=
false
...
...
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